/* ==========================================================================
   Wavesure Operations — app stylesheet, built on the WAVESURE DESIGN SYSTEM
   (round 90). Tokens, type, radii, elevation and motion are the system's
   own (tokens/*.css); the legacy aliases below keep every screen working
   unchanged. Outfit is self-hosted. Mobile-first: bottom tab bar < 768px,
   sticky top header >= 768px.
   ========================================================================== */

/* ---------- Outfit (variable, self-hosted) ---------- */
@font-face { font-family: "Outfit"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("../assets/fonts/Outfit-latin-variable.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Outfit"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("../assets/fonts/Outfit-latin-ext-variable.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  /* ---- Design-system ramps (tokens/colors.css, sampled from the brand palette) ---- */
  --teal-50:  #EFF5F6;
  --teal-100: #DAE7E9;
  --teal-200: #B5CDD1;
  --teal-300: #8BB0B7;
  --teal-400: #60929B;
  --teal-500: #477A83;   /* teal light — accents, secondary arcs of the W */
  --teal-600: #3C6E77;
  --teal-700: #33646C;   /* brand teal */
  --teal-800: #274E55;
  --teal-900: #1B383D;
  --teal-950: #12262A;

  --gray-0:   #FFFFFF;
  --gray-50:  #FAFAFA;
  --gray-100: #F5F5F5;   /* the only tint */
  --gray-200: #E7E7E7;
  --gray-300: #D2D2D2;
  --gray-400: #A9A9A9;
  --gray-500: #7B7B7B;
  --gray-600: #5C5C5C;
  --gray-700: #414141;   /* ink */
  --gray-800: #2B2B2B;
  --gray-900: #141414;
  --black:    #000000;
  --white:    #FFFFFF;

  /* Status — system signals only, never decoration */
  --pass-600: #2E7D4F;    --pass-100: #E4F1E9;
  --alert-600: #B3261E;   --alert-100: #F7E4E3;
  --caution-600: #B4740F; --caution-100: #FBF0DE;

  --ink-a08: rgb(65 65 65 / .08);
  --ink-a12: rgb(65 65 65 / .12);
  --ink-a60: rgb(20 20 20 / .60);
  --white-a12: rgb(255 255 255 / .12);
  --white-a24: rgb(255 255 255 / .24);
  --teal-a10: rgb(51 100 108 / .10);
  --teal-a24: rgb(51 100 108 / .24);

  /* ---- Semantic aliases (design system) ---- */
  --brand: var(--teal-700);
  --brand-hover: var(--teal-800);
  --brand-active: var(--teal-900);
  --brand-soft: var(--teal-50);
  --brand-accent: var(--teal-500);
  --text-strong: var(--gray-900);
  --text-body: var(--gray-700);
  --text-muted: var(--gray-500);
  --text-on-brand: var(--gray-0);
  --text-link: var(--teal-700);
  --text-link-hover: var(--teal-900);
  --surface-page: var(--gray-0);
  --surface-subtle: var(--gray-100);
  --surface-card: var(--gray-0);
  --surface-inset: var(--gray-50);
  --surface-dark: var(--gray-700);
  --surface-brand: var(--teal-700);
  --border-subtle: var(--gray-200);
  --border-default: var(--gray-300);
  --border-strong: var(--gray-400);
  --border-brand: var(--teal-700);
  --focus-ring-color: var(--teal-500);

  /* ---- Legacy aliases the screens were written against ---- */
  --ok-600: var(--pass-600);      --ok-100: var(--pass-100);
  --warn-700: var(--caution-600); --warn-100: var(--caution-100);
  --info-700: var(--teal-800);    --info-100: var(--teal-100);
  --danger-600: var(--alert-600); --danger-100: var(--alert-100);
  --red-600: var(--alert-600);    --red-700: #8F1E18;
  --muted-600: var(--gray-600);   --muted-100: var(--gray-200);
  --bg: var(--surface-subtle);
  --surface: var(--surface-card);
  --text: var(--text-body);
  --border: var(--border-default);
  --accent: var(--brand);
  --accent-hover: var(--brand-hover);
  --focus-ring: 0 0 0 3px rgb(71 122 131 / .35);

  /* ---- Type (Outfit; weight and tracking do the work) ---- */
  --font: "Outfit", "Helvetica Neue", Arial, sans-serif;
  --font-sans: var(--font);
  --fs-xs: 12px;
  --fs-sm: 14px;
  --fs-base: 15px;      /* dense operational screens: one step under the site's 16 */
  --fs-md: 18px;
  --fs-lg: 20px;
  --fs-xl: 24px;
  --fs-2xl: 30px;
  --tracking-tight: -0.02em;
  --tracking-snug: -0.01em;
  --tracking-wide: 0.04em;
  --tracking-eyebrow: 0.14em;

  /* ---- Spacing (4px grid) ---- */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 24px;
  --sp-6: 32px;
  --sp-7: 48px;

  /* ---- Radii: equipment is square, software is softened ---- */
  --radius-xs: 2px;     /* badges */
  --radius-sm: 4px;     /* controls, inputs */
  --radius-md: 6px;     /* media, menus */
  --radius-lg: 10px;    /* cards */
  --radius-xl: 16px;    /* large panels, modals */
  --radius-pill: 999px; /* chips only */
  --r-sm: var(--radius-sm);
  --r-md: var(--radius-lg);
  --r-lg: var(--radius-xl);

  /* ---- Elevation: soft, neutral, never colored ---- */
  --shadow-xs: 0 1px 2px rgb(20 20 20 / .06);
  --shadow-sm: 0 1px 3px rgb(20 20 20 / .08), 0 1px 2px rgb(20 20 20 / .04);
  --shadow-md: 0 4px 12px rgb(20 20 20 / .08);
  --shadow-lg: 0 12px 28px rgb(20 20 20 / .10);
  --shadow-xl: 0 24px 56px rgb(20 20 20 / .14);
  --shadow-1: var(--shadow-sm);
  --shadow-2: var(--shadow-lg);

  /* ---- Motion: spring for movement, ease-out for color ---- */
  --dur-instant: 90ms;
  --dur-fast: 190ms;
  --dur-base: 420ms;
  --ease-spring: cubic-bezier(.34, 1.42, .5, 1);
  --ease-out: cubic-bezier(.2, .8, .3, 1);
  --press-scale: .955;
  --transition-control: background-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);
  --transition-card: box-shadow var(--dur-base) var(--ease-spring), transform var(--dur-base) var(--ease-spring), border-color var(--dur-base) var(--ease-spring);
  --transition-press: transform var(--dur-instant) var(--ease-out);

  --tabbar-h: calc(3.6rem + env(safe-area-inset-bottom, 0px));
  --header-h: 64px;
}
@media (prefers-reduced-motion: reduce) {
  :root { --dur-instant: 1ms; --dur-fast: 1ms; --dur-base: 1ms; --press-scale: 1; }
}

/* ---------- Reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: var(--fs-base);
  font-weight: 400;
  line-height: 1.5;
  color: var(--text-body);
  background: var(--bg);
  padding-bottom: var(--tabbar-h);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3 {
  margin: 0 0 var(--sp-3);
  font-weight: 600;
  line-height: 1.18;
  letter-spacing: var(--tracking-snug);
  color: var(--text-strong);
  text-wrap: balance;
}
h1 { font-size: var(--fs-2xl); letter-spacing: var(--tracking-tight); }
h2 { font-size: var(--fs-xl); }
h3 { font-size: var(--fs-md); }
.section-h { margin: var(--sp-5) 0 var(--sp-2); }
.section-h + .card { margin-top: 0; }
p { margin: 0 0 var(--sp-3); text-wrap: pretty; }
a { color: var(--text-link); text-decoration: none; transition: color var(--dur-fast) var(--ease-out); }
a:hover { color: var(--text-link-hover); }
strong { font-weight: 600; color: var(--text-strong); }
img { max-width: 100%; display: block; }
button { font-family: inherit; }
:focus-visible { outline: 2px solid var(--focus-ring-color); outline-offset: 2px; box-shadow: none; }

/* The eyebrow — the system's signature kicker, set above every page title
   from the section the router puts on <body data-sec="…"> */
.eyebrow, body[data-sec] #view::before {
  display: block;
  font-size: var(--fs-xs); font-weight: 600;
  letter-spacing: var(--tracking-eyebrow); text-transform: uppercase;
  color: var(--brand);
  margin-bottom: var(--sp-2);
}
body[data-sec="dashboard"] #view::before { content: 'Wavesure Operations'; }
body[data-sec="equipment"] #view::before { content: 'Equipment Rental'; }
body[data-sec="customers"] #view::before { content: 'Accounts'; }
body[data-sec="training"] #view::before { content: 'Training Module'; }
body[data-sec="service"] #view::before { content: 'Field Service'; }
body[data-sec="settings"] #view::before { content: 'Administration'; }
body[data-sec="parts"] #view::before { content: 'Parts & Inventory'; }  /* round 95 */

/* ---------- App header (sticky, white, hairline — the site's compact header) ---------- */
.app-header {
  position: sticky; top: 0; z-index: 200;
  height: var(--header-h);
  background: rgb(255 255 255 / .92);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
}
.header-inner {
  display: flex; align-items: center; justify-content: flex-start; gap: var(--sp-6);
  height: 100%;
  max-width: 75rem; margin: 0 auto;
  padding: 0 var(--sp-4);
}
@media (min-width: 768px) { .header-inner { padding: 0 var(--sp-5); } }
@media (min-width: 1024px) { .header-inner { padding: 0 40px; } }
.brand { display: flex; align-items: center; height: 100%; }
.brand-logo { height: 34px; width: auto; }
.top-nav { display: none; }

/* ---------- Bottom tab bar (mobile) ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 200;
  display: flex;
  height: var(--tabbar-h);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: var(--surface-card);
  border-top: 1px solid var(--border-subtle);
}
.tabbar a {
  position: relative;
  flex: 1; min-width: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px;
  font-size: 11px; font-weight: 500; letter-spacing: var(--tracking-wide);
  color: var(--text-muted);
  transition: color var(--dur-fast) var(--ease-out);
}
.tabbar a svg {
  width: 22px; height: 22px;
  fill: none; stroke: currentColor; stroke-width: 1.7;
  stroke-linecap: round; stroke-linejoin: round;
}
.tabbar a span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tabbar a::before {
  content: ''; position: absolute; top: 0; left: 22%; right: 22%; height: 2px;
  background: var(--brand); transform: scaleX(.4); transform-origin: left; opacity: 0;
  transition: opacity var(--dur-fast) var(--ease-out), transform var(--dur-base) var(--ease-spring);
}
.tabbar a.active { color: var(--brand); font-weight: 600; }
.tabbar a.active::before { opacity: 1; transform: scaleX(1); }

/* ---------- Desktop nav: ink labels, 2px teal underline flush to the header edge ---------- */
@media (min-width: 768px) {
  body { padding-bottom: 0; }
  .tabbar { display: none; }
  .top-nav { display: flex; align-items: stretch; gap: var(--sp-6); height: 100%; margin-left: var(--sp-2); }
  .top-nav a, .nav-group-btn {
    position: relative;
    display: inline-flex; align-items: center;
    padding: 0;
    color: var(--text-body);
    font-weight: 500; font-size: var(--fs-sm); letter-spacing: var(--tracking-snug);
    background: none; border: 0; cursor: pointer;
    transition: color var(--dur-fast) var(--ease-out);
  }
  .top-nav > a::after, .nav-group-btn::after {
    content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px;
    background: var(--brand); opacity: 0; transform: scaleX(.4); transform-origin: left;
    transition: opacity var(--dur-fast) var(--ease-out), transform var(--dur-base) var(--ease-spring);
  }
  .top-nav a:hover, .nav-group-btn:hover { color: var(--text-strong); }
  .top-nav > a.active, .nav-group.has-active .nav-group-btn { color: var(--text-strong); font-weight: 600; }
  .top-nav > a.active::after, .nav-group.has-active .nav-group-btn::after { opacity: 1; transform: scaleX(1); }
}

/* ---------- Equipment Rental dropdown (desktop) ---------- */
.nav-group { position: relative; display: flex; align-items: center; height: 100%; }
.nav-caret { font-size: .7em; opacity: .7; margin-left: 4px; }
.nav-group.open .nav-group-btn { color: var(--text-strong); }
.nav-drop {
  display: none;
  position: absolute; top: calc(100% - 1px); left: -12px; z-index: 210;
  min-width: 14.5rem;
  padding: var(--sp-2);
  background: var(--surface-card);
  border: 1px solid var(--border-subtle); border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
}
.nav-group.open .nav-drop { display: flex; flex-direction: column; }
.nav-drop a {
  display: block; width: 100%;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  font-size: var(--fs-sm); font-weight: 500; color: var(--text-body);
}
.nav-drop a::after { display: none; }
.nav-drop a:hover { background: var(--brand-soft); color: var(--teal-800); }
.nav-drop a.active { background: var(--brand-soft); color: var(--teal-800); font-weight: 600; }

/* ---------- Equipment Rental quick links (round 47) — filter chips ---------- */
.equip-subnav {
  display: flex; gap: var(--sp-2); flex-wrap: wrap; align-items: center;
  max-width: 75rem; margin: 0 auto;
  padding: var(--sp-3) var(--sp-4) 0;
}
@media (min-width: 768px) { .equip-subnav { padding: var(--sp-3) var(--sp-5) 0; } }
@media (min-width: 1024px) { .equip-subnav { padding: var(--sp-3) 40px 0; } }
.equip-subnav[hidden] { display: none; }
.equip-subnav a {
  padding: 6px 14px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-pill);
  background: var(--surface-card);
  font-size: var(--fs-sm); font-weight: 500;
  color: var(--text-body);
  transition: var(--transition-control);
}
.equip-subnav a:hover { background: var(--brand-soft); border-color: var(--teal-200); color: var(--teal-800); }
.equip-subnav a.active { background: var(--brand); border-color: var(--brand); color: var(--text-on-brand); }

/* ---------- Equipment hub (mobile landing) ---------- */
.hub-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-3); }
.hub-card {
  display: flex; flex-direction: column; align-items: center; gap: var(--sp-2);
  padding: var(--sp-5) var(--sp-3);
  background: var(--surface-card);
  border: 1px solid var(--border-subtle); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  color: var(--text-strong); font-weight: 600; text-align: center;
  transition: var(--transition-card);
}
.hub-card svg {
  width: 30px; height: 30px;
  fill: none; stroke: var(--brand); stroke-width: 1.7;
  stroke-linecap: round; stroke-linejoin: round;
}
.hub-card:hover { border-color: var(--border-brand); box-shadow: var(--shadow-md); transform: translateY(-2px); color: var(--text-strong); }
.hub-card .hub-sub { font-weight: 400; font-size: var(--fs-xs); color: var(--text-muted); }

/* ---------- Settings accordion ---------- */
.acc-card { padding: 0; }
.acc-summary {
  display: flex; align-items: baseline; justify-content: space-between; gap: var(--sp-3);
  padding: var(--sp-4) var(--sp-5);
  cursor: pointer; list-style: none;
  font-weight: 600; font-size: var(--fs-md); color: var(--text-strong);
  transition: color var(--dur-fast) var(--ease-out);
}
.acc-summary::-webkit-details-marker { display: none; }
.acc-summary::after { content: '+'; color: var(--text-muted); font-weight: 400; }
details[open] > .acc-summary::after { content: '–'; }
details[open] > .acc-summary { border-bottom: 1px solid var(--border-subtle); }
.acc-body { padding: var(--sp-4) var(--sp-5); }
.acc-block + .acc-block { margin-top: var(--sp-5); padding-top: var(--sp-4); border-top: 1px solid var(--border-subtle); }
.acc-block h3 { margin-top: 0; }
.acc-card + .acc-card { margin-top: var(--sp-3); }
.acc-summary:hover { color: var(--brand); }
.acc-summary .small { font-weight: 400; }
details[open].acc-card { border-color: var(--border-brand); }
details[open] > .acc-summary { color: var(--brand); }

/* ---------- Layout ---------- */
.view {
  max-width: 75rem;
  margin: 0 auto;
  padding: var(--sp-4);
}
@media (min-width: 768px) { .view { padding: var(--sp-5); } }
@media (min-width: 1024px) { .view { padding: var(--sp-6) 40px; } }

.page-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--sp-3); margin-bottom: var(--sp-5); flex-wrap: wrap;
}
.page-head h1 { margin: 0; }
.page-head .actions { display: flex; gap: var(--sp-2); flex-wrap: wrap; }

.grid-2 { display: grid; gap: var(--sp-4); grid-template-columns: 1fr; }
@media (min-width: 640px) { .grid-2 { grid-template-columns: 1fr 1fr; } }

/* ---------- Cards: white, hairline, 10px, soft shadow ---------- */
.card {
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--sp-5);
  box-shadow: var(--shadow-sm);
  margin-bottom: var(--sp-4);
}
.card > h2:first-child, .card > h3:first-child { margin-top: 0; }
@media (max-width: 639px) { .card { padding: var(--sp-4); } }

/* ---------- Buttons: square-ish 4px, semibold, press compresses ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2);
  padding: 9px 18px;
  min-height: 40px;
  border: 1px solid var(--brand);
  border-radius: var(--radius-sm);
  font: inherit; font-size: var(--fs-sm); font-weight: 600; letter-spacing: var(--tracking-snug); line-height: 1.2;
  cursor: pointer;
  background: var(--brand); color: var(--text-on-brand);
  transition: var(--transition-control), var(--transition-press);
  text-decoration: none;
}
.btn:hover { background: var(--brand-hover); border-color: var(--brand-hover); color: var(--text-on-brand); }
.btn:active { background: var(--brand-active); border-color: var(--brand-active); transform: scale(var(--press-scale)); }
.btn-secondary { background: transparent; color: var(--text-body); border-color: var(--border-default); }
.btn-secondary:hover { background: var(--brand-soft); color: var(--teal-800); border-color: var(--teal-200); }
.btn-secondary:active { background: var(--teal-100); color: var(--teal-900); border-color: var(--teal-300); }
.btn-ghost { background: transparent; color: var(--brand); border-color: transparent; }
.btn-ghost:hover { background: var(--brand-soft); color: var(--teal-800); border-color: transparent; }
.btn-ghost:active { background: var(--teal-100); color: var(--teal-900); border-color: transparent; }
.btn-danger { background: var(--alert-600); border-color: var(--alert-600); }
.btn-danger:hover, .btn-danger:active { background: #8F1E18; border-color: #8F1E18; }
.btn-danger-ghost { color: var(--alert-600); border-color: transparent; background: transparent; }
.btn-danger-ghost:hover, .btn-danger-ghost:active { background: var(--alert-100); color: var(--alert-600); border-color: transparent; }
.btn-sm { padding: 5px 12px; min-height: 30px; font-size: var(--fs-xs); }
.btn-block { width: 100%; }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }

/* ---------- Badges: spec type, 2px corners, one hairline ---------- */
.badge {
  display: inline-flex; align-items: center;
  padding: 3px 7px;
  border: 1px solid transparent;
  border-radius: var(--radius-xs);
  font-size: 11px; font-weight: 500; line-height: 1.3;
  letter-spacing: var(--tracking-wide); text-transform: uppercase;
  white-space: nowrap;
}
.badge-available, .badge-returned { background: var(--pass-100); color: var(--pass-600); border-color: var(--pass-600); }
.badge-rented, .badge-shipped, .badge-tier { background: var(--brand-soft); color: var(--teal-800); border-color: var(--teal-200); }
.badge-inservice { background: var(--caution-100); color: var(--caution-600); border-color: var(--caution-600); }
.badge-overdue { background: var(--alert-100); color: var(--alert-600); border-color: var(--alert-600); }
.badge-retired, .badge-draft { background: var(--surface-subtle); color: var(--text-body); border-color: var(--border-subtle); }
.badge-sold { background: var(--surface-dark); color: var(--white); border-color: var(--surface-dark); }
.badge-demo { background: var(--teal-100); color: var(--teal-900); border-color: var(--teal-300); }

button.badge-btn { cursor: pointer; font-family: inherit; }
button.badge-btn:hover { filter: brightness(.94); }

/* ---------- KPI tiles (dashboard) ---------- */
.kpi-grid {
  display: grid; gap: var(--sp-3);
  grid-template-columns: repeat(2, 1fr);
  margin-bottom: var(--sp-4);
}
@media (min-width: 640px) { .kpi-grid { grid-template-columns: repeat(4, 1fr); } }
.kpi {
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--sp-4);
  box-shadow: var(--shadow-sm);
  display: block; color: inherit;
  transition: var(--transition-card);
}
.kpi:hover { border-color: var(--border-brand); box-shadow: var(--shadow-md); transform: translateY(-2px); color: inherit; }
.kpi .kpi-value { font-size: var(--fs-2xl); font-weight: 700; letter-spacing: var(--tracking-tight); color: var(--text-strong); line-height: 1.05; }
.kpi .kpi-label { font-size: var(--fs-xs); color: var(--text-muted); font-weight: 500; text-transform: uppercase; letter-spacing: var(--tracking-wide); margin-top: 4px; }
.kpi.kpi-danger .kpi-value { color: var(--alert-600); }

/* ---------- Search + filters ---------- */
.toolbar { display: flex; flex-direction: column; gap: var(--sp-3); margin-bottom: var(--sp-4); }
.searchbar {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  font: inherit; font-size: var(--fs-base);
  background: var(--surface-card);
  transition: var(--transition-control);
}
.searchbar:focus { outline: none; border-color: var(--teal-500); box-shadow: var(--focus-ring); }
.chip-row { display: flex; gap: var(--sp-2); flex-wrap: wrap; }

/* Round 74: unified type-ahead combobox */
.combo { position: relative; }
.combo-list {
  position: absolute; top: calc(100% + 2px); left: 0; right: 0; z-index: 60;
  background: var(--surface-card); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md); box-shadow: var(--shadow-md);
  max-height: 270px; overflow-y: auto;
}
.combo-item {
  padding: 8px 14px; cursor: pointer; font-size: var(--fs-base);
  border-bottom: 1px solid var(--border-subtle);
}
.combo-item:last-child { border-bottom: 0; }
.combo-item:hover, .combo-item.active { background: var(--brand-soft); }
.combo-item.selected { font-weight: 600; }
.combo-sub { display: block; font-size: var(--fs-sm); color: var(--text-muted); margin-top: 1px; }
.combo-add { color: var(--brand); font-weight: 600; }
.combo-clear { color: var(--text-muted); }
.combo-empty { padding: 8px 14px; color: var(--text-muted); font-size: var(--fs-sm); }

/* Round 74: schedule-modal month picker */
.mcal { border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); padding: 8px; background: var(--surface-card); }
.mcal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.mcal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.mcal-dow { text-align: center; font-size: var(--fs-xs); font-weight: 500; letter-spacing: var(--tracking-wide); text-transform: uppercase; color: var(--text-muted); padding: 2px 0; }
.mcal-day {
  min-height: 40px; border-radius: var(--radius-sm); padding: 3px 2px 2px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  border: 1px solid transparent;
  transition: var(--transition-control);
}
.mcal-day:hover { background: var(--brand-soft); }
.mcal-out { cursor: default; }
.mcal-out:hover { background: transparent; }
.mcal-num { font-size: var(--fs-sm); line-height: 1.2; }
.mcal-today .mcal-num { font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.mcal-sel { background: var(--brand); border-color: var(--brand); }
.mcal-sel .mcal-num { color: #fff; font-weight: 700; }
.mcal-sel:hover { background: var(--brand); }
.mcal-hol { background: repeating-linear-gradient(135deg, transparent 0 6px, rgba(180, 116, 15, .12) 6px 9px); }
.mcal-dots { display: flex; gap: 2px; align-items: center; min-height: 6px; }
.mcal-dot { width: 6px; height: 6px; border-radius: 50%; display: inline-block; }
.mcal-more { font-style: normal; font-size: 8px; color: var(--text-muted); }
.cal-jump { cursor: pointer; margin-left: 6px; }

/* ---------- Chips: the only pill in the system ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 14px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-pill);
  background: var(--surface-card);
  font: inherit; font-size: var(--fs-sm); font-weight: 500;
  color: var(--text-body);
  cursor: pointer;
  transition: var(--transition-control), var(--transition-press);
}
.chip:hover { background: var(--brand-soft); border-color: var(--teal-200); color: var(--teal-800); }
.chip:active { transform: scale(var(--press-scale)); }
.chip.active { background: var(--brand); border-color: var(--brand); color: var(--text-on-brand); }

/* Round 78: home page — two business panels */
.home-sec {
  border: 1px solid var(--border-subtle); border-radius: var(--radius-lg);
  background: var(--surface-card); box-shadow: var(--shadow-sm);
  padding: var(--sp-5); margin: var(--sp-5) 0;
}
.home-sec-h {
  margin: 0 0 var(--sp-3);
  padding-bottom: var(--sp-2);
  border-bottom: 2px solid var(--brand);
}
.home-sub { margin: var(--sp-4) 0 var(--sp-2); font-size: var(--fs-base); color: var(--text-body); }
.home-sec .kpi-grid { margin-bottom: 0; }

/* Round 76: pending-count bubble on a chip */
.chip-count {
  display: inline-block; min-width: 18px; padding: 0 5px; margin-left: 6px;
  border-radius: var(--radius-pill); text-align: center;
  background: var(--alert-600); color: var(--white);
  font-size: 11px; font-weight: 600; line-height: 18px; vertical-align: 1px;
}
.chip.active .chip-count { background: var(--white); color: var(--brand); }

/* ---------- List rows ---------- */
.list { display: flex; flex-direction: column; gap: var(--sp-2); }
.list-row {
  display: flex; align-items: center; gap: var(--sp-3);
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--sp-3) var(--sp-4);
  color: inherit;
  box-shadow: var(--shadow-xs);
  transition: border-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);
}
.list-row:hover { border-color: var(--border-brand); box-shadow: var(--shadow-sm); }
.list-row .row-main { flex: 1; min-width: 0; }
.list-row .row-title { font-weight: 600; color: var(--text-strong); }
.list-row .row-sub {
  font-size: var(--fs-sm); color: var(--text-muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.list-row .row-side { display: flex; flex-direction: column; align-items: flex-end; gap: var(--sp-1); }
.row-count { font-size: var(--fs-sm); color: var(--text-muted); margin: var(--sp-2) 0; }

/* ---------- Definition/spec tables ---------- */
.spec-table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.spec-table th, .spec-table td { text-align: left; padding: 8px var(--sp-2); border-bottom: 1px solid var(--border-subtle); vertical-align: top; }
.spec-table th { color: var(--text-muted); font-weight: 500; width: 42%; }
.spec-table tr:last-child th, .spec-table tr:last-child td { border-bottom: none; }

.data-table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.data-table th, .data-table td { text-align: left; padding: 8px var(--sp-2); border-bottom: 1px solid var(--border-subtle); }
.data-table th { color: var(--text-muted); font-weight: 500; font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: var(--tracking-wide); }
.data-table td.num, .data-table th.num { text-align: right; }
.data-table input { max-width: 7rem; }

/* ---------- Forms ---------- */
.field { margin-bottom: var(--sp-4); }
.field > label { display: block; font-size: var(--fs-sm); font-weight: 500; color: var(--text-strong); margin-bottom: 6px; }
.field .hint { font-size: var(--fs-xs); color: var(--text-muted); margin-top: var(--sp-1); }
.req { color: var(--alert-600); }
input[type="text"], input[type="number"], input[type="date"], input[type="email"], input[type="tel"],
input[type="time"], input[type="password"], input[type="url"], input[type="search"],
select, textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  font: inherit; font-size: var(--fs-base);
  background: var(--surface-card);
  color: var(--text-body);
  transition: var(--transition-control);
}
select { appearance: auto; }
input:hover, select:hover, textarea:hover { border-color: var(--border-strong); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--teal-500); box-shadow: var(--focus-ring); }
input:disabled, select:disabled, textarea:disabled { opacity: .55; background: var(--surface-inset); cursor: not-allowed; }
textarea { min-height: 5rem; resize: vertical; }
.field-row { display: grid; gap: var(--sp-3); grid-template-columns: 1fr 1fr; }
.checkbox-field { display: flex; align-items: center; gap: var(--sp-2); font-size: var(--fs-sm); font-weight: 500; color: var(--text-strong); }
.checkbox-field input { width: 18px; height: 18px; accent-color: var(--brand); }
.form-actions { display: flex; gap: var(--sp-2); margin-top: var(--sp-5); flex-wrap: wrap; }

.tier-preview {
  display: flex; align-items: center; gap: var(--sp-2);
  padding: var(--sp-3);
  background: var(--brand-soft);
  border: 1px solid var(--teal-200);
  border-radius: var(--radius-lg);
  margin-bottom: var(--sp-4);
  font-size: var(--fs-sm);
}
.tier-preview strong { font-size: var(--fs-md); color: var(--teal-800); }

/* ---------- Modal: large panel radius, ink backdrop, xl shadow ---------- */
.modal-overlay {
  position: fixed; inset: 0; z-index: 900;
  background: var(--ink-a60);
  display: flex; align-items: flex-end; justify-content: center;
  padding: 0;
}
.modal {
  background: var(--surface-card);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  width: 100%; max-width: 36rem;
  max-height: 88vh; overflow-y: auto;
  padding: var(--sp-5) var(--sp-4) calc(var(--sp-5) + env(safe-area-inset-bottom, 0px));
  box-shadow: var(--shadow-xl);
  animation: modal-in var(--dur-base) var(--ease-spring);
}
@media (min-width: 640px) {
  .modal-overlay { align-items: center; padding: var(--sp-5); }
  .modal { border-radius: var(--radius-xl); padding: var(--sp-6); }
}
.modal h2 { margin-top: 0; }
@keyframes modal-in { from { opacity: 0; transform: translateY(12px) scale(.985); } to { opacity: 1; transform: none; } }

/* ---------- Toast: ink surface, exits never overshoot ---------- */
#toast-root {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(var(--tabbar-h) + var(--sp-3));
  z-index: 1000;
  display: flex; flex-direction: column; gap: var(--sp-2);
  width: min(92vw, 26rem);
}
@media (min-width: 768px) { #toast-root { bottom: var(--sp-5); } }
.toast {
  background: var(--surface-dark); color: var(--white);
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--radius-md);
  font-size: var(--fs-sm); font-weight: 500;
  box-shadow: var(--shadow-lg);
  animation: toast-in var(--dur-fast) var(--ease-out);
}
.toast-error { background: var(--alert-600); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- Wizard (new rental) ---------- */
.wizard-steps {
  display: flex; gap: var(--sp-2); margin-bottom: var(--sp-4);
  font-size: var(--fs-xs); font-weight: 600;
}
.wizard-steps .step {
  flex: 1; text-align: center;
  padding: var(--sp-2);
  border-bottom: 3px solid var(--gray-300);
  color: var(--text-muted);
}
.wizard-steps .step.active { border-color: var(--teal-700); color: var(--teal-800); }
.wizard-steps .step.done { border-color: var(--ok-600); color: var(--ok-600); }

.system-line {
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: var(--sp-3);
  margin-bottom: var(--sp-3);
  background: var(--gray-50);
}
.system-line .line-head { display: flex; justify-content: space-between; align-items: center; gap: var(--sp-2); margin-bottom: var(--sp-2); }
.line-price { font-weight: 700; color: var(--teal-800); }

.total-bar {
  position: sticky; bottom: calc(var(--tabbar-h) + var(--sp-2));
  display: flex; justify-content: space-between; align-items: center; gap: var(--sp-3);
  background: var(--surface-dark); color: var(--white);
  border-radius: var(--radius-lg);
  padding: var(--sp-3) var(--sp-4);
  box-shadow: var(--shadow-lg);
  margin-top: var(--sp-4);
}
@media (min-width: 768px) { .total-bar { bottom: var(--sp-3); } }
.total-bar .total-amount { font-size: var(--fs-lg); font-weight: 700; }
.total-bar .total-label { font-size: var(--fs-xs); opacity: .75; }

/* ---------- Misc ---------- */
.empty-state {
  text-align: center; color: var(--text-muted);
  padding: var(--sp-6) var(--sp-4);
  border: 1px dashed var(--border-default);
  border-radius: var(--radius-lg);
  background: var(--surface-inset);
}
.back-link { display: inline-flex; align-items: center; gap: var(--sp-1); font-size: var(--fs-sm); font-weight: 600; margin-bottom: var(--sp-3); }
.muted { color: var(--text-muted); }
.small { font-size: var(--fs-sm); }
.mb-0 { margin-bottom: 0; }
.mt-2 { margin-top: var(--sp-2); }
.divider { border: none; border-top: 1px solid var(--gray-200); margin: var(--sp-4) 0; }
.notice {
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--radius-md);
  font-size: var(--fs-sm);
  margin-bottom: var(--sp-4);
}
.notice-warn { background: var(--warn-100); color: var(--warn-700); }
.notice-info { background: var(--brand-soft); color: var(--teal-800); border: 1px solid var(--teal-200); }
.notice-warn { border: 1px solid var(--caution-600); }

/* ---------- Form field grid (long spec sheets) ---------- */
.field-grid { display: grid; gap: 0 var(--sp-3); grid-template-columns: 1fr; }
@media (min-width: 640px) { .field-grid { grid-template-columns: 1fr 1fr; } }
.field-row-3 { display: grid; gap: var(--sp-3); grid-template-columns: 1fr 1fr; }
@media (min-width: 640px) { .field-row-3 { grid-template-columns: 1fr 1fr 1fr; } }

/* ---------- Filter selects ---------- */
.filter-grid {
  display: grid; gap: var(--sp-2);
  grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr));
}
.filter-cell label {
  display: block;
  font-size: var(--fs-xs); font-weight: 600; color: var(--text-muted);
  margin-bottom: 2px;
}
.filter-cell select { padding: .4rem .5rem; font-size: var(--fs-sm); }

/* ---------- Attachments ---------- */
.attach-grid { display: flex; flex-wrap: wrap; gap: var(--sp-3); }
.attach-item {
  position: relative;
  width: 8.5rem;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--gray-50);
  padding: var(--sp-2);
  cursor: pointer;
}
.attach-item:hover { border-color: var(--teal-600); }
.attach-thumb {
  height: 6rem;
  display: flex; align-items: center; justify-content: center;
  background: var(--white);
  border-radius: var(--r-sm);
  overflow: hidden;
  margin-bottom: var(--sp-2);
}
.attach-thumb img { max-width: 100%; max-height: 100%; object-fit: contain; }
.file-badge {
  font-size: var(--fs-sm); font-weight: 700;
  color: var(--teal-700);
  border: 2px solid var(--teal-600);
  border-radius: var(--r-sm);
  padding: .35rem .6rem;
  letter-spacing: .05em;
}
.attach-name {
  font-size: var(--fs-xs); font-weight: 600; color: var(--gray-800);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.attach-size { font-size: var(--fs-xs); }
.attach-del {
  position: absolute; top: -0.5rem; right: -0.5rem;
  width: 1.5rem; height: 1.5rem;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--white);
  color: var(--gray-700);
  font-size: 1rem; line-height: 1;
  cursor: pointer;
  box-shadow: var(--shadow-1);
}
.attach-del:hover { background: var(--danger-100); color: var(--danger-600); border-color: var(--danger-600); }
.attach-count { display: inline-flex; align-items: center; gap: 3px; font-size: var(--fs-xs); color: var(--text-muted); }
.clip-icon { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.attach-mini {
  width: 30px; height: 30px;
  object-fit: cover;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  background: var(--white);
}

/* Status picker modal */
.status-pick { display: flex; flex-direction: column; gap: var(--sp-2); }

/* ---------- Login screen ---------- */
.login-screen {
  position: fixed; inset: 0; z-index: 100;
  background: var(--surface-subtle);
  display: flex; align-items: center; justify-content: center;
  padding: var(--sp-4);
}
.login-card {
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  padding: var(--sp-6) var(--sp-5);
  width: 100%; max-width: 23rem;
}
.login-logo { height: 2.6rem; width: auto; margin-bottom: var(--sp-4); }
.login-error {
  background: var(--danger-100); color: var(--danger-600);
  border-radius: var(--r-sm);
  padding: var(--sp-2) var(--sp-3);
  font-size: var(--fs-sm); font-weight: 600;
  margin-bottom: var(--sp-3);
}

/* ---------- Attachment drag & drop (round 19) ---------- */
.attach-card { position: relative; }
.attach-card .drop-overlay {
  display: none;
  position: absolute; inset: 4px;
  border: 2px dashed var(--accent, #33646d);
  border-radius: var(--r-md, 10px);
  background: rgba(51, 100, 109, 0.08);
  color: var(--accent, #33646d);
  font-weight: 600;
  align-items: center; justify-content: center;
  pointer-events: none;
  z-index: 2;
}
.attach-card.drag-over .drop-overlay { display: flex; }
.attach-card.drag-over { outline: 2px solid var(--accent, #33646d); outline-offset: -1px; }
.drop-hint { user-select: none; }
@media (pointer: coarse) { .drop-hint { display: none; } }  /* no mouse — hide the hint */

/* ---------- Wizard: editable line price (round 21) ---------- */
.line-price-edit {
  display: inline-flex; align-items: center; gap: 2px;
  font-weight: 700; color: var(--accent, #33646d);
  background: #fff; border: 1px solid var(--border, #d3d7da);
  border-radius: var(--r-sm, 6px); padding: 2px 6px 2px 8px;
}
.line-price-edit input {
  width: 5.5em; border: 0; outline: none; padding: 4px 2px;
  font: inherit; color: inherit; text-align: right; background: transparent;
}
.line-price-edit.custom { border-color: var(--accent, #33646d); background: #eff6f7; }
.system-line .searchbar { width: 100%; }

/* ---------- Technician colors (round 55) ---------- */
.tech-chip {
  display: inline-block; padding: 0 .55em; border-radius: 999px;
  font-size: var(--fs-xs); font-weight: 600; line-height: 1.5;
  white-space: nowrap; vertical-align: baseline;
}
.tech-legend { display: flex; gap: var(--sp-3); flex-wrap: wrap; margin: var(--sp-2) 0 0; }

/* ---------- Service Dashboard (round 57) ---------- */
.stage-h { margin-top: var(--sp-6, 2rem); padding-top: var(--sp-4);
  border-top: 1px solid var(--border-subtle); }

/* Round 58: table-like selection lists in the schedule / edit-visit modals —
   every row's columns line up (SN | type | site | due), and the availability
   week uses the same grid so the day column stays fixed. */
.pick-list { display: grid; column-gap: 12px; row-gap: 2px; align-items: baseline;
  margin: 4px 0; }
.pick-list.pick-mach { grid-template-columns: max-content minmax(0, 1fr) minmax(0, 1.1fr) max-content; }
/* Round 79: the planned-recipes input takes its own full-width line */
.pick-list.pick-mach .pick-recipes { grid-column: 1 / -1; padding-left: 1.6em; }
.pick-list.pick-mach .pick-recipes input { width: 100%; max-width: 34em; font-size: var(--fs-xs); }
.pick-list.pick-avail { grid-template-columns: max-content minmax(0, 1fr); }
.pick-row { display: contents; cursor: pointer; }
.pick-cell { min-width: 0; padding: 2px 4px 2px 0; overflow-wrap: break-word; }
.pick-cell.pick-hl { background: var(--teal-100, #e4eef0); }
.pick-avail .pick-cell.pick-hl:nth-of-type(odd) { border-radius: 4px 0 0 4px; padding-left: 4px; }
.pick-avail .pick-cell.pick-hl:nth-of-type(even) { border-radius: 0 4px 4px 0; }
@media (max-width: 480px) {
  /* narrow phones: due date tucks under, site column may wrap */
  .pick-list.pick-mach { grid-template-columns: max-content minmax(0, 1fr) minmax(0, 1fr); }
  .pick-list.pick-mach .pick-cell:nth-of-type(4n) { grid-column: 1 / -1; padding-left: 1.6em; }
}

/* Round 60: company holidays — calendar cells, mobile agenda, scheduler */
.cal-cell.cal-holiday { background: #fdf6ec; }
.cal-hol { font-size: .68rem; line-height: 1.25; color: #8a5a00; background: #f7e8cc;
  border-radius: 4px; padding: 1px 4px; margin: 1px 0 2px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hol-chip { color: #8a5a00; background: #f7e8cc; border-radius: 4px;
  padding: 0 5px; font-weight: 600; }
.cal-agenda-row.cal-agenda-hol { background: #fdf6ec; }
@media (max-width: 639px) {
  .cal-hol { display: none; }   /* phones read holidays from the agenda list */
}
#svc-body > h2.stage-h:first-child, .stage-tiles + h2.stage-h { border-top: none; }
.stage-tiles {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr));
  gap: var(--sp-3); margin: 0 0 var(--sp-3);
}
.stage-tile {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  background: var(--surface-card); border: 1px solid var(--border-subtle);
  border-top-color: var(--border-subtle) !important;   /* the system has no colored-bar cards */
  border-radius: var(--radius-lg);
  padding: var(--sp-4);
  box-shadow: var(--shadow-sm);
  text-decoration: none; color: inherit;
  transition: var(--transition-card);
}
.stage-tile:hover { border-color: var(--border-brand); box-shadow: var(--shadow-md); transform: translateY(-2px); color: inherit; }
/* icon emphasis = a brand-soft square at 4px, never a rounded chip */
.stage-tile-ic { display: flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: var(--radius-sm); margin-bottom: 8px;
  background: var(--brand-soft) !important; }
.stage-tile-ic svg { width: 22px; height: 22px; }
.stage-tile-num { font-size: 1.9rem; font-weight: 700; line-height: 1.05; letter-spacing: var(--tracking-tight);
  color: var(--text-strong); }
.stage-tile-lbl { font-size: var(--fs-xs); font-weight: 500; letter-spacing: var(--tracking-wide);
  text-transform: uppercase; color: var(--text-muted); }

/* ---------- Technician dashboard (round 56) ---------- */
.dash-tiles {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--sp-3);
  margin: 0 0 var(--sp-4);
}
@media (max-width: 639px) { .dash-tiles { grid-template-columns: repeat(2, 1fr); } }
.dash-tile {
  background: var(--surface-card); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg);
  padding: var(--sp-4);
  box-shadow: var(--shadow-sm);
}
.dash-tile-warn .dash-lbl { color: var(--alert-600); }
.dash-tile-warn .dash-num { color: var(--red-700, #9c2f28); }
.dash-num { font-size: 2rem; font-weight: 700; line-height: 1.05; letter-spacing: var(--tracking-tight); color: var(--text-strong); }
.dash-lbl { font-size: var(--fs-xs); font-weight: 500; letter-spacing: var(--tracking-wide);
  text-transform: uppercase; color: var(--text-muted); margin-top: 4px; }
.dash-h { margin: var(--sp-4) 0 var(--sp-2); }
.dash-h-warn { color: var(--red-700, #9c2f28); }
.dash-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr));
  gap: var(--sp-3); }
.dash-card {
  background: var(--surface-card); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg);
  padding: var(--sp-3) var(--sp-4); cursor: pointer;
  box-shadow: var(--shadow-xs);
  transition: var(--transition-card);
}
.dash-card:hover { border-color: var(--border-brand); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.dash-card-head { display: flex; justify-content: space-between; align-items: baseline;
  gap: var(--sp-2); margin-bottom: 2px; }
.dash-card-head strong { font-size: var(--fs-base); }

/* ---------- Service calendar (round 27) ---------- */
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; margin-top: var(--sp-3); }
.cal-head { font-size: var(--fs-xs); font-weight: 500; letter-spacing: var(--tracking-wide); text-transform: uppercase; color: var(--text-muted); text-align: center; padding: 4px 0; }
.cal-cell { min-height: 72px; border: 1px solid var(--border-subtle); border-radius: var(--radius-sm); padding: 2px 4px; background: var(--surface-card); }
.cal-empty { border: none; background: transparent; }
.cal-today { outline: 2px solid var(--accent, #33646d); outline-offset: -2px; }
.cal-day { font-size: var(--fs-xs); font-weight: 700; color: var(--gray-600); }
.cal-visit { display: block; font-size: 0.68rem; line-height: 1.25; background: var(--teal-100, #d7e5e8);
  color: var(--teal-800, #1d3f45); border-radius: 3px; padding: 1px 4px; margin-top: 2px;
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.cal-visit.cal-done { background: var(--gray-100, #eee); color: var(--gray-600); }
/* Round 53: long labels used to blow the 7-column grid past the viewport on
   phones. Cells may never dictate column width... */
.cal-cell { min-width: 0; overflow: hidden; }
.cal-visit { overflow: hidden; }
/* ...and on phones the grid becomes compact (dots only) with a readable
   agenda list underneath. */
.cal-dots { display: none; }
.cal-agenda { display: none; }
@media (max-width: 639px) {
  .cal-cell { min-height: 40px; padding: 2px 3px; }
  .cal-visit { display: none; }
  .cal-dots { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 2px; }
  .cal-dot { display: block; width: 7px; height: 7px; border-radius: 50%;
             background: var(--teal-700, #33646d); }
  .cal-dot.cal-dot-done { background: var(--gray-400, #bbb); }
  .cal-agenda { display: block; margin-top: var(--sp-3); border-top: 1px solid var(--border);
                padding-top: var(--sp-2); }
}
.cal-agenda-row { display: flex; gap: var(--sp-3); align-items: baseline;
  padding: 8px 2px; border-bottom: 1px solid var(--gray-200);
  text-decoration: none; color: inherit; }
.cal-agenda-row.cal-done { opacity: .6; }
.cal-agenda-date { flex: 0 0 3.6em; font-size: var(--fs-xs); font-weight: 700;
  color: var(--teal-800, #2a525a); }
.cal-agenda-main { min-width: 0; }

/* Round 75: time off on the calendar + schedule picker */
.cal-off {
  font-size: var(--fs-xs); padding: 1px 4px; border-radius: 4px; margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.mcal-off { background: repeating-linear-gradient(45deg, transparent 0 5px, rgba(46, 125, 79, .16) 5px 8px); }

/* Round 95 (parts module) */
.mt-3 { margin-top: var(--sp-3); }

/* Round 97 (parts): ownership dots match the physical stickers -
   blue = Wavesure-owned, purple = consignment */
.own-dot { display:inline-block; width:8px; height:8px; border-radius:50%;
  margin-right:6px; vertical-align:0; }
.own-owned { background:#2b5f9e; }
.own-consignment { background:#7b4fa6; }

/* Round 98 (parts): the field-app marker is a FLAG, not a button -
   passive tinted badge, no border */
.badge-field { background: #eff6f7; color: #33646C; border: none; }
