/* ===================================================================
   Herald Trainer Consultant — Students Portal
   Professional Theme v2.0 + Attendance + Live Classes
   =================================================================== */

/* ---------- Design Tokens ---------- */
:root {
  --navy-900: #0b1a33;
  --navy-800: #122845;
  --navy-700: #1b3a5c;
  --navy-600: #244c74;
  --navy-500: #2f5f8c;
  --gold-500: #b8860b;
  --gold-400: #d4a017;
  --gold-300: #e6b84c;
  --admin-900: #3d1a1a;
  --admin-700: #6b2c2c;
  --admin-500: #8b3a3a;
  --bg: #f5f6f8;
  --bg-alt: #eceef1;
  --card: #ffffff;
  --text: #1a1f2e;
  --text-soft: #4a5260;
  --muted: #6b7280;
  --border: #d8dce2;
  --border-soft: #e5e8ed;
  --success: #15803d;
  --success-bg: #dcfce7;
  --warning: #a16207;
  --warning-bg: #fef3c7;
  --danger: #b91c1c;
  --danger-bg: #fee2e2;
  --info: #1e40af;
  --info-bg: #dbeafe;
  --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.08), 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 12px 32px rgba(15, 23, 42, 0.14);
  --radius-sm: 4px;
  --radius: 6px;
  --radius-lg: 8px;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'SF Mono', 'Monaco', 'Menlo', 'Consolas', monospace;
    /* ─── Neumorphism tokens ─── */
  --neu-bg: #eef1f5;
  --neu-bg-alt: #e6eaf0;
  --neu-surface: #eef1f5;
  --neu-light: #ffffff;
  --neu-dark: #c8ccd4;
  --neu-shadow-out:
    8px 8px 18px var(--neu-dark),
    -8px -8px 18px var(--neu-light);
  --neu-shadow-out-sm:
    4px 4px 10px var(--neu-dark),
    -4px -4px 10px var(--neu-light);
  --neu-shadow-in:
    inset 6px 6px 12px var(--neu-dark),
    inset -6px -6px 12px var(--neu-light);
  --neu-shadow-in-sm:
    inset 3px 3px 7px var(--neu-dark),
    inset -3px -3px 7px var(--neu-light);
  --neu-shadow-pressed:
    inset 4px 4px 8px var(--neu-dark),
    inset -4px -4px 8px var(--neu-light);
}

/* ---------- Dark Mode ---------- */
body.dark {
  --bg: #0b1220;
  --bg-alt: #0f172a;
  --card: #141d31;
  --text: #e5e9f0;
  --text-soft: #b8c1cf;
  --muted: #8892a3;
  --border: #253047;
  --border-soft: #1e283d;
  --navy-900: #060d1a;
  --navy-800: #0f1a2e;
  --navy-700: #16273f;
  --admin-900: #2a1212;
  --admin-700: #4a2020;
  --success-bg: #052e16;
  --success: #86efac;
  --warning-bg: #451a03;
  --warning: #fcd34d;
  --danger-bg: #450a0a;
  --danger: #fca5a5;
  --info-bg: #1e3a8a;
  --info: #93c5fd;
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.5);
    /* ─── Dark neumorphism ─── */
  --neu-bg: #141d31;
  --neu-bg-alt: #0f172a;
  --neu-surface: #141d31;
  --neu-light: #1e293b;
  --neu-dark: #060c18;
  --neu-shadow-out:
    8px 8px 18px var(--neu-dark),
    -8px -8px 18px var(--neu-light);
  --neu-shadow-out-sm:
    4px 4px 10px var(--neu-dark),
    -4px -4px 10px var(--neu-light);
  --neu-shadow-in:
    inset 6px 6px 12px var(--neu-dark),
    inset -6px -6px 12px var(--neu-light);
  --neu-shadow-in-sm:
    inset 3px 3px 7px var(--neu-dark),
    inset -3px -3px 7px var(--neu-light);
  --neu-shadow-pressed:
    inset 4px 4px 8px var(--neu-dark),
    inset -4px -4px 8px var(--neu-light);
  --bg: var(--neu-bg);
  --bg-alt: var(--neu-bg-alt);
  --card: var(--neu-surface);
  --border: #1e283d;
  --border-soft: #1a2337;
}


/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.55;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 0.2s, color 0.2s;
}
a { color: var(--navy-600); text-decoration: none; transition: color 0.15s; }
a:hover { color: var(--navy-500); text-decoration: underline; }
body.dark a { color: #93c5fd; }
body.dark a:hover { color: #bfdbfe; }

/* ===================================================================
   AUTH PAGES
   =================================================================== */
.auth-body {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--navy-900);
  padding: 24px;
  min-height: 100vh;
}
.admin-auth { background: var(--admin-900); }
.auth-card {
  background: var(--card);
  padding: 48px 40px;
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-soft);
}
.auth-card::before {
  content: '';
  display: block;
  width: 48px;
  height: 4px;
  background: var(--gold-500);
  margin: -48px auto 32px;
  border-radius: 0 0 2px 2px;
}
.admin-auth .auth-card::before { background: var(--admin-700); }
.auth-card h1 { font-size: 22px; font-weight: 600; text-align: center; letter-spacing: -0.02em; color: var(--text); }
.subtitle {
  text-align: center;
  color: var(--muted);
  margin: 6px 0 32px;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 500;
}
.tabs { display: flex; background: var(--bg-alt); border-radius: var(--radius); padding: 3px; margin-bottom: 24px; }
.tab {
  flex: 1;
  border: none;
  background: transparent;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-weight: 500;
  font-size: 13px;
  color: var(--muted);
  font-family: inherit;
  transition: all 0.15s;
}
.tab.active { background: var(--card); color: var(--navy-700); box-shadow: var(--shadow-xs); font-weight: 600; }
body.dark .tab.active { color: #93c5fd; }

.auth-form { display: flex; flex-direction: column; gap: 16px; }
.auth-form label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-soft);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: -8px;
}
.auth-form input {
  padding: 11px 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  font-family: inherit;
  background: var(--card);
  color: var(--text);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.auth-form input:focus { border-color: var(--navy-600); box-shadow: 0 0 0 3px rgba(36, 76, 116, 0.1); }
.admin-auth .auth-form input:focus { border-color: var(--admin-700); box-shadow: 0 0 0 3px rgba(107, 44, 44, 0.1); }

.btn-primary {
  margin-top: 4px;
  padding: 12px 16px;
  border: none;
  border-radius: var(--radius);
  background: var(--navy-700);
  color: #ffffff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  letter-spacing: 0.01em;
  transition: background-color 0.15s, transform 0.1s;
}
.btn-primary:hover { background: var(--navy-600); }
.btn-primary:active { transform: translateY(1px); }
.admin-auth .btn-primary { background: var(--admin-700); }
.admin-auth .btn-primary:hover { background: var(--admin-500); }

.hint { text-align: center; font-size: 12px; color: var(--muted); margin-top: 12px; line-height: 1.6; }
.hint code {
  background: var(--bg-alt);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-soft);
  border: 1px solid var(--border-soft);
}
.msg { text-align: center; margin-top: 16px; font-size: 13px; font-weight: 500; }
.msg.error { color: var(--danger); }
.msg.success { color: var(--success); }
.hidden { display: none !important; }

/* ===================================================================
   TOPBAR
   =================================================================== */
.topbar {
  background: var(--navy-800);
  color: #ffffff;
  padding: 0 32px;
  height: 60px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 3px solid var(--gold-500);
  position: sticky;
  top: 0;
  z-index: 50;
}
.admin-topbar { background: var(--admin-900); border-bottom-color: var(--admin-700); }
.brand { font-size: 15px; font-weight: 600; letter-spacing: 0.02em; display: flex; align-items: center; gap: 10px; }
.brand::before {
  content: '';
  width: 26px;
  height: 26px;
  background: var(--gold-500);
  border-radius: var(--radius-sm);
  display: inline-block;
  flex-shrink: 0;
}
.admin-topbar .brand::before { background: var(--admin-700); }
.user-box { display: flex; align-items: center; gap: 16px; font-size: 13px; color: rgba(255, 255, 255, 0.9); }
.role-badge {
  background: rgba(255, 255, 255, 0.12);
  padding: 3px 10px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border: 1px solid rgba(255, 255, 255, 0.15);
}
.btn-ghost {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #ffffff;
  padding: 7px 14px;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 12px;
  font-family: inherit;
  font-weight: 500;
  letter-spacing: 0.02em;
  transition: all 0.15s;
}
.btn-ghost:hover { background: rgba(255, 255, 255, 0.08); border-color: rgba(255, 255, 255, 0.4); }
.theme-toggle {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #ffffff;
  padding: 7px 12px;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 12px;
  font-family: inherit;
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0.04em;
  transition: all 0.15s;
}
.theme-toggle:hover { background: rgba(255, 255, 255, 0.08); }

/* ===================================================================
   LAYOUT
   =================================================================== */
.container { max-width: 1180px; margin: 0 auto; padding: 32px 24px 64px; }
.hero { margin-bottom: 32px; }
.hero h2 { font-size: 24px; font-weight: 600; letter-spacing: -0.02em; margin-bottom: 6px; color: var(--text); }
.hero p { color: var(--muted); font-size: 14px; }
.hero p strong { color: var(--text-soft); font-weight: 600; font-family: var(--font-mono); font-size: 13px; }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.card {
  background: var(--card);
  padding: 24px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-soft);
}
.card.wide { grid-column: 1 / -1; }
.card h3 {
  margin-bottom: 18px;
  font-size: 13px;
  color: var(--text-soft);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-soft);
}
.list { list-style: none; }
.list li { padding: 12px 0; border-bottom: 1px solid var(--border-soft); font-size: 13.5px; line-height: 1.5; }
.list li:last-child { border-bottom: none; }
.list li strong { color: var(--text); font-weight: 600; display: block; margin-bottom: 3px; }
.list li p { color: var(--muted); font-size: 12.5px; margin-top: 3px; }

/* ===================================================================
   TABLES
   =================================================================== */
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th, td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--border-soft); }
th {
  color: var(--muted);
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: var(--bg-alt);
  border-bottom: 1px solid var(--border);
}
tr:hover td { background: rgba(0, 0, 0, 0.015); }
body.dark tr:hover td { background: rgba(255, 255, 255, 0.02); }
.table-wrap {
  overflow-x: auto;
  background: var(--card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-soft);
}
table { min-width: 600px; }
.table-wrap table { border: none; }
.table-wrap tr:last-child td { border-bottom: none; }
.empty { text-align: center; color: var(--muted); padding: 32px !important; font-style: italic; font-size: 13px; }

/* ===================================================================
   BUTTONS
   =================================================================== */
.btn-enroll {
  background: var(--navy-700);
  color: #ffffff;
  border: none;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: background-color 0.15s;
}
.btn-enroll:hover { background: var(--navy-600); }
.btn-enroll:disabled { background: var(--bg-alt); color: var(--muted); cursor: default; border: 1px solid var(--border); }

.btn-xs {
  background: var(--card);
  color: var(--text-soft);
  border: 1px solid var(--border);
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  font-size: 11.5px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  margin-right: 4px;
  transition: all 0.15s;
}
.btn-xs:hover { background: var(--bg-alt); border-color: var(--text-soft); color: var(--text); }
.btn-xs.danger { background: transparent; color: var(--danger); border-color: var(--danger); }
.btn-xs.danger:hover { background: var(--danger-bg); color: var(--danger); }

.btn-pay {
  background: var(--success-bg);
  color: var(--success);
  border: 1px solid transparent;
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  margin-right: 4px;
  transition: all 0.15s;
}
.btn-pay:hover { filter: brightness(0.95); }

/* ===================================================================
   ADMIN PANEL
   =================================================================== */
.admin-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 28px;
  padding-bottom: 0;
  border-bottom: 1px solid var(--border);
}
.admin-tab {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 12px 16px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  font-family: inherit;
  letter-spacing: 0.01em;
  transition: all 0.15s;
  margin-bottom: -1px;
}
.admin-tab:hover { color: var(--text); }
.admin-tab.active { color: var(--admin-700); border-bottom-color: var(--admin-700); font-weight: 600; }
body.dark .admin-tab.active { color: #fca5a5; border-bottom-color: #fca5a5; }

.admin-panel { display: none; }
.admin-panel.active { display: block; }
.admin-panel h2 { font-size: 20px; font-weight: 600; margin-bottom: 20px; color: var(--text); letter-spacing: -0.01em; }
.panel-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; flex-wrap: wrap; gap: 12px; }
.panel-head .btn-primary { margin-top: 0; padding: 9px 16px; font-size: 13px; }

/* ===================================================================
   STATS
   =================================================================== */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.stat-card {
  background: var(--card);
  padding: 24px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow-xs);
}
.stat-num { font-size: 30px; font-weight: 700; color: var(--text); letter-spacing: -0.03em; line-height: 1; margin-bottom: 8px; }
.stat-lbl { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; font-weight: 600; }

/* ===================================================================
   PILLS
   =================================================================== */
.pill {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 3px;
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border: 1px solid transparent;
}
.pill-green { background: var(--success-bg); color: var(--success); border-color: var(--success); }
.pill-red { background: var(--danger-bg); color: var(--danger); border-color: var(--danger); }
.pill-amber { background: var(--warning-bg); color: var(--warning); border-color: var(--warning); }

/* ===================================================================
   ANNOUNCEMENTS
   =================================================================== */
.ann-admin-list { display: flex; flex-direction: column; gap: 12px; }
.ann-card {
  background: var(--card);
  padding: 20px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-soft);
  border-left: 3px solid var(--admin-700);
  box-shadow: var(--shadow-xs);
}
.ann-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 8px; gap: 16px; flex-wrap: wrap; }
.ann-head strong { font-size: 14.5px; font-weight: 600; color: var(--text); }
.ann-date { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; font-weight: 500; white-space: nowrap; }
.ann-card p { color: var(--text-soft); font-size: 13.5px; line-height: 1.6; margin-top: 6px; }
.ann-actions { margin-top: 14px; }

/* ===================================================================
   MODAL
   =================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
  animation: fadeIn 0.15s ease;
  backdrop-filter: blur(2px);
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: var(--card);
  color: var(--text);
  padding: 28px;
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  overflow: auto;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-soft);
  animation: slideUp 0.2s ease;
}
@keyframes slideUp {
  from { transform: translateY(16px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
.modal h3 {
  margin-bottom: 20px;
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-soft);
}
.modal-form { display: flex; flex-direction: column; gap: 14px; }
.modal-form label {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-soft);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: -6px;
}
.modal-form input,
.modal-form select,
.modal-form textarea {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 13.5px;
  font-family: inherit;
  background: var(--card);
  color: var(--text);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  width: 100%;
}
.modal-form input:focus,
.modal-form select:focus,
.modal-form textarea:focus { border-color: var(--navy-600); box-shadow: 0 0 0 3px rgba(36, 76, 116, 0.1); }
.modal-form textarea { resize: vertical; min-height: 80px; line-height: 1.5; }
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border-soft);
}
.btn-ghost.dark { border-color: var(--border); color: var(--text-soft); background: transparent; }
.btn-ghost.dark:hover { background: var(--bg-alt); color: var(--text); border-color: var(--text-soft); }

/* ===================================================================
   FEES — Student view
   =================================================================== */
.fees-summary { margin-bottom: 18px; }
.fee-summary-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.fee-summary-item {
  background: var(--bg-alt);
  padding: 14px 10px;
  border-radius: var(--radius);
  text-align: center;
  border: 1px solid var(--border-soft);
}
.fee-summary-lbl {
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
  margin-bottom: 6px;
}
.fee-summary-num { font-size: 15px; font-weight: 700; color: var(--text); font-family: var(--font-mono); letter-spacing: -0.02em; }
.fee-summary-num.success { color: var(--success); }
.fee-summary-num.danger { color: var(--danger); }
.fees-summary-bar { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 24px; }
.fees-summary-bar .stat-card { padding: 20px; }
.fees-summary-bar .stat-num { font-size: 22px; font-family: var(--font-mono); letter-spacing: -0.02em; }

/* ===================================================================
   PAYMENT DETAILS BOX (KCB)
   =================================================================== */
.payment-box {
  background: linear-gradient(135deg, #0b1a33 0%, #122845 100%);
  border: 1px solid var(--navy-700);
  border-left: 4px solid var(--gold-500);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-top: 16px;
  color: #ffffff;
}
.payment-box-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  flex-wrap: wrap;
}
.payment-box-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.12em; color: var(--gold-400); }
.payment-box-bank { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: rgba(255, 255, 255, 0.6); }
.payment-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.payment-field { display: flex; flex-direction: column; gap: 3px; }
.payment-field-lbl { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em; color: rgba(255, 255, 255, 0.55); }
.payment-field-val { font-family: var(--font-mono); font-size: 15px; font-weight: 700; color: #ffffff; letter-spacing: 0.03em; word-break: break-all; }
.payment-field-val.paybill { color: var(--gold-300); font-size: 17px; }
.payment-note {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 11.5px;
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.55;
}
.payment-note strong { color: var(--gold-300); font-weight: 600; }

/* ===================================================================
   TIMETABLE GRID
   =================================================================== */
.tt-grid-wrap {
  overflow-x: auto;
  background: var(--card);
  padding: 16px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow-xs);
}
.tt-grid { display: grid; grid-template-columns: 100px repeat(6, minmax(140px, 1fr)); gap: 4px; min-width: 920px; }
.tt-cell {
  padding: 10px 8px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  min-height: 64px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
}
.tt-head {
  background: var(--admin-900);
  color: #ffffff;
  font-weight: 600;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  min-height: auto;
  padding: 12px 8px;
}
.tt-time {
  background: var(--bg-alt);
  color: var(--text-soft);
  font-weight: 600;
  font-size: 11px;
  line-height: 1.35;
  font-family: var(--font-mono);
  border: 1px solid var(--border-soft);
}
.tt-slot {
  background: var(--info-bg);
  border-left: 3px solid var(--info);
  align-items: flex-start;
  justify-content: flex-start;
  text-align: left;
  gap: 3px;
  padding: 10px;
}
body.dark .tt-slot { background: rgba(30, 64, 175, 0.15); }
.tt-slot-code { font-weight: 700; font-size: 11.5px; color: var(--info); letter-spacing: 0.02em; font-family: var(--font-mono); }
body.dark .tt-slot-code { color: #93c5fd; }
.tt-slot-title { font-size: 11px; color: var(--text); line-height: 1.35; }
.tt-slot-meta { font-size: 10px; color: var(--muted); letter-spacing: 0.01em; }
.tt-empty { background: transparent; color: var(--border); font-size: 14px; border: 1px dashed var(--border-soft); }

/* ===================================================================
   SUBMISSIONS
   =================================================================== */
.sub-card {
  background: var(--bg-alt);
  padding: 16px;
  border-radius: var(--radius);
  margin-bottom: 12px;
  border: 1px solid var(--border-soft);
}
.sub-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.sub-head strong { font-size: 13.5px; color: var(--text); font-weight: 600; }
.sub-date { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.03em; }
.sub-content {
  background: var(--card);
  padding: 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text-soft);
  margin: 10px 0;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 150px;
  overflow: auto;
  line-height: 1.55;
  border: 1px solid var(--border-soft);
}
.sub-grade-row { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; margin-top: 10px; }
.sub-grade-row label {
  display: block;
  font-size: 10.5px;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.grade-input {
  width: 76px;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  background: var(--card);
  color: var(--text);
  font-size: 13px;
  text-align: center;
  font-weight: 700;
  outline: none;
  transition: border-color 0.15s;
}
.grade-input:focus { border-color: var(--navy-600); }
.feedback-input {
  width: 100%;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  background: var(--card);
  color: var(--text);
  font-size: 13px;
  outline: none;
  transition: border-color 0.15s;
}
.feedback-input:focus { border-color: var(--navy-600); }

/* ===================================================================
   FILE UPLOAD & PDF LINK
   =================================================================== */
.file-upload {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s;
  background: var(--bg-alt);
  margin: 12px 0;
}
.file-upload:hover { border-color: var(--navy-600); background: var(--card); }
.file-upload.has-file { border-color: var(--success); border-style: solid; background: var(--success-bg); }
.file-upload-icon { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.12em; color: var(--muted); margin-bottom: 6px; }
.file-upload-hint { font-size: 11.5px; color: var(--muted); margin-top: 4px; }
.file-upload-filename { font-family: var(--font-mono); font-size: 12.5px; color: var(--text); font-weight: 600; margin-top: 8px; word-break: break-all; }
.file-upload input[type="file"] { display: none; }

.pdf-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid var(--danger);
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  font-size: 11.5px;
  font-weight: 600;
  text-decoration: none;
  margin-right: 6px;
  transition: all 0.15s;
}
.pdf-link:hover { background: var(--danger); color: #ffffff; text-decoration: none; }
.pdf-link::before {
  content: 'PDF';
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.06em;
  background: rgba(255, 255, 255, 0.25);
  padding: 1px 4px;
  border-radius: 2px;
}

/* ===================================================================
   FILTERS
   =================================================================== */
.term-filter {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-family: inherit;
  background: var(--card);
  color: var(--text);
  outline: none;
  transition: border-color 0.15s;
}
.term-filter:focus { border-color: var(--navy-600); }

/* ===================================================================
   LOADING SPINNER
   =================================================================== */
.btn-loading { position: relative; color: transparent !important; pointer-events: none; }
.btn-loading::after {
  content: '';
  position: absolute;
  inset: 0;
  margin: auto;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===================================================================
   TOASTS
   =================================================================== */
.toast-wrap {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 360px;
}
.toast {
  background: var(--navy-800);
  color: #ffffff;
  padding: 13px 18px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateX(20px);
  transition: all 0.3s ease;
  border-left: 3px solid var(--gold-500);
}
.toast.show { opacity: 1; transform: translateX(0); }
.toast-error { background: var(--danger); border-left-color: var(--danger); }
.toast-success { background: var(--success); border-left-color: var(--success); }

/* ===================================================================
   PRINT
   =================================================================== */
@media print {
  .topbar,
  .admin-tabs,
  .btn-primary,
  .btn-xs,
  .btn-ghost,
  .theme-toggle,
  .toast-wrap,
  .panel-head button {
    display: none !important;
  }
  body { background: #ffffff !important; color: #000000 !important; font-size: 12px; }
  .card, .table-wrap { box-shadow: none !important; border: 1px solid #ccc; break-inside: avoid; }
}

/* ===================================================================
   FOOTER
   =================================================================== */
.site-footer {
  text-align: center;
  padding: 32px 16px;
  color: var(--muted);
  font-size: 12px;
  margin-top: 48px;
  border-top: 1px solid var(--border-soft);
  letter-spacing: 0.02em;
}

/* ===================================================================
   RESPONSIVE
   =================================================================== */
@media (max-width: 768px) {
  .grid { grid-template-columns: 1fr; }
  .auth-card { padding: 36px 24px; }
  .auth-card::before { margin: -36px auto 24px; }
  .container { padding: 20px 16px 48px; }
  .topbar { padding: 0 16px; height: 56px; }
  .brand { font-size: 14px; }
  .user-box { gap: 10px; font-size: 12px; }
  .admin-tabs { overflow-x: auto; flex-wrap: nowrap; padding-bottom: 0; }
  .admin-tab { white-space: nowrap; padding: 12px 12px; font-size: 12px; }
  .modal { padding: 22px; }
  .toast-wrap { top: 12px; right: 12px; left: 12px; max-width: none; }
  .tt-grid { grid-template-columns: 80px repeat(6, minmax(120px, 1fr)); }
  .sub-grade-row { flex-direction: column; align-items: stretch; }
  .grade-input { width: 100%; }
  .payment-grid { grid-template-columns: 1fr; gap: 10px; }
  .payment-field-val { font-size: 14px; }
}

@media (max-width: 480px) {
  .auth-card { padding: 28px 20px; }
  .auth-card h1 { font-size: 19px; }
  .stat-num { font-size: 24px; }
  .admin-panel h2 { font-size: 17px; }
  .panel-head .btn-primary { width: 100%; }
  .fee-summary-grid { grid-template-columns: 1fr; }
  .hero h2 { font-size: 19px; }
}

/* ===================================================================
   COURSE PICKER — Searchable dropdown
   =================================================================== */
.course-picker {
  position: relative;
}

.course-picker input {
  width: 100%;
  padding: 11px 36px 11px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-family: inherit;
  background: var(--card);
  color: var(--text);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.course-picker input:focus {
  border-color: var(--navy-600);
  box-shadow: 0 0 0 3px rgba(36, 76, 116, 0.1);
}

.course-picker input::placeholder {
  color: var(--muted);
}

.course-picker::after {
  content: '';
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid var(--muted);
  pointer-events: none;
}

.course-picker-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  max-height: 320px;
  overflow-y: auto;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  z-index: 100;
  padding: 6px;
}

.course-picker-dropdown.hidden {
  display: none;
}

.course-picker-group {
  padding: 8px 12px 6px;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  border-bottom: 1px solid var(--border-soft);
  margin-bottom: 4px;
}

.course-picker-group:not(:first-child) {
  margin-top: 8px;
}

.course-picker-option {
  padding: 10px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13.5px;
  color: var(--text);
  transition: background-color 0.1s;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.course-picker-option:hover,
.course-picker-option.highlighted {
  background: var(--bg-alt);
}

.course-picker-option.selected {
  background: var(--navy-700);
  color: white;
}

.course-picker-option.selected .course-picker-code {
  color: #e6b84c;
}

.course-picker-code {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--gold-500);
  font-weight: 700;
  flex-shrink: 0;
}

.course-picker-empty {
  padding: 20px 12px;
  text-align: center;
  font-size: 13px;
  color: var(--muted);
  font-style: italic;
}

/* Dark mode */
body.dark .course-picker input {
  background: #0f172a;
  color: var(--text);
  border-color: #334155;
}

body.dark .course-picker-dropdown {
  background: #141d31;
  border-color: #334155;
}

body.dark .course-picker-option:hover,
body.dark .course-picker-option.highlighted {
  background: #1e283d;
}

body.dark .course-picker-group {
  color: #94a3b8;
  border-color: #1e283d;
}

/* ===================================================================
   NEUMORPHISM OVERRIDES
   Soft UI applied to core components
   =================================================================== */

/* ─── Page background ─── */
body {
  background: var(--neu-bg);
  transition: background 0.3s ease, color 0.3s ease;
}

/* ─── Cards — raised surfaces ─── */
.card,
.stat-card,
.ann-card,
.sub-card,
.fees-summary-bar .stat-card,
.admin-panel .stat-card,
.modal {
  background: var(--neu-surface);
  border: none;
  box-shadow: var(--neu-shadow-out);
  transition: box-shadow 0.25s ease, transform 0.25s ease;
}

.card:hover,
.ann-card:hover {
  box-shadow: var(--neu-shadow-out), 0 0 0 1px rgba(184, 134, 11, 0.08);
}

/* Wider gap for cards to breathe */
.grid { gap: 28px; }

/* ─── Tables & table wrappers ─── */
.table-wrap {
  background: var(--neu-surface);
  border: none;
  box-shadow: var(--neu-shadow-in);
  border-radius: var(--radius-lg);
  padding: 16px;
}

table thead th {
  background: transparent;
  border-bottom: 1px solid var(--border-soft);
}

/* ─── Inputs — inset, carved into surface ─── */
.auth-form input,
.modal-form input,
.modal-form select,
.modal-form textarea,
.term-filter,
.grade-input,
.feedback-input,
.course-picker input {
  background: var(--neu-surface);
  border: none;
  box-shadow: var(--neu-shadow-in-sm);
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
  border-radius: var(--radius);
}

.auth-form input:focus,
.modal-form input:focus,
.modal-form select:focus,
.modal-form textarea:focus,
.term-filter:focus,
.grade-input:focus,
.feedback-input:focus,
.course-picker input:focus {
  box-shadow: var(--neu-shadow-in-sm), 0 0 0 2px var(--gold-500);
  outline: none;
}

/* ─── Primary buttons — raised, pressable ─── */
.btn-primary,
.btn-gold,
.btn-submit {
  background: var(--neu-surface);
  color: var(--navy-700);
  box-shadow: var(--neu-shadow-out-sm);
  border: none;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  font-weight: 700;
}

.btn-primary:hover,
.btn-gold:hover,
.btn-submit:hover {
  color: var(--gold-500);
  transform: translateY(-1px);
  box-shadow:
    6px 6px 14px var(--neu-dark),
    -6px -6px 14px var(--neu-light);
}

.btn-primary:active,
.btn-gold:active,
.btn-submit:active {
  box-shadow: var(--neu-shadow-pressed);
  transform: translateY(0);
}

/* Accent primary — filled with brand color but still soft */
.btn-primary.accent,
.btn-submit {
  background: linear-gradient(135deg, var(--navy-700), var(--navy-600));
  color: #ffffff;
  box-shadow:
    6px 6px 14px var(--neu-dark),
    -6px -6px 14px var(--neu-light),
    inset 0 1px 0 rgba(255,255,255,0.15);
}
.btn-primary.accent:hover,
.btn-submit:hover {
  background: linear-gradient(135deg, var(--navy-600), var(--navy-500));
  color: #ffffff;
}

/* ─── Small buttons (edit/delete) ─── */
.btn-xs,
.btn-pay,
.btn-enroll {
  background: var(--neu-surface);
  border: none;
  box-shadow: var(--neu-shadow-out-sm);
  transition: all 0.15s ease;
  color: var(--text-soft);
}

.btn-xs:hover,
.btn-pay:hover,
.btn-enroll:hover {
  transform: translateY(-1px);
  box-shadow:
    5px 5px 12px var(--neu-dark),
    -5px -5px 12px var(--neu-light);
}

.btn-xs:active,
.btn-pay:active,
.btn-enroll:active {
  box-shadow: var(--neu-shadow-pressed);
  transform: translateY(0);
}

.btn-xs.danger {
  color: var(--danger);
  background: var(--neu-surface);
}
.btn-xs.danger:hover {
  background: linear-gradient(135deg, #fee2e2, #fecaca);
  color: var(--danger);
}

.btn-pay {
  color: var(--success);
}

/* ─── Pills — subtle raised badges ─── */
.pill {
  border: none;
  box-shadow:
    2px 2px 4px var(--neu-dark),
    -2px -2px 4px var(--neu-light);
  font-weight: 700;
}

.pill-green { background: linear-gradient(135deg, #dcfce7, #bbf7d0); color: #166534; }
.pill-red   { background: linear-gradient(135deg, #fee2e2, #fecaca); color: #991b1b; }
.pill-amber { background: linear-gradient(135deg, #fef3c7, #fde68a); color: #92400e; }

body.dark .pill-green { background: linear-gradient(135deg, #052e16, #064e3b); color: #86efac; }
body.dark .pill-red   { background: linear-gradient(135deg, #450a0a, #7f1d1d); color: #fca5a5; }
body.dark .pill-amber { background: linear-gradient(135deg, #451a03, #78350f); color: #fcd34d; }

/* ─── Topbar — softly raised ─── */
.topbar {
  background: var(--neu-bg);
  color: var(--text);
  border-bottom: none;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.06);
}

.admin-topbar {
  background: linear-gradient(135deg, #6b2c2c, #8b3a3a);
  color: white;
  box-shadow: 0 4px 16px rgba(107, 44, 44, 0.25);
}

.topbar .brand { color: var(--navy-800); }
.admin-topbar .brand { color: #ffffff; }

/* Buttons inside topbar stay dark-themed */
.topbar .btn-ghost,
.admin-topbar .btn-ghost {
  color: var(--text-soft);
  border-color: var(--border);
}
.admin-topbar .btn-ghost { color: #ffffff; border-color: rgba(255,255,255,0.3); }

/* ─── Tabs — raised when active ─── */
.admin-tab {
  border: none;
  background: transparent;
  color: var(--muted);
  padding: 10px 16px;
  border-radius: var(--radius);
  font-weight: 600;
  transition: all 0.2s ease;
}

.admin-tab:hover {
  background: var(--neu-surface);
  color: var(--text);
  box-shadow: var(--neu-shadow-out-sm);
}

.admin-tab.active {
  background: var(--neu-surface);
  color: var(--admin-700);
  box-shadow: var(--neu-shadow-out-sm);
  border-bottom: none;
}

body.dark .admin-tab.active { color: #fca5a5; }

/* Course tabs (welcome page) */
.course-tab {
  background: var(--neu-surface);
  border: none;
  box-shadow: var(--neu-shadow-out-sm);
}

.course-tab.active {
  background: linear-gradient(135deg, var(--navy-800), var(--navy-600));
  color: white;
  box-shadow:
    inset 4px 4px 8px rgba(0,0,0,0.3),
    inset -4px -4px 8px rgba(255,255,255,0.05);
}

/* ─── Modals — floating panel ─── */
.modal-overlay {
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(8px);
}

.modal {
  box-shadow:
    20px 20px 60px rgba(15, 23, 42, 0.3),
    -10px -10px 40px rgba(255, 255, 255, 0.08);
}

/* ─── Toasts — raised ─── */
.toast {
  background: var(--neu-surface);
  color: var(--text);
  box-shadow: var(--neu-shadow-out);
  border-left: 4px solid var(--gold-500);
  font-weight: 600;
}

.toast-success {
  border-left-color: var(--success);
  background: linear-gradient(135deg, var(--neu-surface), #f0fdf4);
}
.toast-error {
  border-left-color: var(--danger);
  background: linear-gradient(135deg, var(--neu-surface), #fef2f2);
}
body.dark .toast-success { background: linear-gradient(135deg, #141d31, #052e16); }
body.dark .toast-error { background: linear-gradient(135deg, #141d31, #450a0a); }

/* ─── Stats grid — soft raised cards ─── */
.stat-card {
  padding: 28px;
}

.stat-num {
  background: linear-gradient(135deg, var(--navy-700), var(--navy-500));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

body.dark .stat-num {
  background: linear-gradient(135deg, #93c5fd, #bfdbfe);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ─── Course picker dropdown (lecturer/student register) ─── */
.course-picker-dropdown {
  background: var(--neu-surface);
  box-shadow: var(--neu-shadow-out);
  border: none;
}

.course-picker-option:hover,
.course-picker-option.highlighted {
  background: var(--neu-bg-alt);
  box-shadow: var(--neu-shadow-in-sm);
}

.course-picker-option.selected {
  background: linear-gradient(135deg, var(--navy-800), var(--navy-600));
  color: white;
  box-shadow:
    inset 3px 3px 6px rgba(0,0,0,0.25),
    inset -3px -3px 6px rgba(255,255,255,0.05);
}

/* ─── Timetable grid ─── */
.tt-grid-wrap {
  background: var(--neu-surface);
  border: none;
  box-shadow: var(--neu-shadow-in);
}

.tt-head {
  background: linear-gradient(135deg, var(--navy-800), var(--navy-700));
  box-shadow: var(--neu-shadow-out-sm);
  border: none;
}

.tt-slot {
  background: linear-gradient(135deg, var(--info-bg), #eef2ff);
  border-left: none;
  box-shadow:
    inset 2px 2px 4px rgba(30, 64, 175, 0.1),
    2px 2px 4px var(--neu-dark),
    -2px -2px 4px var(--neu-light);
}

/* ─── Auth cards — raised ─── */
.auth-card {
  background: var(--neu-surface);
  box-shadow:
    20px 20px 60px rgba(15, 23, 42, 0.25),
    -10px -10px 40px rgba(255, 255, 255, 0.05);
  border: none;
}

.auth-card::before {
  background: linear-gradient(90deg, var(--gold-500), var(--gold-300));
}

/* ─── Theme toggle & ghost buttons on dark topbar ─── */
.theme-toggle {
  background: var(--neu-surface);
  color: var(--text-soft);
  border: none;
  box-shadow: var(--neu-shadow-out-sm);
}

.theme-toggle:active {
  box-shadow: var(--neu-shadow-pressed);
}

/* ─── Responsive: reduce shadow spread on mobile ─── */
@media (max-width: 768px) {
  :root {
    --neu-shadow-out:
      5px 5px 12px var(--neu-dark),
      -5px -5px 12px var(--neu-light);
    --neu-shadow-in:
      inset 4px 4px 8px var(--neu-dark),
      inset -4px -4px 8px var(--neu-light);
  }
  .card, .stat-card { padding: 20px; }
}

/* Material cards */
.material-locked {
  opacity: 0.7;
  position: relative;
}
.material-locked strong::before {
  content: '🔒 ';
}

.material-unlocked {
  border-left: 3px solid var(--success);
}

/* ===================================================================
   GLOBAL HOME BUTTON
   Floating "Return to Home" button on all pages except welcome.html
   =================================================================== */
.home-fab {
  position: fixed;
  left: 20px;
  bottom: 20px;
  z-index: 90;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  background: linear-gradient(135deg, #0b1a33, #244c74);
  color: #ffffff;
  border: none;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  font-family: inherit;
  letter-spacing: 0.02em;
  cursor: pointer;
  text-decoration: none;
  box-shadow:
    0 8px 24px rgba(11, 26, 51, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.15),
    0 0 0 1px rgba(184, 134, 11, 0.2);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  opacity: 0;
  transform: translateY(20px);
  animation: homeFabIn 0.4s cubic-bezier(0.4, 0, 0.2, 1) 0.2s forwards;
}

@keyframes homeFabIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.home-fab:hover {
  background: linear-gradient(135deg, #244c74, #2f5f8c);
  transform: translateY(-3px);
  box-shadow:
    0 12px 32px rgba(11, 26, 51, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    0 0 0 2px rgba(184, 134, 11, 0.5);
  text-decoration: none;
  color: #ffffff;
}

.home-fab:active {
  transform: translateY(-1px);
}

.home-fab svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  transition: transform 0.25s;
}

.home-fab:hover svg {
  transform: scale(1.15);
}

.home-fab .home-label {
  display: inline-block;
  max-width: 100px;
  overflow: hidden;
  white-space: nowrap;
  transition: max-width 0.3s, margin 0.3s;
}

.home-fab:hover .home-label {
  max-width: 120px;
}

/* Dark mode */
body.dark .home-fab {
  background: linear-gradient(135deg, #1e293b, #334155);
  box-shadow:
    0 8px 24px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 0 0 1px rgba(184, 134, 11, 0.3);
}
body.dark .home-fab:hover {
  background: linear-gradient(135deg, #334155, #475569);
  box-shadow:
    0 12px 32px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    0 0 0 2px rgba(230, 184, 76, 0.6);
}

/* Mobile — icon only to save space */
@media (max-width: 640px) {
  .home-fab {
    left: 14px;
    bottom: 14px;
    padding: 12px;
  }
  .home-fab .home-label {
    display: none;
  }
  .home-fab svg {
    width: 20px;
    height: 20px;
  }
}

/* When back-to-top is also visible, they don't overlap (left vs right) */