:root{
  --ink:#201F1F; --ink-2:#3A3735; --muted:#6B6561; --muted-2:#8E877F;
  --bg:#F7F3ED; --surface:#FFFFFF; --surface-2:#FBF8F3;
  --sand:#E3CEB2; --cream:#F1E0C8; --stone:#D3D0CD;
  --accent:#A8937C; --accent-dark:#8B7662; --accent-soft:#EDE5DA;
  --line:#E6DFD5; --line-2:#F0EAE1;
  --green:#4F7A5B; --green-soft:#E4EDE4;
  --red:#B4553F; --red-soft:#F6E4DE;
  --amber:#C68B3C; --amber-soft:#F8EDDC;
  --blue:#5B6E86; --blue-soft:#E6EBF0;
  --r-s:8px; --r-m:12px; --r-l:16px; --r-xl:22px;
  --sh-s:0 1px 2px rgba(32,31,31,.05);
  --sh-m:0 2px 10px rgba(32,31,31,.06);
  --sh-l:0 12px 40px rgba(32,31,31,.14);
  --sb:250px;
}
*{box-sizing:border-box;margin:0;padding:0}
html,body{height:100%}
body{
  font-family:'Poppins',-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif;
  background:var(--bg); color:var(--ink); font-size:14px; line-height:1.55;
  -webkit-font-smoothing:antialiased;
}
button,input,select,textarea{font:inherit;color:inherit}
button{cursor:pointer;border:none;background:none}
a{color:inherit;text-decoration:none}
.card-b a:not(.btn):not(.nav), .note a, .help a, .dl a, .empty a{text-decoration:underline}
::-webkit-scrollbar{width:10px;height:10px}
::-webkit-scrollbar-thumb{background:#DCD4C8;border-radius:10px;border:3px solid transparent;background-clip:content-box}
::-webkit-scrollbar-thumb:hover{background:#C6BCAC;background-clip:content-box;border:3px solid transparent}
::-webkit-scrollbar-track{background:transparent}

/* ---------- SVG-Grundeinstellung ---------- */
svg{fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;
  width:1em;height:1em;vertical-align:-.14em}

/* ---------- Logo ---------- */
.mark{width:22px;height:25px;flex:none}
.mark path{fill:currentColor;stroke:none}
.wordmark{height:17px;width:auto;flex:none}
.wordmark path{fill:currentColor;stroke:none}

/* ---------- Login ---------- */
#login{position:fixed;inset:0;display:flex;align-items:center;justify-content:center;
  background:linear-gradient(160deg,#F1E6D6 0%,#F7F3ED 45%,#E9E2D6 100%);z-index:100;padding:24px}
.login-card{background:var(--surface);border-radius:var(--r-xl);box-shadow:var(--sh-l);
  padding:44px 40px 36px;width:100%;max-width:430px;text-align:center}
.login-logo{display:flex;align-items:center;justify-content:center;gap:11px;color:var(--ink);margin-bottom:6px}
.login-logo .mark{color:var(--accent);width:30px;height:34px}
.login-logo .wordmark{height:26px}
.login-sub{color:var(--muted);font-size:13px;letter-spacing:.14em;text-transform:uppercase;font-weight:500;margin-bottom:30px}
.login-hint{font-size:12.5px;color:var(--muted-2);margin:22px 0 12px;text-align:left}
.role-pick{display:flex;flex-direction:column;gap:9px;text-align:left}
.role-btn{display:flex;align-items:center;gap:13px;padding:13px 15px;border:1px solid var(--line);
  border-radius:var(--r-m);background:var(--surface-2);transition:.15s;text-align:left;width:100%}
.role-btn:hover{border-color:var(--accent);background:#fff;box-shadow:var(--sh-m);transform:translateY(-1px)}
.role-btn b{display:block;font-weight:600;font-size:13.5px}
.role-btn span{display:block;font-size:12px;color:var(--muted);line-height:1.4}
.role-av{width:38px;height:38px;border-radius:11px;display:grid;place-items:center;font-weight:600;
  font-size:13px;color:#fff;flex:none}

/* ---------- App shell ---------- */
#app{display:none;min-height:100vh}
#app.on{display:block}
.sidebar{position:fixed;left:0;top:0;bottom:0;width:var(--sb);background:var(--surface);
  border-right:1px solid var(--line);display:flex;flex-direction:column;z-index:40}
.sb-head{padding:20px 20px 16px;display:flex;align-items:center;gap:10px;color:var(--ink)}
.sb-head .mark{color:var(--accent);width:26px;height:30px}
.sb-head .wordmark{height:19px}
.sb-head small{display:block;font-size:10px;letter-spacing:.16em;text-transform:uppercase;color:var(--muted-2);margin-top:2px}
.sb-scroll{flex:1;overflow-y:auto;padding:6px 12px 12px}
.sb-group{font-size:10px;letter-spacing:.15em;text-transform:uppercase;color:var(--muted-2);
  font-weight:600;padding:14px 10px 7px}
.nav{display:flex;align-items:center;gap:11px;padding:9px 11px;border-radius:10px;
  color:var(--ink-2);font-size:13.5px;font-weight:400;transition:.13s;width:100%;text-align:left;position:relative}
.nav:hover{background:var(--surface-2)}
.nav.on{background:var(--accent-soft);color:var(--accent-dark);font-weight:600}
.nav svg{width:17px;height:17px;flex:none;stroke:currentColor;stroke-width:1.7;fill:none;
  stroke-linecap:round;stroke-linejoin:round;opacity:.85}
.nav .badge{margin-left:auto;background:var(--red);color:#fff;font-size:10.5px;font-weight:600;
  min-width:19px;height:19px;border-radius:10px;display:grid;place-items:center;padding:0 5px}
.nav .badge.n{background:var(--accent)}
.sb-foot{padding:14px;border-top:1px solid var(--line-2);background:var(--surface-2)}
.sb-foot h6{font-size:11px;font-weight:600;margin-bottom:7px;color:var(--ink-2)}
.sb-foot a{display:block;font-size:11.5px;color:var(--muted);text-decoration:none;padding:2px 0}
.sb-foot a:hover{color:var(--accent-dark);text-decoration:underline}

.main{margin-left:var(--sb);min-height:100vh;display:flex;flex-direction:column}
.topbar{position:sticky;top:0;z-index:30;background:rgba(247,243,237,.88);backdrop-filter:blur(14px);
  border-bottom:1px solid var(--line);padding:13px 26px;display:flex;align-items:center;gap:16px}
.tb-title h1{font-size:17px;font-weight:600;line-height:1.2}
.tb-title p{font-size:11.5px;color:var(--muted)}
.tb-search{flex:1;max-width:430px;position:relative}
.tb-search input{width:100%;background:var(--surface);border:1px solid var(--line);border-radius:10px;
  padding:9px 13px 9px 36px;font-size:13px;outline:none;transition:.15s}
.tb-search input:focus{border-color:var(--accent);box-shadow:0 0 0 3px rgba(168,147,124,.13)}
.tb-search svg{position:absolute;left:12px;top:50%;transform:translateY(-50%);width:15px;height:15px;
  stroke:var(--muted-2);stroke-width:1.9;fill:none}
.tb-right{margin-left:auto;display:flex;align-items:center;gap:10px}
.icon-btn{width:37px;height:37px;border-radius:10px;background:var(--surface);border:1px solid var(--line);
  display:grid;place-items:center;position:relative;transition:.15s}
.icon-btn:hover{border-color:var(--accent);background:#fff}
.icon-btn svg{width:17px;height:17px;stroke:var(--ink-2);stroke-width:1.7;fill:none;stroke-linecap:round}
.icon-btn .dot{position:absolute;top:7px;right:8px;width:7px;height:7px;border-radius:50%;
  background:var(--red);border:1.5px solid var(--surface)}
.avatar{width:37px;height:37px;border-radius:11px;display:grid;place-items:center;color:#fff;
  font-weight:600;font-size:12.5px;flex:none;cursor:pointer}
.content{padding:24px 26px 60px;flex:1;max-width:1440px;width:100%}

/* ---------- Buttons ---------- */
.btn{display:inline-flex;align-items:center;justify-content:center;gap:7px;padding:9px 16px;border-radius:10px;
  font-size:13px;font-weight:500;transition:.15s;border:1px solid transparent;white-space:nowrap}
.btn svg{width:15px;height:15px;stroke:currentColor;stroke-width:1.9;fill:none;stroke-linecap:round;stroke-linejoin:round}
.btn-p{background:var(--accent);color:#fff}
.btn-p:hover{background:var(--accent-dark)}
.btn-s{background:var(--surface);border-color:var(--line);color:var(--ink-2)}
.btn-s:hover{border-color:var(--accent);color:var(--accent-dark)}
.btn-g{background:transparent;color:var(--muted)}
.btn-g:hover{background:var(--surface-2);color:var(--ink)}
.btn-d{background:var(--red);color:#fff}
.btn-d:hover{filter:brightness(.92)}
.btn-sm{padding:6px 11px;font-size:12px;border-radius:8px}
.btn-sm svg{width:13px;height:13px}
.btn:disabled{opacity:.45;cursor:not-allowed}

/* ---------- Cards / layout ---------- */
.card{background:var(--surface);border:1px solid var(--line);border-radius:var(--r-l);box-shadow:var(--sh-s)}
.card-h{padding:16px 20px;border-bottom:1px solid var(--line-2);display:flex;align-items:center;gap:12px}
.card-h h3{font-size:14.5px;font-weight:600}
.card-h p{font-size:11.5px;color:var(--muted)}
.card-h .r{margin-left:auto;display:flex;align-items:center;gap:8px}
.card-b{padding:18px 20px}
.grid{display:grid;gap:16px}
.page-h{display:flex;align-items:flex-end;gap:16px;margin-bottom:20px;flex-wrap:wrap}
.page-h h2{font-size:22px;font-weight:600;letter-spacing:-.2px}
.page-h p{font-size:13px;color:var(--muted);margin-top:2px}
.page-h .r{margin-left:auto;display:flex;gap:9px;align-items:center;flex-wrap:wrap}

/* ---------- KPI ---------- */
.kpis{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:14px;margin-bottom:20px}
.kpi{background:var(--surface);border:1px solid var(--line);border-radius:var(--r-l);padding:16px 18px;box-shadow:var(--sh-s)}
.kpi.klick{display:block;text-decoration:none;color:inherit;cursor:pointer}
.kpi.klick:hover{border-color:var(--accent);box-shadow:var(--sh-m);transform:translateY(-1px)}
.kpi label{font-size:11.5px;color:var(--muted);display:block;margin-bottom:6px}
.kpi .v{font-size:27px;font-weight:600;letter-spacing:-.6px;line-height:1.1}
.kpi .d{font-size:11.5px;margin-top:5px;display:flex;align-items:center;gap:4px}
.kpi .d.up{color:var(--green)} .kpi .d.dn{color:var(--red)} .kpi .d.nt{color:var(--muted-2)}

/* ---------- Table ---------- */
.tbl{width:100%;border-collapse:collapse;font-size:13px}
.tbl th{text-align:left;font-size:10.5px;letter-spacing:.1em;text-transform:uppercase;color:var(--muted-2);
  font-weight:600;padding:11px 14px;border-bottom:1px solid var(--line);white-space:nowrap;background:var(--surface-2)}
.tbl td{padding:12px 14px;border-bottom:1px solid var(--line-2);vertical-align:middle}
.tbl tbody tr{transition:.12s;cursor:pointer}
.tbl tbody tr:hover{background:var(--surface-2)}
.tbl tbody tr.ro{opacity:.62}
.tbl tbody tr:last-child td{border-bottom:none}
.tbl .nm{font-weight:500}
.tbl .sub{font-size:11.5px;color:var(--muted)}
.wrap-x{overflow-x:auto}

/* ---------- Pills / chips ---------- */
.pill{display:inline-flex;align-items:center;gap:5px;padding:3px 9px;border-radius:20px;font-size:11px;
  font-weight:500;white-space:nowrap;border:1px solid transparent}
.pill svg{width:11px;height:11px;stroke:currentColor;stroke-width:2.2;fill:none;stroke-linecap:round}
.p-green{background:var(--green-soft);color:#3C5F46;border-color:#CFE0D2}
.p-red{background:var(--red-soft);color:#8F3E2C;border-color:#EFCFC5}
.p-amber{background:var(--amber-soft);color:#8E6224;border-color:#EFDCBD}
.p-blue{background:var(--blue-soft);color:#40536A;border-color:#D2DBE5}
.p-grey{background:#EFEBE4;color:var(--muted);border-color:#E2DCD3}
.p-accent{background:var(--accent-soft);color:var(--accent-dark);border-color:#DFD3C4}
.dot-s{width:7px;height:7px;border-radius:50%;flex:none}

.chip{display:inline-flex;align-items:center;gap:6px;padding:4px 9px 4px 5px;border-radius:20px;
  background:var(--surface-2);border:1px solid var(--line);font-size:11.5px;font-weight:500}
.chip .av{width:19px;height:19px;border-radius:50%;display:grid;place-items:center;color:#fff;font-size:9px;font-weight:600}
.chip button{width:15px;height:15px;border-radius:50%;display:grid;place-items:center;color:var(--muted-2);font-size:13px;line-height:1}
.chip button:hover{background:var(--red-soft);color:var(--red)}
.avs{display:flex}
.avs .av{width:24px;height:24px;border-radius:50%;display:grid;place-items:center;color:#fff;font-size:9.5px;
  font-weight:600;border:2px solid var(--surface);margin-left:-7px}
.avs .av:first-child{margin-left:0}

/* ---------- Forms ---------- */
.field{margin-bottom:15px}
.field label{display:block;font-size:12px;font-weight:500;color:var(--ink-2);margin-bottom:6px}
.field label .req{color:var(--red)}
.field .help{font-size:11.5px;color:var(--muted-2);margin-top:5px;line-height:1.45}
.inp,select.inp,textarea.inp{width:100%;background:var(--surface);border:1px solid var(--line);border-radius:9px;
  padding:9px 12px;font-size:13px;outline:none;transition:.15s}
.inp:focus{border-color:var(--accent);box-shadow:0 0 0 3px rgba(168,147,124,.13)}
textarea.inp{resize:vertical;min-height:82px;line-height:1.6}
select.inp{appearance:none;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236B6561' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat:no-repeat;background-position:right 11px center;padding-right:32px}
.row2{display:grid;grid-template-columns:1fr 1fr;gap:14px}
.row3{display:grid;grid-template-columns:1fr 1fr 1fr;gap:14px}
.seg{display:inline-flex;background:var(--surface-2);border:1px solid var(--line);border-radius:10px;padding:3px;gap:2px}
.seg button{padding:6px 14px;border-radius:7px;font-size:12.5px;font-weight:500;color:var(--muted);transition:.13s}
.seg button.on{background:var(--surface);color:var(--ink);box-shadow:var(--sh-s);font-weight:600}
.switch{display:inline-flex;align-items:center;gap:9px;cursor:pointer;font-size:12.5px}
.switch input{display:none}
.switch .tr{width:38px;height:21px;border-radius:12px;background:#DDD6CB;position:relative;transition:.18s;flex:none}
.switch .tr:after{content:'';position:absolute;top:2.5px;left:2.5px;width:16px;height:16px;border-radius:50%;
  background:#fff;transition:.18s;box-shadow:0 1px 3px rgba(0,0,0,.18)}
.switch input:checked + .tr{background:var(--accent)}
.switch input:checked + .tr:after{transform:translateX(17px)}
.check{display:flex;align-items:flex-start;gap:9px;cursor:pointer;font-size:13px;padding:2px 0}
.check input{margin-top:3px;accent-color:var(--accent);width:15px;height:15px;flex:none}

/* ---------- Kanban ---------- */
.kb-wrap{overflow-x:auto;padding-bottom:14px;margin:0 -26px;padding-left:26px;padding-right:26px}
.kb{display:flex;gap:14px;min-height:420px}
.kb-col{width:288px;flex:none;background:#F1ECE4;border:1px solid var(--line);border-radius:var(--r-l);
  display:flex;flex-direction:column;max-height:calc(100vh - 260px)}
.kb-col.over{background:var(--accent-soft);border-color:var(--accent);border-style:dashed}
.kb-ch{padding:12px 14px;display:flex;align-items:center;gap:8px;border-bottom:1px solid var(--line)}
.kb-ch .bar{width:3px;height:16px;border-radius:2px;flex:none}
.kb-ch h4{font-size:12.5px;font-weight:600;flex:1;line-height:1.25}
.kb-ch .cnt{background:var(--surface);border:1px solid var(--line);border-radius:20px;padding:1px 8px;
  font-size:11px;font-weight:600;color:var(--muted)}
.kb-body{padding:10px;overflow-y:auto;flex:1;display:flex;flex-direction:column;gap:9px}
.kb-card{background:var(--surface);border:1px solid var(--line);border-left:3px solid var(--stone);
  border-radius:11px;padding:11px 12px;cursor:grab;transition:.14s;box-shadow:var(--sh-s)}
.kb-card:hover{box-shadow:var(--sh-m);transform:translateY(-1px);border-color:#D8CFC1}
.kb-card.drag{opacity:.4}
.kb-card.ro{cursor:default;background:var(--surface-2);opacity:.72}
.kb-card.ro:hover{transform:none}
.kb-card .t{font-size:13px;font-weight:600;margin-bottom:3px;display:flex;align-items:center;gap:6px}
.kb-card .t svg{width:12px;height:12px;stroke:var(--muted-2);stroke-width:2;fill:none;flex:none}
.kb-card .m{font-size:11.5px;color:var(--muted);margin-bottom:9px}
.kb-card .f{display:flex;align-items:center;gap:7px;flex-wrap:wrap}
.kb-card .age{font-size:10.5px;color:var(--muted-2);margin-left:auto;display:flex;align-items:center;gap:4px;white-space:nowrap}
.kb-card .age svg{width:11px;height:11px;stroke-width:2.1}
.note svg{width:13px;height:13px;stroke-width:2;vertical-align:-.16em;margin-right:2px}
.kb-empty{padding:22px 10px;text-align:center;font-size:11.5px;color:var(--muted-2);border:1px dashed var(--line);
  border-radius:10px;background:rgba(255,255,255,.4)}

/* ---------- Timeline ---------- */
.tl{position:relative;padding-left:26px}
.tl:before{content:'';position:absolute;left:8px;top:6px;bottom:6px;width:1.5px;background:var(--line)}
.tl-i{position:relative;padding-bottom:18px}
.tl-i:last-child{padding-bottom:0}
.tl-i .mk{position:absolute;left:-25px;top:2px;width:17px;height:17px;border-radius:50%;background:var(--surface);
  border:1.5px solid var(--line);display:grid;place-items:center}
.tl-i .mk svg{width:9px;height:9px;stroke-width:2.6;fill:none}
.tl-i .hd{display:flex;align-items:baseline;gap:8px;flex-wrap:wrap}
.tl-i .hd b{font-size:12.5px;font-weight:600}
.tl-i .hd time{font-size:11px;color:var(--muted-2)}
.tl-i .bd{font-size:12.5px;color:var(--muted);line-height:1.55;margin-top:2px}
.tl-i .bx{margin-top:7px;background:var(--surface-2);border:1px solid var(--line-2);border-radius:10px;
  padding:10px 12px;font-size:12.5px;line-height:1.6}
.tl-i .bx .sj{font-weight:600;margin-bottom:3px;font-size:12.5px;color:var(--ink)}

/* ---------- Modal ---------- */
.ov{position:fixed;inset:0;background:rgba(32,31,31,.42);backdrop-filter:blur(3px);z-index:80;
  display:flex;align-items:center;justify-content:center;padding:24px;opacity:0;pointer-events:none;transition:.18s}
.ov.on{opacity:1;pointer-events:auto}
.mo{background:var(--surface);border-radius:var(--r-xl);box-shadow:var(--sh-l);width:100%;max-width:560px;
  max-height:90vh;display:flex;flex-direction:column;transform:translateY(14px) scale(.985);transition:.2s}
.ov.on .mo{transform:none}
.mo.w{max-width:760px} .mo.xw{max-width:960px} .mo.n{max-width:430px}
.mo-h{padding:20px 24px 15px;border-bottom:1px solid var(--line-2);display:flex;align-items:flex-start;gap:12px}
.mo-h h3{font-size:16px;font-weight:600}
.mo-h p{font-size:12px;color:var(--muted);margin-top:2px}
.mo-h .x{margin-left:auto;width:30px;height:30px;border-radius:8px;display:grid;place-items:center;color:var(--muted)}
.mo-h .x:hover{background:var(--surface-2);color:var(--ink)}
.mo-b{padding:20px 24px;overflow-y:auto;flex:1}
.mo-f{padding:15px 24px;border-top:1px solid var(--line-2);display:flex;gap:9px;justify-content:flex-end;
  background:var(--surface-2);border-radius:0 0 var(--r-xl) var(--r-xl);flex-wrap:wrap}
.mo-f .l{margin-right:auto;font-size:11.5px;color:var(--muted);display:flex;align-items:center;max-width:52%}
.cf-ic{width:46px;height:46px;border-radius:14px;display:grid;place-items:center;flex:none}
.cf-ic svg{width:22px;height:22px;stroke-width:1.9;fill:none;stroke-linecap:round;stroke-linejoin:round}

/* ---------- Detail panel ---------- */
.det{display:grid;grid-template-columns:1.6fr 1fr;gap:18px}
.dl{display:grid;grid-template-columns:auto 1fr;gap:9px 16px;font-size:12.5px}
.dl dt{color:var(--muted);white-space:nowrap}
.dl dd{font-weight:500}
.stage-bar{display:flex;gap:4px;margin:2px 0 4px}
.stage-bar .s{flex:1;height:5px;border-radius:3px;background:var(--line)}
.stage-bar .s.d{background:var(--accent)}
.stage-bar .s.c{background:var(--green)}

/* ---------- Funnel editor ---------- */
.q-item{background:var(--surface);border:1px solid var(--line);border-radius:var(--r-m);margin-bottom:10px;
  transition:.14s;box-shadow:var(--sh-s)}
.q-item:hover{border-color:#D8CFC1}
.q-h{padding:12px 14px;display:flex;align-items:center;gap:11px}
.q-h .gr{color:var(--muted-2);cursor:grab;display:grid;place-items:center}
.q-h .gr svg{width:14px;height:14px;stroke:currentColor;stroke-width:2;fill:none}
.q-h .no{width:24px;height:24px;border-radius:7px;background:var(--accent-soft);color:var(--accent-dark);
  display:grid;place-items:center;font-size:11px;font-weight:600;flex:none}
.q-h .tt{flex:1;min-width:0}
.q-h .tt b{font-size:13px;font-weight:600;display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.q-h .tt span{font-size:11px;color:var(--muted)}
.q-h .ac{display:flex;gap:4px}
.q-h .ac button{width:28px;height:28px;border-radius:8px;display:grid;place-items:center;color:var(--muted)}
.q-h .ac button:hover{background:var(--surface-2);color:var(--ink)}
.q-h .ac button.del:hover{background:var(--red-soft);color:var(--red)}
.q-h .ac svg{width:14px;height:14px;stroke:currentColor;stroke-width:1.9;fill:none;stroke-linecap:round}
.q-b{padding:0 14px 14px;border-top:1px solid var(--line-2);margin-top:2px;padding-top:14px}
.opt-row{display:flex;align-items:center;gap:8px;margin-bottom:7px}
.opt-row .inp{flex:1}
.opt-row button{width:30px;height:30px;border-radius:8px;display:grid;place-items:center;color:var(--muted-2);flex:none}
.opt-row button:hover{background:var(--red-soft);color:var(--red)}

/* ---------- Public funnel preview ---------- */
.pub{background:linear-gradient(165deg,#F1E6D6,#F7F3ED 55%,#EAE3D7);border-radius:var(--r-l);
  padding:34px 20px;display:flex;align-items:center;justify-content:center;min-height:480px;border:1px solid var(--line)}
.pub-card{background:#fff;border-radius:var(--r-xl);box-shadow:var(--sh-l);padding:32px 30px;width:100%;max-width:470px}
.pub-logo{display:flex;align-items:center;justify-content:center;gap:9px;color:var(--ink);margin-bottom:20px}
.pub-logo .mark{color:var(--accent);width:24px;height:27px}
.pub-logo .wordmark{height:20px}
.pub-prog{height:4px;background:var(--line);border-radius:3px;margin-bottom:22px;overflow:hidden}
.pub-prog i{display:block;height:100%;background:var(--accent);border-radius:3px;transition:.3s}
.pub h3{font-size:19px;font-weight:600;text-align:center;margin-bottom:6px;letter-spacing:-.2px}
.pub .sub{font-size:13px;color:var(--muted);text-align:center;margin-bottom:22px;line-height:1.55}
.opt-btn{display:flex;align-items:center;gap:12px;width:100%;padding:13px 15px;border:1px solid var(--line);
  border-radius:var(--r-m);background:var(--surface-2);margin-bottom:9px;text-align:left;font-size:13.5px;transition:.14s}
.opt-btn:hover{border-color:var(--accent);background:#fff;box-shadow:var(--sh-m)}
.opt-btn.sel{border-color:var(--accent);background:var(--accent-soft);font-weight:500}
.opt-btn .ic{width:32px;height:32px;border-radius:10px;background:var(--accent-soft);display:grid;place-items:center;flex:none}
.opt-btn.sel .ic{background:#fff}
.opt-btn .ic svg{width:15px;height:15px;stroke:var(--accent-dark);stroke-width:1.9;fill:none;stroke-linecap:round}
.scale{display:flex;gap:5px;justify-content:center;margin:8px 0 4px;flex-wrap:wrap}
.scale button{width:38px;height:38px;border-radius:10px;border:1px solid var(--line);background:var(--surface-2);
  font-size:13px;font-weight:500;transition:.13s}
.scale button:hover{border-color:var(--accent)}
.scale button.sel{background:var(--accent);color:#fff;border-color:var(--accent);font-weight:600}
.scale-lbl{display:flex;justify-content:space-between;font-size:10.5px;color:var(--muted-2);margin-bottom:16px;padding:0 2px}

/* ---------- Charts ---------- */
.bar-row{display:flex;align-items:center;gap:12px;margin-bottom:11px;font-size:12.5px}
.bar-row .lb{width:190px;flex:none;color:var(--ink-2)}
.bar-row .tk{flex:1;height:9px;background:var(--line-2);border-radius:5px;overflow:hidden}
.bar-row .tk i{display:block;height:100%;border-radius:5px;background:var(--accent);transition:width .5s}
.bar-row .vl{width:64px;text-align:right;font-weight:600;font-size:12.5px;flex:none}
.bar-row .vl small{font-weight:400;color:var(--muted-2);font-size:11px}
.fnl-row{display:flex;align-items:center;gap:12px;margin-bottom:9px}
.fnl-row .lb{width:210px;flex:none;font-size:12.5px}
.fnl-row .tk{flex:1;height:26px;background:var(--line-2);border-radius:7px;overflow:hidden;position:relative}
.fnl-row .tk i{display:block;height:100%;background:linear-gradient(90deg,var(--accent),#BCA891);border-radius:7px}
.fnl-row .vl{width:96px;text-align:right;font-size:12.5px;font-weight:600}
.fnl-row .vl small{color:var(--muted-2);font-weight:400;font-size:11px;display:block}
.spark{width:100%;height:170px}
.spark path.ln{fill:none;stroke:var(--accent);stroke-width:2;stroke-linejoin:round;stroke-linecap:round}
.spark path.ar{fill:rgba(168,147,124,.14);stroke:none}
.spark line{stroke:var(--line-2);stroke-width:1}
.spark text{font-size:9.5px;fill:var(--muted-2);font-family:'Poppins',sans-serif}
.spark circle{fill:var(--accent)}
.legend{display:flex;gap:16px;flex-wrap:wrap;font-size:11.5px;color:var(--muted);margin-top:12px}
.legend i{width:9px;height:9px;border-radius:3px;display:inline-block;margin-right:5px;vertical-align:middle}

/* ---------- Notifications ---------- */
.pop{position:absolute;top:46px;right:0;width:340px;background:var(--surface);border:1px solid var(--line);
  border-radius:var(--r-l);box-shadow:var(--sh-l);z-index:60;overflow:hidden;display:none}
.pop.on{display:block}
.pop-h{padding:13px 16px;border-bottom:1px solid var(--line-2);display:flex;align-items:center}
.pop-h b{font-size:13px}
.pop-h button{margin-left:auto;font-size:11.5px;color:var(--accent-dark)}
.pop-l{max-height:330px;overflow-y:auto}
.pop-i{padding:11px 16px;border-bottom:1px solid var(--line-2);display:flex;gap:10px;cursor:pointer}
.pop-i:hover{background:var(--surface-2)}
.pop-i.un{background:#FCF9F4}
.pop-i .ic{width:28px;height:28px;border-radius:9px;display:grid;place-items:center;flex:none}
.pop-i .ic svg{width:13px;height:13px;stroke-width:2;fill:none}
.pop-i .tx b{font-size:12.5px;font-weight:600;display:block}
.pop-i .tx p{font-size:11.5px;color:var(--muted);line-height:1.45}
.pop-i .tx time{font-size:10.5px;color:var(--muted-2)}
.menu{position:absolute;top:46px;right:0;width:216px;background:var(--surface);border:1px solid var(--line);
  border-radius:var(--r-m);box-shadow:var(--sh-l);z-index:60;padding:6px;display:none}
.menu.on{display:block}
.menu .mh{padding:9px 11px;border-bottom:1px solid var(--line-2);margin-bottom:5px}
.menu .mh b{font-size:12.5px;display:block}
.menu .mh span{font-size:11px;color:var(--muted)}
.menu button{display:flex;align-items:center;gap:9px;width:100%;padding:8px 11px;border-radius:8px;
  font-size:12.5px;text-align:left;color:var(--ink-2)}
.menu button:hover{background:var(--surface-2)}
.menu button svg{width:14px;height:14px;stroke:currentColor;stroke-width:1.8;fill:none;stroke-linecap:round}

/* ---------- Toast ---------- */
#toasts{position:fixed;bottom:22px;right:22px;z-index:200;display:flex;flex-direction:column;gap:9px;align-items:flex-end}
.toast{background:var(--ink);color:#fff;padding:12px 17px;border-radius:11px;font-size:12.5px;
  box-shadow:var(--sh-l);display:flex;align-items:center;gap:10px;max-width:400px;animation:tin .22s ease-out}
.toast svg{width:16px;height:16px;stroke:currentColor;stroke-width:2.2;fill:none;flex:none;stroke-linecap:round}
.toast.ok svg{stroke:#8FCF9F} .toast.warn svg{stroke:#E8B36B}
@keyframes tin{from{opacity:0;transform:translateY(10px)}to{opacity:1;transform:none}}

/* ---------- Misc ---------- */
.empty{padding:46px 20px;text-align:center;color:var(--muted)}
.empty svg{width:38px;height:38px;stroke:var(--stone);stroke-width:1.4;fill:none;margin-bottom:12px}
.empty b{display:block;font-size:14px;color:var(--ink-2);margin-bottom:4px}
.empty p{font-size:12.5px}
.note{background:var(--surface-2);border:1px solid var(--line);border-left:3px solid var(--accent);
  border-radius:10px;padding:12px 14px;font-size:12.5px;color:var(--muted);line-height:1.6}
.note b{color:var(--ink-2)}
.note.w{border-left-color:var(--amber);background:#FDFAF4}
.note.r{border-left-color:var(--red);background:#FDF7F5}
.note.g{border-left-color:var(--green);background:#F5F9F5}
.tabs{display:flex;gap:2px;border-bottom:1px solid var(--line);margin-bottom:18px;overflow-x:auto}
.tabs button{padding:10px 15px;font-size:13px;color:var(--muted);border-bottom:2px solid transparent;
  margin-bottom:-1px;white-space:nowrap;transition:.14s}
.tabs button:hover{color:var(--ink)}
.tabs button.on{color:var(--accent-dark);border-bottom-color:var(--accent);font-weight:600}
.lock{display:inline-flex;align-items:center;gap:4px;font-size:10.5px;color:var(--muted-2)}
.lock svg{width:11px;height:11px;stroke:currentColor;stroke-width:2;fill:none}
.hidden{display:none !important}
.mono{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:11.5px}
code.k{background:var(--surface-2);border:1px solid var(--line);border-radius:5px;padding:1px 5px;
  font-family:ui-monospace,Menlo,monospace;font-size:11.5px;color:var(--accent-dark)}

@media(max-width:1080px){
  .det{grid-template-columns:1fr}
  .sidebar{transform:translateX(-100%);transition:.22s;box-shadow:var(--sh-l)}
  .sidebar.open{transform:none}
  .main{margin-left:0}
  .content{padding:18px 16px 60px}
  .kb-wrap{margin:0 -16px;padding-left:16px;padding-right:16px}
  .burger{display:grid !important}
}
@media(max-width:680px){
  .row2,.row3{grid-template-columns:1fr}
  .tb-search{display:none}
  .bar-row .lb,.fnl-row .lb{width:120px;font-size:11.5px}
}
.burger{display:none;width:37px;height:37px;border-radius:10px;place-items:center;border:1px solid var(--line);background:var(--surface)}
.burger svg{width:18px;height:18px;stroke:var(--ink);stroke-width:1.9;fill:none;stroke-linecap:round}
