/* TruckTrace final overrides loaded after the legacy stylesheet. */

.viewer-marker-card.zone-card {
  position: absolute;
  top: auto;
  right: 18px;
  bottom: 18px;
  z-index: 6;
  width: min(380px, calc(100% - 36px));
  max-height: min(520px, calc(100% - 36px));
  display: grid;
  gap: 9px;
  overflow: auto;
  padding: 14px;
  border: 1px solid color-mix(in srgb, var(--danger) 24%, var(--line));
  border-radius: 14px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  box-shadow: 0 22px 46px rgba(15, 23, 42, 0.18);
  color: var(--text);
  backdrop-filter: blur(16px);
}

.viewer-marker-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 28px;
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-muted);
  color: var(--text);
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
}

.viewer-marker-card.zone-card > span {
  color: var(--danger);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
}

.viewer-marker-card.zone-card h4 {
  margin: 0;
  padding-right: 32px;
  font-size: 16px;
  font-weight: 600;
}

.viewer-marker-card.zone-card p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.zone-parts-title {
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
}

.zone-part-list {
  display: grid;
  gap: 8px;
}

.zone-part-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: color-mix(in srgb, var(--surface-muted) 72%, var(--surface));
}

.zone-part-row div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.zone-part-row strong {
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.zone-part-row span,
.zone-part-row small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 500;
}

.viewer-marker-card.zone-card .marker-add-button {
  min-height: 32px;
  padding: 0 10px;
  white-space: nowrap;
  font-weight: 600;
}

body.dark-theme .viewer-marker-card.zone-card {
  background: color-mix(in srgb, var(--surface) 88%, rgba(15, 23, 42, 0.72));
  box-shadow: 0 22px 46px rgba(0, 0, 0, 0.36);
}

.nav-link[data-view-link="support"]::before {
  background:
    linear-gradient(var(--accent), var(--accent)) 5px 6px / 10px 2px no-repeat,
    linear-gradient(var(--accent), var(--accent)) 5px 11px / 14px 2px no-repeat,
    linear-gradient(var(--accent), var(--accent)) 5px 16px / 8px 2px no-repeat,
    linear-gradient(135deg, var(--accent-soft), transparent);
}

.support-panel {
  display: grid;
  gap: 14px;
  max-width: 900px;
}

.support-hero-card,
.support-chat-panel,
.support-card {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.support-hero-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding: 22px;
}

.support-help-icon,
.support-card-icon {
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-weight: 600;
}

.support-help-icon {
  width: 52px;
  height: 52px;
  font-size: 24px;
}

.support-hero-card h2,
.support-chat-header h2 {
  margin: 2px 0 4px;
  font-size: 24px;
  font-weight: 600;
}

.support-hero-card p {
  margin: 0;
  color: var(--muted);
}

.support-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.support-card {
  display: grid;
  gap: 8px;
  padding: 18px;
}

.support-card-icon {
  width: 34px;
  height: 34px;
}

.support-card small {
  color: var(--muted);
  font-weight: 500;
}

.support-card strong {
  color: var(--text);
  font-size: 15px;
  font-weight: 600;
}

.support-chat-panel {
  overflow: hidden;
}

.support-chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
}

.support-chat-body {
  min-height: 120px;
  padding: 20px;
  background:
    radial-gradient(circle at 20% 10%, color-mix(in srgb, var(--accent-soft) 45%, transparent), transparent 34%),
    color-mix(in srgb, var(--surface) 96%, var(--accent-soft));
}

.support-message {
  width: fit-content;
  max-width: min(560px, 90%);
  border: 1px solid var(--border);
  border-radius: 14px 14px 14px 4px;
  padding: 12px 14px;
  background: var(--surface);
  color: var(--text);
  font-weight: 500;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

.support-chat-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  padding: 16px 20px 20px;
}

.support-chat-form input {
  min-height: 42px;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0 14px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
}

.brand-name,
.summary-value,
.page-header h1,
.fleet-panel-head h2,
.wizard-section-heading h2,
.selected-vehicle-head h2,
.profile-hero h2 {
  font-weight: 700;
}

.nav-link,
.filter-button,
.action-button,
.table-link,
.sidebar-bottom-cta,
.language-menu button,
.template-toggle button,
.status-pill,
.access-badge {
  font-weight: 600;
}

.field-label,
.section-kicker,
.summary-label,
.nav-link small,
.zone-part-row span,
.zone-part-row small {
  font-weight: 500;
  letter-spacing: 0;
}

@media (max-width: 980px) {
  .support-hero-card,
  .support-chat-form {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 640px) {
  .support-grid {
    grid-template-columns: 1fr;
  }
}

/* TruckTrace v13 visual refresh inspired by the fleet dashboard reference. */
:root {
  --bg: #f6f7fb;
  --surface: #ffffff;
  --surface-muted: #f8fafc;
  --text: #182033;
  --muted: #6d778a;
  --line: #e6eaf0;
  --line-strong: #d9e0ea;
  --border: var(--line);
  --accent: #ff7a3d;
  --accent-dark: #e85f24;
  --accent-soft: #fff0e8;
  --red: #ef4444;
  --yellow: #f5b942;
  --green: #22c55e;
  --blue: #3b82f6;
  --sidebar-bg: #171d2f;
  --sidebar-card: #2a3145;
  --sidebar-text: #eef3ff;
  --sidebar-muted: #8f9ab3;
  --shadow: 0 12px 32px rgba(24, 32, 51, 0.07);
  --shadow-soft: 0 8px 22px rgba(24, 32, 51, 0.055);
  --radius: 14px;
}

body.dark-theme {
  --bg: #0f1420;
  --surface: #171d2b;
  --surface-muted: #111827;
  --text: #f4f7fb;
  --muted: #9aa8bd;
  --line: #2a3447;
  --line-strong: #3a465c;
  --border: var(--line);
  --accent: #ff8b52;
  --accent-dark: #ffb087;
  --accent-soft: rgba(255, 122, 61, 0.16);
  --sidebar-bg: #111827;
  --sidebar-card: #222b3d;
  --sidebar-text: #f5f7fb;
  --sidebar-muted: #9ca8bb;
}

body {
  background: var(--bg);
  color: var(--text);
}

.app-shell {
  grid-template-columns: 248px minmax(0, 1fr);
  gap: 0;
  background: var(--bg);
}

.sidebar {
  left: 0;
  top: 0;
  bottom: 0;
  margin: 0;
  height: 100vh;
  padding: 24px 14px 16px;
  gap: 22px;
  border: 0;
  border-radius: 0;
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  box-shadow: 14px 0 34px rgba(20, 27, 45, 0.12);
}

body.dark-theme .sidebar {
  background: var(--sidebar-bg);
}

.brand {
  padding: 0 10px;
}

.brand-mark {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: linear-gradient(135deg, #ffffff, #cbd5e1);
  color: var(--sidebar-bg);
  box-shadow: none;
  font-size: 12px;
  font-weight: 700;
}

.brand-name {
  color: var(--sidebar-text);
  font-size: 17px;
  font-weight: 700;
}

.brand-subtitle {
  color: var(--sidebar-muted);
  font-size: 10px;
}

.nav-list {
  gap: 4px;
}

.nav-section-label {
  display: block;
  margin: 18px 10px 6px;
  color: var(--sidebar-muted);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.nav-section-label:first-child {
  margin-top: 0;
}

.nav-link {
  min-height: 40px;
  border: 0;
  border-radius: 0;
  color: color-mix(in srgb, var(--sidebar-text) 82%, var(--sidebar-muted));
  padding: 10px 12px;
  font-size: 14px;
  font-weight: 500;
}

body.dark-theme .nav-link {
  color: color-mix(in srgb, var(--sidebar-text) 82%, var(--sidebar-muted));
}

.nav-link::before,
.nav-link.disabled::before {
  display: none;
  content: none;
}

.nav-icon {
  width: 30px;
  height: 30px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.1);
}

.nav-icon img {
  width: 18px;
  height: 18px;
  display: block;
  object-fit: contain;
  filter: invert(1);
  opacity: 0.9;
}

.nav-link.active .nav-icon,
.nav-link:hover .nav-icon {
  background: rgba(255, 255, 255, 0.18);
}

.nav-link.disabled .nav-icon {
  opacity: 0.42;
}

.nav-link:hover,
.nav-link.active {
  background: color-mix(in srgb, var(--accent) 22%, transparent);
  color: #fff;
  box-shadow: inset 3px 0 0 var(--accent);
}

.nav-link.disabled {
  color: color-mix(in srgb, var(--sidebar-muted) 80%, transparent);
}

.nav-link small {
  color: var(--sidebar-muted);
  font-weight: 500;
}

.sidebar-support-card {
  display: grid;
  gap: 8px;
  margin: auto 6px 0;
  padding: 14px;
  border-radius: 14px;
  background: var(--sidebar-card);
  color: var(--sidebar-text);
}

.sidebar-support-icon {
  width: 28px;
  height: 28px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
}

.sidebar-support-card strong {
  font-size: 14px;
  font-weight: 600;
}

.sidebar-support-card p {
  margin: 0;
  color: color-mix(in srgb, var(--sidebar-text) 70%, var(--sidebar-muted));
  font-size: 12px;
  line-height: 1.45;
}

.sidebar-support-button {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: #fff;
  color: #182033;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
}

.sidebar-bottom-cta {
  width: calc(100% - 32px);
  margin: auto 16px 16px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 44px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, #2f7f93, #3a9bad);
  color: #fff;
  box-shadow: none;
  text-align: center;
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: 0;
}

.sidebar-bottom-cta-label {
  flex: 0 1 auto;
  min-width: 0;
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: 0;
}

.sidebar-bottom-cta:hover,
.sidebar-bottom-cta.active {
  box-shadow: 0 14px 26px rgba(47, 127, 147, 0.18);
}

.sidebar-bottom-cta-icon {
  flex: 0 0 auto;
  background: rgba(255, 255, 255, 0.22);
}

.main-content {
  padding: 0 28px 28px;
  background: var(--bg);
}

.page-header {
  min-height: 58px;
  margin: 0 -28px 22px;
  padding: 10px 28px;
  align-items: center;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 8px 22px rgba(24, 32, 51, 0.035);
}

.page-header h1 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
}

.eyebrow,
.page-intro {
  display: none;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.header-search {
  min-width: clamp(220px, 28vw, 360px);
  height: 38px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: var(--surface-muted);
  padding: 0 14px;
  color: var(--muted);
}

.header-search input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 13px;
}

.top-controls {
  gap: 10px;
}

.language-toggle,
.theme-toggle,
.user-chip {
  height: 38px;
  min-height: 38px;
  box-shadow: none;
}

.language-toggle,
.theme-toggle {
  border-color: var(--line);
  background: var(--surface-muted);
  font-weight: 600;
}

.user-chip {
  border: 0;
  background: transparent;
  padding: 0;
}

.header-summary {
  display: none;
}

.overview-tools {
  margin-bottom: 18px;
}

.overview-stat-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.overview-stat-card {
  min-height: 112px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 14px;
  background: var(--surface);
  padding: 18px;
  box-shadow: var(--shadow-soft);
}

.overview-stat-card span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}

.overview-stat-card strong {
  display: block;
  margin-top: 6px;
  color: var(--text);
  font-size: 27px;
  font-weight: 700;
  line-height: 1;
}

.overview-stat-card small {
  display: block;
  margin-top: 12px;
  color: var(--green);
  font-size: 12px;
  font-weight: 500;
}

.overview-stat-card i {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent-soft);
}

.overview-stat-card.stat-success {
  border-left-color: var(--green);
}

.overview-stat-card.stat-success i {
  background: color-mix(in srgb, var(--green) 16%, white);
}

.overview-stat-card.stat-warning,
.overview-stat-card.stat-amber {
  border-left-color: var(--yellow);
}

.overview-stat-card.stat-warning i,
.overview-stat-card.stat-amber i {
  background: color-mix(in srgb, var(--yellow) 18%, white);
}

.overview-stat-card.stat-danger {
  border-left-color: var(--red);
}

.overview-stat-card.stat-danger i {
  background: color-mix(in srgb, var(--red) 14%, white);
}

.overview-stat-card.stat-info {
  border-left-color: var(--blue);
}

.overview-stat-card.stat-info i {
  background: color-mix(in srgb, var(--blue) 14%, white);
}

.fleet-list-panel,
.selected-truck-detail,
.wizard-card,
.company-card,
.report-table-wrap,
.simple-panel,
.profile-card,
.support-hero-card,
.support-chat-panel,
.support-card,
.detail-item,
.media-panel,
.process-timeline,
.photo-count {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.fleet-list-panel,
.selected-truck-detail {
  border-radius: 16px;
}

.action-button.primary,
.table-link.marker-add-button,
.support-chat-form .action-button.primary {
  border-color: transparent;
  background: var(--accent);
  color: #fff;
}

.action-button,
.table-link,
.filter-button {
  border-radius: 10px;
  font-weight: 600;
}

.filter-button.active,
.filter-button:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.status-pill.status-completed,
.status-pill.ready {
  color: var(--green);
}

.status-pill.status-in-progress {
  color: var(--yellow);
}

.status-pill.status-not-arrived {
  color: var(--red);
}

.wizard-section-heading h2,
.fleet-panel-head h2,
.selected-vehicle-head h2,
.support-hero-card h2,
.support-chat-header h2,
.profile-hero h2 {
  font-weight: 600;
}

.report-table th,
.field-label,
.section-kicker,
.access-badge,
.status-pill {
  font-weight: 500;
  letter-spacing: 0;
}

@media (max-width: 1280px) {
  .overview-stat-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 1060px) {
  .sidebar {
    margin: 0;
    height: auto;
    border-radius: 0;
  }

  .header-search {
    display: none;
  }
}

@media (max-width: 760px) {
  .overview-stat-grid {
    grid-template-columns: 1fr;
  }
}

.damage-viewer-placeholder .damage-viewer-copy {
  display: none;
}

.damage-viewer-placeholder [data-viewer-status],
.damage-viewer-placeholder [data-viewer-selection],
.viewer-feedback {
  font-weight: 500;
}

.compact-support-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.compact-support-chat .support-chat-header {
  padding-block: 14px;
}

.compact-support-chat .support-chat-header h2 {
  font-size: 18px;
}

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

@media (max-width: 640px) {
  .compact-support-grid {
    grid-template-columns: 1fr;
  }
}

:root {
  color-scheme: light;
}

body.dark-theme {
  color-scheme: dark;
}

body,
.app-shell,
.main-content,
.sidebar,
.page-header,
.topbar,
.fleet-list-panel,
.selected-truck-detail,
.wizard-card,
.company-card,
.report-table-wrap,
.simple-panel,
.profile-card,
.support-card,
.support-chat-panel,
.support-hero-card,
.nav-link,
.language-toggle,
.search-field input,
.header-search,
.header-search input,
.action-button,
.table-link,
.filter-button,
.status-pill {
  transition:
    background-color 220ms ease,
    border-color 220ms ease,
    box-shadow 220ms ease,
    color 220ms ease,
    filter 220ms ease;
}

.theme-toggle {
  width: 74px;
  height: 38px;
  min-height: 38px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  box-shadow: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.theme-toggle:hover {
  border-color: transparent;
}

.theme-toggle-track {
  position: relative;
  width: 70px;
  height: 34px;
  padding: 4px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  border: 1px solid rgba(148, 163, 184, 0.26);
  border-radius: 999px;
  background: #1c2433;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.18);
  overflow: hidden;
  transition:
    background-color 220ms ease,
    border-color 220ms ease,
    box-shadow 220ms ease;
}

.theme-toggle-track::before,
.theme-toggle-track::after {
  display: grid;
  place-items: center;
  width: 100%;
  font-size: 14px;
  line-height: 1;
  z-index: 1;
  transition:
    color 220ms ease,
    opacity 220ms ease,
    transform 220ms ease;
}

.theme-toggle-track::before {
  content: "\2600";
  color: #f59e0b;
}

.theme-toggle-track::after {
  content: "\263E";
  color: #d7edf3;
}

.theme-toggle-thumb {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #ffffff;
  color: #0f172a;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.22);
  transform: translateX(0);
  z-index: 2;
  transition:
    transform 240ms cubic-bezier(0.22, 1, 0.36, 1),
    background-color 220ms ease,
    box-shadow 220ms ease,
    color 220ms ease;
}

.theme-icon {
  grid-area: 1 / 1;
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  font-size: 14px;
  line-height: 1;
  opacity: 0;
  transform: scale(0.72);
  z-index: 3;
  transition:
    opacity 180ms ease,
    transform 220ms ease,
    color 220ms ease;
}

.theme-icon::before {
  content: none;
  display: none;
}

.theme-icon-sun {
  color: #f59e0b;
  opacity: 1;
  transform: scale(1);
}

.theme-icon-moon {
  color: #334155;
}

body.dark-theme .theme-toggle-track {
  border-color: rgba(148, 163, 184, 0.18);
  background: #111827;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.28);
}

body.dark-theme .theme-toggle-thumb {
  transform: translateX(36px);
}

body.dark-theme .theme-icon-sun {
  opacity: 0;
  transform: scale(0.72);
}

body.dark-theme .theme-icon-moon {
  opacity: 1;
  transform: scale(1);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

body.auth-locked {
  min-height: 100vh;
  overflow: hidden;
}

body.auth-locked .app-shell {
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
}

.login-screen[hidden] {
  display: none;
}

.login-screen {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  grid-template-columns: minmax(360px, 0.9fr) minmax(420px, 1.1fr);
  min-height: 100vh;
  background: linear-gradient(135deg, #141b2b 0%, #1d293c 52%, #f7f9fb 52.2%, #eef3f6 100%);
  color: #f8fafc;
}

.login-brand-panel {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(28px, 5vw, 56px);
}

.login-brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
}

.login-copy {
  max-width: 520px;
}

.login-copy h1 {
  margin: 18px 0 12px;
  font-size: clamp(42px, 6vw, 72px);
  line-height: 0.95;
  letter-spacing: 0;
}

.login-copy p {
  margin: 0;
  color: rgba(248, 250, 252, 0.82);
  font-size: 17px;
  line-height: 1.7;
}

.login-card-panel {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 20px;
  padding: clamp(24px, 5vw, 64px);
  color: var(--text);
}

.login-tools {
  position: absolute;
  top: 24px;
  right: 28px;
  z-index: 4;
  width: auto;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
}

.login-language-switch {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.login-language-switch button {
  width: 42px;
  height: 30px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-weight: 700;
}

.login-language-switch button.active {
  background: var(--accent);
  color: #ffffff;
}

.login-language-dropdown {
  position: relative;
}

.login-language-dropdown .language-menu {
  left: auto;
  right: 0;
  top: calc(100% + 8px);
}

.login-theme-button {
  width: 74px;
  height: 38px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.login-card {
  width: min(100%, 440px);
  display: grid;
  gap: 18px;
  padding: 30px;
  border: 1px solid rgba(203, 213, 225, 0.76);
  border-radius: 22px;
  background: color-mix(in srgb, var(--surface) 96%, transparent);
  box-shadow: 0 28px 80px rgba(15, 23, 42, 0.16);
}

.login-card [hidden],
.login-card.is-forgot-mode #loginPasswordField,
.login-card.is-forgot-mode #loginOptions,
.login-card.is-forgot-mode #loginSubmitButton,
.login-card.is-forgot-mode #demoLoginButton,
.login-card:not(.is-forgot-mode) #forgotRequestButton,
.login-card:not(.is-forgot-mode) #forgotBackButton {
  display: none !important;
}

.login-card h2 {
  margin: 12px 0 8px;
  font-size: 30px;
  line-height: 1.08;
}

.login-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.login-field {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.login-field input {
  width: 100%;
  height: 46px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-muted);
  color: var(--text);
  padding: 0 14px;
  font: inherit;
}

.password-input-wrap {
  position: relative;
  display: block;
}

.password-input-wrap input {
  padding-right: 50px;
}

.password-visibility-toggle {
  position: absolute;
  top: 50%;
  right: 8px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--line) 84%, transparent);
  border-radius: 10px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  color: var(--text);
  cursor: pointer;
  transform: translateY(-50%);
}

.password-visibility-toggle:hover,
.password-visibility-toggle[aria-pressed="true"] {
  border-color: color-mix(in srgb, var(--accent) 42%, var(--line));
  background: color-mix(in srgb, var(--accent) 10%, var(--surface));
}

.login-field input:focus {
  border-color: var(--accent);
  outline: 3px solid color-mix(in srgb, var(--accent) 18%, transparent);
}

.login-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  color: var(--muted);
  font-size: 13px;
}

.login-options label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.login-options button {
  border: 0;
  background: transparent;
  color: var(--accent-dark);
  cursor: pointer;
  font: inherit;
  font-weight: 700;
}

.login-error {
  padding: 10px 12px;
  border: 1px solid color-mix(in srgb, var(--red) 26%, var(--line));
  border-radius: 12px;
  background: color-mix(in srgb, var(--red) 10%, var(--surface));
  color: var(--red);
  font-weight: 700;
}

.login-error.success {
  border-color: color-mix(in srgb, var(--green) 28%, var(--line));
  background: color-mix(in srgb, var(--green) 10%, var(--surface));
  color: var(--green);
  font-weight: 500;
}

.login-error.warning {
  font-weight: 500;
}

.login-submit,
.login-demo-button {
  justify-content: center;
  min-height: 46px;
}

.login-card .login-submit {
  border-color: transparent;
  background: #172236;
  color: #ffffff;
  box-shadow: 0 14px 28px rgba(23, 34, 54, 0.18);
}

.login-card .login-submit:hover {
  background: #22304a;
  box-shadow: 0 16px 34px rgba(23, 34, 54, 0.22);
}

.login-card .login-demo-button {
  border: 1px solid rgba(23, 34, 54, 0.24);
  background: #ffffff;
  color: #172236;
}

.login-card .login-demo-button:hover {
  border-color: rgba(23, 34, 54, 0.38);
  background: rgba(23, 34, 54, 0.05);
  color: #172236;
}

body.dark-theme .login-screen {
  background: linear-gradient(135deg, #0f1726 0%, #121b2b 52%, #101820 52.2%, #0f1420 100%);
}

body.dark-theme .login-card {
  border-color: rgba(71, 85, 105, 0.6);
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  box-shadow: 0 28px 84px rgba(0, 0, 0, 0.36);
}

body.dark-theme .login-card .login-demo-button {
  border-color: rgba(226, 232, 240, 0.16);
  background: rgba(255, 255, 255, 0.04);
  color: #e2e8f0;
}

body.dark-theme .login-card .login-demo-button:hover {
  border-color: rgba(226, 232, 240, 0.28);
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.notification-center {
  position: relative;
}

.notification-button {
  position: relative;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: var(--surface-muted);
  color: var(--text);
  box-shadow: none;
  cursor: pointer;
}

.notification-bell-icon {
  display: none;
}

.notification-button.icon-missing img {
  display: none;
}

.notification-button.icon-missing .notification-bell-icon {
  position: relative;
  width: 15px;
  height: 16px;
  display: block;
  border: 2px solid currentColor;
  border-bottom: 0;
  border-radius: 9px 9px 5px 5px;
}

.notification-button.icon-missing .notification-bell-icon::before {
  content: "";
  position: absolute;
  top: -5px;
  left: 50%;
  width: 6px;
  height: 4px;
  border: 2px solid currentColor;
  border-bottom: 0;
  border-radius: 6px 6px 0 0;
  transform: translateX(-50%);
}

.notification-button.icon-missing .notification-bell-icon::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -5px;
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: currentColor;
  transform: translateX(-50%);
}

.notification-button img {
  width: 18px;
  height: 18px;
  display: block;
  object-fit: contain;
  filter: none;
  opacity: 0.86;
}

body.dark-theme .notification-button img {
  filter: invert(1);
  opacity: 0.9;
}

.notification-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  display: inline-grid;
  place-items: center;
  border: 2px solid var(--surface);
  border-radius: 999px;
  background: var(--accent-orange, #ef7c4a);
  color: #ffffff;
  font-size: 10px;
  line-height: 1;
}

.notification-panel {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  z-index: 50;
  width: min(380px, calc(100vw - 32px));
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: 0 22px 60px rgba(15, 23, 42, 0.18);
}

.notification-panel[hidden] {
  display: none;
}

.notification-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.notification-panel-head strong {
  display: block;
  margin-top: 2px;
  color: var(--text);
  font-size: 13px;
}

.notification-list {
  display: grid;
  gap: 8px;
  max-height: 330px;
  overflow: auto;
}

.notification-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-muted);
}

.notification-item.unread {
  border-color: color-mix(in srgb, var(--accent) 30%, var(--line));
  background: color-mix(in srgb, var(--accent) 7%, var(--surface));
}

.notification-icon,
.toast-icon {
  width: 30px;
  height: 30px;
  display: inline-grid;
  place-items: center;
  border-radius: 10px;
  background: color-mix(in srgb, var(--accent) 14%, var(--surface));
  color: var(--accent-dark);
  font-size: 11px;
  font-weight: 600;
}

.notification-item strong {
  display: block;
  color: var(--text);
  font-size: 13px;
}

.notification-item p {
  margin: 3px 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.notification-item small {
  color: var(--muted);
  font-size: 11px;
}

.notification-desktop-button {
  width: 100%;
  min-height: 38px;
  border: 1px dashed color-mix(in srgb, var(--accent) 36%, var(--line));
  border-radius: 12px;
  background: color-mix(in srgb, var(--accent) 7%, var(--surface));
  color: var(--accent-dark);
  cursor: pointer;
  font-weight: 700;
}

.toast-region {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 1200;
  display: grid;
  gap: 10px;
  width: min(380px, calc(100vw - 32px));
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.2);
  animation: toast-in 180ms ease-out;
}

.toast.leaving {
  animation: toast-out 180ms ease-in forwards;
}

.toast strong {
  color: var(--text);
  font-size: 14px;
}

.toast p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.toast button {
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 999px;
  background: var(--surface-muted);
  color: var(--muted);
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
}

.toast-success .toast-icon {
  background: color-mix(in srgb, var(--green) 16%, var(--surface));
  color: var(--green);
}

.toast-warning .toast-icon {
  background: color-mix(in srgb, var(--yellow) 18%, var(--surface));
  color: #b7791f;
}

.profile-actions {
  margin-top: 16px;
  display: flex;
  justify-content: flex-end;
}

.action-button.danger {
  border-color: color-mix(in srgb, var(--red) 26%, var(--line));
  color: var(--red);
  background: color-mix(in srgb, var(--red) 7%, var(--surface));
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
  padding: 0;
}

.avatar-shell {
  position: relative;
  overflow: hidden;
  background: color-mix(in srgb, var(--accent) 12%, var(--surface));
  color: var(--accent);
  box-shadow: none;
}

.avatar-shell img {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: inherit;
  object-fit: cover;
}

.avatar-shell .avatar-initials {
  position: absolute;
  inset: 0;
  display: none;
  place-items: center;
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  text-align: center;
}

.avatar-shell.avatar-missing img {
  display: none;
}

.avatar-shell.avatar-missing .avatar-initials {
  display: grid;
}

.user-chip .avatar-shell {
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  border: 2px solid color-mix(in srgb, var(--surface) 72%, transparent);
}

.profile-panel {
  width: 100%;
  max-width: none;
}

.profile-dashboard {
  display: grid;
  gap: 18px;
  width: 100%;
}

.profile-dashboard .profile-card {
  overflow: visible;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.08);
}

body.dark-theme .profile-dashboard .profile-card {
  background: color-mix(in srgb, var(--surface) 92%, #0f172a);
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.22);
}

.profile-header-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 20px;
}

.profile-avatar {
  width: 72px;
  height: 72px;
  font-size: 16px;
  font-weight: 700;
  background: color-mix(in srgb, var(--accent) 18%, var(--surface));
  color: var(--accent);
  box-shadow: none;
}

.profile-photo-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
}

.profile-photo-preview {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.profile-photo-avatar {
  width: 58px;
  height: 58px;
  flex: 0 0 auto;
}

.profile-photo-preview span:not(.avatar-initials) {
  display: block;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.25;
}

.profile-photo-preview p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.action-button.subtle,
.profile-image-change-button {
  border-color: var(--line);
  background: var(--surface-muted);
  color: var(--text);
  box-shadow: none;
  font-weight: 600;
  text-decoration: none;
}

.action-button.subtle:hover,
.profile-image-change-button:hover {
  background: color-mix(in srgb, var(--accent) 8%, var(--surface));
  color: var(--text);
}

.profile-header-copy {
  min-width: 0;
}

.profile-header-copy h2,
.profile-section-heading h3,
.profile-logout-card h3 {
  margin: 0;
  color: var(--text);
  font-weight: 600;
  letter-spacing: 0;
}

.profile-header-copy h2 {
  font-size: 22px;
  line-height: 1.2;
}

.profile-header-copy p,
.profile-section-heading p,
.profile-logout-card p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
  font-weight: 400;
}

.profile-header-badges,
.profile-license-badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.profile-status-badge,
.profile-license-badges span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  border: 1px solid var(--line);
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
}

.profile-status-badge.success {
  border-color: color-mix(in srgb, var(--green) 28%, var(--line));
  background: color-mix(in srgb, var(--green) 10%, var(--surface));
  color: var(--green);
}

.profile-status-badge.neutral,
.profile-license-badges span {
  background: var(--surface-muted);
  color: var(--text);
}

.profile-section-card {
  padding: 20px;
}

.profile-section-heading {
  display: grid;
  gap: 4px;
  margin-bottom: 16px;
}

.profile-section-heading > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.profile-section-heading h3,
.profile-logout-card h3 {
  font-size: 17px;
  line-height: 1.3;
}

.profile-info-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.profile-detail-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-muted);
  padding: 14px;
}

.profile-detail-card span,
.profile-status-row span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.35;
}

.profile-detail-card strong,
.profile-status-row strong {
  display: block;
  margin-top: 5px;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.profile-layout-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  gap: 18px;
}

.profile-license-status-card {
  background:
    radial-gradient(circle at 100% 0%, color-mix(in srgb, var(--accent) 10%, transparent), transparent 30%),
    var(--surface);
}

.profile-status-list {
  display: grid;
  gap: 10px;
}

.profile-status-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
}

.profile-status-row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.profile-status-row strong {
  margin-top: 0;
  text-align: right;
}

.profile-license-badges {
  justify-content: flex-start;
  margin-top: 16px;
}

.profile-permission-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.profile-permission-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
}

.profile-check-dot {
  width: 9px;
  height: 9px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: var(--green);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--green) 12%, transparent);
}

.profile-logout-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 20px;
}

.profile-logout-button {
  flex: 0 0 auto;
  border-radius: 10px;
  background: transparent;
  color: var(--red);
  box-shadow: none;
}

.profile-logout-button:hover {
  background: color-mix(in srgb, var(--red) 9%, var(--surface));
  transform: translateY(-1px);
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes toast-out {
  to {
    opacity: 0;
    transform: translateY(8px);
  }
}

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

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

@media (max-width: 860px) {
  .login-screen {
    position: fixed;
    grid-template-columns: 1fr;
    overflow: auto;
    background:
      linear-gradient(180deg, #141b2b 0 38%, #eef3f6 38.2% 100%);
  }

  .login-brand-panel {
    min-height: 260px;
    padding-top: 86px;
  }

  .login-card-panel {
    align-content: start;
  }

  .login-tools {
    top: 18px;
    right: 18px;
  }

  .profile-header-card {
    grid-template-columns: 1fr;
    align-items: flex-start;
  }

  .profile-logout-card {
    flex-direction: column;
    align-items: flex-start;
  }

  .profile-photo-card {
    flex-direction: column;
    align-items: flex-start;
  }

  .profile-header-badges {
    justify-content: flex-start;
  }

  .profile-info-grid {
    grid-template-columns: 1fr;
  }

  .profile-status-row {
    grid-template-columns: 1fr;
  }

  .profile-status-row strong {
    text-align: left;
  }
}

/* TruckTrace v22: MVP polish pass for refined demo typography and utility UI. */
.header-actions {
  position: relative;
}

.global-search-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 188px;
  z-index: 35;
  width: min(420px, calc(100vw - 32px));
  max-height: 360px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: 0 18px 46px rgba(15, 23, 42, 0.16);
  padding: 8px;
}

body.dark-theme .global-search-panel {
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.34);
}

.global-search-result {
  width: 100%;
  display: grid;
  gap: 3px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  padding: 10px 12px;
  text-align: left;
  cursor: pointer;
}

.global-search-result:hover {
  background: var(--surface-muted);
}

.global-search-result span {
  color: var(--accent);
  font-size: 11px;
  font-weight: 600;
}

.global-search-result strong {
  font-size: 14px;
  font-weight: 600;
}

.global-search-result small,
.global-search-empty {
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
}

.global-search-empty {
  padding: 12px;
}

.filter-button,
.status-tabs .filter-button,
.report-filter-tabs .filter-button,
.wizard-status-labels span,
.search-field span,
.wizard-field > span,
.field-label,
.table-link,
.action-button,
.notification-desktop-button,
.profile-image-change-button,
.profile-demo-reset-button,
.viewer-marker-card.zone-card > span,
.viewer-marker-card dt,
.marker-card small {
  font-weight: 500;
}

.filter-button,
.status-tabs .filter-button,
.report-filter-tabs .filter-button {
  min-height: 36px;
  padding: 7px 12px;
  border-radius: 10px;
  font-size: 13px;
  letter-spacing: 0;
}

.filter-button.active,
.filter-button:hover {
  font-weight: 600;
}

.search-field span,
.wizard-field > span,
.field-label {
  letter-spacing: 0.03em;
}

.search-field input,
.header-search input,
.wizard-field input,
.wizard-field select,
.wizard-field textarea {
  font-weight: 400;
}

.search-field input::placeholder,
.header-search input::placeholder,
.wizard-field input::placeholder,
.wizard-field textarea::placeholder {
  color: color-mix(in srgb, var(--muted) 72%, transparent);
  font-weight: 400;
}

.overview-stat-card strong,
.profile-detail-card strong,
.profile-status-row strong,
.selected-part-head h3,
.part-card h3,
.viewer-marker-card h4,
.zone-part-row strong {
  font-weight: 600;
}

.wizard-mini-status,
.wizard-step span,
.wizard-table th,
.wizard-message,
.wizard-success-icon,
.empty-state,
.access-badge,
.status-pill {
  font-weight: 600;
}

.sidebar-bottom-cta,
.sidebar-bottom-cta-label {
  font-weight: 500;
}

.profile-photo-card {
  width: min(100%, 640px);
  align-items: center;
  justify-content: space-between;
}

.profile-demo-card {
  border-style: dashed;
}

.profile-demo-reset-button {
  min-height: 40px;
}

.empty-state,
.compact-empty,
.global-search-empty {
  border-radius: 12px;
  background: var(--surface-muted);
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.45;
}

.viewer-marker-card.zone-card .marker-add-button {
  font-weight: 500;
}

.profile-overview-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 380px);
  align-items: center;
  gap: 16px;
  padding: 16px 18px;
}

.profile-account-compact,
.profile-photo-compact {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 12px;
}

.profile-overview-card .profile-avatar {
  width: 64px;
  height: 64px;
  flex: 0 0 64px;
  font-size: 17px;
}

.profile-overview-card .profile-photo-avatar {
  width: 52px;
  height: 52px;
  flex: 0 0 52px;
  font-size: 14px;
}

.profile-photo-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
  flex: 1 1 auto;
}

.profile-photo-copy strong {
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
}

.profile-photo-copy span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.35;
}

.profile-overview-card .profile-header-copy h2 {
  font-size: 20px;
}

.profile-overview-card .profile-header-badges {
  margin-top: 8px;
}

.profile-image-change-button {
  min-height: 34px;
  padding: 0 12px;
  border-radius: 9px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}

.notification-item {
  width: 100%;
  text-align: left;
  cursor: pointer;
  font: inherit;
}

.notification-item:hover {
  border-color: color-mix(in srgb, var(--accent) 28%, var(--line));
  background: color-mix(in srgb, var(--accent) 6%, var(--surface));
}

.notification-item em {
  display: inline-flex;
  margin-top: 4px;
  color: var(--accent);
  font-size: 11px;
  font-style: normal;
  font-weight: 500;
}

.marker-part-added {
  opacity: 0.62;
  background: color-mix(in srgb, var(--surface-muted) 80%, var(--surface));
}

.marker-part-added .marker-add-button,
.marker-add-button:disabled,
.part-card .table-link:disabled {
  cursor: not-allowed;
  border-color: var(--line);
  background: var(--surface-muted);
  color: var(--muted);
  box-shadow: none;
}

.part-card .table-link,
.viewer-marker-card.zone-card .marker-add-button,
.report-table .table-link,
.wizard-actions .action-button,
.support-chat-form .action-button {
  min-height: 32px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 500;
}

.target-highlight {
  animation: targetHighlightPulse 1.8s ease;
}

@keyframes targetHighlightPulse {
  0%,
  100% {
    box-shadow: none;
  }
  18%,
  70% {
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent);
  }
}

@media (max-width: 860px) {
  .profile-overview-card {
    grid-template-columns: 1fr;
    align-items: flex-start;
  }

  .profile-photo-compact {
    flex-wrap: wrap;
  }

  .global-search-panel {
    left: 0;
    right: auto;
    width: min(100%, calc(100vw - 32px));
  }
}

/* MVP cleanup pass: lighter SaaS typography and tighter utility surfaces. */
.notification-panel {
  width: min(344px, calc(100vw - 28px));
  padding: 14px;
  border-radius: 16px;
}

.notification-panel-head {
  align-items: center;
  gap: 10px;
}

.notification-panel-head strong {
  font-size: 13px;
  font-weight: 600;
}

.notification-panel-head small,
.notification-item p,
.notification-item small {
  font-weight: 400;
}

.notification-list {
  gap: 7px;
  max-height: 430px;
}

.notification-item {
  gap: 9px;
  padding: 10px;
  border-radius: 12px;
  min-height: auto;
}

.notification-icon {
  width: 28px;
  height: 28px;
  border-radius: 9px;
  font-weight: 500;
}

.notification-item strong {
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.25;
}

.notification-item p {
  margin: 2px 0;
  font-size: 11.5px;
  line-height: 1.35;
}

.notification-item small,
.notification-item em {
  font-size: 10.5px;
}

.notification-desktop-button {
  min-height: 34px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 500;
}

.vehicle-summary {
  gap: 12px;
  padding: 14px 16px;
}

.vehicle-summary small,
.company-summary small,
.company-table-head,
.company-info-grid small,
.company-stat-row small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
}

.vehicle-summary strong,
.company-summary strong,
.company-info-grid strong,
.company-stat-row strong,
.company-truck-row strong,
.company-truck-row b {
  color: var(--text);
  font-weight: 600;
  line-height: 1.3;
}

.vehicle-summary .plate,
.company-summary > span:first-of-type strong {
  font-weight: 600;
}

.vehicle-details,
.company-details {
  padding: 14px 16px;
}

.company-summary {
  grid-template-columns: auto minmax(210px, 1.5fr) repeat(3, minmax(118px, 0.75fr)) auto;
  gap: 12px;
  padding: 15px 16px;
}

.company-summary > span {
  min-width: 0;
  align-content: center;
}

.company-summary > span:last-of-type {
  justify-self: start;
}

.company-status,
.table-status,
.status-pill,
.access-badge {
  font-weight: 500;
  letter-spacing: 0;
}

.company-table-head,
.company-truck-row {
  gap: 10px;
  padding: 10px 12px;
}

.company-table-head {
  font-weight: 500;
}

.company-truck-row {
  font-size: 12.5px;
}

.profile-overview-card {
  padding: 14px 16px;
}

.profile-section-card {
  padding: 16px;
}

.profile-detail-card,
.profile-status-row {
  padding: 10px;
}

.profile-detail-card strong,
.profile-status-row strong,
.profile-permission-list li {
  font-weight: 500;
}

.profile-header-copy h2,
.profile-section-heading h3,
.support-chat-header h2 {
  font-weight: 600;
}

.profile-image-change-button,
.profile-logout-button,
.profile-demo-reset-button {
  min-height: 34px;
  padding: 0 12px;
  font-weight: 500;
}

.compact-support-grid {
  gap: 12px;
}

.compact-support-grid .support-card {
  gap: 6px;
  padding: 14px;
}

.support-card small {
  font-size: 11.5px;
  font-weight: 500;
}

.support-card strong {
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.3;
}

.compact-support-chat {
  min-height: 430px;
  display: grid;
  grid-template-rows: auto minmax(280px, 1fr) auto;
}

.compact-support-chat .support-chat-header {
  padding: 14px 16px;
}

.compact-support-chat .support-chat-header h2 {
  margin: 0;
  font-size: 17px;
}

.support-chat-body {
  min-height: 280px;
  padding: 16px;
}

.support-message {
  max-width: min(440px, 86%);
  padding: 10px 12px;
  font-size: 0.9rem;
  font-weight: 400;
  line-height: 1.45;
}

.support-chat-form {
  gap: 10px;
  padding: 12px 16px 16px;
}

.support-chat-form input {
  min-height: 38px;
  border-radius: 10px;
  font-size: 13px;
}

.wizard-card.parts-card,
.selected-damages-panel {
  padding: 16px;
}

.parts-list,
.selected-parts-list {
  gap: 9px;
}

.part-card,
.selected-part-card {
  padding: 10px;
}

.part-card h3,
.selected-part-head h3 {
  font-weight: 600;
}

.filter-button,
.status-tabs .filter-button,
.report-filter-tabs .filter-button,
.template-toggle button,
.action-button,
.table-link,
.sidebar-bottom-cta,
.wizard-field > span,
.search-field span {
  font-weight: 500;
}

.filter-button.active,
.status-tabs .filter-button.active,
.report-filter-tabs .filter-button.active {
  font-weight: 600;
}

.header-search-wrap {
  position: relative;
  width: clamp(220px, 28vw, 360px);
  flex: 0 1 clamp(220px, 28vw, 360px);
}

.header-search-wrap .header-search {
  width: 100%;
  min-width: 0;
}

.header-search-wrap .global-search-panel {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: auto;
  width: 100%;
  min-width: 0;
  transform: none;
}

.notification-item.unread {
  opacity: 1;
  border-color: color-mix(in srgb, var(--accent) 34%, var(--line));
  background: color-mix(in srgb, var(--accent) 10%, var(--surface));
}

.notification-item.read {
  opacity: 0.72;
  border-color: color-mix(in srgb, var(--line) 86%, transparent);
  background: color-mix(in srgb, var(--surface-muted) 82%, var(--surface));
}

body.dark-theme .notification-item.unread {
  background: color-mix(in srgb, var(--accent) 14%, var(--surface));
  border-color: color-mix(in srgb, var(--accent) 42%, var(--line));
}

body.dark-theme .notification-item.read {
  opacity: 0.68;
  background: color-mix(in srgb, var(--surface-muted) 58%, rgba(15, 23, 42, 0.55));
}

.profile-overview-card {
  grid-template-columns: minmax(0, 1fr);
}

.profile-avatar-button {
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  cursor: pointer;
}

.profile-avatar-button:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 28%, transparent);
  outline-offset: 3px;
}

.profile-logout-card {
  min-height: auto;
  padding: 14px 16px;
}

.profile-logout-card h3 {
  font-size: 1rem;
  font-weight: 600;
}

.profile-logout-card p {
  margin-top: 3px;
  font-size: 0.9rem;
  font-weight: 400;
  line-height: 1.4;
}

.profile-avatar-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1300;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.42);
  backdrop-filter: blur(8px);
}

.profile-avatar-modal {
  position: relative;
  width: min(360px, 100%);
  display: grid;
  justify-items: center;
  gap: 14px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: 0 28px 70px rgba(15, 23, 42, 0.24);
}

.profile-avatar-modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-muted);
  color: var(--muted);
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
}

.profile-avatar-modal-preview .profile-avatar-modal-image {
  width: 118px;
  height: 118px;
  font-size: 28px;
}

.profile-avatar-modal-copy {
  text-align: center;
}

.profile-avatar-modal-copy h3 {
  margin: 0;
  color: var(--text);
  font-size: 1rem;
  font-weight: 600;
}

.profile-avatar-modal-copy p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 400;
}

.compact-support-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

@media (max-width: 980px) {
  .header-search-wrap {
    width: clamp(220px, 36vw, 340px);
    flex-basis: clamp(220px, 36vw, 340px);
  }

  .header-search-wrap .header-search {
    display: flex;
  }
}

@media (max-width: 860px) {
  .header-search-wrap {
    width: min(100%, 320px);
    flex-basis: min(100%, 320px);
  }

  .header-search-wrap .header-search {
    display: flex;
  }
}

@media (max-width: 760px) {
  .header-search-wrap {
    display: none;
  }

  .compact-support-grid {
    grid-template-columns: 1fr;
  }
}

/* Profile spacing cleanup: keep the page functional, but remove the tall bar feeling. */
.profile-dashboard {
  gap: 14px;
}

.profile-dashboard .profile-card {
  margin-bottom: 0;
}

.profile-overview-card {
  min-height: auto;
  padding: 12px 16px;
}

.profile-account-compact {
  gap: 11px;
  align-items: center;
}

.profile-overview-card .profile-avatar {
  width: 56px;
  height: 56px;
  flex: 0 0 56px;
  font-size: 15px;
}

.profile-overview-card .profile-header-copy h2 {
  margin: 0 0 3px;
  font-size: 1.18rem;
  line-height: 1.18;
  font-weight: 600;
}

.profile-overview-card .profile-header-copy p {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.3;
}

.profile-overview-card .profile-header-badges {
  margin-top: 6px;
  gap: 6px;
}

.profile-overview-card .profile-status-badge {
  min-height: 22px;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 500;
}

.profile-section-card {
  padding: 14px 16px;
}

.profile-layout-grid {
  gap: 14px;
}

.profile-logout-card,
.profile-demo-card {
  min-height: auto;
  padding: 12px 16px;
  gap: 14px;
}

.profile-logout-card h3,
.profile-demo-card h3 {
  margin: 0 0 3px;
  font-size: 0.98rem;
  line-height: 1.2;
  font-weight: 600;
}

.profile-logout-card p,
.profile-demo-card p {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.32;
  font-weight: 400;
}

.profile-logout-button,
.profile-demo-reset-button {
  min-height: 34px;
  padding: 7px 13px;
  font-size: 12px;
  font-weight: 500;
}

@media (max-width: 760px) {
  .profile-logout-card,
  .profile-demo-card {
    align-items: flex-start;
    padding: 12px 14px;
  }
}

/* Shared compact list/table system */
:root {
  --list-label-size: 11px;
  --list-label-weight: 500;
  --list-value-size: 14px;
  --list-value-weight: 400;
  --list-emphasis-weight: 500;
  --list-strong-weight: 600;
  --list-row-padding-y: 10px;
  --list-row-padding-x: 16px;
  --list-row-radius: 12px;
  --list-column-gap: 20px;
  --list-badge-size: 12px;
  --list-button-size: 13px;
}

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

.report-table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
  table-layout: auto;
}

.report-table th,
.report-table td {
  display: table-cell;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

.report-table th,
.company-summary small,
.vehicle-summary small,
.company-table-head,
.company-info-grid small,
.company-stat-row small {
  color: var(--muted);
  font-size: var(--list-label-size);
  font-weight: var(--list-label-weight);
  letter-spacing: 0.02em;
  line-height: 1.2;
  text-transform: uppercase;
}

.report-table td,
.company-summary strong,
.vehicle-summary strong,
.company-truck-row,
.company-info-grid strong,
.company-stat-row strong {
  font-size: var(--list-value-size);
  font-weight: var(--list-value-weight);
  line-height: 1.35;
  color: var(--text);
}

.report-table td:first-child,
.company-main strong,
.vehicle-summary .plate,
.company-truck-row strong,
.company-truck-row b {
  font-weight: var(--list-emphasis-weight);
}

.company-card,
.vehicle-card {
  border-radius: var(--list-row-radius);
}

.company-list,
.vehicle-list {
  gap: 10px;
}

.company-summary {
  display: grid;
  grid-template-columns:
    minmax(260px, 1.5fr)
    minmax(150px, 0.8fr)
    minmax(150px, 0.8fr)
    minmax(190px, 1fr)
    90px;
  column-gap: 24px;
  align-items: center;
  min-height: auto;
  padding: var(--list-row-padding-y) var(--list-row-padding-x);
}

.company-summary > *,
.vehicle-summary > * {
  min-width: 0;
}

.company-identity {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.company-main,
.company-metric,
.company-contact,
.vehicle-registry-meta {
  display: grid;
  gap: 2px;
  align-content: center;
}

.company-contact {
  justify-self: start;
}

.company-summary .company-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  justify-self: end;
}

.company-main strong {
  font-size: var(--list-value-size);
  font-weight: var(--list-strong-weight);
  line-height: 1.25;
}

.company-main small {
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  line-height: 1.3;
}

.vehicle-summary {
  display: grid;
  grid-template-columns:
    minmax(90px, 0.45fr)
    minmax(220px, 1.2fr)
    minmax(220px, 1.2fr)
    minmax(180px, 1fr)
    minmax(180px, 1fr)
    auto;
  column-gap: var(--list-column-gap);
  align-items: center;
  min-height: auto;
  padding: var(--list-row-padding-y) var(--list-row-padding-x);
}

.vehicle-summary .plate {
  min-height: 25px;
  padding: 3px 8px;
  font-size: var(--list-value-size);
  font-weight: var(--list-emphasis-weight);
}

.access-badge,
.company-status,
.table-status,
.status-pill,
.photo-count {
  min-height: auto;
  padding: 5px 9px;
  font-size: var(--list-badge-size);
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0;
  white-space: nowrap;
}

.table-link,
.report-table .table-link,
.company-truck-row .table-link {
  min-height: 32px;
  padding: 7px 12px;
  border-radius: 8px;
  font-size: var(--list-button-size);
  font-weight: 500;
  line-height: 1.1;
}

.filter-button,
.report-filter-tabs .filter-button,
.status-tabs .filter-button {
  min-height: 32px;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: var(--list-button-size);
  font-weight: 500;
  line-height: 1.1;
}

.report-table td:not(:first-child),
.company-metric strong,
.company-contact strong,
.vehicle-registry-meta strong {
  font-weight: var(--list-value-weight);
}

.report-table td:first-child strong,
.company-main strong {
  font-weight: var(--list-strong-weight);
}

/* Dense fleet registry rows */
#view-trucks .simple-panel {
  padding: 16px 18px;
}

.vehicle-registry-head {
  margin-bottom: 10px;
}

.vehicle-registry-head h2 {
  margin-bottom: 3px;
}

.vehicle-registry-head p {
  font-size: 13px;
  line-height: 1.35;
}

.vehicle-list {
  gap: 7px;
  max-height: calc(100vh - 260px);
  overflow-y: auto;
  padding-right: 2px;
}

.vehicle-card {
  border-radius: 10px;
  box-shadow: none;
}

.vehicle-card:not(.expanded) {
  overflow: visible;
}

.vehicle-summary {
  grid-template-columns:
    minmax(92px, 0.45fr)
    minmax(180px, 1.2fr)
    minmax(170px, 1fr)
    minmax(145px, 0.8fr)
    minmax(150px, 0.85fr)
    24px;
  column-gap: 16px;
  min-height: 46px;
  padding: 7px 14px;
}

.vehicle-summary > span:not(.plate):not(.company-chevron),
.vehicle-registry-meta {
  gap: 1px;
  overflow: hidden;
}

.vehicle-summary small,
.vehicle-registry-meta small {
  font-size: 10.5px;
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--muted);
}

.vehicle-summary strong,
.vehicle-registry-meta strong {
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.vehicle-summary .plate.compact {
  min-height: 23px;
  width: fit-content;
  padding: 3px 7px;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.15;
}

.vehicle-summary .company-chevron {
  justify-self: end;
  width: 22px;
  height: 22px;
}

.vehicle-details {
  padding: 12px 14px;
}

@media (max-width: 1060px) {
  .company-summary {
    grid-template-columns:
      minmax(190px, 1.4fr)
      minmax(110px, 0.75fr)
      minmax(110px, 0.75fr)
      minmax(150px, 1fr)
      90px;
    column-gap: 14px;
  }

  .vehicle-summary {
    grid-template-columns: minmax(86px, 0.55fr) repeat(4, minmax(0, 1fr)) auto;
    column-gap: 12px;
  }
}

@media (max-width: 760px) {
  .company-summary,
  .vehicle-summary {
    grid-template-columns: 1fr auto;
    gap: 9px 12px;
    padding: 11px 14px;
  }

  .company-identity,
  .vehicle-summary .plate {
    grid-column: 1;
    grid-row: 1;
  }

  .company-vehicles,
  .company-cases,
  .company-contact,
  .company-summary .company-status,
  .vehicle-registry-meta {
    grid-column: 1 / -1;
  }

  .company-summary .company-status {
    justify-self: start;
  }

  .vehicle-summary .company-chevron {
    grid-column: 2;
    grid-row: 1;
  }
}

/* Mirror report-table typography across secondary sections */
.profile-detail-card span,
.profile-status-row span,
.profile-permission-list li,
.support-card small,
.support-chat-header small,
.notification-panel-head small,
.notification-item small,
.viewer-marker-card dt,
.viewer-marker-card.zone-card > span,
.marker-card small {
  color: var(--muted);
  font-size: var(--list-label-size);
  font-weight: var(--list-label-weight);
  letter-spacing: 0.02em;
  line-height: 1.18;
}

.profile-detail-card span,
.profile-status-row span,
.support-card small,
.viewer-marker-card dt,
.viewer-marker-card.zone-card > span,
.marker-card small {
  text-transform: uppercase;
}

.profile-detail-card strong,
.profile-status-row strong,
.profile-permission-list li,
.support-card strong,
.support-message,
.notification-item p,
.viewer-marker-card dd,
.viewer-marker-card.zone-card p {
  font-size: var(--list-value-size);
  font-weight: var(--list-value-weight);
  line-height: 1.35;
}

.profile-section-card h3,
.profile-logout-card h3,
.profile-demo-card h3,
.support-card strong,
.support-chat-header h2,
.notification-item strong,
.viewer-marker-card h4,
.viewer-marker-card.zone-card h4 {
  font-weight: var(--list-strong-weight);
}

.profile-detail-card,
.profile-status-row,
.support-card,
.notification-item {
  border-color: var(--line);
  border-radius: var(--list-row-radius);
}

.profile-detail-card,
.profile-status-row {
  padding: var(--list-row-padding-y) 12px;
}

.support-card {
  gap: 7px;
  padding: 14px 16px;
}

.support-card strong {
  font-size: 0.9rem;
}

.support-card small {
  font-size: var(--list-label-size);
}

.support-chat-header {
  padding: 14px 16px;
}

.support-chat-header h2 {
  font-size: 1rem;
}

.support-chat-body {
  padding: 16px;
}

.support-message {
  padding: 10px 12px;
  font-weight: 400;
}

.support-chat-form {
  padding: 12px 16px 16px;
}

.support-chat-form input {
  min-height: 38px;
  border-radius: 10px;
  font-size: 0.85rem;
}

.notification-list {
  gap: 7px;
}

.notification-item {
  gap: 10px;
  padding: 10px;
}

.notification-item strong {
  font-size: 0.86rem;
  line-height: 1.25;
}

.notification-item p {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 400;
}

.notification-item small {
  font-size: 0.7rem;
}

.notification-item.read {
  opacity: 0.72;
}

.notification-item.unread strong {
  font-weight: var(--list-strong-weight);
}

.viewer-marker-card,
.viewer-marker-card.zone-card {
  border-radius: var(--list-row-radius);
}

.viewer-marker-card h4,
.viewer-marker-card.zone-card h4 {
  font-size: 0.95rem;
}

.viewer-marker-card dd {
  text-align: right;
}

.action-button,
.table-link,
.filter-button,
.notification-desktop-button,
.profile-image-change-button,
.profile-logout-button,
.profile-demo-reset-button,
.support-chat-form .action-button,
.viewer-marker-card .marker-add-button,
.viewer-marker-card.zone-card .marker-add-button,
.sidebar-support-button,
.sidebar-bottom-cta {
  font-weight: 500;
  letter-spacing: 0;
}

.filter-button.active,
.report-filter-tabs .filter-button.active,
.status-tabs .filter-button.active {
  font-weight: 500;
}

.notification-badge,
.profile-status-badge,
.wizard-mini-status,
.template-toggle button {
  font-weight: 500;
}

.sidebar-bottom-cta-label {
  font-weight: 500;
}
/* Vehicle status filtering and manual vehicle creation */
.overview-stat-card {
  position: relative;
  width: 100%;
  border: 1px solid var(--line);
  text-align: left;
  cursor: pointer;
  appearance: none;
}

.overview-stat-card:hover,
.overview-stat-card.active {
  border-color: color-mix(in srgb, var(--accent) 58%, var(--line));
  background: color-mix(in srgb, var(--accent-soft) 70%, var(--surface));
  box-shadow: 0 14px 34px rgba(16, 24, 40, 0.09);
}

.overview-stat-card:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 35%, transparent);
  outline-offset: 3px;
}

.overview-stat-card.active::after {
  content: "\2713";
  position: absolute;
  top: 10px;
  right: 12px;
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}

.vehicle-filter-grid {
  grid-template-columns: repeat(5, minmax(130px, 1fr));
  gap: 10px;
  margin: 0 0 12px;
}

.vehicle-filter-card {
  min-height: 78px;
  padding: 12px 14px;
}

.vehicle-filter-card strong {
  font-size: 22px;
}

.vehicle-registry-controls {
  display: flex;
  align-items: end;
  gap: 12px;
  margin-bottom: 12px;
}

.vehicle-registry-controls .registry-search-field {
  flex: 1 1 420px;
}

.vehicle-add-button {
  flex: 0 0 auto;
  min-height: 38px;
  white-space: nowrap;
}

.status-registered,
.status-waiting-parts {
  color: var(--text);
  background: color-mix(in srgb, var(--yellow) 15%, var(--surface));
  border-color: color-mix(in srgb, var(--yellow) 35%, var(--line));
}

.vehicle-dialog-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1500;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.44);
}

.vehicle-dialog {
  width: min(760px, 100%);
  max-height: min(86dvh, 760px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.26);
}

.vehicle-dialog-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px 12px;
  border-bottom: 1px solid var(--line);
}

.vehicle-dialog-header h2 {
  margin: 6px 0 0;
  font-size: 20px;
  font-weight: 650;
}

.vehicle-dialog-header p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.vehicle-dialog-form {
  padding: 16px 20px 18px;
}

.vehicle-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.vehicle-form-field {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.vehicle-form-field input,
.vehicle-form-field select,
.vehicle-form-field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  padding: 9px 11px;
  font: inherit;
  font-size: 14px;
}

.vehicle-form-field-wide {
  grid-column: 1 / -1;
}

.vehicle-form-error {
  margin-bottom: 12px;
  border: 1px solid color-mix(in srgb, var(--red) 35%, var(--line));
  border-radius: 10px;
  background: color-mix(in srgb, var(--red) 8%, var(--surface));
  color: var(--red);
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 600;
}

.vehicle-image-preview {
  min-height: 76px;
  display: grid;
  place-items: center;
  border: 1px dashed var(--line);
  border-radius: 12px;
  background: var(--bg);
  color: var(--muted);
  overflow: hidden;
}

.vehicle-image-preview img {
  width: 100%;
  max-height: 150px;
  object-fit: contain;
  display: block;
}

.vehicle-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
}

.expert-request-dialog {
  width: min(820px, 100%);
}

.expert-request-summary {
  display: grid;
  gap: 4px;
  margin-top: 14px;
  border: 1px solid color-mix(in srgb, var(--accent) 24%, var(--line));
  border-radius: 12px;
  background: color-mix(in srgb, var(--accent) 8%, var(--surface));
  padding: 11px 12px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.expert-request-summary strong {
  color: var(--text);
  font-size: 13px;
}

.scheduling-panel {
  display: grid;
  gap: 18px;
}

.scheduling-dashboard {
  display: grid;
  gap: 18px;
}

.scheduling-capacity-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(120px, 1fr));
  gap: 10px;
}

.scheduling-day-card {
  display: grid;
  gap: 5px;
  min-height: 92px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  color: var(--text);
  padding: 12px;
  text-align: left;
  cursor: pointer;
}

.scheduling-day-card strong {
  font-size: 24px;
  line-height: 1;
}

.scheduling-day-card span,
.scheduling-day-card small {
  color: var(--muted);
  font-size: 12px;
}

.scheduling-day-card:hover,
.scheduling-day-card.active {
  border-color: color-mix(in srgb, var(--accent) 46%, var(--line));
  background: color-mix(in srgb, var(--accent) 8%, var(--surface));
}

.scheduling-workbench {
  display: grid;
  grid-template-columns: minmax(360px, 0.95fr) minmax(380px, 1.05fr);
  gap: 18px;
  align-items: start;
}

.scheduling-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  padding: 16px;
}

.scheduling-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.scheduling-card-head h2 {
  margin: 4px 0 0;
  font-size: 18px;
  line-height: 1.2;
}

.scheduling-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.scheduling-form .action-button {
  justify-self: start;
}

.scheduling-booking-list,
.scheduling-booking-grid {
  display: grid;
  gap: 10px;
}

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

.service-booking-card {
  display: grid;
  gap: 9px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--yellow);
  border-radius: 12px;
  background: var(--surface-muted);
  padding: 12px;
}

.service-booking-card.confirmed {
  border-left-color: var(--green);
}

.service-booking-card.rejected {
  border-left-color: var(--red);
  opacity: 0.72;
}

.service-booking-card > div:first-child,
.service-booking-card > div:nth-child(2) {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.service-booking-card span,
.service-booking-card small,
.service-booking-card p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.service-booking-card p {
  margin: 0;
}

.service-booking-time {
  font-weight: 650;
  color: var(--text) !important;
}

.service-booking-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.service-booking-actions .action-button {
  min-height: 32px;
  padding: 6px 10px;
  font-size: 12px;
}

.scheduling-calendar {
  margin-top: 16px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.scheduling-calendar-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.scheduling-calendar-head h3 {
  margin: 3px 0 0;
  font-size: 15px;
  line-height: 1.2;
}

.scheduling-calendar-head small {
  color: var(--muted);
  font-size: 12px;
}

.scheduling-calendar-controls {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}

.scheduling-calendar-controls button {
  min-width: 32px;
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  font-weight: 700;
}

.scheduling-calendar-controls button:hover {
  border-color: color-mix(in srgb, var(--accent) 42%, var(--line));
  background: color-mix(in srgb, var(--accent) 8%, var(--surface));
}

.scheduling-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(96px, 1fr));
  gap: 8px;
}

.scheduling-calendar-day {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-muted);
  padding: 0;
  overflow: hidden;
}

.scheduling-calendar-day.active {
  border-color: color-mix(in srgb, var(--accent) 44%, var(--line));
  background: color-mix(in srgb, var(--accent) 7%, var(--surface));
}

.scheduling-calendar-day > button {
  width: 100%;
  min-height: 58px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: start;
  gap: 8px;
  border: 0;
  background: transparent;
  color: var(--text);
  padding: 8px;
  cursor: pointer;
  text-align: left;
}

.scheduling-calendar-day > button strong {
  font-size: 11px;
}

.scheduling-calendar-day > button span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.scheduling-calendar-day > button small {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 11px;
}

.daily-slot-plan {
  display: grid;
  gap: 8px;
}

.daily-slot-row {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 10px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--green);
  border-radius: 12px;
  background: var(--surface-muted);
  padding: 10px;
}

.daily-slot-row.partial {
  border-left-color: var(--yellow);
}

.daily-slot-row.full {
  border-left-color: var(--red);
}

.daily-slot-meta {
  display: grid;
  gap: 4px;
  align-content: start;
}

.daily-slot-meta strong {
  font-size: 16px;
}

.daily-slot-meta span {
  width: fit-content;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 10%, var(--surface));
  color: var(--accent-dark);
  padding: 3px 8px;
  font-size: 12px;
  font-weight: 700;
}

.daily-slot-bookings {
  display: grid;
  gap: 8px;
}

.compact-empty {
  min-height: 42px;
  padding: 12px;
}

@media (max-width: 1500px) {
  .scheduling-calendar-grid {
    grid-template-columns: repeat(4, minmax(100px, 1fr));
  }
}

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

  .daily-slot-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  .scheduling-calendar-grid {
    grid-template-columns: 1fr;
  }
}

.wizard-inline-action {
  align-self: end;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 8px 10px;
  color: var(--muted);
  font-size: 13px;
}

.wizard-inline-action .action-button {
  min-height: 32px;
  padding: 6px 10px;
}

body.dark-theme .overview-stat-card:hover,
body.dark-theme .overview-stat-card.active {
  background: color-mix(in srgb, var(--accent) 12%, var(--surface));
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.28);
}

@media (max-width: 1180px) {
  .vehicle-filter-grid {
    grid-template-columns: repeat(3, minmax(140px, 1fr));
  }
}

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

  .vehicle-registry-controls {
    display: grid;
  }

  .vehicle-add-button {
    width: 100%;
  }

  .vehicle-dialog-backdrop {
    padding: 12px;
  }

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

  .wizard-inline-action {
    align-items: stretch;
    flex-direction: column;
  }
}
.damage-owner-badge {
  display: inline-grid;
  min-width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 999px;
  padding: 0 6px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  vertical-align: middle;
}

.damage-owner-badge.is-own {
  border: 1px solid rgba(45, 127, 145, 0.28);
  background: rgba(45, 127, 145, 0.12);
  color: #1f6f82;
}

.damage-owner-badge.is-third-party {
  border: 1px solid rgba(180, 126, 42, 0.28);
  background: rgba(180, 126, 42, 0.13);
  color: #8a5a16;
}

.damage-overview-strip {
  margin: 18px 0 20px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  padding: 16px;
}

.damage-overview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.damage-overview-head h2 {
  margin: 4px 0 0;
  font-size: 18px;
  line-height: 1.2;
}

.damage-overview-list {
  display: grid;
  gap: 8px;
  overflow-x: auto;
}

.damage-overview-row {
  display: grid;
  grid-template-columns: minmax(122px, 0.8fr) auto minmax(150px, 1fr) minmax(220px, 1.5fr) minmax(170px, 1.1fr) minmax(132px, 0.9fr) minmax(130px, 0.9fr) minmax(180px, 1.2fr);
  align-items: center;
  gap: 12px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface) 92%, var(--accent) 8%);
  color: var(--text);
  padding: 10px 12px;
  text-align: left;
  cursor: pointer;
}

.damage-overview-row:hover {
  border-color: color-mix(in srgb, var(--accent) 42%, var(--line));
  background: color-mix(in srgb, var(--surface) 86%, var(--accent) 14%);
}

.damage-overview-id {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
}

.damage-overview-row small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
}

.damage-overview-row strong {
  display: block;
  font-size: 13px;
  line-height: 1.25;
}

.damage-case-detail {
  display: grid;
  gap: 18px;
}

.damage-case-detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.damage-case-detail-head h2 {
  margin: 6px 0 4px;
  font-size: 22px;
}

.damage-case-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.damage-timeline-panel {
  display: grid;
  gap: 10px;
}

.damage-timeline-list {
  display: grid;
  gap: 10px;
}

.damage-timeline-item {
  display: grid;
  grid-template-columns: 12px 1fr;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface) 94%, var(--accent) 6%);
  padding: 10px 12px;
}

.damage-timeline-item > span {
  width: 10px;
  height: 10px;
  margin-top: 5px;
  border-radius: 50%;
  background: var(--accent);
}

.damage-timeline-item strong,
.damage-timeline-item small,
.damage-timeline-item em {
  display: block;
}

.damage-timeline-item p {
  margin: 5px 0;
  color: var(--muted);
  font-size: 13px;
}

.dark-theme .damage-owner-badge.is-own {
  background: rgba(56, 189, 248, 0.14);
  border-color: rgba(56, 189, 248, 0.3);
  color: #7dd3fc;
}

.dark-theme .damage-owner-badge.is-third-party {
  background: rgba(251, 191, 36, 0.14);
  border-color: rgba(251, 191, 36, 0.28);
  color: #facc15;
}

@media (max-width: 1780px) {
  .damage-overview-row {
    grid-template-columns: 1fr;
  }
}
