@import url("/assets/00_typography.css");

/* =============================================================================
   PLATAFORMA INTELIGENCIA DE NEGOCIO - RC DEPORTIVO
   ============================================================================= */

/* Variables */
:root {
    --primary-blue: #0d3b66;
    --dark-blue: #0d3154;
    --accent-blue: #1764a0;
    --light-blue: #88b8e8;
    --white: #ffffff;
    --light-gray: #f5f5f5;
    --text-gray: #666666;
    --sidebar-width: 220px;
    --success-green: #2ecc71;
    --danger-red: #e74c3c;
    --warning-orange: #f39c12;
}

/* =============================================================================
   FUENTES CORPORATIVAS OFICIALES (locales)
   Declaradas en 00_typography.css y servidas desde assets/fonts/rcd/
   ============================================================================= */

/* Font faces and tokens: 00_typography.css */

/* Reset y base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-body, "Commissioner", Arial, sans-serif);
    background-color: var(--light-gray);
    min-height: 100vh;
}

/* Clase utilitaria para usar Barlow Condensed en titulares */
.font-condensed,
.banner-title,
.escudos-nav-title,
.ficha-columna-header,
.ficha-header-rival,
.ficha-header-resultado,
.home-card-title,
.home-card-value,
.section-title,
.kpi-value,
.kpi-value-positive,
.kpi-value-negative,
.kpi-value-neutral,
.ficha-kpi-value,
.sidebar-title,
.header-title {
    font-family: var(--font-display, "Barlow Condensed", "Arial Narrow", Arial, sans-serif);
}

/* =============================================================================
   BANDA CON TÍTULO (usada en el home encima de las 4 tarjetas,
   y reutilizable en otras secciones)
   ============================================================================= */

.banner-title {
    background: linear-gradient(180deg, var(--primary-blue) 0%, var(--dark-blue) 100%);
    color: var(--white);
    font-size: 1.8rem;
    font-weight: 700;
    letter-spacing: 5px;
    text-align: center;
    text-transform: uppercase;
    padding: 20px 22px;
    border-radius: 10px;
    margin: 0 0 22px 0;
    box-shadow: 0 3px 14px rgba(0, 0, 0, 0.18);
}

/* =============================================================================
   LAYOUT PRINCIPAL
   ============================================================================= */

.app-container {
    display: flex;
    min-height: 100vh;
}

/* =============================================================================
   SIDEBAR
   ============================================================================= */

.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, var(--primary-blue) 0%, var(--dark-blue) 100%);
    color: var(--white);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    z-index: 1000;
}

.sidebar-header {
    padding: 20px 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-title {
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--white);
    margin: 0;
}

.sidebar-banner {
    display: block;
    height: 40px;
    width: auto;
    max-width: 100%;
    margin: 0 auto;
}

/* Sub-items del sidebar (expandibles bajo una sección con sub-páginas) */
.nav-sublink {
    display: block;
    padding: 8px 20px 8px 52px;
    color: rgba(255, 255, 255, 0.65);
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 500;
    transition: all 0.25s ease;
    border-left: 3px solid transparent;
    letter-spacing: 0.5px;
}

.nav-sublink:hover {
    color: var(--white);
    background-color: rgba(255, 255, 255, 0.06);
}

.nav-sublink.active {
    color: var(--white);
    background-color: rgba(255, 255, 255, 0.1);
    border-left-color: var(--light-blue);
    font-weight: 600;
}

/* =============================================================================
   TOGGLE TEMPORADA (cápsula con switch a la derecha)
   ============================================================================= */

/* Contenedor exterior: cápsula gris */
.season-toggle {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    background-color: #f5f5f5;
    border: 1px solid #e0e0e0;
    border-radius: 22px;
    padding: 6px 14px 6px 18px;
    cursor: pointer;
    font-family: var(--font-body, "Commissioner", Arial, sans-serif);
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--primary-blue);
    user-select: none;
    transition: background-color 0.2s ease, box-shadow 0.2s ease;
}

.season-toggle:hover {
    background-color: #ececec;
}

.season-toggle-label {
    letter-spacing: 0.4px;
    line-height: 1;
}

/* Switch interno (estilo iOS) */
.season-toggle-switch {
    position: relative;
    width: 36px;
    height: 20px;
    background-color: #cfd6dd;
    border-radius: 12px;
    transition: background-color 0.25s ease;
    flex-shrink: 0;
}

.season-toggle-switch::before {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    background-color: var(--white);
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
    transition: transform 0.25s ease;
}

/* Estado activo: switch a la derecha + color azul corporativo */
.season-toggle.active .season-toggle-switch {
    background-color: var(--primary-blue);
}
.season-toggle.active .season-toggle-switch::before {
    transform: translateX(16px);
}

/* Wrapper que posiciona el toggle en la esquina sup-derecha del contenedor */
.section-header-toggle-wrapper {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 8px;
    padding: 0 4px;
}

/* =============================================================================
   DESGLOSE DE VENTAS — TOGGLE BARRAS / PALCOS
   ============================================================================= */

.store-toggle-row {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 10px;
}

.store-toggle-btn {
    font-family: var(--font-display, "Barlow Condensed", "Arial Narrow", Arial, sans-serif);
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    padding: 8px 24px;
    border-radius: 6px;
    border: 2px solid var(--primary-blue);
    background-color: var(--white);
    color: var(--primary-blue);
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
    min-width: 110px;
}

.store-toggle-btn:hover {
    background-color: rgba(26, 58, 92, 0.08);
}

.store-toggle-btn.active {
    background-color: var(--primary-blue);
    color: var(--white);
}


.sidebar-nav {
    flex: 1;
    padding: 10px 0;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 20px;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

.nav-icon {
    width: 22px;
    height: 22px;
    object-fit: contain;
    mix-blend-mode: screen;
    flex-shrink: 0;
}

.nav-link:hover {
    background-color: rgba(255, 255, 255, 0.15);
    color: var(--white);
    border-left-color: var(--light-blue);
}

.nav-link.active {
    background-color: rgba(255, 255, 255, 0.25);
    color: var(--white);
    border-left-color: #f0a500;
    font-weight: 600;
}

.sidebar-footer {
    padding: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    background-color: rgba(0, 0, 0, 0.2);
}

.user-info {
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 3px;
}

.user-role {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 10px;
}

.btn-logout {
    width: 100%;
    padding: 8px 15px;
    background-color: #c0392b;
    color: var(--white);
    border: none;
    border-radius: 4px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.btn-logout:hover {
    background-color: #a93226;
}

/* =============================================================================
   CONTENIDO PRINCIPAL
   ============================================================================= */

.main-content {
    flex: 1;
    min-width: 0;
    max-width: calc(100vw - var(--sidebar-width));
    margin-left: var(--sidebar-width);
    background-image: 
        linear-gradient(rgba(13, 59, 102, 0.60), rgba(20, 78, 140, 0.46)),
        url('/assets/depor-elche-277.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    min-height: 100vh;
    padding: 20px 30px;
    overflow-x: hidden;
    box-sizing: border-box;
}

/* =============================================================================
   HEADER
   ============================================================================= */

.main-header {
    margin-bottom: 25px;
}

/* Keep white headings readable over the sky without hiding the photograph. */
.main-header .header-title,
.main-header .header-subtitle {
    text-shadow: 0 1px 5px rgba(11, 32, 64, 0.85);
}

.header-content {
    display: flex;
    align-items: center;
    gap: 15px;
}

.header-logo {
    width: 60px;
    height: 60px;
    object-fit: contain;
}

.header-title {
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--white);
    margin: 0;
}

.header-subtitle {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.7);
    margin: 5px 0 0 0;
}

/* =============================================================================
   TARJETAS
   ============================================================================= */

.cards-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.cards-row {
    display: flex;
    gap: 20px;
}

.content-card {
    flex: 1;
    background-color: var(--white);
    border-radius: 8px;
    padding: 20px 25px;
    position: relative;
    overflow: hidden;
    min-height: 180px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.content-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
}

.card-header-section {
    margin-bottom: 10px;
}

.card-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary-blue);
    margin: 0;
}

.card-body {
    position: relative;
    z-index: 1;
}

.card-description {
    font-size: 0.85rem;
    color: var(--text-gray);
    margin-bottom: 15px;
}

.card-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.card-list li {
    padding: 6px 0;
    font-size: 0.9rem;
    color: var(--accent-blue);
    cursor: pointer;
    transition: color 0.2s ease;
}

.card-list li:hover {
    color: var(--primary-blue);
    text-decoration: underline;
}

.card-icon {
    position: absolute;
    right: 15px;
    bottom: 15px;
    opacity: 0.15;
}

.card-image {
    width: 100px;
    height: 100px;
    object-fit: contain;
}

/* =============================================================================
   SUBMENÚ
   ============================================================================= */

.nav-link-parent {
    cursor: pointer;
}

.nav-link-parent::after {
    content: '▼';
    float: right;
    font-size: 0.7rem;
    margin-right: 5px;
    transition: transform 0.3s ease;
}

.submenu {
    display: none;
    background-color: rgba(0, 0, 0, 0.2);
    padding-left: 15px;
}

.nav-link-sub {
    display: block;
    padding: 10px 20px;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 0.8rem;
    transition: all 0.3s ease;
    border-left: 2px solid transparent;
}

.nav-link-sub:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--white);
    border-left-color: var(--light-blue);
}

/* =============================================================================
   NAVEGACIÓN HORIZONTAL (TABS DE SECCIÓN)
   ============================================================================= */

.section-header {
    background-color: var(--white);
    padding: 15px 20px;
    margin-bottom: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    max-width: 100%;
    overflow: hidden;
}

.section-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary-blue);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: center;
}

.section-tabs {
    display: flex;
    gap: 10px;
    flex-wrap: nowrap;
    width: 100%;
}

.section-tab {
    flex: 1 1 0;
    min-width: 0;
    padding: 8px 10px;
    background-color: var(--light-gray);
    border: 1px solid #ddd;
    border-radius: 20px;
    color: var(--text-gray);
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 500;
    transition: all 0.3s ease;
    cursor: pointer;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.section-tab:hover {
    background-color: var(--primary-blue);
    color: var(--white);
    border-color: var(--primary-blue);
}

.section-tab.active {
    background-color: var(--primary-blue);
    color: var(--white);
    border-color: var(--primary-blue);
    font-weight: 700;
}

.section-tab .tab-subtitle {
    display: block;
    font-size: 0.65rem;
    font-weight: 400;
    opacity: 0.8;
    margin-top: 2px;
}

/* Contenedor unificado para contenido de página */
.page-content-container {
    background-color: var(--white);
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    overflow-y: visible;
    box-sizing: border-box;
}

/* =============================================================================
   PÁGINAS DE CONTENIDO
   ============================================================================= */

.page-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--white);
    margin-bottom: 3px;
}

.page-subtitle {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 10px;
}

/* Filtros */
.filters-container {
    display: flex;
    gap: 20px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.filter-item {
    min-width: 200px;
}

.filter-item label {
    display: block;
    color: var(--white);
    font-size: 0.85rem;
    margin-bottom: 5px;
}

/* KPIs */
.kpis-container {
    margin-bottom: 10px;
    overflow: visible;
}

.kpis-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    overflow: visible;
}

.kpi-card {
    background-color: var(--light-gray);
    border-radius: 6px;
    padding: 6px 12px 4px;
    min-width: 120px;
    flex: 1;
    text-align: center;
    border: 1px solid #e0e0e0;
}

.kpi-value {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--primary-blue);
}

.kpi-value-positive {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--success-green);
}

.kpi-value-neutral {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--primary-blue);
}

.kpi-value-negative {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--danger-red);
}

.kpi-pct-diff {
    font-size: 0.9rem;
    font-weight: 600;
}

.kpi-pct-diff.kpi-value-positive {
    font-size: 0.9rem;
    color: var(--success-green);
}

.kpi-pct-diff.kpi-value-negative {
    font-size: 0.9rem;
    color: var(--danger-red);
}

.kpi-previous {
    font-size: 0.7rem;
    color: var(--text-gray);
    margin-top: 2px;
    font-style: italic;
}

.kpi-label {
    font-size: 0.7rem;
    color: var(--text-gray);
    margin-top: 3px;
    font-weight: 500;
}

.kpi-label-top {
    font-size: 1.4rem;
    color: var(--primary-blue);
    font-weight: 700;
    margin-bottom: 5px;
}

/* Gráficas */
.graphs-container {
    display: flex;
    flex-direction: column;
    gap: 5px;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}

.graphs-row {
    display: flex;
    gap: 5px;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}

.graph-card {
    flex: 1;
    min-width: 0;
    background-color: transparent;
    border-radius: 6px;
    padding: 6px 12px;
    max-height: 380px;
    overflow: hidden;
}

.graph-card.full-width {
    flex: 1 1 100%;
    max-height: 420px;
    background-color: transparent;
}

.graph-card.small {
    max-height: 280px;
}

.graph-card h4 {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--primary-blue);
    margin-bottom: 0px;
    text-align: center;
}

.graph-card .js-plotly-plot {
    max-height: 380px !important;
}

/* Variante del contenedor de gráfica con scroll vertical interno: mantiene el
   tamaño exterior de 380px pero permite al gráfico crecer en altura y
   desplazarse mediante scroll (usado en el panel de productos por punto de
   venta del DESGLOSE DE VENTAS). */
.graph-card--scrollable {
    overflow-y: auto;
}
.graph-card--scrollable .js-plotly-plot {
    max-height: none !important;
}

/* Loading Spinner */
.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 70vh;
    width: 100%;
    background-color: var(--white);
    border-radius: 8px;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--primary-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-text {
    margin-top: 15px;
    font-size: 1rem;
    color: var(--text-gray);
    font-weight: 500;
}

/* Placeholder */
.placeholder-container {
    background-color: var(--white);
    border-radius: 8px;
    padding: 40px;
    text-align: center;
}

.placeholder-text {
    color: var(--text-gray);
    font-size: 1rem;
}

/* =============================================================================
   RESPONSIVE
   ============================================================================= */

/* =============================================================================
   HOME CARDS
   ============================================================================= */

.home-card-link {
    flex: 1;
    text-decoration: none;
    color: inherit;
}

.home-card {
    background-color: var(--white);
    border-radius: 8px;
    padding: 30px 25px;
    min-height: 180px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    cursor: pointer;
    position: relative;
}

.home-card:hover {
    background-color: rgba(26, 58, 92, 0.08);
    border-left-color: var(--light-blue);
    transform: translateY(-3px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
}

.home-card-title {
    font-size: 1.45rem;
    font-weight: 700;
    color: var(--primary-blue);
    margin: 0 0 14px 0;
}

.home-card-subtitle {
    font-size: 0.75rem;
    font-weight: 600;
    color: #666;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.home-card-value {
    font-size: 2rem;
    font-weight: 700;
    font-family: var(--font-body, "Commissioner", Arial, sans-serif);
}

/* =============================================================================
   LOGIN PAGE
   ============================================================================= */

.login-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-image:
        linear-gradient(rgba(11, 32, 64, 0.08), rgba(11, 32, 64, 0.20)),
        url('/assets/depor-elche-277.jpg');
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.login-box {
    background-color: var(--white);
    border: 1px solid #d2d7df;
    border-radius: 6px;
    padding: 40px 36px 35px;
    width: 300px;
    max-width: 90vw;
    box-sizing: border-box;
    box-shadow: 0 8px 28px rgba(11, 32, 64, 0.20);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.login-shield {
    width: 76px;
    height: auto;
    margin-bottom: 28px;
}

.login-title {
    font-size: 1.9rem;
    font-weight: 600;
    color: #172333;
    margin: 0 0 24px 0;
    font-family: var(--font-body, "Commissioner", Arial, sans-serif);
}

.login-input {
    width: 100%;
    box-sizing: border-box;
    padding: 8px 11px;
    margin-bottom: 14px;
    border: 1px solid #d8dfe9;
    border-radius: 4px;
    font-size: 0.9rem;
    font-family: var(--font-body, "Commissioner", Arial, sans-serif);
    color: #333;
    outline: none;
    transition: border-color 0.3s ease;
}

.login-input:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 2px rgba(13, 110, 253, 0.12);
}

.login-error {
    color: #e74c3c;
    font-size: 0.82rem;
    font-weight: 500;
    margin-bottom: 10px;
    font-family: var(--font-body, "Commissioner", Arial, sans-serif);
}

.login-error:empty {
    display: none;
}

.login-btn {
    width: 100%;
    padding: 8px 11px;
    background-color: #0d6efd;
    color: var(--white);
    border: none;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 600;
    font-family: var(--font-body, "Commissioner", Arial, sans-serif);
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.login-btn:hover {
    background-color: #0b5ed7;
}

.login-btn:focus-visible {
    outline: 3px solid #88b8e8;
    outline-offset: 3px;
}

/* =============================================================================
   RESPONSIVE
   ============================================================================= */

/* =============================================================================
   LEGEND TOOLTIP (?) CIRCLES
   ============================================================================= */

.custom-legend {
    display: flex;
    justify-content: center;
    gap: 25px;
    margin: 4px 0 2px 0;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    font-weight: 600;
    font-family: var(--font-body, "Commissioner", Arial, sans-serif);
}

.legend-color {
    width: 14px;
    height: 3px;
    border-radius: 2px;
    flex-shrink: 0;
}

.legend-tooltip-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.legend-tooltip-icon {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 1.5px solid #999;
    background-color: transparent;
    color: #999;
    font-size: 10px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: help;
    flex-shrink: 0;
    transition: border-color 0.2s, color 0.2s;
    font-family: var(--font-body, "Commissioner", Arial, sans-serif);
}

.legend-tooltip-icon:hover {
    border-color: var(--primary-blue);
    color: var(--primary-blue);
}

.legend-tooltip-box {
    visibility: hidden;
    opacity: 0;
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--dark-blue);
    color: var(--white);
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 400;
    line-height: 1.45;
    width: 260px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
    z-index: 100;
    pointer-events: none;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    text-align: left;
}

.legend-tooltip-box::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-width: 6px;
    border-style: solid;
    border-color: var(--dark-blue) transparent transparent transparent;
}

.legend-tooltip-wrapper:hover .legend-tooltip-box {
    visibility: visible;
    opacity: 1;
}

/* =============================================================================
   KPI TOOLTIP (?) CIRCLES
   ============================================================================= */

.kpi-tooltip-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.kpi-tooltip-icon {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 1.5px solid var(--primary-blue);
    background-color: transparent;
    color: var(--primary-blue);
    font-size: 9px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: help;
    flex-shrink: 0;
    transition: border-color 0.2s, color 0.2s;
    font-family: var(--font-body, "Commissioner", Arial, sans-serif);
}

.kpi-tooltip-icon:hover {
    border-color: var(--dark-blue);
    color: var(--dark-blue);
}

.kpi-tooltip-box {
    visibility: hidden;
    opacity: 0;
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--dark-blue);
    color: var(--white);
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.68rem;
    font-weight: 400;
    line-height: 1.4;
    width: 230px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
    z-index: 99999;
    pointer-events: none;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    text-align: left;
}

.kpi-tooltip-box::after {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-width: 6px;
    border-style: solid;
    border-color: transparent transparent var(--dark-blue) transparent;
}

.kpi-tooltip-box.pos-left {
    left: auto;
    right: 0;
    transform: translateX(10%);
}

.kpi-tooltip-box.pos-left::after {
    left: auto;
    right: 14px;
    transform: translateX(50%);
}

.kpi-tooltip-wrapper:hover .kpi-tooltip-box {
    visibility: visible;
    opacity: 1;
}

/* =============================================================================
   ANÁLISIS INDIVIDUAL - BUTTON & MODAL
   ============================================================================= */

.btn-analisis-individual {
    display: block;
    width: 100%;
    padding: 10px 20px;
    margin-bottom: 12px;
    background-color: var(--white);
    border: 2px solid var(--primary-blue);
    border-radius: 8px;
    color: var(--primary-blue);
    font-size: 0.85rem;
    font-weight: 700;
    font-family: var(--font-body, "Commissioner", Arial, sans-serif);
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
}

.btn-analisis-individual:hover {
    background-color: var(--primary-blue);
    color: var(--white);
}

.btn-analisis-individual.active {
    background-color: var(--primary-blue);
    color: var(--white);
    border-color: var(--primary-blue);
}

.btn-analisis-individual.active .selection-pill {
    background-color: var(--white);
    color: var(--primary-blue);
}

/* Modal overlay */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.55);
    z-index: 5000;
    align-items: center;
    justify-content: center;
}

.modal-overlay.visible {
    display: flex;
}

/* Modal box */
.modal-box {
    background-color: var(--white);
    border-radius: 12px;
    width: 520px;
    max-width: 92vw;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.35);
    overflow: hidden;
}

.modal-header {
    padding: 18px 24px 14px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary-blue);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0;
}

.modal-close-btn {
    background: none;
    border: none;
    font-size: 1.4rem;
    color: #999;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
    transition: color 0.2s;
}

.modal-close-btn:hover {
    color: var(--danger-red);
}

.modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 10px 24px 16px;
}

/* Match list items */
.match-list-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 8px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background-color 0.15s;
    border-radius: 4px;
}

.match-list-item:hover {
    background-color: #f7f9fc;
}

.match-list-item:last-child {
    border-bottom: none;
}

.match-checkbox {
    width: 18px;
    height: 18px;
    accent-color: var(--primary-blue);
    cursor: pointer;
    flex-shrink: 0;
}

.match-escudo {
    width: 30px;
    height: 30px;
    object-fit: contain;
    flex-shrink: 0;
}

.match-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.match-rival-name {
    font-size: 0.82rem;
    font-weight: 600;
    color: #333;
}

.match-details {
    font-size: 0.7rem;
    color: #888;
    font-weight: 400;
}

/* Modal footer */
.modal-footer {
    padding: 12px 24px;
    border-top: 1px solid #e0e0e0;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.modal-btn {
    padding: 8px 22px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    font-family: var(--font-body, "Commissioner", Arial, sans-serif);
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

.modal-btn-primary {
    background-color: var(--primary-blue);
    color: var(--white);
}

.modal-btn-primary:hover {
    background-color: var(--dark-blue);
}

.modal-btn-secondary {
    background-color: var(--light-gray);
    color: #555;
    border: 1px solid #ccc;
}

.modal-btn-secondary:hover {
    background-color: #e8e8e8;
}

/* Selected matches indicator pill */
.selection-pill {
    display: inline-block;
    background-color: var(--primary-blue);
    color: var(--white);
    font-size: 0.72rem;
    font-weight: 600;
    padding: 3px 12px;
    border-radius: 12px;
    margin-left: 10px;
    vertical-align: middle;
}

@media (max-width: 992px) {
    .cards-row, .graphs-row {
        flex-direction: column;
    }
    
    .sidebar {
        width: 180px;
    }
    
    .main-content {
        margin-left: 180px;
        max-width: calc(100vw - 180px);
    }
    
    .kpis-row {
        flex-wrap: wrap;
    }
    
    .kpi-card {
        min-width: 120px;
    }
}

@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
    }
    
    .main-content {
        margin-left: 0;
        max-width: 100vw;
    }
    
    .app-container {
        flex-direction: column;
    }
}

/* =============================================================================
   NAVEGADOR DE ESCUDOS — FICHA POST PARTIDO
   ============================================================================= */

/* Banda azul corporativa con los escudos — home */
.escudos-nav-section {
    margin-top: 30px;
    padding: 28px 22px 24px;
    background: linear-gradient(180deg, var(--primary-blue) 0%, var(--dark-blue) 100%);
    border-radius: 10px;
    box-shadow: 0 3px 14px rgba(0, 0, 0, 0.18);
}

.escudos-nav-title {
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: 4px;
    color: var(--white);
    text-align: center;
    margin: 0 0 22px 0;
    text-transform: uppercase;
}

.escudos-nav-rows {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.escudos-nav-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    width: 100%;
}

.escudo-slot-link {
    flex: 1;
    display: flex;
    justify-content: center;
    text-decoration: none;
}

.escudo-slot {
    width: 78px;
    height: 78px;
    border-radius: 50%;
    background-color: var(--white);
    border: 3px solid var(--white);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
    cursor: pointer;
}

.escudo-slot img {
    width: 58px;
    height: 58px;
    object-fit: contain;
    transition: filter 0.25s ease;
}

.escudo-slot--enabled:hover {
    background-color: var(--primary-blue);
    border: 3px solid var(--white);
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}

.escudo-slot--disabled {
    background-color: #4a4a4a;
    border-color: #4a4a4a;
    cursor: not-allowed;
    box-shadow: none;
}

.escudo-slot--disabled img {
    filter: grayscale(1) brightness(0.55) opacity(0.55);
}

.escudo-slot--active {
    background-color: var(--primary-blue);
    border: 3px solid var(--white);
    box-shadow: 0 4px 14px rgba(26, 58, 92, 0.45);
}

/* Variante horizontal dentro de la ficha post-partido (1 fila) */
.escudos-nav-ficha {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    background: linear-gradient(180deg, var(--primary-blue) 0%, var(--dark-blue) 100%);
    border-radius: 10px;
    padding: 16px 20px;
    margin-bottom: 18px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
    overflow-x: auto;
}

.escudos-nav-ficha .escudo-slot-link {
    flex: 0 0 auto;
}

.escudos-nav-ficha .escudo-slot {
    width: 64px;
    height: 64px;
}

.escudos-nav-ficha .escudo-slot img {
    width: 46px;
    height: 46px;
}

/* =============================================================================
   FICHA POST-PARTIDO — CUADRÍCULA 4 COLUMNAS × 2 FILAS
   ( IDENTIDAD lateral izquierda (2 filas) · 3 verticales arriba · 3 verticales abajo )
   Diseño tipo ficha rectangular sin scroll vertical.
   ============================================================================= */

.ficha-grid {
    display: grid;
    grid-template-columns: 1.1fr repeat(3, 1fr);
    grid-template-rows: auto auto;
    gap: 12px;
    align-items: stretch;
}

/* Identidad: primera columna, ocupa las 2 filas */
.ficha-columna-identidad {
    grid-column: 1;
    grid-row: 1 / span 2;
    background-color: var(--white);
    border-radius: 10px;
    padding: 22px 18px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    text-align: center;
}

.ficha-identidad-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: center;
}

.ficha-header-escudo {
    width: 130px;
    height: 130px;
    object-fit: contain;
    flex-shrink: 0;
}

.ficha-header-rival {
    font-size: 1.9rem;
    font-weight: 700;
    color: var(--primary-blue);
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 2px;
    line-height: 1.1;
}

.ficha-header-fecha {
    font-size: 0.9rem;
    color: var(--text-gray);
    font-weight: 500;
    margin-bottom: 4px;
}

.ficha-header-resultado {
    font-size: 2.5rem;
    font-weight: 700;
    padding: 10px 32px;
    border-radius: 10px;
    min-width: 130px;
    background-color: var(--light-gray);
    letter-spacing: 5px;
    margin-top: 8px;
}

.ficha-header-resultado--win   { color: var(--success-green); }
.ficha-header-resultado--loss  { color: var(--danger-red); }
.ficha-header-resultado--draw  { color: var(--warning-orange); }

/* Cada vertical = una columna */
.ficha-columna {
    background-color: var(--white);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
}

/* Cabecera grande de la vertical — banda azul corporativa */
.ficha-columna-header {
    background: linear-gradient(180deg, var(--primary-blue) 0%, var(--dark-blue) 100%);
    color: var(--white);
    padding: 10px 12px;
    text-align: center;
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 1.8px;
    text-transform: uppercase;
    line-height: 1.2;
}

.ficha-columna-body {
    padding: 10px 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 7px;
    flex: 1;
}

/* Tarjeta KPI individual — todas con la misma altura para alinear entre columnas */
.ficha-kpi {
    background-color: var(--light-gray);
    border-radius: 6px;
    padding: 7px 10px;
    text-align: center;
    border: 1px solid #e0e0e0;
    min-height: 54px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
}

.ficha-kpi-label {
    font-size: 0.62rem;
    color: var(--text-gray);
    font-weight: 600;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    line-height: 1.15;
}

.ficha-kpi-value {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--primary-blue);
    line-height: 1.1;
}

.ficha-kpi-value--muted {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-gray);
    font-style: italic;
}

/* Responsive: adaptar columnas según ancho */
@media (max-width: 1100px) {
    .ficha-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    .ficha-columna-identidad {
        grid-column: 1 / -1;
        grid-row: auto;
        flex-direction: row;
        justify-content: space-around;
        text-align: center;
    }
}
@media (max-width: 700px) {
    .ficha-grid {
        grid-template-columns: 1fr 1fr;
    }
    .ficha-columna-identidad {
        flex-direction: column;
    }
}
@media (max-width: 500px) {
    .ficha-grid {
        grid-template-columns: 1fr;
    }
}

