/* ==========================================================================
   WEB-BASKET RADAR - DESIGN SYSTEM MINIMALISTA (PALETA CLARA)
   Optimizado para Monitor y Tablet Horizontal
   ========================================================================== */

:root {
    /* Color Palette */
    --bg-main: #f8fafc;
    --bg-surface: #ffffff;
    --bg-sidebar: #ffffff;
    --bg-hover: #f1f5f9;
    --border-color: #e2e8f0;
    --border-light: #f1f5f9;

    /* Text Colors */
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;

    /* Brand & Accent Colors */
    --accent-blue: #2563eb;
    --accent-blue-light: #eff6ff;
    --accent-green: #10b981;
    --accent-green-bg: #ecfdf5;
    --accent-red: #ef4444;
    --accent-red-bg: #fef2f2;
    --accent-amber: #f59e0b;
    --accent-amber-bg: #fffbeb;

    /* Layout Dimensions */
    --sidebar-width: 240px;
    --header-height: 68px;
    
    /* Shadows & Radii */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.02);
    --shadow-hover: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.01);
    
    --transition-standard: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset & Base Setup */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-primary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
    display: flex;
    overflow-x: hidden;
}

/* App Layout Grid (Monitor & Horizontal Tablet) */
.app-container {
    display: flex;
    width: 100vw;
    min-height: 100vh;
}

/* --------------------------------------------------------------------------
   Sidebar Navigation
   -------------------------------------------------------------------------- */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 1.5rem 1rem;
    flex-shrink: 0;
    transition: var(--transition-standard);
    z-index: 20;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0 0.5rem 1.5rem 0.5rem;
    border-bottom: 1px solid var(--border-light);
    margin-bottom: 1.5rem;
}

.brand-icon {
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, #2563eb, #3b82f6);
    color: white;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

.brand-text {
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

.brand-tag {
    font-size: 0.65rem;
    font-weight: 600;
    background-color: var(--accent-blue-light);
    color: var(--accent-blue);
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-left: 0.25rem;
}

.menu-label {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    padding: 0 0.75rem 0.5rem 0.75rem;
}

.nav-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.nav-item a {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.75rem 0.9rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.925rem;
    font-weight: 500;
    border-radius: var(--radius-md);
    transition: var(--transition-standard);
}

.nav-item a:hover {
    background-color: var(--bg-hover);
    color: var(--text-primary);
}

.nav-item.active a {
    background-color: var(--accent-blue-light);
    color: var(--accent-blue);
    font-weight: 600;
}

.nav-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.badge-coming-soon {
    font-size: 0.65rem;
    color: var(--text-muted);
    margin-left: auto;
    background-color: var(--bg-hover);
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
}

.nav-item.disabled a {
    opacity: 0.45;
    cursor: not-allowed;
}

.sidebar-footer {
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid var(--border-light);
    font-size: 0.75rem;
    color: var(--text-muted);
    text-align: center;
}

/* --------------------------------------------------------------------------
   Main View Content
   -------------------------------------------------------------------------- */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow-y: auto;
    background-color: var(--bg-main);
}

.view-section {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    width: 100%;
}

/* Top Header Bar */
.top-header {
    height: var(--header-height);
    background-color: var(--bg-surface);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    position: sticky;
    top: 0;
    z-index: 10;
}

.header-title-group h1 {
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

.header-subtitle {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.period-selector-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.period-select {
    padding: 0.45rem 0.85rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background-color: var(--bg-surface);
    color: var(--text-primary);
    font-size: 0.85rem;
    font-weight: 500;
    outline: none;
    cursor: pointer;
    transition: var(--transition-standard);
}

.period-select:focus {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.badge-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.85rem;
    background-color: var(--accent-green-bg);
    color: var(--accent-green);
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.pulse-dot {
    width: 8px;
    height: 8px;
    background-color: var(--accent-green);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.btn-refresh {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-standard);
}

.btn-refresh:hover {
    background-color: var(--bg-hover);
    color: var(--text-primary);
    border-color: #cbd5e1;
}

.btn-refresh svg {
    transition: transform 0.3s ease;
}

.btn-refresh:active svg {
    transform: rotate(180deg);
}

/* View Container Body */
.view-body {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.75rem;
    max-width: 1600px;
    margin: 0 auto;
    width: 100%;
}

/* System Alerts / Banners */
.alert-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 1.25rem;
    border-radius: var(--radius-md);
    background-color: var(--accent-amber-bg);
    border: 1px solid rgba(245, 158, 11, 0.3);
    color: #b45309;
    font-size: 0.875rem;
}

.alert-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* Cards System */
.card {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    padding: 1.5rem;
    transition: var(--transition-standard);
}

.card:hover {
    box-shadow: var(--shadow-hover);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
    padding-bottom: 0.85rem;
    border-bottom: 1px solid var(--border-light);
}

.card-title-group {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.card-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.card-badge {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    background-color: var(--bg-hover);
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
}

/* --------------------------------------------------------------------------
   Threshold Lines Legend (Gráfico Alertas)
   -------------------------------------------------------------------------- */
.threshold-legend {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.legend-line {
    display: inline-block;
    width: 20px;
    height: 3px;
    border-radius: 2px;
}

.line-amber {
    background-color: #f59e0b;
    border: 1px dashed #d97706;
}

.line-red {
    background-color: #ef4444;
    border: 1px dashed #dc2626;
}

/* --------------------------------------------------------------------------
   KPI Grid System (Sección Estadísticas)
   -------------------------------------------------------------------------- */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1.25rem;
}

.kpi-card {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    box-shadow: var(--shadow-card);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: var(--transition-standard);
}

.kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.kpi-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.kpi-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
    margin-bottom: 0.25rem;
}

.kpi-value.highlight-blue {
    color: var(--accent-blue);
}

.kpi-value.positive {
    color: var(--accent-green);
}

.kpi-value.negative {
    color: var(--accent-red);
}

.kpi-subtext {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.card-hero {
    background: linear-gradient(135deg, #ffffff, #eff6ff);
    border: 1px solid #bfdbfe;
    position: relative;
}

.kpi-badge-roi {
    display: inline-block;
    padding: 0.2rem 0.55rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 700;
    background-color: var(--accent-green-bg);
    color: var(--accent-green);
    border: 1px solid rgba(16, 185, 129, 0.3);
    margin-top: 0.25rem;
    width: fit-content;
}

.kpi-badge-roi.negative {
    background-color: var(--accent-red-bg);
    color: var(--accent-red);
    border-color: rgba(239, 68, 68, 0.3);
}

/* --------------------------------------------------------------------------
   Chart Container & Data Table
   -------------------------------------------------------------------------- */
.chart-wrapper {
    position: relative;
    width: 100%;
    height: 320px;
}

.table-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.search-box {
    position: relative;
    width: 260px;
}

.search-box input {
    width: 100%;
    padding: 0.45rem 0.75rem 0.45rem 2.2rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    outline: none;
    background-color: var(--bg-main);
    color: var(--text-primary);
    transition: var(--transition-standard);
}

.search-box input:focus {
    border-color: var(--accent-blue);
    background-color: var(--bg-surface);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.search-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
    border-radius: var(--radius-md);
}

.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.9rem;
    text-align: left;
}

.data-table th {
    background-color: #f1f5f9;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}

.data-table th:first-child {
    border-top-left-radius: var(--radius-md);
}

.data-table th:last-child {
    border-top-right-radius: var(--radius-md);
}

.data-table td {
    padding: 0.95rem 1rem;
    border-bottom: 1px solid var(--border-light);
    color: var(--text-primary);
    white-space: nowrap;
    transition: var(--transition-standard);
}

.data-table tbody tr {
    transition: var(--transition-standard);
}

.data-table tbody tr:hover {
    background-color: #f8fafc;
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

/* Badges & Formatted Table Cells */
.match-id-badge {
    font-weight: 700;
    font-family: monospace;
    color: var(--accent-blue);
    background-color: var(--accent-blue-light);
    padding: 0.25rem 0.6rem;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    display: inline-block;
}

.match-name-cell {
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.quarter-badge {
    display: inline-block;
    padding: 0.2rem 0.55rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    background-color: #e2e8f0;
    color: #334155;
}

.pct-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.65rem;
    border-radius: 20px;
    font-weight: 700;
    font-size: 0.85rem;
}

.pct-pill.positive {
    background-color: var(--accent-green-bg);
    color: var(--accent-green);
}

.pct-pill.negative {
    background-color: var(--accent-red-bg);
    color: var(--accent-red);
}

.sugerencia-badge {
    display: inline-block;
    padding: 0.3rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.sugerencia-over {
    background-color: #dcfce7;
    color: #15803d;
    border: 1px solid #bbf7d0;
}

.sugerencia-under {
    background-color: #ffe4e6;
    color: #be123c;
    border: 1px solid #fecdd3;
}

.sugerencia-neutral {
    background-color: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
}

/* Badges de Estado de Apuestas */
.bet-status {
    display: inline-block;
    padding: 0.25rem 0.7rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.03em;
}

.bet-status.ganada {
    background-color: #dcfce7;
    color: #15803d;
    border: 1px solid #bbf7d0;
}

.bet-status.perdida {
    background-color: #ffe4e6;
    color: #be123c;
    border: 1px solid #fecdd3;
}

.bet-status.pendiente {
    background-color: #fffbeb;
    color: #b45309;
    border: 1px solid #fef3c7;
}

.bet-status.anulada {
    background-color: #f1f5f9;
    color: #64748b;
    border: 1px solid #e2e8f0;
}

.time-stamp {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-family: monospace;
}

/* Loading & Empty states */
.table-loading, .table-empty {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   Equipos & Diccionario Components
   -------------------------------------------------------------------------- */
.badge-counter {
    margin-left: auto;
    background-color: var(--accent-red);
    color: #ffffff;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.15rem 0.5rem;
    border-radius: 12px;
    line-height: 1;
}

.subnav-tabs {
    display: flex;
    gap: 0.5rem;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 0.5rem;
}

.subnav-tab {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: var(--transition-standard);
    border-top-left-radius: var(--radius-sm);
    border-top-right-radius: var(--radius-sm);
}

.subnav-tab:hover {
    color: var(--accent-blue);
    background-color: var(--bg-hover);
}

.subnav-tab.active {
    color: var(--accent-blue);
    border-bottom-color: var(--accent-blue);
    background-color: var(--bg-surface);
}

.subnav-badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 700;
    background-color: var(--accent-red);
    color: white;
}

.subnav-badge.neutral {
    background-color: var(--bg-hover);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.btn-primary-action {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-standard);
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.2);
}

.btn-primary-action:hover {
    background: linear-gradient(135deg, #1d4ed8, #1e40af);
    box-shadow: 0 4px 8px rgba(37, 99, 235, 0.3);
    transform: translateY(-1px);
}

.btn-danger {
    background-color: var(--accent-red);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    padding: 0.45rem 0.85rem;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-standard);
}

.btn-danger:hover {
    background-color: #dc2626;
}

.btn-success {
    background-color: var(--accent-green);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    padding: 0.45rem 0.85rem;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-standard);
}

.btn-success:hover {
    background-color: #059669;
}

.orphan-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.orphan-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.85rem 1.25rem;
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: var(--transition-standard);
}

.orphan-item:hover {
    border-color: #cbd5e1;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
}

.orphan-source-tag {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    background-color: #fed7aa;
    color: #9a3412;
    border: 1px solid #fdba74;
}

.orphan-name {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text-primary);
}

.orphan-actions {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-left: auto;
}

.orphan-select {
    min-width: 250px;
    padding: 0.45rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background-color: var(--bg-surface);
    color: var(--text-primary);
    font-size: 0.85rem;
    outline: none;
    transition: var(--transition-standard);
}

.orphan-select:focus {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.action-alert {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 1.25rem;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    animation: fadeIn 0.3s ease;
}

.action-alert.success {
    background-color: var(--accent-green-bg);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #065f46;
}

.action-alert.error {
    background-color: var(--accent-red-bg);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #991b1b;
}

.action-alert.info {
    background-color: var(--accent-blue-light);
    border: 1px solid rgba(37, 99, 235, 0.3);
    color: #1e40af;
}

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

.alias-pill-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    max-width: 480px;
}

.alias-pill {
    display: inline-block;
    font-size: 0.75rem;
    padding: 0.15rem 0.5rem;
    border-radius: 12px;
    background-color: #f1f5f9;
    color: #334155;
    border: 1px solid #e2e8f0;
    white-space: nowrap;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(2px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-dialog {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 650px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    padding: 1.75rem;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-light);
    margin-bottom: 1.25rem;
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.25rem;
    color: var(--text-muted);
    cursor: pointer;
    line-height: 1;
    padding: 0.25rem;
}

.modal-close:hover {
    color: var(--text-primary);
}

/* --------------------------------------------------------------------------
   Unir Partidos (Matching UI) Components
   -------------------------------------------------------------------------- */
.unir-list-container {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.unir-card {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.35rem;
    box-shadow: var(--shadow-card);
    transition: var(--transition-standard);
}

.unir-card:hover {
    border-color: #cbd5e1;
    box-shadow: var(--shadow-hover);
}

.unir-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 0.85rem;
    border-bottom: 1px solid var(--border-light);
    margin-bottom: 1.1rem;
}

.unir-teams-grid {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: stretch;
    gap: 1.25rem;
    margin-bottom: 1.25rem;
}

.unir-team-box {
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.95rem 1.15rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.unir-team-role {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 0.35rem;
}

.unir-team-name {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.badge-dict-ok {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.75rem;
    font-weight: 600;
    background-color: #ecfdf5;
    color: #047857;
    border: 1px solid #a7f3d0;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    width: fit-content;
}

.badge-dict-warning {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.75rem;
    font-weight: 600;
    background-color: #fffbeb;
    color: #b45309;
    border: 1px solid #fde68a;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    width: fit-content;
}

.unir-center-score {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0 0.5rem;
}

.score-display {
    font-size: 1.6rem;
    font-weight: 800;
    font-family: monospace;
    color: var(--text-primary);
    letter-spacing: -0.03em;
    background: var(--bg-surface);
    padding: 0.25rem 0.85rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.score-total-pts {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.35rem;
    font-weight: 600;
}

.unir-matcher-box {
    background: linear-gradient(135deg, #f8fafc, #f1f5f9);
    border: 1px dashed var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.suggested-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    background-color: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1e40af;
    padding: 0.45rem 0.85rem;
    border-radius: var(--radius-sm);
    font-size: 0.825rem;
    font-weight: 600;
}

.matcher-action-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.matcher-select {
    flex: 1;
    min-width: 320px;
    padding: 0.55rem 0.85rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background-color: var(--bg-surface);
    color: var(--text-primary);
    font-size: 0.85rem;
    outline: none;
    transition: var(--transition-standard);
}

.matcher-select:focus {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* ==========================================================================
   MÓDULO ANÁLISIS: FILTROS, KPIS Y TABLA ESTADÍSTICA
   ========================================================================== */

.filter-card-analisis {
    background: linear-gradient(to bottom, #ffffff, #fafbfd);
    border: 1px solid var(--border-color);
}

.future-filters-badge {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--accent-blue);
    background-color: var(--accent-blue-light);
    padding: 0.25rem 0.65rem;
    border-radius: 9999px;
    border: 1px solid #bfdbfe;
}

.filter-body-analisis {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.filter-inputs-row {
    display: flex;
    align-items: flex-end;
    gap: 1.25rem;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.filter-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.filter-date-input {
    padding: 0.55rem 0.85rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background-color: var(--bg-surface);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.875rem;
    outline: none;
    transition: var(--transition-standard);
    min-width: 150px;
}

.filter-date-input:focus {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.filter-presets-group {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.preset-buttons-container {
    display: flex;
    gap: 0.35rem;
}

.btn-preset {
    background-color: var(--bg-hover);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 0.55rem 0.85rem;
    border-radius: var(--radius-md);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-standard);
}

.btn-preset:hover {
    background-color: #e2e8f0;
    color: var(--text-primary);
}

.btn-preset.active {
    background-color: var(--accent-blue);
    color: #ffffff;
    border-color: var(--accent-blue);
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.25);
}

.filter-action-group {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    margin-left: auto;
}

.btn-analizar-cta {
    padding: 0.65rem 1.6rem;
    font-size: 0.95rem;
    font-weight: 700;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.25);
    transition: var(--transition-standard);
}

.btn-analizar-cta:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(37, 99, 235, 0.35);
}

.future-filters-accordion {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    padding-top: 0.85rem;
    border-top: 1px dashed var(--border-color);
}

.future-filter-chip {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    padding: 0.3rem 0.65rem;
    border-radius: var(--radius-sm);
    font-size: 0.775rem;
    color: var(--text-secondary);
}

.future-filter-chip em {
    font-style: normal;
    color: var(--text-muted);
}

/* KPIs de Análisis */
.analisis-kpis-section {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.section-subtitle-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.section-title-sm {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
}

.analisis-status-tag {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
}

.kpi-grid-analisis {
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

.text-accent-blue {
    color: var(--accent-blue) !important;
}

.text-accent-green {
    color: #10b981 !important;
}

.text-accent-red {
    color: #ef4444 !important;
}

.text-accent-amber {
    color: #f59e0b !important;
}

/* Leyenda de la Tabla de Análisis */
.analisis-table-legend {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    padding: 0.65rem 1.25rem;
    background-color: var(--bg-hover);
    border-bottom: 1px solid var(--border-color);
    flex-wrap: wrap;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.legend-chip {
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.legend-badge {
    padding: 0.15rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 1.2;
}

.badge-green-demo {
    background-color: #ecfdf5;
    color: #059669;
    border: 1px solid #a7f3d0;
}

.badge-red-demo {
    background-color: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

/* Píldoras de comprobación en celdas de la tabla */
.check-pill-ok {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.25rem 0.65rem;
    border-radius: 9999px;
    font-size: 0.8rem;
    font-weight: 700;
    background-color: #ecfdf5;
    color: #059669;
    border: 1px solid #a7f3d0;
    min-width: 32px;
}

.check-pill-bad {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.25rem 0.65rem;
    border-radius: 9999px;
    font-size: 0.8rem;
    font-weight: 700;
    background-color: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
    min-width: 32px;
}

.cell-bold {
    font-weight: 600;
    color: var(--text-primary);
}

.cell-subinfo {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 400;
}

/* ==========================================================================
   Nuevos estilos para Selector de Tipo de Análisis y Filtro "Qué ver"
   ========================================================================== */

/* Selector de Tipo de Análisis */
.tipo-analisis-selector-container {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding-bottom: 0.85rem;
    border-bottom: 1px solid var(--border-color);
}

.tipo-analisis-buttons {
    display: flex;
    gap: 0.65rem;
    flex-wrap: wrap;
}

.btn-tipo-analisis {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.1rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    background-color: var(--bg-surface);
    color: var(--text-primary);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-standard);
    user-select: none;
}

.btn-tipo-analisis:hover:not(.disabled) {
    background-color: var(--bg-hover);
    border-color: #cbd5e1;
    transform: translateY(-1px);
}

.btn-tipo-analisis.active {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: #ffffff;
    border-color: #1d4ed8;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.28);
}

.btn-tipo-analisis.active .tipo-badge {
    background-color: rgba(255, 255, 255, 0.25);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.4);
}

.btn-tipo-analisis.disabled {
    opacity: 0.55;
    cursor: not-allowed;
    background-color: #f1f5f9;
    color: var(--text-muted);
}

.tipo-badge {
    font-size: 0.7rem;
    padding: 0.15rem 0.45rem;
    border-radius: 9999px;
    background-color: #e2e8f0;
    color: var(--text-secondary);
    border: 1px solid transparent;
}

.tipo-badge.live {
    background-color: #fee2e2;
    color: #dc2626;
    border-color: #fca5a5;
    font-weight: 700;
}

.tipo-badge.soon {
    background-color: #f1f5f9;
    color: var(--text-muted);
}

/* Sección Qué Ver (Columnas Visibles) */
.filter-que-ver-box {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding-top: 0.85rem;
    border-top: 1px dashed var(--border-color);
}

.que-ver-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.btn-text-action {
    background: none;
    border: none;
    color: var(--accent-blue);
    font-size: 0.775rem;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
    text-decoration: underline;
    transition: opacity 0.2s;
}

.btn-text-action:hover {
    opacity: 0.8;
}

.que-ver-chips-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.que-ver-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    background-color: #f8fafc;
    border: 1px solid var(--border-color);
    padding: 0.4rem 0.75rem;
    border-radius: var(--radius-md);
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    user-select: none;
    transition: var(--transition-standard);
}

.que-ver-chip:hover {
    background-color: #f1f5f9;
    color: var(--text-primary);
    border-color: #cbd5e1;
}

.que-ver-chip input[type="checkbox"] {
    accent-color: var(--accent-blue);
    cursor: pointer;
    width: 14px;
    height: 14px;
}

.que-ver-chip.active {
    background-color: #eff6ff;
    border-color: #bfdbfe;
    color: #1e40af;
    font-weight: 600;
}

/* Encabezados de tabla ordenables */
.data-table th.sortable {
    cursor: pointer;
    user-select: none;
    transition: background-color 0.15s ease, color 0.15s ease;
    white-space: nowrap;
}

.data-table th.sortable:hover {
    background-color: rgba(37, 99, 235, 0.08);
    color: var(--accent-blue);
}

.data-table th.sortable .sort-indicator {
    display: inline-block;
    margin-left: 0.35rem;
    font-size: 0.75rem;
    color: #94a3b8;
    vertical-align: middle;
    transition: transform 0.15s ease, color 0.15s ease;
}

.data-table th.sortable.sort-asc .sort-indicator {
    color: var(--accent-blue);
    font-weight: 900;
}

.data-table th.sortable.sort-desc .sort-indicator {
    color: var(--accent-blue);
    font-weight: 900;
}

/* Enlaces a detalle_partido.php */
.table-match-link {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    transition: color 0.15s ease;
}

.table-match-link:hover {
    color: var(--accent-blue);
    text-decoration: underline;
}

.table-match-link .match-link-arrow {
    font-size: 0.75rem;
    opacity: 0.6;
    transition: transform 0.15s ease;
}

.table-match-link:hover .match-link-arrow {
    transform: translate(2px, -2px);
    opacity: 1;
}

/* Badges para Alertas y Apuestas */
.badge-alerta-amarilla {
    background-color: #fef3c7;
    color: #b45309;
    border: 1px solid #fde68a;
    padding: 0.2rem 0.55rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.badge-alerta-roja {
    background-color: #fee2e2;
    color: #b91c1c;
    border: 1px solid #fca5a5;
    padding: 0.2rem 0.55rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.badge-apuesta-over {
    background-color: #e0f2fe;
    color: #0369a1;
    border: 1px solid #bae6fd;
    padding: 0.2rem 0.55rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.5px;
}

.badge-apuesta-under {
    background-color: #ede9fe;
    color: #6d28d9;
    border: 1px solid #ddd6fe;
    padding: 0.2rem 0.55rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.5px;
}

.badge-cuarto-info {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
    background: #f1f5f9;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
}

/* Ocultamiento instantáneo de columnas */
.col-hidden {
    display: none !important;
}

/* --------------------------------------------------------------------------
   Responsive Adaptations (Tablet Horizontal & Monitor)
   -------------------------------------------------------------------------- */
@media (max-width: 1200px) {
    .kpi-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    .kpi-grid-analisis {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 1024px) {
    :root {
        --sidebar-width: 200px;
    }

    .view-body {
        padding: 1.25rem;
        gap: 1.25rem;
    }

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

    .kpi-grid-analisis {
        grid-template-columns: repeat(2, 1fr);
    }

    .chart-wrapper {
        height: 260px;
    }
}

/* ==========================================================================
   AUTO-REFRESH TOGGLE & PARTIDOS SUBSECTIONS
   ========================================================================== */

.auto-refresh-toggle-wrapper {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    padding: 0.35rem 0.85rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    user-select: none;
    transition: var(--transition-standard);
}

.auto-refresh-toggle-wrapper:hover {
    border-color: #cbd5e1;
    background-color: var(--bg-hover);
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 38px;
    height: 20px;
    margin: 0;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #cbd5e1;
    transition: 0.25s ease;
    border-radius: 20px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.25s ease;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0,0,0,0.25);
}

.toggle-switch input:checked + .toggle-slider {
    background-color: var(--accent-green);
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(18px);
}

.toggle-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
}

/* Row clickability & Hover Effect */
.clickable-row {
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.clickable-row:hover td {
    background-color: #f1f5f9 !important;
}

.btn-table-action {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.75rem;
    font-size: 0.775rem;
    font-weight: 700;
    border-radius: var(--radius-sm);
    text-decoration: none;
    border: 1px solid var(--border-color);
    background: var(--bg-surface);
    color: var(--text-primary);
    transition: var(--transition-standard);
    cursor: pointer;
}

.btn-table-action:hover {
    background: var(--accent-blue-light);
    color: var(--accent-blue);
    border-color: var(--accent-blue);
}

.btn-table-action.primary {
    background: var(--accent-blue);
    color: #ffffff;
    border-color: var(--accent-blue);
}

.btn-table-action.primary:hover {
    background: #1d4ed8;
}

/* Partidos Subpane Layout */
.partidos-pane {
    display: flex;
    flex-direction: column;
    gap: 1.75rem;
}

.partidos-filter-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 0.5rem;
}

.date-filter-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.date-input-field {
    padding: 0.45rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    background: var(--bg-surface);
    color: var(--text-primary);
    outline: none;
    transition: var(--transition-standard);
}

.date-input-field:focus {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}

.outcome-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.6rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 700;
}

.outcome-badge.over {
    background: var(--accent-green-bg);
    color: var(--accent-green);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.outcome-badge.under {
    background: var(--accent-red-bg);
    color: var(--accent-red);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.outcome-badge.push {
    background: var(--bg-hover);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

/* Acciones en Lote (Silenciar & Eliminar) */
.bulk-actions-group {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.btn-action-silenciar {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.45rem 0.85rem;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 600;
    color: #92400e;
    background: #fef3c7;
    border: 1px solid #fde68a;
    cursor: pointer;
    transition: var(--transition-standard);
}

.btn-action-silenciar:hover:not(:disabled) {
    background: #fde68a;
    color: #78350f;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(245, 158, 11, 0.2);
}

.btn-action-eliminar {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.45rem 0.85rem;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 600;
    color: #991b1b;
    background: #fee2e2;
    border: 1px solid #fecaca;
    cursor: pointer;
    transition: var(--transition-standard);
}

.btn-action-eliminar:hover:not(:disabled) {
    background: #fecaca;
    color: #7f1d1d;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(239, 68, 68, 0.2);
}

.btn-action-silenciar:disabled,
.btn-action-eliminar:disabled,
.btn-action-desilenciar:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-action-desilenciar {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.45rem 0.85rem;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 600;
    color: #1e40af;
    background: #dbeafe;
    border: 1px solid #bfdbfe;
    cursor: pointer;
    transition: var(--transition-standard);
}

.btn-action-desilenciar:hover:not(:disabled) {
    background: #bfdbfe;
    color: #1e3a8a;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.2);
}

.silenciado-badge-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
    padding: 0.15rem 0.45rem;
    border-radius: 4px;
    font-size: 0.72rem;
    font-weight: 700;
    margin-left: 0.4rem;
    vertical-align: middle;
}

tr.match-silenciado-row {
    background-color: rgba(254, 243, 199, 0.12);
}

tr.match-silenciado-row td {
    opacity: 0.9;
}

tr.match-silenciado-row:hover td {
    opacity: 1;
}

.btn-action-deep {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.9rem;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 700;
    color: #ffffff;
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    border: 1px solid #4338ca;
    cursor: pointer;
    transition: var(--transition-standard);
    box-shadow: 0 2px 6px rgba(79, 70, 229, 0.25);
}

.btn-action-deep:hover:not(:disabled) {
    background: linear-gradient(135deg, #4338ca 0%, #6d28d9 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.35);
}

/* ==========================================================================
   ESTILOS PARA MÓDULO ANÁLISIS DE DESVIACIONES
   ========================================================================== */

.filtros-desviaciones-row {
    display: flex;
    align-items: flex-end;
    gap: 1rem;
    flex-wrap: wrap;
    padding-top: 0.85rem;
    margin-top: 0.5rem;
    border-top: 1px dashed var(--border-color);
}

.input-with-addon {
    position: relative;
    display: flex;
    align-items: center;
}

.input-with-addon input {
    width: 100%;
    padding-right: 1.85rem !important;
}

.input-addon-symbol {
    position: absolute;
    right: 0.65rem;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-muted);
    pointer-events: none;
}

.cuartos-checkboxes-group {
    display: flex;
    gap: 0.45rem;
    flex-wrap: wrap;
}

.cuarto-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background-color: #f8fafc;
    border: 1px solid var(--border-color);
    padding: 0.4rem 0.65rem;
    border-radius: var(--radius-md);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    user-select: none;
    transition: var(--transition-standard);
}

.cuarto-chip:hover {
    background-color: #f1f5f9;
    border-color: #cbd5e1;
    color: var(--text-primary);
}

.cuarto-chip input[type="checkbox"] {
    accent-color: var(--accent-blue);
    cursor: pointer;
    width: 14px;
    height: 14px;
}

.cuarto-chip.active {
    background-color: #eff6ff;
    border-color: #93c5fd;
    color: #1e40af;
}

.filter-select-field {
    padding: 0.5rem 0.85rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    background-color: var(--bg-surface);
    color: var(--text-primary);
    font-size: 0.825rem;
    font-weight: 600;
    cursor: pointer;
    outline: none;
    transition: var(--transition-standard);
    min-height: 38px;
}

.filter-select-field:focus {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

/* Badges para Tipos de Desviación (2: Mínimo, 3: Máximo) */
.badge-tipo-minimo {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    background: #e0f2fe;
    color: #0369a1;
    border: 1px solid #bae6fd;
    padding: 0.2rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 700;
    white-space: nowrap;
}

.badge-tipo-maximo {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    background: #fef3c7;
    color: #b45309;
    border: 1px solid #fde68a;
    padding: 0.2rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 700;
    white-space: nowrap;
}

.badge-cuarto-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #f1f5f9;
    color: #334155;
    font-weight: 800;
    font-size: 0.75rem;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    margin-right: 0.35rem;
    border: 1px solid #e2e8f0;
}

/* Pills para diferencias respecto a inicio, proyección, previa y final */
.diff-pill-pos {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.2rem;
    background: #ecfdf5;
    color: #047857;
    border: 1px solid #a7f3d0;
    padding: 0.2rem 0.55rem;
    border-radius: var(--radius-sm);
    font-size: 0.825rem;
    font-weight: 700;
}

.diff-pill-neg {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.2rem;
    background: #fff1f2;
    color: #be123c;
    border: 1px solid #fecdd3;
    padding: 0.2rem 0.55rem;
    border-radius: var(--radius-sm);
    font-size: 0.825rem;
    font-weight: 700;
}

.diff-pill-zero {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #f8fafc;
    color: #64748b;
    border: 1px solid #e2e8f0;
    padding: 0.2rem 0.55rem;
    border-radius: var(--radius-sm);
    font-size: 0.825rem;
    font-weight: 700;
}

.diff-subinfo {
    display: block;
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-top: 0.2rem;
}



