/* ==========================================================================
   AutoReg Design System — Bootstrap 5 theme
   Green brand palette, sidebar/topbar shell, cards, badges, charts.
   ========================================================================== */

:root {
  /* Brand */
  --primary: #1F7A44;
  --primary-dark: #14532D;
  --primary-darker: #0B2E19;
  --primary-light: #E6F4EA;
  --primary-100: #C9EAD4;

  /* Accent / status */
  --danger: #E53E3E;
  --danger-light: #FDEEEE;
  --warning: #B26A0E;
  --warning-light: #FDF3E3;
  --success: #1F7A44;
  --success-light: #E6F4EA;
  --info: #2F6FDE;
  --info-light: #EAF1FD;

  /* Surfaces */
  --bg: #F4F6F8;
  --surface: #FFFFFF;
  --border: #E5E9EE;
  --border-strong: #D6DCE3;

  /* Text */
  --text-primary: #1A202C;
  --text-secondary: #667085;
  --text-muted: #98A2B3;
  --text-on-primary: #FFFFFF;
  --white: #FFFFFF;

  /* Layout */
  --sidebar-width: 264px;
  --topbar-height: 64px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;

  /* Chart colors (read from JS via getComputedStyle) */
  --chart-primary-soft: rgba(31, 122, 68, 0.12);
  --chart-warning: #F0B94D;
  --chart-danger: #E5645A;
  --chart-grid: #EEF1F4;

  /* Bootstrap variable overrides */
  --bs-primary: var(--primary);
  --bs-primary-rgb: 31, 122, 68;
  --bs-body-color: var(--text-primary);
  --bs-body-bg: var(--bg);
  --bs-border-color: var(--border);
  --bs-link-color: var(--primary);
  --bs-link-hover-color: var(--primary-dark);
  --bs-font-sans-serif: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  /* Raw Bootstrap components (.table, .badge, .list-group, muted text, ...) read
     these rather than --bs-body-color, so they need the same theming or they're
     stuck with Bootstrap's fixed light-mode text/backgrounds under dark mode. */
  --bs-emphasis-color: var(--text-primary);
  --bs-emphasis-color-rgb: 26, 32, 44;
  --bs-secondary-color: var(--text-secondary);
  --bs-secondary-color-rgb: 102, 112, 133;
  --bs-tertiary-color: var(--text-muted);
  --bs-tertiary-color-rgb: 152, 162, 179;
  --bs-secondary-bg: var(--border);
  --bs-tertiary-bg: var(--bg);

  color-scheme: light;
}

body, .sidebar, .topbar, .card, .icon-btn {
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

/* ==========================================================================
   Dark theme — toggled via [data-theme="dark"] on <html>
   ========================================================================== */

:root[data-theme="dark"] {
  --primary: #34A65E;
  --primary-dark: #4FC97C;
  --primary-darker: #0B2E19;
  --primary-light: rgba(52, 166, 94, 0.16);
  --primary-100: rgba(52, 166, 94, 0.28);

  --danger: #F0736B;
  --danger-light: rgba(229, 100, 90, 0.14);
  --warning: #F0B94D;
  --warning-light: rgba(240, 185, 77, 0.14);
  --success: #34A65E;
  --success-light: rgba(52, 166, 94, 0.16);
  --info: #6C9CF5;
  --info-light: rgba(108, 156, 245, 0.14);

  --bg: #0F1712;
  --surface: #17211B;
  --border: #263129;
  --border-strong: #34403A;

  --text-primary: #F3F6F4;
  --text-secondary: #A8B5AE;
  --text-muted: #79867F;
  --text-on-primary: #0B2E19;

  --chart-primary-soft: rgba(52, 166, 94, 0.18);
  --chart-grid: #263129;

  --bs-primary-rgb: 52, 166, 94;

  --bs-emphasis-color-rgb: 243, 246, 244;
  --bs-secondary-color-rgb: 168, 181, 174;
  --bs-tertiary-color-rgb: 121, 134, 127;

  color-scheme: dark;
}

* { box-sizing: border-box; }

body {
  font-family: var(--bs-font-sans-serif);
  background: var(--bg);
  color: var(--text-primary);
  font-size: 14px;
}

a { text-decoration: none; }

.text-muted { font-size:12px; color: var(--text-muted) !important; }

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn-primary {
  /* Bootstrap's own .btn-primary hardcodes ALL of these to its stock blue —
     hover/active/focus/disabled are each a separate custom property, none
     derived from --bs-primary — so every state needs its own override here,
     not just the base background-color/border-color below. */
  --bs-btn-color: var(--text-on-primary);
  --bs-btn-bg: var(--primary);
  --bs-btn-border-color: var(--primary);
  --bs-btn-hover-color: var(--text-on-primary);
  --bs-btn-hover-bg: var(--primary-dark);
  --bs-btn-hover-border-color: var(--primary-dark);
  --bs-btn-focus-shadow-rgb: var(--bs-primary-rgb);
  --bs-btn-active-color: var(--text-on-primary);
  --bs-btn-active-bg: var(--primary-dark);
  --bs-btn-active-border-color: var(--primary-dark);
  --bs-btn-disabled-color: var(--text-on-primary);
  --bs-btn-disabled-bg: var(--primary);
  --bs-btn-disabled-border-color: var(--primary);
  background-color: var(--primary);
  border-color: var(--primary);
  color: var(--text-on-primary);
  font-weight: 600;
  border-radius: var(--radius-sm);
}
.btn-primary:hover,
.btn-primary:focus {
  background-color: var(--primary-dark);
  border-color: var(--primary-dark);
  color: var(--text-on-primary);
}

.btn-outline-primary {
  --bs-btn-color: var(--primary);
  --bs-btn-border-color: var(--border-strong);
  --bs-btn-hover-color: var(--primary-dark);
  --bs-btn-hover-bg: var(--primary-light);
  --bs-btn-hover-border-color: var(--primary);
  --bs-btn-focus-shadow-rgb: var(--bs-primary-rgb);
  --bs-btn-active-color: var(--primary-dark);
  --bs-btn-active-bg: var(--primary-light);
  --bs-btn-active-border-color: var(--primary);
  --bs-btn-disabled-color: var(--primary);
  --bs-btn-disabled-border-color: var(--border-strong);
  color: var(--primary);
  border-color: var(--border-strong);
  border-radius: var(--radius-sm);
}
.btn-outline-primary:hover {
  background-color: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary-dark);
}

/* ==========================================================================
   Global button loading state — class toggled by app.js on any form submit
   or navigating <a class="btn">, site-wide (see app.js for the trigger
   logic and why). <button>/<a> get a spinner via ::after; <input> can't
   host generated content in any browser, so app.js swaps its value text
   instead and this just dims it.
   ========================================================================== */

button.btn-loading,
a.btn-loading {
  position: relative;
  color: transparent !important;
  pointer-events: none;
}

button.btn-loading::after,
a.btn-loading::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 16px;
  height: 16px;
  margin: -8px 0 0 -8px;
  border: 2px solid rgba(255, 255, 255, 0.45);
  border-top-color: #fff;
  border-radius: 50%;
  animation: btn-loading-spin 0.6s linear infinite;
}

button.btn-outline-primary.btn-loading::after,
a.btn-outline-primary.btn-loading::after {
  border-color: rgba(31, 122, 68, 0.35);
  border-top-color: var(--primary);
}

input.btn-loading {
  pointer-events: none;
  opacity: 0.75;
  cursor: not-allowed;
}

@keyframes btn-loading-spin {
  to { transform: rotate(360deg); }
}

/* ==========================================================================
   App shell — topbar + sidebar + main
   ========================================================================== */

.shell {
  display: flex;
  min-height: 100vh;
}

/* --- Sidebar --- */

.sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: sticky;
  top: 0;
}

.sidebar__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px 0px 20px;
  border-bottom: 1px solid var(--border);
}

.sidebar__brand .logo-mark {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 12px;
}

.sidebar__brand span {
  font-weight: 700;
  font-size: 15px;
  color: var(--text-primary);
}

.sidebar__nav {
  flex: 1;
  overflow-y: auto;
  padding: 12px 12px 0;
}

.nav-group + .nav-group {
  margin-top: 4px;
}

.nav-group__toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  border: none;
  background: transparent;
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
}

.nav-group__toggle:hover { background: var(--bg); }

.nav-group__toggle.active {
  background: var(--primary-light);
  color: var(--primary-dark);
}

.nav-group__toggle-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-group__toggle .chevron {
  transition: transform 0.15s ease;
  color: var(--text-muted);
  font-size: 12px;
}

.nav-group__toggle[aria-expanded="true"] .chevron {
  transform: rotate(180deg);
}

.nav-group__badge {
  background: var(--danger);
  color: #fff;
  font-size: 10.5px;
  font-weight: 700;
  line-height: 1;
  padding: 3px 6px;
  border-radius: 999px;
  min-width: 18px;
  text-align: center;
}

.nav-sublist {
  list-style: none;
  margin: 2px 0 6px;
  padding-left: 34px;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.nav-link {
  display: block;
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text-secondary);
}

.nav-link:hover {
  background: var(--bg);
  color: var(--text-primary);
}

.nav-link.active {
  background: var(--primary-light);
  color: var(--primary-dark);
  font-weight: 600;
}

.nav-link--top {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-primary);
}

.nav-link--top:first-child{
  color: var(--primary);
}

.nav-link--top:hover { background: var(--bg); color: var(--text-primary); }

.nav-link--top.active {
  background: var(--primary-light);
  color: var(--primary-dark);
}

.sidebar__footer {
  border-top: 1px solid var(--border);
  padding: 10px 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.sidebar__footer .nav-link--top { font-weight: 500; }

/* --- Topbar --- */

.topbar {
  height: var(--topbar-height);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  position: sticky;
  top: 0;
  z-index: 20;
}

.topbar__org {
  font-weight: 600;
  color: var(--primary-dark);
  font-size: 14.5px;
}

.topbar__branch{
  font-size: 12px;
  color: var(--text-secondary);
}
.topbar__actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
}

.icon-btn:hover { background: var(--bg); }

:disabled,
[disabled],
.disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.topbar__user {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
}

.topbar__user:hover,
.topbar__user:focus {
  color: inherit;
  text-decoration: none;
}

.topbar__user-meta { line-height: 1.2; text-align: right; }
.topbar__user-meta .name { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.topbar__user-meta .role { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.03em; }

.user-dropdown {
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.12);
  border-radius: var(--radius-md);
  padding: 6px;
}

.user-dropdown .dropdown-item {
  border-radius: 8px;
  color: var(--text-primary);
}

.user-dropdown .dropdown-item:hover,
.user-dropdown .dropdown-item:focus {
  background: var(--bg);
  color: var(--primary-dark);
}

.avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 12.5px;
  border: 2px solid var(--primary-100);
}

.hamburger {
  display: none;
  border: 1px solid var(--border);
  background: var(--surface);
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  align-items: center;
  justify-content: center;
  color: var(--text-primary);
}
/* --- Main --- */

.main {
  flex: 1;
  min-width: 0;
  padding: 24px;
  display: flex;
  flex-direction: column;
}

.page-title { font-size: 22px; font-weight: 700; margin-bottom: 2px; }
.page-subtitle { font-size: 13px; color: var(--text-secondary); margin-bottom: 20px; }

/* ==========================================================================
   Cards / KPIs / charts
   ========================================================================== */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px 20px;
}

.kpi-card .kpi-label {
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.kpi-card .kpi-value {
  font-size: 26px;
  font-weight: 700;
  color: var(--text-primary);
}

.kpi-card .kpi-delta {
  font-size: 12px;
  font-weight: 600;
  margin-left: 6px;
}
.kpi-delta.up { color: var(--primary); }
.kpi-delta.down { color: var(--danger); }

.kpi-card .kpi-compare {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 6px;
}

.card-title { font-size: 14px; font-weight: 700; margin-bottom: 2px; }
.card-subtitle { font-size: 12px; color: var(--text-secondary); margin-bottom: 14px; }

.chart-wrap { position: relative; height: 200px; }
.chart-wrap.sm { height: 160px; }

/* Funnel bars */
.funnel-row { margin-bottom: 12px; }
.funnel-row:last-child { margin-bottom: 0; }
.funnel-label {
  display: flex;
  justify-content: space-between;
  font-size: 12.5px;
  font-weight: 600;
  margin-bottom: 4px;
}
.funnel-label .count { color: var(--text-secondary); font-weight: 500; }
.funnel-track {
  height: 30px;
  border-radius: var(--radius-sm);
  background: var(--bg);
  overflow: hidden;
}
.funnel-fill { height: 100%; background: var(--primary); border-radius: var(--radius-sm); }

/* Legend */
.legend { display: flex; flex-direction: column; gap: 6px; margin-top: 14px; font-size: 12.5px; }
.legend-item { display: flex; align-items: center; justify-content: space-between; }
.legend-dot { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 8px; }

/* Alert banner (federation notice style) */
.alert {
  background: var(--danger-light);
  border: 1px solid #F6D2D2;
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 12.5px;
  color: #9B2C2C;
}

:root[data-theme="dark"] .alert {
  border-color: rgba(240, 115, 107, 0.35);
  color: #F5A6A0;
}

.toast-container {
  position: fixed;
  top: 0;
  right: 0;
  padding: 1rem;
  z-index: 1080;
}

.toast-alert {
  align-items: center;
  border: 0;
  margin-bottom: 1rem;
}
.toast-alert .btn-close {
  margin: auto 0.5rem auto 0;
  filter: invert(1) grayscale(100%) brightness(200%);
}


footer.d-flex {
  color: var(--text-secondary) !important;
}

footer.d-flex a {
  color: var(--text-secondary) !important;
}

footer.d-flex a:hover,
footer.d-flex a:focus {
  color: var(--primary) !important;
}

:root[data-theme="dark"] footer.d-flex,
:root[data-theme="dark"] footer.d-flex a {
  color: var(--text-muted) !important;
}

:root[data-theme="dark"] footer.d-flex a:hover,
:root[data-theme="dark"] footer.d-flex a:focus {
  color: var(--primary-dark) !important;
}

/* ==========================================================================
   Theme switcher
   ========================================================================== */

.theme-toggle {
  position: relative;
}

.theme-toggle .bi-moon-stars { display: none; }
:root[data-theme="dark"] .theme-toggle .bi-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .bi-moon-stars { display: inline-block; }

/* ==========================================================================
   Responsive — sidebar becomes off-canvas below lg
   ========================================================================== */

@media (max-width: 991.98px) {
  .sidebar { display: none; }
  .hamburger { display: flex; }
  .main { padding: 16px; }
  .topbar { padding: 0 16px; }
  .topbar__user-meta { display: none; }
}

@media (max-width: 575.98px) {
  .kpi-card .kpi-value { font-size: 22px; }
  .page-title { font-size: 19px; }
}

/* Off-canvas sidebar reuses the same nav styling */
.offcanvas .sidebar { display: flex; border-right: none; height: 100%; position: static; width: 100%; }

/* ==========================================================================
   Vehicle lookup — plate search, status, permits, detail cards
   ========================================================================== */

.plate-toggle {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 24px;
  margin-bottom: 16px;
}

.plate-toggle .form-check {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}

.plate-toggle .form-check-input {
  width: 18px;
  height: 18px;
  margin: 0;
  border-color: var(--border-strong);
}

.plate-toggle .form-check-input:checked {
  background-color: var(--primary);
  border-color: var(--primary);
}

.plate-toggle .form-check-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
}

.plate-toggle .form-check-input:checked ~ .form-check-label {
  color: var(--text-primary);
}

.plate-search {
  display: flex;
  gap: 12px;
}

.plate-input {
  flex: 1;
  min-width: 0;
  background: var(--text-primary);
  color: var(--surface);
  border: none;
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.plate-input::placeholder { color: rgba(255, 255, 255, 0.5); }
.plate-input:focus { outline: 2px solid var(--primary); outline-offset: 2px; }

.plate-state {
  flex: 0 0 220px;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-opacity='0.6' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  background-size: 14px;
  padding-right: 42px;
}

.plate-state option { color: var(--text-primary); background: var(--surface); }

.plate-search .btn-primary {
  padding: 0 24px;
  font-size: 14.5px;
  white-space: nowrap;
}

@media (max-width: 575.98px) {
  .plate-search { flex-direction: column; }
  .plate-state { flex: 1 1 auto; }
}

/* Status pill */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
}

.status-pill.valid {
  background: var(--primary-light);
  color: var(--primary-dark);
}

.status-pill.expired {
  background: var(--danger-light);
  color: var(--danger);
}

.status-pill.none {
  background: var(--warning-light);
  color: var(--warning);
}

.status-pill .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

.status-meta-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: 8px;
}

/* 3-column responsive grid (collapses to 1 column below 768px) — used by permits, reusable elsewhere */
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

@media (max-width: 767.98px) {
  .grid-3 { grid-template-columns: 1fr; }
}

.permit-chip {
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.permit-chip__title {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.permit-chip__status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
}

.permit-chip__status .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

/* Shared status text colors — not scoped to any one component. Apply to
   anything (a status line, a chip, a badge) that needs to read as
   valid/expired; pair with a `.dot { background: currentColor }` sibling
   rule so the dot picks up the same color for free. */
.text-status-valid { color: var(--primary-dark); }
.text-status-expired { color: var(--danger); }

/* Detail rows */
.detail-list { display: flex; flex-direction: column; gap: 14px; }

.detail-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  font-size: 13.5px;
}

.detail-row .label { color: var(--text-muted); }
.detail-row .value { color: var(--text-primary); font-weight: 600; text-align: right; }

.change-link {
  margin-left: 8px;
  font-weight: 600;
  font-size: 12.5px;
  color: var(--primary);
  text-decoration: underline;
  cursor: pointer;
}

.change-link:hover { color: var(--primary-dark); }


.page-header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.kebab-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  border: none;
  background: var(--text-primary);
  color: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.kebab-btn:hover { background: var(--primary-dark); }

.service-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}

.service-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 18px;
}

.service-card:has(.service-row__input:checked) {
  border-color: var(--primary);
}

.service-row {
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
}

.service-row__input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.service-row__box {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 1.5px solid var(--border-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  color: transparent;
  font-size: 14px;
  flex-shrink: 0;
}

.service-row__input:checked ~ .service-row__box {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--text-on-primary);
}

.service-row__input:focus-visible ~ .service-row__box {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.service-row__label {
  flex: 1;
  font-size: 14.5px;
  color: var(--text-primary);
}

.service-row__input:checked ~ .service-row__label { font-weight: 700; }

.service-row__price {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--text-primary);
  text-decoration-color: var(--text-muted);
  text-decoration-thickness: 1px;
}

.service-row__input:checked ~ .service-row__price { font-weight: 700; }

.service-breakdown {
  margin-top: 12px;
  padding-top: 12px;
  padding-left: 36px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 8px;
  opacity: 0.65;
}

.service-card:has(.service-row__input:checked) .service-breakdown { opacity: 0.85; }

.service-breakdown__row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
  color: var(--text-muted);
}

.service-breakdown__row .service-row__price {
  font-size: 13px;
  font-weight: 500;
  color: inherit;
}

.summary-bar {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.summary-bar__label { font-size: 13px; color: var(--text-secondary); margin-bottom: 4px; }

.summary-bar__total {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  text-decoration-color: var(--text-muted);
  text-decoration-thickness: 1px;
}

.invoice-preview__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.invoice-preview__reg {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.invoice-preview__item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}

.invoice-preview__item:first-child { padding-top: 0; }
.invoice-preview__item:last-child { border-bottom: none; }

.invoice-preview__item-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.invoice-preview__item-ref {
  font-size: 11.5px;
  letter-spacing: 0.02em;
  color: var(--text-muted);
  text-transform: uppercase;
}

.invoice-preview__item-price {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  text-decoration-color: var(--text-muted);
  text-decoration-thickness: 1px;
  white-space: nowrap;
}

.invoice-preview__total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 20px;
}

.invoice-preview__total > span:first-child {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
}

.invoice-preview__total-amount {
  font-size: 22px;
  font-weight: 700;
  color: var(--success);
  text-decoration-thickness: 1px;
}
