/* =========================================================
   Vskills — design system
   Dark  : pure black surfaces, indigo->violet gradient hairlines, glass depth.
   Light : white surfaces, indigo-tinted soft shadows.
   ONE accent, identical in both themes:
   linear-gradient(135deg, #0606f3, #8770f9)
   Theme is driven by  <html data-theme="dark|light">  — set by app.js before paint.
   ========================================================= */

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

/* ---------------- tokens: DARK (default) ---------------- */
:root,
html[data-theme="dark"] {
  --grad: linear-gradient(135deg, #0606f3, #8770f9);
  --grad-soft: linear-gradient(135deg, rgba(6,6,243,.22), rgba(135,112,249,.22));
  --g1: #0606f3;
  --g2: #8770f9;
  --sky: #a99bfb;

  --bg:      #000;
  --surface: #000;          /* cards sit on pure black too */
  --sunken:  #000;
  --ink:  #dfe7ff;
  --dim:  #8a97bd;
  --mute: #6b7aa3;
  --line: rgba(135,112,249,.16);
  --card-line: rgba(255,255,255,.14);  /* card/grid borders: white-grey on dark */
  --hover: rgba(135,112,249,.10);

  --good: #4ade80;
  --warn: #fbbf24;
  --bad:  #f87171;

  --good-ink: #8ff2cd;
  --warn-ink: #ffd68f;
  --bad-ink:  #ffa8b8;

  /* subtle glass depth (only reads on black) */
  --nm:    7px 7px 18px rgba(0,0,0,.95), -5px -5px 16px rgba(255,255,255,.03);
  --nm-sm: 4px 4px 10px rgba(0,0,0,.9),  -3px -3px 9px  rgba(255,255,255,.025);
  --nm-in: inset 5px 5px 12px rgba(0,0,0,.95), inset -4px -4px 10px rgba(255,255,255,.035);
  --glow:  0 0 0 1px rgba(135,112,249,.40), 0 8px 28px rgba(6,6,243,.45);

  --scroll: rgba(135,112,249,.22);
  --scrim:  rgba(0,0,0,.72);
  --shade:  rgba(135,112,249,.08);   /* tint used inside bubbles / quotes */
  --scheme: dark;

  --r: 18px;
  --r-sm: 12px;
}

/* ---------------- tokens: LIGHT ---------------- */
html[data-theme="light"] {
  /* pure-white surfaces throughout — cards and the page sit on the same white,
     separated only by hairline borders and soft shadow, never by grey fills */
  --bg:      #ffffff;
  --surface: #ffffff;
  --sunken:  #f7f8fb;        /* just barely off-white, for inputs / wells */

  /* content text: true black for primary copy, neutral greys for the rest —
     no blue tint left in the type colours so paragraphs read as plain ink */
  --ink:  #111318;           /* primary content text — near-black */
  --dim:  #545a6b;           /* secondary text / labels — mid grey */
  --mute: #8a8f9e;           /* placeholders / timestamps — light grey */

  /* borders: a real, visible neutral grey (not a low-alpha black smear) */
  --line: #e3e5eb;
  --card-line: rgba(17,19,24,.16);  /* card/grid borders: black-grey on light */
  --hover: rgba(6,6,243,.05);

  --good: #0e9f70;
  --warn: #b7791f;
  --bad:  #d92146;

  --good-ink: #0b7a56;
  --warn-ink: #8c5a10;
  --bad-ink:  #b3153a;

  --nm:    0 10px 28px rgba(17,19,24,.08), 0 1px 2px rgba(17,19,24,.05);
  --nm-sm: 0 3px 10px rgba(17,19,24,.06), 0 1px 2px rgba(17,19,24,.05);
  --nm-in: inset 0 1px 3px rgba(17,19,24,.06);
  --glow:  0 0 0 1px rgba(6,6,243,.25), 0 10px 26px rgba(6,6,243,.16);

  --scroll: #d3d6de;
  --scrim:  rgba(17,19,24,.45);
  --shade:  rgba(6,6,243,.06);
  --scheme: light;
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  transition: background .25s ease, color .25s ease;
}

/* the same restrained blue aura over black used across the Projects app —
   kept subtle enough that the page still reads as solid black */
html[data-theme="dark"] body {
  background-image:
    radial-gradient(820px 460px at 12% -10%, rgba(6,6,243,.16), transparent 60%),
    radial-gradient(720px 460px at 100% -4%, rgba(135,112,249,.10), transparent 58%);
  background-color: #000;
  background-attachment: fixed;
}

h1, h2, h3, h4 { font-family: 'Sora', sans-serif; font-weight: 800; letter-spacing: -.02em; line-height: 1.25; }
h1 { font-size: clamp(22px, 4vw, 30px); }
h2 { font-size: clamp(19px, 3vw, 23px); }
h3 { font-size: 17px; }

a { color: var(--g2); text-decoration: none; }
a:hover { text-decoration: underline; }
html[data-theme="light"] a { color: var(--g1); }

::selection { background: rgba(135,112,249,.35); color: var(--ink); }

/* focus ring — accessibility floor */
:focus-visible { outline: 2px solid var(--g2); outline-offset: 2px; border-radius: 6px; }

/* scrollbars */
* { scrollbar-width: thin; scrollbar-color: var(--scroll) transparent; }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-thumb { background: var(--scroll); border-radius: 4px; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------------- utilities ---------------- */
.muted { color: var(--mute); font-size: 13px; }
.dim   { color: var(--dim); }
.center { text-align: center; }
.row   { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.grow  { flex: 1; min-width: 0; }
.mt { margin-top: 10px; }  .mt-lg { margin-top: 22px; }
.mb { margin-bottom: 10px; } .mb-lg { margin-bottom: 22px; }
/* Every rule below is on the BARE `hr` tag as well as the helper classes.
   A bare <hr> used to fall through to the browser default, which paints an
   inset light-grey border -- a white line on a black page. It is now a
   hairline in the accent's own colour, in both themes. */
hr, .hr {
  border: 0;
  height: 1px;
  margin: 14px 0;
  background: var(--line);
  color: var(--line);          /* IE/legacy fallback */
  opacity: 1;
}
hr.hr-grad, .hr-grad { border: 0; height: 1px; margin: 26px 0; background: var(--grad); opacity: .5; }
hr.nav-sep, .nav-sep { border: 0; height: 1px; margin: 10px 4px; background: var(--line); }
.ico { flex-shrink: 0; display: block; }
.mono { font-variant-numeric: tabular-nums; letter-spacing: .02em; font-weight: 700; }
.grad-text, .td-accent {
  background: var(--grad); -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; font-weight: 600;
}
.sec-title {
  font: 800 15px 'Sora', sans-serif; letter-spacing: -.01em;
  display: flex; align-items: center; gap: 8px; margin: 4px 0 10px;
}
.sec-title::before { content: ''; width: 4px; height: 15px; border-radius: 3px; background: var(--grad); }

/* ---------------- gradient-hairline surfaces ---------------- */
.gb, .card, .panel {
  background: var(--surface);
  border: 1px solid var(--card-line);
  border-radius: var(--r);
}
.card {
  padding: 20px;
  box-shadow: var(--nm);
  backdrop-filter: blur(16px);
  transition: transform .18s ease, box-shadow .18s ease;
}
.card.hover:hover { transform: translateY(-3px); box-shadow: var(--nm), var(--glow); }
/* .flat = a card with no gradient border, used for filter bars / empty states */
.card.flat {
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--nm-sm);
}
.sunken { border-radius: var(--r); box-shadow: var(--nm-in); background: var(--sunken); padding: 14px; }

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

/* Two fields side by side inside a form (admin batch/trainer modals used this
   class for months while it was never actually defined anywhere — which is why
   those inputs stacked and overflowed). It collapses to one column on phones. */
.row-2 { display: grid; gap: 0 14px; grid-template-columns: 1fr 1fr; }
.row-3 { display: grid; gap: 0 14px; grid-template-columns: repeat(3, 1fr); }
@media (max-width: 560px) {
  .row-2, .row-3 { grid-template-columns: 1fr; }
}

.right { text-align: right; }
.left  { text-align: left; }
.wrap  { min-width: 0; overflow-wrap: anywhere; }

/* ---------------- buttons ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--grad);
  color: #fff;
  border: 0;
  border-radius: var(--r-sm);
  padding: 11px 18px;
  font: 600 14px 'Inter', sans-serif;
  cursor: pointer;
  box-shadow: var(--nm-sm);
  transition: transform .15s ease, box-shadow .15s ease, filter .15s ease;
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--nm-sm), var(--glow); text-decoration: none; filter: brightness(1.08); }
.btn:active { transform: translateY(0); filter: brightness(.94); }
.btn[disabled], .btn.off, .btn.is-disabled { opacity: .45; pointer-events: none; }
.btn-lg { width: 100%; padding: 13px 20px; font-size: 15px; }
.btn-sm { padding: 8px 13px; font-size: 13px; border-radius: 10px; }

.btn-ghost {
  background: var(--surface);
  border: 1px solid var(--card-line);
  color: var(--ink);
}
.btn-bad,  .btn-danger { background: linear-gradient(135deg, #ff2d55, #ff4d6d); }
.btn-good, .btn-ok     { background: linear-gradient(135deg, #0f9e6e, #22e39a); }
.btn-warn              { background: linear-gradient(135deg, #d98a12, #f5b23d); color: #1a1200; }

/* ---------------- inputs ---------------- */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; font-weight: 600; color: var(--dim); margin-bottom: 7px; }

input[type=text], input[type=email], input[type=password], input[type=tel],
input[type=number], input[type=date], input[type=time], input[type=search],
input[type=file], input:not([type]), select, textarea, .input {
  -webkit-appearance: none; appearance: none;
  width: 100%;
  display: block;
  background: var(--sunken);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 12px 14px;
  font: 400 16px 'Inter', sans-serif;   /* 16px = no iOS zoom on focus */
  line-height: 1.4;
  box-shadow: var(--nm-in);
  outline: none;
  transition: box-shadow .18s ease, border-color .18s ease;
  color-scheme: var(--scheme);
}
input::placeholder, textarea::placeholder { color: var(--mute); opacity: 1; }
input:focus, select:focus, textarea:focus, .input:focus {
  box-shadow: var(--nm-in), 0 0 0 2px rgba(135,112,249,.45);
  border-color: var(--g2);
}
input:disabled, textarea:disabled, select:disabled { opacity: .55; cursor: not-allowed; }
textarea { resize: vertical; min-height: 96px; }

input[type=date]::-webkit-calendar-picker-indicator,
input[type=time]::-webkit-calendar-picker-indicator { cursor: pointer; opacity: .75; }
html[data-theme="dark"] input[type=date]::-webkit-calendar-picker-indicator,
html[data-theme="dark"] input[type=time]::-webkit-calendar-picker-indicator { filter: invert(1); }

/* Chrome autofill repaints a white box — override in both themes */
input:-webkit-autofill, input:-webkit-autofill:hover, input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--ink);
  -webkit-box-shadow: 0 0 0 1000px var(--sunken) inset, var(--nm-in);
  caret-color: var(--ink);
  transition: background-color 9999s ease-in-out 0s;
}

select {
  background-image: linear-gradient(45deg, transparent 50%, var(--dim) 50%),
                    linear-gradient(135deg, var(--dim) 50%, transparent 50%);
  background-position: calc(100% - 19px) 21px, calc(100% - 14px) 21px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 38px;
  cursor: pointer;
}
select option { background: var(--surface); color: var(--ink); }

input[type=file] { padding: 9px 12px; font-size: 14px; cursor: pointer; }
input[type=file]::file-selector-button {
  background: var(--grad); color: #fff; border: 0;
  border-radius: 8px; padding: 8px 14px; margin-right: 12px;
  font: 600 13px 'Inter', sans-serif; cursor: pointer;
}

input[type=checkbox] {
  -webkit-appearance: none; appearance: none;
  width: 20px; height: 20px; display: inline-block;
  border-radius: 6px; box-shadow: var(--nm-in); cursor: pointer; flex-shrink: 0;
  position: relative; padding: 0; background: var(--sunken); border: 1px solid var(--line);
}
input[type=checkbox]:checked { background: var(--grad); box-shadow: none; border-color: transparent; }
input[type=checkbox]:checked::after {
  content: ''; position: absolute; left: 6px; top: 2px;
  width: 5px; height: 10px; border: solid #fff; border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* OTP boxes */
.otp { display: flex; gap: 10px; justify-content: center; margin: 8px 0 4px; }
.otp input { width: 48px; height: 56px; text-align: center; font: 700 22px 'Sora', sans-serif; padding: 0; border-radius: var(--r-sm); }
@media (max-width: 380px) { .otp { gap: 6px; } .otp input { width: 42px; height: 50px; font-size: 19px; } }

/* ---------------- pills / badges ---------------- */
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--surface);
  border: 1px solid var(--card-line);
  border-radius: 999px; padding: 4px 12px;
  font: 600 12px 'Inter', sans-serif; color: var(--ink); white-space: nowrap;
}
.pill-good, .pill-ok  { color: var(--good); }
.pill-bad             { color: var(--bad); }
.pill-warn            { color: var(--warn); }
.pill-live            { color: var(--bad); }
/* Free Demo Class — solid accent chip so it reads as "open to everyone" */
.pill-demo { background: var(--grad); color: #fff; border-color: transparent; }
.pill-demo::before { content: none; }
.pill-live::before, .pill-good::before, .pill-ok::before {
  content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; animation: blink 1.4s infinite;
}
.dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; animation: blink 1.4s infinite; flex-shrink: 0; }
@keyframes blink { 0%,100% { opacity: 1 } 50% { opacity: .25 } }

.badge {
  min-width: 19px; height: 19px; padding: 0 5px;
  background: var(--grad); color: #fff;
  border-radius: 999px; display: grid; place-items: center;
  font: 700 11px 'Inter', sans-serif; flex-shrink: 0;
}
.rate-chip {
  display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 10px;
  background: var(--grad); color: #fff; font: 700 14px 'Sora', sans-serif;
}

/* ---------------- tables ---------------- */
.table-wrap {
  background: var(--surface);
  border: 1px solid var(--card-line); border-radius: var(--r);
  box-shadow: var(--nm); overflow: hidden;
}
.table-scroll, .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table, .tbl { width: 100%; border-collapse: collapse; background: var(--surface); min-width: 640px; }
th {
  background: var(--surface); color: var(--dim);
  font: 700 11px 'Inter', sans-serif; text-transform: uppercase; letter-spacing: .09em;
  text-align: left; padding: 13px 16px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
td { background: var(--surface); padding: 14px 16px; border-bottom: 1px solid var(--line); font-size: 14px; vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: var(--hover); }
tr.next-up td, tr.is-next td { color: var(--bad); font-weight: 600; }
tr.next-up td:first-child, tr.is-next td:first-child { box-shadow: inset 3px 0 0 var(--bad); }
tr.is-next .td-accent { -webkit-text-fill-color: var(--bad); }

/* key/value rows */
.kv { display: flex; justify-content: space-between; gap: 14px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.kv:last-child { border-bottom: 0; }
.kv .k, .kv span:first-child { color: var(--mute); flex-shrink: 0; }
.kv .v, .kv span:last-child  { font-weight: 600; text-align: right; color: var(--ink); }

/* ---------------- shell ---------------- */
.shell { display: flex; min-height: 100vh; min-height: 100dvh; background: var(--bg); }

.side {
  width: 252px; flex-shrink: 0; background: var(--bg);
  border-right: 1px solid var(--line);
  padding: 20px 14px; display: flex; flex-direction: column; gap: 6px;
  position: sticky; top: 0; height: 100vh; height: 100dvh; overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 11px; padding: 4px 8px 20px; }
.brand-mark {
  width: 40px; height: 40px; border-radius: 12px; background: var(--grad);
  display: grid; place-items: center; font: 800 18px 'Sora', sans-serif; color: #fff;
  box-shadow: var(--nm-sm); flex-shrink: 0;
}
.brand-name { font: 800 18px 'Sora', sans-serif; letter-spacing: -.02em; color: var(--ink); }
.brand-sub { font-size: 11px; color: var(--mute); }

.nav-link {
  display: flex; align-items: center; gap: 11px;
  padding: 11px 13px; border-radius: var(--r-sm);
  color: var(--dim); font-weight: 600; font-size: 14px;
  text-decoration: none; border: 1px solid transparent; background: var(--bg);
  transition: color .15s, box-shadow .15s;
}
.nav-link:hover { color: var(--ink); box-shadow: var(--nm-sm); text-decoration: none; }
.nav-link.on, .nav-link.active {
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--card-line); box-shadow: var(--nm-sm);
}
.nav-link.on::before, .nav-link.active::before {
  content: ''; width: 3px; height: 18px; border-radius: 3px; background: var(--grad); margin-left: -4px;
}
.nav-sep { height: 1px; background: var(--line); margin: 10px 6px; border: 0; }

/* sidebar log-out entry — same shape as a nav link, tinted danger */
.nav-link.nav-danger { color: var(--bad); }
.nav-link.nav-danger:hover { color: var(--bad); box-shadow: var(--nm-sm); }
.nav-link.nav-danger.on::before { background: var(--bad); }


.main { flex: 1; min-width: 0; background: var(--bg); display: flex; flex-direction: column; }
.topbar {
  min-height: 64px; flex-shrink: 0; display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 10px 22px; border-bottom: 1px solid var(--line); background: var(--bg);
  position: sticky; top: 0; z-index: 40;
}
.page { padding: 24px 22px 90px; background: var(--bg); flex: 1; }
.page-head { margin-bottom: 20px; }
.page-title h2 { font-size: 19px; }
.page-sub { font-size: 12px; color: var(--mute); }

.burger {
  display: none; background: var(--surface); border: 1px solid var(--line); color: var(--ink);
  padding: 8px; border-radius: 10px; box-shadow: var(--nm-sm); cursor: pointer;
}
.scrim { position: fixed; inset: 0; background: var(--scrim); z-index: 70; display: none; }
.scrim.open { display: block; }

/* avatar + dropdown */
.avatar {
  width: 38px; height: 38px; border-radius: 50%; background: var(--grad);
  display: grid; place-items: center; color: #fff; font: 700 15px 'Sora', sans-serif;
  cursor: pointer; box-shadow: var(--nm-sm); flex-shrink: 0; user-select: none;
}
.dropdown { position: relative; }
.dropdown-menu {
  position: absolute; right: 0; top: calc(100% + 10px); width: 240px; z-index: 60;
  background: var(--surface);
  border: 1px solid var(--card-line); border-radius: var(--r);
  box-shadow: var(--nm); padding: 16px; display: none;
}
.dropdown-menu.open { display: block; }
.dropdown-menu > div:first-child { color: var(--ink); }

/* ---------------- auth pages ---------------- */
.auth-wrap { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; background: var(--bg); }
.auth-card {
  width: 100%; max-width: 430px; padding: 30px;
  background: var(--surface);
  border: 1px solid var(--card-line); border-radius: 22px; box-shadow: var(--nm);
}
.auth-head { text-align: center; margin-bottom: 22px; }
.auth-head p { color: var(--mute); font-size: 14px; margin-top: 6px; }

.switch { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 6px; border-radius: 14px; box-shadow: var(--nm-in); background: var(--sunken); margin-bottom: 20px; }
.switch button {
  background: transparent; border: 0; color: var(--dim); padding: 11px; border-radius: 10px;
  font: 600 14px 'Inter', sans-serif; cursor: pointer; transition: all .18s;
}
.switch button.on { background: var(--grad); color: #fff; box-shadow: var(--nm-sm); }

/* ---------------- alerts ---------------- */
.alert { border-radius: var(--r-sm); padding: 12px 15px; font-size: 14px; margin-bottom: 14px; border: 1px solid; background: var(--surface); }
.alert-bad,  .alert-err { border-color: var(--bad);  color: var(--bad-ink);  background: color-mix(in srgb, var(--bad) 8%, var(--surface)); }
.alert-good, .alert-ok  { border-color: var(--good); color: var(--good-ink); background: color-mix(in srgb, var(--good) 8%, var(--surface)); }
.alert-info             { border-color: var(--g2);   color: var(--ink);      background: color-mix(in srgb, var(--g2) 8%, var(--surface)); }

/* ---------------- stats ---------------- */
.stats { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(165px, 1fr)); margin-bottom: 22px; }
.stat {
  padding: 18px; text-align: left; border-radius: var(--r);
  background: var(--surface);
  border: 1px solid var(--card-line); box-shadow: var(--nm);
}
.stat .n { font: 800 26px 'Sora', sans-serif; background: var(--grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.stat .l { font-size: 12px; color: var(--mute); text-transform: uppercase; letter-spacing: .08em; margin-top: 2px; }

/* ---------------- empty ---------------- */
.empty { text-align: center; padding: 48px 20px; color: var(--mute); }
.empty .big { color: var(--g2); opacity: .55; margin-bottom: 12px; display: flex; justify-content: center; }
.empty h3 { color: var(--dim); margin-bottom: 6px; }

/* ---------------- modal ---------------- */
.modal-bg {
  position: fixed; inset: 0; background: var(--scrim); backdrop-filter: blur(6px);
  z-index: 900; display: none; place-items: center; padding: 20px; overflow-y: auto;
}
.modal-bg.open { display: grid; }
.modal {
  width: 100%; max-width: 480px; padding: 24px;
  background: var(--surface);
  border: 1px solid var(--card-line); border-radius: 22px; box-shadow: var(--nm);
  max-height: 90vh; overflow-y: auto;
}
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.modal-head .x {
  background: var(--surface); border: 1px solid var(--line); color: var(--dim);
  width: 34px; height: 34px; border-radius: 10px; font-size: 20px; line-height: 1;
  cursor: pointer; display: grid; place-items: center;
}
.modal-head .x:hover { color: var(--ink); border-color: var(--g2); }

.icon-btn {
  background: var(--surface); border: 1px solid var(--line); color: var(--dim); cursor: pointer;
  width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
  box-shadow: var(--nm-sm); transition: color .15s, border-color .15s; flex-shrink: 0;
}
.icon-btn:hover { color: var(--ink); border-color: var(--g2); }
.icon-btn.ok { color: var(--good); font-size: 16px; font-weight: 700; }
.icon-btn.no { color: var(--bad);  font-size: 16px; font-weight: 700; }

/* ---------------- toast ---------------- */
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 14px);
  background: var(--surface);
  border: 1px solid var(--card-line); border-radius: 14px; color: var(--ink);
  padding: 12px 20px; font-size: 14px; box-shadow: var(--nm);
  opacity: 0; pointer-events: none; transition: all .28s; z-index: 999;
  max-width: calc(100vw - 32px); text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------------- rating scale ---------------- */
.scale { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.scale button,
.scale label {
  background: var(--sunken); border: 1px solid var(--line); color: var(--dim);
  border-radius: var(--r-sm); padding: 13px 0; cursor: pointer; text-align: center;
  font: 700 17px 'Sora', sans-serif; box-shadow: var(--nm-sm); transition: all .15s;
  display: block;
}
.scale label input { position: absolute; opacity: 0; width: 0; height: 0; }
.scale button.on,
.scale label:has(input:checked) { background: var(--grad); color: #fff; border-color: transparent; }
.scale-hint { font-size: 12px; color: var(--mute); margin-top: 7px; text-align: center; }

/* =========================================================
   FLOATING THEME TOGGLE — injected by app.js on every page
   ========================================================= */
.theme-fab {
  position: fixed; right: 18px; bottom: 18px; z-index: 950;
  width: 50px; height: 50px; border-radius: 50%;
  display: grid; place-items: center; cursor: pointer;
  background: var(--grad); color: #fff; border: 0;
  box-shadow: var(--nm), 0 6px 22px rgba(6,6,243,.42);
  transition: transform .2s cubic-bezier(.34,1.56,.64,1), filter .2s;
  padding-bottom: env(safe-area-inset-bottom, 0);
}
.theme-fab:hover { transform: scale(1.08) rotate(-12deg); filter: brightness(1.08); }
.theme-fab:active { transform: scale(.94); }
.theme-fab .ico { transition: transform .35s cubic-bezier(.34,1.56,.64,1), opacity .2s; }
.theme-fab .moon { display: none; }
html[data-theme="light"] .theme-fab .moon { display: block; }
html[data-theme="light"] .theme-fab .sun  { display: none; }
/* keep the FAB clear of the classroom control bar / chat composer */
.room-body .theme-fab, body.has-composer .theme-fab { bottom: auto; top: 14px; right: 74px; width: 40px; height: 40px; }

/* ---------------- responsive ---------------- */
@media (max-width: 980px) {
  .side {
    position: fixed; left: 0; top: 0; z-index: 80; height: 100vh; height: 100dvh;
    transform: translateX(-100%); transition: transform .26s ease;
    box-shadow: 20px 0 50px rgba(0,0,0,.35);
  }
  .side.open { transform: translateX(0); }
  .burger { display: grid; place-items: center; }
}
@media (max-width: 640px) {
  body { font-size: 14px; }
  .page { padding: 18px 14px 96px; }
  .topbar { padding: 10px 14px; }
  .card { padding: 16px; }
  .grid { grid-template-columns: 1fr; gap: 12px; }
  .stats { grid-template-columns: 1fr 1fr; }
  .auth-card { padding: 24px 20px; }
  .btn { padding: 11px 15px; }
  .theme-fab { right: 14px; bottom: 14px; }
}
@media (max-width: 380px) { .stats { grid-template-columns: 1fr; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

@media print {
  .side, .topbar, .btn, .no-print, .theme-fab { display: none !important; }
  body, .card { background: #fff !important; color: #000 !important; box-shadow: none !important; }
}
