:root {
  /* Nova brand palette — sampled from the Nova Biomedical login mockup,
     structural layout modelled on Simpro (icon sidebar, breadcrumb bar,
     tabs, data tables) per the agreed direction. */
  --blue: #2b64b0;       /* Nova blue (from the logo) */
  --blue-dark: #1f4f94;  /* darker blue for hover/emphasis */
  --navy: #0b1f3f;       /* dark navy, login gradient start / sidebar */
  --teal-deep: #143a72;  /* login gradient mid */
  --sidebar: #0f2747;
  --sidebar-hover: #1a3a66;
  --teal-light: #e8f1fb;
  --bg: #f4f6f8;
  --border: #dbe1e6;
  --text: #1f2933;
  --muted: #64748b;
  --green: #1a7f4e;
  --red: #b3261e;
  --amber: #b26a00;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
}
.screen { min-height: 100vh; }

/* Login — matches the Nova Biomedical brand mockup: dark navy-to-teal
   gradient behind a centred white card, logo up top, teal call-to-action. */
#login-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: linear-gradient(135deg, var(--navy) 0%, var(--teal-deep) 55%, var(--blue) 100%);
}
.login-box {
  background: white;
  padding: 40px 44px 32px;
  border-radius: 14px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.35);
  width: 360px;
}
.login-box .login-logo { display: block; width: 100%; max-width: 260px; margin: 0 auto 22px; }
.login-box h1 { font-size: 18px; margin: 0 0 4px; text-align: center; }
.subtitle { color: var(--muted); margin: 0 0 24px; font-size: 13px; text-align: center; }
.login-box form label {
  display: block; margin-bottom: 14px; font-size: 11px; font-weight: 700;
  color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em;
}
.login-box input {
  display: block; width: 100%; margin-top: 6px; padding: 11px 12px;
  border: 1px solid var(--border); border-radius: 6px; font-size: 14px;
}
.login-box button[type=submit] {
  width: 100%; padding: 12px; font-size: 14px; letter-spacing: 0.04em;
  text-transform: uppercase; margin-top: 6px;
}
.login-version { text-align: center; color: var(--muted); font-size: 12px; margin-top: 18px; }

button {
  cursor: pointer; border: none; border-radius: 6px; padding: 9px 16px;
  background: var(--blue); color: white; font-size: 13px; font-weight: 600;
}
button:hover { background: var(--blue-dark); }
button.secondary { background: white; color: var(--blue); border: 1px solid var(--blue); }
button.danger { background: var(--red); }
.error { color: var(--red); font-size: 13px; min-height: 18px; }

/* ============================== App shell ============================== */
/* Icon sidebar (dark navy) + light top bar, mirroring Simpro's structure. */
#app-screen.screen { display: flex; min-height: 100vh; }

.sidebar {
  width: 64px; background: var(--sidebar); flex-shrink: 0;
  display: flex; flex-direction: column; align-items: center; padding: 14px 0; gap: 4px;
}
.sidebar .logo-dot {
  width: 36px; height: 36px; border-radius: 50%; background: var(--blue);
  display: flex; align-items: center; justify-content: center; margin-bottom: 18px;
  color: white; font-weight: 800; font-size: 15px; flex-shrink: 0;
}
.sidebar .tab-btn {
  width: 44px; height: 44px; border-radius: 8px; display: flex; align-items: center;
  justify-content: center; color: #9fb4bb; font-size: 19px; cursor: pointer;
  background: transparent; padding: 0;
}
.sidebar .tab-btn:hover { background: var(--sidebar-hover); color: white; }
.sidebar .tab-btn.active { background: var(--blue); color: white; }
.sidebar .spacer { flex: 1; }

.main-col { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  height: 56px; background: #fafbfc; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; padding: 0 20px; gap: 14px; flex-shrink: 0;
}
.topbar .brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 15px; color: var(--blue-dark); }
.topbar .brand .sq { width: 26px; height: 26px; background: var(--teal-light); border-radius: 5px; }
.who { display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--muted); margin-left: auto; }
.who .avatar {
  width: 28px; height: 28px; border-radius: 50%; background: var(--blue);
  color: white; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700;
}
#logout-btn { background: transparent; color: var(--muted); border: 1px solid var(--border); }

main { flex: 1; }
.tab-panel h2 { margin-top: 0; }

/* Breadcrumb / action row, sits above each section's page heading */
.action-row {
  display: flex; align-items: center; padding: 16px 24px 0; gap: 12px;
}
.action-row .crumb { font-size: 13px; color: var(--muted); }
.action-row .crumb .current { color: var(--text); font-weight: 600; }
.action-row .spacer { flex: 1; }
.action-row .btns { display: flex; gap: 8px; }
.action-row button { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; padding: 9px 16px; }

.page-head { padding: 4px 24px 0; }
.page-head h1 { font-size: 22px; margin: 6px 0 0; }

/* Section status tabs (Jobs: All / Progress / Complete / Archived, etc.) */
.status-tabs { display: flex; gap: 26px; padding: 0 24px; margin-top: 16px; border-bottom: 1px solid var(--border); }
.status-tabs .stab { padding: 9px 2px 11px; font-size: 13px; font-weight: 600; color: var(--muted); cursor: pointer; border-bottom: 3px solid transparent; }
.status-tabs .stab:hover { color: var(--text); }
.status-tabs .stab.active { color: var(--text); border-bottom-color: var(--blue); }

.content-pad { padding: 18px 24px 28px; }

.panel-split { display: flex; gap: 16px; align-items: flex-start; }
.panel-list { flex: 0 0 46%; background: white; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.panel-list-header { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.panel-list-header h2 { margin: 0; font-size: 16px; }
.panel-list-header input[type=search] { padding: 6px 10px; border: 1px solid var(--border); border-radius: 6px; font-size: 13px; }
.panel-detail { flex: 1; background: white; border: 1px solid var(--border); border-radius: 8px; padding: 18px; min-height: 300px; }
.empty-state { color: var(--muted); font-size: 13px; }

/* Data tables — bordered card, uppercase muted header, pill status badges */
table { width: 100%; border-collapse: collapse; font-size: 13px; }
.panel-list table, table.data { background: white; }
table thead { background: #fafbfc; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); }
th { font-size: 11px; text-transform: uppercase; letter-spacing: 0.03em; color: var(--muted); font-weight: 700; }
tbody tr { cursor: pointer; }
tbody tr:hover { background: #f4f8fd; }

.badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.02em; }
.badge.pending { background: #fdecc8; color: #8a5a00; }
.badge.approved, .badge.complete, .badge.paid { background: #dcf3e6; color: var(--green); }
.badge.declined, .badge.archived { background: #fbdada; color: var(--red); }
.badge.progress { background: #e8f1fb; color: var(--blue-dark); }
.badge.overdue { background: #fbdada; color: var(--red); }

.detail-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 14px; }
.detail-header h3 { margin: 0 0 4px; }
.detail-meta { color: var(--muted); font-size: 13px; }
.detail-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.cost-center { border: 1px solid var(--border); border-radius: 8px; margin-bottom: 12px; }
.cost-center-header { display: flex; justify-content: space-between; padding: 10px 12px; background: #fafbfc; font-weight: 600; font-size: 13px; border-bottom: 1px solid var(--border); }
.line-item-row { display: grid; grid-template-columns: 2fr 60px 90px 80px 90px 90px; gap: 8px; padding: 8px 12px; font-size: 13px; align-items: center; border-bottom: 1px solid #f0f2f4; }
.line-item-row.header-row { font-weight: 600; color: var(--muted); font-size: 11px; text-transform: uppercase; background: #fbfcfd; }
.total-row { display: flex; justify-content: flex-end; padding: 12px; font-size: 15px; font-weight: 700; }

.card { background: white; border: 1px solid var(--border); border-radius: 10px; padding: 18px; margin-bottom: 16px; }
#tab-admin .card { max-width: 1100px; }

.dash-cards { display: flex; gap: 16px; flex-wrap: wrap; }
.dash-card {
  background: white; border: 1px solid var(--border); border-radius: 10px;
  padding: 18px 20px; min-width: 220px; flex: 1 1 240px;
}
.dash-card .dash-number { font-size: 32px; font-weight: 700; color: var(--blue-dark); }
.dash-card .dash-label { color: var(--muted); font-size: 13px; margin-bottom: 4px; }
.dash-card ul { list-style: none; padding: 0; margin: 10px 0 0; font-size: 13px; }
.dash-card li { padding: 4px 0; border-top: 1px solid #f0f2f4; cursor: pointer; }
.dash-card li:hover { color: var(--blue); }

.schedule-nav { display: flex; align-items: center; gap: 10px; }
.schedule-nav button { background: white; color: var(--text); border: 1px solid var(--border); border-radius: 6px; padding: 6px 12px; cursor: pointer; font-size: 13px; }
.schedule-nav button:hover { background: #f4f7fa; }
.schedule-nav span { font-weight: 600; color: var(--blue-dark); min-width: 160px; text-align: center; }

#schedule-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 10px; margin-top: 14px; }
.sched-day { background: white; border: 1px solid var(--border); border-radius: 8px; padding: 10px; min-height: 120px; }
.sched-day.sched-today { border-color: var(--blue); box-shadow: 0 0 0 1px var(--blue); }
.sched-day-header { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.03em; margin-bottom: 8px; }
.sched-job { background: #f4f7fa; border-radius: 6px; padding: 6px 8px; margin-bottom: 6px; cursor: pointer; font-size: 12px; }
.sched-job:hover { background: #e6eef5; }
.sched-job-time { font-weight: 700; color: var(--blue-dark); }
.sched-job-name { margin: 2px 0; }
.sched-job-meta { color: var(--muted); }

.modal-backdrop {
  position: fixed; inset: 0; background: rgba(15,23,32,0.4);
  display: flex; align-items: center; justify-content: center; z-index: 50;
}
.modal {
  background: white; border-radius: 10px; padding: 24px; width: 420px; max-width: 90vw;
  max-height: 85vh; overflow-y: auto;
}
.modal h3 { margin-top: 0; }
.modal label {
  display: block; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em;
  color: var(--muted); margin-bottom: 14px;
}
.modal input, .modal select, .modal textarea {
  display: block; width: 100%; margin-top: 6px; padding: 9px 11px;
  border: 1px solid var(--border); border-radius: 6px; font-size: 14px; font-weight: 400;
  text-transform: none; letter-spacing: normal; color: var(--text);
}
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }

.toast {
  position: fixed; bottom: 20px; right: 20px; background: var(--text); color: white;
  padding: 10px 16px; border-radius: 6px; font-size: 13px; z-index: 100;
}
.toast.error-toast { background: var(--red); }

/* Mobile / narrow screens — collapse the icon sidebar to a slim strip and
   stack list/detail panes instead of squeezing them side by side. Not full
   offline support (see sw.js), but usable on a phone in the field today. */
@media (max-width: 780px) {
  #app-screen.screen { flex-direction: column; }
  .sidebar { width: 100%; flex-direction: row; padding: 8px 10px; justify-content: flex-start; overflow-x: auto; }
  .sidebar .logo-dot { margin-bottom: 0; margin-right: 8px; }
  .sidebar .spacer { display: none; }
  .topbar { flex-wrap: wrap; height: auto; padding: 10px 14px; gap: 10px; }
  .action-row { flex-wrap: wrap; padding: 12px 14px 0; }
  .page-head { padding: 4px 14px 0; }
  .status-tabs { padding: 0 14px; overflow-x: auto; }
  .content-pad { padding: 14px; }
  .panel-split { flex-direction: column; }
  .panel-list, .panel-detail { flex: 1 1 auto; width: 100%; }
  .line-item-row { grid-template-columns: 1fr 1fr; row-gap: 4px; }
  .line-item-row.header-row { display: none; }
  .modal { width: 92vw; padding: 18px; }
  #schedule-days { grid-template-columns: 1fr; }
  .panel-list-header { flex-wrap: wrap; gap: 8px; }
  .schedule-nav { flex-wrap: wrap; }
}

/* =====================================================================
   v0.3: Jobs workflow. Simpro structure (icon sidebar, breadcrumb, stage
   tabs, Details / Parts & Labour tabs) in Nova's teal and navy, with a
   cleaner, modern finish.
   ===================================================================== */
:root {
  --teal: #2b64b0; --teal-600: #245699; --teal-700: #1f4f94; --teal-50: #eef4fb; --teal-100: #d6e5f6;
  --ring: 0 0 0 3px rgba(43,100,176,.18);
  --shadow-sm: 0 1px 2px rgba(16,24,40,.05);
  --shadow: 0 1px 3px rgba(16,24,40,.08), 0 1px 2px rgba(16,24,40,.04);
  --shadow-lg: 0 12px 32px rgba(16,24,40,.16);
  --radius: 10px;
}
body { font-size: 14px; -webkit-font-smoothing: antialiased; }
a { color: var(--teal); text-decoration: none; }
a:hover { text-decoration: underline; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.tiny { font-size: 11px; }
.strong { font-weight: 700; }
.nowrap { white-space: nowrap; }
.center { text-align: center !important; }
.num { text-align: right !important; }
.spacer { flex: 1; }
.sep { color: #c3cbd2; margin: 0 6px; }
.warn-text { color: var(--amber); }
.ic { vertical-align: -3px; flex-shrink: 0; }

/* Sidebar: icon + label */
.sidebar { width: 76px; gap: 2px; padding-top: 12px; position: sticky; top: 0; height: 100vh; }
.sidebar .logo-dot { background: white; width: 40px; height: 40px; overflow: hidden; padding: 4px; margin-bottom: 14px; }
.sidebar .logo-dot img { width: 100%; height: 100%; object-fit: contain; }
.sidebar .tab-btn { width: 64px; height: 56px; flex-direction: column; gap: 3px; font-size: 10px; font-weight: 600; letter-spacing: .02em; border-radius: 10px; }
.sidebar .tab-btn span { line-height: 1; }
.sidebar .tab-btn.active { background: var(--teal); box-shadow: inset 3px 0 0 #8fbde8; }
.topbar { background: white; box-shadow: var(--shadow-sm); position: sticky; top: 0; z-index: 20; }
.topbar .brand-logo { height: 30px; display: block; }

/* Buttons */
.btn, button.btn {
  display: inline-flex; align-items: center; gap: 6px; background: white; color: var(--text);
  border: 1px solid var(--border); border-radius: 8px; padding: 8px 14px; font-size: 13px; font-weight: 600;
  text-transform: none; letter-spacing: 0; box-shadow: var(--shadow-sm); cursor: pointer; line-height: 1.2;
}
.btn:hover, button.btn:hover { background: #f5f7f9; text-decoration: none; }
.btn.primary { background: var(--teal); border-color: var(--teal); color: white; }
.btn.primary:hover { background: var(--teal-700); }
.btn.primary-outline { color: var(--teal); border-color: var(--teal); }
.btn.save { background: #3aa55d; border-color: #3aa55d; color: white; text-transform: uppercase; letter-spacing: .03em; font-size: 12px; }
.btn.save:hover { background: #2f8d4e; }
.btn.save.dirty { box-shadow: 0 0 0 3px rgba(58,165,93,.3); }
.btn.danger { background: var(--red); border-color: var(--red); color: white; }
.btn.small { padding: 5px 10px; font-size: 12px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.action-row .btn { text-transform: none; letter-spacing: 0; font-size: 13px; padding: 8px 14px; }
.icon-btn { background: transparent; color: var(--muted); border: 1px solid transparent; border-radius: 8px; padding: 6px; display: inline-flex; cursor: pointer; }
.icon-btn:hover { background: var(--teal-50); color: var(--teal); }
.icon-btn.danger { color: var(--red); }
.icon-btn.danger:hover { background: #fdecec; color: var(--red); }
.icon-btn.small { padding: 2px; }
.link, .link-btn { color: var(--teal); cursor: pointer; background: none; border: none; padding: 0; font-weight: 600; font-size: 13px; }
.link-btn.danger { color: var(--red); }
.link:hover, .link-btn:hover { text-decoration: underline; background: none; }

/* Form controls */
#tab-jobs input:not([type=checkbox]):not([type=radio]):not([type=color]), #tab-jobs select, #tab-jobs textarea,
#tab-admin input:not([type=checkbox]), #tab-admin select {
  width: 100%; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; font: inherit; font-size: 13px;
  background: white; color: var(--text); transition: border-color .15s, box-shadow .15s;
}
#tab-jobs input:focus, #tab-jobs select:focus, #tab-jobs textarea:focus, #tab-admin input:focus { outline: none; border-color: var(--teal); box-shadow: var(--ring); }
#tab-jobs input:disabled, #tab-jobs select:disabled { background: #f3f5f7; color: #8a96a0; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field > label, .field-label { font-size: 12px; font-weight: 700; color: #3b4650; display: flex; align-items: center; gap: 6px; }
.field > label.req::before { content: "*"; color: var(--red); }
.field .opt { font-weight: 400; color: var(--muted); }
.field-link { margin-left: auto; font-weight: 600; font-size: 12px; cursor: pointer; }
.field .hint { font-size: 11px; color: var(--muted); }
.field .static { padding: 8px 0; font-size: 13px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; }
.form-grid.cols-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.form-grid .span2 { grid-column: span 2; }
.form-grid .span3 { grid-column: span 3; }
.half-pair { display: grid !important; grid-template-columns: 1fr 1fr; gap: 12px; }
.half-pair > div { display: flex; flex-direction: column; gap: 5px; }
.half-pair label { font-size: 12px; font-weight: 700; color: #3b4650; }
.input-suffix { display: flex; }
.input-suffix input { border-top-right-radius: 0 !important; border-bottom-right-radius: 0 !important; }
.input-suffix span { background: #eef1f4; border: 1px solid var(--border); border-left: 0; border-radius: 0 8px 8px 0; padding: 0 10px; display: flex; align-items: center; font-size: 12px; color: var(--muted); }
.input-suffix.sm input { width: 80px !important; text-align: right; }
.money-in { display: inline-flex; align-items: center; gap: 2px; }
.money-in span { color: var(--muted); font-size: 12px; }
.money-in input { width: 92px !important; text-align: right; }
.w-qty { width: 72px !important; text-align: right; }
.check { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; cursor: pointer; font-weight: 500; }
.check input { accent-color: var(--teal); width: 15px; height: 15px; }
input[type=checkbox] { accent-color: var(--teal); }
.warn-input { border-color: #e0b24a !important; background: #fffaf0 !important; }

/* Cards and headings */
.card-title { font-size: 16px; margin: 0 0 14px; font-weight: 700; }
.card-title-row { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.card-title-row .card-title { margin: 0; }
.mini-title { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 20px 0 8px; font-weight: 700; }
.card.list-card { padding: 0; overflow: hidden; }

/* Module tabs (Quotes / Jobs / Invoices) + stage tabs */
.module-tabs { display: flex; gap: 4px; padding: 14px 24px 0; }
.module-tabs a { padding: 8px 16px; border-radius: 8px 8px 0 0; color: var(--muted); font-weight: 600; font-size: 14px; }
.module-tabs a.active { background: white; color: var(--text); box-shadow: 0 -1px 0 var(--border), 1px 0 0 var(--border), -1px 0 0 var(--border); }
.module-tabs a:hover { text-decoration: none; color: var(--text); }
#tab-jobs .status-tabs { background: white; margin: 0 24px; padding: 0 16px; border: 1px solid var(--border); border-radius: 0 10px 10px 10px; gap: 6px; margin-top: 0; }
#tab-jobs .status-tabs .stab { display: inline-flex; gap: 8px; align-items: center; padding: 13px 12px; color: var(--muted); }
#tab-jobs .status-tabs .stab:hover { text-decoration: none; color: var(--text); }
#tab-jobs .status-tabs .stab.active { color: var(--teal-700); border-bottom-color: var(--teal); }
.stab .count { background: #eef1f4; color: #52606b; border-radius: 20px; padding: 1px 8px; font-size: 11px; font-weight: 700; min-width: 20px; text-align: center; }
.stab .count:empty { display: none; }
.stab.active .count { background: var(--teal-100); color: var(--teal-700); }

/* Jobs list */
.list-head { display: flex; align-items: center; gap: 10px; padding: 16px 18px 0; }
.list-head h2 { font-size: 19px; margin: 0; }
.filter-bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 14px 18px; }
.filter-bar select { width: 190px !important; }
.searchbox { display: flex; align-items: center; position: relative; flex: 0 1 460px; }
.searchbox .sb-icon { position: absolute; left: 10px; color: var(--muted); display: flex; }
.searchbox input { padding-left: 32px !important; }
.searchbox .btn { margin-left: -1px; border-radius: 0 8px 8px 0; box-shadow: none; }
.searchbox:has(.btn) input { border-radius: 8px 0 0 8px !important; }
.searchbox.small { flex: 0 1 300px; }
.bulk { display: flex; align-items: center; gap: 8px; background: var(--teal-50); padding: 6px 10px; border-radius: 8px; font-size: 13px; font-weight: 600; }
.bulk select { width: 180px !important; }
.table-wrap { overflow-x: auto; }
table.data th { background: #f8fafb; font-size: 11px; white-space: nowrap; }
table.data td { vertical-align: middle; }
.jobs-table td { padding: 11px 12px; }
.jobs-table th.sortable { cursor: pointer; user-select: none; }
.jobs-table th.sortable:hover { color: var(--text); }
.jobs-table .arrow { font-size: 9px; color: var(--teal); }
.jobs-table th.cb, .jobs-table td.cb, td.cb, th.cb { width: 34px; padding-right: 0; }
.job-link { font-weight: 600; color: var(--text); }
.job-link:hover { color: var(--teal); }
.status-cell { display: flex; align-items: center; gap: 8px; min-width: 190px; }
.status-dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; box-shadow: inset 0 0 0 1px rgba(0,0,0,.08); vertical-align: -1px; }
td.overdue { color: var(--red); font-weight: 700; }
tbody tr:hover { background: #f5f8fc; }

/* Dropdown menus */
.menu { position: relative; display: inline-block; }
.menu-list { display: none; position: absolute; right: 0; top: calc(100% + 4px); background: white; border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow-lg); min-width: 170px; z-index: 40; padding: 4px; }
.menu.open .menu-list { display: block; }
.menu-list button { display: block; width: 100%; text-align: left; background: none; color: var(--text); border-radius: 6px; padding: 8px 12px; font-weight: 500; font-size: 13px; }
.menu-list button:hover { background: var(--teal-50); color: var(--teal-700); }

/* New Service Job */
.action-row.sticky { position: sticky; top: 56px; z-index: 15; background: var(--bg); padding-bottom: 12px; }
.nj-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.sub-tabs { display: flex; gap: 4px; margin: -4px 0 16px; border-bottom: 1px solid var(--border); }
.sub-tabs a { padding: 8px 14px; font-weight: 600; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.sub-tabs a.active { color: var(--text); border-bottom-color: var(--teal); }
.sub-tabs a:hover { text-decoration: none; }
.sched-filters { display: grid; grid-template-columns: 180px 1fr; gap: 14px; }
.avail { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.avail-head { display: flex; align-items: center; gap: 8px; padding: 8px 12px; background: #f8fafb; border-bottom: 1px solid var(--border); font-size: 13px; }
.avail-grid th, .avail-grid td { border-bottom: 1px solid var(--border); padding: 8px 6px; text-align: center; font-size: 12px; }
.avail-grid thead th { text-transform: none; font-size: 12px; color: var(--text); letter-spacing: 0; }
.avail-grid tbody th { width: 40px; color: var(--text); }
.av-cell { cursor: default; }
.av-cell .n { font-weight: 700; display: block; }
.av-cell .from { color: var(--muted); font-size: 11px; }
.av-cell.has { cursor: pointer; }
.av-cell.has .n { color: #2f8d4e; }
.av-cell.none .n { color: var(--red); }
.av-cell.has:hover { background: var(--teal-50); }
.av-cell.sel { background: #fff7d6 !important; box-shadow: inset 0 0 0 2px #e8c547; }
.tech-pick-head { display: flex; gap: 10px; align-items: center; margin-bottom: 8px; }
.tech-pick-head input { max-width: 220px; }
.tech-table td { padding: 8px 10px; }
.tech-table select { width: 92px !important; }
.tech-table tr.busy { background: #fff8f0; }
.sched-list { list-style: none; padding: 0; margin: 6px 0 10px; }
.sched-list li { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 7px 10px; border: 1px solid var(--border); border-radius: 8px; margin-bottom: 6px; font-size: 13px; background: #fbfcfd; }
.sched-list li .link-btn { margin-left: auto; }

/* Typeahead + chips */
.typeahead { position: relative; }
.ta-list { position: absolute; left: 0; right: 0; top: calc(100% + 4px); background: white; border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow-lg); max-height: 280px; overflow: auto; z-index: 45; padding: 4px; }
.ta-item { padding: 8px 10px; border-radius: 6px; cursor: pointer; font-size: 13px; }
.ta-item:hover, .ta-item.active { background: var(--teal-50); color: var(--teal-700); }
.ta-item.new { color: var(--teal); font-weight: 600; }
.chips-input { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; border: 1px solid var(--border); border-radius: 8px; padding: 4px 6px; background: white; min-height: 38px; position: relative; }
.chips-input:focus-within { border-color: var(--teal); box-shadow: var(--ring); }
.chip { display: inline-flex; align-items: center; gap: 4px; background: var(--teal-50); color: var(--teal-700); border: 1px solid var(--teal-100); border-radius: 6px; padding: 3px 4px 3px 8px; font-size: 12px; font-weight: 600; }
.chip button { background: none; color: var(--teal-700); padding: 0 4px; font-size: 14px; line-height: 1; border-radius: 4px; }
.chip button:hover { background: var(--teal-100); }
.chip-add { flex: 1; min-width: 120px; position: static; }
.chips-input .chip-add input { border: none !important; box-shadow: none !important; padding: 4px !important; }

/* Rich text editor */
.rte { border: 1px solid var(--border); border-radius: 10px; background: white; overflow: hidden; }
.rte-top:empty { display: none; }
.rte-top { padding: 8px 8px 0; display: flex; justify-content: flex-end; }
.rte-top select { width: 240px !important; }
.rte-bar { display: flex; align-items: center; gap: 2px; padding: 6px 8px; border-bottom: 1px solid var(--border); flex-wrap: wrap; background: #fbfcfd; }
.rte-bar button { background: none; color: #3b4650; padding: 5px 8px; border-radius: 6px; font-size: 13px; min-width: 30px; display: inline-flex; align-items: center; justify-content: center; }
.rte-bar button:hover { background: var(--teal-50); color: var(--teal); }
.rte-bar select { width: 70px !important; padding: 4px 6px !important; font-size: 12px !important; }
.rte-bar .sep { width: 1px; height: 20px; background: var(--border); margin: 0 4px; }
.rte-colour { position: relative; font-weight: 800; padding: 4px 8px; border-radius: 6px; cursor: pointer; border-bottom: 3px solid #1f2933; font-size: 13px; }
.rte-colour input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.rte-body { padding: 12px 14px; font-size: 14px; line-height: 1.5; overflow: auto; max-height: 520px; outline: none; }
.rte-body p { margin: 0 0 8px; }
.rte.fullscreen { position: fixed; inset: 20px; z-index: 60; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; }
.rte.fullscreen .rte-body { flex: 1; max-height: none; }
.plain-rte { border: 1px solid var(--border); border-radius: 8px; min-height: 180px; }

/* Job screen */
.job-top { display: flex; align-items: center; gap: 10px; padding: 14px 24px 10px; flex-wrap: wrap; position: sticky; top: 56px; z-index: 15; background: var(--bg); }
.job-crumb { display: flex; align-items: center; gap: 6px; font-size: 15px; flex-wrap: wrap; }
.job-crumb a { font-weight: 700; }
.job-crumb .sep { margin: 0 2px; }
.autosave { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); font-style: italic; cursor: pointer; }
.autosave input, .toggle-line input { display: none; }
.switch { width: 34px; height: 20px; border-radius: 20px; background: #c5cdd4; position: relative; transition: background .15s; }
.switch::after { content: ""; position: absolute; width: 16px; height: 16px; top: 2px; left: 2px; background: white; border-radius: 50%; transition: left .15s; box-shadow: var(--shadow-sm); }
input:checked + .switch { background: var(--teal); }
input:checked + .switch::after { left: 16px; }
.split-btn { display: inline-flex; }
.split-btn > .btn:first-child { border-radius: 8px 0 0 8px; }
.split-btn > .caret { border-radius: 0 8px 8px 0; border-left: 1px solid rgba(255,255,255,.35); padding: 8px 10px; }
.menu-list.right { right: 0; }
.primary-tabs { display: flex; gap: 4px; padding: 0 24px; }
.primary-tabs a { padding: 10px 22px; border-radius: 10px 10px 0 0; font-weight: 600; color: var(--teal); }
.primary-tabs a.active { background: white; color: var(--text); box-shadow: 0 -1px 0 var(--border), 1px 0 0 var(--border), -1px 0 0 var(--border); }
.primary-tabs a:hover { text-decoration: none; }
.secondary-tabs { display: flex; gap: 2px; background: white; margin: 0 24px; padding: 6px 10px; border: 1px solid var(--border); border-radius: 0 10px 0 0; flex-wrap: wrap; }
.secondary-tabs a { padding: 8px 14px; border-radius: 8px; color: var(--teal); font-weight: 600; font-size: 13px; display: inline-flex; gap: 6px; align-items: center; }
.secondary-tabs a.active { background: var(--teal-50); color: var(--teal-700); }
.secondary-tabs a:hover { text-decoration: none; background: #f4f7fc; }
.pill { background: var(--teal); color: white; border-radius: 20px; font-size: 10px; padding: 1px 6px; font-weight: 700; }
.job-strip { display: grid; grid-template-columns: 1.3fr 1.3fr .8fr 1fr 1.4fr; gap: 14px 20px; background: white; margin: 0 24px; padding: 14px 18px; border: 1px solid var(--border); border-top: none; }
.job-strip .kv { display: flex; gap: 8px; font-size: 13px; min-width: 0; }
.job-strip .k { font-weight: 700; white-space: nowrap; }
.job-strip .v { min-width: 0; }
.job-strip .change { font-size: 11px; cursor: pointer; }
.status-pick { display: flex; align-items: center; gap: 6px; width: 100%; }
.status-pick select { padding: 5px 8px !important; }
.stage-bar { display: flex; align-items: center; gap: 12px; background: white; margin: 0 24px; padding: 10px 18px; border: 1px solid var(--border); border-top: 1px dashed var(--border); border-radius: 0 0 10px 10px; flex-wrap: wrap; }
.stages { display: flex; gap: 0; flex: 1; flex-wrap: wrap; }
.stage { position: relative; padding: 5px 16px 5px 22px; font-size: 12px; font-weight: 700; color: #8a96a0; background: #f0f3f5; clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 50%, calc(100% - 10px) 100%, 0 100%, 10px 50%); margin-right: -4px; }
.stage:first-child { clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 50%, calc(100% - 10px) 100%, 0 100%); padding-left: 14px; border-radius: 6px 0 0 6px; }
.stage.done { background: var(--teal-100); color: var(--teal-700); }
.stage.current { background: var(--teal); color: white; }
.job-body { padding: 16px 24px 32px; }
.summary-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr) 300px; gap: 16px; align-items: start; }
.notes-card { background: #fbfcfd; }
table.compact td, table.compact th { padding: 7px 10px; }
table.compact tbody tr, .breakdown tbody tr { cursor: default; }
.breakdown { margin-top: 14px; }
.breakdown tr.sub td { background: #f6f8f9; font-weight: 600; }
.breakdown tr.grand td { background: var(--teal-50); font-weight: 800; font-size: 14px; color: var(--teal-700); }
.lock-banner { display: flex; align-items: center; gap: 10px; background: #fcf3c9; border: 1px solid #efd97a; color: #6b5300; padding: 10px 12px; border-radius: 8px; margin-bottom: 12px; font-size: 13px; }
.lock-banner .btn { margin-left: auto; background: var(--teal); color: white; border-color: var(--teal); }
.info-banner { display: flex; gap: 8px; align-items: flex-start; background: var(--teal-50); border: 1px solid var(--teal-100); color: var(--teal-700); padding: 10px 12px; border-radius: 8px; margin-bottom: 14px; font-size: 13px; }
.timeline .tl-item { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px solid #f0f2f4; }
.tl-dot { width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--teal); margin-top: 4px; flex-shrink: 0; }
ul.plain { list-style: none; padding: 0; margin: 0; }
ul.plain li { padding: 4px 0; font-size: 13px; }
.options-row { display: flex; align-items: center; gap: 8px; margin: -4px 0 16px; font-size: 13px; }
.options-row .muted { font-weight: 700; margin-right: 6px; }
.status-field { display: flex; align-items: center; gap: 8px; }
.status-field select { flex: 1; }

/* Forms tab */
.forms-top { display: grid; grid-template-columns: 220px 260px 1fr; gap: 14px 18px; align-items: end; }
.forms-top .field:nth-child(3) { grid-column: 1; }
.form-preview { grid-column: 2 / span 2; grid-row: 1 / span 2; align-self: start; }
.fp-actions { display: flex; justify-content: flex-end; gap: 16px; margin-bottom: 6px; }
.fp-card { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border: 1px solid var(--border); border-radius: 10px; background: #fbfcfd; font-size: 13px; flex-wrap: wrap; }
.email-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 20px; }
.email-grid .field { margin-bottom: 12px; }
.toggle-line { margin-bottom: 12px; gap: 10px; }
.attach-pick { border: 1px solid var(--border); border-radius: 10px; padding: 6px; max-height: 360px; overflow: auto; margin-top: 6px; }
.attach-pick .check { display: flex; padding: 8px; border-bottom: 1px solid #f0f2f4; }
.modal-actions.left { justify-content: flex-start; }

/* Attachments */
.att-top { display: flex; gap: 16px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.dropzone { flex: 1; min-width: 260px; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 18px; border: 2px dashed #b9c6cc; border-radius: 10px; color: var(--teal); font-weight: 600; cursor: pointer; background: #fbfcfe; transition: all .15s; }
.dropzone:hover, .dropzone.over { background: var(--teal-50); border-color: var(--teal); }
.dropzone.busy { opacity: .6; pointer-events: none; }
.bulk-links { display: flex; align-items: center; gap: 8px; padding: 12px 4px 0; font-size: 13px; flex-wrap: wrap; }
.bulk-links .check { margin-right: 10px; }

/* Parts & Labour */
.cc-bar { display: flex; align-items: center; gap: 10px; padding-bottom: 12px; margin-bottom: 12px; border-bottom: 1px solid var(--border); font-size: 13px; }
.cc-bar select { width: 260px !important; }
.add-part { width: 420px; max-width: 100%; }
.edit-table td { padding: 6px 8px; }
.edit-table tbody tr { cursor: default; }
.edit-table input, .edit-table select { padding: 6px 8px !important; }
.edit-table .w-desc { min-width: 220px; }
.inline-add { display: flex; align-items: flex-end; gap: 10px; margin: 14px 0; flex-wrap: wrap; }
.inline-add .field { width: 260px; }
.inline-add .field.sm { width: 110px; }
.inline-add .field.grow { flex: 1; min-width: 200px; }
.bill-summary { display: flex; gap: 20px; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; }
.plain-kv td { border: none; padding: 5px 16px 5px 0; font-size: 13px; }
.plain-kv tr { cursor: default; }
.plain-kv td:nth-child(odd) { color: var(--muted); }
.totals-box { width: 320px; background: #f3f6fa; border-radius: 10px; overflow: hidden; }
.totals-box td { border: none; padding: 9px 16px; font-size: 14px; }
.totals-box td:last-child { text-align: right; font-weight: 600; }
.totals-box tr.grand td { background: var(--teal); color: white; font-weight: 800; font-size: 15px; }
.totals-box tr, .totals-mini tr { cursor: default; }
.totals-mini { margin: 10px 0 14px; }
.totals-mini td { padding: 6px 8px; }
.totals-mini td:last-child { text-align: right; }
.totals-mini tr.grand td { font-weight: 800; }
.browse { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 16px; }
.group-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--border); border-radius: 10px; max-height: 620px; overflow: auto; }
.group-list li { padding: 9px 12px; font-size: 13px; cursor: pointer; display: flex; justify-content: space-between; border-bottom: 1px solid #f0f2f4; }
.group-list li:hover { background: #f5f8fc; }
.group-list li.active { background: var(--teal-50); color: var(--teal-700); font-weight: 700; box-shadow: inset 3px 0 0 var(--teal); }
.browse-main { max-height: 620px; overflow: auto; border: 1px solid var(--border); border-radius: 10px; }
.browse-main tbody tr { cursor: default; }
.qty-add { display: inline-flex; gap: 6px; align-items: center; }
.qty-add input { width: 60px !important; padding: 5px 6px !important; text-align: right; }
.oneoff-form { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; padding: 14px; background: #f8fafb; border-radius: 10px; }
.oneoff-form .field.grow { flex: 1; min-width: 220px; }

/* Schedule tab + admin */
a.sched-job { display: block; color: var(--text); border-left: 3px solid var(--teal); }
a.sched-job:hover { text-decoration: none; }
a.sched-job.unscheduled { border-left-color: #e0b24a; background: #fffaf0; }
.staff-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; }
.muted-row td { opacity: .55; }
.script-list li { padding: 6px 0; }

.saved-flash { position: fixed; top: 64px; right: 24px; background: #2f8d4e; color: white; padding: 6px 12px; border-radius: 20px; font-size: 12px; font-weight: 700; opacity: 0; transition: opacity .2s; z-index: 70; pointer-events: none; }
.saved-flash.show { opacity: 1; }
.modal { width: 480px; border-radius: 14px; box-shadow: var(--shadow-lg); }
.modal .typeahead input { margin-top: 0; }
.modal .ta-list { position: static; margin-top: 4px; box-shadow: none; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0 12px; }
.toast { border-radius: 10px; box-shadow: var(--shadow-lg); font-weight: 600; }

@media (max-width: 1200px) {
  .summary-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .summary-grid .activity { grid-column: span 2; }
  .form-grid.cols-6 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .job-strip { grid-template-columns: 1fr 1fr 1fr; }
}
@media (max-width: 1000px) {
  .nj-grid { grid-template-columns: 1fr; }
  .forms-top, .email-grid { grid-template-columns: 1fr; }
  .form-preview { grid-column: auto; grid-row: auto; }
}
@media (max-width: 780px) {
  .sidebar { width: 100%; height: auto; position: static; }
  .sidebar .tab-btn { width: 58px; height: 50px; flex-shrink: 0; }
  .topbar { position: static; }
  .job-top, .action-row.sticky { position: static; }
  .module-tabs, .primary-tabs { padding: 10px 14px 0; }
  #tab-jobs .status-tabs, .secondary-tabs, .job-strip, .stage-bar { margin: 0 14px; overflow-x: auto; flex-wrap: nowrap; }
  .job-strip { grid-template-columns: 1fr; }
  .job-body { padding: 14px; }
  .summary-grid, .form-grid, .form-grid.cols-6, .browse { grid-template-columns: 1fr; }
  .summary-grid .activity, .form-grid .span2, .form-grid .span3 { grid-column: auto; }
  .filter-bar select, .searchbox { width: 100% !important; flex: 1 1 100%; }
  .add-part { width: 100%; }
  .totals-box { width: 100%; }
}
[hidden] { display: none !important; }
.status-cell { display: table-cell; min-width: 200px; }
.status-cell .sc { display: flex; align-items: center; gap: 8px; }
#tab-jobs input:not([type=checkbox]):not([type=radio]):not([type=color]):disabled { background: #f3f5f7; color: #7d8a94; }
button.icon-btn, button.icon-btn.danger { background: transparent; }
button.icon-btn.danger { color: var(--red); }
button.icon-btn.danger:hover { background: #fdecec; }
button.link-btn, button.link-btn.danger { background: none; padding: 0; }
.mini-title span { text-transform: none; letter-spacing: 0; font-weight: 400; margin-left: 6px; }
table.plain-kv { width: auto; }
#tab-admin .card h3 { margin-top: 0; }
.email-grid > div > label { font-size: 12px; font-weight: 700; color: #3b4650; }
@media (max-width: 780px) {
  .topbar { flex-wrap: nowrap; }
  .topbar .brand-logo { height: 22px; }
  #who-name { display: none; }
  .jobs-table thead { display: none; }
  .jobs-table, .jobs-table tbody { display: block; }
  .jobs-table tr { display: grid; grid-template-columns: 28px 1fr 1fr; gap: 2px 10px; padding: 12px 14px; border-bottom: 1px solid var(--border); }
  .jobs-table td { border: none; padding: 2px 0; font-size: 13px; }
  .jobs-table td.cb { grid-row: span 6; }
  .jobs-table td[data-l]::before { content: attr(data-l); display: block; font-size: 10px; text-transform: uppercase; color: var(--muted); font-weight: 700; letter-spacing: .04em; }
  .jobs-table td.job-cell { grid-column: 2 / span 2; order: -1; font-size: 15px; }
  .jobs-table td.job-cell::before { display: none; }
  .jobs-table td.status-cell { grid-column: 2 / span 2; min-width: 0; }
  .jobs-table td.num { text-align: left !important; }
  .jobs-table td:last-child { grid-column: 2 / span 2; }
  .jobs-table td.empty-state { grid-column: 1 / -1; }
  .stages .stage { font-size: 11px; padding: 4px 12px 4px 18px; }
}
.admin-only { display: none !important; }
body.is-admin .admin-only { display: flex !important; }
.rates-body { max-width: 1200px; }
.add-box { background: var(--teal-50); border: 1px solid var(--teal-100); border-radius: 10px; padding: 12px 14px; margin: 0 0 14px; }
.contract-cell { min-width: 260px; }
.contract-cell .chip { margin: 2px 4px 2px 0; }
.typeahead.assign { margin-top: 4px; max-width: 220px; }
.typeahead.assign input { padding: 5px 8px !important; font-size: 12px !important; }
#tab-rates input:not([type=checkbox]) { width: 100%; padding: 7px 9px; border: 1px solid var(--border); border-radius: 8px; font: inherit; font-size: 13px; }
#tab-rates .money-in input { width: 92px; text-align: right; }
input.adjusted { border-color: #e0b24a !important; background: #fffaf0 !important; }
.adj-note { color: var(--amber); margin-top: 2px; }
.mail-body { white-space: pre-wrap; font-size: 12px; background: #f6f8f9; padding: 8px; border-radius: 6px; margin: 6px 0 0; }

/* v0.4 — Nova Pro login in Nova blue (sampled from the logo) so it can't be
   mistaken for the other Nova portal, and the full (uncropped) logo. */
#login-screen {
  background:
    radial-gradient(1200px 600px at 85% 110%, rgba(90,174,230,.45), transparent 60%),
    linear-gradient(135deg, #0b1f3f 0%, #143a72 50%, #2b64b0 100%);
}
.login-box { border-top: 5px solid #3d86d0; }
.login-box .login-logo { max-width: 240px; margin-bottom: 10px; }
.login-product {
  text-align: center; font-size: 12px; font-weight: 800; letter-spacing: .32em;
  color: #2b64b0; margin: 0 0 20px;
}
.login-product b { background: #2b64b0; color: white; padding: 2px 6px 2px 8px; border-radius: 4px; letter-spacing: .28em; }
.login-box button[type=submit] { background: #2b64b0; border-color: #2b64b0; color: white; }
.login-box button[type=submit]:hover { background: #1f4f94; }
.login-box input:focus { outline: none; border-color: #3d86d0; box-shadow: 0 0 0 3px rgba(61,134,208,.18); }
.login-version { font-weight: 600; color: #2b64b0; }
.topbar .brand-logo { height: 34px; width: auto; }
.topbar .brand-tag { font-size: 10px; font-weight: 800; letter-spacing: .2em; color: white; background: #2b64b0; padding: 3px 6px; border-radius: 4px; }
@media (max-width: 780px) { .topbar .brand-logo { height: 26px; } .topbar .brand-tag { display: none; } }

/* Send a test (Forms > Email) */
.test-send { margin-top: 18px; padding: 14px 16px; border: 1px dashed #9cc0e6; background: #f3f8fd; border-radius: 10px; }
.test-send .ts-title { display: flex; align-items: center; gap: 6px; font-weight: 700; color: #1f4f94; font-size: 13px; }
.test-send p { margin: 6px 0 10px; }
.ts-picks { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.chip-btn { border: 1px solid #bcd3ee; background: white; color: #1f4f94; border-radius: 999px; padding: 4px 11px; font-size: 12px; font-weight: 600; cursor: pointer; }
.chip-btn:hover { background: #e8f1fb; }
.chip-btn.on { background: #2b64b0; border-color: #2b64b0; color: white; }
.ts-row { display: flex; gap: 8px; }
.ts-row input { flex: 1; min-width: 0; }
.staff-email { width: 100%; font-size: 12px; padding: 4px 6px; margin-top: 3px; }
.sidebar .logo-dot { background: transparent; padding: 0; border-radius: 0; width: 40px; height: 40px; box-shadow: none; overflow: visible; }

/* Next / Back walk-through on a job */
.walk-bar { position: sticky; bottom: 0; z-index: 15; display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  background: white; border-top: 1px solid var(--border); box-shadow: 0 -4px 14px rgba(16,24,40,.06); padding: 10px 24px; margin-top: 18px; }
.walk-steps { display: flex; gap: 6px; flex-wrap: wrap; flex: 1; min-width: 0; }
.walk-step { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); padding: 4px 10px 4px 4px; border-radius: 999px; background: #f3f6fa; }
.walk-step b { width: 20px; height: 20px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: white; border: 1px solid var(--border); font-size: 11px; }
.walk-step.done { color: var(--blue-dark); }
.walk-step.done b { background: #d6e5f6; border-color: #d6e5f6; }
.walk-step.on { background: var(--blue); color: white; font-weight: 700; }
.walk-step.on b { background: white; color: var(--blue); border-color: white; }
.walk-btns { display: flex; gap: 8px; margin-left: auto; }
.finish-opts { display: grid; gap: 8px; margin: 12px 0 4px; }
.modal label.finish-opt { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; margin: 0; border: 1px solid var(--border); border-radius: 10px; cursor: pointer; text-transform: none; letter-spacing: 0; font-weight: 400; color: var(--text); font-size: 14px; }
.modal label.finish-opt:has(input:checked) { border-color: var(--blue); background: #eef4fb; }
.modal .finish-opt input { display: inline-block; margin: 3px 0 0; width: auto; flex-shrink: 0; }
.modal .finish-opt span { display: flex; flex-direction: column; gap: 3px; text-transform: none; letter-spacing: 0; }
.modal .finish-opt strong { font-size: 14px; color: var(--text); }
.modal .finish-opt .muted { font-weight: 400; font-size: 12.5px; }
.card.invoice-made { display: flex; gap: 10px; align-items: flex-start; background: #eaf6ee; border-color: #bfe3cb; color: #1d5c34; }
@media (max-width: 780px) { .walk-bar { padding: 10px 12px; } .walk-steps { display: none; } .walk-btns { width: 100%; justify-content: space-between; } }
.info-banner.testing-banner { background: #fff7e0; border-color: #f0d58a; color: #6b5300; }

/* ---------- v0.5: My Jobs (phone) + Expenses ---------- */
.fx { max-width: 640px; margin: 0 auto; padding: 18px 16px 90px; }
.fx.fx-wide { max-width: 1200px; }
.fx-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.fx-head h2 { margin: 0; }
.fx-snap { padding: 11px 16px; font-size: 14px; }
.fx-sec { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 20px 2px 8px; }
.fx-empty { margin: 4px 2px; }
.fx-alert { display: flex; gap: 8px; align-items: center; background: #fff7e0; border: 1px solid #f0d58a; color: #6b5300; border-radius: 10px; padding: 10px 12px; font-size: 13px; text-decoration: none; margin-bottom: 6px; }
.fx-job { display: block; background: white; border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; margin-bottom: 10px; color: var(--text); text-decoration: none; box-shadow: var(--shadow-sm); }
.fx-job:active { background: #f3f6fa; }
.fx-job-top { display: flex; align-items: center; gap: 8px; font-size: 12px; margin-bottom: 4px; }
.fx-time { background: var(--blue); color: white; border-radius: 6px; padding: 2px 7px; font-weight: 700; }
.fx-no { color: var(--muted); font-weight: 700; }
.fx-job-top .badge { margin-left: auto; }
.fx-job-name { font-weight: 700; font-size: 15px; margin-bottom: 2px; }
.fx-addr { display: flex; gap: 5px; align-items: flex-start; margin-top: 5px; color: #3b4650; }
.fx-addr svg { flex-shrink: 0; margin-top: 1px; width: 15px; height: 15px; }
.fx-back { display: inline-block; margin: 0 0 10px; font-weight: 600; }
.fx-card { background: white; border: 1px solid var(--border); border-radius: 12px; padding: 14px; margin-bottom: 12px; box-shadow: var(--shadow-sm); }
.fx-card h3 { margin: 0 0 10px; font-size: 15px; }
.fx-card > summary { font-weight: 700; cursor: pointer; }
.fx-title h2 { margin: 4px 0 4px; font-size: 19px; }
.fx-when { margin-top: 8px; display: flex; gap: 6px; align-items: center; color: var(--blue-dark); font-weight: 600; }
.fx-when svg { width: 16px; height: 16px; }
.fx-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.fx-actions .btn { text-decoration: none; }
.fx-desc { margin-top: 10px; font-size: 14px; }
.fx-card textarea, .fx-card input { width: 100%; border: 1px solid var(--border); border-radius: 8px; padding: 10px; font: inherit; font-size: 15px; }
.fx-row-end { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 8px; flex-wrap: wrap; }
.fx-lines { list-style: none; margin: 0 0 10px; padding: 0; }
.fx-lines li { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid #eef1f4; font-size: 14px; }
.fx-qty { font-weight: 700; white-space: nowrap; }
.fx-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.fx-btns .btn { flex: 1; justify-content: center; }
.fx-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(86px, 1fr)); gap: 8px; }
.fx-photo { aspect-ratio: 1; border-radius: 10px; border: 1px solid var(--border); background: #eef1f4 center/cover no-repeat; cursor: pointer; padding: 0; }
.fx-photo.add { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: var(--blue); background: #f3f8fd; border: 1px dashed #9cc0e6; font-size: 12px; font-weight: 700; }
.fx-sig { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; }
.fx-sig img { max-width: 100%; border: 1px solid var(--border); border-radius: 8px; background: white; }
.fx-finish { text-align: center; margin-top: 18px; }
.btn.big { width: 100%; justify-content: center; padding: 15px; font-size: 16px; }
.warn-text { color: #9a5b00; }
.fx-modal h3 { margin-top: 0; }
.rc-preview { background: #f3f6fa; border-radius: 10px; padding: 8px; text-align: center; margin-bottom: 10px; }
.rc-preview img { max-width: 100%; max-height: 42vh; border-radius: 6px; }
.rc-preview.small img { max-height: 150px; }
.rc-preview.small { display: flex; align-items: center; justify-content: center; gap: 12px; }
.rc-reading { display: flex; align-items: center; gap: 10px; color: var(--muted); padding: 8px 0; }
.spinner { width: 18px; height: 18px; border: 2.5px solid #d6e5f6; border-top-color: var(--blue); border-radius: 50%; animation: spin .8s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
.rc-note { display: flex; gap: 6px; align-items: center; margin: 0 0 10px; }
.rc-sugg { margin-bottom: 12px; }
.rc-sugg-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin-bottom: 6px; }
.rc-job { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; width: 100%; text-align: left; background: white; border: 1px solid var(--border); border-radius: 10px; padding: 9px 12px; margin-bottom: 6px; cursor: pointer; font: inherit; color: var(--text); }
.rc-job.on { border-color: var(--blue); background: #eef4fb; box-shadow: inset 3px 0 0 var(--blue); }
.rc-why { font-size: 11.5px; color: var(--blue-dark); }
.fx-form .fx-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.modal .fx-form label.check { text-transform: none; letter-spacing: 0; font-size: 13px; color: var(--text); display: flex; gap: 8px; align-items: center; }
.modal .fx-form label.check input { width: auto; margin: 0; }
.seg { display: flex; border: 1px solid var(--border); border-radius: 9px; overflow: hidden; margin: 0 0 14px; }
.seg button { flex: 1; background: white; border: 0; padding: 10px 8px; font: inherit; font-size: 13px; font-weight: 600; color: #3b4650; cursor: pointer; }
.seg button + button { border-left: 1px solid var(--border); }
.seg button.on { background: var(--blue); color: white; }
.fp-res { max-height: 45vh; overflow-y: auto; margin-top: 10px; }
.fp-item { display: flex; flex-direction: column; align-items: flex-start; width: 100%; text-align: left; background: white; border: 0; border-bottom: 1px solid #eef1f4; padding: 10px 4px; cursor: pointer; font: inherit; color: var(--text); }
.fp-pick { display: grid; gap: 10px; padding: 6px 0; }
.sg-pad { position: relative; border: 1px dashed #9cc0e6; border-radius: 10px; overflow: hidden; background: white; touch-action: none; }
.sg-pad canvas { display: block; touch-action: none; }
.sg-pad #sg-clear { position: absolute; right: 8px; top: 6px; }
.ex-cards { display: grid; gap: 8px; margin-bottom: 10px; }
.ex-card { display: flex; gap: 12px; align-items: center; width: 100%; text-align: left; background: white; border: 1px solid var(--border); border-radius: 12px; padding: 10px; cursor: pointer; font: inherit; color: var(--text); }
.ex-thumb { width: 52px; height: 52px; flex-shrink: 0; border-radius: 8px; background: #eef1f4 center/cover no-repeat; display: flex; align-items: center; justify-content: center; color: var(--muted); }
.ex-thumb.sm { width: 34px; height: 34px; cursor: zoom-in; }
.ex-main { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.ex-main strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ex-side { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.ex-filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 10px; }
.ex-filters select { padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; background: white; }
.ex-totals { display: flex; flex-wrap: wrap; gap: 18px; align-items: center; margin: 4px 2px 12px; font-size: 14px; }
.ex-table td { vertical-align: middle; }
.badge.draft { background: #eef1f4; color: #52606b; }
.badge.submitted { background: #e8f1fb; color: #1f4f94; }
.badge.rejected { background: #fdecec; color: #b3261e; }
.card-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
@media (max-width: 780px) {
  .sidebar .logo-dot { order: -2; }
  .sidebar .phone-first { order: -1; }
  .fx { padding: 14px 12px 90px; }
  .fx-form .fx-row2 { grid-template-columns: 1fr; gap: 0; }
  .modal-content, .modal { max-height: 92vh; overflow-y: auto; }
}
.fx-card input[type=checkbox] { width: auto; padding: 0; margin: 0; }
.fx-row-end .check { display: flex; gap: 8px; align-items: center; }
.fx-job:hover, .fx-alert:hover, .fx-back:hover, .fx-actions .btn:hover { text-decoration: none; }
.rc-job:hover, .ex-card:hover, .fp-item:hover { background: #f3f8fd; color: var(--text); }
.rc-job.on:hover { background: #eef4fb; }
.fx-photo:hover { background-color: #e6ecf3; }
.fx-photo.add:hover { background: #e8f1fb; color: var(--blue); }
.seg button:hover { background: #f3f8fd; color: #3b4650; }
.seg button.on:hover { background: var(--blue-dark); color: white; }
.chip-btn:hover { color: #1f4f94; }

/* Simpro-style Pre-Builds / Catalogue browse */
.sp-search { display: flex; gap: 8px; max-width: 620px; margin: 6px 0 16px; }
.sp-search .searchbox { flex: 1; }
.sp-sub { margin: 4px 0 8px; font-size: 15px; }
.sp-groups tbody tr { cursor: pointer; }
.sp-groups tbody tr:hover td { background: #f3f8fd; }
.sp-crumb { margin: 2px 0 10px; font-size: 14px; }
.sp-items .qa-qty { width: 70px; text-align: right; padding: 6px 8px; border: 1px solid var(--border); border-radius: 6px; }

/* Recurring jobs */
.rf-modal { min-width: min(620px, 86vw); }
.modal:has(.rf-modal) { width: 680px; }
.rf-techs { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 4px 0 14px; }
.modal .rf-techs label.check, .modal .rf-modal label.check { display: flex; align-items: center; gap: 6px; text-transform: none; letter-spacing: 0; font-weight: 500; color: var(--text); font-size: 13px; margin: 0; }
.modal .rf-techs input, .modal .rf-modal label.check input { width: auto; margin: 0; display: inline-block; }
.rf-hint { display: block; padding-top: 16px; text-transform: none; letter-spacing: 0; font-weight: 500; }
.sp-items input.qa-qty { width: 72px !important; display: inline-block; }
.menu-btn { white-space: nowrap; }

/* Staff expenses v2 */
.fx-head-btns { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.ex-range { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.ex-range select, .ex-range input { padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; background: white; font: inherit; }
.ex-range-label { min-width: 230px; text-align: center; }
.btn.icon-only { padding: 7px 9px; }
.ex-people-head { display: flex; align-items: baseline; gap: 12px; margin: 4px 0 6px; }
.ex-people { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.ex-person { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; background: white; border: 1px solid var(--border); border-radius: 10px; padding: 9px 12px; cursor: pointer; font: inherit; color: var(--text); text-align: left; min-width: 170px; }
.ex-person:hover { background: #f3f8fd; color: var(--text); }
.ex-person.on { border-color: var(--blue); box-shadow: inset 0 0 0 1px var(--blue); background: #eef4fb; }
.ex-person span { font-size: 12px; color: var(--muted); }
.ex-person .owe { color: #9a5b00; font-weight: 700; }
.ex-person .wait { color: var(--blue-dark); font-weight: 600; }
.ex-bulk { display: flex; align-items: center; gap: 8px; padding: 10px 14px; background: #eef4fb; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.ex-bulk[hidden] { display: none; }
.badge.ex-draft { background: #eef1f4; color: #52606b; }
.badge.ex-submitted { background: #fff3d6; color: #8a5a00; }
.badge.ex-approved { background: #e8f1fb; color: #1f4f94; }
.badge.ex-reimbursed { background: #dcf3e6; color: #1a7f4e; }
.badge.ex-rejected { background: #fdecec; color: #b3261e; }
.ex-thumb.is-pdf { background: #fdecec; color: #b3261e; font-weight: 800; font-size: 11px; }
.rc-choose { display: grid; gap: 10px; margin: 6px 0 4px; }
.rc-choice { display: grid; grid-template-columns: 34px 1fr; grid-template-rows: auto auto; column-gap: 10px; align-items: center; text-align: left; background: white; border: 1px solid var(--border); border-radius: 12px; padding: 14px; cursor: pointer; font: inherit; color: var(--text); }
.rc-choice:hover { background: #f3f8fd; color: var(--text); border-color: #9cc0e6; }
.rc-choice svg { grid-row: span 2; width: 26px; height: 26px; color: var(--blue); }
.rc-pdf { display: flex; align-items: center; gap: 8px; padding: 14px; justify-content: center; }
.badge.ex-company_card { background: #eef1f4; color: #3b4650; }
.badge.ex-disputed { background: #fde2e1; color: #9b2c2c; }
.rc-paid-hint { margin: -8px 0 12px; }

/* customer own labour prices + Simpro import */
.ov-box{border:1px solid var(--line,#dde3ec);border-radius:8px;padding:10px 12px;margin:10px 0}
.ov-table td{padding:4px 6px;vertical-align:middle}
.ov-box .inline-add{display:flex;gap:8px;align-items:center;flex-wrap:wrap;margin-top:6px}
.imp-row{display:flex;gap:16px;align-items:center;flex-wrap:wrap;margin:8px 0}
.imp-sec{padding:6px 0;border-bottom:1px solid var(--line,#eef1f5)}

/* Simpro-style Service Dashboard */
.dash-cards{display:block}
.dash-welcome{background:var(--blue,#2b64b0);color:#fff;padding:10px 16px;border-radius:8px;font-weight:600;margin-bottom:14px}
.dash-welcome span{font-weight:400;opacity:.85;font-size:13px}
.dash-top{display:grid;grid-template-columns:repeat(auto-fit,minmax(260px,1fr));gap:14px;margin-bottom:14px}
.dash-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(380px,1fr));gap:14px}
.dash-box{background:#fff;border:1px solid var(--line,#dde3ec);border-radius:10px;padding:12px 14px;min-width:0}
.dash-box h3{font-size:15px;margin:0 0 8px}
.dash-flag{display:inline-block;color:#fff;font-weight:600;font-size:13px;padding:4px 14px 4px 10px;margin:-2px 0 10px -14px;clip-path:polygon(0 0,100% 0,92% 100%,0 100%)}
.dash-flag.red{background:#c0392b}.dash-flag.orange{background:#e67e22}.dash-flag.blue{background:#2b64b0}
.alert-row{display:flex;justify-content:space-between;align-items:center;padding:5px 0;color:inherit;text-decoration:none;border-bottom:1px solid #f0f2f5}
.alert-row:hover{color:var(--blue,#2b64b0)}
.alert-n{background:#c0392b;color:#fff;border-radius:999px;min-width:24px;text-align:center;font-size:12px;font-weight:700;padding:2px 7px}
.alert-n.zero{background:#cfd6de}
.dash-number{font-size:28px;font-weight:700;margin:4px 0}
.dash-table td{padding:6px 8px;vertical-align:top}
.dash-table tr[data-href]{cursor:pointer}
.dash-table tr[data-href]:hover{background:#f5f8fc}
/* Schedule tab on jobs and quotes (Simpro layout) */
.sched-tab{display:grid;grid-template-columns:300px 1fr;gap:16px;align-items:start}
@media (max-width:900px){.sched-tab{grid-template-columns:1fr}}
.sched-add{display:flex;flex-wrap:wrap;gap:10px;align-items:flex-end;margin:6px 0 8px}
.sched-add .field{display:flex;flex-direction:column;gap:3px;font-size:12px}
.info-banner.slim{margin:8px 0 0;padding:6px 12px;font-size:13px}
.secondary-tabs.empty{display:none}
.info-banner.slim{margin:0 0 8px;border-radius:6px}
.status-pick select{max-width:230px;text-overflow:ellipsis}
.dash-table{table-layout:auto;width:100%}
.dash-table td{word-break:break-word}

/* ---------------------------------------------------------- invoices (Simpro layout) -- */
.inv-card { padding: 20px 24px; }
.iv-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.iv-head h2, .iv-head h3 { margin: 0; }
.money-pill { background: var(--blue); color: #fff; border-radius: 999px; padding: 8px 16px; font-weight: 600; font-size: 15px; white-space: nowrap; }
.money-pill.red { background: var(--red); }
.money-pill.green { background: var(--green); }
.iv-company { font-size: 16px; font-weight: 600; margin: 6px 0 14px; }
.iv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px 20px; padding: 12px 0; }
.iv-grid.divider, .iv-comment, .iv-site { border-top: 1px solid var(--border); }
.iv-kv .k, .iv-comment .k { font-weight: 600; font-size: 13px; margin-bottom: 4px; }
.iv-kv .v { font-size: 14px; }
.iv-comment { padding: 12px 0; }
.iv-site { padding-top: 14px; font-size: 15px; }
.iv-cc { margin: 18px 0 6px; font-size: 16px; }
.iv-totals { margin: 16px 0 0 auto; min-width: 280px; }
table.data.compact td, table.data.compact th { padding: 7px 10px; }
.inv-table tr.row-overdue td:first-child { box-shadow: inset 3px 0 0 var(--red); }
.kv-table { width: 100%; border-collapse: collapse; margin-bottom: 12px; }
.kv-table td { padding: 6px 4px; border-bottom: 1px solid var(--border); }
.kv-table td:first-child { color: var(--muted); width: 40%; }
.forms-list .form-row { display: flex; align-items: center; gap: 8px; padding: 10px 0; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.ageing { margin-top: 18px; }
.ap-alloc { width: 110px; text-align: right; }
@media (max-width: 780px) {
  .inv-card { padding: 14px; }
  .iv-totals { min-width: 0; width: 100%; }
}
@media print {
  .no-print, .sidebar, .topbar, nav { display: none !important; }
  .statement { box-shadow: none; border: 0; }
}
.inv-table td[data-l="Job Name"], .inv-table td[data-l="Customer"] { min-width: 170px; }
.inv-table td[data-l="Site"] { min-width: 130px; }
.inv-card label { display: flex; flex-direction: column; gap: 5px; font-weight: 600; font-size: 13px; margin-bottom: 12px; }
.inv-card input:not([type=checkbox]), .inv-card select, .inv-card textarea { padding: 8px 10px; border: 1px solid var(--border); border-radius: 6px; font: inherit; font-weight: 400; background: #fff; }
.inv-card input.ap-alloc { padding: 5px 8px; }
.inv-card .form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0 16px; }
.inv-card h3 { margin: 18px 0 8px; }
.statement .iv-company + .muted { margin-bottom: 16px; }
@media (max-width: 780px) {
  #tab-invoices .primary-tabs { overflow-x: auto; flex-wrap: nowrap; max-width: 100vw; }
  #tab-invoices .iv-grid { grid-template-columns: 1fr 1fr; }
  #tab-invoices .job-top { flex-wrap: wrap; }
}
.yn { display: flex; gap: 18px; margin: 4px 0 12px; }
.yn label { display: flex; align-items: center; gap: 6px; font-weight: 400; }

/* ---------------------------------------------------------- customer assets / planner / KB -- */
.due-chip { display: inline-block; font-size: 12px; padding: 2px 7px; border-radius: 999px; background: #eef2f6; color: #3b4650; white-space: nowrap; margin: 1px 0; }
.due-chip.due-over { background: #fde8e7; color: var(--red); }
.due-chip.due-soon { background: #fff4df; color: var(--amber); }
.due-chip.due-ok { background: #e6f4ec; color: var(--green); }
tr.click { cursor: pointer; }
.asset-table td { vertical-align: top; }
.mp-filters { flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.mp-filters label { display: flex; flex-direction: column; font-size: 12px; font-weight: 600; gap: 3px; }
.mp-filters label.inline { flex-direction: row; align-items: center; gap: 6px; font-weight: 400; font-size: 13px; }
.mp-filters input, .mp-filters select { padding: 7px 9px; border: 1px solid var(--border); border-radius: 6px; font: inherit; }
.mp-site { border-top: 1px solid var(--border); padding: 12px 16px; }
.mp-head { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.ja-card { margin-bottom: 16px; }
.ja-card .card-title-row { display: flex; align-items: center; gap: 10px; padding: 12px 16px; flex-wrap: wrap; }
.ja-table input.ja-notes { width: 100%; min-width: 140px; }
.ja-table input.ja-ref { width: 110px; }
.ja-table input, .ja-table select { padding: 5px 7px; border: 1px solid var(--border); border-radius: 6px; font: inherit; }
.lvl { display: block; font-size: 13px; white-space: nowrap; }
.res { font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: #eef2f6; }
.res-pass, .res-repaired { background: #e6f4ec; color: var(--green); }
.res-fail, .res-removed-from-service { background: #fde8e7; color: var(--red); }
.kb-drop { margin: 10px 16px; border: 2px dashed var(--border); border-radius: 10px; padding: 16px; text-align: center; color: var(--muted); }
.kb-drop.over { border-color: var(--blue); background: var(--teal-light); }
.kb-folder { margin: 16px 16px 6px; font-size: 15px; }

/* ---------------------------------------------------------- history -- */
.hi-wrap { display: grid; grid-template-columns: 300px 1fr; gap: 16px; padding: 0 24px 24px; align-items: start; }
.hi-left { position: sticky; top: 12px; padding: 10px; max-height: calc(100vh - 140px); display: flex; flex-direction: column; }
.hi-left .searchbox { margin-bottom: 8px; }
.hi-left .searchbox input { width: 100%; }
.hi-list { overflow-y: auto; }
.hi-cust { display: block; padding: 9px 10px; border-radius: 8px; text-decoration: none; color: inherit; border-bottom: 1px solid var(--border); }
.hi-cust:hover { background: var(--teal-light); }
.hi-cust.on { background: var(--blue); color: #fff; }
.hi-cust .n { display: block; font-weight: 600; font-size: 14px; }
.hi-cust .m { display: block; font-size: 12px; opacity: .75; }
.hi-card { padding: 18px 20px; }
.hi-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 12px 0; }
.hi-stats div { background: var(--bg); border-radius: 10px; padding: 10px 12px; }
.hi-stats b { display: block; font-size: 18px; }
.hi-stats span { font-size: 12px; color: var(--muted); }
.hi-stats .owing b { color: var(--red); }
.hi-filters { gap: 8px; flex-wrap: wrap; padding: 0 0 10px; }
.hi-filters select, .hi-filters input { padding: 7px 9px; border: 1px solid var(--border); border-radius: 6px; font: inherit; }
.hi-filters input { min-width: 240px; }
.hi-empty { text-align: center; color: var(--muted); padding: 80px 20px; }
.hi-empty svg { width: 36px; height: 36px; }
.tag-simpro { font-size: 10px; background: #eef2f6; color: var(--muted); border-radius: 4px; padding: 1px 5px; vertical-align: middle; }
.inv-chip { font-size: 12px; padding: 2px 7px; border-radius: 999px; text-decoration: none; }
.inv-chip.paid { background: #e6f4ec; color: var(--green); }
.inv-chip.unpaid { background: #fde8e7; color: var(--red); }
@media (max-width: 900px) {
  .hi-wrap { grid-template-columns: 1fr; padding: 0 12px 16px; }
  .hi-left { position: static; max-height: 260px; }
  .hi-stats { grid-template-columns: 1fr 1fr; }
}
.np-scan-row { display: flex; align-items: center; gap: 10px; background: var(--teal-light); border-radius: 8px; padding: 8px 10px; margin: 6px 0 12px; flex-wrap: wrap; }
.card > .card-title-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.card > .card-title-row .btn { margin-left: 4px; }
.modal label.mcheck { display: flex; flex-direction: row; align-items: center; gap: 8px; text-transform: none; letter-spacing: 0; font-size: 14px; font-weight: 500; color: var(--text); margin: 6px 0; }
.modal label.mcheck input[type=checkbox] { width: auto; margin: 0; display: inline-block; }
.modal label.mcheck input[type=number] { padding: 5px 8px; display: inline-block; margin: 0; }

/* ---------------------------------------------------------- calibration -- */
.cal-table tr.cal-oos td { opacity: .6; }
.cal-upload { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.cal-upload label:first-child { margin-bottom: 0; }
.cal-upload .btn { margin-bottom: 0; }

/* ---------------------------------------------------------- dashboard: to book / calibration -- */
.dash-wide { grid-column: 1 / -1; }
.dash-box h3 { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.dash-filter { margin-left: auto; font-weight: 400; }
.tb-table tr.tb-over td { background: #fdecea; }
.tb-table tr.tb-over td:first-child { box-shadow: inset 3px 0 0 var(--red); }
.tb-table tr.tb-booked td { color: var(--muted); }
.tb-sel { padding: 4px 6px; border: 1px solid var(--border); border-radius: 6px; font: inherit; font-size: 13px; }
.rp-filters { flex-wrap: wrap; gap: 8px; align-items: flex-end; padding: 0 0 10px; }
.rp-filters label { display: flex; flex-direction: column; font-size: 12px; font-weight: 600; gap: 3px; margin: 0; }
.rp-filters label.inline { flex-direction: row; align-items: center; font-weight: 400; }
.rp-filters input, .rp-filters select { padding: 7px 9px; border: 1px solid var(--border); border-radius: 6px; font: inherit; }
.ok-text { color: var(--green); }
.ex-areas { margin: 4px 0 10px; }
.ex-flag { color: var(--amber); display: inline-flex; vertical-align: -3px; }
.ex-flagbar { display: flex; gap: 16px; flex-wrap: wrap; background: #fff4df; color: #7a4a00; border-radius: 8px; padding: 8px 12px; margin: 8px 0; font-size: 13px; }
.ex-flagbar span { display: inline-flex; align-items: center; gap: 6px; }

/* Employees: training certificates */
.st-add { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; align-items: end; margin-bottom: 6px; }
.st-add .btn { height: 38px; }
.btn.danger-text { color: var(--red); }

/* Forgot password link + staff login status */
.login-forgot { text-align: center; margin: 4px 0 0; font-size: 13px; }
.login-chip { display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 20px; white-space: nowrap; }
.login-chip.on { background: #dcf3e6; color: #1a7f4e; }
.login-chip.invited { background: #fdecc8; color: #8a5a00; }
.login-chip.none { background: #eef1f4; color: #52606b; }

/* Two factor sign in */
.mfa-form label { display: block; margin-bottom: 14px; font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.mfa-form input { display: block; width: 100%; margin-top: 6px; padding: 11px 12px; border: 1px solid var(--border); border-radius: 6px; font-size: 18px; letter-spacing: .2em; }
.mfa-form button, #mfa-saved { width: 100%; padding: 12px; font-size: 14px; letter-spacing: .04em; text-transform: uppercase; }
.mfa-steps { padding-left: 18px; font-size: 13px; line-height: 1.5; margin: 0 0 10px; }
.mfa-qr { display: flex; justify-content: center; margin: 6px 0 8px; }
.mfa-qr svg { width: 190px; height: 190px; }
.mfa-key { word-break: break-all; text-align: center; }
.mfa-codes { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 12px 0 18px; }
.mfa-codes code { background: #f4f6f8; border: 1px solid var(--border); border-radius: 6px; padding: 8px; text-align: center; font-size: 14px; }
#mfa-step h1 { font-size: 18px; text-align: center; margin: 0 0 4px; }
.sec-events td { font-size: 12px; }
.sec-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.mfa-inline { max-width: 420px; padding: 18px; margin: 8px 0 14px; }

/* iPhone fixes (Henry's trial, 2 Nov). iOS zooms the page in when a box with
   text under 16px is tapped (e.g. the login fields), which left the right
   edge cut off. 16px on touch screens stops that; nothing can push the page
   wider than the screen. */
@media (pointer: coarse) {
  input, select, textarea { font-size: 16px !important; }
}
@media (max-width: 780px) {
  html, body { max-width: 100%; overflow-x: hidden; }
  .fx, .fx-card { min-width: 0; overflow-wrap: anywhere; }
  .fx img, .fx table, .fx pre { max-width: 100%; }
  .fx-head { flex-wrap: wrap; }
  .fx-job-top { flex-wrap: wrap; }
}
.fx-files { list-style: none; padding: 0; margin: 0 0 10px; }
.fx-files li { padding: 6px 0; border-bottom: 1px solid var(--border, #e3e8ee); }
.fx-files .linkish { background: none; border: 0; padding: 0; color: var(--blue, #2b64b0); text-align: left; font: inherit; cursor: pointer; }
.fx-finished summary { cursor: pointer; list-style: revert; }

/* customer signature on Finish */
.fx-sign { margin: 10px 0; }
.fx-pad { width: 100%; height: 160px; border: 1px solid var(--border); border-radius: 10px; background: #fff; touch-action: none; display: block; }
.fx-sign-row { display: flex; gap: 8px; margin-top: 8px; }
.fx-sign-row input { flex: 1; min-width: 0; }

.rc-check { display: inline-block; margin-left: 6px; padding: 0 6px; border-radius: 8px; background: #fff4e0; color: #8a5300; font-size: 11px; font-weight: 600; }
.fx-pending { margin: 6px 0 0; padding: 6px 10px; border-radius: 8px; background: #fff4e0; color: #8a5300; }

/* Insights (owners only) */
.owner-only { display: none !important; }
body.is-owner .owner-only { display: flex !important; }
.in-bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.in-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin-bottom: 18px; }
.in-card { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; }
.in-card .in-lab { color: var(--muted); font-size: 13px; }
.in-card .in-num { font-size: 26px; font-weight: 700; color: var(--text); margin-top: 4px; }
.in-card .in-sub { font-size: 13px; margin-top: 4px; }
.in-up { color: #1a7f4e; } .in-down { color: #b3261e; }
.in-panel { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; margin-bottom: 18px; overflow-x: auto; }
.in-panel h3 { margin: 0 0 10px; font-size: 16px; }
.in-chart { width: 100%; height: 220px; display: block; }
.in-chart text { font-size: 11px; fill: var(--muted); }
.in-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.in-table th { text-align: left; font-weight: 600; color: var(--muted); padding: 6px 8px; border-bottom: 1px solid var(--border); cursor: pointer; white-space: nowrap; }
.in-table td { padding: 7px 8px; border-bottom: 1px solid var(--line, #eef1f4); }
.in-table td.num, .in-table th.num { text-align: right; white-space: nowrap; }
.in-table tr.in-row { cursor: pointer; } .in-table tr.in-row:hover { background: #f6f8fb; }
.in-two { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 780px) { .in-two { grid-template-columns: 1fr; } }

/* New job on the phone (#/field/new) */
.fx-new .fx-lbl { display: block; font-weight: 600; font-size: 14px; margin: 12px 0 4px; }
.fx-new .fx-lbl input:not([type=checkbox]), .fx-new .fx-lbl select, .fx-new .fx-lbl textarea { display: block; width: 100%; min-width: 0; box-sizing: border-box; margin-top: 4px; font-size: 16px; font-weight: 400; }
.fx-new .fp-res { max-height: 40vh; margin-top: 0; border-radius: 8px; }
.fx-picked { margin-top: 6px; padding: 10px 12px; background: #eef5fc; border-radius: 8px; }
.fx-row3 { display: grid; grid-template-columns: minmax(0,1.4fr) minmax(0,1fr) minmax(0,1fr); gap: 8px; }
.fx-techs { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 6px; font-weight: 400; }
.fx-tech { display: flex; align-items: center; gap: 8px; font-size: 15px; min-width: 45%; }
.fx-tech input { width: 20px; height: 20px; margin: 0; }
.fx-wide { width: 100%; margin: 18px 0 8px; padding: 14px; font-size: 16px; }
.modal .fx-form #rc-jobq { margin-bottom: 6px; }
.modal-sub { font-size: 13px; font-weight: 600; margin: 14px 0 6px; padding-top: 10px; border-top: 1px solid var(--line, #e3e7ec); }
.fx-small { padding: 4px 10px; font-size: 13px; margin: 4px 0 8px; }
.fx-mynotes { list-style: none; padding: 0; margin: 6px 0; }
.fx-mynotes li { padding: 6px 0; border-bottom: 1px solid var(--line, #e3e7ec); }
/* dashboard wide lists (Ready to invoice, Accepted quotes) */
.dash-list th { font-size: 12px; text-transform: uppercase; letter-spacing: .03em; color: var(--muted, #667085); font-weight: 600; text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line, #dde3ec); }
.dash-list td { word-break: normal; overflow-wrap: anywhere; }
.dash-list .dl-name { min-width: 180px; }
.dash-list .dl-cust { min-width: 140px; color: var(--muted, #667085); }
.dash-list .dl-status { min-width: 160px; }
.dash-list .num { text-align: right; }
@media (max-width: 700px) { .dash-list .dl-cust, .dash-list .dl-status { display: none; } .dash-list th:nth-child(3), .dash-list th:nth-child(4) { display: none; } }
.fx-total { margin-left: auto; font-size: 14px; font-weight: 600; color: var(--blue-dark, #143a72); }
.fx-card h3 { display: flex; align-items: baseline; gap: 8px; }
.inv-ex { margin: 8px 0 12px; }
.inv-ex table { width: 100%; font-size: 13px; }
.inv-ex tr.ex-miss td { background: #fff4df; }
.modal:has(.inv-ex) { max-width: 820px; width: 94vw; }
.inv-ex th { font-size: 11px; }
.inv-ex td, .inv-ex th { padding: 5px 6px; vertical-align: top; }
.inv-ex label.check { text-transform: none; letter-spacing: 0; font-size: 14px; font-weight: 600; color: var(--ink, #1b2733); display: flex; gap: 8px; align-items: center; margin-top: 8px; }
.inv-ex label.check input { width: auto; }
.rc-noreceipt{display:flex;align-items:center;justify-content:space-between;gap:8px;flex-wrap:wrap;padding:8px 10px;border:1px dashed var(--line,#ccc);border-radius:8px;margin:4px 0}
.audit-table td{vertical-align:top}
.audit-table .audit-view td{color:var(--muted,#6b7280)}
.audit-table .audit-refused td{color:#b42318}
.audit-details details summary{cursor:pointer;color:var(--muted,#6b7280)}
.audit-details pre{white-space:pre-wrap;word-break:break-word;max-width:520px;font-size:12px;margin:6px 0 0}
.audit-filters{display:flex;flex-wrap:wrap;gap:8px;align-items:center;margin:8px 0 12px}
.audit-filters input,.audit-filters select{width:auto;min-width:120px}
.audit-filters label.check{width:auto;display:inline-flex;gap:6px;align-items:center;margin:0}

/* ---- Job / quote screens, Aleesha's design (Nov 2026): coloured cards, type
   badges, and anything missing (no technician, not scheduled, no fee, no price)
   stands out in amber so it isn't forgotten. ---- */
.job-top { align-items: flex-end; padding-top: 12px; }
.job-head { min-width: 0; }
.job-head .job-crumb { font-size: 12.5px; color: var(--muted); }
.job-head .job-crumb a { font-weight: 600; }
.job-head .job-crumb .sep { color: #a3adb8; }
.job-title-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 2px; }
.job-title { font-size: 21px; font-weight: 800; margin: 0; color: var(--navy); line-height: 1.25; }
.status-badge { display: inline-flex; align-items: center; gap: 7px; padding: 4px 12px; border-radius: 999px; font-size: 12px; font-weight: 700;
  color: #26323d; background: #eef1f4; background: color-mix(in srgb, var(--c, #9aa5ae) 16%, white); border: 1px solid color-mix(in srgb, var(--c, #9aa5ae) 35%, white); white-space: nowrap; }
.status-badge i { width: 8px; height: 8px; border-radius: 50%; background: var(--c, #9aa5ae); }
.status-badge.missing { --c: #b26a00; color: #8a5a00; }

.secondary-tabs { border-radius: 0 10px 0 0; padding: 10px 14px; gap: 4px; }
.secondary-tabs a { border-radius: 999px; padding: 7px 16px; }
.secondary-tabs a.active { background: var(--navy); color: white; }
.secondary-tabs a.active .pill { background: rgba(255,255,255,.25); color: white; }

.job-cards { display: grid; grid-template-columns: 1.25fr 1.25fr .9fr 1fr 1.2fr; gap: 12px; background: white; margin: 0 24px; padding: 14px 16px; border: 1px solid var(--border); border-top: none; }
.jc { border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; min-width: 0; background: #fbfcfd; }
.jc-k { font-size: 10.5px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.jc-v { font-weight: 700; font-size: 14.5px; line-height: 1.3; overflow-wrap: anywhere; }
.jc-v.plain { color: var(--text); }
.jc-total { font-size: 22px; font-weight: 800; color: var(--navy); line-height: 1.2; }
.jc-links { font-size: 12px; margin-top: 5px; color: var(--muted); }
.jc-links .change { font-size: 12px; cursor: pointer; text-decoration: underline; }
.jc-status .status-pick select { width: 100%; border-left: 4px solid var(--c, #9aa5ae); font-weight: 600; }
.stage-label { font-size: 10.5px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }

.flag-missing, .flag-ok { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 700; white-space: nowrap; }
.flag-missing { background: #fdecc8; color: #8a5a00; }
.flag-ok { background: #dcf3e6; color: var(--green); }
.flag-text { color: #8a5a00; font-weight: 700; }
.missing-box { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; background: #fff6e3; border: 1px solid #f3d9a4; border-radius: 10px; padding: 10px 12px; margin: 6px 0 10px; font-size: 13px; color: #6f4a00; }

.card-title.acc { position: relative; padding-left: 14px; }
.card-title.acc::before { content: ""; position: absolute; left: 0; top: 1px; bottom: 1px; width: 4px; border-radius: 3px; background: var(--blue); }
.card-title.acc-green::before { background: var(--green); }
.card-title.acc-amber::before { background: #d98a00; }
.card-title.acc-grey::before { background: #9aa5ae; }

.type-badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 11px; font-weight: 700; white-space: nowrap; background: #eef1f4; color: #52606b; }
.type-badge.t-prebuild { background: #e3edfb; color: #1f4f94; }
.type-badge.t-catalog { background: #e6f4ec; color: #1a6b43; }
.type-badge.t-one_off { background: #fdecc8; color: #8a5a00; }
.type-badge.t-service_fee { background: #f1e6fa; color: #6a3aa0; }
.type-badge.t-labor { background: #dcf3e6; color: #1a7f4e; }

.sum-totals { width: 100%; border-collapse: collapse; margin-top: 4px; border-top: 2px solid var(--border); }
.sum-totals td { padding: 7px 10px; font-size: 13.5px; border: none; }
.sum-totals tr.grand td { font-weight: 800; font-size: 16px; color: var(--navy); border-top: 1px solid var(--border); padding-top: 10px; }
.cost-details { margin-top: 10px; }
.cost-details summary { cursor: pointer; font-size: 12px; color: var(--muted); font-weight: 600; }
.cost-details .breakdown { margin-top: 6px; }
.summary-grid table.data.compact tbody tr:nth-child(even) td { background: #f8fafc; }
.timeline .tl-dot { background: var(--blue); border-color: var(--blue); }

.card.sect-card { padding: 0; overflow: hidden; }
.card.slim-card { padding: 10px 16px; }
.cc-quiet { margin: 0 2px 10px; }
.sect-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px 18px; background: #f8fafc; border-bottom: 1px solid var(--border); }
.sect-head .card-title { margin: 0; font-size: 16px; }
.sect-head .add-part { min-width: 240px; }
.sect-head .dark { color: var(--text); }
.sect-pad { padding: 4px 18px 14px; margin: 10px 0 0; }
.sect-table { margin: 0; }
.sect-table thead th { background: #eef2f6; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: #52606b; padding: 9px 10px; }
.sect-table thead th:first-child, .sect-table tbody td:first-child, .sect-table tfoot td:first-child { padding-left: 18px; }
.sect-table tbody td { padding: 9px 10px; border-bottom: 1px solid #edf0f3; }
.sect-table tbody tr:nth-child(even) td { background: #f8fafc; }
.sect-table tbody tr.row-missing td { background: #fff8e8; }
.sect-table .w-desc { font-weight: 600; border-color: transparent; background: transparent; }
.sect-table .w-desc:hover, .sect-table .w-desc:focus { border-color: var(--border); background: white; }
.sect-table .money-in.sell input { font-weight: 700; background: white; }
.sect-table td .money-in input[data-k="base_price"], .sect-table td .input-suffix input { background: #f6f8fa; color: #52606b; }
.sect-table .w-qty { width: 70px; text-align: center; font-weight: 700; }
.sect-table tfoot td { padding: 12px 10px; border-top: 2px solid var(--border); background: white; }
.sect-total { font-size: 17px; font-weight: 800; color: var(--navy); }
.sect-table .icon-btn.danger { color: var(--red); }
@media (max-width: 1100px) { .job-cards { grid-template-columns: 1fr 1fr; } }
@media (max-width: 640px) { .job-cards { grid-template-columns: 1fr; margin: 0 10px; } .job-title { font-size: 18px; } }
.sect-card input:not([type=checkbox]):not(.w-desc), .sect-card select, .jc select, .sect-head .add-part input { border: 1px solid var(--border); border-radius: 8px; padding: 7px 10px; font: inherit; font-size: 13px; background: white; }
.sect-card input:focus, .sect-card select:focus { outline: 2px solid #b9d2f2; border-color: var(--blue); }
.sect-card .inline-add label { font-size: 12px; font-weight: 700; color: #3b4650; display: block; margin-bottom: 4px; }

/* Purchase orders */
.po-st { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 700; background: #eef1f4; color: #52606b; text-transform: capitalize; }
.po-st.po-sent { background: #e3edfb; color: #1f4f94; }
.po-st.po-received { background: #dcf3e6; color: var(--green); }
.po-st.po-cancelled { background: #fbdada; color: var(--red); }
.po-grid { display: grid; grid-template-columns: 1fr 1.4fr; gap: 16px; }
.po-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; }
.po-fields label { font-size: 12px; font-weight: 700; color: #3b4650; }
.po-fields label input, .po-fields label textarea { display: block; width: 100%; margin-top: 4px; font-weight: 400; }
.po-fields .wide { grid-column: 1 / -1; }
.po-sup { margin-top: 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: #fbfcfd; display: grid; gap: 3px; }
.po-edit .sect-pad { padding-top: 6px; }
tr.clickable { cursor: pointer; }
@media (max-width: 900px) { .po-grid { grid-template-columns: 1fr; } .po-fields { grid-template-columns: 1fr; } }

/* Jobs / Quotes lists, Aleesha's design (Nov 2026) */
.list-top { display: flex; align-items: flex-end; gap: 12px; padding: 16px 24px 6px; flex-wrap: wrap; }
.list-crumb { font-size: 12.5px; color: var(--muted); }
.list-crumb a { font-weight: 600; }
.list-title { font-size: 24px; font-weight: 800; color: var(--navy); margin: 2px 0 0; }
.module-tabs.line-tabs { display: flex; gap: 22px; padding: 0 24px; margin: 6px 0 0; border-bottom: 1px solid var(--border); background: transparent; }
.module-tabs.line-tabs a { padding: 10px 2px; font-weight: 600; color: var(--muted); border-bottom: 3px solid transparent; border-radius: 0; background: none; }
.module-tabs.line-tabs a.active { color: var(--navy); border-bottom-color: var(--blue); background: none; }
.module-tabs.line-tabs a:hover { color: var(--blue); text-decoration: none; }
.stage-cards { display: flex; gap: 12px; padding: 16px 24px 0; flex-wrap: wrap; }
.stage-card { min-width: 130px; flex: 0 1 170px; background: white; border: 1px solid var(--border); border-radius: 10px; padding: 10px 14px; display: flex; flex-direction: column; gap: 4px; color: var(--text); }
.stage-card:hover { text-decoration: none; border-color: #b9c7d6; box-shadow: 0 1px 3px rgba(15, 39, 71, .08); }
.stage-card.active { border: 2px solid var(--blue); padding: 9px 13px; box-shadow: 0 2px 6px rgba(43, 100, 176, .15); }
.stage-card .sc-label { font-size: 12px; font-weight: 600; color: #52606b; display: flex; align-items: center; gap: 6px; }
.stage-card .count { font-size: 22px; font-weight: 800; color: var(--navy); background: none; padding: 0; min-height: 28px; }
.stage-card.ghost { border-style: dashed; background: transparent; }
.stage-card .sc-more { font-size: 13px; color: var(--blue); font-weight: 600; margin-top: auto; }
.sc-dot { width: 8px; height: 8px; border-radius: 50%; background: #9aa5ae; display: inline-block; }
.sc-dot.st-all { background: var(--blue); }
.sc-dot.st-pending { background: #d98a00; }
.sc-dot.st-progress { background: #f2c94c; box-shadow: 0 0 0 1px #d4a72c inset; }
.sc-dot.st-complete { background: #7b8794; }
.sc-dot.st-approved { background: var(--green); }
.sc-dot.st-invoiced { background: #6a3aa0; }
.sc-dot.st-archived { background: #9aa5ae; }
.list-card .list-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.list-card .list-head h2.acc-title { font-size: 16px; margin: 0; padding-left: 12px; border-left: 4px solid var(--blue); display: flex; align-items: center; gap: 8px; }
.count-pill { background: #e3edfb; color: #1f4f94; font-size: 11.5px; font-weight: 700; padding: 2px 9px; border-radius: 999px; }
.count-pill:empty { display: none; }
.searchbox.compact { min-width: 260px; flex: 0 1 300px; }
.searchbox.compact input { padding-top: 7px !important; padding-bottom: 7px !important; }
.list-head select { max-width: 190px; padding: 7px 10px !important; }
.icon-btn.boxed { border: 1px solid var(--border); }
.bulk-bar { padding: 8px 18px; border-bottom: 1px solid var(--border); background: #f8fafc; }
table.nice-list thead th { font-size: 10.5px; letter-spacing: .07em; text-transform: uppercase; color: #52606b; background: #f8fafc; padding: 10px 10px; }
table.nice-list tbody td { padding: 11px 10px; vertical-align: middle; border-bottom: 1px solid #edf0f3; font-size: 13px; }
table.nice-list tbody tr:hover td { background: #f6f9fd; }
table.nice-list .cust-cell { font-weight: 700; color: var(--navy); }
table.nice-list .site-cell { max-width: 220px; }
table.nice-list .job-link { font-weight: 700; font-size: 12.5px; }
table.nice-list .job-name { font-size: 12.5px; color: #3b4650; max-width: 260px; }
table.nice-list .price-cell strong { font-size: 13.5px; color: var(--navy); }
.status-badge.sm { font-size: 11px; padding: 3px 10px; white-space: normal; line-height: 1.25; max-width: 190px; }
.list-foot { display: flex; align-items: center; gap: 10px; padding: 12px 18px; border-top: 1px solid var(--border); }
.list-foot .btn[disabled] { opacity: .45; cursor: default; }
@media (max-width: 780px) { .stage-card { flex: 1 1 40%; } .list-top, .stage-cards, .module-tabs.line-tabs { padding-left: 12px; padding-right: 12px; } }

/* Reports (owners only) */
.rp-bar select, .rp-bar input[type=date] { padding: 7px 10px; border: 1px solid var(--border); border-radius: 8px; font: inherit; font-size: 14px; background: #fff; }
.in-table tr.rp-total td { font-weight: 700; border-top: 2px solid var(--border); }
.rp-mail { white-space: pre-wrap; background: #f6f8fb; border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px; font-size: 13px; max-height: 520px; overflow: auto; }
#tab-reports .pager { display: flex; gap: 12px; align-items: center; justify-content: center; margin-top: 12px; }
#tab-reports .module-tabs.line-tabs a { cursor: pointer; }
.rp-chart { display: flex; align-items: stretch; gap: 6px; padding-top: 4px; }
.rp-col { flex: 1 1 0; min-width: 0; max-width: 110px; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; }
.rp-col .rp-fill { width: 72%; border-radius: 4px 4px 0 0; min-height: 0; }
.rp-col .rp-val { font-size: 11px; color: var(--muted); margin-bottom: 3px; white-space: nowrap; }
.rp-col .rp-lab { font-size: 11px; color: var(--muted); margin-top: 5px; height: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.rp-chart { justify-content: center; }

/* Open jobs bar (top), like Simpro's corner tabs */
.open-jobs { flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.open-jobs .oj-label { font-size: 11px; font-weight: 700; color: var(--muted, #6b7785); text-transform: uppercase; letter-spacing: .04em; flex-shrink: 0; }
.open-jobs .oj { display: inline-flex; align-items: center; gap: 2px; background: white; border: 1px solid var(--border); border-radius: 16px; padding: 2px 4px 2px 10px; font-size: 12px; flex-shrink: 0; max-width: 220px; }
.open-jobs .oj a { color: var(--blue-dark); font-weight: 700; text-decoration: none; display: inline-flex; gap: 6px; min-width: 0; }
.open-jobs .oj .oj-name { font-weight: 500; color: #44505c; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 130px; }
.open-jobs .oj.on { border-color: var(--teal, #1f7a8c); box-shadow: inset 0 -2px 0 var(--teal, #1f7a8c); }
.open-jobs .oj.dirty a::after { content: "\2022"; color: #d9822b; margin-left: 2px; }
.open-jobs .oj-x { border: 0; background: none; cursor: pointer; color: #8a96a3; font-size: 15px; line-height: 1; padding: 0 4px; }
.open-jobs .oj-x:hover { color: #c0392b; }
.who .link-btn { border: 0; background: none; color: var(--blue-dark); font-size: 12px; cursor: pointer; text-decoration: underline; }
@media (max-width: 780px) { .open-jobs, #prefs-btn { display: none; } }
/* Screen options */
body.pref-hide-history .tab-btn[data-tab="history"] { display: none !important; }
.summary-grid.no-activity { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); }
/* Attachment folders */
.folder-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 10px 0 12px; }
.folder-bar .spacer { flex: 1; }
.fchip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--border); background: white; border-radius: 8px; padding: 5px 10px; font-size: 12.5px; cursor: pointer; color: #34404c; }
.fchip svg { width: 15px; height: 15px; color: #c8952b; }
.fchip .count { background: #eef2f5; border-radius: 10px; padding: 0 6px; font-size: 11px; color: #5c6875; }
.fchip.on { border-color: var(--teal, #1f7a8c); background: #eef7f8; font-weight: 700; }
.folder-tag { display: inline-flex; align-items: center; gap: 3px; font-size: 11px; color: #6b5a2b; background: #fbf3df; border-radius: 6px; padding: 1px 6px; margin-left: 6px; }
.folder-tag svg { width: 12px; height: 12px; }
.small-select { font-size: 12px; padding: 3px 6px; }
.fchip:hover { background: #f3f7f9; color: #34404c; border-color: #b9c6d0; }
.fchip.on:hover { background: #eef7f8; }
.bulk-links .small-select { width: auto; min-width: 200px; display: inline-block; }
/* Invoices: total for the list, top right */
.iv-total { text-align: right; background: #f2f8f9; border: 1px solid #cfe3e7; border-radius: 10px; padding: 8px 14px; min-width: 190px; }
.iv-total-k { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: #4d5b68; }
.iv-total-k span { font-weight: 500; text-transform: none; letter-spacing: 0; color: #7b8794; }
.iv-total-v { font-size: 24px; font-weight: 800; color: var(--blue-dark); line-height: 1.2; }
.iv-total-s { font-size: 12px; color: #5c6875; }
/* Labour and travel entry, several lines at once */
.lab-entry { border-bottom: 1px solid var(--border); }
.lab-entry-head, .lab-entry-foot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 4px 0 8px; }
.lab-entry-head .spacer, .lab-entry-foot .spacer { flex: 1; }
.lab-grid td { padding: 4px 6px; vertical-align: middle; }
.lab-grid select, .lab-grid input:not(.w-qty) { width: 100%; }
.lab-grid td:nth-child(2) { min-width: 200px; }
.lab-grid .money-in { max-width: 120px; margin-left: auto; }
.lab-desc { width: 100%; min-width: 160px; }
.fx-add-btns { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
/* "Invoiced and sent" banner on the jobs list */
.sent-flash { display: flex; align-items: center; gap: 10px; margin: 12px 20px 0; padding: 12px 14px; border-radius: 10px; background: #e8f6ee; border: 1px solid #9fd6b4; color: #1d5e36; font-size: 14px; transition: opacity .5s; }
.sent-flash > div { flex: 1; }
.sent-flash svg { flex-shrink: 0; }
.sent-flash.gone { opacity: 0; }
button.walk-step { border: 0; cursor: pointer; font: inherit; font-size: 12px; }
button.walk-step:hover { background: #e3ecf7; color: var(--blue-dark); }
button.walk-step.on:hover { background: var(--blue); color: white; }

/* ---- Weekly roster (Schedule > By employee, My week) ---- */
.roster-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 4px 0 12px; }
.roster-bar .spacer { flex: 1; }
.seg-toggle { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.seg-toggle button { border: 0; background: white; padding: 6px 12px; font: inherit; font-size: 13px; cursor: pointer; color: #44505c; }
.seg-toggle button.on { background: var(--blue); color: white; font-weight: 700; }
.roster-key { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.rk { display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 10px; border: 1px dashed transparent; }
.rk-work { background: #e3effc; color: #1f4f86; border-color: #8db4e2; }
.rk-office { background: #eef0f3; color: #44505c; border-color: #b8c0c8; }
.rk-leave { background: #fde8e8; color: #9b2c2c; border-color: #e6a3a3; }
.rk-off { background: #f3f3f3; color: #7b8794; border-color: #cfd4d9; }
.rk-tba { background: #fff6d6; color: #8a6400; border-color: #e8cf7a; }
.rk-job { background: white; color: var(--blue-dark); border: 2px solid var(--blue); }
.roster-wrap .table-wrap { overflow-x: auto; }
.roster-grid { width: 100%; border-collapse: separate; border-spacing: 0; background: white; border: 1px solid var(--border); border-radius: 10px; table-layout: fixed; min-width: 900px; }
.roster-grid th, .roster-grid td { border-bottom: 1px solid #eef1f4; border-right: 1px solid #eef1f4; padding: 6px; vertical-align: top; text-align: left; }
.roster-grid thead th { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; background: #fafbfc; }
.roster-grid th.ro-name { width: 140px; font-size: 13px; color: #24313d; text-transform: none; letter-spacing: 0; background: #fafbfc; }
.roster-grid .ro-today { background: #f3f8fe; }
.roster-grid .ro-weekend { background: #fbfbfc; }
.ro-cell { min-height: 54px; position: relative; }
.ro-chip, .ro-job { display: flex; flex-direction: column; align-items: flex-start; width: 100%; text-align: left; font: inherit; font-size: 12px; border-radius: 6px; padding: 4px 6px; margin-bottom: 4px; cursor: pointer; border-width: 1px; border-style: dashed; text-decoration: none; }
.ro-chip .ro-label, .ro-job .ro-label { font-weight: 700; line-height: 1.25; word-break: break-word; }
.ro-time { font-size: 11px; opacity: .8; }
.ro-job { background: white; color: var(--blue-dark); border: 2px solid var(--blue); }
.ro-chip.st-cancelled { opacity: .45; text-decoration: line-through; }
.ro-chip.st-converted, .ro-chip.st-attached { border-style: solid; opacity: .75; }
.ro-tag { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; opacity: .8; }
.ro-linked { font-size: 11px; }
.ro-add { display: none; border: 1px dashed #b9c6d0; background: white; color: var(--blue); border-radius: 6px; width: 100%; font-size: 14px; line-height: 1; padding: 3px; cursor: pointer; }
.ro-cell:hover .ro-add, .ro-cell:empty .ro-add { display: block; }
.ro-cell .ro-add:only-child { display: block; opacity: .35; }
.ro-cell:hover .ro-add:only-child { opacity: 1; }
.ro-day-row { margin-bottom: 4px; }
.ro-gaps { margin-top: 14px; }
.ro-people { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 4px 12px; max-height: 180px; overflow-y: auto; border: 1px solid var(--border); border-radius: 8px; padding: 8px; }
.ra-list { max-height: 300px; overflow-y: auto; margin-top: 8px; }
.ra-item { display: flex; flex-direction: column; align-items: flex-start; width: 100%; text-align: left; border: 1px solid var(--border); background: white; border-radius: 8px; padding: 8px 10px; margin-bottom: 6px; cursor: pointer; font: inherit; }
.ra-item:hover { border-color: var(--blue); }
.ro-myweek h3 { margin-bottom: 8px; }
.ro-strip { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.ro-day { flex: 0 0 auto; min-width: 120px; max-width: 170px; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; border-radius: 10px; padding: 8px 10px; border-width: 1px; border-style: dashed; font: inherit; cursor: pointer; }
.ro-day.today { box-shadow: 0 0 0 2px var(--blue); }
.ro-day .ro-dd { font-size: 11px; font-weight: 700; text-transform: uppercase; opacity: .8; }
.ro-day .ro-label { font-weight: 700; font-size: 13px; }
@media (max-width: 780px) { .roster-key { display: none; } }
#schedule-days.roster-wrap { display: block; }
.ro-gaps ul.plain { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.ro-preview { white-space: pre-wrap; font: 12px/1.45 ui-monospace, Menlo, monospace; background: #f6f8fa; border: 1px solid var(--border); border-radius: 8px; padding: 10px; max-height: 300px; overflow: auto; }
/* Tables in notes and descriptions */
.rte-body table, .rte-view table { border-collapse: collapse; margin: 6px 0; width: auto; min-width: 60%; }
.rte-body td, .rte-body th, .rte-view td, .rte-view th { border: 1px solid #cfd8e0; padding: 4px 8px; min-width: 60px; vertical-align: top; text-align: left; }
.rte-body th, .rte-view th { background: #f2f5f8; font-weight: 700; }
.rte-tablewrap { position: relative; display: inline-flex; }
.rte-bar .rte-table { gap: 4px; }
.rte-pop { position: absolute; top: 100%; left: 0; z-index: 30; background: white; border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 6px 20px rgba(16,24,40,.12); padding: 8px; display: flex; flex-direction: column; gap: 6px; min-width: 190px; }
.rte-pop[hidden] { display: none; }
.rte-pop label { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12px; }
.rte-pop input[type=number] { width: 64px; }
.rte-pop button { justify-content: flex-start !important; width: 100%; }
.rte-pop button.primary { background: var(--blue); color: white; justify-content: center !important; }
.rte-pop button.danger { color: #c0392b; }
.dx-rich { border: 1px solid var(--border); border-radius: 8px; padding: 8px; min-height: 200px; max-height: 50vh; overflow: auto; background: white; }
.rte-view { overflow-x: auto; }
.rte-body th, .rte-view th { text-transform: none; letter-spacing: 0; font-size: inherit; color: inherit; }

/* Remind the team (receipts) */
.rm-list{max-height:52vh;overflow:auto;border:1px solid var(--line,#e3e7ec);border-radius:8px;margin:10px 0}
.rm-row{display:flex;flex-wrap:wrap;align-items:center;gap:6px 12px;padding:8px 12px;border-bottom:1px solid var(--line,#e3e7ec)}
.rm-row:last-child{border-bottom:0}
.rm-row label{min-width:170px}
.rm-row a{margin-left:auto}
.rm-fix{color:#b42318}
.rm-body{flex-basis:100%;white-space:pre-wrap;font-size:12px;background:#f6f8fa;padding:10px;border-radius:6px;margin:4px 0 0}
.rm-auto{display:flex;flex-wrap:wrap;gap:8px;align-items:center;margin-top:6px}
.rm-row label.check,.rm-auto label.check{display:inline-flex;align-items:center;gap:8px;text-transform:none;letter-spacing:0;font-size:14px;color:inherit;margin:0;font-weight:500}
.rm-row label.check input,.rm-auto label.check input{width:auto;margin:0}
.rm-auto select{width:auto;min-width:130px;margin:0}

.sc-dot.st-recurring { background: #0f8a7e; }
.stage-card .sc-sub { font-size: 11px; color: #6b7785; margin-top: -2px; }
