.page-shell {
  min-height: 100vh;
  background: var(--bg-light);
  color: var(--text-strong);
}

.page-container {
  padding: 16px var(--space-5) var(--space-2);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  min-width: 0;
  max-width: 100%;
  overflow-x: clip;
}

.page-container > * {
  min-width: 0;
  max-width: 100%;
}

.card,
.card-body,
.card-header {
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

.page-container > :first-child {
  margin-top: 8px;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-2);
  padding-top: 4px;
  padding-right: var(--space-2);
}

.page-title {
  margin: 0;
  font-size: 32px;
  line-height: 1.1;
}

.page-subtitle {
  margin: 0;
  color: var(--text-muted);
  font-size: 14px;
}

.app-nav {
  display: inline-flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-right: 0;
}

.app-nav a {
  text-decoration: none;
  color: var(--text-strong);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  height: var(--control-height);
  padding: 8px 14px;
  font-size: var(--control-font-size);
  display: inline-flex;
  align-items: center;
}

.app-nav a.is-active {
  background: var(--secondary);
  color: var(--white);
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--bg-light), var(--surface-muted));
  padding: var(--space-2);
}

.auth-card {
  width: min(520px, 100%);
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: var(--space-3);
}

.auth-card h1 {
  margin: 0 0 8px;
  font-size: 32px;
}

.auth-card p {
  margin: 0 0 var(--space-2);
  color: var(--text-muted);
}

/* Modern standalone auth screens */
.auth-modern {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  background: #f3f5fa;
}

.auth-modern-visual {
  padding: clamp(28px, 6vw, 72px);
  background:
    radial-gradient(circle at 14% 18%, rgba(86, 100, 255, 0.20) 0%, rgba(86, 100, 255, 0) 44%),
    radial-gradient(circle at 88% 88%, rgba(73, 201, 167, 0.20) 0%, rgba(73, 201, 167, 0) 44%),
    linear-gradient(160deg, #171a24 0%, #202434 52%, #242a3d 100%);
  color: #eef2ff;
  display: grid;
  align-content: center;
  gap: 16px;
}

.auth-modern-brand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  min-width: 88px;
  height: 34px;
  border-radius: 999px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.08);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.auth-modern-visual h1 {
  margin: 0;
  font-size: clamp(28px, 3.3vw, 46px);
  line-height: 1.1;
  letter-spacing: -0.02em;
  max-width: 560px;
}

.auth-modern-visual p {
  margin: 0;
  max-width: 560px;
  color: rgba(238, 242, 255, 0.78);
  font-size: 15px;
  line-height: 1.5;
}

.auth-modern-points {
  margin: 8px 0 0;
  padding-left: 18px;
  display: grid;
  gap: 6px;
  color: rgba(238, 242, 255, 0.9);
  font-size: 14px;
}

.auth-modern-panel {
  padding: clamp(20px, 5vw, 56px);
  display: grid;
  place-items: center;
}

.auth-modern-card {
  width: min(520px, 100%);
  background: #fff;
  border: 1px solid #e4e9f2;
  border-radius: 20px;
  box-shadow: 0 12px 30px rgba(16, 24, 40, 0.10);
  padding: clamp(20px, 2.5vw, 34px);
}

.auth-modern-card h2 {
  margin: 0;
  font-size: 30px;
  line-height: 1.15;
}

.auth-modern-subtitle {
  margin: 8px 0 var(--space-2);
  color: var(--text-muted);
  font-size: 14px;
}

.auth-modern-actions {
  display: grid;
  gap: 8px;
}

.auth-modern .ui-btn {
  width: 100%;
}

@media (max-width: 1024px) {
  .auth-modern {
    grid-template-columns: 1fr;
  }

  .auth-modern-visual {
    min-height: 240px;
  }
}

.field {
  display: grid;
  gap: 6px;
  margin-bottom: var(--space-2);
}

.field label {
  font-size: 13px;
  font-weight: 600;
}

.field-error {
  color: var(--danger);
  font-size: 12px;
  min-height: 16px;
}

.inline-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-1);
}

.lockout-alert {
  display: none;
  margin: 0 0 var(--space-2);
  padding: var(--space-1);
  border-radius: 10px;
  background: var(--badge-danger-bg);
  color: var(--badge-danger-text);
  font-size: 13px;
}

.lockout-alert.is-visible {
  display: block;
}

.otp-row {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
}

.otp-row input {
  text-align: center;
  font-size: 16px;
  font-weight: 700;
}

.panel-grid {
  display: grid;
  gap: var(--space-3);
}

.panel-grid.two-col {
  grid-template-columns: 1fr 1fr;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--space-2);
  margin-top: var(--space-2);
}

.form-grid .field.span-two {
  grid-column: 1 / -1;
}

.line-items-container {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.line-item-row {
  display: grid;
  grid-template-columns: 1fr 140px auto;
  gap: var(--space-1);
  align-items: center;
}

.line-item-row .line-item-label { min-width: 0; }
.line-item-row .line-item-amount { width: 100%; }
.line-item-row .line-item-remove { flex-shrink: 0; }

#invoiceCreateForm + .section-head .line-item-row,
#invoiceCreateForm .line-item-row,
.line-items-container .line-item-row[data-line-index] {
  grid-template-columns: repeat(6, minmax(0, 1fr)) auto;
}

.invoice-view-tab[hidden] {
  display: none;
}

.email-composer-card {
  max-width: 880px;
}

.wmas-toast-root {
  position: fixed;
  right: 16px;
  bottom: 16px;
  display: grid;
  gap: 8px;
  z-index: 1200;
}

.wmas-toast {
  min-width: 220px;
  max-width: 360px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--secondary);
  color: var(--white);
  font-size: 12px;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 240ms cubic-bezier(0.2, 0.8, 0.2, 1), transform 240ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.wmas-toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.wmas-toast.is-success {
  background: var(--success);
}

.wmas-toast.is-warning {
  background: var(--warning);
  color: #1b1b1b;
}

.wmas-toast.is-danger {
  background: var(--danger);
}

.invoice-total-row {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-2);
  margin-top: var(--space-2);
  padding-top: var(--space-2);
  border-top: 1px solid var(--line);
  font-size: 16px;
}

.form-actions {
  display: flex;
  gap: var(--space-1);
}

.filter-bar {
  display: flex;
  gap: var(--space-1);
  flex-wrap: wrap;
  margin-bottom: var(--space-2);
}

.chip {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 999px;
  height: var(--control-height-sm);
  padding: 0 12px;
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.chip.is-active {
  background: var(--secondary);
  border-color: var(--secondary);
  color: var(--white);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th,
.data-table td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-size: 13px;
}

.data-table th {
  color: var(--text-muted);
  font-weight: 600;
}

.users-table-wrap {
  overflow-x: auto;
}

.users-table {
  min-width: 900px;
}

.users-table th,
.users-table td {
  white-space: nowrap;
}

.users-table td {
  max-width: none;
  overflow: visible;
  text-overflow: clip;
}

.table-actions {
  display: inline-flex;
  gap: 6px;
}

.icon-inline-btn {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 8px;
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(20, 21, 23, 0.45);
  display: none;
  align-items: center;
  justify-content: center;
  padding: var(--space-2);
  z-index: 60;
}

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

.modal-card {
  width: min(640px, 100%);
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: var(--space-2);
}

.mobile-shell {
  max-width: 760px;
  margin: 0 auto;
}

.route-list-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: var(--space-2);
  max-width: 100%;
}

.state-tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-2);
  margin-bottom: var(--space-2);
}

.state-tab {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 10px;
  min-height: 48px;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.state-tab:hover:not(.is-active) {
  border-color: var(--secondary);
  background: color-mix(in srgb, var(--secondary) 5%, var(--surface));
}

.state-tab i {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.state-tab.is-active {
  background: var(--secondary);
  color: var(--white);
  border-color: var(--secondary);
}

.route-card,
.stop-card,
.portal-card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: var(--space-2);
}

.route-card + .route-card,
.stop-card + .stop-card {
  margin-top: 0;
}

.status-pill {
  height: 24px;
  border-radius: 999px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 700;
}

.status-pill.success {
  background: var(--badge-success-bg);
  color: var(--badge-success-text);
}

.status-pill.warning {
  background: var(--badge-warning-bg);
  color: var(--badge-warning-text);
}

.status-pill.danger {
  background: var(--badge-danger-bg);
  color: var(--badge-danger-text);
}

.status-pill.primary {
  background: rgba(31, 122, 255, 0.12);
  color: #1f7aff;
}

.request-wizard {
  display: grid;
  gap: var(--space-2);
}

.wizard-progress-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-2);
}

.wizard-kicker {
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--secondary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.wizard-title {
  margin: 0;
  font-size: 22px;
  line-height: 1.25;
}

.wizard-step-counter {
  margin: 0;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  color: var(--secondary);
  background: var(--surface-muted);
  border: 1px solid var(--line);
}

.wizard-progress {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-1);
}

.wizard-progress-step {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-muted);
  cursor: pointer;
  transition: border-color 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}

.wizard-progress-step strong {
  display: block;
  font-size: 13px;
  line-height: 1.25;
  color: inherit;
}

.wizard-progress-step small {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  color: var(--text-muted);
}

.wizard-progress-index {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1px solid currentColor;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}

.wizard-progress-step.is-active {
  border-color: var(--secondary);
  color: var(--text-strong);
  background: var(--surface-muted);
  background: color-mix(in srgb, var(--secondary) 8%, var(--surface));
}

.wizard-progress-step.is-complete {
  border-color: var(--secondary);
  border-color: color-mix(in srgb, var(--secondary) 45%, var(--line));
  color: var(--text-strong);
  background: var(--surface-muted);
  background: color-mix(in srgb, var(--secondary) 5%, var(--surface));
}

.wizard-progress-step.is-active .wizard-progress-index,
.wizard-progress-step.is-complete .wizard-progress-index {
  border-color: var(--secondary);
  background: var(--secondary);
  color: var(--white);
}

.wizard-progress-track {
  height: 12px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
  margin: var(--space-2) 0;
}

.wizard-progress-fill {
  display: block;
  height: 100%;
  width: 33%;
  border-radius: inherit;
  background: var(--primary);
  box-shadow: 0 0 0 2px rgba(31, 122, 255, 0.2);
  transition: width 0.25s ease;
}

.wizard-pane {
  border: 1px solid var(--line);
  border: 1px solid color-mix(in srgb, var(--line) 80%, transparent);
  border-radius: 14px;
  padding: var(--space-2);
  background: var(--surface);
  background: color-mix(in srgb, var(--surface) 86%, var(--surface-muted));
}

.wizard-pane-head {
  margin-bottom: var(--space-2);
}

.wizard-pane-head h3 {
  margin: 0;
  font-size: 18px;
}

.wizard-pane-head p {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--text-muted);
}

.wizard-consent {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.wizard-actions {
  margin-top: var(--space-3);
  padding-top: var(--space-2);
  border-top: 1px solid var(--line);
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}

.ui-input.is-invalid,
.wizard-pane input[type="checkbox"].is-invalid {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 14%, transparent);
}

@media (max-width: 900px) {
  .wizard-progress {
    grid-template-columns: 1fr;
  }

  .wizard-progress-head {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* Service Request 66/33 split layout */
.service-request-split {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: var(--space-4);
  align-items: stretch;
}

.service-request-split > .request-wizard {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  min-height: 0;
}

.service-request-split > .request-wizard form {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.service-request-split > .request-wizard [data-step-pane] {
  flex: 1;
}

.service-request-sidebar {
  display: grid;
  gap: var(--space-3);
  padding: var(--space-3);
}

.sr-sidebar-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: var(--space-3);
}

.sr-sidebar-card h3 {
  margin: 0 0 6px;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-strong);
}

.sr-sidebar-desc {
  margin: 0 0 var(--space-2);
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.4;
}

.sr-type-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.sr-type-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-strong);
  border-bottom: 1px solid #f1f5f9;
}

.sr-type-list li:last-child {
  border-bottom: 0;
}

.sr-type-list li i {
  width: 18px;
  height: 18px;
  color: var(--primary);
  flex-shrink: 0;
}

.sr-status-flow {
  margin: 0;
  padding: 0;
  list-style: none;
}

.sr-status-flow li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  font-size: 13px;
  color: var(--text-muted);
}

.sr-flow-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary);
  opacity: 0.6;
  flex-shrink: 0;
}

.sr-status-flow li:nth-child(1) .sr-flow-dot { opacity: 1; }
.sr-status-flow li:nth-child(2) .sr-flow-dot { opacity: 0.85; }
.sr-status-flow li:nth-child(3) .sr-flow-dot { opacity: 0.7; }
.sr-status-flow li:nth-child(4) .sr-flow-dot { opacity: 0.5; }

@media (max-width: 900px) {
  .service-request-split {
    grid-template-columns: 1fr;
    gap: var(--space-3);
  }

  .service-request-sidebar {
    margin-top: var(--space-3);
    padding-top: var(--space-3);
  }
}

.timeline {
  margin: 0;
  padding: 0;
  list-style: none;
}

.timeline li {
  display: grid;
  grid-template-columns: 14px 1fr;
  gap: 10px;
  padding: 10px 0;
}

.timeline-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-top: 4px;
  background: var(--secondary);
  box-shadow: 0 0 0 2px rgba(47, 48, 55, 0.15);
}

.gap-sm {
  height: 12px;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-3);
}

.kpi-card {
  background: var(--surface);
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: var(--radius-lg);
  padding: var(--space-2);
  min-height: 140px;
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  gap: var(--space-1);
  align-content: start;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 6px 16px rgba(0, 0, 0, 0.04);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.kpi-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06), 0 12px 24px rgba(0, 0, 0, 0.06);
}

.kpi-card-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: linear-gradient(145deg, var(--bg-dark) 0%, #252830 100%);
  color: var(--white);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  grid-row: 1;
  box-shadow: 0 2px 8px rgba(46, 49, 56, 0.25);
}

.kpi-card-icon svg {
  width: 20px;
  height: 20px;
}

.kpi-card-body {
  min-width: 0;
}

.kpi-card-label,
.kpi-card p {
  margin: 0;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.kpi-card-value,
.kpi-card h3 {
  margin: 6px 0 0;
  font-size: 32px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--text-strong);
}

.kpi-card-sparkline {
  grid-column: 1 / -1;
  height: 48px;
  min-width: 0;
}

.kpi-card-sparkline:empty {
  display: none;
}

.content-split {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: var(--space-2);
}

.stack-list {
  display: grid;
  gap: var(--space-1);
}

.stack-item {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  padding: var(--space-1) 12px;
}

.stack-item p {
  margin: 4px 0 0;
  color: var(--text-muted);
  font-size: 12px;
}

.section-head {
  margin-bottom: var(--space-2);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-1);
}

.section-head h2,
.section-head h3 {
  margin: 0;
}

.control-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-1);
  margin-bottom: var(--space-2);
}

.empty-note {
  margin: 0;
  color: var(--text-muted);
  font-size: 12px;
}

.portal-shell {
  display: grid;
  gap: var(--space-2);
}

.portal-hero {
  background: linear-gradient(130deg, #20232b 0%, #2e3440 55%, #3a4250 100%);
  border-radius: var(--radius-lg);
  padding: var(--space-2);
  color: var(--white);
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: var(--space-2);
  box-shadow: var(--shadow-md);
}

.dashboard-layout > .portal-hero--span {
  grid-column: 1 / -1;
}

.portal-hero h2 {
  margin: 0 0 8px;
  font-size: 24px;
}

.portal-hero p {
  margin: 0;
  color: rgba(255, 255, 255, 0.78);
  font-size: 13px;
}

.portal-hero-actions {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: var(--space-2);
}

.portal-metric-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-1);
}

.portal-metric {
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.08);
  padding: 12px;
}

.portal-metric p {
  margin: 0;
  color: rgba(255, 255, 255, 0.74);
  font-size: 12px;
}

.portal-metric strong {
  display: block;
  margin-top: 4px;
  font-size: 20px;
  line-height: 1.15;
}

.portal-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.portal-toolbar .ui-input {
  min-width: 160px;
}

.invoice-detail {
  display: grid;
  gap: 10px;
}

.invoice-detail dl {
  margin: 0;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.invoice-detail dt,
.invoice-detail dd {
  margin: 0;
  font-size: 13px;
}

.invoice-detail dt {
  color: var(--text-muted);
}

.invoice-detail dd {
  font-weight: 600;
  text-align: right;
}

.map-shell {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.map-canvas {
  height: 360px;
  width: 100%;
}

.tracking-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-1);
  flex-wrap: wrap;
  margin-bottom: var(--space-1);
}

.map-controls {
  display: flex;
  align-items: center;
  gap: 2px;
}

.map-controls .ui-btn {
  padding: 6px 8px;
  min-width: 32px;
}

.map-zoom-level {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary, #666);
  min-width: 20px;
  text-align: center;
}

.map-shell.is-fullscreen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  border-radius: 0;
}

.map-shell.is-fullscreen .map-canvas {
  height: 100vh;
}

.legend-inline .dot.is-en-route {
  background: #3772ff;
}

.legend-inline .dot.is-collecting {
  background: #2fbf71;
}

.legend-inline .dot.is-exception {
  background: #f15b63;
}

.fleet-layout-top {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(320px, 1fr);
  gap: var(--space-2);
}

.fleet-layout-bottom {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 1fr);
  gap: var(--space-2);
}

.fleet-map-panel,
.fleet-info-card {
  background: #fff;
  border: 1px solid #e7ebf2;
  border-radius: 16px;
  padding: var(--space-2);
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 10px 24px rgba(16, 24, 40, 0.04);
}

.fleet-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-2);
  margin-bottom: var(--space-2);
}

.fleet-panel-head h2 {
  margin: 0;
}

.fleet-panel-head p {
  margin: 6px 0 0;
  font-size: 12px;
  color: var(--text-muted);
}

.fleet-mini-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.fleet-mini-stats article {
  border: 1px solid #e7edf4;
  border-radius: 10px;
  background: #f8fafc;
  padding: 8px 10px;
}

.fleet-mini-stats p {
  margin: 0;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
}

.fleet-mini-stats strong {
  margin-top: 2px;
  display: block;
  font-size: 13px;
  font-weight: 600;
}

.fleet-filter-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.fleet-filter-row .ui-input {
  min-width: 150px;
  border-color: #e2e8f0;
  background: #fbfcfe;
}

.fleet-link-btn {
  border: 0;
  background: transparent;
  color: #6cc9a3;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
}

.fleet-map-shell {
  border-radius: 14px;
  border-color: #e7edf4;
}

.fleet-map-canvas {
  height: 500px;
}

.fleet-side-rail {
  display: grid;
  gap: var(--space-2);
  align-content: start;
}

.fleet-card-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-1);
  margin-bottom: var(--space-1);
}

.fleet-card-title-row h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.2;
}

.fleet-card-title-row p {
  margin: 2px 0 0;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
}

.fleet-main-vehicle-title {
  margin: 0;
  color: #64748b;
  font-size: 20px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0.01em;
}

.fleet-main-vehicle-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--space-1);
  align-items: center;
}

.fleet-main-metrics {
  display: grid;
  gap: 8px;
}

.fleet-main-metric strong {
  font-size: 18px;
  font-weight: 600;
  line-height: 1.2;
  display: block;
}

.fleet-main-metric span {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
}

.fleet-main-truck {
  width: 120px;
  height: 84px;
  border-radius: 12px;
  background: linear-gradient(150deg, #f8fafd 0%, #e7edf5 100%);
  display: grid;
  place-items: center;
  color: #8a94a7;
  border: 1px solid #e6ebf2;
}

.fleet-live-list {
  display: grid;
  gap: 6px;
}

.fleet-live-item {
  display: grid;
  grid-template-columns: 40px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: 10px;
  cursor: pointer;
  border: 1px solid transparent;
}

.fleet-live-item:hover,
.fleet-live-item.is-active {
  background: #fff8f1;
  border-color: #f3d8bc;
}

.fleet-live-item-icon {
  width: 40px;
  height: 32px;
  border-radius: 8px;
  background: #eef2f7;
  display: grid;
  place-items: center;
  color: #6f7787;
}

.fleet-live-item-title {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
}

.fleet-live-item-sub {
  margin: 2px 0 0;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
}

.fleet-live-item-value {
  font-size: 15px;
  font-weight: 600;
  color: #64748b;
}

.fleet-trip-list {
  display: grid;
  gap: 8px;
}

.fleet-trip-item {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 8px 0;
  border-top: 1px solid #edf1f6;
}

.fleet-trip-item:first-child {
  border-top: 0;
}

.fleet-trip-time {
  font-weight: 500;
  font-size: 13px;
  color: #5f6674;
}

.fleet-trip-msg {
  font-size: 14px;
  color: var(--text-muted);
}

.fleet-trip-val {
  font-weight: 500;
  font-size: 13px;
  color: #6f7787;
}

.fleet-expense-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-1);
}

.fleet-expense-tile {
  border-radius: 12px;
  padding: 14px 12px;
  display: grid;
  gap: 6px;
  border: 1px solid #eef1f5;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.03);
}

.fleet-expense-tile strong {
  font-size: 18px;
  font-weight: 600;
  line-height: 1.2;
}

.fleet-expense-tile span {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
}

.fleet-expense-tile.is-gas { background: #eaf4ff; }
.fleet-expense-tile.is-oil { background: #e9f8ee; }
.fleet-expense-tile.is-wash { background: #f2ebff; }
.fleet-expense-tile.is-toll { background: #fff3df; }

@media (max-width: 1024px) {
  .kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .content-split {
    grid-template-columns: 1fr;
  }

  .control-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .panel-grid.two-col {
    grid-template-columns: 1fr;
  }

  .portal-hero {
    grid-template-columns: 1fr;
  }

  .fleet-layout-top,
  .fleet-layout-bottom {
    grid-template-columns: 1fr;
  }

  .fleet-map-canvas {
    height: 420px;
  }
}

@media (max-width: 768px) {
  .page-container {
    padding: var(--space-2);
  }

  .page-header {
    display: grid;
    justify-content: start;
    padding-top: 0;
    padding-right: 0;
  }

  .state-tabs {
    grid-template-columns: repeat(2, 1fr);
  }

  .kpi-grid,
  .control-grid {
    grid-template-columns: 1fr;
  }

  .route-list-grid {
    grid-template-columns: 1fr;
    max-width: 560px;
    margin: 0 auto;
  }

  .fleet-panel-head {
    display: grid;
  }

  .fleet-filter-row {
    justify-content: flex-start;
  }

  .fleet-main-vehicle-grid {
    grid-template-columns: 1fr;
  }

  .fleet-mini-stats {
    grid-template-columns: 1fr;
  }

  .fleet-main-truck {
    width: 100%;
    height: 70px;
  }

  .fleet-expense-grid {
    grid-template-columns: 1fr;
  }
}

/* ── Customer Identity (header-customer.html) ── */
.customer-identity {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.customer-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent, #6c5ce7);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  line-height: 1;
  flex-shrink: 0;
}

.customer-identity-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  line-height: 1.25;
}

.customer-identity-text strong {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary, #2f3037);
}

.customer-account-id {
  font-size: 11px;
  color: var(--text-secondary, #888);
  font-weight: 500;
}

/* ── Sidebar customer name / account ── */
.sidebar-customer-name {
  display: none;
}

.sidebar-customer-account {
  display: none;
}

.sidebar-shell.is-expanded .sidebar-customer-name {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.85);
  line-height: 1.2;
  margin-top: 2px;
}

.sidebar-shell.is-expanded .sidebar-customer-account {
  display: inline-block;
  font-size: 10px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.5);
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  padding: 1px 6px;
  margin-top: 2px;
}

/* ── Route card enhancements ── */
.route-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 13px;
  color: var(--text-secondary, #666);
  margin: 8px 0;
}

.route-meta span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.route-progress {
  margin: 8px 0 12px;
}

.route-progress-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary, #666);
  margin-top: 4px;
  display: block;
}

.route-card {
  padding: var(--space-2);
  margin-bottom: 0;
}

/* ── Photo upload zone (stop execution) ── */
.photo-upload-zone {
  border: 2px dashed #cbd5e1;
  border-radius: 10px;
  padding: 16px;
  background: #f8fafc;
  position: relative;
}

.photo-input-hidden {
  position: absolute;
  width: 0;
  height: 0;
  opacity: 0;
  overflow: hidden;
}

.photo-upload-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  color: #64748b;
  font-size: 14px;
}

.photo-upload-label:hover {
  color: var(--primary);
}

.photo-upload-label i {
  width: 32px;
  height: 32px;
}

.photo-preview {
  margin-top: 12px;
}

.signature-pad-wrap {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 8px;
  background: #fff;
}

.signature-canvas {
  display: block;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  cursor: crosshair;
  touch-action: none;
}

.signature-pad-wrap .ui-btn {
  margin-top: 8px;
}

/* ── Toggle switch (for roles) ── */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 20px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: var(--line, #d9dde3);
  border-radius: 20px;
  transition: background 180ms ease;
}

.toggle-slider::before {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  left: 2px;
  bottom: 2px;
  background: #fff;
  border-radius: 50%;
  transition: transform 180ms ease;
}

.toggle-switch input:checked + .toggle-slider {
  background: var(--success, #37c978);
}

.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(16px);
}

/* ── Quick Actions Row ── */
.quick-actions-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: var(--space-1);
  padding: 0 0 var(--space-2);
}

.quick-action-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: var(--space-2);
  background: var(--surface, #fff);
  border: 1px solid var(--line, #e2e5ea);
  border-radius: var(--radius, 12px);
  text-align: center;
  transition: box-shadow 180ms ease, border-color 180ms ease, transform 180ms ease;
  cursor: pointer;
}

.quick-action-card:hover {
  border-color: var(--primary);
  box-shadow: 0 4px 16px rgba(0, 0, 0, .08);
  transform: translateY(-2px);
}

.quick-action-card i {
  width: 28px;
  height: 28px;
  color: var(--primary);
}

.quick-action-card strong {
  font-size: 14px;
  font-weight: 600;
}

.quick-action-card span {
  font-size: 12px;
  color: var(--text-secondary, #666);
}

/* ── Content split panels ── */
.content-split {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: var(--space-2);
  margin-top: var(--space-2);
}

@media (max-width: 768px) {
  .content-split {
    grid-template-columns: 1fr;
  }
}

/* ── Section head with toolbar ── */
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-1);
  margin-bottom: var(--space-1);
}

/* ── Progress bar component ── */
.progress {
  --progress-start: #4a74ff;
  --progress-end: #6f8dff;
  height: 10px;
  background: linear-gradient(180deg, #eef1f6 0%, #e1e6ee 100%);
  border-radius: 999px;
  overflow: hidden;
  box-shadow: inset 0 1px 2px rgba(18, 25, 38, 0.12);
}

.progress span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--progress-start), var(--progress-end));
  border-radius: inherit;
  box-shadow: 0 2px 8px rgba(74, 116, 255, 0.28);
  transition: width 600ms cubic-bezier(0.22, 1, 0.36, 1);
}

.monthly-progress .progress {
  --progress-start: #3e6cff;
  --progress-end: #6f8dff;
}

.category-list .progress {
  --progress-start: #4f85ff;
  --progress-end: #65b9ff;
}

.chart-insight-item:nth-child(1) .progress {
  --progress-start: #16b970;
  --progress-end: #5dd7a2;
}

.chart-insight-item:nth-child(2) .progress {
  --progress-start: #3e6cff;
  --progress-end: #7aa2ff;
}

.chart-insight-item:nth-child(3) .progress {
  --progress-start: #f29f35;
  --progress-end: #ffd16b;
}

.budget-status .budget-row:nth-child(1) .progress {
  --progress-start: #21b66f;
  --progress-end: #5fd89e;
}

.budget-status .budget-row:nth-child(2) .progress {
  --progress-start: #3e7bff;
  --progress-end: #6ca6ff;
}

.budget-status .budget-row:nth-child(3) .progress {
  --progress-start: #f2a83e;
  --progress-end: #ffd173;
}

.budget-status .budget-row:nth-child(4) .progress {
  --progress-start: #22b96f;
  --progress-end: #67dba8;
}

/* ── Stack list (line items, method mix) ── */
.stack-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.stack-item {
  padding: 10px 12px;
  background: var(--background, #f8f9fa);
  border-radius: 8px;
}

.stack-item strong {
  font-size: 14px;
}

.stack-item p {
  font-size: 13px;
  color: var(--text-secondary, #666);
  margin-top: 2px;
}

.empty-note {
  font-size: 13px;
  color: var(--text-secondary, #666);
  font-style: italic;
}

/* ── Invoice detail panel ── */
.invoice-detail dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 16px;
}

.invoice-detail dt {
  font-weight: 600;
  font-size: 13px;
  color: var(--text-secondary, #666);
}

.invoice-detail dd {
  font-size: 14px;
}

/* ── Portal toolbar ── */
.portal-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.dispatch-board-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-2);
}

.dispatch-board-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-3);
  background: var(--surface);
  padding: var(--space-2);
  display: grid;
  gap: 8px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.dispatch-board-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.dispatch-board-card .form-actions {
  margin-top: 4px;
  gap: 6px;
}

.dispatch-board-card .form-actions .ui-btn {
  font-size: 12px;
  padding: 4px 10px;
  height: auto;
}

.dispatch-board-card .route-meta {
  display: flex;
  gap: 12px;
  font-size: 12px;
  color: var(--text-muted);
}

.dispatch-board-card .route-progress {
  display: flex;
  align-items: center;
  gap: 8px;
}

.dispatch-board-card .route-progress .progress {
  flex: 1;
}

.dispatch-board-card .route-progress-label {
  font-size: 11px;
  color: var(--text-secondary, #666);
  white-space: nowrap;
}

.invoice-create-page .invoice-builder-preview-actions .ui-btn i {
  width: 14px;
  height: 14px;
}

.invoice-create-page .invoice-builder-preview-actions .ui-btn {
  height: 36px;
}

.invoice-view-page .invoice-view-top {
  padding: 0 0 24px;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.invoice-view-page .invoice-view-title-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

.invoice-view-page .invoice-view-title-row h2 {
  margin: 0;
  font-size: 32px;
  font-weight: 700;
  color: var(--text-strong);
}

.invoice-view-page .invoice-view-actions {
  display: flex;
  gap: 12px;
  background: transparent;
  border: 0;
  overflow: visible;
}

.invoice-view-page .ui-btn--white {
  background: #fff;
  border: 1px solid #e2e8f0;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
  color: #475569;
  font-weight: 500;
  height: 38px;
  padding: 0 14px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.invoice-view-page .ui-btn--white:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.invoice-view-page .invoice-view-actions #viewSendEmailBtn {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.invoice-view-page .invoice-view-actions #viewSendEmailBtn:hover {
  background: color-mix(in srgb, var(--primary) 85%, #000);
  border-color: color-mix(in srgb, var(--primary) 85%, #000);
  color: #fff;
}

.invoice-view-page .print-invoice {
  border: 1px solid #e2e8f0;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
}

.invoice-view-page .print-invoice .section-head h2 {
  color: var(--primary);
  font-weight: 700;
}

.invoice-view-page .invoice-overview-meta dl {
  border-bottom: 0;
  padding-bottom: 0;
  margin-bottom: 24px;
}

.invoice-view-page .invoice-overview-meta dt {
  font-weight: 500;
  color: #64748b;
}

.invoice-view-page .invoice-overview-meta dd {
  font-weight: 500;
  color: #0f172a;
}

.invoice-view-page .invoice-view-table th {
  background: color-mix(in srgb, var(--primary) 8%, #fff);
  color: var(--secondary);
  font-weight: 600;
  border-bottom: 1px solid color-mix(in srgb, var(--primary) 20%, #e2e8f0);
}

.invoice-view-page .invoice-view-table td {
  border-bottom: 1px solid #f1f5f9;
  color: #334155;
}

.invoice-view-page .invoice-overview-totals {
  border-top: 0;
  margin-top: 24px;
  background: color-mix(in srgb, var(--primary) 6%, #f8fafc);
  padding: 16px;
  border-radius: 8px;
  border-left: 3px solid var(--primary);
}

.invoice-view-page .invoice-overview-totals dl {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 16px;
  margin: 0;
}

.invoice-view-page .invoice-overview-totals dt {
  color: #5f6674;
}

.invoice-view-page .invoice-overview-totals dd {
  margin: 0;
  font-weight: 700;
}

.invoice-view-page .invoice-overview-totals dd:last-of-type {
  color: var(--primary);
  font-size: 1.05em;
}

.invoice-view-page .invoice-overview-layout {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 64px;
  align-items: start;
}

.invoice-view-page .invoice-overview-side {
  display: grid;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-3) var(--space-3) var(--space-4);
  border-left: 3px solid var(--primary);
  background: color-mix(in srgb, var(--primary) 6%, #f8fafc);
  border-radius: 0 12px 12px 0;
}

.invoice-view-page .invoice-overview-side-card {
  border: 1px solid #ebeff4;
  border-radius: 12px;
  background: #fff;
  padding: 20px;
}

.invoice-view-page .invoice-overview-side-card h3 {
  margin: 0 0 8px;
  font-size: 18px;
  color: var(--primary);
  font-weight: 600;
}

.invoice-view-page .invoice-overview-side .timeline li {
  padding: 8px 0;
}

@media (max-width: 900px) {
  .invoice-view-page .invoice-view-title-row h2 {
    font-size: 34px;
  }

  .invoice-view-page .invoice-view-title-row strong {
    font-size: 24px;
  }

  .invoice-view-page .invoice-overview-meta dl {
    grid-template-columns: 1fr;
  }

  .invoice-view-page .invoice-overview-layout {
    grid-template-columns: 1fr;
    gap: var(--space-4);
  }

  .invoice-view-page .invoice-overview-side {
    margin-top: var(--space-4);
    padding-top: var(--space-4);
    padding-left: 0;
    border-left: 0;
    border-top: 3px solid var(--primary);
    border-radius: 0;
    background: transparent;
  }
}

/* Customer Invoice View – modern document-style layout */
.customer-invoice-view-page .customer-invoice-top {
  padding: 0 0 24px;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.customer-invoice-view-page .customer-invoice-title-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

.customer-invoice-view-page .customer-invoice-title-row h2 {
  margin: 0;
  font-size: 32px;
  font-weight: 700;
  color: var(--text-strong);
}

.customer-invoice-view-page .customer-invoice-title-row span {
  font-size: 14px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 6px;
}

.customer-invoice-view-page .customer-invoice-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.customer-invoice-view-page .customer-invoice-actions .ui-btn {
  height: 38px;
  padding: 0 14px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.customer-invoice-view-page .customer-invoice-actions .ui-btn--white {
  background: #fff;
  border: 1px solid #e2e8f0;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
  color: #475569;
  font-weight: 500;
}

.customer-invoice-view-page .customer-invoice-actions .ui-btn--white:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.customer-invoice-view-page .customer-invoice-card.print-invoice {
  border: 1px solid #e2e8f0;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
}

.customer-invoice-view-page .customer-invoice-card .section-head h2 {
  color: var(--primary);
  font-weight: 700;
}

.customer-invoice-view-page .customer-invoice-layout {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 64px;
  align-items: start;
}

.customer-invoice-view-page .customer-invoice-meta dl {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 24px;
  border-bottom: 0;
  padding-bottom: 0;
  margin-bottom: 24px;
}

.customer-invoice-view-page .customer-invoice-meta dt {
  font-weight: 500;
  color: #64748b;
}

.customer-invoice-view-page .customer-invoice-meta dd {
  font-weight: 500;
  color: #0f172a;
}

.customer-invoice-view-page .customer-invoice-table th {
  background: color-mix(in srgb, var(--primary) 8%, #fff);
  color: var(--secondary);
  font-weight: 600;
  border-bottom: 1px solid color-mix(in srgb, var(--primary) 20%, #e2e8f0);
}

.customer-invoice-view-page .customer-invoice-table td {
  border-bottom: 1px solid #f1f5f9;
  color: #334155;
}

.customer-invoice-view-page .customer-invoice-totals {
  border-top: 0;
  margin-top: 24px;
  background: color-mix(in srgb, var(--primary) 6%, #f8fafc);
  padding: 16px;
  border-radius: 8px;
  border-left: 3px solid var(--primary);
}

.customer-invoice-view-page .customer-invoice-totals dl {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 16px;
  margin: 0;
}

.customer-invoice-view-page .customer-invoice-totals dt {
  color: #5f6674;
}

.customer-invoice-view-page .customer-invoice-totals dd {
  margin: 0;
  font-weight: 700;
}

.customer-invoice-view-page .customer-invoice-totals dd:last-of-type {
  color: var(--primary);
  font-size: 1.05em;
}

.customer-invoice-view-page .customer-invoice-side {
  display: grid;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-3) var(--space-3) var(--space-4);
  border-left: 3px solid var(--primary);
  background: color-mix(in srgb, var(--primary) 6%, #f8fafc);
  border-radius: 0 12px 12px 0;
}

.customer-invoice-view-page .customer-invoice-side-card {
  border: 1px solid #ebeff4;
  border-radius: 12px;
  background: #fff;
  padding: 20px;
}

.customer-invoice-view-page .customer-invoice-side-card h3 {
  margin: 0 0 12px;
  font-size: 18px;
  color: var(--primary);
  font-weight: 600;
}

.customer-invoice-view-page .customer-invoice-side .stack-item {
  padding: 8px 0;
  border-bottom: 1px solid #f1f5f9;
}

.customer-invoice-view-page .customer-invoice-side .stack-item:last-child {
  border-bottom: 0;
}

@media (max-width: 900px) {
  .customer-invoice-view-page .customer-invoice-title-row h2 {
    font-size: 24px;
  }

  .customer-invoice-view-page .customer-invoice-meta dl {
    grid-template-columns: 1fr;
  }

  .customer-invoice-view-page .customer-invoice-layout {
    grid-template-columns: 1fr;
    gap: var(--space-4);
  }

  .customer-invoice-view-page .customer-invoice-side {
    margin-top: var(--space-4);
    padding-top: var(--space-4);
    padding-left: 0;
    border-left: 0;
    border-top: 3px solid var(--primary);
    border-radius: 0;
    background: transparent;
  }
}

/* ── Expense Dashboard (kept for expense-dashboard page) ── */
.badge-muted {
  color: var(--text-muted);
  background: var(--surface-muted);
}

.expense-dashboard-split {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: var(--space-2);
  margin-top: var(--space-2);
}

.expense-dashboard-left {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.expense-dashboard-right {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.compliance-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: var(--space-2);
}

.compliance-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: var(--space-2);
  background: var(--surface-muted);
  border-radius: var(--radius);
}

.compliance-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-strong);
}

.compliance-time {
  font-size: 11px;
  color: var(--text-muted);
}

.expense-category-grid {
  display: grid;
  gap: var(--space-2);
}

.expense-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: var(--space-2);
  transition: box-shadow 0.2s ease;
}

.expense-card:hover {
  box-shadow: var(--shadow);
}

.expense-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-2);
}

.expense-card-label {
  font-weight: 600;
  font-size: 14px;
}

.expense-card-time {
  font-size: 11px;
  color: var(--text-muted);
}

.expense-card-bar-wrap {
  position: relative;
  margin-bottom: var(--space-2);
}

.expense-bar-svg {
  width: 100%;
  height: 24px;
  display: block;
  border-radius: var(--radius);
  overflow: hidden;
}

.expense-bar-bg {
  fill: var(--surface-muted);
  width: 100%;
}

.expense-bar-fill {
  transition: width 800ms cubic-bezier(0.22, 1, 0.36, 1);
}

.expense-card-values {
  position: absolute;
  top: 50%;
  left: 12px;
  transform: translateY(-50%);
  font-size: 12px;
  font-weight: 600;
  color: var(--white);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.expense-card-metrics {
  font-size: 11px;
  color: var(--text-muted);
}

.alert-stack {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.alert-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-2);
  padding: var(--space-2);
  border-radius: var(--radius);
  border-left: 4px solid var(--line);
  background: var(--surface-muted);
  transition: opacity 0.3s ease;
}

.alert-item.alert-dismissed {
  opacity: 0;
}

.alert-high {
  border-left-color: var(--danger, #f15b63);
}

.alert-medium {
  border-left-color: var(--warning, #e0c043);
}

.alert-low {
  border-left-color: var(--primary, #1f7aff);
}

.alert-regular {
  border-left-color: var(--text-muted);
}

.alert-item-content {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  flex: 1;
  min-width: 0;
}

.alert-item-content i {
  flex-shrink: 0;
  margin-top: 2px;
}

.alert-item-content > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.alert-item-content strong {
  font-size: 12px;
  display: block;
}

.alert-text {
  font-size: 12px;
  color: var(--text-muted);
}

.alert-time {
  font-size: 11px;
  color: var(--text-muted);
}

.alert-dismiss {
  background: none;
  border: none;
  padding: 4px;
  cursor: pointer;
  color: var(--text-muted);
  border-radius: var(--radius);
  transition: color 0.15s, background 0.15s;
}

.alert-dismiss:hover {
  color: var(--danger);
  background: rgba(241, 91, 99, 0.1);
}

.pending-work-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.pending-work-item {
  padding: var(--space-2);
  background: var(--surface-muted);
  border-radius: var(--radius);
  border-left: 3px solid var(--primary);
}

.pending-work-time {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.pending-work-text {
  margin: 0;
  font-size: 13px;
  color: var(--text-strong);
  line-height: 1.4;
}

@media (max-width: 1024px) {
  .expense-dashboard-split {
    grid-template-columns: 1fr;
  }
}

/* ══════════════════════════════════════════════════════════
   FuelSmart Fuel Dashboard
   ══════════════════════════════════════════════════════════ */
.fuel-smart-page {
  padding: var(--space-3) var(--space-4);
}

.fuel-smart-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: var(--space-4);
  align-items: start;
}

.fuel-smart-left,
.fuel-smart-right {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.fuel-smart-section {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.fuel-smart-heading {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  color: var(--text-strong);
}

/* ── Compliance row ── */
.fs-compliance-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  padding: 14px 16px;
  border-radius: 14px;
  background: linear-gradient(140deg, #121317 0%, #1b1d24 55%, #20232b 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.fs-compliance-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 0;
}

.fs-compliance-meta {
  display: flex;
  flex-direction: column;
}

.fs-compliance-label {
  font-size: 13px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.92);
}

.fs-compliance-time {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.58);
}

.fs-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 999px;
  white-space: nowrap;
}

.fs-badge i {
  width: 13px;
  height: 13px;
}

.fs-badge--pass {
  background: #def8e9;
  color: #2ca362;
}

.fs-badge--fail {
  background: #ffdfe2;
  color: #c63f47;
}

.fs-badge--waiting {
  background: var(--surface-muted);
  color: var(--text-muted);
}

/* ── Tank grid (2-col like FuelSmart) ── */
.fs-tank-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-3);
}

.fs-tank-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: var(--space-2) var(--space-2) var(--space-1);
}

.fs-tank-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.fs-tank-label {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-strong);
}

.fs-tank-time {
  font-size: 11px;
  color: var(--text-muted);
}

.fs-truck-svg {
  display: block;
  width: 100%;
  height: auto;
  max-height: 210px;
}

/* liquid rise animation */
.fs-liquid-body,
.fs-liquid-wave {
  transition: y 1.2s cubic-bezier(0.22, 1, 0.36, 1),
              height 1.2s cubic-bezier(0.22, 1, 0.36, 1);
  transform-box: fill-box;
  transform-origin: center;
}

/* sloshing wave on the liquid surface */
@keyframes fs-wave-slosh {
  0%   { transform: translateX(0) translateY(0); }
  50%  { transform: translateX(-25%) translateY(2px); }
  100% { transform: translateX(-50%) translateY(0); }
}

.fs-wave-path {
  animation: fs-wave-slosh 4.2s linear infinite;
}

@keyframes fs-liquid-sway {
  0%, 100% { transform: translateX(-3.6px) rotate(-1.2deg); }
  50%      { transform: translateX(3.6px) rotate(1.2deg); }
}

.fs-wave-group {
  animation: fs-liquid-sway 3.2s ease-in-out infinite;
}

/* subtle body shimmer so liquid feels alive */
@keyframes fs-liquid-shimmer {
  0%, 100% { opacity: 0.64; }
  50%      { opacity: 0.69; }
}

.fs-liquid-body {
  animation: fs-liquid-shimmer 6s ease-in-out infinite, fs-liquid-sway 3.2s ease-in-out infinite;
}

.fs-tank-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px var(--space-3);
  margin-top: 6px;
}

.fs-tank-metrics--center {
  grid-template-columns: 1fr;
  justify-items: start;
}

.fs-metric {
  display: flex;
  flex-direction: column;
}

.fs-metric span {
  font-size: 11px;
  color: var(--text-muted);
}

.fs-metric strong {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-strong);
}

/* ── Alerts (colored icon circles like FuelSmart) ── */
.fs-alert-stack {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.fs-alert-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  transition: opacity 0.3s ease;
}

.fs-alert-item.fs-alert-dismissed {
  opacity: 0;
}

.fs-alert-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

.fs-alert-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  flex-shrink: 0;
}

.fs-alert-icon i {
  color: #fff;
  width: 16px;
  height: 16px;
}

.fs-alert-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.fs-alert-text strong {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-strong);
}

.fs-alert-text span {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fs-alert-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.fs-alert-time {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
}

.fs-alert-dismiss {
  background: none;
  border: none;
  padding: 4px;
  cursor: pointer;
  color: var(--text-muted);
  border-radius: var(--radius);
  transition: color 0.15s, background 0.15s;
}

.fs-alert-dismiss:hover {
  color: var(--danger, #f15b63);
  background: rgba(241, 91, 99, 0.1);
}

/* ── Pending work orders ── */
.fs-pending-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.fs-pending-item {
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
}

.fs-pending-item:last-child {
  border-bottom: none;
}

.fs-pending-time {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 3px;
}

.fs-pending-text {
  margin: 0;
  font-size: 13px;
  color: var(--text-strong);
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

@media (max-width: 1024px) {
  .fuel-smart-layout {
    grid-template-columns: 1fr;
  }

  .fs-tank-grid {
    grid-template-columns: 1fr;
  }
}

/* ══════════════════════════════════════════════════════════
   Invoice Settings (Hybrid finance flow)
   ══════════════════════════════════════════════════════════ */

.inv-settings-card {
  padding: 0;
  overflow: hidden;
}

.inv-settings-main {
  padding: var(--space-3) var(--space-4);
}

.inv-settings-general-shell {
  display: grid;
  grid-template-columns: 220px 1fr;
  height: 620px;
  border: 1px solid #e7ebf2;
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
}

.inv-settings-general-nav {
  border-right: 1px solid #edf1f6;
  background: #fbfcfe;
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.inv-settings-general-tab {
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  padding: 10px 12px;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.inv-settings-general-tab:hover {
  background: #f2f5fa;
  color: var(--text-strong);
}

.inv-settings-general-tab.is-active {
  background: color-mix(in srgb, var(--primary) 8%, #fff);
  border-color: color-mix(in srgb, var(--primary) 30%, #dbe2ec);
  color: var(--primary, #1f7aff);
}

.inv-settings-general-content {
  overflow: auto;
  padding: 0 16px;
}

.inv-settings-general-panel {
  display: none;
}

.inv-settings-general-panel.is-active {
  display: block;
}

.inv-settings-panel-title {
  margin: 14px 0;
  font-size: 18px;
  font-weight: 700;
  color: var(--text-strong);
}

/* ── Tabs ── */
.inv-settings-tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid #e7ebf2;
  margin-bottom: var(--space-3);
}

.inv-settings-tab {
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.inv-settings-tab:hover {
  color: var(--text-strong);
}

.inv-settings-tab.is-active {
  color: var(--primary, #1f7aff);
  border-bottom-color: var(--primary, #1f7aff);
}

/* ── Tab panes ── */
.inv-settings-pane {
  display: none;
}

.inv-settings-pane.is-active {
  display: block;
}

/* ── Section heading ── */
.inv-settings-section-title {
  margin: 0 0 var(--space-3);
  font-size: 22px;
  font-weight: 700;
  color: var(--text-strong);
}

/* ── Settings rows ── */
.inv-settings-row {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: var(--space-3);
  padding: 20px 0;
  border-bottom: 1px solid #edf1f6;
  align-items: start;
}

.inv-settings-row:last-child {
  border-bottom: none;
}

.inv-settings-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-strong);
  padding-top: 2px;
}

.inv-settings-control {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.inv-settings-desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.45;
  margin: 0;
}

.inv-settings-link {
  color: var(--primary, #1f7aff);
  text-decoration: none;
  font-weight: 500;
  font-size: 13px;
}

.inv-settings-link:hover {
  text-decoration: underline;
}

/* ── Toggle row ── */
.inv-settings-toggle-row {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.inv-settings-toggle-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.inv-settings-toggle-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-strong);
}

.inv-settings-toggle-desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.45;
}

/* ── Radio group ── */
.inv-settings-radio-group {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.inv-settings-radio-option {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.inv-settings-radio-option input[type="radio"] {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--primary, #1f7aff);
  flex-shrink: 0;
}

.inv-settings-radio-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.inv-settings-radio-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-strong);
}

.inv-settings-radio-desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.45;
}

/* ── Textarea ── */
.inv-settings-textarea {
  width: 100%;
  min-height: 90px;
  padding: 10px 14px;
  border: 1px solid #d5dbe5;
  border-radius: 8px;
  font-family: inherit;
  font-size: 14px;
  color: var(--text-strong);
  background: #fff;
  resize: vertical;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.inv-settings-textarea::placeholder {
  color: var(--text-muted);
}

.inv-settings-textarea:focus {
  outline: none;
  border-color: var(--primary, #1f7aff);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 12%, transparent);
}

.inv-settings-helper {
  font-size: 12px;
  color: var(--text-muted);
  margin: 2px 0 0;
}

/* ── Responsive ── */
@media (max-width: 900px) {
  .inv-settings-main {
    padding: var(--space-2);
  }

  .inv-settings-general-shell {
    grid-template-columns: 1fr;
    height: auto;
  }

  .inv-settings-general-nav {
    border-right: 0;
    border-bottom: 1px solid #edf1f6;
    flex-direction: row;
    flex-wrap: wrap;
  }

  .inv-settings-row {
    grid-template-columns: 1fr;
    gap: var(--space-1);
  }
}

/* ══════════════════════════════════════════════════════════
   SHARED VISUAL FX ANIMATIONS
   ══════════════════════════════════════════════════════════ */

@keyframes vfx-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50%      { transform: scale(1.35); opacity: 0.5; }
}

@keyframes vfx-bounce {
  0%   { transform: translateY(-18px); }
  40%  { transform: translateY(0); }
  55%  { transform: translateY(-6px); }
  70%  { transform: translateY(0); }
  85%  { transform: translateY(-2px); }
  100% { transform: translateY(0); }
}

@keyframes vfx-radar {
  0%   { transform: scale(0.5); opacity: 0.7; }
  100% { transform: scale(1.6); opacity: 0; }
}

@keyframes vfx-dash-flow {
  to { stroke-dashoffset: -20; }
}

@keyframes vfx-fade-in {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.vfx-fade-in {
  animation: vfx-fade-in 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: calc(var(--stagger, 0) * 100ms);
}

/* ══════════════════════════════════════════════════════════
   MODULE SHARED
   ══════════════════════════════════════════════════════════ */

.assign-sites-card,
.branches-module,
.price-mgmt-card,
.expense-module-card {
  padding: var(--space-3);
}

.table-wrap { overflow-x: auto; }

.empty-note {
  text-align: center;
  color: var(--text-muted);
  padding: 18px;
}

/* ══════════════════════════════════════════════════════════
   ASSIGN CUSTOMER SITES
   ══════════════════════════════════════════════════════════ */

.acs-hero {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
}

.acs-hero-visual {
  display: flex;
  align-items: center;
  gap: 16px;
}

.acs-pin-svg {
  width: 100px;
  height: auto;
  flex-shrink: 0;
}

.acs-pin-group {
  animation: vfx-bounce 1.2s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.acs-radar {
  animation: vfx-radar 2.5s ease-out infinite;
}
.acs-radar--2 { animation-delay: 0.8s; }

.assign-sites-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.assign-sites-tab {
  border: 1px solid #dde3ee;
  background: #f7f9fc;
  color: var(--text-strong);
  border-radius: 10px;
  padding: 8px 14px;
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.assign-sites-tab.is-active {
  background: color-mix(in srgb, var(--primary) 10%, #fff);
  border-color: color-mix(in srgb, var(--primary) 40%, #d5deea);
  color: var(--primary);
}

.assign-sites-pane { display: none; }
.assign-sites-pane.is-active { display: block; }

.acs-leaflet-map {
  margin-top: var(--space-2);
  height: 320px;
  border-radius: 14px;
  border: 1px solid #d8e0ec;
  overflow: hidden;
}

/* Site cards grid */
.acs-site-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

.acs-site-card {
  background: #fff;
  border: 1px solid #e4e9f2;
  border-left: 4px solid #ccc;
  border-radius: 12px;
  padding: 14px 16px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.acs-site-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
}

.acs-site-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.acs-site-card-head strong {
  font-size: 14px;
  flex: 1;
}

.acs-site-addr {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
}

.acs-site-card-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 12px;
  color: var(--text-muted);
}

.acs-site-card-stats span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.acs-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
}

.acs-empty p { margin-top: 10px; }

/* ══════════════════════════════════════════════════════════
   BRANCHES
   ══════════════════════════════════════════════════════════ */

.branch-hero-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 20px;
  background: linear-gradient(135deg, #f8faff, #eef4ff);
  border: 1px solid #dce6f5;
  border-radius: 16px;
  padding: 20px 24px;
  align-items: center;
}

.branch-network-svg {
  width: 240px;
  height: auto;
}

.branch-conn {
  stroke: #90a4ae;
  stroke-width: 2;
  stroke-dasharray: 6 4;
  animation: vfx-dash-flow 1.5s linear infinite;
}

.branch-hero-right h2 { margin: 0 0 4px; }
.branch-hero-right p { margin: 0 0 12px; color: var(--text-muted); font-size: 14px; }

.branch-mini-map {
  height: 140px;
  border-radius: 12px;
  border: 1px solid #d8e0ec;
  overflow: hidden;
}

.branch-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}

.branch-card {
  background: #fff;
  border: 1px solid #e4e9f2;
  border-radius: 14px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.branch-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.branch-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
}

.branch-card-name {
  flex: 1;
  font-weight: 700;
  font-size: 14px;
}

.branch-card-body {
  padding: 6px 16px 14px;
  display: grid;
  gap: 6px;
}

.branch-card-stat {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted);
}

.branch-card-stat i, .branch-card-stat svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

/* ══════════════════════════════════════════════════════════
   PRICE MANAGEMENT
   ══════════════════════════════════════════════════════════ */

.pm-hero {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 20px;
  background: linear-gradient(135deg, #f8faff, #f0f5ff);
  border: 1px solid #dce6f5;
  border-radius: 16px;
  padding: 24px;
}

.pm-hero-text h2 { margin: 0 0 6px; }
.pm-hero-text p { margin: 0; color: var(--text-muted); font-size: 14px; max-width: 420px; }

.pm-scale-svg {
  width: 180px;
  height: auto;
}

.pm-beam {
  transition: transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

.pm-kpi-strip {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}

.pm-kpi {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #fff;
  border: 1px solid #e4e9f2;
  border-radius: 12px;
  padding: 14px 16px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.pm-kpi:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
}

.pm-kpi-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.pm-kpi p {
  margin: 0;
  font-size: 12px;
  color: var(--text-muted);
}

.pm-kpi strong {
  font-size: 20px;
  font-weight: 800;
}

.pm-cell-rate { font-variant-numeric: tabular-nums; }

.pm-cell-delta {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.pm-delta-bar {
  width: 100%;
  max-width: 80px;
  height: 8px;
  background: #f0f2f5;
  border-radius: 4px;
  overflow: hidden;
}

.pm-delta-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

/* ══════════════════════════════════════════════════════════
   ADD EXPENSE
   ══════════════════════════════════════════════════════════ */

.exp-layout {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 20px;
  align-items: start;
}

.exp-line-host {
  display: grid;
  gap: 10px;
}

.exp-line-card {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  gap: 10px;
  align-items: center;
  background: #fff;
  border: 1px solid #e4e9f2;
  border-radius: 12px;
  padding: 10px 14px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.exp-line-card:hover {
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
}

.exp-line-cat-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.exp-line-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.exp-line-nums {
  display: flex;
  align-items: center;
  gap: 6px;
}

.exp-line-nums input { width: 70px; text-align: right; }

.exp-line-total {
  font-weight: 700;
  font-size: 14px;
  min-width: 60px;
  text-align: right;
  color: var(--text-strong);
}

.exp-preview-col {
  position: sticky;
  top: 20px;
}

.exp-receipt-card {
  background: #fff;
  border: 1px solid #e4e9f2;
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 14px;
}

.exp-receipt-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 10px;
  color: var(--text-strong);
}

.exp-receipt-svg {
  width: 100%;
  max-width: 200px;
  margin: 0 auto;
  display: block;
  transition: height 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.exp-receipt-lines {
  margin-top: 10px;
  display: grid;
  gap: 4px;
}

.exp-receipt-line {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  padding: 4px 0;
  border-bottom: 1px dashed #eef1f6;
}

.exp-totals-visual {
  display: grid;
  gap: 10px;
}

.exp-total-tile {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #fff;
  border: 1px solid #e4e9f2;
  border-radius: 12px;
  padding: 12px 16px;
  transition: transform 0.2s ease;
}

.exp-total-tile:hover { transform: translateY(-1px); }

.exp-total-tile--grand {
  border-color: #2ab56f;
  background: linear-gradient(135deg, #f0fdf4, #fff);
}

.exp-total-tile--grand strong {
  font-size: 22px;
  color: #2ab56f;
}

.exp-total-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.exp-total-tile p {
  margin: 0;
  font-size: 12px;
  color: var(--text-muted);
}

.exp-total-tile strong {
  font-size: 18px;
  font-weight: 800;
}

/* ══════════════════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════════════════ */

@media (max-width: 900px) {
  .acs-hero,
  .pm-hero,
  .branch-hero-card {
    grid-template-columns: 1fr;
  }

  .acs-hero-visual { flex-direction: column; }
  .acs-pin-svg { width: 70px; }

  .branch-network-svg { width: 180px; }

  .exp-layout { grid-template-columns: 1fr; }

  .exp-line-card {
    grid-template-columns: auto 1fr auto;
  }

  .exp-line-nums { flex-wrap: wrap; }
}

/* Unified Settings Hub */
.settings-launcher-card {
  padding: var(--space-2);
}

.settings-launcher-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
}

.settings-launch-card {
  border: 1px solid #dce2ec;
  background: #fff;
  border-radius: 14px;
  min-height: 110px;
  padding: 14px 12px;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 6px;
  text-align: center;
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.settings-launch-card i,
.settings-launch-card svg {
  width: 24px;
  height: 24px;
}

.settings-launch-card strong {
  line-height: 1.1;
  font-size: 14px;
  color: var(--text-strong);
}

.settings-launch-card span {
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1.3;
  max-width: 100%;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.settings-launch-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.08);
}

.settings-launch-card.is-active {
  border-color: #2f6dff;
  box-shadow: 0 0 0 2px color-mix(in srgb, #2f6dff 24%, transparent);
}

.settings-tab-shell .inv-settings-pane {
  gap: 14px;
}

.settings-panel-card {
  border: 1px solid #e7ebf2;
  border-radius: 14px;
  padding: 12px 14px;
  background: #fff;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.settings-panel-card.is-active-focus {
  border-color: #2f6dff;
  box-shadow: 0 0 0 3px color-mix(in srgb, #2f6dff 20%, transparent);
}
