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

  :root {
    --bg: #F5F5F7;
    --card: #FFFFFF;
    --text: #1D1D1F;
    --muted: #6E6E73;
    --border: #E5E5EA;
    --accent: #C00000;
    --green: #1A9E4A;
    --red: #D93025;
    --blue: #0055CC;
    --orange: #D4680A;
    --se-green: #1A9E4A;
    --gold: #B8860B;
    --radius: 18px;
    --shadow: 0 2px 16px rgba(0,0,0,0.07);
  }

  body {
    font-family: 'DM Sans', system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
  }

  /* ─── NAV ─── */
  nav {
    background: rgba(255,255,255,0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 0 32px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  .nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 16px;
    letter-spacing: -0.3px;
    color: var(--text);
    text-decoration: none;
  }

  .nav-brand .dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--accent);
  }

  .market-toggle {
    display: flex;
    background: var(--bg);
    border-radius: 10px;
    padding: 3px;
    gap: 2px;
  }

  .market-btn {
    padding: 5px 14px;
    border-radius: 8px;
    border: none;
    background: transparent;
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    color: var(--muted);
    cursor: pointer;
    transition: all 0.15s;
    text-decoration: none;
    display: inline-block;
  }

  .market-btn.active {
    background: white;
    color: var(--text);
    box-shadow: 0 1px 4px rgba(0,0,0,0.1);
  }

  .nav-meta {
    font-size: 12px;
    color: var(--muted);
  }

  /* ─── LAYOUT ─── */
  .container {
    max-width: 1160px;
    margin: 0 auto;
    padding: 0 32px;
  }

  /* ─── HERO ─── */
  .hero {
    padding: 48px 0 32px;
  }

  .hero h1 {
    font-size: 42px;
    font-weight: 700;
    letter-spacing: -0.8px;
    line-height: 1.1;
    margin-bottom: 8px;
  }

  .hero p {
    font-size: 17px;
    color: var(--muted);
    font-weight: 400;
  }

  /* ─── KPI ROW ─── */
  .kpi-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 48px;
  }

  .kpi-card {
    background: var(--card);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
  }

  .kpi-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
  }

  .kpi-value {
    font-size: 32px;
    font-weight: 700;
    letter-spacing: -0.5px;
    font-variant-numeric: tabular-nums;
    line-height: 1;
    margin-bottom: 6px;
  }

  .kpi-sub {
    font-size: 13px;
    color: var(--muted);
    display: flex;
    align-items: center;
    gap: 4px;
  }

  .kpi-sub .up { color: var(--green); font-weight: 600; }
  .kpi-sub .down { color: var(--red); font-weight: 600; }

  /* ─── MODEL SECTIONS ─── */
  .model-section {
    margin-bottom: 8px;
  }

  .model-section--divided {
    border-top: 2px solid var(--border);
    padding-top: 36px;
    margin-top: 12px;
  }

  .section-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 24px;
  }

  .subgroup-header {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 14px;
    margin-top: 4px;
  }

  /* ─── MODEL GRID ─── */
  .model-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 28px;
  }

  .model-grid--subgap {
    margin-bottom: 32px;
  }

  .model-card {
    background: var(--card);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
    text-decoration: none;
    color: inherit;
    display: block;
  }

  .model-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(0,0,0,0.10);
  }

  .model-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
  }

  .model-name {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.2px;
  }

  .model-link {
    font-size: 13px;
    color: var(--accent);
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
  }

  .model-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 16px;
  }

  .stat-item {}
  .stat-label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.4px; font-weight: 500; margin-bottom: 3px; }
  .stat-value { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -0.3px; }
  .stat-value.price { font-size: 18px; }

  /* ─── SPARKLINE ─── */
  .sparkline-wrap {
    height: 44px;
    margin-bottom: 14px;
  }

  svg.spark { width: 100%; height: 100%; overflow: visible; }

  .model-footer {
    display: flex;
    gap: 16px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
    font-size: 12px;
    color: var(--muted);
  }

  .model-footer span strong {
    color: var(--text);
    font-weight: 600;
  }

  /* ─── DETAIL PAGE ─── */
  .back-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: var(--accent);
    font-weight: 600;
    cursor: pointer;
    padding: 0;
    background: none;
    border: none;
    font-family: inherit;
    margin-bottom: 20px;
    margin-top: 36px;
    text-decoration: none;
  }

  .back-btn:hover { opacity: 0.7; }

  .detail-hero {
    margin-bottom: 32px;
  }

  .detail-hero h1 {
    font-size: 38px;
    font-weight: 700;
    letter-spacing: -0.6px;
    margin-bottom: 6px;
  }

  .detail-meta {
    font-size: 15px;
    color: var(--muted);
    display: flex;
    gap: 16px;
    align-items: center;
  }

  .detail-meta span::before {
    content: '·';
    margin-right: 16px;
  }
  .detail-meta span:first-child::before { content: ''; margin: 0; }

  /* ─── CHART CARD ─── */
  .chart-card {
    background: var(--card);
    border-radius: var(--radius);
    padding: 28px;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
  }

  .chart-card h3 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 4px;
  }

  .chart-subtitle {
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 20px;
  }

  /* ─── SCATTER ─── */
  .scatter-container {
    position: relative;
    height: 360px;
  }

  .scatter-tooltip {
    position: absolute;
    background: var(--text);
    color: white;
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 13px;
    line-height: 1.6;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s;
    white-space: nowrap;
    z-index: 10;
  }

  .scatter-tooltip.visible { opacity: 1; }

  .scatter-legend {
    display: flex;
    gap: 20px;
    margin-top: 14px;
    flex-wrap: wrap;
  }

  .legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--muted);
  }

  .legend-dot {
    width: 10px; height: 10px;
    border-radius: 50%;
  }

  .legend-sq {
    width: 10px; height: 10px;
    border-radius: 2px;
  }

  /* ─── INFO CARD (expanded on click) ─── */
  .car-info-card {
    background: var(--bg);
    border-radius: 12px;
    padding: 18px 20px;
    margin-top: 16px;
    display: none;
    animation: fadeIn 0.2s ease;
  }

  .car-info-card.visible { display: flex; justify-content: space-between; align-items: center; }

  @keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

  .car-info-left .car-title { font-size: 16px; font-weight: 700; margin-bottom: 6px; }
  .car-info-left .car-specs { font-size: 13px; color: var(--muted); line-height: 1.8; }
  .car-info-left .car-specs strong { color: var(--text); font-weight: 600; }

  .annons-btn {
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 10px;
    padding: 10px 20px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
  }

  .annons-btn:hover { opacity: 0.9; }

  /* ─── LINE CHARTS ─── */
  .chart-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
  }

  svg.linechart { width: 100%; height: 200px; overflow: visible; }
  svg.areachart { width: 100%; height: 200px; overflow: visible; }

  .axis-label {
    font-family: 'DM Mono', monospace;
    font-size: 10px;
    fill: var(--muted);
  }

  /* ─── TABLE ─── */
  .table-card {
    background: var(--card);
    border-radius: var(--radius);
    padding: 0;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
    overflow: hidden;
  }

  .table-card-header {
    padding: 22px 24px 16px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  .table-card-header h3 { font-size: 16px; font-weight: 700; }

  .badge {
    background: var(--bg);
    border-radius: 20px;
    padding: 3px 10px;
    font-size: 12px;
    font-weight: 600;
    color: var(--muted);
  }

  table {
    width: 100%;
    border-collapse: collapse;
  }

  th {
    font-size: 11px;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 10px 24px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    white-space: nowrap;
  }

  th:hover { color: var(--text); }

  td {
    padding: 13px 24px;
    font-size: 14px;
    border-bottom: 1px solid var(--border);
    font-variant-numeric: tabular-nums;
  }

  tr:last-child td { border-bottom: none; }
  tr:hover td { background: #FAFAFA; }

  .pts-badge {
    display: inline-block;
    background: #FFF3CC;
    color: #8B6500;
    border: 1px solid #E8CC66;
    border-radius: 5px;
    padding: 1px 6px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.3px;
  }

  .market-tag {
    display: inline-block;
    border-radius: 5px;
    padding: 2px 7px;
    font-size: 11px;
    font-weight: 700;
  }

  .market-tag.de { background: #E8F0FF; color: var(--blue); }
  .market-tag.nl { background: #FFF0E0; color: var(--orange); }
  .market-tag.se { background: #E8F8EF; color: var(--se-green); }

  .link-btn {
    color: var(--accent);
    font-weight: 600;
    font-size: 13px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 3px;
  }

  /* ─── BOTTOM SPACER ─── */
  .spacer { height: 60px; }

  /* ─── RESPONSIVE ─── */
  @media (max-width: 900px) {
    nav { padding: 0 20px; }
    .container { padding: 0 20px; }
    .kpi-row { grid-template-columns: repeat(2, 1fr); }
    .model-grid { grid-template-columns: 1fr; }
    .chart-row { grid-template-columns: 1fr; }
    .hero h1 { font-size: 30px; }
    .detail-hero h1 { font-size: 26px; }
    .kpi-value { font-size: 26px; }
  }

/* ─── LOGIN PAGE ─── */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 40px 48px;
  width: 100%;
  max-width: 400px;
}

.login-card h1 {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 6px;
  letter-spacing: -0.3px;
}

.login-card .subtitle {
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 28px;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.form-group input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
  font-family: inherit;
  font-size: 15px;
  color: var(--text);
  background: white;
  outline: none;
  transition: border-color 0.15s;
}

.form-group input:focus { border-color: var(--accent); }

.login-btn {
  width: 100%;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 10px;
  padding: 12px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 8px;
}

.login-btn:hover { opacity: 0.9; }

.login-error {
  background: #FFF0EE;
  border: 1px solid #FFCDC8;
  color: var(--red);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 14px;
  margin-bottom: 16px;
}

/* ─── NAV LOGOUT ─── */
.nav-logout {
  font-size: 13px;
  color: var(--muted);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
}
.nav-logout:hover { color: var(--text); }

/* ─── CHART NOTE ─── */
.chart-note {
  font-size: 12px;
  color: var(--muted);
  margin-top: 10px;
}

/* ─── EMPTY STATE ─── */
.empty-state {
  text-align: center;
  padding: 40px;
  color: var(--muted);
  font-size: 15px;
}

/* ─── SORT INDICATOR ─── */
th.sort-asc::after { content: ' ↑'; }
th.sort-desc::after { content: ' ↓'; }
