/* ══════════════════════════════════════════════════════════════
   Wise (wise.live) — front-end study recreation
   Rebuilt from public product screenshots: dark aubergine surfaces,
   violet primary, Inter. Own code — no vendor assets embedded.
   ══════════════════════════════════════════════════════════════ */

:root {
  --bg: #131019;
  --bg-soft: #17131F;
  --panel: #1A1523;
  --card: #1E1830;
  --card-2: #241C33;
  --line: rgba(255, 255, 255, 0.08);
  --line-soft: rgba(255, 255, 255, 0.05);

  --violet-600: #7C3AED;
  --violet-500: #8B5CF6;
  --violet-400: #A78BFA;
  --violet-300: #C4B5FD;
  --violet-bar: #D9CCF8;

  --text: #F4F1F8;
  --text-mut: #A79FB3;
  --text-dim: #6E6579;

  --green: #34D399;  --green-bg: rgba(52, 211, 153, 0.14);
  --amber: #FBBF24;  --amber-bg: rgba(251, 191, 36, 0.14);
  --red: #F87171;    --red-bg: rgba(248, 113, 113, 0.14);
  --blue: #60A5FA;   --blue-bg: rgba(96, 165, 250, 0.16);

  --font: "Inter", "Segoe UI", system-ui, sans-serif;
  --r-sm: 8px; --r-md: 12px; --r-lg: 16px; --r-full: 999px;
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 20px; --sp-6: 24px; --sp-8: 32px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --shadow: 0 12px 40px -12px rgba(0, 0, 0, 0.55);

  --hover: rgba(255, 255, 255, 0.05);
  --track: rgba(255, 255, 255, 0.07);
  --top-bg: rgba(19, 16, 25, 0.85);
  --hourline: rgba(255, 255, 255, 0.05);
  --tip-bg: #0D0A12;
}

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
body {
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  background: var(--bg);
  color: var(--text);
  min-height: 100dvh;
}
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input, select, textarea { font: inherit; }
svg { display: block; }
h1, h2, h3 { font-weight: 700; letter-spacing: -0.01em; }
:focus-visible { outline: 2px solid var(--violet-400); outline-offset: 2px; border-radius: 4px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ══ frame ══ */
.app { display: grid; grid-template-columns: 250px minmax(0, 1fr); min-height: 100dvh; }

.side {
  position: sticky; top: 0; height: 100dvh; z-index: 50;
  background: var(--bg-soft);
  border-right: 1px solid var(--line-soft);
  display: flex; flex-direction: column;
  padding: var(--sp-5) var(--sp-3);
}
.side-brand { display: flex; align-items: center; gap: 10px; padding: var(--sp-2) var(--sp-3) var(--sp-5); }
.side-logo {
  width: 36px; height: 36px; border-radius: 10px;
  display: grid; place-items: center;
  background: linear-gradient(140deg, var(--violet-500), var(--violet-600));
  font-weight: 800; font-size: 1.05rem; color: #fff;
  box-shadow: 0 6px 18px -6px rgba(124, 58, 237, 0.65);
}
.side-brand-text strong { display: block; font-size: 1rem; }
.side-brand-text span { font-size: 0.68rem; color: var(--text-dim); letter-spacing: 0.05em; text-transform: uppercase; }

.side-nav { display: flex; flex-direction: column; gap: 2px; overflow-y: auto; }
.snav {
  display: flex; align-items: center; gap: 11px;
  min-height: 42px; padding: 0 var(--sp-3);
  border-radius: var(--r-sm);
  color: var(--text-mut); font-weight: 500; font-size: 0.875rem;
  transition: background 180ms var(--ease), color 180ms var(--ease);
  text-align: left; width: 100%;
}
.snav svg { width: 18px; height: 18px; flex: 0 0 auto; }
.snav:hover { background: var(--hover); color: var(--text); }
.snav.on { background: rgba(124, 58, 237, 0.16); color: var(--violet-300); font-weight: 600; }
.snav.on svg { color: var(--violet-400); }

.side-foot { margin-top: auto; padding-top: var(--sp-4); border-top: 1px solid var(--line-soft); }
.side-org { display: flex; align-items: center; gap: 10px; padding: var(--sp-2) var(--sp-2); }
.side-org-avatar {
  width: 34px; height: 34px; border-radius: 9px; flex: 0 0 auto;
  display: grid; place-items: center;
  background: var(--card-2); border: 1px solid var(--line);
  font-size: 0.7rem; font-weight: 700; color: var(--violet-300);
}
.side-org-text { min-width: 0; }
.side-org-text strong { display: block; font-size: 0.78rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-org-text span { font-size: 0.68rem; color: var(--text-dim); }

/* topbar */
.main { min-width: 0; display: flex; flex-direction: column; }
.top {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-6);
  background: var(--top-bg);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line-soft);
}
.menu-btn { display: none; }
.icon-ghost {
  width: 40px; height: 40px; border-radius: var(--r-sm);
  display: grid; place-items: center; color: var(--text-mut);
}
.icon-ghost:hover { background: var(--hover); color: var(--text); }
.icon-ghost svg { width: 20px; height: 20px; }
.top-search {
  flex: 1; max-width: 460px;
  display: flex; align-items: center; gap: 9px;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--r-sm); padding: 0 var(--sp-3); min-height: 40px;
}
.top-search svg { width: 16px; height: 16px; color: var(--text-dim); }
.top-search input { flex: 1; background: none; border: 0; outline: 0; color: var(--text); min-width: 0; font-size: 0.86rem; }
.top-search input::placeholder { color: var(--text-dim); }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: var(--sp-2); }
.btn-outline {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 38px; padding: 0 14px;
  border: 1px solid var(--line); border-radius: var(--r-sm);
  font-size: 0.82rem; font-weight: 600; color: var(--text-mut);
  transition: all 180ms var(--ease);
}
.btn-outline:hover { border-color: var(--violet-500); color: var(--violet-300); }
.btn-outline svg { width: 15px; height: 15px; }
.top-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center;
  background: linear-gradient(140deg, var(--violet-600), #4C1D95);
  font-size: 0.72rem; font-weight: 700;
}

.content { padding: var(--sp-6); max-width: 1440px; width: 100%; margin-inline: auto; }

/* ══ shared ══ */
.view-head { display: flex; align-items: center; gap: var(--sp-3); margin-bottom: var(--sp-5); flex-wrap: wrap; }
.view-head h1 { font-size: 1.35rem; }
.view-head .sub { color: var(--text-dim); font-size: 0.82rem; margin-top: 2px; }
.view-head .grow { flex: 1; }

.btn-p {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 42px; padding: 0 18px;
  background: linear-gradient(140deg, var(--violet-500), var(--violet-600));
  border-radius: var(--r-sm);
  font-weight: 600; font-size: 0.875rem; color: #fff;
  box-shadow: 0 8px 22px -8px rgba(124, 58, 237, 0.7);
  transition: transform 120ms var(--ease), box-shadow 180ms var(--ease);
}
.btn-p:hover { box-shadow: 0 10px 26px -8px rgba(124, 58, 237, 0.9); }
.btn-p:active { transform: scale(0.97); }
.btn-p svg { width: 16px; height: 16px; }
.btn-2 {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 40px; padding: 0 14px;
  background: var(--card-2); border: 1px solid var(--line);
  border-radius: var(--r-sm);
  font-weight: 600; font-size: 0.82rem; color: var(--text-mut);
  transition: all 180ms var(--ease);
}
.btn-2:hover { color: var(--text); border-color: rgba(255,255,255,0.18); }

.panel {
  background: var(--panel);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-lg);
  padding: var(--sp-5);
}
.panel-title { display: flex; align-items: baseline; justify-content: space-between; gap: var(--sp-3); margin-bottom: var(--sp-4); }
.panel-title h2 { font-size: 1rem; }
.panel-title .sub { font-size: 0.76rem; color: var(--text-dim); }

.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; border-radius: var(--r-full);
  font-size: 0.7rem; font-weight: 600;
}
.pill.green { background: var(--green-bg); color: var(--green); }
.pill.amber { background: var(--amber-bg); color: var(--amber); }
.pill.red   { background: var(--red-bg);   color: var(--red); }
.pill.blue  { background: var(--blue-bg);  color: var(--blue); }
.pill.violet{ background: rgba(139, 92, 246, 0.16); color: var(--violet-300); }
.pill.gray  { background: rgba(255,255,255,0.07); color: var(--text-mut); }

.seg-tabs { display: inline-flex; background: var(--card); border: 1px solid var(--line-soft); border-radius: var(--r-sm); padding: 3px; gap: 2px; }
.seg-tabs button {
  min-height: 34px; padding: 0 14px; border-radius: 6px;
  font-size: 0.8rem; font-weight: 600; color: var(--text-dim);
  transition: all 160ms var(--ease);
}
.seg-tabs button.on { background: rgba(139, 92, 246, 0.18); color: var(--violet-300); }

.avatar-dot {
  width: 34px; height: 34px; border-radius: 50%; flex: 0 0 auto;
  display: grid; place-items: center;
  font-size: 0.68rem; font-weight: 700;
  background: var(--card-2); border: 1px solid var(--line); color: var(--violet-300);
  position: relative;
}
.avatar-dot .on-dot { position: absolute; right: -1px; bottom: -1px; width: 9px; height: 9px; border-radius: 50%; background: var(--green); border: 2px solid var(--panel); }

.table { width: 100%; border-collapse: collapse; font-size: 0.84rem; }
.table th {
  text-align: left; font-size: 0.7rem; font-weight: 600; letter-spacing: 0.04em;
  color: var(--text-dim); text-transform: uppercase;
  padding: 10px 12px; border-bottom: 1px solid var(--line-soft);
}
.table td { padding: 13px 12px; border-bottom: 1px solid var(--line-soft); }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background 140ms var(--ease); }
.table tbody tr:hover { background: var(--hover); }
.tab-num { font-variant-numeric: tabular-nums; }
.t-mut { color: var(--text-mut); }
.t-dim { color: var(--text-dim); font-size: 0.76rem; }
.t-violet { color: var(--violet-400); font-weight: 600; }
.scroll-x { overflow-x: auto; }

.empty { text-align: center; color: var(--text-dim); padding: var(--sp-8); border: 1.5px dashed var(--line); border-radius: var(--r-md); }

/* ══ dashboard ══ */
.kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-4); margin-bottom: var(--sp-4); }
.kpi-card {
  display: flex; align-items: center; gap: var(--sp-4);
  background: var(--panel); border: 1px solid var(--line-soft);
  border-radius: var(--r-lg); padding: var(--sp-5);
}
.kpi-ic {
  width: 44px; height: 44px; border-radius: var(--r-md); flex: 0 0 auto;
  display: grid; place-items: center;
  background: var(--card-2); border: 1px solid var(--line); color: var(--violet-300);
}
.kpi-ic svg { width: 20px; height: 20px; }
.kpi-card strong { display: block; font-size: 1.35rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.kpi-card span { font-size: 0.78rem; color: var(--text-dim); }

.dash { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: var(--sp-4); }
.dash-left, .dash-right { display: flex; flex-direction: column; gap: var(--sp-4); min-width: 0; }

.chart-wrap { position: relative; }
.chart-tip {
  position: absolute; top: 18px; left: 50%; transform: translateX(-50%);
  background: var(--tip-bg); border: 1px solid var(--line);
  padding: 5px 11px; border-radius: var(--r-full);
  font-size: 0.72rem; color: var(--violet-300); font-weight: 600;
  white-space: nowrap; pointer-events: none;
}
.line-chart { width: 100%; height: 220px; }
.line-chart .axis { font-size: 9px; fill: var(--text-dim); }
.line-chart .grid-l { stroke: rgba(255,255,255,0.05); }
.line-chart .series { fill: none; stroke: var(--violet-500); stroke-width: 2; }

.insight { display: flex; gap: var(--sp-3); padding: var(--sp-3) 0; border-top: 1px solid var(--line-soft); }
.insight:first-of-type { border-top: 0; }
.insight-ic { width: 34px; height: 34px; flex: 0 0 auto; border-radius: var(--r-sm); display: grid; place-items: center; background: var(--amber-bg); color: var(--amber); }
.insight-ic.spark { background: rgba(139, 92, 246, 0.15); color: var(--violet-300); }
.insight-ic svg { width: 16px; height: 16px; }
.insight strong { display: block; font-size: 0.84rem; }
.insight p { font-size: 0.78rem; color: var(--text-mut); margin-top: 2px; }

.tc-row { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-2) 0; }
.tc-thumb { width: 40px; height: 40px; border-radius: var(--r-sm); flex: 0 0 auto; display: grid; place-items: center; font-weight: 800; font-size: 0.9rem; color: #fff; }
.tc-row strong { display: block; font-size: 0.83rem; }
.tc-row .t-dim { display: flex; gap: 8px; align-items: center; }

.live-tile { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); }
.live-count { font-size: 2rem; font-weight: 800; color: var(--violet-300); font-variant-numeric: tabular-nums; }

/* ══ calendar ══ */
.cal-bar { display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; margin-bottom: var(--sp-4); }
.cal-nav { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: var(--r-sm); overflow: hidden; }
.cal-nav button { width: 38px; height: 38px; display: grid; place-items: center; color: var(--text-mut); }
.cal-nav button:hover { background: var(--hover); color: var(--text); }
.cal-nav .range { padding: 0 14px; font-size: 0.84rem; font-weight: 600; border-inline: 1px solid var(--line); min-height: 38px; display: inline-flex; align-items: center; }
.cal-nav svg { width: 16px; height: 16px; }
.tz-select {
  background: var(--panel); border: 1px solid var(--line); color: var(--text-mut);
  border-radius: var(--r-sm); min-height: 38px; padding: 0 10px; font-size: 0.8rem;
}

.cal-scroll { overflow-x: auto; border: 1px solid var(--line-soft); border-radius: var(--r-lg); background: var(--panel); }
.cal-grid { display: grid; grid-template-columns: 56px repeat(7, minmax(108px, 1fr)); min-width: 860px; }
.cal-corner { border-bottom: 1px solid var(--line-soft); }
.cal-day-h {
  text-align: center; padding: 10px 4px 12px;
  border-bottom: 1px solid var(--line-soft); border-left: 1px solid var(--line-soft);
}
.cal-day-h .dname { font-size: 0.66rem; letter-spacing: 0.1em; color: var(--text-dim); text-transform: uppercase; }
.cal-day-h .dnum {
  width: 30px; height: 30px; margin: 4px auto 0; border-radius: 50%;
  display: grid; place-items: center; font-weight: 600; font-size: 0.85rem;
}
.cal-day-h.today .dnum { border: 1.5px solid var(--violet-400); color: var(--violet-300); }
.cal-time { grid-column: 1; font-size: 0.68rem; color: var(--text-dim); text-align: right; padding: 4px 8px 0 0; border-top: 1px solid var(--line-soft); font-variant-numeric: tabular-nums; }
.cal-cell { border-left: 1px solid var(--line-soft); border-top: 1px solid var(--line-soft); position: relative; height: 52px; }
.cal-col { position: relative; }

.cal-block {
  position: absolute; left: 3px; right: 3px;
  border-radius: 6px; padding: 5px 8px;
  border-left: 3px solid;
  font-size: 0.72rem; font-weight: 600;
  overflow: hidden; cursor: pointer;
  transition: filter 140ms var(--ease);
  text-align: left;
}
.cal-block:hover { filter: brightness(1.25); }
.cal-block span { display: block; font-weight: 500; font-size: 0.66rem; opacity: 0.8; }
.k-chem { background: rgba(20, 184, 166, 0.16); border-color: #14B8A6; color: #5EEAD4; }
.k-phys { background: rgba(59, 130, 246, 0.16); border-color: #3B82F6; color: #93C5FD; }
.k-alg  { background: rgba(99, 102, 241, 0.18); border-color: #6366F1; color: #A5B4FC; }
.k-stat { background: rgba(139, 92, 246, 0.16); border-color: #8B5CF6; color: #C4B5FD; }
.k-adv  { background: rgba(255, 255, 255, 0.07); border-color: #9CA3AF; color: #E5E7EB; }
.k-eng  { background: rgba(217, 70, 239, 0.14); border-color: #D946EF; color: #F0ABFC; }
.k-sci  { background: rgba(234, 179, 8, 0.12); border-color: #EAB308; color: #FDE047; }

/* availability */
.avail-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: var(--sp-4); }
.mini-cal { text-align: center; }
.mini-cal .mc-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--sp-3); font-weight: 600; font-size: 0.9rem; }
.mini-cal .mc-head button { width: 32px; height: 32px; display: grid; place-items: center; color: var(--text-mut); border-radius: 6px; }
.mini-cal .mc-head button:hover { background: rgba(255,255,255,0.06); }
.mini-cal .mc-head svg { width: 15px; height: 15px; }
.mc-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; font-size: 0.75rem; }
.mc-grid .mc-dow { color: var(--text-dim); font-weight: 600; padding: 4px 0; font-size: 0.66rem; }
.mc-grid button {
  aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center;
  color: var(--text-mut); font-variant-numeric: tabular-nums;
}
.mc-grid button:hover { background: var(--hover); }
.mc-grid button.sel { background: var(--violet-600); color: #fff; font-weight: 700; }
.mc-grid button.dim { color: var(--text-dim); opacity: 0.4; }

.tutor-filter { margin-top: var(--sp-4); }
.tf-search { display: flex; align-items: center; gap: 8px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-sm); min-height: 38px; padding: 0 10px; margin-bottom: var(--sp-3); }
.tf-search svg { width: 14px; height: 14px; color: var(--text-dim); }
.tf-search input { flex: 1; background: none; border: 0; outline: 0; color: var(--text); font-size: 0.8rem; min-width: 0; }
.tf-check { display: flex; align-items: center; gap: 10px; padding: 8px 4px; font-size: 0.84rem; color: var(--text-mut); cursor: pointer; border-radius: 6px; }
.tf-check:hover { background: var(--hover); }
.tf-check input { accent-color: var(--violet-600); width: 16px; height: 16px; }

/* ══ courses ══ */
.course-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: var(--sp-4); }
.course-card {
  background: var(--panel); border: 1px solid var(--line-soft); border-radius: var(--r-lg);
  padding: var(--sp-5); text-align: left;
  transition: transform 150ms var(--ease), border-color 180ms var(--ease);
}
.course-card:hover { transform: translateY(-2px); border-color: rgba(139, 92, 246, 0.4); }
.cc-top { display: flex; align-items: center; gap: var(--sp-3); margin-bottom: var(--sp-3); }
.cc-thumb { width: 44px; height: 44px; border-radius: var(--r-md); display: grid; place-items: center; font-weight: 800; font-size: 1rem; color: #fff; }
.cc-tag { font-size: 0.64rem; letter-spacing: 0.08em; color: var(--text-dim); font-weight: 700; }
.course-card h3 { font-size: 0.95rem; }
.cc-meta { display: flex; gap: var(--sp-4); margin: var(--sp-3) 0; font-size: 0.78rem; color: var(--text-mut); }
.cc-meta strong { color: var(--text); font-variant-numeric: tabular-nums; }
.cc-bar { height: 6px; border-radius: 3px; background: var(--track); overflow: hidden; margin-bottom: 8px; }
.cc-bar i { display: block; height: 100%; border-radius: 3px; background: linear-gradient(90deg, var(--violet-500), var(--violet-400)); }

/* ══ learners ══ */
.learner-name { display: flex; align-items: center; gap: 10px; }
.lvl-chip { font-size: 0.7rem; color: var(--violet-300); font-weight: 700; }

.profile { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: var(--sp-4); }
.prof-card { text-align: center; }
.prof-badge {
  width: 130px; height: 130px; margin: var(--sp-3) auto; border-radius: 50%;
  display: grid; place-items: center; position: relative;
  background: radial-gradient(circle at 30% 25%, #4C1D95, #1E1330 70%);
  border: 3px solid var(--violet-600);
  box-shadow: 0 0 40px -8px rgba(124, 58, 237, 0.7);
}
.prof-badge svg { width: 62px; height: 62px; color: var(--violet-300); }
.prof-level { color: var(--violet-300); font-weight: 700; font-size: 0.84rem; }
.prof-pts { font-size: 0.74rem; color: var(--text-dim); margin-bottom: var(--sp-3); }
.prof-name-row { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); padding: var(--sp-3) 0; border-top: 1px solid var(--line-soft); }
.prof-name-row h2 { font-size: 1.05rem; }
.gems { display: inline-flex; align-items: center; gap: 6px; color: var(--violet-300); font-weight: 800; font-size: 1.15rem; }
.gems svg { width: 18px; height: 18px; color: var(--amber); }
.prof-facts { text-align: left; margin-top: var(--sp-2); }
.prof-facts .row { display: grid; grid-template-columns: 130px 1fr; gap: 8px; padding: 7px 0; font-size: 0.8rem; }
.prof-facts .row b { color: var(--text-mut); font-weight: 500; }

.prof-tabs { display: flex; gap: var(--sp-4); border-bottom: 1px solid var(--line-soft); margin-bottom: var(--sp-4); overflow-x: auto; }
.prof-tabs button {
  padding: 10px 2px; font-size: 0.84rem; font-weight: 600; color: var(--text-dim);
  border-bottom: 2px solid transparent; white-space: nowrap;
}
.prof-tabs button.on { color: var(--violet-300); border-color: var(--violet-500); }
.stat-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-3); margin-bottom: var(--sp-4); }
.stat-tile { background: var(--card); border: 1px solid var(--line-soft); border-radius: var(--r-md); padding: var(--sp-4); }
.stat-tile span { font-size: 0.74rem; color: var(--text-dim); display: flex; align-items: center; gap: 5px; }
.stat-tile strong { font-size: 1.25rem; font-variant-numeric: tabular-nums; }

/* ══ payments ══ */
.fee-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: var(--sp-4); margin-bottom: var(--sp-4); }
.fee-chart { display: flex; align-items: flex-end; gap: var(--sp-8); height: 230px; padding: var(--sp-4) var(--sp-3) 0; }
.fee-col { flex: 1; display: flex; align-items: flex-end; justify-content: center; gap: 8px; height: 100%; position: relative; }
.fee-col .bars { display: flex; align-items: flex-end; gap: 8px; height: calc(100% - 22px); }
.fee-col .m { position: absolute; bottom: 0; left: 0; right: 0; text-align: center; font-size: 0.76rem; color: var(--text-dim); }
.fee-bar { width: 34px; border-radius: 6px 6px 2px 2px; min-height: 4px; }
.fee-bar.collected { background: var(--violet-bar); }
.fee-bar.pending { background: var(--violet-600); }
.legend { display: flex; gap: var(--sp-4); font-size: 0.76rem; color: var(--text-mut); }
.legend i { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; }

/* ══ chat ══ */
.chat-wrap { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: var(--sp-4); height: calc(100dvh - 170px); min-height: 480px; }
.chat-list { overflow-y: auto; padding: var(--sp-2); }
.chat-item {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  padding: 10px; border-radius: var(--r-md);
  transition: background 150ms var(--ease);
}
.chat-item:hover { background: var(--hover); }
.chat-item.on { background: rgba(124, 58, 237, 0.14); }
.chat-item strong { display: block; font-size: 0.85rem; }
.chat-item span { font-size: 0.72rem; color: var(--text-dim); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 180px; }

.chat-pane { display: flex; flex-direction: column; min-width: 0; }
.chat-head { display: flex; align-items: center; gap: 10px; padding-bottom: var(--sp-3); border-bottom: 1px solid var(--line-soft); flex-wrap: wrap; }
.chat-head h2 { font-size: 0.95rem; }
.chat-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.chat-tag { font-size: 0.66rem; padding: 3px 9px; border-radius: var(--r-full); background: var(--card-2); border: 1px solid var(--line); color: var(--text-mut); }
.chat-body { flex: 1; overflow-y: auto; padding: var(--sp-4) var(--sp-2); display: flex; flex-direction: column; gap: var(--sp-3); }
.msg { display: flex; gap: 10px; max-width: 78%; }
.msg.me { align-self: flex-end; flex-direction: row-reverse; }
.msg-bubble { background: var(--card-2); border: 1px solid var(--line-soft); border-radius: 12px; padding: 10px 13px; font-size: 0.83rem; }
.msg.me .msg-bubble { background: rgba(124, 58, 237, 0.2); border-color: rgba(139, 92, 246, 0.35); }
.msg .from { font-size: 0.72rem; color: var(--text-mut); margin-bottom: 3px; font-weight: 600; }
.msg .when { font-size: 0.64rem; color: var(--text-dim); margin-top: 4px; text-align: right; }
.msg-file { display: flex; align-items: center; gap: 10px; }
.msg-file .f-ic { width: 34px; height: 34px; border-radius: 8px; background: var(--red-bg); color: var(--red); display: grid; place-items: center; }
.msg-file .f-ic svg { width: 16px; height: 16px; }
.msg-file strong { font-size: 0.8rem; display: block; }
.msg-file span { font-size: 0.68rem; color: var(--text-dim); }
.chat-divider { align-self: center; font-size: 0.66rem; color: var(--text-dim); background: var(--card); padding: 3px 12px; border-radius: var(--r-full); border: 1px solid var(--line-soft); }
.chat-input { display: flex; align-items: center; gap: 8px; border-top: 1px solid var(--line-soft); padding-top: var(--sp-3); }
.chat-input input { flex: 1; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-full); min-height: 44px; padding: 0 18px; color: var(--text); outline: 0; font-size: 0.86rem; min-width: 0; }
.chat-input input:focus { border-color: var(--violet-500); }
.chat-send { width: 44px; height: 44px; border-radius: 50%; background: var(--violet-600); display: grid; place-items: center; flex: 0 0 auto; }
.chat-send svg { width: 18px; height: 18px; color: #fff; }

/* ══ engage / tests ══ */
.engage-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: var(--sp-4); margin-bottom: var(--sp-4); }
.engage-card { background: var(--panel); border: 1px solid var(--line-soft); border-radius: var(--r-lg); padding: var(--sp-5); }
.engage-card h3 { font-size: 0.92rem; margin-bottom: 4px; }
.engage-card p { font-size: 0.78rem; color: var(--text-mut); min-height: 38px; }
.engage-card .stat { font-size: 0.7rem; color: var(--violet-300); font-weight: 600; margin: var(--sp-2) 0 var(--sp-3); display: block; }

.lb-row { display: flex; align-items: center; gap: var(--sp-3); padding: 9px 0; border-top: 1px solid var(--line-soft); font-size: 0.85rem; }
.lb-row:first-child { border-top: 0; }
.lb-rank { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 0.72rem; font-weight: 700; background: var(--card-2); color: var(--text-mut); flex: 0 0 auto; }
.lb-row:nth-child(1) .lb-rank { background: rgba(251, 191, 36, 0.18); color: var(--amber); }
.lb-pts { margin-left: auto; font-weight: 700; color: var(--violet-300); font-variant-numeric: tabular-nums; }

/* ══ recordings ══ */
.rec-row { display: flex; align-items: center; gap: var(--sp-4); padding: var(--sp-4) 0; border-top: 1px solid var(--line-soft); flex-wrap: wrap; }
.rec-row:first-child { border-top: 0; }
.rec-play { width: 44px; height: 44px; border-radius: var(--r-md); background: rgba(124, 58, 237, 0.16); color: var(--violet-300); display: grid; place-items: center; flex: 0 0 auto; }
.rec-play svg { width: 18px; height: 18px; }
.rec-row strong { display: block; font-size: 0.88rem; }
.rec-actions { margin-left: auto; display: flex; gap: var(--sp-2); }

/* ══ settings ══ */
.int-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: var(--sp-4); }
.int-card { display: flex; gap: var(--sp-3); background: var(--panel); border: 1px solid var(--line-soft); border-radius: var(--r-lg); padding: var(--sp-4); align-items: flex-start; }
.int-logo { width: 40px; height: 40px; border-radius: var(--r-sm); background: var(--card-2); border: 1px solid var(--line); display: grid; place-items: center; font-weight: 800; color: var(--violet-300); flex: 0 0 auto; }
.int-card strong { font-size: 0.88rem; display: block; }
.int-card p { font-size: 0.75rem; color: var(--text-mut); margin: 2px 0 8px; }
.storage-bar { height: 8px; border-radius: 4px; background: var(--track); overflow: hidden; margin: var(--sp-2) 0; }
.storage-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--violet-500), var(--violet-300)); border-radius: 4px; }

/* ══ overlays ══ */
.scrim { position: fixed; inset: 0; z-index: 90; background: rgba(5, 3, 8, 0.6); backdrop-filter: blur(3px); animation: fade 200ms var(--ease); }
@keyframes fade { from { opacity: 0; } }

.modal-root {
  position: fixed; z-index: 100; inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  width: min(920px, calc(100vw - 32px));
  max-height: 90dvh; overflow-y: auto;
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
  animation: pop 220ms var(--ease);
}
@keyframes pop { from { opacity: 0; } }

/* Add Session — white sheet like Wise's real screen */
.sheet { background: #FFFFFF; color: #111827; border-radius: var(--r-lg); overflow: hidden; }
.sheet-head { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-5) var(--sp-6); border-bottom: 1px solid #F3F4F6; }
.sheet-head h2 { font-size: 1.15rem; font-weight: 700; }
.sheet-back { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 8px; color: #374151; }
.sheet-back:hover { background: #F3F4F6; }
.sheet-back svg { width: 19px; height: 19px; }
.sheet-head .btn-p { margin-left: auto; }
.sheet-grid { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 0; }
.sheet-form { padding: var(--sp-5) var(--sp-6); border-right: 1px solid #F3F4F6; }
.sf-label { display: flex; align-items: center; justify-content: space-between; font-size: 0.8rem; font-weight: 600; color: #374151; margin: var(--sp-4) 0 6px; }
.sf-label:first-child { margin-top: 0; }
.sf-label .add-tag { color: #7C3AED; font-weight: 600; font-size: 0.78rem; display: inline-flex; gap: 5px; align-items: center; }
.sf-label .add-tag svg { width: 13px; height: 13px; }
.sheet-form input, .sheet-form select {
  width: 100%; min-height: 44px; border: 1px solid #E5E7EB; border-radius: 8px;
  padding: 0 12px; font-size: 0.9rem; background: #fff; color: #111827;
}
.sheet-form input:focus, .sheet-form select:focus { outline: 2px solid #C4B5FD; border-color: #8B5CF6; }
.sf-help { font-size: 0.74rem; color: #6B7280; margin-top: 6px; }
.tag-row { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.tag-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 0.72rem; font-weight: 600; padding: 3px 9px; border-radius: 6px; border: 1px solid; }
.tag-chip.red { color: #DC2626; border-color: #FECACA; background: #FEF2F2; }
.tag-chip.yellow { color: #B45309; border-color: #FDE68A; background: #FFFBEB; }
.tag-chip button { display: grid; place-items: center; }
.tag-chip svg { width: 11px; height: 11px; }
.sheet-cal { padding: var(--sp-5) var(--sp-6); background: #FAFAFB; }
.sheet-cal .mini-week { border: 1px solid #E5E7EB; border-radius: 12px; background: #fff; overflow: hidden; }
.mw-head { display: grid; grid-template-columns: repeat(7, 1fr); border-bottom: 1px solid #F3F4F6; }
.mw-head div { text-align: center; padding: 9px 2px; font-size: 0.68rem; color: #6B7280; font-weight: 600; }
.mw-head div.today { color: #7C3AED; }
.mw-body { display: grid; grid-template-columns: repeat(7, 1fr); min-height: 200px; }
.mw-col { border-left: 1px solid #F3F4F6; padding: 6px 4px; display: flex; flex-direction: column; gap: 4px; }
.mw-col:first-child { border-left: 0; }
.mw-chip { border-radius: 5px; font-size: 0.62rem; font-weight: 600; padding: 4px 6px; }
.mw-chip.chem { background: #CCFBF1; color: #0F766E; }
.mw-chip.phys { background: #DBEAFE; color: #1D4ED8; }
.mw-chip.alg { background: #E0E7FF; color: #4338CA; }
.mw-chip.stat { background: #EDE9FE; color: #6D28D9; }
.mw-chip.adv { background: #F3F4F6; color: #374151; }
.mw-chip.new { background: #7C3AED; color: #fff; }

/* dark modal (session detail / generic) */
.dmodal { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--sp-6); position: relative; }
.dmodal h2 { font-size: 1.2rem; }
.dmodal .tagline { font-size: 0.72rem; letter-spacing: 0.1em; color: var(--text-dim); font-weight: 700; margin-bottom: var(--sp-4); }
.sess-meta { display: flex; gap: var(--sp-4); align-items: center; margin: var(--sp-4) 0; }
.date-tile { width: 54px; border-radius: 10px; overflow: hidden; text-align: center; border: 1px solid var(--line); flex: 0 0 auto; }
.date-tile .dt-m { background: #0D0A12; font-size: 0.6rem; font-weight: 800; letter-spacing: 0.08em; padding: 3px 0; color: var(--text-mut); }
.date-tile .dt-d { font-size: 1.25rem; font-weight: 800; padding: 5px 0; background: var(--card-2); }
.sess-meta strong { display: block; font-size: 0.95rem; }
.sess-meta .t-dim { margin-top: 2px; }
.dmodal .btn-p.w { width: 100%; justify-content: center; margin-top: var(--sp-4); }
.dmodal-close { position: absolute; top: 14px; right: 14px; width: 38px; height: 38px; border-radius: 8px; display: grid; place-items: center; color: var(--text-mut); }
.dmodal-close:hover { background: var(--hover); color: var(--text); }
.dmodal-close svg { width: 17px; height: 17px; }

/* toast */
.toast-root { position: fixed; z-index: 120; bottom: 22px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; width: min(420px, calc(100vw - 32px)); pointer-events: none; }
.toast {
  display: flex; align-items: center; gap: 10px;
  background: #0D0A12; border: 1px solid var(--line);
  color: var(--text); border-radius: var(--r-md);
  padding: 12px 16px; font-size: 0.84rem; font-weight: 500;
  box-shadow: var(--shadow);
  animation: rise 220ms var(--ease);
}
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
.toast svg { width: 16px; height: 16px; color: var(--green); flex: 0 0 auto; }

/* ══ responsive ══ */
@media (max-width: 1180px) {
  .dash { grid-template-columns: 1fr; }
  .profile { grid-template-columns: 1fr; }
  .fee-grid { grid-template-columns: 1fr; }
  .avail-wrap { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .side {
    position: fixed; inset: 0 auto 0 0; width: 270px;
    transform: translateX(-100%);
    transition: transform 240ms var(--ease);
    box-shadow: var(--shadow);
  }
  .side.open { transform: none; }
  .menu-btn { display: grid; }
  .content { padding: var(--sp-4); }
  .kpis { grid-template-columns: 1fr; }
  .chat-wrap { grid-template-columns: 1fr; height: auto; }
  .chat-list { max-height: 200px; }
  .sheet-grid { grid-template-columns: 1fr; }
  .sheet-form { border-right: 0; border-bottom: 1px solid #F3F4F6; }
  .stat-tiles { grid-template-columns: 1fr; }
  .top-actions .btn-outline { display: none; }
}
@media (max-width: 480px) {
  .view-head h1 { font-size: 1.15rem; }
  .fee-chart { gap: var(--sp-4); }
  .fee-bar { width: 24px; }
}

/* ══ Light theme — how Wise's operational screens look ══ */
:root[data-theme="light"] {
  --bg: #F6F6F9;
  --bg-soft: #FFFFFF;
  --panel: #FFFFFF;
  --card: #F6F6F9;
  --card-2: #EFEDF5;
  --line: rgba(17, 24, 39, 0.12);
  --line-soft: rgba(17, 24, 39, 0.07);
  --text: #111827;
  --text-mut: #4B5563;
  --text-dim: #9CA3AF;
  --hover: rgba(17, 24, 39, 0.045);
  --track: rgba(17, 24, 39, 0.08);
  --top-bg: rgba(255, 255, 255, 0.85);
  --hourline: rgba(17, 24, 39, 0.05);
  --tip-bg: #111827;
  --shadow: 0 12px 40px -12px rgba(17, 24, 39, 0.18);
}
:root[data-theme="light"] .side-brand-text span { color: #9CA3AF; }
:root[data-theme="light"] .snav.on { background: rgba(124, 58, 237, 0.10); color: #6D28D9; }
:root[data-theme="light"] .snav.on svg { color: #7C3AED; }
:root[data-theme="light"] .top-avatar, :root[data-theme="light"] .side-logo { color: #fff; }
:root[data-theme="light"] .seg-tabs button.on { background: rgba(124, 58, 237, 0.12); color: #6D28D9; }
:root[data-theme="light"] .avatar-dot { color: #6D28D9; }
:root[data-theme="light"] .kpi-ic, :root[data-theme="light"] .int-logo { color: #6D28D9; }
:root[data-theme="light"] .lvl-chip, :root[data-theme="light"] .t-violet,
:root[data-theme="light"] .live-count, :root[data-theme="light"] .gems,
:root[data-theme="light"] .prof-level, :root[data-theme="light"] .lb-pts,
:root[data-theme="light"] .engage-card .stat, :root[data-theme="light"] .rec-play { color: #6D28D9; }
:root[data-theme="light"] .pill.violet { background: rgba(124, 58, 237, 0.10); color: #6D28D9; }
:root[data-theme="light"] .pill.green { background: #D1FAE5; color: #047857; }
:root[data-theme="light"] .pill.amber { background: #FEF3C7; color: #B45309; }
:root[data-theme="light"] .pill.red   { background: #FEE2E2; color: #B91C1C; }
:root[data-theme="light"] .pill.blue  { background: #DBEAFE; color: #1D4ED8; }
:root[data-theme="light"] .pill.gray  { background: rgba(17, 24, 39, 0.07); color: #4B5563; }
:root[data-theme="light"] .insight-ic { background: #FEF3C7; color: #B45309; }
:root[data-theme="light"] .insight-ic.spark { background: rgba(124, 58, 237, 0.10); color: #6D28D9; }
:root[data-theme="light"] .k-chem { background: #CCFBF1; border-color: #14B8A6; color: #0F766E; }
:root[data-theme="light"] .k-phys { background: #DBEAFE; border-color: #3B82F6; color: #1D4ED8; }
:root[data-theme="light"] .k-alg  { background: #E0E7FF; border-color: #6366F1; color: #4338CA; }
:root[data-theme="light"] .k-stat { background: #EDE9FE; border-color: #8B5CF6; color: #6D28D9; }
:root[data-theme="light"] .k-adv  { background: #F3F4F6; border-color: #9CA3AF; color: #374151; }
:root[data-theme="light"] .k-eng  { background: #FAE8FF; border-color: #D946EF; color: #A21CAF; }
:root[data-theme="light"] .k-sci  { background: #FEF9C3; border-color: #EAB308; color: #A16207; }
:root[data-theme="light"] .chart-tip { color: #E9D5FF; }
:root[data-theme="light"] .msg-bubble { background: #F3F4F6; border-color: rgba(17, 24, 39, 0.06); }
:root[data-theme="light"] .msg.me .msg-bubble { background: rgba(124, 58, 237, 0.10); border-color: rgba(124, 58, 237, 0.25); }
:root[data-theme="light"] .prof-badge { background: radial-gradient(circle at 30% 25%, #EDE9FE, #F5F3FF 70%); border-color: #8B5CF6; box-shadow: 0 0 32px -10px rgba(124, 58, 237, 0.45); }
:root[data-theme="light"] .prof-badge svg { color: #7C3AED; }
:root[data-theme="light"] .date-tile .dt-m { background: #111827; color: #E5E7EB; }
:root[data-theme="light"] .toast { background: #111827; color: #F9FAFB; border-color: rgba(255, 255, 255, 0.1); }
