/* ============================================================
   webcomm — "Aurora Glass" design system
   Dark navy glass by default, light theme via [data-theme=light]
   ============================================================ */
:root {
  --bg: #050f1f;
  --bg2: #0a1d38;
  --glass: rgba(255, 255, 255, .055);
  --glass-2: rgba(255, 255, 255, .09);
  --glass-3: rgba(255, 255, 255, .14);
  --stroke: rgba(255, 255, 255, .11);
  --stroke-2: rgba(255, 255, 255, .2);
  --text: #eaf2ff;
  --text-2: #a9bbd6;
  --text-3: #6f86a8;
  --brand: #2f8fe0;
  --brand-2: #4fc3f7;
  --brand-3: #7c5cff;
  --navy: #0f3d66;
  --ok: #2fd0a0;
  --warn: #ffb547;
  --bad: #ff5d6c;
  --gold: #e2b764;
  --shadow: 0 20px 60px -20px rgba(0, 0, 0, .65);
  --glow: 0 0 0 1px rgba(79, 195, 247, .35), 0 10px 40px -8px rgba(47, 143, 224, .55);
  --r: 20px;
  --r-sm: 12px;
  --side: 268px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --font: "Segoe UI", "Segoe UI Variable Text", Tahoma, "Arial", sans-serif;
  --input: rgba(4, 14, 30, .55);
  color-scheme: dark;
}
[data-theme=light] {
  --bg: #eef4fb;
  --bg2: #dce9f7;
  --glass: rgba(255, 255, 255, .62);
  --glass-2: rgba(255, 255, 255, .78);
  --glass-3: rgba(255, 255, 255, .92);
  --stroke: rgba(15, 61, 102, .1);
  --stroke-2: rgba(15, 61, 102, .2);
  --text: #0c2340;
  --text-2: #3f5878;
  --text-3: #7a8fab;
  --shadow: 0 20px 50px -24px rgba(15, 61, 102, .35);
  --input: rgba(255, 255, 255, .9);
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font); color: var(--text); background: var(--bg);
  font-size: 15px; line-height: 1.55; overflow: hidden;
  -webkit-font-smoothing: antialiased;
}
::selection { background: rgba(79, 195, 247, .35); }
a { color: inherit; text-decoration: none; }
svg { width: 18px; height: 18px; flex: none; vertical-align: -3px; }
.card h3 svg { width: 20px; height: 20px; color: var(--brand-2); }
button, input, select, textarea { font: inherit; color: inherit; }

/* ---------- animated aurora background ---------- */
.aurora { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none;
  background: radial-gradient(1200px 800px at 85% -10%, var(--bg2), transparent 60%), var(--bg); }
.aurora i { position: absolute; border-radius: 50%; filter: blur(80px); opacity: .55; mix-blend-mode: screen; animation: drift 26s var(--ease) infinite alternate; }
.aurora i:nth-child(1) { width: 640px; height: 640px; background: #1c6fd1; top: -180px; right: -120px; }
.aurora i:nth-child(2) { width: 520px; height: 520px; background: #18b6d8; bottom: -200px; left: 10%; animation-duration: 32s; animation-delay: -8s; }
.aurora i:nth-child(3) { width: 460px; height: 460px; background: #6a4cff; top: 30%; left: -160px; opacity: .35; animation-duration: 38s; animation-delay: -16s; }
.aurora i:nth-child(4) { width: 300px; height: 300px; background: #e2b764; bottom: 10%; right: 25%; opacity: .14; animation-duration: 44s; }
[data-theme=light] .aurora i { mix-blend-mode: multiply; opacity: .22; }
@keyframes drift {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-60px, 40px) scale(1.12); }
  100% { transform: translate(50px, -30px) scale(.95); }
}
.grain { position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: .05;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>"); }

/* ---------- shell ---------- */
.shell { position: relative; z-index: 1; display: grid; grid-template-columns: var(--side) 1fr; height: 100vh; transition: grid-template-columns .45s var(--ease); }
.shell.collapsed { --side: 84px; }
.side { margin: 14px 14px 14px 0; border-radius: 26px; background: var(--glass); border: 1px solid var(--stroke);
  backdrop-filter: blur(26px) saturate(150%); -webkit-backdrop-filter: blur(26px) saturate(150%);
  display: flex; flex-direction: column; overflow: hidden; box-shadow: var(--shadow); }
.brand { display: flex; align-items: center; gap: 12px; padding: 22px 18px 16px; }
.brand .mark { width: 46px; height: 46px; border-radius: 14px; flex: none; display: grid; place-items: center;
  background: linear-gradient(140deg, #2f8fe0, #0f3d66 70%); box-shadow: 0 10px 30px -8px rgba(47, 143, 224, .8), inset 0 1px 0 rgba(255,255,255,.35); }
.brand .mark img { width: 34px; height: 34px; object-fit: contain; }
.brand b { display: block; font-size: 17px; letter-spacing: .2px; white-space: nowrap; }
.brand small { color: var(--text-3); font-size: 12px; white-space: nowrap; }
.collapsed .brand > div, .collapsed .nav span, .collapsed .side-foot span, .collapsed .nav .sec { display: none; }
.nav { padding: 6px 12px; display: flex; flex-direction: column; gap: 4px; flex: 1; overflow: auto; }
.nav .sec { color: var(--text-3); font-size: 11.5px; letter-spacing: 1px; margin: 14px 12px 4px; }
.nav a { position: relative; display: flex; align-items: center; gap: 14px; padding: 11px 14px; border-radius: 14px; color: var(--text-2);
  transition: background .25s, color .25s, transform .25s var(--ease); }
.nav a svg { width: 21px; height: 21px; flex: none; }
.nav a:hover { background: var(--glass-2); color: var(--text); transform: translateX(-3px); }
.nav a.on { color: #fff; background: linear-gradient(135deg, rgba(47, 143, 224, .9), rgba(15, 61, 102, .9)); box-shadow: var(--glow); }
[data-theme=light] .nav a.on { color: #fff; }
.nav a.on::after { content: ""; position: absolute; left: -12px; top: 22%; bottom: 22%; width: 4px; border-radius: 4px; background: var(--brand-2); box-shadow: 0 0 14px var(--brand-2); }
.nav .badge { margin-inline-start: auto; font-size: 11px; padding: 1px 8px; border-radius: 99px; background: rgba(255, 181, 71, .18); color: var(--warn); }
.side-foot { padding: 12px; border-top: 1px solid var(--stroke); display: flex; gap: 8px; }

.main { display: flex; flex-direction: column; min-width: 0; height: 100vh; }
.top { display: flex; align-items: center; gap: 14px; padding: 18px 26px 10px 14px; }
.top h1 { margin: 0; font-size: 26px; font-weight: 800; letter-spacing: -.3px; }
.top .sub { color: var(--text-3); font-size: 13px; }
.top .grow { flex: 1; }
.searchbox { display: flex; align-items: center; gap: 10px; min-width: 300px; padding: 10px 16px; border-radius: 16px; cursor: text;
  background: var(--glass); border: 1px solid var(--stroke); color: var(--text-3); backdrop-filter: blur(18px); transition: border-color .2s, box-shadow .2s; }
.searchbox:hover { border-color: var(--stroke-2); box-shadow: var(--glow); }
.searchbox kbd { margin-inline-start: auto; }
kbd { font: 600 11px var(--font); padding: 2px 7px; border-radius: 7px; border: 1px solid var(--stroke-2); color: var(--text-2); background: var(--glass-2); }
.view { flex: 1; overflow: auto; padding: 8px 26px 40px 14px; scroll-behavior: smooth; }
.view::-webkit-scrollbar, .scroll::-webkit-scrollbar { width: 10px; height: 10px; }
.view::-webkit-scrollbar-thumb, .scroll::-webkit-scrollbar-thumb { background: var(--glass-3); border-radius: 10px; border: 3px solid transparent; background-clip: padding-box; }
.page { animation: pageIn .55s var(--ease) both; }
@keyframes pageIn { from { opacity: 0; transform: translateY(14px) scale(.995); filter: blur(4px); } to { opacity: 1; transform: none; filter: none; } }

/* ---------- glass cards ---------- */
.card { position: relative; background: var(--glass); border: 1px solid var(--stroke); border-radius: var(--r); padding: 20px;
  backdrop-filter: blur(22px) saturate(140%); -webkit-backdrop-filter: blur(22px) saturate(140%); box-shadow: var(--shadow); }
.card.hover { transition: transform .35s var(--ease), box-shadow .35s, border-color .35s; }
.card.hover:hover { transform: translateY(-4px); border-color: var(--stroke-2); box-shadow: var(--shadow), var(--glow); }
.card h3 { margin: 0 0 14px; font-size: 16px; display: flex; align-items: center; gap: 10px; }
.card h3 .muted { font-weight: 400; }
.shine { overflow: hidden; }
.shine::before { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, .09) 45%, transparent 60%); transform: translateX(120%); transition: transform 1s var(--ease); }
.shine:hover::before { transform: translateX(-120%); }
.stagger > * { animation: rise .6s var(--ease) both; }
.stagger > *:nth-child(2) { animation-delay: .05s; } .stagger > *:nth-child(3) { animation-delay: .1s; } .stagger > *:nth-child(4) { animation-delay: .15s; }
.stagger > *:nth-child(5) { animation-delay: .2s; } .stagger > *:nth-child(6) { animation-delay: .25s; } .stagger > *:nth-child(7) { animation-delay: .3s; } .stagger > *:nth-child(n+8) { animation-delay: .35s; }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }

.grid { display: grid; gap: 18px; }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g21 { grid-template-columns: 2fr 1fr; }
.g12 { grid-template-columns: 1fr 2fr; }
@media (max-width: 1250px) { .g4 { grid-template-columns: repeat(2, 1fr); } .g21, .g12, .g3 { grid-template-columns: 1fr; } }
.row { display: flex; align-items: center; gap: 10px; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; }
.muted { color: var(--text-3); }
.dim { color: var(--text-2); }
.mt { margin-top: 18px; } .mb { margin-bottom: 18px; }
.nowrap { white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }

/* ---------- KPI ---------- */
.kpi { overflow: hidden; }
.kpi .ico { width: 48px; height: 48px; border-radius: 15px; display: grid; place-items: center; color: #fff; flex: none; }
.kpi .ico svg { width: 24px; height: 24px; }
.kpi .v { font-size: 34px; font-weight: 800; letter-spacing: -.5px; line-height: 1.1; margin-top: 14px; }
.kpi .l { color: var(--text-2); font-size: 13.5px; }
.kpi .spark { position: absolute; left: -20px; bottom: -30px; width: 160px; height: 160px; border-radius: 50%; filter: blur(40px); opacity: .45; }
.c-blue { background: linear-gradient(135deg, #2f8fe0, #1450a0); } .c-cyan { background: linear-gradient(135deg, #4fc3f7, #1088b8); }
.c-violet { background: linear-gradient(135deg, #8b6cff, #4b2fc9); } .c-gold { background: linear-gradient(135deg, #f0c574, #b07c22); }
.c-green { background: linear-gradient(135deg, #34d8a8, #0f8c6c); } .c-red { background: linear-gradient(135deg, #ff7a86, #c4283a); }

/* ---------- buttons ---------- */
.btn { position: relative; overflow: hidden; display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; cursor: pointer;
  padding: 10px 18px; border-radius: 13px; font-weight: 650; white-space: nowrap; color: #fff;
  background: linear-gradient(135deg, #2f8fe0, #175aa8); box-shadow: 0 10px 26px -10px rgba(47, 143, 224, .9), inset 0 1px 0 rgba(255,255,255,.25);
  transition: transform .2s var(--ease), box-shadow .25s, filter .2s; }
.btn:hover { transform: translateY(-2px); box-shadow: 0 16px 34px -10px rgba(47, 143, 224, 1), inset 0 1px 0 rgba(255,255,255,.3); filter: brightness(1.08); }
.btn:active { transform: translateY(0) scale(.98); }
.btn svg { width: 18px; height: 18px; }
.btn.ghost { background: var(--glass-2); color: var(--text); border: 1px solid var(--stroke); box-shadow: none; }
.btn.ghost:hover { border-color: var(--stroke-2); background: var(--glass-3); }
.btn.danger { background: linear-gradient(135deg, #ff6b78, #c4283a); box-shadow: 0 10px 26px -10px rgba(255, 93, 108, .9); }
.btn.ok { background: linear-gradient(135deg, #34d8a8, #0f8c6c); box-shadow: 0 10px 26px -10px rgba(47, 208, 160, .8); }
.btn.sm { padding: 7px 12px; border-radius: 11px; font-size: 13.5px; }
.btn.icon { padding: 9px; border-radius: 12px; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.ripple { position: absolute; border-radius: 50%; transform: scale(0); background: rgba(255, 255, 255, .45); animation: ripple .6s linear; pointer-events: none; }
@keyframes ripple { to { transform: scale(4); opacity: 0; } }

/* ---------- forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label { font-size: 12.5px; color: var(--text-2); font-weight: 600; letter-spacing: .2px; }
.in, select.in, textarea.in { width: 100%; padding: 11px 14px; border-radius: 13px; border: 1px solid var(--stroke); background: var(--input); outline: none;
  transition: border-color .2s, box-shadow .2s, background .2s; }
.in:hover { border-color: var(--stroke-2); }
.in:focus { border-color: var(--brand-2); box-shadow: 0 0 0 4px rgba(79, 195, 247, .18); }
.in[disabled] { opacity: .45; }
textarea.in { resize: vertical; min-height: 120px; line-height: 1.7; }
select.in { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--text-3) 50%), linear-gradient(135deg, var(--text-3) 50%, transparent 50%);
  background-position: 18px 52%, 13px 52%; background-size: 5px 5px; background-repeat: no-repeat; padding-left: 34px; }
select.in option { background: #0c1e38; color: #eaf2ff; }
[data-theme=light] select.in option { background: #fff; color: #0c2340; }
.fgrid { display: grid; gap: 14px; grid-template-columns: repeat(12, minmax(0, 1fr)); }
.s2 { grid-column: span 2; } .s3 { grid-column: span 3; } .s4 { grid-column: span 4; } .s5 { grid-column: span 5; } .s6 { grid-column: span 6; }
.s7 { grid-column: span 7; } .s8 { grid-column: span 8; } .s12 { grid-column: span 12; }
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.switch input { display: none; }
.switch i { width: 46px; height: 26px; border-radius: 99px; background: var(--glass-3); border: 1px solid var(--stroke-2); position: relative; transition: background .25s; }
.switch i::after { content: ""; position: absolute; top: 3px; right: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .3s var(--ease); box-shadow: 0 2px 6px rgba(0,0,0,.3); }
.switch input:checked + i { background: linear-gradient(135deg, #34d8a8, #2f8fe0); }
.switch input:checked + i::after { transform: translateX(-20px); }

/* ---------- tables ---------- */
.tbl { width: 100%; border-collapse: separate; border-spacing: 0 6px; }
.tbl th { text-align: right; font-size: 12.5px; color: var(--text-3); font-weight: 600; padding: 4px 14px; white-space: nowrap; }
.tbl td { padding: 12px 14px; background: var(--glass); border-top: 1px solid var(--stroke); border-bottom: 1px solid var(--stroke); vertical-align: top; }
.tbl td:first-child { border-right: 1px solid var(--stroke); border-radius: 0 14px 14px 0; }
.tbl td:last-child { border-left: 1px solid var(--stroke); border-radius: 14px 0 0 14px; }
.tbl tr.click { cursor: pointer; }
.tbl tr.click td { transition: background .2s, border-color .2s; }
.tbl tr.click:hover td { background: var(--glass-2); border-color: var(--stroke-2); }
.tbl .txt { max-width: 520px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
mark { background: rgba(255, 213, 79, .35); color: inherit; border-radius: 4px; padding: 0 2px; }

.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 11px; border-radius: 99px; font-size: 12.5px; font-weight: 600;
  background: var(--glass-2); border: 1px solid var(--stroke); white-space: nowrap; }
.chip.ok { color: var(--ok); background: rgba(47, 208, 160, .12); border-color: rgba(47, 208, 160, .3); }
.chip.warn { color: var(--warn); background: rgba(255, 181, 71, .12); border-color: rgba(255, 181, 71, .3); }
.chip.bad { color: var(--bad); background: rgba(255, 93, 108, .12); border-color: rgba(255, 93, 108, .3); }
.chip.info { color: var(--brand-2); background: rgba(79, 195, 247, .12); border-color: rgba(79, 195, 247, .3); }
.chip.gold { color: var(--gold); background: rgba(226, 183, 100, .12); border-color: rgba(226, 183, 100, .3); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; box-shadow: 0 0 10px currentColor; }

/* ---------- tabs ---------- */
.tabs { display: inline-flex; gap: 4px; padding: 5px; border-radius: 16px; background: var(--glass); border: 1px solid var(--stroke); position: relative; }
.tabs { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.tabs button { white-space: nowrap; flex: none; position: relative; z-index: 1; border: 0; background: none; cursor: pointer; padding: 9px 18px; border-radius: 12px; color: var(--text-2); font-weight: 600; transition: color .25s; display: flex; gap: 8px; align-items: center; }
.tabs button.on { color: #fff; }
.tabs .pill { position: absolute; z-index: 0; top: 5px; bottom: 5px; border-radius: 12px; background: linear-gradient(135deg, #2f8fe0, #175aa8); box-shadow: var(--glow); transition: all .45s var(--ease); }
.tabs .count { font-size: 11px; padding: 0 7px; border-radius: 99px; background: rgba(255,255,255,.18); }

/* ---------- meeting header ---------- */
.hero { overflow: hidden; padding: 26px; }
.hero::after { content: ""; position: absolute; inset: 0; pointer-events: none; border-radius: inherit;
  background: radial-gradient(600px 220px at 0% 0%, rgba(79, 195, 247, .18), transparent 70%), radial-gradient(500px 260px at 100% 120%, rgba(124, 92, 255, .16), transparent 70%); }
.hero .no { font-size: 54px; font-weight: 900; line-height: 1; letter-spacing: -2px;
  background: linear-gradient(135deg, #fff, #8fd3ff 60%, #4fc3f7); -webkit-background-clip: text; background-clip: text; color: transparent; }
[data-theme=light] .hero .no { background: linear-gradient(135deg, #0f3d66, #2f8fe0); -webkit-background-clip: text; background-clip: text; }

/* ---------- topic cards ---------- */
.topic { display: grid; grid-template-columns: 54px 1fr auto; gap: 16px; align-items: start; padding: 16px 18px; cursor: pointer; }
.topic .idx { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; font-weight: 800; color: #fff; background: linear-gradient(135deg, rgba(47,143,224,.9), rgba(15,61,102,.9)); }
.topic .t { font-weight: 600; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.topic .meta { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; color: var(--text-3); font-size: 13px; }
.topic .val { font-weight: 800; font-size: 16px; text-align: left; white-space: nowrap; }
.group-h { display: flex; align-items: center; gap: 12px; margin: 22px 4px 10px; color: var(--text-2); font-weight: 700; }
.group-h::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, transparent, var(--stroke-2)); }

/* ---------- members ---------- */
.member { display: flex; gap: 14px; align-items: center; padding: 14px 16px; cursor: pointer; user-select: none; transition: all .3s var(--ease); }
.member .av { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; color: #fff; flex: none; background: linear-gradient(135deg, #5b6b85, #33415a); transition: all .3s; }
.member.on { border-color: rgba(47, 208, 160, .5); box-shadow: 0 0 0 1px rgba(47, 208, 160, .35), 0 12px 30px -12px rgba(47, 208, 160, .6); }
.member.on .av { background: linear-gradient(135deg, #34d8a8, #2f8fe0); }
.member .ck { margin-inline-start: auto; width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--stroke-2); display: grid; place-items: center; transition: all .3s; }
.member.on .ck { border-color: transparent; background: var(--ok); color: #04261c; }
.member .ck svg { width: 15px; height: 15px; opacity: 0; transform: scale(.4); transition: all .3s var(--ease); }
.member.on .ck svg { opacity: 1; transform: none; }

/* ---------- docs ---------- */
.drop { display: block; border: 2px dashed var(--stroke-2); border-radius: var(--r); padding: 26px; text-align: center; color: var(--text-2); transition: all .3s; cursor: pointer; }
.drop.over { border-color: var(--brand-2); background: rgba(79, 195, 247, .08); transform: scale(1.01); }
.drop svg { width: 38px; height: 38px; color: var(--brand-2); }
.doc { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 14px; cursor: pointer; border: 1px solid transparent; transition: all .25s; }
.doc:hover { background: var(--glass-2); }
.doc.on { background: var(--glass-2); border-color: var(--brand-2); box-shadow: var(--glow); }
.doc .pdf { width: 40px; height: 48px; border-radius: 9px; display: grid; place-items: center; font-size: 11px; font-weight: 800; color: #fff; background: linear-gradient(160deg, #ff6b78, #b3261e); flex: none; }
.viewer { width: 100%; height: 72vh; border: 0; border-radius: 16px; background: #fff; }
.thumbs { display: flex; gap: 10px; flex-wrap: wrap; }
.thumbs img { width: 90px; height: 120px; object-fit: cover; border-radius: 10px; border: 1px solid var(--stroke-2); animation: rise .4s var(--ease) both; }

/* ---------- drawer / modal ---------- */
.veil { position: fixed; inset: 0; z-index: 40; background: rgba(2, 8, 20, .55); backdrop-filter: blur(6px); animation: fade .3s both; }
@keyframes fade { from { opacity: 0; } }
.drawer { position: fixed; z-index: 41; top: 12px; bottom: 12px; left: 12px; width: min(820px, calc(100vw - 24px)); border-radius: 26px; display: flex; flex-direction: column;
  background: color-mix(in srgb, var(--bg) 82%, transparent); border: 1px solid var(--stroke-2); backdrop-filter: blur(30px) saturate(160%);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .55); animation: slideIn .5s var(--ease) both; }
@keyframes slideIn { from { transform: translateX(-60px); opacity: 0; } }
.drawer.out { animation: slideOut .3s ease-in both; }
@keyframes slideOut { to { transform: translateX(-60px); opacity: 0; } }
.drawer header { display: flex; align-items: center; gap: 12px; padding: 20px 24px; border-bottom: 1px solid var(--stroke); }
.drawer header h2 { margin: 0; font-size: 20px; }
.drawer .body { flex: 1; overflow: auto; padding: 22px 24px; }
.drawer footer { display: flex; gap: 10px; padding: 16px 24px; border-top: 1px solid var(--stroke); }
.modal { position: fixed; z-index: 41; top: 50%; left: 50%; width: min(560px, calc(100vw - 30px)); transform: translate(-50%, -50%); border-radius: 24px; padding: 26px;
  background: color-mix(in srgb, var(--bg) 85%, transparent); border: 1px solid var(--stroke-2); backdrop-filter: blur(30px); box-shadow: 0 30px 80px rgba(0, 0, 0, .55); animation: pop .4s var(--ease) both; }
@keyframes pop { from { opacity: 0; transform: translate(-50%, -46%) scale(.94); } }
.modal h2 { margin: 0 0 8px; font-size: 20px; }
.modal .ico { width: 54px; height: 54px; border-radius: 17px; display: grid; place-items: center; margin-bottom: 14px; }
.modal .ico svg { width: 28px; height: 28px; }

/* ---------- picker (previous topic) ---------- */
.pick { max-height: 300px; overflow: auto; margin-top: 8px; display: flex; flex-direction: column; gap: 6px; }
.pick .it { padding: 10px 14px; border-radius: 12px; border: 1px solid var(--stroke); background: var(--glass); cursor: pointer; transition: all .2s; font-size: 13.5px; }
.pick .it:hover, .pick .it.on { border-color: var(--brand-2); background: rgba(79, 195, 247, .1); }
.pick .it b { color: var(--brand-2); }
.chosen { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 14px; background: rgba(226, 183, 100, .1); border: 1px solid rgba(226, 183, 100, .35); }

/* ---------- toast ---------- */
.toasts { position: fixed; z-index: 60; bottom: 22px; left: 22px; display: flex; flex-direction: column; gap: 10px; }
.toast { display: flex; gap: 12px; align-items: center; min-width: 280px; max-width: 460px; padding: 14px 18px; border-radius: 16px; background: color-mix(in srgb, var(--bg) 80%, transparent);
  border: 1px solid var(--stroke-2); backdrop-filter: blur(20px); box-shadow: var(--shadow); animation: toastIn .45s var(--ease) both; }
.toast.out { animation: toastOut .35s ease-in both; }
.toast .i { width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; flex: none; }
.toast .i svg { width: 17px; height: 17px; }
@keyframes toastIn { from { opacity: 0; transform: translateY(20px) scale(.96); } }
@keyframes toastOut { to { opacity: 0; transform: translateX(-30px); } }

/* ---------- command palette ---------- */
.palette { position: fixed; z-index: 50; top: 12vh; left: 50%; transform: translateX(-50%); width: min(680px, calc(100vw - 30px)); border-radius: 22px; overflow: hidden;
  background: color-mix(in srgb, var(--bg) 85%, transparent); border: 1px solid var(--stroke-2); backdrop-filter: blur(30px); box-shadow: 0 40px 90px rgba(0, 0, 0, .6); animation: pal .35s var(--ease) both; }
@keyframes pal { from { opacity: 0; transform: translate(-50%, -14px) scale(.97); } }
.palette input { width: 100%; border: 0; outline: none; background: none; padding: 20px 22px; font-size: 18px; border-bottom: 1px solid var(--stroke); }
.palette .res { max-height: 52vh; overflow: auto; padding: 8px; }
.palette .it { display: flex; gap: 12px; align-items: center; padding: 11px 14px; border-radius: 12px; cursor: pointer; }
.palette .it.on, .palette .it:hover { background: var(--glass-2); }
.palette .it svg { width: 19px; height: 19px; color: var(--brand-2); flex: none; }

/* ---------- charts ---------- */
.bars { display: flex; align-items: flex-end; gap: 10px; height: 220px; padding-top: 10px; }
.bars .b { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; height: 100%; justify-content: flex-end; }
.bars .col { width: 100%; max-width: 38px; border-radius: 10px 10px 4px 4px; background: linear-gradient(180deg, #4fc3f7, #2f6fe0 60%, rgba(124, 92, 255, .8));
  box-shadow: 0 10px 24px -8px rgba(79, 195, 247, .7); transform-origin: bottom; animation: grow 1s var(--ease) both; position: relative; }
.bars .col:hover::after { content: attr(data-v); position: absolute; top: -28px; left: 50%; transform: translateX(-50%); font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 8px; background: var(--glass-3); }
.bars small { color: var(--text-3); font-size: 11.5px; }
@keyframes grow { from { transform: scaleY(0); } }
.donut { display: flex; gap: 20px; align-items: center; }
.donut svg { width: 180px; height: 180px; flex: none; }
.donut svg circle { transition: stroke-dashoffset 1.4s var(--ease); }
.legend { display: flex; flex-direction: column; gap: 8px; font-size: 13.5px; }
.legend span { display: inline-block; width: 10px; height: 10px; border-radius: 4px; margin-inline-end: 8px; }
.hbar { margin-bottom: 12px; } .hbar .tr { height: 9px; border-radius: 9px; background: var(--glass-2); overflow: hidden; margin-top: 6px; }
.hbar .tr i { display: block; height: 100%; border-radius: 9px; background: linear-gradient(90deg, #7c5cff, #4fc3f7); animation: hgrow 1.2s var(--ease) both; transform-origin: right; }
@keyframes hgrow { from { transform: scaleX(0); } }

/* ---------- misc ---------- */
.empty { text-align: center; padding: 50px 20px; color: var(--text-3); }
.empty svg { width: 54px; height: 54px; opacity: .6; margin-bottom: 8px; }
.empty .btn svg { width: 18px; height: 18px; opacity: 1; margin: 0; }
.skel { border-radius: 14px; background: linear-gradient(90deg, var(--glass) 25%, var(--glass-3) 50%, var(--glass) 75%); background-size: 200% 100%; animation: sk 1.2s infinite; height: 70px; margin-bottom: 10px; }
@keyframes sk { to { background-position: -200% 0; } }
.menu { position: absolute; z-index: 55; top: calc(100% + 8px); left: 0; min-width: 250px; padding: 8px; border-radius: 16px; background: color-mix(in srgb, var(--bg) 88%, transparent);
  border: 1px solid var(--stroke-2); backdrop-filter: blur(24px); box-shadow: var(--shadow); animation: pop2 .25s var(--ease) both; }
@keyframes pop2 { from { opacity: 0; transform: translateY(-6px) scale(.97); } }
.menu a { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 11px; cursor: pointer; }
.menu a:hover { background: var(--glass-2); }
.menu a svg { width: 18px; height: 18px; color: var(--brand-2); }
.rel { position: relative; }
.timeline { position: relative; padding-right: 26px; }
.timeline::before { content: ""; position: absolute; right: 8px; top: 6px; bottom: 6px; width: 2px; background: linear-gradient(var(--brand-2), transparent); }
.tl { position: relative; margin-bottom: 12px; }
.tl::before { content: ""; position: absolute; right: -24px; top: 22px; width: 12px; height: 12px; border-radius: 50%; background: var(--brand-2); box-shadow: 0 0 12px var(--brand-2); }
.diff { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: center; margin-top: 8px; }
.diff .o { padding: 8px 12px; border-radius: 10px; background: rgba(255, 93, 108, .1); color: #ffb3ba; text-decoration: line-through; text-decoration-color: rgba(255,93,108,.6); }
.diff .n { padding: 8px 12px; border-radius: 10px; background: rgba(47, 208, 160, .1); color: #a8f0d8; }
[data-theme=light] .diff .o { color: #a3202e; } [data-theme=light] .diff .n { color: #0b6b52; }
.clock { text-align: left; line-height: 1.2; } .clock b { font-size: 18px; } .clock small { color: var(--text-3); }
.loader { position: fixed; top: 0; right: 0; left: 0; height: 3px; z-index: 70; background: linear-gradient(90deg, transparent, var(--brand-2), var(--brand-3), transparent); background-size: 200% 100%; animation: load 1s linear infinite; opacity: 0; transition: opacity .2s; }
.loader.on { opacity: 1; }
@keyframes load { to { background-position: -200% 0; } }
.welcome { font-size: 30px; font-weight: 800; margin: 0; }
.gradtext { background: linear-gradient(135deg, #fff 10%, #8fd3ff 50%, #b9a6ff); -webkit-background-clip: text; background-clip: text; color: transparent; }
[data-theme=light] .gradtext { background: linear-gradient(135deg, #0f3d66, #2f8fe0 60%, #6a4cff); -webkit-background-clip: text; background-clip: text; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }

/* ---------- sign-in ---------- */
body.locked .shell { filter: blur(8px); pointer-events: none; }
.login { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 20px; background: rgba(2, 8, 20, .35); animation: fade .5s both; }
.login.out { animation: loginOut .45s ease-in both; }
@keyframes loginOut { to { opacity: 0; transform: scale(1.04); } }
.login-card { width: min(430px, 100%); padding: 34px 32px 24px; border-radius: 30px; text-align: center; display: flex; flex-direction: column; gap: 10px;
  background: color-mix(in srgb, var(--bg) 70%, transparent); border: 1px solid var(--stroke-2); backdrop-filter: blur(30px) saturate(160%);
  box-shadow: 0 40px 100px rgba(0, 0, 0, .55), 0 0 0 1px rgba(79, 195, 247, .12); animation: pop3 .7s var(--ease) both; }
@keyframes pop3 { from { opacity: 0; transform: translateY(24px) scale(.96); } }
.login-card.shake { animation: shake .45s; }
@keyframes shake { 20%, 60% { transform: translateX(-10px); } 40%, 80% { transform: translateX(10px); } }
.login-logo { width: 96px; height: 96px; margin: 0 auto 6px; border-radius: 28px; display: grid; place-items: center;
  background: linear-gradient(140deg, #2f8fe0, #0f3d66 70%); box-shadow: 0 18px 50px -10px rgba(47, 143, 224, .9), inset 0 1px 0 rgba(255,255,255,.35); animation: float 6s ease-in-out infinite; }
.login-logo img { width: 72px; height: 72px; object-fit: contain; }
@keyframes float { 50% { transform: translateY(-6px); } }
.login-card h1 { margin: 6px 0 0; font-size: 26px; }
.login-card form { display: flex; flex-direction: column; gap: 14px; text-align: right; margin-top: 12px; }
.login-err { display: none; color: var(--bad); background: rgba(255, 93, 108, .1); border: 1px solid rgba(255, 93, 108, .3); border-radius: 12px; padding: 10px 12px; font-size: 13.5px; text-align: right; }
.login-foot { font-size: 12px; margin-top: 10px; }
.pw { position: relative; } .pw .eye { position: absolute; left: 8px; top: 50%; transform: translateY(-50%); border: 0; background: none; color: var(--text-3); cursor: pointer; padding: 6px; }

/* ---------- user chip ---------- */
#userBox { padding: 0 12px 8px; }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 16px; cursor: pointer; background: var(--glass); border: 1px solid var(--stroke); transition: all .25s; }
.user-chip:hover { border-color: var(--stroke-2); background: var(--glass-2); }
.user-chip .av { width: 38px; height: 38px; border-radius: 50%; flex: none; display: grid; place-items: center; font-weight: 800; color: #fff; background: linear-gradient(135deg, #34d8a8, #2f8fe0); }
.user-chip .who { min-width: 0; } .user-chip b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 14px; }
.user-chip small { color: var(--text-3); font-size: 12px; }
.collapsed .user-chip .who { display: none; }
body > .menu { position: fixed; }

/* ---------- permissions ---------- */
.preset.on { border-color: var(--brand-2); box-shadow: var(--glow); }
.perm { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--stroke); background: var(--glass); cursor: pointer; transition: all .2s; font-size: 14px; }
.perm input { display: none; }
.perm i { width: 22px; height: 22px; border-radius: 7px; border: 2px solid var(--stroke-2); display: grid; place-items: center; flex: none; transition: all .2s; }
.perm i svg { width: 14px; height: 14px; opacity: 0; }
.perm:has(input:checked) { border-color: rgba(47, 208, 160, .45); background: rgba(47, 208, 160, .08); }
.perm input:checked + i { background: var(--ok); border-color: transparent; color: #04261c; }
.perm input:checked + i svg { opacity: 1; }
.perm:has(input:disabled) { opacity: .7; cursor: default; }
/* ---------- phones and small screens ---------- */
#menuBtn, .side-veil { display: none; }
.login { overflow-y: auto; place-items: safe center; }
.login-card { margin: auto; }
@supports (height: 100dvh) { .shell, .main { height: 100dvh; } }
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .shell.collapsed { --side: 268px; }
  .side { position: fixed; z-index: 45; top: 0; bottom: 0; right: 0; margin: 0; width: min(290px, 84vw); border-radius: 0 0 0 24px;
    background: color-mix(in srgb, var(--bg) 88%, transparent); transform: translateX(105%); transition: transform .35s var(--ease); }
  .nav-open .side { transform: none; }
  .nav-open .side-veil { display: block; position: fixed; inset: 0; z-index: 44; background: rgba(2, 8, 20, .55); backdrop-filter: blur(4px); animation: fade .25s both; }
  .collapsed .brand > div, .collapsed .nav span, .collapsed .nav .sec, .collapsed .user-chip .who { display: revert; }
  #collapseBtn { display: none; }
  #menuBtn { display: inline-flex; flex: none; }
  .top { padding: 10px 12px 8px; gap: 10px; }
  .top .ttl { min-width: 0; }
  .top h1 { font-size: 19px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .top .sub { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .clock { display: none; }
  .searchbox { min-width: 0; padding: 9px; border-radius: 12px; flex: none; }
  .searchbox span:not(#searchIco), .searchbox kbd { display: none; }
  .view { padding: 4px 12px 30px; }
  .grid { gap: 12px; }
  .g2, .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .card { padding: 16px; }
  .hero { padding: 18px; }
  .hero .no { font-size: 40px; }
  .welcome { font-size: 22px; }
  .kpi .v { font-size: 26px; }
  .tbl { display: block; overflow-x: auto; }
  .tbl .txt { max-width: 70vw; }
  .drawer { inset: 0; width: 100%; border-radius: 0; }
  .drawer header, .drawer .body, .drawer footer { padding-left: 14px; padding-right: 14px; }
  .drawer footer { flex-wrap: wrap; }
  .toasts { left: 12px; right: 12px; bottom: 12px; }
  .toast { min-width: 0; max-width: none; }
  .palette { top: 10px; }
  .viewer { height: 60vh; }
}
@media (max-width: 640px) {
  body { font-size: 14.5px; }
  .g2, .g3, .g21, .g12 { grid-template-columns: 1fr; }
  .fgrid { gap: 10px; }
  .fgrid > .s2, .fgrid > .s3, .fgrid > .s4, .fgrid > .s5 { grid-column: span 6; }
  .fgrid > .s6, .fgrid > .s7, .fgrid > .s8 { grid-column: span 12; }
  .hero .row > div:has(> .no) { display: none; }
  .tbl, .tbl tbody { display: block; overflow: visible; }
  .tbl tr:has(> th) { display: none; }
  .tbl tr { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding: 12px 14px; margin-bottom: 8px; border-radius: 14px; background: var(--glass); border: 1px solid var(--stroke); }
  .tbl tr.click:hover { background: var(--glass-2); }
  .tbl td, .tbl tr.click:hover td { display: block; padding: 0; background: none; border: 0 !important; border-radius: 0 !important; }
  .tbl td:has(.txt), .tbl td:has(> .in) { flex-basis: 100%; }
  .tbl .txt { max-width: none; -webkit-line-clamp: 4; }
  .topic { grid-template-columns: 38px 1fr; gap: 10px; padding: 12px; }
  .topic .idx { width: 38px; height: 38px; border-radius: 11px; }
  .topic .val { grid-column: 2; text-align: right; }
  .donut { flex-direction: column; }
  .diff { grid-template-columns: 1fr; }
  .tabs button { padding: 8px 12px; }
  .btn { padding: 9px 14px; }
}
/* short screens (phone held sideways): smaller sign-in card */
@media (max-height: 520px) {
  .login { padding: 10px; }
  .login-card { padding: 16px 22px 12px; gap: 6px; }
  .login-logo { width: 56px; height: 56px; border-radius: 18px; margin-bottom: 0; }
  .login-logo img { width: 42px; height: 42px; }
  .login-card h1 { font-size: 20px; margin: 0; }
  .login-card form { gap: 10px; margin-top: 4px; }
  .login-foot { margin-top: 4px; }
}
body > .menu.sheet { position: fixed; top: auto; left: 10px; right: 10px; bottom: 10px; min-width: 0; padding: 10px; border-radius: 22px;
  box-shadow: 0 -10px 60px rgba(0, 0, 0, .55); animation: sheetUp .35s var(--ease) both; }
body > .menu.sheet a { padding: 14px; font-size: 15.5px; }
@keyframes sheetUp { from { opacity: 0; transform: translateY(40px); } }
