/* ============================================================
   Personal Service Center — Technician Tracking System
   Compact modern UI · responsive (desktop / tablet / mobile)
   ============================================================ */
:root {
  --bg: #0a0f1c;
  --bg2: #0d1526;
  --panel: #101a30;
  --panel2: #16223d;
  --line: rgba(148, 163, 200, 0.14);
  --line2: rgba(148, 163, 200, 0.24);
  --text: #e7ecf6;
  --muted: #8fa0bd;
  --muted2: #64748f;
  --accent: #4f8cff;
  --accent2: #7aa7ff;
  --green: #2dd4a7;
  --red: #f87171;
  --amber: #fbbf24;
  --purple: #b48cff;
  --radius: 10px;
  --shadow: 0 8px 28px rgba(2, 6, 18, 0.55);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  /* ---- derived / extended palette (theme-switchable) ---- */
  --input-bg: #0c1424;
  --input-bg-disabled: #131d33;
  --thead-bg: #131d33;
  --tbl-wrap-bg: rgba(12, 19, 35, .5);
  --seg-bg: #0c1424;
  --modal-bg: linear-gradient(180deg, #18233d, #121c33);
  --login-card-bg: linear-gradient(180deg, rgba(22,34,61,.95), rgba(16,26,48,.95));
  --card-bg: linear-gradient(180deg, rgba(22,34,61,.55), rgba(16,26,48,.55));
  --topbar-bg: rgba(10, 15, 28, 0.88);
  --bottomnav-bg: rgba(13, 21, 38, 0.97);
  --toast-bg: #1b2a47;
  --toast-err-bg: #3a1a24;
  --scrollbar-thumb: #243350;
  --timeline-dot-bg: #0c1424;
  --rank-badge-bg: #1c2947;
  --rank-bar-bg: #1a2745;
  --overlay-bg: rgba(4, 8, 18, 0.72);
  --body-bg-img:
    radial-gradient(1200px 700px at 85% -10%, rgba(79, 140, 255, 0.14), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(45, 212, 167, 0.08), transparent 55%);
  --nav-active-color: #fff;
  --btn-green-text: #04110c;
  --brand-logo-text: #06101f;
  --avatar-text: #0a0f1c;
  --rank-gold-text: #2b1a00;
  --rank-silver-text: #232b3a;
  --rank-bronze-text: #2b1400;
  --bg-grad-btn: linear-gradient(135deg, #4f8cff, #3b6fe0);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  background: var(--body-bg-img), var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font-size: 13.5px;
  line-height: 1.45;
  min-height: 100vh;
}
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: var(--scrollbar-thumb); border-radius: 8px; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- login ---------- */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.login-card {
  width: 100%; max-width: 400px; background: var(--login-card-bg);
  border: 1px solid var(--line); border-radius: 16px; padding: 28px 26px; box-shadow: var(--shadow);
}
.brand-row { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.brand-logo {
  width: 40px; height: 40px; border-radius: 11px; flex: none;
  background: linear-gradient(135deg, #4f8cff, #2dd4a7);
  display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 17px; color: var(--brand-logo-text);
}
.brand-logo-img {
  width: 32px; height: 32px; border-radius: 9px; flex: none; object-fit: cover;
  box-shadow: 0 2px 8px rgba(0,0,0,.30); background: #fff;
}
.brand-logo-img.sm { width: 26px; height: 26px; border-radius: 7px; }
.brand-title { font-size: 17px; font-weight: 700; letter-spacing: .2px; }
.brand-sub { font-size: 11.5px; color: var(--muted); margin-top: 1px; }
.login-card h1 { font-size: 18px; margin: 18px 0 4px; }
.login-card .hint { color: var(--muted); font-size: 12px; margin-bottom: 16px; }

/* ---------- forms ---------- */
label.f { display: block; font-size: 11.5px; color: var(--muted); margin: 0 0 4px 2px; font-weight: 600; letter-spacing: .3px; }
input, select, textarea {
  width: 100%; background: var(--input-bg); color: var(--text);
  border: 1px solid var(--line2); border-radius: 8px;
  padding: 8px 10px; font-size: 13px; font-family: var(--font);
  outline: none; transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(79,140,255,.18); }
input:disabled, select:disabled, input[readonly] { background: var(--input-bg-disabled); color: var(--muted); cursor: not-allowed; }
input[type="date"], input[type="time"] { color-scheme: dark; }
html[data-theme="light"] input[type="date"], html[data-theme="light"] input[type="time"] { color-scheme: light; }
textarea { resize: vertical; min-height: 60px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }
.form-foot { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 16px; }

/* ---------- inline SVG icon base (wave 35) ----------
   Every icon glyph in the app is a bare <svg viewBox="0 0 24 24"> with no
   intrinsic width/height, so it relies on a container rule for sizing. This
   global fallback guarantees an icon can NEVER render at full/default size
   inside a container that forgot to declare one. Charts use <canvas>, so this
   only ever affects icon glyphs. More specific rules (e.g. .btn svg, .empty svg)
   still win because they have higher specificity. */
svg { width: 16px; height: 16px; flex: none; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid transparent; border-radius: 8px; cursor: pointer;
  font-size: 12.5px; font-weight: 600; padding: 8px 14px; font-family: var(--font);
  transition: filter .15s, background .15s; white-space: nowrap; min-height: 34px;
}
.btn-primary { background: var(--bg-grad-btn); color: #fff; }
.btn-primary:hover { filter: brightness(1.12); }
.btn-ghost { background: transparent; border-color: var(--line2); color: var(--muted); }
.btn-ghost:hover { color: var(--text); border-color: var(--accent); }
.btn-green { background: linear-gradient(135deg, #17b58a, #0f9472); color: var(--btn-green-text); }
.btn-danger { background: rgba(248,113,113,.12); border-color: rgba(248,113,113,.4); color: #f8a5a5; }
.btn-danger:hover { background: rgba(248,113,113,.22); }
.btn-sm { padding: 4px 9px; min-height: 28px; font-size: 11.5px; border-radius: 6px; }
/* wave 29: keep inline icons inside buttons small & aligned */
.btn svg { width: 14px; height: 14px; flex: none; }
.btn-sm svg { width: 13px; height: 13px; }
.btn-icon { padding: 6px 8px; }

/* ---------- layout ---------- */
.app { display: none; min-height: 100vh; }
.app.on { display: block; }
.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 12px;
  background: var(--topbar-bg); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line); padding: 9px 16px;
}
.topbar .brand-row { margin: 0; }
.topbar .spacer { flex: 1; }
.user-chip { display: flex; align-items: center; gap: 9px; }
.avatar {
  width: 30px; height: 30px; border-radius: 50%; flex: none;
  background: linear-gradient(135deg, #b48cff, #4f8cff); color: var(--avatar-text);
  font-weight: 800; font-size: 12px; display: flex; align-items: center; justify-content: center;
}
.user-meta { line-height: 1.15; text-align: right; }
.user-meta .nm { font-size: 12.5px; font-weight: 700; }
.user-meta .rl { font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }

.main { display: flex; }
.sidebar {
  width: 212px; flex: none; padding: 14px 10px; border-right: 1px solid var(--line);
  min-height: calc(100vh - 52px); position: sticky; top: 52px; align-self: flex-start;
}
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px; margin-bottom: 3px;
  border-radius: 8px; cursor: pointer; color: var(--muted); font-weight: 600; font-size: 13px;
  border: 1px solid transparent;
}
.nav-item:hover { color: var(--text); background: rgba(79,140,255,.07); }
.nav-item.active { color: var(--nav-active-color); background: linear-gradient(135deg, rgba(79,140,255,.25), rgba(45,212,167,.12)); border-color: rgba(79,140,255,.45); }
.nav-item svg { width: 17px; height: 17px; flex: none; }
.nav-section { font-size: 10px; text-transform: uppercase; letter-spacing: 1px; color: var(--muted2); margin: 14px 6px 6px; }

/* sliding sidebar — desktop collapses to an icon-only rail */
.sidebar { transition: width .18s ease; }
.sidebar.collapsed { width: 66px; padding: 14px 8px; }
.sidebar.collapsed .nav-item { justify-content: center; padding: 10px 0; }
.sidebar.collapsed .nav-item span { display: none; }
.sidebar.collapsed .nav-section { display: none; }

/* hamburger toggle (topbar) */
.nav-toggle {
  flex: none; display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 9px; cursor: pointer;
  background: var(--seg-bg); border: 1px solid var(--line2); color: var(--muted);
  transition: color .15s, border-color .15s, background .15s;
}
.nav-toggle:hover { color: var(--text); border-color: var(--accent); }
.nav-toggle svg { width: 17px; height: 17px; }

/* scrim — mobile drawer overlay (hidden on desktop) */
.scrim { display: none; }

.content { flex: 1; padding: 18px 20px 90px; max-width: 1500px; min-width: 0; }

/* mobile bottom nav */
.bottom-nav { display: none; }
@media (max-width: 860px) {
  /* sidebar becomes a sliding drawer that opens over the content */
  .sidebar {
    position: fixed; top: 52px; left: 0; bottom: 0; z-index: 46;
    width: 236px; max-width: 84vw; min-height: 0;
    background: var(--bottomnav-bg); backdrop-filter: blur(12px);
    border-right: 1px solid var(--line2); box-shadow: var(--shadow);
    transform: translateX(-110%); transition: transform .22s ease;
    overflow-y: auto; padding-top: 10px;
  }
  .sidebar.open { transform: translateX(0); }
  .scrim {
    display: block; position: fixed; top: 52px; left: 0; right: 0; bottom: 0;
    z-index: 45; background: var(--overlay-bg);
    opacity: 0; pointer-events: none; transition: opacity .2s;
  }
  .scrim.on { opacity: 1; pointer-events: auto; }
  /* keep the topbar readable on phones with the hamburger present */
  .topbar .user-meta { display: none; }
  .topbar .brand-title { display: none; }
  .content { padding: 14px 12px 84px; }
  .bottom-nav {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 60;
    background: var(--bottomnav-bg); backdrop-filter: blur(10px);
    border-top: 1px solid var(--line); padding: 4px 4px calc(4px + env(safe-area-inset-bottom));
  }
  .bottom-nav .nav-item { flex: 1; flex-direction: column; gap: 3px; font-size: 10px; padding: 7px 2px; margin: 0; border-radius: 10px; text-align: center; }
  .bottom-nav .nav-item svg { width: 19px; height: 19px; }
}

/* ---------- page & cards ---------- */
.page-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.page-head h2 { font-size: 18px; letter-spacing: .2px; }
.page-head .sub { color: var(--muted); font-size: 12px; width: 100%; margin-top: -6px; }
.page-head .spacer { flex: 1; }

.card {
  background: var(--card-bg);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px;
}
.card h3 { font-size: 13px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .8px; margin-bottom: 10px; }

/* KPI grid */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(168px, 1fr)); gap: 10px; margin-bottom: 14px; }
.kpi { position: relative; overflow: hidden; }
.kpi .k-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: .8px; color: var(--muted); font-weight: 700; }
.kpi .k-val { font-size: 16px; font-weight: 700; margin-top: 3px; letter-spacing: .2px; }
.kpi .k-sub { font-size: 11px; color: var(--muted2); margin-top: 2px; }
.kpi .k-ico { position: absolute; right: 10px; top: 10px; opacity: .5; }
.kpi .k-ico svg { width: 18px; height: 18px; }
.k-green .k-val { color: var(--green); }
.k-blue .k-val { color: var(--accent2); }
.k-purple .k-val { color: var(--purple); }
.k-amber .k-val { color: var(--amber); }

.two-col { display: grid; grid-template-columns: 1.6fr 1fr; gap: 12px; margin-bottom: 12px; }
.three-col { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; margin-bottom: 12px; }
@media (max-width: 1100px) { .three-col { grid-template-columns: 1fr 1fr; } }
@media (max-width: 900px) { .two-col { grid-template-columns: 1fr; } }
@media (max-width: 700px) { .three-col { grid-template-columns: 1fr; } }

/* ---------- tables ---------- */
.tbl-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--line); background: var(--tbl-wrap-bg); }
table.tbl { width: 100%; border-collapse: collapse; font-size: 12.5px; min-width: 640px; }
.tbl thead th {
  position: sticky; top: 0; background: var(--thead-bg); color: var(--muted);
  font-size: 10.5px; text-transform: uppercase; letter-spacing: .7px; text-align: left;
  padding: 8px 10px; border-bottom: 1px solid var(--line2); white-space: nowrap; z-index: 5;
}
.tbl tbody td { padding: 7px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; vertical-align: middle; }
.tbl tbody tr:hover { background: rgba(79, 140, 255, 0.06); }
.tbl tbody tr:last-child td { border-bottom: none; }
.num { text-align: right !important; font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 11.5px; }
.nowrap { white-space: nowrap; }
.td-wrap { white-space: normal; min-width: 180px; }

/* status chips */
.chip {
  display: inline-flex; align-items: center; gap: 5px; font-size: 10.5px; font-weight: 700;
  padding: 3px 8px; border-radius: 999px; letter-spacing: .3px; white-space: nowrap;
}
.chip::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.chip-prog { background: rgba(79,140,255,.14); color: #8db4ff; }
.chip-wcust { background: rgba(251,191,36,.13); color: #ffd675; }
.chip-wpart { background: rgba(180,140,255,.14); color: #cdb2ff; }
.chip-done { background: rgba(45,212,167,.13); color: #6fe7c4; }
.chip-open { background: rgba(148,163,200,.12); color: #a9b7d4; }
.chip-revisit { background: rgba(248,113,113,.13); color: #ffa1a1; }
/* v1.4.8 \u2014 Warranty (No Charge) chip */
.chip-warranty { background: rgba(217,70,239,.15); color: #eaa8ff; }
.chip-co { background: rgba(251,191,36,.1); color: #fcd34d; border: 1px dashed rgba(251,191,36,.4); }
.chip-co::before { display: none; }
/* wave 55 — Daily Log collection-point chip */
.chip-point { background: rgba(56,189,248,.14); color: #7dd3fc; }
.chip-point::before { display: none; }
/* wave 31 — Telegram subscriber status chips */
.chip-green { background: rgba(45,212,167,.14); color: #6fe7c4; }
.chip-amber { background: rgba(251,191,36,.13); color: #ffd675; }
.chip-blue { background: rgba(79,140,255,.14); color: #8db4ff; }
/* wave 9 — multi-technician job chip + contributions sub-table */
.chip-multi { background: rgba(79,140,255,.14); color: #8db4ff; border: 1px solid rgba(79,140,255,.35); }
.chip-multi::before { display: none; }
.contrib-tbl { min-width: 0; }
.contrib-tbl thead th { font-size: 10.5px; }
.contrib-tbl tbody td { padding: 5px 6px; }
.contrib-tbl input, .contrib-tbl select { width: 100%; min-width: 70px; padding: 5px 7px; font-size: 12px; }
.contrib-tbl input.df-c-price, .contrib-tbl input.df-c-cost { text-align: right; }
.contrib-tbl input:disabled { opacity: .45; cursor: not-allowed; }
/* Wave 23: per-contribution "Done" checkbox (contributor marks their own task done) */
.contrib-tbl .df-c-done-cell { text-align: center; white-space: nowrap; }
.contrib-tbl .df-c-done-wrap { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; color: var(--muted); cursor: pointer; }
.contrib-tbl .df-c-done-wrap input.df-c-done { width: auto; min-width: 0; margin: 0; cursor: pointer; }
.contrib-tbl .df-c-done-wrap input.df-c-done:disabled { cursor: not-allowed; }
.contrib-tbl tr.df-c-row:has(.df-c-done:checked) { background: rgba(34,197,94,.07); }
.contrib-tbl tr.df-c-row:has(.df-c-done:checked) .df-c-done-wrap { color: var(--green, #22c55e); font-weight: 600; }
.contrib-totals { margin-top: 8px; padding: 8px 10px; border: 1px solid var(--line2); border-radius: 8px; background: rgba(79,140,255,.05); }
.contrib-totals .ct-job { font-size: 12.5px; margin-bottom: 4px; }
.contrib-totals .ct-job b { font-variant-numeric: tabular-nums; }
.contrib-totals .ct-tech { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.ct-chip { font-size: 11px; background: rgba(148,163,200,.12); border: 1px solid var(--line2); border-radius: 999px; padding: 2px 9px; font-variant-numeric: tabular-nums; }
html[data-theme="light"] .chip-multi { background: rgba(63,116,230,.12); color: #2f5fd4; }
html[data-theme="light"] .contrib-totals { background: rgba(63,116,230,.05); }

/* icons inside table headers & cells */
.tbl thead th svg { width: 12px; height: 12px; vertical-align: -2px; margin-right: 4px; opacity: .7; }
.tl-cell { display: inline-flex; align-items: center; gap: 5px; }
.tl-cell svg { width: 13px; height: 13px; }
.tl-cell.done svg { color: var(--green); }
.tl-cell.open { color: var(--amber); }
.tl-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--red); display: inline-block; flex: none; }
.loc-cell { display: inline-flex; align-items: center; gap: 5px; }
.loc-cell svg { width: 12px; height: 12px; opacity: .7; }

/* fixed-prefix inputs (+960 phone / QT/20 quotation number) */
.cc-input { display: flex; align-items: stretch; }
.cc-input .cc-fix {
  flex: none; display: inline-flex; align-items: center; padding: 0 10px;
  background: var(--input-bg-disabled); color: var(--muted);
  border: 1px solid var(--line2); border-right: none; border-radius: 8px 0 0 8px;
  font-size: 12.5px; font-weight: 700; white-space: nowrap;
}
.cc-input input { border-radius: 0 8px 8px 0; flex: 1; min-width: 0; width: 100%; }
.cc-input input:focus { position: relative; z-index: 1; }

.pos { color: var(--green); font-weight: 700; }
.neg { color: var(--red); font-weight: 700; }

/* filters bar — ONE flowing inline row: fields, Apply, Export, record count and export format together */
.filters { display: flex; flex-wrap: wrap; gap: 8px; row-gap: 8px; align-items: flex-end; margin-bottom: 12px; }
.filters .f-group { display: flex; flex-direction: column; min-width: 130px; }
.filters select, .filters input { padding: 6px 9px; font-size: 12.5px; }
.filters .search-box { flex: 1; min-width: 170px; }
.filters .f-count { display: inline-flex; align-items: center; min-height: 33px; padding: 0 2px; white-space: nowrap; }
.filters .seg { align-self: flex-end; }

/* ---------- wave 107: Daily Logs realtime search suggestions (typeahead) ---------- */
.dl-search-wrap { position: relative; }
.dl-suggest {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 40;
  background: var(--panel); border: 1px solid var(--line2); border-radius: 10px;
  box-shadow: var(--shadow); padding: 4px; max-height: 340px; overflow-y: auto;
  animation: dl-sug-in .12s ease-out;
}
@keyframes dl-sug-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.dl-sug-item { padding: 7px 9px; border-radius: 8px; cursor: pointer; border: 1px solid transparent; }
.dl-sug-item + .dl-sug-item { margin-top: 2px; }
.dl-sug-item.on, .dl-sug-item:hover { background: var(--panel2); border-color: var(--line2); }
.dl-sug-top { display: flex; align-items: baseline; gap: 8px; }
.dl-sug-sid { font-weight: 800; font-size: 12.5px; color: var(--accent2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.dl-sug-name { font-size: 12.5px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dl-sug-bot { display: flex; align-items: center; gap: 8px; margin-top: 2px; font-size: 11px; color: var(--muted); }
.dl-sug-ph { white-space: nowrap; font-variant-numeric: tabular-nums; }
.dl-sug-date { margin-left: auto; white-space: nowrap; color: var(--muted2); }
.dl-sug-item .chip { font-size: 10px; padding: 1px 6px; }
.dl-suggest mark { background: rgba(79, 140, 255, .28); color: inherit; border-radius: 3px; padding: 0 1px; }
html[data-theme="light"] .dl-suggest mark { background: rgba(63, 116, 230, .20); }
.dl-sug-empty, .dl-sug-more { padding: 9px 10px; font-size: 11.5px; color: var(--muted); }
.dl-sug-more { border-top: 1px solid var(--line); text-align: center; }
/* Wave 120: highlight for live list search (matches inside any column) */
mark.hl { background: rgba(79, 140, 255, .30); color: inherit; border-radius: 3px; padding: 0 1px; }
html[data-theme="light"] mark.hl { background: rgba(63, 116, 230, .22); }
/* Wave 120: subtle "live" cue on the search box while it filters the list */
input[data-live-search] { transition: border-color .15s ease, box-shadow .15s ease; }
input[data-live-search]:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(79,140,255,.14); }
html[data-density="compact"] .dl-sug-item { padding: 6px 8px; }

/* toolbar (legacy — other pages) */
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }

/* segment control */
.seg { display: inline-flex; background: var(--seg-bg); border: 1px solid var(--line2); border-radius: 8px; padding: 2px; gap: 2px; }
.seg button {
  border: none; background: transparent; color: var(--muted); font-size: 12px; font-weight: 600;
  padding: 5px 12px; border-radius: 6px; cursor: pointer; font-family: var(--font);
}
.seg button.on { background: linear-gradient(135deg, #4f8cff, #3b6fe0); color: #fff; }

/* tabs */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 14px; flex-wrap: wrap; }
.tab {
  padding: 8px 14px; font-size: 13px; font-weight: 700; color: var(--muted); cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tab:hover { color: var(--text); }
.tab.on { color: var(--accent2); border-bottom-color: var(--accent); }

/* modal */
.modal-overlay {
  position: fixed; inset: 0; background: var(--overlay-bg); backdrop-filter: blur(4px);
  display: none; align-items: flex-start; justify-content: center; z-index: 100; padding: 30px 14px; overflow-y: auto;
}
.modal-overlay.on { display: flex; }
.modal {
  width: 100%; max-width: 620px; background: var(--modal-bg);
  border: 1px solid var(--line2); border-radius: 14px; box-shadow: var(--shadow); padding: 20px 20px 16px;
}
.modal-head { display: flex; align-items: center; margin-bottom: 14px; }
.modal-head h3 { font-size: 15.5px; }
.modal-head .spacer { flex: 1; }
.modal-close { background: none; border: none; color: var(--muted); font-size: 20px; cursor: pointer; padding: 2px 8px; border-radius: 6px; }
.modal-close:hover { color: var(--text); background: rgba(148,163,200,.12); }

/* toast */
#toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--toast-bg); border: 1px solid var(--line2); color: var(--text);
  padding: 10px 18px; border-radius: 10px; font-size: 13px; font-weight: 600;
  opacity: 0; pointer-events: none; transition: all .25s; z-index: 200; box-shadow: var(--shadow);
  max-width: 90vw; text-align: center;
}
#toast.on { opacity: 1; transform: translateX(-50%) translateY(0); }
#toast.err { border-color: rgba(248,113,113,.5); background: var(--toast-err-bg); }
#toast.ok { border-color: rgba(45,212,167,.5); }

/* timeline */
.timeline { list-style: none; margin-top: 6px; }
.timeline li { position: relative; padding: 0 0 14px 26px; }
.timeline li::before {
  content: ''; position: absolute; left: 7px; top: 6px; bottom: -4px; width: 2px; background: var(--line2);
}
.timeline li:last-child::before { display: none; }
.timeline .dot {
  position: absolute; left: 0; top: 3px; width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid var(--accent); background: var(--timeline-dot-bg); display: flex; align-items: center; justify-content: center;
}
.timeline .dot.done { border-color: var(--green); }
.timeline .t-title { font-weight: 700; font-size: 13px; }
.timeline .t-when { font-size: 11.5px; color: var(--muted); }
.timeline .t-note { font-size: 11.5px; color: var(--muted2); }
.big-dur { display: flex; align-items: baseline; gap: 8px; padding: 10px 14px; border-radius: 10px; background: rgba(45,212,167,.08); border: 1px solid rgba(45,212,167,.25); margin-bottom: 12px; }
.big-dur .bd-val { font-size: 20px; font-weight: 800; color: var(--green); }
.big-dur .bd-lab { font-size: 11px; color: var(--muted); }

/* ranking list */
.rank-row { display: flex; align-items: center; gap: 10px; padding: 7px 4px; border-bottom: 1px solid var(--line); }
.rank-row:last-child { border-bottom: none; }
.rank-badge {
  width: 24px; height: 24px; border-radius: 7px; flex: none; font-size: 11.5px; font-weight: 800;
  display: flex; align-items: center; justify-content: center; background: var(--rank-badge-bg); color: var(--muted);
}
.rank-1 { background: linear-gradient(135deg, #ffd166, #f4a63a); color: var(--rank-gold-text); }
.rank-2 { background: linear-gradient(135deg, #d7dde8, #a9b4c7); color: var(--rank-silver-text); }
.rank-3 { background: linear-gradient(135deg, #e8a06b, #c77b42); color: var(--rank-bronze-text); }
.rank-row .r-name { flex: 1; font-weight: 600; font-size: 12.5px; }
.rank-row .r-val { font-weight: 800; font-size: 13px; }
.rank-bar { height: 4px; border-radius: 4px; background: var(--rank-bar-bg); margin-top: 3px; overflow: hidden; }
.rank-bar > div { height: 100%; border-radius: 4px; background: linear-gradient(90deg, var(--accent), var(--green)); }

/* mini stats rows */
.stat-line { display: flex; justify-content: space-between; padding: 6px 2px; border-bottom: 1px dashed var(--line); font-size: 12.5px; }
.stat-line:last-child { border-bottom: none; }
.stat-line b { font-variant-numeric: tabular-nums; }

/* empty state */
.empty { text-align: center; color: var(--muted2); padding: 34px 10px; font-size: 13px; }
.empty svg { width: 34px; height: 34px; opacity: .4; margin-bottom: 8px; }

/* legend */
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 11.5px; color: var(--muted); margin-top: 8px; }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend i { width: 9px; height: 9px; border-radius: 3px; display: inline-block; }

/* mobile card list (tables -> cards on small screens for daily logs) */
@media (max-width: 720px) {
  .tbl-desktop { display: table; }
}
.item-chips { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.item-chip { font-size: 10.5px; background: rgba(79,140,255,.1); border: 1px solid rgba(79,140,255,.25); color: #9dc0ff; padding: 2px 7px; border-radius: 6px; font-weight: 700; }
.item-chip.dsk { background: rgba(45,212,167,.08); border-color: rgba(45,212,167,.25); color: #7fe9c9; }
.item-chip.sys { background: rgba(180,140,255,.1); border-color: rgba(180,140,255,.3); color: #cdb2ff; }

/* users page */
.u-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 6px; }
.u-dot.on { background: var(--green); }
.u-dot.off { background: var(--red); }

/* misc */
.mt { margin-top: 12px; }
.mb { margin-bottom: 12px; }
.pill { font-size: 10.5px; background: rgba(148,163,200,.12); color: var(--muted); padding: 2px 8px; border-radius: 999px; font-weight: 700; }
a { color: var(--accent2); }

/* print */

/* ============================================================
   LIGHT MODE — applied when html[data-theme="light"]
   ============================================================ */
html[data-theme="light"] {
  --bg: #eef2f8;
  --bg2: #e6ecf5;
  --panel: #ffffff;
  --panel2: #f4f7fc;
  --line: rgba(23, 42, 74, 0.14);
  --line2: rgba(23, 42, 74, 0.24);
  --text: #1a2537;
  --muted: #5b6b85;
  --muted2: #8494ab;
  --accent: #3f74e6;
  --accent2: #2f5fd4;
  --green: #0e9e77;
  --red: #d64545;
  --amber: #b57e0f;
  --purple: #7c5cd6;
  --radius: 10px;
  --shadow: 0 8px 24px rgba(23, 42, 74, 0.16);

  --input-bg: #ffffff;
  --input-bg-disabled: #eef1f6;
  --thead-bg: #f2f5fa;
  --tbl-wrap-bg: #ffffff;
  --seg-bg: #e7edf6;
  --modal-bg: #ffffff;
  --login-card-bg: #ffffff;
  --card-bg: #ffffff;
  --topbar-bg: rgba(255, 255, 255, 0.92);
  --bottomnav-bg: rgba(255, 255, 255, 0.97);
  --toast-bg: #ffffff;
  --toast-err-bg: #fdecee;
  --scrollbar-thumb: #c3cedd;
  --timeline-dot-bg: #ffffff;
  --rank-badge-bg: #edf1f7;
  --rank-bar-bg: #e2e8f1;
  --overlay-bg: rgba(23, 42, 74, 0.35);
  --body-bg-img:
    radial-gradient(1200px 700px at 85% -10%, rgba(63, 116, 230, 0.07), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(14, 158, 119, 0.05), transparent 55%);
  --nav-active-color: #1a2537;
  --btn-green-text: #ffffff;
  --brand-logo-text: #06101f;
  --avatar-text: #ffffff;
  --rank-gold-text: #5c4000;
  --rank-silver-text: #3a4557;
  --rank-bronze-text: #5c3010;
  --bg-grad-btn: linear-gradient(135deg, #4f8cff, #3b6fe0);
}
html[data-theme="light"] .brand-logo-img { box-shadow: 0 2px 10px rgba(23,42,74,.18); background: #fff; }
html[data-theme="light"] .chip-prog { background: rgba(63,116,230,.12); color: #2f5fd4; }
html[data-theme="light"] .chip-wcust { background: rgba(181,126,15,.12); color: #8a6208; }
html[data-theme="light"] .chip-wpart { background: rgba(124,92,214,.12); color: #6a4ec2; }
html[data-theme="light"] .chip-done { background: rgba(14,158,119,.12); color: #0b8266; }
html[data-theme="light"] .chip-open { background: rgba(91,107,133,.12); color: #5b6b85; }
html[data-theme="light"] .chip-revisit { background: rgba(214,69,69,.12); color: #c23c3c; }
html[data-theme="light"] .chip-co { background: rgba(181,126,15,.09); color: #8a6208; border: 1px dashed rgba(181,126,15,.45); }
html[data-theme="light"] .chip-warranty { background: rgba(168,36,196,.12); color: #a024c4; }
html[data-theme="light"] .item-chip { background: rgba(63,116,230,.09); border-color: rgba(63,116,230,.28); color: #2f5fd4; }
html[data-theme="light"] .item-chip.dsk { background: rgba(14,158,119,.08); border-color: rgba(14,158,119,.3); color: #0b8266; }
html[data-theme="light"] .item-chip.sys { background: rgba(124,92,214,.09); border-color: rgba(124,92,214,.3); color: #6a4ec2; }
html[data-theme="light"] .pos { color: #0e9e77; }
html[data-theme="light"] .neg { color: #d64545; }
html[data-theme="light"] .btn-danger { background: rgba(214,69,69,.09); border-color: rgba(214,69,69,.35); color: #c23c3c; }
html[data-theme="light"] .btn-danger:hover { background: rgba(214,69,69,.16); }
html[data-theme="light"] .nav-item:hover { background: rgba(63,116,230,.07); }
html[data-theme="light"] .nav-item.active { background: linear-gradient(135deg, rgba(63,116,230,.16), rgba(14,158,119,.08)); border-color: rgba(63,116,230,.4); }
html[data-theme="light"] .tbl tbody tr:hover { background: rgba(63,116,230,.05); }
html[data-theme="light"] .modal-close:hover { background: rgba(23,42,74,.08); }
html[data-theme="light"] .pill { background: rgba(91,107,133,.13); }
html[data-theme="light"] .big-dur { background: rgba(14,158,119,.07); border-color: rgba(14,158,119,.3); }
html[data-theme="light"] .timeline li::before { background: rgba(23,42,74,.2); }
html[data-theme="light"] #toast.ok { border-color: rgba(14,158,119,.45); }
html[data-theme="light"] .btn-ghost { color: #5b6b85; }
html[data-theme="light"] .btn-ghost:hover { color: #1a2537; }

/* ---------- SERVICE ID duplicate alert (wave 5) ---------- */
/* small popup layered above the open form modal (z-index 300 > modal 100) so the
   user's half-typed data stays intact underneath */
.sid-alert-overlay {
  position: fixed; inset: 0; z-index: 300;
  display: flex; align-items: center; justify-content: center;
  background: rgba(8, 12, 22, 0.55); padding: 20px;
}
.sid-alert {
  max-width: 420px; width: 100%;
  background: var(--panel); border: 1px solid rgba(248, 113, 113, 0.45);
  border-top: 3px solid var(--red); border-radius: 12px;
  box-shadow: var(--shadow); padding: 22px 22px 18px;
  text-align: center; animation: sidPop .18s ease-out;
}
@keyframes sidPop { from { transform: scale(.92); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.sid-alert-ico { font-size: 30px; margin-bottom: 8px; }
.sid-alert-title { font-weight: 800; font-size: 16px; color: var(--red); margin-bottom: 8px; }
.sid-alert-msg { font-size: 13.5px; color: var(--text); line-height: 1.5; }
.sid-alert-msg b { color: var(--red); }
.sid-alert-sub { font-size: 12px; color: var(--muted); margin-top: 7px; line-height: 1.5; }
.sid-alert .btn { margin-top: 16px; }
input.err, select.err, textarea.err { border-color: var(--red) !important; box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.18) !important; }

/* ---------- theme toggle ---------- */
.theme-toggle {
  flex: none; display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 9px; cursor: pointer;
  background: var(--seg-bg); border: 1px solid var(--line2); color: var(--muted);
  transition: color .15s, border-color .15s, background .15s;
}
.theme-toggle:hover { color: var(--text); border-color: var(--accent); }
.theme-toggle svg { width: 17px; height: 17px; }
.theme-toggle .ico-moon { display: none; }
html[data-theme="light"] .theme-toggle .ico-sun { display: none; }
html[data-theme="light"] .theme-toggle .ico-moon { display: block; }
.login-theme-row { display: flex; justify-content: center; margin-top: 14px; }

/* print stays paper-white regardless of theme */
@media print {
  html[data-theme="light"] body, body { background: #fff; color: #111; }
}
@media print {
  body { background: #fff; color: #111; }
  .topbar, .sidebar, .bottom-nav, .filters, .toolbar, .form-foot { display: none !important; }
  .card { border: 1px solid #ccc; background: #fff; }
  .content { padding: 0; max-width: none; }
}


/* ===== Wave 7: Technician Performance Report card ===== */
.cr-card { border-left: 3px solid var(--accent); margin-bottom: 18px; }
.cr-card h3 { display: flex; align-items: center; gap: 8px; }
.cr-card h3 svg { width: 15px; height: 15px; color: var(--accent); }
.cr-sub { font-size: 12px; margin: 2px 0 4px; line-height: 1.5; }
.cr-filters { margin: 12px 0 10px; }
.btn-pdf { background: linear-gradient(135deg, #e05252, #c03535); color: #fff; }
.btn-pdf:hover { filter: brightness(1.12); }
.cr-meta { display: flex; flex-wrap: wrap; gap: 6px 22px; padding: 9px 12px; background: var(--tbl-wrap-bg); border: 1px solid var(--line); border-radius: 8px; font-size: 12px; margin-bottom: 12px; color: var(--muted); }
.cr-meta b { color: var(--text); font-weight: 600; }
.cr-empty { padding: 20px; }
.cr-sect { margin-bottom: 16px; }
.cr-sect + .cr-sect { margin-top: 22px; border-top: 2.5px solid var(--cr-edge, var(--line2)); padding-top: 16px; }
.cr-sec { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.cr-no { display: inline-flex; align-items: center; justify-content: center; min-width: 24px; height: 24px; padding: 0 7px; border-radius: 7px; background: var(--accent); color: #fff; font-weight: 800; font-size: 13px; }
.cr-title { font-size: 15px; font-weight: 800; letter-spacing: .3px; }
.cr-count { margin-left: auto; font-size: 12px; color: var(--muted); }
.cr-group td { background: rgba(79, 140, 255, .12); color: var(--accent2); font-weight: 700; font-size: 12.5px; letter-spacing: .2px; }
.cr-tl td { background: var(--tbl-wrap-bg); border-bottom: 1px dashed var(--line2); padding: 7px 10px; }
.cr-tl-sum { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--text); font-style: italic; }
.cr-tl-sum svg { width: 13px; height: 13px; color: var(--amber); flex: none; }
.cr-tot { margin-top: 8px; padding: 9px 12px; border: 1px solid rgba(45, 212, 167, .3); background: rgba(45, 212, 167, .08); border-radius: 8px; font-weight: 700; font-size: 12.5px; }
/* ---- Wave 12: multi-technician job breakdown sub-row (one ticket, 2+ technicians) ---- */
.cr-contribs td { background: var(--cr-tint, rgba(79,140,255,.08)); border-bottom: 1px dashed var(--line2); padding: 6px 10px; }
.cr-contribs-wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 5px 10px; font-size: 11.5px; }
.cr-contribs-lbl { font-weight: 800; color: var(--cr-text, var(--accent2)); letter-spacing: .2px; white-space: nowrap; }
.cr-contrib { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 999px; background: var(--panel); border: 1px solid var(--line2); }
.cr-contrib b { color: var(--text); font-weight: 700; }
.cr-contrib-task { color: var(--muted); }
.cr-contrib-money { color: var(--green); font-weight: 700; font-variant-numeric: tabular-nums; }

/* ---- Wave 7.3: per-report colour identity (screen + A3 print) ---- */
.cr-c-daily  { --cr: #4f8cff; --cr-edge: #4f8cff; --cr-tint: rgba(79, 140, 255, .14); --cr-text: var(--accent2); }
.cr-c-visits { --cr: #14b8a6; --cr-edge: #14b8a6; --cr-tint: rgba(20, 184, 166, .14); --cr-text: #2dd4bf; }
.cr-c-ready  { --cr: #a78bfa; --cr-edge: #a78bfa; --cr-tint: rgba(167, 139, 250, .16); --cr-text: #b9a5ff; }
html[data-theme="light"] .cr-c-daily  { --cr: #1e3a8a; --cr-edge: #2f5fd4; --cr-tint: #e3ebfd; --cr-text: #1e3a8a; }
html[data-theme="light"] .cr-c-visits { --cr: #0d5f55; --cr-edge: #0e9488; --cr-tint: #dff3ef; --cr-text: #0d5f55; }
html[data-theme="light"] .cr-c-ready  { --cr: #4c1d95; --cr-edge: #6d4bd8; --cr-tint: #efe9fc; --cr-text: #4c1d95; }

.cr-sec-band { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; padding: 9px 12px; border-radius: 8px; border-left: 5px solid var(--cr-edge); background: linear-gradient(90deg, var(--cr-tint), transparent 85%); }
.cr-sec-band .cr-no { background: var(--cr); }
.cr-sec-band .cr-title { color: var(--cr-text); }
.cr-c-sect .cr-group td { background: var(--cr-tint); color: var(--cr-text); }
.cr-c-sect .tbl thead th { background: var(--cr-tint); color: var(--cr-text); border-bottom: 2px solid var(--cr-edge); }
.cr-c-sect .cr-tot { border-color: var(--cr-edge); background: var(--cr-tint); color: var(--cr-text); }

/* ---- Wave 7.5: summary reports card (top of performance report) ---- */
.cr-sum { margin: 0 0 14px; border: 1px solid var(--line2); border-radius: 10px; overflow: hidden; background: var(--tbl-wrap-bg); }
.cr-sum-title { padding: 8px 14px; font-size: 11px; font-weight: 800; letter-spacing: 1.2px; text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--line2); }
.cr-sum-row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 18px; padding: 9px 14px; border-left: 4px solid var(--cr-edge, var(--line2)); background: linear-gradient(90deg, var(--cr-tint, transparent), transparent 72%); }
.cr-sum-row + .cr-sum-row { border-top: 1px solid var(--line); }
.cr-sum-row .cr-no { background: var(--cr, var(--accent)); min-width: 20px; height: 20px; font-size: 11.5px; border-radius: 6px; }
.cr-sum-name { font-size: 13px; font-weight: 800; color: var(--cr-text, var(--text)); display: inline-flex; align-items: center; gap: 8px; }
.cr-sum-desc { font-weight: 500; font-size: 11.5px; color: var(--muted); }
.cr-sum-tot { margin-left: auto; font-size: 12px; font-weight: 800; color: var(--text); text-align: right; }
@media (max-width: 980px) { .cr-sum-tot { margin-left: 0; flex-basis: 100%; } }
@media print {
  .cr-tl td { background: #fff !important; }
  .cr-c-daily  { --cr-tint: #e3ebfd; --cr-text: #1e3a8a; --cr-edge: #2f5fd4; }
  .cr-c-visits { --cr-tint: #dff3ef; --cr-text: #0d5f55; --cr-edge: #0e9488; }
  .cr-c-ready  { --cr-tint: #efe9fc; --cr-text: #4c1d95; --cr-edge: #6d4bd8; }
  .cr-meta { background: #fff; }
}

/* ============================================================
   WAVE 10 — notification bell/panel, phone field
   ============================================================ */
/* ---------- notification bell ---------- */
.notif-bell {
  position: relative; width: 34px; height: 34px; flex: none; cursor: pointer;
  border: 1px solid var(--line2); border-radius: 9px; background: transparent;
  color: var(--muted); display: inline-flex; align-items: center; justify-content: center;
  transition: color .15s, border-color .15s, background .15s;
}
.notif-bell:hover { color: var(--text); border-color: var(--accent); background: rgba(79,140,255,.08); }
.notif-bell svg { width: 17px; height: 17px; }
.notif-badge {
  position: absolute; top: -6px; right: -6px; min-width: 17px; height: 17px; padding: 0 4px;
  border-radius: 9px; background: var(--red); color: #fff; font-size: 10px; font-weight: 800;
  display: inline-flex; align-items: center; justify-content: center; line-height: 1;
  box-shadow: 0 0 0 2px var(--topbar-bg);
}
.notif-bell.pulse { animation: notifPulse 1.4s ease-in-out 2; }
@keyframes notifPulse { 0%,100% { transform: rotate(0); } 20% { transform: rotate(-12deg); } 40% { transform: rotate(10deg); } 60% { transform: rotate(-6deg); } 80% { transform: rotate(4deg); } }

/* ============================================================
   WAVE 111 — realtime: live status dot, skeletons, busy spinner
   ============================================================ */
.live-dot {
  width: 9px; height: 9px; flex: none; border-radius: 50%; position: relative;
  background: var(--muted2); margin: 0 8px 0 2px;
  transition: background .2s, box-shadow .2s;
}
.live-dot.live { background: var(--green); box-shadow: 0 0 0 3px rgba(45,212,167,.16); }
.live-dot.live::after {
  content: ''; position: absolute; inset: -3px; border-radius: 50%;
  border: 1px solid var(--green); opacity: .5; animation: livePing 2.4s ease-out infinite;
}
.live-dot.pulse { background: var(--accent); box-shadow: 0 0 0 4px rgba(79,140,255,.22); animation: livePulse .9s ease-in-out; }
.live-dot.down { background: var(--amber); box-shadow: 0 0 0 3px rgba(251,191,36,.18); animation: liveBlink 1s steps(2,start) infinite; }
.live-dot.off { background: var(--muted2); }
@keyframes livePing { 0% { transform: scale(.6); opacity: .55; } 100% { transform: scale(1.8); opacity: 0; } }
@keyframes livePulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.5); } }
@keyframes liveBlink { 50% { opacity: .35; } }

/* skeleton shimmer (first paint of a table) */
.sk-row td { padding-top: 9px; padding-bottom: 9px; }
.sk {
  display: inline-block; height: 11px; width: 70%; border-radius: 6px;
  background: linear-gradient(90deg, var(--line) 25%, var(--line2) 37%, var(--line) 63%);
  background-size: 400% 100%; animation: skShimmer 1.3s ease-in-out infinite;
}
.sk-row td:nth-child(1) .sk { width: 55%; }
.sk-row td:nth-child(3) .sk { width: 45%; }
@keyframes skShimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }

/* inline button spinner (withBusy) */
.btn.busy { opacity: .85; cursor: progress; }
.spin {
  display: inline-block; width: 12px; height: 12px; margin-right: 7px; vertical-align: -1px;
  border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%;
  animation: spin .6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- notification panel ---------- */
.notif-scrim { position: fixed; inset: 0; background: transparent; z-index: 88; display: none; }
.notif-scrim.on { display: block; }
.notif-panel {
  position: fixed; top: 56px; right: 14px; width: 380px; max-width: calc(100vw - 24px);
  max-height: min(70vh, 560px); z-index: 90; display: none; flex-direction: column;
  background: var(--modal-bg); border: 1px solid var(--line2); border-radius: 14px;
  box-shadow: var(--shadow); overflow: hidden;
}
.notif-panel.on { display: flex; }
.notif-head { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.notif-head h3 { font-size: 14px; }
.notif-head .spacer { flex: 1; }
.notif-list { overflow-y: auto; padding: 6px; }
.notif-item {
  display: flex; gap: 10px; padding: 10px 11px; border-radius: 10px; cursor: pointer;
  border: 1px solid transparent; transition: background .15s, border-color .15s;
}
.notif-item:hover { background: rgba(79,140,255,.07); border-color: var(--line); }
.notif-item.unread { background: rgba(79,140,255,.09); border-color: rgba(79,140,255,.22); }
.notif-ico {
  width: 30px; height: 30px; flex: none; border-radius: 9px; display: flex; align-items: center; justify-content: center;
  background: rgba(79,140,255,.14); color: var(--accent); font-size: 15px;
}
.notif-item.unread .notif-ico { background: rgba(79,140,255,.22); }
/* wave 28: per-type accent colours for the notification icon */
.notif-ico.nt-new { background: rgba(79,140,255,.16); }
.notif-ico.nt-price { background: rgba(251,191,36,.16); }
.notif-ico.nt-done { background: rgba(45,212,167,.16); }
.notif-ico.nt-ship { background: rgba(56,189,248,.16); }
.notif-ico.nt-work { background: rgba(180,140,255,.16); }
.notif-ico.nt-warn { background: rgba(248,113,113,.16); }
.notif-ico.nt-sys { background: rgba(148,163,184,.16); }
.notif-main { flex: 1; min-width: 0; }
.notif-title { font-size: 12.5px; font-weight: 700; }
.notif-msg { font-size: 12px; color: var(--muted); margin-top: 2px; white-space: normal; }
.notif-when { font-size: 10.5px; color: var(--muted2); margin-top: 4px; }
.notif-approved { font-size: 10.5px; font-weight: 700; color: #22c55e; margin-top: 3px; }
.vp-summary { }
.vp-sum-head { display: flex; align-items: center; gap: 7px; font-weight: 700; color: #22c55e; margin-bottom: 10px; font-size: 14px; }
.vp-sum-head svg { width: 17px; height: 17px; flex: none; }
.vp-hint { display: flex; align-items: flex-start; gap: 6px; margin-top: 8px; font-size: 11.5px; line-height: 1.45; color: var(--muted); }
.vp-hint svg { width: 14px; height: 14px; flex: none; margin-top: 1px; color: var(--accent2); }
/* Wave 33 (item 7): shipments */
.ship-readying { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin-bottom: 14px; background: var(--panel2, rgba(127,127,127,.05)); }
.ship-readying-head { display: flex; align-items: center; gap: 6px; font-weight: 700; margin-bottom: 4px; }
.ship-readying-head svg { width: 15px; height: 15px; flex: none; color: var(--accent2); }
.ship-actions { display: flex; gap: 8px; align-items: center; margin-top: 10px; flex-wrap: wrap; }
.ship-date, .ship-note { background: var(--input, transparent); border: 1px solid var(--line); border-radius: 8px; padding: 7px 9px; color: var(--fg); font-size: 12.5px; }
.ship-note { flex: 1; min-width: 160px; }
.ship-list { display: flex; flex-direction: column; gap: 10px; }
.ship-card { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.ship-card-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 9px 12px; background: var(--panel2, rgba(127,127,127,.06)); flex-wrap: wrap; }
.ship-card-body { padding: 8px 12px; }
.ship-line { font-size: 12.5px; padding: 3px 0; border-bottom: 1px dashed var(--line); }
.ship-line:last-child { border-bottom: none; }
.ship-card-foot { display: flex; gap: 8px; padding: 8px 12px; border-top: 1px solid var(--line); flex-wrap: wrap; }
/* Wave 33 (item 10): Telegram Message Manager */
.tpl-wrap { display: grid; grid-template-columns: 280px 1fr; gap: 14px; }
.tpl-list { border: 1px solid var(--line); border-radius: 10px; max-height: 460px; overflow-y: auto; padding: 6px; }
.tpl-cat { font-size: 10.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted2); padding: 8px 8px 4px; }
.tpl-item { display: flex; align-items: center; gap: 6px; padding: 7px 9px; border-radius: 8px; cursor: pointer; font-size: 12.5px; }
.tpl-item:hover { background: var(--panel2, rgba(127,127,127,.08)); }
.tpl-item.on { background: var(--accent, #2563eb); color: #fff; }
.tpl-item-lab { flex: 1; }
.tpl-edited { color: #f59e0b; font-size: 10px; }
.tpl-item.on .tpl-edited { color: #fff; }
.tpl-edit { border: 1px solid var(--line); border-radius: 10px; padding: 12px; }
.tpl-edit-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.tpl-body { width: 100%; background: var(--input, transparent); border: 1px solid var(--line); border-radius: 8px; padding: 10px; color: var(--fg); font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12.5px; line-height: 1.5; resize: vertical; }
.tpl-preview { margin-top: 10px; border: 1px dashed var(--line); border-radius: 8px; padding: 8px 10px; }
.tpl-preview-head { font-size: 10.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted2); margin-bottom: 4px; }
.tpl-preview-body { font-size: 12.5px; white-space: normal; }
@media (max-width: 760px) { .tpl-wrap { grid-template-columns: 1fr; } }
.notif-right { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.notif-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.notif-go {
  font-size: 10px; font-weight: 700; color: var(--accent); white-space: nowrap;
  opacity: 0; transition: opacity .15s;
}
.notif-item:hover .notif-go { opacity: 1; }
.notif-empty { padding: 30px 16px; text-align: center; color: var(--muted); font-size: 12.5px; }

@media (max-width: 560px) {
  .notif-panel { right: 8px; left: 8px; width: auto; }
}
html[data-theme="light"] .notif-bell:hover { background: rgba(63,116,230,.08); }
html[data-theme="light"] .notif-item:hover { background: rgba(63,116,230,.06); }
html[data-theme="light"] .notif-item.unread { background: rgba(63,116,230,.09); border-color: rgba(63,116,230,.25); }
html[data-theme="light"] .notif-ico { background: rgba(63,116,230,.12); color: #2f5fd4; }

/* ============================================================
   WAVE 12 — professional compact design system
   Density is driven by html[data-density="compact|comfortable"].
   Compact (default) tightens spacing, denser tables, less white space.
   ============================================================ */

/* density toggle button (top bar) — mirrors the theme toggle */
.density-toggle {
  flex: none; display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 9px; cursor: pointer;
  background: var(--seg-bg); border: 1px solid var(--line2); color: var(--muted);
  transition: color .15s, border-color .15s, background .15s;
}
.density-toggle:hover { color: var(--text); border-color: var(--accent); }
.density-toggle svg { width: 17px; height: 17px; }

/* ---- compact density (default) ---- */
html[data-density="compact"] .card { padding: 11px 13px; }
html[data-density="compact"] .card h3 { margin-bottom: 7px; }
html[data-density="compact"] .page-head { margin-bottom: 10px; gap: 9px; }
html[data-density="compact"] .page-head h2 { font-size: 17px; }
html[data-density="compact"] .sub { font-size: 11.5px; line-height: 1.45; }
html[data-density="compact"] .kpi-grid { gap: 8px; margin-bottom: 10px; }
html[data-density="compact"] .two-col,
html[data-density="compact"] .three-col { gap: 9px; margin-bottom: 9px; }
html[data-density="compact"] .filters { gap: 6px; row-gap: 6px; margin-bottom: 9px; }
html[data-density="compact"] .filters .f-group { min-width: 118px; }
html[data-density="compact"] .filters select,
html[data-density="compact"] .filters input { padding: 5px 8px; font-size: 12px; }
html[data-density="compact"] .filters .f-count { min-height: 30px; }
html[data-density="compact"] table.tbl { font-size: 12px; }
html[data-density="compact"] .tbl thead th { padding: 6px 9px; font-size: 10px; }
html[data-density="compact"] .tbl tbody td { padding: 5px 9px; }
html[data-density="compact"] .stat-line { padding: 4px 2px; font-size: 12px; }
html[data-density="compact"] .form-grid { gap: 9px; }
html[data-density="compact"] .modal { padding: 0; }
html[data-density="compact"] .form-foot { padding: 10px 16px; }
html[data-density="compact"] .contrib-tbl tbody td { padding: 4px 6px; }
html[data-density="compact"] .contrib-totals { margin-top: 6px; padding: 6px 9px; }
html[data-density="compact"] .mt { margin-top: 9px; }

/* comfortable density — a touch more breathing room */
html[data-density="comfortable"] .card { padding: 16px 18px; }
html[data-density="comfortable"] .tbl tbody td { padding: 9px 12px; }
html[data-density="comfortable"] .tbl thead th { padding: 10px 12px; }
html[data-density="comfortable"] .filters { gap: 10px; row-gap: 10px; }
html[data-density="comfortable"] .kpi-grid { gap: 12px; }

/* ---- reusable pagination ---- */
.pager {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 8px 12px; margin-top: 8px;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--tbl-wrap-bg);
}
.pager .pg-info { font-size: 12px; color: var(--muted); }
.pager .pg-info b { color: var(--text); font-variant-numeric: tabular-nums; }
.pager .spacer { flex: 1; }
.pg-ctl { display: inline-flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.pg-btn, .pg-num {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 30px; height: 30px; padding: 0 9px; border-radius: 8px; cursor: pointer;
  background: var(--seg-bg); border: 1px solid var(--line2); color: var(--muted);
  font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums;
  transition: color .12s, border-color .12s, background .12s;
}
.pg-btn:hover:not(:disabled), .pg-num:hover:not(.on) { color: var(--text); border-color: var(--accent); }
.pg-btn:disabled { opacity: .4; cursor: not-allowed; }
.pg-num.on { background: var(--bg-grad-btn); border-color: transparent; color: #fff; }
.pg-nums { display: inline-flex; align-items: center; gap: 4px; }
.pg-gap { color: var(--muted2); padding: 0 2px; }
html[data-density="compact"] .pager { padding: 6px 10px; margin-top: 6px; }
html[data-density="compact"] .pg-btn, html[data-density="compact"] .pg-num { height: 27px; min-width: 27px; font-size: 11.5px; }
html[data-theme="light"] .pg-num.on { color: #fff; }

/* ---- Settings page: preference rows ---- */
.pref-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 10px; }
.pref-row {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--tbl-wrap-bg);
}
.pref-row .pr-main { flex: 1; min-width: 180px; }
.pref-row .pr-title { font-size: 12.5px; font-weight: 700; }
.pref-row .pr-desc { font-size: 11px; color: var(--muted); margin-top: 2px; }
.pref-row select { min-width: 130px; }


/* ================= Wave 13: wider, information-dense modal forms ================= */
/* The modal is a flex column so the title bar and the action bar stay pinned while
   the body scrolls — long forms (Add Daily Log, Site Visit) never lose their buttons. */
.modal { padding: 0; display: flex; flex-direction: column; max-height: calc(100vh - 60px); }
.modal-head {
  position: sticky; top: 0; z-index: 3; margin-bottom: 0;
  padding: 15px 20px 12px; border-bottom: 1px solid var(--line);
  background: var(--modal-bg); border-radius: 14px 14px 0 0;
}
.modal-body { padding: 16px 20px 4px; overflow-y: auto; }
.modal .form-foot {
  position: sticky; bottom: 0; z-index: 3; margin-top: 0;
  padding: 12px 20px 15px; border-top: 1px solid var(--line);
  background: var(--modal-bg); border-radius: 0 0 14px 14px;
}
/* width variants — small dialogs stay 620px, forms open wide so every field is visible at once */
.modal.modal-md { max-width: 880px; }
.modal.modal-lg { max-width: 1120px; }
.modal.modal-xl { max-width: 1320px; }
/* multi-column form grids */
.form-grid.g3 { grid-template-columns: repeat(3, 1fr); }
.form-grid.g4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 1100px) { .form-grid.g4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 980px) { .form-grid.g3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .form-grid.g3, .form-grid.g4 { grid-template-columns: 1fr; } }
/* compact density: pinned head/foot stay tight but never zero */
html[data-density="compact"] .modal-head { padding: 12px 16px 10px; }
html[data-density="compact"] .modal-body { padding: 13px 16px 2px; }
html[data-density="compact"] .modal .form-foot { padding: 10px 16px 12px; }
html[data-density="compact"] .form-grid.g3, html[data-density="compact"] .form-grid.g4 { gap: 9px; }
/* keep the contributions sub-table comfortable inside the wide form */
.modal .contrib-tbl { min-width: 640px; }

/* ================= Wave 14: compact list views — full row + action buttons visible, no horizontal scroll ================= */
/* Tighter compact density so every column (incl. the action buttons) fits on screen */
html[data-density="compact"] table.tbl { font-size: 11px; }
html[data-density="compact"] .tbl thead th { padding: 5px 5px; font-size: 9px; letter-spacing: .2px; }
html[data-density="compact"] .tbl tbody td { padding: 4px 5px; }
html[data-density="compact"] .tbl .small { font-size: 10.5px; }
html[data-density="compact"] .chip { padding: 2px 5px; font-size: 9.5px; gap: 3px; letter-spacing: .1px; }
html[data-density="compact"] .chip::before { width: 4px; height: 4px; }
html[data-density="compact"] .pill { padding: 1px 5px; font-size: 9.5px; }
html[data-density="compact"] .td-wrap { min-width: 90px; }

/* Compact action buttons — tight icon buttons so the whole row fits */
.tbl tbody td:last-child { white-space: nowrap; }
.tbl tbody td:last-child .btn { padding: 2px 5px; min-height: 22px; font-size: 11px; line-height: 1; border-radius: 6px; }
.tbl tbody td:last-child .btn svg { width: 13px; height: 13px; }
html[data-density="compact"] .tbl tbody td:last-child .btn { padding: 2px 5px; min-height: 22px; font-size: 10px; border-radius: 5px; }
html[data-density="compact"] .tbl tbody td:last-child .btn svg { width: 12px; height: 12px; }
/* wave 46: timeline icon button in the Internal Transfers list */
.tbl tbody td:last-child .tl-btn:hover { color: var(--accent); border-color: var(--accent); }

/* Let the widest text columns wrap instead of forcing the table wider */
.tbl td.wrap-col, .tbl th.wrap-col { white-space: normal; }
.tbl td.wrap-col { min-width: 0; max-width: 140px; }
.tbl td.wrap-col .chip { white-space: normal; }
html[data-density="compact"] .tbl td.wrap-col { max-width: 112px; }

/* wave 57 — truncate long free-text cells with a native tooltip */
.tbl .clip { display: inline-block; max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: middle; }
.tbl .clip-sm { display: inline-block; max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: middle; }
.tbl .clip-lg { display: inline-block; max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: middle; }
html[data-density="compact"] .tbl .clip { max-width: 150px; }
html[data-density="compact"] .tbl .clip-sm { max-width: 110px; }
html[data-density="compact"] .tbl .clip-lg { max-width: 200px; }

/* Sticky action column — buttons stay visible even if a table is wider than the viewport */
.tbl thead th:last-child, .tbl tbody td:last-child:not([colspan]) { position: sticky; right: 0; z-index: 6; }
.tbl thead th:last-child { background: var(--thead-bg); z-index: 7; }
.tbl tbody td:last-child:not([colspan]) { background: var(--panel); }
.tbl tbody tr:hover td:last-child:not([colspan]) { background: var(--panel2); }
html[data-theme="light"] .tbl tbody td:last-child:not([colspan]) { background: #ffffff; }
html[data-theme="light"] .tbl tbody tr:hover td:last-child:not([colspan]) { background: #f4f7fc; }
/* tuned wrap widths so the widest columns shrink instead of forcing a scrollbar */
.tbl td.td-wrap { min-width: 120px; }
html[data-density="compact"] .tbl td.td-wrap { min-width: 90px; }
.tbl td.wrap-col { min-width: 0; max-width: 124px; }
html[data-density="compact"] .tbl td.wrap-col { max-width: 100px; }
/* ServiceID is a long fixed-format code — render it a touch smaller so it never pushes the row wide */
.tbl td.sid-col { font-size: 10.5px; letter-spacing: -.1px; }
.tbl td.sid-col b { font-weight: 700; }


/* ================= Wave 15: status chips stay on ONE line (no wrapping) ================= */
/* The Status / Task Status columns use .wrap-col so long text wraps, but a status chip
   must never break across lines — keep it nowrap and give its column enough room. */
.tbl td.wrap-col .chip:not(.chip-co) { white-space: nowrap; }
.tbl td.st-col, .tbl th.st-col { min-width: 150px; max-width: 160px; }
/* Timeline / Location icon columns are narrow — cap them so they never push the row wide */
.tbl thead th.th-ico, .tbl tbody td.th-ico { max-width: 92px; }
/* action buttons: a touch tighter so the last column never forces a scrollbar */
.tbl tbody td:last-child .btn { padding: 2px 4px; }
/* reclaim width from the widest text columns on the two busiest list views */
.tbl-daily thead th:nth-child(4), .tbl-daily tbody td:nth-child(4) { max-width: 120px; }
.tbl-daily thead th:nth-child(6), .tbl-daily tbody td:nth-child(6) { max-width: 116px; }
.tbl-daily thead th:nth-child(11), .tbl-daily tbody td:nth-child(11) { max-width: 92px; }
.tbl-visits thead th:nth-child(3), .tbl-visits tbody td:nth-child(3) { max-width: 120px; }
.tbl-visits thead th:nth-child(5), .tbl-visits tbody td:nth-child(5) { max-width: 92px; }
.tbl-visits thead th:nth-child(6), .tbl-visits tbody td:nth-child(6) { max-width: 80px; }
.tbl-visits thead th:nth-child(9), .tbl-visits tbody td:nth-child(9) { max-width: 104px; }

/* ============================================================
   WAVE 17 — Collection follow-up / Call Log
   ============================================================ */
.chip-received { background: rgba(34,197,94,.14); color: #6ee7a0; }
.chip-disposed { background: rgba(148,163,200,.14); color: #b6c2da; }
.chip-fu { background: rgba(79,140,255,.16); color: #9dc0ff; border: 1px solid rgba(79,140,255,.35); }
.chip-fu::before { display: none; }
html[data-theme="light"] .chip-received { background: rgba(14,158,119,.12); color: #0b8266; }
html[data-theme="light"] .chip-disposed { background: rgba(91,107,133,.12); color: #5b6b85; }
html[data-theme="light"] .chip-fu { background: rgba(63,116,230,.12); color: #2f5fd4; }

/* ageing band chips */
.band-chip { display: inline-flex; align-items: center; gap: 4px; font-size: 10.5px; font-weight: 700; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.band-green { background: rgba(34,197,94,.15); color: #6ee7a0; }
.band-amber { background: rgba(251,191,36,.15); color: #ffd675; }
.band-red { background: rgba(248,113,113,.16); color: #ffa1a1; }
.band-gray { background: rgba(148,163,200,.14); color: #b6c2da; }
html[data-theme="light"] .band-green { background: rgba(14,158,119,.12); color: #0b8266; }
html[data-theme="light"] .band-amber { background: rgba(181,126,15,.12); color: #8a6208; }
html[data-theme="light"] .band-red { background: rgba(214,69,69,.12); color: #c23c3c; }
html[data-theme="light"] .band-gray { background: rgba(91,107,133,.12); color: #5b6b85; }

/* call-log table */
.tbl-calllog { min-width: 760px; }
.tbl-calllog thead th:nth-child(1), .tbl-calllog tbody td:nth-child(1) { min-width: 118px; }
.tbl-calllog thead th:nth-child(2), .tbl-calllog tbody td:nth-child(2) { min-width: 56px; }

/* Wave 18: group header row per ServiceID */
.tbl-calllog tbody tr.cl-group > td { padding: 0; border-top: 2px solid var(--line2); background: rgba(79,140,255,.07); }
.tbl-calllog tbody tr.cl-group:first-child > td { border-top: none; }
.clg { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 9px 12px; }
.clg-sid { font-weight: 800; font-size: 13.5px; letter-spacing: .3px; color: var(--text); }
.clg-cust { font-size: 12.5px; color: var(--text); }
.clg-facts { display: inline-flex; align-items: center; gap: 8px; margin-left: auto; flex-wrap: wrap; font-size: 11.5px; }
.clg-count { font-weight: 700; color: var(--muted); }
.clg-done { color: var(--muted); }
.clg-done b { color: var(--text); }
.tbl-calllog tbody tr.cl-fu > td:first-child { padding-left: 22px; }
.tbl-calllog tbody tr.cl-fu > td:first-child::before { content: "\\21B3"; color: var(--muted); margin-right: 6px; }

/* Wave 19: Daily Logs Timeline modal — COLLECTION FOLLOW-UPS summary + separator */
.fu-sum { background: var(--card-bg, rgba(148,163,200,.06)); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; margin: 4px 0 14px; }
.fu-sum-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px; }
.fu-sum-k { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); }
.fu-sum-v { font-size: 13px; font-weight: 600; color: var(--text); margin-right: 8px; }
.fu-sum-last { margin-top: 9px; padding-top: 9px; border-top: 1px dashed var(--line); font-size: 11.5px; color: var(--muted); }
.fu-sum-last b { color: var(--text); }
.fu-sep { display: flex; align-items: center; gap: 12px; margin: 18px 0 12px; color: var(--muted); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; }
.fu-sep::before, .fu-sep::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.fu-sep span { white-space: nowrap; }

/* Wave 20: Timeline modal — two side-by-side panels with a vertical separator */
.fu-split { display: grid; grid-template-columns: 1fr 1px 1fr; gap: 0 18px; align-items: start; margin: 4px 0 16px; }
.fu-col { min-width: 0; }
.fu-col > label.f { display: block; margin-bottom: 8px; }
.fu-vsep { align-self: stretch; width: 1px; background: var(--line); }
@media (max-width: 720px) {
  .fu-split { grid-template-columns: 1fr; gap: 14px 0; }
  .fu-vsep { width: auto; height: 1px; }
}

/* summary strip */
.cl-summary { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.cl-stat { flex: 1; min-width: 140px; background: var(--card-bg, rgba(148,163,200,.06)); border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; }
.cl-stat .cs-val { font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; }
.cl-stat .cs-lab { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }
.cl-stat.red .cs-val { color: #ffa1a1; }
.cl-stat.amber .cs-val { color: #ffd675; }
html[data-theme="light"] .cl-stat.red .cs-val { color: #c23c3c; }
html[data-theme="light"] .cl-stat.amber .cs-val { color: #8a6208; }

/* follow-up logger modal */
.fu-head { padding: 8px 10px; border: 1px solid var(--line2); border-radius: 8px; background: rgba(79,140,255,.05); margin-bottom: 12px; }
.fu-sec { margin-bottom: 12px; }
.fu-sec .f { display: block; margin-bottom: 6px; }
.fu-btns { display: flex; flex-wrap: wrap; gap: 6px; }
.fu-btn { display: inline-flex; align-items: center; gap: 5px; padding: 7px 12px; font-size: 12.5px; font-weight: 600; border: 1px solid var(--line2); border-radius: 8px; background: var(--seg-bg, rgba(148,163,200,.06)); color: var(--text); cursor: pointer; transition: all .12s; }
.fu-btn:hover { border-color: var(--accent); }
.fu-btn.on { background: linear-gradient(135deg, #4f8cff, #3b6fe0); color: #fff; border-color: transparent; }
.fu-sec textarea, .fu-sec select { width: 100%; }


/* ===== Wave 17 — Collection follow-up settings (Call Log) ===== */
.cf-edit { display: flex; flex-direction: column; gap: 8px; }
.cf-chips { display: flex; flex-wrap: wrap; gap: 6px; min-height: 26px; }
.cf-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 6px 4px 10px; font-size: 12.5px; font-weight: 600; border: 1px solid var(--line2); border-radius: 999px; background: var(--seg-bg, rgba(148,163,200,.08)); color: var(--text); }
.cf-chip .cf-x { border: none; background: transparent; color: var(--muted); cursor: pointer; font-size: 15px; line-height: 1; padding: 0 2px; border-radius: 50%; }
.cf-chip .cf-x:hover { color: #fff; background: #e5484d; }
.cf-add { display: flex; gap: 6px; align-items: center; }
.cf-add input { flex: 1; min-width: 120px; }
.cf-band { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; flex-wrap: wrap; }
.cf-band input, .cf-band select { padding: 5px 7px; font-size: 12.5px; border: 1px solid var(--line2); border-radius: 7px; background: var(--input-bg, transparent); color: var(--text); }
.cf-band .cf-b-color { width: 84px; }
.cf-band .cf-b-del { padding: 4px 8px; }

/* ============ Wave 25: Parts Orders / Vendor workflow ============ */
/* form field wrapper used by the order forms */
.fg { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.form-grid.g2 { grid-template-columns: 1fr 1fr; }
@media (max-width: 640px) { .form-grid.g2 { grid-template-columns: 1fr; } }
.lnk { color: var(--accent, #6ea8ff); text-decoration: none; font-weight: 600; }
.lnk:hover { text-decoration: underline; }
/* wave 29: never let an inline icon inside a link blow up (was rendering 122px) */
.lnk svg { width: 13px; height: 13px; vertical-align: -2px; }

/* orders master / vendor table */
.tbl-orders td, .tbl-orders th { vertical-align: middle; }
.tbl-orders td.wrap-col { max-width: 260px; white-space: normal; }
.tbl-orders .st-col { min-width: 150px; }

/* order detail grid (two columns of key/value rows) */
.od-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 22px; }
@media (max-width: 720px) { .od-grid { grid-template-columns: 1fr; } }
.od-col { min-width: 0; }
.od-row { display: flex; gap: 10px; padding: 6px 0; border-bottom: 1px dashed var(--line); align-items: baseline; }
.od-row:last-child { border-bottom: none; }
.od-k { flex: 0 0 44%; color: var(--muted); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .02em; }
.od-v { flex: 1; min-width: 0; font-size: 13px; word-break: break-word; }

/* wave 28: professional order-detail header + grouped sections */
.od-head {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 12px 14px; margin: -2px 0 14px; border-radius: 12px;
  background: linear-gradient(180deg, rgba(79,140,255,.10), rgba(79,140,255,.03));
  border: 1px solid var(--line2);
}
.od-head-l { flex: 1; min-width: 0; }
.od-sid { font-size: 17px; font-weight: 800; letter-spacing: .2px; }
.od-head-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.od-head-r { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.od-sec { border: 1px solid var(--line); border-radius: 11px; margin-bottom: 12px; overflow: hidden; background: var(--card-bg); }
.od-sec-h {
  font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .7px;
  color: var(--muted); padding: 8px 13px; margin: 0; background: rgba(79,140,255,.05);
  border-bottom: 1px solid var(--line);
}
.od-sec-b { padding: 8px 13px; }
.od-sec-b .od-grid { gap: 0 22px; }

/* wave 28: small professional PDF attachment chip */
.pdf-chip {
  display: inline-flex; align-items: center; gap: 10px; max-width: 100%;
  padding: 8px 11px; border-radius: 10px; text-decoration: none; color: var(--text);
  background: rgba(239,68,68,.07); border: 1px solid rgba(239,68,68,.28);
  transition: background .15s, border-color .15s, transform .1s;
}
.pdf-chip:hover { background: rgba(239,68,68,.13); border-color: rgba(239,68,68,.5); }
.pdf-chip:active { transform: scale(.99); }
.pdf-ico { flex: none; width: 26px; height: 26px; color: #ef4444; display: inline-flex; align-items: center; justify-content: center; }
.pdf-ico svg { width: 26px; height: 26px; }
.pdf-meta { display: flex; flex-direction: column; min-width: 0; }
.pdf-name { font-size: 12.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 260px; }
.pdf-sub { font-size: 10.5px; color: var(--muted); margin-top: 1px; }
.pdf-open { flex: none; width: 16px; height: 16px; color: var(--muted); }
.pdf-open svg { width: 16px; height: 16px; }
.pdf-chip:hover .pdf-open { color: var(--accent); }

/* wave 29: compact PDF mini-chip used inside table cells (small, professional) */
.pdf-mini {
  display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px 2px 6px;
  border-radius: 7px; text-decoration: none; font-size: 11px; font-weight: 700;
  color: #f87171; background: rgba(239,68,68,.10); border: 1px solid rgba(239,68,68,.30);
  line-height: 1.5; transition: background .15s, border-color .15s;
}
.pdf-mini:hover { background: rgba(239,68,68,.18); border-color: rgba(239,68,68,.55); text-decoration: none; }
.pdf-mini-ico { flex: none; width: 13px; height: 13px; display: inline-flex; align-items: center; justify-content: center; }
.pdf-mini-ico svg { width: 13px; height: 13px; }

/* follow-up timeline */
.fu-list { display: flex; flex-direction: column; gap: 0; margin-top: 6px; }
.fu-item { display: flex; gap: 12px; padding: 8px 0 8px 4px; position: relative; }
.fu-item:not(:last-child)::before { content: ''; position: absolute; left: 9px; top: 22px; bottom: -2px; width: 2px; background: var(--line2); }
.fu-dot { flex: 0 0 12px; width: 12px; height: 12px; border-radius: 50%; background: var(--accent, #6ea8ff); margin-top: 4px; box-shadow: 0 0 0 3px rgba(79,140,255,.15); z-index: 1; }
.fu-body { flex: 1; min-width: 0; }
.fu-head { font-size: 13px; }
.fu-note { font-size: 12.5px; color: var(--text); margin: 2px 0; }
.fu-head .muted { font-weight: 400; }

/* order config card (Settings) */
.oc-line { display: flex; flex-direction: column; gap: 4px; margin-bottom: 8px; }
.oc-line input { width: 100%; }
.oc-check { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; }
.oc-grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
@media (max-width: 720px) { .oc-grid4 { grid-template-columns: repeat(2, 1fr); } }
.oc-grid4 label.f { display: block; margin-bottom: 3px; }
.oc-grid4 input { width: 100%; }
.oc-preview { margin-top: 8px; padding: 8px 10px; border: 1px dashed var(--line2); border-radius: 8px; font-size: 12.5px; background: rgba(79,140,255,.05); }
.cf-chip-lock { opacity: .85; }

/* ================= Wave 29: compact & professional workspace ================= */
/* Tighter page header, subtitle and tabs so the workspace reads as a dense,
   professional console instead of a loose, airy page. */
.page-head { margin-bottom: 10px; gap: 10px; }
.page-head h2 { font-size: 16.5px; letter-spacing: .1px; }
.page-head .sub { font-size: 11.5px; line-height: 1.45; margin-top: -4px; max-width: 900px; }
.tabs { gap: 2px; margin-bottom: 10px; }
.tab { padding: 6px 12px; font-size: 12.5px; }
/* slightly denser table rows for the orders/vendor tables */
.tbl-orders tbody td { padding: 6px 10px; }
.tbl-orders thead th { padding: 7px 10px; }
/* keep the compact PDF chip vertically centred in its cell */
.tbl-orders td .pdf-mini { vertical-align: middle; }


/* ================= Wave 49: Collections — professional detail view ================= */
/* A clean, structured "View details" layout: a status-accented hero header with
   quick-glance meta pills, a horizontal journey stepper, grouped key/value
   sections and a refined timeline. */
.cd-hero {
  position: relative; display: flex; align-items: flex-start; gap: 14px; flex-wrap: wrap;
  padding: 16px 18px 15px 22px; margin: 0 0 14px; border-radius: 14px;
  background: linear-gradient(135deg, rgba(79,140,255,.12), rgba(79,140,255,.03) 62%);
  border: 1px solid var(--line2); overflow: hidden;
}
.cd-hero::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--accent, #4f8cff); }
.cd-hero.st-done::before { background: #2dd4a7; }
.cd-hero.st-wait::before { background: #fbbf24; }
.cd-hero.st-cancel::before { background: #f87171; }
.cd-hero-l { flex: 1; min-width: 0; }
.cd-hero-id { font-size: 20px; font-weight: 800; letter-spacing: .2px; line-height: 1.15; }
.cd-hero-sub { font-size: 13px; color: var(--muted); margin-top: 3px; }
.cd-hero-r { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cd-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 13px; width: 100%; }
.cd-pill {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 11px; border-radius: 9px;
  background: var(--card-bg); border: 1px solid var(--line); font-size: 12px; line-height: 1.2;
}
.cd-pill .cd-pill-k { color: var(--muted); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; }
.cd-pill .cd-pill-v { font-weight: 700; }
.cd-pill svg { width: 14px; height: 14px; color: var(--accent); flex: none; }

/* journey stepper */
.cd-steps { display: flex; align-items: center; gap: 0; margin: 0 0 14px; padding: 13px 15px; border: 1px solid var(--line); border-radius: 12px; background: var(--card-bg); overflow-x: auto; }
.cd-step { display: flex; align-items: center; gap: 8px; flex: none; }
.cd-step-dot { width: 20px; height: 20px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 800; border: 2px solid var(--line2); color: var(--muted); background: var(--card-bg); flex: none; }
.cd-step.done .cd-step-dot { background: #2dd4a7; border-color: #2dd4a7; color: #06231b; }
.cd-step.cur .cd-step-dot { background: var(--accent, #4f8cff); border-color: var(--accent, #4f8cff); color: #fff; box-shadow: 0 0 0 4px rgba(79,140,255,.18); }
.cd-step-lbl { font-size: 11px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.cd-step.done .cd-step-lbl, .cd-step.cur .cd-step-lbl { color: var(--text); }
.cd-step-line { width: 16px; height: 2px; background: var(--line2); flex: none; margin: 0 6px; }
.cd-step.done .cd-step-line { background: #2dd4a7; }
/* wave 58 — tiny elapsed-time label above each stage (time spent in that stage) */
.cd-step { position: relative; }
.cd-step-gap { position: absolute; top: -11px; left: 50%; transform: translateX(-50%); font-size: 8.5px; line-height: 1; font-weight: 700; letter-spacing: .2px; color: var(--muted); white-space: nowrap; pointer-events: none; }
.cd-step.done .cd-step-gap { color: #2dd4a7; }
.cd-step.cur .cd-step-gap { color: var(--accent, #4f8cff); }
html[data-theme="light"] .cd-step.done .cd-step-gap { color: #0e9e77; }
/* Wave 107 — compact stage-progress cell in the Internal Transfers list view. */
.tr-mini-stg { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.tr-mini-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--line2); flex: none; }
.tr-mini-dot.done { background: #2dd4a7; }
.tr-mini-dot.cur { background: var(--accent, #4f8cff); box-shadow: 0 0 0 3px rgba(79,140,255,.18); }
.tr-mini-lbl { font-size: 11px; font-weight: 600; color: var(--text); }
html[data-density="compact"] .tr-mini-dot { width: 8px; height: 8px; }
html[data-density="compact"] .tr-mini-lbl { font-size: 10.5px; }
/* wave 58 — reusable stage-to-stage stepper used in every module timeline */
.stg-wrap { margin: 0 0 14px; }
.stg-cap { font-size: 10px; text-transform: uppercase; letter-spacing: .7px; color: var(--muted); margin: 0 0 6px; font-weight: 700; }
.stg-steps { display: flex; align-items: center; flex-wrap: wrap; row-gap: 16px; padding: 14px 14px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--card-bg); }
.stg-step { position: relative; display: flex; align-items: center; gap: 7px; flex: none; }
.stg-gap { position: absolute; top: -11px; left: 50%; transform: translateX(-50%); font-size: 8.5px; line-height: 1; font-weight: 700; color: var(--muted); white-space: nowrap; pointer-events: none; }
.stg-step.done .stg-gap { color: #2dd4a7; }
.stg-step.cur .stg-gap { color: var(--accent, #4f8cff); }
.stg-dot { width: 18px; height: 18px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 800; border: 2px solid var(--line2); color: var(--muted); background: var(--card-bg); flex: none; }
.stg-dot svg { width: 10px; height: 10px; }
.stg-step.done .stg-dot { background: #2dd4a7; border-color: #2dd4a7; color: #06231b; }
.stg-step.cur .stg-dot { background: var(--accent, #4f8cff); border-color: var(--accent, #4f8cff); color: #fff; box-shadow: 0 0 0 4px rgba(79,140,255,.18); }
.stg-lbl { font-size: 10.5px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.stg-step.done .stg-lbl, .stg-step.cur .stg-lbl { color: var(--text); }
.stg-line { width: 14px; height: 2px; background: var(--line2); flex: none; margin: 0 5px; }
.stg-step.done .stg-line { background: #2dd4a7; }
html[data-theme="light"] .stg-step.done .stg-gap { color: #0e9e77; }
.cd-cancel-banner { display: flex; align-items: center; gap: 9px; margin: 0 0 14px; padding: 11px 14px; border-radius: 11px; background: rgba(248,113,113,.10); border: 1px solid rgba(248,113,113,.32); color: #ffa1a1; font-size: 13px; font-weight: 600; }
.cd-cancel-banner svg { width: 16px; height: 16px; flex: none; }

/* grouped sections */
.cd-sec { border: 1px solid var(--line); border-radius: 12px; margin-bottom: 12px; overflow: hidden; background: var(--card-bg); }
.cd-sec-h { display: flex; align-items: center; gap: 8px; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .7px; color: var(--muted); padding: 9px 14px; margin: 0; background: rgba(79,140,255,.05); border-bottom: 1px solid var(--line); }
.cd-sec-h svg { width: 14px; height: 14px; color: var(--accent); flex: none; }
.cd-sec-b { padding: 10px 14px; }
.cd-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 26px; }
@media (max-width: 720px) { .cd-grid { grid-template-columns: 1fr; } }
.cd-row { display: flex; gap: 12px; padding: 7px 0; border-bottom: 1px dashed var(--line); align-items: baseline; }
.cd-row:last-child { border-bottom: none; }
.cd-k { flex: 0 0 42%; color: var(--muted); font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.cd-v { flex: 1; min-width: 0; font-size: 13px; font-weight: 500; word-break: break-word; }
.cd-v.strong { font-weight: 700; }
.cd-v.empty { color: var(--muted); font-weight: 400; }
.cd-note { font-size: 13px; line-height: 1.55; white-space: pre-wrap; word-break: break-word; }
.cd-note.empty { color: var(--muted); }

/* refined timeline */
.cd-tl { display: flex; flex-direction: column; }
.cd-tl-item { display: flex; gap: 12px; padding: 9px 0 9px 2px; position: relative; }
.cd-tl-item:not(:last-child)::before { content: ''; position: absolute; left: 10px; top: 26px; bottom: -3px; width: 2px; background: var(--line2); }
.cd-tl-dot { flex: 0 0 14px; width: 14px; height: 14px; border-radius: 50%; background: var(--accent, #4f8cff); margin-top: 3px; box-shadow: 0 0 0 3px rgba(79,140,255,.15); z-index: 1; }
.cd-tl-item:first-child .cd-tl-dot { background: #2dd4a7; box-shadow: 0 0 0 3px rgba(45,212,167,.18); }
.cd-tl-body { flex: 1; min-width: 0; }
.cd-tl-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.cd-tl-type { font-size: 13px; font-weight: 700; }
.cd-tl-time { font-size: 11.5px; color: var(--muted); }
.cd-tl-note { font-size: 12.5px; color: var(--text); margin: 3px 0 1px; }
.cd-tl-by { font-size: 11px; color: var(--muted); }

/* action bar */
.cd-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.cd-actions-lbl { font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); margin-right: 2px; }
.cd-actions .cd-spacer { flex: 1; }

/* light theme tweaks */
html[data-theme="light"] .cd-hero { background: linear-gradient(135deg, rgba(63,116,230,.10), rgba(63,116,230,.02) 62%); }
html[data-theme="light"] .cd-cancel-banner { color: #c23c3c; }

.cd-step-dot svg { width: 11px; height: 11px; }
.cd-full { grid-column: 1 / -1; }


/* ================= Wave 49b: compact two-column detail ================= */
/* Row 1: Customer | Item & Condition   Row 2: Complaint & Initial Test | Delivery & Service
   Each row is a two-column grid with a thin vertical separator between the columns. */
.cd-cols { display: grid; grid-template-columns: 1fr 1px 1fr; align-items: stretch; margin-bottom: 10px; }
.cd-col { min-width: 0; }
.cd-col-sep { background: var(--line); }
.cd-col .cd-sec { margin-bottom: 0; height: 100%; }
.cd-col .cd-grid { grid-template-columns: 1fr; gap: 0; }
@media (max-width: 720px) {
  .cd-cols { grid-template-columns: 1fr; }
  .cd-col-sep { display: none; }
  .cd-col .cd-sec { margin-bottom: 10px; }
}
/* compact typography + spacing */
.cd-hero { padding: 13px 15px 12px 19px; margin-bottom: 11px; }
.cd-hero-id { font-size: 17px; }
.cd-hero-sub { font-size: 12px; }
.cd-meta { margin-top: 10px; gap: 6px; }
.cd-pill { padding: 5px 9px; font-size: 11px; }
.cd-pill .cd-pill-k { font-size: 9.5px; }
.cd-steps { padding: 10px 12px; margin-bottom: 11px; }
.cd-step-dot { width: 18px; height: 18px; font-size: 10px; }
.cd-step-lbl { font-size: 10.5px; }
.cd-step-line { width: 14px; margin: 0 5px; }
.cd-sec { margin-bottom: 10px; border-radius: 10px; }
.cd-sec-h { font-size: 10px; padding: 7px 12px; letter-spacing: .6px; }
.cd-sec-h svg { width: 13px; height: 13px; }
.cd-sec-b { padding: 7px 12px; }
.cd-row { padding: 5px 0; gap: 10px; }
.cd-k { font-size: 10.5px; flex-basis: 40%; }
.cd-v { font-size: 12px; }
.cd-note { font-size: 12px; line-height: 1.5; }
.cd-tl-item { padding: 7px 0 7px 2px; }
.cd-tl-type { font-size: 12px; }
.cd-tl-time { font-size: 10.5px; }
.cd-tl-note { font-size: 11.5px; }
.cd-tl-by { font-size: 10.5px; }


/* ================= Wave 49c: fit-to-screen detail + grouped compact form ================= */
/* stepper wraps so every stage is visible without a horizontal scrollbar */
.cd-steps { flex-wrap: wrap; overflow: visible; row-gap: 8px; }
.cd-step-line { flex: none; }

/* grouped compact form (New Collection / Edit Collection) */
.cf-group { border: 1px solid var(--line); border-radius: 10px; margin-bottom: 9px; overflow: hidden; background: var(--card-bg); }
.cf-group-h { display: flex; align-items: center; gap: 7px; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); padding: 7px 12px; margin: 0; background: rgba(79,140,255,.05); border-bottom: 1px solid var(--line); }
.cf-group-h svg { width: 13px; height: 13px; color: var(--accent); flex: none; }
.cf-group-b { padding: 9px 12px; }
.cf-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px 12px; }
@media (max-width: 760px) { .cf-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .cf-grid { grid-template-columns: 1fr; } }
.cf-grid .fg { gap: 3px; }
.cf-grid label.f { font-size: 10px; margin: 0 0 2px 1px; letter-spacing: .4px; }
.cf-grid input, .cf-grid select, .cf-grid textarea { font-size: 12.5px; padding: 6px 9px; border-radius: 7px; }
.cf-grid textarea { min-height: 44px; }
.cf-span2 { grid-column: span 2; }
.cf-span3 { grid-column: 1 / -1; }
@media (max-width: 760px) { .cf-span2 { grid-column: 1 / -1; } }
.cf-note { display: flex; align-items: center; gap: 7px; font-size: 11px; color: var(--muted); margin-top: 2px; }
.cf-note svg { width: 13px; height: 13px; color: var(--accent); flex: none; }

/* ============================================================
   PSC Assistant  (wave 63)  —  floating chat bubble + panel
   ============================================================ */
.psc-bubble {
  position: fixed; right: 20px; bottom: 20px; z-index: 70;
  width: 58px; height: 58px; border-radius: 50%; border: none; cursor: pointer;
  background: transparent; padding: 0; display: flex; align-items: center; justify-content: center;
  transition: transform .18s;
}
.psc-bubble:hover { transform: translateY(-2px) scale(1.05); }
.psc-bubble:active { transform: scale(.96); }
.psc-bubble-ring {
  position: absolute; inset: -3px; border-radius: 50%; z-index: 0;
  background: conic-gradient(from 0deg, var(--accent), #22d3a7, var(--accent2, #7c5cff), var(--accent));
  animation: pscSpin 3.4s linear infinite;
}
.psc-bubble::after {
  content: ''; position: absolute; inset: 2px; border-radius: 50%; z-index: 0;
  box-shadow: 0 0 0 0 rgba(31, 84, 200, .5);
  animation: pscPulse 2.6s ease-out infinite;
}
.psc-bubble-img {
  position: relative; z-index: 1; width: 52px; height: 52px; border-radius: 50%;
  object-fit: cover; background: #00c853; border: 2px solid var(--bg);
  box-shadow: 0 8px 22px rgba(0, 0, 0, .28);
  animation: pscBob 3s ease-in-out infinite;
}
@keyframes pscSpin { to { transform: rotate(360deg); } }
@keyframes pscPulse {
  0% { box-shadow: 0 0 0 0 rgba(31, 84, 200, .5); }
  70% { box-shadow: 0 0 0 15px rgba(31, 84, 200, 0); }
  100% { box-shadow: 0 0 0 0 rgba(31, 84, 200, 0); }
}
@keyframes pscBob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-2px); } }
.psc-bubble-badge {
  position: absolute; top: -4px; right: -4px; min-width: 20px; height: 20px; padding: 0 5px;
  border-radius: 999px; background: var(--accent); color: #fff; font-size: 11px; font-weight: 800;
  display: inline-flex; align-items: center; justify-content: center; border: 2px solid var(--bg);
  z-index: 3;
}
.psc-bubble-badge.alert { background: var(--red); }

.psc-scrim { position: fixed; inset: 0; background: transparent; z-index: 94; display: none; }
.psc-scrim.on { display: block; }

.psc-panel {
  position: fixed; right: 20px; bottom: 20px; z-index: 95;
  width: min(390px, calc(100vw - 32px)); height: min(580px, calc(100vh - 90px));
  background: var(--modal-bg); border: 1px solid var(--line2); border-radius: 16px;
  box-shadow: var(--shadow); display: none; flex-direction: column; overflow: hidden;
}
.psc-panel.on { display: flex; animation: pscIn .2s ease; }
@keyframes pscIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

.psc-head { display: flex; align-items: center; gap: 10px; padding: 12px 13px; border-bottom: 1px solid var(--line2); background: var(--panel2); }
.psc-head-ava {
  width: 38px; height: 38px; border-radius: 11px; flex: none; object-fit: cover;
  background: #00c853; box-shadow: 0 2px 8px rgba(0, 0, 0, .18);
}
.psc-head-txt { min-width: 0; }
.psc-head-title { font-size: 14px; font-weight: 800; }
.psc-head-sub { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.psc-head .spacer { flex: 1; }

.psc-body { flex: 1; overflow-y: auto; padding: 13px; display: flex; flex-direction: column; gap: 11px; }
.psc-empty { text-align: center; color: var(--muted2); font-size: 13px; padding: 24px 0; }

.psc-msg { display: flex; gap: 8px; max-width: 100%; }
.psc-msg-user { justify-content: flex-end; }
.psc-ava {
  width: 26px; height: 26px; border-radius: 8px; flex: none; object-fit: cover;
  background: #00c853;
}
.psc-bubble-txt { font-size: 13px; line-height: 1.5; padding: 9px 12px; border-radius: 12px; word-break: break-word; }
.psc-msg-psc .psc-bubble-txt { background: var(--panel2); border: 1px solid var(--line); border-top-left-radius: 4px; }
.psc-msg-user .psc-bubble-txt { background: var(--accent); color: #fff; border-top-right-radius: 4px; }
.psc-msg-user { max-width: 86%; }
.psc-msg-psc { max-width: 100%; }

.psc-tasks { display: flex; flex-direction: column; gap: 7px; margin-top: 9px; }
.psc-task {
  border: 1px solid var(--line2); border-left: 3px solid var(--muted2); border-radius: 9px; padding: 8px 10px;
  cursor: pointer; background: var(--card-bg); transition: background .15s, transform .15s;
}
.psc-task:hover { background: var(--panel2); transform: translateX(2px); }
.psc-task-delayed { border-left-color: var(--red); }
.psc-task-due { border-left-color: var(--amber); }
.psc-task-ok { border-left-color: var(--green); }
.psc-task-top { display: flex; align-items: center; gap: 6px; font-size: 10px; text-transform: uppercase; letter-spacing: .5px; font-weight: 700; color: var(--muted); }
.psc-task-ref { color: var(--muted2); font-weight: 600; }
.psc-task-mid { font-size: 12.5px; font-weight: 600; margin: 3px 0 2px; }
.psc-task-bot { font-size: 10.5px; color: var(--muted2); }
.psc-lv { margin-left: auto; padding: 1px 7px; border-radius: 999px; font-size: 9.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .4px; }
.psc-lv-delayed { background: rgba(248, 113, 113, .16); color: var(--red); }
.psc-lv-due { background: rgba(251, 191, 36, .16); color: var(--amber); }
.psc-lv-ok { background: rgba(45, 212, 167, .16); color: var(--green); }

.psc-chips { display: flex; gap: 6px; flex-wrap: wrap; padding: 8px 12px 0; }
.psc-chip {
  border: 1px solid var(--line2); background: var(--panel2); color: var(--muted); cursor: pointer;
  border-radius: 999px; padding: 4px 11px; font-size: 11px; font-weight: 600; transition: all .15s;
}
.psc-chip:hover { background: var(--accent); color: #fff; border-color: var(--accent); }

.psc-form { display: flex; gap: 8px; padding: 11px 12px; border-top: 1px solid var(--line2); }
.psc-input {
  flex: 1; background: var(--input-bg); border: 1px solid var(--line2); color: var(--text);
  border-radius: 10px; padding: 9px 12px; font-size: 13px; font-family: var(--font);
}
.psc-input:focus { outline: none; border-color: var(--accent); }

/* full-page bits */
.psc-advice { display: flex; gap: 12px; align-items: flex-start; }
.psc-advice-ico { font-size: 24px; line-height: 1; }
.psc-advice-title { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .6px; color: var(--accent2); margin-bottom: 3px; }
.psc-advice-txt { font-size: 13px; line-height: 1.6; color: var(--text); }
.psc-tasklist { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 9px; }

@media (max-width: 760px) {
  .psc-bubble { right: 14px; bottom: 78px; width: 50px; height: 50px; }
  .psc-panel { right: 8px; left: 8px; bottom: 8px; width: auto; height: min(74vh, 560px); }
}

/* print-safe: never print the assistant chrome */
@media print {
  .psc-bubble, .psc-panel, .psc-scrim { display: none !important; }
}

/* PSC settings — toggle switch + SLA grid (wave 63) */
.psc-sw { position: relative; display: inline-block; width: 42px; height: 24px; flex: none; cursor: pointer; }
.psc-sw input { opacity: 0; width: 0; height: 0; }
.psc-sw .knob { position: absolute; inset: 0; background: var(--line2); border-radius: 999px; transition: .2s; }
.psc-sw .knob::before { content: ""; position: absolute; height: 18px; width: 18px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s; box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.psc-sw input:checked + .knob { background: var(--accent); }
.psc-sw input:checked + .knob::before { transform: translateX(18px); }
.psc-hours { display: flex; align-items: center; gap: 8px; }
.psc-hours .f { font-size: 10px; color: var(--muted); font-weight: 700; }
.psc-sla { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.psc-sla-row { display: flex; align-items: center; gap: 8px; }
.psc-sla-row label { font-size: 12px; color: var(--muted); flex: 1; }
.psc-sla-row input { width: 66px; }


/* ---- official PSC logo (wave 64): nav + page header + notifications ---- */
.psc-h-logo { width: 30px; height: 30px; border-radius: 8px; object-fit: cover; vertical-align: -7px; margin-right: 5px; }
.nav-item .nav-ico-img { width: 18px; height: 18px; border-radius: 5px; object-fit: cover; }
.notif-ico .nt-logo, .sn-ico .nt-logo { width: 16px; height: 16px; border-radius: 4px; object-fit: cover; vertical-align: -3px; }
@media (prefers-reduced-motion: reduce) {
  .psc-bubble-ring, .psc-bubble::after, .psc-bubble-img { animation: none !important; }
}

/* only show the assistant once the user is signed in (wave 64 fix) */
.psc-bubble, .psc-scrim, .psc-panel { display: none; }
#app.on ~ .psc-bubble { display: flex; }
#app.on ~ .psc-scrim.on { display: block; }
#app.on ~ .psc-panel.on { display: flex; }


/* ============================================================
   Static line-art nav icons (v1.4.16)
   Previously (wave 66) every nav glyph was drawn with a dashed stroke
   (stroke-dasharray: 22 10) and animated with a continuous `navFlow`
   dash-offset loop, and the PSC Assistant cog span forever. That made the
   whole sidebar look "busy" and slightly blurry. The icons are now plain,
   solid, still line-art: no dash pattern, no keyframes, no spinning.
   Hover still gives colour feedback (not motion).
   ============================================================ */
.nav-item svg path,
.nav-item svg circle,
.nav-item svg rect,
.nav-item svg line,
.nav-item svg polyline,
.nav-item svg polygon,
.nav-item svg ellipse {
  stroke-dasharray: none;
  stroke-dashoffset: 0;
  animation: none;
}

/* PSC Assistant: line-art cog in brand green, static */
.nav-item.nav-psc svg { color: #22c55e; animation: none; transform: none; }
.nav-item.nav-psc:hover svg { color: #16a34a; }

/* ============================================================
   WAVE 68/69/70 — animated login hero (full official logo) + clean professional login
   Animation is GPU-only (transform / opacity) for zero load-performance cost.
   ============================================================ */
.login-wrap {
  min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 40px 20px; gap: 26px; position: relative; overflow: hidden;
}
/* soft animated aurora behind everything (transform only) */
.login-wrap::before {
  content: ''; position: absolute; inset: -20%; z-index: 0; pointer-events: none;
  background:
    radial-gradient(620px 420px at 20% 15%, rgba(79,140,255,.16), transparent 60%),
    radial-gradient(620px 420px at 85% 85%, rgba(45,212,167,.13), transparent 60%);
  animation: loginAurora 16s ease-in-out infinite alternate;
  will-change: transform;
}
@keyframes loginAurora {
  0% { transform: translate3d(0,0,0) scale(1); }
  100% { transform: translate3d(2%,-2%,0) scale(1.08); }
}

/* hero: animated full logo + tagline */
.login-hero {
  position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center;
  text-align: center; animation: heroIn .8s cubic-bezier(.2,.8,.3,1) both;
}
.login-logo-stage {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  margin-bottom: 12px; isolation: isolate;
}
/* soft glow behind the logo — static blur, only opacity animates (cheap) */
.login-logo-glow {
  position: absolute; inset: -26% -10%; z-index: 0; pointer-events: none;
  background: radial-gradient(closest-side, rgba(79,140,255,.40), rgba(45,212,167,.15) 58%, transparent 76%);
  filter: blur(20px); animation: logoGlow 6s ease-in-out infinite;
}
@keyframes logoGlow { 0%,100% { opacity: .55; } 50% { opacity: .95; } }
.login-logo-full {
  position: relative; z-index: 1; width: 244px; max-width: 80vw; height: auto; display: block;
  filter: drop-shadow(0 10px 22px rgba(0,0,0,.42));
  animation: logoFloat 6s ease-in-out infinite;
  will-change: transform;
}
@keyframes logoFloat { 0%,100% { transform: translate3d(0,0,0); } 50% { transform: translate3d(0,-7px,0); } }
/* light sheen that sweeps across the logo shape (masked to the logo pixels) */
.login-logo-stage::after {
  content: ''; position: absolute; inset: 0; z-index: 2; pointer-events: none;
  background: linear-gradient(102deg, transparent 40%, rgba(255,255,255,.95) 50%, transparent 60%);
  background-size: 260% 100%; background-repeat: no-repeat;
  -webkit-mask: url(assets/logo-full.png) center / 100% 100% no-repeat;
  mask: url(assets/logo-full.png) center / 100% 100% no-repeat;
  animation: logoSweep 5.5s ease-in-out infinite;
}
@keyframes logoSweep {
  0%, 14% { background-position: 180% 0; opacity: 0; }
  24% { opacity: .9; }
  56% { background-position: -80% 0; opacity: 0; }
  100% { background-position: -80% 0; opacity: 0; }
}
.login-hero-sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; letter-spacing: .4px; }

@keyframes heroIn { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

/* card entrance */
.login-card { position: relative; z-index: 1; animation: cardIn .8s cubic-bezier(.2,.8,.3,1) .08s both; }
@keyframes cardIn { from { opacity: 0; transform: translateY(22px) scale(.985); } to { opacity: 1; transform: none; } }

/* light theme */
html[data-theme="light"] .login-wrap::before {
  background:
    radial-gradient(620px 420px at 20% 15%, rgba(63,116,230,.12), transparent 60%),
    radial-gradient(620px 420px at 85% 85%, rgba(14,158,119,.10), transparent 60%);
}
html[data-theme="light"] .login-logo-glow {
  background: radial-gradient(closest-side, rgba(63,116,230,.32), rgba(14,158,119,.13) 58%, transparent 76%);
}
html[data-theme="light"] .login-logo-full { filter: drop-shadow(0 10px 22px rgba(23,42,74,.20)); }

/* mobile */
@media (max-width: 480px) {
  .login-wrap { gap: 20px; padding: 28px 16px; }
  .login-logo-full { width: 200px; }
  .login-hero-sub { font-size: 11.5px; }
}

@media (prefers-reduced-motion: reduce) {
  .login-logo-full, .login-logo-glow, .login-logo-stage::after,
  .login-hero, .login-card, .login-wrap::before { animation: none !important; }
  .login-logo-stage::after { opacity: 0 !important; }
}


/* ============================================================
   WAVE 71 — Admin Notices (centred splash + 1-min countdown)
   ============================================================ */

/* ---- splash overlay ---- */
.notice-splash {
  position: fixed;
  inset: 0;
  z-index: 4200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(9, 15, 28, .62);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.notice-splash.on { display: flex; animation: nsFade .28s ease both; }
@keyframes nsFade { from { opacity: 0; } to { opacity: 1; } }

.ns-card {
  position: relative;
  width: 100%;
  max-width: 560px;
  border-radius: 20px;
  padding: 26px 26px 20px;
  background: linear-gradient(180deg, #18233c, #121a2e);
  border: 1px solid rgba(120, 150, 220, .22);
  box-shadow: 0 30px 70px rgba(0, 0, 0, .55), 0 0 0 1px rgba(255,255,255,.03) inset;
  color: #eaf0ff;
  animation: nsPop .42s cubic-bezier(.2, .9, .25, 1.04) both;
  overflow: hidden;
}
@keyframes nsPop {
  from { opacity: 0; transform: translateY(26px) scale(.94); }
  to   { opacity: 1; transform: none; }
}
.ns-card::before {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 4px;
  background: linear-gradient(90deg, #3f74e6, #12b886);
}
.notice-high .ns-card::before { background: linear-gradient(90deg, #f59f00, #f76707); }
.notice-urgent .ns-card::before { background: linear-gradient(90deg, #fa5252, #e03131); }

/* wave 74: animated brand logo + moving border line on the notice/announcement splash */
.ns-logo-stage {
  position: relative;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 16px;
  isolation: isolate;
  min-height: 96px;
}
.ns-logo-glow {
  position: absolute; inset: -18% -6%; z-index: 0; pointer-events: none;
  background: radial-gradient(closest-side, rgba(79,140,255,.42), rgba(45,212,167,.16) 58%, transparent 76%);
  filter: blur(20px);
  animation: nsLogoGlow 6s ease-in-out infinite;
}
@keyframes nsLogoGlow { 0%,100% { opacity: .5; } 50% { opacity: .95; } }
.ns-logo {
  position: relative; z-index: 2;
  width: 244px; max-width: 82%; height: auto; display: block;
  filter: drop-shadow(0 12px 24px rgba(0,0,0,.45));
  animation: nsLogoFloat 6s ease-in-out infinite;
  will-change: transform;
}
@keyframes nsLogoFloat { 0%,100% { transform: translate3d(0,0,0); } 50% { transform: translate3d(0,-8px,0); } }
.ns-logo-ring {
  position: absolute; left: 50%; top: 50%;
  width: 150px; height: 150px; margin: -75px 0 0 -75px;
  border-radius: 50%;
  border: 2px solid rgba(79,140,255,.55);
  z-index: 1; pointer-events: none;
  animation: nsRipple 4.6s ease-out infinite;
}
.ns-logo-ring.r2 { border-color: rgba(45,212,167,.5); animation-delay: 2.3s; }
@keyframes nsRipple {
  0% { transform: scale(.5); opacity: 0; }
  16% { opacity: .7; }
  100% { transform: scale(1.95); opacity: 0; }
}
html[data-theme="light"] .ns-logo-glow {
  background: radial-gradient(closest-side, rgba(63,116,230,.30), rgba(14,158,119,.13) 58%, transparent 76%);
}
html[data-theme="light"] .ns-logo { filter: drop-shadow(0 12px 24px rgba(23,42,74,.22)); }

/* moving border line around the splash card */
@property --nsang { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
.ns-card::after {
  content: "";
  position: absolute; inset: 0;
  border-radius: inherit;
  padding: 1.7px;
  background: conic-gradient(from var(--nsang),
    rgba(63,116,230,0) 0deg,
    rgba(63,116,230,.9) 55deg,
    rgba(18,184,134,.9) 110deg,
    rgba(63,116,230,0) 195deg,
    rgba(63,116,230,0) 360deg);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
          mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  animation: nsBorderSpin 4.5s linear infinite;
  pointer-events: none;
  z-index: 3;
}
@keyframes nsBorderSpin { to { --nsang: 360deg; } }
.notice-high .ns-card::after {
  background: conic-gradient(from var(--nsang),
    rgba(245,159,0,0) 0deg, rgba(245,159,0,.92) 55deg,
    rgba(247,103,7,.92) 110deg, rgba(245,159,0,0) 195deg, rgba(245,159,0,0) 360deg);
}
.notice-urgent .ns-card::after {
  background: conic-gradient(from var(--nsang),
    rgba(250,82,82,0) 0deg, rgba(250,82,82,.92) 55deg,
    rgba(224,49,49,.92) 110deg, rgba(250,82,82,0) 195deg, rgba(250,82,82,0) 360deg);
}

.ns-top { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.ns-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px; height: 34px;
  border-radius: 10px;
  background: rgba(63, 116, 230, .16);
  color: #7fa8ff;
  flex: 0 0 auto;
}
.ns-ico svg { width: 19px; height: 19px; }
.notice-high .ns-ico { background: rgba(245, 159, 0, .16); color: #ffc14d; }
.notice-urgent .ns-ico { background: rgba(250, 82, 82, .16); color: #ff8787; }
.ns-kicker {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .10em;
  text-transform: uppercase;
  color: #8ea6d6;
}
.ns-when { font-size: 11.5px; color: #7d90b8; white-space: nowrap; }

.ns-title {
  margin: 0 0 10px;
  font-size: 21px;
  line-height: 1.3;
  font-weight: 800;
  color: #ffffff;
}
.ns-msg {
  font-size: 14.5px;
  line-height: 1.62;
  color: #c6d2ea;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 42vh;
  overflow: auto;
}

.ns-foot {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid rgba(120, 150, 220, .16);
}
.ns-ack { flex: 0 0 auto; }

.ns-count-wrap {
  position: relative;
  width: 58px; height: 58px;
  margin-left: auto;
  flex: 0 0 auto;
}
.ns-ring { width: 58px; height: 58px; transform: rotate(-90deg); }
.ns-ring-bg { fill: none; stroke: rgba(120, 150, 220, .20); stroke-width: 6; }
.ns-ring-fg {
  fill: none;
  stroke: #12b886;
  stroke-width: 6;
  stroke-linecap: round;
  transition: stroke-dashoffset .95s linear, stroke .3s ease;
}
.notice-high .ns-ring-fg { stroke: #f59f00; }
.notice-urgent .ns-ring-fg { stroke: #fa5252; }
.ns-count {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 800;
  color: #eaf0ff;
  font-variant-numeric: tabular-nums;
}

/* light theme */
html[data-theme="light"] .notice-splash { background: rgba(20, 30, 50, .42); }
html[data-theme="light"] .ns-card {
  background: linear-gradient(180deg, #ffffff, #f4f7ff);
  border-color: rgba(60, 90, 160, .18);
  color: #17233b;
  box-shadow: 0 30px 70px rgba(30, 50, 90, .28);
}
html[data-theme="light"] .ns-title { color: #101a30; }
html[data-theme="light"] .ns-msg { color: #3d4b66; }
html[data-theme="light"] .ns-kicker { color: #5a6d92; }
html[data-theme="light"] .ns-when { color: #6b7c9c; }
html[data-theme="light"] .ns-count { color: #17233b; }

/* ---- admin Notices page ---- */
.nt-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.nt-head .spacer { flex: 1; }

.nt-aud { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.nt-chip {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  background: rgba(63, 116, 230, .12);
  color: #5b8bf0;
  border: 1px solid rgba(63, 116, 230, .22);
}
.nt-chip.muted { background: rgba(120, 140, 180, .12); color: #7d8aa5; border-color: rgba(120,140,180,.22); }

.nt-pill {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  text-transform: capitalize;
}
.nt-pill.normal { background: rgba(63, 116, 230, .14); color: #5b8bf0; }
.nt-pill.high   { background: rgba(245, 159, 0, .16); color: #d98a00; }
.nt-pill.urgent { background: rgba(250, 82, 82, .16); color: #e03131; }

.nt-state { font-size: 11px; font-weight: 700; text-transform: capitalize; }
.nt-state.active { color: #12b886; }
.nt-state.scheduled { color: #d98a00; }
.nt-state.cancelled { color: #98a2b3; }
.nt-state.expired { color: #98a2b3; }

/* compose form */
.nt-form { display: flex; flex-direction: column; gap: 14px; }
.nt-form label { display: block; font-size: 12px; font-weight: 700; color: #5a6d92; margin-bottom: 5px; }
html[data-theme="light"] .nt-form label { color: #55627a; }
.nt-form input[type="text"],
.nt-form input[type="datetime-local"],
.nt-form textarea,
.nt-form select {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(120, 150, 220, .28);
  background: rgba(10, 18, 34, .35);
  color: inherit;
  font: inherit;
  font-size: 14px;
}
html[data-theme="light"] .nt-form input,
html[data-theme="light"] .nt-form textarea,
html[data-theme="light"] .nt-form select { background: #fff; border-color: #d5ddea; }
.nt-form textarea { min-height: 92px; resize: vertical; }
.nt-row { display: flex; gap: 12px; flex-wrap: wrap; }
.nt-row > div { flex: 1 1 160px; }

/* segmented audience picker */
.nt-seg { display: inline-flex; padding: 3px; border-radius: 11px; background: rgba(120, 140, 180, .14); gap: 3px; }
.nt-seg-btn {
  border: 0;
  background: transparent;
  color: #8ea6d6;
  font: inherit;
  font-size: 12.5px;
  font-weight: 700;
  padding: 7px 14px;
  border-radius: 9px;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.nt-seg-btn.on { background: #3f74e6; color: #fff; box-shadow: 0 3px 10px rgba(63,116,230,.35); }
html[data-theme="light"] .nt-seg-btn { color: #5a6d92; }

.nt-picker { margin-top: 10px; }
.nt-picker.hidden { display: none; }
.nt-check {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 11px;
  margin: 0 6px 6px 0;
  border-radius: 999px;
  border: 1px solid rgba(120, 150, 220, .28);
  font-size: 12.5px;
  cursor: pointer;
  user-select: none;
  transition: background .15s, border-color .15s;
}
.nt-check:hover { border-color: rgba(63, 116, 230, .5); }
.nt-check.on { background: rgba(63, 116, 230, .16); border-color: rgba(63, 116, 230, .55); color: #5b8bf0; }
.nt-check input { accent-color: #3f74e6; }

.nt-search { margin-bottom: 8px; }
.nt-users-list {
  max-height: 210px;
  overflow: auto;
  padding: 4px;
  border-radius: 12px;
  border: 1px solid rgba(120, 150, 220, .20);
  background: rgba(10, 18, 34, .25);
}
html[data-theme="light"] .nt-users-list { background: #f7f9fd; border-color: #e2e8f2; }
.nt-user {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 9px;
  border-radius: 9px;
  cursor: pointer;
}
.nt-user:hover { background: rgba(63, 116, 230, .10); }
.nt-user .nm { font-size: 13px; font-weight: 600; }
.nt-user .rl { font-size: 11px; color: #7d8aa5; margin-left: auto; }
.nt-count { font-size: 12px; color: #7d8aa5; margin-top: 8px; }

@media (max-width: 560px) {
  .ns-card { padding: 20px 18px 16px; }
  .ns-title { font-size: 18.5px; }
  .ns-count-wrap, .ns-ring { width: 50px; height: 50px; }
  .nt-row > div { flex: 1 1 100%; }
  .ns-logo-stage { min-height: 74px; margin-bottom: 12px; }
  .ns-logo { width: 188px; }
  .ns-logo-ring { width: 120px; height: 120px; margin: -60px 0 0 -60px; }
}

@media (prefers-reduced-motion: reduce) {
  .notice-splash.on, .ns-card { animation: none !important; }
  .ns-ring-fg { transition: none !important; }
  .ns-logo, .ns-logo-glow, .ns-logo-ring, .ns-card::after { animation: none !important; }
  .ns-logo-ring { opacity: 0 !important; }
}


/* ============================================================
   WAVE 72 — Announcements & Groups (notice tabs)
   ============================================================ */
.nt-tabs {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  margin-bottom: 16px;
  border-radius: 12px;
  background: rgba(120, 140, 180, .12);
}
.nt-tab {
  border: 0;
  background: transparent;
  color: #8ea6d6;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  padding: 8px 16px;
  border-radius: 9px;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.nt-tab.on { background: #3f74e6; color: #fff; box-shadow: 0 3px 10px rgba(63, 116, 230, .32); }
html[data-theme="light"] .nt-tab { color: #5a6d92; }

.nt-save-ann,
.nt-repeat {
  margin-top: 4px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px dashed rgba(120, 150, 220, .34);
  background: rgba(63, 116, 230, .05);
}
.nt-repeat { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.nt-repeat #an-rep-time-wrap { display: flex; align-items: flex-end; gap: 14px; flex-wrap: wrap; }
.nt-repeat #an-rep-time-wrap > div { display: flex; flex-direction: column; gap: 4px; }
.nt-repeat #an-rep-time-wrap label { margin: 0; }
.nt-repeat #an-rep-freq, .nt-repeat #an-rep-time { min-width: 150px; }
.nt-save-ann #nt-ann-name { margin-top: 10px; }

.nt-aud > .f { display: block; margin-bottom: 8px; }
.nt-aud .nt-check { margin-bottom: 6px; }
.nt-picker { margin-top: 2px; }

/* ============================================================
   WAVE 77 — Modern compact tabbed dashboard
   ============================================================ */
.dash-hero {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(134px, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}
.dh-chip {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 10px 12px 10px 15px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--card-bg);
  overflow: hidden;
  transition: border-color .15s, transform .15s, box-shadow .15s;
}
.dh-chip:hover { border-color: var(--line2); transform: translateY(-1px); box-shadow: var(--shadow); }
.dh-chip::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--accent); opacity: .9;
}
.dh-chip.k-blue::before { background: var(--accent); }
.dh-chip.k-green::before { background: var(--green); }
.dh-chip.k-amber::before { background: var(--amber); }
.dh-chip.k-purple::before { background: var(--purple); }
.dh-chip .dh-l { font-size: 9.5px; text-transform: uppercase; letter-spacing: .7px; color: var(--muted); font-weight: 700; }
.dh-chip .dh-v { font-size: 15px; font-weight: 700; letter-spacing: .1px; font-variant-numeric: tabular-nums; line-height: 1.25; }
.dh-chip .dh-s { font-size: 10.5px; color: var(--muted2); }
.dh-chip.k-blue .dh-v { color: var(--accent2); }
.dh-chip.k-green .dh-v { color: var(--green); }
.dh-chip.k-amber .dh-v { color: var(--amber); }
.dh-chip.k-purple .dh-v { color: var(--purple); }

/* segmented tab strip */
.dash-tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  margin-bottom: 14px;
  border-radius: 12px;
  background: rgba(120, 140, 180, .12);
  overflow-x: auto;
  scrollbar-width: none;
}
.dash-tabs::-webkit-scrollbar { display: none; }
.dash-tab {
  border: 0;
  background: transparent;
  color: #8ea6d6;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  padding: 8px 16px;
  border-radius: 9px;
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: background .15s, color .15s;
}
.dash-tab .dt-badge {
  font-size: 10px; font-weight: 800; padding: 1px 7px; border-radius: 999px;
  background: rgba(148, 163, 200, .18); color: var(--muted);
}
.dash-tab.on { background: #3f74e6; color: #fff; box-shadow: 0 3px 10px rgba(63, 116, 230, .32); }
.dash-tab.on .dt-badge { background: rgba(255, 255, 255, .25); color: #fff; }
html[data-theme="light"] .dash-tab { color: #5a6d92; }

.dash-panel { display: none; }
.dash-panel.on { display: block; animation: dashFade .22s ease; }
@keyframes dashFade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* compact summary chips (Last 30 days) */
.sum-chips { display: grid; grid-template-columns: repeat(auto-fit, minmax(148px, 1fr)); gap: 8px; }
.sum-chip {
  display: flex; justify-content: space-between; align-items: baseline; gap: 8px;
  padding: 9px 12px; border-radius: 10px;
  border: 1px solid var(--line); background: rgba(148, 163, 200, .05);
}
.sum-chip .sc-l { font-size: 11px; color: var(--muted); font-weight: 600; }
.sum-chip .sc-v { font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.sum-chip .sc-v.pos { color: var(--green); }

/* Wave 89: multi-period summary blocks (Last 7 / 15 / 30 days) */
.period-summary { display: flex; flex-direction: column; gap: 12px; }
.ps-block { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: rgba(148, 163, 200, .03); }
.ps-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.ps-title { font-size: 13px; font-weight: 800; letter-spacing: .01em; }
.ps-sub { font-size: 11px; font-weight: 700; color: var(--muted); margin-left: auto; background: rgba(148, 163, 200, .12); padding: 2px 9px; border-radius: 999px; }
.ps-chips { display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: 8px; }
.ps-chips .sum-chip { padding: 8px 10px; }

/* Wave 89: comparison card (KPIs + charts + metric toggle) */
.cmp-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.cmp-head h3 { margin: 0; }
.cmp-toggle { display: inline-flex; gap: 3px; background: rgba(148, 163, 200, .10); border: 1px solid var(--line); border-radius: 999px; padding: 3px; margin-left: auto; }
.cmp-tbtn { border: none; background: transparent; color: var(--muted); font-size: 11.5px; font-weight: 700; padding: 5px 13px; border-radius: 999px; cursor: pointer; transition: background .15s, color .15s; }
.cmp-tbtn:hover { color: var(--text); }
.cmp-tbtn.on { background: #3f74e6; color: #fff; box-shadow: 0 2px 8px rgba(63, 116, 230, .3); }
.cmp-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 14px; }
.cmp-kpi { position: relative; padding: 12px 14px 12px 17px; border-radius: 12px; border: 1px solid var(--line); background: rgba(148, 163, 200, .04); overflow: hidden; }
.cmp-kpi::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: #4f8cff; }
.cmp-kpi.k-blue::before { background: #4f8cff; }
.cmp-kpi.k-purple::before { background: #b48cff; }
.cmp-kpi.k-green::before { background: #2dd4a7; }
.cmp-kpi.k-amber::before { background: #f5a623; }
.cmp-kpi .ck-l { font-size: 10.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; }
.cmp-kpi .ck-v { font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums; margin-top: 3px; line-height: 1.2; }
.cmp-kpi .ck-of { font-size: 11px; font-weight: 700; color: var(--muted); }
.cmp-kpi .ck-s { font-size: 11px; color: var(--muted); margin-top: 2px; }
.cmp-grid { display: grid; grid-template-columns: 1fr 1.35fr; gap: 14px; }
@media (max-width: 900px) { .cmp-grid { grid-template-columns: 1fr; } }
.cmp-chart { border: 1px solid var(--line); border-radius: 12px; padding: 12px; background: rgba(148, 163, 200, .02); }
.cmp-h { font-size: 12px; font-weight: 700; margin: 0 0 8px; color: var(--text); }
.cmp-chart .legend { margin-top: 6px; }

/* collections call-to-action row */
.dash-cta { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }

@media (max-width: 640px) {
  .dash-hero { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); }
  .dh-chip .dh-v { font-size: 14px; }
}

/* ============================================================
   WAVE 78 — Clean login + animated moving border on the login box
   ============================================================ */
/* the login card already has position:relative + z-index:1; add a
   rotating conic-gradient ring drawn only at the edges (masked). */
.login-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1.7px;
  background: conic-gradient(from var(--nsang),
    rgba(79,140,255,0) 0deg,
    rgba(79,140,255,.95) 55deg,
    rgba(45,212,167,.95) 115deg,
    rgba(79,140,255,0) 200deg,
    rgba(79,140,255,0) 360deg);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
          mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  animation: nsBorderSpin 5s linear infinite;
  pointer-events: none;
  z-index: 3;
}
html[data-theme="light"] .login-card::after {
  background: conic-gradient(from var(--nsang),
    rgba(63,116,230,0) 0deg,
    rgba(63,116,230,.95) 55deg,
    rgba(14,158,119,.95) 115deg,
    rgba(63,116,230,0) 200deg,
    rgba(63,116,230,0) 360deg);
}
@media (prefers-reduced-motion: reduce) {
  .login-card::after { animation: none; }
}
/* ===== Wave 92 (CR1): multi-part order UI ===== */
/* New Order Request: dynamic part rows */
.nf-parts { display: flex; flex-direction: column; gap: 8px; }
.nf-part-row { display: grid; grid-template-columns: 1fr 74px auto auto; gap: 8px; align-items: center; }
.nf-part-row .nf-part-desc { min-width: 0; }
.nf-part-row .nf-part-qty { text-align: center; }
.nf-part-file { position: relative; display: inline-flex; }
.nf-part-file input[type="file"] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.nf-part-file-lbl {
  display: inline-flex; align-items: center; gap: 5px; padding: 6px 10px; border-radius: 8px;
  border: 1px dashed var(--line2); font-size: 11.5px; font-weight: 700; color: var(--muted);
  white-space: nowrap; transition: border-color .15s, color .15s;
}
.nf-part-file-lbl svg { width: 13px; height: 13px; }
.nf-part-file:hover .nf-part-file-lbl { border-color: var(--accent); color: var(--accent); }
.nf-part-del { flex: none; color: var(--muted); }
.nf-part-del:hover { color: #f87171; border-color: rgba(239,68,68,.5); }
@media (max-width: 640px) {
  .nf-part-row { grid-template-columns: 1fr 64px auto; }
  .nf-part-row .nf-part-desc { grid-column: 1 / -1; }
}

/* Order detail: per-part list */
.od-parts { display: flex; flex-direction: column; gap: 8px; }
.od-part { display: flex; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: rgba(79,140,255,.03); }
.od-part-no {
  flex: none; width: 22px; height: 22px; border-radius: 50%; background: rgba(79,140,255,.14);
  color: #8db4ff; font-size: 11.5px; font-weight: 800; display: inline-flex; align-items: center;
  justify-content: center; margin-top: 1px;
}
.od-part-main { flex: 1; min-width: 0; }
.od-part-desc { font-size: 13px; font-weight: 600; word-break: break-word; }
.od-part-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 5px; }
.od-part-price {
  font-size: 11.5px; font-weight: 700; color: var(--text);
  background: rgba(148,163,200,.12); padding: 1px 7px; border-radius: 6px;
}

/* Vendor price modal: per-part blocks */
.vp-parts { display: flex; flex-direction: column; gap: 12px; }
.vp-part { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: rgba(79,140,255,.03); }
.vp-part-desc { font-size: 12.5px; font-weight: 700; margin-bottom: 8px; }

/* Approve MVR modal: per-part blocks + combined total */
.ap-parts { display: flex; flex-direction: column; gap: 10px; }
.ap-part { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: rgba(79,140,255,.03); }
.ap-part-desc { font-size: 12.5px; font-weight: 700; margin-bottom: 8px; }
.ap-part-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ap-arrow { color: var(--muted); font-weight: 700; }
.ap-total {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin: 12px 0 8px; padding: 10px 12px; border-radius: 10px; font-size: 13px;
  background: rgba(45,212,167,.10); border: 1px solid rgba(45,212,167,.3);
}
.ap-total b { font-size: 15px; }

/* v1.4.7: partial orders — excluded parts (Not Available / Declined) */
.od-part.od-part-excluded { border-color: rgba(255,120,120,.35); background: rgba(255,120,120,.05); }
.od-part.od-part-excluded .od-part-desc { text-decoration: line-through; opacity: .72; }
.od-part.od-part-excluded .od-part-no { background: rgba(255,120,120,.16); color: #ff9d9d; }
.od-part-exc-note { margin-top: 5px; font-size: 11.5px; color: #ff9d9d; }
.od-part-acts { flex: none; display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }
.od-part-acts .btn-sm { white-space: nowrap; }
.od-banner {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin: 0 0 12px; padding: 9px 12px; border-radius: 10px; font-size: 12.5px;
  background: rgba(255,178,60,.10); border: 1px solid rgba(255,178,60,.35); color: var(--text);
}
.ap-exc-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.ap-part-exc { font-size: 12px; color: var(--muted); padding: 6px 10px; border: 1px dashed rgba(255,120,120,.4); border-radius: 8px; }
.ap-part-exc s { color: #ff9d9d; }

/* Edit order modal: professional, aligned per-part table + sectioned form */
.ed-sec { margin-top: 18px; }
.ed-sec:first-child { margin-top: 0; }
.ed-sec-h {
  display: flex; align-items: center; gap: 8px;
  font-size: 11px; font-weight: 800; letter-spacing: .6px; text-transform: uppercase;
  color: var(--muted); margin-bottom: 10px;
}
.ed-sec-h::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.ed-sec-note { font-weight: 600; letter-spacing: 0; text-transform: none; font-size: 11px; }

.ed-note {
  font-size: 12px; line-height: 1.55; color: var(--muted);
  margin-bottom: 14px; padding: 10px 12px; border-radius: 9px;
  background: rgba(148,163,200,.06); border: 1px solid var(--line);
}
.ed-static {
  display: flex; align-items: center; min-height: 36px; padding: 4px 10px;
  border: 1px dashed var(--line2); border-radius: 8px; background: rgba(148,163,200,.04);
}
.ed-empty { padding: 12px; border: 1px dashed var(--line2); border-radius: 10px; text-align: center; }

.ed-parts { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.ed-parts-head, .ed-part { display: grid; grid-template-columns: 30px minmax(0,1fr) 84px; gap: 10px; align-items: center; }
.ed-parts.is-admin .ed-parts-head, .ed-parts.is-admin .ed-part { grid-template-columns: 30px minmax(0,1fr) 84px 110px 110px; }
.ed-parts-head {
  padding: 9px 14px; background: rgba(148,163,200,.07); border-bottom: 1px solid var(--line);
  font-size: 10.5px; font-weight: 800; letter-spacing: .5px; text-transform: uppercase; color: var(--muted);
}
.ed-part { padding: 9px 14px; border-bottom: 1px solid var(--line); }
.ed-part:last-child { border-bottom: none; }
.ed-part-no {
  width: 24px; height: 24px; border-radius: 50%; background: rgba(79,140,255,.14);
  color: #8db4ff; font-size: 11.5px; font-weight: 800; display: inline-flex; align-items: center;
  justify-content: center; justify-self: center;
}
.ed-part-qty, .ed-part-rmb, .ed-part-mvr { text-align: center; }
.ed-h-no, .ed-h-qty, .ed-h-rmb, .ed-h-mvr { text-align: center; }
@media (max-width: 700px) {
  .ed-parts-head { display: none; }
  .ed-parts.is-admin .ed-part {
    grid-template-columns: 30px minmax(0,1fr) 84px;
    grid-template-areas: "no desc qty" ". rmb mvr";
    row-gap: 8px;
  }
  .ed-parts.is-admin .ed-part .ed-part-no { grid-area: no; }
  .ed-parts.is-admin .ed-part .ed-part-desc { grid-area: desc; }
  .ed-parts.is-admin .ed-part .ed-part-qty { grid-area: qty; }
  .ed-parts.is-admin .ed-part .ed-part-rmb { grid-area: rmb; }
  .ed-parts.is-admin .ed-part .ed-part-mvr { grid-area: mvr; }
}

/* Light theme tweaks */
html[data-theme="light"] .od-part-no,
html[data-theme="light"] .ed-part-no { background: rgba(63,116,230,.12); color: #2f5fd4; }
html[data-theme="light"] .od-part-price { background: rgba(91,107,133,.12); color: #33415c; }
html[data-theme="light"] .od-part,
html[data-theme="light"] .vp-part,
html[data-theme="light"] .ap-part { background: rgba(63,116,230,.04); }
html[data-theme="light"] .ap-total { background: rgba(14,158,119,.10); border-color: rgba(14,158,119,.3); }

/* ================= Wave 92 (CR4): compact, professional Collection Details ================= */
/* Balanced two-column rows (Customer|Item, Delivery|Release) + a full-width
   Complaint & Initial Test band + a compact, scrollable activity timeline. */
.cd-full-row { margin-bottom: 10px; }
.cd-full-row .cd-sec { margin-bottom: 0; }
/* two long notes side-by-side inside the full-width band */
.cd-notes { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 22px; margin-bottom: 7px; padding-bottom: 7px; border-bottom: 1px dashed var(--line); }
.cd-note-col { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cd-note-col .cd-k { flex: none; }
@media (max-width: 720px) { .cd-notes { grid-template-columns: 1fr; } }
/* keep the modal short: the activity timeline scrolls inside a capped pane */
.cd-tl-wrap { max-height: 260px; overflow-y: auto; padding-right: 6px; }
.cd-tl-wrap::-webkit-scrollbar { width: 8px; }
.cd-tl-wrap::-webkit-scrollbar-thumb { background: var(--line2); border-radius: 8px; }
/* denser, even spacing for a tidier professional rhythm */
.cd-cols { margin-bottom: 8px; }
.cd-sec { margin-bottom: 8px; }


/* ============ Wave 93 (C1/C3): multi-part rows, stacked PDF chips, manual entry ============ */
/* C1: the Info PDF section stacks one chip per part (so every part's PDF is visible). */
.pdf-chips { display: flex; flex-direction: column; gap: 8px; }
.pdf-chips .pdf-chip { width: 100%; }
/* C1: shipment card - one bullet line per part inside a shipment. */
.ship-parts { margin: 2px 0 0 10px; }
.ship-part { font-size: 12px; color: var(--muted); padding: 1px 0; }
.ship-part .pdf-mini { margin-left: 4px; }
/* C1: multi-part table rows - keep the order-level (rowspan) cells top-aligned. */
.tbl tbody td[rowspan] { vertical-align: top; }
/* C3: manual delivery-person entry fields revealed when "Enter manually" is chosen. */
#cl-dp-manual { margin-top: 4px; }

/* v1.4.13: Daily Logs list — ServiceID, Customer name and Phone number are
   secondary reference data, so they are set smaller and NOT bold. Scoped to
   #dl-rows so no other module's table is affected. */
#dl-rows td.sid-col.dl-sid { font-size: 11px; font-weight: 400; letter-spacing: 0; }
#dl-rows td.dl-cust { font-size: 11.5px; font-weight: 400; }
#dl-rows td.dl-cust .clip { font-weight: 400; }
#dl-rows td.dl-cust .dl-phone { font-size: 10.5px; font-weight: 400; }

/* =====================================================================
   v1.4.15 — Dashboard: kill the dead band under the two chart cards.
   The "14-Day Trend" and "Jobs by Status" cards sit in one stretched grid
   row. The status list used to be a single tall column, so the row grew to
   ~440px while the trend card's content stopped at ~270px, leaving a large
   empty strip at the bottom of both cards. The status list now flows in two
   columns and the trend chart is a little taller, so both cards finish at
   the same height with no wasted space. Dashboard-only: every selector is
   scoped to #dash-status-list / #dash-trend so no other page is affected.
   ===================================================================== */
#dash-status-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(178px, 1fr));
  gap: 0 16px;
  margin-top: 8px;
}
#dash-status-list .stat-line { padding: 3px 2px; font-size: 12px; }
#dash-status-list .stat-line:nth-last-child(-n+2) { border-bottom: none; }
@media (max-width: 520px) {
  #dash-status-list { grid-template-columns: 1fr; }
  #dash-status-list .stat-line:nth-last-child(-n+2) { border-bottom: 1px dashed var(--line); }
  #dash-status-list .stat-line:last-child { border-bottom: none; }
}

/* v1.4.15 — Operations tab: let each card size to its own content instead of
   stretching to the tallest one. The "Site Visits Today" card used to inherit
   the height of "Long-Open Jobs" and leave a large empty area under a short
   list. Scoped to the Operations panel only. */
.dash-panel[data-panel="operations"] .two-col { align-items: start; }

/* ============================================================
   v1.4.17 — PSC Assistant: long-open jobs only.
   The Assistant now reports one thing: jobs open longer than 48 hours.
   Technicians see their own job cards; supervisors, managers and admins see a
   per-technician summary table instead of individual reminder cards.
   ============================================================ */
.kpi .k-val-sm { font-size: 13px; letter-spacing: 0; }
.kpi .k-unit { font-size: 10px; font-weight: 700; margin-left: 1px; opacity: .75; }
.psc-task-tech { color: var(--muted); font-weight: 600; }

.psc-sum-table { width: 100%; border-collapse: collapse; font-size: 12.5px; margin-top: 4px; }
.psc-sum-table th {
  font-size: 10px; text-transform: uppercase; letter-spacing: .6px;
  color: var(--muted); font-weight: 800; text-align: left;
  padding: 6px 8px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
.psc-sum-table td { padding: 7px 8px; border-bottom: 1px dashed var(--line); vertical-align: middle; }
.psc-sum-table tbody tr:last-child td { border-bottom: none; }
.psc-sum-table tbody tr:hover { background: var(--panel2); }
.psc-sum-table .ta-r { text-align: right; }
.psc-cnt {
  display: inline-block; min-width: 22px; padding: 1px 7px; border-radius: 999px;
  background: rgba(248, 113, 113, .16); color: var(--red);
  font-size: 11px; font-weight: 800; text-align: center;
}
@media (max-width: 560px) {
  .psc-sum-table th:nth-child(3), .psc-sum-table td:nth-child(3) { display: none; }
}

/* ============================================================================
   v1.4.18 — Daily Logs · list view
   Compact, all-small, no-bold table + modern icon action group.
   Scoped to .tbl-dl only, so no other table in the app is affected.
   ========================================================================== */

/* --- compact, non-bold table ---------------------------------------------- */
table.tbl.tbl-dl { font-size: 11px; }

table.tbl.tbl-dl thead th {
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: .35px;
  text-transform: uppercase;
  padding: 5px 7px;
  color: var(--muted);
  border-bottom: 1px solid var(--line2);
}
table.tbl.tbl-dl thead th svg { width: 10px; height: 10px; margin-right: 3px; opacity: .55; }

table.tbl.tbl-dl tbody td {
  font-size: 11px;
  font-weight: 400;
  padding: 4px 7px;
  line-height: 1.35;
}
table.tbl.tbl-dl tbody td b,
table.tbl.tbl-dl tbody td strong { font-weight: 500; }

table.tbl.tbl-dl .small,
table.tbl.tbl-dl .muted.small { font-size: 11px; font-weight: 400; }

table.tbl.tbl-dl td.sid-col { font-size: 10.5px; font-weight: 500; letter-spacing: -.1px; }
table.tbl.tbl-dl td.sid-col b { font-weight: 500; }

table.tbl.tbl-dl .dl-phone { font-size: 10px; font-weight: 400; opacity: .8; }

table.tbl.tbl-dl .num { font-weight: 500; }
table.tbl.tbl-dl .pos,
table.tbl.tbl-dl .neg { font-weight: 500; }

table.tbl.tbl-dl .chip {
  font-size: 9.5px;
  font-weight: 500;
  padding: 1px 6px;
  letter-spacing: .2px;
  gap: 4px;
  line-height: 1.5;
}
table.tbl.tbl-dl .chip::before { width: 5px; height: 5px; }

table.tbl.tbl-dl .tl-cell { font-size: 10.5px; gap: 4px; font-weight: 400; }
table.tbl.tbl-dl .tl-cell svg { width: 11px; height: 11px; }
table.tbl.tbl-dl .tl-dot { width: 6px; height: 6px; }

table.tbl.tbl-dl mark.hl { font-weight: 500; }

/* --- modern, compact row action group ------------------------------------- */
table.tbl.tbl-dl td.dl-act-cell { padding: 3px 6px; }

.dl-acts {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.dl-act {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border-radius: 7px;
  border: 1px solid var(--line2);
  background: var(--panel2);
  color: var(--muted);
  cursor: pointer;
  transition: background .15s ease, color .15s ease, border-color .15s ease, transform .08s ease;
}
.dl-act svg { width: 13px; height: 13px; }
.dl-act:hover {
  color: var(--text);
  border-color: var(--accent);
  background: rgba(79, 140, 255, .12);
}
.dl-act:active { transform: translateY(1px); }
.dl-act:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

/* Mark Customer Received — positive / green */
.dl-act-ok {
  color: var(--green);
  border-color: rgba(0, 189, 86, .35);
  background: rgba(0, 189, 86, .10);
}
.dl-act-ok:hover {
  color: #fff;
  background: var(--green);
  border-color: var(--green);
}

/* Delete — destructive / red */
.dl-act-del {
  color: #f8a5a5;
  border-color: rgba(248, 113, 113, .32);
  background: rgba(248, 113, 113, .10);
}
.dl-act-del:hover {
  color: #fff;
  background: #e5484d;
  border-color: #e5484d;
}

/* --- totals card under the list (small + non-bold) ------------------------ */
#dl-summary .dl-totals .stat-line { font-size: 11.5px; padding: 4px 2px; }
#dl-summary .dl-totals .stat-line b { font-weight: 500; }
#dl-summary .dl-totals h3 { font-size: 12px; font-weight: 500; }

/* --- light theme ---------------------------------------------------------- */
html[data-theme="light"] .dl-act { background: #fff; border-color: #dbe3ef; color: #5b6b85; }
html[data-theme="light"] .dl-act:hover { color: #1a2537; border-color: var(--accent); background: rgba(63, 116, 230, .08); }
html[data-theme="light"] .dl-act-ok { color: #0a8a44; border-color: rgba(10, 138, 68, .30); background: rgba(10, 138, 68, .08); }
html[data-theme="light"] .dl-act-ok:hover { color: #fff; background: #0a8a44; border-color: #0a8a44; }
html[data-theme="light"] .dl-act-del { color: #c23c3c; border-color: rgba(214, 69, 69, .30); background: rgba(214, 69, 69, .07); }
html[data-theme="light"] .dl-act-del:hover { color: #fff; background: #d64545; border-color: #d64545; }

@media (max-width: 700px) {
  .dl-act { width: 26px; height: 26px; }
  .dl-act svg { width: 14px; height: 14px; }
}

/* ============================================================================
   v1.4.19 — Follow-up channel chips + delete-confirmation polish
   One chip per channel, correct icon, and a clear "not sent" marker.
   Scoped to .chip-fu / .fu-* so nothing else in the app changes.
   ========================================================================== */

/* channel chip: icon + count + optional ✕ (not sent) */
.chip.chip-fu {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.chip.chip-fu .fu-ic { font-size: 10px; line-height: 1; }
.chip.chip-fu .fu-n { font-weight: 600; letter-spacing: .1px; }
.chip.chip-fu .fu-x {
  font-size: 8px;
  line-height: 1;
  font-weight: 700;
  color: #ffb4b4;
  margin-left: 1px;
}

/* all attempts sent / reached → green tint */
.chip.chip-fu.fu-ok {
  background: rgba(0, 189, 86, .14);
  color: #7ee2a8;
  border-color: rgba(0, 189, 86, .38);
}
/* nothing got through → red tint */
.chip.chip-fu.fu-no {
  background: rgba(248, 113, 113, .13);
  color: #ffb4b4;
  border-color: rgba(248, 113, 113, .38);
}
/* mixed → amber tint */
.chip.chip-fu.fu-mix {
  background: rgba(245, 179, 66, .14);
  color: #ffd08a;
  border-color: rgba(245, 179, 66, .40);
}

/* light theme */
html[data-theme="light"] .chip.chip-fu.fu-ok { background: rgba(10, 138, 68, .10); color: #0a7a3d; border-color: rgba(10, 138, 68, .32); }
html[data-theme="light"] .chip.chip-fu.fu-no { background: rgba(214, 69, 69, .09); color: #b83232; border-color: rgba(214, 69, 69, .32); }
html[data-theme="light"] .chip.chip-fu.fu-mix { background: rgba(190, 130, 20, .11); color: #96650a; border-color: rgba(190, 130, 20, .34); }
html[data-theme="light"] .chip.chip-fu .fu-x { color: #b83232; }

/* timeline outcome colouring */
.fu-out-no { color: #ff9d9d; }
.fu-out-ok { color: #7ee2a8; }
html[data-theme="light"] .fu-out-no { color: #b83232; }
html[data-theme="light"] .fu-out-ok { color: #0a7a3d; }

/* in-row "· 2 tasks" hint for a single technician with several tasks */
table.tbl.tbl-dl .fu-n { font-weight: 500; opacity: .75; }

/* v1.4.27: per-part PDF manager (Replace / Remove / Add another) */
.pdf-grp { margin-bottom: 10px; }
.pdf-grp-h { font-size: 11.5px; font-weight: 700; color: var(--muted, #94a3b8); margin: 2px 0 5px; text-transform: none; }
.pdf-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.pdf-row .pdf-chip { flex: 1 1 260px; min-width: 0; }
.pdf-acts { display: inline-flex; gap: 6px; flex: none; }
.pdf-acts .btn { padding: 4px 10px; }
.pdf-rm { color: #f87171 !important; }
.pdf-row-add { margin-top: 2px; }
@media (max-width: 560px) { .pdf-row .pdf-chip { flex-basis: 100%; } }

/* ============================================================
   WAVE 130 — Data Health admin page (v1.4.30)
   In-app data doctor + restore screen.
   Scoped under .dh-card / .dh-note so it never touches the
   existing .dh-chip dashboard component.
   ============================================================ */

/* ---- health summary cards ---- */
.dh-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}
.dh-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 12px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--card-bg);
  overflow: hidden;
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.dh-card::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--accent);
  opacity: .85;
}
.dh-card:hover { border-color: var(--line2); box-shadow: var(--shadow); transform: translateY(-1px); }
.dh-card.dh-warn { border-color: rgba(251, 191, 36, .55); }
.dh-card.dh-warn::before { background: var(--amber); }
.dh-card .dh-k {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .7px;
  color: var(--muted);
  font-weight: 700;
}
.dh-card .dh-v {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: .1px;
  line-height: 1.25;
  font-variant-numeric: tabular-nums;
  word-break: break-word;
}
.dh-card.dh-warn .dh-v { color: var(--amber); }
.dh-card .dh-s { font-size: 10.5px; color: var(--muted2); }

/* ---- alert / note strips ---- */
.dh-note {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 11px 14px;
  margin-bottom: 14px;
  border-radius: var(--radius);
  border: 1px solid var(--line2);
  background: var(--panel2);
  font-size: 12.5px;
  line-height: 1.5;
}
.dh-note .dh-line { display: block; }
.dh-note code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11.5px;
  background: rgba(148, 163, 200, .14);
  padding: 1px 5px;
  border-radius: 5px;
}
.dh-note-warn {
  border-color: rgba(251, 191, 36, .5);
  background: rgba(251, 191, 36, .09);
}
.dh-note-err {
  border-color: rgba(248, 113, 113, .55);
  background: rgba(248, 113, 113, .1);
}
.dh-note-ok {
  border-color: rgba(45, 212, 167, .5);
  background: rgba(45, 212, 167, .09);
}

/* ---- section cards ---- */
.dh-sec { margin-bottom: 14px; }
.dh-sec .dh-h {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: var(--muted);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.dh-sec .dh-h .muted { text-transform: none; letter-spacing: 0; }

/* ---- per-date coverage strip ---- */
.dh-days {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.dh-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  min-width: 46px;
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--panel2);
  font-variant-numeric: tabular-nums;
}
.dh-day .dh-d { font-size: 10px; color: var(--muted); font-weight: 600; }
.dh-day .dh-n { font-size: 13px; font-weight: 700; color: var(--text); }
.dh-day.dh-day-miss {
  border-color: rgba(251, 191, 36, .6);
  background: rgba(251, 191, 36, .12);
}
.dh-day.dh-day-miss .dh-n { color: var(--amber); }

/* v1.4.32: highlight a module row that has records in a backup but not live */
.tbl tr.dh-row-gap > td { background: rgba(251, 191, 36, .09); }
.tbl tr.dh-row-gap > td:first-child { box-shadow: inset 3px 0 0 var(--amber); }

/* ---- action row ---- */
.dh-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 14px;
}
.dh-actions .muted { font-size: 11.5px; max-width: 480px; line-height: 1.45; }

/* ---- file-kind badges ---- */
.dh-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .4px;
  text-transform: uppercase;
  white-space: nowrap;
  border: 1px solid var(--line2);
  background: var(--panel2);
  color: var(--muted);
}
.dh-badge.dh-b-live { border-color: rgba(45, 212, 167, .55); background: rgba(45, 212, 167, .14); color: var(--green); }
.dh-badge.dh-b-undo { border-color: rgba(79, 140, 255, .55); background: rgba(79, 140, 255, .14); color: var(--accent2); }
.dh-badge.dh-b-backup { border-color: rgba(180, 140, 255, .5); background: rgba(180, 140, 255, .14); color: var(--purple); }
.dh-badge.dh-b-interrupted { border-color: rgba(251, 191, 36, .5); background: rgba(251, 191, 36, .13); color: var(--amber); }
.dh-badge.dh-b-quarantined,
.dh-badge.dh-b-suspect { border-color: rgba(248, 113, 113, .5); background: rgba(248, 113, 113, .13); color: var(--red); }
.dh-badge.dh-b-pre-merge { border-color: rgba(148, 163, 200, .5); }

/* ---- misc helpers ---- */
.dh-mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11.5px;
}
.dh-ok { color: var(--green); font-weight: 600; }
.dh-bad { color: var(--red); font-weight: 600; }

/* ---- busy overlay ---- */
.dh-overlay {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--overlay-bg);
  backdrop-filter: blur(2px);
}
.dh-overlay-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 26px 34px;
  border-radius: 14px;
  border: 1px solid var(--line2);
  background: var(--modal-bg);
  box-shadow: var(--shadow);
  font-size: 13px;
  text-align: center;
  max-width: 340px;
}
.dh-spin {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 3px solid var(--line2);
  border-top-color: var(--accent);
  animation: dh-spin .8s linear infinite;
}
@keyframes dh-spin { to { transform: rotate(360deg); } }

/* ---- responsive ---- */
@media (max-width: 700px) {
  .dh-cards { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
  .dh-card .dh-v { font-size: 15px; }
  .dh-day { min-width: 40px; padding: 5px 6px; }
  .dh-actions { flex-direction: column; align-items: stretch; }
  .dh-actions .btn { width: 100%; }
}

/* ---- print ---- */
@media print {
  .dh-overlay { display: none !important; }
  .dh-cards { grid-template-columns: repeat(4, 1fr); }
  .dh-card, .dh-note, .dh-sec { break-inside: avoid; }
  .dh-actions { display: none; }
}
