/*
  BM Shop Manager UI System
  Intended to be loaded after /style.css as a visual override layer.
  This file is CSS-only and avoids changing application behavior.
*/

:root {
  --bm-blue-950: #031842;
  --bm-blue-900: #052761;
  --bm-blue-800: #073b96;
  --bm-blue-700: #075ed8;
  --bm-blue-600: #0b73e8;
  --bm-blue-500: #1686ff;
  --bm-blue-100: #e7f0ff;
  --bm-blue-050: #f3f8ff;
  --bm-ink: #071b46;
  --bm-text: #13233f;
  --bm-muted: #66758d;
  --bm-soft: #f6f9fe;
  --bm-panel: #ffffff;
  --bm-panel-tint: #f8fbff;
  --bm-line: #d8e4f4;
  --bm-line-strong: #c3d3e8;
  --bm-success: #0fa958;
  --bm-success-soft: #e7f8ef;
  --bm-warning: #d99000;
  --bm-warning-soft: #fff6d8;
  --bm-danger: #dc2626;
  --bm-danger-soft: #ffeded;
  --bm-neutral: #64748b;
  --bm-neutral-soft: #eef2f7;
  --bm-tint-blue: #f1f7ff;
  --bm-tint-green: #f0fbf5;
  --bm-tint-amber: #fff9e8;
  --bm-tint-purple: #f7f3ff;
  --bm-tint-cyan: #effaff;
  --bm-tint-rose: #fff2f5;
  --bm-radius-sm: 8px;
  --bm-radius-md: 10px;
  --bm-radius-lg: 12px;
  --bm-radius-xl: 16px;
  --bm-shadow-sm: 0 6px 16px rgba(15, 35, 74, 0.07);
  --bm-shadow-md: 0 12px 28px rgba(15, 35, 74, 0.1);
  --bm-shadow-lg: 0 22px 48px rgba(15, 35, 74, 0.14);
  --bm-sidebar-width: 240px;
  --bm-sidebar-top-padding: 44px;
  --bm-top-strip-height: 64px;
  --bm-top-banner-height: 88px;
  --bm-top-gradient: linear-gradient(90deg, #041f4f 0%, #062b66 45%, #073b8e 100%);
  --bm-window-gradient: linear-gradient(90deg, #041f4f 0%, #062b66 45%, #073b8e 100%);
  --bm-main-inline-gap: 24px;
  --bm-focus-ring: 0 0 0 4px rgba(7, 94, 216, 0.14);
}

.titlebar,
.window-titlebar,
.app-titlebar,
.desktop-titlebar,
.bm-titlebar,
.bm-window-bar,
.app-window-bar,
.window-header,
.app-frame-header {
  background: var(--bm-window-gradient) !important;
  color: #ffffff !important;
}

.titlebar *,
.window-titlebar *,
.app-titlebar *,
.desktop-titlebar *,
.bm-titlebar *,
.bm-window-bar *,
.app-window-bar *,
.window-header *,
.app-frame-header * {
  color: #ffffff !important;
}

body:not(.preview-body) {
  color: var(--bm-text);
  background:
    linear-gradient(180deg, rgba(240, 246, 255, 0.92), rgba(246, 249, 254, 0.96)),
    var(--bm-soft);
}

.app-shell {
  grid-template-columns: var(--bm-sidebar-width) minmax(0, 1fr);
  background:
    linear-gradient(90deg, #041f4f 0%, #062b66 45%, #073b8e 100%)
      var(--bm-sidebar-width) 0 / calc(100% - var(--bm-sidebar-width)) var(--bm-top-banner-height) no-repeat,
    var(--bm-soft);
}

.main {
  --bm-main-inline-gap: 24px;
  padding: calc(var(--bm-top-strip-height) + 24px) 24px 28px;
}

.main::before {
  left: var(--bm-sidebar-width);
  height: var(--bm-top-strip-height);
  background: var(--bm-top-gradient);
  box-shadow: 0 10px 24px rgba(3, 24, 66, 0.22);
  font-size: 13px;
  letter-spacing: 0.02em;
}

/* Sidebar */
.sidebar {
  width: var(--bm-sidebar-width);
  padding: var(--bm-sidebar-top-padding) 12px 18px;
  background:
    linear-gradient(180deg, var(--bm-blue-950) 0%, var(--bm-blue-900) 44%, #042053 100%);
  box-shadow: 14px 0 34px rgba(3, 24, 66, 0.2);
}

.side-brand {
  gap: 12px;
  min-height: 72px;
  padding: 8px 8px 16px;
  margin-bottom: 10px;
  border-bottom-color: rgba(255, 255, 255, 0.14);
}

.side-brand img {
  width: 56px;
  height: 56px;
  border-radius: var(--bm-radius-md);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.2);
}

.side-brand strong {
  font-size: 13px;
  line-height: 1.2;
}

.side-brand span {
  color: rgba(232, 241, 255, 0.72);
  font-size: 11px;
}

.sidebar nav {
  gap: 5px;
}

.sidebar nav a {
  min-height: 42px;
  padding: 0 12px;
  border-radius: var(--bm-radius-md);
  color: rgba(241, 247, 255, 0.84);
  font-size: 14px;
  font-weight: 760;
  transition:
    background-color 160ms ease,
    color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

.sidebar nav a::before {
  width: 7px;
  height: 7px;
  border-color: rgba(255, 255, 255, 0.58);
}

.sidebar nav a:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
  transform: translateX(1px);
}

.sidebar nav a.active {
  color: #ffffff;
  background: linear-gradient(135deg, var(--bm-blue-500), var(--bm-blue-700));
  box-shadow: 0 12px 28px rgba(7, 94, 216, 0.34);
}

.sidebar-alert-badge {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  margin-left: auto;
  padding: 0 7px;
  border-radius: 999px;
  color: #ffffff;
  background: #ef4444;
  box-shadow: 0 8px 18px rgba(239, 68, 68, 0.28);
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
  line-height: 1;
}

/* Topbar and page headers */
.topbar,
.page-header {
  align-items: center;
  min-height: 58px;
  margin-bottom: 18px;
}

.topbar h1,
.page-header h1 {
  color: var(--bm-ink);
  font-size: 28px;
  line-height: 1.18;
}

.topbar p,
.page-header p {
  color: var(--bm-muted);
  font-size: 13px;
  font-weight: 650;
}

.user-pill {
  min-height: 42px;
  padding: 0 14px;
  border-color: var(--bm-line);
  border-radius: var(--bm-radius-md);
  color: var(--bm-ink);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--bm-shadow-sm);
}

.user-pill a {
  color: var(--bm-blue-700);
  text-decoration: none;
}

.page-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.page-header-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

/* Shared partial layout */
body.search-page .main,
body.dashboard-page .main,
body.job-list-page .main,
body.repair-followups-page .main {
  padding-top: 0;
}

body.search-page .main::before,
body.dashboard-page .main::before,
body.job-list-page .main::before,
body.repair-followups-page .main::before {
  display: none;
}

.bm-topbar {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 88px;
  margin: 0 0 18px;
  padding: 12px var(--bm-main-inline-gap);
  border-radius: 0;
  color: #ffffff;
  background: transparent;
}

.bm-topbar::before {
  content: "";
  position: absolute;
  inset: 0 calc(var(--bm-main-inline-gap) * -1);
  z-index: -1;
  background: var(--bm-top-gradient);
  box-shadow: 0 10px 26px rgba(3, 24, 66, 0.18);
}

.bm-topbar-brand {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 14px;
}

.bm-topbar-logo {
  flex: 0 0 auto;
  width: auto;
  max-width: 150px;
  height: auto;
  max-height: 75px;
  object-fit: contain;
  border-radius: var(--bm-radius-md);
  background: #ffffff;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.18);
}

.bm-topbar-shop,
.bm-topbar-page,
.bm-topbar-user > div {
  min-width: 0;
}

.bm-topbar-shop {
  display: grid;
  gap: 3px;
}

.bm-topbar-shop strong {
  color: #ffffff;
  font-size: 20px;
  line-height: 1.15;
}

.bm-topbar-shop span,
.bm-topbar-user span,
.bm-topbar-date span,
.bm-topbar-page .page-subtitle {
  color: rgba(239, 246, 255, 0.82);
  font-size: 13px;
  line-height: 1.25;
}

.bm-topbar-page {
  flex: 1 1 auto;
  max-width: 320px;
}

.bm-topbar-page .page-title {
  margin: 0;
  color: #ffffff;
  font-size: 18px;
  line-height: 1.2;
}

.bm-topbar-page .page-subtitle {
  margin: 4px 0 0;
}

.bm-topbar-version {
  display: inline-flex;
  align-items: center;
  margin-top: 6px;
  padding: 3px 8px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(239, 246, 255, 0.88);
  font-size: 10px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: .02em;
  white-space: nowrap;
}

.bm-topbar-meta {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
}

.bm-topbar-user,
.bm-topbar-date {
  display: flex;
  align-items: center;
  gap: 10px;
}

.bm-topbar-user strong {
  display: block;
  color: #ffffff;
  font-size: 14px;
  line-height: 1.2;
}

.bm-topbar-avatar {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  color: var(--bm-blue-800);
  background: #ffffff;
}

.bm-topbar-avatar svg,
.bm-topbar-date svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.bm-topbar-date {
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.48);
  border-radius: var(--bm-radius-md);
  color: #ffffff;
  white-space: nowrap;
}

.bm-sidebar {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: var(--bm-sidebar-width);
  padding-top: var(--bm-sidebar-top-padding);
}

.bm-sidebar .bm-sidebar-nav {
  display: grid;
  gap: 5px;
}

.bm-sidebar .bm-sidebar-nav a,
.bm-sidebar .bm-sidebar-footer a,
.bm-sidebar .sidebar-logout-button {
  display: flex;
  align-items: center;
  gap: 11px;
}

.bm-sidebar .bm-sidebar-nav a::before,
.bm-sidebar .bm-sidebar-footer a::before,
.bm-sidebar .sidebar-logout-button::before {
  display: none;
  content: none;
}

.bm-sidebar-icon {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  color: rgba(239, 246, 255, 0.86);
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.bm-sidebar a.active .bm-sidebar-icon,
.bm-sidebar a:hover .bm-sidebar-icon,
.bm-sidebar .sidebar-logout-button.active .bm-sidebar-icon,
.bm-sidebar .sidebar-logout-button:hover .bm-sidebar-icon,
.bm-sidebar .sidebar-logout-button:focus-visible .bm-sidebar-icon {
  color: #ffffff;
}

.bm-sidebar-footer {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
}

.bm-sidebar-footer a,
.bm-sidebar-footer .sidebar-logout-button {
  appearance: none;
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  border: 0;
  border-radius: var(--bm-radius-md);
  background: transparent;
  color: rgba(241, 247, 255, 0.86);
  text-decoration: none;
  text-align: left;
  font: inherit;
  font-size: 14px;
  font-weight: 760;
  cursor: pointer;
}

.bm-sidebar-footer a:hover,
.bm-sidebar-footer .sidebar-logout-button:hover,
.bm-sidebar-footer .sidebar-logout-button:focus-visible {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
  outline: none;
}

/* Panels and cards */
.panel,
.stat,
.summary-card,
.bm-card {
  border: 1px solid var(--bm-line);
  border-radius: var(--bm-radius-lg);
  background: var(--bm-panel);
  box-shadow: var(--bm-shadow-sm);
}

.panel {
  overflow: hidden;
}

.panel-head {
  min-height: 54px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--bm-line);
  background: linear-gradient(180deg, #ffffff, var(--bm-blue-050));
}

.panel-head h2 {
  color: var(--bm-ink);
  font-size: 16px;
  line-height: 1.25;
}

.panel-head span {
  color: var(--bm-muted);
  font-size: 12px;
  font-weight: 750;
}

.content-grid {
  grid-template-columns: minmax(0, 1fr) minmax(320px, 380px);
  gap: 16px;
}

.side-stack {
  gap: 16px;
}

.detail-panel {
  align-self: start;
}

.form-body,
.profile-list {
  padding: 16px;
}

/* Stats and summary cards */
.stats,
.mini-stats {
  gap: 14px;
}

.stat,
.mini-stats div {
  border-color: var(--bm-line);
  border-radius: var(--bm-radius-lg);
  background: linear-gradient(180deg, #ffffff 0%, var(--bm-tint-blue) 100%);
  box-shadow: var(--bm-shadow-sm);
}

.stats > .stat-card,
.mini-stats > div,
.dashboard-stats > .stat,
.reports-stats > .stat-card,
.report-insights > div {
  border-color: #cfe0f6 !important;
  background: linear-gradient(180deg, #ffffff 0%, var(--bm-tint-blue) 100%) !important;
}

.stats > .stat-card:nth-child(6n + 2),
.mini-stats > div:nth-child(6n + 2),
.dashboard-stats > .stat:nth-child(6n + 2),
.reports-stats > .stat-card:nth-child(6n + 2),
.report-insights > div:nth-child(6n + 2) {
  border-color: #cbeedc !important;
  background: linear-gradient(180deg, #ffffff 0%, var(--bm-tint-green) 100%) !important;
}

.stats > .stat-card:nth-child(6n + 3),
.mini-stats > div:nth-child(6n + 3),
.dashboard-stats > .stat:nth-child(6n + 3),
.reports-stats > .stat-card:nth-child(6n + 3),
.report-insights > div:nth-child(6n + 3) {
  border-color: #f4e3ae !important;
  background: linear-gradient(180deg, #ffffff 0%, var(--bm-tint-amber) 100%) !important;
}

.stats > .stat-card:nth-child(6n + 4),
.mini-stats > div:nth-child(6n + 4),
.dashboard-stats > .stat:nth-child(6n + 4),
.reports-stats > .stat-card:nth-child(6n + 4),
.report-insights > div:nth-child(6n + 4) {
  border-color: #ded2fb !important;
  background: linear-gradient(180deg, #ffffff 0%, var(--bm-tint-purple) 100%) !important;
}

.stats > .stat-card:nth-child(6n + 5),
.mini-stats > div:nth-child(6n + 5),
.dashboard-stats > .stat:nth-child(6n + 5),
.reports-stats > .stat-card:nth-child(6n + 5),
.report-insights > div:nth-child(6n + 5) {
  border-color: #c8edf8 !important;
  background: linear-gradient(180deg, #ffffff 0%, var(--bm-tint-cyan) 100%) !important;
}

.stats > .stat-card:nth-child(6n + 6),
.mini-stats > div:nth-child(6n + 6),
.dashboard-stats > .stat:nth-child(6n + 6),
.reports-stats > .stat-card:nth-child(6n + 6),
.report-insights > div:nth-child(6n + 6) {
  border-color: #f6ccd8 !important;
  background: linear-gradient(180deg, #ffffff 0%, var(--bm-tint-rose) 100%) !important;
}

.stat strong,
.mini-stats strong {
  color: var(--bm-ink);
}

.stat span,
.mini-stats span {
  color: var(--bm-muted);
}

.summary-card {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.summary-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.summary-card-title {
  margin: 0;
  color: var(--bm-ink);
  font-size: 16px;
  font-weight: 850;
}

.summary-total,
.summary-primary {
  padding: 18px;
  border-radius: var(--bm-radius-lg);
  color: #ffffff;
  background: linear-gradient(135deg, var(--bm-blue-600), var(--bm-blue-700));
  box-shadow: 0 14px 28px rgba(7, 94, 216, 0.24);
}

.summary-total span,
.summary-primary span {
  display: block;
  color: rgba(255, 255, 255, 0.82);
  font-size: 12px;
  font-weight: 750;
}

.summary-total strong,
.summary-primary strong {
  display: block;
  margin-top: 6px;
  font-size: 32px;
  line-height: 1;
}

.summary-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--bm-line);
  color: var(--bm-text);
  font-size: 14px;
}

.summary-line:last-child {
  border-bottom: 0;
}

.summary-line strong {
  color: var(--bm-ink);
}

.summary-line.danger strong,
.summary-due {
  color: var(--bm-danger);
}

.summary-alert {
  padding: 12px 14px;
  border: 1px solid #f1d47a;
  border-radius: var(--bm-radius-md);
  color: #7c5300;
  background: var(--bm-warning-soft);
  font-size: 13px;
  font-weight: 750;
}

.sticky-summary,
.job-side-stack,
.bm-sticky-side {
  position: sticky;
  top: calc(var(--bm-top-strip-height) + 16px);
}

/* Tables */
.app-shell table {
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
}

.app-shell th,
.app-shell td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--bm-line);
  vertical-align: middle;
}

.app-shell th {
  color: #ffffff;
  background: linear-gradient(180deg, var(--bm-blue-700), #0556c7);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: none;
}

.app-shell tbody tr {
  background: #ffffff;
}

.app-shell tbody tr:hover {
  background: var(--bm-blue-050);
}

.table-actions {
  gap: 8px;
}

/* Forms */
.app-shell label {
  color: var(--bm-ink);
  font-size: 13px;
  font-weight: 800;
}

.app-shell input,
.app-shell select,
.app-shell textarea {
  border-color: var(--bm-line-strong);
  border-radius: var(--bm-radius-sm);
  color: var(--bm-text);
  background: #ffffff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.app-shell input,
.app-shell select {
  min-height: 44px;
  padding: 0 12px;
}

.app-shell textarea {
  min-height: 92px;
  padding: 12px;
}

.app-shell input::placeholder,
.app-shell textarea::placeholder {
  color: #9aa9bb;
}

.app-shell input:focus,
.app-shell select:focus,
.app-shell textarea:focus {
  border-color: var(--bm-blue-600);
  box-shadow: var(--bm-focus-ring);
  outline: 0;
}

.form-row {
  gap: 12px;
}

.toolbar {
  gap: 12px;
}

.search-input {
  max-width: 460px;
}

/* Buttons */
.app-shell a.btn:not(.table-link):not(.small-btn):not(.app-pagination__button),
.app-shell button.btn:not(.small-btn) {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--bm-line-strong);
  border-radius: var(--bm-radius-md);
  color: var(--bm-blue-800);
  background: linear-gradient(180deg, #ffffff 0%, var(--bm-blue-050) 100%);
  box-shadow: var(--bm-shadow-sm);
  font: inherit;
  font-weight: 850;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}

.app-shell a.btn:not(.table-link):not(.small-btn):not(.app-pagination__button):hover,
.app-shell button.btn:not(.small-btn):hover {
  border-color: rgba(7, 94, 216, 0.42);
  color: var(--bm-blue-700);
  box-shadow: 0 12px 24px rgba(7, 94, 216, 0.12);
}

.app-shell a.btn.primary:not(.table-link),
.app-shell button.btn.primary,
.app-shell a.btn.primary-action:not(.table-link),
.app-shell button.btn.primary-action,
.app-shell a.btn.btn-primary:not(.table-link),
.app-shell button.btn.btn-primary {
  border-color: transparent;
  color: #ffffff;
  background: linear-gradient(135deg, var(--bm-blue-600), var(--bm-blue-700));
  box-shadow: 0 12px 24px rgba(7, 94, 216, 0.24);
}

.primary-btn,
.secondary-btn,
.danger-btn,
.table-link,
.action-btn,
.success-btn {
  border-radius: var(--bm-radius-sm);
  font-weight: 850;
  letter-spacing: 0;
}

.primary-btn,
.action-btn.primary {
  min-height: 44px;
  color: #ffffff;
  background: linear-gradient(135deg, var(--bm-blue-600), var(--bm-blue-700));
  box-shadow: 0 12px 24px rgba(7, 94, 216, 0.24);
}

.secondary-btn,
.action-btn.secondary {
  min-height: 42px;
  border-color: var(--bm-line-strong);
  color: var(--bm-blue-800);
  background: #ffffff;
  box-shadow: var(--bm-shadow-sm);
}

.secondary-btn:hover,
.action-btn.secondary:hover {
  border-color: rgba(7, 94, 216, 0.42);
  color: var(--bm-blue-700);
  box-shadow: 0 12px 24px rgba(7, 94, 216, 0.12);
}

.success-btn,
.action-btn.success,
.table-link-success {
  color: #ffffff;
  background: linear-gradient(135deg, #14b86b, var(--bm-success));
  box-shadow: 0 10px 20px rgba(15, 169, 88, 0.2);
}

.danger-btn,
.action-btn.danger {
  border-color: rgba(220, 38, 38, 0.28);
  color: #ffffff;
  background: linear-gradient(135deg, #ef4444, var(--bm-danger));
  box-shadow: 0 10px 20px rgba(220, 38, 38, 0.18);
}

.table-link {
  min-height: 30px;
  padding: 0 10px;
  background: linear-gradient(135deg, var(--bm-blue-600), var(--bm-blue-700));
  box-shadow: 0 8px 16px rgba(7, 94, 216, 0.18);
}

.action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid transparent;
  text-decoration: none;
  font: inherit;
  cursor: pointer;
}

/* Icon color overrides: keep button SVGs legible without changing layout or logic. */
.bm-topbar-avatar,
.bm-user-avatar {
  color: #0a4f9e !important;
}

.bm-topbar-avatar svg,
.bm-topbar-avatar i,
.bm-user-avatar svg,
.bm-user-avatar i {
  color: #0a4f9e !important;
  stroke: #0a4f9e !important;
  opacity: 1;
}

.bm-topbar-date,
.bm-date-box {
  color: #ffffff !important;
}

.bm-topbar-date svg,
.bm-topbar-date i,
.bm-date-box svg,
.bm-date-box i {
  color: #ffffff !important;
  stroke: #ffffff !important;
  opacity: 1;
}

.app-shell .primary-btn,
.app-shell .success-btn,
.app-shell .btn-primary,
.app-shell .btn-success,
.app-shell .action-btn.primary,
.app-shell .action-btn.success {
  color: #ffffff;
}

.app-shell .primary-btn svg,
.app-shell .primary-btn i,
.app-shell .success-btn svg,
.app-shell .success-btn i,
.app-shell .btn-primary svg,
.app-shell .btn-primary i,
.app-shell .btn-success svg,
.app-shell .btn-success i,
.app-shell .action-btn.primary svg,
.app-shell .action-btn.primary i,
.app-shell .action-btn.success svg,
.app-shell .action-btn.success i {
  color: #ffffff !important;
  stroke: #ffffff !important;
  fill: none;
  opacity: 1;
}

.app-shell .primary-btn:hover svg,
.app-shell .primary-btn:hover i,
.app-shell .success-btn:hover svg,
.app-shell .success-btn:hover i,
.app-shell .btn-primary:hover svg,
.app-shell .btn-primary:hover i,
.app-shell .btn-success:hover svg,
.app-shell .btn-success:hover i,
.app-shell .action-btn.primary:hover svg,
.app-shell .action-btn.primary:hover i,
.app-shell .action-btn.success:hover svg,
.app-shell .action-btn.success:hover i {
  color: #ffffff !important;
  stroke: #ffffff !important;
  opacity: 1;
}

.app-shell .secondary-btn svg,
.app-shell .secondary-btn i,
.app-shell .btn-secondary:not(.table-link):not(.small-btn) svg,
.app-shell .btn-secondary:not(.table-link):not(.small-btn) i,
.app-shell .action-btn.secondary svg,
.app-shell .action-btn.secondary i {
  color: #0b73e0 !important;
  stroke: #0b73e0 !important;
  fill: none;
  opacity: 1;
}

body.job-entry-page .jobs-page .job-item-toolbar .add-job-item,
body.job-entry-page .jobs-page .profile-actions .table-link,
body.job-entry-page .jobs-page .job-add-customer-btn,
body.job-entry-page .jobs-page .job-actions .primary-btn,
body.job-entry-page .jobs-page .job-actions .payment-action {
  color: #ffffff;
  gap: 7px;
}

body.job-entry-page .jobs-page .job-item-toolbar .add-job-item svg,
body.job-entry-page .jobs-page .job-item-toolbar .add-job-item i,
body.job-entry-page .jobs-page .profile-actions .table-link svg,
body.job-entry-page .jobs-page .profile-actions .table-link i,
body.job-entry-page .jobs-page .job-add-customer-btn svg,
body.job-entry-page .jobs-page .job-add-customer-btn i,
body.job-entry-page .jobs-page .job-actions .primary-btn svg,
body.job-entry-page .jobs-page .job-actions .primary-btn i,
body.job-entry-page .jobs-page .job-actions .payment-action svg,
body.job-entry-page .jobs-page .job-actions .payment-action i {
  color: #ffffff !important;
  stroke: #ffffff !important;
  fill: none;
  opacity: 1;
}

body.job-entry-page .jobs-page .job-entry-hero-actions .btn-secondary svg,
body.job-entry-page .jobs-page .job-entry-hero-actions .btn-secondary i,
body.job-entry-page .jobs-page .compact-action .btn-secondary svg,
body.job-entry-page .jobs-page .compact-action .btn-secondary i,
body.job-entry-page .jobs-page .action-notice > .btn-secondary svg,
body.job-entry-page .jobs-page .action-notice > .btn-secondary i,
body.job-entry-page .jobs-page .remove-job-item svg,
body.job-entry-page .jobs-page .remove-job-item i,
body.job-entry-page .jobs-page .job-summary-print svg,
body.job-entry-page .jobs-page .job-summary-print i,
body.job-entry-page .jobs-page .cancel-action svg,
body.job-entry-page .jobs-page .cancel-action i {
  color: #0b73e0 !important;
  stroke: #0b73e0 !important;
  fill: none;
  opacity: 1;
}

button:disabled svg,
button:disabled i {
  opacity: 0.6;
}

/* Repair status tracking */
body.repair-jobs-page .repair-status-progress {
  display: grid;
  gap: 6px;
  min-width: 120px;
}

body.repair-jobs-page .repair-status-progress small {
  color: var(--bm-muted);
  font-size: 11px;
  font-weight: 800;
}

body.repair-jobs-page .repair-dashboard-stats {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

body.repair-jobs-page .repair-toolbar {
  padding: 12px 14px;
  border: 1px solid #d7e4f6;
  border-radius: 16px;
  background:
    radial-gradient(circle at 0% 0%, rgba(7, 94, 216, 0.12), transparent 34%),
    radial-gradient(circle at 100% 0%, rgba(15, 169, 88, 0.06), transparent 30%),
    linear-gradient(180deg, #ffffff 0%, #eef5ff 100%);
  box-shadow: 0 12px 26px rgba(15, 35, 74, 0.08);
}

body.repair-jobs-page .repair-toolbar .search-input,
body.repair-jobs-page .repair-toolbar select {
  border-color: #cbdaf0;
  background: #ffffff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

body.repair-jobs-page .repair-toolbar .primary-btn,
body.repair-jobs-page .repair-toolbar .secondary-btn {
  min-height: 42px;
  padding: 0 14px;
  border-radius: 10px;
  box-shadow: 0 10px 20px rgba(7, 94, 216, 0.12);
}

body.repair-jobs-page .content-grid > .panel.card,
body.repair-jobs-page .repair-follow-panel,
body.repair-jobs-page .summary-card.sticky-summary {
  border: 1px solid #d7e4f6;
  border-radius: 16px;
  background:
    linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  box-shadow: 0 14px 34px rgba(15, 35, 74, 0.08);
}

body.repair-jobs-page .repair-follow-panel {
  margin-bottom: 14px;
}

body.repair-jobs-page .repair-follow-panel .panel-head,
body.repair-jobs-page .content-grid > .panel.card .panel-head {
  background:
    radial-gradient(circle at 92% 0%, rgba(7, 94, 216, 0.12), transparent 24%),
    linear-gradient(180deg, #ffffff 0%, #f3f8ff 100%);
}

body.repair-jobs-page .repair-follow-panel .panel-head span,
body.repair-jobs-page .content-grid > .panel.card .panel-head span {
  color: #0b5fd3;
  font-weight: 900;
}

body.repair-jobs-page .repair-follow-list {
  display: grid;
  gap: 8px;
  padding: 14px;
}

body.repair-jobs-page .repair-follow-item {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto minmax(160px, auto) auto;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid #d9e6fb;
  border-radius: 10px;
  background:
    linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
  box-shadow: 0 8px 18px rgba(15, 35, 74, 0.06);
}

body.repair-jobs-page .repair-follow-item strong,
body.repair-jobs-page .repair-follow-item span {
  display: block;
}

body.repair-jobs-page .repair-follow-item strong {
  color: var(--bm-ink);
}

body.repair-jobs-page .repair-follow-item div > span {
  color: var(--bm-muted);
  font-size: 12px;
  font-weight: 750;
}

body.repair-jobs-page .repair-follow-item em {
  color: #8a5b00;
  font-size: 12px;
  font-style: normal;
  font-weight: 850;
}

body.repair-jobs-page .repair-table-wrap {
  border-top: 1px solid #d9e6fb;
  background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
}

body.repair-jobs-page .repair-table {
  background: #ffffff;
}

body.repair-jobs-page .repair-table tbody tr:nth-child(even) {
  background: #fbfdff;
}

body.repair-jobs-page .repair-table tbody tr:hover {
  background: #f0f7ff;
}

body.repair-jobs-page .repair-progress,
body.repair-form-page .repair-progress,
body.repair-public-page .repair-progress {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #e7eef8;
}

body.repair-jobs-page .repair-progress-bar,
body.repair-form-page .repair-progress-bar,
body.repair-public-page .repair-progress-bar {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #0874e8, #17a86b);
}

body.repair-jobs-page .repair-progress-bar.tone-warning,
body.repair-form-page .repair-progress-bar.tone-warning,
body.repair-public-page .repair-progress-bar.tone-warning {
  background: linear-gradient(90deg, #d99000, #f2b527);
}

body.repair-jobs-page .repair-progress-bar.tone-info,
body.repair-form-page .repair-progress-bar.tone-info,
body.repair-public-page .repair-progress-bar.tone-info {
  background: linear-gradient(90deg, #0874e8, #22a7f0);
}

body.repair-jobs-page .repair-progress-bar.tone-ok,
body.repair-form-page .repair-progress-bar.tone-ok,
body.repair-public-page .repair-progress-bar.tone-ok {
  background: linear-gradient(90deg, #0fa958, #19c37d);
}

body.repair-jobs-page .repair-progress-bar.tone-danger,
body.repair-form-page .repair-progress-bar.tone-danger,
body.repair-public-page .repair-progress-bar.tone-danger {
  background: linear-gradient(90deg, #dc2626, #ef4444);
}

body.repair-jobs-page .repair-progress-bar.tone-neutral,
body.repair-form-page .repair-progress-bar.tone-neutral,
body.repair-public-page .repair-progress-bar.tone-neutral {
  background: linear-gradient(90deg, #64748b, #94a3b8);
}

body.repair-form-page .repair-status-card {
  overflow: hidden;
}

body.repair-form-page .repair-status-form {
  display: grid;
  gap: 10px;
  padding: 16px;
}

body.repair-form-page .repair-status-form .primary-btn {
  width: 100%;
  margin-top: 2px;
}

body.repair-form-page .repair-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 2px 0;
  color: var(--bm-text);
  font-size: 13px;
  font-weight: 800;
}

body.repair-form-page .repair-checkbox input {
  width: auto;
  min-height: auto;
}

body.repair-form-page .repair-timeline {
  position: relative;
  margin: 0;
  padding: 16px 16px 4px 44px;
}

body.repair-form-page .repair-timeline::before {
  content: "";
  position: absolute;
  left: 27px;
  top: 24px;
  bottom: 20px;
  width: 2px;
  background: #d7e5f7;
}

body.repair-form-page .repair-timeline-item {
  position: relative;
  padding: 0 0 20px;
}

body.repair-form-page .repair-timeline-dot {
  position: absolute;
  left: -24px;
  top: 4px;
  width: 14px;
  height: 14px;
  border: 3px solid #ffffff;
  border-radius: 50%;
  background: #1478e8;
  box-shadow: 0 0 0 2px #1478e8;
}

body.repair-public-page .repair-timeline-dot {
  position: absolute;
  left: -29px;
  top: 4px;
  width: 14px;
  height: 14px;
  border: 3px solid #ffffff;
  border-radius: 50%;
  background: #1478e8;
  box-shadow: 0 0 0 2px #1478e8;
}

body.repair-public-page .repair-public-timeline-item.is-current .repair-timeline-dot {
  background: #18a766;
  box-shadow: 0 0 0 3px rgba(24, 167, 102, 0.18);
}

body.repair-form-page .repair-timeline-item.is-current .repair-timeline-dot {
  background: #18a766;
  box-shadow: 0 0 0 3px rgba(24, 167, 102, 0.18);
}

body.repair-form-page .repair-timeline-content {
  display: grid;
  gap: 5px;
}

body.repair-form-page .repair-timeline-content time,
body.repair-form-page .repair-timeline-content span {
  color: var(--bm-muted);
  font-size: 12px;
  font-weight: 750;
}

body.repair-form-page .repair-timeline-content strong {
  color: var(--bm-ink);
  font-size: 14px;
}

body.repair-form-page .repair-timeline-content p {
  margin: 0;
  color: var(--bm-text);
  font-size: 13px;
  line-height: 1.45;
}

body.repair-form-page .repair-visibility-badge {
  justify-self: start;
  padding: 3px 8px;
  border-radius: 999px;
  color: #0b4f9e;
  background: #e7f0ff;
  font-size: 11px;
  font-style: normal;
  font-weight: 850;
}

body.repair-form-page .repair-tracking-tools {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--bm-line);
}

body.repair-form-page .repair-tracking-tools label {
  margin: 0;
}

body.repair-form-page .repair-tracking-tools input {
  min-height: 38px;
  font-size: 12px;
}

body.repair-form-page .repair-tracking-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

body.repair-form-page .repair-tracking-actions .secondary-btn {
  min-height: 38px;
  width: 100%;
  margin: 0;
  font-size: 12px;
}

body.repair-form-page .repair-copy-feedback {
  min-height: 18px;
  color: var(--bm-success);
  font-size: 12px;
  font-weight: 800;
}

body.repair-form-page .repair-customer-message {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--bm-line);
}

body.repair-form-page .repair-customer-message label {
  margin: 0;
}

body.repair-form-page .repair-customer-message textarea {
  min-height: 118px;
  font-size: 13px;
  line-height: 1.5;
}

body.repair-form-page .repair-customer-message .secondary-btn {
  width: 100%;
  min-height: 38px;
  margin: 0;
  font-size: 12px;
}

body.repair-public-page {
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(240, 246, 255, 0.94), rgba(247, 250, 255, 0.98)),
    #eef5ff;
}

body.repair-public-page .repair-public-shell {
  width: min(760px, calc(100% - 28px));
  margin: 0 auto;
  padding: 28px 0;
}

body.repair-public-page .repair-public-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  color: var(--bm-ink);
}

body.repair-public-page .repair-public-header img {
  width: 72px;
  height: 72px;
  object-fit: contain;
  border: 1px solid var(--bm-line);
  border-radius: var(--bm-radius-md);
  background: #ffffff;
  box-shadow: var(--bm-shadow-sm);
}

body.repair-public-page .repair-public-header strong,
body.repair-public-page .repair-public-header span {
  display: block;
}

body.repair-public-page .repair-public-header strong {
  font-size: 20px;
}

body.repair-public-page .repair-public-header span,
body.repair-public-page .repair-public-muted {
  color: var(--bm-muted);
  font-size: 13px;
  font-weight: 750;
}

body.repair-public-page .repair-public-panel,
body.repair-public-page .repair-public-contact {
  margin-bottom: 14px;
  padding: 18px;
  border: 1px solid var(--bm-line);
  border-radius: var(--bm-radius-lg);
  background: #ffffff;
  box-shadow: var(--bm-shadow-sm);
}

body.repair-public-page .repair-public-panel h1,
body.repair-public-page .repair-public-panel h2 {
  margin: 0 0 8px;
  color: var(--bm-ink);
  line-height: 1.25;
}

body.repair-public-page .repair-public-panel h1 {
  font-size: 24px;
}

body.repair-public-page .repair-public-panel h2 {
  font-size: 18px;
}

body.repair-public-page .repair-public-panel p {
  margin: 0 0 12px;
  color: var(--bm-muted);
  font-size: 14px;
  line-height: 1.55;
}

body.repair-public-page .repair-public-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

body.repair-public-page .repair-public-title span:not(.status-badge) {
  color: var(--bm-muted);
  font-size: 13px;
  font-weight: 800;
}

body.repair-public-page .repair-public-progress {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

body.repair-public-page .repair-public-progress strong {
  color: var(--bm-ink);
  font-size: 13px;
}

body.repair-public-page .repair-public-details {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
}

body.repair-public-page .repair-public-details div {
  padding: 10px;
  border: 1px solid var(--bm-line);
  border-radius: var(--bm-radius-sm);
  background: var(--bm-panel-tint);
}

body.repair-public-page .repair-public-details dt {
  color: var(--bm-muted);
  font-size: 12px;
  font-weight: 800;
}

body.repair-public-page .repair-public-details dd {
  margin: 4px 0 0;
  color: var(--bm-ink);
  font-weight: 850;
}

body.repair-public-page .repair-public-timeline {
  position: relative;
  margin-top: 14px;
  padding-left: 30px;
}

body.repair-public-page .repair-public-timeline::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 8px;
  bottom: 18px;
  width: 2px;
  background: #d7e5f7;
}

body.repair-public-page .repair-public-timeline-item {
  position: relative;
  display: grid;
  gap: 5px;
  padding-bottom: 18px;
}

body.repair-public-page .repair-public-timeline-item time {
  color: var(--bm-muted);
  font-size: 12px;
  font-weight: 750;
}

body.repair-public-page .repair-public-timeline-item strong {
  color: var(--bm-ink);
}

body.repair-public-page .repair-public-contact {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--bm-text);
  font-size: 14px;
  font-weight: 800;
}

body.repair-public-page .repair-public-contact a {
  color: var(--bm-blue-700);
  text-decoration: none;
}

body.repair-public-page .repair-search-panel form {
  display: grid;
  gap: 10px;
}

body.repair-public-page .repair-search-panel .primary-btn,
body.repair-public-page .repair-public-panel .primary-btn {
  width: 100%;
  margin-top: 8px;
}

@media (max-width: 640px) {
  body.repair-form-page .repair-tracking-actions,
  body.repair-jobs-page .repair-follow-item,
  body.repair-public-page .repair-public-details {
    grid-template-columns: 1fr;
  }

  body.repair-public-page .repair-public-title,
  body.repair-public-page .repair-public-contact {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* Badges */
.status-badge {
  min-height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 850;
}

.status-badge.ok,
.status-badge.done,
.status-badge.success {
  color: #087443;
  background: var(--bm-success-soft);
}

.status-badge.info {
  color: var(--bm-blue-700);
  background: var(--bm-blue-100);
}

.status-badge.warning {
  color: #996700;
  background: var(--bm-warning-soft);
}

.status-badge.danger {
  color: var(--bm-danger);
  background: var(--bm-danger-soft);
}

.status-badge.neutral {
  color: #475569;
  background: var(--bm-neutral-soft);
}

/* Repair follow-up center */
body.repair-followups-page .repair-followup-stats {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

body.repair-followups-page .repair-followup-section,
body.repair-followups-page .repair-followup-toolbar,
body.repair-followups-page .repair-followup-empty,
.repair-followup-dashboard {
  border: 1px solid #d7e4f6;
  border-radius: 16px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  box-shadow: 0 14px 34px rgba(15, 35, 74, 0.08);
}

body.repair-followups-page .repair-followup-section {
  margin-top: 14px;
}

body.repair-followups-page .repair-followup-toolbar {
  display: grid;
  gap: 12px;
  margin-bottom: 14px;
  padding: 14px;
}

.repair-followup-search {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.repair-followup-search input {
  width: 100%;
  max-width: none;
}

.repair-followup-search-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: nowrap;
}

.repair-followup-search-actions .btn,
.repair-followup-search-actions button,
.repair-followup-search-actions a {
  flex: 0 0 auto;
  width: auto;
  min-height: 44px;
  margin-top: 0;
  padding: 0 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

.repair-followup-filter-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}

.repair-followup-filter-grid label {
  display: grid;
  min-width: 0;
  gap: 6px;
}

.repair-followup-filter-grid label > span {
  color: var(--bm-muted);
  font-size: 12px;
  font-weight: 850;
}

.repair-followup-filter-grid select {
  width: 100%;
}

body.repair-followups-page .repair-followup-section .panel-head,
.repair-followup-dashboard .panel-head {
  background:
    radial-gradient(circle at 94% 0%, rgba(7, 94, 216, 0.12), transparent 26%),
    linear-gradient(180deg, #ffffff 0%, #f3f8ff 100%);
}

.repair-followup-list {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.repair-followup-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 14px;
  border: 1px solid #b8d7fa;
  border-radius: 12px;
  background: #eef6ff;
}

.repair-followup-card.danger {
  border-color: #f3b5b5;
  background: #fff0f0;
}

.repair-followup-card.warning {
  border-color: #f4d58a;
  background: #fff8e6;
}

.repair-followup-card.success {
  border-color: #a7e3bd;
  background: #ecfdf3;
}

.repair-followup-card.repair-followup-snoozed {
  border-style: dashed;
  opacity: 0.92;
}

.repair-followup-main {
  display: grid;
  min-width: 0;
  gap: 9px;
}

.repair-followup-main header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.repair-followup-main strong,
.repair-followup-main h3 {
  color: var(--bm-ink);
}

.repair-followup-main h3 {
  margin: 0;
  font-size: 16px;
  line-height: 1.35;
}

.repair-followup-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 6px 12px;
  color: var(--bm-text);
  font-size: 13px;
  font-weight: 720;
}

.repair-followup-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.repair-followup-tags span {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 9px;
  border: 1px solid rgba(7, 94, 216, 0.16);
  border-radius: 999px;
  color: #0755b5;
  background: rgba(255, 255, 255, 0.72);
  font-size: 12px;
  font-weight: 850;
}

.repair-followup-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.repair-followup-actions .table-link {
  min-height: 34px;
  white-space: nowrap;
}

.repair-followup-copy-feedback {
  grid-column: 1 / -1;
  min-height: 18px;
  color: var(--bm-blue-700);
  font-size: 12px;
  font-weight: 850;
}

.repair-followup-action-panels {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.repair-followup-action-panel {
  border: 1px solid #d7e4f6;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.74);
}

.repair-followup-action-panel summary {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 12px;
  border-radius: 11px;
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
  list-style: none;
}

.repair-followup-action-panel summary::-webkit-details-marker {
  display: none;
}

.repair-followup-action-panel.contact summary {
  color: #087a48;
  background: #ecfdf3;
}

.repair-followup-action-panel.snooze summary {
  color: #9a6700;
  background: #fff8e6;
}

.repair-followup-action-panel[open] summary {
  border-bottom-right-radius: 0;
  border-bottom-left-radius: 0;
  border-bottom: 1px solid rgba(7, 94, 216, 0.12);
}

.repair-followup-action-panel form {
  display: grid;
  gap: 8px;
  padding: 12px;
}

.repair-followup-action-panel label {
  margin: 0;
}

.repair-followup-action-panel textarea {
  min-height: 74px;
}

.repair-followup-snooze-form {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.repair-followup-snooze-form button {
  min-height: 36px;
  border: 1px solid #f4d58a;
  border-radius: 9px;
  color: #9a6700;
  background: #fff8e6;
  font-weight: 900;
  cursor: pointer;
}

.repair-followup-snooze-form button:hover,
.repair-followup-snooze-form button:focus-visible {
  background: #ffefbf;
  outline: none;
}

.repair-followup-empty {
  display: grid;
  gap: 12px;
  padding: 18px;
}

.repair-followup-empty .empty-state.success {
  color: #087443;
}

.repair-followup-empty-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

.repair-followup-pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 14px;
  padding: 12px;
  border: 1px solid #d7e4f6;
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 10px 24px rgba(15, 35, 74, 0.06);
}

.repair-followup-pagination a,
.repair-followup-pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid #cfe0f6;
  border-radius: 9px;
  color: var(--bm-blue-700);
  background: #f8fbff;
  font-size: 13px;
  font-weight: 900;
  text-decoration: none;
}

.repair-followup-pagination a.is-current {
  color: #ffffff;
  border-color: var(--bm-blue-700);
  background: var(--bm-blue-700);
}

.repair-followup-pagination a.is-disabled {
  pointer-events: none;
  opacity: 0.45;
}

.repair-followup-pagination strong {
  color: var(--bm-muted);
  font-size: 13px;
}

.repair-followup-history {
  display: grid;
  gap: 10px;
  padding: 14px;
}

.repair-followup-history-item {
  display: grid;
  gap: 5px;
  padding: 12px;
  border: 1px solid #d7e4f6;
  border-radius: 12px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.repair-followup-history-item time,
.repair-followup-history-item span,
.repair-followup-history-item em {
  color: var(--bm-muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 780;
}

.repair-followup-history-item strong {
  color: var(--bm-ink);
  font-size: 14px;
}

.repair-followup-history-item p {
  margin: 2px 0 0;
  color: var(--bm-text);
  font-size: 13px;
  line-height: 1.45;
}

.repair-followup-dashboard {
  margin-bottom: 16px;
}

.repair-followup-dashboard-body {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.repair-followup-dashboard-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
}

.repair-followup-dashboard-summary div {
  padding: 12px;
  border: 1px solid #d7e4f6;
  border-radius: 12px;
  background: linear-gradient(180deg, #ffffff 0%, #f3f8ff 100%);
}

.repair-followup-dashboard-summary span,
.repair-followup-dashboard-list article span:not(.status-badge) {
  color: var(--bm-muted);
  font-size: 12px;
  font-weight: 800;
}

.repair-followup-dashboard-summary strong {
  display: block;
  margin-top: 4px;
  color: var(--bm-ink);
  font-size: 24px;
  line-height: 1;
}

.repair-followup-dashboard-list {
  display: grid;
  gap: 8px;
}

.repair-followup-dashboard-list article {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid #d7e4f6;
  border-radius: 10px;
  background: #ffffff;
}

.repair-followup-dashboard-list article div {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.repair-followup-dashboard-list article strong {
  color: var(--bm-ink);
}

.repair-followup-dashboard-actions {
  display: flex;
  justify-content: flex-end;
}

/* Logout confirmation modal */
.bm-confirm-modal {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.bm-confirm-modal.is-open {
  display: flex;
}

.bm-confirm-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 21, 48, 0.62);
  backdrop-filter: blur(3px);
}

.bm-confirm-dialog {
  position: relative;
  z-index: 1;
  width: min(430px, 100%);
  padding: 28px;
  border: 1px solid #d8e4f3;
  border-radius: 18px;
  background: #ffffff;
  box-shadow: 0 24px 60px rgba(5, 32, 76, 0.28);
  text-align: center;
}

.bm-confirm-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 58px;
  height: 58px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: #fff0f0;
  color: #d9363e;
}

.bm-confirm-icon .bm-sidebar-icon {
  width: 28px;
  height: 28px;
  stroke-width: 2.2;
}

.bm-confirm-dialog h2 {
  margin: 0 0 8px;
  color: #092657;
  font-size: 22px;
  line-height: 1.25;
}

.bm-confirm-dialog p {
  margin: 0;
  color: #64748b;
  font-size: 15px;
  line-height: 1.6;
}

.bm-confirm-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 24px;
}

.bm-btn-cancel,
.bm-btn-danger {
  min-height: 44px;
  padding: 10px 18px;
  border-radius: 11px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.bm-btn-cancel {
  border: 1px solid #cbd9ea;
  background: #ffffff;
  color: #173b6c;
}

.bm-btn-cancel:hover,
.bm-btn-cancel:focus {
  background: #f2f6fb;
  outline: none;
  box-shadow: var(--bm-focus-ring);
}

.bm-btn-danger {
  border: 1px solid #d9363e;
  background: #d9363e;
  color: #ffffff;
}

.bm-btn-danger:hover,
.bm-btn-danger:focus {
  border-color: #ba2931;
  background: #ba2931;
  outline: none;
  box-shadow: 0 0 0 4px rgba(217, 54, 62, 0.16);
}

.bm-btn-danger:disabled {
  opacity: 0.65;
  cursor: wait;
}

body.bm-modal-open {
  overflow: hidden;
}

html[data-app-theme="dark"] .bm-confirm-backdrop {
  background: rgba(1, 8, 20, 0.76);
}

html[data-app-theme="dark"] .bm-confirm-dialog {
  border-color: #31445f;
  color: #dbe7f5;
  background: #111c2d;
  box-shadow: 0 28px 72px rgba(0, 0, 0, 0.5);
}

html[data-app-theme="dark"] .bm-confirm-dialog h2 {
  color: #f3f7fc;
}

html[data-app-theme="dark"] .bm-confirm-dialog p {
  color: #a9b9cc;
}

html[data-app-theme="dark"] .bm-confirm-icon {
  background: #321d27;
  color: #ff7780;
}

html[data-app-theme="dark"] .bm-btn-cancel {
  border-color: #456180;
  color: #dbeafe;
  background: #18283d;
}

html[data-app-theme="dark"] .bm-btn-cancel:hover,
html[data-app-theme="dark"] .bm-btn-cancel:focus {
  background: #20344d;
}

/* Multi-payment page */
body.payment-page .payment-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 380px);
  gap: 16px;
  align-items: start;
}

body.payment-page .payment-main-stack,
body.payment-page .payment-side-stack {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.payment-summary-card,
.payment-form-card,
.payment-history {
  border: 1px solid var(--bm-line);
  border-radius: var(--bm-radius-lg);
  background: #ffffff;
  box-shadow: var(--bm-shadow-sm);
}

.payment-summary-grid,
.payment-readonly-grid,
.payment-form-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  padding: 16px;
}

.payment-summary-grid > div,
.payment-readonly-grid label,
.payment-form-grid label {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.payment-summary-grid > div {
  padding: 14px;
  border: 1px solid #d5e4f8;
  border-radius: 10px;
  background: linear-gradient(135deg, #ffffff, #f5f9ff);
}

.payment-summary-grid span,
.payment-readonly-grid span,
.payment-form-grid span,
.payment-note-field > span {
  color: #5b6b85;
  font-size: 12px;
  font-weight: 800;
}

.payment-summary-grid strong {
  color: #071d49;
  font-size: 20px;
  line-height: 1.15;
}

.payment-summary-grid .payment-balance {
  border-color: #9dc5ff;
  background: linear-gradient(135deg, #eff6ff, #ffffff);
}

.payment-summary-grid .payment-balance strong {
  color: #0967d8;
}

.payment-status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  min-height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.payment-status-badge.unpaid {
  background: #fdecec;
  color: #a32525;
}

.payment-status-badge.partial {
  background: #fff6dc;
  color: #8a5b00;
}

.payment-status-badge.paid {
  background: #e5f8ed;
  color: #14723b;
}

.payment-status-badge.overpaid,
.payment-status-badge.cancelled {
  background: #fee2e2;
  color: #b42318;
}

.payment-readonly-grid input,
.payment-form-grid input,
.payment-form-grid select,
.payment-note-field textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid #c9d8ee;
  border-radius: 8px;
  background: #ffffff;
  color: #061b3f;
  font-weight: 800;
}

.payment-readonly-grid input {
  background: #f7fbff;
  color: #334766;
}

.payment-method-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, 132px);
  gap: 8px;
  padding: 0 16px 16px;
}

.payment-method-options label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  justify-content: flex-start;
  width: 132px;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid #c9d8ee;
  border-radius: 999px;
  background: #ffffff;
  color: #14315f;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.2;
  white-space: nowrap;
}

.payment-method-options input[type="radio"] {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  min-width: 16px;
  margin: 0;
}

.payment-method-options label:has(input[type="radio"]:checked) {
  border-color: #1580ef;
  background: #eff6ff;
  color: #075ed8;
}

.payment-note-field {
  display: grid;
  gap: 6px;
  padding: 0 16px 16px;
}

.payment-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  padding: 0 16px 16px;
}

.payment-actions .primary-btn,
.payment-actions .secondary-btn {
  min-height: 40px;
}

.payment-history {
  overflow: hidden;
}

.payment-history .payment-empty {
  padding: 0 16px 16px;
}

.payment-history-item {
  display: grid;
  gap: 8px;
  margin: 0 16px 12px;
  padding: 14px;
  border: 1px solid #d6e4f5;
  border-radius: 10px;
  background: #fbfdff;
}

.payment-history-item.cancelled {
  background: #eef1f5;
  color: #64748b;
}

.payment-history-top,
.payment-history-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.payment-history-top strong {
  color: #0b3572;
}

.payment-history-top span {
  color: #0967d8;
  font-size: 18px;
  font-weight: 900;
}

.payment-history-meta span,
.payment-history-item p {
  margin: 0;
  color: #5b6b85;
  font-size: 12px;
  font-weight: 800;
}

.payment-history-item .danger-text,
.payment-cancelled-panel .danger-text,
.danger-text {
  color: #b42318;
}

.payment-history-actions,
.payment-detail-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
}

.payment-history-actions .action-btn,
.payment-history-actions .table-link,
.payment-history-actions .payment-cancel-small {
  min-height: 30px;
  padding: 0 9px;
  font-size: 12px;
  line-height: 1;
}

.payment-detail-actions {
  padding: 16px;
}

.payment-detail-actions .primary-btn,
.payment-detail-actions .secondary-btn,
.payment-detail-actions .bm-btn-danger {
  width: 100%;
  min-height: 40px;
}

.payment-detail-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  padding: 16px;
}

.payment-detail-grid > div,
.payment-note-box {
  display: grid;
  gap: 6px;
  padding: 14px;
  border: 1px solid #d5e4f8;
  border-radius: 10px;
  background: #fbfdff;
}

.payment-detail-grid span,
.payment-note-box span {
  color: #5b6b85;
  font-size: 12px;
  font-weight: 900;
}

.payment-detail-grid strong,
.payment-note-box p {
  margin: 0;
  color: #071d49;
  font-weight: 900;
}

.payment-note-box {
  margin: 0 16px 16px;
}

.payment-cancelled-panel {
  border-color: #fecaca;
  background: #fffafa;
}

.job-danger-zone {
  border: 1px solid #fecaca;
  border-radius: var(--bm-radius-lg);
  background: linear-gradient(180deg, #fffafa, #ffffff);
  box-shadow: var(--bm-shadow-sm);
  overflow: hidden;
}

.job-danger-zone header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid #fee2e2;
  background: #fff5f5;
}

.job-danger-zone h2 {
  margin: 0;
  color: #991b1b;
  font-size: 18px;
}

.job-danger-zone p {
  margin: 4px 0 0;
  color: var(--bm-muted);
  font-size: 13px;
  font-weight: 650;
}

.job-danger-zone-body {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.job-danger-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.job-danger-stat {
  padding: 10px;
  border: 1px solid #fde2e2;
  border-radius: var(--bm-radius-md);
  background: #fff;
}

.job-danger-stat span {
  display: block;
  color: var(--bm-muted);
  font-size: 12px;
  font-weight: 800;
}

.job-danger-stat strong {
  display: block;
  margin-top: 3px;
  color: var(--bm-ink);
}

.job-danger-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.job-danger-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid #fca5a5;
  border-radius: var(--bm-radius-md);
  color: #b91c1c;
  background: #ffffff;
  font-size: 13px;
  font-weight: 850;
  cursor: pointer;
}

.job-danger-note {
  color: #991b1b;
  font-size: 12px;
  font-weight: 750;
}

.job-action-modal[hidden] {
  display: none !important;
}

.job-action-modal {
  position: fixed;
  inset: 0;
  z-index: 2200;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(4, 18, 48, 0.54);
}

.job-action-dialog {
  width: min(520px, 100%);
  border-radius: var(--bm-radius-lg);
  background: #fff;
  box-shadow: var(--bm-shadow-lg);
  overflow: hidden;
}

.job-action-dialog form {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.job-action-dialog h2 {
  margin: 0;
  color: var(--bm-ink);
  font-size: 20px;
}

.job-action-dialog p {
  margin: 0;
  color: var(--bm-text);
  line-height: 1.55;
}

.job-action-dialog input[type="text"] {
  width: 100%;
}

.job-action-check {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  color: var(--bm-text);
  font-size: 13px;
  font-weight: 750;
}

.job-action-dialog .job-danger-stats {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.job-action-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.payment-cancel-modal[hidden] {
  display: none;
}

.payment-cancel-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(5, 15, 35, 0.5);
}

.payment-cancel-dialog {
  width: min(520px, 100%);
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 24px 60px rgba(4, 19, 71, 0.28);
}

.payment-cancel-dialog form {
  display: grid;
  gap: 14px;
  padding: 22px;
}

.payment-cancel-dialog h2 {
  margin: 0;
  color: #071d49;
  font-size: 20px;
}

.payment-cancel-dialog dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}

.payment-cancel-dialog dl div {
  padding: 10px;
  border: 1px solid #d6e4f5;
  border-radius: 10px;
  background: #f8fbff;
}

.payment-cancel-dialog dt {
  color: #5b6b85;
  font-size: 12px;
  font-weight: 900;
}

.payment-cancel-dialog dd {
  margin: 4px 0 0;
  color: #071d49;
  font-weight: 900;
}

.payment-cancel-dialog label {
  display: grid;
  gap: 6px;
}

.payment-cancel-dialog label span {
  color: #5b6b85;
  font-size: 12px;
  font-weight: 900;
}

.payment-cancel-dialog textarea {
  width: 100%;
  min-height: 96px;
  border: 1px solid #c9d8ee;
  border-radius: 10px;
  resize: vertical;
}

.payment-cancel-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.payment-status-active {
  background: #e5f8ed;
  color: #14723b;
}

.payment-status-cancelled {
  background: #fee2e2;
  color: #b42318;
}

.payment-compact-cell {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.payment-compact-cell strong {
  color: #071d49;
}

.payment-compact-cell > span:not(.payment-status-badge) {
  color: #5b6b85;
  font-size: 12px;
  font-weight: 800;
}

/* Existing page hero sections */
.dashboard-hero,
.job-entry-hero {
  border-color: var(--bm-line);
  border-radius: var(--bm-radius-xl);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(234, 242, 255, 0.88));
  box-shadow: var(--bm-shadow-md);
}

.dashboard-hero h2,
.job-entry-hero h2 {
  color: var(--bm-ink);
}

.dashboard-search {
  border-color: var(--bm-line-strong);
  border-radius: var(--bm-radius-lg);
  box-shadow: var(--bm-shadow-sm);
}

.dashboard-search button {
  border-radius: var(--bm-radius-sm);
  background: linear-gradient(135deg, var(--bm-blue-600), var(--bm-blue-700));
}

.job-live-summary {
  border-color: var(--bm-line);
}

/* Responsive baseline for storefront screens */
@media (max-width: 1180px) {
  :root {
    --bm-sidebar-width: 220px;
  }

  .main {
    --bm-main-inline-gap: 18px;
    padding-right: 18px;
    padding-left: 18px;
  }

  .content-grid,
  .job-entry-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .repair-followup-card,
  .repair-followup-dashboard-list article {
    grid-template-columns: 1fr;
  }

  .repair-followup-actions,
  .repair-followup-dashboard-actions {
    justify-content: flex-start;
  }

  .repair-followup-search,
  .repair-followup-filter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .repair-followup-search {
    grid-template-columns: 1fr;
  }

  .repair-followup-search-actions {
    justify-content: stretch;
  }

  .repair-followup-search-actions .btn,
  .repair-followup-search-actions button,
  .repair-followup-search-actions a {
    width: 100%;
  }

  .repair-followup-action-panels {
    grid-template-columns: 1fr;
  }

  body.payment-page .payment-layout {
    grid-template-columns: 1fr;
  }

  .payment-summary-grid,
  .payment-readonly-grid,
  .payment-form-grid,
  .payment-detail-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .repair-followup-snooze-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

.sticky-summary,
.job-side-stack,
.bm-sticky-side {
  position: static;
}
}

.app-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  padding: 12px;
  border: 1px solid rgba(15, 98, 254, 0.14);
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 10px 24px rgba(15, 35, 74, 0.06);
}

.app-pagination__pages {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.app-pagination__button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  min-height: 34px;
  padding: 0 11px;
  border: 1px solid #c8d8ef;
  border-radius: 9px;
  color: #0a2a62;
  background: #ffffff;
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
}

.app-pagination__button:hover,
.app-pagination__button:focus-visible {
  border-color: #0f62fe;
  color: #075ed8;
  background: #eef5ff;
}

.app-pagination__button--active,
.app-pagination__button--active:hover,
.app-pagination__button--active:focus-visible {
  border-color: #075ed8;
  color: #ffffff;
  background: linear-gradient(135deg, #0f62fe, #075ed8);
  box-shadow: 0 10px 18px rgba(15, 98, 254, 0.22);
}

.app-pagination__button--disabled,
.app-pagination__button--disabled:hover,
.app-pagination__button--disabled:focus-visible {
  border-color: #d8e2f1;
  color: #8a98ad;
  background: #f5f8fd;
  cursor: not-allowed;
}

.app-pagination__ellipsis {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 4px;
  color: #6c7890;
  font-weight: 800;
}

.app-pagination__info {
  flex: 0 0 auto;
  color: #54647d;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

@media (max-width: 720px) {
  .app-pagination {
    align-items: flex-start;
    flex-direction: column;
  }

  .app-pagination__info {
    white-space: normal;
  }
}

/* Sidebar navigation cleanup: grouped, collapsible, keyboard-visible and theme-safe. */
:root {
  --bm-sidebar-collapsed-width: 76px;
  --bm-sidebar-icon-bg: rgba(255, 255, 255, .08);
  --bm-sidebar-divider: rgba(255, 255, 255, .12);
  --bm-sidebar-active: rgba(22, 134, 255, .22);
  --bm-sidebar-icon-blue: #70adff;
  --bm-sidebar-icon-green: #65d59a;
  --bm-sidebar-icon-cyan: #63d4e8;
  --bm-sidebar-icon-purple: #c39cff;
  --bm-sidebar-icon-orange: #ffb567;
  --bm-sidebar-icon-red: #ff8c89;
  --bm-sidebar-icon-yellow: #ffd66e;
  --bm-sidebar-icon-pink: #f7a4ce;
}
.bm-sidebar { z-index: 30; overflow: hidden; transition: width .18s ease, transform .18s ease; }
.bm-sidebar-head { display:flex; align-items:center; justify-content:space-between; gap:8px; min-height:42px; padding:0 4px 12px; border-bottom:1px solid var(--bm-sidebar-divider); }
.bm-sidebar-brand { color:#fff; font-size:12px; font-weight:850; white-space:nowrap; }
.bm-sidebar-toggle, .bm-sidebar-mobile-close, .bm-sidebar-mobile-open { appearance:none; border:0; cursor:pointer; font:inherit; }
.bm-sidebar-toggle { width:32px; height:32px; border-radius:9px; color:#eaf3ff; background:rgba(255,255,255,.1); font-size:24px; line-height:1; }
.bm-sidebar-toggle:focus-visible, .bm-sidebar-group-toggle:focus-visible, .bm-sidebar-link:focus-visible, .sidebar-logout-button:focus-visible, .bm-sidebar-mobile-open:focus-visible { outline:3px solid #f8d477; outline-offset:2px; }
.bm-sidebar-primary, .bm-sidebar-groups { display:grid; gap:7px; }
.bm-sidebar-nav { min-width:0; }
.bm-sidebar-link, .bm-sidebar-group-toggle { position:relative; display:flex; align-items:center; min-height:46px; gap:10px; width:100%; box-sizing:border-box; padding:5px 10px; border:0; border-radius:10px; color:rgba(241,247,255,.86); background:transparent; text-decoration:none; text-align:left; font:inherit; font-size:13px; font-weight:760; cursor:pointer; }
.bm-sidebar-link + .bm-sidebar-link, .bm-sidebar-submenu .bm-sidebar-link + .bm-sidebar-link { border-top:1px solid var(--bm-sidebar-divider); border-radius:0; }
.bm-sidebar-link:hover, .bm-sidebar-group-toggle:hover { color:#fff; background:rgba(255,255,255,.09); }
.bm-sidebar-link.active { color:#fff; background:var(--bm-sidebar-active); box-shadow:inset 3px 0 0 var(--bm-blue-500); font-weight:900; }
.bm-sidebar-icon { flex:0 0 34px; width:34px; height:34px; box-sizing:border-box; padding:8px; border:1px solid rgba(255,255,255,.14); border-radius:9px; color:var(--bm-sidebar-icon-blue); background:var(--bm-sidebar-icon-bg); stroke:currentColor; fill:none; stroke-linecap:round; stroke-linejoin:round; stroke-width:2; }
.bm-sidebar-icon--blue { color:var(--bm-sidebar-icon-blue); }
.bm-sidebar-icon--green { color:var(--bm-sidebar-icon-green); }
.bm-sidebar-icon--cyan { color:var(--bm-sidebar-icon-cyan); }
.bm-sidebar-icon--purple { color:var(--bm-sidebar-icon-purple); }
.bm-sidebar-icon--orange { color:var(--bm-sidebar-icon-orange); }
.bm-sidebar-icon--red { color:var(--bm-sidebar-icon-red); }
.bm-sidebar-icon--yellow { color:var(--bm-sidebar-icon-yellow); }
.bm-sidebar-icon--pink { color:var(--bm-sidebar-icon-pink); }
.bm-sidebar-icon--gray { color:#b9c4d6; }
.bm-sidebar-primary .bm-sidebar-link:nth-child(2) .bm-sidebar-icon { color:var(--bm-sidebar-icon-cyan); }
.bm-sidebar-submenu .bm-sidebar-link:nth-child(1) .bm-sidebar-icon { color:var(--bm-sidebar-icon-blue); }
.bm-sidebar-submenu .bm-sidebar-link:nth-child(2) .bm-sidebar-icon { color:var(--bm-sidebar-icon-yellow); }
.bm-sidebar-submenu .bm-sidebar-link:nth-child(3) .bm-sidebar-icon { color:var(--bm-sidebar-icon-purple); }
.bm-sidebar-submenu .bm-sidebar-link:nth-child(4) .bm-sidebar-icon { color:var(--bm-sidebar-icon-orange); }
.bm-sidebar-submenu .bm-sidebar-link:nth-child(5) .bm-sidebar-icon { color:var(--bm-sidebar-icon-cyan); }
.bm-sidebar-submenu .bm-sidebar-link:nth-child(6) .bm-sidebar-icon { color:var(--bm-sidebar-icon-green); }
.bm-sidebar-submenu .bm-sidebar-link:nth-child(7) .bm-sidebar-icon { color:var(--bm-sidebar-icon-red); }
.bm-sidebar-group { border:1px solid rgba(255,255,255,.07); border-radius:12px; background:rgba(0,0,0,.08); overflow:hidden; }
.bm-sidebar-group-toggle { min-height:48px; border-radius:0; }
.bm-sidebar-group-toggle > .bm-sidebar-icon { color:var(--bm-sidebar-icon-cyan); }
.bm-sidebar-chevron { margin-left:auto; transition:transform .18s ease; }
.bm-sidebar-group.is-open .bm-sidebar-chevron { transform:rotate(180deg); }
.bm-sidebar-submenu { padding:0 5px 5px 10px; }
.bm-sidebar-submenu[hidden] { display:none; }
.bm-sidebar-sublink { min-height:44px; padding-left:4px; font-size:12px; }
.bm-sidebar-sublink .bm-sidebar-icon { flex-basis:32px; width:32px; height:32px; padding:7px; }
.sidebar-alert-badge { margin-left:auto; min-width:22px; height:22px; padding:0 6px; border-radius:99px; display:inline-flex; align-items:center; justify-content:center; color:#fff; background:#e55757; font-size:11px; font-style:normal; font-weight:900; }
.bm-sidebar-footer { margin-top:auto; }
.bm-sidebar-footer .sidebar-logout-button { min-height:46px; padding:5px 10px; }
.bm-sidebar-footer .bm-send-sound-toggle{position:relative;display:flex;align-items:center;gap:10px;width:100%;min-height:42px;margin:0 0 5px;padding:5px 10px;border:1px solid rgba(99,212,232,.22);border-radius:10px;background:rgba(99,212,232,.08);color:rgba(241,247,255,.9);font:inherit;font-size:12px;font-weight:800;text-align:left;cursor:pointer}
.bm-sidebar-footer .bm-send-sound-toggle:hover,.bm-sidebar-footer .bm-send-sound-toggle:focus-visible{background:rgba(99,212,232,.16);color:#fff;outline:none}
.bm-sidebar-footer .bm-send-sound-toggle.is-off{border-color:rgba(255,255,255,.12);background:rgba(255,255,255,.04);color:rgba(241,247,255,.58)}
.bm-sidebar-footer .bm-send-sound-toggle .bm-sidebar-icon{flex-basis:32px;width:32px;height:32px;padding:7px}
.bm-sidebar-collapsed .app-shell { grid-template-columns:var(--bm-sidebar-collapsed-width) minmax(0,1fr); }
.app-shell.bm-sidebar-collapsed { grid-template-columns:var(--bm-sidebar-collapsed-width) minmax(0,1fr); }
.bm-sidebar-collapsed .bm-sidebar { width:var(--bm-sidebar-collapsed-width); }
.bm-sidebar-collapsed .bm-sidebar-brand, .bm-sidebar-collapsed .bm-sidebar-link > span, .bm-sidebar-collapsed .bm-sidebar-group-toggle > span, .bm-sidebar-collapsed .sidebar-logout-button > span, .bm-sidebar-collapsed .bm-send-sound-toggle > span { display:none; }
.bm-sidebar-collapsed .bm-sidebar-head { justify-content:center; }
.bm-sidebar-collapsed .bm-sidebar-toggle { transform:rotate(180deg); }
.bm-sidebar-collapsed .bm-sidebar-link, .bm-sidebar-collapsed .bm-sidebar-group-toggle, .bm-sidebar-collapsed .sidebar-logout-button, .bm-sidebar-collapsed .bm-send-sound-toggle { justify-content:center; padding:5px; }
.bm-sidebar-collapsed .bm-sidebar-icon { flex-basis:38px; width:38px; height:38px; }
.bm-sidebar-collapsed .bm-sidebar-group { overflow:visible; border-color:transparent; background:transparent; }
.bm-sidebar-collapsed .bm-sidebar-submenu { display:none; }
.bm-sidebar-collapsed .bm-sidebar-group-toggle .bm-sidebar-chevron { display:none; }
.bm-sidebar-link[data-tooltip], .bm-sidebar-group-toggle[data-tooltip] { --bm-tooltip:attr(data-tooltip); }
.bm-sidebar-collapsed [data-tooltip]:hover::after { content:attr(data-tooltip); position:absolute; left:calc(100% + 10px); z-index:60; white-space:nowrap; padding:7px 9px; border-radius:7px; color:#fff; background:#071b46; box-shadow:0 8px 20px rgba(0,0,0,.25); font-size:12px; pointer-events:none; }
.bm-sidebar-scrim, .bm-sidebar-mobile-open, .bm-sidebar-mobile-close { display:none; }
@media (prefers-reduced-motion: reduce) { .bm-sidebar, .bm-sidebar-chevron { transition:none; } }
@media (max-width: 860px) {
  .app-shell, .app-shell.bm-sidebar-collapsed { grid-template-columns:1fr; }
  .bm-sidebar { position:fixed; inset:0 auto 0 0; width:min(310px,88vw); max-width:100%; padding-top:18px; transform:translateX(-105%); box-shadow:18px 0 42px rgba(0,0,0,.28); }
  .bm-mobile-sidebar-open .bm-sidebar { transform:translateX(0); }
  .bm-sidebar-collapsed .bm-sidebar { width:min(310px,88vw); }
  .bm-sidebar-collapsed .bm-sidebar-brand, .bm-sidebar-collapsed .bm-sidebar-link > span, .bm-sidebar-collapsed .bm-sidebar-group-toggle > span, .bm-sidebar-collapsed .sidebar-logout-button > span { display:inline; }
  .bm-sidebar-collapsed .bm-sidebar-submenu { display:block; }
  .bm-sidebar-collapsed .bm-sidebar-toggle { transform:none; }
  .bm-sidebar-scrim { position:fixed; inset:0; z-index:29; border:0; background:rgba(3,24,66,.42); cursor:pointer; }
  .bm-mobile-sidebar-open .bm-sidebar-scrim { display:block; }
  .bm-sidebar-mobile-open { position:fixed; top:12px; left:12px; z-index:20; display:inline-flex; align-items:center; justify-content:center; width:40px; height:40px; border-radius:10px; color:#fff; background:var(--bm-blue-800); box-shadow:0 6px 16px rgba(3,24,66,.24); font-size:20px; }
  .bm-sidebar-mobile-close { position:absolute; top:10px; right:10px; display:block; width:32px; height:32px; border-radius:8px; color:#fff; background:rgba(255,255,255,.12); font-size:22px; line-height:1; }
  .bm-sidebar-head { padding-right:45px; }
}
@media (prefers-color-scheme: light) {
  :root { --bm-sidebar-divider:rgba(0,0,0,.12); --bm-sidebar-icon-bg:rgba(3,24,66,.06); }
}

@media (max-width: 860px) {
  :root {
    --bm-sidebar-top-padding: 18px;
  }

  .app-shell {
    grid-template-columns: 1fr;
    background: var(--bm-soft);
  }

  .sidebar {
    position: relative;
    width: 100%;
    height: auto;
    max-height: none;
  }

  .sidebar nav {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  }

  .main {
    --bm-main-inline-gap: 18px;
    padding: 18px;
  }

  .main::before {
    display: none;
  }

  .topbar,
  .page-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .page-header-actions {
    justify-content: flex-start;
    width: 100%;
  }

  .summary-total strong,
  .summary-primary strong {
    font-size: 28px;
  }
}

@media (max-width: 640px) {
  .main {
    --bm-main-inline-gap: 14px;
    padding: 14px;
  }

  .topbar h1,
  .page-header h1 {
    font-size: 24px;
  }

  .panel-head,
  .form-body,
  .summary-card {
    padding: 14px;
  }

  .app-shell table {
    min-width: 720px;
  }

  .panel {
    overflow-x: auto;
  }

  .toolbar,
  .job-filter,
  .global-search {
    align-items: stretch;
    flex-direction: column;
  }

  .repair-followup-search,
  .repair-followup-filter-grid,
  .payment-summary-grid,
  .payment-readonly-grid,
  .payment-form-grid,
  .payment-detail-grid,
  .repair-followup-snooze-form {
    grid-template-columns: 1fr;
  }

  .payment-cancel-dialog dl {
    grid-template-columns: 1fr;
  }

  .payment-cancel-actions {
    flex-direction: column;
  }

  .repair-followup-actions .table-link,
  .repair-followup-action-panel summary {
    width: 100%;
  }

  .search-input,
  .job-filter .search-input,
  .global-search .search-input,
  .job-filter select,
  .job-filter .secondary-btn,
  .global-search .secondary-btn {
    width: 100%;
    max-width: none;
  }
}

@media (max-width: 520px) {
  .bm-confirm-dialog {
    padding: 22px 18px;
  }

  .bm-confirm-actions {
    grid-template-columns: 1fr;
  }
}

/* If the gray strip at the very top is the native macOS/Electron title bar, CSS in this file cannot restyle it. Change that in the desktop shell configuration instead. */

html.bm-sidebar-collapsed .app-shell { grid-template-columns:var(--bm-sidebar-collapsed-width) minmax(0,1fr); }
@media (max-width: 860px) {
  .app-shell .bm-sidebar { position:fixed; inset:0 auto 0 0; width:min(310px,88vw); height:100vh; max-height:none; padding:18px 12px; transform:translateX(-105%); }
  html.bm-mobile-sidebar-open .app-shell .bm-sidebar { transform:translateX(0); }
  .app-shell .bm-sidebar nav { display:block; }
  .app-shell .bm-sidebar-scrim { display:none; }
  html.bm-mobile-sidebar-open .app-shell .bm-sidebar-scrim { display:block; }
}

/*
 * BM Shop Liquid Glass — Phase 1
 * Shared visual layer for application screens. Print-only pages do not load
 * app-ui.css, so document/PDF output remains unchanged.
 */
:root {
  --bm-glass-bg: rgba(255, 255, 255, 0.66);
  --bm-glass-bg-strong: rgba(255, 255, 255, 0.82);
  --bm-glass-bg-soft: rgba(242, 248, 255, 0.58);
  --bm-glass-line: rgba(255, 255, 255, 0.72);
  --bm-glass-line-blue: rgba(68, 139, 236, 0.2);
  --bm-glass-shadow: 0 18px 44px rgba(25, 79, 151, 0.14);
  --bm-glass-shadow-soft: 0 10px 28px rgba(25, 79, 151, 0.1);
  --bm-glass-highlight: inset 0 1px 0 rgba(255, 255, 255, 0.88);
  --bm-glass-blur: 22px;
  --bm-liquid-blue: #087df2;
  --bm-liquid-blue-deep: #075ed8;
  --bm-liquid-blue-glow: rgba(8, 125, 242, 0.3);
  --bm-radius-md: 14px;
  --bm-radius-lg: 18px;
  --bm-radius-xl: 22px;
}

body:not(.preview-body) {
  min-height: 100vh;
  background:
    radial-gradient(circle at 8% 8%, rgba(21, 132, 255, 0.34), transparent 30%),
    radial-gradient(circle at 92% 14%, rgba(112, 126, 255, 0.24), transparent 30%),
    radial-gradient(circle at 72% 92%, rgba(56, 181, 255, 0.22), transparent 34%),
    linear-gradient(145deg, #d9ecff 0%, #eef6ff 43%, #dceaff 100%);
  background-attachment: fixed;
}

body:not(.preview-body) .app-shell {
  background: transparent;
}

body:not(.preview-body) .main {
  background: rgba(238, 247, 255, 0.2);
}

body:not(.preview-body) .main::before {
  color: #0a4da7;
  border-bottom: 1px solid rgba(255, 255, 255, 0.68);
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.74), rgba(218, 236, 255, 0.62));
  -webkit-backdrop-filter: blur(22px) saturate(145%);
  backdrop-filter: blur(22px) saturate(145%);
  box-shadow: 0 10px 28px rgba(25, 79, 151, 0.1);
}

html.bm-sidebar-collapsed body:not(.preview-body) .main::before,
body:not(.preview-body) .app-shell.bm-sidebar-collapsed .main::before {
  left: var(--bm-sidebar-collapsed-width);
}

body:not(.preview-body) .sidebar.bm-sidebar {
  border-right: 1px solid rgba(255, 255, 255, 0.72);
  background:
    linear-gradient(165deg, rgba(255, 255, 255, 0.82), rgba(213, 233, 255, 0.62)),
    rgba(235, 245, 255, 0.7);
  -webkit-backdrop-filter: blur(26px) saturate(155%);
  backdrop-filter: blur(26px) saturate(155%);
  box-shadow:
    inset -1px 0 0 rgba(65, 131, 226, 0.12),
    14px 0 36px rgba(27, 83, 157, 0.12);
}

body:not(.preview-body) .bm-sidebar-head {
  border-bottom-color: rgba(61, 113, 186, 0.14);
}

body:not(.preview-body) .bm-sidebar-brand,
body:not(.preview-body) .bm-sidebar-link,
body:not(.preview-body) .bm-sidebar-group-toggle,
body:not(.preview-body) .sidebar-logout-button {
  color: #123467;
}

body:not(.preview-body) .bm-sidebar-toggle {
  color: #075ed8;
  border: 1px solid rgba(49, 123, 222, 0.16);
  background: rgba(255, 255, 255, 0.54);
  box-shadow: var(--bm-glass-highlight), 0 6px 16px rgba(28, 87, 164, 0.1);
}

body:not(.preview-body) .bm-sidebar-group {
  border-color: rgba(64, 126, 211, 0.12);
  background: rgba(255, 255, 255, 0.34);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.62);
}

body:not(.preview-body) .bm-sidebar-link + .bm-sidebar-link,
body:not(.preview-body) .bm-sidebar-submenu .bm-sidebar-link + .bm-sidebar-link {
  border-top-color: rgba(59, 112, 184, 0.1);
}

body:not(.preview-body) .bm-sidebar-link:hover,
body:not(.preview-body) .bm-sidebar-group-toggle:hover {
  color: #075ed8;
  background: rgba(255, 255, 255, 0.58);
  box-shadow: var(--bm-glass-highlight);
}

body:not(.preview-body) .bm-sidebar-link.active {
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.56);
  background:
    linear-gradient(135deg, rgba(34, 153, 255, 0.96), rgba(5, 94, 216, 0.96));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.52),
    0 12px 26px var(--bm-liquid-blue-glow);
}

body:not(.preview-body) .bm-sidebar-link.active .bm-sidebar-icon {
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.16);
}

body:not(.preview-body) .bm-sidebar-icon {
  border-color: rgba(44, 113, 208, 0.14);
  background: rgba(255, 255, 255, 0.52);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

body:not(.preview-body) .bm-sidebar-icon--blue { color: var(--bm-sidebar-icon-blue); }
body:not(.preview-body) .bm-sidebar-icon--green { color: #15975b; }
body:not(.preview-body) .bm-sidebar-icon--cyan { color: #0899b7; }
body:not(.preview-body) .bm-sidebar-icon--purple { color: #7c55d9; }
body:not(.preview-body) .bm-sidebar-icon--orange { color: #d56f13; }
body:not(.preview-body) .bm-sidebar-icon--red { color: #d94b48; }
body:not(.preview-body) .bm-sidebar-icon--yellow { color: #b98200; }
body:not(.preview-body) .bm-sidebar-icon--pink { color: #c84e8a; }
body:not(.preview-body) .bm-sidebar-icon--gray { color: #6b7c93; }

body:not(.preview-body) .bm-topbar,
body:not(.preview-body) .topbar.page-header {
  padding: 14px 18px;
  border: 1px solid var(--bm-glass-line);
  border-radius: var(--bm-radius-xl);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.82), rgba(232, 243, 255, 0.6));
  -webkit-backdrop-filter: blur(var(--bm-glass-blur)) saturate(145%);
  backdrop-filter: blur(var(--bm-glass-blur)) saturate(145%);
  box-shadow: var(--bm-glass-highlight), var(--bm-glass-shadow-soft);
}

body:not(.preview-body) :where(
  .panel,
  .control-panel,
  .control-card,
  .control-side-card,
  .work-summary-card,
  .payment-mini-card,
  .dashboard-hero,
  .job-entry-hero,
  .app-pagination,
  .user-pill
) {
  border-color: var(--bm-glass-line);
  background:
    linear-gradient(145deg, var(--bm-glass-bg-strong), var(--bm-glass-bg-soft));
  -webkit-backdrop-filter: blur(var(--bm-glass-blur)) saturate(140%);
  backdrop-filter: blur(var(--bm-glass-blur)) saturate(140%);
  box-shadow: var(--bm-glass-highlight), var(--bm-glass-shadow-soft);
}

body:not(.preview-body) :where(.control-card, .work-summary-card, .payment-mini-card) {
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

body:not(.preview-body) :where(.control-card, .work-summary-card, .payment-mini-card):hover {
  border-color: rgba(67, 137, 233, 0.28);
  transform: translateY(-2px);
  box-shadow: var(--bm-glass-highlight), var(--bm-glass-shadow);
}

body:not(.preview-body) :where(
  .primary-btn,
  .btn-primary,
  .control-link-button.primary,
  .dashboard-search button,
  button.primary,
  a.primary
) {
  border: 1px solid rgba(255, 255, 255, 0.54);
  border-radius: 14px;
  color: #ffffff;
  background:
    linear-gradient(135deg, rgba(31, 155, 255, 0.98), rgba(5, 94, 216, 0.98));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.5),
    0 10px 22px rgba(7, 94, 216, 0.24);
  transition: transform 160ms ease, box-shadow 160ms ease, filter 160ms ease;
}

body:not(.preview-body) :where(
  .primary-btn,
  .btn-primary,
  .control-link-button.primary,
  .dashboard-search button,
  button.primary,
  a.primary
):hover {
  filter: saturate(112%) brightness(1.04);
  transform: translateY(-1px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.62),
    0 14px 28px rgba(7, 94, 216, 0.3);
}

body:not(.preview-body) :where(
  .secondary-btn,
  .btn-secondary,
  .control-outline-button,
  .control-link-button:not(.primary),
  .app-pagination__button
) {
  border-color: rgba(49, 118, 211, 0.2);
  border-radius: 13px;
  color: #0b4fae;
  background: rgba(255, 255, 255, 0.56);
  -webkit-backdrop-filter: blur(14px) saturate(135%);
  backdrop-filter: blur(14px) saturate(135%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.76), 0 7px 18px rgba(25, 78, 148, 0.09);
}

body:not(.preview-body) :where(input, select, textarea) {
  border-color: rgba(61, 119, 199, 0.2);
  background: rgba(255, 255, 255, 0.7);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.84);
}

body:not(.preview-body) :where(input, select, textarea):focus {
  border-color: rgba(8, 125, 242, 0.64);
  box-shadow: 0 0 0 4px rgba(8, 125, 242, 0.13), inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

body:not(.preview-body) :where(.control-table-wrap, .table-wrap) {
  border-radius: var(--bm-radius-lg);
  background: rgba(255, 255, 255, 0.3);
}

body:not(.preview-body) :where(.control-table, .app-shell table) thead th {
  background: rgba(225, 240, 255, 0.72);
}

body:not(.preview-body) :where(.control-table, .app-shell table) tbody tr:hover {
  background: rgba(227, 242, 255, 0.56);
}

@supports not ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  body:not(.preview-body) .sidebar.bm-sidebar,
  body:not(.preview-body) .main::before,
  body:not(.preview-body) .bm-topbar,
  body:not(.preview-body) .topbar.page-header,
  body:not(.preview-body) :where(
    .panel,
    .control-panel,
    .control-card,
    .control-side-card,
    .work-summary-card,
    .payment-mini-card,
    .dashboard-hero,
    .job-entry-hero,
    .app-pagination,
    .user-pill
  ) {
    background: #f7fbff;
  }
}

@media (prefers-reduced-motion: reduce) {
  body:not(.preview-body) :where(.control-card, .work-summary-card, .payment-mini-card),
  body:not(.preview-body) :where(.primary-btn, .btn-primary, .control-link-button.primary) {
    transition: none;
  }
}

@media (prefers-reduced-transparency: reduce) {
  body:not(.preview-body) .sidebar.bm-sidebar,
  body:not(.preview-body) .main::before,
  body:not(.preview-body) .bm-topbar,
  body:not(.preview-body) .topbar.page-header,
  body:not(.preview-body) :where(.panel, .control-panel, .control-card, .control-side-card) {
    background: #f7fbff;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
}

@media (max-width: 860px) {
  body:not(.preview-body) .app-shell .bm-sidebar {
    background: rgba(242, 248, 255, 0.94);
  }

  body:not(.preview-body) .bm-sidebar-mobile-close,
  body:not(.preview-body) .bm-sidebar-mobile-open {
    color: #ffffff;
    background: linear-gradient(135deg, var(--bm-liquid-blue), var(--bm-liquid-blue-deep));
    box-shadow: 0 10px 24px rgba(7, 94, 216, 0.24);
  }
}

/*
 * BM Shop Liquid Glass — Phase 2
 * Refines the shared application chrome and content surfaces. This block is
 * screen-only so print/PDF output keeps its existing stylesheet contract.
 */
@media screen {
  :root {
    --bm-glass-canvas: #eaf4ff;
    --bm-glass-surface: rgba(255, 255, 255, 0.72);
    --bm-glass-surface-strong: rgba(255, 255, 255, 0.84);
    --bm-glass-surface-soft: rgba(236, 246, 255, 0.62);
    --bm-glass-blue: rgba(208, 232, 255, 0.76);
    --bm-glass-border: rgba(255, 255, 255, 0.82);
    --bm-glass-border-blue: rgba(42, 111, 204, 0.28);
    --bm-glass-ink: #102c53;
    --bm-glass-muted: #506884;
    --bm-glass-blue-strong: #087cf0;
    --bm-glass-blue-deep: #075bcf;
    --bm-glass-depth: 0 12px 28px rgba(31, 84, 151, 0.12);
    --bm-glass-depth-soft: 0 7px 19px rgba(31, 84, 151, 0.085);
    --bm-glass-edge: inset 0 1px 0 rgba(255, 255, 255, 0.92);
    --bm-glass-blur: 14px;
  }

  body:not(.preview-body) {
    overflow-x: clip;
    color: var(--bm-glass-ink);
    background-attachment: scroll;
    background-color: var(--bm-glass-canvas);
    background-image:
      radial-gradient(circle at 4% 4%, rgba(85, 169, 255, 0.24), transparent 29rem),
      radial-gradient(circle at 96% 12%, rgba(125, 145, 255, 0.16), transparent 32rem),
      radial-gradient(circle at 74% 96%, rgba(61, 193, 255, 0.14), transparent 34rem),
      linear-gradient(145deg, #deefff 0%, #f4f9ff 48%, #e2efff 100%);
  }

  body:not(.preview-body) .app-shell,
  body:not(.preview-body) .main,
  body:not(.preview-body) .page-content {
    min-width: 0;
  }

  body:not(.preview-body) .main {
    background: rgba(238, 247, 255, 0.16);
  }

  body:not(.preview-body) .main::before {
    color: #174f94;
    border-bottom: 1px solid rgba(255, 255, 255, 0.9);
    background-color: rgba(222, 239, 255, 0.9);
    background-image: linear-gradient(105deg, rgba(255, 255, 255, 0.72), rgba(199, 228, 255, 0.64));
    -webkit-backdrop-filter: blur(16px) saturate(135%);
    backdrop-filter: blur(16px) saturate(135%);
    box-shadow: 0 8px 24px rgba(31, 84, 151, 0.1);
  }

  body:not(.preview-body) .sidebar.bm-sidebar {
    border-right: 1px solid rgba(255, 255, 255, 0.86);
    background-color: rgba(230, 243, 255, 0.94);
    background-image: linear-gradient(160deg, rgba(255, 255, 255, 0.84), rgba(207, 230, 255, 0.7));
    -webkit-backdrop-filter: blur(18px) saturate(135%);
    backdrop-filter: blur(18px) saturate(135%);
    box-shadow:
      inset -1px 0 0 rgba(65, 131, 226, 0.1),
      10px 0 28px rgba(27, 83, 157, 0.1);
  }

  body:not(.preview-body) .bm-sidebar-head {
    min-width: 0;
    border-bottom-color: rgba(47, 110, 196, 0.14);
  }

  body:not(.preview-body) .bm-sidebar-brand {
    color: #0b4188;
    letter-spacing: -0.01em;
  }

  body:not(.preview-body) .bm-sidebar-group {
    border-color: rgba(48, 116, 207, 0.13);
    background: rgba(255, 255, 255, 0.42);
    box-shadow: var(--bm-glass-edge);
  }

  body:not(.preview-body) :where(.bm-sidebar-link, .bm-sidebar-group-toggle, .sidebar-logout-button) {
    color: #183c69;
  }

  body:not(.preview-body) :where(.bm-sidebar-link, .bm-sidebar-group-toggle):hover {
    color: #075bcf;
    background: rgba(255, 255, 255, 0.7);
    box-shadow: var(--bm-glass-edge), 0 5px 14px rgba(31, 84, 151, 0.07);
  }

  body:not(.preview-body) .bm-sidebar-link.active {
    color: #fff;
    border-color: rgba(255, 255, 255, 0.62);
    background-color: var(--bm-glass-blue-deep);
    background-image: linear-gradient(135deg, #2aa4ff, #087cf0 48%, #075bcf);
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.58),
      0 9px 21px rgba(7, 91, 207, 0.24);
  }

  body:not(.preview-body) .bm-sidebar-icon {
    border-color: rgba(44, 113, 208, 0.13);
    background: rgba(255, 255, 255, 0.64);
  }

  body:not(.preview-body) .bm-topbar,
  body:not(.preview-body) .topbar.page-header {
    min-width: 0;
    padding: 13px 18px;
    border: 1px solid var(--bm-glass-border) !important;
    border-radius: 22px;
    color: var(--bm-glass-ink) !important;
    background-color: rgba(224, 240, 255, 0.94) !important;
    background-image:
      linear-gradient(120deg, rgba(255, 255, 255, 0.8), rgba(204, 232, 255, 0.68)),
      linear-gradient(180deg, rgba(227, 243, 255, 0.9), rgba(210, 234, 255, 0.82)) !important;
    -webkit-backdrop-filter: blur(16px) saturate(135%);
    backdrop-filter: blur(16px) saturate(135%);
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.96),
      0 12px 30px rgba(31, 84, 151, 0.11) !important;
  }

  body:not(.preview-body) .bm-topbar::before {
    inset: 0 !important;
    border-radius: inherit;
    background: linear-gradient(110deg, rgba(255, 255, 255, 0.24), rgba(142, 199, 255, 0.12)) !important;
    box-shadow: none !important;
  }

  body:not(.preview-body) :where(.bm-topbar-brand, .bm-topbar-page, .bm-topbar-meta) {
    min-width: 0;
  }

  body:not(.preview-body) .bm-topbar :where(.bm-topbar-shop span, .bm-topbar-user span, .bm-topbar-date span, .page-subtitle) {
    color: var(--bm-glass-muted) !important;
  }

  body:not(.preview-body) .bm-topbar :where(.bm-topbar-date, .bm-topbar-user) {
    color: #254f7e !important;
    background: rgba(255, 255, 255, 0.68);
  }

  body:not(.preview-body) .bm-topbar :where(.bm-topbar-date svg, .bm-topbar-avatar svg) {
    color: #1761aa !important;
    stroke: #1761aa !important;
    opacity: 1;
  }

  body:not(.preview-body) .bm-topbar :where(.bm-topbar-shop strong, .bm-topbar-user strong, .page-title, h1) {
    color: #0d376e !important;
  }

  body:not(.preview-body) :where(.bm-topbar-user, .bm-topbar-date, .user-pill) {
    border: 1px solid rgba(255, 255, 255, 0.82);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.56);
    box-shadow: var(--bm-glass-edge), 0 6px 16px rgba(31, 84, 151, 0.07);
  }

  body:not(.preview-body) .sidebar-alert-badge {
    border: 1px solid rgba(255, 255, 255, 0.78);
    color: #ffffff;
    background: #d92d3a;
    box-shadow: 0 5px 12px rgba(185, 28, 40, 0.2);
  }

  body:not(.preview-body) .app-shell :where(
    .panel,
    .card:not(.student-card-preview-card):not(.student-card-front-preview-card):not(.student-card-back-preview-card),
    .page-card,
    .form-panel,
    .detail-panel,
    .control-panel,
    .control-card,
    .control-side-card,
    .work-summary-card,
    .payment-mini-card,
    .dashboard-hero,
    .job-entry-hero,
    .job-form-section,
    .job-live-summary,
    .job-recent-panel,
    .vinyl-status-card,
    .notification-card,
    .notification-filter-panel,
    .notification-stat,
    .report-filter,
    .report-table-panel,
    .stat-card,
    .settings-card,
    .settings-side-card,
    .documents-form-card,
    .documents-side-card,
    .photo-id-panel,
    .student-card-index-hero,
    .student-card-project,
    .app-pagination
  ) {
    min-width: 0;
    border-color: var(--bm-glass-border) !important;
    background-color: rgba(255, 255, 255, 0.86) !important;
    background-image: linear-gradient(145deg, var(--bm-glass-surface-strong), var(--bm-glass-surface-soft)) !important;
    -webkit-backdrop-filter: blur(var(--bm-glass-blur)) saturate(130%);
    backdrop-filter: blur(var(--bm-glass-blur)) saturate(130%);
    box-shadow: var(--bm-glass-edge), var(--bm-glass-depth-soft) !important;
  }

  body:not(.preview-body) .app-shell :where(
    .dashboard-hero,
    .job-entry-hero,
    .control-card,
    .stat-card,
    .notification-stat
  ) {
    background-color: rgba(255, 255, 255, 0.9) !important;
    box-shadow: var(--bm-glass-edge), 0 9px 22px rgba(31, 84, 151, 0.1) !important;
  }

  body:not(.preview-body) .app-shell :where(
    .muted,
    .muted-text,
    .control-card p,
    .stat-card p,
    .notification-meta,
    .latest-job-meta,
    .payment-mini-card span,
    .summary-line span,
    .photo-id-storage-state,
    .pagination-summary,
    .app-pagination__info
  ) {
    color: var(--bm-glass-muted) !important;
  }

  body:not(.preview-body) .app-shell :where(
    .control-card,
    .work-summary-card,
    .payment-mini-card,
    .vinyl-status-card,
    .notification-stat,
    .stat-card
  ) {
    transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
  }

  body:not(.preview-body) .app-shell :where(
    .control-card,
    .work-summary-card,
    .payment-mini-card,
    .vinyl-status-card,
    .notification-stat,
    .stat-card
  ):hover {
    border-color: rgba(70, 143, 235, 0.3);
    transform: translateY(-1px);
    box-shadow: var(--bm-glass-edge), var(--bm-glass-depth);
  }

  body:not(.preview-body) .app-shell :where(
    .panel-head,
    .control-panel-head,
    .summary-card-header,
    .photo-id-panel-head,
    .student-card-project-head,
    .notification-title-row
  ) {
    border-bottom-color: rgba(58, 119, 198, 0.14) !important;
    background: rgba(225, 240, 255, 0.46) !important;
  }

  body:not(.preview-body) .app-shell :where(
    .primary-btn,
    .btn-primary,
    .btn.primary,
    .control-link-button.primary,
    .dashboard-search button,
    button.primary,
    a.primary,
    .settings-save
  ) {
    border: 1px solid rgba(255, 255, 255, 0.62) !important;
    border-radius: 14px;
    color: #fff !important;
    background-color: var(--bm-glass-blue-deep) !important;
    background-image: linear-gradient(135deg, #2aa4ff, #087cf0 46%, #075bcf) !important;
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.58),
      0 9px 20px rgba(7, 91, 207, 0.22) !important;
    text-shadow: 0 1px 1px rgba(4, 45, 105, 0.18);
  }

  body:not(.preview-body) .app-shell :where(
    .secondary-btn,
    .btn-secondary,
    .btn.secondary,
    .control-outline-button,
    .control-link-button:not(.primary),
    .app-pagination__button,
    .pagination-button,
    .table-link,
    .small-btn,
    .action-btn:not(.primary):not(.danger):not(.success)
  ) {
    border-color: var(--bm-glass-border-blue) !important;
    border-radius: 13px;
    color: #0b4fae !important;
    background-color: rgba(255, 255, 255, 0.9) !important;
    background-image: linear-gradient(145deg, rgba(255, 255, 255, 0.84), rgba(231, 243, 255, 0.68)) !important;
    box-shadow: var(--bm-glass-edge), 0 6px 16px rgba(31, 84, 151, 0.08) !important;
  }

  body:not(.preview-body) .app-shell :where(
    .danger-btn,
    .btn-danger,
    .action-btn.danger,
    .bm-btn-danger
  ) {
    border: 1px solid rgba(255, 255, 255, 0.54) !important;
    border-radius: 13px;
    color: #ffffff !important;
    background-color: #c82f3c !important;
    background-image: linear-gradient(135deg, rgba(239, 68, 68, 0.96), rgba(190, 34, 49, 0.98)) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.38), 0 8px 18px rgba(185, 28, 40, 0.2) !important;
  }

  body:not(.preview-body) .app-shell :where(
    .primary-btn,
    .btn-primary,
    .btn.primary,
    .control-link-button.primary,
    .dashboard-search button,
    button.primary,
    a.primary,
    .settings-save
  ):hover:not(:disabled) {
    filter: saturate(106%) brightness(1.025);
    transform: translateY(-1px);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.62), 0 11px 23px rgba(7, 91, 207, 0.25) !important;
  }

  body:not(.preview-body) .app-shell :where(
    .secondary-btn,
    .btn-secondary,
    .btn.secondary,
    .control-outline-button,
    .control-link-button:not(.primary),
    .app-pagination__button,
    .pagination-button,
    .table-link,
    .small-btn,
    .action-btn:not(.primary):not(.danger):not(.success)
  ):hover:not(:disabled) {
    border-color: rgba(31, 106, 207, 0.4) !important;
    color: #084899 !important;
    background-color: rgba(255, 255, 255, 0.96) !important;
    box-shadow: var(--bm-glass-edge), 0 8px 18px rgba(31, 84, 151, 0.11) !important;
  }

  body:not(.preview-body) .app-shell :where(.danger-btn, .btn-danger, .action-btn.danger, .bm-btn-danger):hover:not(:disabled) {
    filter: brightness(0.96) saturate(106%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.42), 0 9px 20px rgba(185, 28, 40, 0.24) !important;
  }

  body:not(.preview-body) .app-shell :where(button, .btn, .primary-btn, .secondary-btn, .danger-btn, .table-link, .action-btn):focus-visible {
    outline: none;
    box-shadow: 0 0 0 4px rgba(8, 124, 240, 0.16), 0 7px 17px rgba(31, 84, 151, 0.12) !important;
  }

  body:not(.preview-body) .app-shell :where(.danger-btn, .btn-danger, .action-btn.danger, .bm-btn-danger):focus-visible {
    box-shadow: 0 0 0 4px rgba(200, 47, 60, 0.17), 0 8px 18px rgba(185, 28, 40, 0.18) !important;
  }

  body:not(.preview-body) .app-shell :where(button, .btn, .primary-btn, .secondary-btn, .danger-btn, .table-link, .action-btn):active:not(:disabled) {
    filter: brightness(0.98);
    transform: translateY(0);
  }

  body:not(.preview-body) .app-shell :where(
    button:disabled,
    input:disabled,
    select:disabled,
    textarea:disabled,
    .btn[aria-disabled="true"],
    .is-disabled,
    .app-pagination__button--disabled
  ) {
    cursor: not-allowed !important;
    filter: grayscale(16%);
    opacity: 0.58 !important;
    box-shadow: none !important;
  }

  body:not(.preview-body) .app-shell :where(
    .primary-btn,
    .btn-primary,
    .btn.primary,
    .control-link-button.primary,
    .dashboard-search button,
    button.primary,
    a.primary,
    .settings-save,
    .secondary-btn,
    .btn-secondary,
    .btn.secondary,
    .control-outline-button,
    .control-link-button:not(.primary),
    .table-link,
    .small-btn,
    .action-btn
  ) {
    max-width: 100%;
  }

  body:not(.preview-body) .app-shell :where(
    input:not([type="checkbox"]):not([type="radio"]),
    select,
    textarea,
    .search-input,
    .service-combobox-input
  ) {
    max-width: 100%;
    border-color: rgba(47, 110, 198, 0.3) !important;
    border-radius: 13px;
    color: var(--bm-glass-ink) !important;
    background-color: rgba(255, 255, 255, 0.9) !important;
    background-image: linear-gradient(145deg, rgba(255, 255, 255, 0.84), rgba(239, 247, 255, 0.7)) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.94), 0 5px 14px rgba(31, 84, 151, 0.06) !important;
  }

  body:not(.preview-body) .app-shell :where(input, textarea)::placeholder {
    color: #71839a !important;
    opacity: 1;
  }

  body:not(.preview-body) .app-shell select {
    color-scheme: light;
  }

  body:not(.preview-body) .app-shell select option {
    color: var(--bm-glass-ink);
    background: #ffffff;
  }

  body:not(.preview-body) .app-shell :where(input, select, textarea):focus {
    border-color: rgba(8, 124, 240, 0.64) !important;
    outline: none;
    box-shadow: 0 0 0 4px rgba(8, 124, 240, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.96) !important;
  }

  body:not(.preview-body) .app-shell :where(
    .search-toolbar,
    .toolbar,
    .repair-toolbar,
    .documents-toolbar,
    .dashboard-search,
    .job-filter,
    .notification-filter-grid,
    .report-filter-row
  ) {
    min-width: 0;
    border-color: rgba(255, 255, 255, 0.8) !important;
    background: rgba(255, 255, 255, 0.48) !important;
    box-shadow: var(--bm-glass-edge) !important;
  }

  body:not(.preview-body) .app-shell :where(
    .table-wrap,
    .control-table-wrap,
    .job-list-table-wrap,
    .vinyl-table-wrap,
    .repair-table-wrap,
    .documents-table-wrap
  ) {
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    -webkit-overflow-scrolling: touch;
    border: 1px solid rgba(255, 255, 255, 0.82) !important;
    border-radius: 17px;
    background: rgba(255, 255, 255, 0.46) !important;
    box-shadow: var(--bm-glass-edge), 0 7px 18px rgba(31, 84, 151, 0.06) !important;
  }

  body:not(.preview-body) .app-shell table {
    width: 100%;
    max-width: none;
    border-collapse: separate;
    border-spacing: 0;
  }

  body:not(.preview-body) .app-shell table :where(th, td) {
    min-width: 0;
    border-color: rgba(56, 115, 191, 0.11);
    overflow-wrap: anywhere;
    word-break: normal;
  }

  body:not(.preview-body) .app-shell table thead th {
    color: #174778 !important;
    background: rgba(218, 238, 255, 0.78) !important;
  }

  body:not(.preview-body) .app-shell table tbody tr:nth-child(even) {
    background: rgba(244, 249, 255, 0.36);
  }

  body:not(.preview-body) .app-shell table tbody tr:hover {
    background: rgba(219, 239, 255, 0.46);
  }

  body:not(.preview-body) .app-shell :where(
    .notice,
    .action-notice,
    .empty-state,
    .notification-empty,
    .repair-empty,
    .photo-id-history-empty,
    .document-helper,
    .job-summary-alert
  ) {
    border-color: rgba(66, 132, 218, 0.2);
    border-radius: 15px;
    background: rgba(247, 251, 255, 0.74);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
  }

  body:not(.preview-body) .app-shell :where(
    .control-main-grid,
    .control-card-grid,
    .payment-summary-grid,
    .quick-action-grid,
    .job-entry-grid,
    .job-form-grid,
    .vinyl-status-grid,
    .content-grid,
    .notification-stats,
    .report-grid,
    .reports-stats,
    .settings-layout,
    .documents-layout,
    .student-card-grid
  ) > * {
    min-width: 0;
  }
}

@supports not ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  @media screen {
    body:not(.preview-body) .main::before,
    body:not(.preview-body) .sidebar.bm-sidebar,
    body:not(.preview-body) :where(.bm-topbar, .topbar.page-header),
    body:not(.preview-body) .app-shell :where(
      .panel,
      .card:not(.student-card-preview-card):not(.student-card-front-preview-card):not(.student-card-back-preview-card),
      .page-card,
      .form-panel,
      .detail-panel,
      .control-panel,
      .control-card,
      .control-side-card,
      .work-summary-card,
      .payment-mini-card,
      .notification-card,
      .report-table-panel,
      .settings-card,
      .settings-side-card,
      .documents-form-card,
      .documents-side-card,
      .photo-id-panel
    ) {
      background-color: #f7fbff;
      background-image: none;
    }
  }
}

@media screen and (prefers-reduced-motion: reduce) {
  body:not(.preview-body) .app-shell :where(
    .control-card,
    .work-summary-card,
    .payment-mini-card,
    .vinyl-status-card,
    .notification-stat,
    .stat-card,
    .primary-btn,
    .btn-primary,
    .btn,
    .control-link-button.primary,
    .dashboard-search button,
    button.primary,
    a.primary,
    .secondary-btn,
    .btn-secondary,
    .danger-btn,
    .btn-danger,
    .bm-btn-danger,
    .table-link,
    .small-btn,
    .action-btn
  ) {
    scroll-behavior: auto;
    transition: none;
    transform: none;
  }
}

@media screen and (prefers-reduced-transparency: reduce) {
  body:not(.preview-body) {
    background-color: #edf5ff;
    background-image: none;
  }

  body:not(.preview-body) .main::before,
  body:not(.preview-body) .sidebar.bm-sidebar,
  body:not(.preview-body) :where(.bm-topbar, .topbar.page-header),
  body:not(.preview-body) .app-shell :where(
    .panel,
    .card:not(.student-card-preview-card):not(.student-card-front-preview-card):not(.student-card-back-preview-card),
    .page-card,
    .form-panel,
    .detail-panel,
    .control-panel,
    .control-card,
    .control-side-card,
    .work-summary-card,
    .payment-mini-card,
    .notification-card,
    .report-table-panel,
    .settings-card,
    .settings-side-card,
    .documents-form-card,
    .documents-side-card,
    .photo-id-panel
  ) {
    background-color: #f8fbff;
    background-image: none;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }

  body:not(.preview-body) .bm-topbar :where(.bm-topbar-date, .bm-topbar-user),
  body:not(.preview-body) .app-shell :where(input, select, textarea) {
    background-color: #ffffff !important;
    background-image: none !important;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
}

@media screen and (max-width: 1100px) {
  body:not(.preview-body) :where(.bm-topbar, .topbar.page-header) {
    flex-wrap: wrap;
  }

  body:not(.preview-body) .bm-topbar-page {
    order: 3;
    width: 100%;
  }
}

@media screen and (max-width: 860px) {
  body:not(.preview-body) {
    overflow-x: hidden;
  }

  body:not(.preview-body) .main {
    width: 100%;
    max-width: 100vw;
  }

  body:not(.preview-body) .app-shell .bm-sidebar {
    background-color: #edf7ff;
    background-image: linear-gradient(160deg, rgba(255, 255, 255, 0.96), rgba(219, 237, 255, 0.94));
  }

  body:not(.preview-body) :where(.bm-topbar, .topbar.page-header) {
    gap: 12px;
    padding: 12px 14px;
    border-radius: 18px;
  }

  body:not(.preview-body) .bm-topbar-meta {
    width: 100%;
  }

  body:not(.preview-body) .app-shell :where(
    .control-main-grid,
    .job-entry-grid,
    .content-grid,
    .settings-layout,
    .documents-layout
  ) {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media screen and (max-width: 640px) {
  body:not(.preview-body) :where(.bm-topbar, .topbar.page-header) {
    align-items: stretch;
  }

  body:not(.preview-body) :where(.bm-topbar-brand, .bm-topbar-meta) {
    flex-wrap: wrap;
  }

  body:not(.preview-body) .app-shell :where(
    .control-card-grid,
    .payment-summary-grid,
    .quick-action-grid,
    .job-form-grid,
    .vinyl-status-grid,
    .notification-stats,
    .report-grid,
    .reports-stats,
    .student-card-grid
  ) {
    grid-template-columns: minmax(0, 1fr);
  }

  body:not(.preview-body) .app-shell :where(
    .search-toolbar,
    .toolbar,
    .repair-toolbar,
    .documents-toolbar,
    .dashboard-search,
    .job-filter,
    .notification-filter-grid,
    .report-filter-row,
    .page-header-actions,
    .action-bar
  ) {
    width: 100%;
  }

  body:not(.preview-body) .app-shell :where(
    .search-toolbar,
    .toolbar,
    .repair-toolbar,
    .documents-toolbar,
    .dashboard-search,
    .job-filter,
    .notification-filter-grid,
    .report-filter-row
  ) > * {
    min-width: 0;
    max-width: 100%;
  }

  body:not(.preview-body) .app-shell :where(.btn, button, .table-link, .action-btn) {
    white-space: normal;
  }
}

/* Student Cards index readability patch.
 * Screen-only and index-scoped so card canvases, previews, exports and print stay unchanged.
 */
@media screen {
  body.student-cards-page.student-card-index-page {
    --bm-student-text-strong: #0b315f;
    --bm-student-text-body: #294d73;
    --bm-student-text-muted: #435d79;
    --bm-student-border-readable: rgba(55, 116, 191, 0.28);
  }

  body.student-cards-page.student-card-index-page .app-shell .student-card-index-hero p,
  body.student-cards-page.student-card-index-page .app-shell .student-card-section-head p {
    color: var(--bm-student-text-muted);
  }

  body.student-cards-page.student-card-index-page .app-shell .student-card-overview-item {
    border-color: var(--bm-student-border-readable);
    background: rgba(250, 253, 255, 0.9);
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.92),
      0 9px 22px rgba(22, 70, 126, 0.08);
  }

  body.student-cards-page.student-card-index-page .app-shell .student-card-overview-item span,
  body.student-cards-page.student-card-index-page .app-shell .student-card-overview-item small,
  body.student-cards-page.student-card-index-page .app-shell .student-card-project-stats span,
  body.student-cards-page.student-card-index-page .app-shell .student-card-project-stats small {
    color: var(--bm-student-text-muted);
  }

  body.student-cards-page.student-card-index-page .app-shell .student-card-overview-item strong,
  body.student-cards-page.student-card-index-page .app-shell .student-card-project-stats strong,
  body.student-cards-page.student-card-index-page .app-shell .student-card-project-progress strong,
  body.student-cards-page.student-card-index-page .app-shell .student-card-project-format strong {
    color: var(--bm-student-text-strong);
  }

  body.student-cards-page.student-card-index-page .app-shell .student-card-section-head > span {
    border: 1px solid rgba(43, 111, 198, 0.22);
    color: #0b58b1;
    background: rgba(233, 244, 255, 0.86);
  }

  body.student-cards-page.student-card-index-page .app-shell .student-card-project-head,
  body.student-cards-page.student-card-index-page .app-shell .student-card-project-head h2 {
    color: var(--bm-student-text-strong);
  }

  body.student-cards-page.student-card-index-page .app-shell .student-card-project-head h2 {
    font-weight: 900;
    letter-spacing: 0.005em;
    text-shadow: none;
  }

  body.student-cards-page.student-card-index-page .app-shell .student-card-project-head span {
    color: var(--bm-student-text-muted);
  }

  body.student-cards-page.student-card-index-page .app-shell .student-card-project-status {
    border-color: rgba(34, 101, 181, 0.32);
    color: #0a4f9f;
    background: rgba(255, 255, 255, 0.72);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.88);
  }

  body.student-cards-page.student-card-index-page .app-shell .student-card-project-stats {
    border-color: var(--bm-student-border-readable);
    background: rgba(246, 251, 255, 0.82);
  }

  body.student-cards-page.student-card-index-page .app-shell .student-card-project-stats > div {
    border-color: rgba(62, 119, 188, 0.2);
  }

  body.student-cards-page.student-card-index-page .app-shell .student-card-project-progress > div,
  body.student-cards-page.student-card-index-page .app-shell .student-card-project-format {
    color: var(--bm-student-text-body);
  }

  body.student-cards-page.student-card-index-page .app-shell .student-card-project .student-card-actions {
    border-top-color: rgba(62, 119, 188, 0.2);
  }

  body.student-cards-page.student-card-index-page .app-shell .student-card-actions .btn.btn-secondary {
    border-color: rgba(43, 111, 198, 0.36);
    color: #124f92;
    background: rgba(247, 251, 255, 0.9);
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.94),
      0 4px 11px rgba(26, 76, 135, 0.08);
  }

  body.student-cards-page.student-card-index-page .app-shell .student-card-actions .btn.btn-secondary:hover {
    border-color: rgba(31, 101, 190, 0.52);
    color: #0b4381;
    background: rgba(232, 244, 255, 0.96);
  }

  body.student-cards-page.student-card-index-page .app-shell .student-card-actions .btn.btn-secondary:disabled,
  body.student-cards-page.student-card-index-page .app-shell .student-card-actions .btn.btn-secondary[aria-disabled="true"] {
    border-color: rgba(92, 121, 153, 0.22);
    color: #68798b;
    background: rgba(241, 245, 249, 0.7);
    box-shadow: none;
    opacity: 0.72;
  }
}

/* public repair mobile stabilization */
@media (max-width: 640px) {
  body.repair-public-page .repair-public-shell { width:min(100% - 24px,760px); padding:18px 0 28px; }
  body.repair-public-page .repair-public-header img { width:60px; height:60px; }
  body.repair-public-page .repair-public-header strong { font-size:18px; }
  body.repair-public-page .repair-public-panel,
  body.repair-public-page .repair-public-contact { padding:16px; border-radius:14px; }
  body.repair-public-page .repair-public-panel h1 { font-size:22px; }
  body.repair-public-page .repair-search-panel input { min-height:48px; font-size:16px; width:100%; box-sizing:border-box; }
  body.repair-public-page .repair-search-panel .primary-btn,
  body.repair-public-page .repair-public-panel .primary-btn { min-height:48px; }
  body.repair-public-page .repair-public-details dd { overflow-wrap:anywhere; }
  body.repair-public-page .repair-public-contact a { min-height:44px; display:flex; align-items:center; }
}

/* Internal app theme switcher.
 * Scoped to .app-shell so public pages and printable document previews keep their
 * existing colors. The default remains light unless the operator opts into dark.
 */
.bm-app-theme-toggle {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.48);
  border-radius: var(--bm-radius-md);
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.bm-app-theme-toggle:hover {
  border-color: rgba(255, 255, 255, 0.75);
  background: rgba(255, 255, 255, 0.18);
}

.bm-app-theme-toggle:focus-visible {
  outline: 3px solid rgba(147, 197, 253, 0.72);
  outline-offset: 2px;
}

.bm-theme-icon {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.bm-theme-icon-sun,
html[data-app-theme="dark"] .bm-theme-icon-moon {
  display: none;
}

html[data-app-theme="dark"] .bm-theme-icon-sun {
  display: block;
}

@media screen {
  html[data-app-theme="dark"] {
    color-scheme: dark;
    --bg: #09111f;
    --panel: #111c2d;
    --line: rgba(148, 163, 184, 0.22);
    --text: #dbe7f5;
    --ink: #f3f7fc;
    --muted: #9aabc0;
    --bm-ink: #f3f7fc;
    --bm-text: #dbe7f5;
    --bm-muted: #9aabc0;
    --bm-soft: #09111f;
    --bm-panel: #111c2d;
    --bm-panel-tint: #162338;
    --bm-line: #2a3a50;
    --bm-line-strong: #3a4d66;
    --bm-blue-050: #14243b;
    --bm-blue-100: #183252;
    --bm-tint-blue: #132640;
    --bm-tint-green: #102c27;
    --bm-tint-amber: #322711;
    --bm-tint-purple: #241d3d;
    --bm-tint-cyan: #102b36;
    --bm-tint-rose: #321c2a;
    --bm-neutral-soft: #202c3d;
    --bm-success-soft: #102f27;
    --bm-warning-soft: #352a12;
    --bm-danger-soft: #351b23;
    --bm-shadow-sm: 0 6px 18px rgba(0, 0, 0, 0.22);
    --bm-shadow-md: 0 12px 30px rgba(0, 0, 0, 0.28);
    --bm-shadow-lg: 0 22px 50px rgba(0, 0, 0, 0.34);
    --bm-focus-ring: 0 0 0 4px rgba(56, 145, 255, 0.24);
  }

  html[data-app-theme="dark"] body:not(.preview-body) {
    color: var(--bm-text);
    background: #09111f;
  }

  html[data-app-theme="dark"] body:not(.preview-body) .app-shell {
    color: var(--bm-text);
    background:
      var(--bm-top-gradient) var(--bm-sidebar-width) 0 / calc(100% - var(--bm-sidebar-width)) var(--bm-top-banner-height) no-repeat,
      #09111f;
  }

  html[data-app-theme="dark"] body:not(.preview-body) :where(.main, .page-content) {
    background: transparent;
  }

  html[data-app-theme="dark"] body:not(.preview-body) .main::before {
    color: #dbeafe;
    border-color: #293b54;
    background-color: #101d30;
    background-image: linear-gradient(105deg, #152944, #102038);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.24);
  }

  html[data-app-theme="dark"] body:not(.preview-body) .sidebar.bm-sidebar {
    border-right-color: #283a52;
    background-color: #081427;
    background-image: linear-gradient(180deg, #0c203c, #071426);
    box-shadow: 10px 0 28px rgba(0, 0, 0, 0.24);
  }

  html[data-app-theme="dark"] body:not(.preview-body) .bm-sidebar-group {
    border-color: rgba(148, 163, 184, 0.18);
    background: rgba(15, 32, 55, 0.72);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  }

  html[data-app-theme="dark"] body:not(.preview-body) :where(.bm-sidebar-brand, .bm-sidebar-link, .bm-sidebar-group-toggle, .sidebar-logout-button) {
    color: #c9d9ec;
  }

  html[data-app-theme="dark"] body:not(.preview-body) :where(.bm-sidebar-link, .bm-sidebar-group-toggle):hover {
    color: #ffffff;
    background: rgba(96, 165, 250, 0.13);
  }

  html[data-app-theme="dark"] body:not(.preview-body) .bm-sidebar-icon {
    border-color: rgba(147, 197, 253, 0.16);
    background: rgba(30, 64, 100, 0.66);
  }

  html[data-app-theme="dark"] body:not(.preview-body) .bm-topbar,
  html[data-app-theme="dark"] body:not(.preview-body) .topbar.page-header {
    border-color: #314966 !important;
    color: #ffffff !important;
    background-color: #10243d !important;
    background-image: linear-gradient(120deg, #153453, #10253e 58%, #142d49) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 12px 30px rgba(0, 0, 0, 0.25) !important;
  }

  html[data-app-theme="dark"] body:not(.preview-body) .bm-topbar::before {
    background: linear-gradient(110deg, rgba(76, 145, 219, 0.08), rgba(7, 18, 34, 0.18)) !important;
  }

  html[data-app-theme="dark"] body:not(.preview-body) .bm-topbar :where(.bm-topbar-shop strong, .bm-topbar-user strong, .page-title, h1) {
    color: #ffffff !important;
  }

  html[data-app-theme="dark"] body:not(.preview-body) .bm-topbar :where(.bm-topbar-shop span, .bm-topbar-user span, .bm-topbar-date span, .page-subtitle) {
    color: #b8c9dc !important;
  }

  html[data-app-theme="dark"] body:not(.preview-body) .bm-topbar :where(.bm-topbar-date, .bm-topbar-user, .user-pill) {
    border-color: rgba(147, 197, 253, 0.22);
    color: #dbeafe !important;
    background: rgba(7, 18, 34, 0.42);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  }

  html[data-app-theme="dark"] body:not(.preview-body) .app-shell :where(
    .panel,
    .bm-card,
    .summary-card,
    .card,
    .content-card,
    .form-card,
    .filter-card,
    .table-card,
    .detail-card,
    .info-card,
    .settings-card,
    .dashboard-card,
    .notification-card,
    .report-card,
    .modal-content,
    .dialog-content
  ) {
    border-color: var(--bm-line) !important;
    color: var(--bm-text);
    background-color: var(--bm-panel) !important;
    background-image: none !important;
    box-shadow: var(--bm-shadow-sm) !important;
  }

  html[data-app-theme="dark"] body:not(.preview-body) .app-shell :where(
    .panel-head,
    .card-header,
    .section-header,
    .table-header,
    .modal-header
  ) {
    border-color: var(--bm-line) !important;
    color: var(--bm-ink);
    background: linear-gradient(180deg, #17253a, #111c2d) !important;
  }

  /*
   * Do not recolor every heading, label, strong, paragraph or small element here.
   * Several application screens intentionally keep white document, summary and
   * product surfaces in dark mode and already provide their own dark foreground.
   * A blanket foreground rule made those controls render as white-on-white.
   */

  html[data-app-theme="dark"] body:not(.preview-body) .app-shell :where(input, select, textarea) {
    border-color: var(--bm-line-strong) !important;
    color: var(--bm-text) !important;
    background-color: #0d1726 !important;
    background-image: none !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03) !important;
  }

  html[data-app-theme="dark"] body:not(.preview-body) .app-shell select {
    color-scheme: dark;
  }

  html[data-app-theme="dark"] body:not(.preview-body) .app-shell select option {
    color: var(--bm-text);
    background: #0d1726;
  }

  html[data-app-theme="dark"] body:not(.preview-body) .app-shell :where(input, textarea)::placeholder {
    color: #71839a;
  }

  html[data-app-theme="dark"] body:not(.preview-body) .app-shell :where(input, select, textarea):disabled {
    color: #7f8fa3;
    background-color: #172131;
  }

  html[data-app-theme="dark"] body:not(.preview-body) .app-shell tbody tr {
    color: var(--bm-text);
    background: #111c2d !important;
  }

  html[data-app-theme="dark"] body:not(.preview-body) .app-shell tbody tr:nth-child(even) {
    background: #132033 !important;
  }

  html[data-app-theme="dark"] body:not(.preview-body) .app-shell tbody tr:hover {
    background: #192b44 !important;
  }

  html[data-app-theme="dark"] body:not(.preview-body) .app-shell table thead th {
    border-color: #315276;
    color: #eaf4ff !important;
    background: linear-gradient(180deg, #174e85, #123e6b) !important;
  }

  html[data-app-theme="dark"] body:not(.preview-body) .app-shell :where(td, .summary-line, .list-item, .row-item) {
    border-color: var(--bm-line);
  }

  html[data-app-theme="dark"] body:not(.preview-body) .app-shell :where(
    .stat,
    .stat-card,
    .mini-stats > div,
    .dashboard-stats > .stat,
    .reports-stats > .stat-card,
    .report-insights > div
  ) {
    border-color: var(--bm-line) !important;
    color: var(--bm-text);
    background: linear-gradient(180deg, #17253a, #111c2d) !important;
    box-shadow: var(--bm-shadow-sm);
  }

  html[data-app-theme="dark"] body:not(.preview-body) .app-shell :where(
    a.btn:not(.primary):not(.btn-primary):not(.primary-action),
    button.btn:not(.primary):not(.btn-primary):not(.primary-action),
    .secondary-btn,
    .action-btn.secondary
  ) {
    border-color: var(--bm-line-strong) !important;
    color: #9dccff !important;
    background-color: #142236 !important;
    background-image: linear-gradient(180deg, #1a2a40, #142236) !important;
    box-shadow: var(--bm-shadow-sm) !important;
  }

  html[data-app-theme="dark"] body:not(.preview-body) .app-shell :where(
    .search-toolbar,
    .toolbar,
    .repair-toolbar,
    .documents-toolbar,
    .dashboard-search,
    .job-filter,
    .notification-filter-grid,
    .report-filter-row,
    .table-wrap,
    .control-table-wrap,
    .job-list-table-wrap,
    .vinyl-table-wrap,
    .repair-table-wrap,
    .documents-table-wrap
  ) {
    border-color: var(--bm-line) !important;
    background: rgba(17, 28, 45, 0.86) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03) !important;
  }

  html[data-app-theme="dark"] body:not(.preview-body) .app-shell :where(
    .alert,
    .notice,
    .flash,
    .message,
    .empty-state
  ) {
    border-color: var(--bm-line);
    color: var(--bm-text);
    background-color: #162338;
  }

  html[data-app-theme="dark"] body:not(.preview-body) .app-shell a:not(.btn):not(.table-link) {
    color: #72b7ff;
  }

  html[data-app-theme="dark"] body:not(.preview-body) .app-shell hr {
    border-color: var(--bm-line);
  }

  html[data-app-theme="dark"] body:not(.preview-body) .bm-app-theme-toggle {
    color: #ffe08a;
    background: rgba(7, 16, 31, 0.28);
  }

  /* Dashboard owns an inline component palette loaded after this stylesheet.
   * Keep its semantic accents, but force its light surfaces and text onto the
   * dark app palette so headings and live totals retain readable contrast.
   */
  html[data-app-theme="dark"] body.dashboard-page .app-shell :where(
    .control-hero,
    .control-side-card,
    .control-card,
    .control-panel,
    .notification-row,
    .payment-mini-card,
    .work-summary-card,
    .payment-health,
    .control-pagination
  ) {
    border-color: var(--bm-line) !important;
    color: var(--bm-text) !important;
    background-color: var(--bm-panel) !important;
    background-image: none !important;
    box-shadow: var(--bm-shadow-sm) !important;
  }

  html[data-app-theme="dark"] body.dashboard-page .app-shell :where(
    .control-hero h1,
    .control-date strong,
    .control-card strong,
    .control-panel-head h2,
    .notification-title,
    .payment-mini-card strong,
    .work-summary-card h3,
    .latest-job-title,
    .latest-money strong
  ) {
    color: var(--bm-ink) !important;
  }

  html[data-app-theme="dark"] body.dashboard-page .app-shell :where(
    .control-hero p,
    .control-date span,
    .control-card span,
    .control-card small,
    .control-panel-head span,
    .payment-mini-card span,
    .work-line span,
    .muted
  ) {
    color: var(--bm-muted) !important;
  }

  html[data-app-theme="dark"] body.dashboard-page .app-shell .control-panel-head {
    border-color: var(--bm-line) !important;
    background: linear-gradient(180deg, #17253a, #111c2d) !important;
  }

  html[data-app-theme="dark"] body.dashboard-page .app-shell :where(
    .control-quick-links a:not(:first-child),
    .control-link-button:not(.primary),
    .control-outline-button,
    .control-pagination a,
    .control-pagination span:not(.is-current)
  ) {
    border-color: var(--bm-line-strong) !important;
    color: #91c7ff !important;
    background: #142236 !important;
  }

  html[data-app-theme="dark"] body.dashboard-page .app-shell .control-quick-links a.online-order-new {
    border-color: #315d88 !important;
    color: #8cc7ff !important;
    background: #102b45 !important;
  }

  html[data-app-theme="dark"] body.dashboard-page .app-shell .work-bar {
    background: #26364b;
  }

  html[data-app-theme="dark"] body.dashboard-page .app-shell .online-order-alert {
    border-color: #315d88 !important;
    border-left-color: #1686ff !important;
    background: linear-gradient(90deg, #102b45, #111c2d) !important;
  }

  html[data-app-theme="dark"] body.dashboard-page .app-shell .online-order-alert :where(strong, span) {
    color: var(--bm-text) !important;
  }

  html[data-app-theme="dark"] body.dashboard-page .app-shell .online-order-alert.storage-warning {
    border-color: #765a24 !important;
    border-left-color: #f59e0b !important;
    background: linear-gradient(90deg, #332711, #171c26) !important;
  }

  html[data-app-theme="dark"] body.dashboard-page .app-shell .payment-health-main {
    color: var(--bm-muted) !important;
  }

  html[data-app-theme="dark"] body.dashboard-page .app-shell .payment-health-main strong {
    color: var(--bm-text) !important;
  }
}

@media screen and (max-width: 900px) {
  .bm-app-theme-toggle span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
  }

  .bm-app-theme-toggle {
    flex: 0 0 42px;
    width: 42px;
    padding: 0;
  }
}

@media print {
  .bm-app-theme-toggle {
    display: none !important;
  }
}

/* BM Shop dark palette tune — 2026-09-25 */
@media screen {
  html[data-app-theme="dark"] {
    --bg: #0b1017;
    --panel: #171d26;
    --line: #2a3442;
    --text: #d7dee8;
    --ink: #f2f5f8;
    --muted: #94a0af;
    --bm-ink: #f2f5f8;
    --bm-text: #d7dee8;
    --bm-muted: #94a0af;
    --bm-soft: #0b1017;
    --bm-panel: #171d26;
    --bm-panel-tint: #1b2430;
    --bm-line: #2a3442;
    --bm-line-strong: #3a4656;
    --bm-blue-050: #172435;
    --bm-blue-100: #1b3046;
    --bm-tint-blue: #172435;
    --bm-tint-green: #172823;
    --bm-tint-amber: #2c2517;
    --bm-tint-purple: #241f2f;
    --bm-tint-cyan: #17272c;
    --bm-tint-rose: #2b1f25;
    --bm-neutral-soft: #202731;
    --bm-top-gradient: linear-gradient(90deg,#111923 0%,#162332 50%,#193149 100%);
  }  html[data-app-theme="dark"] body:not(.preview-body) {
    background:#0b1017;
    color:var(--bm-text);
  }
  html[data-app-theme="dark"] body:not(.preview-body) .app-shell {
    background:var(--bm-top-gradient) var(--bm-sidebar-width) 0 / calc(100% - var(--bm-sidebar-width)) var(--bm-top-banner-height) no-repeat,#0b1017;
  }
  html[data-app-theme="dark"] body:not(.preview-body) .sidebar.bm-sidebar {
    border-right-color:#26303c;
    background:linear-gradient(180deg,#111923,#0c1219);
    box-shadow:10px 0 26px rgba(0,0,0,.2);
  }
  html[data-app-theme="dark"] body:not(.preview-body) .bm-sidebar-group {
    border-color:#27313d;
    background:rgba(22,29,38,.88);
  }
  html[data-app-theme="dark"] body:not(.preview-body) .main::before {
    color:#dce5ef;
    border-color:#2a3543;
    background:linear-gradient(105deg,#18232f,#131b25);
  }
  html[data-app-theme="dark"] body:not(.preview-body) .bm-topbar,
  html[data-app-theme="dark"] body:not(.preview-body) .topbar.page-header {
    border-color:#304153 !important;
    background:linear-gradient(120deg,#182635,#141f2b 58%,#172331) !important;
    box-shadow:inset 0 1px 0 rgba(255,255,255,.05),0 10px 26px rgba(0,0,0,.22) !important;
  }  html[data-app-theme="dark"] body:not(.preview-body) .app-shell :where(.panel,.bm-card,.summary-card,.card,.content-card,.form-card,.filter-card,.table-card,.detail-card,.info-card,.settings-card,.dashboard-card,.notification-card,.report-card,.modal-content,.dialog-content) {
    border-color:#2a3442 !important;
    background:#171d26 !important;
    color:#d7dee8;
    box-shadow:0 6px 18px rgba(0,0,0,.18) !important;
  }
  html[data-app-theme="dark"] body:not(.preview-body) .app-shell :where(.panel-head,.card-header,.section-header,.table-header,.modal-header) {
    border-color:#2a3442 !important;
    background:linear-gradient(180deg,#1c2430,#171d26) !important;
  }
  html[data-app-theme="dark"] body:not(.preview-body) .app-shell :where(input,select,textarea) {
    border-color:#3a4656 !important;
    color:#d7dee8 !important;
    background:#111821 !important;
  }
  html[data-app-theme="dark"] body:not(.preview-body) .app-shell :where(input,textarea)::placeholder {
    color:#7f8b99 !important;
  }
  html[data-app-theme="dark"] body:not(.preview-body) .app-shell tbody tr { background:#171d26 !important; }
  html[data-app-theme="dark"] body:not(.preview-body) .app-shell tbody tr:nth-child(even) { background:#1a222d !important; }
  html[data-app-theme="dark"] body:not(.preview-body) .app-shell tbody tr:hover { background:#202b38 !important; }
  html[data-app-theme="dark"] body:not(.preview-body) .app-shell table thead th {
    border-color:#314052 !important;
    color:#edf3f8 !important;
    background:linear-gradient(180deg,#203448,#1a2a3a) !important;
  }  html[data-app-theme="dark"] body:not(.preview-body) .app-shell :where(a.btn:not(.primary):not(.btn-primary):not(.primary-action),button.btn:not(.primary):not(.btn-primary):not(.primary-action),.secondary-btn,.action-btn.secondary) {
    border-color:#3a4656 !important;
    color:#a9c9e8 !important;
    background:linear-gradient(180deg,#202a36,#1a222d) !important;
    box-shadow:none !important;
  }
  html[data-app-theme="dark"] body:not(.preview-body) .app-shell :where(.search-toolbar,.toolbar,.repair-toolbar,.documents-toolbar,.dashboard-search,.job-filter,.notification-filter-grid,.report-filter-row,.table-wrap,.control-table-wrap,.job-list-table-wrap,.vinyl-table-wrap,.repair-table-wrap,.documents-table-wrap) {
    border-color:#2a3442 !important;
    background:rgba(23,29,38,.92) !important;
  }
  html[data-app-theme="dark"] body:not(.preview-body) .app-shell :where(.alert,.notice,.flash,.message,.empty-state) {
    border-color:#303b49;
    color:#d7dee8;
    background:#1a222d;
  }
  html[data-app-theme="dark"] body:not(.preview-body) .app-shell a:not(.btn):not(.table-link) { color:#78b8f2; }
  html[data-app-theme="dark"] body:not(.preview-body) .bm-app-theme-toggle {
    color:#f4d97b;
    background:rgba(10,14,20,.28);
  }
  html[data-app-theme="dark"] body.dashboard-page .app-shell :where(.control-hero,.control-side-card,.control-card,.control-panel,.notification-row,.payment-mini-card,.work-summary-card,.payment-health,.control-pagination) {
    border-color:#2a3442 !important;
    background:#171d26 !important;
    box-shadow:0 6px 18px rgba(0,0,0,.18) !important;
  }
}
/* Dark mode: readable text on intentionally light/white surfaces — 2026-09-25 */
@media screen {
  html[data-app-theme="dark"] body:not(.preview-body) .app-shell .profile-list > div {
    color:#17233a !important;
  }
  html[data-app-theme="dark"] body:not(.preview-body) .app-shell .profile-list > div > strong,
  html[data-app-theme="dark"] body:not(.preview-body) .app-shell .profile-list > div :where(h3,h4,b) {
    color:#17233a !important;
  }
  html[data-app-theme="dark"] body:not(.preview-body) .app-shell .profile-list > div > span,
  html[data-app-theme="dark"] body:not(.preview-body) .app-shell .profile-list > div :where(small,p) {
    color:#66758a !important;
  }

  html[data-app-theme="dark"] body.job-entry-page .job-form-section,
  html[data-app-theme="dark"] body.job-entry-page .job-items-builder,
  html[data-app-theme="dark"] body.job-entry-page .job-item-row,
  html[data-app-theme="dark"] body.job-entry-page .job-step {
    color:#17233a !important;
  }
  html[data-app-theme="dark"] body.job-entry-page :where(.job-form-section,.job-items-builder,.job-item-row,.job-step) :where(label,h2,h3,h4,strong) {
    color:#17233a !important;
  }
  html[data-app-theme="dark"] body.job-entry-page :where(.job-form-section,.job-items-builder,.job-item-row,.job-step) :where(p,small,.muted,.form-hint) {
    color:#66758a !important;
  }
  html[data-app-theme="dark"] body.job-entry-page .job-step.is-active { color:#08265c !important; }

  html[data-app-theme="dark"] body.documents-page :where(.document-payment-fields,.document-payer-name-options,.blank-customer-option) {
    color:#17233a !important;
  }
  html[data-app-theme="dark"] body.documents-page :where(.document-payment-fields,.document-payer-name-options,.blank-customer-option) :where(label,legend,strong,h3,h4) {
    color:#17233a !important;
  }
  html[data-app-theme="dark"] body.documents-page :where(.document-payment-fields,.document-payer-name-options,.blank-customer-option) :where(span,small,p) {
    color:#66758a !important;
  }
}

/* Final dark contrast patch — 2026-09-25 */
@media screen {
  html[data-app-theme="dark"] body:not(.preview-body) .app-shell :where(.page-title,.page-header h1) {
    color:#edf3f8 !important;
  }
  html[data-app-theme="dark"] body:not(.preview-body) .app-shell :where(.page-subtitle,.page-header p) {
    color:#94a0af !important;
  }

  html[data-app-theme="dark"] body.settings-page :where(.settings-preview,.settings-check-option,.settings-side-card .profile-list > div) {
    border-color:#33404e !important;
    background:#1a222d !important;
    color:#d7dee8 !important;
  }
  html[data-app-theme="dark"] body.settings-page :where(.settings-card label,.settings-preview strong,.settings-check-option strong,.settings-side-card .profile-list > div strong) {
    color:#edf3f8 !important;
  }
  html[data-app-theme="dark"] body.settings-page :where(.settings-preview span,.settings-preview small,.settings-check-option small,.settings-side-card .profile-list > div span,.settings-side-card .profile-list > div small) {
    color:#94a0af !important;
  }

  html[data-app-theme="dark"] body.easy-page .easy-card {
    border-color:#2a3442 !important;
    background:#171d26 !important;
    box-shadow:0 8px 24px rgba(0,0,0,.18) !important;
  }
  html[data-app-theme="dark"] body.easy-page .easy-card-head {
    border-bottom-color:#2a3442 !important;
    background:#1a222d !important;
  }
  html[data-app-theme="dark"] body.easy-page .easy-card-head h2,
  html[data-app-theme="dark"] body.easy-page .easy-table td,
  html[data-app-theme="dark"] body.easy-page .easy-account-number,
  html[data-app-theme="dark"] body.easy-page .easy-form label {
    color:#d7dee8 !important;
  }
  html[data-app-theme="dark"] body.easy-page :where(.easy-card-head span,.easy-table th,.easy-note,.easy-stat span) {
    color:#94a0af !important;
  }
  html[data-app-theme="dark"] body.easy-page .easy-stat {
    border-color:#33404e !important;
    background:#1a222d !important;
  }
  html[data-app-theme="dark"] body.easy-page .easy-table th,
  html[data-app-theme="dark"] body.easy-page .easy-table td {
    border-bottom-color:#2a3442 !important;
  }
  html[data-app-theme="dark"] body.easy-page :where(.easy-form input,.easy-form select) {
    border-color:#3a4656 !important;
    background:#111821 !important;
    color:#d7dee8 !important;
  }

  html[data-app-theme="dark"] body.reports-page .reports-stats .stat-card,
  html[data-app-theme="dark"] body.reports-page .report-insights > div {
    border-color:#2a3442 !important;
    background:linear-gradient(180deg,#1b2430 0%,#171d26 100%) !important;
    box-shadow:0 8px 22px rgba(0,0,0,.18) !important;
  }
  html[data-app-theme="dark"] body.reports-page .reports-stats .stat-card strong,
  html[data-app-theme="dark"] body.reports-page .report-insights strong {
    color:#8fc8ff !important;
  }
  html[data-app-theme="dark"] body.reports-page .reports-stats .stat-card span,
  html[data-app-theme="dark"] body.reports-page .report-insights span {
    color:#cbd4df !important;
  }
  html[data-app-theme="dark"] body.reports-page .reports-stats .stat-card small,
  html[data-app-theme="dark"] body.reports-page .report-insights small {
    color:#94a0af !important;
  }

  html[data-app-theme="dark"] body.job-list-page .job-list-table :where(td,td strong) {
    color:#d7dee8 !important;
  }
  html[data-app-theme="dark"] body.job-list-page .job-list-table td :where(a:not(.btn),.table-link) {
    color:#9acdfb !important;
  }
  html[data-app-theme="dark"] body.job-list-page .job-list-table :where(small,.muted) {
    color:#94a0af !important;
  }
  html[data-app-theme="dark"] body.job-list-page .mini-stats > div {
    border-color:#2a3442 !important;
    background:#171d26 !important;
  }
  html[data-app-theme="dark"] body.job-list-page .mini-stats strong { color:#8fc8ff !important; }
  html[data-app-theme="dark"] body.job-list-page .mini-stats span { color:#cbd4df !important; }

  html[data-app-theme="dark"] body.vinyl-list-page .vinyl-status-card {
    border-color:#2a3442 !important;
    border-top-color:var(--status-color) !important;
    background:#171d26 !important;
  }
  html[data-app-theme="dark"] body.vinyl-list-page .vinyl-status-card strong {
    color:#edf3f8 !important;
  }
  html[data-app-theme="dark"] body.vinyl-list-page .vinyl-status-card :where(span,small) {
    color:#94a0af !important;
  }
}
