/* ==========================================================================
   Epoxy Command Center — design system
   Poppins only. Warm stone, deep resin green, quiet amber.
   ========================================================================== */

@font-face {
  font-family: 'Poppins';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/poppins-400.woff2') format('woff2');
}
@font-face {
  font-family: 'Poppins';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../fonts/poppins-500.woff2') format('woff2');
}
@font-face {
  font-family: 'Poppins';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../fonts/poppins-600.woff2') format('woff2');
}
@font-face {
  font-family: 'Poppins';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/poppins-700.woff2') format('woff2');
}
@font-face {
  font-family: 'Poppins';
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url('../fonts/poppins-800.woff2') format('woff2');
}

:root {
  --font: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --brand: #0E6F5C;
  --brand-strong: #0A5447;
  --brand-deep: #073B31;
  --brand-bright: #1B9277;
  --brand-ink: #FFFFFF;
  --brand-tint: rgba(14, 111, 92, 0.1);
  --brand-tint-2: rgba(14, 111, 92, 0.16);
  --accent: #D9A24A;
  --accent-strong: #8A5B10;
  --accent-soft: rgba(217, 162, 74, 0.15);
  --danger: #B14A40;
  --danger-soft: rgba(177, 74, 64, 0.1);
  --success: #1F7A58;
  --success-soft: rgba(31, 122, 88, 0.1);
  --blue: #3B6FA8;
  --blue-soft: rgba(59, 111, 168, 0.1);
  --plum: #7C5B96;
  --plum-soft: rgba(124, 91, 150, 0.11);
  --bg: #F2F0EA;
  --surface: #F8F6F1;
  --card: #FFFFFF;
  --card-2: #F6F4EE;
  --card-3: #EEEAE1;
  --ink: #121917;
  --ink-2: #37433E;
  --muted: #6D7973;
  --faint: #929D97;
  --line: #E4E0D6;
  --line-strong: #D2CDC0;
  --field: #F8F6F1;
  --nav-bg: #F6F3ED;
  --topbar: rgba(248, 246, 241, 0.86);
  --overlay: rgba(14, 24, 20, 0.44);
  --shadow-xs: 0 1px 2px rgba(20, 29, 25, 0.05);
  --shadow-sm: 0 1px 2px rgba(20, 29, 25, 0.05), 0 10px 26px -22px rgba(20, 29, 25, 0.45);
  --shadow-md: 0 2px 5px rgba(20, 29, 25, 0.05), 0 22px 50px -28px rgba(20, 29, 25, 0.42);
  --shadow-lg: 0 40px 120px -40px rgba(8, 18, 14, 0.45);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --rail: 252px;
  --topbar-h: 76px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

[data-theme='dark'] {
  --accent: #E4B25F;
  --accent-strong: #EBC57E;
  --accent-soft: rgba(228, 178, 95, 0.13);
  --danger: #E2877D;
  --danger-soft: rgba(226, 135, 125, 0.12);
  --success: #60C29A;
  --success-soft: rgba(96, 194, 154, 0.11);
  --blue: #85B5E8;
  --blue-soft: rgba(133, 181, 232, 0.11);
  --plum: #BFA3D6;
  --plum-soft: rgba(191, 163, 214, 0.12);
  --bg: #090E0C;
  --surface: #0C1310;
  --card: #111A16;
  --card-2: #15201B;
  --card-3: #1A2722;
  --ink: #EFF4F0;
  --ink-2: #C4CEC8;
  --muted: #91A09A;
  --faint: #687771;
  --line: #22302A;
  --line-strong: #33453D;
  --field: #0B1310;
  --nav-bg: #0C1310;
  --topbar: rgba(9, 14, 12, 0.82);
  --overlay: rgba(1, 5, 3, 0.68);
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.25);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.22), 0 12px 28px -24px rgba(0, 0, 0, 0.8);
  --shadow-md: 0 2px 6px rgba(0, 0, 0, 0.24), 0 26px 60px -30px rgba(0, 0, 0, 0.8);
  --shadow-lg: 0 48px 130px -42px rgba(0, 0, 0, 0.86);
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.55;
  font-weight: 400;
  color: var(--ink);
  background: var(--bg);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.is-locked { overflow: hidden; }

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--brand-strong); text-decoration: none; }
img { max-width: 100%; display: block; }
svg { display: block; }
h1, h2, h3, h4, p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
[hidden] { display: none !important; }

::selection { background: var(--brand-tint-2); color: var(--ink); }

:focus-visible {
  outline: 2px solid var(--brand-bright);
  outline-offset: 2px;
}

.svg-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.icon {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-sm { width: 15px; height: 15px; }
.icon-lg { width: 22px; height: 22px; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.muted { color: var(--muted); }
.faint { color: var(--faint); }
.nowrap { white-space: nowrap; }
.tnum { font-variant-numeric: tabular-nums; }
.divider { height: 1px; background: var(--line); border: 0; margin: 18px 0; }
.grow { flex: 1; min-width: 0; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.row { display: flex; align-items: center; gap: 10px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.wrap { flex-wrap: wrap; }

/* ---------- scrollbars ---------- */

.workspace, .sheet-body, .welcome-panel, .kanban {
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}
.workspace::-webkit-scrollbar, .sheet-body::-webkit-scrollbar,
.welcome-panel::-webkit-scrollbar, .kanban::-webkit-scrollbar {
  width: 9px;
  height: 9px;
}
.workspace::-webkit-scrollbar-thumb, .sheet-body::-webkit-scrollbar-thumb,
.welcome-panel::-webkit-scrollbar-thumb, .kanban::-webkit-scrollbar-thumb {
  background: var(--line-strong);
  border-radius: 99px;
  border: 3px solid transparent;
  background-clip: content-box;
}
.workspace::-webkit-scrollbar-track, .sheet-body::-webkit-scrollbar-track,
.welcome-panel::-webkit-scrollbar-track, .kanban::-webkit-scrollbar-track { background: transparent; }

/* ==========================================================================
   Buttons, links, chips
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 42px;
  padding: 0 16px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: var(--card);
  color: var(--ink);
  font-family: var(--font);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
  white-space: nowrap;
  transition: transform 0.18s var(--ease), background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(0.99); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn .icon { width: 17px; height: 17px; }

.btn-primary {
  background: linear-gradient(145deg, var(--brand) 0%, var(--brand-deep) 130%);
  color: var(--brand-ink);
  border-color: color-mix(in srgb, var(--brand-deep) 45%, transparent);
  box-shadow: 0 10px 22px -14px var(--brand), inset 0 1px 0 rgba(255, 255, 255, 0.16);
}
.btn-primary:hover { filter: brightness(1.06); box-shadow: 0 14px 28px -14px var(--brand), inset 0 1px 0 rgba(255, 255, 255, 0.18); }

.btn-secondary {
  background: var(--card);
  border-color: var(--line-strong);
  color: var(--ink);
}
.btn-secondary:hover { border-color: var(--brand); color: var(--brand-strong); }

.btn-soft {
  background: var(--brand-tint);
  border-color: transparent;
  color: var(--brand-strong);
}
.btn-soft:hover { background: var(--brand-tint-2); }

.btn-amber {
  background: var(--accent);
  color: #221708;
  border-color: transparent;
  box-shadow: 0 10px 22px -15px var(--accent);
}
.btn-amber:hover { filter: brightness(1.04); }

.btn-danger {
  background: var(--danger-soft);
  color: var(--danger);
  border-color: transparent;
}
.btn-danger:hover { background: color-mix(in srgb, var(--danger) 18%, transparent); }

.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--muted);
}
.btn-ghost:hover { background: var(--card-2); color: var(--ink); }

.btn-sm { height: 34px; padding: 0 11px; font-size: 11.5px; border-radius: 9px; gap: 6px; }
.btn-sm .icon { width: 14px; height: 14px; }
.btn-lg { height: 50px; padding: 0 22px; font-size: 14px; border-radius: 14px; }
.btn-block { width: 100%; }

.icon-btn {
  width: 40px;
  height: 40px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  color: var(--ink-2);
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.18s var(--ease);
}
.icon-btn:hover { background: var(--card-2); border-color: var(--line-strong); color: var(--ink); transform: translateY(-1px); }
.icon-btn .icon { width: 19px; height: 19px; }

.link-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--brand-strong);
  font-size: 11.5px;
  font-weight: 600;
  border-radius: 6px;
  transition: gap 0.18s var(--ease), color 0.15s ease;
}
.link-btn:hover { gap: 8px; color: var(--brand-bright); }
.link-btn .icon { width: 13px; height: 13px; }
.link-btn.subtle { color: var(--muted); }
.link-btn.danger { color: var(--danger); }

.text-btn {
  border: 0;
  background: none;
  padding: 0;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--brand-strong);
}

.eyebrow, .card-eyebrow, .field-label {
  display: block;
  font-size: 9.5px;
  line-height: 1.3;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 24px;
  padding: 3px 9px;
  border-radius: 99px;
  background: var(--card-2);
  border: 1px solid var(--line);
  color: var(--ink-2);
  font-size: 10.5px;
  font-weight: 500;
  line-height: 1.2;
  white-space: nowrap;
}
.chip .dot, .status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--brand-bright);
  flex: 0 0 auto;
}
.chip.brand { background: var(--brand-tint); border-color: transparent; color: var(--brand-strong); }
.chip.amber { background: var(--accent-soft); border-color: transparent; color: var(--accent-strong); }
.chip.danger { background: var(--danger-soft); border-color: transparent; color: var(--danger); }
.chip.blue { background: var(--blue-soft); border-color: transparent; color: var(--blue); }
.chip.plum { background: var(--plum-soft); border-color: transparent; color: var(--plum); }
.chip.ghost { background: transparent; }
.chip.sm { min-height: 20px; font-size: 9.5px; padding: 2px 7px; }

.source-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 22px;
  padding: 0 8px 0 4px;
  border-radius: 6px;
  background: var(--source-soft);
  color: var(--source-color);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.source-chip b {
  display: inline-grid;
  place-items: center;
  width: 14px;
  height: 14px;
  border-radius: 4px;
  background: var(--source-color);
  color: #fff;
  font-size: 8px;
  font-weight: 700;
  line-height: 1;
}

.avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: var(--card-2);
  color: var(--brand-strong);
  font-size: 12px;
  font-weight: 600;
  display: grid;
  place-items: center;
  overflow: hidden;
  transition: border-color 0.18s ease, transform 0.18s var(--ease);
}
.avatar:hover { border-color: var(--brand); transform: translateY(-1px); }
.avatar img { width: 100%; height: 100%; object-fit: cover; }

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 99px;
  background: var(--brand);
  color: var(--brand-ink);
  font-size: 10px;
  font-weight: 600;
  line-height: 1;
}
.badge.warn { background: var(--accent); color: var(--accent-ink, #221708); }
.badge.quiet { background: var(--card-3); color: var(--muted); }

/* ==========================================================================
   App shell
   ========================================================================== */

.app-shell {
  display: grid;
  grid-template-columns: var(--rail) minmax(0, 1fr);
  grid-template-rows: var(--topbar-h) minmax(0, 1fr);
  grid-template-areas:
    'topbar topbar'
    'sidebar workspace';
  height: 100dvh;
  min-height: 100dvh;
  background:
    radial-gradient(1200px 620px at 96% -10%, var(--brand-tint), transparent 62%),
    radial-gradient(900px 480px at -8% 108%, rgba(217, 162, 74, 0.07), transparent 62%),
    var(--bg);
  opacity: 0;
  transition: opacity 0.4s ease;
}
.app-shell.is-ready { opacity: 1; }

.topbar {
  grid-area: topbar;
  position: relative;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  height: var(--topbar-h);
  padding: 0 clamp(18px, 2.4vw, 30px);
  background: var(--topbar);
  border-bottom: 1px solid var(--line);
  backdrop-filter: saturate(1.2) blur(16px);
  -webkit-backdrop-filter: saturate(1.2) blur(16px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 0;
  background: none;
  padding: 4px 6px 4px 0;
  color: inherit;
  text-align: left;
  border-radius: 13px;
}
.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  overflow: hidden;
  flex: 0 0 auto;
  background: var(--brand-deep);
  box-shadow: 0 8px 18px -12px rgba(7, 30, 24, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.15);
  display: grid;
  place-items: center;
}
.brand-mark svg { width: 100%; height: 100%; }
.brand-mark img { width: 100%; height: 100%; object-fit: cover; }
.brand-copy { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.brand-copy strong {
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 340px;
}
.brand-copy span {
  font-size: 8.5px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  line-height: 1.3;
}

.topbar-actions { display: flex; align-items: center; gap: 10px; }
.local-save {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 10.5px;
  font-weight: 500;
  color: var(--muted);
  padding-right: 4px;
}
.local-save .status-dot { width: 5px; height: 5px; background: var(--success); box-shadow: 0 0 0 3px var(--success-soft); }
.local-save.is-error { color: var(--danger); }
.local-save.is-error .status-dot { background: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); }

.date-chip {
  display: inline-flex;
  align-items: center;
  height: 34px;
  padding: 0 12px;
  border-radius: 99px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 500;
}

.theme-btn { border-color: transparent; background: transparent; }
.theme-btn:hover { background: var(--card-2); border-color: var(--line); }

.new-quote-btn { height: 42px; }

.sidebar {
  grid-area: sidebar;
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 22px 15px 18px;
  border-right: 1px solid var(--line);
  background: var(--nav-bg);
  overflow: hidden;
}
.rail-label {
  padding: 2px 12px 11px;
  font-size: 8.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--faint);
}
.side-nav { display: flex; flex-direction: column; gap: 4px; }
.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  height: 46px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: var(--ink-2);
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: -0.01em;
  text-align: left;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.18s var(--ease);
}
.nav-item:hover { background: var(--card-2); color: var(--ink); }
.nav-item.active {
  background: var(--card);
  border-color: var(--line);
  color: var(--ink);
  font-weight: 600;
  box-shadow: var(--shadow-xs);
}
.nav-icon {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  color: var(--muted);
  transition: background 0.18s ease, color 0.18s ease;
}
.nav-icon .icon { width: 19px; height: 19px; }
.nav-item:hover .nav-icon { color: var(--ink); }
.nav-item.active .nav-icon { background: var(--brand); color: var(--brand-ink); box-shadow: 0 6px 14px -9px var(--brand); }
.nav-label { flex: 1; min-width: 0; }
.nav-item .badge { transform: translateY(-1px); }
.nav-item .badge.quiet { background: var(--card-2); }

.sidebar-foot { margin-top: auto; padding-top: 18px; }
.install-card {
  position: relative;
  display: block;
  width: 100%;
  padding: 16px 15px 15px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  background:
    radial-gradient(120px 100px at 100% 0%, rgba(27, 146, 119, 0.5), transparent 70%),
    linear-gradient(150deg, #0D2A23 0%, #071813 100%);
  color: #F2F7F4;
  text-align: left;
  overflow: hidden;
  transition: transform 0.22s var(--ease), box-shadow 0.22s ease;
}
.install-card:hover { transform: translateY(-2px); box-shadow: 0 18px 30px -24px rgba(5, 22, 17, 0.9); }
.install-copy { position: relative; z-index: 2; display: block; }
.install-copy strong { display: block; font-size: 12.5px; font-weight: 600; letter-spacing: -0.01em; }
.install-copy > span {
  display: block;
  margin-top: 3px;
  font-size: 10px;
  line-height: 1.5;
  color: rgba(238, 247, 242, 0.6);
  max-width: 168px;
}
.install-copy em {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 11px;
  font-style: normal;
  font-size: 9.5px;
  font-weight: 600;
  color: #EBC98D;
}
.install-copy em .icon { width: 12px; height: 12px; }
.install-orbit {
  position: absolute;
  width: 108px;
  height: 108px;
  right: -40px;
  top: -35px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.08);
  pointer-events: none;
}
.install-orbit span { position: absolute; inset: 16px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, 0.07); }
.install-orbit span:nth-child(2) { inset: 34px; border-color: rgba(235, 201, 141, 0.24); }
.install-orbit span:nth-child(3) {
  inset: 50px;
  background: var(--accent);
  border: 0;
  box-shadow: 0 0 18px rgba(217, 162, 74, 0.7);
}
.offline-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin: 12px 0 0;
  font-size: 9px;
  font-weight: 500;
  color: var(--faint);
}
.offline-note .status-dot { width: 5px; height: 5px; background: var(--success); }

.workspace {
  grid-area: workspace;
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  position: relative;
}

/* ==========================================================================
   Dashboard
   ========================================================================== */

.dashboard {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  max-width: 1760px;
  min-height: 100%;
  margin: 0 auto;
  padding: clamp(20px, 2.4vw, 32px) clamp(18px, 2.8vw, 38px) 28px;
}

.dash-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}
.dash-head-copy { min-width: 0; }
.eyebrow-line {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
}
.eyebrow-line .pulse-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--brand-bright);
  position: relative;
}
.eyebrow-line .pulse-dot::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 1px solid var(--brand-bright);
  opacity: 0;
  animation: pulseRing 3.4s ease-out infinite;
}
.dash-title {
  margin: 6px 0 3px;
  font-size: clamp(30px, 3.15vw, 43px);
  line-height: 1.03;
  letter-spacing: -0.04em;
  font-weight: 800;
  color: var(--ink);
}
.dash-title .accent {
  color: var(--brand-strong);
  font-weight: 800;
}
.dash-sub {
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--muted);
  max-width: 600px;
}
.dash-head-actions { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.sample-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 32px;
  padding: 0 11px;
  border-radius: 99px;
  border: 1px solid color-mix(in srgb, var(--accent) 38%, transparent);
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  transition: background 0.18s ease, transform 0.18s var(--ease);
}
.sample-pill:hover { background: color-mix(in srgb, var(--accent) 22%, transparent); transform: translateY(-1px); }
.sample-pill .dot { width: 5px; height: 5px; background: var(--accent); border-radius: 50%; }

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 13px;
}
.metric-card {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  min-height: 134px;
  padding: 16px 17px 14px;
  border: 1px solid var(--line);
  border-radius: 19px;
  background: var(--card);
  box-shadow: var(--shadow-sm);
  transition: transform 0.22s var(--ease), border-color 0.2s ease, box-shadow 0.2s ease;
}
.metric-card:hover { transform: translateY(-2px); border-color: var(--line-strong); box-shadow: var(--shadow-md); }
.metric-card::after {
  content: '';
  position: absolute;
  right: -62px;
  top: -78px;
  width: 170px;
  height: 170px;
  border-radius: 50%;
  background: var(--tone, var(--brand));
  opacity: 0.075;
  pointer-events: none;
}
[data-theme='dark'] .metric-card::after { opacity: 0.13; }
.metric-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.metric-label { font-size: 10px; font-weight: 600; letter-spacing: 0.06em; color: var(--muted); text-transform: none; }
.metric-icon {
  width: 31px;
  height: 31px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: var(--card-2);
  border: 1px solid var(--line);
  color: var(--tone, var(--brand));
  flex: 0 0 auto;
}
.metric-icon .icon { width: 16px; height: 16px; }
.metric-value {
  font-size: clamp(28px, 2.55vw, 37px);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.045em;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.metric-value.is-money { font-size: clamp(26px, 2.25vw, 34px); }
.metric-bottom { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; }
.metric-delta {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 9.5px;
  line-height: 1.35;
  color: var(--muted);
  font-weight: 500;
}
.metric-delta strong { font-weight: 600; color: var(--success); }
.metric-delta.down strong { color: var(--danger); }
.metric-delta .delta-icon { font-size: 10px; line-height: 1; }
.metric-spark { display: flex; align-items: flex-end; gap: 2.5px; height: 21px; width: 46px; flex: 0 0 auto; opacity: 0.9; }
.metric-spark span {
  display: block;
  flex: 1;
  min-height: 3px;
  border-radius: 2px 2px 1px 1px;
  background: var(--tone, var(--brand));
  opacity: 0.22;
}
.metric-spark span:nth-last-child(2) { opacity: 0.42; }
.metric-spark span:last-child { opacity: 0.8; }

.dash-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.62fr) minmax(0, 1fr);
  gap: 13px;
  flex: 1;
  min-height: 0;
}
.side-stack {
  display: grid;
  grid-template-rows: minmax(0, 1.06fr) minmax(0, 0.94fr);
  gap: 13px;
  min-height: 0;
}

.card {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--card);
  box-shadow: var(--shadow-sm);
}
.week-card, .pipeline-card, .quick-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  padding: 17px 17px 15px;
}
.week-card { max-width: 100%; }
.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 13px;
}
.card-head h2 {
  margin-top: 3px;
  font-size: 19px;
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -0.03em;
}
.card-head h2 .count { color: var(--muted); font-weight: 500; }
.card-head p { margin-top: 4px; font-size: 10.5px; color: var(--muted); line-height: 1.5; }
.card-head-actions { display: flex; align-items: center; gap: 7px; flex: 0 0 auto; }

.week-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
  flex: 1;
  min-width: 0;
  max-width: 100%;
  min-height: 0;
}
.day-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 188px;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card-2);
  transition: border-color 0.18s ease, background 0.18s ease;
}
.day-tile:hover { border-color: var(--line-strong); }
.day-tile.today { background: var(--brand-tint); border-color: color-mix(in srgb, var(--brand) 30%, var(--line)); }
.day-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px;
  width: 100%;
  padding: 1px 2px 5px;
  border: 0;
  background: none;
  color: inherit;
  border-radius: 7px;
  text-align: left;
}
.day-top:hover { background: var(--card); }
.weekday {
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--muted);
}
.day-number {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--ink);
  line-height: 1;
}
.day-tile.today .day-number, .day-tile.today .weekday { color: var(--brand-strong); }
.day-jobs { display: flex; flex-direction: column; gap: 4px; flex: 1; min-height: 0; }
.week-job {
  display: block;
  width: 100%;
  padding: 5px 6px 5px 7px;
  border: 0;
  border-left: 2.5px solid var(--tone, var(--brand));
  border-radius: 6px;
  background: var(--card);
  color: inherit;
  text-align: left;
  box-shadow: 0 1px 2px rgba(18, 25, 23, 0.04);
  transition: transform 0.16s var(--ease), background 0.16s ease;
}
.week-job:hover { transform: translateY(-1px); background: var(--card-2); }
.week-job-time {
  display: block;
  font-size: 7.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--muted);
  line-height: 1.3;
}
.week-job-name {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-top: 1px;
  font-size: 9.5px;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.week-empty {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  margin-top: 4px;
  padding: 4px;
  border: 1px dashed var(--line-strong);
  border-radius: 7px;
  background: transparent;
  color: var(--faint);
  font-size: 8px;
  font-weight: 500;
  transition: border-color 0.18s ease, color 0.18s ease, background 0.18s ease;
}
.week-empty .icon { width: 12px; height: 12px; opacity: 0.7; }
.week-empty:hover { border-color: var(--brand); color: var(--brand-strong); background: var(--brand-tint); }
.week-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 10px;
  font-size: 9px;
  color: var(--muted);
  line-height: 1.4;
}
.week-foot strong { color: var(--ink-2); font-weight: 600; }
.week-foot .foot-add { flex: 0 0 auto; }

.pipeline-bar {
  display: flex;
  gap: 3px;
  height: 6px;
  border-radius: 99px;
  overflow: hidden;
  background: var(--card-3);
}
.pipe-seg { display: block; min-width: 3px; border-radius: 99px; background: var(--stage-color); opacity: 0.9; }
.pipeline-list {
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  flex: 1;
  margin-top: 5px;
  min-height: 0;
}
.pipeline-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 3px;
  border: 0;
  border-radius: 8px;
  background: none;
  color: inherit;
  text-align: left;
  transition: background 0.16s ease, padding 0.16s ease;
}
.pipeline-row:hover { background: var(--card-2); padding-left: 6px; }
.pipeline-row .stage-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--stage-color); flex: 0 0 auto; }
.pipeline-label { font-size: 10.5px; font-weight: 500; color: var(--ink-2); flex: 1; }
.pipeline-count { font-size: 12px; font-weight: 700; color: var(--ink); min-width: 14px; text-align: right; }
.pipeline-value { font-size: 9px; color: var(--faint); min-width: 46px; text-align: right; font-weight: 500; }
.pipeline-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 5px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
  font-size: 9px;
  color: var(--muted);
}
.pipeline-foot strong { color: var(--ink); font-weight: 600; }

.quick-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  flex: 1;
}
.quick-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 5px;
  min-width: 0;
  min-height: 57px;
  padding: 8px 9px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card-2);
  color: var(--ink-2);
  font-size: 9px;
  font-weight: 600;
  line-height: 1.2;
  text-align: left;
  transition: transform 0.17s var(--ease), border-color 0.17s ease, background 0.17s ease, color 0.17s ease;
}
.quick-btn .icon { width: 16px; height: 16px; color: var(--brand-strong); }
.quick-btn:hover { transform: translateY(-1px); border-color: var(--brand); background: var(--brand-tint); color: var(--brand-strong); }
.quick-btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }

/* skeleton */

.dash-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 60vh;
  color: var(--muted);
  font-size: 12px;
}
.spinner {
  width: 22px;
  height: 22px;
  border: 2px solid var(--line-strong);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

/* ==========================================================================
   Mobile bottom nav
   ========================================================================== */

.mobile-nav {
  display: none;
  position: fixed;
  z-index: 45;
  left: 12px;
  right: 12px;
  bottom: calc(10px + env(safe-area-inset-bottom));
  height: 64px;
  padding: 6px;
  border: 1px solid var(--line-strong);
  border-radius: 21px;
  background: color-mix(in srgb, var(--card) 90%, transparent);
  box-shadow: 0 20px 45px -24px rgba(9, 20, 15, 0.55);
  backdrop-filter: blur(22px) saturate(1.2);
  -webkit-backdrop-filter: blur(22px) saturate(1.2);
}
.mobile-nav button {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-width: 0;
  border: 0;
  border-radius: 15px;
  background: transparent;
  color: var(--muted);
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.01em;
  transition: background 0.18s ease, color 0.18s ease;
}
.mobile-nav button .icon { width: 19px; height: 19px; }
.mobile-nav button:hover { color: var(--ink); }
.mobile-nav button.active { background: var(--brand-tint); color: var(--brand-strong); }

/* ==========================================================================
   Forms
   ========================================================================== */

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .field-label { font-size: 9px; font-weight: 600; letter-spacing: 0.09em; text-transform: uppercase; color: var(--muted); }
.field > label .optional { color: var(--faint); font-weight: 500; letter-spacing: 0; text-transform: none; }
.input, .select, .textarea {
  width: 100%;
  height: 44px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--field);
  color: var(--ink);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -0.01em;
  transition: border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
  -webkit-appearance: none;
  appearance: none;
}
.textarea { height: auto; min-height: 86px; padding: 11px 13px; resize: vertical; line-height: 1.55; font-weight: 400; }
.select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' fill='none' stroke='%236D7973' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 13px center;
  padding-right: 34px;
}
.input::placeholder, .textarea::placeholder { color: var(--faint); font-weight: 400; }
.input:hover, .select:hover, .textarea:hover { border-color: var(--line-strong); }
.input:focus, .select:focus, .textarea:focus {
  outline: 0;
  border-color: var(--brand);
  background: var(--card);
  box-shadow: 0 0 0 3px var(--brand-tint);
}
.input.invalid { border-color: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); }
.input[type='date'] { min-width: 0; }
.input[type='color'] { padding: 4px; cursor: pointer; }
.input.small { height: 36px; font-size: 12px; border-radius: 9px; }
.input.plain { background: transparent; border-color: transparent; padding: 0; height: 34px; }
.input.plain:focus { background: var(--field); border-color: var(--brand); padding: 0 10px; }
.help { font-size: 9.5px; line-height: 1.5; color: var(--faint); }
.error-text { font-size: 9.5px; color: var(--danger); font-weight: 500; }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.form-grid .full { grid-column: 1 / -1; }
.form-grid.tight { gap: 10px; }
.form-section { padding-top: 4px; }
.form-section + .form-section { margin-top: 20px; padding-top: 19px; border-top: 1px solid var(--line); }
.form-section-head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.form-section-head h3 { font-size: 13px; font-weight: 600; letter-spacing: -0.02em; }
.form-section-head .num {
  width: 20px;
  height: 20px;
  border-radius: 7px;
  background: var(--brand-tint);
  color: var(--brand-strong);
  display: grid;
  place-items: center;
  font-size: 9px;
  font-weight: 600;
}
.field-row { display: flex; gap: 8px; align-items: center; }
.field-suffix {
  height: 44px;
  display: flex;
  align-items: center;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--card-2);
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 500;
  white-space: nowrap;
}

.segmented {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card-2);
}
.segmented button {
  height: 30px;
  padding: 0 10px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  white-space: nowrap;
  transition: background 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
}
.segmented button.active { background: var(--card); color: var(--ink); box-shadow: var(--shadow-xs); }
.segmented.soft { background: transparent; }

.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 11px 0;
}
.switch-copy strong { display: block; font-size: 11.5px; font-weight: 600; }
.switch-copy span { display: block; font-size: 9.5px; color: var(--muted); margin-top: 2px; line-height: 1.45; }
.switch {
  position: relative;
  width: 38px;
  height: 22px;
  flex: 0 0 auto;
}
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.switch span {
  position: absolute;
  inset: 0;
  border-radius: 99px;
  background: var(--line-strong);
  transition: background 0.2s ease;
  pointer-events: none;
}
.switch span::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  top: 3px;
  left: 3px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.22);
  transition: transform 0.2s var(--ease);
}
.switch input:checked + span { background: var(--brand); }
.switch input:checked + span::after { transform: translateX(16px); }
.switch input:focus-visible + span { outline: 2px solid var(--brand-bright); outline-offset: 2px; }

.check-card {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-height: 62px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--field);
  cursor: pointer;
  transition: border-color 0.16s ease, background 0.16s ease, transform 0.16s var(--ease);
}
.check-card:hover { border-color: var(--line-strong); transform: translateY(-1px); }
.check-card:has(input:checked) { border-color: var(--brand); background: var(--brand-tint); }
.check-card input { position: absolute; opacity: 0; pointer-events: none; }
.check-box {
  width: 18px;
  height: 18px;
  border-radius: 5px;
  border: 1.5px solid var(--line-strong);
  background: var(--card);
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  margin-top: 1px;
  color: var(--brand-ink);
  transition: background 0.16s ease, border-color 0.16s ease;
}
.check-box .icon { width: 12px; height: 12px; opacity: 0; transform: scale(0.7); transition: opacity 0.15s ease, transform 0.15s var(--ease); }
.check-card:has(input:checked) .check-box { background: var(--brand); border-color: var(--brand); }
.check-card:has(input:checked) .check-box .icon { opacity: 1; transform: scale(1); }
.check-copy { min-width: 0; flex: 1; }
.check-copy strong { display: block; font-size: 11px; font-weight: 600; line-height: 1.35; letter-spacing: -0.01em; }
.check-copy span { display: block; margin-top: 2px; font-size: 9px; line-height: 1.45; color: var(--muted); }
.check-rate { margin-left: auto; font-size: 10px; font-weight: 600; color: var(--ink-2); white-space: nowrap; }

.stepper {
  display: flex;
  align-items: center;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--field);
  overflow: hidden;
}
.stepper button {
  width: 38px;
  height: 100%;
  border: 0;
  background: transparent;
  color: var(--ink-2);
  display: grid;
  place-items: center;
  transition: background 0.15s ease;
}
.stepper button:hover { background: var(--card-2); color: var(--ink); }
.stepper button .icon { width: 15px; height: 15px; }
.stepper input {
  flex: 1;
  width: 34px;
  height: 100%;
  border: 0;
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
  background: transparent;
  text-align: center;
  font-size: 12.5px;
  font-weight: 600;
  -moz-appearance: textfield;
}
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.range-input {
  width: 100%;
  height: 4px;
  margin: 9px 0;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--brand) 0%, var(--brand) var(--range-fill, 45%), var(--card-3) var(--range-fill, 45%), var(--card-3) 100%);
  -webkit-appearance: none;
  appearance: none;
  outline: none;
}
.range-input::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: var(--card);
  border: 3px solid var(--brand);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
  cursor: pointer;
}
.range-input::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--card);
  border: 3px solid var(--brand);
  cursor: pointer;
}

.choice-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.choice-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }

/* ---------- empty states ---------- */

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 220px;
  padding: 28px;
  text-align: center;
}
.empty-state .empty-icon {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: var(--brand-tint);
  color: var(--brand-strong);
  margin-bottom: 2px;
}
.empty-state .empty-icon .icon { width: 22px; height: 22px; }
.empty-state h3 { font-size: 16px; font-weight: 700; letter-spacing: -0.025em; }
.empty-state p { max-width: 300px; font-size: 11px; line-height: 1.6; color: var(--muted); }
.empty-state .btn { margin-top: 4px; }
.empty-state.small { min-height: 130px; padding: 18px; }

/* ---------- photos ---------- */

.photo-strip { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.photo-tile {
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: 10px;
  overflow: hidden;
  background: var(--card-2);
  border: 1px solid var(--line);
}
.photo-tile img { width: 100%; height: 100%; object-fit: cover; }
.photo-tile button.remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 21px;
  height: 21px;
  border-radius: 50%;
  border: 0;
  background: rgba(8, 15, 12, 0.72);
  color: #fff;
  display: grid;
  place-items: center;
  backdrop-filter: blur(4px);
}
.photo-tile button.remove .icon { width: 11px; height: 11px; }
.photo-tile .photo-tag {
  position: absolute;
  bottom: 5px;
  left: 5px;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(8, 15, 12, 0.66);
  color: #fff;
  font-size: 7.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  backdrop-filter: blur(4px);
}
.add-photo {
  aspect-ratio: 4 / 3;
  border: 1px dashed var(--line-strong);
  border-radius: 10px;
  background: var(--field);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--muted);
  font-size: 8.5px;
  font-weight: 500;
  transition: border-color 0.16s ease, background 0.16s ease, color 0.16s ease;
}
.add-photo .icon { width: 15px; height: 15px; }
.add-photo:hover { border-color: var(--brand); background: var(--brand-tint); color: var(--brand-strong); }
.photo-actions { display: flex; gap: 7px; margin-top: 8px; }
.photo-actions .btn { flex: 1; }
.file-input-hidden { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

/* ==========================================================================
   Sheets (pop-up content)
   ========================================================================== */

.sheet-layer {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(10px, 2.4vw, 28px);
}
.sheet-backdrop {
  position: absolute;
  inset: 0;
  background: var(--overlay);
  backdrop-filter: blur(9px) saturate(0.9);
  -webkit-backdrop-filter: blur(9px) saturate(0.9);
  opacity: 0;
  transition: opacity 0.26s ease;
}
.sheet {
  --sheet-w: 880px;
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(var(--sheet-w), 100%);
  max-height: min(92dvh, 1180px);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  opacity: 0;
  transform: translateY(16px) scale(0.982);
  transition: opacity 0.28s ease, transform 0.38s var(--ease);
}
.sheet-layer.is-open .sheet-backdrop { opacity: 1; }
.sheet-layer.is-open .sheet { opacity: 1; transform: translateY(0) scale(1); }
.sheet-layer.is-closing .sheet-backdrop { opacity: 0; }
.sheet-layer.is-closing .sheet { opacity: 0; transform: translateY(8px) scale(0.99); }
.sheet.size-sm { --sheet-w: 540px; }
.sheet.size-md { --sheet-w: 780px; }
.sheet.size-lg { --sheet-w: 1040px; }
.sheet.size-xl { --sheet-w: 1320px; }
.sheet.size-full { --sheet-w: 1480px; }

.sheet-head {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  flex: 0 0 auto;
  padding: 21px 23px 17px;
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(420px 160px at 100% 0%, var(--brand-tint), transparent 70%),
    var(--surface);
}
.sheet-heading { flex: 1; min-width: 0; }
.sheet-kicker {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 8.5px;
  line-height: 1.3;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--brand-strong);
}
.sheet-kicker .dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.sheet-title {
  margin-top: 4px;
  font-size: clamp(20px, 2.1vw, 26px);
  line-height: 1.15;
  font-weight: 800;
  letter-spacing: -0.04em;
}
.sheet-sub { margin-top: 4px; font-size: 11px; line-height: 1.5; color: var(--muted); max-width: 620px; }
.sheet-head-actions { display: flex; align-items: center; gap: 7px; flex: 0 0 auto; padding-top: 1px; }
.sheet-close {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  border: 1px solid transparent;
  background: var(--card-2);
  color: var(--muted);
  transition: background 0.15s ease, color 0.15s ease, transform 0.15s var(--ease);
}
.sheet-close:hover { background: var(--card-3); color: var(--ink); transform: rotate(3deg); }
.sheet-close .icon { width: 17px; height: 17px; }
.sheet-back {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink-2);
}
.sheet-back:hover { border-color: var(--brand); color: var(--brand-strong); }
.sheet-back .icon { width: 17px; height: 17px; }
.sheet-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 22px 23px 24px;
  overscroll-behavior: contain;
}
.sheet-body.flush { padding: 0; }
.sheet-body.pad-sm { padding: 16px 18px 18px; }
.sheet-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex: 0 0 auto;
  padding: 14px 23px;
  border-top: 1px solid var(--line);
  background: var(--surface);
}
.sheet-foot .foot-left { margin-right: auto; font-size: 9.5px; color: var(--faint); }

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.toolbar-group { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.toolbar-label { font-size: 9.5px; color: var(--muted); font-weight: 500; }

.form-message {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 10.5px;
  font-weight: 500;
  line-height: 1.5;
}
.form-message .icon { width: 15px; height: 15px; margin-top: 1px; }

/* ==========================================================================
   Quote builder
   ========================================================================== */

.quote-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(300px, 0.85fr);
  gap: 20px;
  align-items: start;
}
.quote-form { min-width: 0; }
.quote-form .form-section:first-child { padding-top: 0; }
.quote-aside { position: sticky; top: -22px; min-width: 0; }
.quote-summary {
  position: relative;
  overflow: hidden;
  padding: 19px;
  border-radius: 20px;
  background:
    radial-gradient(420px 260px at 100% 0%, rgba(27, 146, 119, 0.55), transparent 64%),
    radial-gradient(300px 180px at 0% 110%, rgba(217, 162, 74, 0.24), transparent 70%),
    linear-gradient(155deg, #0C261F 0%, #061410 100%);
  color: #F2F7F4;
  box-shadow: 0 24px 60px -32px rgba(4, 20, 15, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.07);
}
.quote-summary::after {
  content: '';
  position: absolute;
  right: -60px;
  bottom: -85px;
  width: 230px;
  height: 230px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.07);
  pointer-events: none;
}
.summary-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; position: relative; z-index: 2; }
.summary-brand { display: flex; align-items: center; gap: 9px; min-width: 0; }
.summary-brand .mini-mark {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.1);
  flex: 0 0 auto;
  display: grid;
  place-items: center;
}
.summary-brand .mini-mark img { width: 100%; height: 100%; object-fit: cover; }
.summary-brand .mini-mark svg { width: 100%; height: 100%; }
.summary-brand strong { display: block; font-size: 11px; font-weight: 600; color: #F2F7F4; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.summary-brand span { display: block; font-size: 8.5px; color: rgba(240, 248, 244, 0.48); letter-spacing: 0.08em; text-transform: uppercase; margin-top: 1px; }
.summary-number {
  font-size: 9px;
  font-weight: 500;
  color: rgba(240, 248, 244, 0.52);
  white-space: nowrap;
  padding-top: 2px;
}
.summary-label {
  margin-top: 24px;
  font-size: 8.5px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(240, 248, 244, 0.48);
}
.summary-total {
  margin-top: 4px;
  font-size: clamp(36px, 4vw, 48px);
  line-height: 1.05;
  font-weight: 800;
  letter-spacing: -0.05em;
  font-variant-numeric: tabular-nums;
  color: #FFFFFF;
}
.summary-total sup { font-size: 0.5em; font-weight: 600; vertical-align: top; top: 0.7em; position: relative; color: rgba(255, 255, 255, 0.55); }
.summary-taxline { margin-top: 3px; font-size: 9px; color: rgba(240, 248, 244, 0.48); }
.summary-lines { margin-top: 17px; padding-top: 13px; border-top: 1px solid rgba(255, 255, 255, 0.12); display: flex; flex-direction: column; gap: 7px; position: relative; z-index: 2; }
.summary-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; font-size: 10px; color: rgba(240, 248, 244, 0.62); }
.summary-row span:last-child { color: #F2F7F4; font-weight: 500; font-variant-numeric: tabular-nums; }
.summary-row.muted-row span:last-child { color: rgba(240, 248, 244, 0.7); }
.summary-row.deposit { margin-top: 3px; padding-top: 8px; border-top: 1px dashed rgba(255, 255, 255, 0.14); font-weight: 600; color: #F2F7F4; font-size: 10.5px; }
.summary-deposit-note { margin-top: 4px; font-size: 8.5px; color: rgba(240, 248, 244, 0.4); line-height: 1.4; }
.summary-margin {
  margin-top: 13px;
  padding: 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.06);
  position: relative;
  z-index: 2;
}
.summary-margin-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 9px; color: rgba(240, 248, 244, 0.6); }
.summary-margin-head strong { font-size: 10px; color: #F2F7F4; font-weight: 600; }
.summary-margin .range-input { --range-fill: var(--margin-fill, 45%); background: linear-gradient(90deg, #E9C98D 0%, #E9C98D var(--range-fill, 45%), rgba(255, 255, 255, 0.16) var(--range-fill, 45%), rgba(255, 255, 255, 0.16) 100%); margin: 8px 0 3px; height: 3px; }
.summary-margin .range-input::-webkit-slider-thumb { border-color: #E9C98D; background: #0B211B; }
.summary-margin .range-input::-moz-range-thumb { border-color: #E9C98D; background: #0B211B; }
.summary-margin-note { display: flex; justify-content: space-between; gap: 8px; font-size: 8px; color: rgba(240, 248, 244, 0.38); }
.summary-actions { margin-top: 16px; display: grid; grid-template-columns: 1fr 1fr; gap: 7px; position: relative; z-index: 2; }
.summary-actions .btn { height: 39px; font-size: 10.5px; border-radius: 10px; }
.summary-actions .btn-primary { background: #E9C98D; color: #1C1509; border-color: transparent; box-shadow: none; }
.summary-actions .btn-primary:hover { background: #F2D8A6; }
.summary-actions .btn-light {
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #F2F7F4;
}
.summary-actions .btn-light:hover { background: rgba(255, 255, 255, 0.14); }
.summary-footnote { display: flex; align-items: center; gap: 5px; margin-top: 9px; font-size: 8px; color: rgba(240, 248, 244, 0.38); position: relative; z-index: 2; }
.summary-footnote .icon { width: 11px; height: 11px; }
.summary-internal { margin-top: 12px; padding-top: 10px; border-top: 1px solid rgba(255, 255, 255, 0.08); display: flex; justify-content: space-between; gap: 8px; font-size: 8.5px; color: rgba(240, 248, 244, 0.42); position: relative; z-index: 2; }
.summary-internal strong { color: rgba(240, 248, 244, 0.72); font-weight: 500; }

.system-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.system-card {
  position: relative;
  display: block;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--field);
  cursor: pointer;
  transition: border-color 0.16s ease, background 0.16s ease, transform 0.16s var(--ease);
}
.system-card:hover { border-color: var(--line-strong); transform: translateY(-1px); }
.system-card:has(input:checked) { border-color: var(--brand); background: var(--brand-tint); box-shadow: inset 0 0 0 1px var(--brand); }
.system-card input { position: absolute; opacity: 0; pointer-events: none; }
.system-card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.system-card-top strong { font-size: 12px; font-weight: 600; letter-spacing: -0.02em; }
.system-rate { font-size: 10px; font-weight: 600; color: var(--brand-strong); white-space: nowrap; }
.system-desc { margin-top: 3px; font-size: 9px; line-height: 1.4; color: var(--muted); }
.system-tag {
  display: inline-block;
  margin-top: 6px;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--card);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 7.5px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.system-check {
  position: absolute;
  top: 9px;
  right: 9px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  border: 1.5px solid var(--line-strong);
  background: var(--card);
  display: grid;
  place-items: center;
  opacity: 0;
  transition: opacity 0.15s ease;
}
.system-check .icon { width: 9px; height: 9px; color: var(--brand-ink); }
.system-card:has(input:checked) .system-check { opacity: 1; background: var(--brand); border-color: var(--brand); }
.system-card:has(input:checked) .system-tag { border-color: transparent; background: var(--brand); color: var(--brand-ink); }
.addon-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }

.quote-customer-preview { display: flex; flex-wrap: wrap; gap: 4px; }
.margin-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.margin-row strong { font-size: 12px; font-weight: 600; }
.margin-value {
  min-width: 52px;
  height: 28px;
  padding: 0 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 7px;
  background: var(--brand-tint);
  color: var(--brand-strong);
  font-size: 11px;
  font-weight: 600;
}
.quote-meta-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }

.quote-ledger { display: flex; flex-direction: column; gap: 7px; }
.quote-list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--card);
  color: inherit;
  text-align: left;
  transition: border-color 0.16s ease, transform 0.16s var(--ease);
}
.quote-list-item:hover { border-color: var(--brand); transform: translateY(-1px); }
.quote-list-main { flex: 1; min-width: 0; }
.quote-list-main strong { display: block; font-size: 11.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.quote-list-main span { display: block; font-size: 9px; color: var(--muted); margin-top: 1px; }
.quote-list-amount { font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ==========================================================================
   Leads
   ========================================================================== */

.leads-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.source-filters { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.source-filter {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 29px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
  color: var(--muted);
  font-size: 9.5px;
  font-weight: 500;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}
.source-filter:hover { color: var(--ink); border-color: var(--line-strong); }
.source-filter.active { background: var(--brand-tint); border-color: transparent; color: var(--brand-strong); font-weight: 600; }
.source-filter .source-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--source-color); }
.source-filter .count { font-size: 8.5px; opacity: 0.65; }

.kanban {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 9px;
  min-height: 470px;
}
.kanban-col {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 420px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card-2);
  transition: background 0.18s ease, border-color 0.18s ease;
}
.kanban-col.drag-over { background: var(--brand-tint); border-color: var(--brand); }
.kanban-head {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 3px 3px 9px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 7px;
}
.kanban-head .stage-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--stage-color); flex: 0 0 auto; }
.kanban-head h3 { font-size: 10px; font-weight: 600; letter-spacing: 0.01em; flex: 1; }
.kanban-count {
  min-width: 18px;
  height: 18px;
  display: inline-grid;
  place-items: center;
  padding: 0 5px;
  border-radius: 5px;
  background: var(--card);
  border: 1px solid var(--line);
  font-size: 8.5px;
  font-weight: 600;
  color: var(--muted);
}
.kanban-value { font-size: 7.5px; color: var(--faint); padding: 0 3px 7px; white-space: nowrap; }
.kanban-cards { display: flex; flex-direction: column; gap: 6px; flex: 1; }
.lead-card {
  position: relative;
  padding: 9px 9px 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
  box-shadow: 0 1px 2px rgba(18, 25, 23, 0.04);
  cursor: grab;
  transition: transform 0.16s var(--ease), border-color 0.16s ease, box-shadow 0.16s ease, opacity 0.16s ease;
}
.lead-card:hover { transform: translateY(-2px); border-color: var(--line-strong); box-shadow: var(--shadow-sm); }
.lead-card:active { cursor: grabbing; }
.lead-card.dragging { opacity: 0.45; transform: rotate(1.5deg) scale(0.98); }
.lead-card-top { display: flex; align-items: flex-start; gap: 5px; }
.lead-card h4 { flex: 1; min-width: 0; font-size: 10.5px; font-weight: 600; letter-spacing: -0.015em; line-height: 1.35; }
.lead-card .drag-dot { color: var(--faint); padding-top: 1px; }
.lead-card .drag-dot .icon { width: 12px; height: 12px; }
.lead-address { margin-top: 2px; font-size: 8px; line-height: 1.4; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lead-card-value { margin-top: 7px; font-size: 14px; font-weight: 700; letter-spacing: -0.035em; font-variant-numeric: tabular-nums; }
.lead-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 5px; margin-top: 6px; }
.lead-card-foot .source-chip { height: 18px; font-size: 8px; gap: 4px; padding-right: 6px; }
.lead-card-foot .source-chip b { width: 12px; height: 12px; font-size: 7px; }
.lead-age { font-size: 7.5px; color: var(--faint); white-space: nowrap; }
.kanban-empty {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 90px;
  padding: 10px;
  border: 1px dashed var(--line-strong);
  border-radius: 9px;
  color: var(--faint);
  font-size: 8.5px;
  text-align: center;
}
.kanban-add {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin-top: 6px;
  height: 26px;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 8.5px;
  font-weight: 500;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.kanban-add:hover { border-color: var(--brand); color: var(--brand-strong); }
.kanban-add .icon { width: 11px; height: 11px; }

.lead-detail-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr); gap: 18px; }
.detail-block { padding: 15px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); }
.detail-block + .detail-block { margin-top: 10px; }
.detail-block-head { display: flex; align-items: center; gap: 7px; margin-bottom: 10px; }
.detail-block-head .icon { width: 15px; height: 15px; color: var(--brand-strong); }
.detail-block-head h3 { font-size: 11.5px; font-weight: 600; letter-spacing: -0.01em; }
.detail-list { display: flex; flex-direction: column; gap: 8px; }
.detail-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; font-size: 10px; }
.detail-row > span:first-child { color: var(--muted); flex: 0 0 auto; }
.detail-row > span:last-child, .detail-row > a { font-weight: 500; text-align: right; word-break: break-word; }
.detail-note { font-size: 10.5px; line-height: 1.65; color: var(--ink-2); white-space: pre-wrap; }
.stage-track { display: flex; align-items: center; gap: 0; margin: 4px 0 16px; }
.stage-track-step { flex: 1; display: flex; align-items: center; gap: 0; min-width: 0; }
.stage-track-step:last-child { flex: 0 0 auto; }
.stage-node {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1.5px solid var(--line-strong);
  background: var(--card);
  display: grid;
  place-items: center;
  color: var(--brand-ink);
  flex: 0 0 auto;
}
.stage-node .icon { width: 10px; height: 10px; opacity: 0; }
.stage-node.done { background: var(--brand); border-color: var(--brand); }
.stage-node.done .icon { opacity: 1; }
.stage-node.current { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-tint); }
.stage-line { height: 1.5px; flex: 1; background: var(--line); }
.stage-line.done { background: var(--brand); }
.stage-track-label { display: flex; justify-content: space-between; gap: 4px; margin: -10px 0 15px; font-size: 7.5px; color: var(--faint); }
.detail-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.detail-actions .btn { flex: 1; min-width: 108px; }

/* ==========================================================================
   Jobs
   ========================================================================== */

.job-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.job-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--card);
  text-align: left;
  color: inherit;
  transition: transform 0.18s var(--ease), border-color 0.18s ease, box-shadow 0.18s ease;
}
.job-card:hover { transform: translateY(-2px); border-color: var(--line-strong); box-shadow: var(--shadow-md); }
.job-thumb {
  position: relative;
  height: 112px;
  overflow: hidden;
  background:
    radial-gradient(120px 100px at 75% 20%, var(--brand-tint-2), transparent 70%),
    linear-gradient(145deg, var(--card-2), var(--card-3));
}
.job-thumb img { width: 100%; height: 100%; object-fit: cover; }
.job-thumb-empty {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--faint);
}
.job-thumb-empty .icon { width: 26px; height: 26px; opacity: 0.5; }
.job-status-chip {
  position: absolute;
  top: 8px;
  left: 8px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 20px;
  padding: 0 7px;
  border-radius: 5px;
  background: rgba(8, 17, 13, 0.7);
  color: #F4F8F5;
  font-size: 7.5px;
  font-weight: 600;
  letter-spacing: 0.03em;
  backdrop-filter: blur(5px);
}
.job-status-chip .dot { width: 4px; height: 4px; border-radius: 50%; background: var(--job-color, #E9C98D); }
.job-date-chip {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 3px 6px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.9);
  color: #1A211E;
  font-size: 7.5px;
  font-weight: 600;
  backdrop-filter: blur(5px);
}
.job-card-body { padding: 10px 11px 11px; }
.job-card-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.job-card-title h3 { font-size: 12px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.3; }
.job-card-value { font-size: 13px; font-weight: 700; letter-spacing: -0.03em; white-space: nowrap; }
.job-address { margin-top: 2px; font-size: 8.5px; color: var(--muted); line-height: 1.4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.job-card-meta { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; margin-top: 7px; }
.job-card-meta .chip { font-size: 8px; min-height: 19px; padding: 2px 6px; }
.job-card-thumbs { display: flex; gap: 3px; margin-left: auto; }
.job-card-thumbs img { width: 21px; height: 17px; object-fit: cover; border-radius: 3px; border: 1px solid var(--line); }

.job-detail-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr); gap: 16px; align-items: start; }
.job-header-band {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 15px;
  margin-bottom: 12px;
  border-radius: 14px;
  background: var(--card-2);
  border: 1px solid var(--line);
}
.job-header-band .job-avatar {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--brand-tint);
  color: var(--brand-strong);
  font-size: 13px;
  font-weight: 600;
  flex: 0 0 auto;
}
.job-header-band h3 { font-size: 16px; font-weight: 700; letter-spacing: -0.03em; line-height: 1.25; }
.job-header-band p { margin-top: 2px; font-size: 9.5px; color: var(--muted); }
.job-header-band .job-header-value { margin-left: auto; text-align: right; }
.job-header-band .job-header-value strong { display: block; font-size: 17px; font-weight: 800; letter-spacing: -0.04em; }
.job-header-band .job-header-value span { display: block; font-size: 8px; color: var(--muted); }

.info-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.info-item {
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--field);
}
.info-item span { display: block; font-size: 7.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--faint); font-weight: 600; }
.info-item strong { display: block; margin-top: 2px; font-size: 10px; font-weight: 500; color: var(--ink); line-height: 1.45; word-break: break-word; }
.flake-swatch {
  display: inline-block;
  width: 9px;
  height: 9px;
  margin-right: 5px;
  border-radius: 50%;
  background: var(--swatch, var(--brand));
  border: 1px solid rgba(0, 0, 0, 0.18);
  vertical-align: -1px;
}
.photo-section { margin-top: 12px; }
.photo-section-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 7px; }
.photo-section-head h4 { font-size: 10px; font-weight: 600; letter-spacing: 0.02em; }
.photo-section-head span { font-size: 8px; color: var(--faint); }

.cure-card {
  position: relative;
  overflow: hidden;
  padding: 16px 15px;
  border-radius: 15px;
  background:
    radial-gradient(220px 150px at 90% 0%, rgba(217, 162, 74, 0.22), transparent 70%),
    linear-gradient(150deg, #0D2820, #071511);
  color: #F2F7F4;
  border: 1px solid rgba(255, 255, 255, 0.07);
}
.cure-card + .handoff-card { margin-top: 10px; }
.cure-eyebrow { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 8px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: rgba(240, 248, 244, 0.48); }
.cure-eyebrow .status { color: #E9C98D; letter-spacing: 0.04em; }
.cure-clock { display: flex; align-items: flex-start; gap: 4px; margin-top: 10px; }
.cure-block { flex: 1; text-align: center; padding: 7px 2px; border-radius: 8px; background: rgba(255, 255, 255, 0.07); border: 1px solid rgba(255, 255, 255, 0.06); }
.cure-value { display: block; font-size: 18px; line-height: 1; font-weight: 700; letter-spacing: -0.04em; font-variant-numeric: tabular-nums; color: #fff; }
.cure-label { display: block; margin-top: 3px; font-size: 6.5px; letter-spacing: 0.08em; text-transform: uppercase; color: rgba(240, 248, 244, 0.4); }
.cure-sep { padding-top: 12px; color: rgba(255, 255, 255, 0.2); font-size: 14px; }
.cure-message { margin-top: 9px; font-size: 8.5px; line-height: 1.5; color: rgba(240, 248, 244, 0.52); }
.cure-actions { display: flex; gap: 6px; margin-top: 11px; }
.cure-actions .btn { flex: 1; height: 32px; font-size: 9.5px; border-radius: 8px; }
.cure-actions .btn-amber { background: #E9C98D; color: #1B1408; }
.cure-actions .btn-ghost { color: rgba(240, 248, 244, 0.75); border-color: rgba(255, 255, 255, 0.1); }
.cure-actions .btn-ghost:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }

.handoff-card {
  padding: 14px 15px;
  border-radius: 15px;
  background: var(--card);
  border: 1px solid var(--line);
}
.handoff-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; margin-bottom: 9px; }
.handoff-head h3 { font-size: 12px; font-weight: 600; letter-spacing: -0.02em; }
.handoff-head p { margin-top: 2px; font-size: 8px; color: var(--muted); }
.handoff-list { display: flex; flex-direction: column; gap: 5px; }
.handoff-list li { position: relative; padding-left: 13px; font-size: 8.5px; line-height: 1.5; color: var(--ink-2); }
.handoff-list li::before { content: ''; position: absolute; left: 2px; top: 6px; width: 4px; height: 4px; border-radius: 50%; background: var(--brand-bright); }
.handoff-actions { display: flex; gap: 6px; margin-top: 11px; }
.handoff-actions .btn { flex: 1; height: 32px; font-size: 9px; }

/* ==========================================================================
   Materials calculator
   ========================================================================== */

.materials-layout { display: grid; grid-template-columns: minmax(0, 0.88fr) minmax(0, 1.12fr); gap: 18px; align-items: start; }
.materials-form { padding: 16px; border-radius: 16px; border: 1px solid var(--line); background: var(--card); }
.materials-form .form-section:first-child { padding-top: 0; }
.mat-hero {
  position: relative;
  overflow: hidden;
  padding: 20px 19px;
  border-radius: 17px;
  background:
    radial-gradient(300px 180px at 92% -20%, rgba(27, 146, 119, 0.55), transparent 65%),
    linear-gradient(150deg, #0C261F, #071511);
  color: #F2F7F4;
  border: 1px solid rgba(255, 255, 255, 0.07);
}
.mat-hero-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.mat-hero .eyebrow { color: rgba(240, 248, 244, 0.45); }
.mat-hero h3 { margin-top: 3px; font-size: 16px; font-weight: 700; letter-spacing: -0.03em; }
.mat-rule { height: 1px; background: rgba(255, 255, 255, 0.1); margin: 15px 0; }
.mat-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.mat-stat { padding: 11px 10px; border-radius: 10px; background: rgba(255, 255, 255, 0.07); border: 1px solid rgba(255, 255, 255, 0.06); }
.mat-stat strong { display: block; font-size: 26px; line-height: 1; font-weight: 800; letter-spacing: -0.05em; font-variant-numeric: tabular-nums; color: #fff; }
.mat-stat strong small { font-size: 10px; font-weight: 500; color: rgba(240, 248, 244, 0.5); letter-spacing: 0; margin-left: 2px; }
.mat-stat span { display: block; margin-top: 4px; font-size: 7.5px; letter-spacing: 0.06em; text-transform: uppercase; color: rgba(240, 248, 244, 0.44); font-weight: 600; }
.mat-summary { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 9.5px; color: rgba(240, 248, 244, 0.6); }
.mat-summary strong { color: #F2F7F4; font-weight: 600; }
.mat-table { margin-top: 12px; border: 1px solid var(--line); border-radius: 13px; overflow: hidden; background: var(--card); }
.mat-row { display: grid; grid-template-columns: 1.4fr 0.7fr 0.7fr; gap: 10px; padding: 9px 12px; border-top: 1px solid var(--line); align-items: center; }
.mat-row:first-child { border-top: 0; }
.mat-row.head { background: var(--card-2); font-size: 7.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--faint); font-weight: 600; }
.mat-row strong { font-size: 10px; font-weight: 500; }
.mat-row span { font-size: 9.5px; color: var(--muted); text-align: right; }
.mat-row .mat-qty { color: var(--ink); font-weight: 600; }
.mat-row .mat-qty em { font-style: normal; font-weight: 400; color: var(--muted); font-size: 8.5px; }
.mat-note { display: flex; align-items: flex-start; gap: 7px; margin-top: 10px; padding: 10px 11px; border-radius: 10px; background: var(--card-2); font-size: 8.5px; line-height: 1.55; color: var(--muted); }
.mat-note .icon { width: 13px; height: 13px; color: var(--brand-strong); margin-top: 1px; }
.mat-cost-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; padding: 11px 12px; background: var(--brand-tint); border-radius: 10px; font-size: 9.5px; color: var(--brand-strong); }
.mat-cost-row strong { font-size: 15px; font-weight: 700; letter-spacing: -0.03em; }
.mat-system-hint { display: flex; align-items: center; gap: 7px; margin-top: 9px; font-size: 9px; color: var(--muted); }
.mat-system-hint .flake-swatch { margin: 0; width: 7px; height: 7px; }

/* ==========================================================================
   Marketing
   ========================================================================== */

.marketing-tabs {
  position: sticky;
  top: -22px;
  z-index: 5;
  display: flex;
  gap: 2px;
  padding: 4px;
  margin: -4px 0 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(12px);
  overflow-x: auto;
}
.marketing-tab {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 34px;
  padding: 0 10px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  white-space: nowrap;
  transition: background 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
}
.marketing-tab .icon { width: 14px; height: 14px; }
.marketing-tab:hover { color: var(--ink); }
.marketing-tab.active { background: var(--card); color: var(--ink); box-shadow: var(--shadow-xs); }
.marketing-panel { animation: fadeRise 0.25s var(--ease); }

.caption-filters { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; margin-bottom: 12px; }
.filter-chip {
  height: 27px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--card);
  color: var(--muted);
  font-size: 9px;
  font-weight: 500;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.filter-chip:hover { border-color: var(--line-strong); color: var(--ink); }
.filter-chip.active { background: var(--brand-tint); border-color: transparent; color: var(--brand-strong); font-weight: 600; }
.caption-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.caption-card {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  transition: border-color 0.16s ease, transform 0.16s var(--ease);
}
.caption-card:hover { border-color: var(--line-strong); transform: translateY(-1px); }
.caption-top { display: flex; align-items: center; gap: 7px; }
.caption-cat { font-size: 7.5px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--brand-strong); }
.caption-title { font-size: 11px; font-weight: 600; letter-spacing: -0.01em; }
.caption-text {
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 9.5px;
  line-height: 1.6;
  color: var(--ink-2);
  white-space: pre-line;
}
.caption-card.expanded .caption-text { display: block; -webkit-line-clamp: unset; }
.caption-actions { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-top: auto; padding-top: 2px; }
.caption-actions .expand-btn { font-size: 8.5px; color: var(--muted); border: 0; background: none; padding: 0; }
.caption-actions .expand-btn:hover { color: var(--ink); }

.post-studio { display: grid; grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr); gap: 20px; align-items: start; }
.post-preview-wrap {
  position: sticky;
  top: 44px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--card-2);
}
.post-preview-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.post-preview-head span { font-size: 8px; color: var(--faint); font-weight: 500; }
.post-canvas { width: 100%; height: auto; border-radius: 9px; box-shadow: 0 10px 30px -22px rgba(7, 20, 14, 0.45); background: var(--card); display: block; }
.post-controls { min-width: 0; }
.post-controls .form-grid { grid-template-columns: 1fr; }
.post-controls .form-section-head { margin-top: 4px; }
.post-note { display: flex; gap: 7px; align-items: flex-start; font-size: 8.5px; line-height: 1.55; color: var(--muted); margin-top: 12px; }
.post-note .icon { width: 13px; height: 13px; margin-top: 1px; color: var(--brand-strong); }
.post-actions { display: flex; gap: 6px; margin-top: 13px; flex-wrap: wrap; }
.post-actions .btn { flex: 1; }

.review-builder { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 0.9fr); gap: 20px; align-items: start; }
.review-card { padding: 16px; border: 1px solid var(--line); border-radius: 15px; background: var(--card); }
.review-fields { display: flex; flex-direction: column; gap: 11px; }
.review-message {
  min-height: 220px;
  width: 100%;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--field);
  font-size: 10.5px;
  line-height: 1.65;
  resize: vertical;
  color: var(--ink-2);
}
.review-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 9px; }
.review-tip { display: flex; align-items: flex-start; gap: 8px; padding: 11px; margin-top: 13px; border-radius: 10px; background: var(--accent-soft); color: var(--accent-strong); font-size: 8.5px; line-height: 1.55; }
.review-tip .icon { width: 13px; height: 13px; flex: 0 0 auto; margin-top: 1px; }

.winter-wrap { max-width: 860px; margin: 0 auto; }
.winter-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 14px; }
.winter-progress { display: flex; align-items: center; gap: 12px; }
.progress-ring { --p: 0; position: relative; width: 51px; height: 51px; border-radius: 50%; background: conic-gradient(var(--brand) calc(var(--p) * 1%), var(--card-3) 0); display: grid; place-items: center; flex: 0 0 auto; }
.progress-ring::before { content: ''; position: absolute; inset: 5px; border-radius: 50%; background: var(--surface); }
.progress-ring span { position: relative; font-size: 10px; font-weight: 700; letter-spacing: -0.02em; }
.winter-head h3 { font-size: 14px; font-weight: 700; letter-spacing: -0.02em; }
.winter-head p { font-size: 9px; color: var(--muted); margin-top: 1px; }
.winter-list { display: flex; flex-direction: column; gap: 6px; }
.winter-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--card);
  transition: background 0.16s ease, border-color 0.16s ease;
}
.winter-item:hover { border-color: var(--line-strong); }
.winter-item.done { background: var(--brand-tint); border-color: transparent; }
.winter-item .check-box { width: 20px; height: 20px; border-radius: 6px; }
.winter-item.done .check-box { background: var(--brand); border-color: var(--brand); }
.winter-item.done .check-box .icon { opacity: 1; transform: scale(1); }
.winter-item .winter-num { width: 16px; font-size: 8px; color: var(--faint); font-weight: 600; flex: 0 0 auto; }
.winter-item span.winter-text { font-size: 10px; line-height: 1.45; color: var(--ink-2); }
.winter-item.done span.winter-text { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--line-strong); }
.winter-item .winter-auto { margin-left: auto; font-size: 7.5px; color: var(--faint); flex: 0 0 auto; }
.winter-actions { display: flex; justify-content: space-between; align-items: center; margin-top: 14px; }

/* ==========================================================================
   Warranty + reminders
   ========================================================================== */

.warranty-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.warranty-card {
  position: relative;
  overflow: hidden;
  padding: 15px;
  border-radius: 15px;
  border: 1px solid var(--line);
  background: var(--card);
  transition: transform 0.18s var(--ease), border-color 0.18s ease;
}
.warranty-card:hover { transform: translateY(-2px); border-color: var(--line-strong); }
.warranty-card::before {
  content: '';
  position: absolute;
  right: -40px;
  top: -60px;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background: var(--brand-tint);
}
.warranty-card-top { position: relative; display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.warranty-seal {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: var(--brand-ink);
  background: linear-gradient(145deg, var(--brand), var(--brand-deep));
  box-shadow: 0 6px 14px -9px var(--brand);
}
.warranty-seal .icon { width: 18px; height: 18px; }
.warranty-card-id { font-size: 7.5px; letter-spacing: 0.1em; color: var(--faint); font-weight: 600; text-transform: uppercase; padding-top: 3px; }
.warranty-card h3 { position: relative; margin-top: 11px; font-size: 14px; font-weight: 700; letter-spacing: -0.025em; }
.warranty-card .w-address { position: relative; margin-top: 1px; font-size: 8.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.warranty-meta { position: relative; display: flex; flex-wrap: wrap; gap: 5px; margin-top: 9px; }
.warranty-dates { position: relative; display: flex; gap: 16px; margin-top: 10px; padding-top: 9px; border-top: 1px solid var(--line); }
.warranty-dates span { display: block; font-size: 7px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--faint); font-weight: 600; }
.warranty-dates strong { display: block; margin-top: 1px; font-size: 9px; font-weight: 500; color: var(--ink-2); }
.warranty-card-actions { position: relative; display: flex; gap: 6px; margin-top: 10px; }
.warranty-card-actions .btn { flex: 1; height: 30px; font-size: 8.5px; border-radius: 8px; }
.warranty-empty-art { display: flex; justify-content: center; padding: 8px 0 2px; }

.reminders-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 13px; }
.reminder-stat { padding: 11px 12px; border: 1px solid var(--line); border-radius: 11px; background: var(--card); }
.reminder-stat span { display: block; font-size: 7.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--faint); font-weight: 600; }
.reminder-stat strong { display: block; margin-top: 2px; font-size: 20px; font-weight: 800; letter-spacing: -0.04em; line-height: 1.1; }
.reminder-stat.alert strong { color: var(--danger); }
.reminder-list { display: flex; flex-direction: column; gap: 6px; }
.reminder-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--card);
  transition: border-color 0.16s ease, opacity 0.16s ease;
}
.reminder-item:hover { border-color: var(--line-strong); }
.reminder-item.done { opacity: 0.58; }
.reminder-check {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1.5px solid var(--line-strong);
  background: var(--card);
  display: grid;
  place-items: center;
  color: #fff;
  flex: 0 0 auto;
  margin-top: 1px;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.reminder-check .icon { width: 11px; height: 11px; opacity: 0; }
.reminder-check:hover { border-color: var(--brand); }
.reminder-check.checked { background: var(--brand); border-color: var(--brand); }
.reminder-check.checked .icon { opacity: 1; }
.reminder-main { flex: 1; min-width: 0; }
.reminder-top { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.reminder-top strong { font-size: 10.5px; font-weight: 600; letter-spacing: -0.01em; }
.reminder-note { margin-top: 2px; font-size: 8.5px; line-height: 1.5; color: var(--muted); }
.reminder-meta { display: flex; align-items: center; gap: 7px; margin-top: 5px; font-size: 8px; color: var(--faint); }
.reminder-meta .overdue { color: var(--danger); font-weight: 600; }
.reminder-actions { display: flex; align-items: center; gap: 4px; flex: 0 0 auto; }
.reminder-actions .icon-btn { width: 27px; height: 27px; border-radius: 7px; border-color: transparent; background: var(--card-2); }
.reminder-actions .icon-btn .icon { width: 13px; height: 13px; }
.reminder-group-title { display: flex; align-items: center; gap: 7px; margin: 16px 0 7px; font-size: 8px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--faint); font-weight: 600; }
.reminder-group-title:first-child { margin-top: 0; }
.reminder-group-title::after { content: ''; flex: 1; height: 1px; background: var(--line); }

/* ==========================================================================
   Settings
   ========================================================================== */

.settings-layout { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 0.65fr); gap: 18px; align-items: start; }
.settings-main { min-width: 0; }
.settings-side { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.settings-panel {
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card);
}
.settings-panel + .settings-panel { margin-top: 10px; }
.settings-panel h3 { font-size: 12.5px; font-weight: 600; letter-spacing: -0.02em; }
.settings-panel > p.panel-sub { margin-top: 2px; font-size: 9px; line-height: 1.5; color: var(--muted); }
.settings-panel .form-grid { margin-top: 13px; }
.settings-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.logo-row { display: flex; align-items: center; gap: 12px; margin-top: 12px; }
.logo-preview {
  width: 58px;
  height: 58px;
  border-radius: 15px;
  border: 1px solid var(--line);
  background: var(--brand-deep);
  overflow: hidden;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}
.logo-preview img { width: 100%; height: 100%; object-fit: cover; }
.logo-preview svg { width: 100%; height: 100%; }
.logo-actions { display: flex; flex-direction: column; gap: 5px; align-items: flex-start; }
.logo-actions .btn { height: 29px; font-size: 9.5px; border-radius: 7px; }
.logo-hint { font-size: 8px; color: var(--faint); line-height: 1.4; }
.brand-swatches { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; margin-top: 10px; }
.swatch {
  width: 27px;
  height: 27px;
  padding: 0;
  border-radius: 50%;
  border: 2px solid transparent;
  background: var(--swatch, var(--brand));
  outline: 1px solid var(--line);
  outline-offset: 1px;
  position: relative;
  transition: transform 0.15s var(--ease), outline-color 0.15s ease;
}
.swatch:hover { transform: scale(1.08); }
.swatch.active { outline: 2px solid var(--ink); outline-offset: 2px; }
.swatch.active::after {
  content: '';
  position: absolute;
  inset: 0;
  margin: auto;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 1.5px rgba(0, 0, 0, 0.3);
}
.custom-color { display: flex; align-items: center; gap: 7px; margin-top: 10px; }
.custom-color label { font-size: 8.5px; color: var(--muted); font-weight: 500; }
.color-input { width: 32px; height: 28px; border-radius: 7px; padding: 2px; border: 1px solid var(--line); background: var(--field); cursor: pointer; }
.settings-side .settings-panel h3 { font-size: 11px; }
.data-actions { display: flex; flex-direction: column; gap: 6px; margin-top: 11px; }
.data-actions .btn { justify-content: flex-start; font-size: 10px; }
.data-note { display: flex; align-items: flex-start; gap: 6px; margin-top: 10px; font-size: 8px; line-height: 1.55; color: var(--faint); }
.data-note .icon { width: 12px; height: 12px; margin-top: 1px; }
.storage-meter { height: 4px; border-radius: 99px; background: var(--card-3); margin-top: 8px; overflow: hidden; }
.storage-meter span { display: block; height: 100%; border-radius: inherit; background: var(--brand); }
.storage-line { display: flex; justify-content: space-between; gap: 8px; margin-top: 5px; font-size: 7.5px; color: var(--faint); }
.settings-small-link { font-size: 9px; color: var(--brand-strong); font-weight: 600; }
.theme-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin-top: 10px; }
.theme-option {
  display: flex;
  flex-direction: column;
  gap: 5px;
  align-items: flex-start;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--field);
  color: var(--muted);
  font-size: 9px;
  font-weight: 500;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.theme-option .icon { width: 15px; height: 15px; }
.theme-option.active { border-color: var(--brand); background: var(--brand-tint); color: var(--brand-strong); font-weight: 600; }
.install-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 9px; padding-top: 9px; border-top: 1px solid var(--line); }
.install-row span { font-size: 8.5px; color: var(--muted); line-height: 1.4; }

/* ==========================================================================
   Welcome
   ========================================================================== */

.welcome {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  grid-template-columns: minmax(0, 1.04fr) minmax(0, 0.96fr);
  gap: 0;
  padding: 16px;
  background: var(--bg);
  overflow: hidden;
}
.welcome-art {
  position: relative;
  min-height: calc(100dvh - 32px);
  border-radius: 28px;
  overflow: hidden;
  background: #06110D;
  isolation: isolate;
}
.welcome-art::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(6, 17, 13, 0.02) 40%, rgba(6, 17, 13, 0.55) 100%);
  pointer-events: none;
}
.hero-art { position: absolute; inset: 0; }
.hero-art svg { width: 100%; height: 100%; object-fit: cover; }
.welcome-art-copy {
  position: absolute;
  z-index: 3;
  left: clamp(22px, 3vw, 40px);
  right: clamp(22px, 3vw, 40px);
  bottom: clamp(24px, 3.2vw, 40px);
}
.art-kicker {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 8.5px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(236, 246, 240, 0.48);
}
.art-kicker .dot { width: 5px; height: 5px; border-radius: 50%; background: #E9C98D; }
.welcome-art-copy h2 {
  max-width: 420px;
  margin-top: 8px;
  font-size: clamp(22px, 2.5vw, 34px);
  line-height: 1.12;
  letter-spacing: -0.04em;
  font-weight: 700;
  color: #F4F8F5;
}
.welcome-art-copy h2 em { font-style: normal; color: #E9C98D; }
.welcome-art-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  padding: 7px 10px;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(8px);
  color: rgba(240, 248, 244, 0.8);
  font-size: 8.5px;
  font-weight: 500;
}
.welcome-art-badge .icon { width: 12px; height: 12px; color: #E9C98D; }
.welcome-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  overflow-y: auto;
  padding: clamp(26px, 4vw, 58px) clamp(22px, 4vw, 64px);
}
.welcome-inner { width: 100%; max-width: 500px; }
.welcome-brand { display: flex; align-items: center; gap: 9px; margin-bottom: clamp(24px, 4vh, 44px); }
.welcome-brand .brand-mark { width: 36px; height: 36px; border-radius: 11px; }
.welcome-brand strong { font-size: 12px; font-weight: 600; letter-spacing: -0.01em; }
.welcome-brand span { display: block; font-size: 7.5px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); font-weight: 600; margin-top: 1px; }
.welcome-eyebrow { display: flex; align-items: center; gap: 7px; font-size: 9px; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: var(--brand-strong); }
.welcome-eyebrow .line { width: 20px; height: 1px; background: var(--brand); }
.welcome-title {
  margin-top: 10px;
  font-size: clamp(32px, 3.7vw, 48px);
  line-height: 1.03;
  letter-spacing: -0.05em;
  font-weight: 800;
}
.welcome-title em { font-style: normal; color: var(--brand-strong); }
.welcome-lede { margin-top: 11px; max-width: 440px; font-size: 12px; line-height: 1.65; color: var(--muted); }
.welcome-lede strong { color: var(--ink-2); font-weight: 600; }

.home-screen { margin-top: clamp(20px, 3.2vh, 31px); }
.home-screen-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.home-screen-head h3 { font-size: 10px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-2); }
.home-screen-head span { font-size: 8px; color: var(--faint); }
.platform-tabs { display: flex; gap: 3px; padding: 3px; border-radius: 10px; border: 1px solid var(--line); background: var(--card-2); }
.platform-tab {
  flex: 1;
  height: 29px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-size: 9px;
  font-weight: 500;
  transition: background 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
}
.platform-tab.active { background: var(--card); color: var(--ink); font-weight: 600; box-shadow: var(--shadow-xs); }
.homescreen-steps { margin-top: 9px; padding: 11px 13px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); }
.homescreen-intro { font-size: 9px; line-height: 1.5; color: var(--muted); margin-bottom: 8px; }
.homescreen-step { display: flex; align-items: flex-start; gap: 8px; padding: 4px 0; }
.step-num {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--muted);
  font-size: 7px;
  font-weight: 600;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  margin-top: 1px;
}
.step-copy { font-size: 9px; line-height: 1.5; color: var(--ink-2); }
.step-copy strong { font-weight: 600; }
.ios-share-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  vertical-align: -2px;
  color: var(--brand-strong);
  margin: 0 1px;
  background: var(--card-2);
}
.ios-share-icon .icon { width: 9px; height: 9px; }
.welcome-actions { display: flex; gap: 8px; margin-top: clamp(16px, 2.8vh, 24px); }
.welcome-actions .btn { height: 45px; font-size: 12px; border-radius: 12px; }
.welcome-actions .btn-primary { flex: 1; }
.welcome-actions .btn-secondary { padding: 0 16px; }
.welcome-foot { display: flex; align-items: center; gap: 6px; margin-top: 12px; font-size: 8px; color: var(--faint); }
.welcome-foot .icon { width: 11px; height: 11px; }
.welcome-skip {
  position: absolute;
  top: 28px;
  right: 30px;
  z-index: 4;
  height: 29px;
  padding: 0 10px;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--muted);
  font-size: 9px;
  font-weight: 500;
}
.welcome-skip:hover { color: var(--ink); border-color: var(--line-strong); }

/* art animation */
.art-float { animation: artFloat 8s ease-in-out infinite; transform-origin: center; }
.art-float-slow { animation: artFloat 11s ease-in-out -3s infinite; transform-origin: center; }
.art-glow { animation: artGlow 7s ease-in-out infinite; transform-origin: center; }
.art-spark { animation: artSpark 4.5s ease-in-out infinite; transform-origin: center; }
.art-spark:nth-of-type(2) { animation-delay: -1.7s; }
.art-spark:nth-of-type(3) { animation-delay: -3s; }

/* ==========================================================================
   Toast + confirm
   ========================================================================== */

.toast-stack {
  position: fixed;
  z-index: 200;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  pointer-events: none;
  width: max-content;
  max-width: calc(100vw - 32px);
}
.toast {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 9px 14px 9px 10px;
  border-radius: 10px;
  background: #0D1D18;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #F3F8F5;
  font-size: 10.5px;
  font-weight: 500;
  box-shadow: 0 14px 34px -15px rgba(0, 0, 0, 0.55);
  animation: toastIn 0.35s var(--ease);
  max-width: 100%;
}
.toast .toast-icon {
  width: 21px;
  height: 21px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.1);
  color: #A9E2CF;
  flex: 0 0 auto;
}
.toast .toast-icon .icon { width: 12px; height: 12px; }
.toast.error .toast-icon { color: #F0A79E; }
.toast.is-out { animation: toastOut 0.25s ease forwards; }

.confirm-body { display: flex; align-items: flex-start; gap: 12px; padding: 2px 0 6px; }
.confirm-icon {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  background: var(--danger-soft);
  color: var(--danger);
  flex: 0 0 auto;
}
.confirm-icon.brand { background: var(--brand-tint); color: var(--brand-strong); }
.confirm-icon .icon { width: 19px; height: 19px; }
.confirm-body p { font-size: 11px; line-height: 1.65; color: var(--muted); }
.confirm-body strong { display: block; margin-bottom: 3px; font-size: 13px; font-weight: 600; color: var(--ink); }

.noscript {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--bg);
  color: var(--ink);
  text-align: center;
  font-size: 14px;
}

/* ==========================================================================
   Print documents
   ========================================================================== */

.print-root { display: none; }

@media print {
  @page { size: letter; margin: 0.5in; }
  html, body { overflow: visible !important; height: auto !important; background: #fff !important; }
  body > * { display: none !important; }
  body > #printRoot { display: block !important; }
  #printRoot { color: #141917; font-family: 'Poppins', sans-serif; }
  .print-doc { width: 100%; max-width: 7.5in; margin: 0 auto; background: #fff; color: #141917; font-size: 9.5pt; line-height: 1.5; }
  .doc-brandbar { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding-bottom: 18px; border-bottom: 2.5px solid #0E6F5C; }
  .doc-brand { display: flex; align-items: center; gap: 11px; }
  .doc-logo { width: 44px; height: 44px; border-radius: 10px; overflow: hidden; background: #0E6F5C; display: grid; place-items: center; }
  .doc-logo img, .doc-logo svg { width: 100%; height: 100%; object-fit: cover; }
  .doc-brand strong { display: block; font-size: 14pt; font-weight: 700; letter-spacing: -0.03em; color: #121917; line-height: 1.2; }
  .doc-brand span { display: block; font-size: 7pt; line-height: 1.4; color: #6D7973; margin-top: 1px; }
  .doc-type { text-align: right; }
  .doc-type h1 { font-size: 23pt; font-weight: 800; letter-spacing: -0.04em; line-height: 1; color: #0E6F5C; }
  .doc-type p { font-size: 7.5pt; color: #6D7973; margin-top: 4px; }
  .doc-meta { display: flex; justify-content: space-between; gap: 22px; margin-top: 20px; }
  .doc-meta-block { flex: 1; }
  .doc-label { font-size: 6.5pt; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: #929D97; margin-bottom: 3px; }
  .doc-meta-block strong { display: block; font-size: 10.5pt; font-weight: 600; color: #121917; letter-spacing: -0.02em; }
  .doc-meta-block p { font-size: 8.5pt; color: #37433E; line-height: 1.5; }
  .doc-sheet { margin-top: 20px; border-top: 1px solid #E4E0D6; }
  .doc-line { display: grid; grid-template-columns: 1fr 100px; gap: 16px; padding: 9px 0; border-bottom: 1px solid #EEEAE1; }
  .doc-line-name { font-size: 9pt; font-weight: 600; color: #121917; }
  .doc-line-detail { font-size: 7.5pt; color: #6D7973; margin-top: 1px; }
  .doc-line-amount { text-align: right; font-size: 9pt; font-weight: 500; color: #121917; }
  .doc-totals { width: 250px; margin-left: auto; margin-top: 14px; }
  .doc-total-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 4px 0; font-size: 8.5pt; color: #6D7973; }
  .doc-total-row span:last-child { color: #121917; font-weight: 500; }
  .doc-total-final { margin-top: 7px; padding: 12px 13px; background: #0E6F5C; color: #fff; border-radius: 8px; display: flex; justify-content: space-between; align-items: center; gap: 20px; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .doc-total-final span { font-size: 7.5pt; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: rgba(255,255,255,.75); }
  .doc-total-final strong { font-size: 17pt; font-weight: 800; letter-spacing: -0.03em; color: #fff; }
  .doc-deposit { text-align: right; font-size: 7.5pt; color: #6D7973; margin-top: 6px; }
  .doc-notes { margin-top: 20px; display: grid; grid-template-columns: 1fr 1fr; gap: 22px; padding-top: 14px; border-top: 1px solid #E4E0D6; }
  .doc-notes h3 { font-size: 8pt; font-weight: 600; margin-bottom: 4px; color: #121917; }
  .doc-notes p { font-size: 7.5pt; line-height: 1.55; color: #6D7973; white-space: pre-line; }
  .doc-sign { display: flex; gap: 30px; margin-top: 30px; }
  .doc-sign div { flex: 1; }
  .doc-sign-line { height: 24px; border-bottom: 1px solid #C9C4B7; }
  .doc-sign span { display: block; font-size: 6.5pt; color: #929D97; margin-top: 4px; }
  .doc-footer { display: flex; justify-content: space-between; gap: 20px; margin-top: 26px; padding-top: 10px; border-top: 1px solid #E4E0D6; font-size: 7pt; color: #929D97; }
  .doc-header { padding-bottom: 16px; border-bottom: 2.5px solid #0E6F5C; }
  .doc-header h1 { font-size: 19pt; font-weight: 800; letter-spacing: -0.04em; color: #0E6F5C; line-height: 1.1; }
  .doc-header p { font-size: 8pt; color: #6D7973; margin-top: 3px; }
  .doc-warranty-hero { margin-top: 18px; padding: 20px; border-radius: 12px; background: #0C261F; color: #fff; -webkit-print-color-adjust: exact; print-color-adjust: exact; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
  .doc-warranty-hero strong { display: block; font-size: 16pt; font-weight: 800; letter-spacing: -0.03em; }
  .doc-warranty-hero span { display: block; font-size: 7.5pt; color: rgba(255,255,255,.6); margin-top: 2px; }
  .doc-warranty-hero .doc-seal { width: 56px; height: 56px; border-radius: 50%; border: 1px solid rgba(255,255,255,.35); display: grid; place-items: center; font-size: 7pt; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: #E9C98D; text-align: center; }
  .doc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 18px; }
  .doc-info-box { padding: 11px 13px; border: 1px solid #E4E0D6; border-radius: 8px; }
  .doc-info-box .doc-label { margin-bottom: 3px; }
  .doc-info-box strong { font-size: 9.5pt; font-weight: 600; }
  .doc-info-box p { font-size: 8pt; color: #6D7973; }
  .doc-care { margin-top: 18px; }
  .doc-care h2 { font-size: 12pt; font-weight: 700; letter-spacing: -0.02em; color: #121917; margin-bottom: 8px; }
  .doc-care li { position: relative; padding-left: 14px; margin-bottom: 5px; font-size: 8pt; line-height: 1.5; color: #37433E; list-style: none; }
  .doc-care li::before { content: ''; position: absolute; left: 2px; top: 6px; width: 4px; height: 4px; border-radius: 50%; background: #0E6F5C; }
  .doc-care-toggle { display: flex; gap: 28px; margin: 16px 0 5px; padding: 10px 12px; border-radius: 8px; background: #F3F1EB; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .doc-care-toggle div { flex: 1; }
  .doc-care-toggle span { display: block; font-size: 6.5pt; color: #929D97; text-transform: uppercase; letter-spacing: .08em; }
  .doc-care-toggle strong { display: block; font-size: 10pt; font-weight: 600; color: #121917; margin-top: 1px; }
  .doc-print-note { margin-top: 18px; font-size: 7pt; color: #929D97; text-align: center; }
}

/* ==========================================================================
   Animations
   ========================================================================== */

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fadeRise {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes pulseRing {
  0% { transform: scale(0.7); opacity: 0.7; }
  75%, 100% { transform: scale(1.65); opacity: 0; }
}
@keyframes artFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-9px); }
}
@keyframes artGlow {
  0%, 100% { opacity: 0.45; transform: scale(1); }
  50% { opacity: 0.7; transform: scale(1.05); }
}
@keyframes artSpark {
  0%, 100% { opacity: 0.25; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1.1); }
}
@keyframes toastIn {
  from { opacity: 0; transform: translateY(10px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes toastOut {
  to { opacity: 0; transform: translateY(6px) scale(0.98); }
}
@keyframes shimmer {
  from { background-position: 200% 0; }
  to { background-position: -200% 0; }
}

.reveal { animation: rise 0.55s var(--ease) both; }
.reveal-delay-1 { animation-delay: 0.04s; }
.reveal-delay-2 { animation-delay: 0.08s; }
.reveal-delay-3 { animation-delay: 0.12s; }
.reveal-delay-4 { animation-delay: 0.16s; }
.reveal-delay-5 { animation-delay: 0.2s; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ==========================================================================
   Responsive — rail, tablet, phone
   ========================================================================== */

@media (max-width: 1280px) {
  .local-save { display: none; }
  .week-job-name { font-size: 9px; }
  .pipeline-value { min-width: 38px; }
}

@media (max-width: 1180px) {
  :root { --rail: 86px; }
  .sidebar { padding: 18px 12px 14px; }
  .rail-label { display: none; }
  .nav-item { justify-content: center; padding: 0; height: 48px; }
  .nav-label, .nav-item .badge { display: none; }
  .nav-icon { width: 36px; height: 36px; }
  .nav-item.active .nav-icon { box-shadow: 0 8px 18px -10px var(--brand); }
  .sidebar-foot { display: none; }
  .topbar { padding-left: 18px; }
  .metrics-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metric-value { font-size: 33px; }
  .dash-grid { grid-template-columns: 1fr; }
  .side-stack { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: none; }
  .pipeline-card, .quick-card { min-height: 245px; }
  .week-card { min-height: 310px; }
  .dashboard { min-height: 0; }
  .welcome { grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr); }
  .quote-layout { grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.85fr); }
}

@media (max-width: 1020px) {
  .quote-layout { grid-template-columns: 1fr; }
  .quote-aside { position: static; }
  .quote-summary { max-width: 560px; }
  .materials-layout { grid-template-columns: 1fr; }
  .materials-form { max-width: none; }
  .post-studio { grid-template-columns: 1fr; }
  .post-preview-wrap { position: static; max-width: 470px; margin: 0 auto; width: 100%; }
  .review-builder { grid-template-columns: 1fr; }
  .settings-layout { grid-template-columns: 1fr; }
  .settings-side { display: grid; grid-template-columns: 1fr 1fr; align-items: start; }
  .job-detail-grid { grid-template-columns: 1fr; }
  .warranty-grid { grid-template-columns: 1fr; }
  .caption-grid { grid-template-columns: 1fr 1fr; }
  .kanban { display: flex; overflow-x: auto; padding-bottom: 8px; min-height: 0; }
  .kanban-col { flex: 0 0 252px; min-height: 380px; }
  .lead-detail-grid { grid-template-columns: 1fr; }
  .sheet-head { padding: 18px 19px 15px; }
  .sheet-body { padding: 18px 19px 21px; }
}

@media (max-width: 900px) {
  .welcome { display: block; padding: 12px; overflow-y: auto; }
  .welcome-art { min-height: 0; height: 300px; border-radius: 22px; margin-bottom: -32px; }
  .welcome-art-copy { left: 22px; right: 22px; bottom: 22px; }
  .welcome-art-copy h2 { font-size: 25px; max-width: 340px; }
  .welcome-art-badge { display: none; }
  .welcome-panel { padding: 56px 22px 40px; align-items: flex-start; overflow: visible; }
  .welcome-inner { max-width: 620px; margin: 0 auto; }
  .welcome-brand { margin-bottom: 23px; }
  .welcome-title { font-size: 38px; }
  .welcome-skip { top: 24px; right: 24px; background: rgba(8, 17, 13, 0.6); border-color: rgba(255, 255, 255, 0.16); color: rgba(255, 255, 255, 0.82); backdrop-filter: blur(8px); }
  .welcome-skip:hover { color: #fff; border-color: rgba(255, 255, 255, 0.3); }
  .welcome-actions { margin-top: 18px; }
  .settings-side { grid-template-columns: 1fr; }
}

@media (max-width: 820px) {
  :root { --topbar-h: 64px; }
  .app-shell {
    grid-template-columns: 1fr;
    grid-template-rows: var(--topbar-h) minmax(0, 1fr);
    grid-template-areas: 'topbar' 'workspace';
    height: 100dvh;
  }
  .sidebar { display: none; }
  .mobile-nav { display: flex; }
  .topbar { padding: 0 14px; }
  .brand-mark { width: 38px; height: 38px; border-radius: 11px; }
  .brand-copy strong { font-size: 13.5px; max-width: 220px; }
  .brand-copy span { font-size: 7.5px; }
  .brand { gap: 9px; padding-right: 0; }
  .topbar-actions { gap: 6px; }
  .date-chip, .new-quote-btn { display: none; }
  .topbar .icon-btn { width: 38px; height: 38px; border-color: transparent; background: transparent; }
  .topbar .avatar { width: 36px; height: 36px; }
  .workspace { padding-bottom: calc(82px + env(safe-area-inset-bottom)); }
  .dashboard { padding: 19px 15px 18px; gap: 13px; }
  .dash-head { align-items: flex-start; gap: 9px; }
  .dash-title { font-size: 30px; margin-top: 5px; }
  .dash-sub { font-size: 11.5px; max-width: 92%; }
  .dash-head-actions { position: absolute; top: 74px; right: 15px; }
  .dash-head { position: relative; }
  .sample-pill { height: 27px; padding: 0 8px; font-size: 8px; }
  .sample-pill span.clear-label { display: none; }
  .metrics-grid { gap: 8px; }
  .metric-card { min-height: 118px; padding: 13px 13px 12px; border-radius: 16px; }
  .metric-label { font-size: 8.5px; }
  .metric-value { font-size: 27px; }
  .metric-value.is-money { font-size: 25px; }
  .metric-icon { width: 27px; height: 27px; }
  .metric-spark { height: 17px; width: 34px; }
  .metric-delta { font-size: 8px; }
  .dash-grid { gap: 10px; }
  .side-stack { grid-template-columns: 1fr; gap: 10px; }
  .week-card, .pipeline-card, .quick-card { padding: 14px; border-radius: 18px; }
  .week-card { min-height: 0; }
  .card-head h2 { font-size: 17px; }
  .week-grid { display: flex; width: 100%; overflow-x: auto; gap: 6px; padding-bottom: 2px; scroll-snap-type: x proximity; scrollbar-width: thin; }
  .day-tile { flex: 0 0 110px; min-height: 175px; scroll-snap-align: start; }
  .week-foot { margin-top: 8px; }
  .pipeline-card, .quick-card { min-height: 0; }
  .pipeline-list { margin-top: 2px; }
  .quick-grid { margin-top: 4px; }
  .quick-btn { min-height: 61px; }
  .mobile-nav button.active { color: var(--brand-strong); }
  .sheet-layer { padding: 0; align-items: stretch; justify-content: stretch; }
  .sheet {
    width: 100%;
    max-width: 100%;
    height: 100dvh;
    max-height: 100dvh;
    border-radius: 0;
    border: 0;
    transform: translateY(26px);
  }
  .sheet-layer.is-open .sheet { transform: translateY(0); }
  .sheet-layer.is-closing .sheet { transform: translateY(22px); }
  .sheet-head { padding: calc(14px + env(safe-area-inset-top)) 16px 13px; gap: 10px; }
  .sheet-kicker { font-size: 7.5px; }
  .sheet-title { font-size: 21px; }
  .sheet-sub { font-size: 10px; max-width: 88%; }
  .sheet-body { padding: 15px 16px calc(22px + env(safe-area-inset-bottom)); }
  .sheet-body.flush { padding: 0 0 calc(80px + env(safe-area-inset-bottom)); }
  .sheet-close { width: 34px; height: 34px; }
  .sheet-foot { padding: 11px 16px calc(11px + env(safe-area-inset-bottom)); }
  .sheet-foot .btn { flex: 1; }
  .sheet-head-actions .btn span { display: none; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .full { grid-column: auto; }
  .quote-layout { gap: 15px; }
  .system-grid { grid-template-columns: 1fr 1fr; }
  .addon-grid { grid-template-columns: 1fr; }
  .quote-summary { max-width: none; border-radius: 17px; padding: 16px; }
  .summary-total { font-size: 42px; }
  .summary-actions .btn { height: 41px; }
  .quote-aside { margin-top: 2px; }
  .job-grid { grid-template-columns: 1fr; }
  .job-thumb { height: 128px; }
  .materials-layout { gap: 12px; }
  .materials-form { padding: 13px; border-radius: 14px; }
  .mat-stats { gap: 6px; }
  .mat-stat { padding: 9px 8px; }
  .mat-stat strong { font-size: 22px; }
  .mat-hero { padding: 16px; border-radius: 15px; }
  .caption-grid { grid-template-columns: 1fr; }
  .marketing-tabs { top: -15px; margin-top: 0; overflow-x: auto; justify-content: flex-start; }
  .marketing-tab { flex: 0 0 auto; padding: 0 11px; }
  .caption-text { -webkit-line-clamp: 5; }
  .post-preview-wrap { max-width: 390px; padding: 10px; }
  .post-actions .btn { min-width: 0; font-size: 10px; }
  .review-message { min-height: 190px; }
  .winter-wrap { max-width: none; }
  .winter-head { flex-wrap: wrap; gap: 10px; }
  .warranty-grid { gap: 8px; }
  .reminders-summary { gap: 6px; }
  .reminder-stat { padding: 9px 10px; }
  .reminder-stat strong { font-size: 18px; }
  .reminder-item { padding: 10px; gap: 8px; }
  .reminder-actions .icon-btn.hide-mobile { display: none; }
  .lead-detail-grid { gap: 10px; }
  .detail-actions .btn { min-width: 0; flex: 1 0 40%; }
  .settings-panel { padding: 14px; border-radius: 14px; }
  .settings-layout { gap: 12px; }
  .form-section + .form-section { margin-top: 15px; padding-top: 15px; }
  .welcome { padding: 0; overflow-x: hidden; }
  .welcome-art { height: 280px; border-radius: 0 0 26px 26px; margin-bottom: -20px; }
  .welcome-panel { padding: 47px 18px 34px; }
  .welcome-title { font-size: 34px; }
  .welcome-lede { font-size: 11.5px; }
  .welcome-actions { flex-direction: column; }
  .welcome-actions .btn { width: 100%; }
  .toast-stack { bottom: calc(86px + env(safe-area-inset-bottom)); }
  .lead-card { cursor: pointer; }
}

@media (max-width: 560px) {
  .brand-copy span { display: none; }
  .brand-copy strong { max-width: 160px; }
  .dash-head-actions { top: 69px; }
  .dash-title { font-size: 28px; }
  .metrics-grid { grid-template-columns: 1fr 1fr; }
  .metric-value { font-size: 25px; }
  .metric-value.is-money { font-size: 23px; }
  .metric-icon { width: 25px; height: 25px; }
  .metric-icon .icon { width: 14px; height: 14px; }
  .metric-spark { display: none; }
  .week-foot { display: none; }
  .quick-grid { gap: 5px; }
  .quick-btn { padding: 7px; font-size: 8.5px; }
  .quote-summary { padding: 14px; }
  .summary-total { font-size: 38px; }
  .system-grid { grid-template-columns: 1fr; }
  .system-card { padding: 10px 11px; }
  .system-desc { font-size: 8.5px; }
  .quote-meta-grid { grid-template-columns: 1fr; }
  .mat-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .mat-stat strong { font-size: 19px; }
  .mat-row { grid-template-columns: 1.3fr 0.7fr 0.6fr; gap: 6px; padding: 8px 10px; }
  .mat-row strong { font-size: 9px; }
  .mat-row span { font-size: 8.5px; }
  .job-header-band { padding: 11px; gap: 9px; }
  .job-header-band .job-avatar { width: 36px; height: 36px; }
  .job-header-band h3 { font-size: 14px; }
  .job-header-band .job-header-value strong { font-size: 14px; }
  .info-grid { gap: 5px; }
  .photo-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .warranty-dates { gap: 12px; }
  .reminders-summary { grid-template-columns: repeat(3, 1fr); }
  .reminder-stat span { font-size: 6.5px; letter-spacing: 0.04em; }
  .reminder-stat strong { font-size: 17px; }
  .winter-item .winter-auto { display: none; }
  .welcome-art { height: 262px; }
  .welcome-title { font-size: 31px; }
  .welcome-eyebrow { font-size: 8px; }
  .welcome-brand { margin-bottom: 19px; }
  .home-screen { margin-top: 20px; }
  .platform-tab { font-size: 8px; }
  .welcome-actions .btn { height: 44px; }
  .settings-side { gap: 8px; }
}

@media (max-height: 760px) and (min-width: 821px) {
  .dashboard { padding-top: 18px; padding-bottom: 18px; gap: 12px; }
  .metric-card { min-height: 116px; }
  .metric-value { font-size: 31px; }
  .week-card, .pipeline-card, .quick-card { padding: 14px; }
  .day-tile { min-height: 155px; }
  .week-job { padding: 4px 5px; }
  .week-job-name { font-size: 8.5px; }
  .card-head { margin-bottom: 9px; }
  .quick-btn { min-height: 48px; padding: 6px 8px; }
  .pipeline-row { padding: 2px 3px; }
  .welcome-panel { padding-top: 28px; padding-bottom: 28px; }
  .welcome-title { font-size: 34px; }
  .welcome-brand { margin-bottom: 20px; }
  .home-screen { margin-top: 18px; }
  .welcome-actions { margin-top: 15px; }
  .homescreen-steps { padding: 9px 11px; }
  .homescreen-intro { margin-bottom: 5px; }
  .homescreen-step { padding: 3px 0; }
}

@media (max-width: 1180px) and (min-width: 821px) {
  .dashboard { padding-left: 24px; padding-right: 24px; }
  .week-grid { min-height: 195px; }
}

/* ==========================================================================
   Final component polish
   ========================================================================== */

.metric-card {
  width: 100%;
  text-align: left;
  font-family: var(--font);
  color: var(--ink);
  cursor: pointer;
}
.metric-card:focus-visible { outline-offset: 3px; }

.system-desc { display: block; }

.week-more {
  display: block;
  padding: 2px 3px;
  font-size: 8px;
  font-weight: 500;
  color: var(--muted);
}

.winter-item {
  width: 100%;
  text-align: left;
  font-family: var(--font);
  color: inherit;
  cursor: pointer;
}
.winter-item .check-box .icon { opacity: 0; }
.winter-item.done .check-box .icon { opacity: 1; }

.welcome {
  animation: welcomeIn 0.6s var(--ease) both;
  transition: opacity 0.32s ease, transform 0.32s var(--ease);
}
.welcome.is-closing {
  opacity: 0;
  transform: scale(0.994);
  pointer-events: none;
}
@keyframes welcomeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
.welcome-actions [data-welcome-install-slot] { display: flex; }
.welcome-actions [data-welcome-install-slot]:empty { display: none; }

.more-list { display: flex; flex-direction: column; gap: 3px; }
.more-item {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 9px 10px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: inherit;
  text-align: left;
  transition: background 0.16s ease, border-color 0.16s ease, transform 0.16s var(--ease);
}
.more-item:hover { background: var(--card); border-color: var(--line); transform: translateX(1px); }
.more-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  background: var(--brand-tint);
  color: var(--brand-strong);
}
.more-icon .icon { width: 17px; height: 17px; }
.more-copy { flex: 1; min-width: 0; }
.more-copy strong { display: block; font-size: 11.5px; font-weight: 600; letter-spacing: -0.01em; }
.more-copy span { display: block; margin-top: 1px; font-size: 8.5px; line-height: 1.4; color: var(--muted); }
.more-item > .icon { color: var(--faint); flex: 0 0 auto; }

.settings-heading > .icon { color: var(--faint); width: 16px; height: 16px; flex: 0 0 auto; }
.review-card .form-section-head { margin-bottom: 11px; }
.job-card .job-card-meta { margin-top: 8px; }

.sheet-head-actions .chip { height: 27px; }

/* Photo click cursor and countdown numerals */
[data-view-photo] { cursor: zoom-in; }
.cure-value { font-variant-numeric: tabular-nums; }

@media (max-width: 820px) {
  .welcome-actions [data-welcome-install-slot] { width: 100%; }
  .welcome-actions [data-welcome-install-slot] .btn { width: 100%; }
  .metric-card { min-height: 116px; }
  .dash-head-actions { position: static; margin-left: auto; align-self: flex-start; padding-top: 2px; }
  .dash-head { align-items: flex-start; }
  .dash-sub { max-width: 100%; padding-right: 2px; }
  .marketing-tabs { margin-bottom: 13px; }
  .winter-item { padding: 10px; }
  .settings-heading { gap: 8px; }
  .more-item { padding: 10px; }
}

@media (max-width: 560px) {
  .dash-head-actions { padding-top: 3px; }
  .sample-pill { font-size: 8px; }
  .welcome-actions [data-welcome-install-slot] { display: flex; }
  .warranty-card-actions .btn { font-size: 8px; }
  .caption-actions .btn { height: 30px; font-size: 8.5px; }
  .section-toolbar { flex-wrap: wrap; }
}

/* ChatGPT artwork */
.hero-art .hero-img { width: 100%; height: 100%; object-fit: cover; object-position: center 30%; display: block; }
.icon.art-icon { object-fit: contain; filter: drop-shadow(0 2px 3px rgba(7, 59, 49, 0.18)); }
.nav-icon.has-art { width: 36px; height: 36px; }
.nav-icon.has-art .art-icon { width: 30px; height: 30px; transition: transform 0.2s ease; }
.nav-item.active .nav-icon.has-art { background: var(--brand-tint); box-shadow: none; }
.nav-item:hover .nav-icon.has-art .art-icon { transform: scale(1.06); }
.mobile-nav button .art-icon { width: 26px; height: 26px; }
.empty-state .empty-art { width: 120px; height: 120px; object-fit: contain; margin-bottom: 4px; filter: drop-shadow(0 10px 18px rgba(7, 59, 49, 0.18)); }
.hero-art::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(7, 30, 25, 0.05) 0%, rgba(7, 30, 25, 0.25) 45%, rgba(7, 30, 25, 0.82) 100%); pointer-events: none; }
