  :root {
    --navy:   #0a1628;
    --blue:   #1a3a6b;
    --mid:    #1e5fa8;
    --bright: #2e86de;
    --ice:    #5aacf5;
    --pale:   #c8e4fd;
    --white:  #f0f6ff;
    --accent: #f0a500;
    --red:    #e63946;
    --green:  #2ec4b6;
    --yellow: #f7c948;
    --text:   #d6e8fb;
    --muted:  #7baed4;
  }

  *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
  html { scroll-behavior: smooth; }
  body {
    font-family: 'Barlow', sans-serif;
    background: var(--navy);
    color: var(--white);
    overflow-x: hidden;
  }

  /* ── HEADER ── */
  header {
    position: fixed; top: 0; left: 0; right: 0; z-index: 100;
    background: rgba(10,22,40,.92);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(46,134,222,.25);
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 2.5rem; height: 64px;
  }
  .logo {
    display: flex; align-items: center; gap: .8rem;
    text-decoration: none;
  }
  .logo-icon {
    width: 36px; height: 36px;
    background: linear-gradient(135deg, var(--bright), var(--ice));
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 800; font-size: 1rem; color: var(--navy);
    flex-shrink: 0;
  }
  .logo-text {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 700; font-size: 1.1rem; color: var(--white); letter-spacing: .5px; line-height: 1.15;
  }
  .logo-text span { color: var(--ice); display: block; font-weight: 400; font-size: .75rem; letter-spacing: 2px; text-transform: uppercase; }
  nav { display: flex; gap: .25rem; }
  nav a {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 600; font-size: .9rem; letter-spacing: 1px; text-transform: uppercase;
    color: var(--muted); text-decoration: none;
    padding: .4rem .85rem; border-radius: 6px;
    transition: color .2s, background .2s;
  }
  nav a:hover, nav a.active { color: var(--white); background: rgba(46,134,222,.18); }
  nav a.active { color: var(--ice); }

  /* ── PAGE HERO ── */
  .page-hero {
    padding-top: 64px;
    background: linear-gradient(160deg, var(--navy) 0%, #0d2145 100%);
    border-bottom: 1px solid rgba(46,134,222,.2);
    position: relative; overflow: hidden;
  }
  .page-hero::before {
    content: '';
    position: absolute; inset: 0;
    background: radial-gradient(ellipse 60% 80% at 80% 50%, rgba(46,134,222,.08) 0%, transparent 60%);
  }
  .hero-grid {
    position: absolute; inset: 0; opacity: .03;
    background-image:
      linear-gradient(var(--bright) 1px, transparent 1px),
      linear-gradient(90deg, var(--bright) 1px, transparent 1px);
    background-size: 50px 50px;
  }
  .page-hero-inner {
    position: relative; z-index: 1;
    max-width: 1200px; margin: 0 auto;
    padding: 2.5rem 2.5rem 2rem;
  }
  .breadcrumb {
    display: flex; align-items: center; gap: .5rem;
    font-size: .75rem; color: var(--muted); margin-bottom: 1.25rem;
  }
  .breadcrumb a { color: var(--muted); text-decoration: none; }
  .breadcrumb a:hover { color: var(--ice); }
  .breadcrumb-sep { color: rgba(46,134,222,.4); }

  .page-title {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 800; font-size: clamp(1.8rem, 4vw, 2.8rem);
    line-height: 1; letter-spacing: -.5px; color: var(--white);
    margin-bottom: .6rem;
  }
  .page-meta {
    display: flex; gap: 1.5rem; flex-wrap: wrap;
    font-size: .8rem; color: var(--muted); margin-bottom: 1.75rem;
  }
  .page-meta span { display: flex; align-items: center; gap: .35rem; }

  /* ── TABS ── */
  .tabs-bar {
    display: flex; gap: 0;
    border-bottom: 1px solid rgba(46,134,222,.2);
    margin-top: .5rem;
    overflow-x: auto;
  }
  .tab-btn {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 700; font-size: .85rem; letter-spacing: 1px; text-transform: uppercase;
    padding: .75rem 1.5rem;
    color: var(--muted); background: none; border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer; white-space: nowrap;
    transition: color .2s, border-color .2s;
  }
  .tab-btn:hover { color: var(--ice); }
  .tab-btn.active { color: var(--ice); border-bottom-color: var(--bright); }

  /* ── LAYOUT ── */
  .layout {
    max-width: 1200px; margin: 0 auto; padding: 2rem 2.5rem 5rem;
    display: grid; grid-template-columns: 280px 1fr; gap: 2rem;
  }

  /* ── SIDEBAR ── */
  .sidebar { display: flex; flex-direction: column; gap: 1.25rem; }

  .sidebar-card {
    background: rgba(255,255,255,.03);
    border: 1px solid rgba(46,134,222,.18);
    border-radius: 12px; overflow: hidden;
  }
  .sidebar-card-title {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 700; font-size: .8rem; letter-spacing: 2px; text-transform: uppercase;
    color: var(--muted); padding: .85rem 1.25rem .6rem;
    border-bottom: 1px solid rgba(46,134,222,.12);
  }

  /* ES list */
  .es-list { list-style: none; padding: .5rem 0; }
  .es-item {
    display: flex; align-items: center; gap: .75rem;
    padding: .6rem 1.25rem;
    cursor: pointer;
    transition: background .15s;
    text-decoration: none; color: inherit;
  }
  .es-item:hover { background: rgba(46,134,222,.08); }
  .es-item.active { background: rgba(46,134,222,.15); }

  .es-status {
    width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0;
  }
  .es-status.done   { background: var(--green); }
  .es-status.live   { background: var(--yellow); box-shadow: 0 0 0 3px rgba(46,196,182,.25); animation: pulse 1.5s infinite; }
  .es-status.upcoming { background: rgba(46,134,222,.3); border: 1px solid rgba(46,134,222,.4); }
  .es-status.cancelled { background: var(--red); }
  .es-status.pending { background: var(--white); }

  .es-num {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 700; font-size: .85rem; color: var(--white); min-width: 28px;
  }
  .es-info { flex: 1; min-width: 0; }
  .es-name { font-size: .82rem; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .es-detail { font-size: .7rem; color: var(--muted); }

  .es-separator {
    padding: .5rem 1.25rem .25rem;
    font-size: .7rem; letter-spacing: 1.5px; text-transform: uppercase;
    color: rgba(46,134,222,.4); font-weight: 600;
  }

  /* doc list */
  .doc-list { list-style: none; padding: .4rem 0; }
  .doc-item {
    display: flex; align-items: center; gap: .75rem;
    padding: .55rem 1.25rem;
    cursor: pointer;
    font-size: .82rem; color: var(--muted);
    transition: color .15s, background .15s;
    text-decoration: none;
  }
  .doc-item:hover { color: var(--ice); background: rgba(46,134,222,.07); }
  .doc-icon { font-size: .85rem; opacity: .7; flex-shrink: 0; }

  /* legend */
  .legend { padding: .75rem 1.25rem; display: flex; flex-direction: column; gap: .45rem; }
  .legend-item { display: flex; align-items: center; gap: .65rem; font-size: .72rem; color: var(--muted); }

  /* ── CONTENT PANEL ── */
  .content-panel { min-width: 0; }

  .panel { display: none; }
  .panel.active { display: block; animation: fadeIn .25s ease; }

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

  /* ── HORAIRES TABLE ── */
  .section-label {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 700; font-size: .75rem; letter-spacing: 2px; text-transform: uppercase;
    color: var(--muted); margin-bottom: 1rem;
  }

  .horaires-table {
    width: 100%; border-collapse: collapse;
    font-size: .85rem;
  }
  .horaires-table th {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 700; font-size: .72rem; letter-spacing: 1.5px; text-transform: uppercase;
    color: var(--muted); padding: .6rem 1rem; text-align: left;
    border-bottom: 1px solid rgba(46,134,222,.2);
  }
  .horaires-table td {
    padding: .75rem 1rem; border-bottom: 1px solid rgba(46,134,222,.08);
    color: var(--text);
  }
  .horaires-table tr:hover td { background: rgba(46,134,222,.06); }
  .horaires-table .es-label {
    font-family: 'Barlow Condensed', sans-serif; font-weight: 700;
    color: var(--ice);
  }
  .horaires-table .km {
    color: var(--muted); font-size: .8rem;
  }
  .mono { font-variant-numeric: tabular-nums; font-size: .82rem; }

  /* ── CLASSEMENT (ES result) ── */
  .result-header {
    background: rgba(46,134,222,.08);
    border: 1px solid rgba(46,134,222,.2);
    border-radius: 10px; padding: 1.25rem 1.5rem;
    margin-bottom: 1.5rem;
  }
  .result-header h2 {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 800; font-size: 1.5rem; color: var(--white);
  }
  .result-header p { font-size: .82rem; color: var(--muted); margin-top: .3rem; }

  .podium {
    display: grid; grid-template-columns: repeat(3,1fr); gap: 1rem;
    margin-bottom: 1.75rem;
  }
  .podium-card {
    background: rgba(255,255,255,.04);
    border: 1px solid rgba(46,134,222,.18);
    border-radius: 10px; padding: 1rem 1.25rem;
    position: relative; overflow: hidden;
  }
  .podium-card.p1 {
    border-color: rgba(240,165,0,.4);
    background: linear-gradient(135deg, rgba(240,165,0,.08), rgba(255,255,255,.02));
  }
  .podium-card.p2 { border-color: rgba(90,172,245,.3); }
  .podium-card.p3 { border-color: rgba(90,172,245,.2); }

  .podium-rank {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 800; font-size: 2rem; line-height: 1;
    color: rgba(255,255,255,.08);
    position: absolute; top: .5rem; right: .75rem;
  }
  .podium-card.p1 .podium-rank { color: rgba(240,165,0,.2); }

  .podium-num {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 700; font-size: .7rem; letter-spacing: 1.5px;
    color: var(--muted); margin-bottom: .4rem;
  }
  .podium-driver {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 700; font-size: 1.05rem; color: var(--white); line-height: 1.2;
  }
  .podium-car { font-size: .75rem; color: var(--muted); margin: .2rem 0 .5rem; }
  .podium-time {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 700; font-size: 1.1rem; color: var(--ice);
  }
  .podium-card.p1 .podium-time { color: var(--accent); }
  .podium-gap { font-size: .72rem; color: var(--muted); margin-left: .3rem; }

  .filter-bar {
    display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: 1rem;
  }
  .filter-btn {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 600; font-size: .75rem; letter-spacing: 1px; text-transform: uppercase;
    padding: .35rem .85rem; border-radius: 100px;
    border: 1px solid rgba(46,134,222,.3);
    background: transparent; color: var(--muted); cursor: pointer;
    transition: all .15s;
  }
  .filter-btn:hover, .filter-btn.active {
    background: rgba(46,134,222,.2); color: var(--ice); border-color: rgba(46,134,222,.5);
  }

  .results-table {
    width: 100%; border-collapse: collapse; font-size: .82rem;
  }
  .results-table th {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 700; font-size: .7rem; letter-spacing: 1.5px; text-transform: uppercase;
    color: var(--muted); padding: .55rem .75rem; text-align: left;
    border-bottom: 2px solid rgba(46,134,222,.2);
    position: sticky; top: 0; background: var(--navy);
  }
  .results-table td {
    padding: .55rem .75rem; border-bottom: 1px solid rgba(46,134,222,.07);
    color: var(--text); vertical-align: middle;
  }
  .results-table tr:hover td { background: rgba(46,134,222,.05); }

  .rk { font-family: 'Barlow Condensed', sans-serif; font-weight: 700; color: var(--muted); text-align: center; width: 36px; }
  .rk.gold   { color: var(--accent); }
  .rk.silver { color: #a8c0d0; }
  .rk.bronze { color: #c49a6c; }

  .car-num {
    display: inline-flex; align-items: center; justify-content: center;
    background: rgba(46,134,222,.15); border: 1px solid rgba(46,134,222,.3);
    border-radius: 4px; width: 28px; height: 20px;
    font-family: 'Barlow Condensed', sans-serif; font-weight: 700; font-size: .75rem;
    color: var(--ice);
  }

  .driver-name { font-weight: 600; color: var(--white); }
  .codriver-name { font-size: .72rem; color: var(--muted); }
  .copilote-star { color: var(--ice); }

  .grp-badge {
    font-size: .68rem; letter-spacing: .5px; padding: .15rem .45rem;
    border-radius: 4px; font-weight: 600; background: rgba(46,134,222,.12);
    color: var(--muted); border: 1px solid rgba(46,134,222,.2);
  }

  .time-cell { font-variant-numeric: tabular-nums; color: var(--ice); font-weight: 600; }
  .time-leader { color: var(--accent); }
  .gap-cell { font-size: .78rem; color: var(--muted); font-variant-numeric: tabular-nums; }

  .section-sep {
    background: rgba(46,134,222,.08);
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 700; font-size: .7rem; letter-spacing: 2px; text-transform: uppercase;
    color: var(--muted); text-align: center;
  }
  .section-sep td { padding: .4rem; }

  /* ── PDF viewer ── */
  .pdf-wrap {
    background: rgba(255,255,255,.03);
    border: 1px solid rgba(46,134,222,.18);
    border-radius: 12px; overflow: hidden;
  }
  .pdf-toolbar {
    padding: .75rem 1.25rem;
    border-bottom: 1px solid rgba(46,134,222,.15);
    display: flex; align-items: center; justify-content: space-between;
    gap: 1rem;
  }
  .pdf-title {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 700; font-size: .85rem; color: var(--ice); letter-spacing: .5px;
  }
  .pdf-actions { display: flex; gap: .5rem; }
  .pdf-btn {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 600; font-size: .72rem; letter-spacing: 1px; text-transform: uppercase;
    padding: .3rem .75rem; border-radius: 6px;
    background: rgba(46,134,222,.15); border: 1px solid rgba(46,134,222,.3);
    color: var(--ice); cursor: pointer; text-decoration: none;
    transition: background .15s;
  }
  .pdf-btn:hover { background: rgba(46,134,222,.3); }
  iframe.pdf-frame {
    width: 100%; height: 650px; border: none; display: block;
    background: #fff;
  }

  /* ── LOADING ── */
  .loading-wrap {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    min-height: 240px; gap: 1rem; color: var(--muted);
  }
  .spinner {
    width: 36px; height: 36px;
    border: 3px solid rgba(46,134,222,.2);
    border-top-color: var(--bright);
    border-radius: 50%;
    animation: spin .8s linear infinite;
  }
  @keyframes spin { to { transform: rotate(360deg); } }

  /* ── ERROR STATE ── */
  .error-wrap {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    min-height: 200px; gap: .75rem; color: var(--muted); text-align: center; padding: 2rem;
  }
  .error-icon { font-size: 2.5rem; }
  .error-title { font-family: 'Barlow Condensed', sans-serif; font-weight: 700; font-size: 1.1rem; color: var(--text); }
  .error-desc { font-size: .82rem; line-height: 1.6; max-width: 340px; }

  /* ── ANIMATIONS ── */
  @keyframes pulse {
    0%,100% { opacity:1; } 50% { opacity:.4; }
  }

  /* ── RESPONSIVE ── */
  @media (max-width: 900px) {
    .layout { grid-template-columns: 1fr; }
    .podium { grid-template-columns: 1fr; }
    header { padding: 0 1.25rem; }
    nav a { font-size: .78rem; padding: .35rem .55rem; }
    .page-hero-inner { padding: 2rem 1.25rem 1.5rem; }
    .layout { padding: 1.5rem 1.25rem 4rem; }
  }
  @media (max-width: 600px) {
    .podium { grid-template-columns: 1fr; }
    .filter-bar { display: none; }
    .results-table .grp-col, .results-table .cls-col { display: none; }
  }