@import url("https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700&display=swap");

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: "Manrope", "Inter", "Segoe UI", Arial, sans-serif;
  background: #f6f7fb;
  color: #0f172a;
  line-height: 1.5;
  font-size: 16px;
}

a {
  color: inherit;
  text-decoration: none;
}

.container {
  max-width: 1200px;
  margin: 36px auto;
  padding: 0 20px;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px;
  background: #ffffff;
  border-bottom: 1px solid #eef1f6;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
  flex-wrap: wrap;
  gap: 16px;
  min-height: 72px;
}

.logo-group {
  display: flex;
  gap: 12px;
  align-items: center;
}

.logo-img {
  height: 36px;
  width: auto;
  display: block;
}

.logo-text {
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.01em;
}

.logo-text.secondary {
  font-weight: 600;
  color: #5a6272;
}

.site-nav {
  display: flex;
  gap: 16px;
}

.nav-link {
  padding: 8px 14px;
  border-radius: 999px;
  color: #334155;
  font-weight: 600;
  transition: background 0.2s ease, color 0.2s ease;
}

.nav-link.active {
  background: #e8f0ff;
  color: #1d4ed8;
}

.card {
  background: #ffffff;
  border-radius: 22px;
  padding: 24px;
  box-shadow: 0 20px 48px rgba(15, 23, 42, 0.08);
  margin-bottom: 26px;
  border: 1px solid #eef1f7;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

.week-info {
  font-weight: 600;
  color: #1d4ed8;
  background: #e8f0ff;
  padding: 6px 14px;
  border-radius: 999px;
}

.table-wrapper {
  width: 100%;
  overflow-x: auto;
}

.rating-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 700px;
}

.rating-table th,
.rating-table td {
  text-align: left;
  padding: 14px;
  border-bottom: 1px solid #edf0f6;
  font-size: 14px;
}

.rating-table th {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #7a8494;
}

.rating-table tbody tr:hover {
  background: #f3f7ff;
}

.rank-top-1 {
  background: #fff6d9;
}

.rank-top-2 {
  background: #f3f4f8;
}

.rank-top-3 {
  background: #fff0e5;
}

.rank-risk {
  border-left: 4px solid #ff5b5b;
}

.risk-zone {
  background: rgba(255, 0, 0, 0.18);
}

.admin-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.panel {
  margin-top: 16px;
}

.team-delete-tools {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.team-checklist {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  max-height: 280px;
  overflow: auto;
  border: 1px solid #edf0f6;
  border-radius: 12px;
  padding: 12px;
  background: #ffffff;
}

.team-checklist label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}

.card h1 {
  font-size: 42px;
  font-weight: 700;
}

.card h2 {
  font-size: 24px;
  font-weight: 700;
}

.muted {
  color: #677089;
  font-size: 14px;
}

.shop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.shop-card {
  border: 1px solid #edf0f6;
  border-radius: 18px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: #ffffff;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.shop-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 26px rgba(27, 31, 42, 0.08);
}

.shop-card h3 {
  font-size: 16px;
}

.pill {
  display: inline-block;
  padding: 4px 10px;
  background: #e8f0ff;
  color: #1d4ed8;
  font-size: 12px;
  border-radius: 999px;
}

.primary-btn {
  border: none;
  background: #1d4ed8;
  color: #ffffff;
  padding: 12px 18px;
  border-radius: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.primary-btn:hover {
  background: #1e40af;
}

.primary-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.form {
  display: grid;
  gap: 12px;
}

.form-row {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  align-items: end;
}

.form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: #444b5a;
}

.form input,
.form select,
.form textarea {
  padding: 11px 14px;
  border-radius: 12px;
  border: 1px solid #d8dee9;
  font-size: 14px;
  background: #fbfcff;
}

.form input:focus,
.form select:focus,
.form textarea:focus {
  outline: none;
  border-color: #1d4ed8;
  box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.16);
}

.list {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

.list-item {
  border: 1px solid #edf0f6;
  padding: 12px;
  border-radius: 12px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.list-item .meta {
  font-size: 12px;
  color: #677089;
}

.actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.secondary-btn {
  border: 1px solid #d9deea;
  background: #ffffff;
  color: #1d4ed8;
  padding: 10px 14px;
  border-radius: 12px;
  font-weight: 600;
  cursor: pointer;
}

.danger-btn {
  border: 1px solid #ffb4b4;
  background: #ffe9e9;
  color: #b91c1c;
  padding: 10px 14px;
  border-radius: 12px;
  font-weight: 600;
  cursor: pointer;
}

.success {
  color: #2f9e44;
  font-weight: 600;
}

.error-text {
  color: #b93939;
  margin-top: 8px;
}

.hidden {
  display: none !important;
}

.flash-ok {
  filter: brightness(1.1);
  opacity: 0.85;
}

.flash-bad {
  filter: brightness(0.9);
  opacity: 0.85;
}

.btn--success-flash {
  filter: brightness(1.1);
  opacity: 0.85;
}

.btn--error-flash {
  filter: brightness(0.9);
  opacity: 0.85;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(10, 12, 20, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 50;
}

.modal-content {
  background: #ffffff;
  border-radius: 20px;
  padding: 26px;
  width: 100%;
  max-width: 460px;
  position: relative;
  z-index: 60;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.2);
  max-height: 90vh;
  overflow: auto;
}

.modal-close {
  position: absolute;
  top: 10px;
  right: 12px;
  border: none;
  background: none;
  font-size: 22px;
  cursor: pointer;
  z-index: 70;
  color: #475569;
}

.history-list {
  margin-top: 12px;
  display: grid;
  gap: 8px;
}

.history-item {
  padding: 10px 12px;
  border-radius: 10px;
  background: #f8f9fc;
  font-size: 13px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.rules-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.rule-block {
  padding: 16px;
  border: 1px solid #edf0f6;
  border-radius: 12px;
}

.rule-block h3 {
  margin-bottom: 10px;
}

.rule-block ul {
  list-style: disc;
  padding-left: 18px;
  display: grid;
  gap: 6px;
  font-size: 14px;
}

.site-footer {
  text-align: center;
  padding: 24px;
  font-size: 12px;
  color: #64748b;
}

.admin-link {
  color: #64748b;
  border-bottom: 1px dashed #64748b;
}

@media (max-width: 720px) {
  .card-header {
    flex-direction: column;
    align-items: flex-start;
  }
}
