:root{
  --ink:#0F1B2D; --ink-soft:#16263C;
  --teal:#1F6F63; --amber:#B9791F; --amber-bright:#E8A23D; --coral:#C4453A;
}
body[data-theme="dark"]{
  --bg:#0B1420; --panel:#131F30; --panel-2:#0F1B2D; --line:#233247; --text:#E7EAEE; --muted:#8B96A3;
  --input-bg:#0B1420; --amber-bg:#2A2010; --teal-bg:#0F211D; --coral-bg:#2A1512;
}
*{ box-sizing:border-box; margin:0; padding:0; }
body{ font-family:'Inter', sans-serif; background:var(--bg); color:var(--text); font-size:14px; }
.mono{ font-family:'IBM Plex Mono', monospace; }
a{ text-decoration:none; color:inherit; }
button{ font-family:inherit; }

.login-screen{ min-height:100vh; display:flex; align-items:center; justify-content:center;
  background:
    radial-gradient(circle at 80% 15%, rgba(232,162,61,0.16), transparent 55%),
    radial-gradient(circle at 15% 85%, rgba(31,111,99,0.18), transparent 55%),
    var(--ink);
}
.login-card{ width:400px; max-width:90vw; background:var(--panel); border:1px solid var(--line); border-radius:16px; padding:38px 36px 30px; box-shadow:0 24px 60px -20px rgba(0,0,0,0.5); }
.login-logo{ display:flex; align-items:center; gap:10px; font-family:'Fraunces', serif; font-weight:600; font-size:22px; margin-bottom:4px; }
.login-logo .mark{ width:22px; height:22px; border-radius:50%; background:conic-gradient(from 180deg, var(--amber-bright), var(--teal), var(--amber-bright)); }
.login-sub{ font-size:12px; color:var(--muted); margin-bottom:28px; }
.login-error{ font-size:12px; color:var(--coral); margin:-6px 0 12px; display:none; }
.login-error.show{ display:block; }
.login-demo-note{ margin-top:18px; padding-top:16px; border-top:1px solid var(--line); font-size:11px; color:var(--muted); line-height:1.6; }
.login-demo-note code{ background:var(--input-bg); padding:1px 5px; border-radius:4px; font-family:'IBM Plex Mono',monospace; font-size:10.5px; }

.form-row{ margin-bottom:14px; }
.form-row label{ display:block; font-size:12px; font-weight:600; margin-bottom:6px; color:var(--muted); }
.form-row input{ width:100%; padding:10px 12px; border-radius:8px; border:1px solid var(--line); background:var(--input-bg); color:var(--text); font-size:13.5px; }
.form-row input:focus{ outline:none; border-color:var(--teal); }

.btn{ padding:10px 18px; border-radius:8px; font-size:13px; font-weight:700; cursor:pointer; border:1px solid transparent; display:inline-flex; align-items:center; gap:6px; }
.btn:hover{ filter:brightness(1.08); }
.btn:disabled{ opacity:.5; cursor:not-allowed; }
.btn-primary{ background:var(--amber-bright); color:#1B2430; }
.btn-ghost{ background:transparent; border-color:var(--line); color:var(--text); }
.btn-sm{ padding:6px 12px; font-size:12px; }
.btn-block{ width:100%; justify-content:center; }

.app{ display:flex; min-height:100vh; }
.sidebar{ width:240px; flex-shrink:0; background:var(--panel-2); border-right:1px solid var(--line); padding:20px 0; height:100vh; position:sticky; top:0; overflow-y:auto; }
.sidebar-logo{ display:flex; align-items:center; gap:9px; font-family:'Fraunces', serif; font-weight:600; font-size:18px; padding:0 22px 22px; }
.sidebar-logo .mark{ width:18px; height:18px; border-radius:50%; background:conic-gradient(from 180deg, var(--amber-bright), var(--teal), var(--amber-bright)); }
.sb-item{ display:flex; align-items:center; gap:11px; padding:11px 22px; font-size:13.5px; font-weight:500; color:var(--muted); cursor:pointer; border-left:3px solid transparent; }
.sb-item:hover{ color:var(--text); background:rgba(255,255,255,0.02); }
.sb-item.active{ color:var(--text); background:rgba(232,162,61,0.08); border-left-color:var(--amber-bright); font-weight:600; }
.sb-item .ic{ width:18px; text-align:center; }

.main{ flex:1; min-width:0; }
.topbar{ height:64px; border-bottom:1px solid var(--line); display:flex; align-items:center; justify-content:space-between; padding:0 28px; position:sticky; top:0; background:var(--bg); z-index:10; }
.tier-chip{ display:flex; align-items:center; gap:8px; font-size:12.5px; font-weight:600; padding:6px 12px; border:1px solid var(--line); border-radius:20px; background:var(--panel); }
.tier-chip .dot{ width:8px; height:8px; border-radius:50%; background:var(--amber-bright); }
.profile-chip{ display:flex; align-items:center; gap:9px; }
.profile-chip .avatar{ width:32px; height:32px; border-radius:50%; background:var(--teal); display:flex; align-items:center; justify-content:center; font-size:12px; font-weight:700; }

.content{ padding:28px 32px 60px; max-width:1100px; }
.page-title{ font-family:'Fraunces', serif; font-size:26px; font-weight:600; margin-bottom:4px; }
.page-sub{ font-size:13px; color:var(--muted); margin-bottom:24px; }

.kpi-grid{ display:grid; grid-template-columns:repeat(4,1fr); gap:16px; margin-bottom:24px; }
@media (max-width:900px){ .kpi-grid{ grid-template-columns:repeat(2,1fr); } .app{ flex-direction:column; } .sidebar{ width:100%; height:auto; position:static; } }
.kpi-card{ background:var(--panel); border:1px solid var(--line); border-radius:12px; padding:18px 20px; }
.kpi-card .label{ font-size:11.5px; color:var(--muted); text-transform:uppercase; letter-spacing:.03em; margin-bottom:8px; }
.kpi-card .value{ font-family:'IBM Plex Mono', monospace; font-size:22px; font-weight:700; }

.panel{ background:var(--panel); border:1px solid var(--line); border-radius:14px; padding:22px 24px; margin-bottom:20px; }
.panel-head{ display:flex; align-items:center; justify-content:space-between; margin-bottom:16px; gap:12px; flex-wrap:wrap; }
.panel-head h3{ font-size:15px; font-weight:700; }
.panel-head span{ font-size:12px; color:var(--muted); }

table{ width:100%; border-collapse:collapse; font-size:13px; }
th{ text-align:left; font-size:11px; color:var(--muted); text-transform:uppercase; letter-spacing:.03em; padding:9px 10px; border-bottom:1px solid var(--line); }
td{ padding:12px 10px; border-bottom:1px solid var(--line); vertical-align:top; }
tr:last-child td{ border-bottom:none; }

.tag-pill{ display:inline-block; padding:3px 9px; border-radius:20px; font-size:11px; font-weight:700; }
.tag-pill.low{ background:var(--teal-bg); color:var(--teal); }
.tag-pill.mid{ background:var(--amber-bg); color:var(--amber-bright); }
.tag-pill.high{ background:var(--coral-bg); color:var(--coral); }

.join-url{ font-size:12px; word-break:break-all; color:var(--muted); max-width:420px; }

.toast{ position:fixed; bottom:24px; right:24px; background:var(--ink); color:#fff; padding:13px 20px; border-radius:10px; font-size:13px; box-shadow:0 12px 28px rgba(0,0,0,0.3); transform:translateY(20px); opacity:0; pointer-events:none; transition:all .25s; z-index:200; max-width:320px; }
.toast.show{ transform:translateY(0); opacity:1; }
