/* =======================================================
   GP Manager 2026 — style.refactor.css
   Generated: 2025-09-24 08:10:32
   Notes:
   - Based on: style.css
   - Dark Mode (mobile) media blocks grouped at the end (content unchanged).
   - Duplicate selectors in base marked with comments (nothing deleted).
   ======================================================= */
/* =========================
   Base + Components (original order)
   ========================= */
@font-face{
  font-family:"MotoGP Display";
  src:url('../fonts/MotoGPDisplay-Bold.woff') format('woff');
  font-weight:700;
  font-style:normal;
}
*{box-sizing:border-box}
html,body{height:100%;margin:0}
body{font-family:"MotoGP Display",system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;color:#000;background:#fff;}
a{text-decoration:none}

/* ===== Mercado layout ===== */
body.market-page{
  --team-panel-mobile-top: 96px;
  display:block;
  min-height:auto;
  overflow:auto;
}
body.market-page .main-wrap{
  display:block;
  width:100%;
  max-width:1140px;
  padding-left:1.5rem;
  padding-right:1.5rem;
  overflow:visible;
  margin-left:auto;
  margin-right:auto;
}
@media (max-width:575.98px){
  body.market-page{
    min-height:auto;
    overflow:auto;
  }
  body.market-page .main-wrap{
    padding-left:1rem;
    padding-right:1rem;
    display:block;
    overflow:visible;
  }
  body.market-page .market-row{
    display:block;
    min-height:auto;
  }
}
body.market-page .market-status-bar{flex-shrink:0;}
body.market-page .market-row{
  display:block;
  min-height:auto;
}
body.market-page .left-pane,
body.market-page .right-pane{
  min-height:auto;
}
body.market-page .right-pane{
  display:block;
  gap:1.5rem;
}

@media (min-width:1000px){
  body.market-page{
    display:flex;
    flex-direction:column;
    min-height:100vh;
    overflow:hidden;
  }
  body.market-page .main-wrap{
    flex:1 1 auto;
    display:flex;
    flex-direction:column;
    overflow:hidden;
  }
  body.market-page .market-row{
    display:flex;
    flex-wrap:wrap;
    flex:1 1 auto;
    min-height:0;
  }
  body.market-page .left-pane,
  body.market-page .right-pane{
    min-height:0;
  }
  body.market-page .left-pane{
    flex:0 0 66.666%;
    max-width:66.666%;
    display:flex;
    flex-direction:column;
    gap:1.5rem;
  }
  body.market-page .right-pane{
    flex:0 0 33.333%;
    max-width:33.333%;
    display:flex;
    flex-direction:column;
    gap:1.5rem;
  }
}
body.market-page .market-status-bar {
  display:flex;
  align-items:center;
  gap:0.75rem;
  flex-wrap:nowrap;
  padding:0;
}
body.market-page .market-status-bar .badge {
  font-size:0.9rem;
  padding:0.3em 0.6em;
  font-weight:600;
  letter-spacing:0.05em;
}
body.market-page .market-status-text {
  display:flex;
  align-items:center;
  gap:0.35rem;
  flex-wrap:nowrap;
  flex:1 1 auto;
  min-width:0;
}
body.market-page .market-status-label {
  font-size:1rem;
  font-weight:700;
  letter-spacing:0.06em;
  color:#343a40;
  white-space:nowrap;
}
body.market-page .market-status-timer {
  font-size:1rem;
  font-weight:600;
  font-variant-numeric:tabular-nums;
  letter-spacing:0.06em;
  color:#212529;
  white-space:nowrap;
}
.market-top-sticky{
  background:var(--bs-body-bg,#fff);
}
.market-top-sticky .market-status-bar{
  margin-bottom:.75rem;
}

@media (max-width: 999.98px) {
  .market-top-sticky{
    position:sticky;
    top:0;
    z-index:30;
    padding-top:.5rem;
    padding-bottom:.75rem;
    box-shadow:0 6px 12px rgba(0,0,0,0.06);
  }
  .market-top-sticky::after{
    content:"";
    display:block;
    height:1px;
    background:rgba(0,0,0,.06);
    margin-top:.5rem;
  }
}

@media (min-width: 1000px) {
  .market-top-sticky{
    position:static;
    box-shadow:none;
    padding-top:0;
    padding-bottom:1rem;
  }
}

.theme-dark .market-top-sticky{
  background:#0f0f10;
}
.theme-dark .market-top-sticky::after{
  background:rgba(255,255,255,0.08);
}
.theme-dark body.market-page .market-status-label {
  color:#f1f3f5;
}
.theme-dark body.market-page .market-status-timer,
.theme-dark body.market-page #marketTimer {
  color:#f8f9fa;
}
.theme-dark body.market-page #marketBadge {
  background-color:#198754 !important;
  color:#fff !important;
}
@media (min-width:576px){
  body.market-page .market-status-text { gap:0.6rem; }
}
.theme-dark .market-status-label { color:#f1f3f5; }
.theme-dark .market-status-timer { color:#f8f9fa; }

body.market-page .team-sticky{
  flex:0 0 auto;
  display:flex;
  flex-direction:column;
  min-height:0;
  max-height:590px;
  background-color:#f8f9fa;
  border:1px solid #e9ecef;
  border-radius:var(--bs-card-border-radius, .5rem);
  overflow:hidden;
}
body.market-page .team-sticky .card-body{
  flex:1 1 auto;
  min-height:0;
  overflow:auto;
  padding:0.75rem 1rem 0.5rem;
}
body.market-page .team-sticky .card-footer{
  flex:0 0 auto;
  padding:0.6rem 1rem 0.4rem;
  background-color:#f8f9fa;
  border-top:1px solid #e9ecef;
}
body.market-page .team-sticky .card-footer .fw-semibold{
  color:#5c6269;
  font-size:0.9rem;
  font-weight:600;
}
body.market-page .team-sticky .card-footer .fw-semibold span{
  color:#000;
  font-size:1rem;
  font-weight:600;
}
body.market-page .team-sticky .dist-row{
  gap:0.4rem;
  margin-bottom:0.2rem;
}
body.market-page .team-sticky .card-footer .row:last-child{
  margin-bottom:0;
}
body.market-page .team-sticky .dist-row .label{
  color:#5c6269;
  font-size:0.9rem;
  font-weight:600;
}
body.market-page .team-sticky .dist-row .value{
  color:#000;
  font-size:1rem;
  font-weight:600;
}
body.market-page .team-index{
  color:#6c757d;
  font-size:0.92rem;
}
body.market-page .pilots-card{
  flex:1 1 auto;
  display:flex;
  flex-direction:column;
  min-height:0;
}
body.market-page .pilots-card .card-body{
  flex:1 1 auto;
  display:flex;
  flex-direction:column;
  min-height:0;
}
body.market-page .pilots-scroll{
  flex:1 1 auto;
  min-height:0;
  overflow-x:auto;
  overflow-y:visible;
}
body.market-page .pilots-scroll .table-responsive{
  overflow:visible !important;
}
body.market-page .pilots-scroll table{
  position:relative;
  border-collapse:separate;
}
body.market-page .pilots-scroll table thead th{
  position:sticky;
  top:0;
  z-index:4;
  background-color:var(--bs-body-bg,#fff);
  box-shadow:0 1px 0 rgba(0,0,0,0.08);
}
body.market-page .pilots-scroll table thead{
  position:sticky;
  top:0;
  z-index:3;
}
body.market-page .pilots-scroll table thead tr th:first-child{
  left:0;
}
body.market-page .pilots-scroll .table-responsive{
  height:100%;
  margin-bottom:0;
}
body.market-page .best-drivers-card{
  flex:1 1 auto;
  display:flex;
  flex-direction:column;
  min-height:0;
}
body.market-page .best-drivers-card .card-body{
  flex:1 1 auto;
  min-height:0;
  display:flex;
  flex-direction:column;
}
body.market-page .best-drivers-card .best-scroll{
  flex:1 1 auto;
  min-height:0;
  overflow:auto;
}
body.market-page .best-drivers-card table thead th{
  font-size:0.85rem;
}
body.market-page .best-drivers-card table tbody td{
  font-size:0.95rem;
}
@media (max-width: 991.98px) {
  body.market-page .best-drivers-card table thead th,
  body.market-page .best-drivers-card table tbody td {
    display:table-cell !important;
  }
}
.team-list .team-item{
  padding:0.35rem 0;
  gap:0.5rem;
  border-bottom:1px solid var(--bs-border-color,#dee2e6);
}
.team-list .team-item:last-child{ border-bottom:none; }
.team-list .team-name{ font-size:0.95rem; font-weight:600; }
.team-list .badge-cat{
  font-size:0.7rem;
  letter-spacing:0.05em;
  text-transform:uppercase;
}
.team-list .team-price{
  font-size:0.95rem;
  font-variant-numeric:tabular-nums;
  letter-spacing:0.05em;
  min-width:82px;
  text-align:right;
}
.btn-save-dirty{
  background-color:#198754!important;
  border-color:#198754!important;
  color:#fff!important;
}
body.market-page .mini-team-card{
  border:none;
  box-shadow:none;
  background:transparent;
}
body.market-page .mini-team-card .card-body{
  padding:0;
}
body.market-page .mini-team-card .btn-team-action{
  width:100%;
  padding:0.45rem 0.75rem;
  font-size:0.85rem;
  border-radius:0.6rem;
}

body.market-page .btn-pilot-action{
  min-width:86px;
  font-weight:600;
  border-radius:0.55rem;
  border:1px solid #343a40;
  color:#343a40;
  background:#fff;
  transition:background-color .15s ease, color .15s ease, border-color .15s ease;
}
body.market-page .btn-pilot-action .action-label{ display:inline; }
body.market-page .btn-pilot-action.btn-add{
  border-color:#198754;
  color:#198754;
}
body.market-page .btn-pilot-action.btn-add:hover{ background:#198754; color:#fff; }
body.market-page .btn-pilot-action.btn-remove{
  border-color:#dc3545;
  color:#dc3545;
}
body.market-page .btn-pilot-action.btn-remove:hover{ background:#dc3545; color:#fff; }
body.market-page .btn-pilot-action.btn-disabled{
  border-color:#adb5bd;
  color:#adb5bd;
  cursor:not-allowed;
}
body.market-page .btn-pilot-action.btn-disabled:hover{ background:#f8f9fa; color:#adb5bd; }
body.market-page .btn-pilot-action:disabled{
  opacity:1;
}

@media (max-width: 991.98px) {
  body.market-page .best-drivers-card .btn-pilot-action{
    min-width:28px;
    width:28px;
    height:28px;
    padding:0;
    display:flex;
    align-items:center;
    justify-content:center;
    border-radius:0.5rem;
    margin-inline:auto;
  }
  body.market-page .best-drivers-card .btn-pilot-action .action-label{ display:none; }
  body.market-page .best-drivers-card td:last-child,
  body.market-page .best-drivers-card th:last-child{
    text-align:center;
  }
  body.market-page .best-drivers-card .btn-pilot-action.btn-add{
    background:#198754;
    color:#fff;
    border-color:#198754;
  }
  body.market-page .best-drivers-card .btn-pilot-action.btn-remove{
    background:#dc3545;
    color:#fff;
    border-color:#dc3545;
  }
  body.market-page .best-drivers-card .btn-pilot-action.btn-disabled{
    background:#adb5bd;
    color:#fff;
    border-color:#adb5bd;
  }
  body.market-page .best-drivers-card .btn-pilot-action.btn-disabled:disabled{
    opacity:0.7;
  }
}

@media (max-width: 767.98px) and (min-width: 576px) {
  body.market-page .table-pilotos td,
  body.market-page .table-pilotos th {
    font-size:0.88rem;
    padding:0.45rem 0.45rem;
  }
  body.market-page .btn-pilot-action{
    min-width:72px;
    padding:0.3rem 0.5rem;
  }
  .market-top-sticky .mini-team-card .card-body{
    display:flex !important;
    flex-direction:row !important;
    align-items:stretch !important;
    flex-wrap:nowrap !important;
    justify-content:space-between !important;
    gap:0.35rem;
  }
  .market-top-sticky .mini-team-card .btn-team-action{
    flex:1 1 calc(50% - 0.175rem);
    max-width:calc(50% - 0.175rem);
    width:auto;
    padding:0.25rem 0.4rem !important;
    font-size:0.8rem !important;
    line-height:1.1 !important;
    height:36px !important;
    display:flex !important;
    align-items:center;
    justify-content:center;
  }
}

body .chart-scroll{
  overflow-x:auto;
  -webkit-overflow-scrolling:touch;
}
body .chart-scroll .chart-inner{
  min-width:100%;
  height:300px;
}

@media (max-width: 575.98px) {
  body.market-page #tablaPilotos thead th:nth-child(3),
  body.market-page #tablaPilotos tbody td:nth-child(3) {
    display:none;
  }
  body .chart-scroll .chart-inner{
    width:670px;
    min-width:670px;
    height:300px;
  }
  body.market-page #posicionChart,
  body.cam .chart-header { /* placeholder to inspect */ }
  body .chart-controls{
    flex-direction:column !important;
    align-items:stretch !important;
    gap:0.5rem !important;
  }
  body .chart-controls > h2{
    margin-bottom:0;
  }
  body .chart-controls > div{
    align-self:flex-end;
    width:100%;
    display:flex;
    justify-content:flex-end;
  }
  body .chart-controls select{
    width:100%;
  }
  body.market-page .left-pane,
  body.market-page .right-pane {
    display:block;
    min-height:auto;
  }
  body.market-page .pilots-card{
    display:block;
    min-height:auto;
  }
  body.market-page .pilots-scroll{
    max-height:none;
    overflow:visible;
  }
  body.market-page .pilots-card .card-body{
    display:block;
    min-height:auto;
  }
  body.market-page .market-row{
    display:block;
    min-height:auto;
  }
  body.market-page #kpiRow .kpi-cell,
  #kpiRowMobile .kpi-cell{
    flex:0 0 100%;
    max-width:100%;
  }
  body.market-page #kpiRow .kpi-cell:nth-child(-n+3),
  #kpiRowMobile .kpi-cell:nth-child(-n+3){
    flex:0 0 33.333%;
    max-width:33.333%;
  }
  body.market-page #kpiRow .kpi-cell:nth-child(4),
  #kpiRowMobile .kpi-cell:nth-child(4){
    flex:0 0 100%;
    max-width:100%;
  }
  body.market-page #kpiRow .card,
  #kpiRowMobile .card {
    min-height:82px;
    padding:0.45rem 0.2rem;
  }
  body.market-page .kpi-mini .card-body{
    padding:0.2rem 0.2rem;
  }
  body.market-page #kpiRow .kpi-value,
  #kpiRowMobile .kpi-value{
    font-size:1.2rem;
  }
  body.market-page #kpiRow .kpi-label,
  #kpiRowMobile .kpi-label{
    font-size:0.9rem;
  }
  body.market-page #kpiRow .mini-team-card .card-body,
  #kpiRowMobile .mini-team-card .card-body{
    padding:0.2rem 0.2rem;
  }
  #kpiRowMobile .mini-team-card .card-body,
  .market-top-sticky .mini-team-card .card-body{
    display:flex !important;
    flex-direction:row !important;
    align-items:stretch !important;
    flex-wrap:nowrap !important;
    justify-content:space-between !important;
    gap:0.5rem;
  }
  #kpiRowMobile .mini-team-card .btn-team-action,
  .market-top-sticky .mini-team-card .btn-team-action{
    flex:1 1 calc(50% - 0.175rem);
    max-width:calc(50% - 0.175rem);
    width:auto;
    padding:0.25rem 0.4rem !important;
    font-size:0.8rem !important;
    line-height:1.1 !important;
    height:36px !important;
    display:flex !important;
    align-items:center;
    justify-content:center;
  }
}

body.market-page .table-pilotos td,
body.market-page .table-pilotos th{
  font-size:0.9rem;
  padding:0.4rem 0.35rem;
}

@media (max-width: 575.98px) {
  body .team-table thead th:nth-child(3),
  body .team-table tbody td:nth-child(3) {
    display:none;
  }
}
body.market-page .table-pilotos .pilot-name{ font-size:0.82rem; }
body.market-page .table-pilotos .pilot-modal-trigger,
#tablaTop10 .pilot-modal-trigger{
  cursor: pointer;
  text-decoration: underline;
}
body.market-page .table-pilotos .pilot-modal-trigger:focus,
#tablaTop10 .pilot-modal-trigger:focus{
  outline: 2px solid #212529;
  outline-offset: 2px;
}

.rider-modal-content .modal-header{border:0;padding-bottom:0;}
.rider-modal-content .modal-body{padding-top:0;}
.rider-modal-top{display:flex;flex-direction:column;gap:1.5rem;}
.rider-modal-photo{flex:0 0 auto;max-width:220px;}
.rider-modal-photo img{width:100%;height:auto;max-height:320px;object-fit:cover;border-radius:14px;}
.rider-modal-main{display:flex;flex-direction:column;gap:1.25rem;}
.rider-modal-head{display:flex;flex-wrap:wrap;gap:1rem;align-items:center;}
.rider-modal-number{background:#212529;color:#fff;border-radius:12px;padding:0.4rem 0.9rem;font-weight:700;font-size:1.1rem;letter-spacing:0.05em;}
.rider-modal-names h3{margin:0;font-size:1.5rem;}
.rider-modal-names .aka{font-size:0.75rem;letter-spacing:0.1em;text-transform:uppercase;color:#6c757d;}
.rider-modal-team{display:inline-flex;align-items:center;gap:0.4rem;padding:0.25rem 0.7rem;border-radius:999px;font-size:0.75rem;font-weight:600;}
.rider-modal-team .chip-dot{width:8px;height:8px;border-radius:50%;background:currentColor;display:inline-block;}
.rider-modal-meta{columns:1;column-gap:1.25rem;}
.rider-modal-meta li{break-inside:avoid;margin-bottom:0.35rem;}
.rider-season-block .title{font-size:0.78rem;letter-spacing:0.08em;text-transform:uppercase;color:#6c757d;margin-bottom:0.5rem;}
.rider-season-summary{display:flex;flex-wrap:wrap;gap:0.75rem;font-size:0.85rem;}
.rider-season-summary .pill{padding:0;border-radius:0;background:transparent;font-weight:500;color:#495057;}
.rider-season-summary .pill .pill-label{color:#6c757d;font-weight:500;margin-right:0.25rem;}
.rider-season-summary .pill .pill-value{color:#212529;font-weight:700;font-size:0.95rem;}
.rider-results-table thead th{text-transform:uppercase;font-size:0.78rem;letter-spacing:0.08em;}
.rider-results-table tbody td{font-weight:600;font-size:0.9rem;}

@media (min-width:768px){
  .rider-modal-top{flex-direction:row;}
  .rider-modal-meta{columns:2;}
}

@media (max-width:768px){
  .rider-modal-photo{max-width:200px;margin:0 auto;}
  .rider-modal-number{font-size:1rem;}
  .rider-modal-names h3{font-size:1.25rem;}
}

@media (max-width:576px){
  .rider-modal-photo{max-width:200px;margin:0 auto;}
  .rider-modal-number{font-size:0.95rem;}
  .rider-modal-names h3{font-size:1.1rem;}
  .rider-modal-meta{columns:1;}
}

@media (max-width:420px){
  .rider-modal-number{font-size:0.9rem;}
}
  body.market-page .table-pilotos .pilot-flag{ display:none !important; }
  body.market-page .btn-pilot-action{
    min-width:auto;
    width:28px;
    height:28px;
    padding:0;
    display:flex;
    align-items:center;
    justify-content:center;
    border-radius:0.5rem;
    margin-inline:auto;
  }
  body.market-page #tablaPilotos th:last-child,
  body.market-page #tablaPilotos td:last-child {
    text-align:center;
  }
  body.market-page .btn-pilot-action .action-label{ display:none; }
  body.market-page .btn-pilot-action.btn-add{
    background:#198754;
    color:#fff;
    border-color:#198754;
  }
  body.market-page .btn-pilot-action.btn-remove{
    background:#dc3545;
    color:#fff;
    border-color:#dc3545;
  }
  body.market-page .btn-pilot-action.btn-disabled{
    background:#adb5bd;
    color:#fff;
    border-color:#adb5bd;
  }
  body.market-page .btn-pilot-action.btn-disabled:disabled{ opacity:0.7; }
}
.table-pilotos .pilot-name-wrap{
  display:flex;
  align-items:center;
  gap:0.65rem;
}
.table-pilotos .pilot-flag{
  width:24px;
  height:16px;
  border:1px solid rgba(140,140,140,.4);
  border-radius:2px;
  object-fit:cover;
  background:#fff;
}

/* ===== GP PAGE ===== */
body.gp-page{
  min-height:100vh;
  background:var(--bs-body-bg,#fff);
}
body.gp-page .gp-topbar{
  background:var(--bs-body-bg,#fff);
}
.theme-dark body.gp-page .gp-topbar{
  background:#0f0f10;
}
body.gp-page .gp-flag{
  width:36px;
  height:24px;
  object-fit:cover;
  border-radius:4px;
  border:1px solid rgba(0,0,0,.1);
}
body.gp-page #gpCountdown{
  font-size:1.5rem;
  font-weight:700;
}
body.gp-page .gp-hero-card .gp-map-wrap{
  background:transparent;
  border-radius:12px;
  padding:10px;
  text-align:center;
}
.theme-dark body.gp-page .gp-hero-card .gp-map-wrap{
  background:transparent;
}
body.gp-page .gp-meta-label{
  font-size:.75rem;
  text-transform:uppercase;
  letter-spacing:.08em;
  color:#6c757d;
}
body.gp-page .gp-meta-value{
  font-size:1.05rem;
  font-weight:600;
}
.theme-dark body.gp-page .gp-meta-label{ color:#9aa0ad; }

body.gp-page .gp-compare-table tr.compare-shared{ background:#e9f7ef; }
body.gp-page .gp-compare-table tr.compare-mine{ background:#e7f1ff; }
body.gp-page .gp-compare-table tr.compare-rival{ background:#fcebea; }
.theme-dark body.gp-page .gp-compare-table tr.compare-shared{ background:rgba(33, 150, 83, 0.25); }
.theme-dark body.gp-page .gp-compare-table tr.compare-mine{ background:rgba(13, 110, 253, 0.18); }
.theme-dark body.gp-page .gp-compare-table tr.compare-rival{ background:rgba(220, 53, 69, 0.18); }

body.gp-page .gp-team-table td,
body.gp-page .gp-team-table th{
  font-size:0.9rem;
  padding:0.6rem 0.75rem;
}

body.gp-page .gp-picker select{
  min-width:200px;
}

@media (max-width: 767.98px){
  body.gp-page .gp-topbar{
    position:sticky;
    top:0;
    z-index:20;
    padding:0.75rem 0;
    box-shadow:0 6px 12px rgba(0,0,0,0.08);
  }
  .theme-dark body.gp-page .gp-topbar{
    box-shadow:0 6px 12px rgba(0,0,0,0.35);
  }
}

/* ===== RIVALS PAGE ===== */
body.rivals-page{
  background:var(--bs-body-bg,#fff);
}
body.rivals-page .selector-card .form-select{
  min-width:220px;
}
body.rivals-page .rivals-grid{
  align-items:stretch;
}
body.rivals-page .rival-card .rival-title{
  letter-spacing:.08em;
}
body.rivals-page .rivals-table td,
body.rivals-page .rivals-table th{
  font-size:0.9rem;
  padding:0.5rem 0.75rem;
}
body.rivals-page .rivals-table th{
  text-transform:uppercase;
  letter-spacing:.08em;
  font-size:0.75rem;
}
body.rivals-page .rival-card .card-body{
  min-height:200px;
}
@media (max-width:575.98px){
  body.rivals-page .selector-card .form-select{
    width:100%;
  }
}

/* TOP */
/* ===== TOP (limpia, estable) ===== */
.top-bar{
  background:#000;           /* SIEMPRE negro */
  height:50px;               /* alto fijo */
  color:#fff;
  padding:0 16px;
  display:flex;
  align-items:center;        /* centra vertical */
  justify-content:space-between;
  position:relative;         /* contexto propio */
  z-index:1000;              /* por encima del fondo de next-race */
}

.top-bar .logo{
  display:flex;
  align-items:center;
  height:50px;
}
.top-bar .logo img{
  height:35px;               /* logo visible y estable */
  width:auto;
  display:block;
}

.top-bar nav{ display:block; margin:0; }
.top-bar .login-wrap{ display:block; margin:0; }
.top-bar nav a,
.top-bar .login-wrap a{
  color:#fff;                /* enlaces SIEMPRE blancos */
  text-decoration:none;
  margin:0 10px;
  padding:0;
  line-height:1;             /* evita que crezcan la altura del top */
}
.top-bar nav a:hover,
.top-bar .login-wrap a:hover{ color:#fff; }

/* Burger */
.navbar-toggler{
  border:none;
  background:transparent;
  padding:0 8px;             /* un poco de aire lateral */
  height:35px;
  display:flex;
  align-items:center;
  color:#fff;
}
.navbar-toggler:focus{ box-shadow:none; }
.navbar-toggler .navbar-toggler-icon{
  display:inline-block; width:1.5em; height:1.5em;
  background-repeat:no-repeat; background-position:center; background-size:100% 100%;
  /* icono hamburguesa BLANCO */
  background-image:url("data:image/svg+xml;charset=utf8,%3Csvg viewBox='0 0 30 30' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath stroke='rgba(255,255,255,1)' stroke-width='2' stroke-linecap='round' d='M4 7h22M4 15h22M4 23h22'/%3E%3C/svg%3E");
}

/* ===== Móvil (<768px): logo centrado, burger a la derecha ===== */
@media (max-width:767.98px){
  /* ocultar nav y login SOLO en móvil */
  .top-bar nav,
  .top-bar .login-wrap{ display:none !important; }

  /* centramos el logo sin absolute ni grid */
  .top-bar{ display:flex; }

/* DUPLICATE of selector first seen at line 26 */
  .top-bar .logo{ margin:0 auto; } /* esto centra el logo perfectamente */

  /* burger fijo a la derecha, centrado vertical y con aire del borde */
  .top-bar .burger-wrap{
    position:absolute;
    right:10px;
    top:50%;
    transform:translateY(-50%);
    height:35px;
    display:flex; align-items:center;
  }
}

/* ===== Admin top bar ===== */
.admin-top-bar {
  background:#fff;
  border-bottom:1px solid rgba(15,23,42,0.08);
  box-shadow:0 12px 30px rgba(15,23,42,0.06);
  position:sticky;
  top:0;
  z-index:1020;
}

.admin-top-inner {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:1.5rem;
  min-height:68px;
  padding:0.75rem 0;
}

.admin-top-greeting {
  font-size:0.95rem;
  font-weight:600;
  letter-spacing:0.08em;
  text-transform:uppercase;
  color:#0f172a;
}

.admin-top-greeting strong {
  font-weight:700;
}

.admin-top-nav {
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:0.75rem;
  flex-wrap:wrap;
}

.admin-top-link {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:0.45rem 0.9rem;
  border-radius:999px;
  font-size:0.82rem;
  letter-spacing:0.08em;
  text-transform:uppercase;
  font-weight:600;
  color:#1f2937;
  background:transparent;
  border:1px solid transparent;
  transition:all 0.18s ease-in-out;
}

.admin-top-link:hover,
.admin-top-link:focus {
  color:#0d6efd;
  background:rgba(13,110,253,0.08);
  text-decoration:none;
}

.admin-top-link.active {
  color:#0d6efd;
  background:rgba(13,110,253,0.12);
}

.admin-top-link.admin-top-exit {
  background:#0d6efd;
  color:#fff;
  border-color:#0d6efd;
  padding:0.45rem 1.3rem;
}

.admin-top-link.admin-top-exit:hover,
.admin-top-link.admin-top-exit:focus {
  background:#0a58ca;
  border-color:#0a58ca;
  color:#fff;
}

@media (max-width: 767.98px) {
  .admin-top-inner {
    flex-direction:column;
    align-items:flex-start;
    gap:0.85rem;
  }

  .admin-top-nav {
    width:100%;
    justify-content:flex-start;
    gap:0.5rem;
  }

  .admin-top-link {
    padding:0.4rem 0.8rem;
  }
}

/* ===== Next-race debajo del top (sin montarse) ===== */
.next-race{
  position:relative; z-index:1;
  margin-top:0;
  height:90px;
  color:#fff;
  background-image:url('../images/background/SL-092619-23740-39.jpg');
  background-position:top center;
  background-repeat:no-repeat;
  background-size:cover;
  display:flex; align-items:center; justify-content:space-between;
}
/* Mantener navbar en una sola línea (>=768px) */
@media (min-width:768px){
  .top-bar nav{
    display:flex;
    align-items:center;
    flex-wrap:nowrap;      /* no permitas salto de línea */
    white-space:nowrap;    /* evita que el texto rompa */
  }

/* DUPLICATE of selector first seen at line 38 */
  .top-bar .login-wrap{
    white-space:nowrap;
  }
}

/* Microajuste para viewport estrecho: 768–784 px */
@media (min-width:768px) and (max-width:784px){
  .top-bar nav a{ 
    margin:0 6px;          /* menos separación horizontal */
    font-size:0.95rem;     /* un pelín más pequeño */
  }
  .top-bar .login-wrap a{
    margin-left:6px;
    font-size:0.95rem;
  }
  .top-bar{ padding:0 12px; } /* recupera unos px de ancho útil */
}

/* NEXT-RACE */
.next-race{
  position:relative;     /* debajo de la top */
  margin-top:0; 
  min-height: 90px;         /* nada de márgenes negativos */
  height:90px;
  color:#fff;
  background-image:url('../images/background/SL-092619-23740-39.jpg');
  background-position:top center;
  background-repeat:no-repeat;
  background-size:cover;
  display:flex; align-items:center; justify-content:space-between;
}
.next-race .race-date{font-size:13px;color:#fff;opacity:.9;line-height:1}
.next-race .race-name{font-size:19px;color:#fff;font-weight:700;line-height:1.1; white-space:nowrap;}
.next-race .race-circuit{line-height:1.2;}
.next-race img.flag{width:50px;height:30px;object-fit:cover}

/* Desktop helpers */
@media (min-width:768px){
  .race-left{display:flex;align-items:center;gap:.5rem}
  .race-right{display:flex;justify-content:flex-end;align-items:center}
}
/* Between 768 and 999: widen left, shrink right */
@media (min-width:768px) and (max-width:999px){
  .next-race .race-left  { flex:0 0 42% !important; max-width:42% !important; }
  .next-race .race-right { flex:0 0 32% !important; max-width:32% !important; }
}

.next-race .race-right{gap:0.5rem;flex-wrap:nowrap;}
.next-race .race-countdown{display:flex;align-items:center;justify-content:flex-end;white-space:nowrap;}
.next-race .race-timer{font-size:1.4rem;font-weight:700;letter-spacing:0.06em;color:#fff;white-space:nowrap;}

/* MOBILE <768px */
@media (max-width:767.98px){
  .next-race{ height:auto !important; min-height:140px !important; padding:8px 12px !important; }
  .race-left{ display:flex; flex-direction:column; align-items:center; justify-content:center; text-align:center; }
  .race-left img.flag{ width:40px; height:24px; margin-bottom:8px; }
  .race-text .race-date,.race-text .race-name{ display:block; margin-bottom:4px; }
  .race-right{ display:flex; justify-content:center; align-items:center; margin-top:8px; gap:0.5rem; }
  .next-race .race-countdown{ justify-content:center; }
}

/* MAIN + FOOTER */
.main-wrap{flex:1 0 auto}
.footer{height:20px;background:#000;color:#fff;text-align:center;line-height:20px;flex-shrink:0}

/* ===== MAIN AREA STYLES ===== */
.card{ border:1px solid #e6e6e6; border-radius:12px; }
.card-header{ background:#fff; border-bottom:1px solid #efefef; }

/* KPI strip */
.kpi-card .kpi-label{ font-size:.9rem; color:#333; opacity:.8; }
.kpi-card .kpi-value{ font-size:1.6rem; font-weight:700; line-height:1; }

/* Team table */
.team-table th{ font-weight:700; font-size:.95rem; }
.team-table td{ font-size:.95rem; }
.team-table th.sortable-header{
  cursor:pointer;
  user-select:none;
  position:relative;
  padding-right:1.5rem;
}
.team-table th.sortable-header::after{
  content:'⇅';
  position:absolute;
  right:0.35rem;
  top:50%;
  transform:translateY(-50%);
  font-size:0.8rem;
  opacity:0.4;
}
.team-table th.sortable-header[data-sort-active="asc"]::after{
  content:'▲';
  opacity:0.8;
}
.team-table th.sortable-header[data-sort-active="desc"]::after{
  content:'▼';
  opacity:0.8;
}

.agenda-day-title{ font-size:1.05rem; }
.agenda-day-list .list-group-item{ border:0; border-bottom:1px solid #efefef; padding-left:0; padding-right:0; }
.agenda-day-list .list-group-item:last-child{ border-bottom:0; }
.agenda-time{ min-width:70px; font-weight:600; text-align:right; }
.agenda-title{ line-height:1.2; }
.agenda-timezone-note{ line-height:1.2; }
.agenda-tz-selector .btn{
  padding:0.15rem 0.55rem;
  font-size:0.775rem;
}
.btn-xs{
  padding:0.15rem 0.55rem;
  font-size:0.775rem;
  line-height:1.1;
}
.agenda-day-selector .btn,
.agenda-tz-selector .btn{
  --bs-btn-bg: transparent;
  --bs-btn-color: #000;
  --bs-btn-border-color: #000;
  --bs-btn-hover-bg: rgba(0,0,0,0.12);
  --bs-btn-hover-color: #000;
  --bs-btn-active-bg: #000;
  --bs-btn-active-color: #fff;
  --bs-btn-focus-shadow-rgb: 0,0,0;
  background-color: transparent !important;
  color:#000 !important;
  border-color:#000 !important;
}
.gp-records-card .records-category-selector .btn{
  --bs-btn-bg: transparent;
  --bs-btn-color: #000;
  --bs-btn-border-color: #000;
  --bs-btn-hover-bg: rgba(0,0,0,0.12);
  --bs-btn-hover-color: #000;
  --bs-btn-active-bg: #000;
  --bs-btn-active-color: #fff;
  --bs-btn-focus-shadow-rgb: 0,0,0;
  background-color: transparent !important;
  color:#000 !important;
  border-color:#000 !important;
  padding-top:0.35rem;
  padding-bottom:0.35rem;
}
.gp-records-card .records-category-selector{
  display:inline-flex;
  flex-wrap:wrap;
}
.gp-records-card .records-category-selector .btn.active{
  background-color:#000 !important;
  color:#fff !important;
  border-color:#000 !important;
}
.gp-description{ position:relative; }
.gp-description-text{ display:block; }
.gp-description-toggle{ display:none; }
.gp-description[data-short-text=""] .gp-description-toggle{ display:none !important; }
@media (max-width: 1199.98px){
  .gp-description[data-short-text]:not([data-short-text=""]) .gp-description-toggle{ display:inline-block; }
}
.records-section{ margin-bottom:0.6rem; }
.records-section-title{
  font-size:0.95rem;
  font-weight:600;
  margin-bottom:0.35rem;
  text-transform:uppercase;
  letter-spacing:0.04em;
}
.records-list-item{
  display:flex;
  align-items:center;
  gap:0.35rem;
  padding:0.1rem 0;
}
.records-count{ min-width:1.8rem; font-size:1.2rem; font-weight:700; text-align:right; margin-left:auto; }
.records-flag{ width:18px; height:12px; object-fit:cover; border-radius:2px; }
.records-name{ font-size:1.1rem; font-weight:600; }
.records-highlight-main{ font-size:1.2rem; }
.records-highlight-meta{ font-size:0.9rem; color:#333; }
.records-highlight-meta .text-muted{ margin-left:0.25rem; }
.records-highlight{
  border-radius:8px;
  padding:0.25rem 0;
}
.gp-records-card .records-columns{
  width:100%;
}
@media (min-width: 992px) {
  .gp-records-card .records-column{
    padding-right:1.5rem;
    border-right:1px solid #e8e8e8;
  }
  .gp-records-card .records-column:last-child{
    border-right:none;
    padding-right:0;
  }
}
.agenda-day-selector .btn:hover,
.agenda-tz-selector .btn:hover,
.agenda-day-selector .btn:focus,
.agenda-tz-selector .btn:focus{
  background-color:rgba(0,0,0,0.08) !important;
  color:#000 !important;
}
.agenda-day-selector .btn.active,
.agenda-tz-selector .btn.active{
  background-color:#000 !important;
  color:#fff !important;
  border-color:#000 !important;
}

/* Próximo GP card */
.gp-title{ font-weight:800; font-size:clamp(18px, 2.2vw, 22px); line-height:1.1; white-space:normal; overflow:hidden; text-overflow:ellipsis; }
.gp-round{ display:inline-flex; align-items:flex-start; font-weight:700; line-height:1; padding-top:0.15rem; }
.gp-name{ line-height:1.1; display:block; }
.circuit-name{ font-size:clamp(14px, 1.8vw, 18px); line-height:1.15; font-weight:600; }
.winners-head{ font-size:1.2rem; font-weight:700; border-bottom:1px solid #efefef; }

/* Market */
.market-list .list-group-item{ padding:.75rem 1rem; }
.market-list .badge{ border-radius:999px; }

/* Ranking */
.table> :not(caption)>*>*{ padding:.6rem .75rem; }

/* Calendar strip */
.calendar-strip{ display:flex; gap:10px; overflow-x:auto; padding:4px 2px; }
.calendar-strip .cal-item{ min-width:72px; text-align:center; border:1px solid #ddd; border-radius:10px; padding:8px 6px; font-weight:700; }
.calendar-strip .cal-item small{ font-weight:400; }
.calendar-strip .cal-item.active{ background:#000; color:#fff; border-color:#000; }

/* News */
.news-list{ list-style: none; padding-left: 1rem; }
.news-list li{ margin-bottom:.35rem; position:relative; }
.news-list li::before{ content:'•'; position:absolute; left:-1rem; top:.05rem; font-weight:700; }

/* Mobile tweaks */
@media (max-width:767.98px){
  .kpi-card .kpi-value{ font-size:1.4rem; }
  .team-card .card-header .btn{ padding:.25rem .5rem; }
}

/* Welcome text above KPI strip */
.welcome-text{ font-size: 1rem; }

/* ===== Offcanvas mobile menu sin bordes ===== */
.offcanvas-motogp .list-group-item{
  border:none !important;          /* quita el borde */
  background:transparent !important; /* fondo transparente */
  padding:12px 0;                  /* separación vertical cómoda */
  font-size:1.1rem;
  color:#000;
}
.offcanvas-motogp .list-group-item:hover{
  background:transparent;           /* sin highlight raro */
  color:#000;
}

/* Headers de las tablas "Mi equipo" y "Clasificación" */
.team-table thead th,
.ranking-card thead th {
  font-size: 1.2rem;
  font-weight: 600;
}

/* === Toggle redondo reducido === */
/* Ocultar el checkbox nativo */
.toggle-input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 0;
  height: 0;
  margin: 0;
  padding: 0;
}

.toggle {
  position: relative;
  display: inline-block;
  width: 36px;     /* antes 46px */
  height: 20px;    /* antes 26px */
  background: #ddd;
  border-radius: 9999px;
  cursor: pointer;
  transition: background 0.2s ease;
  vertical-align: middle;
}

.toggle::after {
  content: "";
  position: absolute;
  top: 2px;        /* ajustado */
  left: 2px;       /* ajustado */
  width: 16px;     /* antes 20px */
  height: 16px;    /* antes 20px */
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s ease;
}

/* Estado ON */
.toggle-input:checked + .toggle {
  background: #111;
}
.toggle-input:checked + .toggle::after {
  transform: translateX(16px); /* antes 20px */
}

/* ========== Dark Mode móvil (afecta solo al MAIN) ========== */

/* ===== Botones en modo normal (todas las resoluciones) ===== */
.main-wrap .btn-outline-dark {
  background-color: #111;
  color: #fff;
  border-color: #111;
}

.main-wrap .btn-outline-dark:hover,
.main-wrap .btn-outline-dark:focus {
  background-color: #000;
  border-color: #000;
  color: #fff;
  text-decoration: none;
  box-shadow: 0 0 0 .2rem rgba(0,0,0,.25); /* accesibilidad */
}

/* ===== Botones en modo oscuro (móvil) ===== */

/* ===== Footer base ===== */
.footer {
  padding: 1rem 0;
  text-align: center;
}

/* ===== Separador centrado con ancho de .container ===== */
.footer::before {
  content: "";
  display: block;
  height: 1px;
  background-color: #ddd;         /* color de línea en modo claro */
  margin: 0 auto 1rem auto;
  width: 100%;
  max-width: 100%;                 /* será ajustado por breakpoints abajo */
  /* pequeño respiro respecto al contenido anterior */
}

/* Igualamos el ancho del separador a .container por breakpoint Bootstrap */
@media (min-width: 576px)  { .footer::before { max-width: 540px; } }
@media (min-width: 768px)  { .footer::before { max-width: 720px; } }
@media (min-width: 992px)  { .footer::before { max-width: 960px; } }
@media (min-width: 1200px) { .footer::before { max-width: 1140px; } }
@media (min-width: 1400px) { .footer::before { max-width: 1320px; } }

/* ===== Modo claro (desktop) ===== */
@media (min-width: 768px) {
  .footer {
    background: #fff;
    color: #000;
  }
}

/* ===== Modo oscuro (tu dark mode móvil) ===== */

/* Opcional: en modo claro móvil mantenemos línea algo más suave */
@media (max-width: 767.98px) {
  .footer::before { background-color: #e5e5e5; }
}

/* Si los bordes del main son más marcados en dark, igualamos el grosor/tono aquí */
.theme-dark .footer {
  border-top: 1px solid #555; /* ayuda de contraste si lo prefieres */
}

/* ===== Footer base ===== */
.footer {
  padding: 1.25rem 0 1.75rem;   /* más aire por abajo */
  text-align: center;
  background: transparent;      /* lo definimos por breakpoint/mode */
  color: inherit;
}

/* Separador centrado con ancho tipo .container */
.footer::before {
  content: "";
  display: block;
  height: 1px;
  width: 100%;
  max-width: 100%;
  margin: 0 auto 1rem auto;     /* espacio sobre el texto */
  background-color: #ddd;       /* color por defecto (desktop claro) */
}

/* Anchos del separador alineados a .container */
@media (min-width: 576px)  { .footer::before { max-width: 540px; } }
@media (min-width: 768px)  { .footer::before { max-width: 720px; } }
@media (min-width: 992px)  { .footer::before { max-width: 960px; } }
@media (min-width: 1200px) { .footer::before { max-width: 1140px; } }
@media (min-width: 1400px) { .footer::before { max-width: 1320px; } }

/* ===== Desktop (>=768) – Modo claro ===== */
@media (min-width: 768px) {
  .footer {
    background: #fff;
    color: #000;
    padding-bottom: 2rem;       /* un pelín más de aire inferior */
  }
  .footer::before {
    background-color: #ddd;     /* línea gris suave sobre fondo blanco */
  }
}

/* ===== Móvil (<768) – Modo claro ===== */

/* ===== Móvil (<768) – Modo oscuro ===== */

/* Links en Noticias: gris/negro en lugar de azul */
.news-card .news-list a,
.news-card .news-list a:link,
.news-card .news-list a:visited {
  color: #333 !important;       /* gris oscuro legible en modo claro */
  text-decoration: none !important;
}

.news-card .news-list a:hover,
.news-card .news-list a:focus {
  color: #000 !important;       /* negro en hover */
  text-decoration: underline !important;
}

/* En dark mode: titulares más claros */

/* Homogeneizar títulos de tarjetas en el main */
.main-wrap .card-header h2 {
  font-size: 1.25rem;  /* mismo tamaño que h5 */
  margin: 0;
}

/* Homogeneizar tamaño de las cabeceras de todas las tablas en main */
.main-wrap table thead th {
  font-size: 1.2rem;      /* mismo tamaño en todas */
  font-weight: 600;     /* semi-bold para que resalte */
  vertical-align: middle;
}

/* ===== Resumen: base común ===== */
.summary-pos-label { font-size: .85rem; }

/* Número con # pequeño y alineado a la base */
.summary-pos-value {
  display: flex;
  align-items: baseline;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.5px;
}
.summary-pos-value .hash { font-size: 60%; margin-right: 2px; line-height: 1; }
.summary-pos-value .num { font-size: inherit; }

/* ===== Mobile (<768): versión compacta ===== */
.summary-mobile .summary-pos-value { font-size: clamp(2rem, 10vw, 2.6rem); }

.kpi-pill {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .35rem .6rem;
  border-radius: 9999px;
  background: #f6f6f7;
  border: 1px solid #e4e4e7;
  font-size: .95rem;
  line-height: 1.2;
  white-space: nowrap;
}
.kpi-pill-label { color: #6c757d; }
.kpi-pill-value { font-weight: 700; color: #111; }

/* Dark mode móvil para pills y labels */

/* ===== Desktop (>=768): versión clásica en línea ===== */
@media (min-width: 768px) {
  .summary-desktop .summary-pos-value { font-size: 3rem; }     /* número bien visible */
  .summary-metric-label { font-size: .9rem; }
  .summary-metric-value { font-weight: 700; font-size: 1.25rem; }
}

/* Aclarar el color de los "0" (text-muted) en modo dark */

/* Mejorar visibilidad de footers en modo dark */

/* Card de la gráfica: solo un toque */
.trend-card .card-body { padding-top: .75rem; padding-bottom: .75rem; }

/* Evitar saltos del select en el header */
.trend-card .card-header .d-flex { flex-wrap: nowrap; }
.trend-select-wrap { flex-wrap: nowrap; }
.trend-mobile-wrap {
  overflow-x: auto;
}
.chart-rival-picker {
  display: flex;
  flex-wrap: wrap;
  row-gap: .35rem;
  column-gap: .75rem;
  justify-content: flex-end;
  align-items: center;
}
.chart-rival-picker .chart-rival-heading {
  font-size: .85rem;
  letter-spacing: .04em;
  text-transform: uppercase;
  font-weight: 600;
  margin: 0;
  color: #6c757d;
}
.chart-rival-picker .chart-rival-list {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem .75rem;
  justify-content: flex-end;
}
.chart-rival-picker .form-check {
  font-size: .9rem;
  margin: 0;
  display: inline-flex;
  align-items: center;
}
.chart-rival-picker .form-check-input {
  width: .95rem;
  height: .95rem;
  margin-top: 0;
}
.chart-rival-picker .form-check-label {
  white-space: nowrap;
}

/* Móvil: que el select no se vaya a otra zona y sea legible */

/* Mantener el dropdown alineado a la derecha y en su sitio */
.trend-card .card-header { flex-wrap: nowrap; }

/* Texto del select un poco mayor en móvil, sin ocupar todo el ancho */

/* Quitar la línea full-width (borde superior real del footer) */
.footer {
  border-top: 0 !important;
}

/* Si por algún motivo viene de un rule más específico: */
body > .footer {
  border-top: 0 !important;
}

/* Asegurarnos de que NO haya otra línea al final del main */
.main-wrap {
  border-bottom: 0 !important;
}

/* Altura unificada de la barra (desktop y móvil) */
:root { --next-race-height: 70px; } /* ajusta si tu barra real es otra altura */
.next-race { min-height: var(--next-race-height); }
.title-bar { height: var(--next-race-height); }

/* Título: blanco, grande, a la izquierda y centrado vertical ya lo hace el flex del contenedor */
.title-bar .page-title {
  color: #fff;
  font-weight: 800;
  font-size: clamp(1.25rem, 2.2vw, 1.75rem);
  line-height: 1;
  letter-spacing: -0.2px;
}

/* Asegurar misma altura en móvil también */
@media (max-width: 767.98px) {
  .title-bar { height: var(--next-race-height); }
}

/* ===== TITLE-BAR (separada de next-race) ===== */
:root {
  --titlebar-height: 70px;              /* misma altura en mobile y desktop */
  --titlebar-bg: var(--hero-bg, #111);  /* opcional: reutiliza el fondo si ya tienes --hero-bg */
}


/* DUPLICATE of selector first seen at line 511 */
.title-bar {
  height: var(--titlebar-height);
  background: var(--titlebar-bg) center/cover no-repeat;
  display: block;
}

.title-bar .page-title {
  color: #fff;
  font-weight: 800;
  font-size: clamp(1.5rem, 2vw, 2rem);
  line-height: 1;
  letter-spacing: -0.2px;
  margin: 0;
}

/* Asegura el ancho de main como en index por si alguna página no usa .container */
.main-wrap {
  max-width: 1320px;
  margin: 0 auto;
  padding-left: var(--bs-gutter-x, .75rem);
  padding-right: var(--bs-gutter-x, .75rem);
}

/* Dark mode móvil (si usas theme-dark) */

/* ===== Title (modo compacto) sobre el skin de next-race ===== */
.next-race--title {
  /* fuerza altura de desktop SIEMPRE (también en mobile) */
  height: 70px;
  min-height: 70px;
}
@media (max-width: 767.98px) {
  /* algunos estilos previos duplicaban la altura en mobile: lo anulamos */
  .next-race--title {
    height: 70px !important;
    min-height: 70px !important;
  }
}

/* ===== Tipografía Title unificada ===== */
.next-race--title .page-title {
  color: #fff;
  font-weight: 800;
  font-size: 2.3rem;   /* mismo tamaño en desktop y mobile */
  line-height: 1;
}

/* Header en main: layout limpio */
.main-header { gap: .75rem; }

/* Título: mismo tamaño en todos los formatos */
.page-title-main {
  font-size: 2.3rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0;
  color: #000;               /* base */
}

/* Desktop: siempre negro, aunque estés en dark */
@media (min-width: 768px) {
  .page-title-main { color: #000 !important; }
}

/* Mobile: negro en light, blanco en dark */

/* Evitar desplazamientos raros: sin padding extra en el header */
.main-header > .main-toggle-slot,
.main-header > h1 { margin: 0; }

/* (Opcional) si tu toggle se mostraba solo en móvil, mantén su visibilidad como la tenías */

/* =========================
   Dark Mode — Mobile only (grouped at end)
   ========================= */
@media (max-width: 767.98px) {
  .theme-dark .main-wrap {
    background-color: #0f0f10;
    color: #eaeaea;
  }
  .theme-dark body {
    background-color: #000;
  }

  /* Tarjetas */
  .theme-dark .main-wrap .card {
    background-color: #151517;
    border-color: #2a2a2d;
    color: inherit;
  }
  .theme-dark .main-wrap .card-header {
    background-color: #1a1a1d;
    border-bottom-color: #2a2a2d;
  }

  /* Listas y tabla */
  .theme-dark .main-wrap .list-group-item {
    background-color: #151517;
    color: #eaeaea;
    border-color: #2a2a2d;
  }
  .theme-dark .main-wrap .table { color: #e0e0e0; }
  .theme-dark .main-wrap .table td,
  .theme-dark .main-wrap .table th { color: #e6e6e6; }
  .theme-dark .main-wrap .table thead th { color: #f1f1f1; }
  .theme-dark .main-wrap .table > :not(caption) > * > * {
    border-color: #2a2a2d;
  }

  /* Enlaces del main en dark */
  .theme-dark .main-wrap a {
    color: #bdbdbd;
    text-decoration: none;
  }
  .theme-dark .main-wrap a:hover,
  .theme-dark .main-wrap a:focus {
    color: #ffffff;
    text-decoration: underline;
  }

  /* Botones outline oscuros dentro del main */
  .theme-dark .main-wrap .btn-outline-dark {
    background-color: #eaeaea;
    color: #111;
    border-color: #eaeaea;
  }
  .theme-dark .main-wrap .btn-outline-dark:hover {
    background-color: #fff;
    border-color: #fff;
    color: #000;
  }

  /* Tablas: fondo oscuro + texto claro */
  .theme-dark .main-wrap .table {
    color: #e6e6e6;
    background-color: #151517;
  }
  .theme-dark .main-wrap .table thead th {
    color: #f1f1f1;
    background-color: #1a1a1d;
  }
  .theme-dark .main-wrap .table > :not(caption) > * > * {
    background-color: #151517;        /* celdas */
    border-color: #3a3a40;            /* bordes más visibles en dark */
  }

  /* Si usas .table-striped, mejora las filas alternas */
  .theme-dark .main-wrap .table-striped > tbody > tr:nth-of-type(odd) > * {
    background-color: #1b1b1e;
  }

  /* Bordes más visibles en dark */
  .theme-dark .main-wrap .card,
  .theme-dark .main-wrap .list-group-item,
  .theme-dark .main-wrap .table,
  .theme-dark .main-wrap .table > :not(caption) > * > * {
    border-color: #555; /* más claro que antes */
  }
  .theme-dark .main-wrap .card-header {
    border-bottom-color: #555;
  }
  /* Textos demasiado oscuros en dark (móvil) */
  .theme-dark .main-wrap .kpi-label {          /* "Presupuesto", "Valor del equipo", etc. */
    color: #cfcfcf !important;
  }

  .theme-dark .main-wrap .nextgp-card .gp-title,
  .theme-dark .main-wrap .nextgp-card .circuit-name, /* Títulos de Próximo GP */
  .theme-dark .main-wrap .nextgp-card .text-muted {   /* Fechas y etiquetas en Próximo GP */
    color: #d6d6d6 !important;
  }

  /* Cualquier .text-dark dentro del main debe verse claro en dark */
  .theme-dark .main-wrap .text-dark {
    color: #e8e8e8 !important;
  }
}

@media (max-width: 767.98px) {
  .theme-dark .main-wrap .btn-outline-dark {
    background-color: #eaeaea;
    color: #111;
    border-color: #eaeaea;
  }
  .theme-dark .main-wrap .btn-outline-dark:hover,
  .theme-dark .main-wrap .btn-outline-dark:focus {
    background-color: #fff;
    border-color: #fff;
    color: #000;
    box-shadow: 0 0 0 .2rem rgba(255,255,255,.25);
  }
}

@media (max-width: 767.98px) {
  .theme-dark .footer {
    background: #000;
    color: #eaeaea;
  }
  .theme-dark .footer::before {
    background-color: #444; /* línea con más contraste sobre fondo negro */
  }
}

@media (max-width: 767.98px) {
  /* Forzamos claro explícito para evitar herencias raras */
  html:not(.theme-dark) .footer {
    background: #fff;           /* blanco en claro */
    color: #000;                /* texto negro visible */
    padding-bottom: 1.75rem;    /* más separación inferior */
  }
  html:not(.theme-dark) .footer::before {
    background-color: #e5e5e5;  /* línea visible sobre blanco */
    margin: 0 auto 1rem auto;
  }
}

@media (max-width: 767.98px) {
  .theme-dark .footer {
    background: #000;           /* negro en dark móvil */
    color: #eaeaea;             /* texto claro */
    padding-bottom: 1.75rem;    /* más separación inferior */
    border-top: 1px solid #555; /* bordecito para separar mejor */
  }
  .theme-dark .footer::before {
    background-color: #555;     /* línea con más contraste en dark */
    margin: 0 auto 1rem auto;
  }
}

@media (max-width: 767.98px) {
  .theme-dark .news-card .news-list a,
  .theme-dark .news-card .news-list a:link,
  .theme-dark .news-card .news-list a:visited {
    color: #ddd !important;     /* gris claro */
  }
  .theme-dark .news-card .news-list a:hover,
  .theme-dark .news-card .news-list a:focus {
    color: #fff !important;     /* blanco en hover */
  }
}

@media (max-width: 767.98px) {
  .theme-dark .summary-pos-label { color: #cfcfcf !important; }
  .theme-dark .kpi-pill { background: #1c1c1f; border-color: #2f2f34; }
  .theme-dark .kpi-pill-label { color: #bdbdbd; }
  .theme-dark .kpi-pill-value { color: #fff; }
}

@media (max-width: 767.98px) {
  .theme-dark .text-muted {
    color: #bdbdbd !important; /* gris claro en dark */
  }
}

@media (max-width: 767.98px) {
  .theme-dark .card-footer {
    background-color: #1c1c1f;   /* fondo oscuro a juego */
    border-top-color: #2f2f34;   /* línea divisoria visible */
    color: #cfcfcf !important;   /* texto claro */
  }
}

@media (max-width: 767.98px) {
  .theme-dark .form-select.form-select-sm {
    background-color: #1c1c1f;
    color: #fff;
    border-color: #2f2f34;
  }
  .theme-dark .form-select.form-select-sm:focus {
    box-shadow: 0 0 0 .2rem rgba(255,255,255,.12);
  }
}

@media (max-width: 767.98px) {
  .chart-rival-picker {
    width: 100%;
    justify-content: flex-start;
    border-top: 1px solid rgba(0,0,0,.05);
    padding-top: .75rem;
  }
  .chart-rival-picker .chart-rival-heading {
    width: 100%;
    margin-bottom: .25rem;
  }
  .chart-rival-picker .chart-rival-list {
    justify-content: flex-start;
  }
  .chart-rival-picker .form-check {
    flex: 1 1 calc(50% - .5rem);
    font-size: .85rem;
  }
  .chart-rival-picker .form-check-label {
    white-space: normal;
  }
}

@media (max-width: 767.98px) {
  .theme-dark .title-bar .page-title { color: #fff; } /* ya es blanco, forzamos por si acaso */
}

@media (max-width: 767.98px) {
  .theme-dark .page-title-main { color: #fff !important; }
}

/* Próximos GP refinado */
.gp-card .gp-date {
  font-size: 0.95rem;
  color: #6c757d;
}
.theme-dark .gp-card .gp-date { color: #bfc3c7; }

.gp-card .gp-round {
  font-size: 1.5rem;
  font-weight: 200;   /* más fino */
  margin-right: .5rem;
}
.gp-card .gp-name {
  font-size: 1.5rem;  /* mismo tamaño que el número */
  font-weight: 700;   /* más grueso que el número */
}
.gp-card .gp-circuit {
  color: #6c757d;
}
.theme-dark .gp-card .gp-circuit { color: #bfc3c7; 
}

.gp-card img {
  border: 1px solid #dee2e6;   /* gris claro Bootstrap */
  
}

/* ===== Próximos GP — versión móvil compacta ===== */
@media (max-width: 767.98px) {
  /* Muestra solo la 1ª tarjeta (oculta 2ª y 3ª) */
  .proximos-gp .row.g-3 > [class*="col-"]:nth-child(n+2) {
    display: none !important;
  }

  /* Compactar tarjeta */
  .proximos-gp .border.p-3 {
    padding: 0.75rem !important; /* menos padding */
  }
  .proximos-gp .gp-card .gp-date {
    font-size: 0.85rem;          /* fecha un poco más pequeña */
  }
  .proximos-gp .gp-card .gp-round,
  .proximos-gp .gp-card .gp-name {
    font-size: 1.25rem;          /* mantiene jerarquía pero reduce altura */
    line-height: 1.2;
  }
  .proximos-gp .gp-card .gp-circuit {
    line-height: 1.2;
  }

  /* Línea final circuito + botón más cerquita */
  .proximos-gp .d-flex.justify-content-between.align-items-end.gap-2 {
    gap: 0.5rem !important;
  }

  /* Banderas: margen lateral más contenido */
  .proximos-gp .gp-card img {
    margin-right: 0.4rem !important;
  }
}

/* Próximos GP: mostrar solo 2 tarjetas en md (768–991.98px) */
@media (min-width: 768px) and (max-width: 991.98px) {
  .proximos-gp .row.g-3 > [class*="col-"]:nth-child(n+3) {
    display: none !important;
  }
}

/* ===== Calendario: estado por fila (colores suaves + left bar) ===== */

/* Light mode */
.cal-row.cal-estado-proximo    { background: #f1f6ff; border-left: 4px solid #6ea8fe; } /* azul suave */
.cal-row.cal-estado-curso      { background: #effaf1; border-left: 4px solid #61d48f; } /* verde suave */
.cal-row.cal-estado-finalizado { background: #f7f7f7; border-left: 4px solid #c9c9c9; } /* gris suave */

/* Dark mode (ajusta a tu esquema actual) */
.theme-dark .cal-row.cal-estado-proximo    { background: #0f1726; border-left-color: #93b7ff; }
.theme-dark .cal-row.cal-estado-curso      { background: #0f1f19; border-left-color: #7ae3ac; }
.theme-dark .cal-row.cal-estado-finalizado { background: #1a1a1a; border-left-color: #9a9a9a; }

/* ===== Responsivo por columnas ===== */

/* <1200px: ocultamos "Estado" (th/td últimos) y usamos el color de fila */
@media (max-width: 1199.98px) {
  .calendar-table thead th:last-child,
  .calendar-table tbody td:last-child {
    display: none !important; /* oculta "Estado" */
  }
}

/* <768px: además ocultamos "Gran Premio" (3ª) y "Circuito" (4ª) */
@media (max-width: 767.98px) {
  .card.calendar .table thead th:nth-child(3),
  .card.calendar .table tbody td:nth-child(3),
  .card.calendar .table thead th:nth-child(4),
  .card.calendar .table tbody td:nth-child(4) {
    display: none !important;
  }
}

/* Opcional: compactar un pelín la altura en móvil */
@media (max-width: 767.98px) {
  .card.calendar .table td,
  .card.calendar .table th {
    padding-top: .5rem;
    padding-bottom: .5rem;
  }
}

/* ===== Calendario — estilos de fila por estado (barra + fondo) ===== */

/* Light mode */
.cal-row.cal-estado-proximo    { background: #f1f6ff; border-left: 6px solid #6ea8fe; }
.cal-row.cal-estado-curso      { background: #effaf1; border-left: 6px solid #61d48f; }
.cal-row.cal-estado-finalizado { background: #f7f7f7; border-left: 6px solid #c9c9c9; }

/* Dark mode */
.theme-dark .cal-row.cal-estado-proximo    { background: #0f1726; border-left-color: #93b7ff; }
.theme-dark .cal-row.cal-estado-curso      { background: #0f1f19; border-left-color: #7ae3ac; }
.theme-dark .cal-row.cal-estado-finalizado { background: #1a1a1a; border-left-color: #9a9a9a; }

/* Banderas con borde fino (evita perder banderas blancas como JP) */
.calendar-table .flag {
  border: 1px solid #dee2e6;
  border-radius: 2px;
  display: inline-block;
}

/* ===== Calendario — fila por estado (barra + fondo) ===== */
/* (igual que antes, lo mantengo por si ya lo tienes) */
.cal-row.cal-estado-proximo    { background: #f1f6ff; border-left: 8px solid #6ea8fe; }
.cal-row.cal-estado-curso      { background: #effaf1; border-left: 8px solid #61d48f; }
.cal-row.cal-estado-finalizado { background: #f7f7f7; border-left: 8px solid #c9c9c9; }
.theme-dark .cal-row.cal-estado-proximo    { background: #0f1726; border-left-color: #93b7ff; }
.theme-dark .cal-row.cal-estado-curso      { background: #0f1f19; border-left-color: #7ae3ac; }
.theme-dark .cal-row.cal-estado-finalizado { background: #1a1a1a; border-left-color: #9a9a9a; }

/* Banderas con borde fino */
.calendar-table .flag {
  border: 1px solid #dee2e6;
  border-radius: 2px;
  display: inline-block;
}

/* ====== CALENDARIO — BLOQUE ÚNICO: visibilidad + distribución (mobile/desktop) ====== */

/* Base: distribución natural y alineaciones */
.main-wrap .card .calendar-table {
  table-layout: auto;
  width: 100%;
}
.main-wrap .card .calendar-table th,
.main-wrap .card .calendar-table td {
  vertical-align: middle;
  white-space: nowrap;
  /* Reset de cualquier display:none heredado */
  display: table-cell !important;
}
/* "Gran Premio" (4ª) y "Circuito" (5ª) pueden partir a varias líneas en desktop */
.main-wrap .card .calendar-table th:nth-child(4),
.main-wrap .card .calendar-table td:nth-child(4),
.main-wrap .card .calendar-table th:nth-child(5),
.main-wrap .card .calendar-table td:nth-child(5) {
  white-space: normal;
}
/* #, Bandera, GP estrechos y centrados */
.main-wrap .card .calendar-table th:nth-child(1),
.main-wrap .card .calendar-table td:nth-child(1) { width: 40px; text-align: center; }
.main-wrap .card .calendar-table th:nth-child(2),
.main-wrap .card .calendar-table td:nth-child(2) { width: 40px; text-align: center; }
.main-wrap .card .calendar-table th:nth-child(3),
.main-wrap .card .calendar-table td:nth-child(3) { width: 60px; text-align: center; }
/* Fechas (última) a la derecha SIEMPRE */
.main-wrap .card .calendar-table thead th:last-child,
.main-wrap .card .calendar-table tbody td:last-child {
  text-align: right;
}
/* Garantiza que la última columna NO se oculte en 768–1199.98 */
@media (max-width: 1199.98px) {
  .main-wrap .card .calendar-table thead th:last-child,
  .main-wrap .card .calendar-table tbody td:last-child {
    display: table-cell !important;
  }
}

/* ===== Mobile (<768px): mostrar 1:#, 2:Bandera, 3:GP, 6:Fechas; ocultar SOLO 4 y 5 ===== */
@media (max-width: 767.98px) {
  /* Oculta 4:Gran Premio y 5:Circuito */
  .main-wrap .card .calendar-table thead th:nth-child(4),
  .main-wrap .card .calendar-table tbody td:nth-child(4),
  .main-wrap .card .calendar-table thead th:nth-child(5),
  .main-wrap .card .calendar-table tbody td:nth-child(5) {
    display: none !important;
  }

  /* Fuerza visibles 1,2,3 y 6 (especif. alta para vencer reglas antiguas) */
  .main-wrap .card .calendar-table.calendar-table thead th:nth-child(1),
  .main-wrap .card .calendar-table.calendar-table tbody td:nth-child(1),
  .main-wrap .card .calendar-table.calendar-table thead th:nth-child(2),
  .main-wrap .card .calendar-table.calendar-table tbody td:nth-child(2),
  .main-wrap .card .calendar-table.calendar-table thead th:nth-child(3),
  .main-wrap .card .calendar-table.calendar-table tbody td:nth-child(3),
  .main-wrap .card .calendar-table.calendar-table thead th:nth-child(6),
  .main-wrap .card .calendar-table.calendar-table tbody td:nth-child(6) {
    display: table-cell !important;
  }

  /* Fechas: usa formato móvil */
  .main-wrap .card .calendar-table .date-desktop { display: none !important; }
  .main-wrap .card .calendar-table .date-mobile  { display: inline !important; }

  /* Compactación ligera */
  .main-wrap .card .calendar-table { font-size: 0.95rem; }
  .main-wrap .card .calendar-table td,
  .main-wrap .card .calendar-table th { padding-top: .5rem; padding-bottom: .5rem; }
}

/* ≥768px: fecha escritorio */
@media (min-width: 768px) {
  .main-wrap .card .calendar-table .date-desktop { display: inline !important; }
  .main-wrap .card .calendar-table .date-mobile  { display: none !important; }
}

/* ===== Calendario (mobile) — distribuir columnas 1–3 y Fechas ===== */
@media (max-width: 767.98px) {
  .calendar-table {
    table-layout: fixed;   /* reparte el ancho por columnas */
    width: 100%;
  }

  /* Evitar saltos raros y mantener proporciones */
  .calendar-table th, .calendar-table td {
    white-space: nowrap;
  }

  /* 1: #  (centrado, estrecho) */
  .calendar-table th:nth-child(1),
  .calendar-table td:nth-child(1) {
    width: 12%;
    text-align: left !important;
    padding-left: .5rem;
  }

  /* 2: Bandera (centrado, algo más ancho) */
  .calendar-table th:nth-child(2),
  .calendar-table td:nth-child(2) {
    width: 14%;
    text-align: center;
  }
  /* Asegurar que la imagen no desborda */
  .calendar-table td:nth-child(2) img.flag {
    max-width: 100%;
    height: auto;
    display: inline-block;
  }

  /* 3: GP (centrado, ancho medio) */
  .calendar-table th:nth-child(3),
  .calendar-table td:nth-child(3) {
    width: 24%;
    text-align: center;
  }

  /* 6: Fechas (a la derecha, el resto del ancho) */
  .calendar-table th:nth-child(6),
  .calendar-table td:nth-child(6) {
    width: 40%;
    text-align: right;
  }
}

/* Indicador de orden en cabecera */
#tablaPilotos thead th { cursor: pointer; user-select: none; }
#tablaPilotos thead th .sort-caret { opacity: .6; font-size: .8rem; }

/* ===== KPIs: tamaño general más grande ===== */
.kpi-mini .card-body { padding: .9rem 1.1rem; }
.kpi-mini .kpi-label { font-size: 0.95rem; color: #6c757d; }
.kpi-mini .kpi-value { font-size: 1.7rem; font-weight: 800; text-align: right;}
.kpi-mini .kpi-sub   { font-size: 0.85rem; color: #6c757d; }
.kpi-alert { color: #dc3545; }

/* ===== KPI Mercado (tarjeta 4) ===== */
.kpi-market .kpi-label { font-size: 0.95rem; }
.kpi-market .kpi-market-row {
  margin-top: .35rem;
  font-size: 1.5rem;           /* un pelín menor que el value general para igualar alturas */
  line-height: 1.2;
}
.kpi-market .kpi-market-left {
  color: #000;                  /* "Cierra en" en negro (modo claro) */
}
.kpi-market .kpi-market-right {
  color: #000 !important;       /* contador en NEGRO, gane a cualquier override */
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: .2px;
  white-space: nowrap;
}

/* ===== Market Badge más grande ===== */
.kpi-market #marketBadge {
  font-size: 0.9rem;       /* más grande (antes ~0.75rem) */
  padding: 0.35em 0.6em;   /* más relleno */
  font-weight: 600;
}

/* Si usas tema oscuro global con clase .theme-dark en <body> o en .main-wrap, y quieres
   que el contador pase a blanco solo en dark, descomenta esto:
.theme-dark .kpi-market .kpi-market-left,
.theme-dark .kpi-market .kpi-market-right { color: #fff !important; }
*/

/* ===== Mercado cerrado: ocultar columna "Acción" y desactivar botones ===== */
body.market-closed #tablaPilotos thead th:last-child,
body.market-closed #tablaPilotos tbody td:last-child {
  display: none !important;
}

/* Botones inhabilitados: aspecto y bloqueo de interacción */
body.market-closed .btn-select,
body.market-closed #btnGuardar,
body.market-closed #btnCargar,
body.market-closed #btnVaciar {
  pointer-events: none !important;
  opacity: .5 !important;
  cursor: not-allowed !important;
}

/* Filtros más compactos (solo Mercado) */
.filters .filter-cat {
  max-width: 210px; /* un poco más estrecho */
}
.filters .filter-price {
  max-width: 110px; /* mucho más estrecho */
}

/* En pantallas muy anchas, aún más compactos si quieres */
@media (min-width: 768px) {
  .filters .filter-cat { max-width: 200px; }
  .filters .filter-price { max-width: 100px; }
}

/* Filtros Mercado más compactos */
.filters .row.g-1 > [class*="col-"] {
  padding-right: .35rem;
  padding-left: .35rem;
}
.filters .form-select,
.filters .form-control {
  height: 36px;
  font-size: 0.9rem;
}
.filters label {
  margin-bottom: 2px;
}

@media (max-width: 991.98px) {
  body.market-page .filters-row {
    flex-wrap: nowrap !important;
    column-gap: 0.75rem;
    padding-bottom: 4px;
  }
  body.market-page .filters-row > [class*="col-"] {
    flex: 1 1 0;
    min-width: 0;
    width: auto;
  }
  body.market-page .filters-row .filters-col label {
    white-space: nowrap;
  }
  body.market-page .filters-row .filter-price {
    min-width: 0;
  }
  body.market-page .filters-row .filter-actions {
    flex: 0 0 auto;
    min-width: 0;
    margin-left: auto;
    justify-content: flex-end;
  }
  body.market-page .filters-row .filter-actions button {
    white-space: nowrap;
  }
}

body.market-page .team-panel-backdrop{
  position:fixed;
  inset:0;
  background:rgba(15,23,42,0.45);
  opacity:0;
  pointer-events:none;
  transition:opacity .3s ease;
  z-index:1040;
}
body.market-page.team-panel-open .team-panel-backdrop{
  opacity:1;
  pointer-events:auto;
}

@media (max-width: 991.98px) {
  body.market-page .right-pane{
    position:fixed;
    top:var(--team-panel-mobile-top, 96px);
    left:0;
    width:min(92vw,360px);
    height:calc(100vh - var(--team-panel-mobile-top, 96px) - 16px);
    background:#fff;
    box-shadow:6px 0 18px rgba(15,23,42,0.18);
    border-radius:0 18px 18px 0;
    padding:1rem;
    transform:translateX(-110%);
    transition:transform .3s ease;
    z-index:1050;
    overflow-y:auto;
    overflow-x:hidden;
    -webkit-overflow-scrolling:touch;
    gap:1rem;
    pointer-events:none;
  }
  body.market-page .right-pane .card{ margin-bottom:1rem; }
  body.market-page .right-pane .card:last-child{ margin-bottom:0; }
  body.market-page.team-panel-open .right-pane{
    transform:translateX(0);
    pointer-events:auto;
  }
  body.market-page.team-panel-open{ overflow:hidden; }
  body.market-page .right-pane .team-sticky{
    height:auto;
    max-height:none;
    background:#f8f9fa;
  }
  body.market-page .right-pane .team-list{ overflow-y:auto; }
  body.market-page .best-drivers-card{
    flex:0 0 auto;
  }
  body.market-page .best-drivers-card .best-scroll{
    max-height:none;
    overflow:visible;
  }
  body.market-page .team-footer-row{
    display:grid;
    grid-template-columns:repeat(4,minmax(0,1fr));
    gap:0.6rem;
    align-items:center;
  }
  body.market-page .team-footer-row > [class*="col-"]{
    width:100%;
    max-width:none;
    padding:0;
  }
  body.market-page .team-footer-row > .col-6 .dist-row{
    justify-content:space-between;
    width:100%;
  }
  body.market-page .team-footer-row > .col-6.col-lg-3{ justify-content:flex-end; }
  body.market-page .team-footer-row > .col-6.col-lg-3.d-flex{ justify-content:flex-end; }
  body.market-page .team-footer-row > .col-12{
    grid-column:1 / -1;
    padding-top:0.4rem;
  }
}

@media (min-width: 992px) {
  body.market-page .team-panel-backdrop{ display:none !important; }
  body.team-panel-open{ overflow:auto; }
  body.market-page .right-pane{
    position:relative;
    transform:none;
    box-shadow:none;
    background:transparent;
    padding:0;
    border-radius:0;
    pointer-events:auto;
  }
}

@media (min-width: 992px) {
  .team-sticky { position: sticky; top: 88px; }
}

/* ===== Desktop: que solo desplace el listado ===== */
@media (min-width: 992px) {
  /* Offset fijo bajo tu top-bar + título; ajusta si hace falta */
  :root { --market-sticky-top: 88px; }

  /* Columna izquierda como "panel" de altura de viewport */
  .left-pane {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    /* ocupa la altura visible restando top fijo */
    min-height: calc(100vh - var(--market-sticky-top));
  }

  /* Filtros arriba permanecen visibles porque NO desplazamos esta columna;
     desplazaremos SOLO el interior de la tarjeta de pilotos */
  .pilots-card {
    display: flex;
    flex-direction: column;
    min-height: 0; /* importante para que flex hijos calculen bien */
  }

  .pilots-card .card-body {
    display: flex;
    flex-direction: column;
    min-height: 0; /* permite que el scroll interno coja el alto */
  }

  .pilots-scroll { flex:1 1 auto; min-height:0; overflow: visible; }

  .team-sticky .team-list { overflow: visible; }

  /* Derecha: “Mi Equipo” sticky (si aún no lo tienes) */
  .team-sticky {
    position: sticky;
    top: var(--market-sticky-top);
  }

  /* En caso de que el footer del listado te empuje, mantiene el tamaño compacto */
  .pilots-card .card-footer {
    flex: 0 0 auto;
  }
}

/* Ajustes visuales suaves para que no "salte" el layout */
.pilots-scroll .table {
  margin-bottom: 0;
}

@media (min-width:1000px){
  /* Columna izquierda: ya la tienes */
  .left-pane{
    height:100%;
    display:flex;
    flex-direction:column;
    overflow:hidden;
  }

  /* === Columna derecha del mercado === */
  .right-pane{
    height:100%;
    display:flex;          /* mantiene el ancho Bootstrap (col-xl-4) */
    flex-direction:column; /* para estirar el card dentro */
  }

  /* El card “Mi Equipo” debe ocupar TODA la altura de su columna */
  .right-pane .team-sticky{
    position:relative;     /* ✅ quitamos sticky que encogía el card */
    top:auto;
    height:100%;
    max-height:100%;
    display:flex;
    flex-direction:column;
    margin:0;              /* evita que un margin acorte visualmente */
  }

  .team-sticky .card-header,
  .team-sticky .card-footer{
    flex:0 0 auto;
  }

  /* El listado interno es quien scrollea si hace falta */
  .team-sticky .team-list{
    flex:1 1 auto;
    min-height:0;
    overflow:visible;      /* por defecto sin scroll; lo activa JS si >12 */
  }

  /* Listado de pilotos (izquierda) ya forzado a ocupar 100% */
  .pilots-card{
    display:flex;
    flex-direction:column;
    min-height:0;
    height:100%;
  }
  .pilots-card .card-body{
    display:flex;
    flex-direction:column;
    min-height:0;
  }
  .pilots-scroll{
    flex:1 1 auto;
    min-height:0;
    overflow:visible;      /* por defecto; JS activará scroll si >12 */
  }
}

/* Live Timing — Summary */
.livetiming-summary{margin-bottom:1.25rem;}
.lt-summary-card{height:100%;border:1px solid rgba(0,0,0,0.05);border-radius:18px;overflow:hidden;box-shadow:0 6px 18px rgba(15,23,42,0.08);background:#fff;}
.lt-summary-card .card-body{display:flex;flex-direction:column;gap:.45rem;padding:1.05rem 1.25rem;min-height:100%;}
.lt-summary-row{display:flex;align-items:center;gap:.75rem;line-height:1.2;letter-spacing:.035em;}
.lt-summary-row--flag{gap:.85rem;margin-bottom:.3rem;font-weight:600;text-transform:uppercase;color:#495057;}
.lt-summary-flag{display:inline-flex;align-items:center;justify-content:center;width:2rem;border-radius:0;background:rgba(13,110,253,0.08);overflow:hidden;aspect-ratio:4/3;}
.lt-summary-flag-img{width:100%;height:100%;object-fit:cover;display:block;}
.lt-summary-flag-emoji{font-size:1.9rem;display:inline-flex;}
.lt-summary-flag-name{font-weight:600;font-size:.85rem;color:#495057;text-transform:uppercase;letter-spacing:.08em;}
.lt-summary-country{font-size:1.08rem;font-weight:700;color:#212529;text-transform:uppercase;letter-spacing:.1em;}
.lt-summary-row:not(.lt-summary-row--flag){font-weight:600;color:#212529;}
.lt-summary-event{font-size:1.25rem;font-weight:800;letter-spacing:.05em;color:#111;margin-top:.15rem;}
.lt-summary-circuit{font-size:.95rem;font-weight:500;color:#495057;}
.lt-summary-session{font-size:1rem;text-transform:uppercase;letter-spacing:.08em;color:#212529;justify-content:space-between;align-items:center;}
.lt-summary-time{font-size:.92rem;color:#343a40;font-weight:500;}
.lt-summary-status{justify-content:flex-start;margin-top:.25rem;}
.lt-status-pill{display:inline-flex;align-items:center;gap:.4rem;padding:.38rem .85rem;border-radius:999px;font-size:.8rem;font-weight:700;letter-spacing:.08em;text-transform:uppercase;background:rgba(108,117,125,0.18);color:#495057;}
.lt-status-pill--live{background:rgba(25,135,84,0.22);color:#0f5132;}
.lt-status-pill--finished{background:rgba(220,53,69,0.22);color:#842029;}
.lt-status-pill--red{background:rgba(220,53,69,0.22);color:#842029;}
.lt-status-pill--neutral{background:rgba(73,80,87,0.18);color:#343a40;}
.lt-summary-laps{justify-content:space-between;margin-top:auto;font-size:.92rem;color:#212529;border-top:1px dashed rgba(33,37,41,0.1);padding-top:.55rem;padding-bottom:.15rem;}
.lt-summary-laps-label{text-transform:uppercase;font-size:.75rem;color:#6c757d;letter-spacing:.08em;font-weight:600;}
.lt-summary-laps-value{font-weight:700;font-size:1.35rem;letter-spacing:.08em;color:#212529;min-width:2.4rem;text-align:right;}
.lt-summary-laps-value--empty{color:#adb5bd;}
.lt-summary-card--session .card-body{background:rgba(248,249,250,0.55);transition:background .3s ease,color .3s ease;}
.lt-summary-card--event .card-body{background:linear-gradient(145deg, rgba(13,110,253,0.12), rgba(13,110,253,0.02));}
.lt-summary-card--tone-live .card-body{background:linear-gradient(140deg, rgba(25,135,84,0.18), rgba(25,135,84,0.05));}
.lt-summary-card--tone-finished .card-body{background:linear-gradient(140deg, rgba(220,53,69,0.2), rgba(220,53,69,0.06));}
.lt-summary-card--tone-red .card-body{background:linear-gradient(140deg, rgba(220,53,69,0.2), rgba(220,53,69,0.06));}
.lt-summary-card--tone-neutral .card-body{background:linear-gradient(140deg, rgba(108,117,125,0.14), rgba(248,249,250,0.75));}

@media (max-width: 576px){
  .lt-summary-card .card-body{padding:.95rem 1.05rem;gap:.4rem;}
  .lt-summary-row--flag{flex-direction:row;align-items:center;gap:.65rem;}
  .lt-summary-country{font-size:1rem;}
  .lt-summary-event{font-size:1.15rem;}
  .lt-summary-laps{flex-direction:row;align-items:center;padding-top:.45rem;}
}

@media (max-width: 768px){
  .livetiming-table th,
  .livetiming-table td{font-size:.85rem;}
  .livetiming-table .lt-col-number,
  .livetiming-table .lt-col-team,
  .livetiming-table .lt-col-bike,
  .livetiming-table .lt-cell.lt-number,
  .livetiming-table .lt-cell.lt-team,
  .livetiming-table .lt-cell.lt-bike{display:none;}
}

@media (max-width: 576px){
  .livetiming-table th,
  .livetiming-table td{font-size:.78rem;}
}

/* Live Timing — Progress indicator */
.lt-progress{display:inline-flex;align-items:center;gap:.35rem;font-weight:600;font-size:.9rem;letter-spacing:.03em;}
.lt-progress span{display:inline-flex;align-items:center;gap:.25rem;}
.lt-progress--up{color:#2e8b57;}
.lt-progress--down{color:#d9534f;}
.lt-progress--even{color:#495057;}
.lt-progress--na{color:#adb5bd;}

.lt-number-badge{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:2.28rem;
  padding:.125rem .57rem;
  border-radius:.45rem;
  font-weight:600;
  letter-spacing:.04em;
  font-size:.95rem;
  line-height:1.2;
}

.livetiming-table .lt-row{transition:background-color .3s ease;}
@keyframes ltHighlightRise{
  0%{background-color:rgba(46,204,113,0.55);} 
  100%{background-color:transparent;}
}
@keyframes ltHighlightFall{
  0%{background-color:rgba(231,76,60,0.55);} 
  100%{background-color:transparent;}
}
@keyframes ltSlideRise{
  0%{transform:translateY(10px);} 
  100%{transform:translateY(0);}
}
@keyframes ltSlideFall{
  0%{transform:translateY(-10px);} 
  100%{transform:translateY(0);}
}
.livetiming-table .lt-row--rise td{animation:ltHighlightRise 5s ease-out forwards;}
.livetiming-table .lt-row--fall td{animation:ltHighlightFall 5s ease-out forwards;}
.livetiming-table .lt-row--rise.lt-row--slide-rise td{animation:ltHighlightRise 5s ease-out forwards, ltSlideRise .45s ease-out;}
.livetiming-table .lt-row--fall.lt-row--slide-fall td{animation:ltHighlightFall 5s ease-out forwards, ltSlideFall .45s ease-out;}

.livetiming-laps--empty .lt-summary-laps-value{color:#adb5bd;}

.lt-name-short{display:none;}
@media (max-width: 768px){
  .lt-name-full{display:none;}
  .lt-name-short{display:inline;}
}
.nextgp-card .card-body{
  display:flex;
  flex-direction:column;
  gap:0.75rem;
  justify-content:flex-start;
}
.nextgp-card .card-body > *:first-child{
  margin-top:0;
}
