/* RS Education — Application Management Portal
   Theme: deep burnt-orange + warm dark glass (default). Light = warm cream. Toggle in the top bar. */

:root {
  --brand: #f07a1a;
  --brand-600: #ff9a4d;
  --brand-700: #ffb27a;
  --brand-50: #3a1d0c;
  --brand-100: #52290f;
  --brown: #8a3f12;
  --navy: #2a140b;
  --navy-2: #3a1d10;

  --bg: #150a06;
  --surface: #27140b;
  --surface-2: rgba(255, 255, 255, .06);
  --card: rgba(38, 15, 6, .52);
  --bar: rgba(30, 11, 4, .5);
  --ctl: rgba(255, 255, 255, .08);
  --line: rgba(255, 200, 160, .15);
  --line-2: rgba(255, 200, 160, .26);
  --text: #fdeee0;
  --text-2: #dcc0a8;
  --muted: #a98c76;
  --glow-1: rgba(214, 98, 28, .26);
  --glow-2: rgba(150, 52, 10, .34);

  --good: #3ccf87;
  --good-bg: #12291c;
  --warn: #e8b030;
  --warn-bg: #33260d;
  --bad: #ef6b64;
  --bad-bg: #3a1613;
  --info: #5aa7ee;
  --info-bg: #15263b;
  --violet: #a99bf0;
  --violet-bg: #261f3d;

  /* chart series (orange first, then distinct hues) */
  --s1: #f08a35;
  --s2: #4fa3e0;
  --s3: #2fbf86;
  --s4: #e8c14a;
  --s5: #e87ba4;
  --s6: #8fcf4a;
  --s7: #a99bf0;
  --s8: #ef6b64;
  --grid: rgba(255, 200, 160, .13);

  --sidebar: rgba(28, 10, 4, .55);
  --sidebar-2: rgba(255, 255, 255, .07);
  --sidebar-text: #d4b49c;

  --radius: 20px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 8px 24px rgba(0, 0, 0, .28);
  --shadow-lg: 0 16px 50px rgba(0, 0, 0, .55);
  --ease: cubic-bezier(.2, .8, .2, 1);
  color-scheme: dark;
}

:root[data-theme="light"] {
  --brand-600: #c85a0a;
  --brand-700: #a54708;
  --brand-50: #fff0e0;
  --brand-100: #ffdcb8;
  --navy: #3a1a0c;
  --navy-2: #4d2412;

  --bg: #ffffff;
  --surface: #ffffff;
  --surface-2: rgba(150, 80, 30, .07);
  --card: rgba(255, 255, 255, .88);
  --bar: rgba(255, 255, 255, .88);
  --ctl: rgba(255, 255, 255, .96);
  --line: rgba(120, 60, 20, .14);
  --line-2: rgba(120, 60, 20, .26);
  --text: #2a1408;
  --text-2: #6a4733;
  --muted: #85664f;
  --glow-1: transparent;
  --glow-2: transparent;

  --good: #12a150;
  --good-bg: #e6f6ec;
  --warn: #c98500;
  --warn-bg: #fff4d6;
  --bad: #d63b3b;
  --bad-bg: #fde8e8;
  --info: #2a78d6;
  --info-bg: #e5f0fc;
  --violet: #4a3aa7;
  --violet-bg: #ecebfa;

  --s1: #e0701a;
  --s2: #2a78d6;
  --s3: #1baf7a;
  --s4: #c98500;
  --s5: #e87ba4;
  --s6: #008300;
  --s7: #4a3aa7;
  --s8: #e34948;
  --grid: rgba(120, 60, 20, .13);

  --sidebar: linear-gradient(180deg, #4a2010, #2c1309);
  --sidebar-2: rgba(255, 255, 255, .09);
  --sidebar-text: #ecd0ba;

  --shadow: 0 1px 2px rgba(90, 40, 10, .05), 0 6px 22px rgba(90, 40, 10, .08);
  --shadow-lg: 0 12px 44px rgba(60, 25, 5, .22);
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  background: radial-gradient(900px 620px at 6% -6%, var(--glow-1), transparent 62%), radial-gradient(820px 620px at 104% 104%, var(--glow-2), transparent 62%), var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
#app { position: relative; z-index: 1; }
a { color: var(--brand-600); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; letter-spacing: -.01em; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.text-2 { color: var(--text-2); }
.hidden { display: none !important; }

/* ---------- Login (calm burnt-orange gradient + soft blobs + dark frosted-glass card) ---------- */
.login-wrap {
  position: relative; height: calc(100vh / var(--zoom, 1)); height: calc(100dvh / var(--zoom, 1)); display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 16px; color: #fff1e4; overflow: hidden; background: transparent;
}
.login-scene {
  position: fixed; inset: 0; overflow: hidden; z-index: 0; pointer-events: none;
  background: linear-gradient(135deg, #b9561a 0%, #94400f 50%, #5e2408 100%);
}
/* parallax wrapper: reacts gently to the mouse via --mx / --my (-1 … 1) */
.px {
  position: absolute; inset: -40px;
  transform: translate3d(calc(var(--mx, 0) * var(--d, 0px)), calc(var(--my, 0) * var(--d, 0px)), 0);
  transition: transform .7s cubic-bezier(.2, .8, .2, 1);
}
.ls-blob {
  position: absolute; width: var(--w); height: var(--h); background: var(--bg);
  border-radius: 63% 37% 54% 46% / 55% 48% 52% 45%;
  box-shadow: 0 30px 56px rgba(40, 12, 2, .35), inset -22px -26px 60px rgba(90, 30, 4, .35), inset 14px 16px 44px rgba(255, 210, 160, .16);
  animation: blobMorph var(--t, 22s) ease-in-out infinite alternate, blobDrift calc(var(--t, 22s) * .8) ease-in-out infinite alternate;
  animation-delay: var(--dl, 0s);
}
body.in-app .ls-blob { animation-name: blobDrift; }
.ls-blob, .ls-sphere, .ls-glassdisc { will-change: transform; }
.ls-blob, .ls-sphere, .ls-glassdisc { will-change: transform; }
/* signed-in pages: darker veil over the shapes so titles and text stay easy to read */
body.in-app .login-scene::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(24, 8, 2, .5), rgba(24, 8, 2, .3)); }
:root[data-theme="light"] body.in-app .login-scene::after { background: linear-gradient(180deg, rgba(255, 238, 220, .38), rgba(255, 238, 220, .3)); }
@keyframes blobMorph {
  0% { border-radius: 63% 37% 54% 46% / 55% 48% 52% 45%; }
  50% { border-radius: 40% 60% 38% 62% / 48% 40% 60% 52%; }
  100% { border-radius: 52% 48% 66% 34% / 38% 58% 42% 62%; }
}
@keyframes blobDrift { from { transform: translate(0, 0) rotate(0deg); } to { transform: translate(var(--dx, 24px), var(--dy, -20px)) rotate(var(--rot, 8deg)); } }
.ls-sphere {
  position: absolute; width: var(--w); height: var(--w); border-radius: 50%;
  background: radial-gradient(circle at 30% 28%, #f3b878 0%, #d9742a 50%, #a8400f 100%);
  box-shadow: 0 22px 36px rgba(40, 12, 2, .4), inset -10px -12px 24px rgba(90, 26, 4, .4);
  animation: sphereFloat var(--t, 9s) ease-in-out infinite alternate; animation-delay: var(--dl, 0s);
}
@keyframes sphereFloat { from { transform: translateY(0); } to { transform: translateY(-14px); } }
.ls-glassdisc {
  position: absolute; width: var(--w); height: var(--w); border-radius: 50%;
  background: linear-gradient(145deg, rgba(255, 220, 180, .2), rgba(255, 220, 180, .04));
  border: 1px solid rgba(255, 210, 170, .35);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  box-shadow: 0 18px 36px rgba(40, 12, 2, .25), inset 0 1px 0 rgba(255, 230, 200, .35);
  animation: sphereFloat var(--t, 12s) ease-in-out infinite alternate; animation-delay: var(--dl, 0s);
}
.ls-dots { position: absolute; width: var(--w, 120px); height: var(--h, 90px); background-image: radial-gradient(rgba(255, 215, 175, .5) 1.5px, transparent 1.8px); background-size: 14px 14px; opacity: .4; }
.ls-sheen { position: absolute; inset: 0; background: radial-gradient(ellipse at 15% 0%, rgba(230, 130, 50, .25), transparent 55%), radial-gradient(ellipse at 100% 100%, rgba(30, 8, 1, .45), transparent 60%); }

/* dark frosted-glass card: soft on the eyes, high-contrast text */
.login-card {
  position: relative; z-index: 2; width: 100%; max-width: 400px; padding: 24px 30px 18px; border-radius: 26px;
  flex: 0 1 auto; min-height: 0; max-height: 100%; overflow-y: auto; scrollbar-width: thin; scrollbar-color: rgba(255, 200, 160, .4) transparent;
  background: linear-gradient(150deg, rgba(60, 24, 8, .62), rgba(24, 8, 3, .8) 75%);
  border: 1px solid rgba(255, 225, 190, .5);
  -webkit-backdrop-filter: blur(20px) saturate(150%); backdrop-filter: blur(20px) saturate(150%);
  box-shadow: 0 0 0 1px rgba(255, 190, 130, .14), 0 34px 80px rgba(18, 5, 1, .6), 0 0 70px rgba(255, 150, 60, .22), inset 0 1px 0 rgba(255, 235, 210, .45);
  animation: cardIn .8s var(--ease) both;
}
@keyframes cardIn { from { opacity: 0; transform: translateY(20px) scale(.97); } }
.login-logo { display: flex; justify-content: center; margin-bottom: 8px; }
.login-logo span { background: #fff4ea; border-radius: 14px; padding: 6px 14px; box-shadow: 0 8px 20px rgba(0, 0, 0, .3); display: inline-flex; }
.login-logo img { height: 32px; display: block; }
.login-card h2 { font-size: 22px; font-weight: 700; text-align: center; letter-spacing: -.01em; color: #fff4e8; }
.login-card .sub { text-align: center; font-size: 13px; color: rgba(255, 232, 210, .82); margin: 2px 0 14px; }

.lg-field { position: relative; margin-bottom: 10px; }
.lg-field .input {
  height: 40px; padding: 0 38px 0 34px; border-radius: 0; background: transparent; color: #fff4e8; font-size: 14.5px;
  border: 0; border-bottom: 1.5px solid rgba(255, 210, 170, .5); box-shadow: none;
}
.lg-field .input::placeholder { color: rgba(255, 232, 212, .82); }
.lg-field .input:focus { border-bottom-color: #f08a3a; box-shadow: 0 8px 14px -10px rgba(240, 138, 58, .8); }
.lg-field .input:-webkit-autofill { -webkit-text-fill-color: #fff4e8; transition: background-color 99999s; }
.lg-field .lg-ic { position: absolute; top: 50%; transform: translateY(-50%); width: 28px; height: 28px; display: grid; place-items: center; color: #ffb06a; background: none; border: 0; padding: 0; }
.lg-field .lg-ic.l { left: 0; }
.lg-field .lg-ic.r { right: 0; }
.lg-field button.lg-ic { cursor: pointer; border-radius: 50%; transition: background .2s; }
.lg-field button.lg-ic:hover { background: rgba(255, 180, 110, .18); }
.lg-field .lg-ic svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.lg-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 12.5px; margin: 0 0 14px; }
.lg-row .chk { font-size: 12.5px; color: rgba(255, 236, 218, .92); }
.lg-row .chk input { accent-color: #e8742a; width: 14px; height: 14px; }
.lg-link { background: none; border: 0; padding: 0; color: #ffb36b; cursor: pointer; font-size: 12.5px; font-weight: 600; }
.lg-link:hover { color: #ffd0a0; text-decoration: underline; text-underline-offset: 3px; }

.lg-btn {
  width: 100%; height: 44px; border: 0; border-radius: 999px; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px;
  background: linear-gradient(90deg, #e2711a, #c4410c); color: #fff; font-weight: 700; font-size: 14px; letter-spacing: .06em; text-transform: uppercase;
  box-shadow: 0 10px 22px rgba(20, 6, 1, .45), inset 0 1px 0 rgba(255, 210, 170, .35); transition: transform .2s var(--ease), box-shadow .2s, filter .2s;
}
.lg-btn svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; transition: transform .2s; }
.lg-btn:hover { transform: translateY(-2px); filter: brightness(1.08); box-shadow: 0 14px 28px rgba(20, 6, 1, .5), inset 0 1px 0 rgba(255, 210, 170, .35); }
.lg-btn:hover svg { transform: translateX(3px); }
.lg-btn:active { transform: translateY(0); }
.lg-btn:disabled { opacity: .7; cursor: wait; }

#login-err { background: rgba(200, 50, 40, .22); border: 1px solid rgba(255, 130, 110, .5); color: #ffd9d2; padding: 8px 14px; border-radius: 14px; font-size: 12.5px; margin: -4px 0 14px; text-align: center; }
.lg-note { text-align: center; font-size: 12.5px; color: rgba(255, 232, 210, .8); margin: 12px 0 0; line-height: 1.4; }
.lg-note b { color: #ffb36b; font-weight: 600; }

.lg-demo { margin-top: 12px; border-top: 1px solid rgba(255, 200, 160, .2); padding-top: 9px; }
.lg-demo summary { cursor: pointer; list-style: none; text-align: center; font-size: 12.5px; color: rgba(255, 232, 210, .88); user-select: none; }
.lg-demo summary:hover { color: #ffb36b; }
.lg-demo summary::-webkit-details-marker { display: none; }
.lg-demo summary::after { content: " ▾"; }
.lg-demo[open] summary::after { content: " ▴"; }
.demo-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; margin-top: 8px; }
.demo-chip {
  display: flex; align-items: center; gap: 8px; text-align: left; cursor: pointer; color: #fff4e8;
  background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 200, 160, .24); border-radius: 12px; padding: 4px 8px;
  transition: all .2s var(--ease);
}
.demo-chip:hover { background: rgba(232, 116, 42, .25); border-color: rgba(255, 180, 120, .6); transform: translateY(-1px); }
.demo-chip > span:last-child { min-width: 0; line-height: 1.2; }
.demo-chip .avatar { width: 24px; height: 24px; font-size: 10px; }
.demo-chip b { display: block; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.demo-chip small { color: rgba(255, 228, 205, .7); font-size: 10.5px; white-space: nowrap; }
.login-stats { position: relative; z-index: 2; flex: 0 0 auto; margin-top: 14px; display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; animation: fadeIn 1.2s .3s both; }
.login-stats span { background: rgba(30, 12, 5, .5); border: 1px solid rgba(255, 190, 140, .25); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); padding: 5px 14px; border-radius: 999px; font-size: 12.5px; color: rgba(255, 236, 218, .92); }
.login-stats b { font-weight: 700; color: #fff; }

@media (prefers-reduced-motion: reduce) {
  .login-scene, .login-scene * { animation: none !important; }
}

/* ---------- Form controls ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 12px; font-weight: 600; color: var(--text-2); }
.input, select.input, textarea.input {
  width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line-2);
  background: var(--surface); outline: none; transition: border-color .2s, box-shadow .2s;
}
.input:focus { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(240,122,26,.15); }
textarea.input { min-height: 80px; resize: vertical; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 14px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 9px 16px; border-radius: 12px; border: 1px solid var(--line-2);
  background: var(--ctl); cursor: pointer; font-weight: 600; font-size: 13px;
  transition: transform .15s var(--ease), box-shadow .2s, background .2s, border-color .2s;
  white-space: nowrap;
}
.btn:hover { border-color: var(--brand); color: var(--brand-600); }
.btn:active { transform: scale(.97); }
.btn svg { width: 16px; height: 16px; }
.btn-primary { background: linear-gradient(135deg, #f07a1a, #d9560c); color: #fff; border-color: transparent; box-shadow: 0 6px 16px rgba(240,122,26,.3); }
.btn-primary:hover { color: #fff; box-shadow: 0 8px 22px rgba(240,122,26,.4); transform: translateY(-1px); }
.btn-dark { background: var(--navy); color: #fff; border-color: transparent; }
.btn-dark:hover { color: #fff; background: var(--navy-2); }
.btn-good { background: var(--good); color: #fff; border-color: transparent; }
.btn-good:hover { color: #fff; filter: brightness(1.05); }
.btn-danger { color: var(--bad); }
.btn-danger:hover { border-color: var(--bad); color: var(--bad); background: var(--bad-bg); }
.btn-sm { padding: 6px 10px; font-size: 12px; border-radius: 8px; }
.btn-block { width: 100%; padding: 12px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }
.icon-btn {
  width: 38px; height: 38px; border-radius: 10px; display: inline-grid; place-items: center;
  border: 1px solid var(--line-2); background: var(--ctl); cursor: pointer; position: relative;
  transition: all .2s;
}
.icon-btn:hover { border-color: var(--brand); color: var(--brand-600); }
.icon-btn svg { width: 18px; height: 18px; }
.badge-dot {
  position: absolute; top: -5px; right: -5px; min-width: 18px; height: 18px; border-radius: 9px;
  background: var(--bad); color: #fff; font-size: 10px; font-weight: 700; display: grid; place-items: center;
  padding: 0 5px; border: 2px solid var(--surface); animation: pop .4s var(--ease);
}

/* ---------- App shell ---------- */
.app { display: grid; grid-template-columns: 260px 1fr; min-height: calc(100vh / var(--zoom, 1)); }
.sidebar {
  background: var(--sidebar); color: var(--sidebar-text);
  position: sticky; top: 0; height: calc(100vh / var(--zoom, 1)); display: flex; flex-direction: column;
  padding: 18px 14px; z-index: 40; transition: transform .3s var(--ease);
  -webkit-backdrop-filter: blur(20px) saturate(140%); backdrop-filter: blur(20px) saturate(140%); border-right: 1px solid rgba(255, 210, 170, .18);
}
.sb-brand { background: #fff; border-radius: 12px; padding: 8px 12px; display: flex; align-items: center; justify-content: center; margin-bottom: 18px; }
.sb-brand img { height: 40px; }
.sb-section { font-size: 10px; text-transform: uppercase; letter-spacing: .12em; color: #9a7863; margin: 14px 10px 6px; }
.sb-nav { display: flex; flex-direction: column; gap: 2px; overflow-y: auto; flex: 1; }
.sb-link {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px;
  color: var(--sidebar-text); cursor: pointer; transition: all .2s var(--ease); position: relative; font-weight: 500;
}
.sb-link svg { width: 18px; height: 18px; flex-shrink: 0; }
.sb-link:hover { background: var(--sidebar-2); color: #fff; }
.sb-link.active { background: linear-gradient(90deg, rgba(240,122,26,.22), rgba(240,122,26,.04)); color: #fff; }
.sb-link.active::before { content: ""; position: absolute; left: -14px; top: 8px; bottom: 8px; width: 4px; border-radius: 0 4px 4px 0; background: var(--brand); }
.sb-link .count { margin-left: auto; background: var(--brand); color: #fff; font-size: 11px; border-radius: 999px; padding: 1px 8px; font-weight: 700; }
.sb-user { display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 12px; background: var(--sidebar-2); margin-top: 12px; }
.sb-user b { color: #fff; font-size: 13px; display: block; }
.sb-user small { font-size: 11px; }

.avatar {
  width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0;
  color: #fff; font-weight: 700; font-size: 13px; position: relative;
}
.avatar.sm { width: 28px; height: 28px; font-size: 11px; }
.avatar.lg { width: 56px; height: 56px; font-size: 20px; }
.avatar .presence { position: absolute; right: -1px; bottom: -1px; width: 11px; height: 11px; border-radius: 50%; border: 2px solid var(--surface); background: var(--muted); }
.avatar .presence.on { background: var(--good); }
.avatar .presence.on::after { content: ""; position: absolute; inset: -2px; border-radius: 50%; border: 2px solid var(--good); animation: ping 1.8s ease-out infinite; }
@keyframes ping { 0% { transform: scale(1); opacity: .8; } 100% { transform: scale(2.4); opacity: 0; } }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 30; display: flex; align-items: center; gap: 12px;
  padding: 14px 28px; background: var(--bar);
  -webkit-backdrop-filter: blur(16px) saturate(130%); backdrop-filter: blur(16px) saturate(130%); border-bottom: 1px solid var(--line);
}
.topbar h1 { font-size: 20px; font-weight: 800; }
.topbar .crumb { color: var(--muted); font-size: 12px; }
.topbar .spacer { flex: 1; }
.search-trigger {
  display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--ctl); color: var(--muted); cursor: pointer; min-width: 240px; transition: border-color .2s;
}
.search-trigger:hover { border-color: var(--brand); }
.search-trigger svg { width: 16px; height: 16px; }
.search-trigger kbd { margin-left: auto; font-size: 11px; border: 1px solid var(--line-2); border-radius: 6px; padding: 1px 6px; background: var(--surface-2); }
.menu-btn { display: none; }
.zoom-ctl { display: inline-flex; align-items: center; gap: 2px; background: var(--ctl); border: 1px solid var(--line-2); border-radius: 12px; padding: 2px; }
.zoom-ctl button { width: 30px; height: 32px; border: 0; background: transparent; border-radius: 10px; cursor: pointer; font-size: 17px; font-weight: 700; line-height: 1; color: var(--text); }
.zoom-ctl button:hover { background: var(--surface-2); color: var(--brand-600); }
.zoom-ctl .zoom-val { width: auto; min-width: 46px; font-size: 12px; }
.content { padding: 24px 28px 48px; animation: fadeIn .35s var(--ease); }

/* ---------- Cards / KPIs ---------- */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  -webkit-backdrop-filter: blur(16px) saturate(135%); backdrop-filter: blur(16px) saturate(135%);
  box-shadow: var(--shadow); padding: 18px 20px; animation: fadeUp .5s var(--ease) both;
}
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.card-head h3 { font-size: 15px; font-weight: 700; }
.card-head .sub { color: var(--muted); font-size: 12px; }
.row { display: grid; gap: 18px; margin-bottom: 18px; }
.row > *, .kpis > * { min-width: 0; }
.row.c2 { grid-template-columns: 1fr 1fr; }
.row.c3 { grid-template-columns: repeat(3, 1fr); }
.row.c21 { grid-template-columns: 2fr 1fr; }
.row.c12 { grid-template-columns: 1fr 2fr; }

.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; margin-bottom: 18px; }
.kpi {
  position: relative; overflow: hidden; cursor: pointer;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 16px 14px;
  -webkit-backdrop-filter: blur(14px) saturate(130%); backdrop-filter: blur(14px) saturate(130%);
  box-shadow: var(--shadow); transition: transform .25s var(--ease), box-shadow .25s, border-color .25s;
  animation: fadeUp .5s var(--ease) both;
}
.kpi:hover { transform: translateY(-3px); box-shadow: 0 14px 34px rgba(0, 0, 0, .3); border-color: var(--line-2); }
.kpi .k-icon { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; margin-bottom: 12px; }
.kpi .k-icon svg { width: 18px; height: 18px; }
.kpi .k-label { font-size: 12px; color: var(--text-2); font-weight: 600; }
.kpi .k-value { font-size: 26px; font-weight: 800; letter-spacing: -.02em; margin-top: 2px; }
.kpi .k-foot { font-size: 11px; color: var(--muted); margin-top: 4px; display: flex; align-items: center; gap: 6px; }
.kpi .k-arrow { position: absolute; top: 14px; right: 14px; color: var(--muted); opacity: 0; transform: translateX(-4px); transition: all .25s; }
.kpi:hover .k-arrow { opacity: 1; transform: none; }
.kpi.hero { background: linear-gradient(135deg, #2a1209, #5e2509 55%, #b4480f); color: #fff; border-color: transparent; }
.kpi.hero .k-label, .kpi.hero .k-foot { color: #ffe0c6; }
.kpi.hero .k-icon { background: rgba(255,255,255,.12) !important; color: #ffb46b !important; }
.kpi.hero::after { content: ""; position: absolute; width: 160px; height: 160px; right: -50px; bottom: -70px; border-radius: 50%; background: radial-gradient(circle, rgba(240,122,26,.55), transparent 70%); }
.tone-brand { background: var(--brand-50); color: var(--brand-600); }
.tone-good { background: var(--good-bg); color: var(--good); }
.tone-warn { background: var(--warn-bg); color: var(--warn); }
.tone-bad { background: var(--bad-bg); color: var(--bad); }
.tone-info { background: var(--info-bg); color: var(--info); }
.tone-violet { background: var(--violet-bg); color: var(--violet); }

.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: transparent; padding: 6px 12px; border-radius: 8px; cursor: pointer; font-weight: 600; font-size: 12px; color: var(--text-2); transition: all .2s; }
.seg button.on { background: var(--surface); color: var(--brand-600); box-shadow: 0 1px 4px rgba(0,0,0,.08); }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; margin: 0 -20px; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--surface-2); }
.tbl th:first-child, .tbl td:first-child { padding-left: 20px; }
.tbl th:last-child, .tbl td:last-child { padding-right: 20px; }
.tbl td { padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tbody tr { transition: background .15s; animation: fadeIn .4s var(--ease) both; }
.tbl tbody tr:hover { background: var(--surface-2); }
.tbl tbody tr.click { cursor: pointer; }
.tbl .r { text-align: right; }
.person { display: flex; align-items: center; gap: 10px; }
.person b { display: block; font-weight: 600; }
.person small { color: var(--muted); font-size: 11px; }

.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 11px; font-weight: 700; white-space: nowrap; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.plain::before { display: none; }

.progress { height: 6px; background: var(--line); border-radius: 999px; overflow: hidden; min-width: 80px; }
.progress > i { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), #ffb46b); border-radius: 999px; animation: growX 1s var(--ease) both; transform-origin: left; }
@keyframes growX { from { transform: scaleX(0); } }

.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.toolbar .input { width: auto; min-width: 160px; padding: 8px 12px; }
.toolbar .grow { flex: 1; min-width: 200px; }

/* ---------- Charts ---------- */
.chart { width: 100%; position: relative; cursor: pointer; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .gridline { stroke: var(--grid); stroke-width: 1; }
.chart .axis-label { fill: var(--muted); font-size: 11px; font-family: inherit; }
.chart .axis-title { fill: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; font-family: inherit; }
.chart .val { fill: var(--text-2); font-size: 10px; font-weight: 700; font-family: inherit; font-variant-numeric: tabular-nums; pointer-events: none; animation: fadeIn .5s var(--ease) both; paint-order: stroke; stroke: var(--surface); stroke-width: 3px; stroke-linejoin: round; }
.chart .val-strong { fill: var(--text); font-size: 11px; }
.chart[data-replay] { cursor: pointer; }
.dlist em.pct { font-style: normal; color: var(--muted); font-size: 11px; min-width: 34px; text-align: right; font-variant-numeric: tabular-nums; }
/* Charts wait, paused, until they scroll into view */
.anim-wait .bar, .anim-wait .line, .anim-wait .area, .anim-wait .val, .anim-wait .donut-seg, .anim-wait .funnel-bar { animation-play-state: paused !important; }
.funnel { cursor: pointer; }
/* Counsellor dashboard: commission wallet beside a 4-column card grid */
.dash-top { display: grid; grid-template-columns: minmax(300px, 1fr) 2.4fr; gap: 18px; margin-bottom: 18px; align-items: stretch; }
.dash-top > * { min-width: 0; }
.dash-top .kpis { grid-template-columns: repeat(4, 1fr); margin: 0; }
.wallet.tall { display: flex; flex-direction: column; justify-content: space-between; gap: 18px; }
.wallet .split > div { border-radius: 10px; padding: 6px 8px; margin: -6px -8px; transition: background .2s; }
.wallet .split > div:hover { background: rgba(255,255,255,.1); }
.wallet .meter { height: 8px; border-radius: 999px; background: rgba(255,255,255,.15); overflow: hidden; position: relative; z-index: 1; }
.wallet .meter i { display: block; height: 100%; background: linear-gradient(90deg, #ffb46b, #f07a1a); border-radius: 999px; animation: growX 1.2s var(--ease) both; transform-origin: left; }
.wallet .meter-legend { display: flex; justify-content: space-between; font-size: 11px; color: #c9cfe0; margin-top: 6px; position: relative; z-index: 1; }
.chart .bar { transform-box: fill-box; transform-origin: bottom; animation: growY .9s var(--ease) both; }
.chart .hit { fill: transparent; cursor: pointer; }
.chart .hit:hover + .hover-band, .chart .hover-band.on { opacity: 1; }
.chart .hover-band { fill: var(--text); opacity: 0; transition: opacity .15s; pointer-events: none; fill-opacity: .04; }
.chart .line { fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 2000; stroke-dashoffset: 2000; animation: draw 1.6s var(--ease) .3s forwards; }
.chart .area { animation: fadeIn 1.2s var(--ease) .4s both; }
.chart .dot { stroke: var(--surface); stroke-width: 2; }
@keyframes growY { from { transform: scaleY(0); } }
@keyframes draw { to { stroke-dashoffset: 0; } }
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12px; color: var(--text-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.legend i.ln { height: 3px; border-radius: 2px; width: 14px; }
.donut-wrap { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.donut-wrap .chart { width: 170px; flex-shrink: 0; }
.donut-seg { transition: opacity .2s; cursor: pointer; animation: donutIn 1.2s var(--ease) both; }
.donut-wrap:hover .donut-seg { opacity: .45; }
.donut-wrap .donut-seg:hover { opacity: 1; }
@keyframes donutIn { from { stroke-dasharray: 0 999; } }
.donut-center { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; pointer-events: none; }
.donut-center b { font-size: 24px; display: block; line-height: 1; }
.donut-center small { color: var(--muted); font-size: 11px; }
.dlist { flex: 1; min-width: 160px; display: flex; flex-direction: column; gap: 8px; }
.dlist div { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.dlist i { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }
.dlist span { flex: 1; color: var(--text-2); }

.funnel { display: flex; flex-direction: column; gap: 8px; }
.funnel-row { display: grid; grid-template-columns: 150px 1fr 44px; align-items: center; gap: 10px; font-size: 12px; cursor: pointer; }
.funnel-row span { color: var(--text-2); }
.funnel-track { height: 22px; background: var(--surface-2); border-radius: 6px; overflow: hidden; }
.funnel-bar { height: 100%; border-radius: 4px; background: var(--s1); animation: growX 1s var(--ease) both; transform-origin: left; transition: filter .2s; }
.funnel-row:hover .funnel-bar { filter: brightness(1.12); }
.funnel-row b { text-align: right; }

.tooltip {
  position: fixed; z-index: 200; pointer-events: none; background: var(--navy); color: #fff; border: 1px solid rgba(255, 190, 140, .25);
  padding: 8px 12px; border-radius: 10px; font-size: 12px; box-shadow: var(--shadow-lg); opacity: 0;
  transform: translateY(4px); transition: opacity .12s, transform .12s; max-width: 260px;
}
.tooltip.on { opacity: 1; transform: none; }
.tooltip .tt-row { display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.tooltip .tt-row i { width: 8px; height: 8px; border-radius: 2px; display: inline-block; margin-right: 6px; }
.tooltip b { font-weight: 700; }

/* ---------- Live / activity ---------- */
.live-list { display: flex; flex-direction: column; gap: 4px; }
.live-item { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 10px; transition: background .2s; }
.live-item:hover { background: var(--surface-2); }
.live-item .meta { flex: 1; min-width: 0; }
.live-item .meta b { font-size: 13px; display: block; }
.live-item .meta small { color: var(--text-2); font-size: 12px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.live-item .when { font-size: 11px; color: var(--muted); white-space: nowrap; }
.live-badge { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 700; color: var(--good); background: var(--good-bg); padding: 3px 10px; border-radius: 999px; }
.live-badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--good); animation: blink 1.4s infinite; }
@keyframes blink { 50% { opacity: .25; } }
.feed { display: flex; flex-direction: column; max-height: 380px; overflow-y: auto; }
.feed-item { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px dashed var(--line); font-size: 13px; animation: slideIn .4s var(--ease) both; }
.feed-item:last-child { border-bottom: 0; }
.feed-item .ic { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; flex-shrink: 0; }
.feed-item .ic svg { width: 15px; height: 15px; }
.feed-item small { color: var(--muted); font-size: 11px; display: block; }
@keyframes slideIn { from { opacity: 0; transform: translateX(-8px); } }

/* ---------- Stepper ---------- */
.stepper { display: flex; gap: 0; overflow-x: auto; padding: 8px 0 4px; }
.step { flex: 1; min-width: 90px; text-align: center; position: relative; font-size: 11px; color: var(--muted); }
.step::before { content: ""; position: absolute; top: 15px; left: -50%; width: 100%; height: 3px; background: var(--line); z-index: 0; }
.step:first-child::before { display: none; }
.step.done::before, .step.current::before { background: linear-gradient(90deg, var(--brand), #ffb46b); }
.step .dot { width: 32px; height: 32px; border-radius: 50%; margin: 0 auto 6px; display: grid; place-items: center; background: var(--surface); border: 2px solid var(--line-2); position: relative; z-index: 1; font-weight: 700; transition: all .3s; }
.step .dot svg { width: 14px; height: 14px; }
.step.done .dot { background: var(--brand); border-color: var(--brand); color: #fff; }
.step.current .dot { border-color: var(--brand); color: var(--brand-600); box-shadow: 0 0 0 6px rgba(240,122,26,.15); animation: pulseRing 2s infinite; }
.step.done, .step.current { color: var(--text); font-weight: 600; }
.step.rejected .dot { background: var(--bad); border-color: var(--bad); color: #fff; }
@keyframes pulseRing { 50% { box-shadow: 0 0 0 10px rgba(240,122,26,.05); } }

.timeline { display: flex; flex-direction: column; gap: 0; position: relative; padding-left: 18px; }
.timeline::before { content: ""; position: absolute; left: 5px; top: 6px; bottom: 6px; width: 2px; background: var(--line); }
.tl-item { position: relative; padding: 0 0 14px 10px; font-size: 13px; }
.tl-item::before { content: ""; position: absolute; left: -18px; top: 5px; width: 12px; height: 12px; border-radius: 50%; background: var(--surface); border: 3px solid var(--brand); }
.tl-item small { color: var(--muted); display: block; font-size: 11px; }

/* ---------- Documents ---------- */
.docs-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
.doc {
  border: 1px solid var(--line); border-radius: 12px; padding: 12px; display: flex; gap: 10px; align-items: flex-start;
  background: var(--surface-2); transition: all .2s;
}
.doc:hover { border-color: var(--line-2); transform: translateY(-1px); }
.doc .ic { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; flex-shrink: 0; }
.doc .ic svg { width: 16px; height: 16px; }
.doc b { font-size: 13px; display: block; }
.doc small { font-size: 11px; color: var(--muted); display: block; }
.doc .act { margin-top: 6px; display: flex; gap: 6px; flex-wrap: wrap; }
.dropzone {
  border: 2px dashed var(--line-2); border-radius: 12px; padding: 18px; text-align: center; color: var(--text-2);
  transition: all .2s; cursor: pointer; background: var(--surface-2);
}
.dropzone:hover, .dropzone.over { border-color: var(--brand); background: var(--brand-50); color: var(--brand-700); }

/* ---------- Modal / drawer ---------- */
.overlay {
  position: fixed; inset: 0; background: rgba(12, 5, 2, .62); backdrop-filter: blur(5px); z-index: 100;
  display: flex; align-items: center; justify-content: center; padding: 20px; animation: fadeIn .2s both;
}
.modal {
  background: var(--surface); border-radius: 18px; box-shadow: var(--shadow-lg); width: 100%; max-width: 640px;
  max-height: calc(100vh / var(--zoom, 1) - 40px); display: flex; flex-direction: column; animation: modalIn .35s var(--ease) both; overflow: hidden;
}
.modal.wide { max-width: 980px; }
.modal.xl { max-width: 1180px; }
.modal-head { display: flex; align-items: center; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.modal-head h3 { font-size: 17px; font-weight: 800; flex: 1; }
.modal-body { padding: 20px 22px; overflow-y: auto; }
.modal-foot { padding: 14px 22px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 10px; background: var(--surface-2); }
@keyframes modalIn { from { opacity: 0; transform: translateY(16px) scale(.97); } }
.drawer-overlay { justify-content: flex-end; padding: 0; }
.modal.drawer { max-width: 780px; }
.drawer { height: calc(100vh / var(--zoom, 1)); max-height: calc(100vh / var(--zoom, 1)); border-radius: 18px 0 0 18px; max-width: 560px; animation: drawerIn .4s var(--ease) both; }
@keyframes drawerIn { from { transform: translateX(100%); } }

.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 300; display: flex; flex-direction: column; gap: 10px; }
.toast {
  min-width: 280px; max-width: 360px; background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--brand);
  border-radius: 12px; box-shadow: var(--shadow-lg); padding: 12px 14px; display: flex; gap: 10px; align-items: flex-start;
  animation: toastIn .4s var(--ease) both;
}
.toast.good { border-left-color: var(--good); }
.toast.bad { border-left-color: var(--bad); }
.toast.push { border-left-color: var(--violet); }
.toast b { display: block; font-size: 13px; }
.toast small { color: var(--text-2); font-size: 12px; }
.toast.out { animation: toastOut .3s ease forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateX(40px); } }
@keyframes toastOut { to { opacity: 0; transform: translateX(40px); } }

.notif-panel {
  position: absolute; right: 0; top: 46px; width: 360px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 14px; box-shadow: var(--shadow-lg); z-index: 50; animation: modalIn .25s var(--ease) both; overflow: hidden;
}
.notif-panel header { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.notif-list { max-height: 380px; overflow-y: auto; }
.notif { display: flex; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); cursor: pointer; transition: background .15s; }
.notif:hover { background: var(--surface-2); }
.notif.unread { background: var(--brand-50); }
.notif b { font-size: 13px; display: block; }
.notif small { color: var(--text-2); font-size: 12px; display: block; }
.notif time { color: var(--muted); font-size: 11px; }

.cmdk { max-width: 600px; align-self: flex-start; margin-top: calc(10vh / var(--zoom, 1)); }
.cmdk input { border: 0; padding: 18px 20px; font-size: 16px; width: 100%; outline: none; background: transparent; border-bottom: 1px solid var(--line); }
.cmdk-list { max-height: 420px; overflow-y: auto; padding: 8px; }
.cmdk-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; cursor: pointer; }
.cmdk-item:hover, .cmdk-item.sel { background: var(--brand-50); }

/* ---------- University portal simulation ---------- */
.portal { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: #fff; color: #1b2033; }
.portal-chrome { display: flex; align-items: center; gap: 8px; background: #eceef3; padding: 8px 12px; border-bottom: 1px solid #dde0e8; }
.portal-chrome i { width: 11px; height: 11px; border-radius: 50%; display: inline-block; }
.portal-url { flex: 1; background: #fff; border-radius: 8px; padding: 5px 12px; font-size: 12px; color: #4b5266; display: flex; align-items: center; gap: 6px; }
.portal-url svg { width: 12px; height: 12px; color: #12a150; }
.portal-head { padding: 14px 18px; color: #fff; display: flex; align-items: center; gap: 12px; }
.portal-head b { font-size: 16px; }
.portal-body { padding: 18px; min-height: 360px; }
.portal .input { background: #fff; border-color: #d6dae4; color: #1b2033; }
.portal .field label { color: #4b5266; }
.typing { border-color: var(--brand) !important; box-shadow: 0 0 0 4px rgba(240,122,26,.15); }
.vault { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); font-size: 12px; }
.vault code { background: var(--surface); border: 1px solid var(--line); padding: 2px 8px; border-radius: 6px; }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid rgba(240,122,26,.25); border-top-color: var(--brand); animation: spin .8s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Misc ---------- */
.empty { text-align: center; padding: 36px 16px; color: var(--muted); }
.empty svg { width: 42px; height: 42px; opacity: .5; margin-bottom: 8px; }
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 8px 12px; font-size: 13px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 600; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.tabs button { border: 0; background: transparent; padding: 10px 14px; cursor: pointer; font-weight: 600; color: var(--text-2); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; transition: all .2s; }
.tabs button.on { color: var(--brand-600); border-color: var(--brand); }
.wallet {
  background: linear-gradient(135deg, #2a1209 0%, #5e2509 55%, #b4480f 100%); color: #fff; border-radius: 18px; padding: 22px;
  position: relative; overflow: hidden; box-shadow: var(--shadow-lg); animation: fadeUp .5s var(--ease) both;
}
.wallet::after { content: ""; position: absolute; width: 240px; height: 240px; border-radius: 50%; right: -60px; top: -80px; background: radial-gradient(circle, rgba(240,122,26,.6), transparent 70%); }
.wallet small { color: #ffe0c6; text-transform: uppercase; letter-spacing: .1em; font-size: 11px; }
.wallet .big { font-size: 36px; font-weight: 800; letter-spacing: -.02em; }
.wallet .split { display: flex; gap: 28px; margin-top: 14px; position: relative; z-index: 1; }
.wallet .split b { font-size: 18px; display: block; }
.uni-tag { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; }
.uni-tag i { width: 8px; height: 8px; border-radius: 2px; }
.banner {
  display: flex; align-items: center; gap: 14px; padding: 14px 18px; border-radius: var(--radius); margin-bottom: 18px;
  background: linear-gradient(90deg, var(--brand-50), var(--surface)); border: 1px solid var(--brand-100); animation: fadeUp .5s var(--ease) both;
}
.banner .ic { width: 40px; height: 40px; border-radius: 12px; background: var(--brand); color: #fff; display: grid; place-items: center; flex-shrink: 0; }
.banner .ic svg { width: 20px; height: 20px; }
.welcome h2 { font-size: 22px; font-weight: 800; }
.welcome p { color: var(--text-2); margin: 4px 0 0; }
.chk { display: flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; }
.chk input { accent-color: var(--brand); width: 16px; height: 16px; }
.mini-stat { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px dashed var(--line); font-size: 13px; }
.mini-stat:last-child { border: 0; }
.mini-stat b { font-variant-numeric: tabular-nums; }
.lb-row { display: grid; grid-template-columns: 24px 1fr auto; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.lb-row:last-child { border: 0; }
.rank { width: 24px; height: 24px; border-radius: 8px; display: grid; place-items: center; font-size: 11px; font-weight: 800; background: var(--surface-2); color: var(--text-2); }
.rank.r1 { background: linear-gradient(135deg, #ffd27a, #f0a01a); color: #5a3500; }
.rank.r2 { background: #e3e6ee; color: #4b5266; }
.rank.r3 { background: #f3d2b7; color: #7a3d12; }

.no-anim, .no-anim *:not(.spinner) { animation: none !important; }
.no-anim .chart .line { stroke-dashoffset: 0; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(12px); } }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes pop { 0% { transform: scale(0); } 70% { transform: scale(1.2); } 100% { transform: scale(1); } }

.stagger > *:nth-child(1) { animation-delay: .02s; } .stagger > *:nth-child(2) { animation-delay: .06s; }
.stagger > *:nth-child(3) { animation-delay: .10s; } .stagger > *:nth-child(4) { animation-delay: .14s; }
.stagger > *:nth-child(5) { animation-delay: .18s; } .stagger > *:nth-child(6) { animation-delay: .22s; }
.stagger > *:nth-child(7) { animation-delay: .26s; } .stagger > *:nth-child(8) { animation-delay: .30s; }
.stagger > *:nth-child(9) { animation-delay: .34s; } .stagger > *:nth-child(10) { animation-delay: .38s; }
.stagger > *:nth-child(n+11) { animation-delay: .42s; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; transition-duration: .01ms !important; }
  .chart .line { stroke-dashoffset: 0; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1200px) {
  .row.c3 { grid-template-columns: 1fr 1fr; }
  .dash-top { grid-template-columns: 1fr; }
}
@media (max-width: 980px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; width: 270px; transform: translateX(-100%); }
  .sidebar.open { transform: none; box-shadow: var(--shadow-lg); }
  .menu-btn { display: inline-grid; }
  .row.c2, .row.c3, .row.c21, .row.c12 { grid-template-columns: 1fr; }
  .dash-top .kpis { grid-template-columns: repeat(2, 1fr); }
  .search-trigger { min-width: 0; }
  .search-trigger span, .search-trigger kbd { display: none; }
}
@media (max-width: 640px) {
  .topbar { padding: 12px 16px; }
  .content { padding: 16px 16px 40px; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: 1fr 1fr; gap: 10px; }
  .kpi .k-value { font-size: 20px; }
  .toasts { left: 12px; right: 12px; bottom: 12px; }
  .toast { min-width: 0; max-width: none; }
  .notif-panel { position: fixed; left: 12px; right: 12px; top: 64px; width: auto; }
  .funnel-row { grid-template-columns: 100px 1fr 34px; }
  .demo-grid { grid-template-columns: 1fr; }
  .topbar .crumb { display: none; }
  .kv { grid-template-columns: 110px 1fr; }
}

/* ---------- Signed-in background: plain page + a few shapes at the bottom ---------- */
body.in-app .login-scene { background: #ffffff; animation: none; }
:root:not([data-theme="light"]) body.in-app .login-scene { background: #170a05; }
body.in-app .login-scene .ls-sheen,
body.in-app .login-scene > .px:nth-child(2),
body.in-app .login-scene .ls-blob:nth-child(1),
body.in-app .login-scene .ls-blob:nth-child(3),
body.in-app .login-scene .ls-blob:nth-child(5),
body.in-app .login-scene .ls-blob:nth-child(6),
body.in-app .login-scene > .px:nth-child(4) { display: none; }
/* the shapes that stay, kept low and to the right so they sit beside the sidebar */
body.in-app .login-scene .ls-blob:nth-child(2) { left: 10vw !important; bottom: -9vh !important; --w: clamp(320px, 36vw, 600px) !important; --h: clamp(230px, 26vw, 420px) !important; }
body.in-app .login-scene .ls-blob:nth-child(4) { right: -7vw !important; bottom: -8vh !important; --w: clamp(340px, 40vw, 680px) !important; --h: clamp(240px, 27vw, 440px) !important; }
:root[data-theme="light"] body.in-app .login-scene .ls-blob:nth-child(2) { --bg: linear-gradient(145deg, #ffc968, #f98d1c) !important; }
:root[data-theme="light"] body.in-app .login-scene .ls-blob:nth-child(4) { --bg: linear-gradient(145deg, #ffb255, #ee6f1a) !important; }
:root[data-theme="light"] body.in-app .login-scene .ls-blob { box-shadow: 0 24px 44px rgba(190, 80, 10, .2), inset -18px -22px 50px rgba(200, 80, 10, .22), inset 14px 16px 40px rgba(255, 245, 220, .45); }
body.in-app .content { padding-bottom: 190px; }

/* ---------- Sign-in photo background (London, orange duotone) ---------- */
.ls-photo {
  position: absolute; inset: -34px; background: url('../assets/london.jpg') 74% center / cover no-repeat;
  transform: translate3d(calc(var(--mx, 0) * -16px), calc(var(--my, 0) * -10px), 0) scale(1.03);
  transition: transform .8s cubic-bezier(.2, .8, .2, 1); filter: contrast(1.06) brightness(1.04);
}
.ls-wash { position: absolute; inset: 0; background: #ff9a3d; mix-blend-mode: color; opacity: .86; }
.ls-haze {
  position: absolute; inset: 0;
  background: radial-gradient(900px 540px at 80% 18%, rgba(255, 238, 205, .5), transparent 62%),
              linear-gradient(180deg, rgba(255, 206, 140, .24), rgba(255, 150, 60, .1) 45%, rgba(86, 28, 4, .55) 100%);
}
.ls-sweep {
  position: absolute; inset: 0; mix-blend-mode: screen;
  background: linear-gradient(115deg, transparent 38%, rgba(255, 232, 195, .22) 50%, transparent 62%); background-size: 260% 100%;
  animation: lightSweep 11s ease-in-out infinite;
}
@keyframes lightSweep { from { background-position: 130% 0; } to { background-position: -50% 0; } }
/* sign-in uses the photo; the blobs are only for the signed-in pages */
body:not(.in-app) .login-scene > .px, body:not(.in-app) .login-scene .ls-sheen { display: none; }
body.in-app .ls-photo, body.in-app .ls-wash, body.in-app .ls-haze, body.in-app .ls-sweep { display: none; }

@media (max-height: 820px) { .login-stats { display: none; } }
@media (max-width: 980px) { .zoom-ctl { display: none; } }

/* Short windows (small laptops): a more compact sidebar so the whole menu fits without scrolling */
@media (max-height: 800px) {
  .sidebar { padding: 12px 12px; }
  .sb-brand { margin-bottom: 10px; padding: 6px 10px; }
  .sb-brand img { height: 32px; }
  .sb-section { margin: 8px 10px 3px; }
  .sb-link { padding: 7px 12px; }
  .sb-user { padding: 8px 10px; margin-top: 8px; }
}
