/* NYHLI Ops — pine sidebar, cream/white work area, cranberry + gold accents (matches the flyer and catalog). */
:root {
  --pine: #0f3a2a;
  --pine-2: #164a36;
  --pine-3: #1f5c44;
  --berry: #b3202f;
  --berry-2: #d33445;
  --gold: #f4b63f;
  --bg: #f5f3ee;
  --surface: #ffffff;
  --surface-2: #f7f5f0;
  --surface-3: #ece8df;
  --line: #e3ded2;
  --text: #1c1a17;
  --text-2: #4a453d;
  --text-3: #857e72;
  --ok: #1d8a4e;
  --warn: #b26a00;
  --bad: #c02a3a;
  --blue: #2a63c9;
  --shadow: 0 1px 2px rgba(30, 25, 15, .06), 0 2px 10px rgba(30, 25, 15, .04);
  --radius: 12px;
  --display: "Archivo", "Arial Narrow", Arial, sans-serif;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0d1512;
  --surface: #15201b;
  --surface-2: #1a2721;
  --surface-3: #22322b;
  --line: #2a3b33;
  --text: #ece8de;
  --text-2: #c3bdb0;
  --text-3: #8d9a92;
  --ok: #45c07c;
  --warn: #e7a33a;
  --bad: #f06676;
  --blue: #6b9cf0;
  --berry: #d33445;
  --berry-2: #e55162;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { font: 14.5px/1.45 Inter, system-ui, -apple-system, Segoe UI, sans-serif; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
html:not(.ready) .app { visibility: hidden; }
a { color: inherit; }
.view a:not(.btn):not(.chip):not(.pipe-step):not(.line):not(.btn-icon), .link { color: var(--blue); text-decoration: none; }
.view a:not(.btn):not(.chip):not(.pipe-step):not(.line):not(.btn-icon):hover, .link:hover { text-decoration: underline; }
.muted { color: var(--text-3); }
.small { font-size: 12.5px; }
.grow { flex: 1; min-width: 0; }
.hidden { display: none !important; }
.r { text-align: right; }
.pad { padding: 0 2px 8px; margin: 0; }
.ic { width: 18px; height: 18px; flex: none; }
.ok-text { color: var(--ok); display: inline-flex; align-items: center; gap: 4px; }
.ok-text .ic { width: 14px; height: 14px; }
.owe { color: var(--berry); font-weight: 600; }
.warn { color: var(--warn); }
.error-text { color: var(--bad); }

/* ---------- layout ---------- */
.app { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 14px;
  background: var(--pine); color: #e8efe9; padding: 18px 14px; overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; padding: 4px 6px 2px; }
.brand img { width: 150px; height: auto; display: block; }
.brand span { font: 800 13px var(--display); letter-spacing: .2em; text-transform: uppercase; color: var(--gold); align-self: flex-end; margin-bottom: 8px; }
.season-pick { display: grid; gap: 4px; padding: 0 6px; }
.season-pick span { font-size: 11px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: #9fbfae; }
.season-pick .select { background: var(--pine-2); color: #fff; border-color: var(--pine-3); }
.nav { display: grid; gap: 2px; }
.nav-link {
  display: flex; align-items: center; gap: 11px; width: 100%; padding: 9px 10px; border-radius: 9px; border: 0; background: none;
  color: #cfdcd3; text-decoration: none; font: 500 14px Inter, sans-serif; cursor: pointer; text-align: left;
}
.nav-link:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.nav-link.active { background: rgba(244, 182, 63, .16); color: #fff; box-shadow: inset 3px 0 0 var(--gold); }
.nav-link.active .ic { color: var(--gold); }
.nav-badge { margin-left: auto; background: var(--berry-2); color: #fff; font-size: 11px; font-weight: 700; border-radius: 99px; padding: 1px 7px; }
.sidebar-foot { margin-top: auto; display: grid; gap: 6px; border-top: 1px solid rgba(255, 255, 255, .1); padding-top: 12px; }
.account { display: grid; gap: 4px; padding: 0 4px; }
.acct-email { font-size: 12.5px; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 0 6px; }
.sync { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; color: #a9c2b4; padding: 0 6px; }
.sync i { width: 7px; height: 7px; border-radius: 50%; background: #6fcf97; }
.sync.busy i { background: var(--gold); animation: pulse 1s infinite; }
.sync.err i { background: #ff6b7a; }
.sync.local i { background: var(--gold); }
@keyframes pulse { 50% { opacity: .3; } }

.main { min-width: 0; padding: 22px 30px 60px; }
.topbar { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 18px; }
.titles { flex: 1; min-width: 0; }
.titles h1 { margin: 0; font: 800 26px/1.15 var(--display); font-variation-settings: "wdth" 80; letter-spacing: .005em; }
.titles p { margin: 3px 0 0; color: var(--text-3); }
.page-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.menu-btn.btn-icon { display: none; }
.scrim { display: none; }

/* ---------- buttons & inputs ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 8px 14px; border-radius: 9px;
  border: 1px solid var(--line); background: var(--surface); color: var(--text); font: 600 13.5px Inter, sans-serif; cursor: pointer;
  text-decoration: none; white-space: nowrap; transition: background .15s, border-color .15s, transform .1s;
}
.btn:hover { background: var(--surface-2); border-color: var(--text-3); }
.btn:active { transform: translateY(1px); }
.btn .ic { width: 16px; height: 16px; }
.btn-primary { background: var(--berry); border-color: var(--berry); color: #fff; }
.btn-primary:hover { background: var(--berry-2); border-color: var(--berry-2); }
.btn-danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn-danger:hover { filter: brightness(1.08); background: var(--bad); }
.btn-danger-ghost { background: none; border-color: transparent; color: var(--bad); }
.btn-danger-ghost:hover { background: color-mix(in srgb, var(--bad) 10%, transparent); border-color: transparent; }
.btn-sm { padding: 5px 10px; font-size: 12.5px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .55; cursor: default; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; }
.btn-icon {
  display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; border: 1px solid var(--line);
  background: var(--surface); color: var(--text-2); cursor: pointer; flex: none; text-decoration: none;
}
.btn-icon:hover { background: var(--surface-2); color: var(--text); }
.btn-icon.sm { width: 26px; height: 26px; border: 0; background: none; }
.btn-icon.sm .ic { width: 14px; height: 14px; }
.link { background: none; border: 0; padding: 0; font: inherit; cursor: pointer; }
.input, .select {
  width: 100%; padding: 9px 11px; border-radius: 9px; border: 1px solid var(--line); background: var(--surface); color: var(--text);
  font: 14px Inter, sans-serif; outline: none; transition: border-color .15s, box-shadow .15s;
}
textarea.input { resize: vertical; min-height: 70px; }
.input:focus, .select:focus { border-color: var(--berry); box-shadow: 0 0 0 3px color-mix(in srgb, var(--berry) 18%, transparent); }
.field { display: grid; gap: 5px; margin-bottom: 12px; }
.field > span { font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.check { display: flex; align-items: flex-start; gap: 9px; cursor: pointer; margin-bottom: 10px; }
.check input { width: 17px; height: 17px; margin: 1px 0 0; accent-color: var(--berry); flex: none; }
.money-in { position: relative; }
.money-in span { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--text-3); }
.money-in .input { padding-left: 24px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.span2 { grid-column: span 2; }

/* ---------- cards ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px; margin-bottom: 16px; }
.card.flush { padding: 0; overflow: hidden; }
.card-h { display: flex; align-items: center; gap: 10px; justify-content: space-between; margin-bottom: 12px; }
.card-h.pad { padding: 14px 18px 0; margin-bottom: 8px; }
.card-h h3 { margin: 0; font-size: 15px; font-weight: 700; display: flex; align-items: center; gap: 7px; }
.card-h h3 .ic { width: 16px; height: 16px; }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.cols > * { min-width: 0; }
.cols.wide-left { grid-template-columns: 1.6fr 1fr; }
.banner {
  display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: var(--radius); margin-bottom: 16px;
  background: color-mix(in srgb, var(--gold) 16%, var(--surface)); border: 1px solid color-mix(in srgb, var(--gold) 45%, transparent);
}
.banner .ic { color: var(--warn); }
.hint { display: flex; align-items: center; gap: 8px; margin-top: 12px; padding: 9px 12px; border-radius: 9px; background: var(--surface-2); color: var(--text-2); font-size: 13px; }
.hint .ic { color: var(--warn); }
.note { margin-top: 10px; padding: 9px 11px; border-radius: 8px; background: var(--surface-2); border-left: 3px solid var(--gold); white-space: pre-wrap; font-size: 13px; color: var(--text-2); }
.empty { display: grid; justify-items: center; gap: 8px; text-align: center; color: var(--text-3); padding: 30px 10px; }
.empty .ic { width: 30px; height: 30px; opacity: .6; }
.empty p { margin: 0; max-width: 360px; }
.empty.small { padding: 18px 10px; }
.empty.small .ic { width: 22px; height: 22px; }

/* ---------- KPIs ---------- */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 16px; }
.kpis.two { grid-template-columns: 1fr 1fr; margin: 0; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px; position: relative; overflow: hidden; }
.kpi::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--pine-3); }
.kpi.k-good::before { background: var(--ok); }
.kpi.k-warn::before { background: var(--berry); }
.kpi-label { font-size: 12px; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: .06em; }
.kpi-value { font: 800 26px/1.2 var(--display); font-variation-settings: "wdth" 85; margin-top: 3px; font-variant-numeric: tabular-nums; }
.kpi-sub { font-size: 12.5px; color: var(--text-3); }

/* ---------- pipeline ---------- */
.pipe { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.pipe-step { display: grid; gap: 2px; padding: 12px; border-radius: 10px; text-decoration: none; background: var(--surface-2); border: 1px solid var(--line); transition: transform .12s, border-color .12s; }
.pipe-step:hover { transform: translateY(-1px); border-color: var(--text-3); }
.pipe-step b { font: 800 24px/1 var(--display); }
.pipe-step span { font-size: 12px; color: var(--text-2); }
.pipe-step.tone-blue b { color: var(--blue); }
.pipe-step.tone-gold b { color: var(--warn); }
.pipe-step.tone-green b { color: var(--ok); }
.pipe-step.tone-gray b { color: var(--text-3); }

/* ---------- badges, chips ---------- */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 99px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.badge .ic { width: 12px; height: 12px; }
.tone-gray { background: var(--surface-3); color: var(--text-2); }
.tone-blue { background: color-mix(in srgb, var(--blue) 14%, transparent); color: var(--blue); }
.tone-gold { background: color-mix(in srgb, var(--gold) 26%, transparent); color: var(--warn); }
.tone-green { background: color-mix(in srgb, var(--ok) 15%, transparent); color: var(--ok); }
.tone-red { background: color-mix(in srgb, var(--bad) 14%, transparent); color: var(--bad); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 99px; border: 1px solid var(--line);
  background: var(--surface); color: var(--text-2); font: 500 13px Inter, sans-serif; cursor: pointer; text-decoration: none;
}
.chip b { font-weight: 600; color: var(--text-3); font-size: 12px; }
.chip:hover { border-color: var(--text-3); }
.chip.on { background: var(--pine); border-color: var(--pine); color: #fff; }
.chip.on b { color: var(--gold); }
.chip .x { display: inline-grid; place-items: center; border: 0; background: none; color: inherit; padding: 0; cursor: pointer; opacity: .7; }
.chip .x .ic { width: 13px; height: 13px; }
.type-dot { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 6px; font-size: 10.5px; font-weight: 700; flex: none; }
.type-dot.res { background: color-mix(in srgb, var(--ok) 15%, transparent); color: var(--ok); }
.type-dot.com { background: color-mix(in srgb, var(--blue) 15%, transparent); color: var(--blue); }
.seg { display: inline-flex; background: var(--surface-3); border-radius: 10px; padding: 3px; }
.seg-b { border: 0; background: none; padding: 6px 12px; border-radius: 8px; font: 600 13px Inter, sans-serif; color: var(--text-2); cursor: pointer; }
.seg-b.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }

/* ---------- tables ---------- */
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 12px; }
.toolbar .chips { margin: 0; }
.search { position: relative; flex: 1; min-width: 220px; max-width: 420px; }
.search .ic { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--text-3); width: 16px; height: 16px; }
.search .input { padding-left: 34px; }
.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-size: 11.5px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--text-3); padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--surface-2); white-space: nowrap; }
.tbl td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl th.r, .tbl td.r { text-align: right; }
.tbl tr.click { cursor: pointer; }
.tbl tr.click:hover td { background: var(--surface-2); }
.tbl.compact td { padding: 8px 0; }
.tbl td.clip { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who { display: flex; align-items: center; gap: 9px; }

/* ---------- rows, agenda ---------- */
.row-line { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line); width: 100%; background: none; border-left: 0; border-right: 0; border-bottom: 0; text-align: left; font: inherit; color: inherit; }
.row-line:first-child { border-top: 0; }
.row-line.click { cursor: pointer; }
.row-line.click:hover { background: var(--surface-2); }
.row-line.wrap { flex-wrap: wrap; }
.ag-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.ag-row:first-child, .ag-label + .ag-row { border-top: 0; }
.ag-date { width: 46px; flex: none; text-align: center; border-radius: 9px; background: var(--surface-2); border: 1px solid var(--line); padding: 4px 0; }
.ag-date b { display: block; font: 800 19px/1.1 var(--display); }
.ag-date span { font-size: 11px; text-transform: uppercase; color: var(--text-3); font-weight: 600; }
.ag-row.late .ag-date { border-color: color-mix(in srgb, var(--bad) 45%, transparent); background: color-mix(in srgb, var(--bad) 8%, var(--surface)); }
.ag-main { flex: 1; min-width: 0; }
.ag-top { display: flex; align-items: center; gap: 8px; margin-bottom: 2px; }
.ag-name { font-weight: 700; color: var(--text) !important; }
.ag-act { display: flex; gap: 6px; align-items: center; }
.ag-group { margin-bottom: 8px; padding-bottom: 6px; border-bottom: 1px dashed var(--line); }
.ag-label { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.ag-label .ic { width: 14px; height: 14px; }

/* ---------- job page ---------- */
.stage-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin-bottom: 16px; }
.steps { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.steps span { display: inline-flex; align-items: center; gap: 6px; color: var(--text-3); font-size: 13px; }
.steps span i { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--line); }
.steps span.done { color: var(--text); font-weight: 600; }
.steps span.done .ic { width: 16px; height: 16px; color: var(--ok); }
.contact { display: grid; gap: 7px; }
.contact > b { font-size: 15px; display: flex; align-items: center; gap: 8px; }
.contact .line { display: flex; align-items: center; gap: 9px; color: var(--text-2); text-decoration: none; }
.contact .line .ic { width: 16px; height: 16px; color: var(--text-3); }
.contact .line a:first-of-type { color: var(--text-2); }
.kv { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); }
.kv:first-of-type { border-top: 0; }
.kv > span { width: 86px; color: var(--text-3); font-size: 13px; flex: none; }
.kv > b { flex: 1; font-weight: 600; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.kv .ic { width: 15px; height: 15px; color: var(--text-3); }
.pay-sum { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 10px; }
.pay-sum div { display: grid; }
.pay-sum b { font: 800 20px/1.2 var(--display); font-variation-settings: "wdth" 85; }
.bar { height: 7px; border-radius: 9px; background: var(--surface-3); overflow: hidden; margin-bottom: 8px; }
.bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--ok), #6fcf97); border-radius: 9px; }
.items { display: grid; }
.item { display: flex; align-items: center; gap: 10px; border-top: 1px solid var(--line); padding: 8px 0; }
.item:first-child { border-top: 0; }
.item > input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--ok); flex: none; margin: 0; }
.item-main { flex: 1; min-width: 0; display: grid; gap: 1px; text-align: left; background: none; border: 0; padding: 0; font: inherit; color: inherit; cursor: pointer; }
.item-main b { font-size: 14px; }
.item-main span { font-size: 12.5px; color: var(--text-3); }
.item-main:hover b { color: var(--blue); }
.item.is-down .item-main b, .item.is-down .item-main span { text-decoration: line-through; color: var(--text-3); }
.zip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 99px; border: 1px solid var(--line); font-size: 12px; font-weight: 600; white-space: nowrap; background: var(--surface); }
.zip i { width: 11px; height: 11px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .25); }
.bin { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--text-3); white-space: nowrap; }
.bin .ic { width: 13px; height: 13px; }
.add-item { display: flex; gap: 8px; margin-top: 10px; }
.add-item.map { display: grid; grid-template-columns: 1.3fr 1.2fr 100px 70px auto; gap: 6px; }
.add-item.map .input, .add-item.map .select { padding: 7px 9px; font-size: 13px; }
.disc { display: flex; gap: 6px; }
.disc .input { flex: 1; }
.disc .select { width: 90px; }
.sub-h { font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); margin: 12px 0 2px; }
.nav-badge.gold { background: var(--gold); color: #3b2a00; }
.pay-sum s { color: var(--text-3); }

/* ---------- pricing ---------- */
.rates { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
.rates > div { display: grid; gap: 2px; padding: 12px 14px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); }
.rates b { font: 800 24px/1.2 var(--display); font-variation-settings: "wdth" 85; }
.rates b small { font: 500 13px Inter, sans-serif; color: var(--text-3); }
.tbl.hist th:first-child, .tbl.hist td:first-child { padding-left: 0; }
.tbl.hist th { background: none; }
.badge.kind { font-size: 11px; padding: 1px 7px; vertical-align: 1px; }

/* ---------- photos ---------- */
.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.pcell { position: relative; aspect-ratio: 4 / 3; border: 0; padding: 0; border-radius: 10px; overflow: hidden; cursor: pointer; background: var(--surface-3); }
.pcell img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .25s; }
.pcell:hover img { transform: scale(1.04); }
.pmeta { position: absolute; left: 0; right: 0; bottom: 0; display: flex; flex-wrap: wrap; gap: 4px; align-items: center; padding: 18px 7px 6px; background: linear-gradient(transparent, rgba(0, 0, 0, .7)); color: #fff; text-align: left; }
.pmeta b { width: 100%; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pmeta i { font-style: normal; font-size: 10.5px; font-weight: 600; background: rgba(255, 255, 255, .2); padding: 1px 6px; border-radius: 99px; backdrop-filter: blur(4px); }
.tag-pick { display: flex; flex-wrap: wrap; gap: 6px; }
.tag-pick label { cursor: pointer; }
.tag-pick input { position: absolute; opacity: 0; pointer-events: none; }
.tag-pick span { display: inline-block; padding: 5px 11px; border-radius: 99px; border: 1px solid var(--line); font-size: 13px; color: var(--text-2); background: var(--surface); }
.tag-pick input:checked + span { background: var(--pine); border-color: var(--pine); color: #fff; }
.tag-pick input:focus-visible + span { outline: 2px solid var(--berry); outline-offset: 2px; }
.upload-preview { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; margin-bottom: 14px; }
.upload-preview img, .upload-preview span { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 7px; background: var(--surface-3); display: grid; place-items: center; color: var(--text-3); font-weight: 600; }

/* lightbox */
.lb { position: fixed; inset: 0; z-index: 60; display: grid; grid-template-columns: 1fr 340px; background: rgba(8, 12, 10, .94); }
.lb-stage { position: relative; display: grid; place-items: center; min-height: 0; padding: 20px; }
.lb-stage img { max-width: 100%; max-height: calc(100vh - 40px); object-fit: contain; border-radius: 6px; }
.lb-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 46px; height: 46px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .14); color: #fff; display: grid; place-items: center; cursor: pointer; }
.lb-nav:hover { background: rgba(255, 255, 255, .26); }
.lb-nav.prev { left: 16px; }
.lb-nav.next { right: 16px; }
.lb-close { position: absolute; top: 14px; left: 14px; background: rgba(255, 255, 255, .14); border: 0; color: #fff; }
.lb-side { background: var(--surface); padding: 22px 20px; overflow-y: auto; }
.lb-side h3 { margin: 4px 0 2px; font-size: 18px; }
.lb-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 6px; }

/* ---------- modal ---------- */
body.modal-open { overflow: hidden; }
.modal-back { position: fixed; inset: 0; background: rgba(10, 16, 13, .5); z-index: 50; animation: fade .15s; }
.modal {
  position: fixed; z-index: 51; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(480px, calc(100vw - 24px)); max-height: calc(100vh - 40px);
  display: flex; flex-direction: column; background: var(--surface); border-radius: 14px; box-shadow: 0 30px 80px rgba(0, 0, 0, .35); animation: pop .16s;
}
.modal.wide { width: min(640px, calc(100vw - 24px)); }
.modal header { display: flex; align-items: center; gap: 10px; padding: 16px 18px 6px; }
.modal header h3 { flex: 1; margin: 0; font-size: 17px; }
.modal header .btn-icon { border: 0; }
.modal-body { padding: 8px 18px; overflow-y: auto; }
.modal-body p { margin-top: 0; }
.modal footer { display: flex; align-items: center; gap: 8px; padding: 12px 18px 16px; border-top: 1px solid var(--line); }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translate(-50%, -48%) scale(.98); } }

/* ---------- toasts ---------- */
#toasts { position: fixed; z-index: 80; right: 18px; bottom: 18px; display: grid; gap: 8px; justify-items: end; }
.toast { display: flex; align-items: center; gap: 9px; max-width: 380px; padding: 10px 14px; border-radius: 10px; background: #1d2a24; color: #fff; box-shadow: 0 10px 30px rgba(0, 0, 0, .25); font-size: 13.5px; animation: pop2 .2s; transition: opacity .35s, transform .35s; }
.toast .ic { color: #6fcf97; width: 17px; height: 17px; }
.toast.error { background: #5a1520; }
.toast.error .ic { color: #ffb3bd; }
.toast.out { opacity: 0; transform: translateY(8px); }
@keyframes pop2 { from { opacity: 0; transform: translateY(8px); } }

/* ---------- auth ---------- */
.auth { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 20px; background: radial-gradient(ellipse 70% 50% at 50% 20%, #175339, transparent 70%), var(--pine); }
.auth-card { width: min(400px, 100%); background: var(--surface); border-radius: 16px; padding: 26px 24px; box-shadow: 0 30px 80px rgba(0, 0, 0, .35); }
.auth-logo { width: 190px; display: block; margin: -4px auto 14px; filter: drop-shadow(0 2px 6px rgba(0, 0, 0, .25)); }
.auth-card h2 { margin: 0 0 4px; font: 800 22px var(--display); text-align: center; }
.auth-card > p { text-align: center; margin: 0 0 16px; }
.auth-links { display: flex; gap: 10px; margin-top: 14px; font-size: 13px; }
.form-error { background: color-mix(in srgb, var(--bad) 12%, transparent); color: var(--bad); padding: 9px 11px; border-radius: 8px; font-size: 13px; margin-bottom: 12px; }
.form-note { background: var(--surface-2); padding: 9px 11px; border-radius: 8px; font-size: 13px; margin-bottom: 12px; }
.spinner { width: 28px; height: 28px; margin: 18px auto; border-radius: 50%; border: 3px solid var(--surface-3); border-top-color: var(--berry); animation: spin .8s linear infinite; }
.spinner.sm { width: 20px; height: 20px; margin: 8px 0; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .pipe { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; z-index: 40; left: 0; top: 0; width: 260px; transform: translateX(-100%); transition: transform .22s; }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .scrim { display: block; position: fixed; inset: 0; z-index: 39; background: rgba(0, 0, 0, .45); }
  .menu-btn.btn-icon { display: inline-grid; }
  .main { padding: 14px 14px 80px; }
  .cols, .cols.wide-left { grid-template-columns: 1fr; }
  .lb { grid-template-columns: 1fr; grid-template-rows: 1fr auto; }
  .lb-side { max-height: 46vh; }
  .lb-stage img { max-height: 50vh; }
}
@media (max-width: 640px) {
  .topbar { flex-wrap: wrap; }
  .page-actions { width: 100%; justify-content: flex-start; }
  .titles h1 { font-size: 22px; }
  .kpi-value { font-size: 21px; }
  .pipe { grid-template-columns: repeat(2, 1fr); }
  .grid2 { grid-template-columns: 1fr; }
  .span2 { grid-column: auto; }
  .upload-preview { grid-template-columns: repeat(4, 1fr); }
  .pgrid { grid-template-columns: repeat(2, 1fr); }
  .ag-act .btn-icon { display: none; }
  .add-item.map { grid-template-columns: 1fr 1fr; }
  .add-item.map .input:first-child, .add-item.map .input[name=text] { grid-column: span 2; }
  /* tables become stacked cards */
  .tbl thead { display: none; }
  .tbl, .tbl tbody, .tbl tr, .tbl td { display: block; width: 100%; }
  .tbl tr { padding: 10px 14px; border-bottom: 1px solid var(--line); }
  .tbl td { border: 0; padding: 2px 0; display: flex; justify-content: space-between; gap: 12px; text-align: right; }
  .tbl td::before { content: attr(data-l); color: var(--text-3); font-size: 12px; text-align: left; }
  .tbl td:first-child { text-align: left; }
  .tbl td:first-child::before { display: none; }
  .tbl td.clip { max-width: none; white-space: normal; }
  .tbl.compact td::before { display: none; }
}

/* ---------- job scope pills ---------- */
.pill { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 7px; font-size: 12.5px; font-weight: 600; line-height: 1.3; white-space: nowrap; }
.pill.ghost { background: transparent; color: var(--text-3); border: 1px dashed var(--line); }
.pill.ghost .ic { width: 12px; height: 12px; }
.pills { display: flex; flex-wrap: wrap; gap: 5px; }
.pills.sm .pill { font-size: 11px; padding: 2px 8px; }
.pills.sm { margin-top: 5px; }
.scope-cell { cursor: pointer; min-width: 200px; }
.scope-cell:hover .pill.ghost { color: var(--text); border-color: var(--text-3); }
.scope-cell .clip { max-width: 280px; margin-top: 4px; }
.scope-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.scope-row .pills { cursor: pointer; padding: 4px; margin: -4px; border-radius: 9px; }
.scope-row .pills:hover { background: var(--surface-3); }
.scope-btn { display: flex; flex-wrap: wrap; gap: 5px; min-height: 40px; align-items: center; text-align: left; cursor: pointer; }
.scope-filter { width: auto; min-width: 150px; }
.scope-set .row-line { padding: 6px 0; }
.swatch { position: relative; width: 22px; height: 22px; border-radius: 50%; flex: none; cursor: pointer; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .2); }
.swatch input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; border: 0; padding: 0; }

/* ---------- popovers ---------- */
.pop {
  position: fixed; z-index: 95; background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: 0 18px 50px rgba(15, 25, 20, .22), 0 2px 6px rgba(15, 25, 20, .08); animation: popIn .14s ease-out;
}
@keyframes popIn { from { opacity: 0; transform: translateY(-4px) scale(.98); } }
.pop.sheet { left: 0 !important; right: 0; bottom: 0; top: auto !important; border-radius: 18px 18px 0 0; padding-bottom: env(safe-area-inset-bottom); animation: sheetIn .2s ease-out; }
@keyframes sheetIn { from { transform: translateY(30px); opacity: 0; } }

/* date picker */
.dp-btn { display: flex; align-items: center; gap: 9px; text-align: left; cursor: pointer; }
.dp-btn .ic { width: 16px; height: 16px; color: var(--text-3); }
.dp-pop { width: 296px; padding: 12px; }
.dp-pop.sheet { width: auto; padding: 16px 16px 20px; }
.dp-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.dp-head b { font: 700 15px Inter, sans-serif; }
.dp-head button { width: 32px; height: 32px; border-radius: 9px; border: 0; background: none; color: var(--text-2); display: grid; place-items: center; cursor: pointer; }
.dp-head button:hover { background: var(--surface-3); }
.dp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.dp-grid > span { text-align: center; font-size: 11px; font-weight: 600; color: var(--text-3); padding: 4px 0 6px; }
.dp-day { aspect-ratio: 1; border: 0; background: none; border-radius: 10px; font: 500 13.5px Inter, sans-serif; color: var(--text); cursor: pointer; font-variant-numeric: tabular-nums; }
.dp-day:hover { background: var(--surface-3); }
.dp-day.out { color: var(--text-3); opacity: .55; }
.dp-day.today { box-shadow: inset 0 0 0 1.5px var(--berry); font-weight: 700; }
.dp-day.sel { background: var(--pine); color: #fff; font-weight: 700; box-shadow: none; }
.dp-quick { display: flex; gap: 6px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.dp-quick button { flex: 1; border: 1px solid var(--line); background: var(--surface-2); border-radius: 8px; padding: 6px 4px; font: 600 12px Inter, sans-serif; color: var(--text-2); cursor: pointer; }
.dp-quick button:hover { border-color: var(--text-3); color: var(--text); }
.dp-quick .clear { flex: .8; color: var(--bad); }

/* scope picker */
.scope-pop { width: 290px; overflow: hidden; }
.scope-pop.sheet { width: auto; }
.sp-search { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.sp-search .ic { color: var(--text-3); width: 17px; height: 17px; }
.sp-q { flex: 1; border: 0; outline: none; background: none; font: 15px Inter, sans-serif; color: var(--text); }
.sp-list { max-height: 330px; overflow-y: auto; padding: 6px; }
.sp-item { display: flex; align-items: center; gap: 8px; width: 100%; padding: 7px 8px; border: 0; background: none; border-radius: 9px; cursor: pointer; text-align: left; font: inherit; color: inherit; }
.sp-item:hover { background: var(--surface-2); }
.sp-item .pill { font-size: 13.5px; padding: 4px 11px; }
.sp-check { margin-left: auto; width: 18px; height: 18px; color: var(--text-2); }
.sp-foot { display: flex; justify-content: flex-end; padding: 6px 10px; border-top: 1px solid var(--line); }
.sp-edit { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; color: var(--text-2); }
.sp-edit:hover { background: var(--surface-3); }

/* ---------- month calendar ---------- */
.cal { padding: 18px; }
.cal-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.cal-head h3 { margin: 0; font: 800 22px var(--display); font-variation-settings: "wdth" 85; }
.cal-legend { display: flex; gap: 16px; font-size: 12px; color: var(--text-3); margin-bottom: 12px; }
.cal-legend span { display: inline-flex; align-items: center; gap: 6px; }
.cal-legend i { width: 9px; height: 9px; border-radius: 3px; }
.cal-legend i.install, .cal-dots i.install { background: var(--blue); }
.cal-legend i.removal, .cal-dots i.removal { background: var(--gold); }
.cal-legend i.done, .cal-dots i.done { background: var(--ok); }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.cal-dow { font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); padding: 0 4px 2px; }
.cal-cell {
  min-height: 104px; display: flex; flex-direction: column; gap: 4px; padding: 7px; text-align: left; cursor: pointer; overflow: hidden;
  background: var(--surface-2); border: 1px solid transparent; border-radius: 12px; font: inherit; color: inherit; transition: border-color .12s, background .12s;
}
.cal-cell:hover { border-color: var(--line); background: var(--surface); }
.cal-cell.out { opacity: .45; }
.cal-cell.sel { border-color: var(--pine); background: var(--surface); box-shadow: 0 0 0 2px color-mix(in srgb, var(--pine) 18%, transparent); }
.cal-n { font: 600 13px Inter, sans-serif; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; font-variant-numeric: tabular-nums; }
.cal-cell.today .cal-n { background: var(--berry); color: #fff; }
.cal-evs { display: grid; gap: 3px; min-width: 0; }
.cal-ev { display: flex; align-items: center; gap: 3px; font-size: 11.5px; font-weight: 600; padding: 3px 6px; border-radius: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-ev .ic { width: 11px; height: 11px; flex: none; }
.cal-ev.install { background: color-mix(in srgb, var(--blue) 14%, var(--surface)); color: var(--blue); }
.cal-ev.removal { background: color-mix(in srgb, var(--gold) 30%, var(--surface)); color: var(--warn); }
.cal-ev.done { background: color-mix(in srgb, var(--ok) 13%, var(--surface)); color: var(--ok); }
.cal-ev.late { box-shadow: inset 2px 0 0 var(--bad); }
.cal-more { font-size: 11px; color: var(--text-3); padding-left: 4px; }
.cal-dots { display: none; gap: 3px; }
.cal-dots i { width: 6px; height: 6px; border-radius: 50%; }
@media (max-width: 760px) {
  .cal { padding: 12px; }
  .cal-grid { gap: 3px; }
  .cal-cell { min-height: 54px; align-items: center; padding: 5px 2px; border-radius: 10px; }
  .cal-evs { display: none; }
  .cal-dots { display: flex; }
  .cal-dow { text-align: center; font-size: 10.5px; padding: 0; }
  .page-actions .seg { flex: 1; }
  .page-actions .seg-b { flex: 1; }
}
.seg-b { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.seg-b .ic { width: 15px; height: 15px; }

.tbl td[data-l="Phone"] { white-space: nowrap; }

/* ---------- estimates ---------- */
.title-badge .badge { vertical-align: 5px; font-family: Inter, sans-serif; }
.est-thumb { width: 64px; height: 44px; object-fit: cover; border-radius: 7px; display: block; background: var(--surface-3); }
.est-thumb.none { display: grid; place-items: center; color: var(--text-3); }
.thumb-td { width: 76px; }
.est-layout { display: grid; grid-template-columns: minmax(360px, 440px) 1fr; gap: 18px; align-items: start; }
.est-preview { position: sticky; top: 16px; }
.est-paper { background: #e9e6df; border-radius: var(--radius); padding: 18px; overflow: auto; max-height: calc(100vh - 40px); }
[data-theme="dark"] .est-paper { background: #0a110e; }
.mock-prev { width: 100%; max-height: 220px; object-fit: cover; border-radius: 9px; margin-bottom: 10px; display: block; }
.li-head, .li-row { display: grid; grid-template-columns: 1fr 52px 96px 74px 26px; gap: 6px; align-items: center; }
.li-head { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--text-3); margin-bottom: 4px; }
.li-row { margin-bottom: 6px; }
.li-row .input { padding: 7px 9px; font-size: 13.5px; }
.li-row .input.r { text-align: right; }
.li-amt { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; font-size: 13.5px; }
.li-quick { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; margin-top: 10px; }
.li-quick button { border: 0; background: none; padding: 0; cursor: pointer; }
.li-quick button:hover .pill { filter: brightness(1.1); transform: translateY(-1px); }
.est-totals { display: flex; justify-content: flex-end; gap: 16px; align-items: baseline; border-top: 1px solid var(--line); margin-top: 6px; padding-top: 10px; color: var(--text-2); font-size: 13px; }
.est-totals b { font: 800 20px var(--display); color: var(--text); }

/* the estimate document itself (always light, like paper) */
.est-doc {
  --d-pine: #0f3a2a; --d-berry: #b3202f; --d-gold: #f4b63f; --d-ink: #1c1a17; --d-muted: #6b665c; --d-line: #e3ded2;
  width: 100%; max-width: 816px; margin: 0 auto; background: #fff; color: var(--d-ink); border-radius: 6px; overflow: hidden;
  box-shadow: 0 10px 40px rgba(0, 0, 0, .15); font: 13.5px/1.5 Inter, Arial, sans-serif;
}
.ed-head { background: var(--d-pine); color: #e8efe9; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 22px 36px; }
.ed-head img { height: 74px; width: auto; display: block; }
.ed-contact { display: grid; text-align: right; font-size: 12.5px; line-height: 1.55; }
.ed-contact b { color: #fff; font-size: 13.5px; }
.ed-lights { display: flex; justify-content: space-around; padding: 6px 30px; background: var(--d-pine); border-top: 1px solid rgba(255, 255, 255, .08); }
.ed-lights i { width: 7px; height: 11px; border-radius: 50% 50% 45% 45%; box-shadow: 0 0 8px currentColor; opacity: .95; }
.ed-meta { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; padding: 26px 36px 10px; }
.ed-meta h1 { margin: 0; font: 800 34px/1 var(--display); font-variation-settings: "wdth" 75; letter-spacing: .01em; text-transform: uppercase; color: var(--d-pine); }
.ed-num { color: var(--d-berry); font-weight: 700; margin-top: 4px; }
.ed-meta dl { display: flex; gap: 22px; margin: 0; }
.ed-meta dt { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--d-muted); }
.ed-meta dd { margin: 2px 0 0; font-weight: 600; }
.ed-to { display: grid; margin: 10px 36px 0; padding: 14px 16px; background: #f7f5f0; border-radius: 8px; border-left: 3px solid var(--d-gold); }
.ed-lbl { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--d-muted); }
.ed-to b { font-size: 15px; }
.ed-to span:not(.ed-lbl) { color: #4a453d; }
.ed-title { margin: 22px 36px 0; font: 800 21px var(--display); font-variation-settings: "wdth" 85; color: var(--d-ink); }
.ed-mock { margin: 16px 36px 0; }
.ed-mock img { width: 100%; max-height: 430px; object-fit: cover; border-radius: 8px; display: block; }
.ed-mock figcaption { font-size: 11px; color: var(--d-muted); margin-top: 6px; font-style: italic; }
.ed-items { width: calc(100% - 72px); margin: 22px 36px 0; border-collapse: collapse; }
.ed-items th { text-align: left; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--d-muted); padding: 8px 10px; border-bottom: 2px solid var(--d-pine); }
.ed-items td { padding: 10px; border-bottom: 1px solid var(--d-line); }
.ed-items .r { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ed-items tfoot td { border-bottom: 0; padding: 6px 10px; color: #4a453d; }
.ed-items tfoot tr:first-child td { padding-top: 12px; }
.ed-items tfoot .ed-disc td { color: var(--d-berry); }
.ed-items tfoot .total td { font: 800 19px var(--display); color: var(--d-ink); border-top: 2px solid var(--d-ink); padding-top: 10px; }
.ed-notes { margin: 16px 36px 0; padding: 12px 14px; background: #fff8e6; border-radius: 8px; white-space: pre-wrap; font-size: 13px; }
.ed-incl { margin: 26px 36px 0; padding: 20px; border-radius: 10px; background: var(--d-pine); color: #d9e6de; }
.ed-incl h3 { margin: 0 0 14px; font: 800 15px var(--display); letter-spacing: .06em; text-transform: uppercase; color: var(--d-gold); }
.ed-steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.ed-steps b { display: block; color: #fff; font-size: 13px; margin: 6px 0 3px; }
.ed-steps p { margin: 0; font-size: 11.5px; line-height: 1.45; }
.ed-ic { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: rgba(244, 182, 63, .16); color: var(--d-gold); }
.ed-ic .ic { width: 17px; height: 17px; }
.ed-badges { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 14px 36px 0; }
.ed-badges > div { display: flex; gap: 10px; align-items: center; padding: 12px 14px; border: 1.5px solid var(--d-line); border-radius: 10px; }
.ed-badges .ic { width: 26px; height: 26px; color: var(--d-berry); flex: none; }
.ed-badges b { display: block; font-size: 13.5px; }
.ed-badges span { font-size: 12px; color: #4a453d; display: grid; }
.ed-terms { margin: 16px 36px 0; font-size: 11px; color: var(--d-muted); }
.ed-sign { display: grid; grid-template-columns: 2fr 1fr; gap: 30px; margin: 34px 36px 0; font-size: 11px; color: var(--d-muted); text-transform: uppercase; letter-spacing: .08em; font-weight: 600; }
.ed-sign span { display: block; border-bottom: 1.5px solid #999; height: 28px; margin-bottom: 5px; }
.ed-foot { margin-top: 28px; padding: 14px 36px; background: var(--d-berry); color: #fff; font-size: 12.5px; text-align: center; font-weight: 600; }
@media (max-width: 1100px) { .est-layout { grid-template-columns: 1fr; } .est-preview { position: static; } .est-paper { max-height: none; } }
@media (max-width: 640px) {
  .est-paper { padding: 8px; }
  .ed-head, .ed-meta { padding-left: 18px; padding-right: 18px; flex-wrap: wrap; }
  .ed-contact { text-align: left; }
  .ed-head img { height: 60px; }
  .ed-to, .ed-title, .ed-mock, .ed-notes, .ed-incl, .ed-badges, .ed-terms, .ed-sign { margin-left: 18px; margin-right: 18px; }
  .ed-items { width: calc(100% - 36px); margin-left: 18px; }
  .ed-steps, .ed-badges { grid-template-columns: 1fr 1fr; }
  .li-head { display: none; }
  .li-row { grid-template-columns: 1fr 56px 90px 26px; }
  .li-row .li-amt { display: none; }
}

/* print just the estimate, letter size */
@media print {
  @page { size: letter; margin: .45in 0; }
  @page :first { margin-top: 0; }
  html, body { background: #fff !important; }
  body * { visibility: hidden; }
  .est-doc, .est-doc * { visibility: visible; }
  .est-doc { position: absolute; left: 0; top: 0; width: 8.5in; max-width: none; box-shadow: none; border-radius: 0; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .ed-mock img { max-height: 5.2in; }
  .est-paper { padding: 0; max-height: none; overflow: visible; background: none; }
  .ed-incl, .ed-badges, .ed-sign, .ed-items tr, .ed-mock, .ed-to { break-inside: avoid; }
  .ed-foot { break-before: avoid; }
  .ed-items { break-inside: avoid; }
  .ed-items tfoot { display: table-row-group; } /* totals print once, at the end */
}

/* ---------- "+ New" quick add (top bar, every page) ---------- */
.quick { position: relative; flex: none; }
.quick-btn { padding: 8px 14px 8px 11px; background: var(--pine); border-color: var(--pine); }
.quick-btn:hover { background: var(--pine-3); border-color: var(--pine-3); }
[data-theme="dark"] .quick-btn { background: var(--pine-3); border-color: var(--pine-3); }
.quick-menu {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 45; min-width: 200px; padding: 6px; display: none;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 18px 40px rgba(15, 25, 20, .18);
}
.quick.open .quick-menu { display: grid; animation: popIn .12s ease-out; }
.quick-menu button { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border: 0; background: none; border-radius: 8px; font: 500 14px Inter, sans-serif; color: var(--text); cursor: pointer; text-align: left; }
.quick-menu button:hover { background: var(--surface-2); }
.quick-menu .ic { width: 17px; height: 17px; color: var(--text-3); }
@media (max-width: 640px) {
  .topbar { position: relative; }
  .quick { position: absolute; top: 0; right: 0; }
  .titles { padding-right: 88px; }
}

.est-next { font: 700 16px Inter, sans-serif; color: var(--berry); padding: 8px 0; }

/* ---------- customer links ---------- */
.banner.ok { background: color-mix(in srgb, var(--ok) 12%, var(--surface)); border-color: color-mix(in srgb, var(--ok) 40%, transparent); }
.banner.ok .ic { color: var(--ok); }
.banner.info { background: color-mix(in srgb, var(--blue) 9%, var(--surface)); border-color: color-mix(in srgb, var(--blue) 30%, transparent); }
.banner.info .ic { color: var(--blue); }
.share-link { display: flex; gap: 8px; margin-bottom: 14px; }
.share-link .input { font-size: 13px; color: var(--text-2); }
.ed-sign .signed { border-bottom-color: #1c1a17 !important; font: italic 600 17px Georgia, serif; color: #1c1a17; text-transform: none; letter-spacing: 0; display: flex !important; align-items: flex-end; padding-bottom: 2px; }

/* ---------- estimate editor v2: wide, Edit / Preview tabs ---------- */
.est-work { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; align-items: start; }
.est-main { min-width: 0; }
.est-side { position: sticky; top: 16px; display: grid; gap: 0; }
.est-full { max-width: 900px; margin: 0 auto; }
.est-full .est-paper { max-height: none; }
.center { text-align: center; }
.li-list { display: grid; gap: 10px; }
.li-row {
  display: grid; grid-template-columns: 28px minmax(0, 1fr) 76px 130px 110px auto; gap: 12px; align-items: start;
  padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); margin: 0;
}
.li-row:focus-within { border-color: color-mix(in srgb, var(--berry) 55%, var(--line)); background: var(--surface); box-shadow: 0 0 0 3px color-mix(in srgb, var(--berry) 10%, transparent); }
.li-num { display: grid; place-items: center; width: 26px; height: 26px; margin-top: 7px; border-radius: 50%; background: var(--surface-3); font-size: 12px; font-weight: 700; color: var(--text-2); }
.li-desc { resize: none; min-height: 40px; line-height: 1.45; font-size: 14.5px; padding: 9px 11px; overflow: hidden; }
.li-f { display: grid; gap: 3px; margin: 0; }
.li-f > span { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--text-3); }
.li-f .input { padding: 8px 10px; font-size: 14.5px; }
.li-qty .input { text-align: center; }
.li-amt-f { text-align: right; }
.li-amt { font: 700 16px Inter, sans-serif; padding-top: 8px; font-variant-numeric: tabular-nums; }
.li-tools { display: flex; gap: 2px; padding-top: 18px; }
.li-tools .btn-icon.sm { width: 30px; height: 30px; }
.li-tools .btn-icon.sm:disabled { opacity: .3; cursor: default; }
.li-tools .danger:hover { color: var(--bad); }
.li-add {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; margin-top: 10px; padding: 12px; border-radius: 12px;
  border: 1.5px dashed var(--line); background: none; color: var(--text-2); font: 600 14px Inter, sans-serif; cursor: pointer;
}
.li-add:hover { border-color: var(--berry); color: var(--berry); background: color-mix(in srgb, var(--berry) 5%, transparent); }
.li-add .ic { width: 17px; height: 17px; }
.li-tip { margin: 10px 0 0; }
kbd { font: 600 11px Inter, sans-serif; padding: 1px 6px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; background: var(--surface); }
.est-sum .tot-lines { display: grid; gap: 6px; margin-bottom: 14px; }
.est-sum .tot-lines > div { display: flex; justify-content: space-between; font-size: 14px; color: var(--text-2); }
.est-sum .tot { border-top: 1px solid var(--line); padding-top: 10px; margin-top: 2px; align-items: baseline; }
.est-sum .tot span { font-weight: 600; color: var(--text); }
.est-sum .tot b { font: 800 30px var(--display); font-variation-settings: "wdth" 85; color: var(--text); }
.disc-row { grid-template-columns: 1fr 1fr; }
.disc-row .disc .select { width: 62px; }
textarea[data-autosize] { resize: none; overflow: hidden; }
.ed-items td:first-child { white-space: pre-line; }
@media (max-width: 1180px) {
  .est-work { grid-template-columns: 1fr; }
  .est-side { position: static; }
}
@media (max-width: 760px) {
  .li-row { grid-template-columns: 26px 1fr 1fr; gap: 8px 10px; }
  .li-row .li-desc { grid-column: 2 / -1; }
  .li-qty { grid-column: 2; }
  .li-price { grid-column: 3; }
  .li-amt-f { grid-column: 2; text-align: left; }
  .li-tools { grid-column: 3; justify-content: flex-end; padding-top: 8px; }
}
/* line item: description on its own full-width line, numbers underneath */
.li-row {
  grid-template-columns: 28px 90px 160px minmax(0, 1fr) auto;
  grid-template-areas: "num desc desc desc desc" ". qty price amt tools";
  gap: 8px 12px;
}
.li-row .li-num { grid-area: num; }
.li-row .li-desc { grid-area: desc; }
.li-row .li-qty { grid-area: qty; }
.li-row .li-price { grid-area: price; }
.li-row .li-amt-f { grid-area: amt; }
.li-row .li-tools { grid-area: tools; }
.est-work { grid-template-columns: minmax(0, 1fr) 320px; }
@media (max-width: 760px) {
  .li-row { grid-template-columns: 26px 1fr 1.4fr; grid-template-areas: "num desc desc" ". qty price" ". amt tools"; }
  .li-row .li-amt-f { text-align: left; }
}
textarea.input.li-desc { min-height: 40px; resize: none; }
.li-f .money-in .input { padding-left: 24px; }
