/* ============================================================
   SIGNA CRM — internal portal
   Deliberately distinct from the public site: dark rail, dense
   tables, no hero furniture. Never indexed.
   ============================================================ */

.crm {
  margin: 0;
  background: var(--paper-2);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

/* Links pick up the surrounding ink — but NOT when they wear a button skin.
   This one selector used to paint black text onto every black button-shaped
   link in the portal: the active filter tab, the "Done" chips, the primary
   actions. A black pill with black writing is not a styling choice. */
.crm a:not(.crm-btn) { color: inherit; }

/* The public site's stylesheet sets `section { padding-block: clamp(3.5rem,
   8vw, 7rem) }` for marketing rhythm. Every panel here is a <section>, so it
   inherited ~112px of dead space top and bottom. Reset it inside the portal. */
.crm section { padding-block: 0; }

/* ---------------------------------------------------------- grid chrome */

.crm__grid {
  display: grid;
  grid-template-columns: 14rem minmax(0, 1fr);
  min-height: 100vh;
}

.crm__side {
  background: var(--ink);
  color: rgba(255, 255, 255, 0.72);
  display: flex;
  flex-direction: column;
  padding: 1.5rem 1rem;
  position: sticky;
  top: 0;
  height: 100vh;
}

.crm__brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: #fff;
  padding: 0 0.5rem 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 1.25rem;
}

.crm__mark {
  width: 0.95rem;
  height: 1.65rem;
  flex: none;
}

.crm__brand strong {
  display: block;
  font-family: var(--display);
  font-size: 1.05rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.1;
}

.crm__brand small {
  display: block;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: rgba(255, 255, 255, 0.45);
  margin-top: 0.15rem;
}

.crm__nav {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  flex: 1;
}

.crm__nav-link {
  display: block;
  padding: 0.6rem 0.75rem;
  border-radius: 3px;
  text-decoration: none;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.66);
  transition: background 0.12s, color 0.12s;
}

.crm__nav-link:hover {
  background: rgba(255, 255, 255, 0.07);
  color: #fff;
}

.crm__nav-link.is-active {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-weight: 600;
}

.crm__side-foot {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 1rem;
  font-size: 0.8rem;
}

.crm__external {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: rgba(255, 255, 255, 0.55) !important;
  text-decoration: none;
  margin-bottom: 0.6rem;
}

.crm__external:hover { color: #fff !important; }
.crm__external svg { width: 0.8rem; height: 0.8rem; }

.crm__signout {
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: rgba(255, 255, 255, 0.72);
  border-radius: 3px;
  padding: 0.4rem 0.7rem;
  font: inherit;
  font-size: 0.78rem;
  cursor: pointer;
  width: 100%;
}

.crm__signout:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }

.crm__who {
  margin-top: 0.9rem;
  line-height: 1.35;
}

.crm__who strong {
  display: block;
  color: #fff;
  font-size: 0.8rem;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
}

.crm__who span {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.4);
}

/* --------------------------------------------------------------- main */

.crm__main { min-width: 0; display: flex; flex-direction: column; }

.crm__topbar {
  padding: 1.6rem clamp(1rem, 3vw, 2.25rem) 1.1rem;
  border-bottom: 1px solid var(--line);
  background: var(--paper);
}

.crm__topbar h1 {
  font-size: clamp(1.3rem, 1.1rem + 0.8vw, 1.75rem);
  margin: 0;
  font-weight: 500;
  letter-spacing: -0.02em;
}

.crm__body { padding: clamp(1.25rem, 3vw, 2.25rem); flex: 1; }

/* ------------------------------------------------------------- metrics */

.crm-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.85rem;
  margin-bottom: 1.75rem;
}

.crm-metric {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 1rem 1.1rem;
}

.crm-metric b {
  display: block;
  font-family: var(--display);
  font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1;
  margin-bottom: 0.35rem;
}

.crm-metric span {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--ink-3);
}

.crm-metric--hot b { color: var(--heritage); }

/* --------------------------------------------------------------- panel */

.crm-panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 4px;
  margin-bottom: 1.25rem;
}

.crm-panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.15rem;
  border-bottom: 1px solid var(--line-soft);
  flex-wrap: wrap;
}

.crm-panel__head h2 {
  font-size: 0.95rem;
  margin: 0;
  font-weight: 600;
  letter-spacing: 0;
}

.crm-panel__body { padding: 1.15rem; }
.crm-panel__body--flush { padding: 0; }

/* --------------------------------------------------------------- table */

.crm-table-wrap { overflow-x: auto; }

.crm-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  min-width: 46rem;
}

.crm-table th {
  text-align: left;
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--ink-3);
  padding: 0.7rem 1rem;
  border-bottom: 1px solid var(--line);
  background: var(--paper-2);
  white-space: nowrap;
}

.crm-table td {
  padding: 0.8rem 1rem;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: top;
}

.crm-table tbody tr:hover { background: rgba(20, 18, 15, 0.02); }
.crm-table tbody tr:last-child td { border-bottom: 0; }
.crm-table .nowrap { white-space: nowrap; }
.crm-table a { color: var(--glass); text-decoration: none; font-weight: 500; }
.crm-table a:hover { text-decoration: underline; }

.crm-empty {
  padding: 2.5rem 1.15rem;
  text-align: center;
  color: var(--ink-3);
  font-size: 0.9rem;
}

/* --------------------------------------------------------------- pills */

.crm-pill {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.22rem 0.5rem;
  border-radius: 2px;
  white-space: nowrap;
}

.crm-pill--new       { background: #E4F1F2; color: #0A5A66; }
.crm-pill--contacted { background: #F3E7D9; color: #8A5527; }
.crm-pill--quoted    { background: #EDE7F6; color: #4A3580; }
.crm-pill--won       { background: #E3F1E5; color: #276237; }
.crm-pill--lost      { background: #F2E9E7; color: #7A4A41; }

/* --------------------------------------------------------------- forms */

.crm-field { display: grid; gap: 0.35rem; margin-bottom: 0.9rem; }

.crm-field > label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-3);
}

.crm-input,
.crm-select,
.crm-textarea {
  font: inherit;
  font-size: 0.9rem;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: #fff;
  width: 100%;
  color: var(--ink);
}

.crm-input:focus,
.crm-select:focus,
.crm-textarea:focus {
  outline: 2px solid var(--glass);
  outline-offset: -1px;
  border-color: transparent;
}

.crm-textarea { min-height: 5.5rem; resize: vertical; }

.crm-actions { display: flex; gap: 0.6rem; flex-wrap: wrap; align-items: center; }

.crm-btn {
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  padding: 0.6rem 1.1rem;
  border-radius: 3px;
  border: 1px solid transparent;
  background: var(--ink);
  color: #fff;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.crm-btn:hover { background: var(--ink-2); }

.crm-btn--ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}

.crm-btn--ghost:hover { background: var(--paper-2); }
.crm-btn--sm { font-size: 0.78rem; padding: 0.4rem 0.75rem; }
.crm-btn--block { width: 100%; justify-content: center; }

/* -------------------------------------------------------------- notice */

.crm-notice {
  border-radius: 3px;
  padding: 0.8rem 1rem;
  font-size: 0.875rem;
  margin-bottom: 1.1rem;
  border: 1px solid;
}

.crm-notice--err { background: #FBEDEA; border-color: rgba(176, 58, 38, 0.3); color: #8C2D1D; }
.crm-notice--ok  { background: #E3F1E5; border-color: rgba(39, 98, 55, 0.28); color: #276237; }
.crm-notice--info{ background: var(--glass-tint); border-color: rgba(14, 122, 138, 0.25); color: #0A5A66; }
.crm-notice code {
  font-family: var(--mono);
  font-size: 0.85em;
  background: rgba(20, 18, 15, 0.07);
  padding: 0.1em 0.35em;
  border-radius: 2px;
}

/* ------------------------------------------------------- detail layout */

.crm-detail {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  gap: 1.25rem;
  align-items: start;
}

.crm-dl { display: grid; gap: 0.85rem; margin: 0; }

.crm-dl > div {
  display: grid;
  grid-template-columns: 7.5rem minmax(0, 1fr);
  gap: 0.75rem;
  align-items: baseline;
}

.crm-dl dt {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-3);
}

.crm-dl dd { margin: 0; font-size: 0.9rem; }
.crm-dl dd a { color: var(--glass); text-decoration: none; }
.crm-dl dd a:hover { text-decoration: underline; }

/* ---------------------------------------------------------------- notes */

.crm-notes { list-style: none; margin: 0; padding: 0; }

.crm-notes li {
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--line-soft);
  font-size: 0.875rem;
  line-height: 1.55;
}

.crm-notes li:last-child { border-bottom: 0; }

.crm-notes__meta {
  display: flex;
  gap: 0.5rem;
  align-items: baseline;
  font-size: 0.7rem;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.35rem;
}

.crm-notes__meta strong { color: var(--ink-2); text-transform: none; letter-spacing: 0; font-size: 0.76rem; }

.crm-note-body { white-space: pre-wrap; }

/* ---------------------------------------------------------------- misc */

.crm-sub { font-size: 0.8rem; color: var(--ink-3); margin: 0.2rem 0 0; }
.crm-mono { font-family: var(--mono); font-size: 0.82rem; }
.crm-row { display: flex; gap: 0.6rem; flex-wrap: wrap; align-items: center; }
.crm-toolbar { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; margin-bottom: 1rem; }
.crm-toolbar form { display: flex; gap: 0.4rem; align-items: center; flex-wrap: wrap; }

.crm-empty-state {
  background: var(--paper);
  border: 1px dashed var(--line);
  border-radius: 4px;
  padding: 2.5rem 1.5rem;
  text-align: center;
}

.crm-empty-state h2 { font-size: 1.05rem; margin-bottom: 0.5rem; }
.crm-empty-state p { color: var(--ink-3); font-size: 0.9rem; margin: 0 auto; max-width: 34rem; line-height: 1.6; }
.crm-empty-state .crm-actions { justify-content: center; margin-top: 1.25rem; }

/* --------------------------------------------------------------- auth */

.crm--auth {
  background: var(--ink);
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 2rem 1rem;
}

.crm-auth { width: 100%; max-width: 24rem; }

.crm-auth__card {
  background: var(--paper);
  border-radius: 5px;
  padding: clamp(1.75rem, 5vw, 2.5rem);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}

.crm-auth__head { text-align: center; margin-bottom: 1.75rem; }

.crm-auth__mark {
  width: 1.5rem;
  height: 2.6rem;
  margin: 0 auto 0.65rem;
  display: block;
}

.crm-auth__brand {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--ink-3);
  margin: 0 0 0.6rem;
}

.crm-auth__head h1 {
  font-size: clamp(1.4rem, 1.2rem + 0.8vw, 1.75rem);
  margin: 0 0 0.4rem;
  font-weight: 500;
}

.crm-auth__sub {
  font-size: 0.85rem;
  color: var(--ink-3);
  margin: 0;
  line-height: 1.5;
}

.crm-auth__foot {
  margin-top: 1.5rem;
  padding-top: 1.15rem;
  border-top: 1px solid var(--line-soft);
  text-align: center;
  font-size: 0.8rem;
  color: var(--ink-3);
}

.crm-auth__legal {
  text-align: center;
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.35);
  margin: 1.5rem 0 0;
  letter-spacing: 0.03em;
}

/* ------------------------------------------------------------ responsive */

@media (max-width: 900px) {
  .crm__grid { grid-template-columns: 1fr; }

  /* Narrow screens: the rail becomes a sticky top bar. The nav is one
     horizontally scrollable strip rather than a wrapping block of links —
     a 15-item wrap would eat half the screen before any work is visible. */
  .crm__side {
    position: sticky;
    top: 0;
    height: auto;
    z-index: 40;
    flex-direction: row;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0 0;
    flex-wrap: nowrap;
    /* A nowrap flex row sizes to its content. Without these three the bar
       grows to the full 15-item width and drags the page wider than the
       screen. `min-width: 0` + clipping keeps it inside the viewport while
       the nav strip scrolls on its own axis. */
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    overflow: hidden;
  }
  .crm__brand {
    border: 0;
    margin: 0;
    padding: 0 0 0.6rem 1rem;
    flex: none;
  }
  .crm__brand small { display: none; }

  .crm__nav {
    flex-direction: row;
    flex-wrap: nowrap;
    flex: 1 1 auto;
    gap: 0.2rem;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 0 1rem 0.6rem;
  }
  .crm__nav::-webkit-scrollbar { display: none; }
  .crm__nav-link {
    padding: 0.4rem 0.7rem;
    font-size: 0.8rem;
    white-space: nowrap;
    flex: none;
  }

  .crm__side-foot {
    border: 0;
    padding: 0 1rem 0.6rem 0;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex: none;
  }
  .crm__external, .crm__who { display: none; }
  .crm__signout { width: auto; font-size: 0.74rem; }

  /* The top bar is short now, so the page heading sits right under it. */
  .crm__topbar { padding-top: 1.15rem; }

  .crm-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .crm-detail { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
  .crm-dl > div { grid-template-columns: 1fr; gap: 0.15rem; }
  .crm-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.6rem; }
}

/* ============================================================
   WORK ORDERS — page 1, page 2 (size sheet), print
   The document has to look like paperwork, not a web page.
   ============================================================ */

.crm-pill--wo-draft       { background: #EFEAE2; color: #5A5348; }
.crm-pill--wo-issued      { background: #E8EEFD; color: #1D4ED8; }
.crm-pill--wo-in_progress { background: #FDF6DC; color: #8A6D0B; }
.crm-pill--wo-complete    { background: #E3F3EC; color: #0A7B57; }
.crm-pill--wo-cancelled   { background: #FBEAE8; color: #B4453A; }

.crm-table .num,
.wo-calc .num,
.wo-sheet .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* ---------------------------------------------------------- the document */

.wo-doc {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1.9rem 2.1rem 2.2rem;
  margin-bottom: 1.25rem;
  box-shadow: 0 1px 2px rgba(20, 18, 15, 0.04);
}

.wo-doc__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 2rem;
  padding-bottom: 1.1rem;
  border-bottom: 2px solid var(--ink);
  margin-bottom: 1.5rem;
}

/* Brand lockup on printed work orders and size sheets. The mark is the real
   three-pane drawing from components/icons.tsx, so a printed document carries
   the same logo as the site header and the portal sidebar. */
.wo-doc__brand { display: flex; align-items: center; gap: 0.7rem; }
.wo-doc__mark {
  width: 1.35rem;
  height: 2.35rem;
  flex: none;
}

.wo-doc__kicker {
  margin: 0 0 0.35rem;
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.wo-doc__num {
  margin: 0;
  font-family: var(--display);
  font-size: 1.75rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.wo-doc__meta {
  display: flex;
  gap: 1.6rem;
  text-align: right;
}

.wo-doc__meta > div { display: flex; flex-direction: column; gap: 0.15rem; }

.wo-doc__meta span {
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.wo-doc__meta b { font-size: 0.86rem; font-weight: 600; white-space: nowrap; }

.wo-doc__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.6rem;
  margin-bottom: 1.4rem;
}

.wo-doc__grid--tight { gap: 1.1rem; }

.wo-block h3 {
  margin: 0 0 0.7rem;
  font-family: var(--mono);
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.wo-block--carry {
  border-left: 3px solid var(--glass);
  padding-left: 0.95rem;
  margin-bottom: 1.5rem;
}

.wo-dl {
  margin: 0;
  display: grid;
  gap: 0.42rem;
}

.wo-dl > div {
  display: grid;
  grid-template-columns: 6.5rem 1fr;
  gap: 0.5rem;
  align-items: baseline;
}

.wo-dl > div.span2 { grid-column: span 2; }

.wo-dl dt {
  font-size: 0.72rem;
  color: var(--ink-3);
  letter-spacing: 0.02em;
}

.wo-dl dd {
  margin: 0;
  font-size: 0.88rem;
  font-weight: 500;
  line-height: 1.4;
}

.wo-scope {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.65;
  white-space: pre-wrap;
  color: var(--ink-2, #3A342C);
}

.wo-scope--tight { font-size: 0.84rem; line-height: 1.55; }

.wo-loc {
  margin: 0.8rem 0 0;
  font-size: 0.84rem;
  color: var(--ink-3);
}

.wo-loc span {
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  margin-right: 0.5rem;
}

.wo-sheetstat { margin: 0 0 0.8rem; font-size: 0.84rem; color: var(--ink-3); }
.wo-sheetstat b { color: var(--ink); font-size: 1rem; }

/* --------------------------------------------------------------- tables */

.wo-calc,
.wo-sheet {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.wo-calc th,
.wo-calc td {
  padding: 0.5rem 0.6rem;
  border-bottom: 1px solid var(--line-soft);
  text-align: left;
}

.wo-calc thead th {
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-3);
  font-weight: 600;
  border-bottom: 1px solid var(--line);
}

.wo-calc tbody th[scope='row'] { font-weight: 500; color: var(--ink-2, #3A342C); }
.wo-calc tfoot th,
.wo-calc tfoot td { font-weight: 650; border-top: 1px solid var(--line); border-bottom: 0; }

.wo-calc .wo-warn th,
.wo-calc .wo-warn td { color: #8A6D0B; }

.wo-calc .wo-total th,
.wo-calc .wo-total td {
  font-size: 0.95rem;
  border-top: 2px solid var(--ink);
  padding-top: 0.65rem;
}

.wo-sheet { margin-bottom: 1.4rem; }

.wo-sheet th,
.wo-sheet td {
  padding: 0.45rem 0.55rem;
  border-bottom: 1px solid var(--line-soft);
  text-align: left;
  vertical-align: middle;
}

.wo-sheet thead th {
  font-family: var(--mono);
  font-size: 0.58rem;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--ink-3);
  font-weight: 600;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

.wo-sheet tfoot th,
.wo-sheet tfoot td {
  font-weight: 600;
  border-bottom: 1px solid var(--line-soft);
}

.wo-sheet tfoot .wo-total th,
.wo-sheet tfoot .wo-total td {
  border-top: 2px solid var(--ink);
  border-bottom: 0;
  font-size: 0.95rem;
}

.wo-sheet-title {
  margin: 0 0 0.7rem;
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.wo-sheet form { margin: 0; }
.wo-sheet .crm-btn--sm { padding: 0.1rem 0.5rem; line-height: 1.4; }

/* ------------------------------------------------------------- edit form */

.wo-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 1rem;
}

.wo-form-grid--sheet { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.wo-form-grid .span2 { grid-column: span 2; }
.wo-form-grid--sheet .span2 { grid-column: span 2; }

/* ---------------------------------------------------------- print view */

.wo-print {
  margin: 0;
  padding: 0;
  background: #E8E4DC;
  font-family: var(--sans);
  color: var(--ink);
}

.wo-print__bar {
  display: flex;
  gap: 0.6rem;
  padding: 0.9rem 1.2rem;
  background: #fff;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 10;
}

.wo-print__page {
  background: #fff;
  width: min(8.5in, 100%);
  margin: 1.2rem auto;
  padding: 0.65in 0.7in;
  box-shadow: 0 2px 14px rgba(20, 18, 15, 0.12);
  font-size: 0.82rem;
}

.wo-sign {
  display: flex;
  gap: 2.5rem;
  margin-top: 2.2rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--line);
}

.wo-sign > div { flex: 1; }

.wo-sign span {
  display: block;
  font-family: var(--mono);
  font-size: 0.58rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 1.6rem;
}

.wo-sign i {
  display: block;
  border-bottom: 1px solid var(--ink);
  height: 0;
}

/* ------------------------------------------------------------ responsive */

@media (max-width: 900px) {
  .wo-doc { padding: 1.4rem 1.3rem 1.6rem; }
  .wo-doc__head { flex-direction: column; gap: 0.9rem; }
  .wo-doc__meta { text-align: left; gap: 1.2rem; }
  .wo-doc__grid { grid-template-columns: 1fr; gap: 1.2rem; }
  .wo-form-grid { grid-template-columns: 1fr; }
  .wo-form-grid--sheet { grid-template-columns: 1fr 1fr; }
  .wo-form-grid .span2 { grid-column: span 1; }
  .wo-dl > div { grid-template-columns: 5.5rem 1fr; }
  .wo-print__page { padding: 0.4in 0.35in; }
}

@media (max-width: 520px) {
  .wo-form-grid--sheet { grid-template-columns: 1fr; }
  .wo-sheet { font-size: 0.78rem; }
  .wo-sheet th, .wo-sheet td { padding: 0.35rem 0.3rem; }
}

/* ------------------------------------------------------------------ print */

@media print {
  .no-print { display: none !important; }
  .wo-print { background: #fff; }
  .wo-print__bar { display: none; }
  .wo-print__page {
    width: auto;
    margin: 0;
    padding: 0;
    box-shadow: none;
    border-radius: 0;
    font-size: 9.5pt;
  }
  .wo-print__page--break { break-before: page; page-break-before: always; }
  .wo-sheet thead { display: table-header-group; }
  .wo-sheet tr { break-inside: avoid; page-break-inside: avoid; }
  .wo-doc__grid { break-inside: avoid; page-break-inside: avoid; }
  @page { margin: 0.55in 0.6in; }
}

/* ============================================================
   TAKEOFF — sheet 1 (summary) + sheet 2 (measurements)
   Mirrors the shop's paper takeoff: white cells you type in,
   shaded cells that calculate. Never re-style without checking
   src/lib/takeoff.ts — the grouping and rounding are load-bearing.
   ============================================================ */

.wo-doc--sheet { padding-bottom: 1.1rem; }

.tk-sheet-lead {
  margin: 0.2rem 0 1.1rem;
  font-size: 0.86rem;
  line-height: 1.6;
  color: var(--ink-3);
  max-width: 68ch;
}

.wo-sheet-foot {
  margin: 0.9rem 0 0;
  padding-top: 0.7rem;
  border-top: 1px solid var(--line-soft);
  font-size: 0.76rem;
  line-height: 1.55;
  color: var(--ink-3);
}

/* --------------------------------------------------------- the two knobs */

.tk-knobs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.9rem;
  margin-bottom: 0.9rem;
}

.tk-knob {
  border: 1px solid var(--line-soft);
  background: var(--paper-2);
  border-radius: 3px;
  padding: 0.65rem 0.7rem 0.6rem;
}

.tk-knob > label {
  display: block;
  font-family: var(--mono);
  font-size: 0.58rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--ink-3);
  font-weight: 600;
  margin-bottom: 0.45rem;
}

.tk-knob__row {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.tk-knob__row .crm-select {
  flex: 0 0 3.1rem;
  padding-left: 0.35rem;
  padding-right: 0.2rem;
  text-align: center;
}

.tk-knob__row .crm-input {
  flex: 1 1 auto;
  min-width: 0;
  font-family: var(--mono);
  font-size: 0.85rem;
  text-align: right;
  padding-right: 0.4rem;
}

.tk-knob__lead {
  font-family: var(--mono);
  font-size: 0.58rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-3);
  white-space: nowrap;
}

.tk-knob__unit {
  font-family: var(--mono);
  font-size: 0.62rem;
  color: var(--ink-3);
}

.tk-knob > .crm-sub {
  display: block;
  margin-top: 0.4rem;
  font-size: 0.66rem;
  line-height: 1.35;
}

.tk-knob--net { background: #fff; border-color: var(--ink); }

.tk-knob__net {
  font-family: var(--mono);
  font-size: 0.95rem;
  letter-spacing: 0.01em;
}

.tk-inline {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
  margin: 0;
}

/* ---------------------------------------------------------- takeoff grid */

.tk-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
  border: 1px solid var(--ink);
}

.tk-table th,
.tk-table td {
  padding: 0.36rem 0.45rem;
  border: 1px solid var(--line-soft);
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
}

.tk-table thead th {
  font-family: var(--mono);
  font-size: 0.54rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--ink-3);
  background: var(--paper-2);
  border-bottom: 1px solid var(--ink);
  text-align: center;
}

/* calculated columns read as shaded cells on the paper sheet */
.tk-table .grp,
.tk-table .sp {
  text-align: center;
  font-family: var(--mono);
  background: var(--paper-2);
}

.tk-table .grp { color: var(--ink); }

.tk-table .num {
  text-align: right;
  font-family: var(--mono);
}

.tk-table .small { font-size: 0.7rem; }

.tk-table tbody tr:hover td { background: rgba(20, 18, 15, 0.03); }

.tk-table tfoot th,
.tk-table tfoot td {
  font-weight: 650;
  background: var(--paper-2);
  border-top: 1px solid var(--ink);
}

.tk-table tfoot .wo-total th,
.tk-table tfoot .wo-total td { border-top: 2px solid var(--ink); }

/* the letter column — this is what the crew calls each size on site */
.tk-letter {
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-align: center;
  background: #fff;
}

/* ------------------------------------------------------ sheet 2 by room */

.tk-table--measure thead th { white-space: normal; }

.tk-room__head th {
  background: var(--ink);
  color: rgba(255, 255, 255, 0.9);
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 600;
  text-align: left;
  padding: 0.42rem 0.5rem;
  border-color: var(--ink);
}

.tk-table--measure td:first-child {
  font-size: 0.7rem;
  color: var(--ink-3);
  max-width: 9rem;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tk-table--measure tbody + tbody { border-top: 0; }

.tk-table--measure .crm-btn--sm {
  padding: 0 0.4rem;
  line-height: 1.5;
  font-size: 0.8rem;
}

/* ------------------------------------------------------------ responsive */

@media (max-width: 900px) {
  .tk-knobs { grid-template-columns: 1fr 1fr; }
  .wo-doc--sheet { overflow-x: auto; }
  .tk-table { font-size: 0.76rem; }
  .tk-table th, .tk-table td { padding: 0.3rem 0.32rem; }
}

@media (max-width: 520px) {
  .tk-knobs { grid-template-columns: 1fr; }
}

/* ------------------------------------------------------------------ print */

@media print {
  .tk-knobs { display: none; }
  .wo-doc--sheet { padding: 0; overflow: visible; }
  .tk-table { border-color: #000; font-size: 8.5pt; }
  .tk-table thead th { background: #EDEAE4 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .tk-table .grp, .tk-table .sp, .tk-table tfoot th, .tk-table tfoot td {
    background: #EDEAE4 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  .tk-room__head th {
    background: #1A1712 !important;
    color: #fff !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  .tk-table tr { break-inside: avoid; page-break-inside: avoid; }
  .tk-table thead { display: table-header-group; }
  .wo-sheet-foot { font-size: 7.5pt; }
}

/* ============================================================
   TIME CLOCK + TIMESHEETS
   The tech-facing screen. Big targets, one job, no scrolling
   hunt — a phone in a lobby at 7am.
   ============================================================ */

.crm-btn--danger {
  background: #B4453A;
  border-color: #B4453A;
  color: #fff;
}
.crm-btn--danger:hover { background: #9E3A30; border-color: #9E3A30; }

.crm-pill--pay-straight     { background: #EFEAE2; color: #5A5348; }
.crm-pill--pay-eight_hour   { background: #E3F1E5; color: #276237; }
.crm-pill--pay-salary_floor { background: #E8EEFD; color: #1D4ED8; }
.crm-pill--pay-open         { background: #FDF6DC; color: #8A6D0B; }

.tc-card { border-color: var(--ink); }

.tc-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.8rem;
  margin: 0 0 1.1rem;
}

.tc-stats > div {
  border: 1px solid var(--line-soft);
  background: var(--paper-2);
  border-radius: 3px;
  padding: 0.6rem 0.7rem;
}

.tc-stats dt {
  font-family: var(--mono);
  font-size: 0.56rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 0.3rem;
}

.tc-stats dd {
  margin: 0;
  font-family: var(--mono);
  font-size: 1rem;
  font-variant-numeric: tabular-nums;
}

.tc-elapsed { font-size: 1.05rem; font-weight: 650; }

/* the path the tech walked today — job moves in order */
.tc-path {
  list-style: none;
  margin: 0 0 1.2rem;
  padding: 0 0 0 0.9rem;
  border-left: 2px solid var(--line);
}

.tc-path li {
  position: relative;
  padding: 0.28rem 0 0.28rem 0.2rem;
  font-size: 0.85rem;
}

.tc-path li::before {
  content: '';
  position: absolute;
  left: -1.26rem;
  top: 0.72rem;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--paper);
  border: 2px solid var(--ink-3);
}

.tc-path li.is-now::before { background: var(--heritage); border-color: var(--heritage); }

.tc-path__time {
  font-family: var(--mono);
  font-size: 0.66rem;
  color: var(--ink-3);
  margin-right: 0.45rem;
}

.tc-path__why { font-size: 0.74rem; color: var(--ink-3); font-style: italic; }

.tc-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.2rem;
  align-items: start;
  padding-top: 1rem;
  border-top: 1px solid var(--line-soft);
}

.tc-move summary {
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.45rem 0;
  color: var(--heritage);
}

.tc-move[open] summary { margin-bottom: 0.7rem; }

/* ============================================================
   ATTENTION NEEDED
   The loudest thing in the portal. If it is on this board,
   somebody promised a client.
   ============================================================ */

.att-banner {
  display: flex;
  gap: 0.9rem;
  align-items: flex-start;
  background: #FDF3E7;
  border: 1px solid rgba(176, 88, 38, 0.35);
  border-left: 4px solid #B4453A;
  border-radius: 4px;
  padding: 0.9rem 1.1rem;
  margin-bottom: 1.3rem;
}

.att-banner__mark {
  flex: 0 0 1.7rem;
  height: 1.7rem;
  border-radius: 50%;
  background: #B4453A;
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
  display: grid;
  place-items: center;
}

.att-banner b { font-size: 0.95rem; color: #8C2D1D; }

.att-banner p {
  margin: 0.2rem 0 0;
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--ink-3);
  max-width: 62ch;
}

.att-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(21rem, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.att-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-left: 3px solid var(--ink-3);
  border-radius: 4px;
  padding: 0.85rem 1rem 0.7rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.att-card--urgent { border-left-color: #B4453A; background: #FEFAF8; }
.att-card--high   { border-left-color: #C8871F; }
.att-card--normal { border-left-color: var(--line); }
.att-card.is-done { opacity: 0.62; }

.att-card__head {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.att-card__id {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 0.62rem;
  color: var(--ink-3);
}

.crm-pill--att-urgent { background: #FBEAE8; color: #B4453A; }
.crm-pill--att-high   { background: #FDF3E1; color: #8A6D0B; }
.crm-pill--att-normal { background: #EFEAE2; color: #5A5348; }
.crm-pill--att-kind   { background: var(--glass-tint); color: #0A5A66; }
.crm-pill--att-late   { background: #FBEAE8; color: #B4453A; }

.att-card__title {
  margin: 0;
  font-size: 1rem;
  line-height: 1.35;
  font-weight: 600;
}

.att-card__dl {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.4rem 0.9rem;
  margin: 0;
  font-size: 0.82rem;
}

.att-card__dl > div { min-width: 0; }
.att-card__dl .span2 { grid-column: span 2; }

.att-card__dl dt {
  font-family: var(--mono);
  font-size: 0.55rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 0.1rem;
}

.att-card__dl dd { margin: 0; line-height: 1.45; word-break: break-word; }

.att-card__contact {
  margin: 0;
  padding-top: 0.5rem;
  border-top: 1px solid var(--line-soft);
  font-size: 0.78rem;
  color: var(--ink-3);
}

.att-card__contact a { color: var(--heritage); text-decoration: none; }
.att-card__contact a:hover { text-decoration: underline; }

.att-card__foot {
  margin-top: auto;
  padding-top: 0.55rem;
  border-top: 1px solid var(--line-soft);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.att-card__actions {
  margin-left: auto;
  display: flex;
  gap: 0.3rem;
}

.att-card__actions form { margin: 0; }

/* ------------------------------------------------------------ responsive */

@media (max-width: 900px) {
  .tc-stats { grid-template-columns: 1fr 1fr; }
  .tc-actions { grid-template-columns: 1fr; }
  .att-grid { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
  .tc-stats { grid-template-columns: 1fr 1fr; gap: 0.5rem; }
  .tc-stats dd { font-size: 0.9rem; }
  .att-card__dl { grid-template-columns: 1fr; }
  .att-card__dl .span2 { grid-column: span 1; }
}

/* ------------------------------------------------------------------ print */

@media print {
  .tc-actions, .att-card__actions, .att-banner, .crm-toolbar { display: none !important; }
  .att-card { break-inside: avoid; page-break-inside: avoid; }
}

/* ============================================================
   LABOR P&L
   Where the week went. Bars are scaled to the biggest line,
   so the shape of the week is readable without reading numbers.
   ============================================================ */

.crm-pill--pnl-job { background: #E3F1E5; color: #276237; }
.crm-pill--pnl-oh  { background: #F2EDE6; color: #7A6A55; }

.pnl-bar-col { width: 8rem; }

.pnl-bar {
  display: block;
  height: 0.55rem;
  min-width: 2px;
  border-radius: 2px;
  background: #276237;
}

.pnl-bar--oh { background: #B08C5A; }

@media (max-width: 900px) {
  .pnl-bar-col { display: none; }
}

/* ------------------------------------------------------- payroll export */

.qb-out {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 1rem;
}

.qb-out__card {
  border: 1px solid var(--rule, #ddd8cf);
  border-radius: 4px;
  padding: 1rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.qb-out__card h3 {
  margin: 0;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
}

.qb-out__card .crm-sub {
  margin: 0;
  line-height: 1.45;
}

.qb-out__card .crm-btn {
  align-self: flex-start;
  margin-top: auto;
}

.qb-out__hint {
  margin: 0;
  font-size: 0.74rem;
  line-height: 1.5;
  color: #6b665e;
}

.qb-out__hint code {
  font-size: 0.72rem;
  background: #f2efe9;
  padding: 0.05rem 0.28rem;
  border-radius: 2px;
}

.qb-missing {
  color: #a8321f;
  font-size: 0.78rem;
}

.qb-set {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  gap: 0 1.25rem;
}

.qb-h3 {
  margin: 1.4rem 0 0.2rem;
  font-size: 0.86rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #6b665e;
}

@media print {
  .qb-out,
  .qb-h3 {
    display: none !important;
  }
}

/* ------------------------------------------------------ pay rate field */

.crm-rate {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.crm-rate .crm-btn { padding: 0.25rem 0.55rem; }

.crm-input--rate {
  width: 5.2rem;
  padding: 0.3rem 0.45rem;
  font-size: 0.82rem;
  text-align: right;
}

/* ------------------------------------------------------------ schedule */

.crm-toolbar__right { margin-left: auto; display: flex; gap: .4rem; align-items: center; }
.crm-select--sm { padding: .32rem .5rem; font-size: .8rem; }
.sch-title { font-size: 1.05rem; margin: 0; font-weight: 600; letter-spacing: -.01em; }

/*
 * Four tabs, one question each: what is booked, what is happening now, what
 * is waiting, and how do I book. The active tab is teal like every other
 * active chip in the portal — nothing here is ever a black pill.
 */
.sch-tabs {
  display: flex;
  gap: .35rem;
  flex-wrap: wrap;
  align-items: center;
  margin: 0 0 1rem;
  padding-bottom: .7rem;
  border-bottom: 1px solid var(--line-soft, rgba(20, 18, 15, .07));
}

.sch-tab {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .45rem .8rem;
  border-radius: 100px;
  border: 1px solid var(--line, rgba(20, 18, 15, .12));
  background: transparent;
  color: var(--ink-2, #2E2921);
  font-size: .8125rem;
  font-weight: 500;
  text-decoration: none;
  line-height: 1.2;
  transition: background .12s var(--ease, ease), border-color .12s var(--ease, ease);
}

.sch-tab:hover { background: var(--paper-3, #EBE5DA); }

.sch-tab.is-on {
  background: var(--glass, #0E7A8A);
  border-color: var(--glass, #0E7A8A);
  color: #fff;
  font-weight: 560;
}

.sch-tab.is-on:hover { background: var(--glass-deep, #0A5A66); border-color: var(--glass-deep, #0A5A66); }

.sch-tab__n {
  display: inline-grid;
  place-items: center;
  min-width: 1.15rem;
  height: 1.15rem;
  padding: 0 .3rem;
  border-radius: 100px;
  background: var(--paper-3, #EBE5DA);
  color: var(--ink-2, #2E2921);
  font-size: .65rem;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.sch-tab.is-on .sch-tab__n { background: rgba(255, 255, 255, .22); color: #fff; }

/* --------------------------------------------------- job cards (today)
   One card per visit, one colour per TASK. The rail, the chip and the label
   all read from the same scope token, so a demo can never be mistaken for a
   retrofit at a glance — which is the whole point of colour on a job board. */

.sch-jobs { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }

.sch-job {
  --sch: #8A857C;
  display: flex;
  align-items: stretch;
  gap: .7rem;
  padding: .6rem .7rem .6rem 0;
  border: 1px solid var(--line, rgba(20, 18, 15, .12));
  border-radius: 5px;
  background: #fff;
  min-height: 44px;
  overflow: hidden;
}

.sch-job__rail { flex: 0 0 4px; border-radius: 0 2px 2px 0; background: var(--sch); }

.sch-job__body { flex: 1 1 auto; min-width: 0; display: grid; gap: .15rem; }

.sch-job__top { display: flex; align-items: center; gap: .45rem; flex-wrap: wrap; }

.sch-job__job {
  font-size: .875rem;
  font-weight: 600;
  letter-spacing: -.01em;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.sch-job__meta {
  font-size: .75rem;
  color: var(--ink-3);
  line-height: 1.35;
}

.sch-job__note {
  font-size: .72rem;
  color: var(--ink-3);
  font-style: italic;
  line-height: 1.35;
}

.sch-job__open { align-self: center; flex: 0 0 auto; }

/* Task colours. Same four tokens the calendar chips and legend already use. */
.sch-job--demo        { --sch: #A8321F; background: #FDF7F5; }
.sch-job--retrofit    { --sch: #2F6B58; background: #F5FAF7; }
.sch-job--film        { --sch: #2B4F74; background: #F5F8FC; }
.sch-job--maintenance { --sch: #8A6A3B; background: #FCF9F3; }

/* On the calendar tab the strip is a glance, not a list — no buttons. */
.sch-jobs--slim .sch-job { padding: .45rem .6rem .45rem 0; }
.sch-jobs--slim .sch-job__note { display: none; }
.sch-jobs--slim .sch-job__open { display: none; }

@media (max-width: 560px) {
  .sch-job { flex-wrap: wrap; }
  .sch-job__body { flex: 1 1 100%; }
  .sch-job__open { margin-left: auto; }
}

.sch-dot {
  display: inline-block;
  width: .62rem;
  height: .62rem;
  border-radius: 50%;
  flex: 0 0 auto;
  vertical-align: middle;
}

/* --- not scheduled (destination of the NOT SCHEDULED tile) --- */

.sch-pending { border-left: 3px solid #a8321f; }
.sch-pending__list { list-style: none; margin: 0; padding: 0; display: grid; gap: .4rem; }
.sch-pending__row {
  display: flex;
  align-items: center;
  gap: .7rem;
  padding: .55rem .6rem;
  border: 1px solid var(--rule, #ddd8cf);
  border-radius: 4px;
  background: #fff;
  text-decoration: none;
  color: inherit;
  min-height: 44px;
}
.sch-pending__row:hover { background: #faf8f4; border-color: #c9c2b6; }
.sch-pending__bar { width: 3px; align-self: stretch; border-radius: 2px; flex: 0 0 auto; }
.sch-pending__bar--watch { background: #2F6B58; }
.sch-pending__bar--high { background: #b8862f; }
.sch-pending__bar--urgent { background: #a8321f; }
.sch-pending__main { flex: 1 1 auto; min-width: 0; display: grid; gap: .1rem; }
.sch-pending__main b { font-size: .875rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sch-pending__main em,
.sch-pending__age em,
.sch-pending__money em {
  font-style: normal;
  font-size: .72rem;
  color: #7d776d;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sch-pending__age { flex: 0 0 auto; display: grid; justify-items: end; gap: .05rem; text-align: right; }
.sch-pending__age b { font-size: .95rem; font-variant-numeric: tabular-nums; font-weight: 600; }
.sch-pending__age--watch b { color: #2F6B58; }
.sch-pending__age--high b { color: #8a6420; }
.sch-pending__age--urgent b { color: #a8321f; }
.sch-pending__money { flex: 0 0 auto; display: grid; justify-items: end; gap: .05rem; text-align: right; }
.sch-pending__money b { font-size: .82rem; font-variant-numeric: tabular-nums; }
@media (max-width: 520px) {
  .sch-pending__row { flex-wrap: wrap; }
  .sch-pending__main { flex: 1 1 100%; order: 2; }
  .sch-pending__money { order: 3; flex: 1 1 auto; justify-items: start; text-align: left; }
  .sch-pending__age { order: 1; }
}

/* --- today strip --- */

.sch-today { border-left: 3px solid var(--heritage, #8A6A3B); }
.sch-today__list { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.sch-today__list li {
  display: flex;
  align-items: center;
  gap: .55rem;
  font-size: .875rem;
  flex-wrap: wrap;
}

/* --- month grid --- */

.sch-wrap {
  border: 1px solid var(--rule, #ddd8cf);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 1rem;
  background: #fff;
}

.sch-head {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  background: #f7f5f1;
  border-bottom: 1px solid var(--rule, #ddd8cf);
}
.sch-head__cell {
  padding: .45rem .5rem;
  font-size: .68rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #6b665e;
  text-align: center;
}

.sch-grid { display: grid; grid-template-columns: repeat(7, 1fr); }

.sch-cell {
  min-height: 6.2rem;
  border-right: 1px solid #eeebe4;
  border-bottom: 1px solid #eeebe4;
  padding: .3rem .3rem .35rem;
  display: flex;
  flex-direction: column;
  gap: .2rem;
  overflow: hidden;
}
.sch-cell:nth-child(7n) { border-right: none; }
.sch-cell--out { background: #fbfaf8; }
.sch-cell--out .sch-cell__num { color: #c4bfb6; }
.sch-cell--today { background: #fdf8ee; box-shadow: inset 0 0 0 2px var(--heritage, #8A6A3B); }

.sch-cell__num {
  font-size: .72rem;
  font-weight: 600;
  color: #6b665e;
  text-decoration: none;
  align-self: flex-start;
  padding: .05rem .2rem;
  border-radius: 2px;
}
.sch-cell--today .sch-cell__num {
  background: var(--heritage, #8A6A3B);
  color: #fff;
}

.sch-chip {
  display: block;
  font-size: .66rem;
  line-height: 1.25;
  padding: .16rem .3rem;
  border-left: 3px solid #8A6A3B;
  background: #f4f0e8;
  border-radius: 2px;
  text-decoration: none;
  color: #2b2823;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sch-chip:hover { background: #ebe5d8; }
.sch-chip__crew { font-weight: 650; }
.sch-chip__label { opacity: .78; }
.sch-chip__crew::after { content: " · "; opacity: .5; }

.sch-chip--in_progress { background: #e8f2ec; }
.sch-chip--done { opacity: .58; text-decoration: line-through; }
.sch-chip--cancelled { opacity: .45; text-decoration: line-through; }

/* --- legend / crews --- */

.sch-legend {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 1.1rem;
  font-size: .78rem;
  color: #4a453d;
}
.sch-legend__item { display: inline-flex; align-items: center; gap: .38rem; }
.sch-legend__item em { color: #8a857c; font-style: normal; font-size: .72rem; }

.sch-add summary { cursor: pointer; list-style: none; }
.sch-add summary::-webkit-details-marker { display: none; }

.sch-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr));
  gap: 0 .9rem;
}
.sch-form__wide { grid-column: 1 / -1; }

.sch-crews { list-style: none; margin: 0 0 1rem; padding: 0; display: grid; gap: .6rem; }
.sch-crews li { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; font-size: .85rem; }
.sch-crews__form { display: flex; gap: .3rem; margin-left: auto; }

.sch-crew-new {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
  align-items: center;
  padding-top: .9rem;
  border-top: 1px solid #eeebe4;
}
.sch-crew-new .crm-input[type="color"] {
  width: 2.6rem;
  height: 2.1rem;
  padding: .15rem;
  flex: 0 0 auto;
}

.sch-detail {
  display: grid;
  grid-template-columns: 7rem 1fr;
  gap: .5rem .9rem;
  margin: 0 0 1.2rem;
  font-size: .875rem;
}
.sch-detail dt { color: #6b665e; font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; padding-top: .12rem; }
.sch-detail dd { margin: 0; }
.sch-detail__form { padding-top: 1rem; border-top: 1px solid #eeebe4; }

/* --- status pills --- */

.crm-pill--sch-planned { background: #f0ede6; color: #5a5449; }
.crm-pill--sch-confirmed { background: #e4ecf5; color: #2b4f74; }
.crm-pill--sch-in_progress { background: #e2f0e8; color: #1f5a3c; }
.crm-pill--sch-done { background: #eae8e3; color: #6b665e; }
.crm-pill--sch-cancelled { background: #f6e6e2; color: #8f3220; }

@media (max-width: 780px) {
  .sch-cell { min-height: 4.6rem; }
  .sch-chip__label { display: none; }
  .sch-head__cell { font-size: .6rem; padding: .35rem .2rem; }
}

/* ------------------------------------------------------ install the app */

.crm-install { margin-top: 1.4rem; text-align: center; }

.crm-install__btn {
  display: flex;
  align-items: center;
  gap: .65rem;
  width: 100%;
  text-align: left;
  padding: .7rem .85rem;
  background: #1d1a16;
  color: #f5f2ec;
  border: 1px solid #322d26;
  border-radius: 5px;
  cursor: pointer;
  font: inherit;
  transition: background .18s ease, border-color .18s ease;
}
.crm-install__btn:hover { background: #262119; border-color: #4a4237; }
.crm-install__btn b { display: block; font-size: .84rem; font-weight: 600; }
.crm-install__btn em {
  display: block;
  font-style: normal;
  font-size: .7rem;
  color: #a39a8b;
  margin-top: .1rem;
  line-height: 1.35;
}
.crm-install__icon {
  flex: 0 0 auto;
  width: 1.6rem;
  height: 1.6rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid #4a4237;
  font-size: .85rem;
  color: #d8c9a8;
}

.crm-install__note {
  margin: .55rem 0 0;
  font-size: .72rem;
  line-height: 1.5;
  color: #8a857c;
  text-align: left;
}
.crm-install__note b { color: #d8c9a8; font-weight: 600; }

@media (display-mode: standalone) {
  .crm-install { display: none; }
}

/* ------------------------------------------------------------ overview */

.ov-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.1rem;
}
.ov-head__title { margin: 0; font-size: 1.5rem; letter-spacing: -.02em; }
.ov-head__sub { margin: .2rem 0 0; font-size: .82rem; color: #6b665e; }
.ov-head__pay { text-align: right; font-size: .75rem; color: #6b665e; }
.ov-head__pay b { display: block; font-size: .82rem; color: #2b2823; font-variant-numeric: tabular-nums; }
.ov-head__pay em { font-style: normal; }

/* --- the six doors --- */

.ov-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: .85rem;
  margin-bottom: 1.1rem;
}

.ov-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: .18rem;
  padding: .85rem .9rem .7rem 1.05rem;
  background: #fff;
  border: 1px solid #e2ddd4;
  border-radius: 5px;
  text-decoration: none;
  color: inherit;
  border-left: 4px solid #c9c3b8;
  transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}
.ov-tile:hover {
  box-shadow: 0 2px 10px rgba(20, 18, 15, .09);
  transform: translateY(-1px);
}
.ov-tile__label {
  font-size: .68rem;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: #6b665e;
}
.ov-tile__value {
  font-size: 1.62rem;
  line-height: 1.15;
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
}
.ov-tile__note { font-size: .72rem; color: #7d776d; line-height: 1.4; }
.ov-tile__go {
  margin-top: auto;
  padding-top: .5rem;
  font-size: .7rem;
  letter-spacing: .04em;
  color: var(--heritage, #8A6A3B);
  font-weight: 600;
}

.ov-tile--hot { border-left-color: #a8321f; }
.ov-tile--hot .ov-tile__value { color: #8f3220; }
.ov-tile--warn { border-left-color: #b8862f; }
.ov-tile--warn .ov-tile__value { color: #8a6420; }
.ov-tile--good { border-left-color: #2f6b58; }
.ov-tile--good .ov-tile__value { color: #235244; }

.ov-tile__list {
  list-style: none;
  margin: .4rem 0 0;
  padding: .4rem 0 0;
  border-top: 1px solid #eeebe4;
  display: grid;
  gap: .16rem;
}
.ov-tile__list li {
  display: flex;
  justify-content: space-between;
  gap: .5rem;
  font-size: .71rem;
  color: #5a5449;
}
.ov-tile__list li span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ov-tile__list li b { font-variant-numeric: tabular-nums; flex: 0 0 auto; }

/* --- revenue ring + cash --- */

.ov-pair {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  gap: .85rem;
  margin-bottom: 1rem;
}
@media (max-width: 820px) { .ov-pair { grid-template-columns: 1fr; } }

.ov-ringwrap { display: flex; align-items: center; gap: 1.2rem; flex-wrap: wrap; }

.ov-ring { position: relative; width: 8.2rem; height: 8.2rem; flex: 0 0 auto; }
.ov-ring svg { width: 100%; height: 100%; display: block; }
.ov-ring__track { fill: none; stroke: #eeebe4; stroke-width: 11; }
.ov-ring__fill {
  fill: none;
  stroke: var(--heritage, #8A6A3B);
  stroke-width: 11;
  stroke-linecap: round;
  transition: stroke-dasharray .5s ease;
}
.ov-ring__mid {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  text-align: center;
  gap: .05rem;
}
.ov-ring__mid b { font-size: 1.18rem; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.ov-ring__mid span { font-size: .63rem; color: #7d776d; }

.ov-ringside { display: grid; gap: .55rem; flex: 1 1 8rem; }
.ov-ringside > div { display: flex; justify-content: space-between; gap: .6rem; font-size: .78rem; }
.ov-ringside > div span { color: #6b665e; }
.ov-ringside > div b { font-variant-numeric: tabular-nums; }
.ov-bad { color: #8f3220; }

.ov-cash { display: grid; gap: .7rem; }
.ov-cash__row {
  display: grid;
  grid-template-columns: 6.4rem minmax(0, 1fr) 4.6rem;
  align-items: center;
  gap: .6rem;
  font-size: .76rem;
}
.ov-cash__row > span { color: #6b665e; }
.ov-cash__row > b { text-align: right; font-variant-numeric: tabular-nums; }
.ov-cash__bar { height: .5rem; background: #f0ede7; border-radius: 999px; overflow: hidden; }
.ov-cash__fill { display: block; height: 100%; background: var(--heritage, #8A6A3B); border-radius: 999px; }
.ov-cash__fill--good { background: #2f6b58; }
.ov-cash__fill--bad { background: #a8321f; }

/* --- footer jump links --- */

.ov-foot {
  display: flex;
  gap: .35rem 1rem;
  flex-wrap: wrap;
  font-size: .74rem;
  margin: 1.2rem 0 0;
}
.ov-foot a { color: #6b665e; text-decoration: none; border-bottom: 1px solid #ddd8cf; }
.ov-foot a:hover { color: #2b2823; border-bottom-color: #8A6A3B; }

/* ===========================================================
   Contractor profile + 1099 year-end
   Everything on this crew is 1099, so the W-9 block is a
   first-class screen, not a hidden field on a user row.
   =========================================================== */

.ct-cols { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 1rem; align-items: start; }
.ct-side { display: grid; gap: 1rem; }

.ct-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 .85rem; }
.ct-field { display: grid; gap: .3rem; margin-bottom: .85rem; min-width: 0; }
.ct-field--wide { grid-column: 1 / -1; }
.ct-field__label {
  font-size: .7rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: .06em; color: var(--ink-3);
}
.ct-field__label i { font-style: normal; color: #a8321f; }
.ct-field__hint { font-size: .7rem; font-style: normal; color: var(--ink-3); line-height: 1.45; }

.ct-h3 {
  margin: 1.15rem 0 .75rem; padding-top: .85rem;
  border-top: 1px solid var(--line-soft, #e6e1d8);
  font-family: var(--mono); font-size: .64rem; font-weight: 600;
  letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3);
}

.ct-check { display: flex; gap: .5rem; align-items: flex-start; margin: .2rem 0 .9rem; font-size: .82rem; }
.ct-check input { margin-top: .18rem; }

.ct-tinnow { margin: 0 0 1rem; font-size: .9rem; }
.ct-tinnow b { font-family: var(--mono); font-size: .95rem; letter-spacing: .04em; }

.ct-fine { margin: .55rem 0 0; font-size: .72rem; line-height: 1.5; color: var(--ink-3); }
.ct-fine--warn { color: #8C2D1D; }

.ct-totals {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px; background: var(--line); border: 1px solid var(--line);
  border-radius: 3px; overflow: hidden; margin-bottom: 1rem;
}
.ct-total { background: #fff; padding: .9rem 1rem; display: grid; gap: .2rem; }
.ct-total span {
  font-family: var(--mono); font-size: .58rem; letter-spacing: .1em;
  text-transform: uppercase; color: var(--ink-3);
}
.ct-total b { font-size: 1.1rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.ct-total--sum { background: #f6f4ef; }

/* --- 1099 year-end dashboard --- */

.tx-year { display: flex; gap: .5rem; align-items: center; }
.tx-year span { font-family: var(--mono); font-size: .62rem; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); }
.tx-year .crm-select { width: auto; min-width: 6rem; }

.tx-stats {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px; background: var(--line); border: 1px solid var(--line);
  border-radius: 3px; overflow: hidden; margin-bottom: 1rem;
}
.tx-stat { background: #fff; padding: .9rem 1rem; display: grid; gap: .18rem; }
.tx-stat > span {
  font-family: var(--mono); font-size: .58rem; letter-spacing: .1em;
  text-transform: uppercase; color: var(--ink-3);
}
.tx-stat b { font-size: 1.15rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.tx-stat em { font-size: .68rem; font-style: normal; color: var(--ink-3); }
.tx-stat--flag b { color: #8C2D1D; }

.tx-table .tx-num { text-align: right; font-variant-numeric: tabular-nums; }
.tx-miss { color: #8C2D1D; font-weight: 600; }
.tx-blockers { font-size: .72rem; color: #8C2D1D; line-height: 1.4; display: block; max-width: 15rem; }

/* --- the printed 1099-NEC --- */

.f1099 { font-size: .74rem; color: #14120F; }
.f1099__hdr {
  display: grid; grid-template-columns: 4.2rem 1fr auto; gap: .9rem;
  align-items: center; padding-bottom: .8rem; border-bottom: 2px solid #14120F;
}
.f1099__yr {
  display: grid; place-items: center; gap: .1rem;
  border: 1.5px solid #14120F; padding: .3rem .2rem;
}
.f1099__yr b { font-size: 1.15rem; line-height: 1; }
.f1099__yr span {
  font-family: var(--mono); font-size: .44rem; letter-spacing: .06em; text-transform: uppercase;
}
.f1099__title p { margin: 0 0 .15rem; font-size: 1.3rem; font-weight: 600; letter-spacing: -.01em; }
.f1099__title span {
  font-family: var(--mono); font-size: .56rem; letter-spacing: .1em; text-transform: uppercase;
  color: #5c574f;
}
.f1099__box1 {
  border: 1.5px solid #14120F; padding: .42rem .7rem; min-width: 9.5rem;
  display: grid; gap: .1rem; text-align: right;
}
.f1099__box1 span { font-family: var(--mono); font-size: .44rem; letter-spacing: .05em; text-transform: uppercase; }
.f1099__box1 b { font-size: 1.05rem; font-variant-numeric: tabular-nums; }

.f1099__split { display: grid; grid-template-columns: 1fr 1fr; gap: 0; margin-top: .9rem; border: 1.5px solid #14120F; }
.f1099__payer, .f1099__recip { padding: .6rem .75rem; }
.f1099__payer { border-right: 1.5px solid #14120F; }

.f1099__lbl {
  margin: 0 0 .35rem; font-family: var(--mono); font-size: .46rem;
  letter-spacing: .06em; text-transform: uppercase; color: #5c574f;
}
.f1099__lbl--gap { margin-top: .75rem; }
.f1099__name { font-size: .84rem; font-weight: 600; }
.f1099__mono { font-family: var(--mono); font-size: .8rem; letter-spacing: .04em; }

.f1099__boxes { display: grid; grid-template-columns: repeat(2, 1fr); border: 1.5px solid #14120F; border-top: 0; }
.f1099__box { padding: .55rem .75rem; display: grid; gap: .12rem; }
.f1099__box:nth-child(odd) { border-right: 1.5px solid #14120F; }
.f1099__box:nth-child(-n+2) { border-bottom: 1.5px solid #14120F; }
.f1099__box span { font-family: var(--mono); font-size: .46rem; letter-spacing: .05em; text-transform: uppercase; color: #5c574f; }
.f1099__box b { font-size: .92rem; font-variant-numeric: tabular-nums; }

.f1099__break { margin-top: .9rem; padding-top: .7rem; border-top: 1px solid #ccc6bb; }
.f1099__line { display: flex; justify-content: space-between; gap: 1rem; padding: .16rem 0; font-size: .76rem; }
.f1099__line b { font-variant-numeric: tabular-nums; }
.f1099__line--sum { border-top: 1px solid #14120F; margin-top: .28rem; padding-top: .34rem; font-weight: 600; }

.f1099__foot { margin-top: .9rem; font-size: .58rem; line-height: 1.5; color: #5c574f; }

/* --- responsive --- */

@media (max-width: 1080px) {
  .ct-cols { grid-template-columns: 1fr; }
  .tx-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
  .ct-grid { grid-template-columns: 1fr; }
  .ct-totals { grid-template-columns: 1fr; }
  .tx-stats { grid-template-columns: 1fr; }
}

@media print {
  .f1099 { break-inside: avoid; page-break-inside: avoid; }
  .f1099__break, .f1099__foot { break-inside: avoid; }
  .f1099__box1 b, .f1099__box b, .f1099__line b { color: #000; }
}

/* ------------------------------------------------ today's core value
   Tomasz, 2026-12-04: a daily quote on sign-in that follows into the app.
   Rendered at the foot of <main>, so it must read as a quiet footer band —
   not as loose paragraphs sitting under the page content. */

.cv {
  margin: 0 clamp(1.25rem, 3vw, 2.25rem) clamp(1.25rem, 3vw, 2.25rem);
  padding: 1.15rem 1.25rem;
  border: 1px solid var(--line);
  border-left: 2px solid var(--heritage);
  border-radius: 3px;
  background: var(--paper);
  max-width: 46rem;
}

.cv__label {
  margin: 0 0 0.45rem;
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.cv__title {
  margin: 0 0 0.3rem;
  font-family: var(--display);
  font-size: 1.05rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.25;
  color: var(--ink);
}

.cv__body {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.55;
  color: var(--ink-3);
}

.cv--compact {
  margin: 1.5rem 0 0;
  padding: 1rem 0 0;
  border: 0;
  border-top: 1px solid var(--line-soft);
  border-radius: 0;
  background: transparent;
  max-width: none;
  text-align: left;
}

.cv--compact .cv__label { font-size: 0.56rem; margin-bottom: 0.35rem; }
.cv--compact .cv__title { font-size: 0.92rem; }
.cv--compact .cv__body { font-size: 0.76rem; line-height: 1.5; }

.crm-auth__card .cv--compact { text-align: center; }

@media (max-width: 720px) {
  .cv {
    margin: 0 1rem 1rem;
    padding: 0.95rem 1rem;
  }
}

/* Inside the app the quote is a sibling of .crm__body (a page footer), so it
   has to carry the same inset the body content uses — otherwise it reads as a
   stray line flush against the rail. */
.crm__main > .cv--compact {
  margin: 0;
  padding: 1.15rem clamp(1.25rem, 3vw, 2.25rem) 1.5rem;
  border-top: 1px solid var(--line-soft);
}

@media (max-width: 720px) {
  .crm__main > .cv--compact { padding: 1rem 1rem 1.25rem; }
}

/* ------------------------------------------- contract scope (0014) --- */
/*
 * Three trades, three colours, one meaning each:
 *   demo  = rust     tear out
 *   glass = green    hang the new units
 *   film  = blue     apply film
 * The crew colour still owns the small dot; the scope owns the bar, the
 * chip tint and the tag. Two people, one job, no guessing.
 */

.sch-scope {
  display: inline-flex;
  align-items: center;
  padding: .1rem .42rem;
  border-radius: 2px;
  font-size: .64rem;
  font-weight: 650;
  letter-spacing: .06em;
  text-transform: uppercase;
  white-space: nowrap;
  flex: 0 0 auto;
}
.sch-scope--demo { background: #f7e6e1; color: #8f3220; }
.sch-scope--retrofit { background: #e2f0e8; color: #1f5a3c; }
.sch-scope--maintenance { background: #f6efe2; color: #7a5c26; }
.sch-scope--film { background: #e4ecf5; color: #2b4f74; }
.sch-scope--other { background: #eeece7; color: #5a5449; }

/* the scope label inside a calendar chip */
.sch-chip__scope {
  display: inline-block;
  font-weight: 700;
  font-size: .58rem;
  letter-spacing: .05em;
  text-transform: uppercase;
  padding: 0 .22rem;
  border-radius: 2px;
  margin-right: .2rem;
}
.sch-chip__scope--demo { background: #f4d9d2; color: #8f3220; }
.sch-chip__scope--retrofit { background: #cfe6db; color: #1f5a3c; }
.sch-chip__scope--maintenance { background: #ece1cb; color: #7a5c26; }
.sch-chip__scope--film { background: #d5e2ef; color: #2b4f74; }
.sch-chip__scope--other { background: #e5e2db; color: #5a5449; }

/* curing days: the unit is finished, the job is not. Hatched, not filled —
   nothing is happening, and the calendar should say so. */
.sch-cure {
  display: block;
  font-size: .56rem;
  line-height: 1.3;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: #8a857c;
  padding: .1rem .3rem;
  border: 1px dashed #c4bfb6;
  border-radius: 2px;
  background-image: repeating-linear-gradient(
    45deg,
    rgba(0, 0, 0, .05) 0 2px,
    transparent 2px 4px
  );
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sch-cure--legend {
  display: inline-block;
  width: 1.5rem;
  height: .68rem;
  padding: 0;
  vertical-align: middle;
}

/* ---- one job, many visits: the plan panel ---- */

.sch-plan { border-left: 3px solid var(--heritage, #8A6A3B); }
.sch-plan__bldg { font-weight: 400; color: var(--ink-3, #6b665e); }

.sch-plan__list {
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
  display: grid;
  gap: .4rem;
}
.sch-plan__list--detail { margin-top: 0; }

.sch-plan__visit {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .45rem .55rem;
  border: 1px solid var(--rule, #ddd8cf);
  border-radius: 4px;
  background: #fff;
  font-size: .82rem;
  min-height: 44px;
  flex-wrap: wrap;
}
.sch-plan__visit--on { background: #fdf8ee; border-color: #c9c2b6; }
.sch-plan__bar { width: 3px; align-self: stretch; border-radius: 2px; flex: 0 0 auto; }
.sch-plan__no {
  flex: 0 0 auto;
  width: 1.35rem;
  height: 1.35rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #f0ede6;
  font-size: .7rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: #5a5449;
}
.sch-plan__name { flex: 1 1 9rem; min-width: 0; display: grid; gap: .05rem; }
.sch-plan__name b { font-weight: 600; font-size: .84rem; }
.sch-plan__name em {
  font-style: normal;
  font-size: .72rem;
  color: #7d776d;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sch-plan__when {
  flex: 0 0 auto;
  font-size: .75rem;
  color: #5a5449;
  font-variant-numeric: tabular-nums;
}

.sch-tag {
  flex: 0 0 auto;
  font-size: .64rem;
  letter-spacing: .04em;
  padding: .1rem .4rem;
  border-radius: 2px;
  border: 1px dashed currentColor;
  white-space: nowrap;
}
.sch-tag--demo { color: #8f3220; }
.sch-tag--retrofit { color: #1f5a3c; }
.sch-tag--maintenance { color: #7a5c26; }
.sch-tag--film { color: #2b4f74; }
.sch-tag--other { color: #5a5449; }

.sch-plan__next {
  margin: 0;
  padding: .7rem .8rem;
  border-radius: 4px;
  background: #f7f5f1;
  font-size: .8rem;
  line-height: 1.55;
  color: #4a453d;
}
.sch-plan__next b { color: var(--ink, #2b2823); }
.sch-plan__next--wait {
  background: #fdf8ee;
  border-left: 2px solid #b8862f;
}

.sch-form__scope-note {
  margin: .9rem 0 1rem;
  font-size: .78rem;
  line-height: 1.5;
  color: #6b665e;
}
.sch-form__scope-note b { color: var(--ink, #2b2823); }

.sch-legend--crews { margin-top: -.6rem; font-size: .74rem; }
.sch-detail__link { margin: 0 0 1rem; }

@media (max-width: 620px) {
  .sch-plan__visit { gap: .4rem; }
  .sch-plan__name { flex: 1 1 100%; order: 3; }
  .sch-plan__when { flex: 1 1 100%; order: 4; font-size: .72rem; }
  .sch-plan__visit .crm-btn { order: 5; margin-left: auto; }
  .sch-chip__scope { font-size: .54rem; padding: 0 .16rem; }
}

/* --------------------------------------- important tasks on the board --- */
/*
 * The things that go missing: a tenant calls about a leak, Sebastian writes
 * it down, the week rolls over. This panel sits above the calendar and only
 * shows tasks that have NO visit booked — so "waiting" means waiting.
 */

.sch-atten { border-left: 3px solid #a8321f; }
.sch-atten__list { list-style: none; margin: 0; padding: 0; display: grid; gap: .4rem; }

.sch-atten__row {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .5rem .55rem;
  border: 1px solid var(--rule, #ddd8cf);
  border-radius: 4px;
  background: #fff;
  min-height: 44px;
  flex-wrap: wrap;
}
.sch-atten__bar { width: 3px; align-self: stretch; border-radius: 2px; flex: 0 0 auto; }
.sch-atten__bar--watch { background: #2F6B58; }
.sch-atten__bar--high { background: #b8862f; }
.sch-atten__bar--urgent { background: #a8321f; }

.sch-atten__main { flex: 1 1 12rem; min-width: 0; display: grid; gap: .08rem; }
.sch-atten__main b {
  font-size: .85rem;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sch-atten__main em {
  font-style: normal;
  font-size: .72rem;
  color: #7d776d;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sch-atten__age { flex: 0 0 auto; display: grid; justify-items: end; gap: .02rem; text-align: right; }
.sch-atten__age b { font-size: .92rem; font-weight: 650; font-variant-numeric: tabular-nums; }
.sch-atten__age em { font-style: normal; font-size: .68rem; color: #8a857c; }
.sch-atten__age--watch b { color: #2F6B58; }
.sch-atten__age--high b { color: #8a6420; }
.sch-atten__age--urgent b { color: #a8321f; }

.sch-atten .crm-btn { flex: 0 0 auto; }

@media (max-width: 620px) {
  .sch-atten__main { flex: 1 1 100%; order: 2; }
  .sch-atten__age { order: 1; }
  .sch-atten .crm-btn { order: 3; flex: 1 1 auto; justify-content: center; }
}

/* ============================================================
   Dashboard v2 — charts, daily cards, road to goal
   Every block is a link; nothing here is decoration.
   ============================================================ */

.ov-today {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: .85rem;
  margin-bottom: 1rem;
}

.ov-day {
  display: flex;
  flex-direction: column;
  gap: .2rem;
  padding: 1rem 1.1rem;
  background: #fff;
  border: 1px solid #e2ddd4;
  border-radius: 5px;
  text-decoration: none;
  color: inherit;
  transition: box-shadow .16s ease, transform .16s ease;
}
.ov-day:hover { box-shadow: 0 2px 12px rgba(20,18,15,.1); transform: translateY(-1px); }
.ov-day__label {
  font-family: var(--mono, ui-monospace, monospace);
  font-size: .63rem; letter-spacing: .12em; text-transform: uppercase; color: #7d776d;
}
.ov-day__value {
  font-size: 2rem; line-height: 1.1; letter-spacing: -.025em;
  font-variant-numeric: tabular-nums; color: #2b2823;
}
.ov-day__note { font-size: .75rem; color: #7d776d; }
.ov-day__go { margin-top: .55rem; font-size: .7rem; font-weight: 600; color: #8A6A3B; }

.ov-spark {
  display: flex; align-items: flex-end; gap: 3px;
  height: 2.1rem; margin: .6rem 0 .35rem;
}
.ov-spark i {
  flex: 1 1 0; background: #cfdcd6; border-radius: 1px 1px 0 0; min-height: 6%;
}
.ov-spark i:last-child { background: #2f6b58; }

.ov-day__foot {
  display: flex; justify-content: space-between; gap: .6rem;
  font-size: .72rem; padding-top: .3rem; border-top: 1px solid #f0ede7;
}
.ov-day__foot em { font-style: normal; color: #7d776d; }
.ov-day__foot b { font-variant-numeric: tabular-nums; }

.ov-quote-row {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem;
  margin: .75rem 0 .2rem; padding-top: .6rem; border-top: 1px solid #f0ede7;
}
.ov-quote-row span { display: grid; gap: .1rem; }
.ov-quote-row em { font-style: normal; font-size: .66rem; color: #7d776d; }
.ov-quote-row b { font-size: 1.15rem; font-variant-numeric: tabular-nums; }

/* --- road to the target --- */

.ov-road__top {
  display: flex; justify-content: space-between; align-items: flex-end;
  gap: 1rem; flex-wrap: wrap; margin-bottom: .85rem;
}
.ov-road__big b {
  display: block; font-size: 2.1rem; line-height: 1.05;
  letter-spacing: -.03em; font-variant-numeric: tabular-nums;
}
.ov-road__big span, .ov-road__pct span { font-size: .74rem; color: #7d776d; }
.ov-road__pct { text-align: right; }
.ov-road__pct b {
  display: block; font-size: 1.35rem; font-variant-numeric: tabular-nums;
  color: #2f6b58;
}

.ov-road__bar {
  position: relative; display: flex; height: 1.15rem;
  background: #f0ede7; border-radius: 999px; overflow: hidden;
}
.ov-road__seg { display: block; height: 100%; }
.ov-road__seg--in { background: #2f6b58; }
.ov-road__seg--sold { background: #b9cdc6; }
.ov-road__pace {
  position: absolute; top: -3px; bottom: -3px; width: 2px;
  background: #a8321f; opacity: .85;
}

.ov-road__legend {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  gap: .5rem 1rem; margin-top: .8rem;
}
.ov-road__legend a {
  display: flex; align-items: center; gap: .4rem;
  font-size: .74rem; color: #5a5449; text-decoration: none;
  padding: .25rem 0; border-bottom: 1px solid transparent;
}
.ov-road__legend a:hover { border-bottom-color: #ddd8cf; }
.ov-road__legend em { font-style: normal; }
.ov-road__legend b { margin-left: auto; font-variant-numeric: tabular-nums; }

.ov-key { width: .6rem; height: .6rem; border-radius: 2px; display: inline-block; flex: 0 0 auto; }
.ov-key--in { background: #2f6b58; }
.ov-key--sold { background: #b9cdc6; }
.ov-key--gap { background: #f0ede7; border: 1px solid #ddd8cf; }

.ov-road__pace-note { margin: .8rem 0 0; font-size: .76rem; color: #6b665e; line-height: 1.5; }
.ov-good { color: #2f6b58; }
.ov-bad { color: #8f3220; }

/* --- month chart ---
   Bars are the chart: no script, no canvas, just heights. */

.ov-chart {
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr));
  align-items: end; gap: .3rem; height: 9.5rem;
  padding-bottom: .1rem;
}
.ov-chart__col {
  display: flex; flex-direction: column; align-items: center; justify-content: flex-end;
  gap: .35rem; height: 100%; text-decoration: none; color: inherit;
}
.ov-chart__bars {
  display: flex; align-items: flex-end; justify-content: center; gap: 2px;
  width: 100%; height: 100%;
}
.ov-chart__sold, .ov-chart__coll {
  display: block; width: 45%; max-width: 1.05rem; border-radius: 2px 2px 0 0;
  background: #d9d3c8; transition: background .15s ease;
}
.ov-chart__coll { background: #2f6b58; }
.ov-chart__col:hover .ov-chart__sold { background: #b8ad9c; }
.ov-chart__col:hover .ov-chart__coll { background: #235244; }
.ov-chart__mon {
  font-family: var(--mono, ui-monospace, monospace);
  font-size: .6rem; letter-spacing: .04em; color: #7d776d; flex: 0 0 auto;
}
.ov-chart__key {
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
  margin: .85rem 0 0; font-size: .72rem; color: #6b665e;
}
.ov-chart__key span { display: inline-flex; align-items: center; gap: .35rem; }
.ov-chart__tot { margin-left: auto; }
.ov-chart__tot b { font-variant-numeric: tabular-nums; }

/* --- stage donut + rows --- */

.ov-donut-wrap { display: flex; align-items: center; gap: 1.15rem; flex-wrap: wrap; }
.ov-stage { display: grid; gap: .45rem; flex: 1 1 9rem; }
.ov-stage__row {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center; gap: .45rem;
  font-size: .76rem; text-decoration: none; color: inherit;
  padding: .3rem 0; border-bottom: 1px solid #f0ede7;
}
.ov-stage__row:last-child { border-bottom: 0; }
.ov-stage__row:hover .ov-stage__lab { color: #8A6A3B; }
.ov-stage__lab { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ov-stage__n { font-variant-numeric: tabular-nums; }
.ov-stage__amt { font-style: normal; font-size: .7rem; color: #7d776d; font-variant-numeric: tabular-nums; }

.ov-dot { width: .55rem; height: .55rem; border-radius: 50%; display: inline-block; }
.ov-dot--good { background: #2f6b58; }
.ov-dot--live { background: #8A6A3B; }
.ov-dot--warn { background: #b8862f; }

/* --- buildings --- */

.ov-bldg { display: grid; gap: .5rem; }
.ov-bldg__row {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(3rem, 7rem) 3.4rem;
  align-items: center; gap: .6rem;
  text-decoration: none; color: inherit; font-size: .76rem;
  padding: .25rem 0;
}
.ov-bldg__row:hover .ov-bldg__name { color: #8A6A3B; }
.ov-bldg__name { display: grid; gap: .05rem; min-width: 0; }
.ov-bldg__name small { font-size: .67rem; color: #7d776d; }
.ov-bldg__bar { height: .45rem; background: #f0ede7; border-radius: 999px; overflow: hidden; }
.ov-bldg__bar i { display: block; height: 100%; background: #8A6A3B; border-radius: 999px; }
.ov-bldg__amt { text-align: right; font-variant-numeric: tabular-nums; }

/* --- commission --- */

.ov-comm { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: .8rem; }
.ov-comm__card {
  display: grid; gap: .2rem; padding: .85rem .95rem;
  background: #fff; border: 1px solid #e2ddd4; border-left: 3px solid #8A6A3B;
  border-radius: 4px; text-decoration: none; color: inherit;
  transition: box-shadow .16s ease;
}
.ov-comm__card:hover { box-shadow: 0 2px 10px rgba(20,18,15,.09); }
.ov-comm__who { font-size: .74rem; color: #6b665e; }
.ov-comm__amt { font-size: 1.35rem; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.ov-comm__note { font-size: .69rem; color: #7d776d; }
.ov-comm__bar { height: .35rem; background: #f0ede7; border-radius: 999px; overflow: hidden; margin-top: .2rem; }
.ov-comm__bar i { display: block; height: 100%; background: #8A6A3B; }

@media (max-width: 720px) {
  .ov-chart { height: 7.5rem; gap: .15rem; }
  .ov-chart__mon { font-size: .52rem; }
  .ov-day__value { font-size: 1.7rem; }
  .ov-road__big b { font-size: 1.7rem; }
  .ov-bldg__row { grid-template-columns: minmax(0, 1fr) 2.8rem; }
  .ov-bldg__bar { display: none; }
}

/* ------------------------------------------------- pay: salary vs hourly */

.crm-pay {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  align-items: flex-start;
}

.crm-pay b {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.crm-pay__per {
  display: block;
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-3, #5A5348);
  font-weight: 500;
}

.crm-pay b .crm-pay__per {
  margin-top: 0.1rem;
}

/* Base + commission. A salesperson's base alone reads like a whole salary,
   so the commission line sits directly under it in the same cell. */
.crm-pay__plus {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--glass-deep, #0A5A66);
  font-variant-numeric: tabular-nums;
}

.crm-pay__plus .crm-pay__per {
  color: var(--ink-3, #5A5348);
}

/* The invitation link: monospace, full width of the cell, select on tap. */
.crm-invite-url {
  width: 100%;
  min-width: 15rem;
  font-family: var(--mono, ui-monospace, SFMono-Regular, Menlo, monospace);
  font-size: 0.72rem;
  padding: 0.32rem 0.45rem;
  color: var(--ink-3, #5A5348);
}

/* ------------------------------------------------------ payroll: salaried rows */

.qb-tag {
  display: inline-block;
  font-size: 0.63rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  font-weight: 600;
  padding: 0.14rem 0.4rem;
  border-radius: 999px;
  background: rgba(14, 122, 138, 0.1);
  color: var(--glass-deep, #0A5A66);
  white-space: nowrap;
}

.qb-per {
  display: block;
  font-size: 0.7rem;
  color: var(--ink-3, #5A5348);
  margin-top: 0.15rem;
}

@media (max-width: 720px) {
  .crm-invite-url { min-width: 0; font-size: 0.66rem; }
}

/* ------------------------------------------------- active filter chips
   "We cannot read what tab we are on if it is all blacked out." The active
   filter used to be a black pill — which is also what a disabled control
   looks like. Teal reads as "you are here" and can never be mistaken for
   an action you cannot press. */
.crm-toolbar > a.crm-btn:not(.crm-btn--ghost),
.crm-toolbar > .crm-btn[aria-current="page"] {
  background: var(--glass);
  border-color: var(--glass);
  color: #fff;
}
.crm-toolbar > a.crm-btn:not(.crm-btn--ghost):hover {
  background: var(--glass-deep);
  border-color: var(--glass-deep);
}
