:root {
  --navy: #0e1b33;
  --navy-2: #16274a;
  --navy-3: #1e3258;
  --navy-4: #28406b;
  --ice: #8fd9d4;
  --ice-dim: #5fb8b2;
  --ice-tint: rgba(143, 217, 212, 0.12);
  --red: #e6392c;
  --red-dark: #c22a1f;
  --red-tint: rgba(230, 57, 44, 0.14);
  --white: #f4f8f8;
  --muted: #9db0c7;
  --muted-2: #6f83a0;
  --good: #34c789;
  --good-tint: rgba(52, 199, 137, 0.14);
  --warn: #e0a72f;
  --warn-tint: rgba(224, 167, 47, 0.14);
  --bad: var(--red);
  --radius: 14px;
  --radius-sm: 10px;
  --sidebar-w: 248px;
  --font: 'Poppins', -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-display: 'Anton', 'Bebas Neue', sans-serif;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.2), 0 14px 32px -16px rgba(0, 0, 0, 0.55);
  --ease: cubic-bezier(0.2, 0.7, 0.3, 1);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--navy);
  background-image: radial-gradient(circle at 15% 0%, rgba(143, 217, 212, 0.08), transparent 45%),
    radial-gradient(circle at 100% 20%, rgba(230, 57, 44, 0.08), transparent 40%);
  color: var(--white);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { margin: 0; font-weight: 700; }
p { margin: 0; }
button, input, select, textarea { font-family: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--ice); }
.hidden { display: none !important; }
::selection { background: var(--red-tint); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--navy-4); border-radius: 8px; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- Buttons & inputs ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  border-radius: var(--radius-sm);
  padding: 11px 18px;
  font-size: 14px;
  font-weight: 600;
  transition: transform 0.15s var(--ease), background 0.15s var(--ease), box-shadow 0.15s var(--ease), opacity 0.15s var(--ease);
  white-space: nowrap;
}
.btn:active:not(:disabled) { transform: scale(0.97); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-primary { background: var(--red); color: #fff; box-shadow: 0 8px 20px -8px rgba(230, 57, 44, 0.6); }
.btn-primary:hover:not(:disabled) { background: var(--red-dark); }
.btn-ice { background: var(--ice); color: var(--navy); box-shadow: 0 8px 20px -8px rgba(143, 217, 212, 0.45); }
.btn-ice:hover:not(:disabled) { background: var(--ice-dim); }
.btn-ghost { background: var(--navy-3); color: var(--white); }
.btn-ghost:hover:not(:disabled) { background: var(--navy-4); }
.btn-outline { background: transparent; color: var(--ice); border: 1px solid var(--navy-4); }
.btn-outline:hover:not(:disabled) { border-color: var(--ice); }
.btn-danger { background: transparent; color: var(--red); border: 1px solid rgba(230, 57, 44, 0.4); }
.btn-danger:hover:not(:disabled) { background: var(--red-tint); }
.btn-block { width: 100%; }
.btn-sm { padding: 7px 12px; font-size: 12.5px; }
.btn-icon { padding: 9px; }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 12.5px; font-weight: 600; color: var(--muted); letter-spacing: 0.2px; }
.input, select.input, textarea.input {
  background: var(--navy);
  border: 1px solid var(--navy-4);
  border-radius: var(--radius-sm);
  padding: 11px 13px;
  font-size: 14.5px;
  color: var(--white);
  outline: none;
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
  width: 100%;
}
.input::placeholder { color: var(--muted-2); }
.input:focus { border-color: var(--ice); box-shadow: 0 0 0 3px var(--ice-tint); }
textarea.input { resize: vertical; min-height: 70px; }
/* Native date/time picker glyphs default to black and disappear on our dark inputs. */
input[type="date"].input, input[type="time"].input { color-scheme: dark; }
.input-row { display: flex; gap: 10px; }
.password-row { position: relative; }
.password-toggle {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  background: none; border: none; color: var(--muted); padding: 4px;
}
.hint { font-size: 12px; color: var(--muted-2); }
.error-text { font-size: 13px; color: var(--red); min-height: 18px; }

.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: 1px solid var(--navy-4); background: var(--navy-3); color: var(--white);
  border-radius: 999px; padding: 9px 16px; font-size: 13.5px; font-weight: 600;
  transition: all 0.15s var(--ease);
}
.chip.active, .chip:hover { border-color: var(--ice); color: var(--ice); background: var(--ice-tint); }

/* ---------- Auth screen ---------- */
.auth-screen {
  min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px;
}
.auth-card {
  width: 100%; max-width: 400px; background: var(--navy-2); border: 1px solid var(--navy-3);
  border-radius: 20px; padding: 32px 28px; box-shadow: var(--shadow);
  animation: rise 0.4s var(--ease);
}
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.auth-logo { width: 230px; max-width: 85%; height: auto; display: block; margin: 0 auto 10px; }
.auth-sub { display: block; text-align: center; color: var(--muted); font-size: 13px; margin-top: -4px; margin-bottom: 22px; }
.auth-tabs { display: flex; background: var(--navy); border-radius: var(--radius-sm); padding: 4px; margin-bottom: 20px; }
.auth-tab { flex: 1; border: none; background: none; padding: 9px; border-radius: 8px; font-weight: 600; font-size: 13.5px; color: var(--muted); transition: all 0.15s var(--ease); }
.auth-tab.active { background: var(--red); color: #fff; }
.lock-banner {
  background: var(--warn-tint); border: 1px solid rgba(224, 167, 47, 0.4); color: var(--warn);
  border-radius: var(--radius-sm); padding: 10px 12px; font-size: 13px; margin-bottom: 14px; text-align: center;
}

/* ---------- App shell ---------- */
.app { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; }
.sidebar {
  background: var(--navy-2); border-right: 1px solid var(--navy-3);
  display: flex; flex-direction: column; padding: 20px 14px; position: sticky; top: 0; height: 100vh;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 6px 8px 20px; }
.brand img { width: 36px; height: 36px; border-radius: 9px; }
.brand span { font-family: var(--font-display); font-size: 16.5px; letter-spacing: 1px; }
.nav-label { font-size: 11px; font-weight: 700; letter-spacing: 1px; color: var(--muted-2); text-transform: uppercase; padding: 14px 12px 6px; }
.tabbar { display: flex; flex-direction: column; gap: 2px; flex: 1; overflow-y: auto; }
.tab-btn {
  display: flex; align-items: center; gap: 12px; border: none; background: none; text-align: left;
  padding: 10px 12px; border-radius: var(--radius-sm); font-size: 14px; font-weight: 500; color: var(--muted);
  transition: background 0.15s var(--ease), color 0.15s var(--ease);
  position: relative;
}
.tab-btn svg { width: 19px; height: 19px; flex-shrink: 0; stroke: currentColor; fill: none; stroke-width: 2; }
.tab-btn span { flex: 1; }
.tab-btn:hover { background: var(--navy-3); color: var(--white); }
.tab-btn.active { background: var(--red-tint); color: var(--ice); box-shadow: inset 3px 0 0 var(--red); }
.count-badge {
  background: var(--red); color: #fff; font-size: 10.5px; font-weight: 700; border-radius: 999px;
  min-width: 18px; height: 18px; display: inline-flex; align-items: center; justify-content: center; padding: 0 5px;
}
.count-badge.hidden { display: none; }
.logout-btn { margin-top: 10px; background: none; border: 1px solid var(--navy-4); color: var(--muted); border-radius: var(--radius-sm); padding: 10px; font-size: 13px; font-weight: 600; }
.logout-btn:hover { border-color: var(--red); color: var(--red); }

.content { padding: 28px 32px 100px; max-width: 980px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.panel-head h2 { font-size: 22px; }
.panel-head p { color: var(--muted); font-size: 13.5px; margin-top: 3px; }

.tab-panel { display: none; animation: fadeIn 0.25s var(--ease); }
.tab-panel.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- Cards ---------- */
.card {
  background: var(--navy-2); border: 1px solid var(--navy-3); border-radius: var(--radius);
  padding: 18px; box-shadow: var(--shadow);
}
.card + .card { margin-top: 14px; }
.empty-state { text-align: center; padding: 46px 20px; color: var(--muted); }
.empty-state svg { width: 40px; height: 40px; stroke: var(--muted-2); margin-bottom: 10px; }
.empty-state p { font-size: 14px; }

.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 700; letter-spacing: 0.3px; text-transform: uppercase; padding: 4px 9px; border-radius: 999px; }
.badge-good { background: var(--good-tint); color: var(--good); }
.badge-warn { background: var(--warn-tint); color: var(--warn); }
.badge-bad { background: var(--red-tint); color: var(--red); }
.badge-muted { background: var(--navy-3); color: var(--muted); }
.badge-ice { background: var(--ice-tint); color: var(--ice); }

/* ---------- Session card ---------- */
.session-card { display: flex; flex-direction: column; gap: 14px; }
.session-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.session-date { font-family: var(--font-display); font-size: 26px; letter-spacing: 0.5px; line-height: 1.1; }
.session-meta { color: var(--muted); font-size: 13.5px; margin-top: 4px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.session-meta svg { width: 14px; height: 14px; stroke: var(--muted); fill: none; stroke-width: 2; }
.countdown { font-size: 12.5px; color: var(--ice); font-weight: 600; }
.countdown.locked { color: var(--warn); }
.attendee-row { display: flex; align-items: center; justify-content: space-between; padding: 9px 0; border-top: 1px solid var(--navy-3); }
.attendee-row:first-of-type { border-top: none; }
.avatar {
  width: 30px; height: 30px; border-radius: 999px; background: var(--navy-4); color: var(--ice);
  display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; margin-right: 10px;
}
.attendee-name { display: flex; align-items: center; font-size: 13.5px; }
.session-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.progress-track { height: 6px; background: var(--navy-3); border-radius: 999px; overflow: hidden; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--ice-dim), var(--ice)); border-radius: 999px; transition: width 0.3s var(--ease); }

/* ---------- Calendar ---------- */
.cal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.cal-header h3 { font-size: 16px; font-family: var(--font-display); letter-spacing: 0.5px; }
.cal-nav { display: flex; gap: 6px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal-dow { text-align: center; font-size: 11px; color: var(--muted-2); font-weight: 700; padding-bottom: 4px; }
.cal-day {
  aspect-ratio: 1; border-radius: 10px; border: 1px solid var(--navy-3); background: var(--navy);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  font-size: 13px; font-weight: 600; transition: all 0.15s var(--ease); position: relative;
}
.cal-day:not(.cal-day-empty):not(.cal-day-past):hover { border-color: var(--ice); }
.cal-day-empty { visibility: hidden; }
.cal-day-past { opacity: 0.35; }
.cal-day-today { box-shadow: 0 0 0 2px var(--ice) inset; }
.cal-day-selected { background: var(--ice); color: var(--navy); border-color: var(--ice); }
.cal-day-dot { width: 5px; height: 5px; border-radius: 999px; background: var(--red); position: absolute; bottom: 5px; }
.cal-day-pending { animation: cal-pending 0.9s ease-in-out infinite; }
@keyframes cal-pending { 0%, 100% { opacity: 1; } 50% { opacity: 0.55; } }
.cal-legend { display: flex; gap: 16px; margin-top: 14px; font-size: 12px; color: var(--muted); }
.cal-legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend-dot { width: 9px; height: 9px; border-radius: 3px; }

/* ---------- Wallet ---------- */
.wallet-hero {
  background: linear-gradient(135deg, var(--navy-3), var(--navy-2)); border: 1px solid var(--navy-4);
  border-radius: var(--radius); padding: 24px; text-align: center; position: relative; overflow: hidden;
}
.wallet-hero::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(circle at 80% 0%, rgba(143,217,212,0.16), transparent 55%);
}
.wallet-hero-label { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; position: relative; }
.wallet-hero-amount { font-family: var(--font-display); font-size: 42px; color: var(--ice); margin: 6px 0 16px; position: relative; letter-spacing: 0.5px; }
.ledger-row { display: flex; align-items: center; justify-content: space-between; padding: 12px 0; border-top: 1px solid var(--navy-3); }
.ledger-row:first-child { border-top: none; }
.ledger-desc { font-size: 13.5px; font-weight: 600; }
.ledger-date { font-size: 12px; color: var(--muted-2); margin-top: 2px; }
.ledger-amount { font-weight: 700; font-size: 14px; }
.ledger-amount.positive { color: var(--good); }
.ledger-amount.negative { color: var(--red); }

.airtel-box { background: var(--navy); border: 1px dashed var(--navy-4); border-radius: var(--radius-sm); padding: 16px; text-align: center; margin: 16px 0; }
.airtel-number { font-family: var(--font-display); font-size: 24px; letter-spacing: 1px; color: var(--white); margin: 4px 0; }
.ref-code { display: inline-block; background: var(--ice-tint); color: var(--ice); font-weight: 700; padding: 6px 14px; border-radius: 8px; letter-spacing: 1px; margin-top: 8px; }
.step-list { text-align: left; font-size: 13px; color: var(--muted); margin-top: 14px; padding-left: 18px; }
.step-list li { margin-bottom: 6px; }

/* ---------- Table-ish lists ---------- */
.list-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 0; border-top: 1px solid var(--navy-3); flex-wrap: wrap; }
.list-row:first-child { border-top: none; }
.list-row-main { display: flex; align-items: center; }
.list-row-title { font-size: 14px; font-weight: 600; }
.list-row-sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.list-row-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.seg { display: inline-flex; background: var(--navy); border-radius: 999px; padding: 3px; border: 1px solid var(--navy-4); }
.seg button { border: none; background: none; padding: 6px 12px; border-radius: 999px; font-size: 12px; font-weight: 600; color: var(--muted); }
.seg button.active { background: var(--ice); color: var(--navy); }

/* ---------- Modal ---------- */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(5, 10, 20, 0.65); backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center; padding: 20px; z-index: 100;
  animation: fadeIn 0.15s var(--ease);
}
.modal-card {
  width: 100%; max-width: 440px; background: var(--navy-2); border: 1px solid var(--navy-3);
  border-radius: 18px; padding: 24px; box-shadow: var(--shadow); max-height: 88vh; overflow-y: auto;
  animation: rise 0.2s var(--ease);
}
.modal-title { font-size: 18px; font-weight: 700; margin-bottom: 4px; }
.modal-sub { font-size: 13px; color: var(--muted); margin-bottom: 18px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.modal-close { position: absolute; }

/* ---------- Toast ---------- */
.toast-root { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; width: 100%; padding: 0 16px; pointer-events: none; }
.toast {
  background: var(--navy-3); border: 1px solid var(--navy-4); color: var(--white); padding: 12px 18px;
  border-radius: 999px; font-size: 13.5px; font-weight: 600; box-shadow: var(--shadow);
  animation: toastIn 0.2s var(--ease); max-width: 420px; text-align: center;
}
.toast.success { border-color: var(--good); color: var(--good); }
.toast.error { border-color: var(--red); color: var(--red); }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ---------- Loading ---------- */
.spinner { width: 20px; height: 20px; border-radius: 999px; border: 2.5px solid var(--navy-4); border-top-color: var(--ice); animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.skeleton { background: linear-gradient(90deg, var(--navy-3) 25%, var(--navy-4) 37%, var(--navy-3) 63%); background-size: 400% 100%; animation: shimmer 1.4s ease infinite; border-radius: var(--radius-sm); height: 90px; }
@keyframes shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* ---------- Sticky mobile action bar ---------- */
.push-bar { display: none; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: sticky; top: 0; height: auto; flex-direction: row; align-items: center;
    padding: 10px 12px; overflow-x: auto; z-index: 50; border-right: none; border-bottom: 1px solid var(--navy-3);
  }
  .brand { padding: 4px 10px 4px 2px; }
  .brand span { display: none; }
  .tabbar { flex-direction: row; flex: none; }
  .nav-label { display: none; }
  .tab-btn { flex-direction: column; gap: 3px; padding: 7px 12px; font-size: 10.5px; }
  .tab-btn span { flex: none; }
  .tab-btn svg { width: 20px; height: 20px; }
  .tab-btn.active { box-shadow: none; background: var(--red-tint); }
  .logout-btn { margin: 0 0 0 6px; padding: 8px; white-space: nowrap; }
  .content { padding: 18px 16px 90px; }
  .wallet-hero-amount { font-size: 34px; }
}

@media (max-width: 520px) {
  .panel-head { flex-direction: column; align-items: flex-start; }
  .session-date { font-size: 22px; }
  .modal-card { padding: 18px; }
}
