/* ============ RESET & TOKENS ============ */
*,*::before,*::after{box-sizing:border-box;}
html,body{margin:0;padding:0;}
:root{
  --nav-bg:#0f1e33;
  --nav-bg-hover:#16293f;
  --nav-bg-active:#1c3a5e;
  --nav-text:#aebbcf;
  --nav-text-active:#ffffff;
  --nav-border:#1c2d45;
  --nav-accent:#4b8bf5;

  --bg:#eff2f6;
  --surface:#ffffff;
  --surface-alt:#f7f8fa;
  --border:#e3e7ee;
  --ink:#101828;
  --ink-soft:#475467;
  --ink-faint:#98a2b3;

  --accent:#2f6fed;
  --accent-hover:#2558c4;
  --accent-soft:#eaf1ff;
  --accent-ink:#1a3f91;

  --ok:#16a34a; --ok-bg:#dcfce7; --ok-text:#166534;
  --warn:#d97706; --warn-bg:#fef3c7; --warn-text:#92400e;
  --critical:#dc2626; --critical-bg:#fee2e2; --critical-text:#991b1b;
  --info:#2563eb; --info-bg:#dbeafe; --info-text:#1e40af;
  --neutral-bg:#eef1f5; --neutral-text:#475467;

  --stage-drain:#f2a19a;       --stage-drain-text:#7a2a20;
  --stage-stacks:#a9c7ea;      --stage-stacks-text:#1e3a5f;
  --stage-roughin:#f0c987;     --stage-roughin-text:#6b4a10;
  --stage-downpipes:#a8d8b0;   --stage-downpipes-text:#1f5c2c;
  --stage-fitoff:#c8b6e2;      --stage-fitoff-text:#442a6b;
  --stage-inspections:#f4a6ab; --stage-inspections-text:#7a1f28;
  --stage-handover:#d8c3a5;    --stage-handover-text:#5c4423;

  --shadow-sm:0 1px 2px rgba(16,24,40,.06);
  --shadow-md:0 2px 8px rgba(16,24,40,.08);
  --radius:10px;
  --radius-sm:6px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark){
  :root:not([data-theme="light"]){
    --bg:#0a0f1a; --surface:#111827; --surface-alt:#0d1421; --border:#232c3d;
    --ink:#e6eaf2; --ink-soft:#a3aec2; --ink-faint:#69748a;
    --accent:#5b8bf0; --accent-hover:#7ba0f3; --accent-soft:#152a4d; --accent-ink:#bcd0fb;
    --ok:#3fbf72; --ok-bg:#0f2b1c; --ok-text:#7de3a5;
    --warn:#e2a13a; --warn-bg:#332406; --warn-text:#f0c479;
    --critical:#f0685f; --critical-bg:#3a1414; --critical-text:#f6a19b;
    --info:#5b8bf0; --info-bg:#132445; --info-text:#a9c3f7;
    --neutral-bg:#1b2333; --neutral-text:#a3aec2;
    --stage-drain:#5c332f;       --stage-drain-text:#f0b6b0;
    --stage-stacks:#28425f;      --stage-stacks-text:#bcd8f5;
    --stage-roughin:#5a4419;     --stage-roughin-text:#f3d191;
    --stage-downpipes:#264a30;   --stage-downpipes-text:#b6e6c0;
    --stage-fitoff:#3f2f5a;      --stage-fitoff-text:#dcc9f5;
    --stage-inspections:#5a2a2e; --stage-inspections-text:#f3b6ba;
    --stage-handover:#4a3c28;    --stage-handover-text:#e5cfa6;
    color-scheme: dark;
  }
}
:root[data-theme="dark"]{
  --bg:#0a0f1a; --surface:#111827; --surface-alt:#0d1421; --border:#232c3d;
  --ink:#e6eaf2; --ink-soft:#a3aec2; --ink-faint:#69748a;
  --accent:#5b8bf0; --accent-hover:#7ba0f3; --accent-soft:#152a4d; --accent-ink:#bcd0fb;
  --ok:#3fbf72; --ok-bg:#0f2b1c; --ok-text:#7de3a5;
  --warn:#e2a13a; --warn-bg:#332406; --warn-text:#f0c479;
  --critical:#f0685f; --critical-bg:#3a1414; --critical-text:#f6a19b;
  --info:#5b8bf0; --info-bg:#132445; --info-text:#a9c3f7;
  --neutral-bg:#1b2333; --neutral-text:#a3aec2;
  --stage-drain:#5c332f;       --stage-drain-text:#f0b6b0;
  --stage-stacks:#28425f;      --stage-stacks-text:#bcd8f5;
  --stage-roughin:#5a4419;     --stage-roughin-text:#f3d191;
  --stage-downpipes:#264a30;   --stage-downpipes-text:#b6e6c0;
  --stage-fitoff:#3f2f5a;      --stage-fitoff-text:#dcc9f5;
  --stage-inspections:#5a2a2e; --stage-inspections-text:#f3b6ba;
  --stage-handover:#4a3c28;    --stage-handover-text:#e5cfa6;
  color-scheme: dark;
}
body{
  background:var(--bg); color:var(--ink);
  font-family:"Inter",-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  font-size:14px; line-height:1.45; -webkit-font-smoothing:antialiased;
}
h1,h2,h3,h4{margin:0; text-wrap:balance; font-weight:700; letter-spacing:-.01em;}
p{margin:0;}
a{color:var(--accent); text-decoration:none;}
button{font-family:inherit;}
input,select,textarea{font-family:inherit; font-size:13px;}
.tabular{font-variant-numeric:tabular-nums;}
::selection{background:var(--accent-soft);}
@media (prefers-reduced-motion: reduce){ *{animation-duration:.001ms !important; transition-duration:.001ms !important;} }

/* ============ LAYOUT SHELL ============ */
#app{min-height:100vh;}
.shell{display:flex; min-height:100vh;}
.sidebar{
  width:232px; flex:0 0 232px; background:var(--nav-bg); color:var(--nav-text);
  display:flex; flex-direction:column; position:sticky; top:0; height:100vh; overflow-y:auto;
  border-right:1px solid var(--nav-border);
}
.sidebar-brand{display:flex; align-items:center; gap:12px; padding:22px 18px 16px;}
.sidebar-brand svg, .sidebar-brand img{flex:0 0 auto;}
.brand-word{line-height:1.05;}
.brand-word b{display:block; color:#fff; font-size:20px; font-weight:800; letter-spacing:.02em;}
.brand-word span{display:block; color:#7f93b3; font-size:10px; font-weight:600; letter-spacing:.18em;}
.nav-scroll{flex:1; padding:6px 10px 10px;}
.nav-group{margin-top:14px;}
.nav-group-label{font-size:10px; font-weight:700; letter-spacing:.1em; color:#5c7093; padding:0 10px 6px; text-transform:uppercase;}
.nav-item{
  display:flex; align-items:center; gap:10px; padding:8px 10px; border-radius:8px; color:var(--nav-text);
  cursor:pointer; font-size:13px; font-weight:500; position:relative; user-select:none;
}
.nav-item:hover{background:var(--nav-bg-hover); color:#fff;}
.nav-item.active{background:var(--nav-bg-active); color:#fff;}
.nav-item.active::before{content:"";position:absolute; left:-10px; top:6px; bottom:6px; width:3px; background:var(--nav-accent); border-radius:0 3px 3px 0;}
.nav-item .ic{width:16px; height:16px; flex:0 0 auto; opacity:.9;}
.nav-item .lbl{flex:1; overflow:hidden; text-overflow:ellipsis; white-space:nowrap;}
.nav-badge{background:#e6483f; color:#fff; font-size:10px; font-weight:700; padding:1px 6px; border-radius:10px;}
.nav-badge.soft{background:#22345690; color:#c7d2e0;}
.nav-item.disabled{opacity:.5; cursor:default;}
.nav-item.disabled:hover{background:transparent; color:var(--nav-text);}
.sidebar-user{display:flex; align-items:center; gap:10px; padding:14px 16px; border-top:1px solid var(--nav-border);}
.avatar{
  width:32px; height:32px; border-radius:50%; display:flex; align-items:center; justify-content:center;
  font-size:12px; font-weight:700; color:#fff; flex:0 0 auto;
}
.sidebar-user .who b{display:block; color:#fff; font-size:13px;}
.sidebar-user .who span{display:block; color:#7f93b3; font-size:11px;}

.main{flex:1; min-width:0; display:flex; flex-direction:column;}
.topbar{
  display:flex; align-items:center; justify-content:space-between; gap:16px;
  padding:14px 24px; background:var(--surface); border-bottom:1px solid var(--border);
  position:sticky; top:0; z-index:5;
}
.crumbs{font-size:12px; color:var(--ink-faint); margin-bottom:4px;}
.crumbs a{color:var(--ink-faint);}
.crumbs .cur{color:var(--ink-soft);}
.topbar h1{font-size:20px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap;}
.topbar-left{min-width:0; display:flex; align-items:center; gap:4px;}
.topbar-actions{display:flex; align-items:center; gap:8px; flex:0 0 auto;}
.content{padding:22px 24px 60px; flex:1; min-width:0;}
/* Hamburger (opens the sidebar drawer on phone widths) and the detail-view
   back arrow both live in the topbar; the hamburger only ever shows once
   the sidebar itself has gone off-canvas (see the 860px query below), the
   back arrow shows whenever backTarget() says the current view was reached
   by drilling into something rather than picked off the nav directly. */
/* .btn.<x> (two classes) so these reliably beat the plain .btn{display:
   inline-flex} rule below regardless of source order - a bare single-class
   selector here previously lost that fight and left the hamburger and the
   drawer's close button visibly showing on desktop. */
.btn.menu-btn{display:none; flex:0 0 auto;}
.btn.back-btn{flex:0 0 auto;}
.btn.sidebar-close{display:none;}
.sidebar-overlay{display:none;}
.content-narrow{max-width:900px;}

/* ============ PRIMITIVES ============ */
/* Default size for any inline icon svg that isn't covered by a more
   specific rule further down (nav items, alert badges, buttons, etc. all
   size their own and win on specificity/source-order below). Without this,
   a bare <svg> with no width/height renders at the browser's default
   replaced-element size (a couple hundred px) - that's what made the
   dashboard stat-tile icons balloon to ~170px. */
svg.ic{width:20px; height:20px; flex:0 0 auto; display:inline-block;}
.stat-ic{width:18px; height:18px; opacity:.55;}
.btn{
  display:inline-flex; align-items:center; gap:6px; border-radius:8px; border:1px solid var(--border);
  background:var(--surface); color:var(--ink); font-size:13px; font-weight:600; padding:8px 14px;
  cursor:pointer; white-space:nowrap; line-height:1.2;
}
.btn:hover{border-color:var(--ink-faint);}
.btn.primary{background:var(--accent); border-color:var(--accent); color:#fff;}
.btn.primary:hover{background:var(--accent-hover); border-color:var(--accent-hover);}
.btn.danger{background:var(--critical); border-color:var(--critical); color:#fff;}
.btn.ghost{background:transparent; border-color:transparent;}
.btn.sm{padding:5px 10px; font-size:12px; border-radius:7px;}
.btn:disabled{opacity:.5; cursor:not-allowed;}
.btn svg{width:14px; height:14px;}

.card{background:var(--surface); border:1px solid var(--border); border-radius:var(--radius); box-shadow:var(--shadow-sm);}
.card-pad{padding:16px 18px;}
.card-head{display:flex; align-items:center; justify-content:space-between; margin-bottom:12px;}
.card-title{font-size:11px; font-weight:800; letter-spacing:.08em; text-transform:uppercase; color:var(--accent);}
.card-title.plain{color:var(--ink-soft);}
.grid{display:grid; gap:16px;}
.g-2{grid-template-columns:repeat(2,1fr);}
.g-3{grid-template-columns:repeat(3,1fr);}
.g-4{grid-template-columns:repeat(4,1fr);}
.g-main-side{grid-template-columns:2fr 1fr;}
@media (max-width: 980px){ .g-2,.g-3,.g-4,.g-main-side{grid-template-columns:1fr;} }

.pill{display:inline-flex; align-items:center; gap:4px; padding:3px 10px; border-radius:999px; font-size:11px; font-weight:700;}
.pill.ok{background:var(--ok-bg); color:var(--ok-text);}
.pill.warn{background:var(--warn-bg); color:var(--warn-text);}
.pill.critical{background:var(--critical-bg); color:var(--critical-text);}
.pill.info{background:var(--info-bg); color:var(--info-text);}
.pill.neutral{background:var(--neutral-bg); color:var(--neutral-text);}

.field{display:flex; flex-direction:column; gap:5px; margin-bottom:12px;}
.field label{font-size:12px; font-weight:600; color:var(--ink-soft);}
.field .hint{font-size:11px; color:var(--ink-faint);}
input[type=text],input[type=number],input[type=date],input[type=time],input[type=search],select,textarea{
  border:1px solid var(--border); border-radius:8px; padding:8px 10px; background:var(--surface); color:var(--ink); width:100%;
}
input:focus,select:focus,textarea:focus,button:focus-visible,.nav-item:focus-visible{outline:2px solid var(--accent); outline-offset:1px;}
textarea{resize:vertical; min-height:70px;}
.stepper{display:flex; align-items:center; border:1px solid var(--border); border-radius:8px; overflow:hidden; width:fit-content;}
.stepper button{width:28px; height:32px; border:0; background:var(--surface-alt); color:var(--ink-soft); font-size:15px; cursor:pointer;}
.stepper input{border:0; width:48px; text-align:center; padding:0; -moz-appearance:textfield;}
.stepper input::-webkit-outer-spin-button,.stepper input::-webkit-inner-spin-button{-webkit-appearance:none; margin:0;}
.toggle{position:relative; width:38px; height:22px; border-radius:999px; background:var(--border); border:0; cursor:pointer; flex:0 0 auto;}
.toggle::after{content:""; position:absolute; top:2px; left:2px; width:18px; height:18px; border-radius:50%; background:#fff; box-shadow:var(--shadow-sm); transition:transform .12s;}
.toggle.on{background:var(--ok);}
.toggle.on::after{transform:translateX(16px);}

table{width:100%; border-collapse:collapse; font-size:13px;}
th{text-align:left; font-size:11px; text-transform:uppercase; letter-spacing:.05em; color:var(--ink-faint); font-weight:700; padding:7px 10px; border-bottom:1px solid var(--border);}
td{padding:9px 10px; border-bottom:1px solid var(--border); vertical-align:middle;}
tr:last-child td{border-bottom:0;}
.table-wrap{overflow-x:auto;}

.empty{padding:28px 16px; text-align:center; color:var(--ink-faint); font-size:13px;}
.divider{height:1px; background:var(--border); margin:14px 0;}

/* stage chip helper */
.stage-chip{display:inline-flex; align-items:center; gap:5px; padding:2px 8px; border-radius:6px; font-size:11px; font-weight:700;}

/* ============ NAV: mobile / worker ============ */
/* The worker shell's bottom tab bar is its own self-contained layout (see
   renderWorkerShell) — it stays visible at every viewport width, not just
   narrow ones, since a worker session never renders the admin sidebar at all. */
.tabbar{
  display:flex; position:fixed; bottom:0; left:0; right:0; background:var(--nav-bg); z-index:20;
  border-top:1px solid var(--nav-border); padding:6px 4px calc(6px + env(safe-area-inset-bottom));
}
.tabbar .tab{flex:1; display:flex; flex-direction:column; align-items:center; gap:2px; color:#8fa1bd; font-size:10px; font-weight:600; padding:4px 2px; cursor:pointer; border-radius:8px;}
.tabbar .tab.active{color:#fff; background:var(--nav-bg-active);}
.tabbar .tab svg{width:18px; height:18px;}
@media (max-width: 860px){
  .shell{flex-direction:column;}
  .topbar{padding:12px 14px;}
  .content{padding:14px 14px 84px;}
  .g-main-side{grid-template-columns:1fr;}
  .btn.menu-btn{display:inline-flex;}
  .btn.sidebar-close{display:inline-flex;}
  /* Off-canvas by default - a slide-in drawer rather than the old "just
     hide it", since hiding it left phone users with no way back to the
     nav at all once they'd tapped into something. */
  .sidebar{
    position:fixed; top:0; left:0; height:100vh; z-index:30;
    transform:translateX(-100%);
    transition:transform .22s ease;
    box-shadow:var(--shadow-md);
  }
  .shell.nav-open .sidebar{transform:translateX(0);}
  .sidebar-overlay{
    display:block; position:fixed; inset:0; background:rgba(8,12,20,.5); z-index:25;
  }
}

/* ============ SCHEDULER ============ */
.sched-toolbar{display:flex; flex-wrap:wrap; align-items:center; gap:10px; margin-bottom:14px;}
.seg{display:flex; border:1px solid var(--border); border-radius:8px; overflow:hidden;}
.seg button{border:0; background:var(--surface); color:var(--ink-soft); font-size:12px; font-weight:700; padding:7px 13px; cursor:pointer; border-right:1px solid var(--border);}
.seg button:last-child{border-right:0;}
.seg button.active{background:var(--accent); color:#fff;}
.sched-layout{display:block;}
.sched-grid-scroll{overflow-x:auto; border:1px solid var(--border); border-radius:var(--radius); background:var(--surface);}
.day-grid{display:grid; min-width:760px;}
.day-grid-head{display:flex; border-bottom:1px solid var(--border); position:sticky; top:0; background:var(--surface); z-index:2;}
.day-col-head{flex:1; min-width:180px; padding:10px 14px; border-left:1px solid var(--border); display:flex; align-items:center; gap:8px;}
.day-col-head:first-child{border-left:0;}
.day-col-head b{font-size:13px;}
.day-time-col{width:60px; flex:0 0 60px;}
.day-body{display:flex; position:relative;}
.day-time-rail{width:60px; flex:0 0 60px;}
.time-slot{height:30px; border-top:1px solid var(--border); font-size:10.5px; color:var(--ink-faint); text-align:right; padding-right:6px; box-sizing:border-box; transform:translateY(-4px);}
.day-time-rail .time-slot:first-child{transform:translateY(0);}
.day-col-body{flex:1; min-width:180px; border-left:1px solid var(--border); position:relative;}
.day-col-body .slot-line{height:30px; border-top:1px solid var(--border);}
.day-col-body.dropzone-hover{background:var(--accent-soft);}
.job-block{
  position:absolute; left:3px; right:3px; border-radius:7px; padding:5px 7px; overflow:hidden;
  font-size:11px; line-height:1.3; cursor:grab; border:1px solid rgba(0,0,0,.08); box-shadow:var(--shadow-sm);
  box-sizing:border-box;
}
.job-block b{display:block; font-size:11.5px;}
.job-block .addr{opacity:.85; display:block; white-space:nowrap; overflow:hidden; text-overflow:ellipsis;}
.insp-block{position:absolute; left:3px; right:3px; border-radius:7px; padding:5px 7px; font-size:11px; background:var(--critical-bg); color:var(--critical-text); border:1px solid var(--critical);}

.week-grid{display:grid; grid-template-columns:160px repeat(7,minmax(140px,1fr)); min-width:1040px;}
.week-cell-head{padding:10px 11px; font-size:11.5px; font-weight:700; color:var(--ink-soft); border-bottom:1px solid var(--border); border-left:1px solid var(--border);}
.week-cell-head:first-child{border-left:0;}
.week-worker-cell{padding:11px; border-bottom:1px solid var(--border); display:flex; align-items:center; gap:8px;}
.week-day-cell{padding:7px; border-bottom:1px solid var(--border); border-left:1px solid var(--border); display:flex; flex-direction:column; gap:5px; min-height:76px;}
.week-chip{border-radius:6px; padding:5px 7px; font-size:11px; line-height:1.3; border:1px solid rgba(0,0,0,.08); cursor:pointer;}
.week-chip b{display:block; font-size:11.5px;}

.legend{display:flex; flex-wrap:wrap; gap:14px; margin-top:14px; font-size:11px; color:var(--ink-soft);}
.legend span{display:inline-flex; align-items:center; gap:6px;}
.legend i{width:11px; height:11px; border-radius:3px; display:inline-block;}

/* ============ STAGE TABS (job detail) ============ */
.stage-tabs{display:flex; gap:4px; overflow-x:auto; border-bottom:1px solid var(--border); margin-bottom:16px; padding-bottom:1px;}
.stage-tab{display:flex; align-items:center; gap:6px; padding:10px 12px; font-size:12.5px; font-weight:700; color:var(--ink-faint); border-bottom:2px solid transparent; cursor:pointer; white-space:nowrap;}
.stage-tab.active{color:var(--accent); border-color:var(--accent);}
.stage-tab .dot{width:7px; height:7px; border-radius:50%;}
.stage-tab .done{color:var(--ok);}

/* ============ CHECKLIST ============ */
.check-row{display:grid; grid-template-columns:28px 1fr 130px 60px; gap:8px; align-items:center; padding:8px 4px; border-bottom:1px solid var(--border);}
.check-row:last-child{border-bottom:0;}
.check-row .qn{color:var(--ink-faint); font-size:11px;}
.status-dot{width:20px; height:20px; border-radius:50%; display:flex; align-items:center; justify-content:center; color:#fff; font-size:12px; font-weight:800;}
.status-dot.pass{background:var(--ok);}
.status-dot.fail{background:var(--critical);}
.status-dot.na{background:var(--ink-faint);}
.status-dot.pending{background:var(--border); color:var(--ink-faint);}

/* ============ ALERTS INBOX ============ */
.alert-item{display:flex; gap:12px; padding:12px 14px; border:1px solid var(--border); border-left:4px solid var(--ink-faint); border-radius:8px; margin-bottom:10px; background:var(--surface); cursor:pointer;}
.alert-item.critical{border-left-color:var(--critical);}
.alert-item.warn{border-left-color:var(--warn);}
.alert-item.info{border-left-color:var(--info);}
.alert-item.selected{box-shadow:0 0 0 2px var(--accent) inset;}
.alert-item .ic{width:30px; height:30px; border-radius:50%; display:flex; align-items:center; justify-content:center; flex:0 0 auto;}
.alert-item.critical .ic{background:var(--critical-bg); color:var(--critical);}
.alert-item.warn .ic{background:var(--warn-bg); color:var(--warn);}
.alert-item.info .ic{background:var(--info-bg); color:var(--info);}
.alert-body{flex:1; min-width:0;}
.alert-body b{font-size:13px; display:block;}
.alert-body .meta{font-size:11.5px; color:var(--ink-faint); margin-top:2px;}

/* ============ WIZARD ============ */
.wizard-steps{display:flex; align-items:center; gap:0; margin-bottom:20px; overflow-x:auto; padding-bottom:4px;}
.wizard-step{display:flex; flex-direction:column; align-items:center; gap:6px; flex:0 0 auto; width:100px; position:relative;}
.wizard-step .num{width:30px; height:30px; border-radius:50%; background:var(--surface); border:2px solid var(--border); display:flex; align-items:center; justify-content:center; font-size:12px; font-weight:800; color:var(--ink-faint);}
.wizard-step.active .num{background:var(--accent); border-color:var(--accent); color:#fff;}
.wizard-step.done .num{background:var(--ok); border-color:var(--ok); color:#fff;}
.wizard-step .lbl{font-size:11px; color:var(--ink-faint); text-align:center;}
.wizard-step.active .lbl{color:var(--ink); font-weight:700;}
.wizard-line{flex:1; height:2px; background:var(--border); margin:0 -6px 22px; min-width:20px;}

.snapshot-groups{display:grid; grid-template-columns:repeat(5,1fr); gap:12px; margin-top:14px;}
@media (max-width:1200px){ .snapshot-groups{grid-template-columns:repeat(3,1fr);} }
@media (max-width:760px){ .snapshot-groups{grid-template-columns:repeat(2,1fr);} }
.snap-group{border:1px solid var(--border); border-radius:8px; padding:10px; background:var(--surface-alt);}
.snap-group h4{font-size:11px; text-transform:uppercase; letter-spacing:.06em; color:var(--ink-soft); margin-bottom:8px;}
.snap-row{display:flex; align-items:center; justify-content:space-between; gap:6px; margin-bottom:7px; font-size:12px;}
.snap-row:last-child{margin-bottom:0;}
.snap-row .stepper input{width:36px;}

/* progress bar */
.progress{height:7px; background:var(--border); border-radius:99px; overflow:hidden;}
.progress > i{display:block; height:100%; background:var(--accent); border-radius:99px;}

/* ============ REPORTS ============ */
.report-tiles{display:grid; grid-template-columns:repeat(4,1fr); gap:12px; margin-bottom:16px;}
@media (max-width:980px){ .report-tiles{grid-template-columns:repeat(2,1fr);} }
.report-tile{border:1px solid var(--border); border-radius:var(--radius); padding:14px 16px; background:var(--surface);}
.report-tile .lbl{font-size:11px; font-weight:700; text-transform:uppercase; letter-spacing:.05em; color:var(--ink-faint);}
.report-tile .val{font-size:22px; font-weight:800; margin-top:6px;}
.report-tile .sub{font-size:11.5px; color:var(--ink-faint); margin-top:3px;}

/* ============ LETTER OF OFFER ============ */
.loo-doc{display:none;}
.loo-preview{border:1px solid var(--border); border-radius:var(--radius); background:#fff; color:#1a1a1a; padding:36px 40px; max-width:760px; margin:0 auto; box-shadow:var(--shadow-sm);}
.loo-preview h1,.loo-preview h2,.loo-preview h3{color:#111;}
.loo-head{display:flex; align-items:center; justify-content:space-between; gap:16px; border-bottom:2px solid #1a2a44; padding-bottom:16px; margin-bottom:20px;}
.loo-head img{max-height:60px; max-width:180px; object-fit:contain;}
.loo-company{font-size:11.5px; color:#444; line-height:1.5; text-align:right;}
.loo-title{font-size:20px; font-weight:800; margin-bottom:2px;}
.loo-meta{font-size:12px; color:#555; margin-bottom:18px;}
.loo-section{margin-bottom:18px;}
.loo-section h4{font-size:11px; text-transform:uppercase; letter-spacing:.06em; color:#555; margin-bottom:6px;}
.loo-table{width:100%; border-collapse:collapse; font-size:12.5px;}
.loo-table th,.loo-table td{border-bottom:1px solid #ddd; padding:6px 4px; text-align:left;}
.loo-table th:last-child,.loo-table td:last-child{text-align:right;}
.loo-total-row td{font-weight:800; border-top:2px solid #1a2a44; border-bottom:none;}
.loo-terms{font-size:11px; color:#444; line-height:1.6; white-space:pre-wrap;}
.loo-sign{display:flex; gap:40px; margin-top:34px;}
.loo-sign > div{flex:1; border-top:1px solid #999; padding-top:6px; font-size:11px; color:#555;}
@media print{
  body *{visibility:hidden;}
  .loo-preview,.loo-preview *{visibility:visible;}
  .loo-preview{position:absolute; top:0; left:0; width:100%; max-width:none; border:none; box-shadow:none; padding:0 24px;}
}

.kv{display:flex; align-items:center; justify-content:space-between; padding:6px 0; font-size:12.5px; border-bottom:1px solid var(--border);}
.kv:last-child{border-bottom:0;}
.kv .k{color:var(--ink-soft);}
.kv .v{font-weight:700;}
.kv .v.good{color:var(--ok);}

.banner{display:flex; gap:10px; align-items:flex-start; padding:11px 14px; border-radius:8px; font-size:12.5px;}
.banner.info{background:var(--info-bg); color:var(--info-text);}
.banner.warn{background:var(--warn-bg); color:var(--warn-text);}
.banner.critical{background:var(--critical-bg); color:var(--critical-text);}

.worker-today-card{background:var(--accent); color:#fff; border-radius:12px; padding:14px; margin-bottom:10px;}
.worker-today-card b{display:block; font-size:14px;}
.worker-today-card .addr{opacity:.9; font-size:12px; display:block; margin-top:2px;}
.worker-today-card .time{font-size:12px; font-weight:700; opacity:.95;}

.readonly-banner{position:sticky; top:0; z-index:30; background:var(--warn); color:#3a2a04; text-align:center; font-size:12px; font-weight:700; padding:6px;}
.coming-soon{padding:60px 20px; text-align:center; color:var(--ink-faint);}
.coming-soon svg{margin-bottom:14px;}