:root{
  --bg:#f5f6f8; --card:#fff; --ink:#101828; --muted:#667085; --line:#eaecf0;
  --rail:#0b0f14; --rail-2:#131a22; --brand:#c8a24a; --brand-2:#e2c778;
  --ok:#12805c; --ok-bg:#e6f5ee; --shadow:0 1px 2px rgba(16,24,40,.05),0 1px 3px rgba(16,24,40,.08);
  --shadow-l:0 4px 20px rgba(16,24,40,.08);
  --font:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;
}
*{box-sizing:border-box;}
html,body{margin:0;padding:0;}
body{font-family:var(--font);background:var(--bg);color:var(--ink);font-size:14px;line-height:1.45;-webkit-font-smoothing:antialiased;}
a{color:inherit;text-decoration:none;}
.tabnum,.hero,.m-v,.mk-v,.fs-v,.hbar-v,td.ar{font-variant-numeric:tabular-nums;}

/* ---------- Rail sidebar ---------- */
.app{display:flex;min-height:100vh;}
.railbar{width:68px;flex-shrink:0;background:linear-gradient(180deg,var(--rail),var(--rail-2));
  display:flex;flex-direction:column;align-items:center;padding:16px 0;position:sticky;top:0;height:100vh;gap:6px;}
.rb-logo{width:40px;height:40px;border-radius:11px;background:rgba(255,255,255,.06);display:flex;align-items:center;justify-content:center;color:var(--brand-2);margin-bottom:12px;}
.rb-nav{display:flex;flex-direction:column;gap:4px;flex:1;}
.rb-bottom{display:flex;flex-direction:column;gap:10px;align-items:center;}
.rb-i{width:42px;height:42px;border-radius:11px;display:flex;align-items:center;justify-content:center;color:#7d8ca0;transition:.15s;}
.rb-i svg{width:21px;height:21px;fill:none;stroke:currentColor;stroke-width:1.9;stroke-linecap:round;stroke-linejoin:round;}
.rb-i:hover{background:rgba(255,255,255,.06);color:#cfd8e3;}
.rb-i.active{background:rgba(200,162,74,.16);color:var(--brand-2);}
.rb-ava{width:34px;height:34px;border-radius:50%;background:linear-gradient(135deg,var(--brand),var(--brand-2));color:#2a2110;display:flex;align-items:center;justify-content:center;font-weight:700;font-size:12px;}

.main{flex:1;min-width:0;}
.wrap{max-width:1200px;margin:0 auto;padding:26px 30px 40px;}

/* ---------- Page head ---------- */
.pagehead{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;margin-bottom:22px;}
.pagehead h1{font-size:23px;font-weight:700;margin:0;letter-spacing:-.02em;}
.pagehead .sub{color:var(--muted);margin:3px 0 0;font-size:13px;}
.head-actions{display:flex;gap:10px;}
.chip{display:inline-flex;align-items:center;gap:8px;background:var(--card);border:1px solid var(--line);border-radius:9px;padding:8px 13px;font-size:13px;font-weight:600;color:#344054;box-shadow:var(--shadow);}
.chip .ic{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;}
.chip:hover{background:#fafbfc;}

/* ---------- Panels ---------- */
.panel{background:var(--card);border:1px solid var(--line);border-radius:16px;box-shadow:var(--shadow);padding:20px 22px;margin-bottom:18px;}
.panel.wide{padding:22px 24px;}
.p-top{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;margin-bottom:14px;}
.p-cap{font-size:15px;font-weight:700;}
.p-sub{color:var(--muted);font-size:12px;margin-top:2px;}
.p-link{color:var(--muted);font-size:12.5px;font-weight:600;}
.p-link:hover{color:var(--ink);}
.pill{background:var(--bg);border:1px solid var(--line);border-radius:999px;padding:4px 11px;font-size:12px;font-weight:600;color:#344054;white-space:nowrap;}

.row2{display:grid;grid-template-columns:1fr 1.15fr;gap:18px;}
.row-6-4{display:grid;grid-template-columns:1.5fr 1fr;gap:18px;}

.hero{font-size:40px;font-weight:750;letter-spacing:-.03em;margin:2px 0 16px;}

/* stacked bar */
.stack{display:flex;height:13px;border-radius:7px;overflow:hidden;background:var(--bg);gap:2px;}
.stack span{display:block;height:100%;}
.stack-leg{display:flex;flex-wrap:wrap;gap:14px;margin-top:12px;font-size:12px;color:var(--muted);}
.stack-leg span{display:inline-flex;align-items:center;gap:6px;}
.stack-leg i{width:9px;height:9px;border-radius:3px;}
.stack-leg b{color:var(--ink);font-weight:700;}

/* summary metrics */
.summary{display:grid;grid-template-columns:1fr 1fr;gap:18px 22px;padding-top:4px;}
.m{position:relative;}
.m-v{font-size:26px;font-weight:750;letter-spacing:-.02em;}
.m-l{color:var(--muted);font-size:12.5px;margin-top:2px;}
.m .u{display:block;width:34px;height:3px;border-radius:2px;margin-top:8px;}

/* funnel */
.funnel-stages{display:grid;grid-template-columns:repeat(5,1fr);gap:2px;margin-bottom:6px;}
.fstage{padding:2px 4px 10px;border-left:1px solid var(--line);}
.fstage:first-child{border-left:0;}
.fs-l{font-size:12px;color:var(--muted);font-weight:600;}
.fs-v{font-size:24px;font-weight:750;letter-spacing:-.02em;margin-top:2px;}
.fs-v.neg{color:#b42318;}
.fs-s{font-size:11.5px;color:var(--muted);margin-top:1px;}
.funnel-svg{display:block;width:100%;height:150px;}

/* hbars */
.hbars{display:flex;flex-direction:column;gap:9px;margin-top:2px;}
.hbar{display:grid;grid-template-columns:150px 1fr 54px;align-items:center;gap:12px;}
.hbar-l{font-size:12.5px;color:#344054;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.hbar-t{height:9px;border-radius:5px;background:var(--bg);overflow:hidden;}
.hbar-t i{display:block;height:100%;border-radius:5px;background:linear-gradient(90deg,#5fa982,#2f6fed);}
.hbar-v{font-size:12.5px;font-weight:700;text-align:right;color:#344054;}

.mini-kpis{display:grid;grid-template-columns:1fr 1fr;gap:14px;margin-top:6px;}
.mk-v{font-size:20px;font-weight:750;}
.mk-l{color:var(--muted);font-size:12px;}

/* ---------- Download center ---------- */
.genform{margin-bottom:18px;}
.grid3{display:grid;grid-template-columns:1.4fr 1fr 1.3fr;gap:16px;margin-bottom:6px;}
.field{margin-bottom:10px;}
.field>label{display:block;font-weight:600;font-size:12.5px;margin-bottom:6px;color:#475467;}
select,input[type=date],input[type=month],input[type=text],input[type=password]{
  width:100%;padding:10px 12px;border:1px solid var(--line);border-radius:9px;font-size:14px;color:var(--ink);background:#fff;font-family:inherit;}
select:focus,input:focus{outline:none;border-color:var(--brand);box-shadow:0 0 0 3px rgba(200,162,74,.16);}
.seg{display:inline-flex;background:var(--bg);border:1px solid var(--line);border-radius:10px;padding:3px;gap:2px;width:100%;}
.seg label{flex:1;position:relative;}
.seg input{position:absolute;opacity:0;}
.seg span{display:block;text-align:center;padding:7px 8px;border-radius:7px;cursor:pointer;font-weight:600;font-size:12.5px;color:var(--muted);}
.seg input:checked+span{background:#fff;color:var(--ink);box-shadow:var(--shadow);}
.hint{color:var(--muted);font-size:12px;margin-top:6px;}
.btn{display:inline-flex;align-items:center;gap:8px;cursor:pointer;padding:11px 20px;border-radius:10px;border:0;font-weight:700;font-size:14px;font-family:inherit;background:linear-gradient(180deg,var(--brand-2),var(--brand));color:#2a2110;box-shadow:var(--shadow);margin-top:6px;}
.btn:hover{filter:brightness(1.04);}

.tablewrap{overflow-x:auto;border:1px solid var(--line);border-radius:12px;margin-top:16px;}
table.data{width:100%;border-collapse:collapse;font-size:13px;}
table.data th{text-align:left;color:var(--muted);font-weight:600;font-size:11px;text-transform:uppercase;letter-spacing:.4px;padding:11px 14px;border-bottom:1px solid var(--line);background:#fafbfc;white-space:nowrap;}
table.data td{padding:11px 14px;border-bottom:1px solid var(--line);}
table.data tr:last-child td{border-bottom:none;}
table.data tr:hover td{background:#fbfcfe;}
td.ar,th.ar{text-align:right;}
.badge{display:inline-block;padding:3px 9px;border-radius:999px;font-size:11.5px;font-weight:600;}
.badge.ok{background:var(--ok-bg);color:var(--ok);}
.badge.n{background:#eef1f5;color:var(--muted);}
.tag{font-family:ui-monospace,Menlo,monospace;font-size:12px;color:#475467;background:var(--bg);padding:2px 7px;border-radius:6px;}

.foot{text-align:center;color:#98a2b3;font-size:12px;padding:12px 0 0;}

/* ---------- Login ---------- */
.login-wrap{min-height:100vh;display:flex;align-items:center;justify-content:center;background:radial-gradient(1100px 560px at 50% -10%,#16202b,#0b0f14);padding:24px;}
.login-card{width:100%;max-width:380px;background:var(--card);border-radius:18px;box-shadow:0 24px 70px rgba(0,0,0,.4);overflow:hidden;}
.login-head{text-align:center;padding:32px 30px 8px;}
.login-head .logo{width:54px;height:54px;color:var(--brand);}
.login-head h1{font-size:18px;margin:12px 0 2px;}
.login-head p{color:var(--muted);margin:0;font-size:13px;}
.login-body{padding:20px 30px 28px;}
.login-body .btn{width:100%;justify-content:center;margin-top:8px;}
.err{background:#fef3f2;color:#b42318;border:1px solid #fecdca;padding:10px 12px;border-radius:9px;font-size:13px;margin-bottom:14px;}
.login-foot{text-align:center;color:#98a2b3;font-size:12px;padding-bottom:22px;}

@media (max-width:900px){
  .row2,.row-6-4{grid-template-columns:1fr;}
  .grid3{grid-template-columns:1fr;}
  .funnel-stages .fs-v{font-size:19px;}
}
@media (max-width:560px){
  .railbar{width:56px;}
  .wrap{padding:18px 16px 32px;}
  .hero{font-size:32px;}
}
