/* =============================================================================
   Smartrise component kit (v1.289 design system). Class prefix sr-.
   Every value comes from assets/css/sr/tokens.css — no raw colours (design lint).
   PHP helpers that print this markup: includes/ui_kit.php. Reference: admin/ui-kit.php.
   ============================================================================= */

/* ---------- layout helpers ---------- */
.sr-stack { display: flex; flex-direction: column; gap: var(--sr-space-4); }
.sr-stack--sm { gap: var(--sr-space-2); }
.sr-stack--lg { gap: var(--sr-space-6); }
.sr-row { display: flex; align-items: center; gap: var(--sr-space-2); flex-wrap: wrap; }
.sr-row--between { justify-content: space-between; }
.sr-row--end { justify-content: flex-end; }
.sr-row--nowrap { flex-wrap: nowrap; }
.sr-grid { display: grid; gap: var(--sr-space-4); grid-template-columns: minmax(0, 1fr); }
.sr-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.sr-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.sr-grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.sr-grid--side { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.sr-grid--auto { grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr)); }
.sr-grid--auto-sm { grid-template-columns: repeat(auto-fill, minmax(min(170px, 100%), 1fr)); align-items: start; }
/* v1.291: a Chart.js trend chart's box (the chart fills it) */
.sr-chart { position: relative; height: 220px; }
.sr-grid--tiles { grid-template-columns: repeat(auto-fill, minmax(min(150px, 100%), 1fr)); gap: var(--sr-space-3); }
.sr-span-2 { grid-column: span 2; }
@media (max-width: 900px) { .sr-span-2 { grid-column: auto; } }
@media (max-width: 1100px) { .sr-grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 720px) { .sr-grid--2, .sr-grid--3, .sr-grid--4, .sr-grid--side { grid-template-columns: minmax(0, 1fr); } }
.sr-muted { color: var(--sr-text-soft); }
.sr-faint { color: var(--sr-text-faint); font-size: var(--sr-size-sm); }
.sr-num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.sr-text-sm { font-size: var(--sr-size-sm); font-weight: var(--sr-weight-regular); }
.sr-grow { flex: 1 1 220px; min-width: 0; max-width: 460px; }
.sr-fill { flex: 1 1 auto; min-width: 0; }
.sr-scrollbox { max-height: 220px; overflow: auto; }
.sr-text-danger { color: var(--sr-danger-ink); font-weight: var(--sr-weight-semibold); }
.sr-text-warning { color: var(--sr-warning-ink); font-weight: var(--sr-weight-semibold); }
.sr-text-success { color: var(--sr-success-ink); font-weight: var(--sr-weight-semibold); }
/* v1.294: a table cell sets its own text colour, so the status colours name the cell too (they did not show in tables before) */
.sr-table td.sr-text-danger { color: var(--sr-danger-ink); } .sr-table td.sr-text-warning { color: var(--sr-warning-ink); } .sr-table td.sr-text-success { color: var(--sr-success-ink); }
.sr-divider { border-top: 1px solid var(--sr-line); padding-top: var(--sr-space-4); }
.sr-break { word-break: break-all; }
.sr-input[data-sr-upper] { text-transform: uppercase; }
.sr-audio { width: 100%; max-width: 360px; }
.sr-map { height: 440px; border-radius: var(--sr-radius-md); overflow: hidden; z-index: 0; }
@media (max-width: 720px) { .sr-map { height: 320px; } }
.sr-sla { font-weight: var(--sr-weight-semibold); margin: var(--sr-space-1) 0 0; }
.sr-sla.is-overdue { color: var(--sr-danger-ink); }
.sr-anchor { scroll-margin-top: calc(var(--sr-topbar-h) + var(--sr-space-4)); }
.sr-pad-top { padding-top: var(--sr-space-3); }
.sr-status { font-size: var(--sr-size-sm); min-height: 1.4em; margin: 0; color: var(--sr-text-soft); }
.sr-status.is-ok { color: var(--sr-success-ink); }
.sr-status.is-bad { color: var(--sr-danger-ink); }
.sr-link-btn { align-self: flex-start; background: none; border: 0; min-height: 0; padding: 0; color: var(--sr-link); font: inherit; font-size: var(--sr-size-sm); text-decoration: underline; cursor: pointer; text-align: left; }
.pp-row .pp-label { width: 170px; } .pp-row .pp-date { width: auto; } .pp-row .pp-amt { width: 160px; }
.sr-table tr.sr-row-danger td { background: var(--sr-danger-bg); }
.sr-channels { border: 0; margin: 0; padding: 0; gap: var(--sr-space-2) var(--sr-space-5); }
.sr-channels legend { width: 100%; margin-bottom: var(--sr-space-1); }
.sr-pre { white-space: pre-wrap; }
/* a compact control for a table row (v1.290: Lead Outcomes "close with reason") */
.sr-input.sr-input--sm, .sr-select.sr-select--sm { min-height: 32px; width: auto; padding: 0 var(--sr-space-2); font-size: var(--sr-size-sm); }
.sr-input.sr-input--sm { min-width: 200px; }
.sr-input.sr-input--order { min-width: 0; width: 4.5rem; flex: 0 0 auto; }   /* v1.321: an order number beside a list item (Settings → site ready checklist) */
.sr-input.sr-input--qty { width: 96px; min-width: 0; flex: none; } /* v1.292: a quantity box stays quantity-sized on staff pages too (field.css had it for the FieldApp only) */
.sr-mono { font-family: var(--sr-font-mono); font-size: var(--sr-size-sm); }
.sr-visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- page header ---------- */
.sr-page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--sr-space-4); flex-wrap: wrap; margin: 0 0 var(--sr-space-6); }
.sr-page-head__text { min-width: 0; }
.sr-page-head__title { font-family: var(--sr-font-display); font-size: var(--sr-size-3xl); font-weight: var(--sr-weight-bold); color: var(--sr-heading); line-height: 1.2; margin: 0; letter-spacing: var(--sr-track-tight); text-transform: none; }
.sr-page-head__sub { margin: var(--sr-space-1) 0 0; color: var(--sr-text-soft); font-size: var(--sr-size-md); max-width: var(--sr-measure); }
.sr-page-head__actions { display: flex; gap: var(--sr-space-2); flex-wrap: wrap; align-items: center; }
/* v1.326 P3: the title stays 24 px on a phone (one title size everywhere) */
@media (max-width: 720px) { .sr-page-head { margin-bottom: var(--sr-space-4); } .sr-page-head__actions { width: 100%; } }

/* ---------- breadcrumbs ---------- */
.sr-crumbs { display: flex; flex-wrap: wrap; gap: var(--sr-space-1); list-style: none; margin: 0 0 var(--sr-space-3); padding: 0; font-size: var(--sr-size-sm); color: var(--sr-text-faint); }
.sr-crumbs li + li::before { content: "/"; margin-right: var(--sr-space-1); color: var(--sr-text-faint); }
.sr-crumbs a { color: var(--sr-text-faint); text-decoration: none; }
.sr-crumbs a:hover { color: var(--sr-heading); text-decoration: underline; }

/* ---------- buttons ---------- */
.sr-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--sr-space-2);
  min-height: var(--sr-control-h); padding: 0 var(--sr-space-4);
  font-family: var(--sr-font-body); font-size: var(--sr-size-md); font-weight: var(--sr-weight-semibold);
  line-height: 1; text-transform: none; letter-spacing: normal; white-space: nowrap; text-decoration: none;
  border-radius: var(--sr-radius-md); border: 1px solid var(--sr-line-strong);
  background: var(--sr-surface); color: var(--sr-text); cursor: pointer; box-shadow: var(--sr-shadow-1); /* v1.326 P5: a 1 px lift */
  transition: background var(--sr-dur-fast) var(--sr-ease), border-color var(--sr-dur-fast) var(--sr-ease), color var(--sr-dur-fast) var(--sr-ease), transform var(--sr-dur-fast) var(--sr-ease-out);
}
.sr-btn:hover { background: var(--sr-surface-2); color: var(--sr-text); }
.sr-btn:active:not([aria-busy="true"]) { transform: scale(0.97); } /* v1.304: a press is felt (120ms) */
.sr-btn:focus-visible { outline: 2px solid var(--sr-focus); outline-offset: 2px; }
.sr-btn[disabled], .sr-btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; pointer-events: none; }
.sr-btn--primary { background: var(--sr-accent); border-color: var(--sr-accent); color: var(--sr-accent-ink); }
.sr-btn--primary:hover { background: var(--sr-accent-hover); border-color: var(--sr-accent-hover); color: var(--sr-accent-ink); }
.sr-btn--secondary { background: var(--sr-surface); }
.sr-btn--quiet { background: transparent; border-color: transparent; color: var(--sr-link); box-shadow: none; padding: 0 var(--sr-space-2); }
.sr-btn--quiet:hover { background: var(--sr-surface-2); color: var(--sr-heading); }
.sr-btn--danger { background: var(--sr-surface); border-color: var(--sr-danger-line); color: var(--sr-danger-ink); }
.sr-btn--danger:hover { background: var(--sr-danger-bg); color: var(--sr-danger-ink); }
.sr-btn--sm { min-height: 32px; padding: 0 var(--sr-space-3); font-size: var(--sr-size-sm); } /* v1.326 P5: one small size (28 and 30 retired) */
/* v1.326 P5: a repeated row action ("Manage", "Open", "Assign") is a quiet link; it shows its frame when the row is hovered */
.sr-table td .sr-btn--sm:not(.sr-btn--primary):not(.sr-btn--danger), .sr-list__end .sr-btn--sm:not(.sr-btn--primary):not(.sr-btn--danger) { background: transparent; border-color: transparent; box-shadow: none; color: var(--sr-link); }
.sr-table tr:hover td .sr-btn--sm:not(.sr-btn--primary):not(.sr-btn--danger), .sr-list > li:hover .sr-list__end .sr-btn--sm:not(.sr-btn--primary):not(.sr-btn--danger),
.sr-table td .sr-btn--sm:not(.sr-btn--primary):not(.sr-btn--danger):focus-visible { background: var(--sr-surface); border-color: var(--sr-line-strong); }
.sr-btn--icon { padding: 0; width: var(--sr-control-h); }
.sr-btn--block { width: 100%; }
.sr-btn svg { width: 16px; height: 16px; flex: none; }

/* ---------- form fields ---------- */
.sr-field { display: flex; flex-direction: column; gap: var(--sr-space-1); min-width: 0; }
.sr-field__label { font-size: var(--sr-size-sm); font-weight: var(--sr-weight-medium); color: var(--sr-text); }
.sr-field__req { color: var(--sr-danger-ink); margin-left: 2px; }
.sr-field__help { font-size: var(--sr-size-sm); color: var(--sr-text-soft); margin: 0; max-width: var(--sr-measure); }
.sr-field__error { font-size: var(--sr-size-sm); color: var(--sr-danger-ink); margin: 0; }
.sr-field--invalid .sr-input, .sr-field--invalid .sr-select, .sr-field--invalid .sr-textarea { border-color: var(--sr-danger-ink); }
.sr-input, .sr-select, .sr-textarea {
  font: inherit; font-size: var(--sr-size-md); color: var(--sr-text); background: var(--sr-surface);
  border: 1px solid var(--sr-control-line); border-radius: var(--sr-radius-md); /* v1.326: 3:1 (WCAG 1.4.11) */
  min-height: var(--sr-control-h); padding: 0 var(--sr-space-3); width: 100%; box-sizing: border-box;
  transition: border-color var(--sr-dur-fast) var(--sr-ease), box-shadow var(--sr-dur-fast) var(--sr-ease);
}
.sr-input:hover, .sr-select:hover, .sr-textarea:hover { border-color: var(--sr-text-faint); }
.sr-textarea { padding: var(--sr-space-2) var(--sr-space-3); min-height: 96px; resize: vertical; }
.sr-input:focus-visible, .sr-input:is([type=date], [type=time], [type=datetime-local], [type=month]):focus-within, .sr-select:focus-visible, .sr-textarea:focus-visible { outline: 0; border-color: var(--sr-focus); box-shadow: 0 0 0 1px var(--sr-focus), var(--sr-focus-ring); } /* v1.291: a date box keeps its ring while Tab is on its calendar button; v1.326 P6: the teal edge and halo, no offset outline */
/* v1.326 P6: a file picker is a dashed drop frame with a real "Choose file" button, not the browser's grey one */
.sr-app input[type="file"], .sr-field-app input[type="file"], .sr-portal input[type="file"], input[type="file"].sr-input { font: inherit; font-size: var(--sr-size-sm); color: var(--sr-text-soft); border: 1px dashed var(--sr-control-line); border-radius: var(--sr-radius-md); padding: 6px; background: var(--sr-surface); max-width: 100%; box-sizing: border-box; min-height: 0; }
.sr-app input[type="file"]::file-selector-button, .sr-field-app input[type="file"]::file-selector-button, .sr-portal input[type="file"]::file-selector-button, input[type="file"].sr-input::file-selector-button { font: inherit; font-weight: var(--sr-weight-semibold); color: var(--sr-text); background: var(--sr-surface); border: 1px solid var(--sr-line-strong); border-radius: var(--sr-radius-sm); padding: var(--sr-space-1) var(--sr-space-3); margin-right: var(--sr-space-3); cursor: pointer; box-shadow: var(--sr-shadow-1); }
.sr-input--money { text-align: right; font-variant-numeric: tabular-nums; }
.sr-check { display: inline-flex; align-items: center; gap: var(--sr-space-2); font-size: var(--sr-size-md); color: var(--sr-text); cursor: pointer; }
.sr-check input { accent-color: var(--sr-link); width: 16px; height: 16px; margin: 0; }
.sr-switch { display: inline-flex; align-items: center; gap: var(--sr-space-2); cursor: pointer; }
.sr-switch input { appearance: none; width: 36px; height: 20px; border-radius: var(--sr-radius-pill); background: var(--sr-control-line); position: relative; margin: 0; cursor: pointer; transition: background var(--sr-dur-fast) var(--sr-ease); }
.sr-switch input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--sr-surface); box-shadow: var(--sr-shadow-1); transition: transform var(--sr-dur-fast) var(--sr-ease); }
.sr-switch input:checked { background: var(--sr-teal-500); }
.sr-switch input:checked::after { transform: translateX(16px); }
.sr-form-actions { display: flex; gap: var(--sr-space-2); justify-content: flex-end; flex-wrap: wrap; padding-top: var(--sr-space-5); border-top: 1px solid var(--sr-line); }

/* ---------- search ---------- */
.sr-search { position: relative; display: flex; align-items: center; min-width: 220px; flex: 1 1 260px; max-width: 420px; }
.sr-search__icon { position: absolute; left: var(--sr-space-3); width: 16px; height: 16px; color: var(--sr-text-faint); pointer-events: none; }
.sr-search .sr-input { padding-left: 36px; }

/* ---------- filter tabs ---------- */
.sr-tabs { display: flex; gap: var(--sr-space-4); border-bottom: 1px solid var(--sr-line); overflow-x: auto; scrollbar-width: thin; margin: 0 0 var(--sr-space-5); }
.sr-tabs__item { display: inline-flex; align-items: center; gap: var(--sr-space-2); padding: var(--sr-space-2) 0; min-height: 40px; box-sizing: border-box; color: var(--sr-text-soft); text-decoration: none; font-weight: var(--sr-weight-medium); font-size: var(--sr-size-md); white-space: nowrap; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.sr-tabs__item:hover { color: var(--sr-text); }
/* v1.326 P8: the active underline is teal — orange stays for the one main action; a count is a plain faint number */
.sr-tabs__item.is-active { color: var(--sr-text); border-bottom-color: var(--sr-heading); font-weight: var(--sr-weight-semibold); }
.sr-tabs__count { font-size: var(--sr-size-xs); font-variant-numeric: tabular-nums; background: transparent; color: var(--sr-text-faint); border-radius: var(--sr-radius-pill); padding: 0 2px; }
.sr-tabs__item.is-active .sr-tabs__count { color: var(--sr-text-soft); }

/* ---------- toolbar (search + filters above a table) ---------- */
.sr-toolbar { display: flex; gap: var(--sr-space-2); align-items: center; flex-wrap: wrap; margin: 0 0 var(--sr-space-4); }
.sr-toolbar .sr-select { width: auto; min-width: 140px; }
.sr-toolbar:has(.sr-field) { align-items: flex-end; }
.sr-toolbar > .sr-field { flex: 0 1 180px; }
.sr-toolbar > .sr-field .sr-select { width: 100%; }
.sr-toolbar > .sr-field:has(.sr-check) { flex: none; justify-content: flex-end; min-height: var(--sr-control-h); }

/* ---------- cards ---------- */
/* v1.326 P4: a card is a hairline, no shadow (elevation 0), 24 px inside (16 on a phone) */
.sr-card { background: var(--sr-surface); border: 1px solid var(--sr-line); border-radius: var(--sr-radius-lg); padding: var(--sr-space-6); min-width: 0; }
.sr-card--flush { padding: 0; overflow: hidden; }
.sr-card__head { display: flex; align-items: center; justify-content: space-between; gap: var(--sr-space-3); margin: 0 0 var(--sr-space-4); flex-wrap: wrap; }
.sr-card--flush > .sr-card__head { padding: var(--sr-space-5) var(--sr-space-6) 0; }
.sr-stack > .sr-card__head { margin-bottom: 0; }
.sr-card__pad { padding: 0 var(--sr-space-6); }
.sr-card--flush > .sr-card__pad:first-child { padding-top: var(--sr-space-4); }
.sr-card--flush > .sr-toolbar.sr-card__pad { margin-bottom: var(--sr-space-2); }
/* v1.326 P4: a status card keeps a quiet 2 px edge in its status colour (was a 4 px bar); its title stays in the text
   colour — the edge and the card's own words carry the status, never the colour alone */
.sr-card--danger { box-shadow: inset 2px 0 0 var(--sr-danger-ink); }
.sr-card--warning { box-shadow: inset 2px 0 0 var(--sr-warning-ink); }
.sr-card--success { box-shadow: inset 2px 0 0 var(--sr-success-ink); }
.sr-card__head .sr-card__link { font-size: var(--sr-size-sm); font-weight: var(--sr-weight-semibold); color: var(--sr-link); text-decoration: none; white-space: nowrap; }
.sr-card__head .sr-card__link:hover { text-decoration: underline; }
.sr-card__foot { margin: var(--sr-space-3) 0 0; font-size: var(--sr-size-sm); color: var(--sr-text-soft); }
.sr-card__title { font-family: var(--sr-font-body); font-size: var(--sr-size-lg); font-weight: var(--sr-weight-semibold); color: var(--sr-text); letter-spacing: normal; margin: 0; } /* v1.326 P4: a step below the page title */
/* v1.326 P4: a card inside a card or an open section loses its own frame — a hairline separates it from the one above */
:is(.sr-card, .sr-disclosure__body) .sr-card { border: 0; border-radius: 0; background: transparent; padding: var(--sr-space-5) 0 0; box-shadow: none; }
:is(.sr-card, .sr-disclosure__body) .sr-card + .sr-card, .sr-disclosure__body > .sr-grid > .sr-card { border-top: 1px solid var(--sr-line); }
.sr-disclosure__body > .sr-grid { gap: 0 var(--sr-space-7); }
:is(.sr-card, .sr-disclosure__body) .sr-card:is(.sr-card--danger, .sr-card--warning, .sr-card--success) { padding-left: var(--sr-space-3); } /* keeps its status edge */
:is(.sr-card, .sr-disclosure__body) .sr-card--danger { box-shadow: inset 2px 0 0 var(--sr-danger-ink); }
:is(.sr-card, .sr-disclosure__body) .sr-card--warning { box-shadow: inset 2px 0 0 var(--sr-warning-ink); }
:is(.sr-card, .sr-disclosure__body) .sr-card--success { box-shadow: inset 2px 0 0 var(--sr-success-ink); }
:is(.sr-card, .sr-disclosure__body) .sr-card--flush > .sr-card__head, :is(.sr-card, .sr-disclosure__body) .sr-card--flush > .sr-card__pad { padding-left: 0; padding-right: 0; }
@media (max-width: 720px) { .sr-card { padding: var(--sr-space-4); } .sr-card--flush { padding: 0; } .sr-card--flush > .sr-card__head { padding: var(--sr-space-4) var(--sr-space-4) 0; } .sr-card__pad { padding: 0 var(--sr-space-4); } }
.sr-card__sub { color: var(--sr-text-soft); font-size: var(--sr-size-sm); margin: 2px 0 0; }

/* ---------- data table ---------- */
.sr-table-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.sr-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: var(--sr-size-md); font-variant-numeric: tabular-nums; }
/* v1.326 P7: a quiet header (12 px, faint, a hairline) that stops competing with the data; 48 px rows, no zebra */
.sr-table th { position: sticky; top: 0; z-index: 1; background: var(--sr-surface); text-align: left; font-size: var(--sr-size-xs); font-weight: var(--sr-weight-medium); color: var(--sr-text-faint); text-transform: none; letter-spacing: normal; padding: var(--sr-space-2) var(--sr-space-4); border-bottom: 1px solid var(--sr-line); white-space: nowrap; }
.sr-table td { padding: var(--sr-space-3) var(--sr-space-4); height: var(--sr-row-h); box-sizing: border-box; border-bottom: 1px solid var(--sr-line); vertical-align: middle; color: var(--sr-text); }
.sr-table tbody tr:hover td { background: var(--sr-surface-2); }
.sr-table tbody tr:last-child td { border-bottom: 0; }
.sr-table .num, .sr-table th.num, .sr-table td:has(> .sr-num:only-child) { text-align: right; white-space: nowrap; }
.sr-table a { color: var(--sr-link); font-weight: var(--sr-weight-semibold); text-decoration: none; }
.sr-table .sr-avatar { width: 28px; height: 28px; font-size: var(--sr-size-xs); }
.sr-card--flush .sr-table th:first-child, .sr-card--flush .sr-table td:first-child { padding-left: var(--sr-space-6); }
.sr-card--flush .sr-table th:last-child, .sr-card--flush .sr-table td:last-child { padding-right: var(--sr-space-6); }
.sr-table a:hover { text-decoration: underline; }
.sr-table__empty td { text-align: center; color: var(--sr-text-soft); padding: var(--sr-space-8) var(--sr-space-4); }
.sr-table__sub { display: block; font-size: var(--sr-size-sm); color: var(--sr-text-soft); }
.sr-table--wide { min-width: 760px; } /* v1.291: many columns — the box scrolls on a phone instead of squeezing every column */
.sr-table .sr-mono { white-space: nowrap; }
.sr-table--compact th, .sr-table--compact td { padding: var(--sr-space-2) var(--sr-space-3); }
.sr-table--compact td { height: 40px; }
/* v1.325 R4: a row with one main link is the target (data-href from includes/ui_kit.php; assets/js/sr-interact.js opens it).
   On a phone a cell's lone link also gets a 44 px hit area without making the row taller (negative margins). */
.sr-table tbody tr[data-href] { cursor: pointer; }
@media (max-width: 720px) {
  .sr-table td > a:not(.sr-btn):only-child, .sr-table td > a.sr-mono { display: inline-flex; align-items: center; min-height: 44px; margin-block: -12px; }
}
/* v1.325 R5: phone — a list table becomes stacked cards ("sr-table--stack" and data-label from ui_kit.php): the first
   cell is the card's title, every other cell shows its column name, nothing hides off-screen to the right. A matrix or
   a ledger ("sr-table--keep") keeps its grid in its scroll box, with the first column pinned and a fading right edge
   while more columns are hidden (.sr-scroll-more, set by sr-interact.js). Desktop: tables stay tables. */
@media (max-width: 560px) {
  .sr-table--stack > thead { display: none; } /* every cell carries its own visible label (data-label) */
  .sr-table.sr-table--stack, .sr-table--stack > tbody, .sr-table--stack > tbody > tr, .sr-table.sr-table--stack > tbody > tr > td { display: block; width: 100%; min-width: 0; box-sizing: border-box; }
  .sr-table-wrap:has(> .sr-table--stack) { overflow: visible; }
  .sr-table--stack > tbody > tr { border: 1px solid var(--sr-line); border-radius: var(--sr-radius-lg); margin: 0 0 var(--sr-space-2); padding: var(--sr-space-3) var(--sr-space-4); background: var(--sr-surface); }
  .sr-table.sr-table--stack > tbody > tr > td, .sr-card--flush .sr-table.sr-table--stack > tbody > tr > td:first-child { height: auto; }
  .sr-card--flush .sr-table--stack > tbody > tr > td:last-child { padding-right: 0; }
  .sr-table.sr-table--stack > tbody > tr > td { position: relative; border: 0; padding: var(--sr-space-1) 0 var(--sr-space-1) 40%; text-align: left; white-space: normal; min-height: 20px; overflow-wrap: anywhere; }
  .sr-table.sr-table--stack > tbody > tr:hover > td { background: transparent; }
  /* v1.325.1 LABELS: the column name floats in the cell's 40 % left padding instead of being absolutely placed, and the
     cell is its own block formatting context (flow-root), so a long name that wraps onto two or three lines makes
     the cell taller — before, it ran over the next line and out of the card. The float's percentages are of the
     cell's content box (60 % of the row): -66.667 % = 40 % of the row, 61.667 % = the 37 % column. */
  .sr-table.sr-table--stack > tbody > tr > td { display: flow-root; }
  .sr-table--stack > tbody > tr > td::before { content: attr(data-label); float: left; width: 61.667%; margin-left: -66.667%; color: var(--sr-text-soft); font-size: var(--sr-size-sm); font-weight: var(--sr-weight-regular); }
  .sr-table.sr-table--stack > tbody > tr > td:not([data-label]), .sr-table.sr-table--stack > tbody > tr > td:first-child { padding-left: 0; }
  .sr-table--stack > tbody > tr > td:not([data-label])::before, .sr-table--stack > tbody > tr > td:first-child::before { content: none; }
  .sr-table.sr-table--stack > tbody > tr > td:first-child { font-weight: var(--sr-weight-semibold); padding-bottom: var(--sr-space-2); }
  .sr-table--stack > tbody > tr > td:empty { display: none; }
  .sr-table--stack > tbody > tr.sr-table__empty { border-style: dashed; }

  .sr-table-wrap > table.sr-table.sr-table--keep { display: table; max-width: none; overflow: visible; } /* its box scrolls, not the table (admin-nav-v2.css makes phone tables scroll themselves) */
  .sr-table--keep tr > :first-child { position: sticky; left: 0; z-index: 1; background: var(--sr-surface); box-shadow: 1px 0 0 var(--sr-line); }
  .sr-table--keep thead tr > :first-child { z-index: 3; }
  .sr-table-wrap.sr-scroll-more { -webkit-mask-image: linear-gradient(to left, transparent 0, black 28px); mask-image: linear-gradient(to left, transparent 0, black 28px); }
}
.sr-table tfoot td, .sr-table tfoot th { font-weight: var(--sr-weight-bold); background: var(--sr-surface-2); } /* v1.296: totals rows (was in money-pages.css only) */

/* ---------- status pill and badge ---------- */
/* v1.326 P8: less ink — no border (its tint and its word carry it), weight 500, a 5 px dot */
.sr-pill { display: inline-flex; align-items: center; gap: var(--sr-space-1); padding: 2px var(--sr-space-2); border-radius: var(--sr-radius-pill); font-size: var(--sr-size-xs); font-weight: var(--sr-weight-medium); line-height: 1.6; white-space: nowrap; border: 1px solid transparent; background: var(--sr-neutral-bg); color: var(--sr-neutral-ink); text-transform: none; letter-spacing: normal; font-family: var(--sr-font-body); }
.sr-pill::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.sr-pill--success { background: var(--sr-success-bg); color: var(--sr-success-ink); }
.sr-pill--warning { background: var(--sr-warning-bg); color: var(--sr-warning-ink); }
.sr-pill--danger  { background: var(--sr-danger-bg);  color: var(--sr-danger-ink); }
.sr-pill--info    { background: var(--sr-info-bg);    color: var(--sr-info-ink); }
.sr-pill--neutral { background: var(--sr-neutral-bg); color: var(--sr-neutral-ink); }
/* v1.326.1 (review v1326 M9): a neutral pill on the page grey (outside a card) takes the tint. v1.332 (Option A): not in the staff app any
   more — there --sr-neutral-bg IS the panel grey (tokens.css); pages outside it keep this exactly (:where() adds no weight) */
:where(body:not(.admin-body)) .sr-pill:not([class*="sr-pill--"]):not(.sr-card *), :where(body:not(.admin-body)) .sr-pill--neutral:not(.sr-card *) { background: var(--sr-tint, var(--sr-neutral-bg)); }
.sr-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 6px; box-sizing: border-box; border-radius: var(--sr-radius-pill); background: var(--sr-accent); color: var(--sr-accent-ink); font-size: var(--sr-size-xs); font-weight: var(--sr-weight-bold); font-variant-numeric: tabular-nums; }
.sr-badge--quiet { background: var(--sr-surface-2); color: var(--sr-text-soft); }

/* ---------- number tiles ---------- */
/* v1.326 P4: a number tile is a hairline (no shadow, no coloured side bar): a 13 px label, a 24 px figure; its note
   keeps the status colour (with its words — the colour is never the only signal) */
.sr-kpi { background: var(--sr-surface); border: 1px solid var(--sr-line); border-radius: var(--sr-radius-lg); padding: var(--sr-space-4) var(--sr-space-5); min-width: 0; display: flex; flex-direction: column; gap: 2px; text-decoration: none; color: inherit; }
a.sr-kpi:hover, button.sr-kpi:hover { border-color: var(--sr-line-strong); }
button.sr-kpi { font: inherit; text-align: left; cursor: pointer; width: 100%; text-transform: none; letter-spacing: normal; }
button.sr-kpi[aria-expanded="true"] { border-color: var(--sr-teal-400); box-shadow: 0 0 0 1px var(--sr-teal-400); }
.sr-kpi--sm .sr-kpi__value { font-size: var(--sr-size-2xl); }
.sr-kpi__label { font-size: var(--sr-size-sm); color: var(--sr-text-soft); font-weight: var(--sr-weight-medium); }
.sr-kpi__value { font-family: var(--sr-font-display); font-size: var(--sr-size-3xl); font-weight: var(--sr-weight-bold); color: var(--sr-heading); font-variant-numeric: tabular-nums; line-height: 1.15; letter-spacing: var(--sr-track-tight); overflow-wrap: anywhere; }
.sr-kpi__note { font-size: var(--sr-size-sm); color: var(--sr-text-soft); }
.sr-kpi--success .sr-kpi__note { color: var(--sr-success-ink); }
.sr-kpi--warning .sr-kpi__note { color: var(--sr-warning-ink); }
.sr-kpi--danger  .sr-kpi__note { color: var(--sr-danger-ink); }
.sr-card .sr-kpi { border: 0; padding: 0; background: transparent; } /* a tile inside a card: no frame in a frame */
@media (max-width: 720px) {
  .sr-grid--4:has(> .sr-kpi), .sr-grid--3:has(> .sr-kpi) { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sr-space-2); } /* v1.326 P4: tiles 2 across on a phone */
  .sr-kpi { padding: var(--sr-space-3) var(--sr-space-4); }
  .sr-kpi__value { font-size: var(--sr-size-xl); }
}

/* ---------- empty state ---------- */
/* v1.326 P9: a 28 px faint icon (ui_empty() prints it from the one icon family) above a 16 / 600 title and 14 px text */
.sr-empty { text-align: center; padding: var(--sr-space-8) var(--sr-space-4); color: var(--sr-text-soft); }
.sr-empty__icon { display: block; width: 28px; height: 28px; margin: 0 auto var(--sr-space-3); color: var(--sr-text-faint); }
.sr-empty__icon svg { width: 28px; height: 28px; display: block; }
.sr-empty__title { font-family: var(--sr-font-body); font-size: var(--sr-size-lg); font-weight: var(--sr-weight-semibold); color: var(--sr-text); margin: 0 0 var(--sr-space-1); }
.sr-empty__text { margin: 0 auto var(--sr-space-4); max-width: 44ch; font-size: var(--sr-size-md); }

/* ---------- inline alerts ---------- */
.sr-alert { display: flex; gap: var(--sr-space-3); align-items: flex-start; padding: var(--sr-space-3) var(--sr-space-4); border-radius: var(--sr-radius-md); border: 1px solid var(--sr-info-line); background: var(--sr-info-bg); color: var(--sr-info-ink); font-size: var(--sr-size-sm); margin: 0 0 var(--sr-space-4); }
.sr-alert > span, .sr-alert > p, .sr-card > p, .sr-card__sub { max-width: var(--sr-measure); } /* v1.326 P2: readable lines */
.sr-alert--success { border-color: var(--sr-success-line); background: var(--sr-success-bg); color: var(--sr-success-ink); }
.sr-alert--warning { border-color: var(--sr-warning-line); background: var(--sr-warning-bg); color: var(--sr-warning-ink); }
.sr-alert--danger  { border-color: var(--sr-danger-line);  background: var(--sr-danger-bg);  color: var(--sr-danger-ink); }
.sr-alert a { color: inherit; font-weight: var(--sr-weight-semibold); }

/* ---------- confirm dialog ---------- */
.sr-dialog { border: 1px solid var(--sr-line); border-radius: var(--sr-radius-lg); padding: var(--sr-space-6); max-width: min(440px, calc(100vw - 32px)); background: var(--sr-surface); color: var(--sr-text); box-shadow: var(--sr-shadow-3); }
dialog.sr-dialog:not([open]) { display: none; } /* v1.326.1: a closed pop-up is never drawn, whatever display a page gives it */
.sr-dialog::backdrop { background: color-mix(in srgb, var(--sr-overlay) 45%, transparent); }
.sr-dialog__text { margin: 0 0 var(--sr-space-5); font-size: var(--sr-size-lg); line-height: var(--sr-leading); }
.sr-dialog__actions { display: flex; gap: var(--sr-space-2); justify-content: flex-end; }

/* ---------- a window over the page (hidden attribute opens / closes it) ---------- */
.sr-modal { position: fixed; inset: 0; z-index: 9400; display: flex; align-items: center; justify-content: center; padding: var(--sr-space-4); background: color-mix(in srgb, var(--sr-overlay) 45%, transparent); }
.sr-modal__panel { background: var(--sr-surface); color: var(--sr-text); border-radius: var(--sr-radius-lg); box-shadow: var(--sr-shadow-3); width: min(480px, 100%); max-height: 92vh; overflow: auto; padding: var(--sr-space-6); display: flex; flex-direction: column; gap: var(--sr-space-4); }
.sr-modal__title { font-family: var(--sr-font-display); font-size: var(--sr-size-xl); color: var(--sr-heading); margin: 0; }

/* ---------- a signature picture ---------- */
.sr-signature { max-width: 260px; border: 1px solid var(--sr-line); border-radius: var(--sr-radius-md); background: var(--sr-surface); }
[data-mode="dark"] .sr-signature { background: var(--sr-text); }

/* ---------- pop-up notices: one stack, bottom right, never over the header ---------- */
.sr-toasts { position: fixed; right: var(--sr-space-4); bottom: var(--sr-space-4); z-index: 9000; display: flex; flex-direction: column-reverse; gap: var(--sr-space-2); width: min(380px, calc(100vw - 32px)); max-height: calc(100vh - var(--sr-topbar-h) - 32px); overflow-y: auto; pointer-events: none; }
/* v1.326 P9: a toast is a pop-over (elevation 2) with a quiet 2 px status edge, not a 4 px bar */
.sr-toast { --sr-toast-edge: var(--sr-info-ink); pointer-events: auto; display: flex; gap: var(--sr-space-3); align-items: flex-start; background: var(--sr-surface); color: var(--sr-text); border: 1px solid var(--sr-line); border-radius: var(--sr-radius-md); box-shadow: inset 2px 0 0 var(--sr-toast-edge), var(--sr-shadow-2); padding: var(--sr-space-3) var(--sr-space-4); font-size: var(--sr-size-md); animation: sr-toast-in var(--sr-dur-base) var(--sr-ease); }
.sr-toast--success { --sr-toast-edge: var(--sr-success-ink); }
.sr-toast--warning { --sr-toast-edge: var(--sr-warning-ink); }
.sr-toast--danger  { --sr-toast-edge: var(--sr-danger-ink); }
.sr-toast__body { flex: 1; min-width: 0; }
.sr-toast__close { background: none; border: 0; min-height: 0; padding: 0 var(--sr-space-1); color: var(--sr-text-soft); font-size: var(--sr-size-lg); line-height: 1; cursor: pointer; }
@keyframes sr-toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (max-width: 720px) { .sr-toasts { right: var(--sr-space-2); left: var(--sr-space-2); width: auto; bottom: calc(var(--sr-space-2) + env(safe-area-inset-bottom)); } }

/* ---------- pager ---------- */
.sr-pager { display: flex; align-items: center; justify-content: space-between; gap: var(--sr-space-3); padding: var(--sr-space-3) var(--sr-space-4); border-top: 1px solid var(--sr-line); font-size: var(--sr-size-sm); color: var(--sr-text-soft); flex-wrap: wrap; }
.sr-pager__links { display: flex; gap: var(--sr-space-1); }

/* ---------- key–value list ---------- */
.sr-kv { display: grid; grid-template-columns: minmax(110px, max-content) minmax(0, 1fr); gap: var(--sr-space-2) var(--sr-space-4); margin: 0; font-size: var(--sr-size-md); }
.sr-kv dt { color: var(--sr-text-soft); }
.sr-kv dd { margin: 0; color: var(--sr-text); overflow-wrap: anywhere; }
.sr-kv--wrap dd { word-break: break-all; }
@media (max-width: 480px) { .sr-kv { grid-template-columns: minmax(0, 1fr); gap: 2px; } .sr-kv dd { margin-bottom: var(--sr-space-2); } }

/* ---------- avatar ---------- */
.sr-avatar { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 50%; background: var(--sr-teal-100); color: var(--sr-teal); font-weight: var(--sr-weight-bold); font-size: var(--sr-size-sm); flex: none; overflow: hidden; }
[data-mode="dark"] .sr-avatar { background: var(--sr-surface-2); color: var(--sr-heading); }
.sr-avatar img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- skeleton loader ---------- */
/* v1.326 P9: a soft pulse instead of the moving shimmer (still under reduced motion) */
.sr-skel { display: block; height: 14px; border-radius: var(--sr-radius-sm); background: var(--sr-surface-2); animation: sr-skel-pulse 1.4s var(--sr-ease) infinite; }
@keyframes sr-skel-pulse { 50% { opacity: .55; } }
@media (prefers-reduced-motion: reduce) { .sr-skel { animation: none; } }

/* ---------- list rows (activity, feeds) ---------- */
.sr-list { list-style: none; margin: 0; padding: 0; }
.sr-list > li { display: flex; gap: var(--sr-space-3); align-items: flex-start; padding: var(--sr-space-3) 0; border-bottom: 1px solid var(--sr-line); }
.sr-list > li:last-child { border-bottom: 0; }
.sr-list > li:first-child { padding-top: 0; }
.sr-list--center > li { align-items: center; }
.sr-list__lead { flex: none; min-width: 52px; font-size: var(--sr-size-sm); font-weight: var(--sr-weight-semibold); color: var(--sr-text-soft); font-variant-numeric: tabular-nums; }
.sr-list__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.sr-list__title { font-weight: var(--sr-weight-semibold); color: var(--sr-text); overflow-wrap: anywhere; }
a.sr-list__title { color: var(--sr-link); text-decoration: none; }
a.sr-list__title:hover { text-decoration: underline; }
.sr-list__sub { font-size: var(--sr-size-sm); color: var(--sr-text-soft); overflow-wrap: anywhere; }
.sr-list__end { flex: none; display: flex; align-items: center; gap: var(--sr-space-2); text-align: right; font-size: var(--sr-size-sm); }
.sr-list__end--danger { color: var(--sr-danger-ink); font-weight: var(--sr-weight-semibold); }
.sr-list__end--warning { color: var(--sr-warning-ink); font-weight: var(--sr-weight-semibold); }
/* v1.326: a phone list title never shrinks below 180 px, so the row wraps its actions under it instead of breaking the
   title letter by letter (Customer → "Monthly energy digest") */
@media (max-width: 560px) { .sr-list > li { flex-wrap: wrap; } .sr-list__body { min-width: min(180px, 100%); } .sr-list__end { width: 100%; justify-content: flex-start; text-align: left; } }

/* ---------- stats inside a card (label under a figure) ---------- */
.sr-stats { display: flex; flex-wrap: wrap; gap: var(--sr-space-3) var(--sr-space-6); }
.sr-stat { display: flex; flex-direction: column; gap: 2px; min-width: 90px; }
.sr-stat__value { font-family: var(--sr-font-display); font-size: var(--sr-size-xl); font-weight: var(--sr-weight-bold); color: var(--sr-heading); font-variant-numeric: tabular-nums; line-height: 1.2; }
.sr-stat__label { font-size: var(--sr-size-sm); color: var(--sr-text-soft); }
.sr-stat--danger .sr-stat__value { color: var(--sr-danger-ink); }

/* ---------- progress bar (width from data: style="width:<?= … ?>%") ---------- */
.sr-progress { height: 8px; border-radius: var(--sr-radius-pill); background: var(--sr-surface-2); overflow: hidden; }
.sr-progress > span { display: block; height: 100%; border-radius: var(--sr-radius-pill); background: var(--sr-success-ink); }
.sr-progress--accent > span { background: var(--sr-accent); }
.sr-progress--success > span { background: var(--sr-success-ink); }
.sr-progress--danger > span { background: var(--sr-danger-ink); }
.sr-progress--warning > span { background: var(--sr-warning-ink); } /* v1.291 */
.sr-meter { display: flex; align-items: center; gap: 6px; min-width: 120px; } /* v1.291: a bar with its figure */
.sr-meter .sr-progress { flex: 1; height: 6px; }
.sr-meter__n { font-size: var(--sr-size-xs); color: var(--sr-text-soft); min-width: 44px; text-align: right; font-variant-numeric: tabular-nums; }
.sr-progress__label { display: flex; justify-content: space-between; font-size: var(--sr-size-sm); color: var(--sr-text-soft); margin-top: var(--sr-space-1); }

/* ---------- change against last period ---------- */
.sr-delta { display: inline-flex; align-self: flex-start; font-size: var(--sr-size-xs); font-weight: var(--sr-weight-semibold); padding: 1px 8px; border-radius: var(--sr-radius-pill); background: var(--sr-neutral-bg); color: var(--sr-neutral-ink); font-variant-numeric: tabular-nums; }
.sr-delta--up { background: var(--sr-success-bg); color: var(--sr-success-ink); }
.sr-delta--down { background: var(--sr-danger-bg); color: var(--sr-danger-ink); }

/* ---------- a section you can open and close ---------- */
.sr-disclosure { border: 1px solid var(--sr-line); border-radius: var(--sr-radius-lg); background: var(--sr-surface); }
.sr-disclosure > summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: var(--sr-space-3); padding: var(--sr-space-4) var(--sr-space-5); font-family: var(--sr-font-body); font-weight: var(--sr-weight-semibold); font-size: var(--sr-size-lg); color: var(--sr-text); }
.sr-disclosure > summary::-webkit-details-marker { display: none; }
.sr-disclosure > summary small { font-family: var(--sr-font-body); font-weight: var(--sr-weight-regular); font-size: var(--sr-size-sm); color: var(--sr-text-soft); }
.sr-disclosure > summary::after { content: ""; width: 8px; height: 8px; border-right: 2px solid var(--sr-text-soft); border-bottom: 2px solid var(--sr-text-soft); transform: rotate(45deg); transition: transform var(--sr-dur-fast) var(--sr-ease); flex: none; }
.sr-disclosure[open] > summary::after { transform: rotate(-135deg); }
.sr-disclosure__body { padding: 0 var(--sr-space-5) var(--sr-space-5); display: flex; flex-direction: column; gap: var(--sr-space-4); }

/* ---------- checklist ---------- */
.sr-checklist { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(220px, 100%), 1fr)); gap: var(--sr-space-2) var(--sr-space-4); }
.sr-checklist li { display: flex; gap: var(--sr-space-2); align-items: center; font-size: var(--sr-size-sm); }
.sr-checklist__tick { width: 18px; height: 18px; border-radius: 50%; flex: none; display: inline-flex; align-items: center; justify-content: center; font-size: var(--sr-size-xs); border: 1px solid var(--sr-line-strong); color: var(--sr-text-soft); background: var(--sr-surface-2); }
.sr-checklist .is-done .sr-checklist__tick { border-color: var(--sr-success-line); background: var(--sr-success-bg); color: var(--sr-success-ink); }
.sr-checklist .is-done span:last-child { color: var(--sr-text-soft); text-decoration: line-through; }

/* ---------- alert cards (includes/alerts_view.php markup: Notifications, Alert routing) ---------- */
.alv-list { display: flex; flex-direction: column; gap: var(--sr-space-2); margin: 0; padding: 0; list-style: none; }
.sr-app .alv-card { border: 1px solid var(--sr-line); border-radius: var(--sr-radius-lg); padding: var(--sr-space-3) var(--sr-space-4); background: var(--sr-surface); overflow-wrap: anywhere; }
.sr-app .alv-card.is-unread { border-left: 4px solid var(--sr-accent); }
.sr-app .alv-card h3 { font-family: var(--sr-font-body); font-size: var(--sr-size-md); font-weight: var(--sr-weight-semibold); color: var(--sr-text); margin: var(--sr-space-1) 0; }
.sr-app .alv-meta { display: flex; flex-wrap: wrap; gap: var(--sr-space-1) var(--sr-space-3); font-size: var(--sr-size-sm); color: var(--sr-text-soft); align-items: center; }
.sr-app .alv-meta--foot { margin-top: var(--sr-space-2); }
.sr-app .alv-body { white-space: pre-line; font-size: var(--sr-size-md); color: var(--sr-text); margin: var(--sr-space-1) 0 0; }
.sr-app .alv-actions { display: flex; flex-wrap: wrap; gap: var(--sr-space-2); margin-top: var(--sr-space-3); align-items: center; }
.sr-app .alv-actions form { margin: 0; }
.sr-app .alv-note { width: 240px; max-width: 100%; min-height: 30px; font-size: var(--sr-size-sm); }
.sr-app .alv-pill { display: inline-flex; align-items: center; padding: 1px 8px; border-radius: var(--sr-radius-pill); font-size: var(--sr-size-xs); font-weight: var(--sr-weight-semibold); text-transform: none; letter-spacing: normal; background: var(--sr-neutral-bg); color: var(--sr-neutral-ink); border: 1px solid var(--sr-neutral-line); }
.sr-app .alv-pill[data-sev="INFO"] { background: var(--sr-info-bg); color: var(--sr-info-ink); border-color: var(--sr-info-line); }
.sr-app .alv-pill[data-sev="WARNING"] { background: var(--sr-warning-bg); color: var(--sr-warning-ink); border-color: var(--sr-warning-line); }
.sr-app .alv-pill[data-sev="SERIOUS"], .sr-app .alv-pill[data-sev="CRITICAL"] { background: var(--sr-danger-bg); color: var(--sr-danger-ink); border-color: var(--sr-danger-line); }
.sr-app .alv-st { font-size: var(--sr-size-xs); font-weight: var(--sr-weight-semibold); }
.sr-app .alv-st[data-st="OPEN"] { color: var(--sr-danger-ink); }
.sr-app .alv-st[data-st="ACKNOWLEDGED"] { color: var(--sr-success-ink); }
.sr-app .alv-st[data-st="RESOLVED"] { color: var(--sr-text-soft); }
.sr-app .alv-steps { margin: var(--sr-space-2) 0 0; font-size: var(--sr-size-sm); }
.sr-app .alv-steps summary { cursor: pointer; color: var(--sr-link); font-weight: var(--sr-weight-semibold); }
.sr-app .alv-scroll { overflow-x: auto; max-width: 100%; }
.sr-app .alv-table { border-collapse: collapse; width: 100%; font-size: var(--sr-size-sm); }
.sr-app .alv-table th, .sr-app .alv-table td { text-align: left; padding: var(--sr-space-1) var(--sr-space-2); border-bottom: 1px solid var(--sr-line); vertical-align: top; }
.sr-app .alv-ok { color: var(--sr-success-ink); font-weight: var(--sr-weight-semibold); }
.sr-app .alv-bad { color: var(--sr-danger-ink); font-weight: var(--sr-weight-semibold); }
.sr-app .alv-skip { color: var(--sr-text-faint); }

/* ---------- line items editor (new quote, new invoice) ---------- */
.sr-lines { width: 100%; border-collapse: collapse; font-size: var(--sr-size-md); min-width: 760px; }
.sr-lines th { text-align: left; font-size: var(--sr-size-sm); font-weight: var(--sr-weight-semibold); color: var(--sr-text-soft); padding: var(--sr-space-2); border-bottom: 1px solid var(--sr-line-strong); white-space: nowrap; }
.sr-lines td { padding: var(--sr-space-2); border-bottom: 1px solid var(--sr-line); vertical-align: top; }
.sr-lines :is(input, select) { width: 100%; min-height: var(--sr-control-h); }
.sr-lines .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.sr-lines .ln-total { padding-top: var(--sr-space-3); font-weight: var(--sr-weight-semibold); }
.sr-lines .ln-price-cell { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--sr-space-1); align-items: center; }
.sr-lines .ln-price-cell .ln-cur { width: auto; padding-right: var(--sr-space-6); }
.sr-lines .ln-cost-hint { grid-column: 1 / -1; font-size: var(--sr-size-xs); color: var(--sr-text-soft); }
.sr-lines .ln-cost-hint:empty { display: none; }
.sr-lines td > .ln-cost-hint { display: block; margin-top: 2px; }
.sr-lines .ln-cost-suggest { color: var(--sr-link); text-decoration: underline; cursor: pointer; }
.sr-lines .ln-remove { background: none; border: 0; min-height: var(--sr-control-h); width: 32px; color: var(--sr-text-soft); cursor: pointer; font-size: var(--sr-size-lg); border-radius: var(--sr-radius-sm); }
.sr-lines .ln-remove:hover { background: var(--sr-danger-bg); color: var(--sr-danger-ink); }
.sr-lines .ln-margin { padding-top: var(--sr-space-3); font-size: var(--sr-size-sm); color: var(--sr-text-soft); }
.sr-lines .ln-margin.is-below { color: var(--sr-danger-ink); font-weight: var(--sr-weight-bold); }
.sr-lines .ln-margin.is-thin { color: var(--sr-warning-ink); }
.sr-lines tr.qi-below td { background: var(--sr-danger-bg); }
.sr-lines tr.qi-thin td { background: var(--sr-warning-bg); }
.sr-lines .col-item { width: 170px; } .sr-lines .col-qty { width: 72px; } .sr-lines .col-price { width: 180px; }
.sr-lines .col-cost { width: 100px; } .sr-lines .col-margin { width: 72px; } .sr-lines .col-tax { width: 140px; }
.sr-lines .col-total { width: 112px; } .sr-lines .col-x { width: 36px; }
.sr-totals { display: flex; flex-direction: column; align-items: flex-end; gap: var(--sr-space-1); font-size: var(--sr-size-md); font-variant-numeric: tabular-nums; }
.sr-totals p { margin: 0; color: var(--sr-text-soft); }
.sr-totals strong { color: var(--sr-text); }
.sr-totals .sr-totals__grand { font-size: var(--sr-size-xl); color: var(--sr-text); }
.sr-totals .sr-totals__grand strong { font-family: var(--sr-font-display); color: var(--sr-heading); }
/* catalogue suggestions under the "Find an item" box */
.qi-wrap { position: relative; }
.qi-sug { position: absolute; z-index: 40; left: 0; top: 100%; min-width: 340px; max-width: 460px; background: var(--sr-surface); color: var(--sr-text); border: 1px solid var(--sr-line); border-radius: var(--sr-radius-md); box-shadow: var(--sr-shadow-2); max-height: 300px; overflow: auto; }
.qi-sug button { display: flex; width: 100%; justify-content: space-between; gap: var(--sr-space-3); text-align: left; background: none; border: 0; border-bottom: 1px solid var(--sr-line); padding: var(--sr-space-2) var(--sr-space-3); cursor: pointer; font-size: var(--sr-size-sm); color: var(--sr-text); min-height: 0; }
.qi-sug button:hover, .qi-sug button.is-on { background: var(--sr-surface-2); }
.qi-sug small { color: var(--sr-text-soft); }
.qi-sug .qi-add { color: var(--sr-link); font-weight: var(--sr-weight-bold); }
/* cost, profit and margin while quoting — only people allowed to see costs */
.qc-box { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sr-space-3); margin-left: auto; max-width: 560px; border: 1px solid var(--sr-warning-line); background: var(--sr-warning-bg); border-radius: var(--sr-radius-lg); padding: var(--sr-space-3) var(--sr-space-4); }
.qc-box span { display: block; font-size: var(--sr-size-xs); color: var(--sr-text-soft); }
.qc-box b { font-size: var(--sr-size-lg); color: var(--sr-text); font-variant-numeric: tabular-nums; }
.qc-box b.is-below { color: var(--sr-danger-ink); } .qc-box b.is-thin { color: var(--sr-warning-ink); }
.qc-warn { grid-column: 1 / -1; margin: 0; color: var(--sr-danger-ink); font-weight: var(--sr-weight-semibold); font-size: var(--sr-size-sm); }
.qc-note { grid-column: 1 / -1; margin: 0; font-size: var(--sr-size-xs); color: var(--sr-text-soft); }

/* ---------- bridge: older partials inside a moved page ----------
   Shared panels (contacts, documents, the customer overview strip, …) still print their older
   markup until their own wave. On a moved page (.sr-app) they take the kit's look and the dark
   mode: the older colour variables point at the tokens, and the common older classes are restyled. */
.sr-app {
  --paper: var(--sr-bg); --ink: var(--sr-text); --ink-soft: var(--sr-text-soft); --fog: var(--sr-text-faint);
  --line-light: var(--sr-line); --card: var(--sr-surface); --orange-ink: var(--sr-orange-ink);
  --orange-dark: var(--sr-orange-ink); --orange-tint: var(--sr-orange-50);
  --line: var(--sr-line-strong); --input-bg: var(--sr-surface);
  /* v1.291: money.css (comment threads on a purchase order, …) */
  --mn-teal: var(--sr-heading); --mn-ink: var(--sr-text); --mn-soft: var(--sr-text-soft); --mn-line: var(--sr-line);
  --mn-paper: var(--sr-surface-2); --mn-in: var(--sr-success-ink); --mn-out: var(--sr-danger-ink);
}
/* the no-receipt questions (includes/no_receipt.php nr_form_fields; inside the job page's expense form and the no-receipt register) — v1.294 */
.sr-app .nr-fields { grid-column: 1 / -1; margin: 0; padding: var(--sr-space-3); border: 1px solid var(--sr-warning-line); border-radius: var(--sr-radius-md); background: var(--sr-warning-bg); color: var(--sr-text); min-width: 0; }
.sr-app .nr-fields legend { padding: 0 var(--sr-space-1); font-weight: var(--sr-weight-bold); font-size: var(--sr-size-sm); color: var(--sr-heading); }
.sr-app .detail-section { background: var(--sr-surface); border: 1px solid var(--sr-line); border-radius: var(--sr-radius-lg); padding: var(--sr-space-6); margin: 0 0 var(--sr-space-4); color: var(--sr-text); }
.sr-app .detail-section h2 { font-family: var(--sr-font-body); font-size: var(--sr-size-lg); font-weight: var(--sr-weight-semibold); text-transform: none; letter-spacing: normal; color: var(--sr-text); margin: 0 0 var(--sr-space-3); }
.sr-app .detail-section p { font-size: var(--sr-size-sm); max-width: var(--sr-measure); }
.sr-app .error-box { background: var(--sr-danger-bg); color: var(--sr-danger-ink); border: 1px solid var(--sr-danger-line); border-radius: var(--sr-radius-md); padding: var(--sr-space-3) var(--sr-space-4); margin: 0 0 var(--sr-space-3); font-size: var(--sr-size-md); }
.sr-app .btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--sr-space-2); min-height: var(--sr-control-h); padding: 0 var(--sr-space-4); border-radius: var(--sr-radius-md); border: 1px solid var(--sr-line-strong); background: var(--sr-surface); color: var(--sr-text); font-family: var(--sr-font-body); font-size: var(--sr-size-md); font-weight: var(--sr-weight-semibold); text-transform: none; letter-spacing: normal; text-decoration: none; box-shadow: none; transform: none; cursor: pointer; }
.sr-app .btn:hover { background: var(--sr-surface-2); color: var(--sr-text); border-color: var(--sr-line-strong); transform: none; box-shadow: none; }
.sr-app .btn--primary { background: var(--sr-surface); border-color: var(--sr-line-strong); color: var(--sr-text); }
.sr-app .btn--sm, .sr-app .btn-mini { min-height: 32px; padding: 0 var(--sr-space-3); font-size: var(--sr-size-sm); }
.sr-app .btn-mini { border-radius: var(--sr-radius-md); border: 1px solid var(--sr-line-strong); background: var(--sr-surface); color: var(--sr-text); font-weight: var(--sr-weight-semibold); }
.sr-app .priority-badge { font-family: var(--sr-font-body); font-size: var(--sr-size-xs); font-weight: var(--sr-weight-semibold); text-transform: none; letter-spacing: normal; border-radius: var(--sr-radius-pill); padding: 1px 8px; border: 1px solid var(--sr-neutral-line); background: var(--sr-neutral-bg); color: var(--sr-neutral-ink); }
.sr-app .priority-badge.HIGH { background: var(--sr-danger-bg); color: var(--sr-danger-ink); border-color: var(--sr-danger-line); }
.sr-app .priority-badge.MEDIUM { background: var(--sr-warning-bg); color: var(--sr-warning-ink); border-color: var(--sr-warning-line); }
.sr-app .field { display: flex; flex-direction: column; gap: var(--sr-space-1); margin: 0 0 var(--sr-space-3); }
.sr-app .field label { font-size: var(--sr-size-sm); font-weight: var(--sr-weight-semibold); color: var(--sr-text); text-transform: none; letter-spacing: normal; }
.sr-app .field input, .sr-app .field select, .sr-app .field textarea { width: 100%; box-sizing: border-box; }
.sr-app :is(input:not([type="checkbox"], [type="radio"], [type="range"], [type="color"], [type="file"], [type="hidden"], [type="submit"], [type="button"]), select, textarea) {
  background-color: var(--sr-surface); color: var(--sr-text); border-color: var(--sr-control-line);
}
.sr-app :is(input, select, textarea)::placeholder { color: var(--sr-text-faint); }
.sr-app details > summary { color: var(--sr-link); }
.sr-app .staff-row { border-top: 1px solid var(--sr-line); }
.sr-app .staff-row .name { color: var(--sr-text); }
.sr-app .staff-row .email { color: var(--sr-text-soft); }
.sr-app .expense-table th { font-family: var(--sr-font-body); font-size: var(--sr-size-sm); font-weight: var(--sr-weight-semibold); text-transform: none; letter-spacing: normal; color: var(--sr-text-soft); border-bottom: 1px solid var(--sr-line-strong); }
.sr-app .expense-table td { color: var(--sr-text); border-bottom: 1px solid var(--sr-line); }
.sr-app .mono { font-family: var(--sr-font-mono); }
/* "← Job …" link at the top of a document (job_backlink(); inline colours, hence !important) */
.sr-app .job-backlink { background: var(--sr-surface) !important; border-color: var(--sr-line) !important; color: var(--sr-link) !important; }
.sr-app .job-backlink span { color: var(--sr-text-soft) !important; }
.sr-app .job-backlink-row { margin: 0 0 var(--sr-space-3); }
/* the working-year line on lists (fiscal_year_bar(); its colours are inline, hence !important) */
.sr-app .fy-bar { background: var(--sr-surface-2) !important; color: var(--sr-text-soft); border: 1px solid var(--sr-line); border-radius: var(--sr-radius-md) !important; font-size: var(--sr-size-sm) !important; margin: 0 0 var(--sr-space-4) !important; }
.sr-app .fy-bar strong { color: var(--sr-text); }
.sr-app .fy-bar span:last-child { color: var(--sr-text-faint) !important; }
/* the customer overview strip (includes/customer_overview_view.php) */
.sr-app .ov-sum { gap: var(--sr-space-3); margin: 0 0 var(--sr-space-4); }
.sr-app .ov-sum > div { background: var(--sr-surface); border: 1px solid var(--sr-line); border-radius: var(--sr-radius-lg); padding: var(--sr-space-4); min-width: 0; }
/* v1.326 P14: the summary tiles go 2 across on a phone (about 600 px less scroll before the details) */
@media (max-width: 720px) {
  .sr-app .ov-sum { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sr-space-2); }
  .sr-app .ov-sum > div { padding: var(--sr-space-3); }
  .sr-app .ov-sum strong { font-size: var(--sr-size-lg); overflow-wrap: anywhere; }
}
.sr-app .ov-sum span { font-size: var(--sr-size-sm); font-weight: var(--sr-weight-medium); text-transform: none; letter-spacing: normal; color: var(--sr-text-soft); }
.sr-app .ov-sum strong { font-family: var(--sr-font-display); font-size: var(--sr-size-xl); color: var(--sr-heading); }
.sr-app .ov-sum small { font-size: var(--sr-size-sm); color: var(--sr-text-soft); }
.sr-app .ov-sum .is-owing strong { color: var(--sr-danger-ink); }
.sr-app .ov-sum .is-soon { border-color: var(--sr-warning-line); background: var(--sr-warning-bg); }
.sr-app .sr-card--flush .ov-table-wrap { border: 0; border-radius: 0; background: none; }

/* ---------- print: kit pieces print plainly ---------- */
@media print {
  .sr-btn, .sr-toasts, .sr-tabs, .sr-toolbar, .sr-page-head__actions, .sr-noprint { display: none !important; }
  .sr-card, .sr-kpi { box-shadow: none; }
}

/* ---------- chips: a row of choices (pipeline stages, where an item goes) ---------- */
.sr-chips { display: flex; flex-wrap: wrap; gap: var(--sr-space-2); }
.sr-chip, .sr-app .stage-pill { display: inline-flex; align-items: center; min-height: 32px; padding: 0 var(--sr-space-3); border-radius: var(--sr-radius-pill); border: 1px solid var(--sr-line-strong); background: var(--sr-surface); color: var(--sr-text); font-family: var(--sr-font-body); font-size: var(--sr-size-sm); font-weight: var(--sr-weight-medium); text-transform: none; letter-spacing: normal; cursor: pointer; transition: border-color var(--sr-dur-fast) var(--sr-ease), background var(--sr-dur-fast) var(--sr-ease); }
.sr-chip:hover, .sr-app .stage-pill:hover { border-color: var(--sr-link); }
.sr-chip:focus-visible, .sr-app .stage-pill:focus-visible { outline: 2px solid var(--sr-focus); outline-offset: 2px; }
.sr-chip.is-active, .sr-app .stage-pill.current { background: var(--sr-info-bg); border-color: var(--sr-info-line); color: var(--sr-info-ink); font-weight: var(--sr-weight-semibold); cursor: default; }
span.sr-chip { cursor: default; }

/* ---------- photo thumbnails, upload drop-zones, a quoted note, a pick card ---------- */
.sr-thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: var(--sr-space-2); }
.sr-thumbs img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--sr-radius-md); border: 1px solid var(--sr-line); }
.sr-upload { display: flex; align-items: center; gap: var(--sr-space-2); min-height: var(--sr-tap); padding: var(--sr-space-3) var(--sr-space-4); border: 1px dashed var(--sr-line-strong); border-radius: var(--sr-radius-md); color: var(--sr-link); font-size: var(--sr-size-sm); font-weight: var(--sr-weight-semibold); cursor: pointer; }
.sr-upload:hover { background: var(--sr-surface-2); border-color: var(--sr-link); }
.sr-upload:focus-within { outline: 2px solid var(--sr-focus); outline-offset: 2px; }
.sr-note { margin: 0; padding: var(--sr-space-2) var(--sr-space-3); border-radius: var(--sr-radius-md); background: var(--sr-surface-2); color: var(--sr-text); font-size: var(--sr-size-sm); }
.sr-note--warning { background: var(--sr-warning-bg); color: var(--sr-warning-ink); border: 1px solid var(--sr-warning-line); }
.sr-pick { display: flex; flex-direction: column; align-items: flex-start; gap: var(--sr-space-1); padding: var(--sr-space-3); border: 1px solid var(--sr-line); border-radius: var(--sr-radius-md); background: var(--sr-surface); min-width: 0; }
.sr-pick__title { font-weight: var(--sr-weight-semibold); font-size: var(--sr-size-sm); color: var(--sr-link); overflow-wrap: anywhere; }
.sr-pick__meta { font-size: var(--sr-size-xs); color: var(--sr-text-soft); margin-bottom: var(--sr-space-1); }

/* ---------- a quiet fold inside a card (history, archives) ---------- */
.sr-disclosure--plain { border: 0; border-top: 1px solid var(--sr-line); border-radius: 0; background: none; }
.sr-disclosure--plain > summary { justify-content: flex-start; padding: var(--sr-space-3) 0 0; font-family: var(--sr-font-body); font-size: var(--sr-size-sm); font-weight: var(--sr-weight-semibold); color: var(--sr-text-soft); }
.sr-disclosure--plain > summary::after { width: 6px; height: 6px; }
.sr-disclosure--plain > .sr-disclosure__body { padding: var(--sr-space-3) 0 0; }

/* "Match my device": the dark-only component rules above, when the device is dark */
@media (prefers-color-scheme: dark) {
  [data-mode="auto"] .sr-tabs__item.is-active .sr-tabs__count { background: var(--sr-surface-2); color: var(--sr-heading); }
  [data-mode="auto"] .sr-signature { background: var(--sr-text); }
  [data-mode="auto"] .sr-avatar { background: var(--sr-surface-2); color: var(--sr-heading); }
}

/* ---------- a list of conversations beside the open one (v1.290: Chat Inbox) ---------- */
.sr-split { display: grid; grid-template-columns: minmax(220px, 300px) minmax(0, 1fr); gap: var(--sr-space-4); align-items: start; }
@media (max-width: 860px) { .sr-split { grid-template-columns: minmax(0, 1fr); } }
.sr-threads { padding: var(--sr-space-2); max-height: 72vh; overflow: auto; }
.sr-thread { display: block; padding: var(--sr-space-3); border-radius: var(--sr-radius-md); color: inherit; text-decoration: none; border: 1px solid transparent; overflow-wrap: anywhere; }
.sr-thread:hover { background: var(--sr-surface-2); }
.sr-thread.is-on { border-color: var(--sr-link); background: var(--sr-surface-2); } /* v1.326: a selection is teal; orange is for the main action */
.sr-thread__name { display: flex; justify-content: space-between; gap: 6px; color: var(--sr-heading); font-weight: var(--sr-weight-semibold); font-size: var(--sr-size-sm); margin: 0; }
.sr-thread__last { display: block; color: var(--sr-text-soft); font-size: var(--sr-size-xs); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin: 2px 0 0; }
.sr-thread__time { display: block; color: var(--sr-text-faint); font-size: var(--sr-size-xs); margin: 4px 0 0; }
.sr-msg { padding: 0 0 var(--sr-space-3); border-bottom: 1px solid var(--sr-line); }
.sr-msg:last-child { border-bottom: 0; }
.sr-msg__who { font-size: var(--sr-size-sm); font-weight: var(--sr-weight-semibold); color: var(--sr-heading); margin: 0; }
.sr-msg__who.is-them { color: var(--sr-warning-ink); }
.sr-msg__who small { font-weight: 400; color: var(--sr-text-soft); font-size: inherit; }
.sr-msg__body { margin: 2px 0 0; }

/* v1.326 MENU: the tab bar of a merged page (each tab = an old page at its old address), the views of one tab, and the
   quiet links to tools kept off the menu ("Also here"). Rendered by includes/admin_header.php → admin_nav_tabs_html(). */
.sr-pagetabs { margin: 0 0 var(--sr-space-3); }
.sr-pageviews { display: flex; flex-wrap: wrap; gap: var(--sr-space-1); margin: 0 0 var(--sr-space-4); }
.sr-pageviews__item { display: inline-flex; align-items: center; min-height: 32px; box-sizing: border-box; padding: 0 var(--sr-space-3); border-radius: var(--sr-radius-pill); border: 1px solid var(--sr-line); color: var(--sr-text-soft); text-decoration: none; font-size: var(--sr-size-sm); }
.sr-pageviews__item:hover { color: var(--sr-text); }
.sr-pageviews__item.is-active { background: var(--sr-surface-2); color: var(--sr-heading); border-color: var(--sr-line-strong); font-weight: var(--sr-weight-medium); }
.sr-pagetabs-also { margin: 0 0 var(--sr-space-4); font-size: var(--sr-size-sm); color: var(--sr-text-soft); }
.sr-pagetabs-also a { color: var(--sr-link); text-decoration: none; }
.sr-pagetabs-also a:hover { text-decoration: underline; }

/* v1.326 ICONS: a tile's icon before its label (decorative) */
.sr-kpi__label .ui-icon { margin-right: var(--sr-space-1); opacity: .75; }

/* v1.326.2 (the owner: "move that option to the top bar with orange colour with motion effects"): "N waiting on you" —
   the orange "your turn" pill in the staff top bar and the FieldApp header (includes/waiting_pill.php; not printed at 0).
   Dark ink on the brand orange (about 8 : 1, AA). A gentle ring on load, 2 s, three times at most, then still; none under
   reduced motion. A phone shows the icon and the count only, 44 × 44 px at least. */
.sr-waitpill {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; flex: none;
  min-height: 32px; padding: 0 12px; border-radius: var(--sr-radius-pill);
  background: var(--sr-orange); color: var(--sr-accent-ink); border: 0;
  font-family: var(--sr-font-body); font-size: var(--sr-size-sm); font-weight: var(--sr-weight-semibold); line-height: 1;
  text-decoration: none; white-space: nowrap;
}
.sr-waitpill:hover, .sr-waitpill:focus-visible { background: var(--sr-orange-300); color: var(--sr-accent-ink); text-decoration: none; }
.sr-waitpill:focus-visible { outline-offset: 2px; } /* the kit's focus ring (base.css, --sr-focus), light and dark */
.sr-waitpill__n { font-variant-numeric: tabular-nums; font-weight: var(--sr-weight-bold); }
.sr-waitpill .ui-icon { flex: none; }
@keyframes sr-waitpill-ring {
  0%   { box-shadow: 0 0 0 0 color-mix(in srgb, var(--sr-orange) 55%, transparent); }
  70%  { box-shadow: 0 0 0 9px color-mix(in srgb, var(--sr-orange) 0%, transparent); }
  100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--sr-orange) 0%, transparent); }
}
@media (prefers-reduced-motion: no-preference) {
  .sr-waitpill { animation: sr-waitpill-ring 2s ease-out 3; }
}
@media (prefers-reduced-motion: reduce) {
  .sr-waitpill { animation: none; }
}
@media (max-width: 820px) {
  body .sr-waitpill, body.admin-body .admin-topbar-right > a.sr-waitpill { min-width: var(--sr-tap); width: auto; min-height: var(--sr-tap); height: auto; padding: 0 10px; }
  .sr-waitpill__txt { display: none; }
}
/* the FieldApp header: the pill sits on its own line above the title row, at the right */
.sr-field-head__attn { display: flex; justify-content: flex-end; max-width: 560px; margin: calc(var(--sr-space-2) * -1) auto var(--sr-space-2); }

/* ---------- v1.331 TAB STYLE: the page tabs in the look each person picks on Appearance (owner-approved mockup
   tabs-mock). The look sits on the staff <html> as data-tabstyle (includes/admin_header.php), so it applies to every
   .sr-tabs bar on staff pages — the merged-page bar from admin_nav_tabs_html() and any in-page bar — and never to the
   site or the portals (no attribute there: they keep the plain underline above). Colours are the --sr-tab-* role
   tokens, which turn for dark mode in tokens.css (ratios checked by tools/design-contrast.php). Kept as before:
   aria-current, the 40 px height (44 px on a phone, shell.css), the scroll inside the bar on a phone (A, B), print hiding.
   A — a segmented bar: soft teal track, the open tab a solid dark-teal button, counts orange ---------- */
[data-tabstyle="a"] .sr-tabs { width: max-content; max-width: 100%; box-sizing: border-box; gap: var(--sr-space-1); padding: var(--sr-space-1); background: var(--sr-tab-track); border: 0; border-radius: var(--sr-radius-lg); }
[data-tabstyle="a"] .sr-tabs__item { padding: var(--sr-space-2) 14px; margin: 0; border: 0; border-radius: 9px; color: var(--sr-tab-ink); transition: background-color var(--sr-dur-fast) var(--sr-ease), color var(--sr-dur-fast) var(--sr-ease); }
[data-tabstyle="a"] .sr-tabs__item:hover:not(.is-active) { background: var(--sr-tab-hover); color: var(--sr-tab-ink); }
[data-tabstyle="a"] .sr-tabs__item.is-active { background: var(--sr-tab-on); color: var(--sr-tab-on-ink); font-weight: var(--sr-weight-semibold); box-shadow: 0 1px 3px color-mix(in srgb, var(--sr-teal-700) 30%, transparent); }
[data-tabstyle="a"] .sr-tabs__item:focus-visible { outline: 2px solid var(--sr-focus); outline-offset: 1px; }
[data-tabstyle="a"] .sr-tabs__count, [data-tabstyle="a"] .sr-tabs__item.is-active .sr-tabs__count { background: var(--sr-accent); color: var(--sr-accent-ink); font-weight: var(--sr-weight-bold); padding: 1px 7px; line-height: 1.4; }
[data-tabstyle="a"] .sr-pageviews__item.is-active, [data-tabstyle="b"] .sr-pageviews__item.is-active { background: var(--sr-tab-soft); color: var(--sr-heading); border-color: var(--sr-tab-soft-line); font-weight: var(--sr-weight-semibold); }

/* B — a white strip: the open tab has a 3 px orange underline and a warm tint; counts teal, orange on the open tab */
[data-tabstyle="b"] .sr-tabs { gap: 2px; padding: 0 6px; background: var(--sr-surface); border-bottom: 1px solid var(--sr-tab-line); border-radius: var(--sr-radius-lg) var(--sr-radius-lg) 0 0; }
[data-tabstyle="b"] .sr-tabs__item { padding: 11px 14px; color: var(--sr-text-soft); border-bottom: 3px solid transparent; margin-bottom: -1px; transition: background-color var(--sr-dur-fast) var(--sr-ease), color var(--sr-dur-fast) var(--sr-ease); }
[data-tabstyle="b"] .sr-tabs__item:hover:not(.is-active) { color: var(--sr-heading); background: var(--sr-bg); }
[data-tabstyle="b"] .sr-tabs__item.is-active { color: var(--sr-heading); font-weight: var(--sr-weight-semibold); border-bottom-color: var(--sr-orange); background: linear-gradient(var(--sr-surface), var(--sr-orange-50)); }
[data-tabstyle="b"] .sr-tabs__item:focus-visible { outline: 2px solid var(--sr-focus); outline-offset: -2px; }
[data-tabstyle="b"] .sr-tabs__count { background: var(--sr-tab-soft); color: var(--sr-tab-ink); font-weight: var(--sr-weight-bold); padding: 1px 7px; line-height: 1.4; }
[data-tabstyle="b"] .sr-tabs__item.is-active .sr-tabs__count { background: var(--sr-accent); color: var(--sr-accent-ink); }

/* C — chips: each tab a white pill, the open one orange; the row wraps (on a phone too) instead of scrolling */
[data-tabstyle="c"] .sr-tabs { flex-wrap: wrap; overflow: visible; gap: var(--sr-space-2); border: 0; }
[data-tabstyle="c"] .sr-tabs__item { padding: 7px 14px; margin: 0; border: 1px solid var(--sr-tab-line); border-radius: var(--sr-radius-pill); background: var(--sr-surface); color: var(--sr-tab-ink); transition: background-color var(--sr-dur-fast) var(--sr-ease), border-color var(--sr-dur-fast) var(--sr-ease); }
[data-tabstyle="c"] .sr-tabs__item:hover:not(.is-active) { border-color: var(--sr-tab-soft-line); background: var(--sr-tab-soft); color: var(--sr-tab-ink); }
[data-tabstyle="c"] .sr-tabs__item.is-active { background: var(--sr-orange-50); border-color: var(--sr-orange); color: var(--sr-orange-ink); font-weight: var(--sr-weight-semibold); }
[data-tabstyle="c"] .sr-tabs__item:focus-visible { outline: 2px solid var(--sr-focus); outline-offset: 2px; }
[data-tabstyle="c"] .sr-tabs__count, [data-tabstyle="c"] .sr-tabs__item.is-active .sr-tabs__count { background: var(--sr-tab-soft); color: var(--sr-tab-ink); font-weight: var(--sr-weight-bold); padding: 1px 7px; line-height: 1.4; }
[data-tabstyle="c"] .sr-pageviews__item.is-active { background: var(--sr-orange-50); color: var(--sr-orange-ink); border-color: var(--sr-orange); font-weight: var(--sr-weight-semibold); }

/* v1.331 (owner, 18:07): the chip switcher rows follow the same tab style — the dashboard areas (.k-cats) and periods
   (.k-period), and the link-chip filter rows of staff pages. Hooked by the class sr-switcher on the row (a <nav>), so the
   chips used as labels or pickers elsewhere keep their look. A scrolls, B scrolls, C wraps — as the tabs. */
[data-tabstyle="a"] .sr-switcher { display: flex; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: thin; width: max-content; max-width: 100%; box-sizing: border-box; gap: var(--sr-space-1); padding: var(--sr-space-1); background: var(--sr-tab-track); border-radius: var(--sr-radius-lg); }
[data-tabstyle="a"] .sr-switcher .sr-chip { flex: none; min-height: 40px; padding: 0 14px; border: 0; border-radius: 9px; background: transparent; color: var(--sr-tab-ink); font-size: var(--sr-size-md); white-space: nowrap; text-decoration: none; }
[data-tabstyle="a"] .sr-switcher .sr-chip:hover:not(.is-active) { background: var(--sr-tab-hover); }
[data-tabstyle="a"] .sr-switcher .sr-chip.is-active { background: var(--sr-tab-on); color: var(--sr-tab-on-ink); font-weight: var(--sr-weight-semibold); box-shadow: 0 1px 3px color-mix(in srgb, var(--sr-teal-700) 30%, transparent); }
[data-tabstyle="a"] .sr-switcher .sr-chip:focus-visible { outline: 2px solid var(--sr-focus); outline-offset: 1px; }
[data-tabstyle="b"] .sr-switcher { display: flex; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: thin; gap: 2px; padding: 0 6px; background: var(--sr-surface); border-bottom: 1px solid var(--sr-tab-line); border-radius: var(--sr-radius-lg) var(--sr-radius-lg) 0 0; }
[data-tabstyle="b"] .sr-switcher .sr-chip { flex: none; min-height: 40px; padding: 0 14px; border: 0; border-bottom: 3px solid transparent; margin-bottom: -1px; border-radius: 0; background: transparent; color: var(--sr-text-soft); font-size: var(--sr-size-md); white-space: nowrap; text-decoration: none; }
[data-tabstyle="b"] .sr-switcher .sr-chip:hover:not(.is-active) { color: var(--sr-heading); background: var(--sr-bg); }
[data-tabstyle="b"] .sr-switcher .sr-chip.is-active { color: var(--sr-heading); font-weight: var(--sr-weight-semibold); border-bottom-color: var(--sr-orange); background: linear-gradient(var(--sr-surface), var(--sr-orange-50)); }
[data-tabstyle="b"] .sr-switcher .sr-chip:focus-visible { outline: 2px solid var(--sr-focus); outline-offset: -2px; }
[data-tabstyle="c"] .sr-switcher { display: flex; flex-wrap: wrap; gap: var(--sr-space-2); }
[data-tabstyle="c"] .sr-switcher .sr-chip { min-height: 40px; padding: 0 14px; border: 1px solid var(--sr-tab-line); border-radius: var(--sr-radius-pill); background: var(--sr-surface); color: var(--sr-tab-ink); font-size: var(--sr-size-md); text-decoration: none; }
[data-tabstyle="c"] .sr-switcher .sr-chip:hover:not(.is-active) { border-color: var(--sr-tab-soft-line); background: var(--sr-tab-soft); }
[data-tabstyle="c"] .sr-switcher .sr-chip.is-active { background: var(--sr-orange-50); border-color: var(--sr-orange); color: var(--sr-orange-ink); font-weight: var(--sr-weight-semibold); }
[data-tabstyle="c"] .sr-switcher .sr-chip:focus-visible { outline: 2px solid var(--sr-focus); outline-offset: 2px; }
@media (max-width: 720px) { [data-tabstyle] .sr-switcher .sr-chip { min-height: 44px; } }

/* v1.331: dashboard KPI tiles get a meaning-coloured accent (includes/dash_view.php DASH_KPI_ACCENTS — the same for
   everyone, whatever their tab style): a 3 px bar on top and a tinted dot by the label. The figure keeps its own colour. */
[data-tabstyle] .k-acc::after { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--k-acc); pointer-events: none; } /* ::before is the motion glow (dash.css) */
[data-tabstyle] .k-acc .sr-kpi__label::before { content: ""; display: inline-block; width: 8px; height: 8px; margin: 0 8px 1px 3px; border-radius: 50%; vertical-align: middle; background: var(--k-acc); box-shadow: 0 0 0 3px var(--k-acc-soft); }
[data-tabstyle] .k-acc--teal { --k-acc: var(--sr-heading); --k-acc-soft: var(--sr-tab-soft); }
[data-tabstyle] .k-acc--orange { --k-acc: var(--sr-orange); --k-acc-soft: var(--sr-orange-50); }
[data-tabstyle] .k-acc--pos { --k-acc: var(--sr-success-ink); --k-acc-soft: var(--sr-success-bg); }
[data-tabstyle] .k-acc--neg { --k-acc: var(--sr-danger-ink); --k-acc-soft: var(--sr-danger-bg); }
[data-tabstyle] .k-acc--teal5 { --k-acc: var(--sr-acc-teal5); --k-acc-soft: var(--sr-tab-soft); }
[data-tabstyle] .k-acc--neutral { --k-acc: var(--sr-control-line); --k-acc-soft: var(--sr-tint); }
/* the "admin & finance" lock on a tile: a warm tint */
[data-tabstyle] .k .k-lock { top: 8px; right: 8px; background: var(--sr-orange-50); color: var(--sr-orange-ink); border-radius: var(--sr-radius-pill); padding: 1px 7px; }
@media (min-width: 721px) { [data-tabstyle] .k:has(.k-lock) .sr-kpi__label { padding-right: 100px; } } /* room for the tinted lock tag */
/* dashboard section cards: a thin teal bar before the title, so a section stands apart from the grey page */
[data-tabstyle] [data-dash-tab] .sr-card__title::before { content: ""; display: inline-block; width: 3px; height: 1em; margin-right: 10px; border-radius: 2px; vertical-align: -2px; background: var(--sr-heading); }
