:root {
  --bg: #0b1220; --bg2: #101a2c; --panel: #141f33; --panel2: #1a2740; --line: #24334d; --line2: #2f405e;
  --text: #e8eef8; --muted: #8d9bb5; --dim: #5f6d87;
  --accent: #06b7b0; --accent2: #22d3cc; --accent-dim: rgba(6, 183, 176, 0.14);
  --green: #34d399; --amber: #fbbf24; --red: #f87171; --blue: #60a5fa; --purple: #a78bfa;
  --radius: 12px;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: Manrope, system-ui, sans-serif; font-size: 14px; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
#app { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.side { background: var(--bg2); border-right: 1px solid var(--line); padding: 18px 14px; display: flex; flex-direction: column; gap: 10px; position: sticky; top: 0; height: 100vh; }
.logo img { width: 160px; display: block; margin: 4px 6px 0; }
.side-sub { color: var(--muted); font-weight: 700; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; padding: 4px 6px 8px; display: flex; gap: 8px; align-items: center; }
nav a { display: flex; align-items: center; justify-content: space-between; padding: 9px 10px; border-radius: 9px; color: var(--muted); font-weight: 600; margin-bottom: 2px; }
nav a:hover { background: var(--panel); color: var(--text); }
nav a.active { background: var(--accent-dim); color: var(--accent2); }
nav a .cnt { background: var(--line2); color: var(--text); font-size: 11px; font-weight: 800; padding: 2px 7px; border-radius: 99px; }
nav a.active .cnt, nav a .cnt.hot { background: var(--accent); color: #04221f; }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 6px; }
.main { min-width: 0; }
.top { display: flex; gap: 14px; align-items: center; padding: 14px 24px; border-bottom: 1px solid var(--line); background: var(--bg); position: sticky; top: 0; z-index: 5; }
.top input { flex: 1; max-width: 560px; background: var(--panel); border: 1px solid var(--line); color: var(--text); padding: 9px 12px; border-radius: 9px; outline: none; }
.top input:focus { border-color: var(--accent); }
.top-right { margin-left: auto; color: var(--muted); font-weight: 600; }
#view { padding: 22px 24px 60px; }
h1 { font-size: 22px; margin: 0 0 4px; font-weight: 800; }
h2 { font-size: 15px; margin: 0 0 10px; font-weight: 800; letter-spacing: .01em; }
h2 .sub, .sub { color: var(--muted); font-weight: 600; font-size: 12px; }
.lede { color: var(--muted); margin: 0 0 18px; }
.pill { display: inline-block; padding: 3px 9px; border-radius: 99px; font-size: 11px; font-weight: 800; letter-spacing: .02em; background: var(--line2); color: var(--text); white-space: nowrap; }
.pill.demo { background: var(--accent-dim); color: var(--accent2); }
.pill.new { background: rgba(96,165,250,.18); color: var(--blue); }
.pill.submitted { background: rgba(167,139,250,.18); color: var(--purple); }
.pill.accepted { background: rgba(52,211,153,.16); color: var(--green); }
.pill.awaiting_info { background: rgba(251,191,36,.16); color: var(--amber); }
.pill.action { background: var(--accent); color: #04221f; }
.pill.payout_pending { background: rgba(34,211,204,.18); color: var(--accent2); }
.pill.paid { background: rgba(52,211,153,.28); color: #a7f3d0; }
.pill.declined { background: rgba(248,113,113,.16); color: var(--red); }
.pill.cat { background: var(--panel2); color: var(--muted); }
.grid { display: grid; gap: 14px; }
.kpis { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin-bottom: 18px; }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.kpi .v { font-size: 26px; font-weight: 800; line-height: 1.1; }
.kpi .l { color: var(--muted); font-weight: 600; font-size: 12px; margin-top: 4px; }
.kpi .d { font-size: 12px; margin-top: 6px; font-weight: 700; }
.kpi.hot { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim); }
.up { color: var(--green); } .down { color: var(--red); } .warn { color: var(--amber); } .ok { color: var(--green); } .bad { color: var(--red); }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.cols2 { grid-template-columns: 1.4fr 1fr; } .cols3 { grid-template-columns: repeat(3, 1fr); } .cols-eq { grid-template-columns: 1fr 1fr; }
@media (max-width: 1100px) { .cols2, .cols3, .cols-eq { grid-template-columns: 1fr; } }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; padding: 8px 10px; border-bottom: 1px solid var(--line); font-weight: 800; }
td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr.row:hover td { background: var(--panel2); cursor: pointer; }
td .main-txt { font-weight: 700; } td .sub-txt { color: var(--muted); font-size: 12px; margin-top: 2px; }
.num { text-align: right; font-variant-numeric: tabular-nums; } th.num { text-align: right; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
.reg { display: inline-block; background: #f7d53c; color: #111; font-weight: 800; padding: 1px 7px; border-radius: 4px; font-family: ui-monospace, Menlo, monospace; font-size: 12px; letter-spacing: .04em; }
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(190px, 1fr); gap: 10px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 18px; }
.col { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; min-height: 90px; }
.col.hot { border-color: var(--accent); }
.col .ch { display: flex; justify-content: space-between; align-items: baseline; font-weight: 800; font-size: 12px; }
.col .ch .n { font-size: 22px; } .col .cv { color: var(--muted); font-size: 12px; margin-top: 2px; font-weight: 600; }
.col .hint { color: var(--dim); font-size: 11px; margin-top: 8px; line-height: 1.35; }
.list { display: flex; flex-direction: column; }
.item { display: grid; grid-template-columns: 1fr auto; gap: 10px; padding: 10px 6px; border-bottom: 1px solid var(--line); align-items: center; border-radius: 8px; }
.item:hover { background: var(--panel2); cursor: pointer; }
.item .t { font-weight: 700; } .item .s { color: var(--muted); font-size: 12px; margin-top: 2px; }
.btn { background: var(--accent); color: #04221f; border: 0; padding: 9px 14px; border-radius: 9px; font-weight: 800; cursor: pointer; }
.btn:hover { background: var(--accent2); }
.btn.ghost { background: transparent; border: 1px solid var(--line2); color: var(--text); }
.btn.ghost:hover { border-color: var(--accent); color: var(--accent2); background: transparent; }
.btn.small { padding: 7px 10px; font-size: 12px; } .btn.muted { color: var(--muted); } .btn.danger { background: rgba(248,113,113,.16); color: var(--red); border: 1px solid transparent; }
.btn.danger:hover { background: rgba(248,113,113,.3); }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 14px; flex-wrap: wrap; }
.tabs button { background: none; border: 0; color: var(--muted); font-weight: 700; padding: 10px 12px; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs button.active { color: var(--accent2); border-color: var(--accent); }
.tabs button .cnt { color: var(--dim); margin-left: 6px; }
.dealers-cat { margin-bottom: 22px; }
.dealers-cat h2 { display: flex; align-items: center; gap: 10px; }
.dcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; }
.dcard { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; display: block; }
.dcard:hover { border-color: var(--accent); }
.dcard .n { font-weight: 800; font-size: 15px; } .dcard .m { color: var(--muted); font-size: 12px; margin: 2px 0 10px; }
.dcard .stats { display: flex; gap: 12px; flex-wrap: wrap; } .dcard .stats div { font-size: 12px; color: var(--muted); } .dcard .stats b { color: var(--text); font-size: 14px; display: block; }
.dcard .flag { margin-top: 10px; }
.check { display: flex; flex-direction: column; gap: 6px; }
.check .c { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 9px; background: var(--bg2); border: 1px solid var(--line); }
.check .c.in { border-color: rgba(52,211,153,.4); } .check .c.out { border-color: rgba(251,191,36,.35); }
.check .ico { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 12px; background: var(--line2); color: var(--muted); }
.check .c.in .ico { background: var(--green); color: #052e22; } .check .c.out .ico { background: rgba(251,191,36,.25); color: var(--amber); }
.check .c .nm { font-weight: 700; flex: 1; } .check .c .meta { color: var(--muted); font-size: 12px; }
.timeline { display: flex; flex-direction: column; gap: 0; }
.tl { display: grid; grid-template-columns: 110px 1fr; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.tl .when { color: var(--dim); font-size: 12px; font-variant-numeric: tabular-nums; }
.tl .what { font-weight: 600; } .tl.stage .what { color: var(--accent2); } .tl.doc .what { color: var(--green); } .tl.email .what { color: var(--blue); }
.mail { padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 8px; background: var(--bg2); }
.mail.out { border-style: dashed; } .mail .h { display: flex; justify-content: space-between; gap: 10px; font-weight: 700; } .mail .h .when { color: var(--dim); font-weight: 600; font-size: 12px; }
.mail .b { color: var(--muted); font-size: 13px; margin-top: 4px; } .mail .att { margin-top: 6px; display: flex; gap: 6px; flex-wrap: wrap; }
.att span { background: var(--panel2); border: 1px solid var(--line2); border-radius: 6px; padding: 2px 8px; font-size: 11px; font-weight: 700; }
.att span.cls { border-color: rgba(52,211,153,.4); color: var(--green); }
.match { font-size: 11px; color: var(--dim); font-weight: 700; }
.hidden { display: none !important; }
.modal { position: fixed; inset: 0; background: rgba(4, 9, 20, .72); display: grid; place-items: center; z-index: 50; padding: 20px; }
.modal .box { background: var(--panel); border: 1px solid var(--line2); border-radius: 14px; padding: 22px; width: min(620px, 100%); }
.modal label { display: block; color: var(--muted); font-size: 12px; font-weight: 700; margin: 10px 0 4px; }
.modal input, .modal textarea, .modal select { width: 100%; background: var(--bg2); border: 1px solid var(--line); color: var(--text); border-radius: 9px; padding: 9px 11px; outline: none; }
.modal input:focus, .modal textarea:focus { border-color: var(--accent); }
.modal .foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: var(--panel2); border: 1px solid var(--accent); color: var(--text); padding: 12px 18px; border-radius: 10px; font-weight: 700; z-index: 60; box-shadow: 0 10px 40px rgba(0,0,0,.4); max-width: 640px; }
.bars { display: flex; align-items: flex-end; gap: 6px; height: 70px; margin-top: 8px; }
.bars .bar { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; height: 100%; }
.bars .bar i { display: block; width: 100%; background: var(--accent); border-radius: 4px 4px 0 0; opacity: .85; }
.bars .bar i.dec { background: var(--red); } .bars .bar span { color: var(--dim); font-size: 10px; }
.meter { height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; } .meter i { display: block; height: 100%; background: var(--accent); }
.deal-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; flex-wrap: wrap; margin-bottom: 16px; }
.deal-head .title { font-size: 22px; font-weight: 800; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.fact { background: var(--bg2); border: 1px solid var(--line); border-radius: 9px; padding: 10px 12px; }
.fact .k { color: var(--dim); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; } .fact .v { font-weight: 700; margin-top: 2px; }
.empty { color: var(--dim); padding: 18px 6px; text-align: center; font-weight: 600; }
.intro-banner { background: linear-gradient(90deg, var(--accent-dim), transparent); border: 1px solid var(--accent); border-radius: var(--radius); padding: 12px 16px; margin-bottom: 18px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.filters button { background: var(--panel); border: 1px solid var(--line); color: var(--muted); padding: 6px 10px; border-radius: 99px; font-weight: 700; font-size: 12px; cursor: pointer; }
.filters button.active { border-color: var(--accent); color: var(--accent2); background: var(--accent-dim); }
.feature { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; } .feature h3 { margin: 0 0 4px; font-size: 14px; } .feature p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.45; }
.ideas { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }

/* ---- quoting, help, how-it-works ---- */
.how { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 18px; }
.how .hh { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; }
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 8px; }
.step { background: var(--bg2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; position: relative; }
.step .n { width: 22px; height: 22px; border-radius: 50%; background: var(--accent); color: #04221f; font-weight: 800; display: grid; place-items: center; font-size: 12px; margin-bottom: 6px; }
.step b { display: block; margin-bottom: 2px; } .step span { color: var(--muted); font-size: 12px; line-height: 1.35; }
.cta-row { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.cta { flex: 1; min-width: 220px; background: linear-gradient(135deg, var(--accent-dim), var(--panel)); border: 1px solid var(--accent); border-radius: var(--radius); padding: 16px; display: block; }
.cta:hover { background: var(--accent-dim); } .cta b { font-size: 16px; display: block; } .cta span { color: var(--muted); font-size: 12px; }
.qform { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.qform label { display: block; color: var(--muted); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 4px; }
.qform input, .qform select { width: 100%; background: var(--bg2); border: 1px solid var(--line); color: var(--text); border-radius: 9px; padding: 9px 11px; outline: none; font-weight: 700; }
.qform input:focus, .qform select:focus { border-color: var(--accent); }
.qform .full { grid-column: 1 / -1; }
.seg { display: flex; gap: 4px; background: var(--bg2); border: 1px solid var(--line); border-radius: 9px; padding: 3px; }
.seg button { flex: 1; background: none; border: 0; color: var(--muted); font-weight: 800; padding: 7px 4px; border-radius: 7px; cursor: pointer; font-size: 12px; }
.seg button.active { background: var(--accent); color: #04221f; }
.qsummary { display: flex; gap: 14px; flex-wrap: wrap; color: var(--muted); font-size: 12px; margin: 10px 0 0; } .qsummary b { color: var(--text); font-size: 15px; display: block; }
.quote-row td { vertical-align: middle; } .quote-row .m { font-size: 18px; font-weight: 800; } .quote-row .m small { color: var(--muted); font-size: 11px; font-weight: 700; }
.quote-row.best td { background: var(--accent-dim); } .quote-row.best td:first-child { border-left: 3px solid var(--accent); }
.excl { color: var(--muted); font-size: 12px; display: grid; grid-template-columns: 1fr auto 1.4fr; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.excl b { color: var(--text); }
.rep { color: var(--dim); font-size: 11px; line-height: 1.4; margin-top: 12px; }
.tip { border-bottom: 1px dotted var(--muted); cursor: help; }
.glossary .g { display: grid; grid-template-columns: 220px 1fr; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.glossary .g p { margin: 0; color: var(--muted); }
.faq details { border-bottom: 1px solid var(--line); padding: 10px 0; } .faq summary { font-weight: 700; cursor: pointer; } .faq p { color: var(--muted); margin: 8px 0 0; }
.upd { display: grid; grid-template-columns: 120px 1fr; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); align-items: start; }
.upd .w { color: var(--dim); font-size: 12px; } .upd .t a { font-weight: 800; }
@media (max-width: 800px) { .qform { grid-template-columns: 1fr; } .glossary .g { grid-template-columns: 1fr; } }
.quote-row td:first-child { white-space: nowrap; }
@media (max-width: 1100px) { #view .grid[style*="1.7fr"] { grid-template-columns: 1fr !important; } }

/* ---- deal file ---- */
.drop { border: 2px dashed var(--line2); border-radius: 12px; padding: 18px; text-align: center; color: var(--muted); font-weight: 700; cursor: pointer; transition: all .15s; margin-bottom: 12px; }
.drop:hover, .drop.over { border-color: var(--accent); background: var(--accent-dim); color: var(--accent2); }
.drop small { display: block; font-weight: 600; color: var(--dim); margin-top: 4px; }
.frow { display: grid; grid-template-columns: 34px 1fr auto; gap: 10px; align-items: center; padding: 8px 6px; border-bottom: 1px solid var(--line); }
.frow:hover { background: var(--panel2); border-radius: 8px; }
.frow .fi { width: 34px; height: 40px; border-radius: 6px; background: var(--line2); display: grid; place-items: center; font-size: 10px; font-weight: 800; color: var(--text); letter-spacing: .04em; }
.frow .fi.pdf { background: #b91c1c; } .frow .fi.img { background: #2563eb; } .frow .fi.doc { background: #1d4ed8; } .frow .fi.xls { background: #15803d; }
.frow .fn { font-weight: 700; word-break: break-all; } .frow .fm { color: var(--muted); font-size: 12px; margin-top: 2px; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.frow select { background: var(--bg2); border: 1px solid var(--line); color: var(--text); border-radius: 6px; padding: 2px 6px; font-size: 12px; font-weight: 700; }
.frow .fa { display: flex; gap: 6px; }
.pill.dup { background: rgba(251,191,36,.16); color: var(--amber); }
.modal .box.wide { width: min(1100px, 100%); height: min(88vh, 900px); display: flex; flex-direction: column; }
.modal .box.wide iframe, .modal .box.wide img { flex: 1; width: 100%; border: 0; border-radius: 8px; background: #fff; object-fit: contain; min-height: 0; }
.modal .box.wide .ph { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; }
.sr-group h2 { margin-top: 18px; }
.progress { color: var(--accent2); font-weight: 700; font-size: 12px; margin-bottom: 8px; }
.pv { flex: 1; overflow: auto; background: #2a2f3a; border-radius: 8px; padding: 12px; display: flex; flex-direction: column; align-items: center; gap: 12px; min-height: 0; }
.pv canvas.page { background: #fff; box-shadow: 0 6px 24px rgba(0,0,0,.45); max-width: 100%; }
.pv img { max-width: 100%; max-height: 100%; object-fit: contain; }

/* ---- phone & tablet ---- */
.menu-btn { display: none; }
@media (max-width: 900px) {
  #app { grid-template-columns: 1fr; }
  .side { position: sticky; top: 0; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 14px; z-index: 20; border-right: 0; border-bottom: 1px solid var(--line); }
  .logo img { width: 120px; margin: 0; }
  .side-sub { display: none; }
  .menu-btn { display: block; margin-left: auto; background: var(--panel); border: 1px solid var(--line2); color: var(--text); border-radius: 8px; padding: 6px 10px; font-size: 16px; cursor: pointer; }
  nav#nav, .side-foot { display: none; width: 100%; }
  body.menu-open nav#nav, body.menu-open .side-foot { display: flex; flex-direction: column; }
  nav#nav a { padding: 10px 12px; }
  .top { padding: 10px 14px; } .top-right { display: none; }
  #view { padding: 14px 14px 60px; }
  h1 { font-size: 19px; }
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .kpi .v { font-size: 22px; }
  .board { grid-auto-columns: minmax(160px, 1fr); }
  table { display: block; overflow-x: auto; white-space: nowrap; }
  .deal-head .title { font-size: 18px; }
  .facts { grid-template-columns: 1fr 1fr; }
  .modal .box { padding: 16px; }
  .modal .box.wide { height: 92vh; }
}

/* ---- grouping ---- */
.group-seg { width: auto; min-width: 220px; align-self: center; }
.group-seg button { padding: 7px 12px; }
.dgroup { margin-bottom: 14px; } .dgroup h2 a { color: var(--accent2); }
.dgroup-inner { margin-bottom: 14px; } .dgroup-inner h2 { margin-top: 6px; } .dgroup-inner h2 a { color: var(--accent2); }

.top-right { display: flex; gap: 12px; align-items: center; }
.side { overflow-y: auto; }
@media (max-width: 900px) { .top-right { display: flex; } .top-right #who { display: none; } }
