:root {
  --brand: #e8590c;
  --brand-ink: #fff;
  --bg: #f2f4f7;
  --surface: #ffffff;
  --surface-2: #f7f8fa;
  --ink: #17191c;
  --ink-2: #4a4f57;
  --ink-3: #868b93;
  --line: #e3e6eb;
  --line-2: #d2d7de;
  --ok: #138a52;
  --warn: #b7791f;
  --bad: #c2362f;
  --info: #2a62d4;
  --ws: #0e1116;
  --ws-2: #161a21;
  --ws-line: #262c36;
  --ws-ink: #e9edf3;
  --ws-ink-2: #9aa3b0;
  --r: 12px;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
  --sans: 'Manrope', system-ui, sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--sans); background: var(--bg); color: var(--ink); font-size: 14px; line-height: 1.45; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }
.num { font-family: var(--mono); font-feature-settings: 'tnum'; letter-spacing: -0.02em; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; }
.side { background: #15171a; color: #d8dbe0; padding: 18px 14px; display: flex; flex-direction: column; gap: 18px; position: sticky; top: 0; height: 100vh; }
.product { display: flex; align-items: center; gap: 10px; padding: 2px 6px; color: #fff; font-weight: 800; letter-spacing: -0.02em; font-size: 15px; }
.product .mark { width: 26px; height: 26px; border-radius: 7px; background: conic-gradient(from 200deg, #ffb703, #fb8500, #ffb703); display: grid; place-items: center; }
.product small { display: block; font-weight: 600; color: #8b919b; font-size: 11px; letter-spacing: 0; }
.tenant-switch { background: #1f2226; border: 1px solid #2b2f35; border-radius: 10px; padding: 10px; }
.tenant-switch label { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.08em; color: #8b919b; font-weight: 700; }
.tenant-row { display: flex; align-items: center; gap: 9px; margin-top: 8px; }
.tlogo { width: 30px; height: 30px; border-radius: 8px; background: var(--brand); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 12px; flex: none; }
.tenant-switch select { width: 100%; background: transparent; border: 0; color: #fff; font-weight: 700; padding: 0; cursor: pointer; }
.tenant-switch select option { color: #111; }
.tenant-row .meta { font-size: 11.5px; color: #8b919b; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a { text-decoration: none; padding: 9px 10px; border-radius: 8px; color: #c4c8cf; font-weight: 600; display: flex; align-items: center; gap: 10px; }
.nav a:hover { background: #1f2226; color: #fff; }
.nav a.on { background: #24282d; color: #fff; box-shadow: inset 3px 0 0 var(--brand); }
.nav svg { width: 17px; height: 17px; opacity: 0.85; }
.side .foot { margin-top: auto; font-size: 11.5px; color: #6f757e; padding: 0 6px; }
.side .foot button { background: none; border: 0; color: #8b919b; padding: 0; text-decoration: underline; cursor: pointer; font-size: 11.5px; }
main { min-width: 0; }
.page { padding: 28px 36px 60px; max-width: 1280px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
h1 { font-size: 26px; letter-spacing: -0.03em; margin: 0; font-weight: 800; }
.sub { color: var(--ink-3); margin-top: 4px; }
h2 { font-size: 16px; margin: 0 0 12px; letter-spacing: -0.01em; }
h3 { font-size: 13px; margin: 0 0 8px; }

/* ---------- controls ---------- */
.btn { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line-2); background: var(--surface); padding: 9px 14px; border-radius: 9px; font-weight: 700; cursor: pointer; text-decoration: none; white-space: nowrap; transition: transform .08s, background .15s, border-color .15s; }
.btn:hover { border-color: var(--ink-3); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn.primary:hover { filter: brightness(1.06); }
.btn.dark { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.sm { padding: 6px 10px; font-size: 12.5px; border-radius: 8px; }
.btn svg { width: 16px; height: 16px; }
.btn[disabled] { opacity: .45; pointer-events: none; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: 12px; font-weight: 700; color: var(--ink-2); }
.field small { color: var(--ink-3); font-size: 11.5px; }
.input, .field input, .field select, .field textarea { border: 1px solid var(--line-2); background: var(--surface); border-radius: 9px; padding: 9px 11px; width: 100%; outline: none; transition: border-color .15s, box-shadow .15s; }
.field input:focus, .field select:focus, .field textarea:focus, .input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; }
.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 10px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg button { border: 0; background: transparent; padding: 7px 12px; border-radius: 7px; font-weight: 700; color: var(--ink-2); cursor: pointer; font-size: 13px; }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.08), 0 0 0 1px var(--line); }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 800; padding: 3px 9px; border-radius: 99px; text-transform: capitalize; }
.pill::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.draft { background: #eceef2; color: #6c7078; }
.pill.sent { background: #e7eefc; color: var(--info); }
.pill.viewed { background: #fdf2dc; color: var(--warn); }
.pill.accepted { background: #def4e8; color: var(--ok); }
.hint { font-size: 12px; color: var(--ink-3); }
.kbd { font-family: var(--mono); font-size: 11px; padding: 1px 5px; border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 5px; background: var(--surface); }

/* ---------- dashboard ---------- */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 22px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; }
.kpi .l { font-size: 12px; color: var(--ink-3); font-weight: 700; }
.kpi .v { font-size: 24px; font-weight: 800; margin-top: 6px; letter-spacing: -0.03em; }
.kpi .d { font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; gap: 12px; flex-wrap: wrap; }
.qlist { display: flex; flex-direction: column; gap: 10px; }
.qrow { display: grid; grid-template-columns: 150px 1.4fr 1fr 1fr 120px 150px; gap: 18px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 10px 16px 10px 10px; text-decoration: none; transition: border-color .15s, box-shadow .15s; }
.qrow:hover { border-color: var(--line-2); box-shadow: 0 4px 16px -8px rgba(30,25,10,.18); }
.thumb { width: 150px; aspect-ratio: 3/2; border-radius: 8px; overflow: hidden; background: repeating-linear-gradient(135deg, #eceff3 0 8px, #f4f6f8 8px 16px); display: grid; place-items: center; color: var(--ink-3); font-size: 11px; font-weight: 700; }
.thumb canvas { width: 100%; height: 100%; object-fit: cover; display: block; }
.qrow .who b { display: block; font-size: 14.5px; }
.qrow .who span, .qrow .c span { font-size: 12px; color: var(--ink-3); }
.qrow .c b { display: block; font-size: 14px; }
.qrow .acts { display: flex; gap: 6px; justify-content: flex-end; }
.empty { text-align: center; padding: 50px; color: var(--ink-3); border: 1px dashed var(--line-2); border-radius: var(--r); }

/* ---------- builder ---------- */
.builder { display: grid; grid-template-columns: 1fr 330px; gap: 22px; align-items: start; }
.steps { display: flex; gap: 6px; margin-bottom: 18px; flex-wrap: wrap; }
.step { display: flex; align-items: center; gap: 9px; padding: 8px 14px 8px 8px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface); font-weight: 700; color: var(--ink-2); cursor: pointer; text-decoration: none; }
.step i { font-style: normal; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--line-2); font-size: 12px; }
.step.on { border-color: var(--ink); color: var(--ink); }
.step.on i { background: var(--ink); color: #fff; border-color: var(--ink); }
.step.done i { background: var(--brand); border-color: var(--brand); color: #fff; }
.summary { position: sticky; top: 18px; display: flex; flex-direction: column; gap: 12px; }
.sumcard { background: var(--ink); color: #f2f3f5; border-radius: 14px; padding: 18px; }
.sumcard .big { font-size: 30px; font-weight: 800; letter-spacing: -0.04em; }
.sumcard .row { display: flex; justify-content: space-between; padding: 7px 0; border-bottom: 1px solid #2b2f36; font-size: 13px; }
.sumcard .row:last-child { border-bottom: 0; }
.sumcard .row span { color: #a5abb4; }
.sumcard .row.net { font-size: 15px; font-weight: 800; }
.sumcard .row.net span { color: #fff; }
.sumcard .tag { font-size: 11px; color: #a5abb4; text-transform: uppercase; letter-spacing: .08em; font-weight: 800; }
.mini { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.mini div { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.mini b { display: block; font-size: 17px; letter-spacing: -0.02em; }
.mini span { font-size: 11.5px; color: var(--ink-3); font-weight: 700; }
.suggest { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border-radius: 10px; background: color-mix(in srgb, var(--brand) 9%, #fff); border: 1px solid color-mix(in srgb, var(--brand) 25%, #fff); font-size: 13px; }
.lines { width: 100%; border-collapse: collapse; }
.lines td { padding: 10px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.lines td:last-child { text-align: right; white-space: nowrap; }
.lines td small { display: block; color: var(--ink-3); font-size: 12px; }
.lines tr.t td { font-weight: 800; border-bottom: 0; padding-top: 12px; }
.extras { display: flex; flex-direction: column; gap: 8px; }
.extras .er { display: grid; grid-template-columns: 1fr 140px 34px; gap: 8px; }
.warnbar { padding: 10px 12px; border-radius: 10px; background: #fff6e5; border: 1px solid #f3d8a4; color: #7a5212; font-size: 13px; display: flex; gap: 10px; align-items: center; justify-content: space-between; }
.okbar { padding: 10px 12px; border-radius: 10px; background: #e7f6ee; border: 1px solid #b9e3cb; color: #0f5e39; font-size: 13px; }

/* ---------- workspace (visual) ---------- */
.ws { background: var(--ws); border-radius: 16px; color: var(--ws-ink); display: grid; grid-template-columns: 1fr 290px; overflow: hidden; border: 1px solid #000; min-height: 640px; }
.ws-main { display: flex; flex-direction: column; min-width: 0; }
.ws-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--ws-line); flex-wrap: wrap; }
.ws .seg { background: var(--ws-2); border-color: var(--ws-line); }
.ws .seg button { color: var(--ws-ink-2); }
.ws .seg button.on { background: #2a303a; color: #fff; box-shadow: none; }
.ws .seg button i { font-style: normal; display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; }
.stage { flex: 1; display: grid; place-items: center; padding: 14px; min-height: 520px; position: relative; }
.stage canvas { display: block; border-radius: 6px; touch-action: none; }
.stage-help { position: absolute; left: 50%; bottom: 22px; transform: translateX(-50%); background: rgba(14,17,22,.88); border: 1px solid var(--ws-line); padding: 8px 14px; border-radius: 99px; font-size: 12.5px; color: var(--ws-ink); pointer-events: none; white-space: nowrap; backdrop-filter: blur(6px); max-width: 92%; overflow: hidden; text-overflow: ellipsis; }
.ws-side { background: var(--ws-2); border-left: 1px solid var(--ws-line); padding: 14px; display: flex; flex-direction: column; gap: 14px; overflow-y: auto; max-height: 760px; }
.ws-side h3 { color: var(--ws-ink-2); font-size: 10.5px; text-transform: uppercase; letter-spacing: .1em; margin-bottom: 8px; }
.ws .field > span { color: var(--ws-ink-2); }
.ws .field input, .ws .field select { background: #0f1217; border-color: var(--ws-line); color: var(--ws-ink); padding: 8px 10px; }
.ws .btn { background: #232832; border-color: #2f3642; color: var(--ws-ink); }
.ws .btn:hover { border-color: #4b5463; }
.ws .btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.ws .hint { color: var(--ws-ink-2); }
.ws input[type=range] { width: 100%; accent-color: var(--brand); }
.secs { display: flex; flex-direction: column; gap: 6px; }
.sec-tab { display: flex; justify-content: space-between; align-items: center; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--ws-line); cursor: pointer; font-weight: 700; font-size: 13px; }
.sec-tab.on { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 12%, transparent); }
.sec-tab span { color: var(--ws-ink-2); font-weight: 600; font-size: 12px; }
.meter { height: 6px; border-radius: 9px; background: #232832; overflow: hidden; margin-top: 6px; }
.meter i { display: block; height: 100%; background: var(--brand); border-radius: 9px; transition: width .3s; }
.count-big { font-size: 28px; font-weight: 800; letter-spacing: -0.04em; }
.pick { display: grid; grid-template-columns: 1fr; gap: 10px; padding: 26px; width: 100%; max-width: 760px; }
.pick h2 { color: #fff; font-size: 20px; }
.pick .opts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.pick .opt { border: 1px solid var(--ws-line); border-radius: 12px; overflow: hidden; cursor: pointer; background: var(--ws-2); text-align: left; padding: 0; transition: border-color .15s, transform .15s; }
.pick .opt:hover { border-color: var(--brand); transform: translateY(-2px); }
.pick .opt img { width: 100%; aspect-ratio: 3/2; object-fit: cover; display: block; }
.pick .opt span { display: block; padding: 8px 10px; font-weight: 700; font-size: 12.5px; color: var(--ws-ink); }
.drop { border: 1.5px dashed #3a4250; border-radius: 14px; padding: 26px; text-align: center; color: var(--ws-ink-2); cursor: pointer; transition: border-color .15s, background .15s; }
.drop:hover, .drop.over { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 8%, transparent); color: #fff; }
.scan { position: absolute; inset: 14px; pointer-events: none; border-radius: 6px; overflow: hidden; }
.scan::after { content: ''; position: absolute; left: 0; right: 0; height: 30%; top: -30%; background: linear-gradient(180deg, transparent, rgba(62,224,143,.25), rgba(62,224,143,.6) 98%, transparent); animation: scan 1.1s linear infinite; }
@keyframes scan { to { top: 100%; } }
.legend { display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--ws-ink-2); }
.legend b { color: var(--ws-ink); }

/* ---------- client proposal ---------- */
.client { background: #f7f8fa; min-height: 100vh; }
.preview-bar { position: sticky; top: 0; z-index: 10; background: #15171a; color: #d8dbe0; display: flex; justify-content: space-between; align-items: center; padding: 8px 20px; font-size: 13px; gap: 10px; }
.preview-bar .btn { background: #24282d; border-color: #33383f; color: #fff; }
.prop { max-width: 980px; margin: 0 auto; padding: 28px 24px 80px; }
.prop-head { display: flex; justify-content: space-between; align-items: center; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.prop-head .co { display: flex; gap: 12px; align-items: center; }
.prop-head .co b { font-size: 17px; display: block; letter-spacing: -0.02em; }
.prop-head .co span, .prop-head .ref { font-size: 12.5px; color: var(--ink-3); }
.prop-head .ref { text-align: right; }
.prop h1 { font-size: 38px; line-height: 1.08; letter-spacing: -0.04em; margin: 30px 0 8px; max-width: 760px; }
.prop .lede { font-size: 16px; color: var(--ink-2); max-width: 640px; }
.ba { position: relative; margin: 24px 0 8px; border-radius: 16px; overflow: hidden; aspect-ratio: 3/2; background: #ddd; user-select: none; touch-action: none; cursor: ew-resize; }
.ba canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.ba .after { clip-path: inset(0 0 0 var(--cut, 50%)); }
.ba .bar { position: absolute; top: 0; bottom: 0; left: var(--cut, 50%); width: 2px; background: #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.15); }
.ba .knob { position: absolute; top: 50%; left: var(--cut, 50%); transform: translate(-50%, -50%); width: 44px; height: 44px; border-radius: 50%; background: #fff; display: grid; place-items: center; box-shadow: 0 6px 20px rgba(0,0,0,.25); font-weight: 800; color: #111; }
.ba .lab { position: absolute; top: 14px; padding: 5px 10px; border-radius: 99px; background: rgba(10,12,16,.7); color: #fff; font-size: 12px; font-weight: 700; backdrop-filter: blur(6px); }
.ba .lab.l { left: 14px; } .ba .lab.r { right: 14px; }
.caption { font-size: 12px; color: var(--ink-3); }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; margin: 26px 0; }
.stats div { background: var(--surface); padding: 18px; }
.stats b { display: block; font-size: 26px; letter-spacing: -0.04em; font-weight: 800; }
.stats span { font-size: 12.5px; color: var(--ink-3); font-weight: 600; }
.two { display: grid; grid-template-columns: 1.15fr 1fr; gap: 22px; margin-top: 10px; }
.netbox { background: var(--ink); color: #fff; border-radius: 14px; padding: 20px; margin-top: 14px; }
.netbox .row { display: flex; justify-content: space-between; padding: 6px 0; font-size: 14px; color: #c9cdd3; }
.netbox .row.big { font-size: 22px; color: #fff; font-weight: 800; border-top: 1px solid #333840; margin-top: 6px; padding-top: 12px; }
.chart { width: 100%; height: auto; display: block; }
.timeline { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 12px; }
.timeline div { border-top: 3px solid var(--brand); padding-top: 10px; font-size: 13px; color: var(--ink-2); }
.timeline b { display: block; color: var(--ink); }
.accept { margin-top: 30px; display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 22px; border-radius: 16px; background: color-mix(in srgb, var(--brand) 8%, #fff); border: 1px solid color-mix(in srgb, var(--brand) 25%, #fff); }
.accept b { font-size: 18px; letter-spacing: -0.02em; }
.fine { font-size: 11.5px; color: var(--ink-3); margin-top: 22px; line-height: 1.6; }

.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%) translateY(20px); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 10px; font-weight: 700; opacity: 0; transition: .25s; z-index: 100; pointer-events: none; }
.toast.on { opacity: 1; transform: translateX(-50%); }

@media (max-width: 1100px) {
  .builder { grid-template-columns: 1fr; }
  .summary { position: static; }
  .ws { grid-template-columns: 1fr; }
  .ws-side { border-left: 0; border-top: 1px solid var(--ws-line); max-height: none; }
  .qrow { grid-template-columns: 110px 1fr 1fr; }
  .qrow .thumb { width: 110px; }
  .qrow .hide-md { display: none; }
}
@media (max-width: 760px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; }
  .side .foot { display: none; }
  .nav { flex-direction: row; }
  .page { padding: 18px 16px 40px; }
  .kpis, .stats { grid-template-columns: 1fr 1fr; }
  .grid2, .grid3, .two, .timeline { grid-template-columns: 1fr; }
  .pick .opts { grid-template-columns: 1fr; }
  .prop h1 { font-size: 28px; }
  .accept { flex-direction: column; align-items: stretch; }
  .qrow { grid-template-columns: 1fr; }
  .qrow .thumb { width: 100%; }
}
@media print {
  .preview-bar, .no-print { display: none !important; }
  .client { background: #fff; }
  .prop { padding: 0; }
  .ba { cursor: default; break-inside: avoid; }
  .ba .knob, .ba .bar { display: none; }
  .ba .after { clip-path: none; }
  .ba .before, .ba .lab.l { display: none; }
  .stats, .two > *, .timeline { break-inside: avoid; }
  .accept .btn { display: none; }
}
