*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

:root {
  --accent: #FF7250;
  --accent-hover: #E8623F;
  --accent-glow: rgba(255, 114, 80, 0.18);
  --accent-soft: rgba(255, 114, 80, 0.06);
  --accent-comp: #50DDFF;
  --accent-comp-soft: rgba(80, 221, 255, 0.08);
  --bg-primary: #FFFFFF;
  --bg-secondary: #F3F5F7;
  --bg-card: #FFFFFF;
  --bg-glass: rgba(255, 255, 255, 0.92);
  --text-primary: #121212;
  --text-secondary: #414141;
  --text-muted: #717171;
  --border-subtle: #DCE1E7;
  --border-accent: rgba(255, 114, 80, 0.15);
  --cream: #EDF0F3;
  --success: #0CC36B;
  --success-bg: #E5F7E8;
  --warning: #FFCA50;
  --warning-text: #E6940A;
  --warning-bg: #FFF8E1;
  --danger: #E3392C;
  --danger-bg: #FFEBE9;
  --info: #50DDFF;
  --info-bg: #E8F8FF;
  --radius-sm: 8px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-pill: 100px;
  --font-heading: Chakra Petch, sans-serif;
  --font-body: Inter, sans-serif;
  --transition: all 0.4s cubic-bezier(0.44, 0, 0.56, 1);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.06), 0 2px 4px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.08), 0 4px 8px rgba(0, 0, 0, 0.04);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme=light]) {
    --bg-primary: #0F1117;
    --bg-secondary: #1A1D26;
    --bg-card: #1E2130;
    --bg-glass: rgba(15, 17, 23, 0.92);
    --text-primary: #E8EAED;
    --text-secondary: #B0B3BA;
    --text-muted: #7A7D85;
    --border-subtle: #2A2D38;
    --border-accent: rgba(255, 114, 80, 0.2);
    --cream: #1A1D26;
    --accent-glow: rgba(255, 114, 80, 0.25);
    --accent-soft: rgba(255, 114, 80, 0.1);
    --success-bg: rgba(12, 195, 107, 0.12);
    --warning-bg: rgba(255, 202, 80, 0.12);
    --danger-bg: rgba(227, 57, 44, 0.12);
    --info-bg: rgba(80, 221, 255, 0.12);
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.2), 0 1px 2px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.25), 0 2px 4px rgba(0,0,0,0.2);
    --shadow-lg: 0 12px 32px rgba(0,0,0,0.35), 0 4px 8px rgba(0,0,0,0.25);
  }
}
[data-theme=dark] {
  --bg-primary: #0F1117;
  --bg-secondary: #1A1D26;
  --bg-card: #1E2130;
  --bg-glass: rgba(15, 17, 23, 0.92);
  --text-primary: #E8EAED;
  --text-secondary: #B0B3BA;
  --text-muted: #7A7D85;
  --border-subtle: #2A2D38;
  --border-accent: rgba(255, 114, 80, 0.2);
  --cream: #1A1D26;
  --accent-glow: rgba(255, 114, 80, 0.25);
  --accent-soft: rgba(255, 114, 80, 0.1);
  --success-bg: rgba(12, 195, 107, 0.12);
  --warning-bg: rgba(255, 202, 80, 0.12);
  --danger-bg: rgba(227, 57, 44, 0.12);
  --info-bg: rgba(80, 221, 255, 0.12);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.2), 0 1px 2px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.25), 0 2px 4px rgba(0,0,0,0.2);
  --shadow-lg: 0 12px 32px rgba(0,0,0,0.35), 0 4px 8px rgba(0,0,0,0.25);
}

body {
  font-family: var(--font-body);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.15;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
body {
  background: var(--bg-secondary);
  min-height: 100vh;
}

.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-subtle);
  padding: 0 24px;
}
.navbar-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text-primary);
  text-decoration: none;
}
.nav-logo-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent-glow);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.dark-toggle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}
.dark-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.nav-back {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: var(--transition);
}
.nav-back:hover {
  color: var(--accent);
}

.cabinet {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 24px;
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 24px;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: sticky;
  top: 88px;
  align-self: start;
}
.sidebar-nav {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: var(--transition);
  border-left: 3px solid transparent;
}
.sidebar-link:hover {
  background: var(--bg-secondary);
  color: var(--text-primary);
}
.sidebar-link.active {
  background: var(--accent-soft);
  color: var(--accent);
  border-left-color: var(--accent);
  font-weight: 600;
}
.sidebar-link.danger {
  color: var(--danger);
}
.sidebar-link.danger:hover {
  background: var(--danger-bg);
}
.sidebar-link i {
  font-size: 18px;
  width: 20px;
  text-align: center;
}
.sidebar-link-badge {
  margin-left: auto;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
}
.sidebar-divider {
  height: 1px;
  background: var(--border-subtle);
}

.profile-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: 28px 24px;
  text-align: center;
  box-shadow: var(--shadow-sm);
}
.profile-card .profile-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  color: #fff;
  font-family: var(--font-heading);
  font-size: 28px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  box-shadow: 0 4px 16px var(--accent-glow);
}
.profile-card .profile-name {
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 4px;
}
.profile-card .profile-email {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 16px;
}
.profile-card .profile-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
}

.main-content {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.balance-card {
  background: linear-gradient(135deg, var(--accent), #FF9472);
  border-radius: var(--radius-lg);
  padding: 28px 32px;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 8px 32px var(--accent-glow);
  position: relative;
  overflow: hidden;
}
.balance-card::before {
  content: "";
  position: absolute;
  top: -50%;
  right: -20%;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
}
.balance-card::after {
  content: "";
  position: absolute;
  bottom: -40%;
  left: 10%;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
}
.balance-card .balance-info {
  position: relative;
  z-index: 1;
}
.balance-card .balance-label {
  font-size: 14px;
  opacity: 0.85;
  margin-bottom: 4px;
}
.balance-card .balance-amount {
  font-family: var(--font-heading);
  font-size: 36px;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.balance-card .balance-sub {
  font-size: 13px;
  opacity: 0.7;
  margin-top: 4px;
}
.balance-card .balance-actions {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 10px;
}

.balance-btn {
  padding: 12px 24px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 6px;
  backdrop-filter: blur(8px);
}
.balance-btn:hover {
  background: rgba(255, 255, 255, 0.25);
  border-color: rgba(255, 255, 255, 0.5);
}
.balance-btn.primary {
  background: #fff;
  color: var(--accent);
  border-color: #fff;
}
.balance-btn.primary:hover {
  background: rgba(255, 255, 255, 0.9);
}

.stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.stats-row .stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: 20px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}
.stats-row .stat-card:hover {
  box-shadow: var(--shadow-md);
}
.stats-row .stat-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  margin-bottom: 12px;
}
.stats-row .stat-icon.blue {
  background: var(--info-bg);
  color: var(--info);
}
.stats-row .stat-icon.green {
  background: var(--success-bg);
  color: var(--success);
}
.stats-row .stat-icon.orange {
  background: var(--warning-bg);
  color: var(--warning-text);
}
.stats-row .stat-value {
  font-family: var(--font-heading);
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 2px;
}
.stats-row .stat-label {
  font-size: 13px;
  color: var(--text-muted);
}

.section-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.section-card .section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-subtle);
}
.section-card .section-title {
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 700;
}
.section-card .section-action {
  font-size: 13px;
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  transition: var(--transition);
}
.section-card .section-action:hover {
  text-decoration: underline;
}

.report-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border-subtle);
  transition: var(--transition);
}
.report-item:last-child {
  border-bottom: none;
}
.report-item:hover {
  background: var(--bg-secondary);
}
.report-item .report-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: var(--accent-soft);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}
.report-item .report-info {
  flex: 1;
  min-width: 0;
}
.report-item .report-vin {
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.04em;
  margin-bottom: 2px;
}
/* Human-readable car make/model shown under the technical VIN.
   Single line with ellipsis on desktop so a long name never grows the row. */
.report-item .report-model {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-secondary, var(--text-muted));
  line-height: 1.35;
  margin-bottom: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.report-item .report-meta {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  gap: 12px;
}
.report-item .report-status {
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 600;
  flex-shrink: 0;
}
.report-item .report-status.ready {
  background: var(--success-bg);
  color: var(--success);
}
.report-item .report-status.pending {
  background: var(--warning-bg);
  color: var(--warning-text);
}
.report-item .report-action {
  color: var(--text-muted);
  font-size: 20px;
  text-decoration: none;
  transition: var(--transition);
  flex-shrink: 0;
}
.report-item .report-action:hover {
  color: var(--accent);
}
/* Desktop keeps the compact icon-only action; the text label is mobile-only. */
.report-item .report-action-label {
  display: none;
}

.empty-state {
  padding: 48px 24px;
  text-align: center;
}
.empty-state .empty-icon {
  font-size: 48px;
  color: var(--text-muted);
  opacity: 0.4;
  margin-bottom: 16px;
}
.empty-state .empty-text {
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 16px;
}
.empty-state .empty-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 24px;
  border-radius: var(--radius-pill);
  background: var(--accent);
  color: #fff;
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: var(--transition);
}
.empty-state .empty-btn:hover {
  background: var(--accent-hover);
}

.quick-actions {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  padding: 20px 24px;
}
.quick-actions .quick-action {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: var(--bg-secondary);
  text-decoration: none;
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 600;
  transition: var(--transition);
}
.quick-actions .quick-action:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}
.quick-actions .quick-action i {
  font-size: 20px;
  color: var(--accent);
}

.settings-section {
  display: none;
}
.settings-section.active {
  display: block;
}

.setting-group {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-subtle);
}
.setting-group:last-child {
  border-bottom: none;
}

.setting-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.setting-input {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--bg-secondary);
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--text-primary);
  transition: var(--transition);
  outline: none;
}
.setting-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.setting-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.setting-save {
  margin: 20px 24px;
  padding: 12px 28px;
  border: none;
  border-radius: var(--radius-pill);
  background: var(--accent);
  color: #fff;
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}
.setting-save:hover {
  background: var(--accent-hover);
}

.vin-check-btn {
  padding: 12px 28px;
  border: none;
  border-radius: var(--radius-pill);
  background: var(--accent);
  color: #fff;
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  cursor: pointer;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition);
  box-shadow: 0 2px 10px var(--accent-glow);
}
.vin-check-btn:hover {
  background: var(--accent-hover);
}


/* ── Branded Loader (ac-loader) ── */
@keyframes ac-spin {
  to { transform: rotate(360deg); }
}
@keyframes ac-pulse {
  0%, 100% { opacity: 0.35; transform: scale(0.75); }
  50%      { opacity: 1;    transform: scale(1); }
}
@keyframes ac-ring-pulse {
  0%, 100% { box-shadow: 0 0 0 0 var(--accent-glow); }
  50%      { box-shadow: 0 0 0 10px rgba(255, 114, 80, 0); }
}
@keyframes ac-progress-slide {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.ac-loader {
  --size: 56px;
  width: var(--size);
  height: var(--size);
  position: relative;
  display: inline-block;
  flex-shrink: 0;
}
.ac-loader::before,
.ac-loader::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
}
.ac-loader::before {
  border: 3px solid var(--accent-glow);
}
.ac-loader::after {
  border: 3px solid transparent;
  border-top-color: var(--accent);
  border-right-color: var(--accent);
  animation: ac-spin 0.9s cubic-bezier(0.44, 0, 0.56, 1) infinite;
}
.ac-loader__dot {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 30%;
  height: 30%;
  margin: -15% 0 0 -15%;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent-glow);
  animation: ac-pulse 1.4s ease-in-out infinite;
}
.ac-loader--sm {
  --size: 22px;
}
.ac-loader--sm::before,
.ac-loader--sm::after {
  border-width: 2px;
}
.ac-loader--lg {
  --size: 72px;
}

.vin-check-btn.loading,
.login-btn.loading,
.setting-save.loading {
  position: relative;
  color: transparent !important;
  pointer-events: none;
}
.vin-check-btn.loading::after,
.login-btn.loading::after,
.setting-save.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  animation: ac-spin 0.7s linear infinite;
}

.ac-loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 22px;
  background: rgba(15, 17, 23, 0.55);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  padding: 24px;
}
.ac-loading-overlay.show {
  opacity: 1;
  visibility: visible;
}
.ac-loading-overlay .ac-loader {
  animation: ac-ring-pulse 2s ease-out infinite;
  border-radius: 50%;
}
.ac-loading-overlay .ac-loading-title {
  font-family: var(--font-heading);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #fff;
  text-align: center;
}
.ac-loading-overlay .ac-loading-sub {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.7);
  text-align: center;
  min-height: 1.2em;
  transition: opacity 0.25s ease;
}
.ac-loading-overlay .ac-loading-progress {
  width: min(280px, 80vw);
  height: 3px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
  position: relative;
}
.ac-loading-overlay .ac-loading-progress::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 0%, var(--accent) 50%, transparent 100%);
  animation: ac-progress-slide 1.4s ease-in-out infinite;
}

.mobile-sidebar-toggle {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  margin-bottom: 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
  transition: var(--transition);
}
.mobile-sidebar-toggle i {
  font-size: 18px;
}

[data-theme=dark] .stat-card {
  background: var(--bg-card);
  border-color: var(--border-subtle);
}
[data-theme=dark] .section-card {
  background: var(--bg-card);
  border-color: var(--border-subtle);
}
[data-theme=dark] .quick-action {
  background: var(--bg-secondary);
  border-color: var(--border-subtle);
}
[data-theme=dark] .report-item:hover {
  background: var(--bg-secondary);
}
[data-theme=dark] .profile-card {
  background: var(--bg-card);
  border-color: var(--border-subtle);
}
[data-theme=dark] .sidebar-nav {
  background: var(--bg-card);
  border-color: var(--border-subtle);
}
[data-theme=dark] .setting-input {
  background: var(--bg-secondary);
  border-color: var(--border-subtle);
  color: var(--text-primary);
}
[data-theme=dark] .balance-card {
  box-shadow: 0 8px 32px rgba(255, 114, 80, 0.15);
}
@media (max-width: 768px) {
  .cabinet {
    grid-template-columns: 1fr;
    padding: 16px;
  }
  .sidebar {
    display: none;
  }
  .sidebar.mobile-open {
    display: flex;
  }
  .mobile-sidebar-toggle {
    display: flex;
  }
  .stats-row {
    grid-template-columns: 1fr;
  }
  .balance-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
    padding: 24px;
  }
  .balance-card .balance-amount {
    font-size: 28px;
  }
  .balance-card .balance-actions {
    width: 100%;
  }
  .balance-btn {
    flex: 1;
    justify-content: center;
  }
  .quick-actions {
    grid-template-columns: 1fr;
  }
  .setting-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .cabinet {
    padding: 14px;
  }
  .balance-card {
    padding: 20px;
  }
  .balance-card .balance-actions {
    flex-direction: column;
    gap: 10px;
  }
  .balance-btn {
    width: 100%;
    flex: 1 1 auto;
  }
  .section-card .section-header {
    padding: 16px 18px;
  }
  .quick-actions {
    padding: 16px 18px;
  }
}
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}
.modal-overlay.show {
    opacity: 1;
    visibility: visible;
}
.modal-overlay.show .modal-box {
    transform: scale(1);
}
.modal-overlay .modal-box {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 16px;
    padding: 32px;
    max-width: 400px;
    width: 90%;
    box-shadow: var(--shadow-lg);
    text-align: center;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}
.modal-overlay .modal-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--danger-bg);
    color: var(--danger);
    font-size: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}
.modal-overlay .modal-title {
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 8px;
}
.modal-overlay .modal-text {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 24px;
}
.modal-overlay .modal-actions {
    display: flex;
    gap: 12px;
}
.modal-overlay .modal-btn {
    flex: 1;
    padding: 12px;
    border-radius: var(--radius-pill);
    font-family: var(--font-heading);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.04em;
    cursor: pointer;
    transition: var(--transition);
    border: none;
}
.modal-overlay .modal-btn.cancel {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-subtle);
}
.modal-overlay .modal-btn.cancel:hover {
    background: var(--border-subtle);
}
.modal-overlay .modal-btn.confirm {
    background: var(--danger);
    color: #fff;
}
.modal-overlay .modal-btn.confirm:hover {
    background: #c92e22;
}
.modal-overlay .modal-btn.primary {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 2px 10px var(--accent-glow);
}
.modal-overlay .modal-btn.primary:hover {
    background: var(--accent-hover);
}
.modal-overlay .modal-icon.warning {
    background: var(--warning-bg);
    color: var(--warning-text);
}
.modal-overlay .modal-icon.info {
    background: var(--info-bg);
    color: var(--info);
}
.modal-overlay .modal-icon.success {
    background: var(--success-bg);
    color: var(--success);
}
.modal-overlay .modal-icon.accent {
    background: var(--accent-soft);
    color: var(--accent);
}
.modal-overlay .modal-box {
    transform: scale(0.92) translateY(12px);
}
.modal-overlay.show .modal-box {
    transform: scale(1) translateY(0);
}

/* ───────────────────────────────────────────────────────────
   Reports — mobile card layout (< 768px)
   Desktop (>= 768px) keeps the compact table-like row untouched.
   Each report becomes a self-contained card: VIN title, date,
   status badge and a full-width "Открыть" action (touch >= 44px).
   ─────────────────────────────────────────────────────────── */
@media (max-width: 767.98px) {
  .report-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px;
  }

  .report-item {
    display: grid;
    grid-template-columns: 44px 1fr auto;
    grid-template-areas:
      "icon vin    status"
      "icon model  model"
      "icon meta   meta"
      "action action action";
    align-items: center;
    column-gap: 12px;
    row-gap: 6px;
    padding: 14px;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    background: var(--bg-card);
    box-shadow: var(--shadow-sm);
  }
  .report-item:hover {
    background: var(--bg-card);
  }

  .report-item .report-icon {
    grid-area: icon;
    align-self: start;
  }

  .report-item .report-info {
    display: contents;
  }

  .report-item .report-vin {
    grid-area: vin;
    align-self: center;
    margin-bottom: 0;
    font-size: 15px;
    line-height: 1.3;
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  /* On the card the model wraps instead of truncating so the full
     vehicle name stays readable even on a 320px screen. */
  .report-item .report-model {
    grid-area: model;
    align-self: center;
    font-size: 13px;
    line-height: 1.3;
    margin-bottom: 0;
    white-space: normal;
    overflow: visible;
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .report-item .report-meta {
    grid-area: meta;
    flex-direction: row;
    align-items: center;
    gap: 6px;
    font-size: 13px;
  }
  .report-item .report-meta span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
  }

  .report-item .report-status {
    grid-area: status;
    align-self: center;
    justify-self: end;
    white-space: nowrap;
  }

  .report-item .report-action {
    grid-area: action;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    margin-top: 6px;
    padding: 0 16px;
    border-radius: var(--radius-md);
    background: var(--accent-soft);
    color: var(--accent);
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 600;
  }
  .report-item .report-action i {
    font-size: 18px;
  }
  .report-item .report-action:hover,
  .report-item .report-action:active {
    background: var(--accent);
    color: #fff;
  }
  .report-item .report-action-label {
    display: inline;
  }
}

[data-theme=dark] .report-item {
  background: var(--bg-card);
}

@media (max-width: 767.98px) {
  [data-theme=dark] .report-item {
    background: var(--bg-secondary);
    border-color: var(--border-subtle);
  }
  [data-theme=dark] .report-item:hover {
    background: var(--bg-secondary);
  }
}

/* ───────────────────────────────────────────────
   Balance top-up: amount picker (premium redesign)
   ─────────────────────────────────────────────── */
.topup-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

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

.topup-card {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 64px;
  padding: 18px 14px;
  border: 2px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-family: var(--font-heading);
  cursor: pointer;
  transition: transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1),
              border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}
.topup-card__amount {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1;
}
.topup-card__cur {
  font-weight: 600;
  color: var(--text-muted);
}
.topup-card:hover {
  border-color: var(--accent);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}
.topup-card:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.topup-card.is-selected {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 4px 16px var(--accent-glow);
}
.topup-card.is-selected .topup-card__cur {
  color: var(--accent);
}

/* Selected check — top-right corner, springs in only when active */
.topup-card__check {
  position: absolute;
  top: 7px;
  right: 8px;
  font-size: 18px;
  line-height: 1;
  color: var(--accent);
  opacity: 0;
  transform: scale(0.4);
  transition: opacity 0.2s ease, transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.topup-card.is-selected .topup-card__check {
  opacity: 1;
  transform: scale(1);
}

/* "Популярный" badge on the pre-selected option */
.topup-card__badge {
  position: absolute;
  top: -9px;
  left: 50%;
  transform: translateX(-50%);
  padding: 2px 10px;
  border-radius: var(--radius-pill);
  background: var(--accent);
  color: #fff;
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.5;
  white-space: nowrap;
  box-shadow: 0 2px 8px var(--accent-glow);
}

/* Custom amount field */
.topup-custom {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.topup-custom__label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}
.topup-custom__field {
  position: relative;
  display: flex;
  align-items: center;
}
.topup-custom__input {
  width: 100%;
  padding: 13px 36px 13px 14px;
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--bg-secondary);
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 500;
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.topup-custom__input::placeholder {
  color: var(--text-muted);
  font-weight: 400;
}
.topup-custom__input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.topup-custom__suffix {
  position: absolute;
  right: 14px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-muted);
  pointer-events: none;
}

/* Pay button — gradient + brand shadow */
.topup-pay {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 52px;
  padding: 15px 24px;
  border: none;
  border-radius: var(--radius-pill);
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-hover) 100%);
  color: #fff;
  font-family: var(--font-heading);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(255, 114, 80, 0.3);
  transition: transform 0.18s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}
.topup-pay i {
  font-size: 18px;
}
.topup-pay:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 30px rgba(255, 114, 80, 0.42);
}
.topup-pay:active {
  transform: translateY(0);
  box-shadow: 0 6px 18px rgba(255, 114, 80, 0.3);
}
.topup-pay:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--bg-primary), 0 0 0 5px var(--accent);
}
.topup-pay:disabled {
  cursor: not-allowed;
  opacity: 0.45;
  background: var(--text-muted);
  box-shadow: none;
  transform: none;
}

/* Dark mode */
[data-theme=dark] .topup-card {
  background: var(--bg-secondary);
  border-color: var(--border-subtle);
  color: var(--text-primary);
}
[data-theme=dark] .topup-card.is-selected {
  background: var(--accent-soft);
  border-color: var(--accent);
}
[data-theme=dark] .topup-custom__input {
  background: var(--bg-secondary);
  border-color: var(--border-subtle);
  color: var(--text-primary);
}

/* Tablet & mobile: 2 columns, full-width controls already inherit */
@media (max-width: 767.98px) {
  .topup-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  .topup-card {
    min-height: 60px;
    padding: 16px 12px;
  }
  .topup-card__amount {
    font-size: 18px;
  }
}

@media (max-width: 480px) {
  .topup-body {
    padding: 20px 18px;
    gap: 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .topup-card,
  .topup-card__check,
  .topup-pay {
    transition: border-color 0.2s ease, background 0.2s ease,
                box-shadow 0.2s ease, opacity 0.2s ease;
  }
  .topup-card:hover {
    transform: none;
  }
}
