/* Cedar & Oak Joinery Workshop — Workshop Console
   Warm, tactile craft/editorial design system. No sidebar; top nav + Kanban board. */

:root{
  --walnut:#5C4033;
  --walnut-dark:#40261C;
  --walnut-light:#7A5B47;
  --cream:#F5E9DA;
  --cream-soft:#EFE1CD;
  --surface:#FBF4EA;
  --surface-raised:#FFFDF9;
  --ink:#2B2118;
  --ink-soft:#5A4B3D;
  --ink-faint:#8A7A68;
  --sage:#7A8B69;
  --sage-btn:#566B45;
  --sage-btn-hover:#465939;
  --sage-chip:#9BAE86;
  --sage-wash:#E7ECE0;
  --terracotta:#8C4A34;
  --terracotta-wash:#F3E2DA;
  --line:#DDCBAF;
  --line-soft:#E9DCC6;
  --shadow-sm: 0 1px 2px rgba(43,33,24,0.08), 0 1px 1px rgba(43,33,24,0.05);
  --shadow-md: 0 4px 14px rgba(43,33,24,0.10), 0 1px 3px rgba(43,33,24,0.08);
  --shadow-lg: 0 16px 40px rgba(43,33,24,0.16), 0 4px 12px rgba(43,33,24,0.08);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --font-head: 'Fraunces', 'Iowan Old Style', Georgia, serif;
  --font-body: 'Karla', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

*,*::before,*::after{ box-sizing:border-box; }
html{ -webkit-text-size-adjust:100%; }
body{
  margin:0;
  background:
    radial-gradient(ellipse 900px 500px at 12% -8%, rgba(122,139,105,0.08), transparent 60%),
    radial-gradient(ellipse 700px 480px at 100% 0%, rgba(92,64,51,0.07), transparent 55%),
    var(--cream);
  color:var(--ink);
  font-family:var(--font-body);
  font-size:15.5px;
  line-height:1.5;
  -webkit-font-smoothing:antialiased;
}
h1,h2,h3,h4{ font-family:var(--font-head); font-weight:600; color:var(--ink); margin:0; letter-spacing:-0.01em; }
p{ margin:0; }
button{ font-family:inherit; }
.skip-link{ position:absolute; left:-999px; top:0; background:var(--walnut); color:var(--cream); padding:10px 16px; border-radius:0 0 8px 0; z-index:999; }
.skip-link:focus{ left:0; }

/* subtle woodgrain texture used on a few surfaces */
.grain{ position:relative; }
.grain::before{
  content:"";
  position:absolute; inset:0; pointer-events:none; border-radius:inherit;
  background-image: repeating-linear-gradient(100deg, rgba(92,64,51,0.05) 0px, rgba(92,64,51,0.05) 1px, transparent 1px, transparent 7px);
  opacity:0.5;
}

/* ============ TOP BAR (no sidebar, ever) ============ */
.topbar{
  position:sticky; top:0; z-index:40;
  background:linear-gradient(180deg, var(--walnut) 0%, var(--walnut-dark) 100%);
  box-shadow:0 2px 10px rgba(43,33,24,0.22);
}
.topbar-inner{
  max-width:1360px; margin:0 auto;
  display:flex; align-items:center; gap:8px;
  padding:10px 20px;
}
.brand{ display:flex; align-items:center; gap:10px; background:none; border:0; cursor:pointer; padding:6px 6px; border-radius:10px; }
.brand:hover{ background:rgba(245,233,218,0.08); }
.brand .mark svg{ width:38px; height:38px; display:block; }
.brand-text{ display:flex; flex-direction:column; align-items:flex-start; line-height:1.15; }
.brand-text b{ font-family:var(--font-head); font-weight:600; font-size:17px; color:var(--cream); }
.brand-text small{ font-size:11px; color:#D8C4AE; letter-spacing:0.03em; }

.tabs{ display:flex; gap:2px; margin-left:12px; overflow-x:auto; scrollbar-width:none; flex:1; }
.tabs::-webkit-scrollbar{ display:none; }
.tab{
  appearance:none; border:0; background:transparent; color:#E4D3BE;
  font-size:14px; font-weight:600; padding:11px 15px; border-radius:9px; cursor:pointer;
  white-space:nowrap; min-height:44px;
}
.tab:hover{ background:rgba(245,233,218,0.10); color:var(--cream); }
.tab.active{ background:var(--cream); color:var(--walnut-dark); }

.btn-new-quote{ flex-shrink:0; }

.footer{ max-width:1360px; margin:40px auto 24px; padding:0 20px; }
.footer p{ font-size:12px; color:var(--ink-faint); text-align:center; }

/* ============ SCREENS ============ */
main{ display:block; }
.screen{ display:none; max-width:1360px; margin:0 auto; padding:28px 20px 60px; }
.screen.active{ display:block; }

.page-head{ display:flex; align-items:flex-end; justify-content:space-between; gap:16px; margin-bottom:22px; flex-wrap:wrap; }
.page-head h1{ font-size:30px; }
.page-head .sub{ color:var(--ink-soft); font-size:14px; margin-top:4px; }
.page-head-actions{ display:flex; gap:10px; flex-wrap:wrap; }

/* ============ BUTTONS ============ */
.btn{
  display:inline-flex; align-items:center; justify-content:center; gap:7px;
  border-radius:11px; border:1px solid transparent; cursor:pointer;
  font-family:var(--font-body); font-weight:700; font-size:13.5px;
  padding:10px 16px; min-height:44px; line-height:1;
  transition:transform .06s ease, box-shadow .12s ease, background .12s ease;
}
.btn:active{ transform:translateY(1px); }
.icn{ width:16px; height:16px; flex-shrink:0; vertical-align:-3px; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; }
.btn-primary{ background:var(--walnut); color:var(--cream); box-shadow:var(--shadow-sm); }
.btn-primary:hover{ background:var(--walnut-dark); }
.btn-accent{ background:var(--sage-btn); color:#fff; box-shadow:var(--shadow-sm); }
.btn-accent:hover{ background:var(--sage-btn-hover); }
.btn-ghost{ background:var(--surface); color:var(--ink); border-color:var(--line); }
.btn-ghost:hover{ background:var(--cream-soft); }
.btn-ghost.on-dark{ background:rgba(255,255,255,0.08); color:var(--cream); border-color:rgba(255,255,255,0.2); }
.btn-ghost.on-dark:hover{ background:rgba(255,255,255,0.16); }
.btn-text{ display:inline-flex; align-items:center; gap:6px; background:transparent; color:var(--walnut); border:0; padding:10px; min-height:44px; cursor:pointer; font-weight:700; font-size:13.5px; }
.btn-text:hover{ text-decoration:underline; }
.btn-danger-text{ display:inline-flex; align-items:center; gap:6px; background:transparent; color:var(--terracotta); border:0; padding:10px; min-height:44px; cursor:pointer; font-weight:700; font-size:13.5px; }
.btn-sm{ padding:7px 12px; font-size:12.5px; min-height:36px; }
.btn-icon-only{ padding:10px; min-width:44px; }
.btn:disabled{ opacity:0.45; cursor:not-allowed; }
.btn-block{ width:100%; }

/* ============ CARDS / SURFACES ============ */
.card{
  background:var(--surface-raised); border:1px solid var(--line-soft); border-radius:var(--radius-md);
  box-shadow:var(--shadow-sm);
}
.card-pad{ padding:20px; }

/* ============ DASHBOARD ============ */
.stat-row{ display:grid; grid-template-columns:repeat(4,1fr); gap:14px; margin-bottom:22px; }
.stat-card{ padding:18px 18px; border-radius:var(--radius-md); position:relative; overflow:hidden; }
.stat-card .stat-label{ font-size:12px; font-weight:700; letter-spacing:0.04em; text-transform:uppercase; color:var(--ink-soft); }
.stat-card .stat-value{ font-family:var(--font-head); font-size:clamp(18px,4.4vw,32px); font-weight:600; margin-top:6px; color:var(--ink); line-height:1.15; overflow-wrap:break-word; }
.stat-card .stat-note{ font-size:12px; color:var(--ink-faint); margin-top:4px; }
.stat-card.walnut{ background:linear-gradient(155deg, var(--walnut) 0%, var(--walnut-dark) 100%); }
.stat-card.walnut .stat-label{ color:#E4D3BE; }
.stat-card.walnut .stat-value{ color:var(--cream); }
.stat-card.walnut .stat-note{ color:#C9B49A; }

.dash-grid{ display:grid; grid-template-columns:1.4fr 1fr; gap:18px; align-items:start; }
.panel-title{ display:flex; align-items:center; justify-content:space-between; padding:16px 20px; border-bottom:1px solid var(--line-soft); }
.panel-title h2{ font-size:17px; }
.stage-mini-row{ display:grid; grid-template-columns:repeat(6,1fr); gap:8px; padding:18px 20px; }
.stage-mini{ text-align:center; padding:12px 6px; border-radius:12px; background:var(--cream-soft); border:1px solid var(--line-soft); }
.stage-mini .n{ font-family:var(--font-head); font-size:22px; font-weight:600; }
.stage-mini .l{ font-size:10.5px; color:var(--ink-soft); margin-top:3px; line-height:1.25; }
.activity-list{ padding:6px 10px 14px; }
.activity-item{ display:flex; gap:12px; padding:12px 10px; border-radius:10px; }
.activity-item:hover{ background:var(--cream-soft); }
.activity-dot{ width:9px; height:9px; border-radius:50%; margin-top:6px; flex-shrink:0; }
.activity-body b{ font-size:13.5px; }
.activity-body .meta{ font-size:12px; color:var(--ink-faint); margin-top:2px; }

.approval-row{ display:flex; align-items:center; justify-content:space-between; padding:13px 20px; border-top:1px solid var(--line-soft); gap:10px; }
.approval-row:first-child{ border-top:0; }
.approval-row .who{ font-size:13.5px; font-weight:700; }
.approval-row .what{ font-size:12px; color:var(--ink-soft); }

/* ============ BADGES / CHIPS ============ */
.badge{
  display:inline-flex; align-items:center; gap:6px; font-size:11.5px; font-weight:700;
  padding:4px 10px; border-radius:99px; letter-spacing:0.02em; white-space:nowrap;
}
.badge-dot{ width:7px; height:7px; border-radius:50%; flex-shrink:0; }
.badge-draft{ background:var(--cream-soft); color:var(--ink-soft); border:1px solid var(--line); }
.badge-sent{ background:#E7E2D8; color:var(--walnut-dark); border:1px solid var(--line); }
.badge-approved{ background:var(--sage-wash); color:var(--sage-btn-hover); border:1px solid #C7D3BB; }
.badge-converted{ background:var(--sage-wash); color:var(--sage-btn-hover); border:1px solid #C7D3BB; }
.badge-warn{ background:var(--terracotta-wash); color:var(--terracotta); border:1px solid #E1C3B6; }
.badge-stage{ background:var(--walnut); color:var(--cream); }
.badge-paid{ background:var(--sage-wash); color:var(--sage-btn-hover); border:1px solid #C7D3BB; }
.badge-due{ background:var(--terracotta-wash); color:var(--terracotta); border:1px solid #E1C3B6; }

/* ============ TABLE / LIST VIEWS ============ */
.toolbar{ display:flex; align-items:center; gap:10px; margin-bottom:16px; flex-wrap:wrap; }
.search-box{ position:relative; flex:1; min-width:220px; max-width:360px; }
.search-box svg{ position:absolute; left:12px; top:50%; transform:translateY(-50%); width:16px; height:16px; color:var(--ink-faint); }
.search-box input{ width:100%; padding:10px 12px 10px 36px; border-radius:11px; border:1px solid var(--line); background:var(--surface-raised); font-size:14px; min-height:44px; color:var(--ink); }
.search-box input:focus{ outline:2px solid var(--sage); outline-offset:1px; }
.filter-chip{ padding:9px 14px; border-radius:99px; border:1px solid var(--line); background:var(--surface-raised); font-size:12.5px; font-weight:700; color:var(--ink-soft); cursor:pointer; min-height:36px; }
.filter-chip.active{ background:var(--walnut); border-color:var(--walnut); color:var(--cream); }

.list-table{ width:100%; border-collapse:collapse; }
.list-table thead th{ text-align:left; font-size:11px; text-transform:uppercase; letter-spacing:0.05em; color:var(--ink-faint); font-weight:700; padding:0 16px 10px; }
.list-table tbody tr{ background:var(--surface-raised); cursor:pointer; }
.list-table tbody td{ padding:14px 16px; font-size:14px; border-top:1px solid var(--line-soft); }
.list-table tbody tr:hover td{ background:var(--cream-soft); }
.list-table tbody tr td:first-child{ border-radius:0; }
.list-table .row-title{ font-weight:700; }
.list-table .row-sub{ font-size:12px; color:var(--ink-faint); margin-top:2px; }
.list-wrap{ border-radius:var(--radius-md); overflow:hidden; box-shadow:var(--shadow-sm); border:1px solid var(--line-soft); }
.list-wrap .list-table thead{ background:var(--cream-soft); }
.list-wrap .list-table thead th{ padding:12px 16px; }

.empty-state{ text-align:center; padding:60px 20px; color:var(--ink-soft); }
.empty-state svg{ width:44px; height:44px; color:var(--ink-faint); margin-bottom:10px; }

/* ============ QUOTE BUILDER ============ */
.builder-grid{ display:grid; grid-template-columns:1fr 380px; gap:20px; align-items:start; }
.builder-section{ padding:20px; margin-bottom:16px; }
.builder-section h3{ font-size:15px; margin-bottom:14px; display:flex; align-items:center; gap:8px; }
.builder-section h3 svg{ width:17px; height:17px; color:var(--sage-btn); }
.field-grid{ display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.field{ display:flex; flex-direction:column; gap:5px; margin-bottom:12px; }
.field label{ font-size:11.5px; font-weight:700; color:var(--ink-soft); text-transform:uppercase; letter-spacing:0.03em; }
.field input, .field textarea, .field select{
  padding:10px 12px; border-radius:10px; border:1px solid var(--line); background:var(--surface-raised);
  font-family:var(--font-body); font-size:14.5px; color:var(--ink); min-height:44px;
}
.field textarea{ min-height:70px; resize:vertical; }
.field input:focus, .field textarea:focus, .field select:focus{ outline:2px solid var(--sage); outline-offset:1px; }

.line-item{ border:1px solid var(--line-soft); border-radius:var(--radius-sm); padding:16px; margin-bottom:14px; background:var(--cream-soft); position:relative; }
.line-item-top{ display:flex; gap:10px; align-items:flex-start; }
.line-item-top .field{ flex:1; margin-bottom:0; }
.line-item-remove{ background:none; border:0; color:var(--terracotta); cursor:pointer; padding:10px; min-width:44px; min-height:44px; border-radius:8px; }
.line-item-remove:hover{ background:var(--terracotta-wash); }
.line-item-nums{ display:grid; grid-template-columns:1fr 1fr 1fr; gap:10px; margin-top:10px; }

.swatch-label{ font-size:11.5px; font-weight:700; color:var(--ink-soft); text-transform:uppercase; letter-spacing:0.03em; margin:12px 0 8px; }
.swatch-grid{ display:grid; grid-template-columns:repeat(auto-fill,minmax(128px,1fr)); gap:8px; }
.swatch{
  display:flex; align-items:center; gap:9px; padding:9px 10px; border-radius:11px; border:1.5px solid var(--line);
  background:var(--surface-raised); cursor:pointer; text-align:left; min-height:44px;
}
.swatch:hover{ border-color:var(--walnut-light); }
.swatch.selected{ border-color:var(--sage-btn); background:var(--sage-wash); box-shadow:0 0 0 1px var(--sage-btn) inset; }
.swatch-chip{ width:22px; height:22px; border-radius:7px; flex-shrink:0; border:1px solid rgba(43,33,24,0.18); box-shadow:inset 0 0 0 1px rgba(255,255,255,0.25); }
.swatch-text b{ display:block; font-size:12.5px; font-weight:700; line-height:1.2; }
.swatch-text span{ display:block; font-size:10.5px; color:var(--ink-faint); }
.swatch.selected .swatch-text b{ color:var(--sage-btn-hover); }
.swatch-check{ margin-left:auto; width:16px; height:16px; color:var(--sage-btn); flex-shrink:0; visibility:hidden; }
.swatch.selected .swatch-check{ visibility:visible; }

.finish-chip{ width:22px; height:22px; border-radius:50%; flex-shrink:0; border:1px solid rgba(43,33,24,0.18); }
.sheen-matte{ background:radial-gradient(circle at 35% 30%, #cbb891, #a68a5c); }
.sheen-satin{ background:radial-gradient(circle at 35% 30%, #e8d3a8, #b89563); }
.sheen-oil{ background:radial-gradient(circle at 35% 30%, #8a5a34, #5f3c1f); }
.sheen-gloss{ background:radial-gradient(circle at 32% 26%, #ffffff, #8f6a3d 55%, #5f4526); }
.sheen-painted{ background:radial-gradient(circle at 35% 30%, #ffffff, #d9d2c4); }
.sheen-wax{ background:radial-gradient(circle at 35% 30%, #c79a5a, #7a5230); }

.totals-box{ position:sticky; top:80px; }
.totals-row{ display:flex; justify-content:space-between; padding:8px 0; font-size:14px; color:var(--ink-soft); }
.totals-row.grand{ border-top:1.5px dashed var(--line); margin-top:6px; padding-top:14px; font-size:19px; font-weight:700; color:var(--ink); font-family:var(--font-head); }
.totals-row b{ color:var(--ink); }
.builder-actions{ display:flex; flex-direction:column; gap:9px; margin-top:16px; }

/* ============ KANBAN BOARD ============ */
.board-toolbar{ display:flex; align-items:center; justify-content:space-between; gap:10px; margin-bottom:16px; flex-wrap:wrap; }
.board-legend{ display:flex; gap:14px; flex-wrap:wrap; font-size:12px; color:var(--ink-soft); }
.board-legend span{ display:inline-flex; align-items:center; gap:6px; }
.board-legend i{ width:9px; height:9px; border-radius:50%; display:inline-block; }

.board-scroll{ overflow-x:auto; padding-bottom:14px; margin:0 -20px; padding-left:20px; padding-right:20px; }
.board{ display:grid; grid-auto-flow:column; grid-auto-columns:272px; gap:14px; align-items:start; }
.board-col{ background:var(--cream-soft); border:1px solid var(--line-soft); border-radius:var(--radius-md); min-height:220px; display:flex; flex-direction:column; }
.board-col.dragover{ background:var(--sage-wash); border-color:var(--sage-btn); }
.board-col-head{ padding:13px 14px 11px; border-bottom:1px solid var(--line-soft); }
.board-col-head .name{ font-family:var(--font-head); font-weight:600; font-size:14.5px; display:flex; align-items:center; gap:7px; }
.board-col-head .name i{ width:9px; height:9px; border-radius:50%; flex-shrink:0; }
.board-col-head .count{ font-size:11.5px; color:var(--ink-faint); margin-top:2px; }
.board-col-body{ padding:10px; display:flex; flex-direction:column; gap:9px; flex:1; min-height:80px; }

.job-card{
  background:var(--surface-raised); border:1px solid var(--line-soft); border-radius:12px; padding:12px 13px;
  cursor:grab; box-shadow:var(--shadow-sm); transition:box-shadow .12s ease, transform .12s ease;
}
.job-card:hover{ box-shadow:var(--shadow-md); }
.job-card.dragging{ opacity:0.4; }
.job-card .jc-top{ display:flex; justify-content:space-between; align-items:flex-start; gap:6px; }
.job-card .jc-no{ font-size:10.5px; color:var(--ink-faint); font-weight:700; letter-spacing:0.02em; }
.job-card .jc-client{ font-weight:700; font-size:13.5px; margin-top:3px; line-height:1.25; }
.job-card .jc-item{ font-size:12px; color:var(--ink-soft); margin-top:5px; line-height:1.3; }
.job-card .jc-swatches{ display:flex; gap:5px; margin-top:9px; }
.job-card .jc-swatch{ width:15px; height:15px; border-radius:5px; border:1px solid rgba(43,33,24,0.18); }
.job-card .jc-foot{ display:flex; align-items:center; justify-content:space-between; margin-top:10px; }
.job-card .jc-value{ font-size:11.5px; color:var(--ink-faint); font-weight:700; }
.job-card .jc-advance{ display:flex; align-items:center; gap:12px; }
.job-advance-btn{
  background:var(--surface); border:1px solid var(--line); border-radius:8px; color:var(--walnut-dark);
  font-size:11px; font-weight:700; padding:7px 9px; cursor:pointer; display:inline-flex; align-items:center; gap:4px; min-height:32px;
}
.job-advance-btn:hover{ background:var(--sage-wash); border-color:var(--sage-btn); }
.job-advance-btn svg{ width:12px; height:12px; }
.job-advance-btn:disabled{ opacity:0.35; cursor:default; }

/* ============ JOB DETAIL ============ */
.job-head{ display:flex; justify-content:space-between; align-items:flex-start; gap:14px; flex-wrap:wrap; margin-bottom:20px; }
.job-head-left .kicker{ font-size:12px; font-weight:700; color:var(--sage-btn); text-transform:uppercase; letter-spacing:0.05em; }
.job-head-left h1{ font-size:26px; margin-top:4px; }
.job-head-left .client-line{ color:var(--ink-soft); font-size:14px; margin-top:5px; }
.job-doc-actions{ display:flex; gap:8px; flex-wrap:wrap; }

.job-detail-grid{ display:grid; grid-template-columns:1fr 330px; gap:18px; align-items:start; }
.job-detail-grid > div{ min-width:0; }

.timeline{ padding:6px 4px; }
.tl-item{ display:flex; gap:12px; padding:0 16px 22px; position:relative; }
.tl-item:last-child{ padding-bottom:4px; }
.tl-item::before{ content:""; position:absolute; left:23px; top:26px; bottom:0; width:2px; background:var(--line); }
.tl-item:last-child::before{ display:none; }
.tl-dot{ width:16px; height:16px; border-radius:50%; background:var(--sage-btn); flex-shrink:0; margin-top:2px; display:flex; align-items:center; justify-content:center; box-shadow:0 0 0 4px var(--sage-wash); }
.tl-dot.pending{ background:var(--surface); border:2px solid var(--line); box-shadow:none; }
.tl-dot svg{ width:9px; height:9px; color:#fff; }
.tl-body b{ font-size:14px; }
.tl-body .tl-date{ font-size:12px; color:var(--ink-faint); margin-top:2px; }
.tl-body .tl-note{ font-size:12.5px; color:var(--ink-soft); margin-top:4px; }

.items-mini-table{ width:100%; border-collapse:collapse; margin-top:4px; }
.items-mini-table th{ text-align:left; font-size:10.5px; text-transform:uppercase; color:var(--ink-faint); padding:0 10px 8px; }
.items-mini-table td{ padding:9px 10px; font-size:13px; border-top:1px solid var(--line-soft); }
.mini-swatch-pair{ display:flex; align-items:center; gap:6px; }
.mini-swatch{ width:14px; height:14px; border-radius:4px; border:1px solid rgba(43,33,24,0.18); flex-shrink:0; }

.side-card + .side-card{ margin-top:14px; }
.side-card h4{ font-size:13px; padding:14px 16px; border-bottom:1px solid var(--line-soft); display:flex; align-items:center; gap:7px; }
.side-card h4 svg{ width:15px; height:15px; color:var(--sage-btn); }
.side-card-body{ padding:14px 16px; }
.kv-row{ display:flex; justify-content:space-between; font-size:13px; padding:5px 0; }
.kv-row span:first-child{ color:var(--ink-soft); }
.kv-row b{ font-weight:700; }

.stage-progress{ display:flex; gap:4px; padding:0 16px 16px; }
.stage-progress i{ flex:1; height:6px; border-radius:4px; background:var(--line-soft); }
.stage-progress i.done{ background:var(--sage-btn); }
.stage-progress i.now{ background:var(--walnut); }

/* ============ CLIENTS ============ */
.client-grid{ display:grid; grid-template-columns:repeat(auto-fill,minmax(260px,1fr)); gap:14px; }
.client-card{ padding:18px; }
.client-card .initials{ width:40px; height:40px; border-radius:11px; background:var(--walnut); color:var(--cream); display:flex; align-items:center; justify-content:center; font-family:var(--font-head); font-weight:600; font-size:15px; margin-bottom:10px; }
.client-card b{ display:block; font-size:14.5px; }
.client-card .co{ font-size:12px; color:var(--ink-faint); margin-top:1px; }
.client-card .row{ display:flex; gap:7px; align-items:center; font-size:12.5px; color:var(--ink-soft); margin-top:8px; }
.client-card .row svg{ width:14px; height:14px; flex-shrink:0; color:var(--ink-faint); }

/* ============ MODAL: sheet form ============ */
.sheet-overlay{ position:fixed; inset:0; background:rgba(43,33,24,0.45); backdrop-filter:blur(2px); z-index:60; display:none; align-items:flex-start; justify-content:center; padding:40px 16px; overflow-y:auto; }
.sheet-overlay.show{ display:flex; }
.sheet{ background:var(--surface-raised); border-radius:var(--radius-lg); width:100%; max-width:480px; box-shadow:var(--shadow-lg); }
.sheet-head{ padding:20px 22px 4px; }
.sheet-head h3{ font-size:19px; }
.sheet-head p{ font-size:13px; color:var(--ink-soft); margin-top:5px; }
.sheet-body{ padding:14px 22px 6px; }
.sheet-foot{ padding:16px 22px 22px; display:flex; gap:10px; justify-content:flex-end; }

/* ============ DOCUMENT OVERLAY & PRINTABLE SHEET ============ */
.doc-overlay{ position:fixed; inset:0; background:rgba(43,33,24,0.55); z-index:80; display:none; flex-direction:column; }
.doc-overlay.show{ display:flex; }
.doc-overlay-bar{ background:var(--walnut-dark); color:var(--cream); display:flex; align-items:center; justify-content:space-between; padding:12px 20px; flex-shrink:0; }
.doc-overlay-title{ font-family:var(--font-head); font-weight:600; font-size:15px; }
.doc-overlay-actions{ display:flex; gap:8px; }
.doc-overlay-scroll{ flex:1; overflow-y:auto; padding:28px 16px 60px; }

.doc-sheet{
  max-width:800px; margin:0 auto; background:#fff; color:#241A11; border-radius:6px;
  box-shadow:0 20px 50px rgba(0,0,0,0.35); padding:48px 52px; font-family:var(--font-body);
}
.doc-head{ display:flex; justify-content:space-between; align-items:flex-start; gap:20px; border-bottom:3px solid var(--walnut); padding-bottom:18px; }
.doc-brand{ display:flex; gap:12px; align-items:center; }
.doc-brand svg{ width:44px; height:44px; }
.doc-brand-name{ font-family:var(--font-head); font-weight:600; font-size:19px; color:var(--walnut); }
.doc-brand-tag{ font-size:11px; color:#6B5D4F; margin-top:1px; }
.doc-brand-addr{ font-size:10.5px; color:#6B5D4F; margin-top:6px; line-height:1.5; }
.doc-title-block{ text-align:right; }
.doc-title-block h1{ font-size:22px; color:var(--walnut); letter-spacing:0.01em; }
.doc-title-block .doc-no{ font-size:12.5px; color:#6B5D4F; margin-top:4px; font-weight:700; }
.doc-title-block .doc-date{ font-size:11.5px; color:#8A7A68; margin-top:2px; }

.doc-parties{ display:flex; gap:30px; margin:22px 0; }
.doc-party{ flex:1; }
.doc-party .lbl{ font-size:10px; text-transform:uppercase; letter-spacing:0.06em; color:#8A7A68; font-weight:700; margin-bottom:6px; }
.doc-party b{ font-size:14.5px; display:block; }
.doc-party .line{ font-size:12.5px; color:#5A4B3D; margin-top:2px; line-height:1.5; }

.doc-table{ width:100%; border-collapse:collapse; margin-top:6px; }
.doc-table thead th{ background:var(--walnut); color:#F5E9DA; font-size:10.5px; text-transform:uppercase; letter-spacing:0.03em; text-align:left; padding:10px 12px; }
.doc-table thead th.num{ text-align:right; }
.doc-table tbody td{ padding:11px 12px; font-size:12.5px; border-bottom:1px solid #E9DCC6; vertical-align:top; }
.doc-table tbody td.num{ text-align:right; white-space:nowrap; }
.doc-table tbody tr:nth-child(even){ background:#FBF6EE; }
.doc-mat-line{ display:flex; align-items:center; gap:6px; margin-top:4px; }
.doc-mat-line .dot{ width:11px; height:11px; border-radius:3px; border:1px solid rgba(0,0,0,0.15); flex-shrink:0; }
.doc-mat-line span{ font-size:11px; color:#6B5D4F; }

.doc-totals{ display:flex; justify-content:flex-end; margin-top:14px; }
.doc-totals table{ border-collapse:collapse; min-width:260px; }
.doc-totals td{ padding:6px 4px; font-size:13px; }
.doc-totals td.tl{ color:#5A4B3D; }
.doc-totals td.tv{ text-align:right; font-weight:700; }
.doc-totals tr.grand td{ border-top:2px solid var(--walnut); padding-top:10px; font-size:16px; }
.doc-totals tr.due td{ color:var(--terracotta); font-weight:700; }
.doc-totals tr.paid td{ color:var(--sage-btn-hover); }

.doc-note-box{ background:#FBF4EA; border:1px solid #E9DCC6; border-radius:8px; padding:14px 16px; margin-top:20px; font-size:12px; color:#5A4B3D; line-height:1.6; }
.doc-note-box b{ color:#241A11; }

.doc-stamp{ display:inline-block; border:2px solid var(--sage-btn); color:var(--sage-btn-hover); font-weight:800; font-size:13px; letter-spacing:0.08em; padding:6px 14px; border-radius:6px; transform:rotate(-4deg); margin-top:14px; }
.doc-stamp.due{ border-color:var(--terracotta); color:var(--terracotta); }

.doc-sig-row{ display:flex; gap:40px; margin-top:46px; }
.doc-sig{ flex:1; }
.doc-sig .line{ border-top:1px solid #8A7A68; padding-top:6px; font-size:11px; color:#6B5D4F; }

.doc-timeline{ margin-top:8px; }
.doc-tl-row{ display:flex; gap:12px; padding:8px 0; border-bottom:1px dashed #E9DCC6; font-size:12.5px; }
.doc-tl-row .dt-stage{ font-weight:700; width:190px; flex-shrink:0; }
.doc-tl-row .dt-date{ color:#6B5D4F; width:110px; flex-shrink:0; }
.doc-tl-row .dt-note{ color:#6B5D4F; }

.doc-foot-note{ text-align:center; font-size:10.5px; color:#8A7A68; margin-top:32px; }

/* ============ TOAST ============ */
.toast{ position:fixed; bottom:22px; left:50%; transform:translate(-50%,120%); background:var(--ink); color:var(--cream); padding:13px 20px; border-radius:11px; font-size:13.5px; font-weight:600; box-shadow:var(--shadow-lg); z-index:100; transition:transform .25s ease; max-width:90vw; }
.toast.show{ transform:translate(-50%,0); }

/* ============ PRINT ============ */
@media print{
  body *{ visibility:hidden; }
  .doc-overlay, .doc-overlay *{ visibility:visible; }
  .doc-overlay{ position:absolute; inset:0; background:#fff; display:flex; }
  .doc-overlay-bar{ display:none; }
  .doc-overlay-scroll{ overflow:visible; padding:0; }
  .doc-sheet{ box-shadow:none; max-width:100%; margin:0; border-radius:0; }
}

/* ============ RESPONSIVE ============ */
@media (max-width: 980px){
  .stat-row{ grid-template-columns:repeat(2,1fr); }
  .dash-grid{ grid-template-columns:1fr; }
  .builder-grid{ grid-template-columns:1fr; }
  .totals-box{ position:static; }
  .job-detail-grid{ grid-template-columns:1fr; }
  .stage-mini-row{ grid-template-columns:repeat(3,1fr); }
}
@media (max-width: 640px){
  .topbar-inner{ flex-wrap:wrap; }
  .brand-text small{ display:none; }
  .tabs{ order:3; flex:1 1 100%; width:100%; margin-left:0; border-top:1px solid rgba(245,233,218,0.15); padding-top:6px; }
  .btn-new-quote span{ display:none; }
  .btn-new-quote{ padding:10px; min-width:44px; }
  .stat-row{ grid-template-columns:1fr 1fr; }
  .stage-mini-row{ grid-template-columns:repeat(2,1fr); }
  .doc-sheet{ padding:26px 14px; }
  .doc-table thead th{ padding:9px 6px; font-size:9px; }
  .doc-table tbody td{ padding:9px 6px; font-size:11.5px; }
  .doc-parties{ flex-direction:column; gap:14px; }
  .doc-title-block{ text-align:left; }
  .doc-head{ flex-direction:column; }
  .field-grid{ grid-template-columns:1fr; }
  .line-item-nums{ grid-template-columns:1fr 1fr; }
  .doc-sig-row{ flex-direction:column; gap:20px; }
  /* Tap targets: 44px minimum on touch viewports, even for compact desktop controls. */
  .btn-sm{ min-height:44px; padding:9px 14px; }
  .filter-chip{ min-height:44px; padding:11px 16px; }
  .job-advance-btn{ min-height:44px; padding:10px 12px; }
  /* Data tables: scroll as a unit within their own card rather than cramming columns —
     keeps every value legible instead of wrapping numbers mid-digit. Body never scrolls. */
  .list-wrap{ overflow-x:auto; -webkit-overflow-scrolling:touch; }
  .list-table{ min-width:640px; }
  /* Document viewer toolbar: title gets its own row, action buttons go icon-only so the
     bar never squeezes the title into a multi-line wrap next to cramped buttons. */
  .doc-overlay-bar{ flex-wrap:wrap; gap:8px 10px; padding:12px 16px; }
  .doc-overlay-title{ flex:1 1 100%; font-size:14px; }
  .doc-overlay-actions{ flex:1 1 100%; justify-content:flex-start; }
  .doc-overlay-actions .btn span{ display:none; }
  .doc-overlay-actions .btn{ padding:10px; min-width:44px; }
}
