/* ============================================================
   VSE Design System — vse_style.css  (v2 — CGT Panel look)
   Reference: console CGT Panel — clean SaaS, white surfaces,
   colorful stat values, pastel icon chips, flat blue primary.
   LIGHT default + DARK option. Theme key: localStorage 'cgt_theme'
   ============================================================ */

:root {
  /* Chart palette — validated (CVD + contrast) dono themes ke against */
  --chart-1: #3b82f6; --chart-2: #059669; --chart-3: #8b5cf6;
  --font: 'Plus Jakarta Sans', -apple-system, 'Segoe UI', sans-serif;
}
:root[data-theme="light"] {
  --bg: #f4f6fb; --card: #ffffff; --card2: #f7f9fd; --border: #e7ebf3;
  --text: #1c2333; --muted: #64708a; --faint: #9aa5bd;
  --blue: #2563eb; --green: #16a34a; --red: #e11d48; --amber: #ea8a00; --violet: #7c3aed; --pink: #ec4899;
  --blue-bg: rgba(37,99,235,.09); --green-bg: rgba(22,163,74,.10);
  --red-bg: rgba(225,29,72,.09); --amber-bg: rgba(234,138,0,.12); --violet-bg: rgba(124,58,237,.09);
  --shadow: 0 1px 2px rgba(28,35,51,.04), 0 8px 24px rgba(28,35,51,.06);
  --grid-line: transparent;
}
:root[data-theme="dark"] {
  --bg: #0b0f19; --card: #141a28; --card2: #101522; --border: #222b3f;
  --text: #e6eaf4; --muted: #93a0bc; --faint: #5b6780;
  --blue: #4f83f7; --green: #2fbf68; --red: #f4517b; --amber: #f0a13c; --violet: #a17df5; --pink: #f472b6;
  --blue-bg: rgba(79,131,247,.14); --green-bg: rgba(47,191,104,.13);
  --red-bg: rgba(244,81,123,.13); --amber-bg: rgba(240,161,60,.14); --violet-bg: rgba(161,125,245,.14);
  --shadow: 0 10px 34px rgba(0,0,0,.35);
  --grid-line: transparent;
}

* { margin:0; padding:0; box-sizing:border-box; }
html { -webkit-text-size-adjust:100%; }
body {
  background: var(--bg); color: var(--text);
  font-family: var(--font); font-size: 16px; line-height: 1.55;
  min-height: 100dvh;
}
a { color: var(--blue); text-decoration: none; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 8px;
}
.mono { font-family: var(--font); font-variant-numeric: tabular-nums; letter-spacing: .01em; }
.num  { font-family: var(--font); font-variant-numeric: tabular-nums; }

/* ── Topbar ── */
.topbar {
  position: sticky; top: 0; z-index: 100;
  background: color-mix(in srgb, var(--card) 88%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.topbar-in {
  max-width: 1360px; margin: 0 auto; padding: 10px 18px;
  display: flex; align-items: center; gap: 12px;
}
.logo { display:flex; align-items:center; gap:10px; min-height:44px; }
.logo-icon {
  width: 38px; height: 38px; border-radius: 11px; flex: 0 0 auto;
  background: var(--blue);
  display:flex; align-items:center; justify-content:center;
  color:#fff; font-weight:800; font-size:17px;
  box-shadow: 0 4px 12px rgba(37,99,235,.28);
}
.logo-name { font-size: 17px; font-weight: 800; white-space: nowrap; letter-spacing:-.01em; display:flex; align-items:center; gap:8px; }
.role-pill {
  background: var(--blue-bg); color: var(--blue);
  font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 999px;
}
.logo-sub { font-size: 10.5px; color: var(--faint); font-weight:600; letter-spacing:.02em; }
.topbar-actions { margin-left:auto; display:flex; align-items:center; gap:8px; }
.icon-btn {
  background: var(--card); border: 1px solid var(--border); color: var(--muted);
  border-radius: 11px; width: 40px; height: 40px; min-width:40px;
  display:flex; align-items:center; justify-content:center; cursor:pointer;
  transition: border-color .15s, color .15s;
}
.icon-btn:hover { border-color: var(--blue); color: var(--blue); }

/* ── Nav (mobile) ── */
.nav {
  max-width: 1360px; margin: 0 auto; padding: 0 12px;
  display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none;
}
.nav::-webkit-scrollbar { display: none; }
.nav a {
  display:flex; align-items:center; gap:7px;
  padding: 10px 14px; min-height: 44px; white-space: nowrap;
  color: var(--muted); font-size: 13.5px; font-weight: 700;
  border-bottom: 2px solid transparent;
}
.nav a svg { width:16px; height:16px; flex:0 0 auto; }
.nav a.active { color: var(--blue); border-bottom-color: var(--blue); }
.nav a:hover { color: var(--text); }

/* ── Layout ── */
.container { max-width: 1360px; margin: 0 auto; padding: 22px 18px 60px; position:relative; z-index:1; }
.page-head { display:flex; align-items:flex-end; justify-content:space-between; gap:12px; flex-wrap:wrap; margin-bottom:20px; }
.page-title { font-size: 24px; font-weight: 800; letter-spacing:-.02em; }
.page-sub { font-size: 13px; color: var(--muted); font-weight:600; margin-top:3px; }

.card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 18px; padding: 20px; box-shadow: var(--shadow);
}

/* ── Stat cards (reference style: white card, colored value) ── */
.stat-grid { display:grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 20px; }
@media (min-width: 768px) { .stat-grid { grid-template-columns: repeat(4, 1fr); gap: 14px; } }
.stat {
  background: var(--card); border:1px solid var(--border); border-radius:16px;
  padding: 16px 18px; box-shadow: var(--shadow);
}
.stat-label { font-size: 12px; font-weight: 700; color: var(--muted); letter-spacing:.01em; }
.stat-value { font-size: 26px; font-weight: 800; margin-top: 6px; font-variant-numeric: tabular-nums; letter-spacing:-.02em; }
.stat-hint { font-size: 12px; color: var(--muted); margin-top: 3px; font-weight:600; }
.stat.accent-blue  { border-color: color-mix(in srgb, var(--blue) 26%, var(--border)); }
.stat.accent-green { border-color: color-mix(in srgb, var(--green) 26%, var(--border)); }
.stat.accent-amber { border-color: color-mix(in srgb, var(--amber) 30%, var(--border)); }
.stat.accent-red   { border-color: color-mix(in srgb, var(--pink) 26%, var(--border)); }
.stat.accent-blue  .stat-value { color: var(--blue); }
.stat.accent-green .stat-value { color: var(--green); }
.stat.accent-amber .stat-value { color: var(--amber); }
.stat.accent-red   .stat-value { color: var(--pink); }

/* ── Forms ── */
.filters { display:flex; flex-wrap:wrap; gap:10px; margin-bottom:18px; }
.input, .select, textarea.input {
  background: var(--card); border: 1px solid var(--border); color: var(--text);
  border-radius: 12px; padding: 0 14px; height: 44px; font-size: 14px;
  font-family: var(--font); font-weight:600; transition: border-color .15s, box-shadow .15s;
}
textarea.input { padding: 12px 14px; font-weight:500; }
.input:focus, .select:focus, textarea.input:focus {
  border-color: var(--blue); outline: none;
  box-shadow: 0 0 0 3px var(--blue-bg);
}
.input::placeholder { color: var(--faint); font-weight:500; }
.filters .input { flex: 1 1 220px; min-width: 0; }
.filters .select { flex: 0 1 auto; }
.btn {
  display:inline-flex; align-items:center; justify-content:center; gap:8px;
  background: var(--blue); color:#fff;
  border:none; border-radius:12px; padding: 0 18px; height: 44px;
  font-family: var(--font); font-size:14px; font-weight:700; cursor:pointer;
  transition: filter .15s, transform .1s;
  box-shadow: 0 4px 12px rgba(37,99,235,.22);
}
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: scale(.98); }
.btn-ghost {
  background: var(--card); color: var(--text); border: 1px solid var(--border); box-shadow:none;
}
.btn-ghost:hover { border-color: var(--blue); color: var(--blue); filter:none; }
.btn-sm { height: 36px; padding: 0 12px; font-size: 12.5px; border-radius: 10px; }

/* ── Badges & chips ── */
.badge {
  display:inline-flex; align-items:center; gap:5px;
  font-size:11px; font-weight:800; letter-spacing:.03em; text-transform:uppercase;
  padding: 4px 11px; border-radius: 999px;
}
.badge svg { width:11px; height:11px; }
.badge.paid    { background: var(--green-bg); color: var(--green); }
.badge.unpaid  { background: var(--amber-bg); color: var(--amber); }
.badge.invalid { background: var(--red-bg); color: var(--red); }
.chip {
  display:inline-flex; align-items:center; gap:6px;
  background: var(--blue-bg); color: var(--blue);
  font-size: 12px; font-weight:700; padding: 5px 11px; border-radius: 999px;
}
.chip.green { background: var(--green-bg); color: var(--green); }
.chip.violet { background: var(--violet-bg); color: var(--violet); }
.chip.neutral { background: var(--card2); color: var(--muted); border:1px solid var(--border); }

/* ── Student list ── */
.slist { display:flex; flex-direction:column; gap:10px; }
.srow {
  display:grid; gap: 6px 12px; align-items:center;
  grid-template-columns: 44px 1fr auto;
  grid-template-areas: "av main status" "av meta meta";
  background: var(--card); border:1px solid var(--border); border-radius:14px;
  padding: 12px 16px; color: var(--text); box-shadow: var(--shadow);
  transition: border-color .15s, transform .1s;
}
.srow:hover { border-color: var(--blue); }
.srow:active { transform: scale(.997); }
.avatar {
  grid-area: av; width: 42px; height: 42px; border-radius: 50%;
  display:flex; align-items:center; justify-content:center;
  font-weight:800; font-size:16px; flex:0 0 auto;
  background: var(--blue-bg); color: var(--blue);
}
.srow-main { grid-area: main; min-width: 0; }
.srow-name { font-weight:700; font-size:15px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.srow-num { font-size:12.5px; color:var(--muted); font-weight:600; font-variant-numeric: tabular-nums; }
.srow-status { grid-area: status; justify-self:end; display:flex; flex-direction:column; align-items:flex-end; gap:4px; }
.srow-meta {
  grid-area: meta; display:flex; flex-wrap:wrap; gap:6px 14px;
  font-size: 12px; color: var(--muted); font-weight:600;
}
.srow-rev { font-weight:800; color: var(--green); font-size:13.5px; font-variant-numeric: tabular-nums; }
@media (min-width: 900px) {
  .srow {
    grid-template-columns: 44px minmax(180px,1.4fr) 110px 1fr 110px 150px;
    grid-template-areas: "av main status meta rev last";
    padding: 11px 18px;
  }
  .srow-status { justify-self:start; flex-direction:row; align-items:center; }
  .srow-rev { grid-area: rev; text-align:right; }
  .srow-last { grid-area: last; text-align:right; }
}
.srow-last { font-size:12px; color:var(--muted); font-weight:600; }

/* ── Timeline ── */
.timeline { position: relative; padding-left: 26px; }
.timeline::before {
  content:''; position:absolute; left: 9px; top: 6px; bottom: 6px;
  width: 2px; background: var(--border); border-radius: 2px;
}
.tl-item { position: relative; padding: 0 0 18px 8px; }
.tl-item:last-child { padding-bottom: 4px; }
.tl-dot {
  position:absolute; left: -26px; top: 2px; width: 20px; height: 20px;
  border-radius: 50%; display:flex; align-items:center; justify-content:center;
  border: 2px solid var(--card); box-shadow: 0 0 0 2px var(--border);
}
.tl-dot svg { width: 10px; height: 10px; color:#fff; }
.tl-dot.signup   { background: var(--blue); }
.tl-dot.video    { background: var(--violet); }
.tl-dot.demo     { background: var(--amber); }
.tl-dot.purchase { background: var(--green); }
.tl-dot.other    { background: var(--faint); }
.tl-head { display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.tl-type { font-weight:800; font-size:13.5px; }
.tl-time { font-size:11.5px; color:var(--muted); font-weight:600; }
.tl-detail { font-size: 13px; color: var(--muted); margin-top: 3px; overflow-wrap:anywhere; }
.tl-amount { font-weight:800; color: var(--green); font-size:13px; font-variant-numeric: tabular-nums; }

/* ── Profile ── */
.profile-head { display:flex; gap:16px; align-items:flex-start; flex-wrap:wrap; }
.profile-avatar {
  width: 64px; height: 64px; border-radius: 50%; flex: 0 0 auto;
  display:flex; align-items:center; justify-content:center;
  font-weight:800; font-size:26px;
  background: var(--blue-bg); color: var(--blue);
}
.profile-name { font-size: 21px; font-weight: 800; overflow-wrap:anywhere; letter-spacing:-.01em; }
.profile-fields { display:flex; flex-wrap:wrap; gap:6px 18px; margin-top:6px; font-size:13px; color:var(--muted); font-weight:600; }
.profile-fields .f { display:flex; align-items:center; gap:6px; min-height:24px; }
.profile-fields svg { width:14px; height:14px; flex:0 0 auto; color:var(--faint); }

/* ── Empty / pager / misc ── */
.empty { text-align:center; padding: 48px 20px; color: var(--muted); }
.empty svg { width: 40px; height: 40px; color: var(--faint); margin-bottom: 10px; }
.empty-title { font-weight:800; color: var(--text); margin-bottom: 4px; }
.pager { display:flex; align-items:center; justify-content:center; gap:8px; margin-top: 18px; }
.pager a, .pager span {
  min-width: 44px; height: 44px; padding: 0 14px;
  display:inline-flex; align-items:center; justify-content:center;
  border: 1px solid var(--border); border-radius: 12px;
  color: var(--text); font-size: 13.5px; font-weight:700; background: var(--card);
}
.pager .cur { background: var(--blue); color:#fff; border:none; }
.pager .off { opacity:.4; pointer-events:none; }
.pager-info { font-size: 12.5px; color: var(--muted); font-weight:600; }
.section-title { font-size: 16px; font-weight: 800; margin-bottom: 14px; display:flex; align-items:center; gap:9px; letter-spacing:-.01em; }
.section-title svg { width:17px; height:17px; color: var(--blue); }
.grid-2 { display:grid; grid-template-columns: 1fr; gap: 14px; }
@media (min-width: 900px) { .grid-2 { grid-template-columns: 340px 1fr; align-items: start; } }
.kv { display:flex; justify-content:space-between; gap:10px; padding: 9px 0; border-bottom: 1px dashed var(--border); font-size: 13px; }
.kv:last-child { border-bottom: none; }
.kv .k { color: var(--muted); font-weight:600; }
.kv .v { font-weight: 700; text-align:right; overflow-wrap:anywhere; }

/* ── Shell: sidebar (desktop) + mobile nav ── */
.shell { max-width: 1360px; margin: 0 auto; display: flex; align-items: flex-start; position: relative; z-index: 1; }
.sidebar { display: none; }
@media (min-width: 1024px) {
  .nav { display: none; }
  .sidebar {
    display: flex; flex-direction: column; gap: 3px;
    position: sticky; top: 76px; width: 232px; flex: 0 0 auto;
    padding: 20px 12px 20px 18px;
  }
  .sidebar a {
    display: flex; align-items: center; gap: 11px;
    padding: 10px 14px; min-height: 44px; border-radius: 12px;
    color: var(--muted); font-weight: 700; font-size: 13.5px;
    transition: background .15s, color .15s;
  }
  .sidebar a svg { width: 17px; height: 17px; flex: 0 0 auto; }
  .sidebar a.active { background: var(--blue); color: #fff; box-shadow: 0 4px 12px rgba(37,99,235,.25); }
  .sidebar a:hover:not(.active) { color: var(--text); background: var(--card); }
  .sidebar .sep { margin: 10px 14px 4px; border-top: 1px solid var(--border); }
  .sidebar .sec {
    font-size: 10.5px; font-weight:800; letter-spacing: .08em; text-transform: uppercase;
    color: var(--faint); padding: 8px 14px 4px;
  }
  .container { flex: 1; min-width: 0; }
}

/* ── Settings forms ── */
.form-grid { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 768px) { .form-grid.two { grid-template-columns: 1fr 1fr; } }
.field label {
  display: block; font-size: 11.5px; font-weight:700;
  color: var(--muted); letter-spacing: .02em; margin-bottom: 7px;
}
.field .input, .field .select { width: 100%; }
.field .hint { font-size: 12px; color: var(--faint); margin-top: 5px; font-weight:500; }
.alert { border-radius: 12px; padding: 12px 15px; font-size: 13.5px; margin-bottom: 16px; font-weight:600; }
.alert.ok { background: var(--green-bg); color: var(--green); }
.alert.bad { background: var(--red-bg); color: var(--red); }
.check-row { display: flex; align-items: center; gap: 10px; min-height: 44px; cursor: pointer; font-size: 14px; font-weight: 700; }
.check-row input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--blue); cursor: pointer; }

/* ── Category / list rows ── */
.cat-row {
  display: flex; align-items: flex-start; gap: 12px; flex-wrap: wrap;
  padding: 14px 0; border-bottom: 1px dashed var(--border);
}
.cat-row:last-child { border-bottom: none; }
.cat-name { font-weight: 800; font-size: 14.5px; min-width: 140px; padding-top: 6px; }
.cat-kws { flex: 1; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; min-width: 200px; }
.kw-chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--card2); border: 1px solid var(--border);
  font-size: 12.5px; font-weight:600;
  padding: 5px 8px 5px 12px; border-radius: 999px;
}
.kw-chip form { display: inline-flex; }
.kw-x {
  background: none; border: none; color: var(--faint); cursor: pointer;
  display: inline-flex; align-items: center; padding: 2px; border-radius: 50%;
}
.kw-x:hover { color: var(--red); }
.kw-x svg { width: 12px; height: 12px; }
.inline-form { display: inline-flex; gap: 6px; align-items: center; }
.inline-form .input { height: 36px; font-size: 13px; padding: 0 10px; width: 130px; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
