/* Fuze Schedule — styles. Spreadsheet look for planning, clean cards for field staff. */
:root {
  --bg: #F3F4F6;
  --surface: #FFFFFF;
  --surface-2: #F7F8FA;
  --line: #D4D4D4;          /* Excel gridline grey */
  --line-2: #E6E8EC;
  --ink: #1D232B; --on-fill: #0B0F14; --on-fill-2: rgba(0,0,0,.72);
  --ink-2: #4A5563;
  --ink-3: #7A8594;
  --chrome: #2E3B4E;        /* from the workbook's dark-2 theme colour (44546A), deepened */
  --chrome-ink: #F2F5F9;
  --chrome-ink-2: #B9C4D3;
  --accent: #1F6FB2;
  --accent-ink: #FFFFFF;
  --accent-soft: #E3EEF8;
  --select: #217346;        /* Excel's selection green */
  --hdr-fill: #FFC7CE;      /* date header fill + text used in the workbook */
  --hdr-ink: #9C0006;
  --col-fill: #D9D9D9;      /* Employment / Name / Type header */
  --weekend: #DBDBDB;
  --today: #FFEB9C;
  --today-ink: #9C5700;
  --ph-hdr: #BDD7EE;
  --type-emp: #E2EFDA;
  --type-con: #D6DCE4;
  --type-arc: #E7E6E6;
  --cell: #FFFFFF;
  --fill-mix: 100%;
  --good: #2E7D32; --good-soft: #E6F4EA;
  --warn: #B26A00; --warn-soft: #FFF4DC;
  --bad: #C62828; --bad-soft: #FDECEC;
  --mgr: #8E1B3A; --mgr-soft: #FBEFF2;   /* manager-only sections */
  --shadow: 0 1px 2px rgba(20,30,45,.08), 0 4px 16px rgba(20,30,45,.08);
  --radius: 6px;
  --font: Calibri, Carlito, "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #12161C; --surface: #1A2029; --surface-2: #202834; --line: #394352; --line-2: #2A3240;
    --on-fill: #F4F7FA; --on-fill-2: rgba(255,255,255,.78); --ink: #E7ECF2; --ink-2: #B4BFCC; --ink-3: #8592A3;
    --chrome: #0E1218; --chrome-ink: #E7ECF2; --chrome-ink-2: #93A1B3;
    --accent: #5AA2E0; --accent-ink: #0B1620; --accent-soft: #1C3246; --select: #4CC38A;
    --hdr-fill: #4A2A2F; --hdr-ink: #FFB3BD; --col-fill: #2B3340; --weekend: #232A35;
    --today: #4A3F16; --today-ink: #FFD978; --ph-hdr: #22384F;
    --type-emp: #22331F; --type-con: #283140; --type-arc: #2A2E35; --cell: #1A2029; --fill-mix: 34%;
    --good: #6CCB7A; --good-soft: #1D3322; --warn: #F0B454; --warn-soft: #3A2E14; --bad: #FF8A80; --bad-soft: #3B1E1E;
    --mgr: #F59AB3; --mgr-soft: #3A1D27;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 6px 20px rgba(0,0,0,.35);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #12161C; --surface: #1A2029; --surface-2: #202834; --line: #394352; --line-2: #2A3240;
  --on-fill: #F4F7FA; --on-fill-2: rgba(255,255,255,.78); --ink: #E7ECF2; --ink-2: #B4BFCC; --ink-3: #8592A3;
  --chrome: #0E1218; --chrome-ink: #E7ECF2; --chrome-ink-2: #93A1B3;
  --accent: #5AA2E0; --accent-ink: #0B1620; --accent-soft: #1C3246; --select: #4CC38A;
  --hdr-fill: #4A2A2F; --hdr-ink: #FFB3BD; --col-fill: #2B3340; --weekend: #232A35;
  --today: #4A3F16; --today-ink: #FFD978; --ph-hdr: #22384F;
  --type-emp: #22331F; --type-con: #283140; --type-arc: #2A2E35; --cell: #1A2029; --fill-mix: 34%;
  --good: #6CCB7A; --good-soft: #1D3322; --warn: #F0B454; --warn-soft: #3A2E14; --bad: #FF8A80; --bad-soft: #3B1E1E;
  --mgr: #F59AB3; --mgr-soft: #3A1D27;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 6px 20px rgba(0,0,0,.35);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
#app { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 14px/1.4 var(--font); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
h1, h2, h3 { text-wrap: balance; margin: 0; line-height: 1.2; }
h1 { font-size: 22px; } h2 { font-size: 17px; } h3 { font-size: 14px; }
.muted { color: var(--ink-3); } .small { font-size: 12px; } .tnum { font-variant-numeric: tabular-nums; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1 1 auto; }
.stack { display: flex; flex-direction: column; gap: 12px; }
[hidden] { display: none !important; }

/* ---------- buttons & inputs ---------- */
.btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: var(--radius); padding: 6px 12px; cursor: pointer; min-height: 32px; white-space: nowrap; }
.btn:hover { border-color: var(--ink-3); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 600; }
.btn.danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 40%, var(--line)); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.sm { padding: 3px 8px; min-height: 26px; font-size: 12px; }
.btn[disabled] { opacity: .5; cursor: default; }
.btn .count { background: rgba(255,255,255,.25); padding: 0 6px; border-radius: 9px; font-size: 12px; }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=time], input[type=search], input[type=number], input[type=tel], select, textarea {
  border: 1px solid var(--line); background: var(--surface); border-radius: 4px; padding: 6px 8px; min-height: 32px; width: 100%;
}
textarea { resize: vertical; min-height: 60px; }
label.fld { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--ink-2); font-weight: 600; }
label.chk { display: inline-flex; gap: 8px; align-items: center; cursor: pointer; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.seg button { border: 0; background: transparent; padding: 5px 10px; cursor: pointer; min-height: 30px; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.pill { display: inline-flex; align-items: center; gap: 4px; border-radius: 10px; padding: 1px 8px; font-size: 11px; font-weight: 600; background: var(--surface-2); border: 1px solid var(--line-2); white-space: nowrap; }
.pill .dot { width: 7px; height: 7px; border-radius: 50%; }
.pill.draft { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.pill.bad { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.pill.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.pill.good { background: var(--good-soft); color: var(--good); border-color: transparent; }
.pill.mgr { background: var(--mgr-soft); color: var(--mgr); border-color: transparent; }

/* ---------- app shell ---------- */
.app { display: flex; flex-direction: column; height: 100%; }
.topbar { background: var(--chrome); color: var(--chrome-ink); display: flex; align-items: center; gap: 12px; padding: 0 16px; min-height: 48px; flex-wrap: wrap; position: relative; z-index: 30; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; letter-spacing: .02em; white-space: nowrap; }
.brand .mark { width: 24px; height: 24px; border-radius: 4px; background: #F2A900; color: #1D232B; display: grid; place-items: center; font-weight: 800; font-size: 14px; }
.brand small { font-weight: 400; color: var(--chrome-ink-2); }
.nav { display: flex; gap: 2px; flex-wrap: wrap; }
.nav button { background: transparent; border: 0; color: var(--chrome-ink-2); padding: 14px 10px 12px; cursor: pointer; border-bottom: 2px solid transparent; }
.nav button:hover { color: var(--chrome-ink); }
.nav button.on { color: var(--chrome-ink); border-bottom-color: #F2A900; font-weight: 600; }
.topbar .spacer { flex: 1; }
.topbar .btn { background: transparent; color: var(--chrome-ink); border-color: rgba(255,255,255,.25); }
.topbar .btn.primary { background: #F2A900; color: #1D232B; border-color: #F2A900; }
.topbar .btn.primary.none { background: transparent; color: var(--chrome-ink-2); border-color: rgba(255,255,255,.2); font-weight: 400; }
.bell { position: relative; }
.bell .badge { position: absolute; top: -4px; right: -4px; background: #E23D3D; color: #fff; border-radius: 9px; font-size: 10px; padding: 0 5px; min-width: 16px; text-align: center; font-weight: 700; }
.sync { font-size: 11px; color: var(--chrome-ink-2); white-space: nowrap; }
.sync .live { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #4CC38A; margin-right: 4px; vertical-align: 1px; }
.sync .live.off { background: #E0A43A; }
.main { flex: 1; overflow: auto; position: relative; }
.page { padding-block: 16px 40px; padding-inline: 16px; max-width: 1400px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; }
.page.wide { max-width: none; }
.card { background: var(--surface); border: 1px solid var(--line-2); border-radius: 8px; padding: 16px; }
.card h2 { margin-bottom: 10px; }
.demo-bar { background: #F2A900; color: #1D232B; font-size: 12px; padding: 4px 16px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.demo-bar button { background: rgba(0,0,0,.1); border: 0; border-radius: 4px; padding: 2px 8px; cursor: pointer; font-size: 12px; }

/* ---------- toolbar ---------- */
.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 8px 16px; background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 12; }
.toolbar .range-label { font-weight: 700; min-width: 150px; text-align: center; font-variant-numeric: tabular-nums; }
.toolbar select, .toolbar input { width: auto; min-height: 30px; padding: 3px 6px; }
.toolbar input[type=search] { width: 180px; }
.chipset { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.chipset button { border: 1px solid var(--line); background: var(--surface); border-radius: 12px; padding: 2px 10px; font-size: 12px; cursor: pointer; }
.chipset button.on { background: var(--chrome); color: var(--chrome-ink); border-color: var(--chrome); }

/* ---------- planner grid (spreadsheet) ---------- */
.grid-wrap { overflow: auto; height: calc(100% - var(--tbh, 100px)); background: var(--cell); }
table.sheet { border-collapse: separate; border-spacing: 0; font-size: 12px; font-family: var(--font); }
.sheet th, .sheet td { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 0; vertical-align: middle; background: var(--cell); }
.sheet thead th { position: sticky; top: 0; z-index: 4; background: var(--hdr-fill); color: var(--hdr-ink); font-weight: 700; height: 34px; text-align: center; font-variant-numeric: tabular-nums; white-space: nowrap; padding: 2px 4px; }
.sheet thead th.fix { background: var(--col-fill); color: var(--ink); z-index: 6; text-align: left; padding-left: 6px; }
.sheet thead th.wkend { background: color-mix(in srgb, var(--weekend) 70%, var(--hdr-fill)); }
.sheet thead th.ph { background: var(--ph-hdr); color: var(--ink); }
.sheet thead th.today { background: var(--today); color: var(--today-ink); box-shadow: inset 0 -3px 0 var(--today-ink); }
.sheet thead th .dow { display: block; font-size: 10px; font-weight: 400; opacity: .8; }
.sheet .fix { position: sticky; z-index: 3; }
.sheet .c-emp { left: 0; width: 86px; min-width: 86px; max-width: 86px; }
.sheet .c-name { left: 86px; width: 190px; min-width: 190px; max-width: 190px; }
.sheet .c-type { left: 276px; width: 76px; min-width: 76px; max-width: 76px; box-shadow: 2px 0 0 var(--line); }
.sheet td.fix { padding: 2px 6px; font-size: 12px; }
.sheet td.c-name { font-weight: 600; white-space: pre-line; }
.sheet td.c-name .sub { display: block; font-weight: 400; font-size: 10px; color: var(--ink-3); }
.sheet td.c-type.t-emp { background: color-mix(in srgb, var(--type-emp) 100%, var(--cell)); }
.sheet td.c-type.t-con { background: var(--type-con); }
.sheet td.c-type.t-arc { background: var(--type-arc); color: var(--ink-3); }
.sheet tr.grp td { background: var(--surface-2); font-weight: 700; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); height: 22px; }
.sheet tr.grp td.fix { z-index: 3; }
.sheet td.cell { width: var(--cw, 128px); min-width: var(--cw, 128px); max-width: var(--cw, 128px); height: var(--rh, 84px); position: relative; cursor: cell; text-align: center; overflow: hidden; }
.sheet.compact td.cell { height: 44px; }
.sheet td.cell.wkend { background: var(--weekend); }
.sheet td.cell.today { box-shadow: inset 2px 0 0 color-mix(in srgb, var(--today-ink) 50%, transparent), inset -2px 0 0 color-mix(in srgb, var(--today-ink) 50%, transparent); }
.sheet td.cell.sel { outline: 2px solid var(--select); outline-offset: -2px; z-index: 2; }
.sheet td.cell.drop { outline: 2px dashed var(--accent); outline-offset: -3px; background: var(--accent-soft); }
.sheet td.cell .inner { display: flex; flex-direction: column; justify-content: center; gap: 2px; height: 100%; padding: 2px 3px; overflow: hidden; }
.sheet td.cell.filled { background: color-mix(in srgb, var(--f) var(--fill-mix), var(--cell)); }
/* classic: plain text like the spreadsheet */
.cj { white-space: pre-line; line-height: 1.2; font-size: 11.5px; cursor: grab; border-radius: 2px; }
.cj:hover { background: color-mix(in srgb, var(--accent) 10%, transparent); }
.cj.cancel { text-decoration: line-through; color: var(--ink-3); }
.cj.deleted { text-decoration: line-through; opacity: .45; }
.cj + .cj { border-top: 1px dotted var(--line); padding-top: 2px; }
.cj .t { display: block; font-size: 10px; color: var(--ink-3); }
/* improved: chips */
.chip { text-align: left; background: var(--surface); border: 1px solid var(--line-2); border-left: 4px solid var(--stripe, #BFBFBF); border-radius: 4px; padding: 2px 4px 2px 5px; font-size: 11px; line-height: 1.2; cursor: grab; box-shadow: 0 1px 0 rgba(0,0,0,.03); }
.chip .l1 { display: flex; gap: 4px; align-items: center; font-size: 10px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.chip .l1 .sd { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.chip .l2 { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chip.filled { background: color-mix(in srgb, var(--f) var(--fill-mix), var(--cell)); }
.chip.cancel .l2 { text-decoration: line-through; color: var(--ink-3); }
.chip.deleted { opacity: .45; text-decoration: line-through; border-style: dashed; }
.chip.draft, .cj.draft { box-shadow: inset 0 0 0 1px var(--accent); }
.chip .ic { font-size: 9px; font-weight: 700; padding: 0 3px; border-radius: 3px; background: var(--mgr-soft); color: var(--mgr); }
/* Excel-style corner markers */
.corner-draft::before { content: ""; position: absolute; top: 0; left: 0; border-style: solid; border-width: 7px 7px 0 0; border-color: var(--accent) transparent transparent transparent; z-index: 1; }
.corner-conf::after { content: ""; position: absolute; top: 0; right: 0; border-style: solid; border-width: 0 8px 8px 0; border-color: transparent var(--bad) transparent transparent; z-index: 1; }
.corner-conf.low::after { border-right-color: var(--warn); }
.cell-edit { position: absolute; inset: 0; z-index: 5; border: 2px solid var(--select); resize: none; font: 11.5px/1.2 var(--font); padding: 3px; background: var(--surface); color: var(--ink); min-height: 0; border-radius: 0; }
.add-hint { position: absolute; right: 2px; bottom: 1px; font-size: 14px; line-height: 1; color: var(--ink-3); opacity: 0; border: 0; background: transparent; cursor: pointer; padding: 2px 4px; }
td.cell:hover .add-hint, td.cell.sel .add-hint { opacity: 1; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend i { display: inline-block; width: 16px; height: 12px; border: 1px solid var(--line); background: var(--f); }
.legend i.str { background: var(--surface); border-left: 4px solid var(--f); }

/* ---------- board / calendar ---------- */
.board { display: grid; grid-template-columns: repeat(var(--days, 7), minmax(170px, 1fr)); gap: 8px; padding: 12px 16px; overflow-x: auto; align-items: start; }
.bcol { background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 8px; min-height: 300px; display: flex; flex-direction: column; }
.bcol.drop { outline: 2px dashed var(--accent); }
.bcol h3 { padding: 8px 10px; border-bottom: 1px solid var(--line-2); display: flex; justify-content: space-between; align-items: baseline; font-size: 13px; }
.bcol h3.today { background: var(--today); color: var(--today-ink); border-radius: 8px 8px 0 0; }
.bcol h3.ph { background: var(--ph-hdr); border-radius: 8px 8px 0 0; }
.bcol .list { padding: 8px; display: flex; flex-direction: column; gap: 6px; }
.bcard { background: var(--surface); border: 1px solid var(--line-2); border-left: 4px solid var(--stripe); border-radius: 6px; padding: 6px 8px; font-size: 12px; cursor: grab; position: relative; }
.bcard .who { font-weight: 700; }
.bcard .what { white-space: pre-line; }
.bcard .meta { color: var(--ink-3); font-size: 11px; font-variant-numeric: tabular-nums; }
.bcard.draft { box-shadow: inset 0 0 0 1px var(--accent); }
.bcard.cancel .what { text-decoration: line-through; }
.month { display: grid; grid-template-columns: repeat(7, minmax(110px, 1fr)); border-top: 1px solid var(--line); border-left: 1px solid var(--line); margin: 12px 16px; background: var(--surface); overflow-x: auto; }
.month > div { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); min-height: 110px; padding: 4px; font-size: 11px; }
.month .mh { min-height: 0; background: var(--col-fill); font-weight: 700; text-align: center; padding: 4px; }
.month .d { font-weight: 700; display: flex; justify-content: space-between; }
.month .out { background: var(--surface-2); color: var(--ink-3); }
.month .wk { background: color-mix(in srgb, var(--weekend) 45%, var(--surface)); }
.month .td { background: color-mix(in srgb, var(--today) 50%, var(--surface)); }
.month .mj { border-left: 3px solid var(--stripe); padding: 1px 4px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; background: var(--surface-2); border-radius: 2px; }

/* ---------- tables ---------- */
.tbl-wrap { overflow-x: auto; border: 1px solid var(--line-2); border-radius: 8px; background: var(--surface); }
table.tbl { border-collapse: collapse; width: 100%; font-size: 13px; }
.tbl th { text-align: left; background: var(--col-fill); font-weight: 700; padding: 6px 8px; white-space: nowrap; position: sticky; top: 0; cursor: default; font-size: 12px; }
.tbl th.sort { cursor: pointer; }
.tbl td { padding: 6px 8px; border-top: 1px solid var(--line-2); vertical-align: top; }
.tbl tr.click { cursor: pointer; }
.tbl tr.click:hover td { background: var(--surface-2); }
.tbl td.pre { white-space: pre-line; }
.tbl .stripe { border-left: 4px solid var(--stripe); }
.chg { font-size: 12px; }
.chg b { font-weight: 600; }
.chg del { color: var(--bad); text-decoration: line-through; }
.chg ins { color: var(--good); text-decoration: none; }

/* ---------- drawer ---------- */
.scrim { position: fixed; inset: 0; background: rgba(10,16,24,.35); z-index: 40; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(520px, 100%); background: var(--surface); z-index: 41; box-shadow: var(--shadow); display: flex; flex-direction: column; padding-top: env(safe-area-inset-top, 0px); }
.drawer header { padding: 12px 16px; border-bottom: 1px solid var(--line-2); display: flex; gap: 8px; align-items: flex-start; }
.drawer .body { flex: 1; overflow: auto; padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.drawer footer { padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--line-2); display: flex; gap: 8px; flex-wrap: wrap; }
.f2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.f3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
@media (max-width: 520px) { .f2, .f3 { grid-template-columns: 1fr; } }
.mgr-box { border: 1px solid color-mix(in srgb, var(--mgr) 35%, var(--line)); background: var(--mgr-soft); border-radius: 8px; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.mgr-box > .hd { color: var(--mgr); font-weight: 700; font-size: 12px; display: flex; align-items: center; gap: 6px; }
.note-box { border-radius: 8px; padding: 10px 12px; font-size: 13px; }
.note-box.info { background: var(--accent-soft); }
.note-box.warn { background: var(--warn-soft); color: var(--ink); }
.note-box.bad { background: var(--bad-soft); }
.hist { font-size: 12px; display: flex; flex-direction: column; gap: 8px; }
.hist > div { border-left: 2px solid var(--line); padding-left: 8px; }

/* ---------- popover / toast ---------- */
.pop { position: absolute; right: 12px; top: 52px; width: min(420px, calc(100vw - 24px)); max-height: 70vh; overflow: auto; background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); z-index: 50; }
.pop .hd { padding: 10px 12px; border-bottom: 1px solid var(--line-2); display: flex; justify-content: space-between; align-items: center; position: sticky; top: 0; background: var(--surface); }
.nitem { padding: 10px 12px; border-bottom: 1px solid var(--line-2); display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.nitem.unread { background: var(--accent-soft); }
.nitem .t { font-weight: 600; }
.toasts { position: fixed; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); left: 50%; transform: translateX(-50%); z-index: 60; display: flex; flex-direction: column; gap: 8px; align-items: center; width: min(560px, calc(100% - 32px)); }
.toast { background: var(--chrome); color: var(--chrome-ink); padding: 10px 14px; border-radius: 8px; box-shadow: var(--shadow); display: flex; gap: 12px; align-items: center; font-size: 13px; }
.toast.bad { background: var(--bad); color: #fff; }
.toast button { background: transparent; border: 1px solid rgba(255,255,255,.4); color: inherit; border-radius: 4px; padding: 2px 8px; cursor: pointer; }
.confirm { position: fixed; inset: 0; display: grid; place-items: center; z-index: 70; background: rgba(10,16,24,.4); padding: 16px; }
.confirm .box { background: var(--surface); border-radius: 10px; padding: 18px; width: min(420px, 100%); box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 14px; }

/* ---------- dashboard ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; }
.kpi { background: var(--surface); border: 1px solid var(--line-2); border-radius: 8px; padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; cursor: default; }
.kpi.click { cursor: pointer; }
.kpi .n { font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.1; }
.kpi .l { font-size: 12px; color: var(--ink-2); }
.kpi.attn { border-color: color-mix(in srgb, var(--bad) 45%, var(--line)); }
.kpi.attn .n { color: var(--bad); }
.kpi.draft .n { color: var(--accent); }
.cols2 { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 900px) { .cols2 { grid-template-columns: 1fr; } }
.attn-item { display: flex; gap: 8px; padding: 8px 0; border-top: 1px solid var(--line-2); font-size: 13px; align-items: flex-start; }
.attn-item:first-child { border-top: 0; }
.sev { width: 8px; height: 8px; border-radius: 50%; margin-top: 5px; flex: none; }
.sev.high { background: var(--bad); } .sev.medium { background: var(--warn); } .sev.low { background: var(--ink-3); }

/* ---------- staff plan (mobile first) ---------- */
.plan { max-width: 720px; margin: 0 auto; padding-block: 12px 90px; padding-inline: 16px; display: flex; flex-direction: column; gap: 14px; }
.plan-head { display: flex; flex-direction: column; gap: 4px; }
.banner { background: var(--warn-soft); border: 1px solid color-mix(in srgb, var(--warn) 45%, var(--line)); border-radius: 10px; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.banner .it { background: var(--surface); border-radius: 8px; padding: 10px; display: flex; gap: 10px; align-items: flex-start; justify-content: space-between; }
.day { display: flex; flex-direction: column; gap: 8px; }
.day > .dh { display: flex; justify-content: space-between; align-items: baseline; font-weight: 700; font-size: 15px; padding-top: 6px; border-top: 1px solid var(--line); }
.day > .dh .muted { font-weight: 400; font-size: 12px; }
.day.today > .dh { color: var(--accent); }
.jcard { background: var(--surface); border: 1px solid var(--line-2); border-left: 5px solid var(--stripe); border-radius: 10px; padding: 12px; display: flex; flex-direction: column; gap: 6px; }
.jcard.changed { box-shadow: 0 0 0 2px var(--warn); }
.jcard.cancel { opacity: .75; }
.jcard.cancel .jn { text-decoration: line-through; }
.jcard .time { font-weight: 700; font-size: 15px; font-variant-numeric: tabular-nums; }
.jcard .jn { font-weight: 700; font-size: 16px; white-space: pre-line; }
.jcard .kv { display: grid; grid-template-columns: 92px 1fr; gap: 3px 8px; font-size: 13px; }
.jcard .kv dt { color: var(--ink-3); } .jcard .kv dd { margin: 0; white-space: pre-line; overflow-wrap: anywhere; }
.jcard .instr { background: var(--warn-soft); border-radius: 6px; padding: 8px; font-size: 13px; white-space: pre-line; }
.jcard .upd { font-size: 11px; color: var(--ink-3); }
.empty-day { color: var(--ink-3); font-size: 13px; padding: 4px 0 8px; }
.bottomnav { display: none; }
@media (max-width: 760px) {
  .nav.staff { display: none; }
  .bottomnav.show { display: flex; position: fixed; bottom: 0; left: 0; right: 0; background: var(--surface); border-top: 1px solid var(--line); z-index: 35; padding-bottom: env(safe-area-inset-bottom, 0px); }
  .bottomnav button { flex: 1; border: 0; background: transparent; padding: 10px 4px; font-size: 12px; color: var(--ink-3); position: relative; }
  .bottomnav button.on { color: var(--accent); font-weight: 700; }
  .bottomnav .badge { position: absolute; top: 4px; left: calc(50% + 10px); background: #E23D3D; color: #fff; border-radius: 9px; font-size: 10px; padding: 0 5px; }
  .topbar { padding: 0 12px; }
  .sync { display: none; }
  .brand small { display: none; }
  .toasts { bottom: calc(64px + env(safe-area-inset-bottom, 0px)); }
  .toolbar input[type=search] { width: 130px; }
}

/* ---------- login ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: var(--chrome); }
.login .box { background: var(--surface); border-radius: 12px; padding: 24px; width: min(400px, 100%); display: flex; flex-direction: column; gap: 14px; box-shadow: var(--shadow); }
.login .demo-users { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.login .demo-users button { text-align: left; border: 1px solid var(--line); background: var(--surface-2); border-radius: 6px; padding: 6px 8px; cursor: pointer; font-size: 12px; }
.login .demo-users button b { display: block; font-size: 13px; }
.err { color: var(--bad); font-size: 13px; }

/* ---------- admin ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.tabs button { border: 0; background: transparent; padding: 8px 12px; cursor: pointer; border-bottom: 2px solid transparent; color: var(--ink-2); }
.tabs button.on { border-bottom-color: var(--accent); color: var(--ink); font-weight: 700; }
.sw { width: 26px; height: 18px; border: 1px solid var(--line); border-radius: 3px; display: inline-block; vertical-align: middle; }
input[type=color] { width: 40px; height: 28px; padding: 0 2px; border: 1px solid var(--line); border-radius: 4px; background: var(--surface); }
.map-grid { display: grid; grid-template-columns: 180px 1fr; gap: 6px 12px; align-items: center; max-width: 640px; }
.steps { display: flex; gap: 6px; flex-wrap: wrap; font-size: 12px; }
.steps span { padding: 3px 10px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line-2); }
.steps span.on { background: var(--chrome); color: var(--chrome-ink); border-color: var(--chrome); }
.dropzone { border: 2px dashed var(--line); border-radius: 10px; padding: 28px; text-align: center; background: var(--surface-2); }
.dropzone.over { border-color: var(--accent); background: var(--accent-soft); }
@media (prefers-reduced-motion: no-preference) { .toast { animation: tin .18s ease-out; } @keyframes tin { from { transform: translateY(8px); opacity: 0; } } }

/* ---------- time clock ---------- */
.clock { border-radius: 12px; padding: 14px; display: flex; flex-direction: column; gap: 10px; border: 1px solid var(--line-2); background: var(--surface); }
.clock.on { border-color: color-mix(in srgb, var(--good) 50%, var(--line)); background: var(--good-soft); }
.clock .btn.big { min-height: 48px; font-size: 16px; justify-content: center; padding-inline: 22px; }
.clock.off .btn.big { width: 100%; }
.clock select, .clock input { min-height: 40px; }
.pulse { width: 12px; height: 12px; border-radius: 50%; background: var(--good); flex: none; box-shadow: 0 0 0 0 color-mix(in srgb, var(--good) 60%, transparent); }
@media (prefers-reduced-motion: no-preference) { .pulse { animation: pulse 2s infinite; } @keyframes pulse { 70% { box-shadow: 0 0 0 10px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } } }
.row > select, .row > input[type=text], .row > input[type=date], .row > input[type=search] { width: auto; }
.nav button { padding: 14px 8px 12px; }
@media (max-width: 1500px) { .topbar .sync { display: none; } .brand small { display: none; } }

/* ---------- planner: headcount, free/leave rows, density ---------- */
.sheet tr.grp td.hc { text-align: center; font-size: 11px; font-weight: 700; color: var(--ink-2); letter-spacing: 0; text-transform: none; font-variant-numeric: tabular-nums; }
.sheet tr.grp td.hc.wkend { background: color-mix(in srgb, var(--weekend) 60%, var(--surface-2)); }
.grp-btn { border: 0; background: transparent; font: inherit; font-weight: 700; color: inherit; cursor: pointer; padding: 0; text-transform: uppercase; letter-spacing: .06em; font-size: 11px; }
.sheet tr.sum td { background: var(--surface-2); vertical-align: top; }
.sheet tr.sum.free td.c-name { box-shadow: inset 3px 0 0 var(--good); }
.sheet tr.sum.away td.c-name { box-shadow: inset 3px 0 0 var(--warn); }
.sheet tr.sum:first-of-type td, .sheet tr.sum.free td { border-top: 2px solid var(--line); }
.sheet td.sumcell { padding: 4px; font-size: 11px; text-align: left; width: var(--cw); max-width: var(--cw); }
.sheet td.sumcell.wkend { background: var(--weekend); }
.sumcell .n { display: inline-block; min-width: 18px; margin-right: 4px; color: var(--ink); }
.sumcell .who { border: 1px solid var(--line-2); background: var(--surface); border-radius: 10px; padding: 0 6px; margin: 1px 2px 1px 0; font-size: 11px; cursor: pointer; line-height: 16px; }
.sumcell .who:hover { border-color: var(--accent); color: var(--accent); }
.toolbar .legend { gap: 4px 10px; }
.toolbar input[type=date] { width: 140px; }

.sheet tr.sum td { position: sticky; z-index: 3; height: 38px; max-height: 38px; }
.sheet tr.sum.free td { bottom: 39px; }
.sheet tr.sum.away td { bottom: 0; }
.sheet tr.sum td.fix { z-index: 5; }
.sheet td.sumcell { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- planner side panel ---------- */
.scrim.side { background: transparent; pointer-events: none; }
body.panel-open .drawer { width: 440px; border-left: 1px solid var(--line); }
body.panel-open .grid-wrap { margin-right: 440px; }
/* status quick-change */
.chip .l1 .sd { width: 9px; height: 9px; cursor: pointer; box-shadow: 0 0 0 2px var(--surface); }
.chip .l1 .sd:hover { transform: scale(1.4); }
.status-menu { position: fixed; z-index: 55; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); padding: 4px; display: flex; flex-direction: column; min-width: 150px; }
.status-menu button { border: 0; background: transparent; text-align: left; padding: 6px 8px; border-radius: 4px; cursor: pointer; display: flex; gap: 8px; align-items: center; font-size: 13px; }
.status-menu button:hover, .status-menu button.on { background: var(--accent-soft); }
.status-menu .dot { width: 9px; height: 9px; border-radius: 50%; }
/* ---------- wall screen ---------- */
body.wall-mode .topbar, body.wall-mode .demo-bar, body.wall-mode .bottomnav { display: none !important; }
.wall { min-height: 100%; background: var(--bg); padding-block: 16px; padding-inline: 16px; display: flex; flex-direction: column; gap: 12px; }
.wall-head { display: flex; align-items: baseline; gap: 16px; flex-wrap: wrap; }
.wall-head h1 { font-size: 28px; }
.wall-head .clock-big { font-size: 28px; font-weight: 700; font-variant-numeric: tabular-nums; margin-left: auto; }
.wall-grid { display: grid; grid-template-columns: 200px repeat(var(--days), minmax(150px, 1fr)); border-top: 1px solid var(--line); border-left: 1px solid var(--line); background: var(--surface); overflow-x: auto; }
.wall-grid > div { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 8px 10px; min-height: 64px; }
.wall-grid .wh { background: var(--chrome); color: var(--chrome-ink); font-weight: 700; font-size: 18px; min-height: 0; text-align: center; }
.wall-grid .wh.today { background: #F2A900; color: #1D232B; }
.wall-grid .wn { font-weight: 700; font-size: 17px; display: flex; flex-direction: column; justify-content: center; }
.wall-grid .wn small { font-weight: 400; font-size: 12px; color: var(--ink-3); }
.wall-grid .wg { grid-column: 1 / -1; background: var(--surface-2); font-weight: 700; text-transform: uppercase; letter-spacing: .08em; font-size: 12px; min-height: 0; color: var(--ink-2); }
.wj { border-left: 5px solid var(--stripe); padding: 2px 0 2px 8px; margin-bottom: 4px; }
.wj b { display: block; font-size: 16px; line-height: 1.2; }
.wj span { font-size: 13px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.wj.leave b { color: var(--ink-3); }
/* ---------- print: weekly plan ---------- */
@media print {
  @page { size: A3 landscape; margin: 8mm; }
  .topbar, .toolbar, .demo-bar, .bottomnav, .toasts, .add-hint, .drawer, .scrim { display: none !important; }
  html, body, #app, .app, .main { height: auto !important; overflow: visible !important; background: #fff !important; }
  .grid-wrap { height: auto !important; overflow: visible !important; margin: 0 !important; }
  .sheet .fix, .sheet thead th, .sheet tr.sum td { position: static !important; }
  .sheet { font-size: 9px; }
  .print-title { display: block !important; font: 700 14px var(--font); margin: 0 0 6px; }
}
.print-title { display: none; }

/* ---------- feedback round 2: planner ---------- */
.sheet .c-name { box-shadow: 2px 0 0 var(--line); }
.sheet td.c-emp.t-con { background: var(--type-con); }
.sheet td.c-emp.t-arc { background: var(--type-arc); color: var(--ink-3); }
.sheet td.c-name .nm { all: unset; cursor: pointer; font-weight: 600; display: inline; }
.sheet td.c-name .nm:hover, .sheet td.c-name .nm:focus-visible { text-decoration: underline; color: var(--accent); }
.sheet.readonly td.c-name .nm { cursor: pointer; }
.sheet td.c-name[draggable="true"] { cursor: grab; }
.sheet td.c-name.drop-row { box-shadow: inset 0 3px 0 var(--accent), 2px 0 0 var(--line); }
.sheet tr.me td.fix { background: color-mix(in srgb, var(--accent) 10%, var(--surface)); }
.sheet tr.me td.cell:not(.filled):not(.wkend) { background-color: color-mix(in srgb, var(--accent) 4%, var(--cell)); }
.tm { font-weight: 700; color: var(--ink); font-size: 10px; }
.tm.night { color: #fff; background: #2C3E66; border-radius: 3px; padding: 0 4px; }
.tm.early { color: #7A4B00; background: #FFE8B3; border-radius: 3px; padding: 0 4px; }
.cj .tm { margin-right: 2px; }
.copybar { display: flex; gap: 10px; align-items: center; padding: 8px 12px; background: var(--accent-soft); border-bottom: 2px solid var(--accent); font-size: 13px; }
.copybar .ic { font-size: 18px; }
.grid-wrap.pasting td.cell { cursor: copy; }
.grid-wrap.pasting td.cell:hover { outline: 2px dashed var(--accent); outline-offset: -2px; }
.sheet.tiny { font-size: 10px; }
.sheet.tiny thead th { padding: 2px 1px; font-size: 10px; }
.sheet.tiny thead th .mon { display: block; font-weight: 700; color: var(--accent); }
.sheet.tiny th.mstart, .sheet.tiny td.mstart { border-left: 2px solid var(--ink-3); }
.sheet.tiny .chip { padding: 1px 2px 1px 3px; border-left-width: 3px; font-size: 9px; }
.sheet.tiny .chip .l2 { font-weight: 500; }
.sheet.tiny .cj { font-size: 9px; line-height: 1.1; }
.status-menu hr { border: 0; border-top: 1px solid var(--line-2); margin: 3px 0; }
.status-menu { max-height: 80vh; overflow: auto; }
/* people picker */
.pop.peoplepop { position: fixed; right: auto; width: 320px; max-height: 70vh; display: flex; flex-direction: column; overflow: hidden; padding: 0; z-index: 60; }
.peoplepop .hd { flex-direction: column; align-items: stretch; gap: 6px; }
.peoplepop .quick { display: flex; flex-wrap: wrap; gap: 4px; padding: 8px 12px; border-bottom: 1px solid var(--line-2); }
.peoplepop .plist { overflow: auto; padding: 6px 12px; flex: 1; display: flex; flex-direction: column; gap: 2px; }
.peoplepop .pg { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-3); }
.peoplepop .ft { display: flex; gap: 6px; align-items: center; padding: 8px 12px; border-top: 1px solid var(--line-2); }
/* publish dialog */
.confirm .box.wide { width: min(720px, 100%); max-height: 90vh; }
.pubdlg { display: flex; flex-direction: column; gap: 10px; }
.pubdlg .publist { max-height: 42vh; overflow: auto; border: 1px solid var(--line-2); border-radius: 6px; padding: 6px 10px; }
.pubdlg .pgrp { padding: 6px 0; border-bottom: 1px solid var(--line-2); }
.pubdlg .pgrp:last-child { border-bottom: 0; }
.pubdlg .pit { padding-left: 22px; font-size: 13px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.note-msg { display: block; background: var(--accent-soft); border-radius: 4px; padding: 4px 6px; margin: 4px 0; }
@media print { .copybar { display: none; } }
.bcard.mine { box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--accent) 40%, transparent); }
.toolbar .opts { display: contents; }
.phone-only { display: none; }
@media (max-width: 700px) {
  .phone-only { display: inline-flex; }
  .toolbar .opts { display: none; }
  .toolbar.open .opts { display: contents; }
  .sheet .c-emp { display: none; }
  .sheet .c-name { left: 0; width: 112px; min-width: 112px; max-width: 112px; }
  .sheet td.c-name .sub { display: none; }
  .sheet td.c-name .pill { font-size: 9px; padding: 0 4px; }
  .sheet tr.grp td.c-name .muted { display: none; }
}
@media (max-width: 700px) { .tbl.jobs-list td, .tbl.jobs-list th { white-space: nowrap; } .tbl.jobs-list td.pre { white-space: nowrap; max-width: 220px; overflow: hidden; text-overflow: ellipsis; } }
.tbl input[data-pf="name"] { min-width: 150px; }
.tbl select[data-pf] { min-width: 112px; }
.tbl input[data-pf] { min-width: 96px; }
.tbl input.saved, .tbl select.saved { box-shadow: 0 0 0 2px var(--good); transition: box-shadow .2s; }
fieldset.bare { border: 0; padding: 0; margin: 0; min-width: 0; }
.type-prev { display: inline-flex; gap: 6px; align-items: center; }
.type-prev .cellp { width: 22px; height: 18px; border: 1px solid var(--line); border-radius: 3px; display: inline-block; }
.type-prev .chipp { border: 1px solid var(--line-2); border-left: 4px solid var(--stripe); border-radius: 4px; padding: 1px 6px; font-size: 11px; font-weight: 600; white-space: nowrap; }
/* the logged-in person stands out in every team view */
.pill.you { background: var(--accent); color: #fff; font-weight: 700; border-color: var(--accent); }
.sheet tr.me td.fix { background: color-mix(in srgb, var(--accent) 20%, var(--surface)) !important; }
.sheet tr.me td.c-name { box-shadow: inset 4px 0 0 var(--accent), 2px 0 0 var(--line); }
.sheet tr.me td.c-name .nm { color: var(--accent); }
.sheet tr.me td.cell:not(.filled):not(.wkend) { background-color: color-mix(in srgb, var(--accent) 9%, var(--cell)); border-top: 1px solid color-mix(in srgb, var(--accent) 45%, transparent); border-bottom: 1px solid color-mix(in srgb, var(--accent) 45%, transparent); }
.bcard.mine { background: color-mix(in srgb, var(--accent) 12%, var(--surface)); box-shadow: inset 0 0 0 2px var(--accent); }
.tbl tr.me td { background: color-mix(in srgb, var(--accent) 10%, var(--surface)); font-weight: 600; }
.demo-bar button.hot { background: var(--accent); color: #fff; font-weight: 700; }
/* text on filled (coloured) cells: darker and heavier so it reads on any fill */
.sheet td.cell.filled, .sheet td.cell.filled .cj { color: var(--on-fill); font-weight: 600; }
.sheet td.cell.filled .cj .t { color: var(--on-fill-2); }
.chip.filled .l2 { color: var(--on-fill); }
.chip.filled .l1 { color: var(--on-fill-2); font-weight: 600; }
.wj.leave, .mj { color: var(--ink); }
