/* =========================================================
   Primox SEM — base styles
   Theme via CSS variables. Components below the tokens block.
   ========================================================= */

:root {
  --brand-gold: #C9A227;
  --brand-gold-soft: #E2C566;
  --gold: #C9A227; /* alias: brand gold for inline var(--gold) references */
  --brand-ink: #1A1A1A;
  --brand-ink-soft: #2A2A2A;

  --bg: #F7F7F5;
  --surface: #FFFFFF;
  --surface-2: #FAFAF8;
  --border: #E5E5E0;
  --border-strong: #D4D4CE;

  --text: #1A1A1A;
  --text-soft: #555550;
  --text-muted: #8A8A85;
  --text-inverse: #FFFFFF;

  --ok: #1F7A4D;
  --ok-bg: #E6F4EC;
  --warn: #B7791F;
  --warn-bg: #FFF4E0;
  --err: #B91C1C;
  --err-bg: #FEE7E7;
  --info: #1E5BC6;
  --info-bg: #E4ECFB;

  --r-sm: 6px;
  --r: 10px;
  --r-lg: 14px;
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 24px;
  --s-6: 32px;
  --s-7: 48px;

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --shadow-1: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-2: 0 4px 16px rgba(0,0,0,0.08), 0 2px 6px rgba(0,0,0,0.05);
  --shadow-3: 0 12px 40px rgba(0,0,0,0.12), 0 4px 12px rgba(0,0,0,0.06);

  --header-h: 56px;
  --content-max: 1200px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--text); }

/* ========== App shell ========== */

#app {
  min-height: 100vh;
  display: flex;
  flex-direction: row;
}

/* ================================================================
   APP SHELL — sidebar + topbar layout
   ================================================================ */

/* Sidebar left, main column right — set on #app base rule above */

/* ---- Sidebar ---- */
.app-sidebar {
  width: 220px;
  min-width: 220px;
  background: #0f1117;
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: sticky;
  top: 0;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none;
  z-index: 20;
  flex-shrink: 0;
}
.app-sidebar::-webkit-scrollbar { display: none; }

/* Logo */
.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 16px 16px;
  text-decoration: none;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  flex-shrink: 0;
}
.sidebar-logo-mark {
  width: 30px;
  height: 30px;
  background: var(--brand-gold);
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
  color: #0f1117;
  flex-shrink: 0;
  font-family: Georgia, serif;
}
.sidebar-logo-wordmark { display: flex; flex-direction: column; line-height: 1.15; }
.sidebar-logo-name    { font-size: 14px; font-weight: 600; color: rgba(255,255,255,0.9); letter-spacing: 0.01em; }
.sidebar-logo-product { font-size: 10px; font-weight: 500; letter-spacing: 0.1em; color: rgba(255,255,255,0.3); text-transform: uppercase; }

/* Sidebar nav */
.sidebar-nav {
  flex: 1;
  padding: 10px 8px 4px;
  display: flex;
  flex-direction: column;
}

/* Dashboard row — top level, separated */
.snav-top {
  margin-bottom: 4px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

/* Nav items */
.snav-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 8px;
  border-radius: 6px;
  text-decoration: none;
  font-size: 13px;
  color: rgba(255,255,255,0.72);
  transition: color 80ms, background 80ms;
  white-space: nowrap;
  overflow: hidden;
  line-height: 1.3;
}
.snav-item:hover {
  color: rgba(255,255,255,0.96);
  background: rgba(255,255,255,0.07);
}
.snav-item.snav-active {
  color: #ffffff;
  background: rgba(201,162,39,0.22);
  font-weight: 600;
}
.snav-icon {
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  opacity: 0.82;
}
.snav-item.snav-active .snav-icon { opacity: 1; color: var(--brand-gold); }
.snav-locked { opacity: 0.32; cursor: default; pointer-events: none; }
.snav-lock { margin-left: auto; font-size: 11px; opacity: 0.7; }

/* Group header */
.snav-group { margin-top: 6px; }
.snav-group-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 5px 8px 4px;
  background: transparent;
  border: 0;
  border-radius: 5px;
  cursor: pointer;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.5);
  transition: color 80ms;
}
.snav-group-btn:hover { color: rgba(255,255,255,0.72); }
.snav-group-btn.has-active { color: rgba(255,255,255,0.7); }
.snav-chevron {
  flex-shrink: 0;
  color: rgba(255,255,255,0.42);
  transition: transform 180ms;
}
.snav-group-btn[aria-expanded="false"] .snav-chevron { transform: rotate(-90deg); }

.snav-children {
  padding-left: 4px;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.snav-children .snav-item {
  font-size: 12.5px;
  padding: 5px 8px;
}

/* Sidebar ops placeholder — assets now inline */
.sidebar-ops { display: none; }

/* Sidebar footer — Reports + Settings pinned at bottom */
.sidebar-footer {
  padding: 8px 8px 14px;
  border-top: 1px solid rgba(255,255,255,0.06);
  display: flex;
  flex-direction: column;
  gap: 1px;
}

/* ---- Main column ---- */
.app-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

/* ---- Topbar ---- */
.app-topbar {
  height: var(--header-h);
  min-height: var(--header-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 10;
  flex-shrink: 0;
}

.topbar-meta {
  display: flex;
  flex-direction: column;
  min-width: 164px;
  flex-shrink: 0;
  gap: 1px;
}
.topbar-date {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
  white-space: nowrap;
}
.topbar-user {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 6px;
}
.topbar-role-badge {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.04em;
  background: var(--surface-2);
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 6px;
  text-transform: capitalize;
}

/* Centre search */
.topbar-search-wrap {
  flex: 1;
  display: flex;
  justify-content: center;
  padding: 0 8px;
}
.topbar-search {
  position: relative;
  width: 100%;
  max-width: 440px;
}
.topbar-search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}
.topbar-search-input {
  width: 100%;
  height: 34px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0 52px 0 32px;
  font-size: 13px;
  color: var(--text);
  outline: none;
  transition: border-color 120ms, box-shadow 120ms;
  -webkit-appearance: none;
  appearance: none;
}
.topbar-search-input::placeholder { color: var(--text-muted); }
.topbar-search-input:focus {
  border-color: var(--brand-gold);
  box-shadow: 0 0 0 3px rgba(201,162,39,0.1);
}
.topbar-search-kbd {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 11px;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 5px;
  pointer-events: none;
  line-height: 1.6;
}

/* Right actions */
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  flex-shrink: 0;
}
.topbar-icon-btn {
  width: 32px;
  height: 32px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-muted);
  transition: background 80ms, color 80ms;
  flex-shrink: 0;
}
.topbar-icon-btn:hover { background: var(--surface-2); color: var(--text); }
.topbar-nav-toggle { display: none; }

/* Keep brand/app-nav stubs — nothing references them in workflow modules */
.brand { display: flex; align-items: baseline; gap: var(--s-2); font-weight: 600; text-decoration: none; }
.brand-mark    { color: var(--brand-gold); font-size: 18px; }
.brand-sep     { color: var(--text-muted); font-size: 18px; opacity: 0.5; }
.brand-product { color: var(--text-inverse); font-size: 18px; }
.app-nav { display: none; }
.app-header { display: none; }

/* ---- User menu (topbar avatar dropdown) ---- */
.user-menu { position: relative; }
.user-menu .avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--brand-gold);
  color: var(--brand-ink);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 12px;
  cursor: pointer;
  border: none;
}
.user-menu .dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + var(--s-2));
  background: var(--surface);
  color: var(--text);
  min-width: 220px;
  border-radius: var(--r);
  box-shadow: var(--shadow-2);
  padding: var(--s-2);
  display: none;
  border: 1px solid var(--border);
  z-index: 100;
}
.user-menu[data-open="true"] .dropdown { display: block; }
.user-menu .dropdown .who {
  padding: var(--s-2) var(--s-3);
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--s-1);
}
.user-menu .dropdown .who .name  { font-weight: 600; font-size: 14px; }
.user-menu .dropdown .who .email { font-size: 13px; color: var(--text-soft); }
.user-menu .dropdown .who .role {
  display: inline-block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--info-bg);
  color: var(--info);
  margin-top: 4px;
}
.user-menu .dropdown button {
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  padding: var(--s-2) var(--s-3);
  border-radius: var(--r-sm);
  cursor: pointer;
  font: inherit;
  color: var(--text);
}
.user-menu .dropdown button:hover { background: var(--surface-2); }

/* ---- Mobile — sidebar becomes overlay drawer ---- */
@media (max-width: 768px) {
  /* Sidebar slides in from left as overlay — does not push content */
  .app-sidebar {
    position: fixed;
    left: -240px;
    top: 0;
    height: 100vh;
    transition: left 200ms ease;
    z-index: 50;
    box-shadow: 4px 0 32px rgba(0,0,0,0.5);
  }
  .app-sidebar[data-mobile-open="true"] { left: 0; }

  /* Semi-transparent backdrop — tapping it closes the drawer */
  .app-sidebar[data-mobile-open="true"]::after {
    content: "";
    position: fixed;
    inset: 0 0 0 220px;   /* covers everything right of the sidebar */
    background: rgba(0,0,0,0.4);
    z-index: -1;           /* behind sidebar, above content */
  }

  /* Main column fills full width — sidebar is an overlay above it */
  .app-main { width: 100%; min-width: 0; }

  /* Topbar: collapse meta, hide date, keep search usable */
  .topbar-nav-toggle { display: flex; }
  .topbar-meta { min-width: 0; flex-shrink: 1; }
  .topbar-date { display: none; }
  .topbar-user { font-size: 12px; max-width: 100px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .topbar-role-badge { display: none; }
  .topbar-search-wrap { flex: 1; padding: 0 6px; min-width: 0; }
  .topbar-search { max-width: 100%; }
  .topbar-search-kbd { display: none; }
  .topbar-actions { gap: 4px; flex-shrink: 0; }

  /* Content padding tighter on mobile */
  .view { padding: var(--s-4) var(--s-3); }
}


.view {
  flex: 1;
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: var(--s-5) var(--s-4);
}

/* ========== Boot ========== */

.boot {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 50vh;
  gap: var(--s-3);
  color: var(--text-soft);
}
.boot-spinner {
  width: 28px;
  height: 28px;
  border: 3px solid var(--border);
  border-top-color: var(--brand-gold);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
.boot-text { margin: 0; font-size: 14px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ========== Login ========== */

.login-wrap {
  min-height: calc(100vh - 0px);
  display: grid;
  place-items: center;
  padding: var(--s-5) var(--s-4);
}
.login {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-2);
  padding: var(--s-6);
  width: 100%;
  max-width: 400px;
}
.login .brand-row {
  display: flex;
  align-items: baseline;
  gap: var(--s-2);
  margin-bottom: var(--s-5);
}
.login .brand-row .brand-mark { color: var(--brand-gold); font-size: 22px; font-weight: 600; }
.login .brand-row .brand-sep { color: var(--text-muted); font-size: 22px; opacity: 0.5; }
.login .brand-row .brand-product { font-size: 22px; font-weight: 600; }
.login h1 { font-size: 18px; margin: 0 0 var(--s-1); }
.login .sub { color: var(--text-muted); font-size: 14px; margin: 0 0 var(--s-5); }
.login .field { margin-bottom: var(--s-4); }
.login label { display: block; font-size: 13px; color: var(--text-soft); margin-bottom: var(--s-1); font-weight: 500; }
.login input {
  width: 100%;
  padding: var(--s-3);
  font: inherit;
  border: 1px solid var(--border-strong);
  border-radius: var(--r);
  background: var(--surface);
}
.login input:focus { outline: 2px solid var(--brand-gold); outline-offset: 1px; border-color: var(--brand-gold); }
.login .err {
  background: var(--err-bg);
  color: var(--err);
  padding: var(--s-2) var(--s-3);
  border-radius: var(--r);
  font-size: 13px;
  margin-bottom: var(--s-3);
}
.login .footnote {
  margin-top: var(--s-5);
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
}

/* ========== Buttons ========== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  padding: 6px 14px;
  font: inherit;
  font-size: 13.5px;
  font-weight: 500;
  border-radius: var(--r);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  color: var(--text);
  background: var(--surface);
  border-color: var(--border-strong);
  transition: background 100ms ease, border-color 100ms ease, box-shadow 100ms ease, transform 80ms ease;
  white-space: nowrap;
  line-height: 1.4;
  min-height: 32px;
}
.btn:hover {
  background: var(--surface-2);
  border-color: var(--border);
}
.btn:active { transform: translateY(1px); }
.btn:focus-visible {
  outline: 2px solid var(--brand-gold);
  outline-offset: 2px;
}
.btn.primary {
  background: var(--brand-ink);
  color: var(--text-inverse);
  border-color: var(--brand-ink);
}
.btn.primary:hover { background: var(--brand-ink-soft); }
.btn.gold {
  background: var(--brand-gold);
  color: var(--brand-ink);
  border-color: var(--brand-gold);
  font-weight: 600;
}
.btn.gold:hover { background: var(--brand-gold-soft); }
.btn.block { width: 100%; }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; transform: none; }

/* ========== Page header ========== */

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--s-3);
  margin-bottom: var(--s-5);
  padding-top: var(--s-5);
  flex-wrap: wrap;
}
.page-head h1 {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--text);
}
.page-head .sub {
  color: var(--text-muted);
  font-size: 13px;
  margin-top: 3px;
  letter-spacing: 0.01em;
}

/* ========== Dashboard ========== */

.widgets {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: var(--s-3);
  margin-bottom: var(--s-5);
}
.widget {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--s-4);
  box-shadow: var(--shadow-1);
}
.widget .label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  font-weight: 600;
}
.widget .value {
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-top: var(--s-2);
  color: var(--text);
}
.widget .value.dim { color: var(--text-muted); font-weight: 400; }
.widget .sub {
  margin-top: 2px;
  font-size: 12px;
  color: var(--text-muted);
}
.widget.alert { border-color: #F2D9A6; background: var(--warn-bg); }
.widget.alert .value { color: var(--warn); }

/* Clickable widgets render as <a>. Reset link styles and add hover affordance. */
a.widget {
  text-decoration: none;
  color: inherit;
  display: block;
  transition: transform 0.06s ease, box-shadow 0.12s ease, border-color 0.12s ease;
  cursor: pointer;
}
a.widget:hover {
  border-color: var(--gold);
  transform: translateY(-1px);
  box-shadow: var(--shadow-2, 0 4px 12px rgba(0,0,0,0.06));
}
a.widget:active { transform: translateY(0); }

/* ========== Onboarding checklist ========== */

.checklist {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--s-5);
  margin-bottom: var(--s-5);
  box-shadow: var(--shadow-1);
}
.checklist h2 {
  font-size: 16px;
  margin: 0 0 var(--s-1);
}
.checklist .intro {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0 0 var(--s-4);
}
.checklist ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
  counter-reset: step;
}
.checklist li {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-3);
  border: 1px solid var(--border);
  border-radius: var(--r);
  background: var(--surface-2);
}
.checklist li .step {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-soft);
  flex-shrink: 0;
}
.checklist li .label { flex: 1; font-size: 14px; }
.checklist li .go {
  font-size: 13px;
  color: var(--brand-ink);
  text-decoration: none;
  border: 1px solid var(--border-strong);
  padding: 4px var(--s-3);
  border-radius: var(--r-sm);
  background: var(--surface);
}
.checklist li .go:hover { background: var(--bg); }
.checklist li.done { background: var(--ok-bg); border-color: #C7E6D5; }
.checklist li.done .step { background: var(--ok); color: #fff; border-color: var(--ok); }
.checklist li.done .step::after { content: "✓"; }
.checklist li.done .step .num { display: none; }
.checklist li.done .label { color: var(--text-soft); }
.checklist li.done .go { display: none; }
.checklist li:not(.done) .step .num::before { counter-increment: step; content: counter(step); }

/* ========== Placeholder pages ========== */

.placeholder {
  background: var(--surface);
  border: 1px dashed var(--border-strong);
  border-radius: var(--r-lg);
  padding: var(--s-7) var(--s-5);
  text-align: center;
  color: var(--text-muted);
}
.placeholder h2 { margin: 0 0 var(--s-2); color: var(--text); font-size: 18px; }
.placeholder p { margin: 0; font-size: 14px; }

/* ========== Settings ========== */

.kv {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--s-4) var(--s-5);
  box-shadow: var(--shadow-1);
}
.kv dl { display: grid; grid-template-columns: 160px 1fr; gap: var(--s-2) var(--s-4); margin: 0; }
.kv dt { color: var(--text-muted); font-size: 13px; }
.kv dd { margin: 0; font-size: 14px; }

/* ========== Toast ========== */

.toast {
  position: fixed;
  left: 50%;
  bottom: var(--s-5);
  transform: translateX(-50%) translateY(20px);
  background: var(--brand-ink);
  color: var(--text-inverse);
  padding: var(--s-2) var(--s-4);
  border-radius: var(--r);
  font-size: 14px;
  box-shadow: var(--shadow-2);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
  max-width: 90vw;
  z-index: 100;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.ok  { background: var(--ok); }
.toast.err { background: var(--err); }

/* ========== List pages (toolbar + table) ========== */

.toolbar {
  display: flex;
  gap: var(--s-3);
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: var(--s-4);
}
.toolbar .search {
  flex: 1;
  min-width: 220px;
  position: relative;
}
.toolbar .search input {
  width: 100%;
  padding: var(--s-3) var(--s-4);
  font: inherit;
  border: 1px solid var(--border-strong);
  border-radius: var(--r);
  background: var(--surface);
}
.toolbar .search input:focus {
  outline: 2px solid var(--brand-gold);
  outline-offset: 1px;
  border-color: var(--brand-gold);
}
.toolbar select {
  padding: var(--s-3);
  font: inherit;
  border: 1px solid var(--border-strong);
  border-radius: var(--r);
  background: var(--surface);
  min-width: 180px;
}

.list-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-1);
  overflow: hidden;
}

.dtable {
  width: 100%;
  border-collapse: collapse;
}
.dtable th,
.dtable td {
  text-align: left;
  padding: var(--s-3) var(--s-4);
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  vertical-align: middle;
}
.dtable th {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  padding-bottom: var(--s-2);
  white-space: nowrap;
}
.dtable tbody tr:hover { background: #F8F8F6; }
.dtable tr:last-child td { border-bottom: 0; }
.dtable .nowrap { white-space: nowrap; }
.dtable .right { text-align: right; }
.dtable .muted { color: var(--text-muted); }
.dtable .name-cell { font-weight: 500; }

/* Mobile: dtable scrolls horizontally, don't squash columns */
@media (max-width: 640px) {
  .dtable th, .dtable td { padding: var(--s-2) var(--s-3); }
  .dtable th { font-size: 10px; }
}

.empty-row td {
  text-align: center !important;
  padding: var(--s-6) !important;
  color: var(--text-muted);
}

/* Pills (used inside tables and modals) */
.pill {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--info-bg);
  color: var(--info);
  white-space: nowrap;
}
.pill.ok    { background: var(--ok-bg);   color: var(--ok); }
.pill.warn  { background: var(--warn-bg); color: var(--warn); }
.pill.err   { background: var(--err-bg);  color: var(--err); }
.pill.muted { background: var(--surface-2); color: var(--text-muted); border: 1px solid var(--border); }

/* ========== Forms ========== */

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s-4);
}
.form-grid .full { grid-column: 1 / -1; }

.field { margin-bottom: 0; }
.field > label {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  margin-bottom: 5px;
  font-weight: 700;
}
.field > label .req { color: var(--err); }
.field input[type="text"],
.field input[type="email"],
.field input[type="password"],
.field input[type="number"],
.field input[type="date"],
.field input[type="tel"],
.field input[type="url"],
.field select,
.field textarea,
.form-input {
  width: 100%;
  padding: 7px var(--s-3);
  font: inherit;
  font-size: 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--r);
  background: var(--surface);
  transition: border-color 100ms, box-shadow 100ms;
  color: var(--text);
}
.field input:focus,
.field select:focus,
.field textarea:focus,
.form-input:focus {
  outline: none;
  border-color: var(--brand-gold);
  box-shadow: 0 0 0 3px rgba(201,162,39,0.15);
}
.form-input[type="number"],
.form-input[type="date"] { width: 100%; }
.field textarea { resize: vertical; min-height: 80px; font-family: var(--font); }
.field .hint { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.field .err.inline {
  font-size: 12px;
  color: var(--err);
  margin-top: 4px;
  background: transparent;
  padding: 0;
}

.fieldset {
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: var(--s-4);
  margin-bottom: var(--s-4);
  background: var(--surface-2);
}
.fieldset legend {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
  color: var(--text-muted);
  padding: 0 var(--s-2);
}

/* Star rating */
.stars {
  display: inline-flex;
  gap: 2px;
  align-items: center;
}
.stars .star {
  background: transparent;
  border: 0;
  font-size: 22px;
  line-height: 1;
  padding: 0 2px;
  cursor: pointer;
  color: var(--brand-gold);
  font-family: inherit;
}
.stars .star:focus { outline: 2px solid var(--brand-gold); outline-offset: 2px; border-radius: 2px; }

/* Inline stars in tables (read-only) */
.stars-readout {
  color: var(--brand-gold);
  letter-spacing: 1px;
  font-size: 14px;
}
.stars-readout .off { color: var(--border-strong); }

/* ========== Modal ========== */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.35);
  display: grid;
  place-items: center;
  z-index: 1000;
  padding: var(--s-4);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}
.modal {
  background: var(--surface);
  border-radius: var(--r-lg);
  width: 100%;
  max-width: 520px;
  max-height: calc(100vh - 48px);
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-3);
  border: 1px solid var(--border);
}
.modal.wide { max-width: 760px; }
.modal.xl { max-width: 1000px; }
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--s-4) var(--s-5);
  border-bottom: 1px solid var(--border);
}
.modal-head h2 {
  margin: 0;
  font-size: 17px;
}
.modal-close {
  background: transparent;
  border: 0;
  font-size: 22px;
  cursor: pointer;
  color: var(--text-muted);
  padding: 0;
  width: 32px;
  height: 32px;
  border-radius: var(--r-sm);
}
.modal-close:hover { background: var(--surface-2); color: var(--text); }
.modal-body {
  padding: var(--s-5);
  overflow-y: auto;
  overflow-x: visible;
}
.modal-foot {
  display: flex;
  gap: var(--s-2);
  justify-content: flex-end;
  padding: var(--s-3) var(--s-5);
  border-top: 1px solid var(--border);
  background: var(--surface-2);
}

/* ========== Page head actions ========== */

.page-head .actions {
  display: flex;
  gap: var(--s-2);
}

/* ========== Detail view (used by suppliers, assets, etc.) ========== */

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s-3) var(--s-5);
}
.detail-grid .full { grid-column: 1 / -1; }
.detail-grid dt {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  font-weight: 600;
}
.detail-grid dd {
  margin: 0 0 var(--s-3);
  font-size: 14px;
}

/* Calibration intelligence callout */
.cal-intel {
  background: linear-gradient(180deg, #FFFCEF 0%, #FFF8DC 100%);
  border: 1px solid #E6D08A;
  border-radius: var(--r);
  padding: var(--s-4);
  margin-top: var(--s-4);
}
.cal-intel h3 {
  margin: 0 0 var(--s-3);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #7A5A0E;
}
.cal-intel .grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: var(--s-3);
}
.cal-intel .stat .lbl {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}
.cal-intel .stat .val {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  margin-top: 2px;
}
.cal-intel .stat .val.dim { color: var(--text-muted); font-weight: 400; }

/* ========== Categories admin ========== */

.cat-list {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-1);
  overflow: hidden;
}
.cat-row {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-3) var(--s-4);
  border-bottom: 1px solid var(--border);
}
.cat-row:last-child { border-bottom: 0; }
.cat-row .order-btns { display: flex; gap: 2px; }
.cat-row .order-btns button {
  width: 28px;
  height: 28px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  border-radius: var(--r-sm);
  cursor: pointer;
  font-size: 12px;
  color: var(--text-soft);
}
.cat-row .order-btns button:hover { background: var(--surface-2); }
.cat-row .order-btns button[disabled] { opacity: 0.3; cursor: not-allowed; }
.cat-row .name { flex: 1; font-size: 14px; }
.cat-row .ctrls { display: flex; gap: var(--s-2); }

/* ========== Global search ========== */

#globalSearchHost {
  margin-left: var(--s-2);
  margin-right: var(--s-2);
}
.gsearch-trigger {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  background: var(--brand-ink-soft);
  color: var(--text-inverse);
  border: 1px solid rgba(255,255,255,0.08);
  padding: 6px var(--s-3);
  border-radius: var(--r);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
  min-width: 220px;
  text-align: left;
}
.gsearch-trigger:hover { background: rgba(255,255,255,0.08); }
.gsearch-trigger-text { opacity: 0.7; flex: 1; }
.gsearch-icon { font-size: 16px; }

.gsearch-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 200;
  display: none;
  padding-top: 64px;
  justify-content: center;
}
.gsearch[data-open="true"] .gsearch-overlay { display: flex; }

.gsearch-bar {
  background: var(--surface);
  border-radius: var(--r-lg) var(--r-lg) 0 0;
  width: 100%;
  max-width: 640px;
  display: flex;
  align-items: center;
  gap: var(--s-2);
  padding: var(--s-3) var(--s-4);
  border-bottom: 1px solid var(--border);
  height: 56px;
}
.gsearch-bar .gsearch-icon { color: var(--text-muted); font-size: 18px; }
.gsearch-bar input {
  flex: 1;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 16px;
  outline: none;
  color: var(--text);
}
.gsearch-close {
  background: transparent;
  border: 0;
  font-size: 22px;
  cursor: pointer;
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  border-radius: var(--r-sm);
}
.gsearch-close:hover { background: var(--surface-2); color: var(--text); }

.gsearch-results {
  background: var(--surface);
  width: 100%;
  max-width: 640px;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  border-radius: 0 0 var(--r-lg) var(--r-lg);
  position: relative;
}

.search-group { padding: var(--s-2) 0; border-bottom: 1px solid var(--border); }
.search-group:last-child { border-bottom: 0; }
.search-group-head {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  font-weight: 600;
  padding: var(--s-2) var(--s-4);
}
.search-item {
  display: block;
  text-decoration: none;
  color: var(--text);
  padding: var(--s-3) var(--s-4);
  border-bottom: 1px solid transparent;
}
.search-item:hover { background: var(--surface-2); }
.search-item-name { display: block; font-weight: 500; font-size: 14px; }
.search-item-meta { display: block; color: var(--text-muted); font-size: 12px; margin-top: 2px; }

.search-empty { padding: var(--s-5) var(--s-4); text-align: center; color: var(--text-muted); }
.search-empty strong { color: var(--text); display: block; margin-bottom: var(--s-2); }
.search-empty p { margin: 0 0 var(--s-2); font-size: 14px; }
.search-empty .search-hint { font-size: 12px; opacity: 0.8; }

body.search-open { overflow: hidden; }

/* ========== Empty states (proper, not "Coming soon") ========== */

.empty-state {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--s-6) var(--s-5);
  text-align: center;
  box-shadow: var(--shadow-1);
}
.empty-state .icon {
  font-size: 36px;
  display: block;
  margin-bottom: var(--s-3);
  opacity: 0.4;
}
.empty-state h2 {
  margin: 0 0 var(--s-2);
  font-size: 18px;
  color: var(--text);
}
.empty-state p {
  margin: 0 auto var(--s-4);
  font-size: 14px;
  color: var(--text-muted);
  max-width: 480px;
  line-height: 1.55;
}
.empty-state .actions {
  display: inline-flex;
  gap: var(--s-2);
  justify-content: center;
}

/* Report cards (for /reports) */
.reports-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--s-3);
}
.report-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--s-4);
  box-shadow: var(--shadow-1);
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
}
.report-card h3 { margin: 0; font-size: 15px; }
.report-card p { margin: 0; color: var(--text-muted); font-size: 13px; flex: 1; }
.report-card .meta {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: var(--s-2);
}
.report-card .btn { margin-top: var(--s-2); }

a.report-card-link {
  text-decoration: none;
  color: inherit;
  transition: transform 0.06s ease, box-shadow 0.12s ease, border-color 0.12s ease;
}
a.report-card-link:hover {
  border-color: var(--gold);
  transform: translateY(-1px);
  box-shadow: var(--shadow-2, 0 4px 12px rgba(0,0,0,0.06));
}
a.report-card-link .meta { color: var(--gold); font-weight: 500; }

/* Supplier role contact cards (Sales / Service / Tech support) */
.role-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--s-3);
  margin-top: var(--s-4);
}
.role-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: var(--s-3);
}
.role-card h4 {
  margin: 0 0 var(--s-2);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  font-weight: 600;
}

/* Pairing list on asset detail */
.pairing-list { display: flex; flex-direction: column; gap: var(--s-2); }.pairing-row {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-2) var(--s-3);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r);
}
.pairing-name {
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
  flex-shrink: 0;
}
.pairing-name:hover { color: var(--gold); }
.pairing-row .muted { flex: 1; }
.pairing-remove {
  background: none;
  border: 0;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 16px;
  padding: 4px 8px;
  border-radius: 4px;
}
.pairing-remove:hover { background: var(--surface); color: var(--err); }

/* ========== Settings sub-page layout ========== */

.settings-shell {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: var(--s-5);
  align-items: start;
}
.settings-nav {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--s-2);
  box-shadow: var(--shadow-1);
  position: sticky;
  top: calc(var(--header-h) + var(--s-3));
}
.settings-nav a {
  display: block;
  padding: var(--s-2) var(--s-3);
  border-radius: var(--r-sm);
  color: var(--text);
  text-decoration: none;
  font-size: 14px;
}
.settings-nav a:hover { background: var(--surface-2); }
.settings-nav a[aria-current="page"] {
  background: var(--brand-ink);
  color: var(--text-inverse);
  font-weight: 500;
}
.settings-nav .group-head {
  padding: var(--s-2) var(--s-3) 4px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  font-weight: 600;
}

/* ========== Phase 5: Asset form sections ========== */

.asset-form-section {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: var(--s-4);
  margin-bottom: var(--s-3);
}
.asset-form-section h3 {
  margin: 0 0 var(--s-3);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  font-weight: 600;
}

/* Asset picker (multi-select for check-out) */
.asset-picker {
  border: 1px solid var(--border);
  border-radius: var(--r);
  background: var(--surface);
  max-height: 280px;
  overflow-y: auto;
}
.asset-pick {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-3);
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}
.asset-pick:last-child { border-bottom: 0; }
.asset-pick:hover { background: var(--surface-2); }
.asset-pick input[type="checkbox"] { width: 18px; height: 18px; cursor: pointer; }
.asset-pick-text { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.asset-pick-name { font-size: 14px; font-weight: 500; }
.asset-pick-meta { font-size: 12px; }

/* Check In/Out landing cards */
.ciio-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s-4);
}
.ciio-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--s-5);
  box-shadow: var(--shadow-1);
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
}
.ciio-card-head { display: flex; align-items: center; justify-content: space-between; }
.ciio-card-head h2 { margin: 0; font-size: 17px; }
.ciio-card p { margin: 0; color: var(--text-muted); font-size: 14px; }

.ciio-out-list {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: var(--r);
  background: var(--surface-2);
  max-height: 360px;
  overflow-y: auto;
}
.ciio-out-row {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-3);
  border-bottom: 1px solid var(--border);
}
.ciio-out-row:last-child { border-bottom: 0; }
.ciio-out-text { flex: 1; min-width: 0; }
.ciio-out-name { font-weight: 500; font-size: 14px; }
.ciio-out-meta { font-size: 12px; }

/* Assignments groups */
.assign-group { margin-bottom: var(--s-5); }
.assign-group-head {
  display: flex;
  align-items: baseline;
  gap: var(--s-3);
  margin-bottom: var(--s-2);
}
.assign-group-head h3 { margin: 0; font-size: 16px; }

/* Segmented control */
.seg {
  display: inline-flex;
  border: 1px solid var(--border-strong);
  border-radius: var(--r);
  overflow: hidden;
  background: var(--surface);
}
.seg-btn {
  background: transparent;
  border: 0;
  padding: var(--s-2) var(--s-3);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  color: var(--text-soft);
  border-right: 1px solid var(--border);
}
.seg-btn:last-child { border-right: 0; }
.seg-btn:hover { background: var(--surface-2); }
.seg-btn.on { background: var(--brand-ink); color: var(--text-inverse); font-weight: 500; }

/* ========== Mobile ========== */

@media (max-width: 760px) {
  .view { padding: var(--s-4) var(--s-3); }
  .kv dl { grid-template-columns: 1fr; gap: 2px var(--s-3); }
  .kv dt { margin-top: var(--s-2); }

  /* Phase 3 mobile */
  .form-grid { grid-template-columns: 1fr; gap: var(--s-3); }
  .detail-grid { grid-template-columns: 1fr; }
  .dtable thead { display: none; }
  .dtable, .dtable tbody, .dtable tr, .dtable td { display: block; }
  .dtable tr {
    padding: var(--s-3);
    border-bottom: 1px solid var(--border);
  }
  .dtable td {
    padding: 4px 0;
    border-bottom: 0;
  }
  .dtable td::before {
    content: attr(data-label) ": ";
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    font-weight: 600;
    display: inline-block;
    min-width: 100px;
  }
  .dtable td.no-label::before { content: ""; min-width: 0; }
  .toolbar { flex-direction: column; align-items: stretch; }
  .modal { max-height: calc(100vh - 16px); }

  /* Phase 3.5 mobile */
  #globalSearchHost { margin: 0; flex: 1; }
  .gsearch-trigger { min-width: 0; width: 100%; }
  .gsearch-trigger-text { display: none; }
  .gsearch-overlay { padding-top: 0; }
  .gsearch-bar { border-radius: 0; }
  .gsearch-results {
    max-height: calc(100vh - 56px);
    border-radius: 0;
  }

  .settings-shell { grid-template-columns: 1fr; gap: var(--s-3); }
  .settings-nav { position: static; }
  .settings-nav { display: flex; flex-wrap: wrap; gap: 2px; padding: var(--s-2); }
  .settings-nav a { flex: 0 0 auto; }
  .settings-nav .group-head { width: 100%; }

  /* Phase 5 mobile */
  .ciio-cards { grid-template-columns: 1fr; }
  .seg { width: 100%; }
  .seg-btn { flex: 1; padding: var(--s-2); font-size: 12px; }
}

/* ========== Phase 6: Damage list ========== */

.damage-list {
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
}
.damage-row {
  padding: var(--s-3);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r);
}
.damage-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-2);
  margin-bottom: var(--s-2);
}
.damage-notes {
  font-size: 14px;
  white-space: pre-wrap;
  margin-bottom: var(--s-2);
}
.damage-edit {
  background: none;
  border: 0;
  color: var(--gold);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  padding: 4px 8px;
  border-radius: 4px;
}
.damage-edit:hover { background: var(--surface); }

/* Highlight columns when filter from dashboard click-through is active */
.dtable th.col-highlight {
  background: var(--warn-bg, #FBF3E3);
  color: var(--text);
}
.dtable td.col-highlight {
  background: rgba(248, 211, 119, 0.08);
}

/* ========== Phase 7a: Activity timeline ========== */

.timeline {
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
  position: relative;
}
.timeline-event {
  display: flex;
  gap: var(--s-3);
  padding: var(--s-2) 0;
  border-bottom: 1px solid var(--border);
}
.timeline-event:last-child { border-bottom: 0; }
.timeline-icon {
  width: 32px;
  flex-shrink: 0;
  text-align: center;
  font-size: 18px;
  line-height: 32px;
}
.timeline-body { flex: 1; min-width: 0; }
.timeline-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s-2);
  margin-bottom: 2px;
}
.timeline-title { font-weight: 600; font-size: 14px; }
.timeline-date { font-size: 12px; white-space: nowrap; }
.timeline-detail { font-size: 14px; margin-bottom: 2px; }
.timeline-meta { font-size: 12px; }

/* ========== Phase 7a: Legacy view fold-out ========== */

.legacy-view {
  margin-top: var(--s-4);
  border-top: 1px dashed var(--border);
  padding-top: var(--s-3);
}
.legacy-view > summary {
  cursor: pointer;
  color: var(--text-muted);
  font-size: 13px;
  padding: var(--s-2) 0;
  user-select: none;
}
.legacy-view > summary:hover { color: var(--text); }
.legacy-view[open] > summary { margin-bottom: var(--s-3); }
.legacy-view-inner > * + * { margin-top: var(--s-3); }

/* Phase 7a: cancelled events on timeline render muted */
.timeline-event.muted-event {
  opacity: 0.6;
}
.timeline-event.muted-event .timeline-title {
  font-weight: 500;
  text-decoration: line-through;
  text-decoration-thickness: 1px;
  text-decoration-color: var(--text-muted);
}

/* ========== Phase 7a: Certificates ========== */

.cert-list { display: flex; flex-direction: column; gap: var(--s-2); }
.cert-row {
  display: flex;
  gap: var(--s-3);
  padding: var(--s-3);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r);
  align-items: flex-start;
}
.cert-icon {
  flex-shrink: 0;
  font-size: 22px;
  line-height: 1;
  width: 32px;
  text-align: center;
}
.cert-body { flex: 1; min-width: 0; }
.cert-head {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  flex-wrap: wrap;
  margin-bottom: 4px;
}
.cert-name {
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
  text-decoration: none;
}
.cert-name:hover { color: var(--gold); text-decoration: underline; }
.cert-meta { font-size: 12px; }
.cert-notes { font-size: 13px; margin-top: 4px; white-space: pre-wrap; }
.cert-actions {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex-shrink: 0;
}
.cert-actions .btn-link {
  background: none;
  border: 0;
  color: var(--text-muted);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  padding: 4px 8px;
  border-radius: 4px;
  text-align: right;
}
.cert-actions .btn-link:hover { background: var(--surface); color: var(--text); }
.cert-actions .cert-delete:hover { color: var(--err); }

/* ========== Phase 7b: Reports grid ========== */

.report-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--s-3);
}
.report-grid .report-card-link {
  padding: var(--s-4);
  display: flex;
  flex-direction: column;
  gap: var(--s-1);
}

/* ========== Phase 7c: Add Asset wizard ========== */

.wizard-form { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-3); }
.wizard-form .full { grid-column: 1 / -1; }
@media (max-width: 640px) { .wizard-form { grid-template-columns: 1fr; } }

.wizard-footer {
  display: flex;
  justify-content: flex-end;
  gap: var(--s-2);
  margin-top: var(--s-4);
  padding-top: var(--s-3);
  border-top: 1px solid var(--border);
}

.wizard-prompt {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: var(--s-3);
}
.wizard-prompt-q { font-weight: 600; margin-bottom: var(--s-2); }
.wizard-radio { display: inline-flex; align-items: center; gap: 6px; margin-right: var(--s-3); cursor: pointer; }

.wizard-more { grid-column: 1 / -1; }
.wizard-more summary { cursor: pointer; color: var(--text-muted); padding: var(--s-2) 0; }
.wizard-more-inner { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-3); margin-top: var(--s-2); }
@media (max-width: 640px) { .wizard-more-inner { grid-template-columns: 1fr; } }

/* Step 2: choice cards */
.wizard-choice { text-align: center; padding: var(--s-4) 0; }
.wizard-choice-q { font-size: 16px; margin-bottom: var(--s-4); }
.wizard-choice-cards { display: flex; gap: var(--s-3); justify-content: center; flex-wrap: wrap; }
.wizard-card {
  flex: 1;
  min-width: 160px;
  max-width: 240px;
  padding: var(--s-5);
  background: var(--surface-2);
  border: 2px solid var(--border);
  border-radius: var(--r);
  cursor: pointer;
  transition: border-color .12s, background .12s;
}
.wizard-card:hover { border-color: var(--gold); background: var(--surface); }
.wizard-card-title { font-size: 18px; font-weight: 700; margin-bottom: 4px; }
.wizard-card-sub { color: var(--text-muted); font-size: 13px; }

/* Step 3: package builder */
.wizard-pkg-main {
  padding: var(--s-3);
  background: var(--surface-2);
  border-radius: var(--r);
  margin-bottom: var(--s-3);
  display: flex;
  align-items: center;
  gap: var(--s-2);
}
.wizard-quickadd { margin-bottom: var(--s-3); }
.wizard-quickadd-label { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); margin-bottom: var(--s-2); }
.wizard-quickadd-btns { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.quickadd-btn { font-size: 13px; }

.wizard-items { display: flex; flex-direction: column; gap: var(--s-3); }
.wizard-item-card {
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: var(--s-3);
  background: var(--surface-2);
}
.wizard-item-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s-2); margin-bottom: var(--s-2); }
.wizard-item-head .wiz-cat { flex: 1; max-width: 260px; }
.wizard-item-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: var(--s-2); }
@media (max-width: 640px) { .wizard-item-grid { grid-template-columns: 1fr; } }
.wiz-mini { display: flex; flex-direction: column; font-size: 12px; color: var(--text-muted); gap: 4px; }
.wiz-mini input, .wiz-mini select { font-size: 14px; padding: 6px 8px; }
.wiz-serial-hint { font-size: 11px; color: var(--text-muted); margin-top: var(--s-2); font-style: italic; }
.wiz-remove { color: var(--err); }

/* ========== Phase 7c: Spend view banner ========== */

.spend-banner {
  display: flex;
  gap: var(--s-4);
  flex-wrap: wrap;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: var(--s-4);
  margin-bottom: var(--s-3);
}
.spend-total { flex: 1; min-width: 220px; }
.spend-total-label { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); }
.spend-total-value { font-size: 28px; font-weight: 700; margin: 4px 0; }
.spend-breakdowns { display: flex; gap: var(--s-4); flex-wrap: wrap; }
.spend-breakdown { min-width: 180px; }
.spend-breakdown h4 { margin: 0 0 var(--s-2); font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); }
.spend-row { display: flex; justify-content: space-between; gap: var(--s-3); font-size: 13px; padding: 2px 0; }
.spend-row span:last-child { font-weight: 600; white-space: nowrap; }

/* ========== Phase 10A: auth success message ========== */
.ok-msg {
  background: color-mix(in srgb, var(--ok, #2e7d32) 12%, transparent);
  border: 1px solid var(--ok, #2e7d32);
  color: var(--text);
  border-radius: var(--r);
  padding: var(--s-3);
  font-size: 14px;
  margin-bottom: var(--s-3);
}

/* ========== Phase 10B.1: CSV import ========== */
.import-drop {
  border: 2px dashed var(--border);
  border-radius: var(--r);
  padding: var(--s-6, 32px) var(--s-4);
  text-align: center;
  transition: border-color .12s, background .12s;
}
.import-drop.drag { border-color: var(--gold); background: var(--surface-2); }
.import-table th, .import-table td { white-space: nowrap; }
.import-table td:last-child { white-space: normal; max-width: 360px; }
.import-row-err { background: color-mix(in srgb, var(--err, #c62828) 6%, transparent); }

/* Onboarding checklist — primary (equipment) step emphasis */
.checklist li.primary {
  border: 1px solid var(--gold);
  border-radius: var(--r);
  padding: var(--s-2) var(--s-3);
  background: color-mix(in srgb, var(--gold) 6%, transparent);
}

/* ========== Phase 10B.2: Demo badge ========== */
.demo-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--gold);
  color: #1a1a1a;
  margin-left: 8px;
  vertical-align: middle;
}

/* ========== Phase 9B: locked field display (report theft form) ========== */
.locked-field {
  padding: var(--s-2) var(--s-3);
  background: var(--surface-2, #f5f5f5);
  border: 1px solid var(--border);
  border-radius: var(--r);
  color: var(--text);
  font-weight: 600;
}

/* ================================================================
   FEATURE LOCKED VIEW
   ================================================================ */
.feature-locked-view {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--s-6) var(--s-4);
  max-width: 480px;
  margin: 0 auto;
}
.flv-icon {
  font-size: 40px;
  margin-bottom: var(--s-4);
  opacity: .6;
}
.flv-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
  margin: 0 0 var(--s-2);
}
.flv-desc {
  font-size: 15px;
  color: var(--text-soft);
  margin: 0 0 var(--s-3);
  line-height: 1.6;
}
.flv-bullets {
  list-style: none;
  padding: 0;
  margin: 0 0 var(--s-4);
  text-align: left;
}
.flv-bullets li {
  font-size: 14px;
  color: var(--text-soft);
  padding: 4px 0;
}
.flv-bullets li::before {
  content: "✓ ";
  color: var(--brand-gold);
  font-weight: 700;
}
.flv-tier {
  font-size: 14px;
  color: var(--text-muted);
  margin: 0 0 var(--s-5);
}
.flv-tier strong {
  color: var(--text);
}
.flv-actions {
  display: flex;
  gap: var(--s-3);
  flex-wrap: wrap;
  justify-content: center;
}

/* Locked nav items */
.nav-locked {
  opacity: .55;
  cursor: pointer;
}
.nav-locked:hover {
  opacity: .75;
}
/* Suppress active indicator on locked items */
.nav-locked[aria-current] {
  opacity: .55;
}

/* ================================================================
   DASHBOARD — Command Centre
   ================================================================ */

/* Hero */
.dash-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--s-3);
  background: var(--brand-ink);
  color: var(--text-inverse);
  border-radius: var(--r-lg);
  padding: var(--s-5) var(--s-5);
  margin-bottom: var(--s-4);
}
.dash-hero-company {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #fff;
}
.dash-hero-date {
  font-size: 13px;
  opacity: 0.55;
  margin-top: 2px;
}
.dash-hero-summary {
  font-size: 13px;
  opacity: 0.75;
  text-align: right;
}
.dash-hero-summary strong { color: var(--brand-gold); opacity: 1; }

/* Metric cards */
.dash-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: var(--s-3);
  margin-bottom: var(--s-5);
}
.dash-metric {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--s-4);
  display: flex;
  align-items: flex-start;
  gap: var(--s-3);
  box-shadow: var(--shadow-1);
  text-decoration: none;
  color: inherit;
  transition: transform 0.06s, box-shadow 0.12s, border-color 0.12s;
}
a.dash-metric:hover {
  border-color: var(--brand-gold);
  transform: translateY(-1px);
  box-shadow: var(--shadow-2);
  cursor: pointer;
}
.dash-metric--alert {
  border-color: #F2D9A6;
  background: var(--warn-bg);
}
.dm-icon { font-size: 22px; line-height: 1; flex-shrink: 0; margin-top: 2px; }
.dm-body { min-width: 0; }
.dm-value {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--text);
}
.dm-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  font-weight: 600;
  margin-top: var(--s-1);
}
.dm-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Sections */
.dash-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--s-5);
  margin-bottom: var(--s-4);
  box-shadow: var(--shadow-1);
}
.dash-section-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--s-4);
}
.dash-section-title {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}
.dash-section-title--alert { color: var(--err); }
.dash-section-link {
  font-size: 13px;
  color: var(--brand-gold);
  text-decoration: none;
  font-weight: 600;
}
.dash-section-link:hover { text-decoration: underline; }
.dash-empty {
  font-size: 14px;
  color: var(--text-muted);
  padding: var(--s-2) 0;
}
.dash-empty a { color: var(--brand-gold); }

/* Attention required */
.att-panel { display: flex; flex-direction: column; gap: 0; }
.att-item {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.att-item:last-child { border-bottom: none; }
.att-icon { font-size: 16px; flex-shrink: 0; }
.att-text { flex: 1; font-size: 13px; color: var(--text); line-height: 1.4; }
.att-link {
  font-size: 12px;
  font-weight: 700;
  color: var(--brand-gold);
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
}
.att-link:hover { text-decoration: underline; }
.att--red .att-text strong  { color: var(--err); }
.att--amber .att-text strong { color: var(--warn); }
.att-clear {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-3) 0;
  font-size: 14px;
  color: var(--ok);
  font-weight: 600;
}
.att-clear-icon { font-size: 18px; }

/* Schedule table */
.sched-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.sched-table th {
  text-align: left;
  padding: 6px 10px 8px 0;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  font-weight: 700;
  border-bottom: 2px solid var(--border);
}
.sched-table th:last-child { padding-right: 0; }
.sched-row td {
  padding: 9px 10px 9px 0;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.sched-row:last-child td { border-bottom: none; }
.sched-time {
  color: var(--text-muted);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  min-width: 90px;
}
.sched-eng { font-weight: 600; min-width: 110px; }
.sched-job { max-width: 260px; }
.sched-job-name { display: block; font-weight: 500; }
.sched-job-client { display: block; font-size: 11px; color: var(--text-muted); margin-top: 1px; }
.sched-status { white-space: nowrap; padding-right: var(--s-3) !important; }
.sched-icons { text-align: right; padding-right: 0 !important; }

/* Status chips */
.sched-chip {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
  white-space: nowrap;
}
.sched-chip--planned { background: #f1f5f9; color: #64748b; }
.sched-chip--active  { background: #dbeafe; color: #1d4ed8; }
.sched-chip--onsite  { background: #dcfce7; color: #15803d; }
.sched-chip--done    { background: #f3f4f6; color: #374151; }
.sched-chip--issue   { background: #fee2e2; color: #991b1b; }

/* Activity feed */
.feed { display: flex; flex-direction: column; gap: 0; }
.feed-item {
  display: flex;
  align-items: flex-start;
  gap: var(--s-3);
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
  position: relative;
}
.feed-item:last-child { border-bottom: none; }
.feed-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  flex-shrink: 0;
  margin-top: 1px;
  opacity: 0.85;
}
.feed-body { flex: 1; min-width: 0; }
.feed-text { font-size: 13px; color: var(--text); line-height: 1.4; }
.feed-time { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* Project cards */
.proj-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: var(--s-3);
}
.proj-card {
  display: flex;
  flex-direction: column;
  gap: var(--s-1);
  padding: var(--s-4);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.12s, box-shadow 0.12s;
  position: relative;
}
.proj-card:hover { border-color: var(--brand-gold); box-shadow: var(--shadow-2); }
.proj-card-name  { font-weight: 700; font-size: 14px; color: var(--text); }
.proj-card-client { font-size: 12px; color: var(--text-muted); }
.proj-card-badge {
  display: inline-block;
  margin-top: var(--s-2);
  padding: 2px 8px;
  background: #dcfce7;
  color: #15803d;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  align-self: flex-start;
}

/* Upgrade teaser */
.dash-teaser {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--s-3);
  padding: var(--s-4) var(--s-5);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r);
  margin-top: var(--s-4);
}
.dash-teaser-text { font-size: 14px; color: var(--text-soft); }
.dash-teaser-plan { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.dash-teaser-link {
  font-size: 13px;
  font-weight: 700;
  color: var(--brand-gold);
  text-decoration: none;
  white-space: nowrap;
}
.dash-teaser-link:hover { text-decoration: underline; }

/* ================================================================
   CALENDAR — Month view
   ================================================================ */

/* Month grid wrapper (inside .ap-calendar-wrap) */
.ap-month-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  border-left: 1px solid #E5E7EB;
  border-top: 1px solid #E5E7EB;
  background: #fff;
  min-height: 520px;
}

/* Day-of-week header row */
.ap-month-dow {
  background: #F9FAFB;
  border-right: 1px solid #E5E7EB;
  border-bottom: 1px solid #E5E7EB;
  padding: 8px 0;
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #9CA3AF;
}
.ap-month-dow.is-weekend { color: #D1D5DB; }

/* Day cells */
.ap-month-cell {
  border-right: 1px solid #E5E7EB;
  border-bottom: 1px solid #E5E7EB;
  min-height: 90px;
  padding: 4px;
  vertical-align: top;
  cursor: pointer;
  transition: background 0.08s;
}
.ap-month-cell:hover { background: #F0F7FF; }
.ap-month-cell.is-other-month { background: #FAFAFA; }
.ap-month-cell.is-today { background: #EFF6FF; }
.ap-month-cell.is-today .ap-month-dn { background: #2563EB; color: #fff; }
.ap-month-cell.is-weekend .ap-month-dn { color: #9CA3AF; }

/* Date number */
.ap-month-dn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 600;
  color: #374151;
  margin-bottom: 2px;
}

/* Event pills inside day cells */
.ap-month-pill {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  margin-bottom: 2px;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  line-height: 1.4;
}
.ap-month-pill:hover { filter: brightness(0.93); }
.ap-month-pill-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
  background: currentColor;
}
.ap-month-more {
  font-size: 10px;
  color: #9CA3AF;
  padding: 1px 4px;
  cursor: pointer;
}
.ap-month-more:hover { color: #2563EB; }

/* Month nav label */
.ap-month-label {
  font-size: 16px;
  font-weight: 700;
  color: #1A1A1A;
  margin: 0 var(--s-2);
}

/* ================================================================
   WEEK TIME GRID VIEW
   ================================================================ */
.wk-grid-wrap {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid #E5E7EB;
  border-radius: var(--r);
  overflow: hidden;
  min-width: 600px;
}

/* Day header row */
.wk-header-row {
  display: flex;
  border-bottom: 2px solid #E5E7EB;
  background: #F9FAFB;
}
.wk-time-gutter-hd {
  width: 52px;
  flex-shrink: 0;
  border-right: 1px solid #E5E7EB;
}
.wk-day-hd {
  flex: 1;
  min-width: 0;
  padding: 8px 4px;
  text-align: center;
  border-right: 1px solid #E5E7EB;
}
.wk-day-hd:last-child { border-right: none; }
.wk-day-hd.is-today { background: #EFF6FF; }
.wk-day-hd.is-weekend { background: #FAFAFA; }
.wk-day-name {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: #9CA3AF;
}
.wk-day-num {
  font-size: 20px;
  font-weight: 700;
  color: #374151;
  line-height: 1.1;
  margin-top: 2px;
}
.wk-day-num.is-today {
  background: #2563EB;
  color: #fff;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* All-day strip */
.wk-allday-header-row {
  display: flex;
  border-bottom: 1px solid #E5E7EB;
  background: #FAFAFA;
  min-height: 32px;
}
.wk-time-gutter-allday {
  width: 52px;
  flex-shrink: 0;
  border-right: 1px solid #E5E7EB;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: #9CA3AF;
  display: flex;
  align-items: center;
  justify-content: center;
}
.wk-allday-cols { display: flex; flex: 1; }
.wk-allday-col-hd {
  flex: 1;
  min-width: 0;
  padding: 4px;
  border-right: 1px solid #E5E7EB;
  cursor: pointer;
}
.wk-allday-col-hd:last-child { border-right: none; }
.wk-allday-pill {
  display: block;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  margin-bottom: 2px;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.wk-allday-pill:hover { filter: brightness(.9); }
.wk-allday-empty { font-size: 11px; color: #D1D5DB; padding: 4px; }

/* Scrollable body */
.wk-scroll-area {
  display: flex;
  overflow-y: auto;
  max-height: 560px;
}

/* Time gutter */
.wk-time-gutter {
  width: 52px;
  flex-shrink: 0;
  border-right: 1px solid #E5E7EB;
  background: #FAFAFA;
  position: relative;
}
.wk-time-label {
  position: absolute;
  right: 8px;
  font-size: 10px;
  font-weight: 600;
  color: #9CA3AF;
  transform: translateY(-50%);
  white-space: nowrap;
}
.wk-time-half { display: none; }

/* Day columns area */
.wk-days-area {
  flex: 1;
  display: flex;
  min-width: 0;
}
.wk-day-col {
  flex: 1;
  min-width: 0;
  border-right: 1px solid #E5E7EB;
  position: relative;
  cursor: pointer;
}
.wk-day-col:last-child { border-right: none; }
.wk-day-col.is-today { background: #FAFFFE; }
.wk-day-col.is-weekend { background: #FAFAFA; }

/* Grid lines */
.wk-grid-line {
  position: absolute;
  left: 0; right: 0;
  border-top: 1px solid #E5E7EB;
  pointer-events: none;
}
.wk-grid-half { border-top-style: dashed; border-color: #F3F4F6; }

/* Event blocks */
.wk-event {
  position: absolute;
  left: 2px; right: 2px;
  border-radius: 4px;
  padding: 2px 6px;
  overflow: hidden;
  cursor: pointer;
  z-index: 1;
  transition: filter .1s;
}
.wk-event:hover { filter: brightness(.93); z-index: 2; }
.wk-event-time {
  font-size: 10px;
  font-weight: 700;
  opacity: .75;
  white-space: nowrap;
}
.wk-event-label {
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.wk-event-badge {
  font-size: 9px;
  font-weight: 700;
  color: #15803d;
  margin-top: 2px;
}

/* ================================================================
   OLD-STYLE METRIC CARDS (matching original dashboard reference)
   ================================================================ */
.ocard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: var(--s-3);
  align-items: stretch;
}
.ocard {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--s-4) var(--s-4) var(--s-3);
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-decoration: none;
  color: inherit;
  min-height: 92px;
  transition: border-color .12s, box-shadow .12s, transform .06s;
  box-shadow: var(--shadow-1);
}
a.ocard:hover {
  border-color: var(--brand-gold);
  box-shadow: var(--shadow-2);
  transform: translateY(-1px);
}
.ocard--alert {
  background: var(--err-bg);
  border-color: #F5B7B7;
}
.ocard--warn {
  background: var(--warn-bg);
  border-color: #F2D9A6;
}
.ocard-label {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-muted);
  line-height: 1.3;
}
.ocard-value {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text);
  line-height: 1;
  margin: 4px 0 2px;
}
.ocard--alert .ocard-value { color: var(--err); }
.ocard--warn  .ocard-value { color: var(--warn); }
.ocard-sub {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.3;
}

/* Hero user line */
.dash-hero-user {
  font-size: 12px;
  opacity: 0.45;
  margin-top: 2px;
}

/* Demo upgrade locked-view additions */
.flv-demo-note {
  font-size: 11px;
  color: var(--text-muted);
  margin: var(--s-2) 0 0;
  text-align: center;
}
.flv-hints li::before { content: "✓ "; color: var(--brand-gold); font-weight: 700; }

/* ================================================================
   ADMIN CUSTOMERS / ACTIVATION PANEL
   ================================================================ */
.cust-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--s-5);
  box-shadow: var(--shadow-1);
  margin-bottom: var(--s-4);
}
.cust-card--primary {
  border-left: 4px solid var(--brand-gold);
}
.cust-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--s-3);
  margin-bottom: var(--s-4);
  flex-wrap: wrap;
}
.cust-card-name {
  font-size: 18px;
  font-weight: 800;
  color: var(--text);
}
.cust-card-slug {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
  font-family: monospace;
}
.cust-card-badges {
  display: flex;
  gap: var(--s-2);
  flex-wrap: wrap;
}
.cust-card-form {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: var(--s-3);
  align-items: end;
  margin-bottom: var(--s-4);
}
@media (max-width: 560px) {
  .cust-card-form { grid-template-columns: 1fr; }
}
.cust-form-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-muted);
  margin-bottom: var(--s-1);
}
.cust-card-meta {
  display: flex;
  gap: var(--s-4);
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--text-muted);
  padding-top: var(--s-3);
  border-top: 1px solid var(--border);
}
.cust-card-meta code {
  font-size: 11px;
  background: var(--surface-2);
  padding: 1px 6px;
  border-radius: 4px;
  font-family: monospace;
}

/* ================================================================
   ADMIN CUSTOMERS TABLE
   ================================================================ */
.cust-toolbar {
  display: flex;
  gap: var(--s-3);
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: var(--s-4);
}
.cust-table {
  font-size: 13px;
  min-width: 680px;
}
.cust-table th {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .07em;
  font-weight: 700;
  color: var(--text-muted);
  padding: 8px 12px 8px 0;
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
}
.cust-table td {
  padding: 10px 12px 10px 0;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.cust-table tr:last-child td { border-bottom: none; }
.cust-name { font-weight: 700; color: var(--text); }
.cust-slug { font-size: 11px; color: var(--text-muted); font-family: monospace; }
.cust-td-num  { text-align: right; padding-right: var(--s-4) !important; }
.cust-td-date { white-space: nowrap; color: var(--text-muted); }
.cust-td-actions { text-align: right; }
.cust-td-onboard { white-space: nowrap; }

/* ================================================================
   T4 COMMERCIAL — ENQUIRIES + QUOTES
   ================================================================ */

/* Enquiry pipeline status bar */
.enq-pipeline {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0;
  margin-bottom: var(--s-4);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: var(--s-2) var(--s-3);
  overflow-x: auto;
}
.enq-step {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  padding: 4px 8px;
  border-radius: 4px;
  white-space: nowrap;
}
.enq-step--done   { color: var(--ok); }
.enq-step--active { background: var(--brand-ink); color: #fff; }
.enq-step-arrow   { color: var(--text-muted); font-size: 13px; padding: 0 2px; }

/* Internal notes feed */
.enq-note {
  padding: var(--s-3);
  background: var(--surface-2);
  border-radius: var(--r);
  margin-bottom: var(--s-2);
  border-left: 3px solid var(--warn);
}
.enq-note-body { font-size: 14px; color: var(--text); margin-bottom: 4px; white-space: pre-wrap; }
.enq-note-meta { font-size: 11px; color: var(--text-muted); }

/* KV table inside detail cards */
.kv-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.kv-table th {
  text-align: left; padding: 6px 12px 6px 0;
  color: var(--text-muted); font-weight: 600;
  width: 38%; border-bottom: 1px solid var(--border);
  font-size: 12px;
}
.kv-table td { padding: 6px 0; border-bottom: 1px solid var(--border); }
.kv-table tr:last-child th,
.kv-table tr:last-child td { border-bottom: none; }

/* Live margin panel */
.quote-margin-panel {
  margin-top: var(--s-4);
  padding: var(--s-4);
  background: var(--brand-ink);
  color: #fff;
  border-radius: var(--r);
}
.qm-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 0;
  font-size: 14px;
  border-bottom: 1px solid rgba(255,255,255,.1);
}
.qm-row:last-child { border-bottom: none; }
.qm-row span { opacity: .7; }
.qm-row strong { font-size: 16px; }
.qm-profit strong { color: #4ade80; }
.qm-margin strong { font-size: 22px; letter-spacing: -0.03em; }
.qm-margin.quote-margin--ok     strong { color: #4ade80; }
.qm-margin.quote-margin--amber  strong { color: #fbbf24; }
.qm-margin.quote-margin--red    strong { color: #f87171; }

/* Margin colour classes for list */
.quote-margin--red   { color: var(--err); font-weight: 700; }
.quote-margin--amber { color: var(--warn); font-weight: 700; }
.quote-margin--ok    { color: var(--ok); }

/* Customer quote preview (print) */
.quote-preview {
  max-width: 680px;
  margin: 0 auto;
  font-family: Arial, sans-serif;
  font-size: 14px;
  color: #111;
}
.qp-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding-bottom: var(--s-4);
  border-bottom: 3px solid #111;
  margin-bottom: var(--s-4);
}
.qp-company { font-size: 22px; font-weight: 800; }
.qp-section { margin-bottom: var(--s-4); }
.qp-section-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: #777;
  margin-bottom: var(--s-1);
}
.qp-client-name { font-size: 18px; font-weight: 700; }
.qp-address { color: #555; margin-top: 4px; }
.qp-body { line-height: 1.6; white-space: pre-wrap; }
.qp-value-section { border-top: 2px solid #111; padding-top: var(--s-3); }
.qp-total { font-size: 28px; font-weight: 700; }

@media print {
  .modal-foot, .modal-close, button { display: none !important; }
  .modal-backdrop { position: static !important; background: none !important; }
  .modal { box-shadow: none !important; border: none !important; max-width:100% !important; }
}

/* Quote snapshot panel — immutable record captured at send */
.quote-snapshot-panel {
  margin-top: var(--s-3);
  padding: var(--s-3) var(--s-4);
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: var(--r);
  opacity: .85;
}
.qsp-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: rgba(255,255,255,.45);
  margin-bottom: 8px;
}

/* ================================================================
   CONFLICT DETECTION — structured conflict blocks and reassignment
   ================================================================ */
.conflict-block {
  background: var(--warn-bg);
  border: 1px solid #F2D9A6;
  border-left: 4px solid var(--warn);
  border-radius: var(--r);
  padding: var(--s-4);
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
}
.conflict-icon { font-size: 20px; }
.conflict-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 2px;
}
.conflict-detail {
  font-size: 13px;
  color: var(--text-soft);
  line-height: 1.5;
}
.conflict-action {
  font-size: 12px;
  color: var(--text-muted);
  font-style: italic;
}
.conflict-btns {
  display: flex;
  gap: var(--s-2);
  flex-wrap: wrap;
}

/* Reassignment banner — shown below diary toolbar after an override */
.reassign-banner {
  display: flex;
  align-items: flex-start;
  gap: var(--s-3);
  flex-wrap: wrap;
  padding: var(--s-3) var(--s-4);
  background: #FFFBEB;
  border: 1px solid #F59E0B;
  border-radius: var(--r);
  margin: var(--s-3) 0;
  font-size: 13px;
}
.reassign-icon { font-size: 18px; flex-shrink: 0; }
.reassign-text { flex: 1; min-width: 200px; line-height: 1.4; }
.reassign-btns { display: flex; gap: var(--s-2); flex-wrap: wrap; }
.reassign-dismiss { color: var(--text-muted); }

/* ================================================================
   POLISH SPRINT — utility additions
   ================================================================ */

/* form-label: matches new .field > label style, for inline HTML usage */
.form-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  margin-bottom: 5px;
}

/* form-input (already declared in field block above — textarea variant) */
textarea.form-input { resize: vertical; min-height: 72px; font-family: var(--font); }
select.form-input { cursor: pointer; }

/* Smooth page transitions */
.page-wrap {
  animation: pageFadeIn 120ms ease;
}
@keyframes pageFadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Clickable rows — cursor pointer */
.dtable tbody tr { cursor: pointer; }

/* List toolbar spacing */
.list-toolbar {
  display: flex;
  gap: var(--s-3);
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: var(--s-4);
}

/* Danger button — consolidated here, remove duplicate */
.btn.danger {
  background: var(--err-bg);
  border-color: #f5b7b7;
  color: var(--err);
}
.btn.danger:hover { background: var(--err); color: #fff; border-color: var(--err); }

/* Section headings inside content areas */
.section-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin: 0 0 var(--s-3);
}

/* Empty state refinement */
.empty-state {
  padding: var(--s-7) var(--s-5);
}
.empty-state .icon { font-size: 32px; margin-bottom: var(--s-3); display: block; }
.empty-state h2 { font-size: 17px; font-weight: 700; letter-spacing: -0.01em; }
.empty-state p { color: var(--text-muted); font-size: 14px; max-width: 360px; margin: 0 auto; }

/* Toast refinement */
.toast {
  border-radius: var(--r) !important;
  box-shadow: var(--shadow-2) !important;
  font-size: 13.5px !important;
}

/* Dashboard metric value — tighter number rendering */
.dm-value { font-variant-numeric: tabular-nums; }
.ocard-value { font-variant-numeric: tabular-nums; }

/* Mobile: stack page-head vertically */
@media (max-width: 600px) {
  .page-head { flex-direction: column; align-items: flex-start; padding-top: var(--s-4); }
  .page-head > div:last-child { width: 100%; }
  .dash-metrics { grid-template-columns: repeat(2, 1fr); }
  .ocard-grid   { grid-template-columns: repeat(2, 1fr); }
}

/* ================================================================
   OPERATIONAL UX — Dashboard context bar, slim attention,
   sticky table headers, hover row actions
   ================================================================ */

/* ---- Dashboard context bar (replaces dark hero) ---- */
.dash-ctx {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--s-3);
  padding: var(--s-4) 0 var(--s-3);
  margin-bottom: var(--s-4);
  border-bottom: 1px solid var(--border);
}
.dash-ctx-date {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}
.dash-ctx-company {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-weight: 600;
}
.dash-ctx-stats {
  font-size: 13px;
  color: var(--text-soft);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.dash-ctx-alert {
  color: var(--err);
  font-weight: 700;
}

/* ---- Slim attention panel ---- */
.att-slim {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--warn);
  border-radius: var(--r);
  padding: var(--s-2) 0;
  margin-bottom: var(--s-4);
}
.att-slim-row {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: 7px var(--s-4);
  font-size: 13px;
}
.att-slim-row:not(:last-child) {
  border-bottom: 1px solid var(--border);
}
.att-slim-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.att-slim-text {
  flex: 1;
  color: var(--text);
  line-height: 1.4;
}
.att-slim-link {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 100ms;
}
.att-slim-row:hover .att-slim-link { opacity: 1; color: var(--brand-gold); }

/* ---- Sticky table headers ---- */
/* Wrap tables in .table-wrap for sticky to work */
.table-wrap {
  overflow-x: auto;
  overflow-y: auto;
  max-height: 65vh;
  border-radius: var(--r-lg);
}
.table-wrap .dtable thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--surface);
  box-shadow: 0 1px 0 var(--border);
}

/* ---- Row hover actions ---- */
/* Row actions container — hidden until hover */
.dtable tbody tr { position: relative; }
.row-actions {
  display: flex;
  gap: 4px;
  align-items: center;
  opacity: 0;
  transition: opacity 100ms;
  pointer-events: none;
}
.dtable tbody tr:hover .row-actions {
  opacity: 1;
  pointer-events: auto;
}
/* Row action buttons — compact ghost style */
.btn-ra {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  font-size: 12px;
  font-weight: 500;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text-soft);
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  transition: background 80ms, border-color 80ms, color 80ms;
  line-height: 1.4;
}
.btn-ra:hover {
  background: var(--brand-ink);
  border-color: var(--brand-ink);
  color: #fff;
}
.btn-ra.primary-ra {
  background: var(--brand-ink);
  border-color: var(--brand-ink);
  color: #fff;
}
.btn-ra.primary-ra:hover { background: var(--brand-ink-soft); }

/* ---- Metric strip (tighter) ---- */
.dash-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-3);
  margin-bottom: var(--s-5);
}
.dash-metric {
  flex: 1 1 140px;
  min-width: 120px;
  max-width: 220px;
}

/* ---- ocard strip (tighter for dashboard) ---- */
.ocard-grid { gap: var(--s-2); }
.ocard {
  padding: var(--s-3) var(--s-3) var(--s-2);
}
.ocard-value { font-size: 26px; }
.ocard-label { font-size: 9.5px; }
.ocard-sub   { font-size: 11px; }

/* ---- Dashboard section: lighter border, no heavy shadow ---- */
.dash-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--s-4) var(--s-5);
  margin-bottom: var(--s-3);
  box-shadow: none;
}

/* ---- Schedule table: row height consistent 44px ---- */
.sched-table td { padding: 10px 10px 10px 0; }
.sched-table tr:hover { background: #F8F8F6; }

/* ---- Section headings: lighter weight ---- */
.dash-section-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-soft);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* Row actions cell — always right-aligned, min-width to prevent collapse */
.row-actions-cell {
  text-align: right;
  white-space: nowrap;
  width: 1%;
  padding-right: var(--s-4) !important;
}


/* ================================================================
   DASHBOARD — Two-column cockpit layout + ops strip
   ================================================================ */

/* Context bar — stronger */
.dash-ctx {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--s-4);
  padding: var(--s-5) 0 var(--s-4);
  margin-bottom: var(--s-4);
  border-bottom: 1px solid var(--border);
}
.dash-ctx-date {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--text);
  line-height: 1.2;
}
.dash-ctx-company {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 3px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
}
.dash-ctx-dots {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  flex-wrap: wrap;
}
.dash-ctx-dot-item {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
}
.dash-ctx-dot-val {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.dash-ctx-dot-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  white-space: nowrap;
}
.dash-ctx-sep {
  color: var(--border-strong);
  font-size: 18px;
  line-height: 1;
  padding: 0 2px;
}

/* Two-column layout */
.dash-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: var(--s-5);
  align-items: start;
}
.dash-main    { min-width: 0; }
.dash-sidebar { min-width: 0; }

/* Ops stat strip */
.ops-strip {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--s-4) var(--s-5);
  margin-bottom: var(--s-3);
  display: flex;
  align-items: stretch;
  gap: var(--s-5);
}
.ops-primary {
  display: flex;
  gap: 0;
  flex: 1;
}
.ops-stat {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: var(--s-2) var(--s-4) var(--s-2) 0;
  border-right: 1px solid var(--border);
  text-decoration: none;
  transition: background 80ms;
  border-radius: var(--r-sm);
}
.ops-stat:last-child { border-right: none; padding-right: 0; }
.ops-stat:hover { background: var(--surface-2); }
.ops-val {
  font-size: 36px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.ops-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  margin-top: 6px;
}
.ops-sub {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Secondary ops — compact vertical stack */
.ops-secondary {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: var(--s-2);
  padding-left: var(--s-4);
  border-left: 1px solid var(--border);
  min-width: 120px;
}
.ops-sec-item {
  display: flex;
  align-items: baseline;
  gap: var(--s-2);
  text-decoration: none;
  color: var(--text);
  font-size: 13px;
  opacity: 0.75;
  transition: opacity 80ms;
  white-space: nowrap;
}
.ops-sec-item:hover { opacity: 1; }
.ops-sec-val {
  font-size: 16px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
  min-width: 24px;
}
.ops-sec-label {
  font-size: 11px;
  color: var(--text-muted);
}
.ops-sec--alert .ops-sec-val { color: var(--err); }
.ops-sec--alert { opacity: 1; }

/* Sidebar sections — more compact than main sections */
.dash-sidebar .dash-section {
  padding: var(--s-3) var(--s-4);
  margin-bottom: var(--s-3);
}
.dash-sidebar .dash-section-title {
  font-size: 10px;
  letter-spacing: 0.09em;
  margin-bottom: var(--s-2);
}
.dash-sidebar .ocard-grid {
  grid-template-columns: 1fr;
  gap: var(--s-2);
}
.dash-sidebar .ocard {
  padding: var(--s-2) var(--s-3);
  display: flex;
  align-items: center;
  gap: var(--s-3);
  flex-direction: row;
}
.dash-sidebar .ocard-value {
  font-size: 20px;
  min-width: 32px;
  flex-shrink: 0;
}
.dash-sidebar .ocard-label {
  font-size: 10px;
}
.dash-sidebar .ocard-sub {
  font-size: 10px;
}

/* Att-slim in sidebar — no extra margin */
.dash-sidebar .att-slim {
  margin-bottom: var(--s-3);
}

/* Mobile: collapse to single column */
@media (max-width: 860px) {
  .dash-layout {
    grid-template-columns: 1fr;
  }
  .dash-sidebar {
    display: contents; /* sidebar items flow into normal stack on mobile */
  }
  .ops-strip {
    flex-direction: column;
    gap: var(--s-3);
  }
  .ops-primary {
    gap: var(--s-1);
  }
  .ops-stat {
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 0 0 var(--s-2);
  }
  .ops-stat:last-child { border-bottom: none; padding-bottom: 0; }
  .ops-val { font-size: 28px; }
  .ops-secondary {
    flex-direction: row;
    flex-wrap: wrap;
    border-left: none;
    border-top: 1px solid var(--border);
    padding-left: 0;
    padding-top: var(--s-3);
  }
  .dash-ctx-dots { justify-content: flex-start; }
  .dash-ctx-dot-item { align-items: flex-start; }
}


/* ================================================================
   ONBOARDING WIZARD — enterprise first-run experience
   Graphite + white + soft grey. Gold: progress bar only.
   Lucide SVG icons throughout.
   ================================================================ */

/* Full-page layout */
.onb-wrap {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 0;
  min-height: 100vh;
  background: #F7F7F5;
}

/* Left card */
.onb-card-outer {
  background: #ffffff;
  border-right: 1px solid #E5E5E2;
  padding: 48px 56px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Progress bar — single gold accent */
.onb-progress-track {
  width: 100%;
  height: 2px;
  background: #E5E5E2;
  border-radius: 99px;
  margin-bottom: 36px;
  overflow: hidden;
}
.onb-progress-fill {
  height: 100%;
  background: var(--brand-gold);
  border-radius: 99px;
  transition: width 350ms ease;
}

.onb-step-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: #9CA3AF;
  margin-bottom: 24px;
}

/* Icon — Lucide SVG, graphite */
.onb-icon {
  color: #374151;
  margin-bottom: 16px;
  display: block;
  line-height: 1;
}
.onb-icon svg { display: block; }

.onb-title {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #111827;
  margin: 0 0 10px;
  line-height: 1.25;
}

.onb-subtitle {
  font-size: 14px;
  color: #6B7280;
  margin: 0 0 28px;
  line-height: 1.55;
  max-width: 400px;
}

.onb-body { flex: 1; }
.onb-hint { font-size: 12px; color: #9CA3AF; margin-top: 12px; }

/* Actions */
.onb-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid #F3F4F6;
}
.onb-actions-right { display: flex; gap: 8px; align-items: center; }

.onb-back {
  color: #9CA3AF;
  background: transparent;
  border-color: transparent;
  font-size: 13px;
  font-weight: 500;
}
.onb-back:hover { color: #374151; background: #F9FAFB; }

.onb-skip {
  color: #9CA3AF;
  font-size: 13px;
  background: transparent;
  border-color: transparent;
}
.onb-skip:hover { color: #374151; background: #F9FAFB; }

/* Next button — graphite, not gold */
.onb-next-btn {
  background: #111827;
  color: #ffffff;
  border-color: #111827;
  font-size: 13.5px;
  font-weight: 600;
  min-width: 130px;
  justify-content: center;
  padding: 8px 18px;
}
.onb-next-btn:hover { background: #1F2937; border-color: #1F2937; }
.onb-next-btn:disabled { background: #D1D5DB; border-color: #D1D5DB; color: #9CA3AF; cursor: not-allowed; }

/* Form fields */
.onb-field-group { display: flex; flex-direction: column; gap: 20px; }
.onb-field { display: flex; flex-direction: column; gap: 6px; }
.onb-field--half { max-width: 220px; }

.onb-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #6B7280;
}
.onb-req { color: #EF4444; }

.onb-input {
  width: 100%;
  padding: 10px 14px;
  font: inherit;
  font-size: 14px;
  border: 1px solid #D1D5DB;
  border-radius: 8px;
  background: #ffffff;
  color: #111827;
  transition: border-color 100ms, box-shadow 100ms;
}
.onb-input:focus {
  outline: none;
  border-color: #374151;
  box-shadow: 0 0 0 3px rgba(55,65,81,0.1);
}
select.onb-input { cursor: pointer; }

/* Choice card grid */
.onb-choice-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.onb-choice-grid--multi { grid-template-columns: repeat(4, 1fr); }
.onb-choice-grid--2col  { grid-template-columns: repeat(2, 1fr); }

/* Choice card */
.onb-choice {
  background: #ffffff;
  border: 1px solid #E5E7EB;
  border-radius: 8px;
  padding: 16px 12px;
  cursor: pointer;
  transition: border-color 100ms, background 100ms;
  text-align: center;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.onb-choice:hover {
  border-color: #9CA3AF;
  background: #F9FAFB;
}
.onb-choice--selected {
  border-color: #111827 !important;
  background: #F9FAFB !important;
  box-shadow: 0 0 0 2px rgba(17,24,39,0.08);
}
/* SVG in choice cards — graphite */
.onb-choice-icon {
  color: #374151;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.onb-choice--selected .onb-choice-icon { color: #111827; }

.onb-choice-label {
  font-size: 13px;
  font-weight: 700;
  color: #111827;
  margin-bottom: 4px;
}
.onb-choice-desc {
  font-size: 11px;
  color: #9CA3AF;
  line-height: 1.4;
}

/* Wide cards (2-col team size) */
.onb-choice--wide {
  padding: 18px 16px;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.onb-choice--wide .onb-choice-icon { justify-content: flex-start; margin-bottom: 4px; }
.onb-choice--wide .onb-choice-label { font-size: 18px; font-weight: 800; }
.onb-choice--wide .onb-choice-desc  { font-size: 12px; color: #9CA3AF; }

/* Right preview panel */
.onb-preview {
  background: #F3F4F6;
  border-left: 1px solid #E5E5E2;
  padding: 48px 28px;
  display: flex;
  flex-direction: column;
}
.onb-preview-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #9CA3AF;
  margin-bottom: 20px;
}
.onb-preview-name {
  font-size: 15px;
  font-weight: 700;
  color: #111827;
  margin-bottom: 20px;
  letter-spacing: -0.01em;
}
.onb-preview-items { display: flex; flex-direction: column; gap: 10px; }
.onb-preview-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  transition: opacity 300ms;
}
.onb-preview-item--done { opacity: 1 !important; color: #111827; font-weight: 500; }
.onb-preview-item--pending { color: #9CA3AF; }
.onb-check-icon  { color: #16A34A; flex-shrink: 0; display: flex; }
.onb-circle-icon { color: #D1D5DB; flex-shrink: 0; display: flex; }

/* ---- Setup / generation screen ---- */
/* Full page, off-white, no dark drama, operational tone */
.onb-setup {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: #F7F7F5;
}
.onb-setup-inner {
  width: 100%;
  max-width: 420px;
  padding: 48px 32px;
}
.onb-setup-logo {
  margin-bottom: 32px;
}
.onb-setup-wordmark {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #111827;
}
.onb-setup-name {
  font-size: 15px;
  color: #6B7280;
  margin-bottom: 36px;
  font-weight: 500;
}
.onb-setup-items {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.onb-setup-item {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 14px;
  color: #9CA3AF;
  opacity: 0.4;
  transition: opacity 250ms ease, color 250ms ease;
}
.onb-setup-item--active {
  opacity: 1;
  color: #374151;
}
.onb-setup-item--done {
  opacity: 1;
  color: #16A34A;
}
/* Status dot */
.onb-setup-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #D1D5DB;
  flex-shrink: 0;
  transition: background 250ms;
}
.onb-setup-item--active .onb-setup-dot { background: #374151; }
.onb-setup-item--done   .onb-setup-dot { background: #16A34A; }
.onb-setup-text { font-weight: 500; }

/* Mobile */
@media (max-width: 768px) {
  .onb-wrap { grid-template-columns: 1fr; }
  .onb-card-outer {
    border-right: none;
    padding: 32px 24px;
    min-height: auto;
  }
  .onb-preview { display: none; }
  .onb-choice-grid         { grid-template-columns: repeat(2, 1fr); }
  .onb-choice-grid--multi  { grid-template-columns: repeat(2, 1fr); }
  .onb-choice-grid--2col   { grid-template-columns: repeat(2, 1fr); }
  .onb-title { font-size: 20px; }
  .onb-setup { min-height: 100svh; }
  .onb-setup-inner { padding: 40px 24px; }
}

/* ================================================================
   QUOTE PREVIEW — customer-facing, brand-first layout
   Survey company brand is the headline. Primox is invisible.
   ================================================================ */
.qp-wrap {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 13px;
  line-height: 1.5;
  color: #111827;
  max-width: 720px;
  margin: 0 auto;
}

/* Masthead — company identity */
.qp-masthead {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  align-items: flex-start;
  padding: 28px 0 20px;
  border-bottom: none;
}
.qp-logo {
  max-height: 56px;
  max-width: 200px;
  width: auto;
  object-fit: contain;
  display: block;
  margin-bottom: 10px;
}
.qp-company-name {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.025em;
  color: var(--qp-primary, #111827);
  margin-bottom: 8px;
}
.qp-contact {
  font-size: 11.5px;
  color: #6B7280;
  line-height: 1.6;
}

/* Right: ref + meta */
.qp-masthead-right { text-align: right; }
.qp-ref-block { margin-bottom: 14px; }
.qp-ref-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: #9CA3AF;
  margin-bottom: 4px;
}
.qp-ref-value {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--qp-primary, #111827);
}
.qp-meta { font-size: 11.5px; color: #6B7280; }
.qp-meta-row {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-bottom: 3px;
}
.qp-meta-row span:first-child { color: #9CA3AF; }
.qp-meta-row span:last-child  { font-weight: 600; color: #374151; }

/* Accent bar — uses company primary colour */
.qp-accent-bar {
  height: 3px;
  border-radius: 2px;
  margin: 0 0 28px;
  background: var(--qp-primary, #111827);
}

/* Prepared for */
.qp-for-section {
  background: #F9FAFB;
  border: 1px solid #F3F4F6;
  border-radius: 8px;
  padding: 16px 20px;
  margin-bottom: 24px;
}
.qp-for-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: #9CA3AF;
  margin-bottom: 6px;
}
.qp-for-client {
  font-size: 16px;
  font-weight: 700;
  color: #111827;
  margin-bottom: 3px;
}
.qp-for-contact { font-size: 12px; color: #6B7280; }
.qp-for-addr    { font-size: 12px; color: #9CA3AF; margin-top: 4px; }

/* Content sections */
.qp-section {
  margin-bottom: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid #F3F4F6;
}
.qp-section:last-of-type { border-bottom: none; }
.qp-section-title {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: #9CA3AF;
  margin-bottom: 8px;
}
.qp-section-body {
  font-size: 13px;
  color: #374151;
  line-height: 1.65;
  white-space: pre-wrap;
}
.qp-terms { font-size: 12px; color: #6B7280; }

/* Pricing */
.qp-pricing {
  background: #F9FAFB;
  border: 1px solid #F3F4F6;
  border-radius: 8px;
  padding: 16px 20px;
  margin-bottom: 24px;
}
.qp-pricing-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: #374151;
}
.qp-pricing-total {
  font-size: 18px;
  font-weight: 700;
  color: #111827;
}
.qp-pricing-vat { font-size: 11px; color: #9CA3AF; margin-top: 6px; }

/* Acceptance block */
.qp-acceptance {
  margin-bottom: 32px;
  padding: 20px;
  border: 1px solid #E5E7EB;
  border-radius: 8px;
}
.qp-acceptance-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #9CA3AF;
  margin-bottom: 20px;
}
.qp-acceptance-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px 32px;
}
.qp-sig-block { }
.qp-sig-line {
  height: 1px;
  background: #D1D5DB;
  margin-bottom: 6px;
  margin-top: 28px;
}
.qp-sig-label { font-size: 10px; color: #9CA3AF; text-transform: uppercase; letter-spacing: 0.07em; }

/* Footer */
.qp-footer {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding-top: 16px;
  border-top: 1px solid #F3F4F6;
  font-size: 11px;
  color: #9CA3AF;
}
.qp-footer-left { line-height: 1.5; }
.qp-footer-right { text-align: right; line-height: 1.5; }
.qp-powered { display: block; font-size: 10px; color: #D1D5DB; margin-top: 4px; }

/* Print controls */
.qp-controls {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  margin-top: var(--s-4);
  padding-top: var(--s-4);
  border-top: 1px solid var(--border);
}
.qp-controls-note { font-size: 12px; color: var(--text-muted); }

/* Print styles */
@media print {
  .no-print { display: none !important; }
  .modal-backdrop, .modal-header, .modal-footer { display: none !important; }
  .qp-wrap { max-width: 100%; margin: 0; font-size: 12px; }
  .qp-accent-bar { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  body * { visibility: hidden; }
  #quotePrintArea, #quotePrintArea * { visibility: visible; }
  #quotePrintArea { position: absolute; left: 0; top: 0; width: 100%; }
}

/* Survey discipline chips */
.survey-chip {
  display: inline-flex; align-items: center;
  padding: 5px 12px; border: 1px solid var(--border-strong);
  border-radius: 999px; cursor: pointer; font-size: 13px;
  background: var(--surface); color: var(--text);
  transition: background 80ms, border-color 80ms, color 80ms;
  user-select: none;
}
.survey-chip:hover { border-color: var(--text-muted); }
.survey-chip--sel {
  background: var(--brand-ink) !important;
  border-color: var(--brand-ink) !important;
  color: #fff !important;
}

/* ---- Enquiry note improvements ---- */
.enq-note-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 5px;
}
.enq-note-type {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 6px;
  color: var(--text-soft);
}
.enq-note-edit-btn {
  margin-left: auto;
  font-size: 11px;
  padding: 1px 8px;
  background: transparent;
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  cursor: pointer;
  color: var(--text-muted);
  opacity: 0;
  transition: opacity 100ms;
}
.enq-note:hover .enq-note-edit-btn { opacity: 1; }

/* ---- Engineer searchable multi-select ---- */
.eng-multiselect {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  border: 1px solid var(--border-strong);
  border-radius: var(--r);
  padding: 6px 8px;
  min-height: 42px;
  background: var(--surface);
  cursor: text;
  position: relative;
  width: 100%;
  box-sizing: border-box;
}
.eng-multiselect:focus-within {
  border-color: var(--brand-gold);
  box-shadow: 0 0 0 3px rgba(201,162,39,0.1);
}
/* Pills container — sits inline with the search input */
.eng-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
}
.eng-pill {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--brand-ink); color: #fff;
  border-radius: 999px; padding: 3px 8px 3px 10px;
  font-size: 12px; font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}
.eng-pill-remove {
  background: none; border: none; color: rgba(255,255,255,.7);
  cursor: pointer; font-size: 14px; padding: 0; line-height: 1;
}
.eng-pill-remove:hover { color: #fff; }
/* Search input — takes remaining row width, never collapses */
.eng-search {
  outline: none;
  border: none !important;
  box-shadow: none !important;
  background: transparent;
  flex: 1 1 120px;
  min-width: 120px;
  font-size: 14px;
  padding: 4px 6px;
}
.eng-dropdown {
  display: none;
  position: absolute; top: calc(100% + 2px); left: 0; right: 0;
  z-index: 1100;
  background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: var(--r); box-shadow: 0 4px 20px rgba(0,0,0,.15);
  max-height: 240px; overflow-y: auto;
}
.eng-option {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 14px; font-size: 14px; cursor: pointer;
  transition: background 60ms;
}
.eng-option:hover { background: var(--surface-2); }
.eng-option-check { color: var(--ok); font-weight: 700; font-size: 14px; }

/* ---- Diary: unscheduled project banner ---- */
.diary-unscheduled-banner {
  display: flex; align-items: center; flex-wrap: wrap; gap: 6px;
  padding: 8px 12px; background: #FFFBEB;
  border: 1px solid #FDE68A; border-radius: var(--r);
  margin-bottom: 8px; font-size: 12px;
}
.diary-unscheduled-label {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .07em; color: var(--warn); flex-shrink: 0; margin-right: 4px;
}
.diary-unscheduled-pill {
  display: inline-flex; align-items: center; gap: 6px;
  background: #fff; border: 1px solid #FDE68A; border-radius: 999px;
  padding: 2px 10px; text-decoration: none; color: var(--text);
  font-size: 12px; font-weight: 500;
}
.diary-unscheduled-pill:hover { background: #FEF3C7; }
.diary-unscheduled-date { color: var(--text-muted); font-size: 11px; }

/* ---- Operations dropdown nav ---- */
.nav-ops-wrap { position: relative; display: inline-block; }
.nav-ops-btn {
  background: none; border: none; cursor: pointer;
  font-size: var(--nav-font-size, 13px); font-weight: 500;
  color: var(--text-soft); padding: 6px 10px; border-radius: var(--r);
  display: flex; align-items: center; gap: 4px;
  transition: color 80ms, background 80ms;
}
.nav-ops-btn:hover { color: var(--text); background: var(--surface-2); }
.nav-ops-wrap.active .nav-ops-btn { color: var(--text); font-weight: 700; }
.nav-ops-arrow { font-size: 10px; }
.nav-ops-menu {
  display: none; position: absolute; top: calc(100% + 4px); left: 0;
  background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: var(--r); box-shadow: 0 4px 20px rgba(0,0,0,.12);
  min-width: 200px; z-index: 300; padding: 4px 0;
}
.nav-ops-item {
  display: block; padding: 9px 16px; font-size: 13px;
  color: var(--text-soft); text-decoration: none;
  transition: background 60ms, color 60ms;
}
.nav-ops-item:hover { background: var(--surface-2); color: var(--text); }

/* ========== Survey Command Centre — Dashboard ========== */
.cmd-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: var(--s-4);
  margin: var(--s-4) 0;
}
@media (max-width: 900px) { .cmd-grid { grid-template-columns: 1fr; } }

.cmd-col { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); overflow: hidden; }
.cmd-col-head {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .07em; color: var(--text-muted);
  padding: 12px 16px 8px; border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}

/* Timeline */
.cmd-tl { padding: 8px 0; }
.cmd-tl-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px; text-decoration: none; color: var(--text);
  border-bottom: 1px solid var(--border); transition: background 60ms;
}
.cmd-tl-row:hover { background: var(--surface-2); }
.cmd-tl-time { font-size: 12px; color: var(--text-muted); min-width: 44px; font-variant-numeric: tabular-nums; }
.cmd-tl-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--border-strong); flex-shrink: 0; }
.cmd-tl-dot--on { background: var(--ok); box-shadow: 0 0 0 3px rgba(34,197,94,.2); }
.cmd-tl-body { flex: 1; min-width: 0; }
.cmd-tl-name { display: block; font-size: 13px; font-weight: 600; }
.cmd-tl-job { display: block; font-size: 12px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cmd-tl-chip { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--ok); background: rgba(34,197,94,.1); padding: 2px 6px; border-radius: 4px; flex-shrink: 0; }
.cmd-tl-unassigned { padding: 10px 16px; font-size: 12px; color: var(--text-muted); border-top: 1px solid var(--border); }
.cmd-tl-warn { color: var(--warn); margin-right: 4px; }
.cmd-more-link { display: block; padding: 10px 16px; font-size: 12px; color: var(--brand-ink); text-decoration: none; border-top: 1px solid var(--border); }

/* Action Inbox */
.cmd-inbox { padding: 4px 0; }
.cmd-inbox-row {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 16px; text-decoration: none; color: var(--text);
  border-bottom: 1px solid var(--border); transition: background 60ms;
}
.cmd-inbox-row:hover { background: var(--surface-2); }
.cmd-inbox-row--urgent { border-left: 3px solid var(--err); }
.cmd-inbox-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.cmd-inbox-text { flex: 1; font-size: 13px; line-height: 1.4; }
.cmd-inbox-arr { font-size: 12px; color: var(--text-muted); flex-shrink: 0; }

/* Watchlist */
.cmd-watch { padding: 4px 0; }
.cmd-watch-row {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 16px; text-decoration: none; color: var(--text);
  border-bottom: 1px solid var(--border); transition: background 60ms;
}
.cmd-watch-row:hover { background: var(--surface-2); }
.cmd-watch-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.cmd-watch-body { flex: 1; }
.cmd-watch-label { display: block; font-size: 13px; font-weight: 600; }
.cmd-watch-sub { display: block; font-size: 11px; color: var(--text-muted); }

/* Empty states */
.cmd-empty { padding: 24px 16px; font-size: 13px; color: var(--text-muted); text-align: center; }
.cmd-empty--ok { color: var(--ok); }
.cmd-empty-link { display: block; margin-top: 8px; font-size: 12px; color: var(--brand-ink); }

/* Pipeline strip */
.cmd-pipeline-strip {
  display: flex; align-items: center; gap: var(--s-2); flex-wrap: wrap;
  padding: var(--s-3) var(--s-4);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r); margin-top: var(--s-3); font-size: 12px;
}
.cmd-pipeline-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--text-muted); }
.cmd-pipeline-pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border: 1px solid; border-radius: 999px;
  text-decoration: none; transition: opacity 80ms;
}
.cmd-pipeline-pill:hover { opacity: .8; }
.cmd-pipeline-count { font-weight: 700; font-size: 14px; }
.cmd-pipeline-name { font-size: 11px; }
.cmd-pipeline-won { margin-left: auto; font-weight: 700; color: var(--ok); font-size: 13px; }

/* ========== Commercial Pipeline Board ========== */
.pl-board {
  display: flex; gap: var(--s-3); overflow-x: auto; padding-bottom: var(--s-3);
  -webkit-overflow-scrolling: touch;
}
.pl-col {
  flex: 0 0 200px; background: var(--surface-2);
  border-radius: var(--r); padding: var(--s-2);
}
.pl-col-head {
  display: flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .06em; color: var(--text-soft); margin-bottom: 6px;
}
.pl-col-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.pl-col-count { margin-left: auto; background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: 0 6px; font-size: 11px; color: var(--text-muted); }
.pl-col-val { font-size: 11px; color: var(--text-muted); margin-bottom: 6px; padding: 0 2px; }
.pl-col-cards { display: flex; flex-direction: column; gap: 6px; }
.pl-col-empty { font-size: 12px; color: var(--text-muted); padding: 8px 4px; }

.pl-card {
  display: block; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r); padding: 10px 12px; text-decoration: none;
  color: var(--text); transition: box-shadow 80ms, border-color 80ms;
}
.pl-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,.08); border-color: var(--border-strong); }
.pl-card--stale { border-left: 3px solid var(--warn); }
.pl-card-client { font-size: 13px; font-weight: 700; }
.pl-card-project { font-size: 11px; color: var(--text-muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pl-card-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 6px; }
.pl-card-value { font-size: 12px; font-weight: 700; color: var(--text); }
.pl-card-age { font-size: 11px; color: var(--text-muted); }
.pl-card-stale-warn { font-size: 10px; color: var(--warn); margin-top: 4px; }

.pl-lost-section { margin-top: var(--s-4); }
.pl-lost-toggle { background: none; border: 1px solid var(--border); border-radius: var(--r); padding: 6px 14px; cursor: pointer; font-size: 13px; color: var(--text-soft); }
.pl-lost-cards { display: flex; flex-wrap: wrap; gap: var(--s-2); margin-top: var(--s-2); }
.pl-lost-card { display: flex; gap: 10px; align-items: center; padding: 8px 12px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); text-decoration: none; color: var(--text-soft); font-size: 12px; }

/* ========== Executive Strip ========== */
.exec-strip-header {
  padding: 12px var(--s-5) 0;
  font-size: 13px; color: var(--text-muted);
}
.exec-strip-date { font-size: 13px; color: var(--text-muted); }
.exec-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: var(--s-3);
  padding: var(--s-3) var(--s-5) var(--s-4);
  align-items: stretch;
}
.exec-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r); padding: var(--s-3) var(--s-4);
  text-decoration: none; color: var(--text);
  transition: box-shadow 80ms, border-color 80ms;
  display: flex; flex-direction: column; justify-content: space-between;
  min-height: 92px;
}
.exec-card:hover { box-shadow: 0 2px 10px rgba(0,0,0,.08); border-color: var(--border-strong); }
.exec-card--alert { border-color: var(--err); background: rgba(239,68,68,.04); }
.exec-card--wide  { grid-column: span 2; }   /* legacy: kept for safety, no longer used */
.exec-val { font-size: 26px; font-weight: 800; line-height: 1.1; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.exec-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--text-muted); margin-top: 4px; }
.exec-sub { font-size: 11px; color: var(--text-muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ========== Business Intelligence column ========== */
.cmd-biz { padding: 12px 0; }
.biz-metric {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 10px 16px; border-bottom: 1px solid var(--border);
}
.biz-metric-label { font-size: 12px; color: var(--text-muted); }
.biz-metric-val { font-size: 16px; font-weight: 800; color: var(--text); }
.biz-metric-sub { font-size: 11px; font-weight: 400; color: var(--text-muted); margin-left: 6px; }
.biz-section-head {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .07em; color: var(--text-muted);
  padding: 10px 16px 4px;
}
.biz-asset-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 16px; border-bottom: 1px solid var(--border);
  text-decoration: none; color: var(--text); font-size: 13px;
  transition: background 60ms;
}
.biz-asset-row:hover { background: var(--surface-2); }
.biz-asset-name { font-weight: 500; }
.biz-asset-badge {
  font-size: 11px; font-weight: 600; color: var(--warn);
  background: rgba(245,158,11,.1); padding: 2px 7px; border-radius: 4px;
}

.nav-ops-item--active { font-weight: 700; color: var(--text) !important; }

/* ========== P4: Visual hierarchy pass ========== */

/* -- Unassigned project cards in diary -- */
.diary-unassigned-section {
  margin-bottom: var(--s-3);
  border-radius: var(--r);
  overflow: hidden;
  border: 1.5px solid #fde68a;
  background: #fffbeb;
}
.diary-unassigned-header {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 16px;
  background: #fef3c7;
  border-bottom: 1px solid #fde68a;
  font-size: 12px; font-weight: 700;
  color: #92400e;
  text-transform: uppercase; letter-spacing: .06em;
}
.diary-unassigned-icon { font-size: 14px; }
.diary-unassigned-title { flex: 1; }
.diary-unassigned-count {
  background: #f59e0b; color: #fff;
  border-radius: 999px; padding: 1px 8px;
  font-size: 11px;
}
.diary-unassigned-cards { display: flex; flex-direction: column; gap: 0; }
.diary-ua-card {
  padding: 12px 16px;
  border-bottom: 1px solid #fde68a;
  background: #fffbeb;
}
.diary-ua-card:last-child { border-bottom: none; }
.diary-ua-card-head {
  display: flex; align-items: baseline; gap: 8px;
  margin-bottom: 4px;
}
.diary-ua-name { font-size: 14px; font-weight: 700; color: var(--text); }
.diary-ua-client { font-size: 12px; color: var(--text-muted); }
.diary-ua-meta {
  display: flex; gap: 8px; align-items: center;
  margin-bottom: 8px; flex-wrap: wrap;
}
.diary-ua-date { font-size: 12px; color: var(--text-soft); }
.diary-ua-badge {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .06em; padding: 2px 8px; border-radius: 4px;
  background: rgba(245,158,11,.15); color: #92400e;
}
.diary-ua-badge--kit {
  background: rgba(100,116,139,.12); color: var(--text-muted);
}
.diary-ua-actions {
  display: flex; gap: var(--s-2);
}

/* -- Action inbox refinements -- */
.cmd-inbox-more {
  padding: 8px 16px; font-size: 11px; color: var(--text-muted);
  text-align: center; border-top: 1px solid var(--border);
}

/* -- Dashboard cards: breathing room -- */
.exec-strip { gap: var(--s-3); padding: var(--s-3) var(--s-4) var(--s-4); }
.exec-card  { padding: var(--s-4) var(--s-4); border-radius: 10px; }
.exec-val   { font-size: 28px; font-weight: 800; letter-spacing: -.02em; }
.exec-label { font-size: 11px; font-weight: 600; margin-top: 6px; }
.exec-sub   { font-size: 11px; margin-top: 2px; opacity: .7; }

/* -- Command grid: softer look -- */
.cmd-col {
  border-radius: 10px;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
  border: 1px solid rgba(0,0,0,.07);
}
.cmd-col-head {
  font-size: 11px; font-weight: 700;
  letter-spacing: .07em; text-transform: uppercase;
  padding: 14px 16px 10px;
}
.cmd-inbox-row { padding: 12px 16px; }
.cmd-tl-row    { padding: 11px 16px; }
.cmd-watch-row { padding: 11px 16px; }

/* -- Cards globally: lighter shadows, less borders -- */
.list-card, .dash-section {
  border-radius: 10px;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
  border: 1px solid rgba(0,0,0,.07);
}

/* -- Navigation: tighter, smaller type -- */
.app-nav a {
  font-size: 13px;
  padding: 5px 10px;
  opacity: .7;
  letter-spacing: 0;
}
.app-nav a.active, .app-nav a[aria-current] {
  opacity: 1; font-weight: 600;
}
.app-nav { gap: 1px; }

/* -- Smaller nav operations button -- */
.nav-ops-btn { font-size: 13px; padding: 5px 10px; }

/* -- Page headers: more breathing room -- */
.page-head { margin-bottom: var(--s-5); }
.page-head h1 { font-size: 22px; font-weight: 800; letter-spacing: -.02em; }
.page-head .sub { margin-top: 3px; font-size: 13px; }

/* -- Tables: less grid-like -- */
.dtable th {
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .06em;
  color: var(--text-muted); padding: 10px 14px;
  border-bottom: 1px solid rgba(0,0,0,.08);
}
.dtable td { padding: 12px 14px; }
.dtable tr:hover td { background: rgba(0,0,0,.02); }

/* -- Pills: softer -- */
.pill { font-size: 11px; font-weight: 600; border-radius: 6px; padding: 3px 8px; }

/* ========== Engineer Hub ========== */
.eng-strip {
  display: flex; gap: var(--s-3); margin-bottom: var(--s-4); flex-wrap: wrap;
}
.eng-strip-stat {
  flex: 1; min-width: 100px; background: var(--surface);
  border: 1px solid var(--border); border-radius: 10px;
  padding: var(--s-3) var(--s-4); text-align: center;
}
.eng-strip-val   { font-size: 28px; font-weight: 800; line-height: 1; }
.eng-strip-label { font-size: 11px; color: var(--text-muted); margin-top: 4px;
                   text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }

.eng-hub-grid {
  display: grid;
  grid-template-columns: 2fr 2fr 1.2fr;
  gap: var(--s-3);
}
@media (max-width: 900px) { .eng-hub-grid { grid-template-columns: 1fr; } }

.eng-hub-col {
  background: var(--surface); border: 1px solid rgba(0,0,0,.07);
  border-radius: 10px; box-shadow: 0 1px 4px rgba(0,0,0,.06);
  overflow: hidden;
}
.eng-hub-col-head {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .07em; color: var(--text-muted);
  padding: 12px 16px 10px; border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}
.eng-cards { display: flex; flex-direction: column; }

/* Engineer card */
.eng-card {
  display: block; padding: 14px 16px; text-decoration: none; color: var(--text);
  border-bottom: 1px solid rgba(0,0,0,.05); transition: background 60ms;
}
.eng-card:hover { background: var(--surface-2); }
.eng-card:last-child { border-bottom: none; }
.eng-card-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 4px;
}
.eng-card-name { font-size: 14px; font-weight: 700; }
.eng-card-job  { font-size: 12px; color: var(--text-soft); margin-bottom: 3px;
                  display: flex; gap: 8px; align-items: center; }
.eng-card-job--none { color: var(--text-muted); font-style: italic; }
.eng-card-client { font-weight: 600; }
.eng-card-time   { color: var(--text-muted); font-size: 11px; }
.eng-card-kit    { font-size: 11px; color: var(--text-muted); margin-bottom: 2px; }
.eng-card-checkin { font-size: 11px; color: var(--ok); font-weight: 600; }
.eng-card-week   { font-size: 11px; color: var(--text-muted); }
.eng-card-warn   { font-size: 11px; color: var(--warn); margin-top: 4px; font-weight: 600; }

/* Status badges */
.eng-badge {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .06em; padding: 2px 8px; border-radius: 999px;
}
.eng-badge--green { background: rgba(34,197,94,.12); color: #166534; }
.eng-badge--blue  { background: rgba(59,130,246,.12); color: #1e40af; }
.eng-badge--grey  { background: rgba(100,116,139,.1); color: var(--text-muted); }
.eng-badge--amber { background: rgba(245,158,11,.12); color: #92400e; }

/* Timeline */
.eng-tl { padding: 4px 0; }
.eng-tl-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px; border-bottom: 1px solid rgba(0,0,0,.05);
}
.eng-tl-row:last-child { border-bottom: none; }
.eng-tl-time { font-size: 12px; color: var(--text-muted); min-width: 44px;
               font-variant-numeric: tabular-nums; }
.eng-tl-dot  { width: 8px; height: 8px; border-radius: 50%;
               background: var(--border-strong); flex-shrink: 0; }
.eng-tl-dot--on { background: var(--ok); box-shadow: 0 0 0 3px rgba(34,197,94,.2); }
.eng-tl-body { flex: 1; min-width: 0; }
.eng-tl-name { display: block; font-size: 13px; font-weight: 600; }
.eng-tl-job  { display: block; font-size: 12px; color: var(--text-muted);
               white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.eng-tl-live { font-size: 10px; font-weight: 700; color: var(--ok);
               background: rgba(34,197,94,.1); padding: 2px 6px; border-radius: 4px;
               text-transform: uppercase; letter-spacing: .06em; flex-shrink: 0; }

/* Attention */
.eng-att { padding: 4px 0; }
.eng-att-row {
  padding: 10px 16px; border-bottom: 1px solid rgba(0,0,0,.05);
}
.eng-att-row:last-child { border-bottom: none; }
.eng-att-name { display: block; font-size: 12px; font-weight: 700; color: var(--text); }
.eng-att-text { display: block; font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* ========== Workforce Planner ========== */
.eng-planner { }
.eng-planner-head {
  font-size: 13px; font-weight: 700; color: var(--text);
  padding: 12px 16px; background: var(--surface-2);
  border: 1px solid rgba(0,0,0,.07); border-radius: 10px 10px 0 0;
  display: flex; align-items: center; gap: 8px;
}
.eng-planner-range { font-size: 11px; color: var(--text-muted); font-weight: 400; }
.eng-planner-body {
  border: 1px solid rgba(0,0,0,.07); border-top: none;
  border-radius: 0 0 10px 10px; background: var(--surface); overflow: hidden;
}
.eng-planner-row {
  display: grid;
  grid-template-columns: 180px repeat(5, 1fr) 48px;
  border-bottom: 1px solid rgba(0,0,0,.05);
  align-items: center;
}
.eng-planner-row:last-child { border-bottom: none; }
.eng-planner-row--header {
  background: var(--surface-2);
  border-bottom: 1px solid rgba(0,0,0,.08);
}
.eng-planner-name-col {
  padding: 10px 16px; font-size: 12px; font-weight: 600;
}
.eng-planner-row--header .eng-planner-name-col {
  font-size: 11px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--text-muted); font-weight: 700;
}
.eng-planner-day-col {
  padding: 8px 6px; text-align: center;
  border-left: 1px solid rgba(0,0,0,.05);
  position: relative;
}
.eng-planner-day-col--today { background: rgba(59,130,246,.04); }
.eng-planner-day-label { font-size: 11px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; }
.eng-planner-day-date  { font-size: 10px; color: var(--text-muted); margin-top: 1px; }
.eng-planner-days-col  { padding: 10px 12px; text-align: center; font-size: 13px; font-weight: 700; color: var(--text); border-left: 1px solid rgba(0,0,0,.05); }
.eng-planner-row--header .eng-planner-days-col { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); }

/* Workload bar: vertical, inside a fixed-height track */
.eng-planner-bar-track {
  height: 28px; background: rgba(0,0,0,.06);
  border-radius: 4px; overflow: hidden;
  display: flex; align-items: flex-end;
  margin: 0 4px;
}
.eng-planner-bar-fill {
  width: 100%; border-radius: 4px;
  transition: height 200ms;
}
.eng-planner-link {
  color: var(--text); text-decoration: none; font-size: 12px;
}
.eng-planner-link:hover { color: var(--brand-ink); }
.eng-planner-legend {
  display: flex; gap: var(--s-4); padding: 10px 16px;
  font-size: 11px; color: var(--text-muted); align-items: center;
}
.eng-legend-dot {
  display: inline-block; width: 10px; height: 10px;
  border-radius: 2px; margin-right: 4px; vertical-align: middle;
}

/* ========== Engineer Profile ========== */
.eng-profile-kit-row {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 0; border-bottom: 1px solid rgba(0,0,0,.05);
  font-size: 13px;
}
.eng-profile-kit-row:last-child { border-bottom: none; }
.eng-profile-kit-name { flex: 1; font-weight: 500; }
.eng-profile-assign {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 8px 0; border-bottom: 1px solid rgba(0,0,0,.05);
}
.eng-profile-assign:last-child { border-bottom: none; }
.eng-profile-assign-time   { font-size: 12px; color: var(--text-muted); min-width: 50px; font-variant-numeric: tabular-nums; padding-top: 2px; }
.eng-profile-assign-name   { font-size: 13px; font-weight: 600; }
.eng-profile-upcoming {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 0; border-bottom: 1px solid rgba(0,0,0,.05);
  font-size: 12px;
}
.eng-profile-upcoming:last-child { border-bottom: none; }
.eng-profile-upcoming-date { color: var(--text-muted); min-width: 100px; }
.eng-profile-upcoming-job  { flex: 1; font-weight: 500; }
.eng-profile-upcoming-link { color: var(--brand-ink); text-decoration: none; }
.eng-profile-proj {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 0; border-bottom: 1px solid rgba(0,0,0,.05);
  text-decoration: none; color: var(--text); font-size: 12px;
  transition: background 60ms;
}
.eng-profile-proj:last-child { border-bottom: none; }
.eng-profile-proj-name { flex: 1; font-weight: 500; }
.eng-profile-proj:hover { color: var(--brand-ink); }

.eng-planner-meta     { display:flex; gap:6px; align-items:center; margin-top:2px; font-size:11px; }
.eng-planner-capacity { color:var(--text-muted); }

/* ---- Engineer invite status ---- */
.eng-invite-status {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 10px 12px; border-radius: var(--r);
  font-size: 13px; margin-bottom: var(--s-2);
}
.eng-invite-status--none   { background: rgba(100,116,139,.08); color: var(--text-muted); }
.eng-invite-status--pending { background: rgba(245,158,11,.1);  color: #92400e; }
.eng-invite-status--ok      { background: rgba(34,197,94,.1);   color: #166534; font-weight: 600; }

/* ---- Diary: leave and sick badges ---- */
.ap-badge.leave { background:#fef3c7; color:#92400e; }
.ap-badge.sick  { background:#fee2e2; color:#991b1b; }

/* ---- Diary: status badge colours ---- */
.ap-badge.on-site   { background:#dbeafe; color:#1d4ed8; font-weight:700; }
.ap-badge.finished  { background:#dcfce7; color:#15803d; font-weight:700; }
.ap-badge.left-site { background:#f3f4f6; color:#6b7280; }
.ap-badge.planned   { background:#e5e7eb; color:#374151; }
.ap-badge.kit       { background:#fef9c3; color:#854d0e; }

/* ---- Van kit picker (engineer start/end day) ---- */
.van-kit-list { display:flex; flex-direction:column; gap:6px; max-height:60vh; overflow-y:auto; }
.van-kit-row  { display:flex; align-items:center; gap:12px; padding:10px 12px;
                background:var(--surface-2); border:1px solid var(--border);
                border-radius:var(--r-sm); cursor:pointer; }
.van-kit-row:hover { background:var(--surface); }
.van-kit-name { flex:1; font-size:14px; font-weight:500; display:flex; flex-direction:column; gap:2px; }
.van-kit-serial { font-size:11px; color:var(--text-muted); font-weight:400; }
.van-kit-cat  { font-size:11px; color:var(--text-muted); white-space:nowrap; }

/* =========================================================
   Brand logo images (PRIMOX) — added in branding alignment.
   Replaces the previous text/"P" wordmarks. Sizing only;
   no colour-system changes (see --brand-gold follow-up).
   ========================================================= */
.sidebar-logo-img   { height: 22px; width: auto; display: block; }
.boot-logo          { height: 30px; width: auto; display: block; }
.brand-logo         { height: 28px; width: auto; display: block; }
.onb-setup-logo-img { height: 24px; width: auto; display: block; }

/* =========================================================
   Monthly Target Tracker card (dashboard).
   Brand-aligned: anthracite text, neutral track, signal-orange
   fill (#DD4F14). Self-contained; no colour-system tokens changed.
   ========================================================= */
.tgt-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-1);
  padding: var(--s-4) var(--s-5);
}
.tgt-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s-3); margin-bottom: var(--s-4); }
.tgt-title { font-size: 14px; font-weight: 700; color: var(--text); letter-spacing: 0.01em; }
.tgt-sub { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.tgt-figures {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--s-3);
  margin-bottom: var(--s-3);
}
.tgt-fig-val { font-size: 20px; font-weight: 700; color: var(--text); line-height: 1.1; }
.tgt-fig-lbl { font-size: 11px; color: var(--text-muted); margin-top: 4px; }
.tgt-bar {
  height: 8px;
  border-radius: 999px;
  background: var(--surface-2, #ECECEA);
  overflow: hidden;
}
.tgt-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: #DD4F14;            /* signal orange */
  transition: width 0.4s ease;
}
.tgt-bar-fill--over { background: #16A34A; }   /* target met → green */
.tgt-empty { font-size: 13px; color: var(--text-soft); }
.tgt-empty-figure { margin-top: var(--s-2); color: var(--text); }
@media (max-width: 640px) {
  .tgt-figures { grid-template-columns: repeat(2, 1fr); }
}

/* =========================================================================
   DASHBOARD ENHANCEMENT — Action Centre + Monthly Target ring
   Added: visual-only upgrade. New namespaced classes (.acx-*, .tgt-ring*)
   so existing components (.cmd-inbox-row reused by capacity, .tgt-figures)
   are not affected. Tokens used: --err/--warn/--ok/--info(+ -bg), --brand-gold.
   ========================================================================= */

/* ---- Action Centre: status cards ---- */
.acx { display: flex; flex-direction: column; gap: 8px; }
.acx-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 0 2px 4px;
}
.acx-bar-count { font-size: 12px; font-weight: 600; color: var(--text-soft); }
.acx-bar-crit {
  font-size: 11px; font-weight: 700; color: var(--err);
  background: var(--err-bg); padding: 2px 9px; border-radius: 999px;
  letter-spacing: .01em;
}
.acx-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; text-decoration: none; color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--border-strong);
  border-radius: var(--r);
  box-shadow: var(--shadow-1);
  transition: transform 90ms ease, box-shadow 90ms ease, border-color 90ms ease;
}
.acx-row:hover { transform: translateY(-1px); box-shadow: var(--shadow-2); }
.acx-row:focus-visible { outline: 2px solid var(--brand-gold); outline-offset: 2px; }
.acx-ico {
  display: grid; place-items: center;
  width: 30px; height: 30px; border-radius: 8px; flex: 0 0 auto;
}
.acx-text { flex: 1; font-size: 13.5px; line-height: 1.4; color: var(--text); }
.acx-text strong { font-weight: 700; }
.acx-arr {
  flex: 0 0 auto; font-size: 14px; color: var(--text-muted);
  transition: transform 90ms ease, color 90ms ease;
}
.acx-row:hover .acx-arr { transform: translateX(2px); color: var(--text-soft); }
.acx-more {
  padding: 6px; font-size: 12px; color: var(--text-muted); text-align: center;
}

/* severity treatments */
.acx-row--crit {
  border-left-color: var(--err);
  background: var(--err-bg);
  border-color: #F3C9C9;
}
.acx-row--crit .acx-ico { background: var(--surface); color: var(--err); }
.acx-row--warn { border-left-color: var(--warn); }
.acx-row--warn .acx-ico { background: var(--warn-bg); color: var(--warn); }
.acx-row--gold { border-left-color: var(--brand-gold); }
.acx-row--gold .acx-ico { background: #FBF3D7; color: #9A7B12; }
.acx-row--info { border-left-color: var(--info); }
.acx-row--info .acx-ico { background: var(--info-bg); color: var(--info); }

/* ---- Monthly Target: circular progress ring ---- */
.tgt-card--ring { padding: var(--s-5); }
.tgt-body {
  display: flex; align-items: center; gap: var(--s-5);
}
.tgt-ring {
  position: relative; flex: 0 0 auto; width: 128px; height: 128px;
}
.tgt-ring-track { stroke: var(--border); }
.tgt-ring-prog  {
  stroke: var(--ok);
  transition: stroke-dashoffset .7s cubic-bezier(.22,.61,.36,1);
}
.tgt-ring-center {
  position: absolute; inset: 0;
  display: grid; place-items: center; align-content: center; text-align: center;
}
.tgt-ring-pct {
  font-size: 30px; font-weight: 800; letter-spacing: -.02em;
  line-height: 1; color: var(--text); font-variant-numeric: tabular-nums;
}
.tgt-ring-cap {
  font-size: 10px; text-transform: uppercase; letter-spacing: .09em;
  color: var(--text-muted); margin-top: 4px;
}
.tgt-meta { flex: 1; min-width: 0; }
.tgt-status {
  display: inline-block; font-size: 11px; font-weight: 700;
  padding: 4px 11px; border-radius: 999px; letter-spacing: .02em;
}
.tgt-rows {
  display: flex; flex-direction: column;
  margin-top: var(--s-3); border-top: 1px solid var(--border);
}
.tgt-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 9px 0; border-bottom: 1px solid var(--border);
  font-size: 13px; text-decoration: none; color: inherit;
}
.tgt-row:last-child { border-bottom: none; }
.tgt-row-lbl { color: var(--text-soft); }
.tgt-row-val { font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.tgt-row--link:hover .tgt-row-val { color: var(--brand-gold); }

/* status colour mapping (ring + percentage + pill) */
.tgt--over    .tgt-ring-prog { stroke: #16A34A; }
.tgt--over    .tgt-ring-pct  { color: #16A34A; }
.tgt--over    .tgt-status    { background: var(--ok-bg);   color: #15803D; }
.tgt--ontrack .tgt-ring-prog { stroke: var(--ok); }
.tgt--ontrack .tgt-ring-pct  { color: var(--ok); }
.tgt--ontrack .tgt-status    { background: var(--ok-bg);   color: var(--ok); }
.tgt--warn    .tgt-ring-prog { stroke: var(--warn); }
.tgt--warn    .tgt-ring-pct  { color: var(--warn); }
.tgt--warn    .tgt-status    { background: var(--warn-bg); color: var(--warn); }
.tgt--behind  .tgt-ring-prog { stroke: var(--err); }
.tgt--behind  .tgt-ring-pct  { color: var(--err); }
.tgt--behind  .tgt-status    { background: var(--err-bg);  color: var(--err); }

@media (max-width: 560px) {
  .tgt-body { flex-direction: column; gap: var(--s-4); align-items: stretch; }
  .tgt-ring { align-self: center; }
}
@media (prefers-reduced-motion: reduce) {
  .acx-row, .acx-arr, .tgt-ring-prog { transition: none; }
}

/* =========================================================
   Dashboard-scoped DARK THEME (Phase 1)
   Re-maps the design tokens ONLY within #dashContent.dash-dark.
   No markup, logic, query, click-through, or other screen is
   affected — every dashboard card/widget already reads these
   tokens, so they recolour automatically. Fully reversible by
   removing the .dash-dark class. Staging visual change only.
   ========================================================= */
.dash-dark {
  /* surfaces */
  --bg: #0E1116;
  --surface: #171B22;
  --surface-2: #10141A;
  --border: #262C36;
  --border-strong: #333B47;
  /* text */
  --text: #F4F6FB;
  --text-soft: #C2C8D2;
  --text-muted: #8B94A3;
  --text-inverse: #0E1116;
  /* semantic (brightened for dark contrast; hues preserved) */
  --ok: #2FB98D;  --ok-bg: rgba(47,185,141,.12);
  --warn: #E8B23A; --warn-bg: rgba(232,178,58,.12);
  --err: #F8736F;  --err-bg: rgba(248,115,111,.12);
  --info: #5B9BF0; --info-bg: rgba(91,155,240,.12);
  /* elevation tuned for dark */
  --shadow-1: 0 1px 2px rgba(0,0,0,.40);
  --shadow-2: 0 6px 20px rgba(0,0,0,.45);
  --shadow-3: 0 12px 40px rgba(0,0,0,.55);

  background: var(--bg);
  color: var(--text);
  border-radius: var(--r-lg);
  min-height: 100%;
}
/* Subtle premium lift on the main card containers within the dark scope */
.dash-dark .dash-section { background: transparent; }
.dash-dark .cmd-col,
.dash-dark .exec-card,
.dash-dark .tgt-card,
.dash-dark .ocard { box-shadow: var(--shadow-1); }

/* =========================================================
   Dashboard COCKPIT MOSAIC (Phase 2) — layout only.
   Token-based, so it inherits the .dash-dark palette. Responsive:
   collapses to a single column on narrow viewports. No colour is
   hard-coded except the restrained commercial-card glow.
   ========================================================= */
.ccm-cockpit { display:grid; grid-template-columns: 1fr 1.45fr 1fr; gap: var(--s-3); align-items:start; }
.ccm-stack   { display:flex; flex-direction:column; gap: var(--s-3); }
.ccm-row2    { display:grid; grid-template-columns: 2.2fr 1fr; gap: var(--s-3); align-items:start; }
.ccm-lower   { display:grid; grid-template-columns: 1fr 1fr; gap: var(--s-3); align-items:start; }
.ccm-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--s-4);
  box-shadow: var(--shadow-1);
}
.ccm-card-hd {
  display:flex; align-items:center; justify-content:space-between; gap: var(--s-2);
  font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: var(--s-3);
}
.ccm-card-subhd {
  font-size: 11px; text-transform: uppercase; letter-spacing: .05em;
  color: var(--text-muted); margin: var(--s-4) 0 var(--s-2);
}
.ccm-commercial { display:flex; flex-direction:column; }
/* Restrained premium glow — commercial card is the visual centrepiece */
.dash-dark .ccm-commercial { box-shadow: 0 0 0 1px rgba(47,185,141,.14), 0 8px 28px rgba(0,0,0,.45); }

@media (max-width: 1000px) {
  .ccm-cockpit, .ccm-row2, .ccm-lower { grid-template-columns: 1fr; }
}

/* Phase 2 refinement: Assets panel nested under Commercial in the centre column */
.ccm-centre { display:flex; flex-direction:column; gap: var(--s-3); min-width:0; }
.ccm-assets-grid {
  display:grid; grid-template-columns: repeat(3, 1fr); gap: var(--s-2);
}
.ccm-asset {
  display:grid; grid-template-rows:auto auto auto auto; gap:2px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: var(--s-3);
  text-decoration:none;
}
.ccm-asset:hover { border-color: var(--border-strong); }
.ccm-asset-ic   { display:flex; align-items:center; gap:6px; font-size:12px; color: var(--text-muted); }
.ccm-asset-ic svg { color: var(--text-muted); flex:none; }
.ccm-asset-val  { font-size:24px; font-weight:700; color: var(--text); line-height:1.1; font-variant-numeric:tabular-nums; }
.ccm-asset-sub  { font-size:11px; color: var(--text-soft); }
.ccm-asset-link { font-size:11px; color: var(--info); margin-top:2px; }
@media (max-width: 1000px) {
  .ccm-assets-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Phase 3: large-screen width — dashboard only, laptops unchanged.
   Scoped to the dashboard view via :has(); other screens keep --content-max. */
@media (min-width: 1400px) {
  .view:has(#dashContent) { max-width: 1560px; }
}
@media (min-width: 1800px) {
  .view:has(#dashContent) { max-width: 1800px; }
}

/* =========================================================
   Phase 1 — dashboard status indicators (light theme, NO glow).
   Minimal typography only. Status COLOUR is applied inline by
   dashboard.js via the existing --ok/--warn/--err tokens, so these
   rules carry no colour, border, box-shadow, drop-shadow or neon.
   Added because the preserved status markup (On track / Attention
   Required / Action required) and the pipeline header dot / empty
   state are emitted by dashboard.js but were previously only styled
   inside the removed .dash-dark glow layer.
   ========================================================= */
.ccm-asset-status {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .02em;
  margin-top: 2px;
}
.ccm-pipeline-dot {
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: var(--text-muted);
  display: inline-block;
}
.cmd-pipeline-empty {
  color: var(--text-muted);
  font-size: 13px;
}
