/* ---------------------------------------------------------------------------
   Truck & Plant Connection CRM

   Palette taken from the yard rather than a UI kit: oxide primer, hi-vis vest,
   galvanised steel, concrete. Black bands carry the structure, the way depot
   signage and chassis plates do.

   Designed phone-first for the salesperson screens — this is used standing in
   a yard, one-handed, with thirty seconds between conversations.
--------------------------------------------------------------------------- */
:root{
  --ink:#14171A; --ink-2:#242A30; --steel:#616C76; --steel-2:#8C959D;
  --concrete:#E3E6E1; --concrete-2:#EFF1ED; --paper:#F7F8F6; --white:#FFF;
  --hivis:#A6D129; --hivis-deep:#5F8410; --amber:#D2871A; --rust:#A63527;
  --sky:#2B6B8C; --line:#D3D8D2; --r:3px;
  --shadow:0 1px 0 rgba(20,23,26,.06), 0 6px 18px -12px rgba(20,23,26,.4);
  --rail:212px;
}
*{box-sizing:border-box}
html,body{margin:0;padding:0;height:100%}
body{background:var(--paper);color:var(--ink);
  font-family:'IBM Plex Sans',system-ui,-apple-system,sans-serif;font-size:14px;
  line-height:1.45;-webkit-font-smoothing:antialiased}
h1,h2,h3,h4{font-family:'Barlow Condensed','Arial Narrow',sans-serif;font-weight:600;
  letter-spacing:.01em;margin:0;line-height:1.05}
a{color:var(--sky);text-decoration:none}
a:hover{text-decoration:underline}
button{font:inherit;color:inherit;cursor:pointer}
.mono{font-family:'IBM Plex Mono',ui-monospace,monospace}
:focus-visible{outline:2px solid var(--sky);outline-offset:2px}
@media (prefers-reduced-motion:reduce){*{transition:none!important;animation:none!important}}

/* ------------------------------------------------------------------- shell */
.shell{display:grid;grid-template-columns:var(--rail) 1fr;min-height:100vh}
.rail{background:var(--ink);color:var(--concrete);display:flex;flex-direction:column;
  position:sticky;top:0;height:100vh}
.brand{padding:18px 16px 14px;border-bottom:1px solid rgba(255,255,255,.09)}
.brand .mark{font-family:'Barlow Condensed',sans-serif;font-weight:700;font-size:19px;
  letter-spacing:.03em;line-height:1;color:var(--white)}
.brand .mark em{color:var(--hivis);font-style:normal}
.brand .sub{font-family:'IBM Plex Mono',monospace;font-size:9.5px;letter-spacing:.16em;
  color:var(--steel-2);text-transform:uppercase;margin-top:5px}
.nav{padding:10px 8px;display:flex;flex-direction:column;gap:1px;flex:1;overflow-y:auto}
.nav a{padding:9px 10px;border-radius:var(--r);color:var(--concrete);display:flex;
  align-items:center;gap:10px;font-size:13.5px;transition:background .12s;text-decoration:none}
.nav a:hover{background:rgba(255,255,255,.07);text-decoration:none}
.nav a.active{background:var(--hivis);color:var(--ink);font-weight:600}
.nav .ico{width:16px;text-align:center;opacity:.85;font-size:13px}
.nav .count{margin-left:auto;font-family:'IBM Plex Mono',monospace;font-size:11px;
  background:rgba(255,255,255,.12);padding:1px 6px;border-radius:20px}
.nav a.active .count{background:rgba(20,23,26,.18)}
.nav .group{font-family:'IBM Plex Mono',monospace;font-size:9px;letter-spacing:.16em;
  text-transform:uppercase;color:var(--steel-2);padding:14px 10px 5px}
.rail-foot{padding:12px 16px;border-top:1px solid rgba(255,255,255,.09);font-size:12px;
  color:var(--steel-2)}
.rail-foot strong{display:block;color:var(--concrete);font-weight:500;font-size:13px}
.rail-foot a{color:var(--steel-2);font-size:11.5px}

.main{min-width:0;display:flex;flex-direction:column}
.topbar{background:var(--white);border-bottom:1px solid var(--line);padding:11px 20px;
  display:flex;align-items:center;gap:14px;flex-wrap:wrap;position:sticky;top:0;z-index:10}
.topbar h1{font-size:21px}
.spacer{flex:1}
.content{padding:20px;max-width:1180px;width:100%}

/* ------------------------------------------------------------------ pieces */
.card{background:var(--white);border:1px solid var(--line);border-radius:var(--r);
  box-shadow:var(--shadow)}
.card-h{padding:11px 14px;border-bottom:1px solid var(--line);display:flex;
  align-items:center;gap:10px;flex-wrap:wrap}
.card-h h2{font-size:16px;letter-spacing:.02em;text-transform:uppercase}
.card-b{padding:14px}
.card-b.flush{padding:14px 0 4px}
.grid{display:grid;gap:14px}
.g2{grid-template-columns:repeat(2,minmax(0,1fr))}
.g3{grid-template-columns:repeat(3,minmax(0,1fr))}
.g4{grid-template-columns:repeat(4,minmax(0,1fr))}
.split{display:grid;grid-template-columns:1fr 320px;gap:14px}
@media(max-width:1000px){.split{grid-template-columns:1fr}}
@media(max-width:960px){.g3,.g4{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:640px){.g2,.g3,.g4{grid-template-columns:1fr}}

.eyebrow{font-family:'IBM Plex Mono',monospace;font-size:10px;letter-spacing:.14em;
  text-transform:uppercase;color:var(--steel-2)}
.metric{font-family:'Barlow Condensed',sans-serif;font-size:34px;font-weight:600;line-height:1}
.metric small{font-size:15px;color:var(--steel);font-weight:400;margin-left:3px}
.delta{font-size:12px;color:var(--steel)}
.delta.up{color:var(--hivis-deep)} .delta.down{color:var(--rust)}

/* Registration plate — the one device everyone in this trade reads instantly.
   South African plates are white with black characters. */
.plate{display:inline-flex;align-items:stretch;border:1.5px solid var(--ink);
  border-radius:4px;overflow:hidden;background:#FFF;line-height:1;
  font-family:'Barlow Condensed',sans-serif;font-weight:700}
.plate .no{padding:4px 7px 3px;font-size:14px;letter-spacing:.09em;color:#111}
.plate .prov{background:var(--ink);color:#FFF;font-size:9px;letter-spacing:.08em;
  padding:4px 5px 3px;display:flex;align-items:center}
.plate.sm .no{font-size:12px;padding:3px 6px 2px}
.plate.sm .prov{font-size:8px}

/* Chassis plate — riveted metal data block, as bolted to the machine */
.chassis{background:linear-gradient(160deg,#2C3238,#191D21);color:var(--concrete);
  border-radius:var(--r);padding:13px 15px;position:relative}
.chassis::before,.chassis::after{content:'';position:absolute;width:5px;height:5px;
  border-radius:50%;background:#565E66;box-shadow:inset 0 1px 1px rgba(0,0,0,.6);top:7px}
.chassis::before{left:7px}.chassis::after{right:7px}
.chassis dl{margin:0;display:grid;grid-template-columns:auto 1fr;gap:5px 14px;font-size:12px}
.chassis dt{font-family:'IBM Plex Mono',monospace;font-size:9.5px;letter-spacing:.12em;
  text-transform:uppercase;color:var(--steel-2);align-self:center}
.chassis dd{margin:0;font-family:'IBM Plex Mono',monospace;font-size:12.5px;color:var(--white)}
.chassis .title{font-family:'Barlow Condensed',sans-serif;font-size:19px;color:var(--white);
  margin:0 0 9px;padding-bottom:8px;border-bottom:1px solid rgba(255,255,255,.14)}

.tag{display:inline-flex;align-items:center;gap:5px;font-size:11.5px;padding:2px 8px;
  border-radius:20px;border:1px solid var(--line);background:var(--concrete-2);
  color:var(--ink-2);white-space:nowrap}
.tag.hi{background:var(--hivis);border-color:var(--hivis);color:var(--ink);font-weight:600}
.tag.warn{background:#FBF0DC;border-color:#EBD4A6;color:#7A4E08}
.tag.bad{background:#F9E5E2;border-color:#EFC3BC;color:var(--rust);font-weight:600}
.tag.quiet{background:transparent;color:var(--steel)}
.dot{width:6px;height:6px;border-radius:50%;background:currentColor;display:inline-block}

.btn{border:1px solid var(--ink);background:var(--ink);color:var(--white);padding:7px 13px;
  border-radius:var(--r);font-size:13px;font-weight:500;transition:filter .12s;
  display:inline-flex;align-items:center;gap:6px;text-decoration:none}
.btn:hover{filter:brightness(1.35);text-decoration:none}
.btn.hi{background:var(--hivis);border-color:var(--hivis);color:var(--ink);font-weight:600}
.btn.hi:hover{filter:brightness(1.06)}
.btn.ghost{background:transparent;color:var(--ink);border-color:var(--line)}
.btn.ghost:hover{background:var(--concrete-2);filter:none}
.btn.danger{background:var(--rust);border-color:var(--rust)}
.btn.sm{padding:4px 9px;font-size:12px}
.btn.block{width:100%;justify-content:center}
.btn:disabled{opacity:.4;cursor:not-allowed;filter:none}

table{width:100%;border-collapse:collapse}
th{text-align:left;font-family:'IBM Plex Mono',monospace;font-size:9.5px;letter-spacing:.13em;
  text-transform:uppercase;color:var(--steel-2);padding:0 12px 7px;font-weight:500}
td{padding:11px 12px;border-top:1px solid var(--line);vertical-align:middle}
tbody tr.click{cursor:pointer;transition:background .1s}
tbody tr.click:hover{background:var(--concrete-2)}
.row-title{font-weight:500}
.row-sub{font-size:12px;color:var(--steel)}
.stripe{border-left:3px solid transparent}
.stripe.bad{border-left-color:var(--rust)}
.stripe.warn{border-left-color:var(--amber)}
.stripe.hi{border-left-color:var(--hivis)}

.tl{list-style:none;margin:0;padding:0;position:relative}
.tl::before{content:'';position:absolute;left:7px;top:6px;bottom:6px;width:1px;background:var(--line)}
.tl li{position:relative;padding:0 0 16px 26px}
.tl li:last-child{padding-bottom:0}
.tl .node{position:absolute;left:0;top:3px;width:15px;height:15px;border-radius:50%;
  background:var(--white);border:2px solid var(--steel-2)}
.tl li.key .node{border-color:var(--hivis-deep);background:var(--hivis)}
.tl .when{font-family:'IBM Plex Mono',monospace;font-size:11px;color:var(--steel-2)}
.tl .what{font-size:13.5px}
.tl .who{font-size:12px;color:var(--steel)}

.board{display:grid;grid-template-columns:repeat(auto-fit,minmax(190px,1fr));gap:11px;
  overflow-x:auto;padding-bottom:6px}
.col-h{display:flex;align-items:baseline;gap:7px;padding:0 2px 8px;
  border-bottom:2px solid var(--ink);margin-bottom:10px}
.col-h h3{font-size:14px;letter-spacing:.04em;text-transform:uppercase}
.col-h .n{font-family:'IBM Plex Mono',monospace;font-size:11px;color:var(--steel)}
.col-h .v{margin-left:auto;font-family:'IBM Plex Mono',monospace;font-size:11.5px;font-weight:600}
.deal{background:var(--white);border:1px solid var(--line);border-radius:var(--r);padding:10px;
  margin-bottom:8px;box-shadow:var(--shadow);cursor:pointer;transition:transform .12s;
  display:block;color:inherit;text-decoration:none}
.deal:hover{transform:translateY(-1px);text-decoration:none}
.deal .who{font-weight:500;font-size:13.5px}
.deal .unit{font-size:12px;color:var(--steel);margin:1px 0 7px}
.deal .foot{display:flex;align-items:center;gap:7px;font-family:'IBM Plex Mono',monospace;font-size:11.5px}
.deal .val{font-weight:600}
.deal .prob{margin-left:auto;color:var(--steel)}

.bar{height:7px;background:var(--concrete);border-radius:20px;overflow:hidden}
.bar i{display:block;height:100%;background:var(--hivis);border-radius:20px}
.bar i.warn{background:var(--amber)} .bar i.bad{background:var(--rust)}
.kv{display:grid;grid-template-columns:auto 1fr;gap:6px 14px;font-size:13px;margin:0}
.kv dt{color:var(--steel);font-size:12px}
.kv dd{margin:0}
.banner{border-left:3px solid var(--rust);background:#FBEDEB;padding:9px 13px;
  border-radius:0 var(--r) var(--r) 0;font-size:13px;display:flex;gap:9px;align-items:center}
.banner.warn{border-left-color:var(--amber);background:#FCF3E2}
.banner.ok{border-left-color:var(--hivis-deep);background:#F1F7E2}
.banner.info{border-left-color:var(--sky);background:#E9F1F6}
.clock{font-family:'IBM Plex Mono',monospace;font-weight:600;font-size:13px;color:var(--rust);
  font-variant-numeric:tabular-nums}
.empty{padding:30px 14px;text-align:center;color:var(--steel)}
.empty p{margin:0 0 12px}
.crumb{background:none;border:0;padding:0;font-size:12.5px;color:var(--sky);margin-bottom:9px;
  display:inline-block}

/* ------------------------------------------------------------------ forms */
.field{margin-bottom:11px}
.field label{display:block;font-size:12px;color:var(--steel);margin-bottom:4px}
.field input,.field select,.field textarea{width:100%;padding:8px 10px;border:1px solid var(--line);
  border-radius:var(--r);font:inherit;font-size:13.5px;background:var(--white);color:var(--ink)}
.field textarea{min-height:70px;resize:vertical}
.field .hint{font-size:11.5px;color:var(--steel-2);margin-top:4px}
.field.inline{display:flex;align-items:center;gap:8px;margin-bottom:8px}
.field.inline label{margin:0}
.field.inline input[type=checkbox]{width:auto}
.validation{color:var(--rust);font-size:12px;margin-top:4px}
.filters{display:flex;gap:8px;flex-wrap:wrap;align-items:center}
.chip{border:1px solid var(--line);background:var(--white);border-radius:20px;padding:4px 11px;
  font-size:12.5px;color:var(--steel)}
.chip.on{background:var(--ink);color:var(--white);border-color:var(--ink)}

/* --------------------------------------------------------- inline editing */
/* The dashed underline is always visible, not only on hover.
   A phone has no hover, so an editable field looked identical to a fixed one
   and nobody knew they could change it. */
.edit{border-bottom:1px dashed var(--line);cursor:text;border-radius:2px;padding:1px 3px;
  margin:0 -3px;transition:background .12s,border-color .12s;display:inline-block;
  min-width:90px;min-height:20px}

/* An empty field is otherwise nothing at all - zero width, nothing to tap.
   This gives it both a target and a word saying what goes there. */
.edit:empty::before{content:'Add';color:var(--steel-2);font-style:italic}
.edit:hover{border-bottom-color:var(--steel-2);background:var(--concrete-2)}
.edit:focus{outline:0;background:var(--white);border-bottom:1px solid var(--sky);
  box-shadow:0 1px 0 var(--sky)}
.edit.dirty{background:#FBF6E4;border-bottom-color:var(--amber)}
.edit-hint{font-size:11.5px;color:var(--steel-2)}
.edit-hint kbd{font-family:'IBM Plex Mono',monospace;font-size:10px;border:1px solid var(--line);
  border-bottom-width:2px;border-radius:3px;padding:0 4px;background:var(--white)}
.savebar{position:fixed;left:50%;bottom:20px;transform:translateX(-50%) translateY(140%);
  background:var(--ink);color:var(--white);border-radius:40px;padding:9px 10px 9px 18px;
  display:flex;align-items:center;gap:14px;box-shadow:0 10px 30px -8px rgba(0,0,0,.5);
  transition:transform .2s cubic-bezier(.2,.8,.3,1);z-index:40;font-size:13px}
.savebar.up{transform:translateX(-50%) translateY(0)}
.savebar .n{font-family:'IBM Plex Mono',monospace;color:var(--hivis)}

/* ---------------------------------------------------------------- dialog */
.scrim{position:fixed;inset:0;background:rgba(20,23,26,.45);display:flex;align-items:center;
  justify-content:center;z-index:50;padding:16px}
.dlg{background:var(--white);border-radius:var(--r);width:100%;max-width:460px;
  box-shadow:0 24px 60px -20px rgba(0,0,0,.5);max-height:90vh;display:flex;flex-direction:column}
.dlg h2{font-size:19px;padding:15px 17px 0}
.dlg .body{padding:13px 17px;overflow-y:auto}
.dlg .foot{padding:13px 17px;border-top:1px solid var(--line);display:flex;gap:8px;
  justify-content:flex-end}

/* ---------------------------------------------------------------- toasts */
.toasts{position:fixed;right:16px;bottom:16px;z-index:60;display:flex;flex-direction:column;gap:8px}
.toast{background:var(--ink);color:var(--white);padding:10px 14px;border-radius:var(--r);
  font-size:13px;box-shadow:0 10px 26px -10px rgba(0,0,0,.6);max-width:340px;
  border-left:3px solid var(--hivis);animation:rise .2s ease-out}
.toast.bad{border-left-color:var(--rust)}
.toast.warn{border-left-color:var(--amber)}
@keyframes rise{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:none}}

/* -------------------------------------------------------------- sign in */
.signin{min-height:100vh;display:grid;place-items:center;background:var(--ink);padding:20px}
.signin .panel{background:var(--white);border-radius:var(--r);width:100%;max-width:380px;
  padding:26px;box-shadow:0 30px 70px -25px rgba(0,0,0,.7)}
.signin .mark{font-family:'Barlow Condensed',sans-serif;font-weight:700;font-size:22px;
  line-height:1;margin-bottom:3px}
.signin .mark em{color:var(--hivis-deep);font-style:normal}

/* --------------------------------------------------------- public survey */
.survey{max-width:560px;margin:0 auto;padding:24px 16px 60px}
.rating{display:flex;gap:6px;flex-wrap:wrap}
.rating button{border:1px solid var(--line);background:var(--white);width:44px;height:44px;
  border-radius:var(--r);font-family:'Barlow Condensed',sans-serif;font-size:19px;font-weight:600}
.rating button.on{background:var(--hivis);border-color:var(--hivis-deep)}

/* --------------------------------------------------------------- mobile */
@media(max-width:820px){
  .shell{grid-template-columns:1fr}
  .rail{flex-direction:row;align-items:center;overflow-x:auto;height:auto;
    position:sticky;top:0;z-index:20}
  .brand{border-bottom:0;border-right:1px solid rgba(255,255,255,.09);white-space:nowrap;padding:12px 14px}
  .brand .sub{display:none}
  .nav{flex-direction:row;padding:7px;flex:0 0 auto;overflow-y:visible}
  .nav a{white-space:nowrap}
  .nav .count,.nav .group,.rail-foot{display:none}
  .content{padding:14px}
  .topbar{padding:10px 14px}
  .split{grid-template-columns:1fr}
  /* Actions are thumb-sized on a phone, because this is used in a yard. */
  .btn{padding:9px 15px}
  .btn.sm{padding:7px 12px}
}

/* ------------------------------------------------------------------ reports
   Interactive report visuals. Everything here is CSS only: no charting
   library, so nothing to break on upgrade, and it all prints. */

.chart-bars {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    height: 190px;
    padding-top: 18px;
}

.chart-bar {
    flex: 1 1 0;
    min-width: 34px;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    gap: 4px;
    background: none;
    border: 0;
    padding: 0;
    font: inherit;
    text-align: center;
}

.chart-bar.pick { cursor: pointer; }

.chart-bar-fill {
    width: 100%;
    border-radius: 3px 3px 0 0;
    transition: opacity .12s ease, transform .12s ease;
}

.chart-bar.pick:hover .chart-bar-fill { transform: scaleY(1.02); transform-origin: bottom; }
.chart-bar.pick:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

/* When something is selected, everything else recedes rather than disappears —
   the comparison is the point, so the unselected bars still have to be read. */
.chart-bars.filtered .chart-bar:not(.on) .chart-bar-fill { opacity: .28; }
.chart-bars.filtered .chart-bar:not(.on) .chart-bar-value { opacity: .45; }

.chart-bar-value { font-size: 10.5px; color: var(--steel); }

.chart-bar-label {
    font-size: 10.5px;
    color: var(--ink);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.donut-legend { flex: 1; min-width: 170px; display: grid; gap: 3px; }

.donut-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12.5px;
    background: none;
    border: 0;
    padding: 4px 6px;
    border-radius: 4px;
    font: inherit;
    width: 100%;
    text-align: left;
}

.donut-row.pick { cursor: pointer; }
.donut-row.pick:hover { background: var(--concrete); }
.donut-row.on { background: var(--concrete); font-weight: 600; }
.donut-swatch { width: 10px; height: 10px; border-radius: 2px; flex: 0 0 auto; }
.donut-name { flex: 1; }

.funnel-stage {
    display: block;
    width: 100%;
    text-align: left;
    background: none;
    border: 0;
    padding: 4px 6px;
    border-radius: 4px;
    font: inherit;
}

.funnel-stage.pick { cursor: pointer; }
.funnel-stage.pick:hover { background: var(--concrete); }
.funnel-stage.on { background: var(--concrete); }

.slicer {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.slicer-label {
    font-size: 10.5px;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--steel);
    margin-right: 2px;
}

/* The filter bar. Sticky, because a filter you cannot see is a filter you
   forget you set — the commonest way to misread a dashboard. */
.filter-chips {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    padding: 8px 10px;
    background: var(--concrete);
    border-radius: 5px;
    margin-bottom: 12px;
}

.chip-x { margin-left: 5px; opacity: .7; }

.report-canvas { display: grid; gap: 14px; }

.report-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    padding-bottom: 12px;
}

/* Drill-through: a row that opens something is signalled, not guessed at. */
tr.drill { cursor: pointer; }
tr.drill:hover { background: var(--concrete); }

@media print {
    .slicer, .report-toolbar, .filter-chips button { display: none; }
    .chart-bar-fill { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
}

.sortable { padding: 0; }

.sort-btn {
    background: none;
    border: 0;
    font: inherit;
    color: inherit;
    cursor: pointer;
    padding: 9px 10px;
    width: 100%;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 4px;
}

.sort-btn:hover { color: var(--hivis-deep); }
.sort-mark { font-size: 9px; color: var(--hivis-deep); }

/* --------------------------------------------------------------- empty state */
.empty { padding: 36px 20px; text-align: center; }
.empty-title { font-family: 'Barlow Condensed','Arial Narrow',sans-serif;
  font-size: 17px; font-weight: 600; color: var(--ink); }
.empty-msg { font-size: 13px; color: var(--steel); margin-top: 5px; }
.empty-action { margin-top: 14px; }

/* -------------------------------------------------------------------- drawer */
.drawer-backdrop { position: fixed; inset: 0; background: rgba(20,23,26,.4); z-index: 40; }

.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(560px, 100vw);
  background: var(--white); border-left: 1px solid var(--line); z-index: 41;
  display: flex; flex-direction: column; box-shadow: -18px 0 40px -28px rgba(20,23,26,.5);
}

.drawer-head { display: flex; align-items: center; gap: 10px;
  padding: 13px 16px; border-bottom: 1px solid var(--line); background: var(--concrete-2); }
.drawer-head h2 { font-size: 16px; letter-spacing: .02em; text-transform: uppercase; margin: 0; }
.drawer-body { padding: 16px; overflow-y: auto; flex: 1; }
.drawer-foot { padding: 12px 16px; border-top: 1px solid var(--line);
  display: flex; gap: 8px; justify-content: flex-end; }

@media (max-width: 640px) { .drawer { width: 100vw; } }

/* The signature preview: shown as it will arrive, not as prose. */
.sig-preview {
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-size: 12px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
  background: var(--concrete-2);
  border-left: 3px solid var(--hivis);
  border-radius: 0 3px 3px 0;
  padding: 11px 13px;
  margin: 0;
  color: var(--ink);
}

/* A rule above each salesperson's first deal, so the grouping reads at a
   glance the way the spreadsheet did. */
tr.group-start td { border-top: 2px solid var(--line); }

/* The update upload control. */
.file-input {
  display: block;
  width: 100%;
  padding: 14px;
  border: 2px dashed var(--line);
  border-radius: var(--r);
  background: var(--concrete-2);
  font-size: 13px;
  cursor: pointer;
}
.file-input:hover { border-color: var(--hivis); }

/* Somewhere obvious to put a file. */
.dropzone {
  border: 2px dashed var(--line);
  border-radius: var(--r);
  padding: 26px 18px;
  text-align: center;
  background: var(--concrete-2);
  transition: border-color .15s ease;
}
.dropzone:hover { border-color: var(--hivis); }
.dropzone input[type=file] { display: block; margin: 0 auto 10px; font-size: 12.5px; }
.dropzone label { display: block; cursor: pointer; }
.dropzone label strong { display: block; font-size: 14px; margin-bottom: 3px; }

dl.kv { display: grid; grid-template-columns: auto 1fr; gap: 5px 14px; margin: 0; font-size: 13px; }
dl.kv dt { color: var(--steel); }
dl.kv dd { margin: 0; }

/* --------------------------------------------- signing in with Microsoft */
.or { display: flex; align-items: center; gap: 10px; margin: 16px 0 12px;
  color: var(--steel); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; }
.or:before, .or:after { content: ""; flex: 1; height: 1px; background: var(--line); }

.btn.ms {
  display: flex; align-items: center; justify-content: center; gap: 9px;
  background: var(--white); border: 1px solid var(--steel-2); color: var(--ink);
  text-decoration: none; font-weight: 600;
}
.btn.ms:hover { border-color: var(--ink); background: var(--concrete-2); }

.signin-note { font-size: 11.5px; color: var(--steel); margin: 10px 0 0; line-height: 1.5; }

/* ---------------------------------------------------------- nav groups
   Collapsible sections in the rail.

   The heading is a button so it is reachable by keyboard, which means the
   browser's default button styling applies unless every part of it is
   overridden - background, border, padding and appearance. Missing any one of
   them leaves a pale grey box sitting on a dark rail. */

.nav-group-head {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    margin: 0;
    padding: 9px 10px;
    background: transparent;
    background-color: transparent;
    border: 0;
    border-radius: var(--r);
    -webkit-appearance: none;
    appearance: none;
    box-shadow: none;
    color: var(--concrete);
    font-family: 'IBM Plex Mono', monospace;
    font-size: 9px;
    letter-spacing: .16em;
    text-transform: uppercase;
    opacity: .55;
    cursor: pointer;
    text-align: left;
}

.nav-group-head:hover {
    background: rgba(255, 255, 255, .07);
    opacity: 1;
}

.nav-group.open > .nav-group-head { opacity: 1; }

.nav-group-head .ico { width: 16px; text-align: center; font-size: 13px; }
.nav-group-title { flex: 1; }
.nav-group-chevron { font-size: 9px; opacity: .7; }

/* Indented, so the eye can tell which links belong to which heading. */
.nav-group-body { padding-left: 10px; }

/* A metric that leads somewhere. Underlining every figure would be noise, so
   the cue is a lift on hover and a cursor, the same as the clickable rows. */
.metric-link { display: block; text-decoration: none; color: inherit; }
.metric-link:hover { border-color: var(--lime); }

/* ------------------------------------------------------------------ help
   The question mark beside a page title, and the panel it opens.
   Quiet until wanted: a help icon competing with the title is a help icon
   people learn to ignore. */

.help-mark {
    /* Inline-flex and a fixed line height, because as an inline-block inside a
       heading it inherited the heading's line box and got clipped at the top. */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    position: relative;
    top: -1px;

    margin-left: 8px;
    width: 18px;
    height: 18px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: transparent;
    color: var(--concrete);
    font-size: 11px;
    line-height: 1;
    cursor: pointer;
    vertical-align: middle;
    opacity: .5;
}

.help-mark:hover { opacity: 1; border-color: var(--lime); color: var(--ink); }

.help-panel {
    /* Fixed, not absolute: the topbar is position:sticky, which clips an
       absolutely-positioned child that extends past it - that was the top
       clipping. Fixed takes the panel out of the topbar entirely so it floats
       over the page, anchored just below the bar. */
    position: fixed;
    z-index: 60;
    top: 64px;
    left: 20px;
    max-width: 380px;
    width: min(380px, calc(100vw - 40px));
    /* Fit within the viewport below the bar and scroll if long. */
    max-height: calc(100vh - 84px);
    overflow-y: auto;
    padding: 14px 16px;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--r);
    box-shadow: 0 10px 30px rgba(0, 0, 0, .18);
}

.help-topic + .help-topic { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.help-title { font-weight: 600; margin-bottom: 4px; }
.help-tip { font-size: 13px; line-height: 1.5; }
.help-body { font-size: 13px; line-height: 1.6; margin: 8px 0; white-space: pre-wrap; }

.help-foot {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid var(--line);
    font-size: 12px;
}

/* ---------------------------------------------------------------- portal
   The customer's side. Plainer than the staff screens on purpose: somebody
   signing in twice a year should not have to learn an interface. */

.portal { min-height: 100vh; display: flex; flex-direction: column; background: var(--paper); }

.portal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px;
    border-bottom: 1px solid var(--line);
}

.portal-brand { font-weight: 700; font-size: 14px; line-height: 1.2; }
.portal-brand span { color: var(--lime); }

.portal-body { flex: 1; padding: 28px 24px; max-width: 900px; width: 100%; margin: 0 auto; }
.portal-narrow { max-width: 420px; margin: 40px auto; }
.portal-foot { padding: 18px 24px; border-top: 1px solid var(--line); font-size: 12px; color: var(--concrete); }

/* The four ways of reaching somebody: call, WhatsApp, email, text.

   A grid rather than a flex row, because these buttons sit in a column that is
   wide on a desktop and narrow on a phone. Left to wrap they ended up two on
   one line and two below at different widths, which looked like an accident.
   Equal columns that fold to two-by-two keep the same shape at any width. */
.reach {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(84px, 1fr));
    gap: 6px;
    margin-bottom: 14px;
}

/* The buttons come from four separate components, so the widths are evened out
   here rather than in each of them. */
.reach > .btn,
.reach > * > .btn {
    width: 100%;
    justify-content: center;
}

/* Skeleton loading placeholders.
   Shown by the shared Loading component while a page fetches its data. The
   shimmer makes a page feel like it is arriving rather than frozen - the
   cheapest perceived-performance win, and every page using <Loading> gets it. */
.skeleton { padding: 8px 0; }
.skeleton-row, .skeleton-card {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    /* A soft neutral fill that works on light or dark: a low-opacity grey,
       so it never becomes a hard black or white slab. */
    background: rgba(128, 128, 128, 0.18);
}
.skeleton-row {
    height: 16px;
    margin: 12px 0;
    width: 70%;
}
.skeleton-row.wide { width: 90%; height: 22px; }
.skeleton-row.narrow { width: 40%; }
.skeleton-cards { display: flex; gap: 12px; margin: 16px 0; }
.skeleton-card { flex: 1; height: 84px; }
/* The shimmer is a moving highlight passed over the soft fill, not a
   background-position trick on a solid colour - so it reads as a gentle sweep
   on any surface. */
.skeleton-row::after, .skeleton-card::after {
    content: "";
    position: absolute;
    inset: 0;
    transform: translateX(-100%);
    background: linear-gradient(90deg,
        transparent, rgba(255, 255, 255, 0.22), transparent);
    animation: skeleton-sweep 1.4s ease-in-out infinite;
}
@keyframes skeleton-sweep {
    100% { transform: translateX(100%); }
}
@media (prefers-reduced-motion: reduce) {
    .skeleton-row::after, .skeleton-card::after { animation: none; }
}
