/* D100 dashboard. Look: Apple (Arman 2026-11-12: "anything regarding iOS is always beautiful ... Apple design in itself is
   always beautiful"). iOS dark system colours, system type, borderless groups on black, thin inset dividers, no gradients,
   no glow, no lift on hover. */
:root {
  --bg: #000000;
  --panel: #1C1C1E;
  --card: #1C1C1E;
  --card-2: rgba(120,120,128,0.16);
  --card-grad: #2C2C2E;
  --border: rgba(84,84,88,0.45);
  --border-soft: rgba(84,84,88,0.3);
  --border-solid: #38383A;
  --text: #FFFFFF;
  --muted: rgba(235,235,245,0.6);
  --muted-2: rgba(235,235,245,0.34);

  --accent: #0A84FF;
  --accent-soft: rgba(10,132,255,0.14);
  --accent-border: rgba(10,132,255,0.35);

  --good: #30D158;
  --bad: #FF453A;
  --warn: #FF9F0A;

  --r-panel: 22px;
  --r-card: 14px;
  --r-btn: 10px;
}

* { margin:0; padding:0; box-sizing:border-box; }
html, body {
  background:var(--bg); color:var(--text);
  font-family:-apple-system, BlinkMacSystemFont, 'SF Pro Text', 'SF Pro Display', system-ui, sans-serif; letter-spacing:-0.01em;
  font-size:14px; line-height:1.5; min-height:100vh;
  -webkit-font-smoothing:antialiased; -moz-osx-font-smoothing:grayscale;
}
body { background:var(--bg); }
.hidden { display:none !important; }
.muted { color:var(--muted); font-weight:500; font-size:13px; }

/* ── SHELL ── */
.app { display:flex; min-height:100vh; align-items:stretch; }

/* ── SIDEBAR (floating ClientOS panel) ── */
.sidebar {
  width:236px; flex-shrink:0; position:sticky; top:14px; align-self:flex-start;
  height:calc(100vh - 28px); margin:14px 0 14px 14px; padding:14px;
  background:var(--panel); border:0; border-radius:22px;
  display:flex; flex-direction:column; gap:6px; overflow:hidden;
}
.sidebar > * { position:relative; z-index:1; }
.ws-chip { display:flex; align-items:center; gap:10px; padding:6px 6px 16px; }
.ws-mark {
  width:34px; height:34px; border-radius:9px; flex-shrink:0;
  display:grid; place-items:center; font-weight:700; font-size:12.5px; color:#fff;
  background:var(--accent);
}
.ws-name { font-size:14.5px; font-weight:700; color:var(--text); white-space:nowrap; letter-spacing:-0.1px; }
.ws-tag { font-size:10.5px; color:var(--muted-2); font-weight:500; margin-top:1px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; max-width:150px; }

.side-nav { display:flex; flex-direction:column; gap:3px; }
.nav-item {
  display:flex; align-items:center; gap:11px; width:100%; text-align:left;
  background:transparent; border:none; border-radius:10px; padding:10px 12px;
  color:var(--text); font-size:15px; font-weight:400; cursor:pointer;
  font-family:inherit; transition:color .15s, background .15s, transform .15s; white-space:nowrap;
}
.nav-item:hover { color:#fff; background:rgba(255,255,255,0.04); }
.nav-item:active { transform:scale(0.98); }
.nav-item.active { background:rgba(120,120,128,0.32); color:#fff; font-weight:600; }
.nav-ic { width:18px; text-align:center; font-size:14px; color:var(--accent); flex-shrink:0; }
.nav-item.active .nav-ic { opacity:1; color:var(--accent); }
.nav-num, .nav-sub { display:none; }
.nav-text, .nav-title { display:contents; font:inherit; }

.side-foot { margin-top:auto; padding-top:14px; border-top:1px solid var(--border-soft); }
.side-foot-btn {
  width:100%; background:#252525; border:1px solid var(--border-solid); border-radius:var(--r-btn);
  padding:9px 14px; color:var(--text); font-size:13px; font-weight:500; cursor:pointer;
  font-family:inherit; transition:background .15s, transform .15s; white-space:nowrap;
}
.side-foot-btn:hover { background:#2E2E2E; }
.side-foot-btn:active { transform:scale(0.98); }
.side-foot-updated { font-size:10.5px; line-height:1.45; color:var(--muted-2); white-space:normal; overflow-wrap:anywhere; text-align:center; margin-top:8px; }
.side-foot-updated + .side-foot-updated { margin-top:6px; }

/* ── MAIN ── */
.main { flex:1; min-width:0; width:100%; max-width:1500px; margin:0 auto; padding:28px 28px 48px; }
.view { animation:fade .3s cubic-bezier(.21,.47,.32,.98); }
@keyframes fade { from{opacity:0;transform:translateY(8px)} to{opacity:1;transform:none} }

.page-head { display:flex; justify-content:space-between; align-items:flex-start; gap:20px; margin-bottom:20px; flex-wrap:wrap; }
.page-eyebrow { font-size:11px; font-weight:600; letter-spacing:1.4px; text-transform:uppercase; color:var(--muted-2); }
.page-title { font-size:34px; font-weight:700; letter-spacing:-0.02em; margin:2px 0 4px; color:#fff; }
.page-sub { font-size:15px; color:var(--muted); }
.page-head-actions { display:flex; align-items:center; gap:10px; }
.demo-pill {
  display:inline-block; padding:5px 13px; border-radius:999px; font-size:11px; font-weight:600;
  background:#252525; border:1px solid var(--border-solid); color:var(--muted);
}

/* ── KPI ROW ── */
.kpi-row { display:grid; grid-template-columns:repeat(auto-fill,minmax(184px,1fr)); gap:12px; margin-bottom:20px; }
.kpi {
  background:var(--card-grad);
  border:0; border-radius:var(--r-card); padding:18px 18px 16px;
  position:relative; overflow:hidden; transition:transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}
.kpi::before {
  content:''; position:absolute; inset:0; pointer-events:none;
  background:none;
}
.kpi-label { font-size:11px; font-weight:600; letter-spacing:0.6px; text-transform:uppercase; color:var(--muted); }
.kpi-value { font-size:26px; font-weight:700; letter-spacing:-0.6px; margin:8px 0 3px; color:#fff; font-variant-numeric:tabular-nums; }
.kpi-acc .kpi-value { color:var(--accent); }
.kpi-green .kpi-value { color:var(--good); }
.kpi-sub { font-size:11.5px; color:var(--muted-2); font-weight:500; }

/* ── CARDS (panels) ── */
.card {
  background:var(--panel); border:0; border-radius:var(--r-panel);
  padding:20px 20px; margin-bottom:16px; position:relative; overflow:hidden;
}
.card > * { position:relative; z-index:1; }
.card h2 {
  font-size:15px; font-weight:600; letter-spacing:-0.1px;
  margin-bottom:18px; color:#fff; display:flex; align-items:center;
}
.card h2 .muted { font-size:12px; font-weight:500; margin-left:10px; text-transform:none; color:var(--muted); }
.two-col { display:grid; grid-template-columns:1fr 1fr; gap:16px; margin-bottom:16px; }
.two-col .card { margin-bottom:0; }
@media(max-width:900px) { .two-col { grid-template-columns:1fr; } }
.offer-card.is-best { border-color:var(--accent-border); }
.ft-badge { background:var(--accent-soft); color:var(--accent); font-size:11px; font-weight:600; padding:4px 10px; border-radius:var(--r-btn); white-space:nowrap; border:none; }

/* ── STATS GRID ── */
.stats-grid { display:grid; grid-template-columns:repeat(auto-fill, minmax(150px, 1fr)); gap:12px; margin-bottom:18px; }
.stat {
  background:var(--card-grad); border:0; border-radius:var(--r-card);
  padding:15px 16px; position:relative; overflow:hidden;
}
.stat > * { position:relative; }
.stat-label { font-size:10.5px; font-weight:600; letter-spacing:1.1px; color:var(--muted); text-transform:uppercase; margin-bottom:9px; }
.stat-value { font-size:26px; font-weight:700; color:#fff; letter-spacing:-0.025em; line-height:1; font-variant-numeric:tabular-nums; }
.stat-value.acc { color:var(--accent); }
.stat-value.green { color:var(--good); }
.stat-sub { font-size:10.5px; color:var(--muted-2); margin-top:6px; }

/* ── FUNNEL BARS ── */
.funnel-steps { display:flex; flex-direction:column; gap:10px; }
.funnel-step { display:grid; grid-template-columns:120px 1fr 110px; gap:14px; align-items:center; }
.funnel-step-label { font-size:13px; font-weight:500; color:var(--text); }
.funnel-step-bar { height:24px; background:rgba(255,255,255,0.05); border-radius:7px; overflow:hidden; }
.funnel-step-fill { height:100%; background:var(--accent); border-radius:7px; position:relative; overflow:hidden; animation:fillIn 0.8s cubic-bezier(.21,.47,.32,.98) both; }
@keyframes fillIn { from{transform:translateX(-100%);} to{transform:none;} }
@keyframes shine { 0%{transform:translateX(-120%);} 45%,100%{transform:translateX(130%);} }
.funnel-step-count { font-size:13px; text-align:right; font-weight:600; font-variant-numeric:tabular-nums; }
.funnel-step-count .conv { color:var(--muted); font-size:11px; margin-left:6px; font-weight:500; }

/* head-to-head */
.h2h { display:flex; flex-direction:column; gap:8px; }
.h2h-row { display:grid; grid-template-columns:1fr 90px 90px; gap:12px; align-items:center; padding:10px 14px; background:var(--card-grad); border:1px solid var(--border-soft); border-radius:var(--r-card); }
.h2h-row.head { background:transparent; border-color:transparent; padding:2px 14px; font-size:10.5px; font-weight:600; letter-spacing:1.1px; text-transform:uppercase; color:var(--muted-2); }
.h2h-label { font-size:13px; font-weight:500; color:var(--muted); }
.h2h-val { font-size:14px; font-weight:700; text-align:right; font-variant-numeric:tabular-nums; }
.h2h-val.win { color:var(--accent); }

/* ── SEGMENTED + PILLS ── */
.seg { display:inline-flex; gap:2px; background:var(--panel); border:1px solid var(--border); border-radius:12px; padding:4px; }
.seg-btn { background:transparent; border:none; padding:8px 15px; border-radius:8px; color:var(--muted); font-size:13px; font-weight:500; cursor:pointer; font-family:inherit; transition:color .15s, background .15s; }
.seg-btn:hover { color:#fff; }
.seg-btn.active { background:#333333; color:#fff; }

.src-row { display:flex; align-items:center; gap:6px; flex-wrap:wrap; margin:14px 0 18px; }
.src {
  background:transparent; border:1px solid var(--border-solid); border-radius:var(--r-btn);
  padding:7px 14px; color:var(--muted); font-size:12.5px; font-weight:500;
  cursor:pointer; font-family:inherit; transition:all 0.15s;
}
.src:hover { color:#fff; }
.src.active { background:#333333; border-color:#333333; color:#fff; }
.src .n { margin-left:6px; font-size:11px; font-weight:700; opacity:.7; }

/* ── FILTER BAR (leads database) ── */
.filter-bar { display:flex; align-items:center; gap:8px; flex-wrap:wrap; margin-bottom:16px; }
.leads-search { flex:1; min-width:190px; background:#0A0A0A; color:var(--text); border:1px solid var(--border-solid); border-radius:var(--r-btn); padding:9px 13px; font-size:13px; font-family:inherit; }
.leads-search::placeholder { color:var(--muted-2); }
.leads-search:focus { outline:none; border-color:#555; }
.f-select {
  background:#0A0A0A; color:var(--text); border:1px solid var(--border-solid); border-radius:var(--r-btn);
  padding:9px 11px; font-size:12.5px; font-weight:500; cursor:pointer; font-family:inherit;
  appearance:none; -webkit-appearance:none;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23888' stroke-width='1.6' fill='none'/%3E%3C/svg%3E");
  background-repeat:no-repeat; background-position:right 10px center; padding-right:28px;
}
.f-select:focus { outline:none; border-color:#555; }
.f-select.on { border-color:#555; color:#fff; }

/* ── LIST / TABLE ROWS ── */
.list-rows { display:flex; flex-direction:column; gap:0; }
.list-row {
  display:grid; align-items:center; gap:14px;
  padding:12px 4px; background:none; border:0; border-top:0.5px solid var(--border); border-radius:0;
}
.list-row:not(.head) { animation:rowIn .45s cubic-bezier(.21,.47,.32,.98) both; }
.list-rows .list-row:nth-child(2) { animation-delay:.03s; } .list-rows .list-row:nth-child(3) { animation-delay:.06s; }
.list-rows .list-row:nth-child(4) { animation-delay:.09s; } .list-rows .list-row:nth-child(5) { animation-delay:.12s; }
.list-rows .list-row:nth-child(6) { animation-delay:.15s; } .list-rows .list-row:nth-child(7) { animation-delay:.18s; }
.list-rows .list-row:nth-child(8) { animation-delay:.21s; } .list-rows .list-row:nth-child(9) { animation-delay:.24s; }
.list-rows .list-row:nth-child(10) { animation-delay:.27s; } .list-rows .list-row:nth-child(11) { animation-delay:.30s; }
.list-rows .list-row:nth-child(12) { animation-delay:.33s; } .list-rows .list-row:nth-child(13) { animation-delay:.36s; }
@keyframes rowIn { from{opacity:0; transform:translateY(10px);} to{opacity:1; transform:none;} }
.list-row:not(.head):hover { background:rgba(120,120,128,0.12); cursor:pointer; }
.list-row.head {
  background:none; border-color:transparent; padding:2px 4px 6px;
  font-size:10.5px; font-weight:600; letter-spacing:1.1px; text-transform:uppercase; color:var(--muted-2);
  box-shadow:none;
}
.list-row.head:hover { cursor:default; }
.lr-biz { font-size:14px; font-weight:600; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.lr-biz .lr-sub { display:block; font-size:11.5px; color:var(--muted); font-weight:400; margin-top:1px; }
.lr-txt { font-size:12.5px; color:var(--muted); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }

.lead-tag { display:inline-block; font-size:11px; font-weight:600; padding:4px 10px; border-radius:var(--r-btn); background:rgba(255,255,255,0.07); color:var(--muted); white-space:nowrap; border:none; }
.lead-tag.acc { background:rgba(77,159,255,0.1); color:var(--accent); }
.lead-tag.good { background:rgba(74,222,128,0.1); color:var(--good); }
.lead-tag.bad { background:rgba(235,87,87,0.1); color:var(--bad); }
.lead-tag.warn { background:rgba(242,201,76,0.1); color:var(--warn); }
.lead-tag.dim { opacity:.75; }
.offer-chip {
  font-size:12px; font-weight:600; padding:5px 11px; border-radius:var(--r-btn);
  background:rgba(255,255,255,0.07); border:none; color:var(--text);
  cursor:pointer; font-family:inherit; white-space:nowrap; transition:background .14s;
}
.offer-chip:hover { background:rgba(255,255,255,0.12); }
.offer-chip:disabled { opacity:.5; cursor:default; }

/* buttons */
.btn-ghost {
  background:#252525; border:1px solid var(--border-solid); border-radius:var(--r-btn);
  padding:8px 14px; color:#fff; font-size:13px; font-weight:500; cursor:pointer; font-family:inherit; transition:background .15s; white-space:nowrap;
}
.btn-ghost:hover { background:#2E2E2E; }
.btn-acc {
  background:#FAFAFA; color:#000; font-weight:600; font-size:13px;
  padding:9px 16px; border-radius:var(--r-btn); border:none;
  cursor:pointer; font-family:inherit; white-space:nowrap;
  transition:background 0.15s, transform 0.15s;
}
.btn-acc:hover { background:#fff; transform:translateY(-1px); }
.btn-acc:disabled { opacity:.55; transform:none; cursor:default; }
.btn-danger { background:transparent; border:1px solid rgba(235,87,87,.4); color:var(--bad); border-radius:var(--r-btn); padding:8px 14px; font-size:12.5px; font-weight:600; cursor:pointer; font-family:inherit; }
.btn-danger:hover { background:rgba(235,87,87,.1); }

/* pager */
.pager { display:flex; align-items:center; gap:6px; flex-wrap:wrap; margin-top:16px; padding-top:14px; border-top:1px solid var(--border-soft); }
.pg-btn { background:transparent; color:var(--muted); border:1px solid var(--border-solid); border-radius:8px; min-width:34px; padding:7px 10px; font-size:12.5px; font-weight:600; cursor:pointer; font-family:inherit; transition:all .12s; }
.pg-btn:hover:not(:disabled):not(.active) { color:#fff; }
.pg-btn.active { background:#FAFAFA; border-color:#FAFAFA; color:#000; }
.pg-btn:disabled { opacity:.4; cursor:default; }
.pg-count { margin-left:auto; font-size:12px; font-weight:500; color:var(--muted); }

/* ── DRAWER (lead card) ── */
.lead-drawer[hidden] { display:none; }
.lead-drawer { position:fixed; inset:0; z-index:120; }
.drawer-scrim { position:absolute; inset:0; background:rgba(0,0,0,.6); }
.drawer-panel { position:absolute; top:0; right:0; height:100%; width:min(500px,94vw); background:#1C1C1E; border-left:0; box-shadow:-12px 0 40px rgba(0,0,0,.5); overflow-y:auto; padding:24px; animation:drawerIn .18s ease; }
@keyframes drawerIn { from{transform:translateX(24px);opacity:.6;} to{transform:none;opacity:1;} }
.drawer-head { display:flex; justify-content:space-between; align-items:flex-start; gap:12px; margin-bottom:6px; }
.drawer-name { font-size:20px; font-weight:700; letter-spacing:-.4px; }
.drawer-sub { font-size:12.5px; color:var(--muted); margin-top:3px; }
.drawer-x { background:#252525; border:1px solid var(--border-solid); color:var(--text); border-radius:8px; width:32px; height:32px; cursor:pointer; font-size:14px; flex-shrink:0; }
.drawer-tags { display:flex; align-items:center; gap:8px; margin:12px 0 18px; flex-wrap:wrap; }
.drawer-sec { margin-bottom:20px; }
.drawer-sec h4 { font-size:11px; font-weight:600; letter-spacing:1px; text-transform:uppercase; color:var(--muted); margin:0 0 10px; }
.drawer-attrs { display:grid; grid-template-columns:1fr 1fr; gap:8px; }
.drawer-attr { font-size:12.5px; display:flex; flex-direction:column; gap:2px; background:var(--card-grad); border:1px solid var(--border-soft); padding:9px 11px; border-radius:var(--r-btn); min-width:0; }
.drawer-attr span { color:var(--muted); font-size:10.5px; text-transform:uppercase; letter-spacing:.3px; font-weight:600; }
.drawer-attr b, .drawer-attr a { font-weight:600; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.drawer-attr a { color:var(--accent); text-decoration:none; }
.drawer-attr a:hover { text-decoration:underline; }

/* D100 pipeline chips */
.pipe { display:flex; align-items:center; gap:5px; flex-wrap:wrap; }
.pipe-step { display:flex; align-items:center; gap:5px; }
.pipe-chip { font-size:11px; font-weight:600; padding:5px 11px; border-radius:var(--r-btn); background:rgba(255,255,255,0.07); border:none; color:var(--muted); cursor:pointer; font-family:inherit; transition:all .14s; }
.pipe-chip:hover { color:#fff; }
.pipe-chip.done { color:var(--accent); background:rgba(77,159,255,0.1); }
.pipe-chip.now { background:#FAFAFA; color:#000; }
.pipe-arrow { color:var(--muted-2); font-size:11px; }

/* interest status picker */
.int-grid { display:flex; flex-wrap:wrap; gap:7px; }
.int-btn {
  font-size:12px; font-weight:600; padding:7px 12px; border-radius:var(--r-btn); cursor:pointer;
  background:rgba(255,255,255,0.07); border:none; color:var(--muted); font-family:inherit; transition:all .14s;
}
.int-btn:hover { color:#fff; }
.int-btn.on { background:rgba(77,159,255,0.12); color:var(--accent); }
.int-btn.on.good { background:rgba(74,222,128,.12); color:var(--good); }
.int-btn.on.bad { background:rgba(235,87,87,.12); color:var(--bad); }

.phase-rows { display:flex; flex-direction:column; gap:8px; }
.phase-row { display:grid; grid-template-columns:96px 1fr auto; gap:12px; align-items:center; background:var(--card-grad); border:1px solid var(--border-soft); border-radius:var(--r-card); padding:10px 13px; }
.phase-chan { font-size:12.5px; font-weight:600; }
.phase-steps { display:flex; gap:4px; }
.phase-dot { width:14px; height:14px; border-radius:4px; background:rgba(255,255,255,0.06); border:1px solid var(--border-soft); }
.phase-dot.on { background:var(--accent); border-color:var(--accent); }
.phase-cur { font-size:11px; font-weight:600; color:var(--muted); white-space:nowrap; }

.empty { color:var(--muted); text-align:center; padding:40px 0; font-size:13px; }
.err-note { color:var(--bad); font-size:13px; font-weight:500; padding:12px 0; }

/* ── LOGIN OVERLAY ── */
.login-overlay[hidden] { display:none; }
.login-overlay { position:fixed; inset:0; z-index:200; display:grid; place-items:center; background:rgba(0,0,0,.92); backdrop-filter:blur(6px); }
.login-card {
  width:min(360px, 92vw); background:var(--panel); border:1px solid var(--border); border-radius:16px;
  padding:32px 30px; display:flex; flex-direction:column; gap:12px; text-align:center;
  box-shadow:0 24px 80px rgba(0,0,0,.6);
}
.login-mark {
  width:48px; height:48px; border-radius:12px; margin:0 auto 4px;
  display:grid; place-items:center; font-weight:800; font-size:15px; color:#FAFAFA;
  background:#333333;
}
.login-card h3 { font-size:17px; font-weight:700; letter-spacing:-.2px; }
.login-msg { font-size:12.5px; color:var(--muted); }
.login-msg.err { color:var(--bad); font-weight:600; }
.login-input {
  background:#0A0A0A; color:var(--text); border:1px solid var(--border-solid); border-radius:var(--r-btn);
  padding:11px 13px; font-size:13.5px; font-family:inherit; text-align:center;
}
.login-input:focus { outline:none; border-color:#555; }
.login-btn { margin-top:2px; }

/* ── TYPE DOTS / STATUS CHIPS (deliverable types) ── */
.type-dot { display:inline-block; width:9px; height:9px; border-radius:3px; margin-right:8px; flex-shrink:0; vertical-align:baseline; }
.type-grid { display:grid; grid-template-columns:repeat(auto-fit, minmax(300px, 1fr)); gap:16px; margin-bottom:16px; }
.type-grid .card { margin-bottom:0; }
.queued-chip {
  display:inline-block; padding:5px 12px; border-radius:999px; font-size:11px; font-weight:600;
  background:rgba(242,201,76,.1); color:var(--warn);
}
.note-txt { font-size:12.5px; color:var(--muted); line-height:1.6; margin-top:12px; padding-top:12px; border-top:1px solid var(--border-soft); }
.bar-track { height:10px; background:var(--panel); border:1px solid var(--border); border-radius:6px; overflow:hidden; margin:4px 0 10px; }
.bar-fill { height:100%; background:var(--good); border-radius:6px; transition:width .5s ease; }
.build-live-head { display:flex; justify-content:space-between; align-items:baseline; font-size:13px; margin-bottom:4px; }
.build-live-head b { color:#fff; }

/* toggle switch */
.toggle {
  position:relative; width:42px; height:23px; border-radius:999px; flex-shrink:0; cursor:pointer;
  background:#252525; border:1px solid var(--border-solid); transition:all .18s; padding:0; font-family:inherit;
}
.toggle::after {
  content:''; position:absolute; top:2px; left:2px; width:17px; height:17px; border-radius:50%;
  background:var(--muted); transition:all .28s cubic-bezier(.34,1.56,.64,1);
}
.toggle.on { background:rgba(74,222,128,0.15); border-color:rgba(74,222,128,0.4); }
.toggle.on::after { left:21px; background:var(--good); }
.toggle:disabled { opacity:.5; cursor:default; }

/* admin forms */
.form-row { display:flex; align-items:center; gap:9px; flex-wrap:wrap; }
.form-input {
  flex:1; min-width:170px; background:#0A0A0A; color:var(--text); border:1px solid var(--border-solid);
  border-radius:var(--r-btn); padding:10px 13px; font-size:13px; font-family:inherit;
}
.form-input::placeholder { color:var(--muted-2); }
.form-input:focus { outline:none; border-color:#555; }
.form-hint { font-size:11.5px; color:var(--muted-2); margin-top:8px; line-height:1.5; }

/* template performance table (N-way) */
.perf-wrap { overflow-x:auto; }
.perf-row { display:grid; gap:12px; align-items:center; padding:11px 14px; background:var(--card-grad); border:1px solid var(--border); border-radius:var(--r-card); margin-bottom:7px; min-width:fit-content; }
.perf-row.head { background:none; border-color:transparent; padding:2px 14px; font-size:10.5px; font-weight:600; letter-spacing:1.1px; text-transform:uppercase; color:var(--muted-2); }
.perf-label { font-size:13px; font-weight:500; color:var(--muted); white-space:nowrap; }
.perf-val { font-size:14px; font-weight:700; text-align:right; font-variant-numeric:tabular-nums; white-space:nowrap; }
.perf-val.win { color:var(--accent); }

/* type deliverables modal (D100 Types -> click a type) */
.type-modal[hidden] { display:none; }
.type-modal { position:fixed; inset:0; z-index:140; display:flex; align-items:center; justify-content:center; }
.type-modal-card { position:relative; width:min(520px,92vw); max-height:84vh; overflow-y:auto; background:var(--panel); border:1px solid var(--border); border-radius:var(--r-panel); padding:22px 22px 20px; box-shadow:0 24px 70px rgba(0,0,0,.6); animation:drawerIn .18s ease; }
.tm-head { display:flex; justify-content:space-between; align-items:flex-start; gap:12px; margin-bottom:4px; }
.tm-title { font-size:17px; font-weight:700; letter-spacing:-.3px; display:flex; align-items:center; gap:8px; }
.tm-sub { font-size:12.5px; color:var(--muted); margin:2px 0 14px; }
.tm-list { display:flex; flex-direction:column; gap:7px; margin-bottom:14px; }
.tm-item { display:flex; align-items:center; justify-content:space-between; gap:10px; padding:11px 13px; background:var(--card-grad); border:1px solid var(--border); border-radius:var(--r-card); font-size:13.5px; font-weight:500; }
.tm-item .tm-x { background:transparent; border:1px solid var(--border-solid); color:var(--muted); border-radius:7px; width:26px; height:26px; cursor:pointer; font-size:13px; line-height:1; flex-shrink:0; }
.tm-item .tm-x:hover { color:var(--text); border-color:#555; }
.tm-add { display:flex; gap:8px; margin-bottom:16px; }
.tm-add .form-input { flex:1; }
.tm-foot { display:flex; justify-content:flex-end; gap:8px; }
.tm-note { font-size:11.5px; color:var(--muted-2); margin-top:10px; }

/* ── API LIMITS / usage cards + alerts ── */
.nav-alert { width:7px; height:7px; border-radius:50%; background:var(--bad); margin-left:auto;  animation:pulse 1.6s ease-in-out infinite; }
.nav-alert[hidden] { display:none; }
@keyframes pulse { 0%,100%{opacity:1;} 50%{opacity:.4;} }
.usage-card { display:flex; flex-direction:column; }
.usage-bar { height:8px; border-radius:99px; background:rgba(255,255,255,0.07); overflow:hidden; margin-top:4px; }
.usage-fill { height:100%; border-radius:99px; background:var(--good); transition:width .6s cubic-bezier(.21,.47,.32,.98); }
.usage-fill.warn { background:var(--warn); }
.usage-fill.crit { background:var(--bad); }
.usage-meta { display:flex; justify-content:space-between; font-size:12px; color:var(--muted); margin-top:7px; font-variant-numeric:tabular-nums; }
.usage-meta .warn { color:var(--warn); font-weight:700; }
.usage-meta .crit { color:var(--bad); font-weight:700; }
.usage-err { font-size:12.5px; color:var(--muted); line-height:1.5; margin-top:6px; }
.usage-link { font-size:11.5px; color:var(--accent); text-decoration:none; margin-top:10px; font-weight:600; }
.usage-link:hover { text-decoration:underline; }
.alert-banner {
  display:block; padding:13px 16px; border-radius:var(--r-card); margin-bottom:12px;
  background:rgba(255,159,10,0.14); border:0; color:var(--warn);
  font-size:13px; line-height:1.5;
}
.alert-banner.crit { background:rgba(255,69,58,0.16); color:var(--bad); }
.alert-banner b { font-weight:700; }

/* ── RESPONSIVE: sidebar becomes a horizontal bar ── */
@media(max-width:900px) {
  .app { flex-direction:column; }
  .sidebar {
    position:static; width:auto; height:auto; margin:12px 12px 0;
    flex-direction:row; align-items:center; gap:8px; padding:8px 10px;
  }
  .sidebar::after { display:none; }
  .ws-chip { padding:0 4px 0 0; }
  .ws-name, .ws-tag { display:none; }
  .side-nav { flex-direction:row; gap:2px; overflow-x:auto; scrollbar-width:none; }
  .side-nav::-webkit-scrollbar { display:none; }
  .nav-item { padding:9px 12px; font-size:13px; }
  .nav-ic { display:none; }
  .side-foot { margin:0 0 0 auto; padding:0; border:none; }
  .side-foot-btn { width:auto; padding:8px 12px; font-size:12px; }
  .side-foot-updated { display:none; }
  .main { padding:16px 12px 60px; }
  .card { padding:18px 16px; }
  .page-title { font-size:21px; }
  .stats-grid { grid-template-columns:1fr 1fr; gap:10px; }
  .stat-value { font-size:21px; }
  .funnel-step { grid-template-columns:84px 1fr 86px; gap:10px; }
  .list-row { padding:10px 13px; gap:10px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration:0.01ms !important; animation-iteration-count:1 !important; transition-duration:0.01ms !important; }
}

/* Evidence tables reuse the dashboard card language. */
.evidence-card { margin-top:16px; }
.evidence-table table { width:100%; border-collapse:collapse; table-layout:fixed; }
.evidence-table th,.evidence-table td { text-align:left; vertical-align:top; padding:12px 8px; border-bottom:1px solid #ffffff18; overflow-wrap:anywhere; font-size:13px; }
.evidence-table th { color:var(--muted,#999); }
.evidence-person { background:none; border:0; padding:0; color:var(--acc,#4d9fff); font:inherit; text-align:left; cursor:pointer; }
.evidence-table p { white-space:pre-wrap; margin:8px 0; }
.evidence-table details { font-size:12px; }
@media(max-width:600px) { .evidence-table th,.evidence-table td { padding:8px 4px; font-size:12px; } }

.outbound-stats { grid-template-columns:repeat(3,minmax(0,1fr)); }

/* Engine uses the existing cards and number tiles with neutral surfaces. */
.engine-board { min-width:0; }
.engine-board .card::before, .engine-board .stat::before { display:none; }
.engine-card h2::before { display:none; }
.engine-card { padding:16px 20px; margin-bottom:12px; }
.engine-card-head { display:flex; align-items:baseline; justify-content:space-between; gap:8px; flex-wrap:wrap; }
.engine-card h2 { margin:0; }
.engine-time { color:var(--muted); font-size:12px; line-height:1.5; }
.engine-say { font-size:clamp(19px,2vw,23px); font-weight:600; line-height:1.35; margin:10px 0 14px; color:var(--text); }
.engine-board .engine-problem { color:var(--bad); }
.engine-metrics { grid-template-columns:repeat(4,minmax(0,1fr)); gap:10px; margin-bottom:0; }
.engine-metrics .stat { min-width:0; padding:10px 12px; }
.engine-metrics .stat-label { font-size:12px; letter-spacing:.35px; line-height:1.4; margin-bottom:6px; }
.engine-metrics .engine-label-long { text-transform:none; letter-spacing:normal; }
.engine-metrics .stat-value { font-size:23px; line-height:1.25; }
.engine-card, .engine-card p, .engine-card li, .engine-card .stat { overflow-wrap:anywhere; }
.engine-card .note-txt, .engine-untracked { color:var(--muted); font-size:13px; line-height:1.5; margin:10px 0 0; }
.engine-details { margin-top:10px; font-size:13px; }
.engine-details summary { cursor:pointer; color:var(--muted); width:fit-content; padding:4px 0; }
.engine-details summary:hover, .engine-details summary:focus-visible { color:var(--text); }
.engine-details[open] > .engine-metrics { margin-top:10px; }
.engine-items { padding-left:18px; margin:10px 0 0; font-size:14px; line-height:1.5; }
.engine-items li + li { margin-top:6px; }
.engine-questions { list-style:none; padding-left:0; }
.engine-questions li.engine-problem { color:var(--text); }
@media(max-width:600px) {
  .engine-card { padding:14px; }
  .engine-metrics { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .engine-metrics .stat-value { font-size:20px; }
}
@media(max-width:600px) { .outbound-stats { grid-template-columns:repeat(2,minmax(0,1fr)); } }

@media(max-width:600px) {
  .type-grid { grid-template-columns:minmax(0,1fr); }
  .engine-table .list-row.head { display:none; }
  .engine-table .list-row:not(.head) { grid-template-columns:repeat(2,minmax(0,1fr)) !important; }
  .engine-table .lr-biz { grid-column:1 / -1; }
  .engine-table [data-label]::before { content:attr(data-label); display:block; font-size:10px; color:var(--muted); }
  .perf-row { min-width:0; grid-template-columns:minmax(0,1.4fr) repeat(var(--perf-count),minmax(0,1fr)) !important; gap:5px; padding:8px 5px; }
  .perf-label,.perf-val { min-width:0; white-space:normal; overflow-wrap:anywhere; font-size:11px; }
  .perf-row.head { padding:4px 5px; letter-spacing:0; }
}
@media(max-width:900px) {
  .sidebar { max-width:calc(100vw - 24px); min-width:0; box-sizing:border-box; }
  .side-nav { min-width:0; flex:1; }
}

/* ── FOLLOW-UPS view (2026-10-21): reuses the list-row cards and stat tiles; rows stack into labelled cards on phones ── */
.fu-room { display:flex; flex-wrap:wrap; gap:6px; margin:0 0 6px; }
.fu-details { margin-top:14px; }
.fu-details > summary { cursor:pointer; font-size:13px; font-weight:600; color:var(--text); padding:6px 0; }
.fu-details > summary .muted { color:var(--muted); font-weight:500; margin-left:4px; }
.fu-stats5 { grid-template-columns:repeat(5,minmax(0,1fr)); }
.fu-rows .list-row { align-items:start; }
.fu-rows .list-row.head { align-items:center; }
.fu-rows .lr-txt { font-size:12.5px; white-space:normal; overflow:visible; text-overflow:clip; min-width:0; }
.fu-rows .lr-sub { display:block; font-size:11.5px; color:var(--muted); font-weight:400; margin-top:2px; overflow-wrap:anywhere; }
.fu-said { white-space:normal; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; color:var(--text); }
.fu-rows .list-row:not(.head):not([data-open]):not([data-thread]):hover { cursor:default; transform:none; box-shadow:none; }
.fu-rows .list-row[data-thread] { cursor:pointer; }
.fu-num { text-align:right; font-variant-numeric:tabular-nums; }
/* thread drawer: the messages and nothing else */
.drawer-panel.th-panel { width:min(640px,100%); padding:0 0 24px; }
.th-panel .drawer-head { position:sticky; top:0; z-index:1; background:#111111; padding:20px 24px 14px; margin:0; border-bottom:1px solid var(--border); }
.th-link { background:none; border:0; padding:0; color:var(--accent); font:inherit; cursor:pointer; }
.th-link:hover { text-decoration:underline; }
.th-list { display:flex; flex-direction:column; gap:14px; padding:18px 24px 0; }
.th-msg { max-width:88%; border-radius:12px; padding:12px 14px; border:1px solid var(--border); background:#1A1A1A; }
.th-in { align-self:flex-start; border-top-left-radius:4px; }
.th-out { align-self:flex-end; background:var(--accent-soft); border-color:var(--accent-border); border-top-right-radius:4px; }
.th-auto { align-self:center; max-width:88%; font-size:12px; color:var(--muted); text-align:center; }
.th-auto > summary { cursor:pointer; list-style:none; }
.th-auto > summary::-webkit-details-marker { display:none; }
.th-auto[open] .th-text { text-align:left; margin-top:8px; padding:10px 12px; border:1px dashed var(--border-solid); border-radius:10px; font-size:13px; color:var(--muted); }
.th-meta { display:flex; justify-content:space-between; gap:12px; font-size:12px; color:var(--muted); margin-bottom:6px; }
.th-meta b { color:var(--text); font-weight:600; }
.th-subj { font-size:12px; color:var(--muted); margin-bottom:6px; }
.th-text { font-size:14px; line-height:1.55; white-space:pre-wrap; overflow-wrap:anywhere; }
@media(max-width:560px) {
  .th-panel .drawer-head { padding:16px 16px 12px; }
  .th-list { padding:14px 12px 0; }
  .th-msg { max-width:94%; }
}
@media(max-width:760px) {
  .fu-stats5 { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .fu-rows .list-row.head { display:none; }
  .fu-rows .list-row { grid-template-columns:1fr !important; gap:6px; }
  .fu-rows .list-row > div[data-label]:not(.lr-biz)::before { content:attr(data-label); display:block; font-size:10px; color:var(--muted); text-transform:uppercase; letter-spacing:.6px; margin-bottom:1px; }
  .fu-held .list-row { grid-template-columns:1fr auto !important; }
  .fu-held .list-row > div::before { display:none !important; }
}

/* Pipeline charts (2026-10-23) */
:root { --pc1:#3987e5; --pc2:#d95926; --pc3:#199e70; --pc4:#c98500; }
.pc-today { display:flex; align-items:center; gap:18px; margin-top:8px; }
.pc-ring { width:110px; height:110px; flex:none; }
.pc-big { font-size:40px; font-weight:800; letter-spacing:-.04em; line-height:1; }
.pc-big small { font-size:15px; font-weight:600; color:var(--muted); letter-spacing:0; margin-left:4px; }
.pc-line { font-size:14px; color:var(--muted); line-height:1.5; margin-top:8px; }
.pc-grid { display:grid; grid-template-columns:minmax(0,1fr); gap:16px; margin-top:16px; align-items:start; }
.pc-grid > .card { min-width:0; overflow-wrap:anywhere; }
@media (min-width:1100px) { .pc-grid { grid-template-columns:minmax(0,1fr) minmax(0,1fr); } }
.pc-svg { width:100%; display:block; margin-top:10px; overflow:visible; }
.pc-svg .pc-lab { fill:var(--text); font-size:13px; }
.pc-svg .pc-val { fill:var(--text); font-size:13px; font-weight:600; }
.pc-svg .pc-ax { fill:var(--muted); font-size:12px; }
.pc-legend { display:flex; flex-wrap:wrap; gap:14px; font-size:13px; color:var(--muted); margin-top:8px; }
.pc-legend i { display:inline-block; width:10px; height:10px; border-radius:3px; margin-right:6px; vertical-align:-1px; }
.pc-tip { position:fixed; pointer-events:none; background:#1d1d1d; border:1px solid #333; border-radius:8px; padding:8px 10px; font-size:13px; line-height:1.4; opacity:0; transition:opacity .1s; z-index:999; }

/* Phone: the five tabs sit in one row under the logo, all visible, no sideways scroll (Arman: "no sideways scrolling on a phone, ever"). */
@media(max-width:600px) {
  .sidebar { flex-wrap:wrap; height:auto; }
  .side-nav { order:3; flex:0 0 100%; justify-content:space-between; overflow:visible; }
  .nav-item { padding:9px 4px; font-size:11.5px; gap:0; }
  .page-title { font-size:28px; }
  .side-legal { display:none; }
}
