/* Design tokens (seeded from Figma Shotrun) */
:root {
  /* Palette */
  --bg: #E0E7F2;           /* light slate/blue background */
  --surface: #FFFFFF;      /* cards, inputs */
  --text: #0f172a;         /* slate-900 */
  --muted: #475569;        /* slate-600 */
  --border: #E5E7EB;       /* light border */
  --primary: #F97316;      /* Figma orange (tweakable) */
  --primary-hover: #EA580C;
  --primary-tint: #FFF7ED; /* light orange for active states */

  /* Radii & shadows */
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 6px 20px rgba(15, 23, 42, 0.10);
  /* Typography */
  --ff-base: 'KookFaNum', 'Vazir', ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, "Noto Sans", Ubuntu, Cantarell;
  --fs-body: 16px;   --lh-body: 20px;
  --fs-h1: 28px;     --lh-h1: 36px;
  --fs-h2: 20px;     --lh-h2: 28px;
  --fs-btn: 14px;    --lh-btn: 20px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--ff-base);
  background: var(--bg);
  color: var(--text);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
}
body.student-body {
  min-height: 100vh;
  background: radial-gradient(circle at top, rgba(15, 23, 42, 0.9), rgba(3, 7, 18, 0.98));
  color: #f8fafc;
}
body.student-body a { color: #f97316; }
body.student-body a:hover { color: #fdba74; }

body.coach-body {
  min-height: 100vh;
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 20%, #e0f2fe 70%, #f1f5f9 100%);
  color: #0f172a;
}
body.coach-body .container {
  max-width: 1160px;
  margin: 36px auto 56px;
  padding: 0 20px;
}
/* Ensure controls and links inherit the app font */
button, input, select, textarea, a { font: inherit; font-family: inherit; }
/* Explicitly set on key UI elements */
.sidebar .side-link, .btn-sm, .tab, .topbar a, .card, label { font-family: var(--ff-base); }

/* Local Vazir font (optional: add files to coach-student-app/fonts/) */
@font-face {
  font-family: 'Vazir';
  src: url('fonts/Vazir-FD.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Vazir';
  src: url('fonts/Vazir-Bold-FD.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* Optional: local KookFaNum if available */
@font-face {
  font-family: 'KookFaNum';
  src: url('fonts/KookFaNum-Bold.woff2') format('woff2');
  font-weight: 400; /* map normal weight to bold file by request */
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'KookFaNum';
  src: url('fonts/KookFaNum-Bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

.container {
  max-width: 1180px;
  margin: 32px auto 48px;
  padding: 0 24px;
}
body.student-body .container {
  max-width: 900px;
  margin: 40px auto 56px;
  padding: 0 20px;
}

.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.topbar a { color: var(--primary); text-decoration: none; }
.topbar a:hover { color: var(--primary-hover); }
.coach-header { gap: 20px; }
.coach-header .header-user { display: flex; align-items: center; gap: 14px; }
body.student-body .topbar { margin-bottom: 24px; }
body.student-body .topbar a { color: #f97316; }
body.sidebar-open { overflow: hidden; }

.logo-mark {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(249, 115, 22, 0.12);
  color: #f97316;
  font-size: 22px;
}
body.coach-body .logo-mark {
  background: rgba(37, 99, 235, 0.15);
  color: #2563eb;
}
body.coach-body .topbar { margin-bottom: 28px; }
body.coach-body .topbar a { color: #2563eb; }

.logo-mark-img {
  width: 56px;
  height: 56px;
  border-radius: 18px;
  background: rgba(249, 115, 22, 0.12);
  padding: 8px;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.25);
}
.header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}
.header-actions .top-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.top-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.3);
  background: rgba(15, 23, 42, 0.35);
  color: #f8fafc;
  font-size: 13px;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}
.top-action:hover {
  border-color: rgba(249, 115, 22, 0.6);
  background: rgba(249, 115, 22, 0.18);
  color: #f97316;
}
.top-action:active { transform: translateY(1px) scale(0.98); }
.top-action.danger {
  background: rgba(220, 38, 38, 0.3);
  border-color: rgba(239, 68, 68, 0.55);
  color: #fecaca;
}
.top-action.danger:hover {
  background: rgba(220, 38, 38, 0.42);
  color: #fee2e2;
}
.top-action:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.25);
}
.top-action:disabled {
  opacity: 0.5;
  cursor: default;
  pointer-events: none;
}
.header-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(248, 250, 252, 0.35);
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.35);
}
.mobile-menu-btn {
  display: none;
  width: 44px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(15, 23, 42, 0.4);
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 6px;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.mobile-menu-btn span {
  width: 22px;
  height: 2px;
  background: #f8fafc;
  border-radius: 999px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.mobile-menu-btn[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}
.mobile-menu-btn[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}
.mobile-menu-btn[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}
.en-digit-hint {
  font-size: 13px;
  color: rgba(148, 163, 184, 0.85);
}
.calc-mode {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}
.radio-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(15, 23, 42, 0.45);
  cursor: pointer;
  font-size: 13px;
  transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}
.radio-pill input {
  display: none;
}
.radio-pill.active {
  border-color: rgba(249, 115, 22, 0.6);
  background: rgba(249, 115, 22, 0.18);
}
.radio-pill.active span {
  color: #f97316;
  font-weight: 600;
}
.radio-pill input:checked + span {
  color: #f97316;
  font-weight: 600;
}
.radio-pill span {
  pointer-events: none;
}

/* Global anchor color */
a { color: var(--primary); }
a:hover { color: var(--primary-hover); }

h1 { font-size: var(--fs-h1); line-height: var(--lh-h1); margin: 8px 0 18px; }
h2 { font-size: var(--fs-h2); line-height: var(--lh-h2); margin: 0 0 12px; }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 18px;
}
body.student-body .card {
  background: rgba(15, 23, 42, 0.82);
  border-color: rgba(148, 163, 184, 0.18);
  box-shadow: 0 24px 60px rgba(2, 6, 23, 0.6);
}
body.student-body .card h2 { color: #f8fafc; }
body.student-body .card p { color: rgba(226, 232, 240, 0.72); }
body.student-body .note { color: rgba(226, 232, 240, 0.75); }
.student-alert {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.student-alert .alert-body { flex: 1 1 auto; }
.student-alert .alert-icon {
  font-size: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
}
.student-alert .alert-close {
  background: transparent;
  border: 1px solid rgba(148, 163, 184, 0.25);
  color: inherit;
  border-radius: var(--radius-sm);
  padding: 4px 8px;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}
.student-alert .alert-close:hover {
  border-color: rgba(248, 250, 252, 0.6);
  background: rgba(148, 163, 184, 0.2);
  transform: translateY(-1px);
}
.auth-alert {
  margin: 12px 0;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}
.auth-alert[data-variant="danger"] {
  border-color: rgba(239, 68, 68, 0.5);
  background: rgba(254, 226, 226, 0.65);
  color: #b91c1c;
}
.auth-alert[data-variant="success"] {
  border-color: rgba(16, 185, 129, 0.45);
  background: rgba(209, 250, 229, 0.7);
  color: #065f46;
}
.auth-alert[data-variant="info"] {
  border-color: rgba(59, 130, 246, 0.45);
  background: rgba(219, 234, 254, 0.7);
  color: #1d4ed8;
}

body.student-body .student-alert {
  border-radius: var(--radius-md);
  padding: 12px 16px;
  margin-top: 16px;
  font-size: 14px;
  background: rgba(59, 130, 246, 0.15);
  color: #bfdbfe;
  border: 1px solid rgba(59, 130, 246, 0.35);
}
body.student-body .student-alert[data-variant="success"] {
  background: rgba(34, 197, 94, 0.15);
  color: #bbf7d0;
  border-color: rgba(34, 197, 94, 0.35);
}
body.student-body .student-alert[data-variant="danger"] {
  background: rgba(248, 113, 113, 0.18);
  color: #fecaca;
  border-color: rgba(248, 113, 113, 0.4);
}
body.student-body .student-alert[data-variant="warning"] {
  background: rgba(250, 204, 21, 0.18);
  color: #fef9c3;
  border-color: rgba(250, 204, 21, 0.4);
}
body.student-body .student-alert[data-variant="info"] {
  background: rgba(59, 130, 246, 0.15);
  color: #bfdbfe;
  border-color: rgba(59, 130, 246, 0.35);
}
body.student-body .student-alert .alert-close {
  border-color: rgba(203, 213, 225, 0.25);
}
body.student-body .student-alert strong { display: block; margin-bottom: 4px; }
body.student-body .student-alert a { color: #fde68a; }
body.student-body .student-alert a:hover { color: #facc15; }

.program-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0 10px;
  flex-wrap: wrap;
}
.program-toolbar label {
  font-size: 13px;
  color: rgba(226, 232, 240, 0.75);
}
.program-toolbar select {
  background: rgba(15, 23, 42, 0.75);
  color: #f8fafc;
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
}

body.coach-body .card {
  background: rgba(255, 255, 255, 0.92);
  border-color: rgba(148, 163, 184, 0.25);
  box-shadow: 0 20px 45px rgba(148, 163, 184, 0.3);
}
body.coach-body .card h2 { color: #0f172a; }
body.coach-body .note { color: #475569; }
.card:hover { box-shadow: var(--shadow-md); }
.card h2 { margin-top: 0; }
.card p { color: var(--muted); margin: 6px 0 0; }
.card a { color: inherit; text-decoration: none; display: block; }
/* Specific spacing for student login + app area */
.login-card { margin-bottom: 20px; }
#appArea { margin-top: 20px; }

.panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.panel-view {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-top: 20px;
}
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
}
.metric-card {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.metric-title {
  font-size: 14px;
  color: var(--muted);
}
.metric-value {
  font-size: 28px;
  font-weight: 600;
  color: var(--text);
}
.panel-block {
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.panel-block .list { margin: 0; }
.panel-block h3 { margin: 0; font-size: 18px; }
.quick-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.chip-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.14);
  background: #fff;
  color: var(--text);
  padding: 6px 14px;
  text-decoration: none;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}
.chip-link:hover,
.chip-link:focus-visible {
  background: var(--primary-tint);
  color: var(--primary);
  box-shadow: 0 0 0 1px rgba(249, 115, 22, 0.25);
}
.chip-link[hidden] { display: none !important; }
button.chip-link:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.auth-tabs {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}
body.student-body .auth-tabs {
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 16px;
  padding: 6px;
}
.auth-tab {
  flex: 1;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-weight: 600;
}
.auth-tab:hover,
.auth-tab:focus-visible {
  border-color: var(--primary);
  color: var(--primary);
}
.auth-tab.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
}
body.coach-body .auth-tab.active {
  background: rgba(37, 99, 235, 0.15);
  border-color: rgba(37, 99, 235, 0.6);
  color: #2563eb;
}
body.student-body .auth-tab { color: rgba(226, 232, 240, 0.75); border-color: rgba(148, 163, 184, 0.2); }
body.student-body .auth-tab:hover,
body.student-body .auth-tab:focus-visible {
  border-color: rgba(249,115,22,0.8);
  color: #f97316;
}
body.student-body .auth-tab.active {
  background: rgba(249,115,22,0.18);
  border-color: rgba(249,115,22,0.9);
  color: #f97316;
}
.assign-tabs {
  display: inline-flex;
  gap: 8px;
  margin: 12px 0 18px;
  flex-wrap: wrap;
}
.assign-tab {
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(248, 250, 252, 0.95);
  color: #1f2937;
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  cursor: pointer;
  font-weight: 600;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.assign-tab:hover,
.assign-tab:focus-visible {
  border-color: var(--primary);
  color: var(--primary);
}
.assign-tab.active {
  background: var(--primary-tint);
  border-color: var(--primary);
  color: var(--primary);
}
body.coach-body .assign-tab {
  background: rgba(255, 255, 255, 0.95);
  color: #0f172a;
}
body.coach-body .assign-tab.active {
  background: rgba(37, 99, 235, 0.12);
  border-color: rgba(37, 99, 235, 0.55);
  color: #2563eb;
}
.assign-section { margin-bottom: 16px; }
.assign-section__title { font-weight: 600; margin-bottom: 8px; color: var(--text); }
.assign-checklist {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 240px;
  padding: 10px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: var(--radius-md);
  background: rgba(248, 250, 252, 0.92);
  overflow-y: auto;
}
.assign-checklist::-webkit-scrollbar { width: 6px; }
.assign-checklist::-webkit-scrollbar-thumb { background: rgba(148, 163, 184, 0.4); border-radius: 999px; }
.assign-check-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 14px;
}
.assign-check-item input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin-top: 2px;
}
.assign-check-text { display: flex; flex-direction: column; gap: 2px; }
.assign-check-text small { color: var(--muted); font-size: 12px; }
body.coach-body .assign-checklist {
  background: rgba(255, 255, 255, 0.95);
  border-color: rgba(148, 163, 184, 0.3);
}

.program-card {
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: var(--radius-lg);
  padding: 20px;
  background: rgba(248, 250, 252, 0.96);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 18px;
}
body.student-body .program-card {
  background: rgba(15, 23, 42, 0.82);
  border-color: rgba(148, 163, 184, 0.25);
  box-shadow: 0 24px 60px rgba(2, 6, 23, 0.55);
}
.program-card-header h3 {
  margin: 0;
  font-size: 18px;
}
.program-card-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}
.program-card-header > div:first-child {
  flex: 1;
}
.program-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.program-card-header p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 14px;
}
.program-card-header .program-meta {
  display: flex;
  gap: 12px;
  font-size: 13px;
  color: var(--muted);
  margin-top: 6px;
}
.program-card-updated {
  border-color: rgba(250, 204, 21, 0.6) !important;
  box-shadow: 0 0 0 2px rgba(250, 204, 21, 0.18);
}
body.student-body .program-card-updated {
  border-color: rgba(250, 204, 21, 0.7) !important;
  box-shadow: 0 0 0 2px rgba(250, 204, 21, 0.28);
}
body.student-body .program-card-header p { color: rgba(226, 232, 240, 0.75); }
body.student-body .program-card-header .program-meta { color: rgba(226, 232, 240, 0.7); }
.program-week {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.program-week-row {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px 18px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.95);
  font-size: 13px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
  position: relative;
  overflow: hidden;
}
.program-week-row.today {
  border-color: rgba(249, 115, 22, 0.75);
  box-shadow: 0 12px 30px rgba(249, 115, 22, 0.18);
}
.program-week-row.done {
  border-color: rgba(22, 163, 74, 0.65);
  box-shadow: 0 18px 40px rgba(22, 163, 74, 0.22);
  background: linear-gradient(135deg, rgba(240, 253, 244, 0.95), rgba(187, 247, 208, 0.85));
}
.program-week-row.pending {
  border-color: rgba(148, 163, 184, 0.35);
  background: linear-gradient(135deg, rgba(255,255,255,0.96), rgba(241,245,249,0.9));
}
.program-week-row.done::before,
.program-week-row.pending::before {
  content: '';
  position: absolute;
  inset-block: 0;
  inset-inline-start: 0;
  width: 5px;
  border-radius: 999px;
}
.program-week-row.done::before {
  background: linear-gradient(180deg, #16a34a, #4ade80);
}
.program-week-row.pending::before {
  background: linear-gradient(180deg, rgba(148,163,184,0.6), rgba(148,163,184,0.35));
}
.program-week-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
}
.program-week-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 14px;
}
.program-week-day {
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.05);
  color: var(--text);
  font-size: 12px;
}
.program-week-date {
  font-size: 12px;
  color: var(--muted);
}
.program-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 12px;
  transition: background 0.2s ease, color 0.2s ease;
}
.program-badge--done {
  background: rgba(22, 163, 74, 0.18);
  color: #166534;
}
.program-badge--pending {
  background: rgba(148, 163, 184, 0.18);
  color: rgba(71, 85, 105, 0.9);
}
body.student-body .program-badge {
  background: rgba(34, 197, 94, 0.35);
  color: #bbf7d0;
}
.program-week-state {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.4);
  background: rgba(248, 250, 252, 0.92);
  font-size: 12px;
}
.status-pill.pending {
  background: rgba(248, 250, 252, 0.92);
  color: var(--muted);
}
.status-pill.done {
  border-color: rgba(34, 197, 94, 0.55);
  background: rgba(34, 197, 94, 0.16);
  color: #15803d;
}
.status-pill.mood {
  border-color: rgba(79, 70, 229, 0.25);
  background: rgba(79, 70, 229, 0.12);
  color: rgba(79, 70, 229, 0.95);
}
.program-week-body {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}
.program-week-content {
  flex: 1 1 60%;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.program-week-row.done .program-week-content {
  color: #166534;
}
.program-week-row.done .program-week-desc,
.program-week-row.done .program-week-metrics {
  color: #166534;
}
.program-week-toggle {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: center;
}
.program-check {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-weight: 600;
  color: var(--muted);
  transition: color 0.2s ease, opacity 0.2s ease;
  border: none;
  background: transparent;
  padding: 6px 12px;
  border-radius: var(--radius-md);
}
.program-check:disabled {
  cursor: wait;
  opacity: 0.6;
}
.program-check .check-box {
  width: 24px;
  height: 24px;
  border-radius: 8px;
  border: 2px solid rgba(148, 163, 184, 0.45);
  background: rgba(255, 255, 255, 0.95);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: transparent;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.program-check .check-box::after {
  content: '';
  transition: opacity 0.2s ease;
}
.program-check.checked .check-box {
  border-color: rgba(22, 163, 74, 0.95);
  background: rgba(22, 163, 74, 0.95);
  color: #fff;
}
.program-check.checked .check-box::after {
  content: '✓';
  color: inherit;
}
.program-check .check-label {
  font-size: 13px;
}
.program-check.checked .check-label {
  color: #166534;
}
.program-message {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: rgba(22, 163, 74, 0.12);
  color: #166534;
  display: block;
}
.program-message .program-message-text {
  font-size: 13px;
  line-height: 1.5;
}
.program-message .program-message-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-inline-start: 8px;
  padding: 0 10px;
  height: 26px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(22, 163, 74, 0.4);
  color: #166534;
  text-decoration: none;
  font-size: 12px;
  font-weight: 600;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.program-message .program-message-link:hover {
  border-color: rgba(22, 163, 74, 0.7);
  background: rgba(22, 163, 74, 0.08);
}
.program-message .program-message-link::after {
  content: '↗';
  font-size: 11px;
}
.program-week-desc {
  line-height: 1.6;
}
.program-week-metrics {
  font-size: 12px;
  color: var(--muted);
}
.program-week-note {
  font-size: 12px;
  color: var(--muted);
  background: rgba(148, 163, 184, 0.12);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
}
.program-group {
  margin-bottom: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.program-group-title {
  margin: 0;
  font-size: 18px;
  color: rgba(15, 23, 42, 0.85);
}
.program-group-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
body.student-body .program-group-title {
  color: rgba(248, 250, 252, 0.92);
}
@media (max-width: 600px) {
  .program-week-row {
    padding: 14px;
  }
  .program-week-body {
    flex-direction: column;
    align-items: stretch;
  }
  .program-week-actions {
    align-items: stretch;
    min-width: 0;
  }
  .program-week-actions .status-switch {
    justify-content: center;
  }
}
body.student-body .program-week-row {
  background: rgba(15, 23, 42, 0.55);
  border-color: rgba(148, 163, 184, 0.3);
}
body.student-body .program-week-row.today {
  border-color: rgba(249, 115, 22, 0.8);
  box-shadow: 0 12px 30px rgba(249, 115, 22, 0.25);
}
body.student-body .program-week-row.done {
  border-color: rgba(34, 197, 94, 0.85);
  box-shadow: 0 20px 45px rgba(34, 197, 94, 0.35);
  background: linear-gradient(135deg, rgba(7, 31, 18, 0.92), rgba(17, 64, 33, 0.88));
}
body.student-body .program-week-row.done::before {
  background: linear-gradient(180deg, rgba(34, 197, 94, 0.9), rgba(22, 163, 74, 0.7));
}
body.student-body .program-week-row.pending {
  border-color: rgba(82, 82, 91, 0.6);
  background: rgba(15, 23, 42, 0.75);
}
body.student-body .program-week-row.pending::before {
  background: linear-gradient(180deg, rgba(82, 82, 91, 0.9), rgba(82, 82, 91, 0.4));
}
body.student-body .program-badge--done {
  background: rgba(34, 197, 94, 0.35);
  color: #bbf7d0;
}
body.student-body .program-badge--pending {
  background: rgba(71, 85, 105, 0.5);
  color: rgba(226, 232, 240, 0.85);
}
body.student-body .program-week-day {
  background: rgba(248, 250, 252, 0.12);
  color: rgba(248, 250, 252, 0.95);
}
body.student-body .program-week-date {
  color: rgba(226, 232, 240, 0.7);
}
[...]
body.student-body .status-pill {
  border-color: rgba(148, 163, 184, 0.3);
  background: rgba(15, 23, 42, 0.6);
  color: rgba(226, 232, 240, 0.88);
}
body.student-body .status-pill.done {
  border-color: rgba(34, 197, 94, 0.6);
  background: rgba(34, 197, 94, 0.18);
  color: #bbf7d0;
}
body.student-body .status-pill.mood {
  border-color: rgba(147, 197, 253, 0.35);
  background: rgba(59, 130, 246, 0.22);
  color: #bfdbfe;
}
.program-check.checked .check-label {
  color: #166534;
}
body.student-body .program-check {
  color: rgba(226, 232, 240, 0.72);
}
body.student-body .program-check .check-box {
  border-color: rgba(148, 163, 184, 0.45);
  background: rgba(15, 23, 42, 0.8);
  color: transparent;
}
body.student-body .program-check.checked .check-box {
  border-color: rgba(34, 197, 94, 0.9);
  background: rgba(34, 197, 94, 0.95);
  color: #052e16;
}
body.student-body .program-check.checked .check-box::after {
  color: #052e16;
}
body.student-body .program-check .check-label {
  color: rgba(226, 232, 240, 0.8);
}
body.student-body .program-check.checked .check-label {
  color: #bbf7d0;
}
body.student-body .program-message {
  background: rgba(34, 197, 94, 0.25);
  color: #bbf7d0;
}
body.student-body .program-message .program-message-link {
  border-color: rgba(34, 197, 94, 0.6);
  color: #bbf7d0;
}
body.student-body .program-message .program-message-link:hover {
  background: rgba(34, 197, 94, 0.15);
  border-color: rgba(74, 222, 128, 0.9);
}
body.student-body .program-week-metrics {
  color: rgba(226, 232, 240, 0.72);
}
body.student-body .program-week-note {
  background: rgba(148, 163, 184, 0.2);
  color: rgba(226, 232, 240, 0.8);
}
.program-week-desc { white-space: pre-wrap; line-height: 1.6; }
.program-week-desc .muted { color: var(--muted); }
.status-switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 12px;
}
.status-switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.status-switch .switch-track {
  position: relative;
  width: 56px;
  height: 30px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.35);
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 6px;
  transition: background 0.25s ease;
}
.status-switch .switch-emoji {
  font-size: 16px;
  opacity: 0.35;
  transition: opacity 0.25s ease;
}
.status-switch .switch-handle {
  position: absolute;
  top: 3px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.25);
  transform: translateX(0);
  transition: transform 0.25s ease;
}
.status-switch input:checked + .switch-track {
  background: linear-gradient(135deg, #f97316, #fb923c);
}
.status-switch input:checked + .switch-track .switch-handle {
  transform: translateX(26px);
}
.status-switch input:checked + .switch-track .switch-emoji.on,
.status-switch input:not(:checked) + .switch-track .switch-emoji.off {
  opacity: 1;
}
.status-switch .switch-caption {
  font-weight: 600;
  color: var(--muted);
}
.status-switch.done .switch-caption {
  color: #15803d;
}
.status-switch input:focus-visible + .switch-track {
  box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.25);
}
body.student-body .status-switch .switch-track {
  background: rgba(148, 163, 184, 0.3);
}
body.student-body .status-switch input:checked + .switch-track {
  background: linear-gradient(135deg, #22c55e, #16a34a);
}
body.student-body .status-switch .switch-caption {
  color: rgba(226, 232, 240, 0.85);
}
body.student-body .status-switch.done .switch-caption {
  color: #bbf7d0;
}
.note-reminder {
  margin-bottom: 16px;
}
.note-reminder a {
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
}
.note-reminder a:hover {
  text-decoration: underline;
}
.profile-reminder {
  margin-top: 8px;
  font-size: 13px;
}
body.student-body .profile-reminder strong {
  color: #fef3c7;
}
body.modal-open {
  overflow: hidden;
}
.completion-modal {
  position: fixed;
  inset: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 3000;
}
.completion-modal[hidden] {
  display: none;
}
.completion-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
}
.completion-dialog {
  position: relative;
  max-width: 360px;
  width: 90%;
  background: rgba(15, 23, 42, 0.96);
  border-radius: 18px;
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: 0 24px 60px rgba(2, 6, 23, 0.55);
  color: #f8fafc;
}
.completion-dialog h3 {
  margin: 0;
  font-size: 20px;
  text-align: center;
}
.completion-text {
  margin: 0;
  text-align: center;
  line-height: 1.8;
  color: rgba(226, 232, 240, 0.85);
}
.completion-icon {
  font-size: 40px;
  text-align: center;
}
.completion-close {
  position: absolute;
  inset-inline-end: 10px;
  inset-block-start: 8px;
  background: transparent;
  border: none;
  color: rgba(226, 232, 240, 0.8);
  font-size: 20px;
  cursor: pointer;
}
.completion-close:hover {
  color: #f8fafc;
}
.completion-dialog .btn-primary {
  margin-top: 0;
}
.celebrate-pop {
  position: fixed;
  inset-inline-start: 50%;
  inset-block-start: 16px;
  transform: translateX(-50%) scale(0.9);
  opacity: 0;
  z-index: 2000;
  padding: 12px 20px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.18);
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 600;
  color: var(--text);
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.celebrate-pop.show {
  opacity: 1;
  transform: translateX(-50%) scale(1);
}
.celebrate-pop .celebrate-icon {
  font-size: 26px;
}
.celebrate-pop .celebrate-text {
  font-size: 15px;
}
body.student-body .celebrate-pop {
  background: rgba(15, 23, 42, 0.9);
  color: #fef3c7;
  box-shadow: 0 18px 40px rgba(2, 6, 23, 0.35);
}
.log-tabs {
  display: flex;
  gap: 8px;
  margin: 12px 0 18px;
  flex-wrap: wrap;
}
.log-tab {
  border: 1px solid var(--border);
  background: #fff;
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  cursor: pointer;
  font-weight: 600;
  color: var(--muted);
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.log-tab:hover,
.log-tab:focus-visible {
  border-color: var(--primary);
  color: var(--primary);
}
.log-tab.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
body.student-body .log-tab {
  background: rgba(15, 23, 42, 0.6);
  border-color: rgba(148, 163, 184, 0.32);
  color: rgba(226, 232, 240, 0.85);
}
body.student-body .log-tab:hover,
body.student-body .log-tab:focus-visible {
  border-color: rgba(96, 165, 250, 0.7);
  color: #bfdbfe;
}
body.student-body .log-tab.active {
  background: rgba(37, 99, 235, 0.45);
  border-color: rgba(96, 165, 250, 0.85);
  color: #f8fafc;
}
.log-view[hidden] {
  display: none !important;
}
.log-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 18px;
  padding: 18px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
body.student-body .log-section {
  background: rgba(15, 23, 42, 0.62);
  border-color: rgba(148, 163, 184, 0.22);
  box-shadow: 0 18px 45px rgba(2, 6, 23, 0.45);
}
.log-section .section-subtitle {
  margin-bottom: 0;
  font-size: 14px;
  opacity: 0.9;
}
.log-section .form-grid {
  margin-top: 6px;
}
.log-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-top: 6px;
}
.log-selected-date {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--primary-tint);
  color: var(--primary);
  font-size: 13px;
  font-weight: 600;
}
body.student-body .log-selected-date {
  background: rgba(37, 99, 235, 0.2);
  color: #bfdbfe;
}
.log-history {
  margin-top: 12px;
}
.program-quick-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  margin: 12px 0;
  flex-wrap: wrap;
}
.program-quick-actions .btn-ghost { margin-top: 0; }
.log-view[data-log-view="charts"] .charts-grid {
  margin-bottom: 12px;
}
.profile-shoe-manager {
  border: 1px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  background: rgba(15, 23, 42, 0.03);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
body.student-body .profile-shoe-manager {
  background: rgba(15, 23, 42, 0.5);
  border-color: rgba(148, 163, 184, 0.25);
}
.shoe-input-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.shoe-input-row input {
  flex: 1 1 240px;
}
.shoe-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 32px;
}
.shoe-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 6px 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 14px;
}
body.student-body .shoe-chip {
  background: rgba(15, 23, 42, 0.7);
  border-color: rgba(148, 163, 184, 0.3);
  color: rgba(226, 232, 240, 0.9);
}
.shoe-chip-remove {
  border: none;
  background: transparent;
  color: inherit;
  font-size: 16px;
  cursor: pointer;
  line-height: 1;
  padding: 0;
}
.shoe-chip-remove:hover {
  color: var(--primary);
}
.goal-time-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px;
  background: rgba(248, 250, 252, 0.8);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.goal-time-inline {
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
}
.goal-time-inline .time-group {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
}
.goal-time-inline .time-group label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
}
.goal-time-inline .time-group label span {
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
}
body.student-body .goal-time-inline .time-group label span {
  color: rgba(226, 232, 240, 0.85);
}
.goal-time-inline .time-group label input {
  width: 64px;
  text-align: center;
}
.goal-time-inline .goal-time-title {
  flex: 0 0 auto;
  white-space: nowrap;
  margin: 0;
}
body.student-body .goal-time-card {
  background: rgba(15, 23, 42, 0.6);
  border-color: rgba(148, 163, 184, 0.25);
}
.goal-time-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}
body.student-body .goal-time-title {
  color: rgba(226, 232, 240, 0.85);
}
.hr-history {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.hr-history-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.hr-history-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  background: var(--surface);
}
body.student-body .hr-history-card {
  background: rgba(15, 23, 42, 0.7);
  border-color: rgba(148, 163, 184, 0.25);
  color: rgba(226, 232, 240, 0.9);
}
.hr-history-meta {
  font-size: 12px;
  color: var(--muted);
}
body.student-body .hr-history-meta {
  color: rgba(203, 213, 225, 0.8);
}
.hr-history-zones {
  margin-top: 6px;
  display: grid;
  gap: 4px;
}
.hr-history-empty {
  color: var(--muted);
  font-size: 14px;
}
.form-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-top: 12px;
}
.log-view .preview-box {
  margin: 0;
}
.log-meta-row .preview-box {
  flex: 1 1 200px;
}
.btn-link {
  background: none;
  border: none;
  padding: 0;
  color: var(--primary);
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
}
.btn-link:hover { text-decoration: underline; }
body.student-body .btn-link { color: #f97316; }
.auth-view[hidden] {
  display: none !important;
}
.auth-view button {
  width: 100%;
}
.auth-view form + form {
  border-top: 1px dashed var(--border);
  padding-top: 14px;
  margin-top: 14px;
}
.auth-views {
  display: flex;
  flex-direction: column;
  gap: 24px;
  margin-bottom: 12px;
}
body.student-body .auth-views {
  background: rgba(15, 23, 42, 0.35);
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 18px;
  padding: 18px;
  backdrop-filter: blur(4px);
}

.modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(2px);
  z-index: 999;
}
.modal[hidden] {
  display: none !important;
}
.modal.open {
  animation: modalFade 0.25s ease;
}
.modal-content {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 24px;
  max-width: 420px;
  width: calc(100% - 32px);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border);
  color: var(--text);
  text-align: center;
}
.modal-content p { margin: 0; white-space: pre-line; }
.modal[data-variant="success"] .modal-content {
  border-color: #22c55e;
  color: #166534;
}
.modal[data-variant="danger"] .modal-content {
  border-color: #ef4444;
  color: #991b1b;
}
.modal[data-variant="info"] .modal-content {
  border-color: var(--border);
}
.modal-actions {
  margin-top: 16px;
  display: flex;
  justify-content: center;
}
.modal-actions button {
  min-width: 120px;
}

@keyframes modalFade {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

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

label { display: block; font-size: 14px; color: var(--muted); margin: 6px 0 6px; }
input, textarea, select {
  width: 100%;
  padding: 11px 13px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(249,115,22,0.08);
}
input.is-output {
  background: rgba(248, 250, 252, 0.6);
  border-style: dashed;
}
body.student-body input.is-output {
  background: rgba(15, 23, 42, 0.55);
  color: rgba(226, 232, 240, 0.88);
  border-color: rgba(148, 163, 184, 0.35);
}

button {
  margin-top: 12px;
  background: var(--primary);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-md);
  padding: 10px 14px;
  font-weight: 700;
  font-size: var(--fs-btn);
  line-height: var(--lh-btn);
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}
button:not(.password-toggle):hover { background: var(--primary-hover); transform: translateY(-1px); }
button:active { transform: translateY(0); }
body.student-body button { font-weight: 600; letter-spacing: 0.2px; }
.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  border: 1px dashed var(--border);
  background: transparent;
  color: var(--primary);
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}
.btn-ghost:hover,
.btn-ghost:focus-visible {
  border-color: var(--primary);
  background: var(--primary-tint);
  color: var(--primary-hover);
}
body.student-body .btn-ghost {
  border-color: rgba(249,115,22,0.55);
  color: #f97316;
  background: rgba(15,23,42,0.45);
}
body.student-body .btn-ghost:hover,
body.student-body .btn-ghost:focus-visible {
  border-color: rgba(249,115,22,0.85);
  background: rgba(249,115,22,0.2);
  color: #fbbf24;
}
.btn-primary {
  margin-top: 12px;
  background: linear-gradient(135deg, #f97316, #fb923c);
  color: #fff;
  border: none;
  border-radius: 14px;
  padding: 12px 14px;
  font-weight: 700;
  box-shadow: 0 14px 32px rgba(249, 115, 22, 0.35);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 18px 36px rgba(249, 115, 22, 0.42); }
.btn-primary:active { transform: translateY(0); }

.btn-outline {
  margin-top: 12px;
  background: transparent;
  color: var(--text);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  border: 1px solid rgba(148, 163, 184, 0.6);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}
.btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(249, 115, 22, 0.08);
}
body.coach-body .btn-outline { color: #1f2937; border-color: rgba(148, 163, 184, 0.6); }
body.coach-body .btn-outline:hover { color: #2563eb; border-color: rgba(37, 99, 235, 0.7); background: rgba(37, 99, 235, 0.08); }

.list { margin-top: 10px; display: grid; gap: 12px; }
.item {
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.calc-result {
  background: rgba(255, 255, 255, 0.95);
  color: #0f172a;
  border-color: rgba(148, 163, 184, 0.35);
}
.calc-result .muted { color: #475569 !important; }
.calc-result strong { color: #0f172a; }

.muted { color: var(--muted); font-size: 13px; }
.note { color: var(--muted); font-size: 13px; }

.stack { display: flex; flex-direction: column; gap: 12px; }
.stack-lg { gap: 18px; }
.form-stack { display: flex; flex-direction: column; gap: 12px; }
.form-inline { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.form-inline label { flex: 1 1 220px; display: flex; flex-direction: column; gap: 6px; }
.form-inline button { flex: 0 0 auto; }

.password-input {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}
.password-input input {
  width: 100%;
  padding-inline: 12px;
}
.password-toggle {
  position: static;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border: none;
  background: transparent;
  color: rgba(226, 232, 240, 0.8);
  cursor: pointer;
  padding: 0;
  transition: color 0.2s ease, transform 0.2s ease;
  padding: 2px;
}
.password-toggle svg { width: 18px; height: 18px; fill: currentColor; }
.password-toggle:hover { color: #f97316; }
.password-toggle:active { transform: scale(0.92); }
.password-toggle:focus-visible { outline: none; }
.password-toggle[aria-pressed="true"] { color: #f97316; }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; }

.row-between { display: flex; justify-content: space-between; gap: 12px; align-items: center; }

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

.footer { margin-top: 16px; display: flex; justify-content: flex-end; }

/* Tabs */
.tabs { display: flex; gap: 8px; border-bottom: 1px solid var(--border); margin: -4px -4px 12px; padding: 4px; }
.tab { background: transparent; border: 1px solid transparent; color: var(--text); margin: 0; padding: 8px 10px; border-radius: 8px; cursor: pointer; }
.tab.active { border-color: var(--primary); background: var(--primary-tint); }

.payment { display: flex; align-items: center; gap: 12px; }
.payment .thumb { width: 64px; height: 64px; object-fit: cover; border-radius: var(--radius-sm); border: 1px solid var(--border); background: #f8fafc; }
.payment-meta { display: grid; gap: 2px; }

/* Avatar */
.avatar { width: 96px; height: 96px; object-fit: cover; border-radius: 50%; border: 1px solid var(--border); background: #f8fafc; }
.avatar-sm { width: 40px; height: 40px; object-fit: cover; border-radius: 50%; border: 1px solid var(--border); background: #f8fafc; }
.header-user { display: flex; align-items: center; gap: 8px; }

body.student-body .mobile-nav {
  position: fixed;
  inset-inline: 0;
  bottom: 0;
  z-index: 20;
  display: none;
  background: rgba(15, 23, 42, 0.92);
  border-top: 1px solid rgba(148, 163, 184, 0.35);
  backdrop-filter: blur(8px);
  box-shadow: 0 -8px 20px rgba(2, 6, 23, 0.35);
  padding: 8px 12px calc(env(safe-area-inset-bottom) + 8px);
  gap: 8px;
  justify-content: space-around;
}
body.student-body .mobile-nav-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  border: none;
  background: transparent;
  color: rgba(226, 232, 240, 0.8);
  font-size: 12px;
  padding: 6px 4px;
  border-radius: var(--radius-md);
}
body.student-body .mobile-nav-btn span { font-size: 16px; }
body.student-body .mobile-nav-btn.active {
  background: rgba(249, 115, 22, 0.18);
  color: #f97316;
}
body.student-body .mobile-nav-btn:active { transform: scale(0.98); }
/* Goals */
.milestones { display: grid; gap: 6px; margin-top: 8px; }
.milestone { display: flex; gap: 8px; align-items: center; font-size: 14px; }
.milestone .done { text-decoration: line-through; color: var(--muted); }
.mini { display: flex; gap: 8px; margin-top: 8px; }
.mini input { flex: 1; }

.j-month { position: relative; display: flex; gap: 8px; }
.j-month input[type="text"] { flex: 1; cursor: pointer; }
.j-month button { margin-top: 0; }
.j-popup { position: absolute; top: 100%; inset-inline-start: 0; z-index: 10; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 8px; box-shadow: var(--shadow-md); width: 260px; }
.j-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.j-header select {
  margin: 0 6px;
  padding: 4px 6px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: #fff;
  font: inherit;
}
body.student-body .j-header select {
  background: rgba(15, 23, 42, 0.6);
  color: #f8fafc;
  border-color: rgba(148, 163, 184, 0.35);
}
.j-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.j-cell { background: #f8fafc; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px; color: var(--text); cursor: pointer; }
.j-cell:hover { border-color: var(--primary); }

.j-date { position: relative; display: flex; gap: 8px; }
.j-date input[type="text"] { flex: 1; cursor: pointer; }
.j-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.j-day { background: #f8fafc; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 6px; color: var(--text); cursor: pointer; }
.j-day.selected { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(55,99,174,.15) inset; }
.j-day.blank { visibility: hidden; }

/* Charts responsiveness */

.grouping-manager .grouping-columns { display: flex; flex-direction: column; gap: 20px; }
@media (min-width: 992px) {
  .grouping-manager .grouping-columns { flex-direction: row; align-items: flex-start; }
}
.grouping-groups { flex: 1; min-width: 240px; }
.grouping-group-list { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.grouping-group-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.grouping-group-item:hover { border-color: var(--primary); background: var(--primary-tint); }
.grouping-group-item.active {
  border-color: var(--primary);
  background: var(--primary-tint);
  box-shadow: inset 0 0 0 1px rgba(249, 115, 22, 0.25);
}
.grouping-group-item span { font-size: 13px; color: var(--muted); }

.grouping-details {
  flex: 2;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow-sm);
}
body.coach-body .grouping-details { background: rgba(255, 255, 255, 0.92); }
.grouping-details[hidden] { display: none !important; }
.grouping-section { margin-top: 18px; display: flex; flex-direction: column; gap: 10px; }
.grouping-section h4 { margin: 0; font-size: 16px; }

.grouping-add { display: flex; flex-direction: column; gap: 10px; }
.grouping-add select {
  min-height: 140px;
  padding: 8px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: #f8fafc;
}
.grouping-add-actions { display: flex; flex-direction: column; gap: 6px; }
@media (min-width: 600px) {
  .grouping-add { flex-direction: row; align-items: flex-start; }
  .grouping-add select { flex: 1; }
  .grouping-add-actions { flex-basis: 200px; }
}

.grouping-member-list .item { margin: 0; }
.grouping-member-list .item .muted { margin-top: 4px; }

.grouping-assign-form {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: flex-end;
  margin-top: 8px;
}
.grouping-assign-form select,
.grouping-assign-form input[type="date"],
.grouping-assign-form input[type="number"] {
  flex: 1 1 160px;
  min-width: 140px;
  padding: 8px 10px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: #f8fafc;
}
.grouping-assign-form button { flex: 0 0 auto; }

.grouping-assignment-list .item { margin: 0; }
.grouping-assignment-list .item .muted { margin-top: 4px; }

.grouping-search input[type="search"] {
  width: 100%;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: #f8fafc;
  font: inherit;
}
.grouping-search input[type="search"]:focus {
  outline: none;
  border-color: rgba(37, 99, 235, 0.5);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.08);
}
.grouping-candidate-list .item { margin: 0; }

body.dialog-open { overflow: hidden; }
.coach-dialog {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
  z-index: 1200;
}
.coach-dialog.open {
  opacity: 1;
  pointer-events: auto;
}
.coach-dialog__box {
  width: min(94vw, 420px);
  background: #ffffff;
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.18);
  display: flex;
  flex-direction: column;
  gap: 16px;
}
body.coach-body .coach-dialog__box {
  background: rgba(255, 255, 255, 0.96);
}
.coach-dialog__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.coach-dialog__body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  color: var(--text);
}
.coach-dialog__actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}
.btn-icon {
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  color: var(--muted);
}
.btn-icon:hover { color: var(--primary); }
.dialog-field label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14px;
}
.input-help {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-top: 6px;
}
body.student-body .input-help { color: rgba(226,232,240,0.7); }
.dialog-input {
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font: inherit;
}
.dialog-input:focus {
  outline: none;
  border-color: rgba(37, 99, 235, 0.5);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.08);
}
.dialog-textarea {
  width: 100%;
  min-height: 80px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font: inherit;
  resize: vertical;
}
.dialog-input.invalid,
.dialog-textarea.invalid {
  border-color: #dc2626;
  box-shadow: 0 0 0 1px rgba(220, 38, 38, 0.2);
}
.dialog-subtitle {
  font-weight: 600;
  margin: 14px 0 6px;
}
.dialog-week-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}
.dialog-week-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
}
.dialog-week-field span {
  font-weight: 600;
}
.dialog-week-field textarea {
  min-height: 70px;
}
.dialog-input.invalid {
  border-color: #dc2626;
  box-shadow: 0 0 0 1px rgba(220, 38, 38, 0.2);
}
.dialog-textarea {
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font: inherit;
  resize: vertical;
  min-height: 96px;
}
.dialog-textarea:focus {
  outline: none;
  border-color: rgba(37, 99, 235, 0.5);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.08);
}
.btn-primary.danger {
  background: #dc2626;
  border-color: #dc2626;
}
.btn-primary.danger:hover {
  background: #b91c1c;
  border-color: #b91c1c;
}
.coach-toast {
  position: fixed;
  inset-inline: 50%;
  transform: translateX(-50%);
  bottom: 32px;
  min-width: 200px;
  max-width: 440px;
  padding: 12px 18px;
  border-radius: var(--radius-md);
  background: rgba(15, 23, 42, 0.92);
  color: #f8fafc;
  font-size: 14px;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.25);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 1300;
}
.coach-toast.show {
  opacity: 1;
  pointer-events: auto;
}
.coach-toast[data-variant="success"] { background: rgba(22, 163, 74, 0.94); }
.coach-toast[data-variant="danger"] { background: rgba(220, 38, 38, 0.92); }
.coach-toast[data-variant="info"] { background: rgba(37, 99, 235, 0.92); }
.coach-toast[data-variant="warning"] { background: rgba(217, 119, 6, 0.92); }
.card canvas { width: 100%; max-width: 100%; display: block; }
.charts-grid.two { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }

/* Dashboard layout (RTL sidebar on the right) */
.layout { display: flex; gap: 16px; align-items: flex-start; }
/* In RTL, first child appears visually at right in row layout */
.sidebar { width: 240px; flex: 0 0 240px; position: sticky; top: 12px; align-self: flex-start; z-index: 10; }
.sidebar .side-link { display: block; width: 100%; text-align: start; margin: 0 0 8px; padding: 10px 12px; border-radius: var(--radius-md); border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; }
.sidebar .side-link:hover { border-color: var(--primary); }
.sidebar .side-link.active { background: var(--primary-tint); border-color: var(--primary); }
.sidebar .side-footer { margin-top: 12px; }
.sidebar .side-secondary { width: 100%; background: transparent; border: 1px dashed var(--border); color: var(--text); }
body.student-body .sidebar .side-link {
  border-color: rgba(148, 163, 184, 0.2);
  background: rgba(15, 23, 42, 0.65);
  color: rgba(226, 232, 240, 0.85);
}
body.student-body .sidebar .side-link:hover { border-color: rgba(249,115,22,0.8); color: #f97316; }
body.student-body .sidebar .side-link.active {
  background: rgba(249,115,22,0.18);
  border-color: rgba(249,115,22,0.85);
  color: #f97316;
}
body.student-body .sidebar .side-secondary {
  border-color: rgba(148, 163, 184, 0.3);
  color: rgba(226, 232, 240, 0.85);
}
.content { flex: 1 1 auto; min-width: 0; }
.sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 45;
}
.sidebar-backdrop.is-active {
  opacity: 1;
  pointer-events: auto;
}
.panel { display: block; }
.panel[hidden] { display: none !important; }

@media (max-width: 1024px) {
  body.student-body .container { margin: 24px auto 32px; padding: 0 20px; }
  body.student-body .layout { gap: 14px; }
  body.student-body .sidebar { width: 220px; flex: 0 0 220px; }
  body.student-body .card { padding: 20px; }
}

@media (max-width: 900px) {
  body.student-body .layout { flex-direction: column; gap: 14px; }
  body.student-body .mobile-menu-btn { display: none; }
  body.student-body .sidebar { width: 100%; flex: 1 1 100%; position: static; transform: none; background: transparent; box-shadow: none; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  body.student-body .sidebar .side-link,
  body.student-body .sidebar .side-secondary { margin: 0; text-align: center; border-radius: 16px; background: rgba(15,23,42,0.78); border: 1px solid rgba(148,163,184,0.25); padding: 12px 10px; }
  body.student-body .sidebar .side-link[data-mobile-hidden="true"] { display: none; }
  body.student-body .sidebar .side-link.active { border-color: rgba(249,115,22,0.85); background: rgba(249,115,22,0.2); color: #f97316; }
  body.student-body .sidebar .side-footer { display: flex; gap: 10px; margin-top: 0; grid-column: span 2; }
  body.student-body .content { width: 100%; }
  body.student-body .form-grid.two { grid-template-columns: 1fr; }
  body.student-body .goal-time-inline .time-group { justify-content: flex-start; }
}
@media (max-width: 1100px) {
  body.student-body .mobile-nav { display: flex; }
  body.student-body .layout { margin-bottom: 80px; }
  body.student-body .goal-time-inline {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  body.student-body .goal-time-inline .time-group {
    flex-wrap: wrap;
    gap: 10px 8px;
  }
  body.student-body .goal-time-inline .time-group label {
    width: auto;
  }
  body.student-body .goal-time-inline .time-group label input {
    width: 70px;
  }
}

@media (max-width: 768px) {
  body.student-body .topbar { margin-bottom: 12px; gap: 10px; }
  .header-actions { gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
  .header-actions .top-actions { flex-wrap: wrap; justify-content: flex-end; }
  body.student-body #appArea .content { padding-bottom: 60px; }
}

@media (max-width: 640px) {
  h1 { font-size: 22px; line-height: 32px; }
  .card { padding: 18px; }
  .item { padding: 12px; }
  .auth-tabs { flex-direction: row; }
  .form-actions { justify-content: stretch; }
  .form-actions button { flex: 1; }
  .header-user { flex: 1; display: flex; align-items: center; gap: 12px; }
  body.student-body #appArea .content { padding-bottom: 110px; }
  body.student-body .mobile-nav { display: flex; }
  .dashboard-notices .student-alert { margin: 0; }
  .btn-ghost { width: 100%; justify-content: center; }

  .program-week-body {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  .program-week-content {
    flex: 1 1 100%;
  }
  .program-week-toggle {
    justify-content: flex-start;
  }
  .program-check {
    width: 100%;
    justify-content: flex-start;
    background: rgba(15, 23, 42, 0.35);
    border-radius: var(--radius-md);
  }
  body.student-body .program-check {
    background: rgba(15, 23, 42, 0.55);
    color: rgba(226, 232, 240, 0.85);
  }
  body.student-body .program-check .check-label {
    color: rgba(226, 232, 240, 0.85);
  }
  body.student-body .program-check.checked {
    background: rgba(22, 163, 74, 0.25);
  }
  body.student-body .program-check.checked .check-label {
    color: #bbf7d0;
  }
}

/* Week planner */
.week-details summary { cursor: pointer; margin: 8px 0 6px; color: var(--muted); }
.week-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.week-grid.days { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.chips { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-block; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--border); font-size: 12px; color: var(--muted); }
.chip.success { border-color: var(--primary); color: var(--primary); }
.chip.danger { border-color: #ef4444; color: #ef4444; }
.chip.chip-link {
  border-color: var(--primary);
  color: var(--primary);
  text-decoration: none;
  background: var(--primary-tint);
}
.chip.chip-link:hover,
.chip.chip-link:focus-visible {
  border-color: var(--primary-hover);
  color: var(--primary-hover);
}
.pending-group-title {
  font-size: 13px;
  margin: 12px 4px 6px;
}
.verify-area { margin-top: 8px; }
.day { border: 1px solid var(--border); border-radius: var(--radius-md); padding: 8px; background: var(--surface); }
.day-title { font-weight: 700; margin-bottom: 6px; }
.day.has { border-color: var(--primary); }
.day.today { box-shadow: 0 0 0 2px rgba(55,99,174,.25) inset; }
.day-content { white-space: pre-wrap; }
.day-empty { font-size: 12px; }

/* Archive */
.arch-month { margin-bottom: 8px; }
.arch-item { padding: 6px 0; border-top: 1px dashed var(--border); }
.arch-item:first-child { border-top: none; }

/* Simple row helper */
.row { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.row-between { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.btn-sm { padding: 6px 10px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; transition: background 0.2s ease, border-color 0.2s ease; }
.btn-sm:hover { border-color: var(--primary); background: var(--primary-tint); }
.btn-sm.success { border-color: #16a34a; color: #166534; background: #f0fdf4; }
.btn-sm.danger { border-color: #dc2626; color: #991b1b; background: #fef2f2; }

/* Form layout helpers */
.form-grid { display: grid; gap: 12px; }
.form-grid.two { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.section-subtitle { margin: 12px 0 6px; color: var(--muted); font-weight: 700; font-size: 14px; }
.hint { color: var(--muted); font-size: 12px; }
.pill { display: inline-block; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--border); background: #f8fafc; font-size: 12px; color: var(--muted); }
.preview-box { border: 1px dashed var(--border); background: #f8fafc; border-radius: var(--radius-sm); padding: 8px; color: var(--muted); }

/* Emoji quick buttons */
.emoji-quick { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.emoji-btn { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 6px 8px; cursor: pointer; }
.emoji-btn.active { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(249,115,22,0.15) inset; }

/* Compact time inputs */
.time-group {
  display: flex;
  gap: 6px;
  align-items: flex-end;
  justify-content: flex-start;
  flex-wrap: wrap;
}
.time-group label {
  max-width: 100px;
  text-align: left;
}
.time-group .sep { color: var(--muted); padding-bottom: 12px; }
.time-group input {
  width: 72px;
  text-align: left;
  direction: ltr;
}
.time-group[dir="ltr"] {
  direction: ltr;
}
#logDist, #logHR { direction: ltr; }

@media (max-width: 900px) {
  .layout { flex-direction: column; }
  .sidebar { width: 100%; position: static; display: flex; gap: 8px; flex-wrap: wrap; }
  .sidebar .side-link, .sidebar .side-secondary { flex: 1; }
}
.checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--muted);
}
.checkbox-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
}
.log-period-toggle {
  align-items: flex-start;
  flex-wrap: wrap;
}
.log-period-toggle .hint {
  font-size: 11px;
  color: rgba(148, 163, 184, 0.75);
  margin-inline-start: 28px;
}
.dashboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.dashboard-header h2 { margin: 0; }
.dashboard-notices { display: grid; gap: 10px; margin-bottom: 16px; }
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.dash-tile {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border-radius: 16px;
  border: 1px solid rgba(148,163,184,0.25);
  background: rgba(15, 23, 42, 0.75);
  color: inherit;
  text-decoration: none;
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}
.dash-tile:hover { transform: translateY(-2px); border-color: rgba(249,115,22,0.8); background: rgba(249,115,22,0.18); }
.dash-tile .tile-icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: rgba(249,115,22,0.22);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  color: #f97316;
}
.tile-title { font-weight: 600; margin-bottom: 4px; }
.tile-sub { font-size: 12px; color: var(--muted); }

/* Race panel ----------------------------------------------------------- */
.race-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.race-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.race-actions-header {
  display: flex;
  gap: 8px;
}
.race-card-header h2 {
  margin: 0;
}
.race-card-header p {
  margin: 6px 0 0;
  font-size: 14px;
}
.race-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.race-stat {
  min-width: 150px;
  background: var(--surface);
  border-radius: var(--radius-md);
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: var(--shadow-sm);
  padding: 12px 16px;
}
.race-stat strong {
  display: block;
  font-size: 18px;
  margin-bottom: 2px;
}
.race-stat span {
  font-size: 13px;
  color: var(--muted);
}
.race-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.race-team-list {
  display: grid;
  gap: 16px;
}
.race-team-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.race-team-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}
.race-team-header h3 {
  margin: 0;
  font-size: 20px;
}
.race-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 14px;
  color: var(--muted);
}
.race-beep strong {
  margin-inline-start: 6px;
  font-size: 18px;
  color: var(--primary);
}
.race-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  background: #e2e8f0;
  color: #0f172a;
}
.race-status[data-status="pending"] {
  background: #fef3c7;
  color: #c2410c;
}
.race-status[data-status="approved"] {
  background: #dcfce7;
  color: #15803d;
}
.race-status[data-status="rejected"] {
  background: #fee2e2;
  color: #b91c1c;
}
.race-members {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}
.race-member {
  padding: 12px;
  border-radius: var(--radius-sm);
  background: rgba(15, 23, 42, 0.05);
}
.race-member strong {
  display: block;
  font-size: 15px;
  margin-bottom: 4px;
}
.race-member span {
  display: block;
  font-size: 13px;
  color: var(--muted);
}
.race-note {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.race-note textarea {
  min-height: 68px;
  resize: vertical;
}
.race-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.empty-state {
  text-align: center;
  font-size: 14px;
  padding: 12px;
}

/* Events panel --------------------------------------------------------- */
.events-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.events-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}
.events-shell {
  display: grid;
  grid-template-columns: minmax(240px, 320px) 1fr;
  gap: 16px;
}
.events-list {
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  padding: 12px;
  max-height: 520px;
  overflow-y: auto;
}
.event-item {
  width: 100%;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  padding: 12px;
  text-align: right;
  background: transparent;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}
.event-item strong {
  display: block;
  margin-bottom: 4px;
}
.event-item span {
  font-size: 12px;
  color: var(--muted);
}
.event-item.active {
  border-color: rgba(234, 88, 12, 0.3);
  background: rgba(234, 88, 12, 0.08);
}
.event-item + .event-item {
  margin-top: 8px;
}
.events-details {
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: var(--radius-md);
  padding: 16px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  min-height: 320px;
}
.event-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 12px;
  color: var(--muted);
}
.event-meta span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.event-meta a {
  color: var(--primary);
  text-decoration: underline;
}
.event-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}
.event-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.event-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 12px;
}
.event-table th,
.event-table td {
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  padding: 8px;
  font-size: 14px;
}
.event-table th {
  text-align: right;
  background: rgba(15, 23, 42, 0.04);
}
.event-table tr:last-child td {
  border-bottom: none;
}
.event-empty {
  text-align: center;
  color: var(--muted);
  padding: 32px 0;
}

@media (max-width: 900px) {
  .events-shell {
    grid-template-columns: 1fr;
  }
  .events-list {
    max-height: none;
  }
}

/* Super admin dashboard */
body.sadmin-body {
  min-height: 100vh;
  background: radial-gradient(circle at top, rgba(4, 7, 20, 0.96), #010617);
  color: #e2e8f0;
  font-family: var(--ff-base);
}
body.sadmin-body .container {
  max-width: 1240px;
  position: relative;
  z-index: 1;
}
.sadmin-gradient {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at 30% 20%, rgba(14, 165, 233, 0.18), transparent 45%),
    radial-gradient(circle at 70% 0%, rgba(249, 115, 22, 0.2), transparent 40%);
  opacity: 0.65;
  pointer-events: none;
}
.sadmin-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-block: 32px 16px;
  position: relative;
  z-index: 1;
}
.sadmin-hero h1 {
  color: #f8fafc;
  margin-bottom: 8px;
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(59, 130, 246, 0.18);
  color: #bfdbfe;
  font-size: 13px;
  font-weight: 600;
}
.sadmin-frame {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  gap: 24px;
  margin-bottom: 56px;
}
.sadmin-sidebar {
  width: 260px;
  background: rgba(2, 6, 23, 0.65);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 24px;
  padding: 22px 20px;
  box-shadow: 0 30px 80px rgba(2, 6, 23, 0.55);
  position: sticky;
  top: 24px;
  backdrop-filter: blur(18px);
}
.sidebar-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}
.sidebar-logo {
  width: 46px;
  height: 46px;
  border-radius: 16px;
  background: rgba(248, 250, 252, 0.06);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #f97316;
  font-size: 18px;
}
.sidebar-title {
  font-weight: 700;
  color: #f8fafc;
}
body.sadmin-body .muted {
  color: rgba(226, 232, 240, 0.75);
}
.sadmin-sidebar .side-link {
  width: 100%;
  border: 1px solid transparent;
  background: transparent;
  color: #cbd5f5;
  padding: 10px 12px;
  border-radius: 12px;
  text-align: right;
  cursor: pointer;
  margin-top: 8px;
  font-weight: 600;
  transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}
.sadmin-sidebar .side-link:first-of-type {
  margin-top: 0;
}
.sadmin-sidebar .side-link:hover,
.sadmin-sidebar .side-link:focus-visible {
  border-color: rgba(248, 250, 252, 0.2);
  color: #fff;
}
.sadmin-sidebar .side-link.active {
  background: rgba(249, 115, 22, 0.15);
  border-color: rgba(249, 115, 22, 0.4);
  color: #ffedd5;
}
.sadmin-sidebar .side-link[hidden] {
  display: none !important;
}
.side-footer {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid rgba(148, 163, 184, 0.18);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.side-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #bfdbfe;
  text-decoration: none;
  font-size: 14px;
  padding: 8px 0;
}
.side-secondary:hover {
  color: #f8fafc;
}
.sadmin-main {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.sadmin-card {
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 32px;
  box-shadow: 0 25px 60px rgba(2, 6, 23, 0.45);
  color: #e2e8f0;
  padding: 26px;
}
.sadmin-card h2 {
  color: #f8fafc;
}
.sadmin-card p {
  color: rgba(226, 232, 240, 0.8);
}
.sadmin-section {
  display: none;
}
.sadmin-section.is-active {
  display: flex;
}
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
}
.overview-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.sadmin-overview .pill {
  border-color: rgba(59, 130, 246, 0.35);
  background: rgba(59, 130, 246, 0.12);
  color: #bfdbfe;
}
.sadmin-auth-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}
body.sadmin-body .auth-panel {
  background: rgba(2, 6, 23, 0.45);
  border: 1px solid rgba(148, 163, 184, 0.2);
  min-height: 100%;
}
body.sadmin-body label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14px;
  color: rgba(226, 232, 240, 0.82);
}
body.sadmin-body input,
body.sadmin-body select {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(148, 163, 184, 0.35);
  color: #f8fafc;
  border-radius: 12px;
  padding: 10px 12px;
}
body.sadmin-body input:focus,
body.sadmin-body select:focus {
  outline: none;
  border-color: rgba(249, 115, 22, 0.8);
}
.panel-header h2 {
  margin: 0;
  color: #f8fafc;
  font-size: 24px;
}
.panel-label {
  font-size: 13px;
  color: rgba(226, 232, 240, 0.75);
  margin-bottom: 6px;
}
body.sadmin-body .tabs {
  border-color: rgba(148, 163, 184, 0.2);
}
body.sadmin-body .tab {
  color: rgba(226, 232, 240, 0.75);
}
body.sadmin-body .tab.active {
  color: #ffedd5;
  background: rgba(249, 115, 22, 0.18);
  border-color: rgba(249, 115, 22, 0.75);
}
body.sadmin-body .metric-card {
  background: rgba(15, 23, 42, 0.7);
  border-color: rgba(148, 163, 184, 0.15);
  color: #e2e8f0;
}
body.sadmin-body .metric-title {
  color: rgba(203, 213, 225, 0.8);
}
body.sadmin-body .metric-value {
  color: #f8fafc;
}
body.sadmin-body .panel-block {
  background: rgba(2, 6, 23, 0.55);
  border-color: rgba(148, 163, 184, 0.15);
}
.quick-links .chip-link {
  background: rgba(15, 23, 42, 0.7);
  border-color: rgba(148, 163, 184, 0.35);
  color: #f8fafc;
}
.quick-links .chip-link:hover {
  color: #f97316;
}
.backup-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.backup-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 16px;
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: rgba(2, 6, 23, 0.45);
  flex-wrap: wrap;
}
.backup-meta {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}
.backup-name {
  font-weight: 600;
  color: #f8fafc;
}
.backup-stats {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 13px;
  color: rgba(226, 232, 240, 0.75);
}
.backup-actions {
  display: flex;
  gap: 8px;
}
.activity-timeline {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.activity-entry {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.activity-dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: #f97316;
  box-shadow: 0 0 0 6px rgba(249, 115, 22, 0.15);
  margin-top: 14px;
}
.activity-card {
  flex: 1;
  border-radius: 16px;
  padding: 14px 16px;
  background: rgba(2, 6, 23, 0.45);
  border: 1px solid rgba(148, 163, 184, 0.2);
}
.activity-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 13px;
  color: rgba(226, 232, 240, 0.75);
}
.activity-card strong {
  color: #f8fafc;
}
.guide-list {
  margin: 0;
  padding-inline-start: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  color: rgba(226, 232, 240, 0.78);
}
.guide-list li {
  line-height: 1.8;
}
body.sadmin-body .btn-sm {
  background: rgba(248, 250, 252, 0.1);
  border-color: rgba(248, 250, 252, 0.25);
  color: #f8fafc;
}
body.sadmin-body .btn-sm:hover {
  background: rgba(249, 115, 22, 0.22);
  border-color: rgba(249, 115, 22, 0.75);
}
body.sadmin-body .btn-sm.danger {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.65);
  color: #fee2e2;
}
body.sadmin-body .btn-sm.success {
  background: rgba(16, 185, 129, 0.2);
  border-color: rgba(16, 185, 129, 0.6);
  color: #ccfbf1;
}

@media (max-width: 1080px) {
  .sadmin-frame {
    flex-direction: column;
  }
  .sadmin-sidebar {
    width: 100%;
    position: static;
  }
  .sadmin-sidebar .side-link {
    display: inline-flex;
    justify-content: space-between;
  }
}

@media (max-width: 640px) {
  .sadmin-hero {
    flex-direction: column;
    align-items: flex-start;
  }
  .sadmin-card {
    padding: 20px;
  }
  .backup-item {
    flex-direction: column;
    align-items: flex-start;
  }
}
