/* Styles for the owner tools: quotes dashboard and estimator. */
:root {
  --plate: #e9eef3; --surface: #ffffff; --ink: #111c2e; --ink-soft: #4f5d73; --line: #d3dce6;
  --navy: #22345a; --pop: #f5a524; --on-pop: #1a1205; --ok: #2f7a4f; --warn: #b2402f; --chrome: #111c2e; --chrome-fg: #e6ecf2;
  --font-display: "Unbounded", "Segoe UI", system-ui, sans-serif;
  --font-body: "Figtree", "Segoe UI", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root { --plate: #0e1522; --surface: #172235; --ink: #e7edf5; --ink-soft: #a3b1c5; --line: #2b3a52; --navy: #8fa9d9; --ok: #6fc394; --warn: #e48b7c; --chrome: #060a12; --chrome-fg: #e7edf5; color-scheme: dark; }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--plate); color: var(--ink); font: 15px/1.5 var(--font-body); }
h1, h2, h3, h4 { font-family: var(--font-display); margin: 0; line-height: 1.15; }
h4 { font-size: .85rem; letter-spacing: .02em; margin: 6px 0 10px; }
img { max-width: 100%; display: block; }
.topbar { background: var(--chrome); color: var(--chrome-fg); }
.topbar .in { max-width: 1400px; margin: 0 auto; padding: 12px max(16px, env(safe-area-inset-left, 0px)); display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.topbar b { font: 800 1.05rem var(--font-display); margin-right: auto; }
.topbar a, .topbar button.link { color: var(--chrome-fg); background: none; border: 0; font: inherit; cursor: pointer; text-decoration: underline; }
.page { max-width: 1400px; margin: 0 auto; padding: 24px max(16px, env(safe-area-inset-left, 0px)) 64px; }
.btn { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; font: 700 .92rem/1 var(--font-body); padding: 11px 16px; border-radius: 999px; border: 2px solid var(--navy); background: var(--navy); color: var(--surface); text-decoration: none; }
.btn.ghost { background: transparent; color: var(--navy); }
.btn.pop { background: var(--pop); border-color: var(--pop); color: var(--on-pop); }
.btn.danger { background: transparent; border-color: var(--warn); color: var(--warn); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 18px; display: grid; gap: 12px; min-width: 0; }
input, select, textarea { font: inherit; color: var(--ink); background: var(--plate); border: 1px solid var(--line); border-radius: 8px; padding: 9px 10px; width: 100%; }
textarea { min-height: 110px; resize: vertical; }
label.f { display: grid; gap: 4px; font-weight: 600; font-size: .9rem; }
.hint { color: var(--ink-soft); font-size: .85rem; font-weight: 400; }
.status-msg { padding: 10px 12px; border-radius: 8px; font-weight: 600; }
.status-msg.ok { background: color-mix(in srgb, var(--ok) 15%, var(--surface)); color: var(--ok); }
.status-msg.err { background: color-mix(in srgb, var(--warn) 15%, var(--surface)); color: var(--warn); }
:focus-visible { outline: 3px solid var(--pop); outline-offset: 2px; }

/* Estimator */
.est-cols { display: grid; grid-template-columns: 1.2fr 1fr; gap: 24px; }
.est-cols > * { min-width: 0; }
.est-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.est-f { display: grid; gap: 4px; font-weight: 600; font-size: .82rem; }
.est-check { display: flex; align-items: center; gap: 8px; }
.est-check input { width: auto; }
.est-hint { color: var(--ink-soft); font-size: .82rem; margin: 10px 0; }
.est-settings { margin-top: 10px; border-top: 1px solid var(--line); padding-top: 10px; }
.est-settings summary { cursor: pointer; font-weight: 700; margin-bottom: 10px; }
.est-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; font-size: .9rem; }
.est-table td, .est-table th { padding: 7px 4px; border-bottom: 1px solid var(--line); text-align: left; }
.est-table td:last-child, .est-table th:last-child, .est-profit td:nth-child(2), .est-profit th:nth-child(2) { text-align: right; }
.est-table th { font: 600 .72rem var(--font-mono); text-transform: uppercase; letter-spacing: .06em; color: var(--ink-soft); }
.est-total td { font-weight: 800; border-bottom: 2px solid var(--ink); }
.est-neg { color: var(--warn); font-weight: 800; }
.est-price { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.est-price > div { background: var(--plate); border-radius: 10px; padding: 12px; display: grid; gap: 4px; }
.est-price b { font: 800 1.5rem var(--font-display); font-variant-numeric: tabular-nums; }
.est-k { font-size: .8rem; color: var(--ink-soft); }
.est-out .btn { margin-top: 12px; }

/* Dashboard */
.login { max-width: 420px; margin: 8vh auto; }
.dash { display: grid; grid-template-columns: 340px 1fr; gap: 20px; align-items: start; }
.dash > * { min-width: 0; }
.filters { display: flex; gap: 6px; flex-wrap: wrap; }
.filters button { border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 999px; padding: 6px 11px; font: 600 .82rem var(--font-body); cursor: pointer; }
.filters button[aria-pressed="true"] { background: var(--navy); color: var(--surface); border-color: var(--navy); }
.qlist { display: grid; gap: 8px; max-height: 75vh; overflow-y: auto; padding-right: 4px; }
.qitem { all: unset; cursor: pointer; display: grid; gap: 3px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 12px; }
.qitem[aria-current="true"] { border: 2px solid var(--navy); padding: 11px; }
.qitem .top { display: flex; justify-content: space-between; gap: 8px; }
.qitem small { color: var(--ink-soft); }
.pill { display: inline-block; font: 700 .7rem/1 var(--font-mono); text-transform: uppercase; letter-spacing: .05em; padding: 5px 8px; border-radius: 999px; background: var(--plate); color: var(--ink-soft); white-space: nowrap; }
.pill.new { background: var(--pop); color: var(--on-pop); }
.pill.quoted { background: color-mix(in srgb, var(--navy) 18%, var(--surface)); color: var(--navy); }
.pill.changes_requested { background: color-mix(in srgb, var(--warn) 18%, var(--surface)); color: var(--warn); }
.pill.paid, .pill.printing { background: color-mix(in srgb, var(--ok) 18%, var(--surface)); color: var(--ok); }
.detail { display: grid; gap: 16px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; font-size: .92rem; }
.kv dt { color: var(--ink-soft); font-weight: 600; }
.kv dd { margin: 0; overflow-wrap: anywhere; white-space: pre-wrap; }
.imgs { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.imgs a { display: grid; gap: 4px; color: var(--navy); font-size: .8rem; text-decoration: none; overflow-wrap: anywhere; }
.imgs img { aspect-ratio: 1; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); background: var(--plate); }
.sw { display: inline-block; width: 14px; height: 14px; border-radius: 3px; border: 1px solid rgba(0,0,0,.25); vertical-align: -2px; margin-right: 4px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.three { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.preview-img { max-height: 260px; width: auto; border-radius: 8px; border: 1px solid var(--line); }
.linkbox { display: flex; gap: 8px; }
.linkbox input { font-family: var(--font-mono); font-size: .8rem; }
.empty { color: var(--ink-soft); padding: 30px 10px; text-align: center; }
@media (max-width: 980px) { .dash, .est-cols { grid-template-columns: 1fr; } .qlist { max-height: 40vh; } }
@media (max-width: 520px) { .two, .three, .est-price { grid-template-columns: 1fr; } }
