/* ═══════════════════════════════════════════════════════
   LAYOUT
═══════════════════════════════════════════════════════ */
#app { min-height: 100vh; }

.dashboard-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  min-height: 100vh;
}

/* ═══════════════════════════════════════════════════════
   SIDEBAR
═══════════════════════════════════════════════════════ */
.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: 220px;
  z-index: 100;
  overflow: hidden;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 1.5rem 1.25rem 1.25rem;
  font-size: 1.0625rem;
  font-weight: 800;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  letter-spacing: -0.01em;
}
.sidebar-logo svg {
  color: var(--accent);
  flex-shrink: 0;
  filter: drop-shadow(0 0 8px rgba(139,92,246,0.5));
}

.sidebar-nav {
  flex: 1;
  padding: 1.25rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  overflow-y: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6875rem 0.875rem;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition);
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  position: relative;
}
.nav-item:hover {
  background: var(--surface-2);
  color: var(--text);
}
.nav-item.active {
  background: rgba(139,92,246,0.12);
  color: var(--accent);
  font-weight: 600;
}
.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 25%; bottom: 25%;
  width: 3px;
  background: var(--accent);
  border-radius: 0 3px 3px 0;
}
.nav-item svg { flex-shrink: 0; }
.nav-item .badge-count {
  margin-left: auto;
  background: var(--accent);
  color: #fff;
  font-size: 0.6875rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 50px;
  min-width: 18px;
  text-align: center;
  line-height: 1.6;
}

.sidebar-footer {
  padding: 0.875rem 0.75rem 1.125rem;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.plan-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.575rem;
  border-radius: 50px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.plan-chip.free       { background: rgba(100,116,139,0.15); color: var(--text-dim); }
.plan-chip.pro        { background: rgba(139,92,246,0.18); color: var(--accent); border: 1px solid rgba(139,92,246,0.3); }
.plan-chip.business   { background: rgba(59,130,246,0.18); color: var(--accent-2); border: 1px solid rgba(59,130,246,0.3); }
.plan-chip.enterprise { background: rgba(34,197,94,0.15); color: var(--success); border: 1px solid rgba(34,197,94,0.3); }

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-bottom: 0.875rem;
  padding: 0.5rem 0.125rem;
}
.user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(139,92,246,0.3), rgba(59,130,246,0.3));
  border: 1px solid rgba(139,92,246,0.35);
  color: var(--accent);
  font-weight: 700;
  font-size: 0.8125rem;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.user-info { flex: 1; min-width: 0; }
.user-name {
  font-size: 0.8125rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 3px;
}
.user-plan { line-height: 1; }

.btn-logout {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5625rem 0.875rem;
  background: none;
  border: 1px solid var(--border);
  border-radius: 9px;
  color: var(--text-muted);
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  font-family: var(--font);
}
.btn-logout:hover {
  border-color: var(--danger);
  color: var(--danger);
  background: rgba(239,68,68,0.06);
}

/* ═══════════════════════════════════════════════════════
   MAIN CONTENT
═══════════════════════════════════════════════════════ */
.main-content {
  margin-left: 220px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: var(--bg);
}

.topbar {
  padding: 0 2rem;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  background: rgba(13,17,23,0.85);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 50;
  gap: 1rem;
}
.topbar-left { display: flex; align-items: center; gap: 0.75rem; }
.topbar-breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
}
.topbar-breadcrumb span:last-child {
  color: var(--text);
  font-weight: 600;
}
.topbar-title {
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.topbar-actions { display: flex; align-items: center; gap: 0.625rem; }

.view-body {
  padding: 2rem;
  flex: 1;
  max-width: 1200px;
  width: 100%;
}

/* ═══════════════════════════════════════════════════════
   BUTTONS
═══════════════════════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.59375rem 1.1875rem;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.875rem;
  border: none;
  cursor: pointer;
  transition: all var(--transition);
  font-family: var(--font);
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
}
.btn-primary {
  background: linear-gradient(135deg, var(--accent) 0%, #7c3aed 50%, var(--accent-2) 100%);
  color: #fff;
  box-shadow: 0 4px 14px rgba(139,92,246,0.35);
}
.btn-primary:hover {
  opacity: 0.92;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(139,92,246,0.45);
}
.btn-secondary {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover {
  border-color: rgba(139,92,246,0.5);
  background: rgba(139,92,246,0.07);
}
.btn-ghost { background: transparent; color: var(--text-muted); }
.btn-ghost:hover { color: var(--text); background: var(--surface-2); }
.btn-danger { background: rgba(239,68,68,0.1); color: var(--danger); border: 1px solid rgba(239,68,68,0.25); }
.btn-danger:hover { background: rgba(239,68,68,0.18); }
.btn-block { display: flex; width: 100%; }
.btn-sm { padding: 0.375rem 0.8125rem; font-size: 0.8rem; border-radius: 8px; }
.btn-xs { padding: 0.25rem 0.625rem; font-size: 0.75rem; border-radius: 6px; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none !important; box-shadow: none !important; }

/* Toggle group */
.btn-group {
  display: flex;
  align-items: center;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 3px;
  gap: 2px;
}
.btn-group .btn-tab {
  padding: 0.3125rem 0.75rem;
  font-size: 0.8125rem;
  font-weight: 500;
  border-radius: 7px;
  border: none;
  background: none;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition);
  font-family: var(--font);
}
.btn-group .btn-tab.active {
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
  box-shadow: 0 1px 4px rgba(0,0,0,0.3);
}

/* ═══════════════════════════════════════════════════════
   CARDS
═══════════════════════════════════════════════════════ */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}
.card-title {
  font-size: 0.9375rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.card-title svg { color: var(--accent); }

/* Stats row */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
  margin-bottom: 1.75rem;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  transition: border-color var(--transition);
}
.stat-card:hover { border-color: rgba(139,92,246,0.35); }
.stat-label { font-size: 0.8rem; color: var(--text-muted); font-weight: 500; }
.stat-value { font-size: 1.875rem; font-weight: 800; letter-spacing: -0.02em; }
.stat-sub { font-size: 0.775rem; color: var(--text-dim); }

/* ═══════════════════════════════════════════════════════
   CAR CARDS — mini-CRM style
═══════════════════════════════════════════════════════ */
.garage-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}
.garage-header-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.garage-count {
  font-size: 0.8125rem;
  color: var(--text-muted);
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 0.2rem 0.6rem;
  border-radius: 50px;
  font-weight: 500;
}

.cars-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.125rem;
}

.car-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  position: relative;
}
.car-card:hover {
  border-color: rgba(139,92,246,0.45);
  box-shadow: 0 8px 30px rgba(0,0,0,0.35), 0 0 0 1px rgba(139,92,246,0.1);
  transform: translateY(-2px);
}

.car-thumb-wrap {
  height: 150px;
  background: var(--surface-2);
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}
.car-thumb-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}
.car-card:hover .car-thumb-wrap img { transform: scale(1.03); }
.car-thumb-empty {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  color: var(--text-dim);
  font-size: 0.8rem;
}
.car-thumb-empty svg { opacity: 0.3; }

.car-thumb-badges {
  position: absolute;
  top: 0.625rem;
  left: 0.625rem;
  right: 0.625rem;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

/* Portal badges */
.portal-badge {
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  font-size: 0.675rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255,255,255,0.1);
}
.portal-badge.autoscout24  { background: rgba(0,100,230,0.85); color: #fff; }
.portal-badge.subito       { background: rgba(255,140,0,0.85); color: #fff; }
.portal-badge.automobile   { background: rgba(220,38,38,0.85); color: #fff; }
.portal-badge.carmarket    { background: rgba(34,197,94,0.85); color: #fff; }
.portal-badge.default      { background: rgba(30,37,53,0.9); color: var(--text-muted); }

/* Status badge on card */
.status-badge {
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  font-size: 0.675rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255,255,255,0.1);
  transition: all var(--transition);
}
.status-badge.da_valutare   { background: rgba(100,116,139,0.85); color: #e2e8f0; }
.status-badge.in_valutazione{ background: rgba(234,179,8,0.85); color: #1a1000; }
.status-badge.contattato    { background: rgba(139,92,246,0.85); color: #fff; }
.status-badge.scartato      { background: rgba(239,68,68,0.85); color: #fff; }

.car-body {
  padding: 0.875rem 1rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.car-title {
  font-size: 0.9375rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
  color: var(--text);
}
.car-price-row {
  display: flex;
  align-items: baseline;
  gap: 0.625rem;
}
.car-price {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: -0.02em;
}
.car-price-original {
  font-size: 0.8125rem;
  color: var(--text-dim);
  text-decoration: line-through;
}
.car-price-delta {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
}
.car-price-delta.down { background: rgba(34,197,94,0.15); color: var(--success); }
.car-price-delta.up   { background: rgba(239,68,68,0.12); color: var(--danger); }

.car-meta {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  align-items: center;
}
.car-chip {
  padding: 0.175rem 0.525rem;
  border-radius: 5px;
  font-size: 0.75rem;
  font-weight: 500;
  background: var(--surface-2);
  color: var(--text-muted);
  border: 1px solid rgba(255,255,255,0.04);
}
.car-chip.days {
  background: rgba(59,130,246,0.1);
  color: var(--accent-2);
  border-color: rgba(59,130,246,0.15);
}

.car-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  padding: 0.625rem 0.875rem;
  border-top: 1px solid var(--border);
  background: rgba(255,255,255,0.01);
}
.car-actions .btn-link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font);
  padding: 0.3rem 0.5rem;
  border-radius: 6px;
  transition: all var(--transition);
  text-decoration: none;
}
.car-actions .btn-link:hover { color: var(--accent); background: rgba(139,92,246,0.08); }

/* Status dropdown */
.status-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.5);
  z-index: 200;
  min-width: 160px;
  overflow: hidden;
  animation: dropdownIn 0.15s ease;
}
.status-dropdown-item {
  padding: 0.6rem 0.875rem;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--transition);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text);
}
.status-dropdown-item:hover { background: var(--surface-2); }
@keyframes dropdownIn {
  from { opacity: 0; transform: translateY(-6px) scale(0.97); }
  to   { opacity: 1; transform: none; }
}

/* ═══════════════════════════════════════════════════════
   TABLE VIEW
═══════════════════════════════════════════════════════ */
.garage-table-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.garage-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}
.garage-table thead th {
  padding: 0.75rem 1rem;
  text-align: left;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  background: rgba(255,255,255,0.02);
}
.garage-table tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
  cursor: pointer;
}
.garage-table tbody tr:last-child { border-bottom: none; }
.garage-table tbody tr:hover { background: rgba(139,92,246,0.05); }
.garage-table td {
  padding: 0.875rem 1rem;
  color: var(--text);
  vertical-align: middle;
}
.garage-table td.td-title { font-weight: 600; max-width: 220px; }
.garage-table td.td-title span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}
.garage-table td.td-price { font-weight: 700; color: var(--accent); white-space: nowrap; }
.garage-table td.td-actions { white-space: nowrap; text-align: right; }

/* ═══════════════════════════════════════════════════════
   NOTIFICATIONS
═══════════════════════════════════════════════════════ */
.notif-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}
.notif-unread-badge {
  background: rgba(139,92,246,0.15);
  color: var(--accent);
  border: 1px solid rgba(139,92,246,0.25);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: 50px;
}
.notif-list { display: flex; flex-direction: column; gap: 0.625rem; }
.notif-item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  transition: all var(--transition);
  cursor: pointer;
  text-decoration: none;
  color: var(--text);
}
.notif-item:hover {
  border-color: rgba(139,92,246,0.4);
  background: rgba(139,92,246,0.04);
}
.notif-item.unread {
  border-left: 3px solid var(--accent);
  padding-left: calc(1.25rem - 2px);
}
.notif-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.notif-icon.price_drop    { background: rgba(34,197,94,0.12); color: var(--success); }
.notif-icon.new_listing   { background: rgba(139,92,246,0.12); color: var(--accent); }
.notif-icon.watchlist_hit { background: rgba(234,179,8,0.12); color: var(--warning); }
.notif-body { flex: 1; min-width: 0; }
.notif-title { font-size: 0.9rem; font-weight: 600; margin-bottom: 0.25rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.notif-sub { font-size: 0.8125rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.notif-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.375rem;
  flex-shrink: 0;
}
.notif-time { font-size: 0.75rem; color: var(--text-dim); white-space: nowrap; }
.notif-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 5px var(--accent);
}

/* ═══════════════════════════════════════════════════════
   PROFILE
═══════════════════════════════════════════════════════ */
.profile-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}
.profile-card h3 {
  font-size: 0.9375rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
  padding-bottom: 0.875rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.profile-card h3 svg { color: var(--accent); }

.info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.625rem 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  gap: 1rem;
}
.info-row:last-child { border-bottom: none; padding-bottom: 0; }
.info-label { font-size: 0.8125rem; color: var(--text-muted); flex-shrink: 0; }
.info-value { font-size: 0.875rem; font-weight: 600; text-align: right; }

.copy-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.copy-value {
  font-family: 'Menlo', 'Monaco', 'Consolas', monospace;
  font-size: 0.8rem;
  background: var(--surface-2);
  padding: 0.275rem 0.625rem;
  border-radius: 6px;
  color: var(--text-muted);
  letter-spacing: 0.03em;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.btn-copy {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.275rem 0.625rem;
  border-radius: 6px;
  background: rgba(139,92,246,0.1);
  color: var(--accent);
  border: 1px solid rgba(139,92,246,0.2);
  cursor: pointer;
  font-family: var(--font);
  transition: all var(--transition);
  white-space: nowrap;
}
.btn-copy:hover { background: rgba(139,92,246,0.2); }
.btn-copy.copied { background: rgba(34,197,94,0.12); color: var(--success); border-color: rgba(34,197,94,0.25); }

.upgrade-banner {
  background: linear-gradient(135deg, rgba(139,92,246,0.12) 0%, rgba(59,130,246,0.08) 100%);
  border: 1px solid rgba(139,92,246,0.25);
  border-radius: 12px;
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}
.upgrade-banner p {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
  line-height: 1.55;
}

/* ═══════════════════════════════════════════════════════
   DOWNLOAD VIEW
═══════════════════════════════════════════════════════ */
.download-card {
  max-width: 600px;
}
.download-hero {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-bottom: 1.75rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}
.download-icon {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(139,92,246,0.2), rgba(59,130,246,0.15));
  border: 1px solid rgba(139,92,246,0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--accent);
}
.download-hero-info h2 {
  font-size: 1.25rem;
  font-weight: 800;
  margin-bottom: 0.3rem;
  letter-spacing: -0.01em;
}
.download-version {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.775rem;
  color: var(--text-muted);
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 0.175rem 0.55rem;
  border-radius: 50px;
}
.download-btn-wrap { margin-bottom: 1.75rem; }
.download-btn-main {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.875rem 1.75rem;
  font-size: 1rem;
  font-weight: 700;
  border-radius: 12px;
}

.install-steps { display: flex; flex-direction: column; gap: 1rem; }
.install-step {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}
.step-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(139,92,246,0.15);
  border: 1px solid rgba(139,92,246,0.25);
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}
.step-body { flex: 1; }
.step-title { font-size: 0.9rem; font-weight: 600; margin-bottom: 0.2rem; }
.step-desc { font-size: 0.8125rem; color: var(--text-muted); line-height: 1.5; }
.step-desc code {
  background: var(--surface-2);
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 0.8rem;
  font-family: 'Menlo', 'Monaco', monospace;
  color: var(--accent);
}

/* ═══════════════════════════════════════════════════════
   LOGIN
═══════════════════════════════════════════════════════ */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  padding: 2rem;
  background-image:
    radial-gradient(ellipse 70% 50% at 50% -10%, rgba(139,92,246,0.15) 0%, transparent 70%),
    radial-gradient(ellipse 50% 40% at 80% 90%, rgba(59,130,246,0.07) 0%, transparent 60%);
}
.login-card {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 2.5rem;
  box-shadow: 0 32px 80px rgba(0,0,0,0.5), 0 0 0 1px rgba(139,92,246,0.08);
}
.login-logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1.125rem;
  font-weight: 800;
  margin-bottom: 2rem;
  letter-spacing: -0.01em;
}
.login-logo svg { color: var(--accent); filter: drop-shadow(0 0 8px rgba(139,92,246,0.5)); }
.login-title {
  font-size: 1.625rem;
  font-weight: 800;
  margin-bottom: 0.4rem;
  letter-spacing: -0.02em;
}
.login-sub {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 2rem;
  line-height: 1.55;
}
.form-group { margin-bottom: 1.125rem; }
.form-label { display: block; font-size: 0.8125rem; font-weight: 600; margin-bottom: 0.4rem; color: var(--text); }
.form-input {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 0.9375rem;
  font-family: var(--font);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
  box-sizing: border-box;
}
.form-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(139,92,246,0.12);
}
.form-input::placeholder { color: var(--text-dim); }
.form-error { margin-top: 0.5rem; font-size: 0.8rem; color: var(--danger); display: none; }
.form-error.visible { display: block; }
.login-footer {
  margin-top: 1.75rem;
  text-align: center;
  font-size: 0.8125rem;
  color: var(--text-muted);
  line-height: 1.5;
}
.login-footer a { color: var(--accent); font-weight: 500; }
.login-footer a:hover { text-decoration: underline; }

/* ═══════════════════════════════════════════════════════
   EMPTY / LOADING / ERROR STATES
═══════════════════════════════════════════════════════ */
.state-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 2rem;
  text-align: center;
  min-height: 280px;
}
.state-svg {
  margin-bottom: 1.5rem;
  opacity: 0.55;
}
.state-title { font-size: 1.125rem; font-weight: 700; margin-bottom: 0.5rem; }
.state-sub { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 1.75rem; max-width: 360px; line-height: 1.6; }

/* Skeleton */
.skeleton {
  background: linear-gradient(90deg,
    var(--surface-2) 25%,
    rgba(255,255,255,0.045) 50%,
    var(--surface-2) 75%
  );
  background-size: 400%;
  animation: shimmer 1.5s ease infinite;
  border-radius: 8px;
}
@keyframes shimmer {
  0%   { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}
.sk-card { height: 250px; border-radius: var(--radius); }
.sk-line  { height: 14px; margin-bottom: 8px; }
.sk-line.short { width: 60%; }

/* Spinner */
.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255,255,255,0.25);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ═══════════════════════════════════════════════════════
   TOAST
═══════════════════════════════════════════════════════ */
#toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  padding: 0.8125rem 1.125rem;
  border-radius: 12px;
  font-size: 0.875rem;
  font-weight: 500;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  box-shadow: 0 12px 32px rgba(0,0,0,0.45);
  animation: toastIn 0.3s ease;
  max-width: 340px;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.toast .toast-icon {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8125rem;
  font-weight: 800;
  flex-shrink: 0;
}
.toast.success { border-color: rgba(34,197,94,0.4); }
.toast.success .toast-icon { background: rgba(34,197,94,0.15); color: var(--success); }
.toast.error   { border-color: rgba(239,68,68,0.4); }
.toast.error   .toast-icon { background: rgba(239,68,68,0.12); color: var(--danger); }
.toast.info    { border-color: var(--border); }
.toast.info    .toast-icon { background: rgba(59,130,246,0.12); color: var(--accent-2); }
@keyframes toastIn {
  from { opacity: 0; transform: translateX(12px) scale(0.97); }
  to   { opacity: 1; transform: none; }
}

/* ═══════════════════════════════════════════════════════
   HAMBURGER & SIDEBAR OVERLAY
═══════════════════════════════════════════════════════ */
#btn-menu {
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  cursor: pointer;
  transition: all var(--transition);
  flex-shrink: 0;
}
#btn-menu:hover { background: var(--surface-2); border-color: var(--accent); }
#btn-menu:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
#btn-menu svg { pointer-events: none; }

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 99;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(3px);
  animation: overlayIn 0.2s ease;
}
.sidebar-overlay.visible { display: block; }
@keyframes overlayIn { from { opacity: 0; } to { opacity: 1; } }

/* ═══════════════════════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════════════════════ */
@media (max-width: 960px) {
  .dashboard-layout { grid-template-columns: 1fr; }
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.28s ease;
    z-index: 100;
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: 12px 0 40px rgba(0,0,0,0.5);
  }
  .main-content { margin-left: 0; }
  .topbar { padding: 0 1.25rem; }
  .view-body { padding: 1.25rem; }
  .profile-grid { grid-template-columns: 1fr; }
  #btn-menu { display: inline-flex; }
}

@media (max-width: 640px) {
  .cars-grid { grid-template-columns: 1fr; }
  .topbar-title { font-size: 1rem; }
  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .login-card { padding: 1.75rem 1.5rem; }
}

@media (max-width: 400px) {
  .stats-row { grid-template-columns: 1fr; }
}
