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

a {
  color: var(--theme-link);
}

a:hover {
  color: var(--theme-link-hover);
}

.btn-primary,
.btn-clicki9,
.btn-click {
  --bs-btn-bg: var(--theme-primary);
  --bs-btn-border-color: var(--theme-primary);
  --bs-btn-color: var(--theme-button-primary-text);
  --bs-btn-hover-bg: var(--theme-primary-hover);
  --bs-btn-hover-border-color: var(--theme-primary-hover);
  --bs-btn-hover-color: var(--theme-button-primary-text);
  --bs-btn-active-bg: var(--theme-primary-hover);
  --bs-btn-active-border-color: var(--theme-primary-hover);
  --bs-btn-disabled-bg: var(--theme-primary);
  --bs-btn-disabled-border-color: var(--theme-primary);
}

.btn-outline-primary {
  --bs-btn-color: var(--theme-primary);
  --bs-btn-border-color: var(--theme-primary);
  --bs-btn-hover-bg: var(--theme-primary);
  --bs-btn-hover-border-color: var(--theme-primary);
  --bs-btn-active-bg: var(--theme-primary-hover);
  --bs-btn-active-border-color: var(--theme-primary-hover);
}

.form-control:focus,
.form-select:focus,
.form-check-input:focus {
  border-color: var(--theme-input-focus);
  box-shadow: 0 0 0 .25rem color-mix(in srgb, var(--theme-input-focus) 24%, transparent);
}

.form-check-input:checked {
  background-color: var(--theme-primary);
  border-color: var(--theme-primary);
}

.app-sidebar,
.app-mobile-sidebar {
  background: var(--theme-sidebar-bg);
  color: var(--theme-sidebar-text);
}

.app-sidebar-brand,
.app-mobile-brand {
  color: var(--theme-sidebar-text);
}

.app-brand-copy strong,
.app-mobile-brand strong {
  color: var(--theme-sidebar-text);
}

.app-brand-copy small,
.app-mobile-brand small,
.app-nav-heading,
.app-sidebar-footer {
  color: var(--theme-sidebar-muted);
}

.app-nav-link {
  color: var(--theme-sidebar-muted);
}

.app-nav-link:hover,
.app-nav-link:focus {
  background: var(--theme-sidebar-hover-bg);
  color: var(--theme-sidebar-hover-text);
}

.app-sidebar .nav-link.active,
.app-nav-link.is-active {
  background: var(--theme-sidebar-active-bg);
  color: var(--theme-sidebar-active-text);
}

.app-brand-initials,
.brand-initials {
  background: var(--theme-primary);
  color: var(--theme-button-primary-text);
}

.app-topbar {
  background: var(--theme-topbar-bg);
  border-bottom-color: var(--theme-border);
  color: var(--theme-topbar-text);
}

.app-topbar-title strong,
.app-context strong,
.app-user-summary span,
.page-head h1,
.panel h2,
.kanban-col h2,
.commercial-table thead th,
.grid-sort-link {
  color: var(--theme-text);
}

.app-topbar-title span,
.app-context span,
.app-user-summary small,
.muted {
  color: var(--theme-muted);
}

.app-content,
.app-workspace {
  background: var(--theme-body-bg);
}

.panel,
.metric-card,
.auth-card,
.sale-panel,
.commercial-grid-panel,
.theme-section,
.theme-preview,
.modal-content,
.dropdown-menu {
  background: var(--theme-card-bg);
  border-color: var(--theme-border);
  color: var(--theme-text);
}

.commercial-table-wrap,
.table-logo-box,
.section,
.route-card,
.timeline-item {
  border-color: var(--theme-border);
}

.commercial-table thead th,
.app-table thead th,
.section h2,
.table-light {
  background: color-mix(in srgb, var(--theme-body-bg) 78%, var(--theme-surface));
}

.commercial-table tbody td,
.app-table tbody td,
.table td,
.table th {
  border-color: var(--theme-border);
  color: var(--theme-text);
}

.commercial-table tbody tr:hover td,
.app-table tbody tr:hover td {
  background: color-mix(in srgb, var(--theme-primary) 5%, var(--theme-surface));
}

.kicker,
.grid-sort-link:hover,
.travel-login-forgot {
  color: var(--theme-primary);
}

.status,
.status-badge:not(.status-badge-yellow):not(.status-badge-gold):not(.status-badge-orange):not(.status-badge-blue):not(.status-badge-green):not(.status-badge-light-green):not(.status-badge-strong-green):not(.status-badge-red) {
  background: color-mix(in srgb, var(--theme-primary) 10%, var(--theme-surface));
  border-color: color-mix(in srgb, var(--theme-primary) 30%, var(--theme-border));
  color: var(--theme-primary);
}

.status-badge-strong-green,
.status-badge-green {
  background: color-mix(in srgb, var(--theme-success) 13%, #fff);
  border-color: color-mix(in srgb, var(--theme-success) 36%, #fff);
  color: var(--theme-success);
}

.status-badge-yellow,
.status-badge-gold,
.status-badge-orange {
  background: color-mix(in srgb, var(--theme-warning) 18%, #fff);
  border-color: color-mix(in srgb, var(--theme-warning) 42%, #fff);
  color: #775f00;
}

.status-badge-red {
  background: color-mix(in srgb, var(--theme-danger) 12%, #fff);
  border-color: color-mix(in srgb, var(--theme-danger) 32%, #fff);
  color: var(--theme-danger);
}

.status-badge-blue {
  background: color-mix(in srgb, var(--theme-info) 12%, #fff);
  border-color: color-mix(in srgb, var(--theme-info) 32%, #fff);
  color: color-mix(in srgb, var(--theme-info) 70%, #172033);
}

.badge.bg-success,
.text-bg-success {
  background-color: var(--theme-success) !important;
}

.badge.bg-warning,
.text-bg-warning {
  background-color: var(--theme-warning) !important;
  color: #172033 !important;
}

.badge.bg-danger,
.text-bg-danger {
  background-color: var(--theme-danger) !important;
}

.badge.bg-info,
.text-bg-info {
  background-color: var(--theme-info) !important;
  color: #172033 !important;
}

.travel-login-hero {
  background:
    linear-gradient(90deg, rgba(255,255,255,.055) 1px, transparent 1px),
    linear-gradient(0deg, rgba(255,255,255,.045) 1px, transparent 1px),
    linear-gradient(145deg, var(--theme-sidebar-bg), var(--theme-secondary));
  background-size: 58px 58px, 58px 58px, auto;
}

.travel-login-access,
.auth-page {
  background: var(--theme-login-bg);
}

.travel-login-card,
.auth-card {
  background: var(--theme-login-card-bg);
}

.travel-login-core {
  color: var(--theme-secondary);
}

.theme-editor-layout {
  align-items: start;
  display: grid;
  gap: 22px;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 36%);
}

.theme-editor-main {
  display: grid;
  gap: 18px;
}

.theme-section,
.theme-preview {
  border: 1px solid var(--theme-border);
  border-radius: 8px;
  padding: 18px;
}

.theme-section h2 {
  font-size: 17px;
  font-weight: 900;
  margin-bottom: 14px;
}

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

.theme-color-control {
  display: grid;
  gap: 7px;
  grid-template-columns: 48px minmax(0, 1fr);
}

.theme-color-control span {
  color: var(--theme-muted);
  font-size: 12px;
  font-weight: 800;
  grid-column: 1 / -1;
}

.theme-color-control input[type="color"] {
  border: 1px solid var(--theme-border);
  border-radius: 7px;
  height: 38px;
  padding: 4px;
  width: 48px;
}

.theme-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.theme-dirty {
  color: var(--theme-warning);
  font-size: 13px;
  font-weight: 800;
}

.theme-preview {
  position: sticky;
  top: calc(var(--topbar-height, 72px) + 16px);
}

.theme-preview-shell {
  border: 1px solid var(--theme-border);
  border-radius: 8px;
  display: grid;
  grid-template-columns: 132px 1fr;
  min-height: 280px;
  overflow: hidden;
}

.theme-preview-sidebar {
  background: var(--theme-sidebar-bg);
  color: var(--theme-sidebar-text);
  display: grid;
  gap: 8px;
  align-content: start;
  padding: 14px;
}

.theme-preview-sidebar span {
  color: var(--theme-sidebar-muted);
  font-size: 11px;
}

.theme-preview-sidebar a {
  border-radius: 7px;
  color: var(--theme-sidebar-muted);
  font-size: 12px;
  font-weight: 800;
  padding: 7px 8px;
  text-decoration: none;
}

.theme-preview-sidebar a.is-active {
  background: var(--theme-sidebar-active-bg);
  color: var(--theme-sidebar-active-text);
}

.theme-preview-content {
  background: var(--theme-body-bg);
}

.theme-preview-topbar {
  align-items: center;
  background: var(--theme-topbar-bg);
  border-bottom: 1px solid var(--theme-border);
  color: var(--theme-topbar-text);
  display: flex;
  justify-content: space-between;
  padding: 12px;
}

.theme-preview-card {
  background: var(--theme-card-bg);
  border: 1px solid var(--theme-border);
  border-radius: 8px;
  margin: 14px;
  padding: 14px;
}

@media (max-width: 992px) {
  .theme-editor-layout {
    grid-template-columns: 1fr;
  }
  .theme-preview {
    position: static;
  }
}

@media (max-width: 640px) {
  .theme-color-grid {
    grid-template-columns: 1fr;
  }
  .theme-preview-shell {
    grid-template-columns: 1fr;
  }
}
