/* Novarus Live Audit: meeting screens. Palette: night blue, graphite, turquoise (actions, score),
   purple (AI insights), amber (lost visibility). */
:root {
  --bg: #0B1220; --panel: #172338; --panel-2: #1D2B44; --line: #263655;
  --ink: #E6EDF7; --muted: #8DA2C0; --accent: #22D3C5; --ai: #9B8CFF; --lost: #FFB454; --bad: #FF7A7A;
  --radius: 14px;
  font-family: "Segoe UI", Calibri, system-ui, -apple-system, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body { min-height: 100vh; font-size: 16px; line-height: 1.45; }
a { color: var(--accent); }
button, input, textarea { font: inherit; }
[hidden] { display: none !important; }

.topbar { display: flex; align-items: center; gap: 24px; padding: 14px 24px; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; background: rgba(11,18,32,.92); backdrop-filter: blur(8px); z-index: 5; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 700; font-size: 18px; }
.brand em { font-style: normal; color: var(--muted); font-weight: 500; }
.mark { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent), var(--ai)); color: var(--bg); font-weight: 800; }
.topbar nav { display: flex; gap: 6px; }
.topbar nav a { color: var(--muted); text-decoration: none; padding: 7px 12px; border-radius: 9px; }
.topbar nav a.on, .topbar nav a:hover { color: var(--ink); background: var(--panel); }
.who { margin-left: auto; display: flex; gap: 12px; align-items: center; color: var(--muted); font-size: 14px; }

main { max-width: 1180px; margin: 0 auto; padding: 28px 24px 64px; }
h1 { font-size: 28px; margin: 0 0 6px; letter-spacing: -.01em; }
h2 { font-size: 19px; margin: 0 0 14px; }
.sub { color: var(--muted); margin: 0 0 24px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.stack > * + * { margin-top: 18px; }
.grid2 { display: grid; grid-template-columns: 1.15fr .85fr; gap: 18px; }
@media (max-width: 900px) { .grid2 { grid-template-columns: 1fr; } }

label { display: block; font-size: 14px; color: var(--muted); margin: 0 0 6px; }
input[type=text], input[type=email], input[type=password] { width: 100%; padding: 13px 14px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--bg); color: var(--ink); outline: none; }
input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(34,211,197,.18); }
.field + .field { margin-top: 16px; }
.check { display: flex; gap: 10px; align-items: center; color: var(--ink); margin-top: 16px; }
.btn { display: inline-flex; align-items: center; gap: 8px; border: 0; border-radius: 10px; padding: 12px 20px;
  background: var(--accent); color: #062226; font-weight: 700; cursor: pointer; text-decoration: none; }
.btn:disabled { opacity: .5; cursor: progress; }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn.big { padding: 15px 28px; font-size: 17px; }
.link { background: none; border: 0; color: var(--accent); cursor: pointer; padding: 0; }
.error { color: var(--bad); margin-top: 12px; min-height: 1.2em; }
.hint { color: var(--muted); font-size: 14px; }

/* sign-in */
.auth { max-width: 420px; margin: 9vh auto 0; }
.auth .brand { justify-content: center; margin-bottom: 26px; font-size: 22px; }
.qr { background: #fff; border-radius: 12px; padding: 10px; width: max-content; margin: 14px auto; }
.secret { font-family: ui-monospace, Consolas, monospace; letter-spacing: .08em; word-break: break-all;
  background: var(--bg); padding: 10px; border-radius: 8px; text-align: center; font-size: 14px; }
.code-input { font-size: 26px !important; letter-spacing: .35em; text-align: center; }

/* run view */
.run-head { display: flex; flex-wrap: wrap; gap: 14px 24px; align-items: flex-end; justify-content: space-between; margin-bottom: 20px; }
.pill { display: inline-block; padding: 4px 11px; border-radius: 99px; font-size: 13px; font-weight: 600; background: var(--panel-2); color: var(--muted); }
.pill.run { color: var(--accent); } .pill.done { color: var(--accent); background: rgba(34,211,197,.12); }
.pill.failed, .pill.capped { color: var(--lost); }
.profile { display: flex; flex-wrap: wrap; gap: 10px 28px; }
.profile div span { display: block; font-size: 13px; color: var(--muted); }
.profile div strong { font-size: 16px; }
.progress { height: 6px; background: var(--panel-2); border-radius: 99px; overflow: hidden; margin: 16px 0 4px; }
.progress i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--ai)); transition: width .4s; }

table.gridt { width: 100%; border-collapse: separate; border-spacing: 0 8px; }
.gridt th { text-align: left; font-size: 13px; color: var(--muted); font-weight: 600; padding: 0 10px; }
.gridt td { background: var(--panel); padding: 12px 10px; vertical-align: middle; }
.gridt td:first-child { border-radius: 10px 0 0 10px; width: 46%; }
.gridt td:last-child { border-radius: 0 10px 10px 0; }
.kind { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); display: block; margin-bottom: 3px; }
.cell { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 8px; font-size: 13px; font-weight: 600; white-space: nowrap; }
.cell.wait { color: var(--muted); background: transparent; }
.cell.wait::before { content: ""; width: 12px; height: 12px; border: 2px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin 1s linear infinite; }
.cell.win { background: rgba(34,211,197,.14); color: var(--accent); }
.cell.mid { background: rgba(155,140,255,.15); color: var(--ai); }
.cell.lost { background: rgba(255,180,84,.12); color: var(--lost); }
.cell.err { background: var(--panel-2); color: var(--muted); }
.cell.flash { animation: pop .5s ease-out; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pop { from { transform: scale(.85); opacity: .2; } to { transform: scale(1); opacity: 1; } }
@media (max-width: 760px) { .gridt td:first-child { width: auto; } .gridt th.q { display: none; }
  .gridt tr { display: grid; grid-template-columns: repeat(2, 1fr); } .gridt td { border-radius: 8px !important; }
  .gridt td:first-child { grid-column: 1 / -1; } }

/* scorecard */
.score { display: grid; grid-template-columns: auto 1fr; gap: 24px; align-items: center; }
.ring { --p: 0; width: 148px; height: 148px; border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(var(--accent) calc(var(--p) * 1%), var(--panel-2) 0); }
.ring > div { width: 118px; height: 118px; border-radius: 50%; background: var(--panel); display: grid; place-items: center; text-align: center; }
.ring b { font-size: 38px; line-height: 1; } .ring small { color: var(--muted); font-size: 13px; }
.areas { display: grid; gap: 10px; }
.area { display: grid; grid-template-columns: 170px 1fr 40px; gap: 12px; align-items: center; font-size: 15px; }
.bar { height: 8px; background: var(--panel-2); border-radius: 99px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--accent); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { padding: 7px 12px; border-radius: 99px; background: rgba(155,140,255,.14); color: var(--ink); font-size: 14px; }
.chip b { color: var(--ai); margin-left: 4px; }
ul.gaps { margin: 0; padding: 0; list-style: none; }
ul.gaps li { padding: 10px 0; border-top: 1px solid var(--line); }
ul.gaps li:first-child { border-top: 0; }
ul.gaps li::before { content: "●"; color: var(--lost); margin-right: 10px; font-size: 11px; vertical-align: 2px; }
.checks li::before { content: none !important; }
.ev { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; padding: 2px 7px; border-radius: 6px; background: var(--panel-2); color: var(--muted); margin-left: 8px; }
.ok-mark { color: var(--accent); margin-right: 8px; } .no-mark { color: var(--lost); margin-right: 8px; }
.offer { background: linear-gradient(160deg, #1A2B47, #1B2140); border-color: #34407A; }
.offer .price { font-size: 30px; font-weight: 800; margin: 6px 0; }
.offer ul { padding-left: 20px; margin: 12px 0 18px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; }
.note { font-size: 13px; color: var(--muted); }

/* history */
.hist { width: 100%; border-collapse: collapse; }
.hist th, .hist td { text-align: left; padding: 12px 10px; border-bottom: 1px solid var(--line); }
.hist th { color: var(--muted); font-size: 13px; font-weight: 600; }
.hist tr[data-id] { cursor: pointer; } .hist tr[data-id]:hover td { background: var(--panel); }
.empty { color: var(--muted); padding: 30px 0; text-align: center; }

.modes { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mode { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; margin: 0; color: var(--ink); }
.mode:has(input:checked) { border-color: var(--accent); background: rgba(34,211,197,.07); }
.mode input { margin-top: 4px; accent-color: var(--accent); }
.mode b { display: block; } .mode small { color: var(--muted); font-size: 13px; }
@media (max-width: 600px) { .modes { grid-template-columns: 1fr; } }

.meter { color: var(--muted); text-decoration: none; font-size: 13px; padding: 5px 10px; border: 1px solid var(--line); border-radius: 99px; }
.meter.high { color: var(--lost); border-color: rgba(255,180,84,.5); }
.num { text-align: right !important; font-variant-numeric: tabular-nums; }
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
@media (max-width: 900px) { .kpis { grid-template-columns: repeat(2, 1fr); } }
.kpi b { display: block; font-size: 30px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.kpi span { color: var(--muted); font-size: 14px; }
.kpi b.live { color: var(--accent); }
.bar.big { height: 12px; margin: 14px 0 10px; }
.bar.warn i { background: var(--lost); }
.spend { display: flex; justify-content: space-between; gap: 8px; font-size: 14px; margin-bottom: 6px; }
.requests { margin-top: 18px; border-color: rgba(255,180,84,.45); }
.req { display: flex; justify-content: space-between; gap: 16px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.req:first-of-type { border-top: 0; }
.budget { border-color: rgba(255,180,84,.45); margin-bottom: 18px; max-width: 720px; }

/* client conversation and the client's own question */
.cvhead { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.cvhead h2 { margin: 0; }
.tag { font-size: 11px; font-weight: 600; padding: 2px 7px; border-radius: 6px; background: rgba(155,140,255,.15); color: var(--ai); white-space: nowrap; }
ol.qa { margin: 12px 0 16px; padding-left: 22px; }
ol.qa li { padding: 10px 0; border-top: 1px solid var(--line); }
ol.qa li:first-child { border-top: 0; }
.qtext { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; margin-bottom: 8px; }
.qtext .rm { margin-left: auto; font-size: 13px; color: var(--muted); }
.qtext .rm:hover { color: var(--bad); }
textarea { width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg);
  color: var(--ink); outline: none; resize: vertical; min-height: 46px; }
textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(34,211,197,.18); }
.bank { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 14px; }
.banktabs { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 8px; }
.banktabs .hint { width: 74px; flex: none; }
.tab { border: 1px solid var(--line); background: transparent; color: var(--muted); padding: 5px 11px; border-radius: 99px; font-size: 13px; cursor: pointer; }
.tab.on, .tab:hover { color: var(--ink); border-color: var(--accent); background: rgba(34,211,197,.08); }
ul.bankq { list-style: none; margin: 12px 0; padding: 0; display: grid; gap: 6px; }
.bq { width: 100%; text-align: left; display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; padding: 10px 12px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--panel-2); color: var(--ink); cursor: pointer; }
.bq span:first-child { color: var(--accent); font-weight: 700; width: 12px; }
.bq:hover:not(:disabled) { border-color: var(--accent); }
.bq:disabled { opacity: .55; cursor: default; }
.askrow { display: flex; gap: 10px; }
.askrow input { flex: 1; }
.ask { border-color: rgba(155,140,255,.45); }
@media (max-width: 600px) { .askrow { flex-direction: column; } .banktabs .hint { width: 100%; } }

/* deals: proposal, agreement, signature */
.deal { border-color: rgba(34,211,197,.45); }
ul.plist { list-style: none; margin: 0 0 14px; padding: 0; }
ul.plist li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); }
ul.plist li:first-child { border-top: 0; }
ul.plist a { color: var(--ink); text-decoration: none; } ul.plist a:hover { color: var(--accent); }
.pkgs { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.pkg { position: relative; display: flex; flex-direction: column; gap: 2px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; margin: 0; color: var(--ink); }
.pkg input { position: absolute; opacity: 0; }
.pkg:has(input:checked) { border-color: var(--accent); background: rgba(34,211,197,.08); box-shadow: 0 0 0 1px var(--accent) inset; }
.pkg.off { opacity: .5; cursor: not-allowed; }
.pkg b { font-size: 16px; } .pkg .pp { font-size: 22px; font-weight: 800; margin-top: 4px; } .pkg .pp small { font-size: 13px; color: var(--muted); font-weight: 500; }
.pkg small { color: var(--muted); font-size: 13px; } .pkg .pd { margin-top: 6px; }
.sub3 { font-size: 14px; color: var(--muted); font-weight: 600; margin: 18px 0 8px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; } .row3 { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 14px; }
.row2 .field + .field, .row3 .field + .field { margin-top: 0; }
.row2 + .field, .row3 + .field, .field + .row2 { margin-top: 16px; }
@media (max-width: 700px) { .row2, .row3 { grid-template-columns: 1fr; } }
.sumcard { position: sticky; top: 84px; }
table.sumt { width: 100%; border-collapse: collapse; font-size: 14px; }
.sumt td { padding: 7px 0; border-bottom: 1px solid var(--line); }
.sumt tr.discount td, .sumt tr.incentive td { color: var(--accent); }
.totals { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 14px; }
.totals span { display: block; font-size: 13px; color: var(--muted); } .totals b { font-size: 22px; font-variant-numeric: tabular-nums; }
.incent { margin-top: 14px; padding: 12px 14px; border-radius: 10px; background: rgba(34,211,197,.1); color: var(--ink); }
.incent b { color: var(--accent); }
.warnline { color: var(--lost); margin-top: 10px; }
.actions.col { flex-direction: column; } .actions.col .btn { justify-content: center; }
.btn.big { width: 100%; justify-content: center; }
.qr.big { padding: 14px; margin: 16px auto 6px; } .qr.big svg { width: 220px; height: 220px; display: block; }
.won { text-align: center; border-color: rgba(34,211,197,.6); background: linear-gradient(160deg, rgba(34,211,197,.12), rgba(155,140,255,.08)); }
.won .tick { width: 56px; height: 56px; border-radius: 50%; background: var(--accent); color: var(--bg); display: grid; place-items: center; font-size: 30px; font-weight: 800; margin: 0 auto 10px; }
ul.timeline { list-style: none; margin: 0; padding: 0; font-size: 14px; }
ul.timeline li { padding: 6px 0; border-top: 1px solid var(--line); } ul.timeline li:first-child { border-top: 0; }
ul.timeline span { color: var(--muted); display: inline-block; min-width: 150px; }
.pgrid { grid-template-columns: 1.25fr .75fr; align-items: start; }
@media (max-width: 900px) { .pgrid { grid-template-columns: 1fr; } }
.docframe { background: #fff; border-radius: var(--radius); overflow: hidden; }
.docframe iframe { width: 100%; min-height: 900px; border: 0; display: block; }
.settings .pkgedit { border: 1px solid var(--line); border-radius: 12px; padding: 16px; margin-bottom: 12px; }
.rmrow { font-size: 13px; color: var(--muted); margin-top: 8px; } .rmrow:hover { color: var(--bad); }
textarea.mono { font-family: ui-monospace, Consolas, monospace; font-size: 13px; line-height: 1.5; }
