
/* ============================================================
   BadmintonScore - Módulo Torneos
   v1.5 - Integración AdminLTE + gestión deportiva
   ============================================================ */

.torneos-page {
    background: #ecf0f5;
    min-height: 100%;
}

/* Evita que reglas del módulo afecten al layout general */
.torneos-page,
.torneos-page * {
    box-sizing: border-box;
}

.torneos-page .content-header {
    padding: 15px 15px 0;
}

.torneos-page .content {
    padding: 15px;
}

/* Cabecera del torneo */
.torneos-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 15px;
    flex-wrap: wrap;
    margin: 0;
}

.torneos-head h1 {
    margin: 0;
    color: #333;
    font-size: 26px;
    font-weight: 700;
}

.torneos-sub {
    color: #777;
    margin-top: 5px;
}

/* Navegación interna */
.torneos-nav {
    display: flex;
    gap: 7px;
    flex-wrap: wrap;
    margin: 0 0 20px;
}

.torneos-nav a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #fff;
    border: 1px solid #d2d6de;
    border-radius: 5px;
    padding: 8px 12px;
    color: #333;
    text-decoration: none;
    box-shadow: 0 1px 2px rgba(0,0,0,.04);
}

.torneos-nav a:hover,
.torneos-nav a:focus {
    border-color: #f39c12;
    color: #b36b00;
    text-decoration: none;
}

/* Cards */
.tor-card {
    background: #fff;
    border: 1px solid #e4e7ea;
    border-radius: 7px;
    box-shadow: 0 2px 8px rgba(0,0,0,.05);
    margin-bottom: 18px;
    overflow: hidden;
}

.tor-card-h {
    padding: 12px 15px;
    border-bottom: 1px solid #eee;
    font-weight: 700;
    background: #fafafa;
    color: #333;
}

.tor-card-b {
    padding: 15px;
    color: #333;
}

/* Métricas */
.tor-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}

.tor-stat {
    background: #fff;
    border: 1px solid #e6e6e6;
    border-radius: 7px;
    padding: 14px;
    min-height: 92px;
    color: #333;
}

.tor-stat .n {
    font-size: 28px;
    font-weight: 800;
    line-height: 1;
}

.tor-stat .l {
    margin-top: 8px;
    color: #777;
    font-size: 12px;
    text-transform: uppercase;
}

/* Tablas */
.tor-table-wrap {
    width: 100%;
    overflow-x: auto;
}

.tor-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
}

.tor-table th,
.tor-table td {
    border-bottom: 1px solid #eee;
    padding: 9px 8px;
    vertical-align: top;
    color: #333;
}

.tor-table th {
    text-align: left;
    background: #fafafa;
    font-weight: 700;
}

/* Botones propios */
.tor-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 8px 12px;
    border: 0;
    border-radius: 5px;
    background: #222d32;
    color: #fff !important;
    text-decoration: none !important;
    cursor: pointer;
    line-height: 1.4;
}

.tor-btn:hover,
.tor-btn:focus {
    opacity: .88;
    color: #fff !important;
}

.tor-btn-warning {
    background: #f39c12;
}

.tor-btn-danger {
    background: #dd4b39;
}

.tor-btn-light {
    background: #fff;
    border: 1px solid #d2d6de;
    color: #333 !important;
}

.tor-btn-light:hover,
.tor-btn-light:focus {
    color: #333 !important;
}

/* Formularios */
.tor-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 12px;
}

.tor-field label {
    display: block;
    font-weight: 700;
    margin-bottom: 5px;
    color: #333;
}

.tor-field input,
.tor-field select,
.tor-field textarea {
    width: 100%;
    padding: 8px 9px;
    border: 1px solid #d2d6de;
    border-radius: 4px;
    background: #fff;
    color: #333;
}

/* Avisos */
.tor-alert {
    padding: 11px 13px;
    border-radius: 5px;
    margin-bottom: 14px;
}

.tor-success {
    background: #e8f5e9;
    color: #256029;
}

.tor-error {
    background: #fdecea;
    color: #9d1c12;
}

.tor-badge {
    display: inline-block;
    padding: 3px 7px;
    border-radius: 12px;
    background: #ecf0f5;
    color: #444;
    font-size: 11px;
    white-space: nowrap;
}

.tor-empty {
    color: #888;
    padding: 18px 0;
}

/* Listado de eventos */
.tor-list-card {
    background: #fff;
    border: 1px solid #e4e7ea;
    border-radius: 7px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,.05);
}

.tor-search {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.tor-search input {
    flex: 1 1 320px;
    max-width: 520px;
    min-width: 220px;
    padding: 8px 10px;
    border: 1px solid #d2d6de;
    border-radius: 4px;
    background: #fff;
    color: #333;
}

/* Árbol eliminatorio */
.tor-tree-scroll {
    width: 100%;
    overflow-x: auto;
    overflow-y: visible;
    padding-bottom: 8px;
}

.tor-tree {
    display: flex;
    gap: 28px;
    min-width: max-content;
    align-items: stretch;
}

.tor-round {
    min-width: 235px;
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    gap: 18px;
}

.tor-match {
    border: 1px solid #d7dce0;
    border-radius: 6px;
    background: #fff;
    min-width: 220px;
    box-shadow: 0 2px 6px rgba(0,0,0,.05);
}

.tor-match-title {
    font-size: 11px;
    color: #777;
    padding: 5px 8px;
    border-bottom: 1px solid #eee;
    background: #fafafa;
}

.tor-side {
    padding: 7px 8px;
    border-bottom: 1px solid #f2f2f2;
    color: #333;
}

.tor-side:last-child {
    border-bottom: 0;
}

/* Footer: no tocarlo desde el módulo.
   AdminLTE calcula correctamente su posición cuando content-wrapper existe. */

@media (max-width: 767px) {
    .torneos-page .content-header {
        padding: 10px 10px 0;
    }

    .torneos-page .content {
        padding: 10px;
    }

    .torneos-head h1 {
        font-size: 22px;
    }

    .torneos-head {
        display: block;
    }

    .torneos-head .tor-btn {
        margin-top: 10px;
    }

    .torneos-nav a {
        padding: 7px 9px;
    }

    .tor-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 480px) {
    .tor-grid {
        grid-template-columns: 1fr;
    }
}


/* ============================================================
   v1.6 - Partidos, resultados y bracket
   ============================================================ */

.tor-filter-bar {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 14px;
}

.tor-filter-bar select,
.tor-filter-bar input {
    padding: 8px 9px;
    border: 1px solid #d2d6de;
    border-radius: 4px;
    background: #fff;
    color: #333;
}

.tor-nowrap {
    white-space: nowrap;
}

.tor-result-cell {
    white-space: nowrap;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.tor-seed {
    display: inline-block;
    font-weight: 800;
    color: #555;
    margin-right: 2px;
}

/* Ganador: amarillo claro + negrita + subrayado. */
.tor-winner-cell,
.tor-side-winner {
    background: #fff6c9 !important;
}

.tor-winner-name {
    font-weight: 800;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
}

/* ============================================================
   Árbol eliminatorio
   ============================================================ */

.tor-tree-scroll {
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 12px;
}

.tor-bracket-tree {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 64px;
    width: max-content;
    min-width: 100%;
    padding: 4px 4px 14px 4px;
}

.tor-bracket-lines {
    position: absolute;
    left: 0;
    top: 0;
    z-index: 0;
    overflow: visible;
    pointer-events: none;
}

.tor-bracket-path {
    fill: none;
    stroke: #7e8a91;
    stroke-width: 2;
    vector-effect: non-scaling-stroke;
}

.tor-bracket-tree .tor-round {
    position: relative;
    z-index: 1;
    flex: 0 0 258px;
    width: 258px;
    min-width: 258px;
}

.tor-round-title {
    height: 34px;
    line-height: 26px;
    text-align: center;
    font-weight: 800;
    color: #444;
    white-space: nowrap;
}

.tor-round-matches {
    position: relative;
    width: 258px;
    min-height: 140px;
}

.tor-bracket-tree .tor-match {
    position: absolute;
    left: 0;
    z-index: 2;
    width: 258px;
    min-width: 258px;
    border: 1px solid #cfd6da;
    border-radius: 6px;
    background: #fff;
    box-shadow: 0 2px 6px rgba(0,0,0,.06);
    overflow: hidden;
}

.tor-match-title {
    min-height: 29px;
    padding: 6px 8px;
    font-size: 11px;
    color: #666;
    background: #f7f7f7;
    border-bottom: 1px solid #e6e6e6;
    white-space: nowrap;
}

.tor-side {
    min-height: 40px;
    padding: 8px;
    display: flex;
    align-items: center;
    color: #333;
    border-bottom: 1px solid #eee;
    line-height: 1.25;
}

.tor-side:last-of-type {
    border-bottom: 0;
}

.tor-match-result {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    background: #fafafa;
    border-top: 1px solid #eee;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.tor-match-time {
    color: #777;
    font-weight: 600;
    margin-left: auto;
}

@media (max-width: 767px) {
    .tor-bracket-tree {
        gap: 48px;
    }

    .tor-bracket-tree .tor-round,
    .tor-round-matches,
    .tor-bracket-tree .tor-match {
        flex-basis: 224px;
        width: 224px;
        min-width: 224px;
    }
}


/* v1.6.1 - Puntuaciones: puntos ganadores de cada set en negrita */
.tor-set-winner {
    font-weight: 900;
}

.tor-set-sep {
    color: #999;
    font-weight: 400;
    padding: 0 2px;
}

/* ============================================================
   v1.7 - Enlaces, matriz de grupos y fases TP
   ============================================================ */

.tor-player-link,
.tor-cuadro-link {
    color: #2b6f9d;
    text-decoration: none;
}

.tor-player-link:hover,
.tor-cuadro-link:hover {
    color: #174765;
    text-decoration: underline;
}

.tor-info-box {
    padding: 10px 12px;
    border-left: 4px solid #3c8dbc;
    background: #f4f9fc;
    color: #444;
    border-radius: 3px;
}

.tor-player-summary {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
    align-items: center;
}

.tor-group-matrix-wrap {
    width: 100%;
    overflow-x: auto;
    overflow-y: visible;
    border: 1px solid #e2e6e9;
    border-radius: 5px;
}

.tor-group-matrix {
    border-collapse: separate;
    border-spacing: 0;
    min-width: 100%;
    background: #fff;
    font-size: 12px;
}

.tor-group-matrix th,
.tor-group-matrix td {
    border-right: 1px solid #e5e8ea;
    border-bottom: 1px solid #e5e8ea;
    padding: 8px;
    vertical-align: middle;
    text-align: center;
    min-width: 145px;
}

.tor-group-matrix tr:last-child th,
.tor-group-matrix tr:last-child td {
    border-bottom: 0;
}

.tor-group-matrix th:last-child,
.tor-group-matrix td:last-child {
    border-right: 0;
}

.tor-group-corner,
.tor-group-rowhead {
    position: sticky;
    left: 0;
    z-index: 4;
    min-width: 220px !important;
    width: 220px;
    text-align: left !important;
    background: #f8f9fa;
}

.tor-group-corner {
    top: 0;
    z-index: 6;
}

.tor-group-head {
    background: #f8f9fa;
    font-weight: 600;
}

.tor-group-rowhead {
    font-weight: 600;
}

.tor-group-pos {
    display: inline-block;
    min-width: 20px;
    font-weight: 800;
    color: #666;
    margin-right: 3px;
}

.tor-group-name {
    margin-top: 3px;
    line-height: 1.25;
}

.tor-group-diagonal {
    background: #eceff1;
    color: #555;
    font-size: 16px;
    font-weight: 900;
}

.tor-group-empty {
    color: #aaa;
    background: #fafafa;
}

.tor-group-score {
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.tor-group-state {
    margin-top: 4px;
    font-size: 11px;
    font-weight: 800;
}

.tor-group-state.won {
    color: #26734d;
}

.tor-group-state.lost {
    color: #9b3a32;
}

.tor-group-won {
    background: #f2fbf5;
}

.tor-group-lost {
    background: #fff8f7;
}

.tor-group-time {
    margin-top: 4px;
    color: #888;
    font-size: 10px;
}

@media (max-width: 767px) {
    .tor-group-corner,
    .tor-group-rowhead {
        min-width: 175px !important;
        width: 175px;
    }

    .tor-group-matrix th,
    .tor-group-matrix td {
        min-width: 130px;
    }
}


/* ============================================================
   v1.8 - Resumen, clubes, podios y clasificación
   ============================================================ */

.tor-stat {
    position: relative;
}

.tor-stat-head {
    display: flex;
    align-items: center;
    gap: 7px;
    color: #666;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 12px;
}

.tor-stat-head i {
    color: #3c8dbc;
    font-size: 15px;
}

.tor-summary-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 12px;
    margin-top: 18px;
}

.tor-summary-action {
    display: flex;
    gap: 14px;
    align-items: center;
    padding: 15px 16px;
    background: #fff;
    border: 1px solid #dfe4e8;
    border-radius: 7px;
    box-shadow: 0 2px 8px rgba(0,0,0,.05);
    color: #333;
    text-decoration: none;
}

.tor-summary-action:hover {
    border-color: #3c8dbc;
    color: #1e5d83;
    text-decoration: none;
}

.tor-summary-action > i {
    font-size: 26px;
    width: 36px;
    text-align: center;
    color: #f39c12;
}

.tor-summary-action strong,
.tor-summary-action span {
    display: block;
}

.tor-summary-action strong {
    font-size: 15px;
    margin-bottom: 3px;
}

.tor-summary-action span {
    color: #777;
    font-size: 12px;
}

.tor-config-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
}

.tor-config-title {
    margin: 0 0 9px;
    color: #555;
    font-weight: 700;
}

.tor-club-small {
    margin-top: 2px;
    color: #929292;
    font-size: 10px;
    font-weight: 400;
    line-height: 1.15;
}

.tor-bracket-player {
    min-width: 0;
    line-height: 1.2;
}

.tor-card-note {
    margin-left: 8px;
    color: #888;
    font-size: 11px;
    font-weight: 400;
}

.tor-category-title {
    margin: 18px 0 10px;
    color: #333;
    font-size: 19px;
    font-weight: 800;
}

.tor-category-title i {
    color: #3c8dbc;
    margin-right: 6px;
}

.tor-podium-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 10px;
}

.tor-podium-item {
    padding: 13px;
    border: 1px solid #e3e6e8;
    border-radius: 6px;
    background: #fafafa;
}

.tor-podium-pos {
    display: inline-block;
    padding: 3px 8px;
    margin-bottom: 7px;
    border-radius: 999px;
    background: #f39c12;
    color: #fff;
    font-weight: 800;
    font-size: 12px;
}

.tor-podium-name {
    font-weight: 700;
    line-height: 1.25;
}

.tor-podium-detail {
    color: #888;
    margin-top: 5px;
    font-size: 10px;
}

@media (max-width: 767px) {
    .tor-config-grid {
        grid-template-columns: 1fr;
    }
}


/* v1.9 - Filtros dinámicos posiciones finales */
.tor-final-filters{display:grid;grid-template-columns:minmax(260px,2fr) repeat(3,minmax(145px,1fr)) auto;gap:12px;align-items:end}
.tor-final-filter label{display:block;margin-bottom:5px;color:#555;font-size:12px;font-weight:700}
.tor-final-filter input,.tor-final-filter select{width:100%;height:38px;padding:7px 9px;border:1px solid #d2d6de;border-radius:4px;background:#fff;color:#333}
.tor-search-input-wrap{position:relative}.tor-search-input-wrap>i{position:absolute;left:11px;top:50%;transform:translateY(-50%);color:#999;pointer-events:none}.tor-search-input-wrap input{padding-left:34px}
.tor-final-filter-action .tor-btn{height:38px;white-space:nowrap}.tor-final-filter-summary{margin-top:12px;color:#777;font-size:12px}.tor-final-phase-detail{margin-top:2px;color:#888;font-size:10px;font-weight:400}.tor-final-table td{vertical-align:middle}
@media(max-width:1100px){.tor-final-filters{grid-template-columns:minmax(240px,2fr) repeat(2,minmax(140px,1fr))}}
@media(max-width:767px){.tor-final-filters{grid-template-columns:1fr}.tor-final-filter-action .tor-btn{width:100%;justify-content:center}}


/* ============================================================
   v1.11 - Dashboard estadístico
   ============================================================ */
.tor-stats-hero{position:relative;overflow:hidden;display:flex;justify-content:space-between;align-items:center;gap:24px;padding:28px 30px;margin-bottom:18px;border-radius:16px;background:linear-gradient(135deg,#0f172a 0%,#172554 46%,#312e81 100%);color:#fff;box-shadow:0 18px 45px rgba(15,23,42,.18)}
.tor-stats-hero:before,.tor-stats-hero:after{content:"";position:absolute;border-radius:999px;filter:blur(1px);opacity:.28}.tor-stats-hero:before{width:230px;height:230px;right:-70px;top:-110px;background:#22d3ee}.tor-stats-hero:after{width:180px;height:180px;right:130px;bottom:-130px;background:#a78bfa}.tor-stats-hero>div{position:relative;z-index:1}.tor-stats-eyebrow{font-size:11px;letter-spacing:.16em;font-weight:800;color:#67e8f9;margin-bottom:7px}.tor-stats-hero h2{margin:0 0 7px;font-size:27px;font-weight:800}.tor-stats-hero p{max-width:760px;margin:0;color:#cbd5e1}.tor-stats-live-pill{display:flex;align-items:center;gap:8px;white-space:nowrap;padding:9px 13px;border:1px solid rgba(255,255,255,.18);background:rgba(255,255,255,.08);border-radius:999px;font-size:12px}.tor-stats-live-pill span{width:8px;height:8px;border-radius:50%;background:#34d399;box-shadow:0 0 0 5px rgba(52,211,153,.14);animation:torPulse 1.8s infinite}@keyframes torPulse{50%{box-shadow:0 0 0 10px rgba(52,211,153,0)}}
.tor-stats-kpis{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:12px;margin-bottom:26px}.tor-kpi{position:relative;overflow:hidden;min-height:132px;padding:17px;border-radius:14px;background:#fff;border:1px solid #e8edf3;box-shadow:0 8px 24px rgba(15,23,42,.055)}.tor-kpi:before{content:"";position:absolute;left:0;top:0;width:100%;height:4px;background:var(--accent)}.tor-kpi>i{position:absolute;right:14px;top:14px;font-size:23px;color:var(--accent);opacity:.22}.tor-kpi-value{font-size:27px;font-weight:850;color:#0f172a;line-height:1.1;margin:10px 0 4px}.tor-kpi-label{font-size:12px;font-weight:800;color:#475569;text-transform:uppercase;letter-spacing:.03em}.tor-kpi small{display:block;color:#94a3b8;margin-top:7px;line-height:1.25}.tor-kpi-blue{--accent:#2563eb}.tor-kpi-purple{--accent:#8b5cf6}.tor-kpi-cyan{--accent:#06b6d4}.tor-kpi-orange{--accent:#f59e0b}.tor-kpi-green{--accent:#10b981}.tor-kpi-pink{--accent:#ec4899}
.tor-stats-section-title{display:flex;align-items:center;gap:13px;margin:31px 0 13px}.tor-stats-section-title>span{display:flex;width:38px;height:38px;align-items:center;justify-content:center;border-radius:11px;background:#0f172a;color:#fff;font-size:12px;font-weight:900}.tor-stats-section-title h3{margin:0;color:#0f172a;font-size:20px;font-weight:850}.tor-stats-section-title p{margin:2px 0 0;color:#94a3b8;font-size:12px}
.tor-chart-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;margin-bottom:14px}.tor-chart-card{min-width:0;padding:17px;border:1px solid #e8edf3;border-radius:15px;background:linear-gradient(180deg,#fff 0%,#fbfdff 100%);box-shadow:0 8px 25px rgba(15,23,42,.045)}.tor-chart-wide{grid-column:span 2}.tor-chart-head{display:flex;justify-content:space-between;gap:12px;align-items:flex-start;margin-bottom:10px}.tor-chart-head h4{margin:0;color:#0f172a;font-size:14px;font-weight:850}.tor-chart-head p{margin:3px 0 0;color:#94a3b8;font-size:11px}.tor-chart-head>i{color:#6366f1;font-size:18px;opacity:.65}.tor-chart-wrap{position:relative;height:285px}.tor-chart-tall{height:330px}.tor-chart-small{height:210px;margin-top:12px}
.tor-mini-kpis{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;margin:13px 0 18px}.tor-mini-kpis>div{padding:13px 15px;border:1px solid #e8edf3;border-radius:11px;background:#fff}.tor-mini-kpis strong{display:block;color:#111827;font-size:20px}.tor-mini-kpis span{display:block;margin-top:3px;color:#94a3b8;font-size:11px}
.tor-heatmap-wrap{overflow:auto}.tor-heatmap{width:100%;border-collapse:separate;border-spacing:5px}.tor-heatmap th{padding:7px;color:#64748b;font-size:11px;text-align:center}.tor-heatmap tbody th{text-align:left;white-space:nowrap}.tor-heat-cell{min-width:92px;padding:12px 7px;border-radius:8px;background:rgba(37,99,235,var(--heat));color:#0f172a;font-size:11px;font-weight:800;text-align:center}.tor-heat-cell[style*="--heat:0.000"]{background:#f8fafc;color:#cbd5e1}
.tor-ranking-list{display:flex;flex-direction:column;gap:3px}.tor-ranking-list a{display:grid;grid-template-columns:28px minmax(0,1fr) auto;gap:8px;align-items:center;padding:8px;border-radius:9px;color:#334155;text-decoration:none}.tor-ranking-list a:hover{background:#f1f5f9}.tor-rank-n{display:flex;width:25px;height:25px;align-items:center;justify-content:center;border-radius:8px;background:#eef2ff;color:#4f46e5;font-size:10px;font-weight:900}.tor-ranking-list strong{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:11px}.tor-ranking-list small{display:block;color:#a0aec0;font-size:9px}.tor-ranking-list b{font-size:11px;color:#0f172a;white-space:nowrap}.tor-seed-kpis{display:grid;grid-template-columns:1fr 1fr;gap:8px}.tor-seed-kpis>div{padding:10px;border-radius:10px;background:#f8fafc}.tor-seed-kpis strong{display:block;color:#7c3aed;font-size:21px}.tor-seed-kpis span{font-size:10px;color:#94a3b8}
.tor-shuttle-hero{display:grid;grid-template-columns:auto minmax(0,1.7fr) minmax(120px,.6fr) minmax(130px,.6fr);gap:18px;align-items:center;padding:20px 23px;margin-bottom:14px;border-radius:15px;background:linear-gradient(135deg,#ecfeff 0%,#eff6ff 50%,#f5f3ff 100%);border:1px solid #dbeafe}.tor-shuttle-icon{display:flex;width:54px;height:54px;align-items:center;justify-content:center;border-radius:16px;background:#fff;color:#2563eb;font-size:24px;box-shadow:0 8px 20px rgba(37,99,235,.12)}.tor-shuttle-hero span,.tor-shuttle-hero small{display:block;color:#64748b}.tor-shuttle-hero>div>strong{display:block;color:#0f172a;font-size:24px}.tor-shuttle-bottles,.tor-shuttle-quality{padding-left:18px;border-left:1px solid #cbd5e1}.tor-shuttle-bottles strong,.tor-shuttle-quality strong{font-size:27px!important}.tor-shuttle-bottles span,.tor-shuttle-quality span{font-size:11px}
.tor-record-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:11px;margin-bottom:20px}.tor-record-card{position:relative;min-height:142px;padding:16px;border:1px solid #e8edf3;border-radius:14px;background:#fff;box-shadow:0 7px 20px rgba(15,23,42,.04)}.tor-record-card>i{font-size:19px;color:#6366f1;margin-bottom:12px}.tor-record-card>span{display:block;color:#94a3b8;font-size:10px;font-weight:800;text-transform:uppercase}.tor-record-card>strong{display:block;margin:4px 0;color:#0f172a;font-size:20px}.tor-record-card>small{display:-webkit-box;overflow:hidden;color:#64748b;font-size:10px;line-height:1.25;-webkit-box-orient:vertical;-webkit-line-clamp:2}
.tor-reveal{opacity:0;transform:translateY(13px);transition:opacity .55s ease,transform .55s ease}.tor-reveal.is-visible{opacity:1;transform:none}
@media(max-width:1300px){.tor-stats-kpis{grid-template-columns:repeat(3,1fr)}.tor-record-grid{grid-template-columns:repeat(2,1fr)}}
@media(max-width:900px){.tor-chart-grid{grid-template-columns:1fr}.tor-chart-wide{grid-column:span 1}.tor-mini-kpis{grid-template-columns:repeat(2,1fr)}.tor-shuttle-hero{grid-template-columns:auto 1fr}.tor-shuttle-bottles,.tor-shuttle-quality{border-left:0;padding-left:0}.tor-stats-hero{align-items:flex-start;flex-direction:column}}
@media(max-width:620px){.tor-stats-kpis{grid-template-columns:1fr 1fr}.tor-mini-kpis{grid-template-columns:1fr}.tor-record-grid{grid-template-columns:1fr}.tor-shuttle-hero{grid-template-columns:1fr}.tor-stats-hero{padding:22px}.tor-stats-hero h2{font-size:23px}.tor-chart-wrap{height:260px}}


/* ============================================================
   v1.12 - Estadísticas públicas
   ============================================================ */

.tor-public-stats-page {
    min-height: 100vh;
    padding: 28px 0 48px;
    background:
        radial-gradient(circle at 10% 0%, rgba(37,99,235,.09), transparent 32%),
        radial-gradient(circle at 90% 10%, rgba(139,92,246,.08), transparent 30%),
        #f6f8fb;
}

.tor-public-stats-page .container {
    max-width: 1320px;
}

.tor-public-back {
    margin-bottom: 12px;
}

.tor-public-back a {
    display: inline-flex;
    gap: 7px;
    align-items: center;
    color: #64748b;
    font-weight: 700;
    text-decoration: none;
}

.tor-public-back a:hover {
    color: #2563eb;
}

.tor-public-hero {
    margin-top: 0;
}

.tor-public-privacy-note {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-top: 24px;
    padding: 14px 16px;
    border: 1px solid rgba(16,185,129,.22);
    border-radius: 10px;
    background: rgba(236,253,245,.86);
    color: #476158;
    font-size: 12px;
    line-height: 1.5;
}

.tor-public-privacy-note i {
    margin-top: 2px;
    color: #10b981;
    font-size: 16px;
}

@media (max-width: 767px) {
    .tor-public-stats-page {
        padding-top: 15px;
    }
}


/* ============================================================
   v1.12.1 - Tema público claro + Font Awesome 4
   ============================================================ */

.tor-public-stats-page {
    min-height: 100vh;
    padding: 28px 0 48px;
    color: #334155;
    background:
        radial-gradient(circle at 8% 0%, rgba(59,130,246,.055), transparent 30%),
        radial-gradient(circle at 92% 6%, rgba(139,92,246,.045), transparent 28%),
        linear-gradient(180deg, #ffffff 0%, #f8fbff 46%, #ffffff 100%);
}

/* La cabecera pública deja de usar el fondo azul oscuro del panel privado. */
.tor-public-stats-page .tor-stats-hero {
    border: 1px solid #dfe8f3;
    background:
        radial-gradient(circle at 90% 10%, rgba(59,130,246,.10), transparent 34%),
        radial-gradient(circle at 70% 100%, rgba(139,92,246,.08), transparent 30%),
        linear-gradient(135deg, #ffffff 0%, #f7faff 52%, #f3f7ff 100%);
    color: #0f172a;
    box-shadow: 0 12px 32px rgba(51,65,85,.08);
}

.tor-public-stats-page .tor-stats-hero:before {
    background: #bfdbfe;
    opacity: .24;
}

.tor-public-stats-page .tor-stats-hero:after {
    background: #ddd6fe;
    opacity: .22;
}

.tor-public-stats-page .tor-stats-eyebrow {
    color: #2563eb;
}

.tor-public-stats-page .tor-stats-hero h2 {
    color: #0f172a;
}

.tor-public-stats-page .tor-stats-hero p {
    color: #64748b;
}

.tor-public-stats-page .tor-stats-live-pill {
    border-color: #dbe6f4;
    background: rgba(255,255,255,.78);
    color: #475569;
    box-shadow: 0 4px 14px rgba(51,65,85,.05);
}

/* Contraste consistente en tarjetas y títulos públicos. */
.tor-public-stats-page .tor-kpi,
.tor-public-stats-page .tor-chart-card,
.tor-public-stats-page .tor-mini-kpis > div,
.tor-public-stats-page .tor-record-card,
.tor-public-stats-page .tor-shuttle-hero {
    background: #ffffff;
    border-color: #e3eaf2;
}

.tor-public-stats-page .tor-kpi-value,
.tor-public-stats-page .tor-stats-section-title h3,
.tor-public-stats-page .tor-chart-head h4,
.tor-public-stats-page .tor-mini-kpis strong,
.tor-public-stats-page .tor-record-card strong {
    color: #0f172a;
}

.tor-public-stats-page .tor-kpi-label,
.tor-public-stats-page .tor-record-card span {
    color: #475569;
}

.tor-public-stats-page .tor-kpi small,
.tor-public-stats-page .tor-stats-section-title p,
.tor-public-stats-page .tor-chart-head p,
.tor-public-stats-page .tor-mini-kpis span,
.tor-public-stats-page .tor-record-card small {
    color: #7c8ba1;
}

/* Los números de sección siguen destacando, pero con un azul más luminoso. */
.tor-public-stats-page .tor-stats-section-title > span {
    background: linear-gradient(135deg, #2563eb, #6366f1);
    color: #ffffff;
    box-shadow: 0 5px 14px rgba(37,99,235,.18);
}

/* Iconos Font Awesome 4 de la página pública. */
.tor-public-stats-page i.fa {
    text-rendering: auto;
    -webkit-font-smoothing: antialiased;
}

.tor-public-stats-page .tor-chart-head > i.fa {
    color: #4f46e5;
    opacity: .70;
}

.tor-public-stats-page .tor-public-back a {
    color: #52657a;
}

.tor-public-stats-page .tor-public-back a:hover {
    color: #2563eb;
}

@media (max-width: 767px) {
    .tor-public-stats-page {
        padding-top: 15px;
        background: #fbfdff;
    }
}
