/* =====================================================================
   Unico Sales Dashboard — styles
   Brand: yellow #ffd200 · ink #14151a · white
   ===================================================================== */
:root {
  --yellow: #ffd200;
  --yellow-dark: #e6bd00;
  --yellow-soft: #fff8dc;
  --ink: #0f1115;
  --ink-2: #33383f;
  --muted: #7c828c;
  --muted-2: #9aa0aa;
  --line: #e9ecf1;
  --line-2: #dfe3ea;
  --bg: #f3f5f8;
  --card: #ffffff;
  --slate-50: #f7f9fb;
  --danger: #dc2626;
  --danger-bg: #fef2f2;
  --danger-line: #fecaca;
  --warn: #b45309;
  --warn-bg: #fffbeb;
  --warn-line: #fcd77f;
  --success: #059669;
  --success-bg: #ecfdf5;
  --success-line: #a7f3d0;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(15,17,21,.04), 0 4px 16px rgba(15,17,21,.05);
  --shadow-lg: 0 10px 40px rgba(15,17,21,.12);
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { font-family: var(--font); background: var(--bg); color: var(--ink); -webkit-font-smoothing: antialiased; letter-spacing: -0.01em; }
button, input, select, textarea { font-family: inherit; font-size: 14px; }
img { max-width: 100%; }

/* Analytics-console typography helpers */
.eyebrow { font-family: var(--mono); font-size: 11px; font-weight: 600; letter-spacing: .12em;
  text-transform: uppercase; color: var(--muted-2); }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.num-lg { font-family: var(--mono); font-variant-numeric: tabular-nums; font-weight: 700; letter-spacing: -.02em; }

/* View header (eyebrow + title + right context) */
.view-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px;
  padding-bottom: 16px; margin-bottom: 18px; border-bottom: 1px solid var(--line); }
.view-title { margin: 3px 0 0; font-size: 24px; font-weight: 800; letter-spacing: -.02em; }
.view-header-right { font-family: var(--mono); font-size: 13px; color: var(--muted); text-align: right; }
.view-header-right b { color: var(--ink); font-weight: 700; }
@media (max-width: 520px) { .view-title { font-size: 20px; } }

/* ---------- Buttons ---------- */
.btn { border: 1px solid transparent; border-radius: 11px; padding: 11px 18px; font-weight: 600;
  cursor: pointer; background: var(--ink); color: #fff; transition: .15s; line-height: 1; font-size: 14px; }
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.btn.primary { background: var(--ink); color: #fff; }
.btn.primary:hover { background: #000; }
.btn.accent { background: var(--yellow); color: var(--ink); }
.btn.accent:hover { background: var(--yellow-dark); }
.btn.ghost { background: #fff; color: var(--ink); border-color: var(--line-2); }
.btn.ghost:hover { border-color: #cfd3da; }
.btn.danger { background: var(--danger); color: #fff; }
.btn.danger.ghost { background: #fff; color: var(--danger); border-color: #f3c0bb; }
.btn.small { padding: 6px 11px; font-size: 13px; border-radius: 8px; }
.btn.block { width: 100%; padding: 12px; }
.btn:disabled { opacity: .6; cursor: default; transform: none; }
.icon-btn { background: none; border: none; font-size: 18px; cursor: pointer; color: var(--muted); padding: 4px 8px; border-radius: 8px; }
.icon-btn:hover { background: var(--bg); }
.linklike { background: none; border: none; color: var(--muted); cursor: pointer; text-decoration: underline; padding: 4px; }
.spacer { flex: 1; }
.hidden { display: none !important; }
.muted { color: var(--muted); font-size: 13px; }
.row { display: flex; align-items: center; }
.row.gap { gap: 8px; }
.row-between { display: flex; justify-content: space-between; align-items: center; }
.row-end { display: flex; justify-content: flex-end; align-items: center; }
.gap { gap: 10px; }
.center { text-align: center; }

/* ---------- App shell: left sidebar + main ---------- */
.app-shell { display: flex; min-height: 100vh; }
.sidebar { width: 250px; flex: 0 0 250px; background: var(--ink); color: #fff;
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.sidebar-brand { display: flex; align-items: center; gap: 11px; padding: 20px 20px 16px; }
.brand-logo { width: 36px; height: 36px; }
.brand-name { font-weight: 700; font-size: 15px; letter-spacing: -.01em; line-height: 1.2; }
.sidebar-nav { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 3px; padding: 8px 12px; }
.nav-btn { display: flex; align-items: center; gap: 11px; background: transparent; border: none; color: #b9bdc6;
  padding: 11px 13px; border-radius: 11px; cursor: pointer; font-weight: 600; font-size: 14px; text-align: left; width: 100%; transition: .12s; }
.nav-btn:hover { background: rgba(255,255,255,.07); color: #fff; }
.nav-btn.active { background: var(--yellow); color: var(--ink); }
.nav-icon { font-size: 16px; width: 20px; text-align: center; }
.sidebar-foot { padding: 14px; border-top: 1px solid rgba(255,255,255,.09); display: flex; flex-direction: column; gap: 10px; }
.user-card { display: flex; align-items: center; gap: 10px; min-width: 0; }
.user-avatar { width: 36px; height: 36px; flex: 0 0 36px; border-radius: 50%; background: var(--yellow); color: var(--ink);
  display: grid; place-items: center; font-weight: 800; font-size: 14px; }
.user-info { min-width: 0; }
.user-name { font-size: 13.5px; font-weight: 600; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-role { font-family: var(--mono); font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; color: #8b9098; }
.sidebar-foot .btn.ghost { background: rgba(255,255,255,.06); color: #e6e8ec; border-color: rgba(255,255,255,.12); }
.sidebar-foot .btn.ghost:hover { background: rgba(255,255,255,.12); }
.block { width: 100%; justify-content: center; display: flex; }

.main { flex: 1; min-width: 0; }
.view { padding: 24px 28px; max-width: 1360px; margin: 0 auto; }

/* ---------- Auth ---------- */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px; background:
  radial-gradient(1200px 600px at 50% -200px, #fff6cc, var(--bg)); }
.auth-card { background: var(--card); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow);
  padding: 34px 30px; width: 100%; max-width: 400px; text-align: center; }
.auth-logo { width: 64px; height: 64px; margin-bottom: 10px; }
.auth-title { font-size: 22px; margin: 4px 0; }
.auth-sub { color: var(--muted); margin: 0 0 22px; font-size: 14px; }
.auth-step { display: flex; flex-direction: column; gap: 12px; text-align: left; }
.auth-input { width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: 11px; }
.auth-input:focus { outline: 2px solid var(--yellow); border-color: var(--yellow); }
.otp { letter-spacing: 8px; font-size: 20px; text-align: center; font-weight: 700; }
.auth-hint, .auth-sent { font-size: 12.5px; color: var(--muted); margin: 4px 0 0; }
.auth-sent b { color: var(--ink); }
.field-label { font-size: 12.5px; font-weight: 600; color: var(--ink-2); }

/* ---------- Panels / cards ---------- */
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px 22px; box-shadow: var(--shadow); margin-bottom: 16px; }
.panel-title { margin: 0 0 16px; font-family: var(--mono); font-size: 12px; font-weight: 600;
  letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }

/* ---------- Filter bars ---------- */
.filter-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 18px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.filter-bar > .eyebrow { margin-right: 4px; }
.board-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 16px; }
.search { padding: 10px 12px; border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: var(--slate-50); min-width: 120px; color: var(--ink); }
.search:focus { outline: none; border-color: var(--yellow); background: #fff; box-shadow: 0 0 0 3px rgba(255,210,0,.25); }
select.search { appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2 4l4 4 4-4' stroke='%237c828c' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px; }
.inline-field { display: flex; flex-direction: column; gap: 4px; }
.inline-field > span { font-family: var(--mono); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted-2); font-weight: 600; }
.metric-list { display: flex; flex-direction: column; }
.metric-list-row { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.metric-list-row:last-child { border-bottom: none; }
.metric-list-row b { font-family: var(--mono); font-variant-numeric: tabular-nums; color: var(--success); }

/* ---------- Kanban board ---------- */
.board { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 12px; align-items: flex-start; }
.column { background: #eef0f3; border-radius: var(--radius); width: 270px; flex: 0 0 270px; display: flex; flex-direction: column; max-height: calc(100vh - 200px); }
.column-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 12px 6px; }
.col-title { font-weight: 700; font-size: 13.5px; }
.col-count { background: #fff; border-radius: 20px; padding: 1px 9px; font-size: 12px; font-weight: 700; color: var(--muted); }
.col-sub { padding: 0 12px 6px; font-size: 12px; color: var(--success); font-weight: 700; }
.column-body { padding: 6px 10px 12px; overflow-y: auto; flex: 1; min-height: 40px; display: flex; flex-direction: column; gap: 9px; }
.lead-card { background: #fff; border: 1px solid var(--line); border-radius: 11px; padding: 11px 12px; cursor: pointer;
  box-shadow: 0 1px 2px rgba(16,18,25,.05); transition: .12s; }
.lead-card:hover { border-color: var(--yellow); transform: translateY(-1px); }
.lead-card.leak { border-left: 4px solid var(--danger); }
.lc-name { font-weight: 700; font-size: 14px; }
.lc-company { font-size: 12.5px; color: var(--muted); margin-top: 1px; }
.lc-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; align-items: center; }
.lc-value { font-weight: 700; color: var(--success); font-size: 13px; }
.chip { font-size: 11px; background: #f0f1f4; color: var(--ink-2); padding: 2px 8px; border-radius: 20px; font-weight: 600; }
.chip.subtle { background: transparent; border: 1px solid var(--line); color: var(--muted); }
.lc-reps { font-size: 11.5px; color: var(--muted); margin-top: 7px; }
.lc-flags { display: flex; flex-direction: column; gap: 3px; margin-top: 8px; }
.flag { font-size: 11px; color: var(--danger); background: var(--danger-bg); padding: 2px 7px; border-radius: 6px; font-weight: 600; }
.drag-ghost { opacity: .4; }

/* ---------- Modal ---------- */
.modal-overlay { position: fixed; inset: 0; background: rgba(16,18,25,.5); display: grid; place-items: center;
  z-index: 50; padding: 16px; overflow-y: auto; }
.modal { background: #fff; border-radius: 20px; width: 100%; max-width: 480px; box-shadow: var(--shadow-lg); max-height: 92vh; display: flex; flex-direction: column; }
.modal.wide { max-width: 760px; }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; padding: 22px 24px 16px; }
.modal-head h3 { margin: 0; font-size: 26px; font-weight: 800; letter-spacing: -.02em; }
.modal-sub { font-family: var(--mono); font-size: 12px; color: var(--muted); margin-top: 4px; }
.modal-body { padding: 8px 24px 24px; overflow-y: auto; }
.modal-footer { position: sticky; bottom: 0; display: flex; align-items: center; gap: 10px;
  padding: 16px 24px; margin: 8px -24px -24px; background: rgba(255,255,255,.9);
  backdrop-filter: blur(6px); border-top: 1px solid var(--line); }
.confirm-msg { margin: 0 0 18px; line-height: 1.5; }

/* ---------- Right-side drawer (slide-in edit panel) ---------- */
.drawer-overlay { position: fixed; inset: 0; background: rgba(15,17,21,.42); z-index: 60;
  opacity: 0; transition: opacity .25s ease; }
.drawer-overlay.open { opacity: 1; }
.drawer { position: absolute; top: 0; right: 0; height: 100%; width: min(620px, 100%); background: #fff;
  box-shadow: var(--shadow-lg); display: flex; flex-direction: column;
  transform: translateX(100%); transition: transform .3s cubic-bezier(.4,0,.2,1); }
.drawer-overlay.open .drawer { transform: translateX(0); }
.drawer-head { display: flex; align-items: flex-start; justify-content: space-between; padding: 22px 24px 16px; border-bottom: 1px solid var(--line); }
.drawer-head h3 { margin: 0; font-size: 22px; font-weight: 800; letter-spacing: -.02em; }
.drawer-body { padding: 20px 24px 24px; overflow-y: auto; flex: 1; }

/* ---------- Lead form ---------- */
.form-section { margin-bottom: 22px; }
.form-section-title { margin: 0 0 12px; font-family: var(--mono); font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .12em; color: var(--muted-2); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field.wide { grid-column: 1 / -1; }
.field-label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.field-hint { font-family: var(--mono); font-size: 11px; color: var(--muted); }
.field input, .field select, .field textarea, .activity-form input {
  padding: 12px 13px; border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  background: var(--slate-50); width: 100%; color: var(--ink); transition: .15s; }
.field input::placeholder, .field textarea::placeholder { color: var(--muted-2); font-family: var(--mono); font-size: 13px; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--yellow); background: #fff; box-shadow: 0 0 0 3px rgba(255,210,0,.25); }
.field select { appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2 4l4 4 4-4' stroke='%237c828c' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 13px center; padding-right: 34px; }

/* iOS-style toggle row (Offer Made) */
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 12px;
  grid-column: 1 / -1; background: var(--slate-50); border: 1px solid var(--line-2);
  border-radius: var(--radius-sm); padding: 12px 14px; }
.toggle-title { font-weight: 600; font-size: 14px; }
.toggle-sub { font-family: var(--mono); font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.switch { position: relative; width: 46px; height: 26px; flex: 0 0 auto; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.slider { position: absolute; inset: 0; background: #cbd2dc; border-radius: 20px; transition: .2s; cursor: pointer; }
.slider::before { content: ""; position: absolute; height: 20px; width: 20px; left: 3px; top: 3px;
  background: #fff; border-radius: 50%; transition: .2s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.switch input:checked + .slider { background: var(--yellow); }
.switch input:checked + .slider::before { transform: translateX(20px); }

/* AUTO EARNINGS band (dark) */
.earn-band { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between;
  gap: 12px; background: var(--ink); color: #fff; border-radius: 12px; padding: 16px 18px; }
.earn-band-label { font-family: var(--mono); font-size: 11px; letter-spacing: .1em; color: var(--muted-2); }
.earn-band-formula { font-family: var(--mono); font-size: 12px; color: #c9cdd4; margin-top: 3px; }
.earn-band-value { font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: 28px; font-weight: 700; color: var(--yellow); }

/* ---------- Tables ---------- */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.log-count { font-size: 12px; color: var(--muted); margin-bottom: 8px; }
table { border-collapse: collapse; width: 100%; font-size: 13px; }
.log-table th, .metric-table th { text-align: left; padding: 11px 12px; border-bottom: 1px solid var(--line-2);
  cursor: pointer; white-space: nowrap; color: var(--muted); position: sticky; top: 0; background: #fff;
  font-family: var(--mono); font-size: 10.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.metric-table th { cursor: default; }
.log-table td, .metric-table td { padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.metric-table tbody tr:first-child td { font-weight: 500; }
.log-table tbody tr { cursor: pointer; }
.log-table tbody tr:hover { background: var(--yellow-soft); }
.num { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; }
.leak-row { background: var(--danger-bg); }
.leak-row:hover { background: #fde3e0 !important; }

/* ---------- KPI / money cards ---------- */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; }
.kpi { position: relative; background: var(--slate-50); border: 1px solid var(--line); border-radius: 14px; padding: 16px; }
.kpi-icon { position: absolute; top: 14px; right: 14px; font-size: 15px; opacity: .5; }
.kpi-label { font-family: var(--mono); font-size: 10.5px; font-weight: 600; letter-spacing: .08em;
  text-transform: uppercase; color: var(--muted); }
.kpi-val { font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: 23px;
  font-weight: 700; letter-spacing: -.02em; margin-top: 8px; }
.kpi.warn { background: var(--warn-bg); border-color: var(--warn-line); }
.kpi.warn .kpi-val { color: var(--warn); }
.kpi.danger { background: var(--danger-bg); border-color: var(--danger-line); }
.kpi.danger .kpi-val { color: var(--danger); }
.kpi.filled { background: var(--ink); border-color: var(--ink); }
.kpi.filled .kpi-label { color: var(--muted-2); }
.kpi.filled .kpi-val { color: #fff; }
.kpi.accent { background: var(--yellow-soft); border-color: var(--warn-line); }

/* ---------- Goal bar ---------- */
.goal-row { margin-top: 16px; }
.goal-head { display: flex; justify-content: space-between; align-items: baseline; font-size: 14px; margin-bottom: 8px; }
.goal-head .num-lg { font-size: 22px; }
.goal-head .goal-target { font-family: var(--mono); color: var(--muted-2); font-size: 15px; }
.goal-bar { height: 12px; background: #eaedf1; border-radius: 20px; overflow: hidden; }
.goal-fill { height: 100%; background: linear-gradient(90deg, var(--yellow), var(--yellow-dark)); border-radius: 20px; transition: width .5s; }
.goal-pct { font-family: var(--mono); font-size: 12px; color: var(--muted); margin-top: 8px; }
.goal-currency { font-size: 18px; font-weight: 700; }
.goal-set { display: flex; align-items: center; gap: 8px; }
.goal-set input { width: 150px; font-family: var(--mono); }

/* ---------- Charts ---------- */
.chart-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.chart-box { position: relative; height: 260px; }

/* ---------- Projection ---------- */
.assume-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.assume-field { display: flex; flex-direction: column; gap: 7px; }
.assume-field > span { font-family: var(--mono); font-size: 10.5px; font-weight: 600; letter-spacing: .08em;
  text-transform: uppercase; color: var(--muted); }
.assume-input, .assume-ro { padding: 12px 13px; border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  background: var(--slate-50); font-family: var(--mono); font-variant-numeric: tabular-nums; font-weight: 700; font-size: 18px; }
.assume-input:focus { outline: none; border-color: var(--yellow); background: #fff; box-shadow: 0 0 0 3px rgba(255,210,0,.25); }
.assume-ro { color: var(--muted); }

.scenario-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.scenario { border-radius: 16px; padding: 20px; border: 1.5px solid var(--line); background: var(--slate-50); }
.scenario.expected { border-color: var(--line-2); background: #fff; box-shadow: var(--shadow); }
.scenario.worst { border-color: var(--danger-line); background: var(--danger-bg); }
.scenario.best { border-color: var(--success-line); background: var(--success-bg); }
.scen-head { display: flex; align-items: center; justify-content: space-between; }
.scen-title { font-family: var(--mono); font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.scen-icon { font-size: 16px; }
.scenario.worst .scen-icon { color: var(--danger); }
.scenario.best .scen-icon { color: var(--success); }
.scen-rev { font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: 30px; font-weight: 700; letter-spacing: -.02em; margin: 14px 0 2px; }
.scenario.worst .scen-rev { color: var(--danger); }
.scenario.best .scen-rev { color: var(--success); }
.scen-label { font-family: var(--mono); font-size: 11px; color: var(--muted); }
.scen-rows { margin-top: 14px; border-top: 1px solid rgba(0,0,0,.06); padding-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.scen-line { display: flex; justify-content: space-between; align-items: center; font-size: 13px; }
.scen-line span { color: var(--muted); }
.scen-line b { font-family: var(--mono); font-variant-numeric: tabular-nums; font-weight: 700; }

/* Dark summary band */
.dark-band { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; background: var(--ink);
  border-radius: var(--radius); padding: 22px 24px; margin-bottom: 16px; }
.dark-metric-label { font-family: var(--mono); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted-2); }
.dark-metric-val { font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: 30px; font-weight: 700; margin: 8px 0 4px; letter-spacing: -.02em; }
.dark-metric-sub { font-size: 12px; color: #9aa0aa; }
.dark-metric.white .dark-metric-val { color: #fff; }
.dark-metric.blue .dark-metric-val { color: #60a5fa; }
.dark-metric.green .dark-metric-val { color: #34d399; }

/* Formula panel */
.formula { font-family: var(--mono); font-size: 14px; line-height: 1.9; color: var(--ink-2); }
.formula .op { color: var(--muted-2); }
.formula-note { font-family: var(--font); font-size: 12.5px; color: var(--muted); margin-top: 10px; }
@media (max-width: 820px) { .dark-band { grid-template-columns: 1fr; gap: 16px; } }

/* ---------- Admin ---------- */
.cell-input { padding: 6px 8px; border: 1px solid var(--line); border-radius: 7px; width: 100%; min-width: 80px; }
.admin-table td { vertical-align: middle; }

/* ---------- Toast ---------- */
#toast { position: fixed; bottom: 22px; left: 50%; transform: translate(-50%, 20px); background: var(--ink); color: #fff;
  padding: 12px 20px; border-radius: 12px; font-weight: 600; font-size: 14px; opacity: 0; pointer-events: none;
  transition: .25s; z-index: 100; box-shadow: var(--shadow); max-width: 90vw; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast.success { background: var(--success); }
#toast.error { background: var(--danger); }
#toast.info { background: var(--ink); }

/* ---------- Loading / fallback ---------- */
.center-screen { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; text-align: center; padding: 24px; }
.spin-logo { width: 54px; height: 54px; animation: spin 1.4s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.err { background: #fff; border: 1px solid var(--line); padding: 10px; border-radius: 8px; font-size: 12px; max-width: 90vw; overflow: auto; }

/* ---------- Responsive ---------- */
@media (max-width: 820px) {
  .chart-row { grid-template-columns: 1fr; }
  .scenario-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .view { padding: 14px; }
  .drawer { width: 100%; }
  /* Sidebar collapses into a top bar */
  .app-shell { flex-direction: column; }
  .sidebar { width: 100%; flex: 0 0 auto; height: auto; flex-direction: row; align-items: center;
    gap: 6px; padding: 8px 12px; z-index: 30; }
  .sidebar-brand { padding: 0; }
  .brand-name { display: none; }
  .sidebar-nav { flex: 1; flex-direction: row; overflow-x: auto; padding: 0; gap: 4px; }
  .nav-btn { padding: 9px 12px; white-space: nowrap; }
  .nav-label { display: none; }
  .nav-icon { font-size: 18px; }
  .sidebar-foot { flex-direction: row; align-items: center; border: none; padding: 0; margin-left: auto; gap: 8px; }
  .user-card { display: none; }
  .sidebar-foot .btn { padding: 8px 12px; }
}
@media (max-width: 520px) {
  .kpi-grid, .assume-grid { grid-template-columns: 1fr 1fr; }
  .kpi-val { font-size: 18px; }
}
