@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Inter+Tight:wght@500;600;700;800&family=JetBrains+Mono:wght@500;600&display=swap');

:root {
  /* White sidebar (light default), warm 6SD content */
  --side-bg: #FFFFFF; --side-text: #14120F; --side-mute: #8A8578;
  --side-active: #EAF1FF; --side-active-text: #1B4FFF; --side-line: rgba(20,18,15,.08);
  --bg: #FBF8F2; --panel: #FFFFFF; --panel-2: #F4EFE3;
  --text: #14120F; --dim: #4A5468; --mute: #8A8578;
  --line: rgba(20,18,15,.09); --line-2: rgba(20,18,15,.17);
  --accent: #2E6BFF; --accent-2: #1B4FFF; --accent-soft: #EAF1FF;
  --good: #1FA971; --warn: #C9871A; --bad: #E5484D;
  --radius: 14px; --brand: #2E6BFF;
  --font-display: "Inter Tight", system-ui, sans-serif;
  --font-body: "Inter", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
  font-family: var(--font-body); font-size: 14px;
}
body.dark {
  --side-bg: #0E0D0B; --side-text: #F4EFE3; --side-mute: #9A958A;
  --side-active: rgba(46,107,255,.20); --side-active-text: #9EC5FF; --side-line: rgba(255,255,255,.07);
  --bg: #0B0A0A; --panel: #14120F; --panel-2: #1C1A16;
  --text: #FFFFFF; --dim: #D6DAE4; --mute: #9CA3B4;
  --line: rgba(255,255,255,.09); --line-2: rgba(255,255,255,.16);
  --accent-soft: rgba(46,107,255,.16);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); min-height: 100vh; -webkit-font-smoothing: antialiased; }
.hidden { display: none !important; }
.muted { color: var(--mute); }
button, input, textarea, select { font-family: inherit; }
a { color: var(--accent-2); }
.link { color: var(--accent-2); cursor: pointer; background: none; border: none; font: inherit; padding: 0; }
.link:hover { text-decoration: underline; }
h1, h2, h3 { font-family: var(--font-display); letter-spacing: -0.03em; font-weight: 700; margin: 0; }
.eyebrow { font-family: var(--font-mono); font-size: 11px; font-weight: 600; letter-spacing: .2em; text-transform: uppercase; color: var(--accent); }

/* ---------- Logo mark ---------- */
.logo { display: flex; align-items: center; gap: 10px; }
.logo .word b { font-family: var(--font-display); font-weight: 700; font-size: 16px; letter-spacing: -0.04em; }
.logo .word small { font-family: var(--font-mono); font-weight: 600; font-size: 8.5px; letter-spacing: .26em; text-transform: uppercase; display: block; margin-top: 3px; }

/* ---------- Auth ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: linear-gradient(160deg, #0B1430, #0E1A3D); }
.auth-card { width: 100%; max-width: 400px; background: #fff; border-radius: 20px; padding: 38px 34px; box-shadow: 0 30px 80px rgba(0,0,0,.4); color: #0C1220; }
.auth-card .logo { justify-content: center; margin-bottom: 22px; color: #0C1220; }
.auth-card .logo .word b small { color: var(--accent); }
.auth-card .eyebrow { display: block; text-align: center; margin-bottom: 8px; }
.auth-card h1 { text-align: center; font-size: 27px; margin-bottom: 6px; }
.auth-card .sub { color: var(--mute); font-size: 14px; text-align: center; margin: 0; line-height: 1.5; }
.auth-card form { display: grid; gap: 10px; margin-top: 22px; }
.auth input { padding: 14px 15px; border-radius: 11px; border: 1px solid #d8dde7; font-size: 15px; }
.auth input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(46,107,255,.18); }
.auth button[type=submit] { padding: 14px; border-radius: 11px; border: none; background: var(--accent); color: #fff; font-weight: 700; font-size: 15px; cursor: pointer; font-family: var(--font-display); }
.auth button[type=submit]:hover { background: var(--accent-2); }
.auth button[type=submit]:disabled { opacity: .6; }
.auth-msg { margin-top: 14px; font-size: 14px; min-height: 18px; text-align: center; }
.auth-msg.err { color: var(--bad); } .auth-msg.ok { color: var(--good); }
.auth .link { display: block; text-align: center; margin-top: 4px; }

/* ---------- App shell ---------- */
#app { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.sidebar { background: var(--side-bg); color: var(--side-text); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; border-right: 1px solid var(--side-line); }
.side-brand { padding: 18px 16px 14px; display: flex; align-items: center; gap: 10px; }
.side-brand .bword { display: flex; flex-direction: column; line-height: 1; }
.side-brand .bword b { font-family: var(--font-display); font-weight: 800; font-size: 16px; letter-spacing: -0.04em; color: var(--side-text); }
.side-brand .bword small { font-family: var(--font-mono); font-weight: 600; font-size: 8.5px; letter-spacing: .3em; color: var(--accent); margin-top: 3px; }
.side-id { padding: 12px 16px; margin: 0 10px 6px; border-radius: 11px; background: var(--panel-2); display: flex; align-items: center; gap: 11px; }
.side-id .av { width: 38px; height: 38px; border-radius: 10px; background: var(--panel-2); border: 1px solid var(--side-line); display: grid; place-items: center; overflow: hidden; flex-shrink: 0; }
.side-id .av img { width: 100%; height: 100%; object-fit: contain; padding: 4px; }
.side-id .av.brandfill { background: var(--brand); color: #fff; font-family: var(--font-display); font-weight: 800; font-size: 15px; }
.side-id .who-name { font-family: var(--font-display); font-weight: 700; font-size: 14.5px; line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-id .who-sub { color: var(--side-mute); font-size: 12px; margin-top: 2px; }
.nav { padding: 10px 10px; display: flex; flex-direction: column; gap: 2px; }
.nav-group { padding: 14px 12px 7px; margin-top: 8px; border-top: 0.5px solid var(--side-line); display: flex; flex-direction: column; gap: 2px; }
.nav-group .ng-name { font-family: var(--font-display); font-weight: 700; font-size: 12.5px; letter-spacing: -0.01em; color: var(--side-text); }
.nav-group .ng-tag { font-family: var(--font-mono); font-size: 9.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--side-mute); }
.nav a { position: relative; display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 9px; color: var(--side-mute); text-decoration: none; font-weight: 500; font-size: 14px; cursor: pointer; transition: background .12s, color .12s; }
.nav a svg { width: 18px; height: 18px; opacity: .8; flex-shrink: 0; }
.nav a:hover { background: var(--panel-2); color: var(--side-text); }
.nav a.active { background: var(--side-active); color: var(--side-active-text); font-weight: 600; }
.nav a.active svg { opacity: 1; }
.nav a.active::before { content: ""; position: absolute; left: -10px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); }
.side-foot { margin-top: auto; padding: 10px; border-top: 1px solid var(--side-line); display: flex; flex-direction: column; gap: 2px; }
.side-foot .sbtn { display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 9px; color: var(--side-mute); background: none; border: none; cursor: pointer; font-size: 14px; text-align: left; width: 100%; }
.side-foot .sbtn:hover { background: var(--panel-2); color: var(--side-text); }
.side-foot .sbtn svg { width: 17px; height: 17px; }

.content { padding: 28px 34px 80px; max-width: 1240px; }

/* ---------- Page header ---------- */
.phead { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.phead h1 { font-size: 26px; }
.phead .greet-sub { color: var(--mute); font-size: 14.5px; margin-top: 4px; }
.phead-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.chip-link { display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px; border: 1px solid var(--line-2); border-radius: 9px; background: var(--panel); color: var(--text); text-decoration: none; font-size: 13px; font-weight: 500; }
.chip-link:hover { border-color: var(--accent); }

/* ---------- KPI cards ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; margin-bottom: 22px; }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; display: flex; gap: 14px; align-items: center; box-shadow: 0 1px 2px rgba(20,18,15,.04); }
.kpi .ic { width: 46px; height: 46px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; flex-shrink: 0; }
.kpi .ic svg { width: 22px; height: 22px; }
.kpi .label { font-size: 13px; color: var(--mute); }
.kpi .value { font-family: var(--font-display); font-size: 27px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.1; margin-top: 2px; }

/* ---------- Panels ---------- */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 18px; overflow: hidden; box-shadow: 0 1px 2px rgba(20,18,15,.04); }
body.dark .kpi, body.dark .panel, body.dark .ccard { box-shadow: none; }
.panel-head { padding: 15px 18px; border-bottom: 1px solid var(--line); font-family: var(--font-display); font-weight: 600; font-size: 15px; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.panel-head .count { color: var(--mute); font-weight: 500; font-size: 12px; font-family: var(--font-mono); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 12px 18px; font-size: 13.5px; border-bottom: 1px solid var(--line); }
th { color: var(--mute); font-weight: 600; font-size: 10.5px; text-transform: uppercase; letter-spacing: .05em; font-family: var(--font-mono); }
tr:last-child td { border-bottom: none; }
tbody tr.clickable { cursor: pointer; }
tbody tr.clickable:hover { background: var(--panel-2); }
.empty { padding: 40px 20px; color: var(--mute); text-align: center; font-size: 14px; }

/* ---------- Request/list rows ---------- */
.lrow { display: flex; align-items: center; gap: 14px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.lrow:last-child { border-bottom: none; }
.lrow .av { width: 38px; height: 38px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-family: var(--font-display); font-weight: 700; font-size: 14px; flex-shrink: 0; }
.lrow .main { flex: 1; min-width: 0; }
.lrow .main b { font-family: var(--font-display); font-weight: 600; }
.lrow .main small { color: var(--mute); display: block; margin-top: 2px; }
.lrow .meta { color: var(--mute); font-size: 13px; text-align: right; white-space: nowrap; }
.lrow .meta svg { width: 16px; height: 16px; vertical-align: -3px; }
.lrow .av svg { width: 17px; height: 17px; }
.panel-head svg { width: 16px; height: 16px; vertical-align: -3px; }

/* ---------- Cards grid (clients/projects) ---------- */
.cgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.ccard { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; cursor: pointer; position: relative; overflow: hidden; transition: border-color .15s, transform .15s, box-shadow .15s; box-shadow: 0 1px 2px rgba(20,18,15,.04); }
.ccard:hover { box-shadow: 0 10px 28px rgba(20,18,15,.1); }
.ccard::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: var(--brand); }
.ccard:hover { border-color: var(--line-2); transform: translateY(-2px); }
.ccard .top { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.ccard .lg { width: 46px; height: 46px; border-radius: 11px; background: var(--panel-2); display: grid; place-items: center; overflow: hidden; flex-shrink: 0; }
.ccard .lg img { width: 100%; height: 100%; object-fit: contain; padding: 5px; }
.ccard .lg.fb { background: var(--brand); color: #fff; font-family: var(--font-display); font-weight: 800; }
.ccard .nm { font-family: var(--font-display); font-weight: 700; font-size: 15.5px; }
.ccard .nm small { display: block; color: var(--mute); font-weight: 400; font-size: 12.5px; margin-top: 2px; }
.ccard .stats { display: flex; gap: 20px; margin-bottom: 12px; }
.ccard .stats b { font-family: var(--font-display); font-size: 19px; display: block; font-weight: 700; }
.ccard .stats span { color: var(--mute); font-size: 11px; text-transform: uppercase; letter-spacing: .04em; font-family: var(--font-mono); }
.ccard .actions { display: flex; gap: 8px; }

/* ---------- Setup (coming soon) card ---------- */
.setup { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 48px 32px; text-align: center; }
.setup .ic { width: 56px; height: 56px; border-radius: 16px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; margin: 0 auto 18px; }
.setup .ic svg { width: 28px; height: 28px; }
.setup h2 { font-size: 21px; margin-bottom: 8px; }
.setup p { color: var(--mute); max-width: 440px; margin: 0 auto 8px; line-height: 1.55; }
.setup ul { list-style: none; padding: 0; margin: 16px auto 22px; max-width: 320px; text-align: left; display: grid; gap: 8px; }
.setup li { display: flex; gap: 9px; align-items: center; font-size: 14px; }
.setup li svg { width: 16px; height: 16px; color: var(--good); flex-shrink: 0; }
.setup .soon { display: inline-block; font-size: 11px; font-family: var(--font-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--accent); background: var(--accent-soft); padding: 4px 12px; border-radius: 999px; }

/* ---------- Pills / badges ---------- */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 11px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.active { background: rgba(31,169,113,.14); color: var(--good); }
.pill.paused { background: rgba(201,135,26,.14); color: var(--warn); }
.pill.pending { background: var(--accent-soft); color: var(--accent); }
.pill.off { background: var(--panel-2); color: var(--mute); }

/* ---------- Buttons ---------- */
.btn { background: var(--accent); color: #fff; border: none; padding: 10px 20px; border-radius: 999px; font-weight: 600; cursor: pointer; font-size: 14px; letter-spacing: -0.01em; font-family: var(--font-display); transition: transform .18s, box-shadow .22s, background .18s; }
.btn:hover { background: var(--accent-2); box-shadow: 0 6px 18px rgba(46,107,255,.35); transform: translateY(-1px); }
.btn.sm { padding: 7px 14px; font-size: 13px; }
.btn.ghost { background: transparent; border: 1px solid var(--line-2); color: var(--text); }
.btn.ghost:hover { background: var(--panel-2); box-shadow: none; border-color: var(--line-2); }
.btn.good { background: var(--good); }
.btn.danger { background: var(--bad); }
.btn.danger:hover { background: #cf3b40; box-shadow: 0 6px 18px rgba(229,72,77,.32); }
.btn:disabled { opacity: .5; cursor: default; box-shadow: none; transform: none; }

/* ---------- Service rows ---------- */
.svc { display: flex; align-items: center; justify-content: space-between; padding: 13px 18px; border-bottom: 1px solid var(--line); gap: 12px; }
.svc:last-child { border-bottom: none; }
.svc .info b { display: block; font-family: var(--font-display); font-weight: 600; font-size: 15px; }
.svc .info small { color: var(--mute); font-size: 13px; }
.svc .right { display: flex; align-items: center; gap: 10px; }
.svc .price { font-family: var(--font-display); font-weight: 700; color: var(--dim); cursor: pointer; background: none; border: none; }

/* ---------- Fields ---------- */
.fld { display: grid; gap: 6px; margin-bottom: 4px; }
.fld > span { font-size: 11px; color: var(--mute); font-family: var(--font-mono); letter-spacing: .05em; text-transform: uppercase; }
.fld input, .fld textarea, .copyrow input { width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--panel); color: var(--text); font-size: 14px; }
.fld input:focus, .fld textarea:focus { outline: none; border-color: var(--accent); }
.copyrow { display: flex; gap: 8px; } .copyrow input { flex: 1; }
.statussel { padding: 6px 10px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--panel); color: var(--text); font-size: 13px; cursor: pointer; }
.statussel:focus { outline: none; border-color: var(--accent); }
.modal form select { padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--panel); color: var(--text); font-size: 14px; }
.views { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.vchip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 13px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--panel); color: var(--dim); font-size: 13px; font-weight: 500; cursor: pointer; }
.vchip:hover { border-color: var(--accent); }
.vchip.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.vchip .vx { opacity: .7; font-size: 14px; line-height: 1; }
.vchip .vx:hover { opacity: 1; }
.vchip.add { color: var(--accent); border-style: dashed; }
.tablewrap { overflow-x: auto; }
table.crm { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.crm th { text-align: left; padding: 11px 14px; font-family: var(--font-mono); font-size: 10.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--mute); border-bottom: 1px solid var(--line); cursor: pointer; white-space: nowrap; user-select: none; }
table.crm th:hover { color: var(--text); }
table.crm td { padding: 0; border-bottom: 1px solid var(--line); }
table.crm tbody tr:last-child td { border-bottom: none; }
table.crm td.cell { padding: 11px 14px; cursor: text; white-space: nowrap; max-width: 260px; overflow: hidden; text-overflow: ellipsis; }
table.crm td.cell:hover { background: var(--panel-2); box-shadow: inset 0 0 0 1px var(--line-2); }
table.crm td.ro { padding: 7px 12px; text-align: center; }
.cellinp { width: 100%; min-width: 130px; padding: 8px 11px; border: 1px solid var(--accent); border-radius: 6px; font-size: 13.5px; background: var(--panel); color: var(--text); }
.cellinp:focus { outline: none; box-shadow: 0 0 0 2px rgba(46,107,255,.18); }
.iconbtn { background: none; border: none; color: var(--mute); cursor: pointer; padding: 4px; display: inline-flex; }
.iconbtn:hover { color: var(--accent); }
.iconbtn svg { width: 16px; height: 16px; }
.search-inp { padding: 8px 12px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--panel); color: var(--text); font-size: 13.5px; min-width: 190px; }
.search-inp:focus { outline: none; border-color: var(--accent); }
.checklist { display: grid; gap: 10px; padding: 18px 20px; }
.checklist .ci { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.checklist .ci .ck { width: 20px; height: 20px; border-radius: 50%; background: rgba(31,169,113,.15); color: var(--good); display: grid; place-items: center; flex-shrink: 0; }
.checklist .ci .ck svg { width: 13px; height: 13px; }
.siteframe { width: 100%; height: 420px; border: 0; display: block; background: var(--panel-2); }
.steps { counter-reset: s; display: grid; gap: 14px; padding: 18px 20px; }
.steps .st { display: flex; gap: 12px; align-items: flex-start; font-size: 14px; }
.steps .st .n { counter-increment: s; width: 26px; height: 26px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-family: var(--font-display); font-weight: 700; font-size: 13px; flex-shrink: 0; }
.steps .st .n::before { content: counter(s); }

/* ---------- Review / QR ---------- */
.review-row { display: flex; gap: 18px; align-items: flex-start; flex-wrap: wrap; }
.qrbox { width: 128px; height: 128px; border-radius: 12px; background: #fff; padding: 8px; flex-shrink: 0; border: 1px solid var(--line); }
.qrbox img { width: 100%; height: 100%; }

/* ---------- Photos / projects ---------- */
.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.pcard { position: relative; aspect-ratio: 4/3; border-radius: 11px; overflow: hidden; border: 1px solid var(--line); background: var(--panel-2); }
.pcard img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pdel { position: absolute; top: 6px; right: 6px; width: 26px; height: 26px; border-radius: 7px; border: none; background: rgba(11,10,10,.7); color: #fff; cursor: pointer; font-size: 13px; opacity: 0; transition: opacity .15s; }
.pcard:hover .pdel { opacity: 1; }
.passign { position: absolute; left: 6px; right: 6px; bottom: 6px; font-size: 11px; padding: 3px 6px; border-radius: 6px; border: none; background: rgba(11,10,10,.8); color: #fff; opacity: 0; transition: opacity .15s; }
.pcard:hover .passign { opacity: 1; }
.proj { border: 1px solid var(--line); border-radius: 12px; margin-bottom: 14px; overflow: hidden; }
.proj-head { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); background: var(--panel-2); }
.proj-head b { font-family: var(--font-display); font-weight: 600; font-size: 15px; }
.proj-actions { margin-left: auto; display: flex; gap: 8px; }
.proj .pgrid { padding: 14px 16px; }

/* ---------- Chart ---------- */
.chart { padding: 18px; }
.chart svg { width: 100%; height: 150px; display: block; overflow: visible; }
.chart .bar { fill: var(--accent); }
.chart .axis { fill: var(--mute); font-size: 10px; font-family: var(--font-mono); }

/* ---------- Preview chip (floating) ---------- */
.preview-chip { position: fixed; right: 20px; bottom: 20px; z-index: 50; display: none; align-items: center; gap: 12px; background: var(--side-bg); color: #fff; padding: 11px 14px; border-radius: 12px; box-shadow: 0 12px 34px rgba(0,0,0,.35); font-size: 13px; }
.preview-chip.on { display: flex; }
.preview-chip b { font-family: var(--font-display); }
.preview-chip button { background: var(--accent); color: #fff; border: none; padding: 6px 12px; border-radius: 8px; font-weight: 600; cursor: pointer; font-size: 13px; }

/* ---------- Home report (Build/Grow/Automate) ---------- */
.alert { display: flex; align-items: center; gap: 12px; background: var(--accent-soft); border: 1px solid rgba(46,107,255,.22); border-radius: 12px; padding: 13px 16px; margin-bottom: 22px; }
.alert .ai { color: var(--accent); display: flex; flex-shrink: 0; }
.alert .ai svg { width: 20px; height: 20px; }
.alert .atext { font-size: 14.5px; color: var(--text); flex: 1; }
.alert .atext b { font-weight: 600; }
.headline { margin-bottom: 10px; }
.headline .hrow { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.headline .hnum { font-family: var(--font-display); font-size: 52px; font-weight: 800; letter-spacing: -0.045em; line-height: 1; }
.headline .htrend { font-size: 14px; font-weight: 600; font-family: var(--font-display); }
.headline .htrend.up { color: var(--good); } .headline .htrend.down { color: var(--bad); }
.headline .hcap { color: var(--mute); font-size: 14.5px; margin-top: 8px; }
.pillar-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; margin-top: 6px; margin-bottom: 22px; }
.pcard2 { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; cursor: pointer; box-shadow: 0 1px 2px rgba(20,18,15,.04); transition: box-shadow .15s, transform .15s; }
.pcard2:hover { box-shadow: 0 10px 28px rgba(20,18,15,.1); transform: translateY(-2px); }
.pcard2 .pc-eyebrow { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .18em; text-transform: uppercase; color: var(--accent); }
.pcard2 .pc-stat { font-family: var(--font-display); font-size: 30px; font-weight: 800; letter-spacing: -0.03em; margin: 12px 0 0; }
.pcard2 .pc-stat small { font-family: var(--font-body); font-size: 12.5px; font-weight: 400; color: var(--mute); display: block; letter-spacing: 0; margin-top: 3px; }
.pcard2 .pc-link { color: var(--accent-2); font-size: 13px; font-weight: 600; margin-top: 12px; display: flex; align-items: center; gap: 6px; }
.pcard2 .pc-link svg { width: 15px; height: 15px; }
.chip-link svg { width: 15px; height: 15px; }
body.dark .pcard2 { box-shadow: none; }

/* ---------- In-app modal ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(20,18,15,.45); backdrop-filter: blur(4px); display: grid; place-items: center; z-index: 100; padding: 20px; animation: mfade .15s ease; }
@keyframes mfade { from { opacity: 0; } to { opacity: 1; } }
.modal { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 26px; width: 100%; max-width: 420px; box-shadow: 0 30px 80px rgba(20,18,15,.28); }
.modal h3 { font-size: 20px; letter-spacing: -0.03em; margin-bottom: 4px; }
.modal .msub { color: var(--mute); font-size: 14px; margin-bottom: 18px; line-height: 1.5; }
.modal form { display: grid; gap: 14px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 8px; }

.loading { position: fixed; inset: 0; display: grid; place-items: center; color: var(--mute); font-size: 14px; }

/* toast (soft-delete undo, etc.) */
.toast { position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 16px); z-index: 80; display: flex; align-items: center; gap: 16px; background: var(--ink, #1c1a17); color: #fff; padding: 12px 14px 12px 18px; border-radius: 12px; box-shadow: 0 10px 34px rgba(0,0,0,.28); font-size: 14px; opacity: 0; transition: opacity .22s ease, transform .22s ease; max-width: min(92vw, 460px); }
.toast.on { opacity: 1; transform: translate(-50%, 0); }
.toast button { background: none; border: none; color: var(--accent2, #f0a04b); font-weight: 700; font-size: 14px; cursor: pointer; padding: 4px 6px; white-space: nowrap; }
.toast button:hover { text-decoration: underline; }
@media (max-width: 880px) { .toast { left: 12px; right: 12px; bottom: 16px; transform: translateY(16px); max-width: none; } .toast.on { transform: translateY(0); } }

/* mobile top bar + drawer (hidden on desktop) */
.mobilebar { display: none; }
.scrim { display: none; }

@media (max-width: 880px) {
  #app { display: block; }
  .mobilebar { display: flex; align-items: center; gap: 12px; position: sticky; top: 0; z-index: 30; background: var(--side-bg); color: var(--side-text); padding: 12px 16px; padding-top: calc(12px + env(safe-area-inset-top)); border-bottom: 1px solid var(--side-line); }
  .m-menu { background: none; border: none; color: inherit; cursor: pointer; padding: 4px; display: flex; }
  .m-menu svg { width: 24px; height: 24px; }
  .m-title { font-family: var(--font-display); font-weight: 700; font-size: 16px; letter-spacing: -0.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .sidebar { position: fixed; top: 0; left: 0; height: 100vh; width: 282px; max-width: 84vw; transform: translateX(-100%); transition: transform .25s ease; z-index: 50; box-shadow: 6px 0 30px rgba(0,0,0,.22); }
  body.drawer .sidebar { transform: translateX(0); }
  .scrim { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 40; }
  body.drawer .scrim { display: block; }
  .content { padding: 18px 14px 96px; max-width: 100%; }
  .grid-2 { grid-template-columns: 1fr; }
  .phead { gap: 10px; }
  .phead h1 { font-size: 23px; }
  .phead-actions { width: 100%; }
  .phead-actions .search-inp, .phead-actions .statussel { flex: 1; min-width: 0; }
  .headline .hnum { font-size: 42px; }
  .kpi .value { font-size: 24px; }
  .modal { max-width: 100%; }
  .preview-chip { left: 12px; right: 12px; bottom: 12px; }
  table:not(.crm) th:nth-child(n+4), table:not(.crm) td:nth-child(n+4) { display: none; }
}
