:root {
  --ink: #1b2430;
  --ink-soft: #3d4a5c;
  --muted: #6b7787;
  --paper: #f3efe6;
  --panel: #fffdf8;
  --line: #d9d1c3;
  --navy: #1c2b3a;
  --navy-2: #243647;
  --brass: #b8862e;
  --brass-soft: #f3e3c0;
  --field: #2f6b4f;
  --field-soft: #d7ebe0;
  --warn: #c47a12;
  --warn-soft: #f8e6c8;
  --hold: #b85c2a;
  --bad: #9a3b3b;
  --bad-soft: #f3d6d6;
  --sky: #2b6a8a;
  --sky-soft: #d5e8f1;
  --shadow: 0 10px 30px rgba(28, 43, 58, 0.08);
  font-family: "Source Sans 3", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--paper); color: var(--ink); }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
button { cursor: pointer; }

.app { display: grid; min-height: 100vh; grid-template-columns: 228px minmax(0, 1fr); }
.sidebar {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  overflow: auto;
  background: var(--navy);
  color: #f4efe4;
  padding: 18px 12px 20px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.brand { display: flex; gap: 10px; align-items: center; }
.mark {
  width: 36px; height: 36px; border-radius: 8px;
  background: linear-gradient(160deg, #e2b456, #8d6418);
  color: #1c2b3a; font-weight: 800; display: grid; place-items: center;
}
.brand strong { display: block; font-size: 1.05rem; letter-spacing: 0.02em; }
.brand span { color: #c9d3dc; font-size: 0.78rem; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-label {
  margin: 12px 10px 4px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #8fa0b0;
}
.nav a {
  padding: 7px 10px; border-radius: 8px; color: #d7dee6;
}
.nav a.active, .nav a:hover { background: var(--navy-2); color: #fff; }
.side-foot { margin-top: auto; font-size: 0.8rem; color: #9aabba; }

.main { padding: 16px 22px 40px; }
.topbar { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; margin-bottom: 22px; }
.topbar h1 { margin: 0 0 4px; font-size: 1.7rem; letter-spacing: -0.02em; }
.eyebrow { color: var(--brass); font-size: 0.78rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.who { display: flex; align-items: center; gap: 10px; }
.company-chip {
  font-size: 0.82rem; font-weight: 700; color: var(--navy);
  background: var(--brass-soft); border: 1px solid #e0c88a;
  border-radius: 999px; padding: 6px 10px; white-space: nowrap;
}
.avatar {
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--brass-soft); color: var(--navy); display: grid; place-items: center; font-weight: 700;
}
.who button, .ghost, .primary, .danger {
  border-radius: 8px; border: 1px solid var(--line); background: var(--panel); padding: 8px 12px;
}
.primary { background: var(--navy); color: #fff; border-color: var(--navy); }
.danger { background: var(--bad-soft); border-color: #e0b3b3; color: var(--bad); }
select, input[type="date"], input[type="search"] {
  border: 1px solid var(--line); background: var(--panel); border-radius: 8px; padding: 8px 10px;
}

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 20px; }
.stat, .card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: var(--shadow);
}
.stat { padding: 14px 16px; }
.stat em { display: block; font-style: normal; color: var(--muted); font-size: 0.8rem; }
.stat strong { font-size: 1.55rem; }
.split { display: grid; grid-template-columns: 1.4fr 1fr; gap: 14px; }
.card { padding: 16px 18px; }
.card h2 { margin: 0 0 12px; font-size: 1rem; }

.row { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.row:first-of-type { border-top: 0; }
.row:hover { background: #faf6ee; margin: 0 -8px; padding-left: 8px; padding-right: 8px; border-radius: 8px; }
.meta { color: var(--muted); font-size: 0.86rem; }

.pill {
  display: inline-block; padding: 2px 8px; border-radius: 999px;
  font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em;
}
.pill.open { background: var(--sky-soft); color: var(--sky); }
.pill.in_progress { background: var(--warn-soft); color: var(--warn); }
.pill.on_hold { background: #f6ddd0; color: var(--hold); }
.pill.closed { background: var(--field-soft); color: var(--field); }
.pill.cancelled { background: #ececec; color: #666; }
.pill.service { background: #e8e1f4; color: #5b4580; }
.pill.production { background: #dce8f7; color: #2a4d78; }
.pill.accepted, .pill.approved, .pill.issued, .pill.posted { background: var(--field-soft); color: var(--field); }
.pill.submitted { background: var(--sky-soft); color: var(--sky); }
.pill.rejected { background: var(--bad-soft); color: var(--bad); }
.pill.draft, .pill.sent, .pill.pending { background: var(--warn-soft); color: var(--warn); }
.pill.locked { background: var(--brass-soft); color: #7a5610; }
.pill.qualified, .pill.estimating, .pill.proposed, .pill.open { background: var(--sky-soft); color: var(--sky); }
.pill.won, .pill.done, .pill.receipt { background: var(--field-soft); color: var(--field); }
.pill.lost, .pill.disbursement { background: var(--bad-soft); color: var(--bad); }
.pill.new, .pill.milestone { background: var(--brass-soft); color: #7a5610; }

.table-wrap {
  overflow: auto;
  max-height: min(68vh, 740px);
  border: 1px solid var(--line);
  background: #fff;
}
.table-wrap .table,
.table-wrap .line-grid { border: 0; margin: 0; width: 100%; }
.table { width: 100%; border-collapse: collapse; background: #fff; }
.table th {
  position: sticky; top: 0; z-index: 1;
  text-align: left; color: var(--muted); font-size: 0.72rem; text-transform: uppercase;
  letter-spacing: 0.05em; padding: 7px 10px; background: #f7f1e6; border-bottom: 1px solid var(--line);
}
.table td { padding: 7px 10px; border-top: 1px solid var(--line); vertical-align: top; }
.table tbody tr:hover { background: #faf6ee; }
.table tbody tr:focus-within,
.table tbody tr.selected { background: var(--brass-soft); }
.money { font-variant-numeric: tabular-nums; font-weight: 650; }

.phase { margin: 10px 0 14px; }
.bar { height: 8px; background: #ece6da; border-radius: 99px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--brass); }

.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
.photos figure { margin: 0; background: #efe8d8; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); }
.photos img { width: 100%; height: 160px; object-fit: cover; display: block; background: #ddd4c2; }
.photos figcaption { padding: 8px 10px; font-size: 0.82rem; }

.people { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; max-width: 980px; }
.person {
  text-align: left; background: var(--panel); border: 1px solid var(--line);
  border-radius: 14px; padding: 16px; box-shadow: var(--shadow);
}
.person:hover { border-color: var(--brass); }
.person small { display: block; color: var(--muted); margin-top: 4px; }

.gate { min-height: 100vh; display: grid; place-items: center; padding: 32px 16px; }
.gate-card { width: min(980px, 100%); }
.gate-card h1 { font-size: 2.2rem; margin: 8px 0 8px; }
.gate-card .lede { color: var(--ink-soft); max-width: 38rem; margin-bottom: 22px; }

.tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 16px; }
.tab {
  padding: 7px 12px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--panel); color: var(--ink-soft); font-weight: 650; font-size: 0.88rem;
}
.tab.active, .tab:hover { background: var(--navy); color: #fff; border-color: var(--navy); }

.board { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.col { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 12px; min-height: 220px; }
.ticket { border: 1px solid var(--line); border-radius: 10px; padding: 10px; margin-top: 8px; background: #fff; }

.banner { background: var(--brass-soft); border: 1px solid #e0c88a; color: #6b4b12; padding: 10px 12px; border-radius: 10px; margin-bottom: 12px; }
.empty { color: var(--muted); padding: 18px 0; }
.err { color: var(--bad); }
.hidden { display: none !important; }
.click { cursor: pointer; }

@media (max-width: 899px) and (min-width: 721px) {
  .stats, .split { grid-template-columns: 1fr 1fr; }
}

.dock { display: none; }
.more-sheet { display: none; }

.dock {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: var(--navy);
  border-top: 1px solid var(--navy-2);
  grid-template-columns: repeat(6, 1fr);
  align-items: stretch;
  padding-bottom: env(safe-area-inset-bottom);
}
.dock a,
.dock-more {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: 48px;
  padding: 6px 4px;
  color: #c9d3dc;
  font-size: 0.68rem;
  font-weight: 650;
  text-align: center;
  border: 0;
  background: transparent;
  border-radius: 0;
}
.dock a.active,
.dock a:hover,
.dock-more:hover {
  color: var(--brass);
  background: var(--navy-2);
}
.dock-more[aria-expanded="true"] {
  color: var(--brass);
  background: var(--navy-2);
}

.more-sheet {
  position: fixed;
  bottom: calc(48px + env(safe-area-inset-bottom));
  left: 0;
  right: 0;
  z-index: 99;
  background: var(--panel);
  border-top: 1px solid var(--line);
  box-shadow: 0 -8px 24px rgba(28, 43, 58, 0.12);
  padding: 12px 16px 16px;
  display: none;
  flex-direction: column;
  gap: 4px;
  max-height: 60vh;
  overflow-y: auto;
}
.more-sheet a {
  display: block;
  padding: 12px 14px;
  min-height: 44px;
  border-radius: 8px;
  font-weight: 650;
  color: var(--ink);
}
.more-sheet a.active,
.more-sheet a:hover {
  background: var(--brass-soft);
  color: var(--navy);
}
.more-sheet .more-note {
  margin: 8px 0 0;
  padding: 10px 14px 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.4;
}

.preview-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 24rem;
  margin-bottom: 22px;
}
.preview-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-weight: 650;
  font-size: 0.88rem;
}
.preview-form input {
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 8px;
  padding: 10px 12px;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 24rem;
  margin-bottom: 18px;
}
.login-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-weight: 650;
  font-size: 0.88rem;
}
.login-form input {
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 8px;
  padding: 10px 12px;
}
.gate-or {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.offline-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 200;
  background: var(--warn-soft);
  border-bottom: 2px solid var(--warn);
  color: #6b4b12;
  padding: 10px 16px;
  font-weight: 700;
  text-align: center;
  font-size: 0.95rem;
}
.offline-queue {
  list-style: none;
  margin: 6px 0 0;
  padding: 0;
  font-weight: 550;
  font-size: 0.85rem;
}
.offline-queue li { margin: 2px 0; }
.offline-banner code {
  display: block;
  margin-top: 4px;
  font-weight: 550;
  font-size: 0.78rem;
  letter-spacing: 0;
}
.app:has(.offline-banner:not(.hidden)) .sidebar { top: 92px; height: calc(100vh - 92px); }
.app:has(.offline-banner:not(.hidden)) .main { padding-top: 100px; }

.gantt {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}
.gantt-head {
  display: grid;
  grid-template-columns: minmax(140px, 1.4fr) minmax(200px, 3fr);
  gap: 10px;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  font-weight: 700;
}
.gantt-row {
  display: grid;
  grid-template-columns: minmax(140px, 1.4fr) minmax(200px, 3fr);
  gap: 10px;
  align-items: center;
  padding: 8px 0;
  border-top: 1px solid var(--line);
}
.gantt-row:first-of-type { border-top: 0; }
.gantt-track {
  position: relative;
  height: 28px;
  background: #ece6da;
  border-radius: 6px;
  overflow: hidden;
}
.gantt-bar {
  position: absolute;
  top: 4px;
  bottom: 4px;
  border-radius: 4px;
  background: var(--sky);
  min-width: 4px;
}
.gantt-bar.critical { background: var(--bad); }
.gantt-bar.milestone { background: var(--brass); }
.gantt-deps { font-size: 0.78rem; color: var(--muted); margin-top: 2px; }

.markup-stage {
  position: relative;
  display: inline-block;
  max-width: 100%;
  margin-bottom: 12px;
  cursor: crosshair;
}
.markup-stage img {
  display: block;
  max-width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.markup-label {
  position: absolute;
  transform: translate(-50%, -50%);
  background: var(--navy);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  white-space: nowrap;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.field-capture {
  border: 1px dashed var(--line);
  border-radius: 12px;
  padding: 14px;
  margin-top: 12px;
  background: #faf6ee;
}
.field-capture h3 { margin: 0 0 10px; font-size: 0.95rem; }
.portal-reveal {
  background: var(--field-soft);
  border: 1px solid #a8d4bc;
  border-radius: 10px;
  padding: 12px 14px;
  margin-top: 12px;
  word-break: break-all;
}
.pill.queued { background: var(--warn-soft); color: var(--warn); }
.pill.failed { background: var(--bad-soft); color: var(--bad); }
.pill.stubbed { background: #ececec; color: #666; }
.pill.overdue { background: var(--bad-soft); color: var(--bad); }
.pill.critical, .pill.high { background: var(--bad-soft); color: var(--bad); }
.pill.medium { background: var(--warn-soft); color: var(--warn); }
.pill.low { background: var(--sky-soft); color: var(--sky); }
.pill.merged, .pill.disabled, .pill.invited { background: #ececec; color: #666; }
.pill.active { background: var(--field-soft); color: var(--field); }

@media (max-width: 720px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { display: none !important; }
  .dock { display: grid; }
  .more-sheet:not(.hidden) { display: flex; }

  .main {
    padding: 14px 14px 72px;
    padding-bottom: calc(72px + env(safe-area-inset-bottom));
  }

  .topbar {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    margin-bottom: 14px;
  }
  .topbar h1 { font-size: 1.35rem; }
  .who {
    flex-wrap: wrap;
    gap: 8px;
    font-size: 0.88rem;
  }
  .who strong { font-size: 0.92rem; }
  .who .meta { font-size: 0.78rem; }
  .company-chip {
    font-size: 0.72rem;
    padding: 4px 8px;
    white-space: normal;
  }
  .avatar { width: 32px; height: 32px; font-size: 0.82rem; }
  .who button.ghost,
  #signout {
    min-height: 44px;
    min-width: 44px;
    margin-left: auto;
  }

  .stats,
  .split,
  .kpi-row {
    grid-template-columns: 1fr;
  }

  .card {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .table,
  .line-grid {
    display: block;
    width: max-content;
    min-width: 100%;
  }

  .inline-form {
    flex-direction: column;
    align-items: stretch;
  }
  .inline-form label {
    width: 100%;
  }
  .inline-form input,
  .inline-form select,
  .inline-form textarea {
    width: 100%;
    min-width: 0;
  }
  button,
  .ghost,
  .primary,
  .danger,
  .tab {
    min-height: 44px;
    min-width: 44px;
  }

  .board {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    gap: 12px;
    padding-bottom: 4px;
  }
  .board .col {
    flex: 0 0 min(85vw, 280px);
    scroll-snap-align: start;
    min-height: 220px;
  }

  .tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    gap: 8px;
    padding-bottom: 4px;
  }
  .tab {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  .people {
    grid-template-columns: 1fr;
  }
  .gate-card h1 {
    font-size: 1.55rem;
  }

  .filter-bar {
    flex-direction: column;
    align-items: stretch;
  }
  .filter-bar label,
  .filter-bar select,
  .filter-bar input {
    width: 100%;
    min-width: 0;
  }

  .delivery-strip {
    grid-template-columns: 1fr;
  }

  .proposal-editor .proposal-meta {
    grid-template-columns: 1fr;
  }

  .proposal-preview,
  .print-frame {
    display: none;
  }
  .table-wrap { max-height: none; }
  .table th,
  .line-grid th { position: static; }

  .row {
    flex-wrap: wrap;
  }
}

.desk-grid { display: grid; gap: 14px; }
.desk-toolbar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 16px; }
.desk-toolbar .filter-bar { flex: 1 1 280px; margin: 0; }
.proposal-workbench { display: grid; gap: 16px; }
.proposal-preview { min-width: 0; }
.print-frame {
  width: 100%; min-height: 70vh; border: 1px solid var(--line); background: #fff;
}
.crm-desk, .job-desk { align-items: start; }

.filter-bar {
  display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: flex-end;
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
  padding: 8px 12px; margin-bottom: 16px;
}
.filter-bar label { display: flex; flex-direction: column; gap: 4px; font-size: 0.78rem; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; }
.filter-bar select, .filter-bar input { min-width: 140px; }

.kpi-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 16px; }
.kpi {
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px;
}
.kpi em { display: block; font-style: normal; color: var(--muted); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; }
.kpi strong { font-size: 1.35rem; }

.timeline { position: relative; padding-left: 22px; margin: 0; list-style: none; }
.timeline::before {
  content: ""; position: absolute; left: 6px; top: 4px; bottom: 4px;
  width: 2px; background: var(--line);
}
.timeline li { position: relative; padding: 0 0 16px 10px; }
.timeline li::before {
  content: ""; position: absolute; left: -20px; top: 6px;
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--brass); border: 2px solid var(--panel); box-shadow: 0 0 0 1px var(--line);
}
.timeline .when { color: var(--muted); font-size: 0.82rem; margin-bottom: 2px; }
.timeline .what { font-weight: 650; }
.timeline .detail { color: var(--ink-soft); font-size: 0.88rem; margin-top: 2px; }

.proposal-editor .proposal-meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; margin-bottom: 16px; }
.proposal-block { margin-bottom: 18px; }
.proposal-block h3 { margin: 0 0 8px; font-size: 0.95rem; color: var(--ink-soft); }
.proposal-block p, .proposal-block textarea { margin: 0; line-height: 1.5; }
.proposal-block textarea { width: 100%; min-height: 72px; border: 1px solid var(--line); border-radius: 8px; padding: 10px; background: var(--panel); resize: vertical; }

.line-grid { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.line-grid th {
  position: sticky; top: 0; z-index: 1; background: #f7f1e6;
  text-align: left; color: var(--muted); font-size: 0.72rem; text-transform: uppercase;
  letter-spacing: 0.05em; padding: 6px 8px; border-bottom: 2px solid var(--line);
}
.line-grid td { padding: 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.line-grid tbody tr:hover td { background: #faf6ee; }
.line-grid tr.alt td { background: #faf6ee; }
.line-grid tbody tr.section-row:hover td { background: var(--navy); }
.line-grid .section-row td { background: var(--navy); color: #fff; font-weight: 700; padding: 10px 8px; border: 0; }
.line-grid .section-row td:first-child { border-radius: 8px 0 0 8px; }
.line-grid .section-row td:last-child { border-radius: 0 8px 8px 0; }

.editor-toolbar { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0; align-items: center; }
.inline-form {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end;
  padding: 12px 0; border-top: 1px solid var(--line); margin-top: 8px;
}
.inline-form label { display: flex; flex-direction: column; gap: 4px; font-size: 0.78rem; color: var(--muted); }
.inline-form input, .inline-form select, .inline-form textarea { min-width: 120px; }

.findings-list { margin: 0; padding: 0; list-style: none; }
.findings-list li { padding: 8px 0; border-top: 1px solid var(--line); }
.findings-list li:first-child { border-top: 0; }

.log-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px 14px; margin: 10px 0; }
.log-entry { border-top: 1px solid var(--line); padding-top: 14px; margin-top: 14px; }
.log-entry:first-child { border-top: 0; margin-top: 0; padding-top: 0; }

.open-items .row { border-left: 3px solid var(--warn); padding-left: 10px; }
.open-items .row.risk { border-left-color: var(--bad); }

.actions-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }

.delivery-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
  padding: 14px 16px;
}
.delivery-step em {
  display: block;
  font-style: normal;
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}
.delivery-step strong { font-size: 0.95rem; }

@media (min-width: 1100px) {
  .desk-grid {
    grid-template-columns: minmax(0, 1.65fr) minmax(260px, 1fr);
    align-items: start;
  }
  .proposal-workbench {
    grid-template-columns: minmax(0, 1fr) minmax(380px, 42%);
    align-items: start;
  }
  .proposal-preview { position: sticky; top: 12px; }
}

@media (min-width: 1280px) {
  .app { grid-template-columns: 228px minmax(0, 1fr); }
  .main { padding: 14px 22px 36px; }
  .topbar { margin-bottom: 16px; }
  .topbar h1 { font-size: 1.55rem; }
  .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .split { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); align-items: start; }
  .split.crm-desk,
  .split.job-desk { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); }
  .desk-grid { grid-template-columns: minmax(0, 1.7fr) minmax(280px, 1fr); }
  .proposal-workbench { grid-template-columns: minmax(0, 1fr) minmax(400px, 0.88fr); }
  .board { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
  .card { padding: 14px 16px; }
  .table th, .table td { padding: 6px 10px; }
  .filter-bar { padding: 8px 10px; }
}
