/* Paton Hawksley Hub: app shell on top of hub.css (the design system). Colours ONLY through hub.css tokens. */
@font-face { font-family: "Figtree"; src: url(/fonts/figtree.woff2) format("woff2"); font-weight: 300 900; font-display: swap; }
@font-face { font-family: "Outfit"; src: url(/fonts/outfit.woff2) format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Carlito"; src: url(/fonts/carlito-regular.ttf) format("truetype"); font-weight: 400; font-display: block; }
@font-face { font-family: "Carlito"; src: url(/fonts/carlito-bold.ttf) format("truetype"); font-weight: 700; font-display: block; }
@font-face { font-family: "Sora"; src: url(/fonts/sora.woff2) format("woff2"); font-weight: 100 800; font-display: swap; }

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { background: var(--bg); color: var(--ink); font-family: var(--font); -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
button { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; }
a { color: var(--accent); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.stack { display: flex; flex-direction: column; }
.g4 { gap: 4px; } .g8 { gap: 8px; } .g12 { gap: 12px; } .g16 { gap: 16px; } .g20 { gap: 20px; } .g24 { gap: 24px; }
.rowx { display: flex; align-items: center; gap: 10px; } .between { justify-content: space-between; } .wrap { flex-wrap: wrap; } .grow { flex: 1; min-width: 0; }
.right { text-align: right; } .muted { color: var(--ink-2); } .faint { color: var(--ink-3); }
.ellip { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- PC shell ---------- */
.shell { display: flex; min-height: 100vh; }
.shell > .side { position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.shell > .main { flex: 1; min-width: 0; padding: 28px 36px 48px; display: flex; flex-direction: column; gap: 20px; }
.main.page-light { background-color: transparent; background-repeat: no-repeat; background-size: 100% 420px; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) 420px; gap: 24px; align-items: start; }
.split > .panel { position: sticky; top: 24px; max-height: calc(100vh - 48px); overflow-y: auto; }
.panel { padding: 22px; display: flex; flex-direction: column; gap: 16px; }
.head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.side .nav-item { cursor: pointer; border: 0; background: none; width: 100%; text-align: left; }
.side .nav-item.on { background: var(--accent-soft); }
.edlist { background: none; } .edlist.on { background: var(--accent-soft); } .edlist:hover:not(.on) { background: var(--surface-2); }
.side .nav-item:hover:not(.on) { background: var(--surface-2); }
.side-me { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 8px; border: 0; background: none; border-radius: var(--r-ctl); cursor: pointer; text-align: left; }
.side-me:hover { background: var(--surface-2); }

/* ---------- phone shell ---------- */
.topbar { position: sticky; top: 0; z-index: 15; display: flex; align-items: center; gap: 10px; padding: calc(8px + env(safe-area-inset-top)) 12px 8px 16px; background: var(--bg); border-bottom: 1px solid var(--line); }
.topbar .brand { width: 30px; height: 30px; border-radius: 8px; font-size: 12px; }
.gear { flex: none; width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; border: 0; border-radius: 22px; background: none; color: var(--ink-2); cursor: pointer; }
.side .gear { width: 36px; height: 36px; border-radius: 18px; }
.side .brand + .stack .t-sm { white-space: nowrap; }
.gear:hover { background: var(--surface-2); color: var(--ink); }
.gear.on { background: var(--accent-soft); color: var(--accent); }
.gear:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.phone-main { padding: 20px 16px calc(96px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 20px; max-width: 640px; margin: 0 auto; }
.phone-main.page-light { background-repeat: no-repeat; background-size: 100% 360px; }
.tabs.fixed { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; padding-bottom: calc(10px + env(safe-area-inset-bottom)); }
.tab { border: 0; background: none; cursor: pointer; }
.btn:disabled { opacity: .45; cursor: default; }
.seg > * { white-space: nowrap; padding: 0 12px; }
.panel { position: relative; }
.panel-x { position: absolute; top: 12px; right: 12px; width: 36px; height: 36px; border: 0; border-radius: 18px; background: none; color: var(--ink-2); cursor: pointer; display: flex; align-items: center; justify-content: center; z-index: 1; }
.panel > * { flex-shrink: 0; }
.panel-x + * { padding-right: 40px; }
.panel-x:hover { background: var(--surface-2); color: var(--ink); }
@media (max-width: 899px) { .seg { width: 100%; max-width: none !important; grid-auto-columns: minmax(max-content, 1fr); } .seg > * { padding: 0 4px; font-size: 14px; } }
.back { align-self: flex-start; padding: 0; }

/* ---------- pieces ---------- */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.stat { padding: 16px 18px; display: flex; flex-direction: column; gap: 2px; cursor: pointer; border: var(--card-border); text-align: left; background: var(--surface); border-radius: var(--r-card); }
.stat:hover { border-color: var(--line-2); }
.stat .n { font-size: 28px; font-weight: 700; line-height: 34px; font-variant-numeric: tabular-nums; }
.figs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.fig { background: var(--surface-2); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; }
.fig .n { font-size: 21px; font-weight: 700; font-variant-numeric: tabular-nums; }
.stepper { display: flex; align-items: center; gap: 12px; }
.stepper .btn { width: 52px; height: 52px; padding: 0; font-size: 22px; }
.stepper input { width: 96px; height: 52px; text-align: center; font-size: 24px; font-weight: 700; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips .btn { height: 36px; padding: 0 12px; font-size: 14px; }
.empty { padding: 28px 20px; text-align: center; color: var(--ink-2); display: flex; flex-direction: column; gap: 8px; align-items: center; }
.banner { padding: 14px 16px; display: flex; align-items: center; gap: 14px; }
.hist { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.hist:last-child { border-bottom: 0; }
.qtyline { display: grid; grid-template-columns: minmax(0, 1fr) 88px 32px; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.qtyline input { height: 44px; text-align: center; font-weight: 700; font-size: 17px; }
.x { width: 32px; height: 32px; border-radius: 16px; border: 0; background: none; color: var(--ink-3); cursor: pointer; font-size: 20px; }
.x:hover { background: var(--surface-2); color: var(--ink); }
.suggest { position: relative; }
.suggest .list { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 30; background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-card); overflow: hidden; box-shadow: 0 12px 32px rgba(0,0,0,.14); max-height: 320px; overflow-y: auto; }
.suggest .list button { display: flex; width: 100%; gap: 10px; align-items: baseline; padding: 12px 14px; border: 0; background: none; text-align: left; cursor: pointer; border-bottom: 1px solid var(--line); }
.suggest .list button:last-child { border-bottom: 0; }
.suggest .list button:hover, .suggest .list button.on { background: var(--accent-soft); }
.field-label { display: flex; flex-direction: column; gap: 6px; }
.field-label > span { font-size: 13px; font-weight: 600; color: var(--ink-2); }
textarea.field { height: auto; min-height: 88px; padding: 12px 16px; resize: vertical; }
select.field { appearance: auto; }
.check { display: flex; align-items: center; gap: 10px; min-height: 44px; cursor: pointer; }
.check input { width: 22px; height: 22px; accent-color: var(--accent); }
.sheetgrid { display: grid; gap: 4px; padding: 8px; background: var(--surface); border: 1px solid var(--line-2); border-radius: 8px; align-self: flex-start; }
.sheetgrid button { height: 14px; border: 0; border-radius: 2px; padding: 0; cursor: pointer; background: var(--surface-2); }
.sheetgrid button.use { background: var(--accent); }
.labelprev { width: 132px; height: 74px; flex: none; border: 1px solid var(--line-2); border-radius: 6px; background: #FFFFFF; color: #111111; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; text-align: center; padding: 4px; font-family: Arial, Helvetica, sans-serif; }
.labelprev .b { font-size: 7px; font-weight: 700; letter-spacing: .05em; }
.labelprev .t { font-size: 12px; font-weight: 700; line-height: 1.1; }
.labelprev .s { font-size: 9px; }
.tag-row { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.link-danger { color: var(--red); }
.loading { padding: 60px 20px; text-align: center; color: var(--ink-3); }

/* ---------- sheet (phone: from the bottom; PC: centred) ---------- */
.sheet-wrap { position: fixed; inset: 0; background: rgba(12, 14, 24, .42); z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
.sheet { background: var(--bg); color: var(--ink); width: 100%; max-width: 560px; max-height: 92vh; overflow-y: auto; border-radius: 24px 24px 0 0; padding: 12px 20px calc(24px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 16px; }
.sheet .grip { width: 40px; height: 5px; border-radius: 3px; background: var(--line-2); align-self: center; }
@media (min-width: 900px) {
  .sheet-wrap { align-items: center; }
  .sheet { border-radius: 24px; padding: 24px 28px 28px; }
  .sheet .grip { display: none; }
}

/* ---------- toast ---------- */
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(96px + env(safe-area-inset-bottom)); z-index: 60; background: var(--ink); color: var(--bg); border-radius: 14px; padding: 12px 16px; display: flex; gap: 16px; align-items: center; font-size: 15px; font-weight: 500; box-shadow: 0 12px 32px rgba(0,0,0,.25); max-width: calc(100% - 32px); }
.toast button { background: none; border: 0; color: inherit; font-weight: 700; text-decoration: underline; cursor: pointer; }
@media (min-width: 900px) { .toast { bottom: 28px; } }

/* ---------- sign in ---------- */
.login { max-width: 400px; margin: 0 auto; padding: 72px 20px 40px; display: flex; flex-direction: column; gap: 18px; }
.login .brand-row { display: flex; align-items: center; gap: 14px; margin-bottom: 8px; }
.login .brand { width: 48px; height: 48px; border-radius: 14px; font-size: 18px; }
.note { padding: 12px 14px; border-radius: 12px; font-size: 15px; }
.note.red { background: var(--red-soft); color: var(--red); }
.note.info { background: var(--accent-soft); color: var(--accent); }

@media (prefers-reduced-motion: no-preference) {
  .sheet { animation: up .18s ease-out; }
  @keyframes up { from { transform: translateY(24px); opacity: .6; } to { transform: none; opacity: 1; } }
}
@media (max-width: 1180px) { .split { grid-template-columns: minmax(0, 1fr) 380px; } .shell > .main { padding: 24px 24px 40px; } }
@media print { .side, .tabs { display: none; } }
.field:disabled { opacity: .45; cursor: not-allowed; }
.shell > .side { width: 252px; }
.seg > button:not(.on) { background: transparent; }

/* ---------------------------------------------------------------- tablets (the main device: Tom 30 Nov "It's basically going to be used on tablets ... We need to be clever")
   NOTHING IS EVER HIDDEN. On the Lenovo (1280 wide) every table fits with all its columns. When a table is narrower than it needs
   (flowTables() in 01-core.js measures it), each row re-flows onto two lines: line 1 = the product/customer (+ its status on the right),
   line 2 = every other value, each with its own label (e.g. "Where B4 · Shelf 80 · Promised 35 · Free 45"). Blank values are left out.
   Below 1280 the details panel slides over the list from the right; Today is one column below 1400. */
.thead > *, .trow > * { min-width: 0; }
.table.flow > .thead { display: none; }
.table.flow > .trow { display: flex !important; flex-wrap: wrap; align-items: center; column-gap: 14px; row-gap: 6px; padding-top: 12px; padding-bottom: 12px; }
.table.flow > .trow > .f-lead { order: 0; flex: 0 0 auto; }
.table.flow > .trow > .f-title { order: 1; flex: 1 1 0; min-width: 0; }
.table.flow > .trow > .f-right { order: 2; flex: 0 0 auto; margin-left: auto; justify-self: auto !important; }
.table.flow > .trow::after { content: ''; order: 2; flex-basis: 100%; height: 0; }
.table.flow > .trow > .f-extra { order: 3; flex: 0 0 auto; display: inline-flex; align-items: baseline; gap: 6px; font-size: 14px; }
.table.flow > .trow > .f-extra::before { content: attr(data-l); color: var(--ink-2); font-weight: 500; font-size: 12px; }
.table.flow > .trow > .f-extra.f-empty { display: none; }
.table.flow > .trow > .f-extra > .stack { flex-direction: row; gap: 6px; }
@media (min-width: 900px) and (max-width: 1399px) { .split:not(.detail) { grid-template-columns: minmax(0, 1fr); } }
@media (min-width: 900px) and (max-width: 1279px) {
  .shell > .side { width: 216px; padding: 20px 10px; }
  .side .brand + .stack .t-sm { font-size: 13px; }
  .side .gear { width: 32px; height: 32px; }
  .shell > .main { padding: 24px 24px 40px; }
  .split.detail { grid-template-columns: minmax(0, 1fr); }
  .split.detail > .panel { position: fixed; top: 0; right: 0; bottom: 0; width: min(460px, 92vw); max-height: none; border-radius: 0; z-index: 40;
    box-shadow: -12px 0 40px rgba(15, 18, 40, .18); padding-top: 56px; animation: drawer-in .18s ease-out; }
  .split.detail > .panel > .panel-x { top: 14px; right: 14px; }
}
@keyframes drawer-in { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .split.detail > .panel { animation: none; } }
@media (min-width: 680px) and (max-width: 899px) { .phone-main { max-width: none; padding-left: 32px; padding-right: 32px; } }

/* ---------------------------------------------------------------- Today's plan (design/TODAYS-PLAN-v1-2026-11-30.md) */
.plan .job { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 16px 18px; border-bottom: 1px solid var(--line); background: var(--surface); }
.plan .job:last-child { border-bottom: 0; }
.plan .tick { width: 30px; height: 30px; border-radius: 15px; border: 2px solid var(--line-2); display: flex; align-items: center; justify-content: center; }
.plan .job.done .tick { background: var(--green); border-color: transparent; color: var(--surface); }
.plan .job.done .what { color: var(--ink-3); text-decoration: line-through; text-decoration-thickness: 1px; }
.plan .job.now { background: var(--accent-soft); }
.plan .hint { margin-top: 4px; font-size: 13px; color: var(--ink-2); }
.ok-line { display: flex; gap: 10px; align-items: center; font-weight: 600; }
.ok-dot { flex: none; width: 24px; height: 24px; border-radius: 12px; background: var(--green-soft); color: var(--green); display: flex; align-items: center; justify-content: center; }
.week { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.week .day { background: var(--surface-2); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.week .bar { height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; } .week .bar > i { display: block; height: 100%; background: var(--accent); border-radius: 3px; }
.risk { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
@media (max-width: 899px) {
  .plan .job { grid-template-columns: 32px minmax(0, 1fr); padding: 14px; }
  .plan .job > .btn, .plan .job > .tag { grid-column: 2; justify-self: start; }
  .risk { grid-template-columns: minmax(0, 1fr); }
  .week { gap: 6px; }
  .week .day { padding: 8px 8px; }
}

/* ---------------------------------------------------------------- the PHEL logo (from www.patonhawksley.com; design/brand) */
.logo { display: block; height: auto; }
.side-brand { padding: 0 0 0 6px; align-items: center; }
.side-brand .logo { width: 128px; }
.topbar .logo { width: 72px; }
.login-logo { flex-direction: column; align-items: flex-start; gap: 10px; }
.login-logo .logo { width: 200px; }
@media (min-width: 900px) and (max-width: 1279px) { .side-brand .logo { width: 112px; } }
.login-logo { align-items: center; }

/* ---------------------------------------------------------------- detail panels: one tidy pattern (Tom 30 Nov "not as tidy as it could be") */
.min0 { min-width: 0; }
.nowrap { white-space: nowrap; }
.amber { color: var(--amber); } .green { color: var(--green); }
.facts { display: flex; flex-wrap: wrap; gap: 6px 20px; margin-top: 6px; }
.fact { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.op-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: start; }
.op-head .tag-row { flex-direction: column; align-items: flex-end; gap: 6px; }
.op-lines { display: flex; flex-direction: column; border-top: 1px solid var(--line); }
.op-line { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 12px; row-gap: 8px; padding: 14px 0; border-bottom: 1px solid var(--line); align-items: start; }
.op-qty { font-size: 20px; font-weight: 700; line-height: 1.2; }
.op-sub { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 32px; }
.btn.btn-sm { height: 34px; padding: 0 14px; font-size: 14px; }
.op-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.op-actions > .btn { width: 100%; padding: 0 10px; white-space: normal; line-height: 1.15; min-height: 44px; }
.op-actions > .link-danger { color: var(--red); }
.op-actions > .wide { grid-column: 1 / -1; }
.op-history summary { cursor: pointer; padding: 6px 0; }
.btn.plus { width: 40px; height: 40px; padding: 0; border-radius: 20px; font-size: 22px; line-height: 1; font-weight: 600; flex: none; }

/* ---------------------------------------------------------------- Time off */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal-h { text-align: center; font-size: 12px; font-weight: 600; color: var(--ink-3); padding: 2px 0; }
.cal-d { height: 44px; border: 0; border-radius: 12px; background: none; color: var(--ink); font: inherit; font-size: 15px; cursor: pointer; }
.cal-d:hover:not(:disabled) { background: var(--surface-2); }
.cal-d.rest { color: var(--ink-3); }
.cal-d.now { box-shadow: inset 0 0 0 2px var(--line-2); }
.cal-d.sel { background: var(--accent); color: var(--accent-ink); font-weight: 700; }
.cal-d.bank { background: var(--amber-soft); color: var(--amber); font-weight: 600; }
.cal-d.booked { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.cal-d:disabled { cursor: default; }
.cal-d:disabled:not(.bank):not(.booked) { color: var(--ink-3); opacity: .5; }
.month { display: grid; gap: 3px; align-items: center; }
.m-h { font-size: 11px; color: var(--ink-3); text-align: center; }
.m-c { height: 24px; border-radius: 5px; background: var(--surface-2); }
.m-c.off { background: var(--accent); } .m-c.two { background: var(--red); } .m-c.bank { background: var(--amber-soft); } .m-c.rest { background: transparent; }
.key { display: inline-block; width: 12px; height: 12px; border-radius: 3px; } .key.off { background: var(--accent); } .key.bank { background: var(--amber-soft); } .key.two { background: var(--red); }
.alert { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.alert:last-child { border-bottom: 0; }
@media (max-width: 899px) { .alert { grid-template-columns: minmax(0, 1fr); } .month { overflow-x: auto; } }

.to-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; align-items: start; }
.to-grid > * { min-width: 0; }
@media (min-width: 1000px) { .to-grid { grid-template-columns: minmax(0, 520px) minmax(0, 1fr); } }
@media (max-width: 899px) { .split { grid-template-columns: minmax(0, 1fr); } }

/* ---------------------------------------------------------------- Requests */
.chips2 { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { height: 42px; padding: 0 16px; border-radius: 21px; border: 1px solid var(--line-2); background: var(--surface); font: inherit; font-weight: 600; font-size: 15px; color: var(--ink); cursor: pointer; }
.chip:hover { background: var(--surface-2); } .chip.on { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.chip.lab { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.sug { border: 1px solid var(--line-2); border-radius: 14px; overflow: hidden; background: var(--surface); }
.sug:empty { display: none; }
.sug-row { width: 100%; display: flex; align-items: center; gap: 10px; padding: 12px 14px; border: 0; border-bottom: 1px solid var(--line); background: none; font: inherit; color: var(--ink); text-align: left; cursor: pointer; }
.sug-row:last-child { border-bottom: 0; } .sug-row:hover { background: var(--surface-2); } .sug-row.add { color: var(--accent); font-weight: 700; }
.rq-pick { display: flex; flex-direction: column; gap: 12px; align-items: center; padding-top: 12px; border-top: 1px solid var(--line); }
.rq-pick .stepper { display: flex; align-items: center; gap: 14px; }
.rq-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; align-items: start; }
@media (min-width: 1000px) { .rq-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.inbox { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.chip.asked { background: var(--green-soft); color: var(--green); border-color: transparent; }
.chip:disabled { cursor: default; }
.inbox:last-child { border-bottom: 0; }
