:root {
  --chrome: #d4d9df;
  --chrome-2: #c2c9d1;
  --chrome-line: #9aa3ad;
  --chrome-dark: #7d8893;
  --title-1: #1a6e8e;
  --title-2: #0c4256;
  --accent: #c8102e;        /* Mitchell 1 red */
  --accent-dk: #9e0c24;
  --ink: #16202a;
  --muted: #54616e;
  --grid-bg: #ffffff;
  --grid-alt: #f1f5f8;
  --grid-line: #d3dade;
  --grid-head: #e6ebef;
  --grid-head-2: #d2dae0;
  --sel: #b9d8ff;
  --sel-line: #4a90d9;
  --est: #5b6670;           /* estimate = gray */
  --ro: #14181d;            /* repair order = black */
  --inv: #1457c8;           /* posted invoice = blue */
  --red: #c8102e;
  --ok: #15803d;
  --warn: #b45309;
  --ui: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  --mono: "Consolas", "SFMono-Regular", Menlo, monospace;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; margin: 0; }
body { background: #eef1f4; color: var(--ink); font-family: var(--ui); font-size: 13px; overflow: hidden; }
button, input, select { font: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--sel-line); outline-offset: 1px; }
.sr-only, .skip-link { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.skip-link:focus { position: fixed; width: auto; height: auto; clip: auto; top: 8px; left: 8px; background: #fff; padding: 6px 10px; z-index: 200; }
.eyebrow { color: var(--muted); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; margin: 0; }

/* ===== Lock screen ===== */
.lock-screen {
  position: fixed; inset: 0; z-index: 80;
  display: grid; place-items: center; padding: 1.5rem;
  background: linear-gradient(135deg, #0c4256, #1a6e8e);
}
.lock-card { width: 100%; max-width: 27rem; background: #fff; border: 1px solid var(--chrome-dark); box-shadow: 0 18px 50px rgba(0,0,0,.35); padding: 1.5rem; border-radius: 3px; }
.lock-brand { display: flex; align-items: center; gap: .75rem; margin-bottom: 1rem; }
.lock-mark, .tb-mark { background: var(--accent); color: #fff; font-weight: 800; letter-spacing: -.02em; }
.lock-mark { width: 3rem; height: 3rem; border-radius: 6px; display: grid; place-items: center; font-size: 1.25rem; }
.lock-brand h1 { margin: 0; font-size: 1.6rem; color: var(--title-2); letter-spacing: -.01em; }
.lock-copy { color: var(--muted); margin: 0 0 1.1rem; }
.lock-card label { display: block; font-size: 11px; font-weight: 700; text-transform: uppercase; color: var(--muted); margin-bottom: .35rem; }
.lock-row { display: grid; grid-template-columns: 1fr auto; border: 1px solid var(--chrome-dark); border-radius: 3px; overflow: hidden; }
.lock-row input { border: 0; padding: .7rem .8rem; min-width: 0; }
.lock-row button { border: 0; background: linear-gradient(#2a86a8, #0e4d66); color: #fff; font-weight: 700; padding: 0 1.3rem; }
.lock-error { color: var(--red); min-height: 1.3rem; margin: .5rem 0 0; }
.lock-foot { color: var(--muted); font-size: 11px; margin: 1rem 0 0; text-align: center; }

/* ===== App frame ===== */
/* 6 shell children: titlebar / menubar / toolbar / quickbar / workarea / statusbar.
   The stretchy row belongs to the WORKAREA — never the quickbar. */
.app { display: grid; grid-template-rows: auto auto auto auto minmax(0,1fr) auto; height: 100vh; }

.titlebar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; background: linear-gradient(#1a6e8e, #0c4256); color: #fff; padding: .3rem .6rem; min-height: 2rem; }
.tb-left { display: flex; align-items: center; gap: .55rem; min-width: 0; }
.tb-mark { width: 1.4rem; height: 1.4rem; border-radius: 4px; display: grid; place-items: center; font-size: .72rem; }
.tb-title { font-weight: 700; }
.tb-shop { color: rgba(255,255,255,.8); font-size: 12px; border-left: 1px solid rgba(255,255,255,.3); padding-left: .55rem; }
.tb-right { display: flex; align-items: center; gap: .7rem; }
.tb-sync { font-size: 11px; color: rgba(255,255,255,.85); font-family: var(--mono); }
.tb-clock { font-variant-numeric: tabular-nums; font-size: 12px; }
.tb-x { background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.25); color: #fff; border-radius: 3px; line-height: 1; padding: .15rem .45rem; }
.tb-x:hover { background: var(--accent); border-color: var(--accent); }

.menubar { display: flex; background: var(--chrome); border-bottom: 1px solid var(--chrome-line); padding: 0 .25rem; }
.menubar > button { background: transparent; border: 0; padding: .35rem .7rem; color: var(--ink); font-size: 12px; }
.menubar > button:hover, .menubar > button.is-open { background: var(--sel); }

.buttonbar { display: flex; gap: .25rem; background: linear-gradient(#e9edf1, #cdd4db); border-bottom: 1px solid var(--chrome-line); padding: .35rem .4rem; }
.bb { display: grid; justify-items: center; gap: .12rem; min-width: 4.1rem; padding: .3rem .35rem; background: linear-gradient(#fbfcfd, #dde3e9); border: 1px solid var(--chrome-dark); border-radius: 4px; color: var(--ink); font-size: 11px; font-weight: 600; }
.bb:hover { background: linear-gradient(#ffffff, #e7edf3); border-color: var(--sel-line); }
.bb.is-active { background: linear-gradient(#cfe6f3, #a9d2e8); border-color: var(--title-2); box-shadow: inset 0 1px 2px rgba(0,0,0,.12); }
.bb-ico { font-size: 1.05rem; line-height: 1; }
.bb-right { margin-left: auto; }

.workarea { min-height: 0; overflow: auto; padding: .6rem; background: #eef1f4; position: relative; }
.alert { margin-bottom: .6rem; padding: .55rem .75rem; border: 1px solid #c9b458; background: #fff8d6; color: #5a4a00; border-radius: 3px; }
.alert.status-good { border-color: #86c79b; background: #e8f7ee; color: #14532d; }
.alert.status-bad { border-color: #e0a0a0; background: #fdeeee; color: #7f1d1d; }

.screen { display: none; }
.screen.is-active { display: block; }
/* Title + actions grouped left as one compact cluster (no full-width justify). */
.screen-titlebar { display: flex; align-items: center; justify-content: flex-start; gap: .9rem; margin-bottom: .5rem; flex-wrap: wrap; }
.screen-titlebar h2 { margin: 0; font-size: 1.1rem; color: var(--title-2); }

/* ===== WIP tools ===== */
.wip-tools { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.wip-filter { font-size: 12px; color: var(--muted); }
.wip-filter select, .wip-search input { border: 1px solid var(--chrome-dark); border-radius: 3px; padding: .3rem .5rem; background: #fff; }
.wip-search input { min-width: 16rem; }
.wip-count { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ===== Data grid ===== */
.grid-wrap { background: var(--grid-bg); border: 1px solid var(--chrome-dark); border-radius: 2px; overflow: auto; max-height: calc(100vh - 16rem); }
.m1-grid { border-collapse: collapse; width: 100%; font-size: 12.5px; white-space: nowrap; }
.m1-grid thead th {
  position: sticky; top: 0; z-index: 1;
  background: linear-gradient(var(--grid-head), var(--grid-head-2));
  border-right: 1px solid var(--chrome-line); border-bottom: 1px solid var(--chrome-dark);
  color: var(--title-2); font-size: 11px; text-transform: uppercase; letter-spacing: .03em;
  padding: .4rem .55rem; text-align: left; cursor: pointer; user-select: none;
}
.m1-grid thead th.r { text-align: right; }
.m1-grid thead th .sortcaret { color: var(--accent); margin-left: .25rem; }
.m1-grid tbody td { border-right: 1px solid var(--grid-line); border-bottom: 1px solid var(--grid-line); padding: .34rem .55rem; }
.m1-grid tbody td.r { text-align: right; font-variant-numeric: tabular-nums; }
.m1-grid tbody tr:nth-child(even) td { background: var(--grid-alt); }
.m1-grid tbody tr:hover td { background: #fff7d6; }
.m1-grid tbody tr.is-sel td { background: var(--sel); box-shadow: inset 0 0 0 9999px rgba(74,144,217,.12); }
.m1-grid tbody tr { cursor: pointer; }
.m1-grid .type-cell { font-weight: 800; font-size: 11px; }
.m1-grid .mono { font-family: var(--mono); }

/* Order type coloring (M1: gray EST, black RO, blue posted INV) */
tr.t-EST td { color: var(--est); }
tr.t-RO td { color: var(--ro); }
tr.t-INV td { color: var(--inv); }
tr.t-EST .type-cell { color: var(--est); }
tr.t-RO .type-cell { color: var(--ro); }
tr.t-INV .type-cell { color: var(--inv); }
td.red-flag { color: var(--red) !important; font-weight: 700; }

.status-pill { display: inline-block; padding: .05rem .5rem; border-radius: 999px; font-size: 11px; font-weight: 700; border: 1px solid transparent; }
.st-in_progress, .st-active { background: #fff3df; color: #9a5b00; border-color: #f0c98a; }
.st-waiting_parts { background: #fdeedd; color: #9a4b00; border-color: #f0b98a; }
.st-approved { background: #e3f1fb; color: #0c5; color: #0e5aa7; border-color: #a9cdec; }
.st-estimate { background: #eef0f2; color: #5b6670; border-color: #cdd4db; }
.st-completed, .st-invoiced, .st-paid { background: #e8f7ee; color: #14532d; border-color: #9bd3ad; }

/* ===== WIP actions / legend ===== */
.wip-actions { display: flex; gap: .4rem; margin-top: .5rem; flex-wrap: wrap; }
.m1-btn { background: linear-gradient(#fbfcfd, #dde3e9); border: 1px solid var(--chrome-dark); border-radius: 4px; padding: .4rem .9rem; font-weight: 600; color: var(--ink); }
.m1-btn:hover { border-color: var(--sel-line); background: linear-gradient(#fff, #e7edf3); }
.m1-btn-primary { background: linear-gradient(#2a86a8, #0e4d66); color: #fff; border-color: var(--title-2); }
.m1-btn-primary:hover { background: linear-gradient(#2f93b8, #0c4458); }
.m1-btn:disabled { opacity: .5; cursor: default; }
.wip-legend { display: flex; gap: 1.1rem; margin-top: .6rem; color: var(--muted); font-size: 11px; flex-wrap: wrap; }
.wip-legend span { display: inline-flex; align-items: center; gap: .35rem; }
.sw { width: .8rem; height: .8rem; border-radius: 2px; display: inline-block; border: 1px solid rgba(0,0,0,.2); }
.sw-est { background: var(--est); } .sw-ro { background: var(--ro); } .sw-inv { background: var(--inv); } .sw-red { background: var(--red); }

/* ===== States ===== */
.empty-state, .loading-state { display: grid; gap: .35rem; place-content: center; min-height: 12rem; padding: 2rem; text-align: center; color: var(--muted); }
.empty-state strong, .loading-state strong { color: var(--ink); font-size: 1rem; }

/* ===== Order screen ===== */
.order-pane { display: grid; gap: .6rem; }
.order-head { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: .6rem; }
.order-card { background: #fff; border: 1px solid var(--chrome-dark); border-radius: 3px; }
.order-card h3 { margin: 0; background: linear-gradient(var(--grid-head), var(--grid-head-2)); border-bottom: 1px solid var(--chrome-dark); color: var(--title-2); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; padding: .4rem .6rem; }
.order-card .oc-body { padding: .6rem; display: grid; gap: .3rem; }
.kv { display: grid; grid-template-columns: 7.5rem 1fr; gap: .4rem; font-size: 12.5px; }
.kv span { color: var(--muted); }
.kv strong { font-weight: 700; }
.job { border: 1px solid var(--chrome-dark); border-radius: 3px; background: #fff; }
.job-h { display: flex; justify-content: space-between; align-items: center; background: #eaf2f7; border-bottom: 1px solid var(--chrome-line); padding: .4rem .6rem; font-weight: 700; color: var(--title-2); }
.li-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.li-table th { text-align: left; color: var(--muted); font-size: 11px; text-transform: uppercase; padding: .3rem .55rem; border-bottom: 1px solid var(--grid-line); }
.li-table td { padding: .32rem .55rem; border-bottom: 1px solid var(--grid-line); }
.li-table .r { text-align: right; font-variant-numeric: tabular-nums; }
.li-type { display: inline-block; min-width: 3.2rem; font-size: 10px; font-weight: 800; text-transform: uppercase; color: var(--muted); }
.order-totals { display: flex; justify-content: flex-end; }
.order-totals table { font-size: 13px; }
.order-totals td { padding: .2rem .6rem; }
.order-totals .grand td { font-weight: 800; font-size: 15px; border-top: 2px solid var(--chrome-dark); color: var(--title-2); }
.order-actions { display: flex; gap: .4rem; flex-wrap: wrap; }
.backlink { background: none; border: 0; color: var(--accent); font-weight: 700; padding: 0; }

/* ===== Reports ===== */
.reports-pane { display: grid; gap: .8rem; }
.metric-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); gap: .6rem; }
.metric { background: #fff; border: 1px solid var(--chrome-dark); border-radius: 3px; padding: .7rem .8rem; }
.metric span { display: block; color: var(--muted); font-size: 11px; text-transform: uppercase; }
.metric strong { display: block; font-size: 1.9rem; color: var(--title-2); letter-spacing: -.03em; }
.report-cats { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem,1fr)); gap: .6rem; }
.report-cat { background: #fff; border: 1px solid var(--chrome-dark); border-radius: 3px; padding: .7rem .8rem; }
.report-cat h4 { margin: 0 0 .4rem; color: var(--title-2); font-size: 12px; text-transform: uppercase; }
.report-cat ul { margin: 0; padding-left: 1rem; color: var(--muted); font-size: 12px; line-height: 1.7; }

/* ===== Sync ===== */
.sync-pane { display: grid; gap: .5rem; max-width: 40rem; }
.sync-row { display: grid; grid-template-columns: 12rem 1fr; gap: .5rem; background: #fff; border: 1px solid var(--chrome-dark); border-radius: 3px; padding: .55rem .7rem; }
.sync-row span:first-child { color: var(--muted); }

/* ===== Status bar ===== */
.statusbar { display: flex; align-items: center; gap: .6rem; background: var(--chrome); border-top: 1px solid var(--chrome-line); padding: .25rem .6rem; font-size: 11px; color: var(--muted); }
.sb-sep { color: var(--chrome-dark); }
.sb-spacer { flex: 1; }

/* ===== Menu popover ===== */
.menu-popover { position: fixed; z-index: 90; background: #fff; border: 1px solid var(--chrome-dark); box-shadow: 0 10px 24px rgba(0,0,0,.25); min-width: 13rem; padding: .25rem; }
.menu-item { display: block; width: 100%; text-align: left; background: none; border: 0; padding: .4rem .6rem; font-size: 12.5px; color: var(--ink); }
.menu-item:hover { background: var(--sel); }

/* ===== Scheduler (block calendar) ===== */
.sched-root { display: grid; grid-template-rows: auto minmax(0,1fr); height: calc(100vh - 11rem); min-height: 22rem; min-width: 0; overflow: hidden; background: #fff; border: 1px solid var(--chrome-dark); border-radius: 2px; }
.sched-root > *, .sched-body, .cal, .month, .month-grid, .month-head, .inshop, .inshop-grid { min-width: 0; max-width: 100%; }
/* Scheduler body: Day = calendar + side rail; Week/Month = calendar + board below */
.sched-body { min-height: 0; }
.sched-body.day { display: grid; grid-template-columns: minmax(0,1fr) 19rem; }
.sched-body.wide { display: grid; grid-template-rows: minmax(0,1.35fr) minmax(0,1fr); }
/* In Shop board hidden -> calendar takes the full space */
.sched-body.wide.no-inshop { grid-template-rows: minmax(0,1fr); }
.sched-body.day.no-inshop { grid-template-columns: minmax(0,1fr); }
.inshop { display: flex; flex-direction: column; min-height: 0; background: var(--grid-alt); }
.sched-body.day .inshop { border-left: 1px solid var(--chrome-dark); }
.sched-body.wide .inshop { border-top: 1px solid var(--chrome-dark); }
.inshop-head { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .4rem .6rem; background: linear-gradient(var(--grid-head), var(--grid-head-2)); border-bottom: 1px solid var(--chrome-dark); }
.inshop-title { font-weight: 800; font-size: 11px; letter-spacing: .05em; text-transform: uppercase; color: var(--title-2); }
.inshop-tools { display: flex; align-items: center; gap: .4rem; }
.inshop-count { font-size: 11px; background: #fff3df; border: 1px solid #f0c98a; color: #9a5b00; border-radius: 999px; padding: .1rem .55rem; }
.inshop-sum { font-size: 12px; font-weight: 800; color: #14532d; }
.inshop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(13rem,1fr)); gap: .4rem; padding: .5rem; overflow: auto; align-content: start; }
.sched-body.day .inshop-grid { grid-template-columns: 1fr; }
.inshop-card { background: #fff; border: 1px solid var(--chrome-line); border-left: 4px solid var(--chrome-dark); border-radius: 3px; display: grid; gap: .08rem; padding: .35rem .45rem; text-align: left; cursor: pointer; }
.inshop-card:hover { background: #fff7d6; }
.ic-top { display: flex; justify-content: space-between; gap: .4rem; }
.ic-ro { font-weight: 800; font-size: 12px; color: var(--title-2); }
.ic-amt { font-weight: 800; font-size: 12px; color: #14532d; }
.ic-name { font-weight: 700; font-size: 12px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ic-veh { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ic-meta { display: flex; align-items: center; gap: .3rem; font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .02em; }
.mi-note { margin: .15rem 0 0; font-size: 12px; color: var(--ink); white-space: pre-wrap; line-height: 1.35; }
.mi-table tr.mi-click { cursor: pointer; }
.mi-table tr.mi-click:hover { background: #fff7d6; }
.sched-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .6rem; background: linear-gradient(var(--grid-head), var(--grid-head-2)); border-bottom: 1px solid var(--chrome-dark); padding: .45rem .6rem; }
.sched-nav, .sched-views { display: flex; align-items: center; gap: .3rem; }
.sched-btn { background: linear-gradient(#fbfcfd, #dde3e9); border: 1px solid var(--chrome-dark); border-radius: 4px; font-size: 12px; font-weight: 600; padding: .25rem .6rem; }
.sched-btn.is-active { background: linear-gradient(#2a86a8, #0e4d66); color: #fff; border-color: var(--title-2); }
.sched-range { font-weight: 800; margin-left: .4rem; color: var(--title-2); }
.sched-meta { display: flex; gap: .4rem; font-size: 11px; color: var(--muted); }
.sched-count { background: #e3f1fb; border: 1px solid #a9cdec; border-radius: 999px; padding: .1rem .55rem; }
.sched-count.wip { background: #fff3df; border-color: #f0c98a; color: #9a5b00; }
.sched-vsep { width: 1px; align-self: stretch; margin: 0 .15rem; background: var(--chrome-dark); opacity: .5; }
.sched-toggle { background: linear-gradient(#fff7e6, #ffe9c2); border-color: #e0ad5c; color: #8a5300; }
.sched-toggle.is-active { background: linear-gradient(#f0a93a, #cf7c10); border-color: #b9690a; color: #fff; }
.wip-strip { display: none; }

.cal { --cal-days: 6; display: grid; grid-auto-rows: min-content; overflow: auto; min-height: 0; }
.cal-head, .cal-row { display: grid; grid-template-columns: 3.4rem repeat(var(--cal-days), minmax(0,1fr)); }
.cal-head { position: sticky; top: 0; z-index: 2; }
.cal-corner, .cal-dayhead { background: var(--grid-head-2); border-right: 1px solid var(--grid-line); border-bottom: 1px solid var(--chrome-dark); color: var(--title-2); font-size: 11px; padding: .35rem .4rem; text-transform: uppercase; }
.cal-dayhead { display: flex; align-items: baseline; justify-content: center; gap: .35rem; flex-wrap: wrap; }
.cal-dayhead .dh-num { font-size: .95rem; font-weight: 800; color: var(--ink); }
.cal-dayhead.is-today { background: linear-gradient(#2a86a8,#0e4d66); color: #fff; }
.cal-dayhead.is-today .dh-num { color: #fff; }
.dh-shop { background: #fff3df; border: 1px solid #f0c98a; border-radius: 999px; color: #9a5b00; font-size: .62rem; font-weight: 700; padding: 0 .4rem; }
.cal-rowlabel { background: var(--grid-alt); border-right: 1px solid var(--grid-line); border-bottom: 1px solid var(--grid-line); color: var(--muted); font-size: 11px; padding: .3rem .35rem; text-align: right; }
.cal-cell { border-right: 1px solid var(--grid-line); border-bottom: 1px solid var(--grid-line); display: grid; gap: .2rem; min-height: 2.5rem; padding: .2rem; align-content: start; }
.cal-cell.is-today-col { background: #fffdf2; }
.cal-allday .cal-cell, .cal-allday .cal-rowlabel { background: #fbf7e6; }
.cal-empty { padding: 1.5rem; text-align: center; color: var(--muted); }

.appt-block, .wip-block { background: #fff; border: 1px solid var(--chrome-line); border-left: 4px solid var(--title-1); border-radius: 3px; display: grid; gap: .04rem; padding: .25rem .35rem; text-align: left; width: 100%; }
.appt-block:hover, .wip-block:hover { background: #fff7d6; }
.ab-top, .wb-top { display: flex; justify-content: space-between; gap: .3rem; }
.ab-time { color: var(--muted); font-size: 10px; font-family: var(--mono); }
.ab-amt, .wb-amt { font-weight: 800; font-size: 11px; }
.ab-name, .wb-name { font-weight: 700; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ab-veh, .wb-veh { color: var(--muted); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wb-ro { color: var(--muted); font-size: 10px; font-family: var(--mono); }
.wb-meta { display: flex; align-items: center; gap: .3rem; color: var(--muted); font-size: 10px; }
.cal-cell .wip-block { flex: initial; }
.dot { width: .5rem; height: .5rem; border-radius: 50%; display: inline-block; }

/* status left-border accents */
.s-scheduled { border-left-color: #1457c8; } .s-confirmed,.s-approved { border-left-color: #0e7490; }
.s-arrived,.s-active,.s-waiting { border-left-color: #d97706; } .s-estimate { border-left-color: #6d28d9; }
.s-done { border-left-color: #15803d; } .s-warn { border-left-color: var(--red); } .s-cancel { border-left-color: #8a8a8a; } .s-default { border-left-color: var(--chrome-dark); }
.dot.s-scheduled{background:#1457c8}.dot.s-confirmed,.dot.s-approved{background:#0e7490}.dot.s-arrived,.dot.s-active,.dot.s-waiting{background:#d97706}.dot.s-estimate{background:#6d28d9}.dot.s-done{background:#15803d}.dot.s-warn{background:var(--red)}.dot.s-cancel{background:#8a8a8a}.dot.s-default{background:var(--chrome-dark)}

/* Month */
.month { display: grid; grid-template-rows: auto minmax(0,1fr); overflow: auto; min-height: 0; }
.month-head { display: grid; grid-template-columns: repeat(7, minmax(0,1fr)); position: sticky; top: 0; z-index: 2; }
.month-weekday { background: var(--grid-head-2); border-right: 1px solid var(--grid-line); border-bottom: 1px solid var(--chrome-dark); color: var(--title-2); font-size: 11px; padding: .35rem .5rem; text-transform: uppercase; }
.month-grid { display: grid; grid-auto-rows: minmax(6rem,1fr); grid-template-columns: repeat(7, minmax(0,1fr)); }
.month-cell { border-right: 1px solid var(--grid-line); border-bottom: 1px solid var(--grid-line); display: flex; flex-direction: column; gap: .15rem; padding: .2rem; min-width: 0; }
.month-cell.is-out { background: #f0f3f5; }
.month-cell.is-out .month-daynum { color: var(--muted); opacity: .6; }
.month-cell.is-today { background: #fffdf2; box-shadow: inset 0 0 0 2px var(--title-1); }
.month-daynum { display: flex; justify-content: space-between; align-items: center; background: none; border: 0; font-weight: 800; padding: .05rem .15rem; }
.md-sum { color: var(--ok); font-size: 11px; }
.month-chip { display: flex; justify-content: space-between; gap: .3rem; background: #fff; border: 1px solid var(--chrome-line); border-left: 4px solid var(--title-1); border-radius: 3px; overflow: hidden; padding: .14rem .3rem; width: 100%; }
.month-chip:hover { background: #fff7d6; }
.mc-name { font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mc-amt { font-size: 11px; font-weight: 800; flex: 0 0 auto; }
.month-more { background: none; border: 0; color: var(--accent); font-size: 10px; font-weight: 700; text-align: left; padding: .05rem .15rem; }

/* ===== Modal ===== */
.modal-overlay { position: fixed; inset: 0; z-index: 95; background: rgba(12,42,58,.5); display: flex; align-items: center; justify-content: center; padding: 1.25rem; }
.modal-card { width: 100%; max-width: 40rem; max-height: 88vh; background: #fff; border: 1px solid var(--title-2); box-shadow: 0 20px 56px rgba(0,0,0,.4); display: grid; grid-template-rows: auto minmax(0,1fr) auto; border-radius: 3px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; background: linear-gradient(#1a6e8e,#0c4256); color: #fff; padding: .55rem .8rem; }
.modal-head h3 { margin: .05rem 0 0; font-size: 1.1rem; }
.modal-eyebrow { font-size: 11px; color: rgba(255,255,255,.75); text-transform: uppercase; letter-spacing: .08em; }
.modal-x { background: rgba(255,255,255,.15); border: 1px solid rgba(255,255,255,.3); color: #fff; border-radius: 3px; padding: .1rem .5rem; font-size: 1.05rem; line-height: 1; }
.modal-body { overflow: auto; padding: .85rem; display: grid; gap: .8rem; }
.modal-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .55rem; }
.mi { display: grid; gap: .1rem; }
.mi span { color: var(--muted); font-size: 11px; text-transform: uppercase; }
.mi strong { font-size: .95rem; }
.mi-amt { color: var(--ok) !important; font-size: 1.15rem !important; }
.modal-section { border-top: 1px solid var(--grid-line); padding-top: .7rem; display: grid; gap: .5rem; }
.modal-label { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .05em; }
.status-pills { display: flex; flex-wrap: wrap; gap: .35rem; }
.status-pill-btn { background: linear-gradient(#fbfcfd,#dde3e9); border: 1px solid var(--chrome-dark); border-left-width: 4px; border-radius: 999px; font-size: 12px; font-weight: 700; padding: .25rem .7rem; }
.status-pill-btn.is-active { background: linear-gradient(#2a86a8,#0e4d66); color: #fff; }
.mi-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.mi-table th, .mi-table td { border-bottom: 1px solid var(--grid-line); padding: .35rem .45rem; text-align: left; }
.mi-table th { color: var(--muted); font-size: 11px; text-transform: uppercase; }
.mi-table .r { text-align: right; }
.muted { color: var(--muted); }
.ghost-btn { background: linear-gradient(#fbfcfd,#dde3e9); border: 1px solid var(--chrome-dark); border-radius: 4px; font-weight: 600; padding: .4rem .8rem; }
.modal-msg { background: #fff8d6; border: 1px solid #c9b458; color: #5a4a00; margin: 0; padding: .45rem .6rem; border-radius: 3px; }
.modal-foot { display: flex; align-items: center; gap: .5rem; border-top: 1px solid var(--chrome-line); padding: .6rem .8rem; }
.modal-btn { background: linear-gradient(#fbfcfd,#dde3e9); border: 1px solid var(--chrome-dark); border-radius: 4px; color: var(--ink); font-weight: 700; padding: .4rem .9rem; text-decoration: none; }
.modal-btn.primary { background: linear-gradient(#2a86a8,#0e4d66); color: #fff; border-color: var(--title-2); }
.modal-foot .modal-btn:last-child { margin-left: auto; }
.modal-saving { color: var(--muted); font-size: 12px; }

@media (max-width: 820px) {
  .order-head { grid-template-columns: 1fr; }
  .modal-grid { grid-template-columns: 1fr; }
  .bb span:not(.bb-ico) { display: none; }
  .bb { min-width: 2.6rem; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* =================================================================== *
 * Manager SE fidelity pass — match the real TeamWorks/Manager SE look
 * =================================================================== */
.titlebar { background: linear-gradient(#3f86d6, #2256a8); padding: .25rem .5rem; min-height: 1.8rem; }
.tb-mark { background: #fff; color: #2256a8; }
.tb-title { font-weight: 600; font-size: 12.5px; }
.tb-right { gap: .25rem; }
.winbtn { width: 1.6rem; height: 1.25rem; display: inline-grid; place-items: center; background: transparent; border: 0; color: #fff; font-size: .8rem; line-height: 1; }
.winbtn:hover { background: rgba(255,255,255,.22); }
.winx:hover { background: #c8102e; }

/* Menubar */
.menubar { background: #eef1f4; }
.menubar > button { font-size: 12px; padding: .3rem .65rem; }

/* Toolbar (icon-over-label) */
.toolbar { display: flex; align-items: flex-end; gap: .15rem; background: linear-gradient(#f6f8fa, #dde3ea); border-bottom: 1px solid var(--chrome-line); padding: .3rem .4rem; overflow-x: auto; }
.tbtn { display: grid; justify-items: center; gap: .15rem; min-width: 3.7rem; padding: .25rem .3rem; background: transparent; border: 1px solid transparent; border-radius: 4px; color: var(--ink); font-size: 10.5px; font-weight: 600; }
.tbtn:hover { background: #fff; border-color: var(--chrome-dark); }
.tbtn.is-active { background: #dcebf8; border-color: #2256a8; }
.tbi { width: 1.55rem; height: 1.55rem; border-radius: 4px; display: grid; place-items: center; color: #fff; font-size: .9rem; }
.tb-flex { flex: 1; }

/* Group-by bar above WIP grid */
.groupby-bar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; background: #dfe4ea; border: 1px solid var(--chrome-line); border-bottom: 0; padding: .3rem .6rem; }
.gb-text { color: #6b7682; font-size: 11px; font-style: italic; }
.gb-tools { display: flex; gap: .4rem; }
.gb-tools select, .gb-tools input { border: 1px solid var(--chrome-dark); border-radius: 3px; padding: .2rem .45rem; font-size: 11px; background: #fff; }
.gb-tools input { min-width: 13rem; }
.wip-grid-wrap { max-height: calc(100vh - 20rem); border-radius: 0; }

/* WIP grid header neutral gray (not teal) */
.m1-grid thead th { background: linear-gradient(#eef1f4, #dde3ea); color: #2256a8; }

/* Customer name = blue hyperlink (M1 signature) */
.cust-link { color: #1457c8; cursor: pointer; }
.cust-link:hover { text-decoration: underline; }

/* Editable dropdown cells (Written By / Labor Tech) */
.cell-dd { display: inline-flex; align-items: center; gap: .3rem; }
.cell-dd .cap { color: #9aa3ad; font-size: .65rem; }
.cell-edit:hover { outline: 1px solid #2256a8; outline-offset: -1px; cursor: pointer; }

/* Full-cell color-coded Status column (M1 signature) */
.m1-grid tbody td.wcell-status { text-align: center; font-weight: 700; color: #fff; }
.m1-grid tbody td.wst-estimate { background: #e3e7ea; color: #4a545d; }
.m1-grid tbody td.wst-approved { background: #2e7d32; }
.m1-grid tbody td.wst-in_progress { background: #1565c0; }
.m1-grid tbody td.wst-waiting_parts { background: #8a1f2b; }
.m1-grid tbody td.wst-completed { background: #00695c; }
.m1-grid tbody td.wst-invoiced { background: #4527a0; }
.m1-grid tbody td.wst-paid { background: #2e7d32; }
.m1-grid tbody td.wst-default { background: #eceff1; color: #4a545d; }

/* Strong full-row blue selection (overrides zebra + status color) */
.m1-grid tbody tr.is-sel td { background: #2f6fb0 !important; color: #fff !important; }
.m1-grid tbody tr.is-sel td .cust-link, .m1-grid tbody tr.is-sel td .cap { color: #fff !important; }

/* WIP footer: record navigator + recall + row colors */
.wip-footer { display: flex; align-items: center; gap: 1rem; background: #eef1f4; border: 1px solid var(--chrome-line); border-top: 0; padding: .3rem .6rem; font-size: 11px; color: #5b6670; }
.record-nav { font-variant-numeric: tabular-nums; }
.recall-line { flex: 1; color: #9a5b00; }
.rowcolor-link { color: #1457c8; cursor: pointer; }
.rowcolor-link:hover { text-decoration: underline; }

/* Inline edit popover */
.inline-pop { position: fixed; z-index: 120; background: #fff; border: 1px solid var(--chrome-dark); box-shadow: 0 8px 20px rgba(0,0,0,.25); padding: .25rem; }
.inline-pop select { border: 1px solid var(--chrome-dark); border-radius: 3px; padding: .25rem; min-width: 10rem; font-size: 12px; }

/* SVG icons (no emoji) */
.tbi svg { width: 1.05rem; height: 1.05rem; stroke: #fff; fill: none; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.lock-mark, .tb-mark { background: #fff; color: #2256a8; }
.lock-mark svg, .tb-mark svg { stroke: currentColor; fill: none; stroke-width: 1.3; stroke-linecap: round; stroke-linejoin: round; }
.tb-mark svg { width: 1rem; height: 1rem; }
.lock-mark svg { width: 1.75rem; height: 1.75rem; }
.winx { font-size: 1rem; }
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); gap: .6rem; margin-bottom: .9rem; }
.kpi { background: #fff; border: 1px solid var(--chrome-dark); border-top: 3px solid #2256a8; border-radius: 3px; padding: .65rem .8rem; }
.kpi span { display: block; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .03em; }
.kpi strong { display: block; font-size: 1.7rem; color: #14304f; letter-spacing: -.03em; line-height: 1.1; }
.kpi small { color: var(--muted); font-size: 11px; }

/* =================================================================== *
 * Sheep — Hiring platform
 * =================================================================== */
.sheep-root { display: grid; gap: .6rem; align-content: start; }
.sheep-provision { background: #fff; border: 1px solid var(--chrome-dark); border-radius: 3px; padding: 1.5rem; display: grid; gap: .6rem; justify-items: start; max-width: 40rem; }
.sheep-provision p { margin: 0; color: var(--muted); }
.sheep-provision code { background: #eef1f4; border: 1px solid var(--grid-line); border-radius: 3px; padding: .05rem .3rem; font-family: var(--mono); font-size: 11.5px; }

/* AI intelligence strip */
.sheep-brief { background: linear-gradient(#0c4256, #0a3547); color: #eaf4f8; border: 1px solid #082b39; border-radius: 4px; overflow: hidden; }
.sb-head { display: flex; align-items: center; gap: .55rem; padding: .45rem .65rem; background: rgba(255,255,255,.06); border-bottom: 1px solid rgba(255,255,255,.12); flex-wrap: wrap; }
.sb-mark { background: #0b8f5a; color: #fff; font-weight: 800; font-size: 10px; letter-spacing: .04em; border-radius: 3px; padding: .12rem .4rem; }
.sb-title { font-weight: 700; font-size: 12.5px; letter-spacing: .02em; }
.sb-run { color: rgba(234,244,248,.7); font-size: 11px; font-family: var(--mono); }
.sb-tools { margin-left: auto; display: flex; gap: .35rem; }
.sb-tools .m1-btn { padding: .3rem .7rem; font-size: 12px; }
.sb-body { padding: .6rem .7rem; }
.ai-bullets { display: grid; gap: .3rem; }
.ai-bullet { position: relative; padding-left: 1rem; font-size: 13px; line-height: 1.4; }
.ai-bullet::before { content: "\25B8"; position: absolute; left: 0; color: #4fd1a8; }
.ai-src { margin-top: .45rem; font-size: 10px; text-transform: uppercase; letter-spacing: .05em; color: rgba(234,244,248,.55); }
.ai-empty, .ai-thinking { color: rgba(234,244,248,.8); font-size: 12.5px; }
.ai-thinking::after { content: "\2026"; animation: sheepdots 1.2s steps(4,end) infinite; }
@keyframes sheepdots { 0% { opacity:.3 } 50% { opacity:1 } 100% { opacity:.3 } }

/* Stat chips */
.sheep-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr)); gap: .45rem; }
.sheep-stat { background: #fff; border: 1px solid var(--chrome-dark); border-top: 3px solid #0b8f5a; border-radius: 3px; padding: .5rem .65rem; }
.sheep-stat span { display: block; color: var(--muted); font-size: 10.5px; text-transform: uppercase; letter-spacing: .03em; }
.sheep-stat strong { display: block; font-size: 1.5rem; color: #14304f; letter-spacing: -.03em; line-height: 1.15; }
.sheep-stat.is-click { cursor: pointer; }
.sheep-stat.is-click:hover { border-color: var(--sel-line); }
.sheep-stat.is-active { background: #e9f7f0; border-top-color: #097a4c; box-shadow: inset 0 0 0 1px #0b8f5a; }

/* Toolbar + filter bar */
.sheep-toolbar { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; background: #eef1f4; border: 1px solid var(--chrome-line); border-radius: 7px; padding: .4rem .55rem; }
.sheep-seg { display: inline-flex; border: 1px solid var(--chrome-dark); border-radius: 6px; overflow: hidden; }
.seg-btn { background: linear-gradient(#fbfcfd, #dde3e9); border: 0; border-right: 1px solid var(--chrome-dark); padding: .35rem .8rem; font-size: 12px; font-weight: 700; color: var(--ink); cursor: pointer; }
.seg-btn:last-child { border-right: 0; }
.seg-btn.is-active { background: linear-gradient(#0b8f5a, #097a4c); color: #fff; }
.jb-views .seg-btn.is-active { background: linear-gradient(#2256a8, #1c4a90); color: #fff; }
.jb-flex { flex: 1; }
.jb-clear { background: #fff; border: 1px solid var(--chrome-dark); border-radius: 999px; padding: .3rem .75rem; font-size: 11.5px; font-weight: 700; color: var(--accent); cursor: pointer; }
.jb-clear:hover { border-color: var(--accent); }
.sheep-sortwrap { font-size: 11px; color: var(--muted); display: inline-flex; align-items: center; gap: .35rem; }
.sheep-sort { border: 1px solid var(--chrome-dark); border-radius: 4px; padding: .32rem .45rem; background: #fff; font-size: 12px; }
.jb-filterbar { display: flex; flex-direction: column; gap: .35rem; margin-top: -.1rem; }
.jb-filterbar:empty { display: none; }
.jb-chipgroup { display: flex; align-items: center; gap: .3rem; flex-wrap: wrap; }
.jb-glabel { font-size: 10px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 800; min-width: 3rem; }
.stage-chip { background: #fff; border: 1px solid var(--chrome-dark); border-radius: 999px; padding: .22rem .65rem; font-size: 11px; font-weight: 700; color: var(--ink); cursor: pointer; }
.stage-chip em { font-style: normal; color: var(--muted); font-weight: 800; }
.stage-chip.is-active { background: #14304f; color: #fff; border-color: #14304f; }
.stage-chip.is-active em { color: rgba(255,255,255,.8); }
.jb-stagechip { border-left-width: 4px; }
.jb-stage-new { border-left-color: #1565c0; } .jb-stage-contacted { border-left-color: #b45309; } .jb-stage-screening { border-left-color: #6d28d9; }
.jb-stage-interview { border-left-color: #0e7490; } .jb-stage-hired { border-left-color: #15803d; } .jb-stage-passed { border-left-color: #9aa1a9; }

/* Shared fit-score badge */
.jb-score { width: 2.3rem; height: 2.3rem; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: .95rem; color: #fff; flex: 0 0 auto; }
.sc-score.sc-elite, .jb-score.sc-elite { background: #097a4c; } .sc-score.sc-strong, .jb-score.sc-strong { background: #2e7d32; } .sc-score.sc-good, .jb-score.sc-good { background: #1565c0; }
.sc-score.sc-fair, .jb-score.sc-fair { background: #b45309; } .sc-score.sc-low, .jb-score.sc-low { background: #8a8a8a; }

/* Shared chips reused by cards */
.sc-badges { display: flex; flex-wrap: wrap; gap: .25rem; }
.sbadge { font-size: 10px; font-weight: 700; color: var(--muted); background: #eef1f4; border: 1px solid var(--grid-line); border-radius: 3px; padding: .05rem .35rem; }
.sbadge.b-master { background: #fbe8ef; border-color: #e6a8c4; color: #9b1b56; }
.sbadge.b-ase { background: #e8f1fb; border-color: #a9cdec; color: #0e5aa7; }
.sbadge.b-qual { background: #e9f7f0; border-color: #9bd3ad; color: #14532d; }
.sc-likes { display: inline-flex; gap: .25rem; }
.like-chip { font-size: 10px; font-weight: 700; border-radius: 999px; padding: .05rem .4rem; border: 1px solid transparent; }
.like-chip.band-good { background: #e8f7ee; color: #14532d; border-color: #9bd3ad; }
.like-chip.band-mid { background: #fff3df; color: #9a5b00; border-color: #f0c98a; }
.like-chip.band-low { background: #fdeeee; color: #7f1d1d; border-color: #e0a0a0; }
.like-chip.band-na { background: #eef1f4; color: var(--muted); border-color: var(--grid-line); }

/* Candidate meta chips */
.jb-chip { font-size: 10px; font-weight: 700; color: #3a4753; background: #eef2f6; border: 1px solid var(--grid-line); border-radius: 999px; padding: .05rem .45rem; }
.jb-chip-role { background: #e8f1fb; border-color: #a9cdec; color: #0e5aa7; }
.jb-chip-master { background: #fbe8ef; border-color: #e6a8c4; color: #9b1b56; }
.jb-chip-ase { background: #e9f7f0; border-color: #9bd3ad; color: #14532d; }

/* Last-contact pill */
.jb-contact { font-size: 10px; font-weight: 700; border-radius: 999px; padding: .07rem .5rem; border: 1px solid transparent; white-space: nowrap; }
.jb-contact.jb-fresh { background: #f3f5f7; color: #7a828b; border-color: var(--grid-line); }
.jb-contact.jb-contacted { background: #fff3df; color: #9a5b00; border-color: #f0c98a; }
.jb-contact.jb-replied { background: #e8f7ee; color: #14532d; border-color: #9bd3ad; }

/* Action buttons (Text / Call / Open) */
.jb-actions { margin-left: auto; display: inline-flex; gap: .3rem; }
.jb-act { display: inline-flex; align-items: center; gap: .25rem; background: #fff; border: 1px solid var(--chrome-dark); border-radius: 6px; padding: .32rem .6rem; font-size: 11.5px; font-weight: 700; color: var(--ink); text-decoration: none; cursor: pointer; line-height: 1; }
.jb-act:hover { border-color: var(--sel-line); }
.jb-act-text { background: linear-gradient(#0b8f5a, #097a4c); color: #fff; border-color: #097a4c; }
.jb-act-call { color: #0e5aa7; border-color: #a9cdec; }
.jb-act-call.is-disabled { color: var(--muted); border-color: var(--grid-line); background: #f3f5f7; cursor: default; }
.jb-act-open.primary { background: linear-gradient(#2256a8, #1c4a90); color: #fff; border-color: #1c4a90; }

/* ---- Pipeline (Kanban) board ---- */
.jb-board { display: flex; gap: .55rem; overflow-x: auto; padding-bottom: .4rem; align-items: flex-start; scroll-snap-type: x proximity; }
.jb-col { flex: 1 0 15rem; min-width: 15rem; max-width: 26rem; background: #eef1f4; border: 1px solid var(--chrome-line); border-radius: 9px; display: flex; flex-direction: column; scroll-snap-align: start; }
.jb-col-head { display: flex; align-items: center; gap: .45rem; padding: .5rem .6rem; border-bottom: 1px solid var(--chrome-line); }
.jb-col-head h4 { margin: 0; font-size: 11.5px; text-transform: uppercase; letter-spacing: .03em; color: var(--title-2); flex: 1; }
.jb-col-dot { width: 9px; height: 9px; border-radius: 50%; background: #9aa1a9; }
.jb-col-n { font-size: 11px; font-weight: 800; color: #fff; background: #9aa1a9; border-radius: 999px; min-width: 1.4rem; text-align: center; padding: .05rem .4rem; }
.jb-col-body { display: grid; gap: .45rem; padding: .5rem; align-content: start; overflow-y: auto; max-height: 64vh; }
.jb-col-empty { color: var(--muted); font-size: 12px; text-align: center; padding: .9rem 0; }
.jb-col-new { border-top: 3px solid #1565c0; } .jb-col-new .jb-col-dot, .jb-col-new .jb-col-n { background: #1565c0; }
.jb-col-contacted { border-top: 3px solid #b45309; } .jb-col-contacted .jb-col-dot, .jb-col-contacted .jb-col-n { background: #b45309; }
.jb-col-screening { border-top: 3px solid #6d28d9; } .jb-col-screening .jb-col-dot, .jb-col-screening .jb-col-n { background: #6d28d9; }
.jb-col-interview { border-top: 3px solid #0e7490; } .jb-col-interview .jb-col-dot, .jb-col-interview .jb-col-n { background: #0e7490; }
.jb-col-hired { border-top: 3px solid #15803d; } .jb-col-hired .jb-col-dot, .jb-col-hired .jb-col-n { background: #15803d; }
.jb-col-passed { border-top: 3px solid #9aa1a9; } .jb-col-passed .jb-col-dot, .jb-col-passed .jb-col-n { background: #9aa1a9; }

/* Mini candidate card (board) */
.jb-mini { background: #fff; border: 1px solid var(--chrome-dark); border-radius: 8px; padding: .5rem .55rem; display: grid; gap: .4rem; cursor: pointer; }
.jb-mini:hover { box-shadow: 0 2px 8px rgba(12,42,58,.16); border-color: var(--sel-line); }
.jb-mini:focus-visible { outline: 2px solid var(--sel-line); outline-offset: 1px; }
.jb-mini-top { display: flex; align-items: center; gap: .5rem; }
.jb-mini-id { min-width: 0; display: grid; }
.jb-mini-name { font-weight: 800; font-size: 13px; color: var(--title-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.jb-mini-loc { font-size: 10.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.jb-mini-chips { display: flex; flex-wrap: wrap; gap: .25rem; }
.jb-mini-foot { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
.jb-mini-foot .jb-actions { margin-left: auto; }
.jb-mini .jb-act { padding: .3rem .5rem; }

/* Full candidate card (Cards view) */
.jb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(22rem, 1fr)); gap: .55rem; }
.jb-card { display: grid; grid-template-columns: 2.6rem 1fr; gap: .55rem; background: #fff; border: 1px solid var(--chrome-dark); border-left: 4px solid #9aa1a9; border-radius: 8px; padding: .6rem .65rem; cursor: pointer; }
.jb-card:hover { box-shadow: 0 2px 10px rgba(12,42,58,.16); border-color: var(--sel-line); }
.jb-card:focus-visible { outline: 2px solid var(--sel-line); outline-offset: 1px; }
.jb-card.jb-st-new { border-left-color: #1565c0; } .jb-card.jb-st-contacted { border-left-color: #b45309; } .jb-card.jb-st-screening { border-left-color: #6d28d9; }
.jb-card.jb-st-interview { border-left-color: #0e7490; } .jb-card.jb-st-hired { border-left-color: #15803d; } .jb-card.jb-st-passed { border-left-color: #9aa1a9; }
.jb-card-l { display: grid; gap: .3rem; justify-items: center; align-content: start; }
.jb-rank { font-size: 10px; font-weight: 800; color: var(--muted); }
.jb-card-main { min-width: 0; display: grid; gap: .25rem; }
.jb-card-namerow { display: flex; align-items: center; gap: .5rem; }
.jb-card-name { font-weight: 800; font-size: 14px; color: var(--title-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; }
.jb-stage { font-size: 9.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .03em; border-radius: 999px; padding: .12rem .5rem; border: 1px solid transparent; white-space: nowrap; }
.jb-stage.jb-st-new { background: #e3f1fb; color: #0e5aa7; border-color: #a9cdec; }
.jb-stage.jb-st-contacted { background: #fff3df; color: #9a5b00; border-color: #f0c98a; }
.jb-stage.jb-st-screening { background: #f1ebfb; color: #5b21b6; border-color: #c4b5e8; }
.jb-stage.jb-st-interview { background: #e0f2f4; color: #0e7490; border-color: #a7d8de; }
.jb-stage.jb-st-hired { background: #e8f7ee; color: #14532d; border-color: #9bd3ad; }
.jb-stage.jb-st-passed { background: #f3f3f3; color: #6b6b6b; border-color: #cfcfcf; }
.jb-card-sub { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.jb-src { color: #0e5aa7; font-weight: 600; }
.jb-card-date { font-family: var(--mono); }
.jb-card-head { font-size: 12px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.jb-card-intel { font-size: 11.5px; color: #3a4753; line-height: 1.35; background: #f5f8fa; border-left: 2px solid #cfe0ea; padding: .25rem .4rem; border-radius: 2px; }
.jb-card-foot { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; border-top: 1px solid var(--grid-line); padding-top: .45rem; margin-top: .1rem; }
.jb-card-actions { margin-left: auto; display: inline-flex; gap: .3rem; }

/* Empty state */
.jb-empty { grid-column: 1 / -1; background: #fff; border: 1px dashed var(--chrome-dark); border-radius: 8px; padding: 2.2rem 1rem; display: grid; gap: .45rem; justify-items: center; text-align: center; }
.jb-empty strong { font-size: 14px; color: var(--title-2); }
.jb-empty span { color: var(--muted); font-size: 12.5px; }

/* Jobber board — phone tuning */
@media (max-width: 820px) {
  .jb-board { gap: .5rem; scroll-snap-type: x mandatory; }
  .jb-col { flex: 0 0 86%; min-width: 86%; max-width: 86%; }
  .jb-col-body { max-height: none; }
  .jb-grid { grid-template-columns: 1fr; }
  .jb-act { padding: .5rem .8rem; font-size: 13px; }
  .jb-glabel { min-width: 100%; }
}

/* ---- Outreach: bulk, notes, follow-up, candidate thread, inbox tag ---- */
.jb-bulk { background: linear-gradient(#0b8f5a, #097a4c); color: #fff; border: 1px solid #097a4c; border-radius: 999px; padding: .32rem .8rem; font-size: 11.5px; font-weight: 800; cursor: pointer; display: inline-flex; align-items: center; gap: .35rem; }
.jb-bulk em { font-style: normal; background: rgba(255,255,255,.25); border-radius: 999px; padding: 0 .4rem; }
.jb-bulk:hover { filter: brightness(1.06); }
.jb-contact.jb-follow { background: #eef2fb; color: #1c4a90; border-color: #b9c9ec; }
.jb-contact.jb-follow.due { background: #fdeeee; color: #8a1f2b; border-color: #e0a0a0; }
.bulk-list { list-style: none; margin: .2rem 0 0; padding: 0; display: grid; gap: .15rem; max-height: 11rem; overflow: auto; }
.bulk-list li { font-size: 12.5px; color: var(--ink); display: flex; justify-content: space-between; gap: .6rem; border-bottom: 1px solid var(--grid-line); padding: .22rem 0; }
.bulk-ph { color: var(--muted); font-family: var(--mono); font-size: 11.5px; }
.bulk-more { color: var(--muted); justify-content: flex-start; }
.bulk-note { margin-top: .45rem; font-size: 11.5px; line-height: 1.4; }
.bulk-live { color: #14532d; } .bulk-warn { color: #8a5b00; }
.bulk-result { background: #e9f7f0; border: 1px solid #9bd3ad; border-radius: 6px; padding: .5rem .65rem; font-size: 13px; color: #14532d; }
.cand-notes { min-height: 4rem; }
.cand-fu { align-items: center; gap: .6rem; margin-top: .45rem; }
.fu-lbl { font-size: 12px; color: var(--muted); display: inline-flex; align-items: center; gap: .35rem; }
.fu-lbl input { border: 1px solid var(--chrome-dark); border-radius: 4px; padding: .32rem .4rem; font: inherit; }
.cand-thread { display: grid; gap: .4rem; max-height: 16rem; overflow: auto; padding: .2rem; background: #f5f8fa; border: 1px solid var(--grid-line); border-radius: 6px; }
.cbubble { max-width: 82%; padding: .4rem .6rem; border-radius: 10px; display: grid; gap: .15rem; }
.cbubble.out { justify-self: end; background: #dceefe; border: 1px solid #b9d9f5; }
.cbubble.in { justify-self: start; background: #fff; border: 1px solid var(--grid-line); }
.cb-body { font-size: 13px; color: var(--ink); white-space: pre-wrap; }
.cb-meta { font-size: 10px; color: var(--muted); }
.mt-tag { font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: #097a4c; background: #e9f7f0; border: 1px solid #9bd3ad; border-radius: 999px; padding: 0 .35rem; margin-left: .35rem; }

/* Hiring stage status pills */
.st-new { background: #e3f1fb; color: #0e5aa7; border-color: #a9cdec; }
.st-reviewing { background: #efe9fb; color: #5b21b6; border-color: #c4b5e8; }
.st-contacting { background: #fff3df; color: #9a5b00; border-color: #f0c98a; }
.st-interviewing { background: #e0f2f4; color: #0e7490; border-color: #a7d8de; }
.st-offer { background: #e8f1fb; color: #0e5aa7; border-color: #a9cdec; }
.st-hired { background: #e8f7ee; color: #14532d; border-color: #9bd3ad; }
.st-rejected { background: #f3f3f3; color: #6b6b6b; border-color: #cfcfcf; }
.st-sourced { background: #eef1f4; color: #54616e; border-color: #cdd4db; }

/* Sheep modal */
.sheep-modal { max-width: 44rem; }
.modal-badges { margin-top: -.2rem; }
.chip-row { display: flex; flex-wrap: wrap; gap: .3rem; }
.chip { font-size: 11px; background: #eef1f4; border: 1px solid var(--grid-line); border-radius: 999px; padding: .1rem .5rem; color: #3a4753; }
.row-actions { display: flex; gap: .4rem; flex-wrap: wrap; }
.compose-seg { width: max-content; }
.compose-subject { width: 100%; border: 1px solid var(--chrome-dark); border-radius: 3px; padding: .4rem .55rem; }
.compose-box { width: 100%; min-height: 6rem; border: 1px solid var(--chrome-dark); border-radius: 3px; padding: .5rem .6rem; font: inherit; resize: vertical; }
.ai-out { background: #f5f8fa; border: 1px solid var(--grid-line); border-radius: 3px; padding: .4rem .55rem; }
.ai-out summary { cursor: pointer; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.ai-out pre { margin: .45rem 0 0; white-space: pre-wrap; font-family: var(--ui); font-size: 12.5px; line-height: 1.45; color: var(--ink); }
.mi-note.ai { border-left: 2px solid #0b8f5a; padding-left: .5rem; color: #14532d; }

/* =================================================================== *
 * Pagination, forms, charts, CRM stats, WIP grouping (jobber pass)
 * =================================================================== */

/* Pager */
.pager { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem; padding: .4rem 0; }
.wip-footer .pager { padding: 0; }
.pg-btn { background: linear-gradient(#fbfcfd, #dde3e9); border: 1px solid var(--chrome-dark); border-radius: 4px; font-size: 12px; font-weight: 600; min-width: 2rem; padding: .25rem .5rem; color: var(--ink); }
.pg-btn:hover:not(:disabled) { border-color: var(--sel-line); }
.pg-btn.is-active { background: linear-gradient(#2a86a8, #0e4d66); color: #fff; border-color: var(--title-2); }
.pg-btn:disabled { opacity: .45; cursor: default; }
.pg-ell { color: var(--muted); padding: 0 .15rem; }

/* WIP group-by controls + group header rows */
.gb-label { font-size: 11px; color: #6b7682; display: inline-flex; align-items: center; gap: .3rem; }
.gb-label select { border: 1px solid var(--chrome-dark); border-radius: 3px; padding: .2rem .4rem; font-size: 11px; background: #fff; }
.gb-chk { font-size: 11px; color: #6b7682; display: inline-flex; align-items: center; gap: .3rem; }
.m1-grid tbody tr.grp-row td { background: #14304f; color: #fff; font-weight: 800; font-size: 11.5px; text-transform: uppercase; letter-spacing: .03em; position: sticky; }
.m1-grid tbody tr.grp-row .grp-n { color: rgba(255,255,255,.7); font-weight: 600; }

/* Forms (add/edit vendor, prospect) */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .55rem .7rem; }
.form-row { display: grid; gap: .2rem; font-size: 12px; }
.form-row > span { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .03em; }
.form-row.full { grid-column: 1 / -1; margin-top: .55rem; }
.form-row.chk { flex-direction: row; display: flex; align-items: center; gap: .4rem; text-transform: none; color: var(--ink); font-size: 12.5px; }
.form-row input, .form-row select { border: 1px solid var(--chrome-dark); border-radius: 3px; padding: .4rem .5rem; background: #fff; font: inherit; }
.modal-body .form-grid + .form-row.full { margin-top: .7rem; }

/* CRM stats + toolbar */
.crm-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: .5rem; margin-bottom: .5rem; }
.crm-kpi { background: #fff; border: 1px solid var(--chrome-dark); border-top: 3px solid #b02f6f; border-radius: 3px; padding: .5rem .65rem; }
.crm-kpi span { display: block; color: var(--muted); font-size: 10.5px; text-transform: uppercase; letter-spacing: .03em; }
.crm-kpi strong { display: block; font-size: 1.45rem; color: #14304f; letter-spacing: -.03em; line-height: 1.15; }
.crm-kpi small { color: var(--muted); font-size: 10.5px; }
.crm-toolbar { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; background: #dfe4ea; border: 1px solid var(--chrome-line); border-radius: 3px; padding: .35rem .5rem; margin-bottom: .5rem; }
.crm-toolbar .sheep-stages { flex: 1; }

/* Reports — bar chart + cards */
.report-card { background: #fff; border: 1px solid var(--chrome-dark); border-radius: 3px; padding: .7rem .8rem; margin-bottom: .8rem; }
.report-card h4 { margin: 0 0 .6rem; color: var(--title-2); font-size: 12px; text-transform: uppercase; letter-spacing: .03em; }
.report-note { color: var(--warn); font-size: 12px; background: #fff8d6; border: 1px solid #e3d28a; border-radius: 3px; padding: .5rem .7rem; }
.bar-chart { display: flex; align-items: flex-end; gap: .6rem; height: 11rem; padding-top: 1rem; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: .25rem; height: 100%; min-width: 0; }
.bar { width: 60%; max-width: 3rem; background: linear-gradient(#2f6fb0, #1457c8); border-radius: 3px 3px 0 0; min-height: 2px; transition: height .3s; }
.bar-val { font-size: 10.5px; font-weight: 700; color: #14304f; }
.bar-lbl { font-size: 10.5px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* Schedule running total */
.sched-total { background: #14532d; color: #fff; border-radius: 999px; padding: .12rem .65rem; font-size: 11px; font-weight: 800; }

/* ===== Create/Edit forms (jobber-3 writes) ===== */
.order-form-card { max-width: 46rem; }
.form-block { display: grid; gap: .35rem; padding: .6rem; border: 1px solid var(--grid-line); border-radius: 4px; background: var(--grid-alt); }
.form-block > .modal-label { font-size: 11px; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); font-weight: 700; }
.form-block .modal-label small { text-transform: none; letter-spacing: 0; font-weight: 500; }
.form-seg { display: inline-flex; border: 1px solid var(--chrome-dark); border-radius: 4px; overflow: hidden; }
.form-seg .seg-btn.is-active { background: linear-gradient(#2256a8, #1c4a90); color: #fff; }
.form-row input, .form-row select, .form-row textarea { border: 1px solid var(--chrome-dark); border-radius: 3px; padding: .35rem .45rem; font: inherit; font-size: 13px; background: #fff; width: 100%; }
.form-row.chk { flex-direction: row; align-items: center; gap: .4rem; grid-auto-flow: column; justify-content: start; }

/* customer / vehicle picker */
.picker { display: grid; gap: .4rem; }
.picker-input { border: 1px solid var(--chrome-dark); border-radius: 3px; padding: .4rem .5rem; font: inherit; font-size: 13px; width: 100%; background: #fff; }
.picker-results { display: grid; gap: 2px; max-height: 11rem; overflow: auto; }
.picker-row { display: flex; justify-content: space-between; align-items: center; gap: .6rem; text-align: left; background: #fff; border: 1px solid var(--grid-line); border-radius: 3px; padding: .4rem .55rem; cursor: pointer; font-size: 13px; }
.picker-row:hover { background: var(--sel); border-color: var(--sel-line); }
.picker-row small { color: var(--muted); }
.picker-empty { color: var(--muted); font-size: 12px; padding: .35rem .2rem; }
.picked-chip { display: flex; justify-content: space-between; align-items: center; gap: .8rem; background: #fff; border: 1px solid var(--sel-line); border-radius: 4px; padding: .45rem .6rem; }
.picked-chip strong { display: block; font-size: 13px; }
.picked-chip small { color: var(--muted); }

/* line item editor */
.li-edit { width: 100%; border-collapse: collapse; font-size: 13px; }
.li-edit th { text-align: left; font-size: 10px; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); padding: .2rem .3rem; }
.li-edit th.r, .li-edit td.r { text-align: right; }
.li-edit td { padding: .15rem .2rem; }
.li-edit input, .li-edit select { border: 1px solid var(--chrome-dark); border-radius: 3px; padding: .3rem .35rem; font: inherit; font-size: 12px; width: 100%; background: #fff; }
.li-edit input.num { text-align: right; max-width: 6rem; }
.li-del { background: #fff; border: 1px solid var(--chrome-dark); border-radius: 3px; color: var(--red); font-weight: 700; line-height: 1; padding: .15rem .45rem; cursor: pointer; }
.li-del:hover { background: var(--red); color: #fff; }
.li-actions { white-space: nowrap; }
.li-mini { background: #fff; border: 1px solid var(--chrome-dark); border-radius: 3px; padding: .1rem .4rem; margin-left: 2px; cursor: pointer; font-size: 12px; line-height: 1.4; }
.li-mini:hover { background: var(--sel); border-color: var(--sel-line); }
.li-mini.li-del:hover { background: var(--red); color: #fff; }

/* ===== FannyPack (CRM) follow-ups + sources ===== */
.crm-kpi-due { outline: 2px solid var(--warn); outline-offset: -2px; }
.crm-kpi-due strong { color: var(--warn); }
.crm-sources { margin-top: .35rem; opacity: .95; }
.crm-sources .stage-chip { font-size: 11px; }

/* ===== Jobber role/experience categorization (Phase 3) ===== */
.sbadge.b-cat { background: #1c4a90; color: #fff; border-color: #163b73; }
.sbadge.b-exp { background: #0b6e4f; color: #fff; border-color: #095a41; text-transform: capitalize; }
.sheep-cats { margin-top: .4rem; }
.stage-chip.b-cat-chip.is-active { background: #1c4a90; color: #fff; border-color: #163b73; }
.stage-chip.b-cat-chip.is-active em { color: #cfe0fb; }

/* ===================== P0 action-first additions ===================== */
.m1-btn-accent { background: linear-gradient(#d33b50, #a30f24); color: #fff; border-color: var(--accent-dk); }
.m1-btn-accent:hover { background: linear-gradient(#e0495e, #b3122a); }

/* Quick-action bar */
.quickbar { display: flex; align-items: center; gap: .4rem; padding: .35rem .6rem; background: linear-gradient(#eef2f6, #dce3ea); border-bottom: 1px solid var(--chrome-line); flex-wrap: wrap; }
.qb-btn { background: linear-gradient(#fbfcfd, #e3e8ed); border: 1px solid var(--chrome-dark); border-radius: 4px; padding: .3rem .7rem; font-weight: 600; font-size: 12px; color: var(--ink); }
.qb-btn:hover { border-color: var(--sel-line); background: #fff; }
.qb-primary { background: linear-gradient(#2a86a8, #0e4d66); color: #fff; border-color: var(--title-2); }
.qb-primary:hover { background: linear-gradient(#2f93b8, #0c4458); }
.qb-ic { font-weight: 800; margin-right: .15rem; }
/* Compact group: the old flex:1 spacer justified buttons/search to opposite
   edges of the screen. Keep everything as one left-aligned cluster. */
.qb-flex { flex: 0 0 .4rem; }
.qb-search { display: flex; align-items: center; gap: .45rem; background: #fff; border: 1px solid var(--chrome-dark); border-radius: 5px; padding: .3rem .7rem; color: var(--muted); flex: 0 0 auto; width: 15rem; max-width: 15rem; }
.qb-search:hover { border-color: var(--sel-line); }
.qb-search svg { width: 13px; height: 13px; fill: none; stroke: var(--muted); stroke-width: 1.6; }
.qb-search span { font-size: 12px; }
.qb-search kbd { margin-left: auto; background: var(--grid-head); border: 1px solid var(--chrome-line); border-radius: 3px; padding: 0 .3rem; font-size: 11px; font-family: var(--mono); }

/* Tab unread badge */
.tbtn { position: relative; }
.tab-badge { position: absolute; top: 2px; right: 4px; background: var(--accent); color: #fff; font-size: 10px; font-weight: 800; min-width: 15px; height: 15px; line-height: 15px; border-radius: 8px; padding: 0 3px; }

/* Row quick-action menu */
.row-act-cell { width: 30px; text-align: center; }
.rowmenu-btn { background: none; border: 1px solid transparent; border-radius: 4px; font-size: 16px; line-height: 1; color: var(--muted); padding: 0 .35rem; }
.rowmenu-btn:hover { background: var(--grid-head); border-color: var(--chrome-line); color: var(--ink); }
.rowmenu { position: absolute; z-index: 120; min-width: 220px; background: #fff; border: 1px solid var(--title-2); border-radius: 5px; box-shadow: 0 12px 30px rgba(0,0,0,.28); padding: .25rem; }
.rowmenu-item { display: block; width: 100%; text-align: left; background: none; border: 0; border-radius: 4px; padding: .45rem .6rem; font-size: 12.5px; color: var(--ink); }
.rowmenu-item:hover { background: var(--sel); }

/* Command palette */
.palette-overlay { position: fixed; inset: 0; z-index: 300; background: rgba(12,22,32,.4); display: flex; align-items: flex-start; justify-content: center; padding-top: 12vh; }
.palette { width: min(620px, 92vw); background: #fff; border: 1px solid var(--title-2); border-radius: 8px; box-shadow: 0 24px 60px rgba(0,0,0,.45); overflow: hidden; }
.palette-input { width: 100%; border: 0; border-bottom: 1px solid var(--grid-line); padding: .9rem 1rem; font-size: 15px; outline: none; }
.palette-results { max-height: 52vh; overflow: auto; padding: .35rem; }
.pal-item { display: flex; justify-content: space-between; align-items: center; gap: 1rem; width: 100%; text-align: left; background: none; border: 0; border-radius: 5px; padding: .55rem .7rem; }
.pal-item.is-sel, .pal-item:hover { background: var(--sel); }
.pal-l { font-size: 13.5px; color: var(--ink); font-weight: 600; }
.pal-h { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; white-space: nowrap; }
.pal-empty { padding: 1.2rem; text-align: center; color: var(--muted); }
.palette-foot { display: flex; gap: .8rem; padding: .5rem .9rem; border-top: 1px solid var(--grid-line); font-size: 11px; color: var(--muted); }
.palette-foot kbd { background: var(--grid-head); border: 1px solid var(--chrome-line); border-radius: 3px; padding: 0 .3rem; font-family: var(--mono); }

/* Empty-state CTA */
.empty-cta { gap: .6rem; }
.empty-cta .m1-btn { margin-top: .4rem; }

/* Today dashboard */
.today-pane { display: grid; gap: .8rem; }
.today-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: .5rem; }
.today-stat { text-align: left; background: #fff; border: 1px solid var(--grid-line); border-radius: 6px; padding: .6rem .75rem; display: grid; gap: .15rem; }
.today-stat.is-click { cursor: pointer; } .today-stat.is-click:hover { border-color: var(--sel-line); }
.today-stat span { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.today-stat strong { font-size: 1.35rem; color: var(--title-2); }
.today-cols { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; }
.today-card { background: #fff; border: 1px solid var(--grid-line); border-radius: 6px; padding: .75rem; }
.today-card h3 { margin: 0 0 .5rem; font-size: .95rem; color: var(--title-2); }
.today-bay { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: .5rem; }
@media (max-width: 900px) { .today-cols { grid-template-columns: 1fr; } }

/* Messages inbox */
.msg-layout { display: grid; grid-template-columns: 300px 1fr; gap: 0; border: 1px solid var(--grid-line); border-radius: 6px; overflow: hidden; height: calc(100vh - 230px); min-height: 360px; background: #fff; }
.msg-list { border-right: 1px solid var(--grid-line); overflow: auto; background: var(--grid-alt); }
.msg-thread { display: grid; gap: .15rem; width: 100%; text-align: left; background: none; border: 0; border-bottom: 1px solid var(--grid-line); padding: .55rem .7rem; }
.msg-thread:hover { background: #fff; } .msg-thread.is-active { background: #fff; box-shadow: inset 3px 0 0 var(--sel-line); }
.mt-top { display: flex; justify-content: space-between; align-items: center; }
.mt-name { font-weight: 700; color: var(--ink); }
.mt-unread { background: var(--accent); color: #fff; font-style: normal; font-size: 10px; font-weight: 800; border-radius: 8px; padding: 0 .35rem; }
.mt-last { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.msg-conv { display: flex; flex-direction: column; min-width: 0; }
.conv-head { display: flex; align-items: center; gap: .6rem; padding: .6rem .85rem; border-bottom: 1px solid var(--grid-line); }
.conv-head strong { font-size: .95rem; }
.conv-head .m1-btn { margin-left: auto; padding: .2rem .6rem; }
.msg-body { flex: 1; overflow: auto; padding: .85rem; display: flex; flex-direction: column; gap: .5rem; background: var(--grid-alt); }
.bubble { max-width: 75%; padding: .5rem .7rem; border-radius: 10px; display: grid; gap: .2rem; }
.bubble.out { align-self: flex-end; background: #d6ebff; }
.bubble.in { align-self: flex-start; background: #fff; border: 1px solid var(--grid-line); }
.b-body { font-size: 13px; color: var(--ink); white-space: pre-wrap; }
.b-meta { font-size: 10px; color: var(--muted); }
.msg-composer { display: flex; gap: .5rem; padding: .6rem; border-top: 1px solid var(--grid-line); }
.msg-composer textarea { flex: 1; resize: none; height: 2.6rem; border: 1px solid var(--chrome-dark); border-radius: 5px; padding: .45rem .6rem; }
.msg-empty { padding: 2rem 1rem; text-align: center; color: var(--muted); margin: auto; }
.conn-hint { display: block; padding: .3rem .85rem .5rem; font-size: 11px; color: var(--warn); }

/* Connector badges */
.conn-badge { font-size: 11px; font-weight: 700; padding: .15rem .55rem; border-radius: 999px; }
.conn-badge.ok { background: #dcfce7; color: var(--ok); }
.conn-badge.bad { background: #fef3c7; color: var(--warn); }
.conn-ok { color: var(--ok); font-weight: 700; } .conn-bad { color: var(--warn); font-weight: 700; }

/* Payments */
.pay-pane { display: grid; gap: .8rem; }
.pay-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: .5rem; }
.pf-note { font-size: 11.5px; margin: .5rem 0 0; }

/* Link result + VIN decode */
.link-box { display: flex; gap: .4rem; }
.link-box input { flex: 1; border: 1px solid var(--chrome-dark); border-radius: 5px; padding: .5rem .6rem; font-family: var(--mono); font-size: 12px; }
.vin-input { display: flex; gap: .4rem; align-items: stretch; }
.vin-input input { flex: 1; border: 1px solid var(--chrome-dark); border-radius: 5px; padding: .45rem .6rem; }
.vin-row { display: grid; gap: .25rem; margin-bottom: .5rem; }
.decode-msg { font-size: 12px; margin: .25rem 0 .5rem; }
.decode-msg.ok { color: var(--ok); } .decode-msg.bad { color: var(--warn); }

/* =================================================================== *
 * P1 — Numeric fit: stat/KPI/metric values never overflow their card.
 * Container queries size the number to the CARD width (not viewport),
 * tabular-nums keeps digits aligned, ellipsis is the last-resort guard.
 * =================================================================== */
.kpi, .metric, .crm-kpi, .sheep-stat, .today-stat, .pay-stats .kpi {
  container-type: inline-size;
  min-width: 0;
  overflow: hidden;
}
.kpi > *, .metric > *, .crm-kpi > *, .sheep-stat > *, .today-stat > * { min-width: 0; max-width: 100%; }
.kpi strong, .metric strong, .crm-kpi strong, .sheep-stat strong, .today-stat strong {
  display: block;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.02em;
  line-height: 1.1;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.kpi strong       { font-size: clamp(1rem, 15cqi, 1.7rem); }
.metric strong    { font-size: clamp(1.05rem, 16cqi, 1.9rem); }
.sheep-stat strong{ font-size: clamp(.95rem, 15cqi, 1.5rem); }
.crm-kpi strong   { font-size: clamp(.95rem, 14cqi, 1.45rem); }
.today-stat strong{ font-size: clamp(1rem, 14cqi, 1.35rem); }
/* sub-labels / eyebrows wrap or clip instead of forcing width */
.kpi span, .metric span, .crm-kpi span, .sheep-stat span, .today-stat span,
.kpi small, .crm-kpi small { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* tighten grid minimums so cards shrink (esp. on phones) */
.kpi-grid   { grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr)); }
.metric-row { grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); }
.crm-stats  { grid-template-columns: repeat(auto-fit, minmax(7.5rem, 1fr)); }
.sheep-stats{ grid-template-columns: repeat(auto-fit, minmax(7rem, 1fr)); }
.today-stats{ grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr)); }
.pay-stats  { grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr)); }
/* money fields in boards/calendars keep aligned digits + never push layout */
.ic-amt, .mc-amt, .ab-amt, .wb-amt, .inshop-sum, .sched-total, .bar-val {
  font-variant-numeric: tabular-nums; max-width: 100%; overflow: hidden; text-overflow: ellipsis;
}
.kpi.is-click { cursor: pointer; }
.kpi.is-click:hover { border-color: var(--sel-line); }

/* WIP column chooser + row-color legend */
.rowmenu-head { padding: .35rem .5rem .25rem; font-weight: 700; font-size: 11px; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }
.rowmenu-check { display: flex; align-items: center; gap: .5rem; }
.legend-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .35rem .8rem; margin-top: .35rem; }
.legend-item { display: flex; align-items: center; gap: .5rem; font-size: 12.5px; }
.legend-sw { width: 14px; height: 14px; border-radius: 3px; border: 1px solid rgba(0,0,0,.25); flex: 0 0 auto; }
.wip-grid-wrap.hide-written  th:nth-child(3), .wip-grid-wrap.hide-written  td:nth-child(3) { display: none; }
.wip-grid-wrap.hide-license  th:nth-child(5), .wip-grid-wrap.hide-license  td:nth-child(5) { display: none; }
.wip-grid-wrap.hide-promised th:nth-child(9), .wip-grid-wrap.hide-promised td:nth-child(9) { display: none; }
.reports-toolbar { margin-bottom: .6rem; }

/* DVI builder + declined work */
.rate { display: inline-block; width: 11px; height: 11px; border-radius: 50%; }
.r-green { background: var(--ok); } .r-yellow { background: #d97706; } .r-red { background: var(--red); }
.dvi-rate.dvi-g.is-active { background: linear-gradient(#16a34a,#15803d); color: #fff; border-color: #15803d; }
.dvi-rate.dvi-y.is-active { background: linear-gradient(#e0a72e,#b45309); color: #fff; border-color: #b45309; }
.dvi-rate.dvi-r.is-active { background: linear-gradient(#dc2626,#991b1b); color: #fff; border-color: #991b1b; }
.dvi-items td { vertical-align: middle; }
.rec-actions { white-space: nowrap; }
.rec-actions .li-mini { margin-left: .2rem; }

/* =================================================================== *
 * P2 — Adaptive shell. Desktop keeps the Manager-SE chrome; phones get
 * a native iOS-style bottom tab bar + FAB + bottom sheets. One codebase.
 * =================================================================== */
.bottom-tabs, .fab, .tb-add { display: none; }

.bottom-tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 70;
  background: #fff; border-top: 1px solid var(--chrome-line);
  padding: 3px 4px calc(3px + env(safe-area-inset-bottom));
  box-shadow: 0 -2px 12px rgba(12,42,58,.12);
}
.bt-tab { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 50px; padding: 5px 2px; position: relative; background: none; border: 0; border-radius: 10px; color: var(--muted); font-size: 10.5px; font-weight: 600; }
.bt-tab:active { background: var(--grid-alt); }
.bt-tab svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.bt-tab.is-active { color: var(--title-1); }
.bt-tab .tab-badge { top: 3px; right: calc(50% - 24px); }
.fab {
  position: fixed; right: 16px; z-index: 71; place-items: center;
  bottom: calc(66px + env(safe-area-inset-bottom));
  width: 54px; height: 54px; border-radius: 50%;
  background: linear-gradient(#2a86a8,#0e4d66); color: #fff; border: 0;
  font-size: 30px; font-weight: 300; line-height: 1; box-shadow: 0 6px 18px rgba(12,42,58,.42);
}
.fab:active { transform: scale(.96); }

/* Bottom sheets (Create / More) */
.sheet-overlay { position: fixed; inset: 0; z-index: 210; background: rgba(12,22,32,.45); display: flex; align-items: flex-end; opacity: 0; transition: opacity .18s ease; }
.sheet-overlay.is-open { opacity: 1; }
.sheet { width: 100%; background: #fff; border-radius: 18px 18px 0 0; padding: 6px 12px calc(16px + env(safe-area-inset-bottom)); max-height: 82vh; overflow: auto; transform: translateY(16px); transition: transform .2s ease; }
.sheet-overlay.is-open .sheet { transform: translateY(0); }
.sheet-grab { width: 42px; height: 4px; border-radius: 2px; background: var(--chrome-dark); margin: 8px auto 12px; }
.sheet-title { font-weight: 800; font-size: 1rem; color: var(--title-2); padding: 0 6px 10px; }
.sheet-items { display: grid; gap: 3px; }
.sheet-item { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; background: none; border: 0; border-radius: 12px; padding: 14px 12px; font-size: 15px; color: var(--ink); }
.sheet-item:active { background: var(--sel); }
.sheet-ic { width: 26px; text-align: center; color: var(--title-1); font-weight: 800; }

@media (max-width: 820px) {
  /* Hide the desktop chrome that doesn't fit a phone */
  .menubar, .toolbar, .quickbar, .statusbar { display: none !important; }
  .titlebar .tb-sync, .titlebar .winhide { display: none; }
  .tb-add { display: inline-grid; place-items: center; width: 2rem; height: 1.7rem; background: rgba(255,255,255,.2); border: 1px solid rgba(255,255,255,.35); border-radius: 7px; color: #fff; font-size: 1.25rem; line-height: 1; }
  .titlebar { padding: .45rem .7rem; min-height: 2.5rem; }
  .tb-title { font-size: 1.02rem; }

  /* App becomes: top app bar + scrollable workarea (+ fixed bottom tabs) */
  .app { grid-template-rows: auto minmax(0,1fr); height: 100vh; height: 100dvh; }
  .workarea { padding: .6rem .6rem calc(74px + env(safe-area-inset-bottom)); }
  .bottom-tabs { display: flex; }
  .fab { display: grid; }

  /* Contextual sub-bar sticks under the app bar */
  .screen-titlebar { position: sticky; top: 0; z-index: 6; background: #eef1f4; margin: -.6rem -.6rem .55rem; padding: .6rem; border-bottom: 1px solid var(--chrome-line); flex-wrap: wrap; gap: .45rem; }
  .screen-titlebar h2 { font-size: 1.06rem; }
  .wip-tools { flex-wrap: wrap; gap: .4rem; }
  .wip-tools .wip-search { flex: 1 1 100%; }
  .wip-search input, .gb-tools input { min-width: 0; width: 100%; }

  /* Bigger tap targets; 16px inputs prevent iOS auto-zoom */
  .m1-btn, .qb-btn, .sched-btn, .seg-btn, .pg-btn, .stage-chip, .sheep-seg .seg-btn { padding: .55rem .85rem; font-size: 13px; }
  input, select, textarea, .picker-input { font-size: 16px !important; }
  .wip-actions { gap: .45rem; }
  .wip-actions .m1-btn { flex: 1 1 auto; }

  /* Grids scroll inside the viewport instead of forcing it wide */
  .grid-wrap, .wip-grid-wrap { max-height: none; max-width: 100%; -webkit-overflow-scrolling: touch; }
  .screen, .workarea { min-width: 0; }
  .groupby-bar, .wip-footer { flex-wrap: wrap; gap: .4rem; }
  .reports-toolbar, .crm-toolbar, .sheep-toolbar { flex-wrap: wrap; }

  /* Modals slide up as sheets */
  .modal-overlay { align-items: flex-end; padding: 0; }
  .modal-card { max-width: 100%; width: 100%; max-height: 92vh; border-radius: 16px 16px 0 0; }
  .modal-grid, .form-grid { grid-template-columns: 1fr; }
  .palette-overlay { padding-top: 8vh; }
  .palette { width: 94vw; }

  /* Calendars / boards / inbox fit the screen height */
  .sched-root { height: calc(100dvh - 13rem); min-height: 18rem; }
  .today-cols { grid-template-columns: 1fr; }
  .msg-layout { grid-template-columns: 1fr; height: calc(100dvh - 13rem); }
  .msg-layout .msg-list { max-height: 34vh; }
  .order-head { grid-template-columns: 1fr; }
  .clock-grid { grid-template-columns: 1fr; }
}

/* ===== Payroll ===== */
.payroll-pane { display: grid; gap: .8rem; }
.payroll-toolbar { align-items: center; }
.payroll-presets { display: inline-flex; gap: .3rem; flex-wrap: wrap; }
.clock-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: .5rem; }
.clock-row { display: flex; align-items: center; justify-content: space-between; gap: .6rem; background: var(--grid-alt); border: 1px solid var(--grid-line); border-radius: 8px; padding: .5rem .7rem; }
.clock-name { display: flex; flex-direction: column; gap: 2px; font-weight: 700; min-width: 0; }
.clock-name > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.clock-live { font-size: 11px; font-weight: 700; color: var(--ok); }
.clock-off { font-size: 11px; font-weight: 600; color: var(--muted); }
.rate-edit { display: inline-flex; align-items: center; gap: 2px; justify-content: flex-end; }
.pr-rate-input { width: 4.6rem; text-align: right; border: 1px solid var(--chrome-dark); border-radius: 3px; padding: .2rem .35rem; font: inherit; }

/* ===== QuickBooks (read-only) tab ===== */
.qbo-pane { display: grid; gap: .8rem; }
.qbo-head { display: flex; align-items: center; justify-content: space-between; gap: .8rem; flex-wrap: wrap; background: #fff; border: 1px solid var(--chrome-dark); border-radius: 6px; padding: .55rem .8rem; }
.qbo-badge { font-size: 11px; font-weight: 700; color: #146c2e; background: #e7f7ee; border: 1px solid #9bd3ad; border-radius: 999px; padding: .15rem .6rem; }
.qbo-toolbar { align-items: center; }
.qbo-badge-warn { color: #92400e; background: #fde68a; border-color: #f0c14b; }
/* Pending QuickBooks Pushes — the standing write-safety gate */
.qbo-push-card { margin: .6rem 0; }
.qbo-push-card.qbo-push-active { border-color: #f0c14b; background: #fffdf3; box-shadow: 0 0 0 1px #f0c14b inset; }
.qbo-push-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding: .6rem .2rem; border-top: 1px solid var(--chrome-dark); }
.qbo-push-row:first-of-type { border-top: 0; }
.qbo-push-info { flex: 1 1 320px; min-width: 0; }
.qbo-push-preview { margin-top: .35rem; font-size: 12px; color: #4a4a4a; white-space: pre-wrap; background: #fff; border: 1px solid var(--chrome-dark); border-radius: 5px; padding: .4rem .55rem; max-height: 180px; overflow: auto; }
.qbo-push-acts { display: flex; gap: .4rem; flex-wrap: wrap; align-items: flex-start; }
.m1-grid.qbo-pnl tbody tr:nth-child(even) td { background: #fff; }
.m1-grid.qbo-pnl td { padding: .32rem .6rem; }
.m1-grid.qbo-pnl tbody tr:hover td { background: #fff7d6; }
.m1-grid.qbo-pnl tr.qbo-sum td { background: #eef3f7; }

/* con7o integration strip (shared-QBO bus: con7o writes, this tab reads) */
.con7o-strip { display: flex; align-items: center; justify-content: space-between; gap: .9rem; flex-wrap: wrap; background: linear-gradient(#0c4256, #0a3547); color: #eaf4f8; border: 1px solid #082b39; border-radius: 6px; padding: .6rem .85rem; }
.con7o-msg { font-size: 12.5px; line-height: 1.4; max-width: 60ch; }
.con7o-msg strong { color: #4fd1a8; }
.con7o-acts { display: flex; gap: .4rem; flex-wrap: wrap; }
.con7o-acts .m1-btn { text-decoration: none; }

/* ===== v2 UX pass: contextual bar, msg filters, jobber contact/unread, modal ===== */
.msg-listhead { padding: 8px; border-bottom: 1px solid var(--chrome-line, #d8dce4); background: #f6f7fa; position: sticky; top: 0; z-index: 2; }
.msg-filters { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 6px; }
.msg-chip { border: 1px solid #c9cfda; background: #fff; border-radius: 999px; padding: 3px 10px; font-size: 12px; cursor: pointer; }
.msg-chip em { font-style: normal; opacity: .65; margin-left: 3px; }
.msg-chip.is-active { background: #1565c0; color: #fff; border-color: #1565c0; }
.msg-chip.is-active em { opacity: .9; }
.msg-search { width: 100%; padding: 6px 9px; border: 1px solid #c9cfda; border-radius: 7px; font-size: 13px; box-sizing: border-box; }
.jb-card-contact { font-size: 12.5px; margin-top: 2px; }
.jb-card-contact a { color: #1565c0; text-decoration: none; font-weight: 600; }
.jb-nocontact { color: #b3541e; font-style: italic; }
.jb-mini-tel { display: block; font-size: 11.5px; color: #1565c0; text-decoration: none; font-weight: 600; margin-top: 1px; }
.jb-unread { font-style: normal; background: #d92c20; color: #fff; border-radius: 999px; font-size: 10.5px; font-weight: 800; padding: 1px 6px; margin-left: 5px; vertical-align: middle; }
.sheep-brief.compact { margin-bottom: 8px; }
.sheep-brief.compact .sb-head { padding: 7px 10px; }
.ai-style-row select { padding: 4px 8px; border-radius: 6px; border: 1px solid #c9cfda; }
.ai-custom { flex: 1; min-width: 220px; }
/* Pipeline columns: never clip the stack — every card in a stage shows. */
.jb-col-body { max-height: none; overflow-y: visible; }
.jb-board { align-items: stretch; }
/* Candidate conversation thread: readable chat bubbles. */
.cand-thread { max-height: 340px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; padding: 10px; background: #eef1f6; border-radius: 10px; }
.cbubble { max-width: 78%; padding: 9px 12px; border-radius: 14px; font-size: 14px; line-height: 1.45; box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.cbubble.in { align-self: flex-start; background: #fff; border: 1px solid #dfe3ea; border-bottom-left-radius: 4px; }
.cbubble.out { align-self: flex-end; background: #1565c0; color: #fff; border-bottom-right-radius: 4px; }
.cbubble .cb-body { display: block; white-space: pre-wrap; word-break: break-word; }
.cbubble .cb-meta { display: block; font-size: 10.5px; opacity: .65; margin-top: 4px; }
.cand-contact .row-actions { flex-wrap: wrap; gap: 8px; }

/* ===== v3: vertical chrome diet + Today tabs + outreach hub ===== */
/* Kill the fat around the quick-action row and titlebars on every page. */
.quickbar { padding: .18rem .5rem; gap: .3rem; }
.qb-btn { padding: .22rem .6rem; font-size: 11.5px; }
.qb-search { padding: .2rem .55rem; }
.screen-titlebar { margin-bottom: .3rem; min-height: 0; }
.screen-titlebar h2 { font-size: 1.02rem; line-height: 1.2; }
.workarea { padding-top: .35rem; }
.today-stats, .sheep-stats, .pay-stats { margin: 0 0 .45rem; gap: .4rem; }
.today-stat, .sheep-stat, .kpi { padding: .4rem .55rem; }
.today-card { padding: .55rem .65rem; margin: 0 0 .5rem; }
.today-card h3 { margin: 0 0 .4rem; font-size: .92rem; }
.today-tabs { margin: 0 0 .4rem; }
.today-tab { font-size: 12.5px; padding: 4px 12px; }
.m1-btn-danger { background: linear-gradient(#d9534f, #b52b27); color: #fff; border-color: #8f1f1c; }
.m1-btn-danger:hover { background: #c9302c; }
.conv-head { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.conv-head .m1-btn:last-child { margin-left: auto; }
