/* ============================================================
   Shared "live demo" dashboard shell — used by demo-*.html pages
   Self-contained dark theme (separate from assets/styles.css,
   which stays the single stylesheet for the marketing site).
   Reuses the site's existing self-hosted fonts.
   ============================================================ */

@font-face{
  font-family:'Space Grotesk';font-style:normal;font-weight:400 700;font-display:swap;
  src:url('fonts/space-grotesk-latin.woff2') format('woff2');
  unicode-range:U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face{
  font-family:'Space Grotesk';font-style:normal;font-weight:400 700;font-display:swap;
  src:url('fonts/space-grotesk-latin-ext.woff2') format('woff2');
  unicode-range:U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face{
  font-family:'Plus Jakarta Sans';font-style:normal;font-weight:400 700;font-display:swap;
  src:url('fonts/plus-jakarta-sans-latin.woff2') format('woff2');
  unicode-range:U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face{
  font-family:'Plus Jakarta Sans';font-style:normal;font-weight:400 700;font-display:swap;
  src:url('fonts/plus-jakarta-sans-latin-ext.woff2') format('woff2');
  unicode-range:U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root{
  --bg:       #0b1220;
  --bg-soft:  #0f1b30;
  --panel:    #121d33;
  --panel-2:  #0c1729;
  --line:     #21304c;
  --ink:      #e7ecf6;
  --ink-soft: #9aa8c4;
  --ink-dim:  #6c7a99;
  --brand:    #f07c1e;
  --brand-2:  #ff9a47;
  --ok:       #2ecc8f;
  --warn:     #f5b942;
  --bad:      #f4655c;
  --info:     #4aa8ff;
  --radius:   14px;
  --radius-sm:10px;
  --side-w:   252px;
  --ff-head:'Space Grotesk', sans-serif;
  --ff-body:'Plus Jakarta Sans', sans-serif;
  /* per-demo accent (overridden per page via body[data-theme]) */
  --accent:     var(--brand);
  --accent-2:   var(--brand-2);
  --accent-rgb: 240,124,30;
  --accent-ink: #1a0e02;
}
/* ---------- PER-DEMO ACCENT THEMES ----------
   Each demo keeps the shared layout/shell but gets its own accent
   colour (sidebar, avatar, charts, chat widget) so it feels like a
   distinct product. Webtech chrome (topband badge, skip link, focus
   ring, semantic status tags) stays brand-orange across all themes. */
body[data-theme="rose"]{--accent:#ec6f9b;--accent-2:#ff9bbd;--accent-rgb:236,111,155;--accent-ink:#2b0c1a}
body[data-theme="indigo"]{--accent:#6f86e8;--accent-2:#9fb0ff;--accent-rgb:111,134,232;--accent-ink:#0c1338}
body[data-theme="teal"]{--accent:#2bb3a3;--accent-2:#5fd9c9;--accent-rgb:43,179,163;--accent-ink:#062623}
body[data-theme="violet"]{--accent:#9b6bf2;--accent-2:#c2a3ff;--accent-rgb:155,107,242;--accent-ink:#1d0f3c}
body[data-theme="amber"]{--accent:#f0a93e;--accent-2:#ffcb70;--accent-rgb:240,169,62;--accent-ink:#2e1a02}
body[data-theme="coral"]{--accent:#ef7a5a;--accent-2:#ff9f82;--accent-rgb:239,122,90;--accent-ink:#2c0e04}
body[data-theme="sky"]{--accent:#3aa8d8;--accent-2:#7fd4f5;--accent-rgb:58,168,216;--accent-ink:#04222e}
*{box-sizing:border-box;margin:0;padding:0}
html{scroll-behavior:smooth}
@media(prefers-reduced-motion:reduce){html{scroll-behavior:auto}*{transition-duration:.001ms !important;animation-duration:.001ms !important}}
:focus-visible{outline:2px solid var(--brand-2);outline-offset:3px;border-radius:4px}
body{
  background:var(--bg);color:var(--ink);font-family:var(--ff-body);
  -webkit-font-smoothing:antialiased;line-height:1.5;min-height:100vh;
}
h1,h2,h3,h4{font-family:var(--ff-head);font-weight:700;line-height:1.2;letter-spacing:-.01em}
a{color:inherit}
img{max-width:100%;display:block}
button{font-family:inherit}
.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}

.skip-link{
  position:absolute;left:16px;top:-60px;z-index:300;
  background:var(--brand);color:#1a0e02;font-family:var(--ff-head);font-weight:700;font-size:14px;
  padding:10px 18px;border-radius:0 0 12px 12px;transition:top .2s;
}
.skip-link:focus{top:0}

/* ---------- TOP BAND ---------- */
.demo-topband{
  position:sticky;top:0;z-index:80;display:flex;align-items:center;gap:14px;flex-wrap:wrap;
  padding:12px 22px;background:var(--panel-2);border-bottom:1px solid var(--line);
}
.demo-topband .back{
  display:inline-flex;align-items:center;gap:6px;color:var(--ink-soft);text-decoration:none;
  font-size:14px;font-weight:600;white-space:nowrap;
}
.demo-topband .back svg{width:16px;height:16px;stroke:currentColor;fill:none;stroke-width:2.2;stroke-linecap:round;stroke-linejoin:round}
.demo-topband .back:hover{color:var(--ink)}
.demo-topband .brand{
  display:inline-flex;align-items:center;gap:9px;text-decoration:none;color:var(--ink);
  font-family:var(--ff-head);font-weight:700;font-size:15px;margin-right:auto;
}
.demo-topband .brand img{width:26px;height:26px;border-radius:7px}
.demo-badge{
  background:rgba(240,124,30,.14);color:var(--brand-2);border:1px solid rgba(240,124,30,.35);
  padding:5px 12px;border-radius:999px;font-size:12.5px;font-weight:700;letter-spacing:.01em;white-space:nowrap;
}
.demo-topband .btn{white-space:nowrap}

/* ---------- APP SHELL ---------- */
.demo-app{display:grid;grid-template-columns:var(--side-w) 1fr;align-items:start}
.side-scrim{position:fixed;inset:0;display:none}

.demo-side{
  position:sticky;top:57px;height:calc(100vh - 57px);overflow-y:auto;
  background:var(--panel-2);border-right:1px solid var(--line);padding:18px 14px 24px;
  display:flex;flex-direction:column;gap:2px;
}
.demo-side .side-h{font-size:11px;text-transform:uppercase;letter-spacing:.09em;color:var(--ink-dim);padding:16px 12px 8px;font-weight:700}
.demo-side .side-h:first-child{padding-top:6px;color:var(--accent-2)}
.demo-side a{
  display:flex;align-items:center;gap:12px;padding:10px 12px;border-radius:10px;
  color:var(--ink-soft);text-decoration:none;font-size:14.5px;font-weight:600;transition:.15s ease;
}
.demo-side a svg{width:18px;height:18px;flex:none;stroke:currentColor;fill:none;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.demo-side a:hover{background:rgba(255,255,255,.05);color:var(--ink)}
.demo-side a.active{background:rgba(var(--accent-rgb),.13);color:var(--accent-2)}
.demo-side a .count{margin-left:auto;background:rgba(255,255,255,.08);color:var(--ink-soft);font-size:11.5px;font-weight:700;padding:2px 8px;border-radius:999px}
.demo-side a.active .count{background:rgba(var(--accent-rgb),.22);color:var(--accent-2)}
.demo-side a .count.new{background:rgba(46,204,143,.18);color:var(--ok)}
.demo-side hr{border:none;border-top:1px solid var(--line);margin:14px 8px}
.demo-side .side-foot{margin-top:auto;padding:14px 12px 4px;font-size:12.5px;color:var(--ink-dim)}

.demo-main{min-width:0}
.demo-topbar{
  position:sticky;top:57px;z-index:40;display:flex;align-items:center;justify-content:space-between;gap:16px;
  padding:16px 24px;border-bottom:1px solid var(--line);background:rgba(11,18,32,.92);backdrop-filter:blur(10px);
}
.demo-topbar .tb-left{display:flex;align-items:center;gap:12px;min-width:0}
.demo-topbar h1{font-size:19px;font-weight:700;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.demo-topbar .tb-sub{font-size:12.5px;color:var(--ink-dim);display:none}
.demo-topbar .tb-right{display:flex;align-items:center;gap:10px}

.icon-btn{
  display:inline-grid;place-items:center;width:38px;height:38px;border-radius:10px;
  background:var(--panel);border:1px solid var(--line);color:var(--ink-soft);cursor:pointer;flex:none;
}
.icon-btn svg{width:18px;height:18px;stroke:currentColor;fill:none;stroke-width:1.9;stroke-linecap:round;stroke-linejoin:round}
.icon-btn:hover{color:var(--ink);background:var(--bg-soft)}
.sideToggle{display:none}

.avatar{
  width:34px;height:34px;border-radius:50%;background:linear-gradient(135deg,var(--accent),var(--accent-2));
  display:grid;place-items:center;font-family:var(--ff-head);font-weight:700;font-size:13px;color:var(--accent-ink);flex:none;
}

.demo-content{padding:24px;display:flex;flex-direction:column;gap:20px;max-width:1180px}
.tab-panel{display:flex;flex-direction:column;gap:20px}
.tab-panel[hidden]{display:none}

/* ---------- KPI CARDS ---------- */
.kpis{display:grid;grid-template-columns:repeat(4,1fr);gap:16px}
.kpi{background:var(--panel);border:1px solid var(--line);border-left:3px solid var(--accent);border-radius:var(--radius);padding:18px}
.kpi .lbl{font-size:12.5px;color:var(--ink-soft);font-weight:600;display:flex;align-items:center;gap:8px}
.kpi .lbl svg{width:16px;height:16px;stroke:var(--accent-2);fill:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.kpi .val{font-family:var(--ff-head);font-size:28px;font-weight:700;margin-top:8px}
.kpi .delta{font-size:12.5px;margin-top:6px;font-weight:600}
.kpi .delta.up{color:var(--ok)}
.kpi .delta.down{color:var(--bad)}
.kpi .delta.flat{color:var(--ink-dim)}

/* ---------- CARDS / GRIDS ---------- */
.card{background:var(--panel);border:1px solid var(--line);border-radius:var(--radius);padding:20px}
.card-h{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:14px;flex-wrap:wrap}
.card-h h2,.card-h h3{font-size:16px}
.card-h p{font-size:13px;color:var(--ink-soft);margin-top:2px}
.grid2{display:grid;grid-template-columns:1.4fr .9fr;gap:16px}
.grid3{display:grid;grid-template-columns:repeat(3,1fr);gap:16px}

/* ---------- TABLES ---------- */
.tbl{width:100%;border-collapse:collapse;font-size:13.5px}
.tbl th{text-align:left;color:var(--ink-dim);font-weight:700;font-size:11.5px;text-transform:uppercase;letter-spacing:.05em;padding:10px 12px;border-bottom:1px solid var(--line);white-space:nowrap}
.tbl td{padding:12px;border-bottom:1px solid var(--line);vertical-align:middle}
.tbl tr:last-child td{border-bottom:none}
.tbl .muted{color:var(--ink-soft)}
.tbl-wrap{overflow-x:auto;margin:0 -4px}
.tbl-wrap .tbl{min-width:560px}

/* ---------- TAGS / CHIPS / PROGRESS ---------- */
.tag{display:inline-flex;align-items:center;gap:5px;padding:3px 10px;border-radius:999px;font-size:12px;font-weight:700;white-space:nowrap}
.tag.ok{background:rgba(46,204,143,.14);color:var(--ok)}
.tag.warn{background:rgba(245,185,66,.14);color:var(--warn)}
.tag.bad{background:rgba(244,101,92,.14);color:var(--bad)}
.tag.info{background:rgba(74,168,255,.14);color:var(--info)}
.tag.brand{background:rgba(var(--accent-rgb),.14);color:var(--accent-2)}

.chip{display:inline-flex;align-items:center;gap:6px;padding:6px 12px;border-radius:999px;background:var(--bg-soft);border:1px solid var(--line);font-size:12.5px;font-weight:600;color:var(--ink-soft)}
.chip svg{width:14px;height:14px;stroke:currentColor;fill:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.chip-row{display:flex;gap:8px;flex-wrap:wrap}

.progress{height:8px;border-radius:999px;background:var(--bg-soft);border:1px solid var(--line);overflow:hidden}
.progress span{display:block;height:100%;background:linear-gradient(90deg,var(--accent),var(--accent-2));border-radius:999px}

/* ---------- LISTS ---------- */
.list{display:flex;flex-direction:column;gap:2px}
.list li,.list .li{display:flex;align-items:flex-start;gap:12px;padding:12px 4px;border-bottom:1px solid var(--line);list-style:none}
.list li:last-child,.list .li:last-child{border-bottom:none}
.list .li-ic{width:36px;height:36px;border-radius:10px;background:var(--bg-soft);border:1px solid var(--line);display:grid;place-items:center;flex:none}
.list .li-ic svg{width:17px;height:17px;stroke:var(--accent-2);fill:none;stroke-width:1.9;stroke-linecap:round;stroke-linejoin:round}
.list .li-body{flex:1;min-width:0}
.list .li-title{font-weight:600;font-size:14px}
.list .li-sub{font-size:12.5px;color:var(--ink-soft);margin-top:2px}
.list .li-time{font-size:12px;color:var(--ink-dim);white-space:nowrap;flex:none}

/* ---------- TABS ---------- */
.tabs{display:flex;gap:4px;border-bottom:1px solid var(--line);margin:-4px -4px 16px;flex-wrap:wrap;padding:0 4px}
.tabs button{
  background:none;border:none;color:var(--ink-soft);padding:10px 14px;font-family:var(--ff-body);
  font-size:13.5px;font-weight:700;cursor:pointer;border-bottom:2px solid transparent;white-space:nowrap;
}
.tabs button.active{color:var(--accent-2);border-color:var(--accent)}
.tabs button:hover{color:var(--ink)}
.subpanel[hidden]{display:none}

/* ---------- ALERTS ---------- */
.alert{display:flex;gap:10px;align-items:flex-start;padding:12px 14px;border-radius:10px;font-size:13.5px;border:1px solid}
.alert svg{width:18px;height:18px;flex:none;margin-top:1px;stroke:currentColor;fill:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.alert.ok{background:rgba(46,204,143,.08);border-color:rgba(46,204,143,.3);color:#8be8c4}
.alert.warn{background:rgba(245,185,66,.08);border-color:rgba(245,185,66,.3);color:#ffd98a}
.alert.info{background:rgba(74,168,255,.08);border-color:rgba(74,168,255,.3);color:#a9d6ff}
.alert b{color:var(--ink)}

/* ---------- BAR CHART (CSS only) ---------- */
.barchart{display:flex;align-items:flex-end;gap:10px;height:160px;padding:6px 4px 28px;position:relative}
.barchart .bar{flex:1;background:linear-gradient(180deg,var(--accent-2),rgba(var(--accent-rgb),.25));border-radius:6px 6px 2px 2px;min-height:6px;position:relative}
.barchart .bar.alt{background:linear-gradient(180deg,#3d4f78,rgba(61,79,120,.25))}
.barchart .bar span{position:absolute;bottom:-24px;left:0;right:0;text-align:center;font-size:11px;color:var(--ink-dim);font-weight:600}

/* ---------- BUTTONS ---------- */
.btn{
  display:inline-flex;align-items:center;justify-content:center;gap:8px;padding:11px 18px;border-radius:10px;
  font-weight:700;font-size:14px;text-decoration:none;border:1px solid transparent;cursor:pointer;
  font-family:var(--ff-body);min-height:44px;
}
.btn svg{width:16px;height:16px;stroke:currentColor;fill:none;stroke-width:2.2;stroke-linecap:round;stroke-linejoin:round}
.btn-primary{background:var(--accent);color:var(--accent-ink)}
.btn-primary:hover{background:var(--accent-2)}
.btn-ghost{background:transparent;border-color:var(--line);color:var(--ink)}
.btn-ghost:hover{background:rgba(255,255,255,.05)}
.btn-sm{padding:8px 14px;font-size:13px;min-height:36px;border-radius:8px}
.btn-block{width:100%}

/* ---------- FORMS (inside modals) ---------- */
.field{display:flex;flex-direction:column;gap:6px;margin-bottom:14px}
.field label{font-size:12.5px;font-weight:700;color:var(--ink-soft)}
.field input,.field select,.field textarea{
  background:var(--bg-soft);border:1px solid var(--line);border-radius:10px;color:var(--ink);
  padding:11px 12px;font-size:15px;font-family:var(--ff-body);width:100%;
}
.field input:focus,.field select:focus,.field textarea:focus{outline:2px solid var(--accent-2);outline-offset:1px}
.field-row{display:grid;grid-template-columns:1fr 1fr;gap:12px}

/* ---------- MODAL ---------- */
.modal-overlay{
  position:fixed;inset:0;background:rgba(5,9,18,.72);display:flex;align-items:center;justify-content:center;
  padding:20px;opacity:0;visibility:hidden;transition:opacity .2s ease;z-index:200;
}
.modal-overlay.open{opacity:1;visibility:visible}
.modal{
  background:var(--panel);border:1px solid var(--line);border-radius:16px;max-width:560px;width:100%;
  max-height:85vh;overflow-y:auto;padding:22px;transform:translateY(14px);transition:transform .2s ease;
}
.modal-overlay.open .modal{transform:none}
.modal-h{display:flex;justify-content:space-between;align-items:flex-start;gap:12px;margin-bottom:16px}
.modal-h h2{font-size:18px}
.modal-h p{font-size:13px;color:var(--ink-soft);margin-top:4px}
.modal-h button{background:none;border:none;color:var(--ink-soft);cursor:pointer;font-size:24px;line-height:1;padding:2px}
.modal-h button:hover{color:var(--ink)}
.modal-actions{display:flex;gap:10px;justify-content:flex-end;margin-top:18px;flex-wrap:wrap}
.modal .doc-preview{background:var(--bg-soft);border:1px dashed var(--line);border-radius:10px;padding:16px;font-size:13px;color:var(--ink-soft);margin-bottom:14px}

/* ---------- FLOATING AI CHAT ---------- */
.fchat-btn{
  position:fixed;right:20px;bottom:90px;width:58px;height:58px;border-radius:50%;background:var(--accent);
  display:grid;place-items:center;border:none;cursor:pointer;box-shadow:0 14px 32px -8px rgba(var(--accent-rgb),.65);z-index:120;
}
.fchat-btn svg{width:26px;height:26px;stroke:var(--accent-ink);fill:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.fchat-btn:hover{transform:translateY(-2px)}
.fchat-panel{
  position:fixed;right:20px;bottom:160px;width:350px;max-height:62vh;background:var(--panel);
  border:1px solid var(--line);border-radius:16px;display:flex;flex-direction:column;overflow:hidden;
  opacity:0;visibility:hidden;transform:translateY(14px);transition:.2s ease;z-index:120;
  box-shadow:0 24px 60px -16px rgba(0,0,0,.6);
}
.fchat-panel.open{opacity:1;visibility:visible;transform:none}
.fchat-head{padding:14px 16px;border-bottom:1px solid var(--line);display:flex;align-items:center;gap:10px}
.fchat-head .dot{width:9px;height:9px;border-radius:50%;background:var(--ok);box-shadow:0 0 0 3px rgba(46,204,143,.18)}
.fchat-head b{font-family:var(--ff-head);font-size:14.5px}
.fchat-head span{display:block;font-size:11.5px;color:var(--ink-soft)}
.fchat-body{flex:1;overflow-y:auto;padding:14px;display:flex;flex-direction:column;gap:10px;min-height:180px}
.fmsg{max-width:82%;padding:9px 12px;border-radius:13px;font-size:13.5px;line-height:1.45}
.fmsg.ai{background:var(--bg-soft);border:1px solid var(--line);align-self:flex-start;border-bottom-left-radius:4px}
.fmsg.user{background:var(--accent);color:var(--accent-ink);align-self:flex-end;border-bottom-right-radius:4px;font-weight:600}
.fchat-form{display:flex;border-top:1px solid var(--line)}
.fchat-form input{flex:1;background:none;border:none;padding:13px 14px;color:var(--ink);font-size:15px;font-family:var(--ff-body)}
.fchat-form input::placeholder{color:var(--ink-dim)}
.fchat-form button{background:none;border:none;color:var(--accent-2);padding:0 16px;cursor:pointer;font-weight:700}

/* ---------- WHATSAPP FLOAT (matches main site) ---------- */
.wa-float{
  position:fixed;left:20px;bottom:20px;z-index:90;
  width:56px;height:56px;border-radius:50%;
  background:#25d366;display:grid;place-items:center;
  box-shadow:0 12px 30px -8px rgba(37,211,102,.55);
  transition:transform .2s ease,box-shadow .25s;
}
.wa-float:hover{transform:translateY(-3px) scale(1.05);box-shadow:0 18px 40px -8px rgba(37,211,102,.6)}
.wa-float svg{width:30px;height:30px;fill:#fff}

/* ---------- RESPONSIVE ---------- */
@media(max-width:1180px){
  .kpis{grid-template-columns:repeat(2,1fr)}
  .grid2,.grid3{grid-template-columns:1fr}
}
@media(max-width:980px){
  .sideToggle{display:inline-grid}
  .demo-app{grid-template-columns:1fr}
  .demo-side{
    position:fixed;left:0;top:57px;bottom:0;width:280px;height:auto;
    transform:translateX(-100%);transition:transform .2s ease;z-index:160;box-shadow:18px 0 40px -20px rgba(0,0,0,.5);
  }
  .demo-app.side-open .demo-side{transform:none}
  .side-scrim{
    display:block;top:57px;background:rgba(4,8,16,.55);z-index:150;
    opacity:0;visibility:hidden;transition:opacity .2s ease;
  }
  .demo-app.side-open .side-scrim{opacity:1;visibility:visible}
  .demo-topbar{top:57px}
  .demo-content{padding:18px}
}
@media(max-width:680px){
  .demo-topband{padding:10px 14px;gap:10px}
  .demo-topband .brand{display:none}
  .demo-topbar{padding:12px 16px;gap:10px}
  .demo-topbar h1{font-size:17px}
  .demo-content{padding:14px;gap:16px}
  .kpis{grid-template-columns:1fr 1fr;gap:10px}
  .kpi{padding:14px}
  .kpi .val{font-size:22px}
  .field-row{grid-template-columns:1fr}
  .fchat-panel{width:calc(100vw - 28px);right:14px;left:14px;bottom:148px}
  .fchat-btn{right:16px;bottom:84px}
  .wa-float{left:16px;bottom:16px;width:50px;height:50px}
  .wa-float svg{width:26px;height:26px}
  .avatar{display:none}
}
@media(max-width:390px){
  .kpis{grid-template-columns:1fr}
  .demo-topband .demo-badge{display:none}
}
