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

/* Variables */
:root {
    /* Paleta corporativa RC Deportivo.
       Títulos y barra lateral usan el marino corporativo (--primary-blue);
       --chart-blue es el azul vivo reservado para líneas/barras de gráficos. */
    --primary-blue: #000D33;
    --dark-blue: #00081a;
    --chart-blue: #0831B6;
    --accent-blue: #2c5282;
    --light-blue: #4a7ab0;
    --accent-gold: #b4a16b;
    --corporate-white: #E6E7E8;
    --white: #ffffff;
    --light-gray: #f5f5f5;
    --text-gray: #666666;
    --sidebar-width: 220px;
    --success-green: #2ecc71;
    --danger-red: #e74c3c;
    --warning-orange: #f39c12;
}

/* =============================================================================
   FUENTES CORPORATIVAS OFICIALES (locales)
   Servidas desde assets/MATERIAL/TIPOGRAFIAS/
   ============================================================================= */

/* Commissioner Flair — fuente principal (cuerpo + headlines estilo 1) */
@font-face {
    font-family: 'Commissioner Flair';
    src: url('/assets/MATERIAL/TIPOGRAFIAS/Commissioner-Flair/ttf/CommissionerFlair-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Commissioner Flair';
    src: url('/assets/MATERIAL/TIPOGRAFIAS/Commissioner-Flair/ttf/CommissionerFlair-Medium.ttf') format('truetype');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Commissioner Flair';
    src: url('/assets/MATERIAL/TIPOGRAFIAS/Commissioner-Flair/ttf/CommissionerFlair-SemiBold.ttf') format('truetype');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Commissioner Flair';
    src: url('/assets/MATERIAL/TIPOGRAFIAS/Commissioner-Flair/ttf/CommissionerFlair-Bold.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

/* Barlow Condensed — headlines estilo 2 (condensados) */
@font-face {
    font-family: 'Barlow Condensed';
    src: url('/assets/MATERIAL/TIPOGRAFIAS/Barlow_Condensed/BarlowCondensed-Medium.ttf') format('truetype');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Barlow Condensed';
    src: url('/assets/MATERIAL/TIPOGRAFIAS/Barlow_Condensed/BarlowCondensed-SemiBold.ttf') format('truetype');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Barlow Condensed';
    src: url('/assets/MATERIAL/TIPOGRAFIAS/Barlow_Condensed/BarlowCondensed-Bold.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

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

body {
    font-family: 'Commissioner Flair', 'Commissioner', sans-serif;
    background-color: var(--primary-blue);
    min-height: 100vh;
}

/* Clase utilitaria para usar Barlow Condensed en headlines condensados */
.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: 'Barlow Condensed', 'Commissioner Flair', sans-serif;
}

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

.banner-title {
    background: var(--primary-blue);
    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;
    background: var(--primary-blue);
}

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

.sidebar {
    width: var(--sidebar-width);
    background: var(--primary-blue);
    color: var(--white);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    z-index: 1000;
    transition: transform 0.25s ease, width 0.25s ease;
    overflow: hidden;
}

.sidebar.collapsed {
    transform: translateX(-100%);
    width: 0;
}

.sidebar-toggle {
    position: fixed;
    top: 50%;
    left: var(--sidebar-width);
    transform: translateY(-50%);
    z-index: 1100;
    width: 30px;
    height: 58px;
    border: 1px solid rgba(255, 255, 255, 0.55);
    border-left: 0;
    border-radius: 0 12px 12px 0;
    background: var(--primary-blue);
    color: white;
    font-size: 27px;
    line-height: 52px;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 4px 0 10px rgba(0, 0, 0, .2);
    transition: left 0.25s ease, background-color 0.2s ease, color 0.2s ease;
}

.sidebar-toggle:hover {
    background: var(--accent-gold);
}

.sidebar-toggle.collapsed {
    left: 0;
}

.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: #f0a500;
    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: 'Commissioner Flair', 'Commissioner', 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;
}

/* Selector de partido: misma cápsula visual que los toggles contiguos */
.partido-dropdown {
    position: relative;
    z-index: 1;
    margin-bottom: 8px;
    padding: 0;
    height: 34px;
    min-height: 34px;
    background: #f5f5f5;
    border: 1px solid #e0e0e0 !important;
    border-radius: 22px !important;
    box-shadow: none;
    font-family: 'Commissioner Flair', 'Commissioner', sans-serif;
    color: var(--primary-blue);
    cursor: pointer;
    transition: background-color 0.2s ease, box-shadow 0.2s ease;
}

.partido-dropdown:hover {
    background: #ececec;
    border-color: #e0e0e0 !important;
}

.partido-dropdown:focus,
.partido-dropdown:focus-visible {
    border: 1px solid #e0e0e0 !important;
    outline: none;
    box-shadow: 0 0 0 2px rgba(26, 58, 92, 0.12);
}

.partido-dropdown .dash-dropdown-trigger {
    grid-template-columns: 1fr auto;
    gap: 12px;
    min-height: 32px;
    height: 32px;
    padding: 0 14px 0 18px;
}

.partido-dropdown .dash-dropdown-value {
    color: var(--primary-blue);
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 0.4px;
}

.partido-dropdown .dash-dropdown-trigger-icon {
    color: var(--primary-blue);
    fill: var(--primary-blue);
}

.partido-dropdown .Select-control {
    height: 34px;
    min-height: 34px;
    background-color: #f5f5f5;
    border: 1px solid #e0e0e0;
    border-radius: 22px;
    box-shadow: none;
    cursor: pointer;
    transition: background-color 0.2s ease, box-shadow 0.2s ease;
}

.partido-dropdown .Select-control:hover {
    background-color: #ececec;
    border-color: #e0e0e0;
    box-shadow: none;
}

.partido-dropdown .Select-value,
.partido-dropdown .Select-placeholder,
.partido-dropdown .Select-input {
    height: 32px;
    line-height: 32px;
}

.partido-dropdown .Select-value-label {
    color: var(--primary-blue) !important;
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 0.4px;
}

.partido-dropdown .Select-arrow-zone {
    padding-right: 14px;
}

.partido-dropdown.is-focused:not(.is-open) > .Select-control {
    border-color: #e0e0e0;
    box-shadow: 0 0 0 2px rgba(26, 58, 92, 0.12);
}

/* Menús desplegables: deben quedar por encima de tarjetas, gráficas y filtros
   contiguos. Dash 3 usa las clases dash-dropdown-*; las Select-* mantienen la
   compatibilidad con las versiones anteriores del componente. */
.partido-dropdown:focus-within,
.partido-dropdown.is-open,
.partido-dropdown.Select--multi.is-open {
    z-index: 1300;
}

.partido-dropdown .dash-dropdown-content,
.partido-dropdown .Select-menu-outer {
    z-index: 1400 !important;
    max-height: min(320px, 48vh);
    overflow-y: auto;
    background: var(--white);
    border: 1px solid #d7dee8;
    border-radius: 10px;
    box-shadow: 0 12px 30px rgba(0, 23, 65, 0.18);
}

.partido-dropdown .dash-dropdown-option,
.partido-dropdown .VirtualizedSelectOption,
.partido-dropdown .Select-option {
    min-height: 36px;
    padding: 9px 14px;
    color: var(--primary-blue);
    font-size: 0.82rem;
    line-height: 1.25;
    white-space: normal;
}

.partido-dropdown .dash-dropdown-option:hover,
.partido-dropdown .VirtualizedSelectFocusedOption,
.partido-dropdown .Select-option.is-focused {
    background: #eef3fb;
}

/* Los filtros múltiples pueden crecer al mostrar varias selecciones. */
.partido-dropdown.multi-filter-dropdown {
    height: auto;
    min-height: 36px;
    border-radius: 10px !important;
}

.partido-dropdown.multi-filter-dropdown .dash-dropdown-trigger,
.partido-dropdown.multi-filter-dropdown .Select-control {
    height: auto;
    min-height: 34px;
    border-radius: 10px;
}

.partido-dropdown.multi-filter-dropdown .dash-dropdown-value,
.partido-dropdown.multi-filter-dropdown .Select-multi-value-wrapper {
    min-height: 32px;
}

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

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

.store-toggle-btn {
    font-family: 'Barlow Condensed', 'Commissioner Flair', 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);
    transition: margin-left 0.25s ease, max-width 0.25s ease;
    background: var(--primary-blue);
    min-height: 100vh;
    padding: 20px 30px;
    overflow-x: hidden;
    box-sizing: border-box;
}

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

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

.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 {
    position: relative;
    z-index: 1;
    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: visible;
}

.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%;
    /* No recortar menús desplegables que necesitan salir de la tarjeta. */
    overflow: 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: 18px;
    padding-bottom: 18px;
    overflow: visible;
}

.kpis-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(165px, 1fr));
    gap: 14px;
    overflow: visible;
    width: 100%;
    margin: 0 0 16px;
}

/* Tarjeta KPI común a todas las pestañas. Estructura fija en tres zonas
   (título / dato / comparativa) para que todo quede alineado entre tarjetas. */
.kpi-card {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-rows: 38px minmax(64px, 1fr) 42px;
    align-items: stretch;
    gap: 6px;
    min-width: 0;
    padding: 12px 14px 10px;
    border: 1px solid #e3e9f3;
    border-top: 3px solid var(--chart-blue);
    border-radius: 12px;
    background: #ffffff;
    box-shadow: 0 2px 8px rgba(0, 13, 51, 0.06);
    text-align: center;
    container-type: inline-size;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

/* La tarjeta bajo el cursor (o con foco por teclado) sube de plano: sin esto,
   el tooltip (230px) de una tarjeta estrecha puede quedar tapado por el
   fondo opaco de la tarjeta vecina, aunque el tooltip tenga z-index alto,
   porque esa tarjeta vecina pinta después en el orden normal del documento. */
.kpi-card:hover,
.kpi-card:focus-within {
    z-index: 100;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 13, 51, 0.10);
}

.kpi-card .kpi-head {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 0;
    min-height: 0 !important;
    white-space: normal !important;
    color: var(--primary-blue);
    font-size: 0.88rem !important;
    font-weight: 700;
    line-height: 1.2;
}

.kpi-card .kpi-head .kpi-tooltip-wrapper {
    flex: 0 0 auto;
}

.kpi-card .kpi-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
}

.kpi-card .kpi-foot {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 2px;
}

/* Dato principal: una sola línea, color marino y tamaño que se adapta al ancho
   de la tarjeta (nunca se parte en varias líneas). */
.kpi-value-row {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 6px;
    white-space: nowrap;
}

.kpi-value {
    font-size: clamp(1.3rem, 19cqw, 1.8rem);
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0.01em;
    color: var(--primary-blue);
}

.kpi-unit {
    color: #5b6678;
    font-size: 0.85rem;
    font-weight: 600;
}

/* Variación frente a la referencia: pequeña, en verde o rojo. */
.kpi-var {
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    line-height: 1.2;
}

.kpi-var--up {
    color: #1b8f50;
}

.kpi-var--down {
    color: #c0392b;
}

.kpi-previous {
    margin: 0;
    color: var(--text-gray);
    font-size: 0.76rem;
    font-style: italic;
    line-height: 1.25;
}

/* Icono de la tarjeta: chip azul claro junto al título. */
.kpi-icon {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 9px;
    background: rgba(8, 49, 182, 0.09);
}

.kpi-icon img {
    width: 18px;
    height: 18px;
}

.kpi-icon.kpi-icon--light {
    background: rgba(255, 255, 255, 0.16);
}

/* En tarjetas estrechas el icono se oculta para que el título no se parta en
   tres líneas. */
@container (max-width: 205px) {
    .kpi-card .kpi-icon {
        display: none;
    }
}

/* Los gráficos circulares dentro de una tarjeta ocupan todo su ancho (si no,
   Plotly los dibuja con 700 px y se salen de la tarjeta). */
.kpi-card .dash-graph {
    width: 100%;
    align-self: stretch;
}

/* Tarjeta protagonista: el KPI principal de la página, a doble ancho y en
   marino corporativo para que sea lo primero que se lee. */
.kpi-card.kpi-hero {
    grid-column: span 2;
    background: linear-gradient(135deg, #0a2463 0%, #041b4d 100%);
    border-color: #0a2463;
    border-top-color: var(--accent-gold);
    box-shadow: 0 6px 16px rgba(4, 27, 77, 0.22);
}

.kpi-card.kpi-hero .kpi-head {
    color: #ffffff;
}

.kpi-card.kpi-hero .kpi-value {
    color: #ffffff;
    font-size: clamp(1.8rem, 20cqw, 2.8rem);
}

.kpi-card.kpi-hero .kpi-unit,
.kpi-card.kpi-hero .kpi-previous {
    color: rgba(255, 255, 255, 0.78);
}

.kpi-card.kpi-hero .kpi-var--up {
    color: #8ff5b5;
}

.kpi-card.kpi-hero .kpi-var--down {
    color: #ffb3aa;
}

.kpi-card.kpi-hero .kpi-tooltip-icon {
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.6);
}

/* En pantallas medianas no caben seis columnas: la tarjeta protagonista pasa a
   ocupar una sola. */
@media (max-width: 1420px) {
    .kpi-card.kpi-hero {
        grid-column: auto;
    }
}

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

.graphs-row {
    display: flex;
    align-items: flex-start;
    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;
    /* Sin tope de altura: cada figura declara su altura real y la tarjeta se
       adapta. Un max-height + overflow:hidden recortaba los escudos y las
       etiquetas del borde inferior en cuanto una figura medía más que el tope
       (p. ej. al activar un filtro) o tenía más filas. */
    max-height: none;
    overflow: visible;
}

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

.graph-card.small {
    max-height: none;
}

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

.main-content.sidebar-collapsed {
    margin-left: 0;
    max-width: 100vw;
}

/* Liberaciones tiene más espacio vertical y prioriza lectura ejecutiva desde
   pantallas grandes: títulos y ayudas ligeramente mayores sin afectar al
   resto de páginas. */
.liberaciones-page .graph-card h4 {
    font-size: 1.02rem;
    line-height: 1.25;
    margin-bottom: 6px;
}

.liberaciones-page .kpi-tooltip-icon {
    font-size: 0.78rem;
}

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

/* Museo contiene rankings de ocho filas y gráficos con etiquetas exteriores.
   Se deja que cada figura use su altura real para no recortar categorías,
   rótulos ni valores en el borde inferior. */
.museo-page .graph-card,
.museo-page .graph-card.small,
.museo-page .graph-card.full-width {
    max-height: none;
    overflow: visible;
}

.museo-page .graph-card .js-plotly-plot {
    max-height: none !important;
}

/* En las filas de dos columnas cada tarjeta debe conservar su altura natural.
   El valor por defecto de Flexbox (stretch) igualaba ambas alturas; Plotly
   tomaba esa altura ampliada como un nuevo tamaño disponible y podía volver a
   crecer en el siguiente cálculo responsive. */
.museo-page .graphs-row {
    align-items: flex-start;
}

.museo-page .graphs-row > .graph-card {
    align-self: flex-start;
}

/* Cabecera narrativa compartida por todas las áreas del dashboard: banda
   clara con barra marino, numeración en recuadro marino y filete dorado bajo el
   título. Formal, pero con presencia suficiente para ordenar la página. */
.narrative-section {
    display: flex;
    align-items: center;
    gap: 16px;
    width: 100%;
    margin: 28px 0 16px;
    padding: 14px 20px 14px 18px;
    border: 1px solid #dfe6f2;
    border-left: 5px solid var(--primary-blue);
    border-radius: 10px;
    background: linear-gradient(90deg, #eef3fb 0%, #fbfcfe 100%);
    box-shadow: 0 2px 8px rgba(0, 13, 51, 0.06);
}

.narrative-number {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: var(--primary-blue);
    color: var(--accent-gold);
    font-family: 'Barlow Condensed', 'Commissioner Flair', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    line-height: 1;
    padding: 0;
    box-shadow: 0 3px 8px rgba(0, 13, 51, 0.18);
}

.narrative-title {
    position: relative;
    padding-bottom: 7px;
    color: var(--primary-blue);
    font-size: 1.2rem;
    font-weight: 800;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    line-height: 1.15;
}

.narrative-title::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 44px;
    height: 3px;
    border-radius: 2px;
    background: var(--accent-gold);
}

.narrative-subtitle {
    margin-top: 6px;
    color: #566274;
    font-size: 0.88rem;
    line-height: 1.3;
}

/* Lectura inmediata del alcance de los datos. No sustituye a los filtros:
   simplemente confirma qué selección está activa en cada página. */
.active-context {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    width: fit-content;
    max-width: 100%;
    margin: 0 0 12px;
    padding: 7px 11px;
    border: 1px solid #dce4f0;
    border-radius: 999px;
    background: #f8fafd;
    color: #536174;
    font-size: 0.75rem;
    line-height: 1.25;
}

.active-context-label {
    flex: 0 0 auto;
    color: var(--primary-blue);
    font-weight: 800;
}

.active-context-value {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Pulso Diario es una excepción al crecimiento libre de las gráficas de
   Museo. Plotly recalcula su tamaño al cambiar el ancho del contenido; si el
   padre toma a la vez la altura del hijo se crea un bucle de redimensionado
   que estira la gráfica en cada cálculo. Se fija solo esta tarjeta y se deja
   el resto de Museo con altura libre para no recortar rankings o etiquetas. */
.museo-page .museo-pulso-card {
    height: 458px;
    min-height: 458px;
    max-height: 458px;
    overflow: visible;
}

/* Eleva únicamente la cabecera cuyo control está activo, para que su menú no
   quede detrás de la siguiente tarjeta de filtros. */
.section-header:focus-within {
    z-index: 1200;
}

.museo-page .museo-pulso-graph,
.museo-page .museo-pulso-graph .js-plotly-plot,
.museo-page .museo-pulso-graph .plot-container,
.museo-page .museo-pulso-graph .svg-container {
    height: 420px !important;
    min-height: 420px !important;
    max-height: 420px !important;
}

/* Dépor Tiendas mezcla rankings largos, donuts y comparativas en la misma
   cuadrícula. Cada figura conserva su altura para que no se corten productos,
   escudos, etiquetas ni valores exteriores. */
.deportiendas-page .graph-card,
.deportiendas-page .graph-card.small,
.deportiendas-page .graph-card.full-width {
    max-height: none;
    overflow: visible;
}

.deportiendas-page .graph-card .js-plotly-plot {
    max-height: none !important;
}

/* Las gráficas de Dépor Tiendas declaran su altura real en el componente.
   Los nodos internos ocupan exactamente esa caja fija: así Plotly puede
   seguir siendo responsive en anchura sin aumentar la altura en cada resize. */
.deportiendas-page .stable-plotly-graph .js-plotly-plot,
.deportiendas-page .stable-plotly-graph .plot-container,
.deportiendas-page .stable-plotly-graph .svg-container {
    height: 100% !important;
    min-height: 100% !important;
    max-height: 100% !important;
}

.deportiendas-page .graph-card h4 {
    font-size: 1rem;
    line-height: 1.3;
    margin-bottom: 7px;
}

.deportiendas-page .kpi-label-top {
    font-size: 0.82rem;
}

/* Las ocho métricas de Museo necesitan un mínimo real de anchura. En lugar de
   comprimir sus títulos hasta solaparlos, saltan ordenadamente a otra fila. */
.museo-page .kpis-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 12px;
}

.museo-page .kpi-card {
    min-width: 0;
}

.museo-page .kpi-label-top {
    white-space: normal !important;
    line-height: 1.2;
    min-height: 2.5em;
}

/* 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: 430px;
    width: 100%;
    background-color: var(--white);
    border-radius: 8px;
    position: relative;
    overflow: hidden;
    box-shadow: inset 0 0 0 1px #edf1f6;
}

.loading-container::before {
    content: '';
    position: absolute;
    inset: 24px;
    border-radius: 10px;
    background:
        linear-gradient(#eef2f7 0 0) 0 0 / 100% 62px no-repeat,
        linear-gradient(#f3f6fa 0 0) 0 82px / 31% 92px no-repeat,
        linear-gradient(#f3f6fa 0 0) 34.5% 82px / 31% 92px no-repeat,
        linear-gradient(#f3f6fa 0 0) 69% 82px / 31% 92px no-repeat,
        linear-gradient(#f3f6fa 0 0) 0 194px / 100% 188px no-repeat;
    opacity: 0.72;
}

.loading-container::after {
    content: '';
    position: absolute;
    inset: 24px;
    transform: translateX(-110%);
    background: linear-gradient(100deg, transparent 25%, rgba(255,255,255,.8) 50%, transparent 75%);
    animation: loading-shimmer 1.7s ease-in-out infinite;
}

.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;
    position: relative;
    z-index: 2;
    background: rgba(255, 255, 255, 0.9);
}

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

@keyframes loading-shimmer {
    100% { transform: translateX(110%); }
}

.loading-text {
    margin-top: 15px;
    font-size: 1rem;
    color: var(--text-gray);
    font-weight: 500;
    position: relative;
    z-index: 2;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.92);
}

/* 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: 24px 24px 20px;
    min-height: 145px;
    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.12rem;
    font-weight: 700;
    color: var(--primary-blue);
    margin: 0 0 10px 0;
}

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

.home-card-value {
    font-size: 1.85rem;
    font-weight: 700;
    font-family: 'Montserrat', sans-serif;
}

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

.login-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-image:
        linear-gradient(rgba(26, 58, 92, 0.80), rgba(13, 33, 55, 0.85)),
        url('/assets/login.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-radius: 12px;
    padding: 40px 40px 35px;
    width: 360px;
    max-width: 90vw;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.login-shield {
    width: 70px;
    height: auto;
    margin-bottom: 18px;
}

.login-title {
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--primary-blue);
    margin: 0 0 25px 0;
    font-family: 'Montserrat', sans-serif;
}

.login-input {
    width: 100%;
    padding: 10px 14px;
    margin-bottom: 14px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 0.9rem;
    font-family: 'Montserrat', sans-serif;
    color: #333;
    outline: none;
    transition: border-color 0.3s ease;
}

.login-input:focus {
    border-color: var(--primary-blue);
}

.login-error {
    color: #e74c3c;
    font-size: 0.82rem;
    font-weight: 500;
    margin-bottom: 10px;
    min-height: 20px;
    font-family: 'Montserrat', sans-serif;
}

.login-btn {
    width: 100%;
    padding: 11px;
    background-color: var(--accent-blue);
    color: var(--white);
    border: none;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 600;
    font-family: 'Montserrat', sans-serif;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

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

/* =============================================================================
   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: 'Montserrat', 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: 'Montserrat', 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: 'Montserrat', 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;
    white-space: normal;
}

.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: 'Montserrat', 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: 'Montserrat', 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;
    }

    .sidebar-toggle {
        left: 180px;
    }

    .sidebar-toggle.collapsed {
        left: 0;
    }
    
    .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: 72px;
        height: 100vh;
        position: fixed;
    }

    .sidebar-header {
        padding: 18px 8px;
    }

    .sidebar-banner {
        width: 48px;
        height: 34px;
        object-fit: cover;
        object-position: left;
    }

    .nav-link {
        justify-content: center;
        min-height: 52px;
        padding: 12px 8px;
    }

    .nav-link span,
    .nav-sublink,
    .sidebar-footer {
        display: none;
    }

    #nav-inicio {
        font-size: 0;
    }

    #nav-inicio::before {
        content: '⌂';
        font-size: 1.35rem;
        line-height: 1;
    }

    .main-content {
        margin-left: 72px;
        max-width: calc(100vw - 72px);
        padding: 16px;
    }

    .main-content.sidebar-collapsed {
        margin-left: 0;
        max-width: 100vw;
    }

    .sidebar-toggle,
    .sidebar-toggle.collapsed {
        top: 50%;
        right: auto;
        left: 72px;
        transform: translateY(-50%);
        width: 26px;
        height: 50px;
        line-height: 44px;
        border-radius: 0 10px 10px 0;
    }

    .sidebar-toggle.collapsed {
        left: 0;
    }

    .header-logo {
        width: 46px;
        height: 46px;
    }

    .header-title {
        font-size: 1.45rem;
    }

    .header-subtitle {
        font-size: 0.8rem;
    }

    .section-tabs {
        gap: 6px;
    }

    .section-tab {
        padding: 8px 5px;
        font-size: 0.72rem;
    }

    .page-content-container {
        padding: 14px;
    }

    .kpis-row,
    .museo-page .kpis-row {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .kpi-card {
        min-width: 0;
    }

    .kpi-label-top {
        font-size: 1rem;
        min-height: 2.5em;
        line-height: 1.2;
    }

    .home-cards-grid {
        grid-template-columns: 1fr;
    }

    .narrative-section {
        align-items: flex-start;
        padding: 10px 12px;
    }

    .active-context {
        width: 100%;
        border-radius: 10px;
        box-sizing: border-box;
    }

    .active-context-value {
        white-space: normal;
    }

    .museo-page > .section-header {
        align-items: stretch !important;
        flex-direction: column;
    }

    .museo-page > .section-header .partido-dropdown,
    .museo-page > .section-header .Select,
    .deportiendas-page .partido-dropdown {
        width: 100% !important;
        min-width: 0 !important;
    }
}

@media (max-width: 520px) {
    .kpis-row,
    .museo-page .kpis-row {
        grid-template-columns: 1fr;
    }

    .section-tabs {
        flex-wrap: wrap;
    }

    .section-tab {
        flex: 1 1 100%;
    }
}

.home-cards-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.home-card-action {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 12px;
    color: #667085;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.03em;
}

.home-card:hover .home-card-action {
    color: var(--primary-blue);
}

/* =============================================================================
   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;
    }
}

/* Selector temporal de temporada en Dépor Hostelería. */
.hosteleria-season-gate {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 2200;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(4, 24, 49, 0.72);
    backdrop-filter: blur(5px);
}

.hosteleria-season-gate.visible {
    display: flex;
}

.hosteleria-season-gate-card {
    width: min(620px, calc(100vw - 48px));
    padding: 34px;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 24px 70px rgba(1, 21, 52, 0.30);
    text-align: center;
    color: #001b44;
}

.hosteleria-season-gate-icon {
    font-size: 34px;
    line-height: 1;
    margin-bottom: 10px;
}

.hosteleria-season-gate-eyebrow {
    color: #0831b6;
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0.12em;
}

.hosteleria-season-gate-card h2 {
    margin: 8px 0 22px;
    font-size: 1.65rem;
}

.hosteleria-season-status {
    padding: 18px 20px;
    border: 1px solid #dbe4f1;
    border-left: 5px solid #b49a52;
    border-radius: 12px;
    background: #f7f9fc;
    text-align: left;
}

.hosteleria-season-status-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

.hosteleria-season-status-title {
    font-weight: 800;
}

.hosteleria-season-status-badge {
    padding: 5px 9px;
    border-radius: 999px;
    background: #f3ead2;
    color: #745d1d;
    font-size: 0.72rem;
    font-weight: 800;
    white-space: nowrap;
}

.hosteleria-season-status p {
    margin: 0;
    color: #536174;
    font-size: 0.95rem;
    line-height: 1.55;
}

.hosteleria-season-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    width: 100%;
    margin-top: 20px;
    padding: 15px 20px;
    border: 0;
    border-radius: 11px;
    background: #0831b6;
    color: #fff;
    font-size: 1rem;
    font-weight: 800;
    cursor: pointer;
    transition: transform 0.15s ease, background 0.15s ease;
}

.hosteleria-season-button:hover {
    background: #062890;
    transform: translateY(-1px);
}

.hosteleria-season-button-arrow {
    font-size: 1.25rem;
}

@media (max-width: 640px) {
    .hosteleria-season-gate-card {
        padding: 26px 20px;
    }

    .hosteleria-season-status-head {
        align-items: flex-start;
        flex-direction: column;
    }
}
