/* ==========================================================================
   FUTBOLFORMATIVO AI - PREMIUM DARK STYLE SYSTEM (WITH GLASSMORPHISM)
   ========================================================================== */

/* Variables y Tokens de Diseño */
:root {
    --bg-dark-base: #060913;       /* Fondo Oscuro Premium (HSL 225° 50% 5%) */
    --bg-dark-panel: #0c1020;      /* Fondo de Paneles y Tarjetas (HSL 227° 45% 9%) */
    --bg-dark-card: rgba(12, 16, 32, 0.45);
    
    --border-glass: rgba(255, 255, 255, 0.05);
    --border-glass-hover: rgba(255, 255, 255, 0.12);
    
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    /* LuduSport Color Palette - Concept 1 Tech Crest */
    --brand-primary: #00f0ff;      /* Cyan Eléctrico (Formativo/IA) */
    --brand-secondary: #b026ff;    /* Violeta Neón (Campeonatos/Arena) */
    
    --color-accent: var(--brand-primary);
    --color-accent-hover: #00d8e6;
    --color-accent-rgb: 0, 240, 255;
    --gradient-primary: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-secondary) 100%);
    --gradient-accent: linear-gradient(135deg, #ec4899 0%, var(--brand-secondary) 100%);
    
    /* Colores Específicos de las Etapas */
    --color-sub-1: #10b981; /* Emerald */
    --color-ego-2: #06b6d4; /* Cyan */
    --color-suma-1: #6366f1; /* Indigo */
    --color-suma-2: #f59e0b; /* Amber */
    
    --shadow-soft: 0 8px 32px rgba(3, 7, 18, 0.5);
    --shadow-glow: 0 0 15px rgba(0, 240, 255, 0.35);
    
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
    
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dinamic Themes based on Active Stage */
.theme-subegocentrico {
    --color-accent: var(--color-sub-1);
    --gradient-primary: linear-gradient(135deg, var(--color-sub-1) 0%, #059669 100%);
    --shadow-glow: 0 0 15px rgba(16, 185, 129, 0.35);
}
.theme-egocentrica {
    --color-accent: var(--color-ego-2);
    --gradient-primary: linear-gradient(135deg, var(--color-ego-2) 0%, #0891b2 100%);
    --shadow-glow: 0 0 15px rgba(6, 182, 212, 0.35);
}
.theme-sumativa1 {
    --color-accent: var(--color-suma-1);
    --gradient-primary: linear-gradient(135deg, var(--color-suma-1) 0%, #4338ca 100%);
    --shadow-glow: 0 0 15px rgba(99, 102, 241, 0.35);
}
.theme-sumativa2 {
    --color-accent: var(--color-suma-2);
    --gradient-primary: linear-gradient(135deg, var(--color-suma-2) 0%, #d97706 100%);
    --shadow-glow: 0 0 15px rgba(245, 158, 11, 0.35);
}

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

body {
    background-color: var(--bg-dark-base);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.6;
    overflow-x: hidden;
    transition: background-color 0.5s ease;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #ffffff;
}

/* Estructura Principal Grid */
.app-container {
    display: grid;
    grid-template-columns: 340px 1fr;
    height: 100vh;
    overflow: hidden;
}

/* Scrollbars Modernos */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* ==========================================================================
   SIDEBAR COMPONENT & LOCK KEY WIDGET
   ========================================================================== */
.sidebar {
    background-color: var(--bg-dark-panel);
    border-right: 1px solid var(--border-glass);
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 1.5rem 1.25rem;
    overflow-y: auto;
    position: relative;
}

.sidebar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 150px;
    background: radial-gradient(circle at top left, rgba(124, 58, 237, 0.1) 0%, transparent 70%);
    pointer-events: none;
}

.sidebar-header {
    margin-bottom: 1.25rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 800;
}

.logo-icon {
    color: var(--color-accent);
    width: 2rem;
    height: 2rem;
    transition: color 0.3s;
}

.highlight {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.tagline {
    font-size: 0.72rem;
    color: var(--text-secondary);
    margin-left: 2.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

/* Lock API Credentials Panel */
.api-key-panel {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-glass);
    border-radius: 10px;
    padding: 0.85rem;
    margin-bottom: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.api-panel-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.status-indicator.connected {
    background-color: var(--color-sub-1);
    box-shadow: 0 0 8px var(--color-sub-1);
}

.key-input-wrapper {
    display: flex;
    align-items: center;
    background: rgba(15, 20, 35, 0.8);
    border: 1px solid var(--border-glass-hover);
    border-radius: 6px;
    padding: 0 0.5rem;
}

.key-icon {
    width: 1rem;
    height: 1rem;
    color: var(--text-muted);
}

#api-key-input {
    background: none;
    border: none;
    outline: none;
    color: var(--text-primary);
    padding: 0.5rem;
    font-size: 0.8rem;
    font-family: monospace;
    flex-grow: 1;
    width: 100%;
}

#toggle-key-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    padding: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

#toggle-key-btn:hover {
    color: #ffffff;
}

#toggle-key-btn i {
    width: 1rem;
    height: 1rem;
}

.api-status-text {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-style: italic;
}

/* Config Form & Inputs */
.config-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    flex-grow: 1;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.form-group label {
    font-family: var(--font-heading);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-group label i {
    width: 1rem;
    height: 1rem;
    color: var(--color-accent);
}

.select-wrapper {
    position: relative;
}

.select-wrapper::after {
    content: '▼';
    font-size: 0.6rem;
    position: absolute;
    right: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: var(--text-secondary);
}

select {
    width: 100%;
    background-color: rgba(15, 20, 35, 0.75);
    border: 1px solid var(--border-glass);
    border-radius: 8px;
    padding: 0.65rem 0.85rem;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.88rem;
    appearance: none;
    cursor: pointer;
    transition: var(--transition-fast);
}

select:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 2px rgba(var(--color-accent-rgb), 0.25);
}

.helper-text {
    font-size: 0.75rem;
    color: var(--text-muted);
    line-height: 1.35;
    padding-left: 0.25rem;
}

/* Slider Custom Styling */
.label-with-value {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.badge-value {
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-glass-hover);
    color: var(--text-primary);
    font-size: 0.78rem;
    font-weight: 700;
    padding: 0.1rem 0.45rem;
    border-radius: 4px;
}

.slider {
    -webkit-appearance: none;
    width: 100%;
    height: 5px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.1);
    outline: none;
    margin-top: 0.4rem;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--color-accent);
    cursor: pointer;
    box-shadow: 0 0 10px rgba(0,0,0,0.5);
    transition: transform 0.1s;
}

.slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.slider-ticks {
    display: flex;
    justify-content: space-between;
    font-size: 0.72rem;
    color: var(--text-muted);
    padding: 0 0.1rem;
    margin-top: 0.2rem;
}

textarea {
    background-color: rgba(15, 20, 35, 0.75);
    border: 1px solid var(--border-glass);
    border-radius: 8px;
    padding: 0.65rem;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.88rem;
    resize: none;
    transition: var(--transition-fast);
}

textarea:focus {
    outline: none;
    border-color: var(--color-accent);
}

/* Botones */
.btn {
    border: none;
    border-radius: 8px;
    padding: 0.75rem 1.25rem;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: var(--transition-smooth);
}

.btn i {
    width: 1.1rem;
    height: 1.1rem;
}

.btn-primary {
    background: var(--gradient-primary);
    color: #ffffff;
    box-shadow: var(--shadow-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 20px rgba(124, 58, 237, 0.5);
}

.btn-generate {
    margin-top: 0.5rem;
    width: 100%;
}

.btn-secondary {
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-glass);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: var(--border-glass-hover);
}

.btn-accent {
    background: var(--gradient-accent);
    color: white;
}

.btn-accent:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 20px rgba(236, 72, 153, 0.4);
}

.sidebar-footer {
    border-top: 1px solid var(--border-glass);
    padding-top: 1rem;
    margin-top: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.expert-avatar-group {
    display: flex;
}

.mini-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.7rem;
    border: 2px solid var(--bg-dark-panel);
    margin-right: -8px;
    color: white;
}

.mini-avatar.coach { background-color: var(--color-suma-1); }
.mini-avatar.trainer { background-color: var(--color-sub-1); }
.mini-avatar.psychologist { background-color: var(--color-suma-2); }
.mini-avatar.backend { background-color: #ec4899; }
.mini-avatar.frontend { background-color: #8b5cf6; }

/* ==========================================================================
   MAIN CONTENT AREA
   ========================================================================== */
.main-content {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow-y: auto;
    background: radial-gradient(circle at 80% 20%, rgba(79, 70, 229, 0.05) 0%, transparent 60%);
    padding: 1.5rem 2rem;
}

.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.breadcrumb {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 0.25rem;
}

#session-title {
    font-size: 1.8rem;
    font-weight: 800;
}

.header-actions {
    display: flex;
    gap: 0.75rem;
}

/* Metrics Dashboard Panel */
.dashboard-metrics {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

.metric-card {
    background-color: var(--bg-dark-panel);
    border: 1px solid var(--border-glass);
    border-radius: 12px;
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: var(--shadow-soft);
    position: relative;
    overflow: hidden;
}

.metric-card::after {
    content: '';
    position: absolute;
    right: 0;
    bottom: 0;
    width: 60px;
    height: 60px;
    background: radial-gradient(circle at bottom right, rgba(255,255,255,0.01) 0%, transparent 70%);
}

.metric-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.metric-icon.coach { background-color: rgba(99, 102, 241, 0.12); color: var(--color-suma-1); }
.metric-icon.trainer { background-color: rgba(16, 185, 129, 0.12); color: var(--color-sub-1); }
.metric-icon.psychologist { background-color: rgba(245, 158, 11, 0.12); color: var(--color-suma-2); }

.metric-icon i {
    width: 1.3rem;
    height: 1.3rem;
}

.metric-info {
    flex-grow: 1;
}

.metric-label {
    font-size: 0.78rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.progress-bar-container {
    background-color: rgba(255, 255, 255, 0.08);
    height: 5px;
    border-radius: 3px;
    margin: 0.35rem 0;
    overflow: hidden;
    position: relative;
}

.progress-bar {
    height: 100%;
    border-radius: 3px;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.progress-bar.coach-bar { background-color: var(--color-suma-1); }
.progress-bar.trainer-bar { background-color: var(--color-sub-1); }
.progress-bar.psychologist-bar { background-color: var(--color-suma-2); }
.progress-bar.metric-green { background-color: var(--color-sub-1); }
.progress-bar.metric-blue { background-color: var(--color-ego-2); }
.progress-bar.metric-orange { background-color: var(--color-suma-2); }
.progress-bar.metric-purple { background-color: #a78bfa; }
.progress-bar.metric-indigo { background-color: var(--color-suma-1); }

.metric-status {
    font-size: 0.75rem;
    font-weight: 700;
    color: #ffffff;
}

/* Tabs System */
.workspace-tabs-container {
    border-bottom: 1px solid var(--border-glass);
    margin-bottom: 1.5rem;
}

.tabs {
    display: flex;
    gap: 1.5rem;
}

.tab-btn {
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    color: var(--text-secondary);
    padding: 0.65rem 0.25rem;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.98rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    transition: var(--transition-fast);
}

.tab-btn i {
    width: 1.1rem;
    height: 1.1rem;
}

.tab-btn:hover {
    color: #ffffff;
}

.tab-btn.active {
    color: #ffffff;
    border-bottom-color: var(--color-accent);
}

.tab-content-wrapper {
    flex-grow: 1;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.4s ease-out;
}

/* ==========================================================================
   TIMELINE & DIGITAL PITCH PANEL (PESTAÑA 1)
   ========================================================================== */
.timeline-layout {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 1.5rem;
    align-items: flex-start;
}

.session-timeline {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.timeline-card {
    background-color: var(--bg-dark-panel);
    border: 1px solid var(--border-glass);
    border-radius: 12px;
    display: flex;
    padding: 1.25rem;
    gap: 1.25rem;
    box-shadow: var(--shadow-soft);
    cursor: pointer;
    transition: var(--transition-smooth);
    position: relative;
}

.timeline-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 4px;
    background-color: var(--color-accent);
    border-radius: 12px 0 0 12px;
    transition: background-color 0.3s;
}

.timeline-card:hover {
    border-color: var(--border-glass-hover);
    transform: translateX(4px);
}

.timeline-card.active {
    border-color: rgba(var(--color-accent-rgb), 0.35);
    background-color: rgba(25, 30, 52, 0.3);
    box-shadow: 0 0 15px rgba(var(--color-accent-rgb), 0.1);
}

.card-timeline-marker {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    width: 14px;
}

.marker-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: var(--color-accent);
    border: 2px solid var(--bg-dark-panel);
    z-index: 2;
    transition: background-color 0.3s;
}

.timeline-card.active .marker-dot {
    box-shadow: 0 0 8px var(--color-accent);
}

.marker-line {
    flex-grow: 1;
    width: 2px;
    background-color: var(--border-glass);
    margin-top: 4px;
}

.timeline-card:last-child .marker-line {
    display: none;
}

.card-body {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.card-header-flex {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

.drill-phase {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.02em;
}

.drill-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: #ffffff;
}

.card-badges {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.drill-duration-badge {
    background-color: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-glass);
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-secondary);
    padding: 0.2rem 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.drill-duration-badge i {
    width: 0.9rem;
    height: 0.9rem;
}

.card-actions-buttons {
    display: flex;
    gap: 0.25rem;
}

.action-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
}

.action-btn:hover {
    color: #ffffff;
    background-color: rgba(255, 255, 255, 0.08);
}

.action-btn.delete-btn:hover {
    color: #ef4444;
    background-color: rgba(239, 68, 68, 0.1);
}

.action-btn i {
    width: 0.95rem;
    height: 0.95rem;
}

.drill-desc {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.45;
}

.provocation-rule-box {
    background-color: rgba(255, 255, 255, 0.01);
    border: 1px dashed rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    font-size: 0.82rem;
    line-height: 1.4;
}

.rule-title {
    font-weight: 700;
    color: var(--color-suma-2);
    margin-right: 0.25rem;
}

.rule-content {
    color: var(--text-secondary);
}

/* Pizarra Táctica Digital */
.tactical-board-panel {
    background-color: var(--bg-dark-panel);
    border: 1px solid var(--border-glass);
    border-radius: 16px;
    padding: 1.25rem;
    box-shadow: var(--shadow-soft);
    position: sticky;
    top: 0;
}

.board-header {
    margin-bottom: 1rem;
}

.board-header h3 {
    font-size: 1.15rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.board-header h3 i {
    color: var(--color-accent);
}

.board-subtitle {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.tactical-pitch-wrapper {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.soccer-pitch {
    width: 100%;
    height: auto;
    border: 1px solid var(--border-glass-hover);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    border-radius: 8px;
    background-color: #0d1c33;
}

/* Draggable Nodes styling */
.draggable {
    cursor: grab;
    transition: filter 0.1s;
}

.draggable:active {
    cursor: grabbing;
    filter: brightness(1.2) drop-shadow(0 0 4px rgba(255,255,255,0.8));
}

.player-node {
    transition: r 0.1s;
}

.player-node:hover {
    r: 2.6;
}

.ball-node:hover {
    r: 1.5;
}

.board-legend {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-secondary);
    padding: 0 0.5rem;
}

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

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.dot.azul { background-color: #3b82f6; border: 1px solid #fff; }
.dot.rojo { background-color: #ef4444; border: 1px solid #fff; }
.dot.amarillo { background-color: #eab308; }
.dot.blanco { background-color: #fff; border: 1px solid #000; }

/* ==========================================================================
   PESTAÑA 2: SEGUIMIENTO DE JUGADORAS (EXCEL INTEGRATION)
   ========================================================================== */
.players-dashboard-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 1.5rem;
    height: calc(100vh - 220px);
    min-height: 500px;
}

.players-sidebar {
    background-color: rgba(15, 20, 35, 0.45);
    border: 1px solid var(--border-glass);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.players-sidebar-header {
    padding: 0.85rem;
    border-bottom: 1px solid var(--border-glass);
    display: flex;
    align-items: center;
    background-color: var(--bg-dark-panel);
    gap: 0.5rem;
}

/* Botón "+" en el sidebar de jugadoras */
.btn-add-player {
    flex-shrink: 0;
    background: rgba(99,179,237,0.12);
    border: 1px solid rgba(99,179,237,0.3);
    border-radius: 7px;
    color: #63b3ed;
    cursor: pointer;
    padding: 5px 7px;
    display: flex;
    align-items: center;
    transition: background 0.15s, border-color 0.15s;
}
.btn-add-player:hover {
    background: rgba(99,179,237,0.25);
    border-color: #63b3ed;
}
.btn-add-player i { width: 14px; height: 14px; }

.players-sidebar-header i {
    width: 1rem;
    height: 1rem;
    color: var(--text-muted);
}

#player-search {
    background: none;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-size: 0.88rem;
    width: 100%;
}

.players-list {
    list-style: none;
    overflow-y: auto;
    flex-grow: 1;
    padding: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.player-list-item {
    display: flex;
    align-items: center;
    padding: 0.6rem 0.75rem;
    border-radius: 8px;
    cursor: pointer;
    gap: 0.75rem;
    transition: var(--transition-fast);
}

.player-list-item:hover {
    background-color: rgba(255, 255, 255, 0.03);
}

.player-list-item.active {
    background-color: rgba(124, 58, 237, 0.12);
    border: 1px solid rgba(124, 58, 237, 0.25);
}

.player-mini-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border: 1px solid var(--border-glass-hover);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.75rem;
    text-transform: uppercase;
}

.player-mini-info {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.player-mini-name {
    font-size: 0.88rem;
    font-weight: 600;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.player-mini-pos {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.player-mini-badge {
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-glass);
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.1rem 0.35rem;
    color: var(--text-secondary);
}

.player-list-item.active .player-mini-badge {
    background-color: var(--color-accent);
    color: #ffffff;
    border-color: transparent;
}

/* Ficha Fisiológica de Jugadora */
.player-profile-view {
    background-color: var(--bg-dark-panel);
    border: 1px solid var(--border-glass);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: var(--shadow-soft);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.profile-card-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    border-bottom: 1px solid var(--border-glass);
    padding-bottom: 1.25rem;
}

.profile-avatar {
    width: 65px;
    height: 65px;
    border-radius: 50%;
    background: var(--gradient-primary);
    color: #ffffff;
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1.6rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid rgba(255,255,255,0.2);
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    text-transform: uppercase;
}

.profile-meta {
    flex-grow: 1;
}

.profile-meta h2 {
    font-size: 1.6rem;
    margin-bottom: 0.25rem;
}

.profile-subtitle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.88rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.profile-subtitle span {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.profile-subtitle i {
    width: 1rem;
    height: 1rem;
    color: var(--color-accent);
}

.profile-badges {
    display: flex;
    gap: 0.5rem;
}

.profile-badge-club, .profile-badge-dni {
    background-color: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-glass);
    font-size: 0.75rem;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    color: var(--text-secondary);
    font-weight: 500;
}

.profile-score-badge {
    background: rgba(124, 58, 237, 0.08);
    border: 1px solid rgba(124, 58, 237, 0.25);
    border-radius: 12px;
    padding: 0.75rem 1rem;
    text-align: center;
    min-width: 90px;
}

.score-num {
    display: block;
    font-size: 1.7rem;
    font-weight: 800;
    font-family: var(--font-heading);
    color: #c084fc;
    line-height: 1.1;
}

.score-label {
    font-size: 0.68rem;
    text-transform: uppercase;
    color: var(--text-secondary);
    font-weight: 700;
    letter-spacing: 0.02em;
}

.profile-body-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.profile-col {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.profile-section-card {
    background-color: rgba(15, 20, 35, 0.5);
    border: 1px solid var(--border-glass);
    border-radius: 12px;
    padding: 1.25rem;
}

.profile-section-card h3 {
    font-size: 1.05rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    border-bottom: 1px solid var(--border-glass);
    padding-bottom: 0.5rem;
}

.profile-section-card h3 i {
    color: var(--color-accent);
    width: 1.1rem;
    height: 1.1rem;
}

/* Biometrics Widgets */
.biometrics-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
}

.bio-stat {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-glass);
    border-radius: 8px;
    padding: 0.75rem;
    text-align: center;
}

.bio-stat-label {
    display: block;
    font-size: 0.72rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
}

.bio-stat-val {
    display: block;
    font-size: 1.2rem;
    font-weight: 700;
    color: #ffffff;
    margin: 0.2rem 0;
}

.bio-stat-comparison {
    font-size: 0.68rem;
    font-weight: 600;
    padding: 0.05rem 0.35rem;
    border-radius: 3px;
    display: inline-block;
}

.bio-stat-comparison.positive {
    background-color: rgba(16, 185, 129, 0.1);
    color: #34d399;
}

.bio-stat-comparison.negative {
    background-color: rgba(245, 158, 11, 0.1);
    color: #fbcfe8;
}

/* Injury alerts */
.injury-card-box {
    border-left: 4px solid transparent;
}

.injury-card-box.injury-green {
    border-left-color: var(--color-sub-1);
    background-color: rgba(16, 185, 129, 0.03);
}

.injury-card-box.injury-yellow {
    border-left-color: var(--color-suma-2);
    background-color: rgba(245, 158, 11, 0.03);
}

.injury-status-badge {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    margin-bottom: 0.75rem;
}

.injury-green .injury-status-badge {
    background-color: rgba(16, 185, 129, 0.15);
    color: #34d399;
}

.injury-yellow .injury-status-badge {
    background-color: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
}

.injury-description {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.45;
}

/* Semáforo Biológico — Fase 4 (AI Sports Medicine) */
.injury-card-box.semaphore-green {
    border-left-color: var(--color-sub-1);
    background-color: rgba(16, 185, 129, 0.04);
}
.injury-card-box.semaphore-yellow {
    border-left-color: var(--color-suma-2);
    background-color: rgba(245, 158, 11, 0.04);
}
.injury-card-box.semaphore-red {
    border-left-color: #ef4444;
    background-color: rgba(239, 68, 68, 0.05);
}

.semaphore-green .injury-status-badge { background-color: rgba(16,185,129,0.15); color: #34d399; }
.semaphore-yellow .injury-status-badge { background-color: rgba(245,158,11,0.15); color: #fbbf24; }
.semaphore-red .injury-status-badge { background-color: rgba(239,68,68,0.15); color: #f87171; }

.semaphore-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.65rem;
    flex-wrap: wrap;
}
.semaphore-load-pill {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.12rem 0.5rem;
    border-radius: 20px;
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.1);
    color: var(--text-secondary);
}
.semaphore-desc-text {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 0.4rem;
    font-style: italic;
    line-height: 1.4;
}

/* Panel de Insights Gemini AI (Fase 2 — Backend Expert) */
.gemini-ai-insights-panel {
    background: rgba(124, 58, 237, 0.06);
    border: 1px solid rgba(124, 58, 237, 0.2);
    border-radius: 12px;
    margin: 0.75rem 1.5rem 0.5rem;
    overflow: hidden;
}
.gemini-panel-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.65rem 1rem;
    background: rgba(124, 58, 237, 0.12);
    border-bottom: 1px solid rgba(124, 58, 237, 0.15);
    font-size: 0.82rem;
    font-weight: 600;
    color: #c4b5fd;
}
.gemini-header-icon { color: #a78bfa; flex-shrink: 0; width: 16px; height: 16px; }
.gemini-header-tag {
    margin-left: auto;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.1rem 0.5rem;
    border-radius: 20px;
    background: rgba(124,58,237,0.25);
    color: #c4b5fd;
    letter-spacing: 0.03em;
}
#gemini-panel-body { padding: 0.85rem 1rem; min-height: 52px; }
.gemini-panel-content { display: flex; flex-direction: column; gap: 0.75rem; }
.gemini-section { display: flex; flex-direction: column; gap: 0.3rem; }
.gemini-section p { font-size: 0.82rem; color: var(--text-secondary); line-height: 1.55; }
.gemini-key-insight strong { color: #e2e8f0; font-size: 0.85rem; }
.gemini-token-badge {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.68rem;
    color: #475569;
    margin-top: 4px;
    padding-top: 6px;
    border-top: 1px solid rgba(255,255,255,0.05);
}
.gemini-token-badge .icon-inline { width: 11px; height: 11px; stroke-width: 2.5; }
.gemini-tag {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.1rem 0.45rem;
    border-radius: 4px;
    width: fit-content;
}
.gemini-tag.coach { background: rgba(16,185,129,0.15); color: #34d399; }
.gemini-tag.medicine { background: rgba(239,68,68,0.12); color: #f87171; }
.gemini-tag.trainer { background: rgba(245,158,11,0.15); color: #fbbf24; }
/* Estado: IA generó los ejercicios con éxito */
.gemini-section-success { background: rgba(16,185,129,0.06); border-left: 2px solid #34d399; border-radius: 0 6px 6px 0; padding-left: 0.5rem; }
/* Estado: Gemini no generó session_plan, se usó fallback */
.gemini-section-warn { background: rgba(245,158,11,0.06); border-left: 2px solid #fbbf24; border-radius: 0 6px 6px 0; padding-left: 0.5rem; }
.gemini-loading {
    display: flex; align-items: center; gap: 0.7rem;
    color: var(--text-muted); font-size: 0.82rem; padding: 0.25rem 0;
}
.gemini-spinner {
    width: 16px; height: 16px; border-radius: 50%;
    border: 2px solid rgba(124,58,237,0.2);
    border-top-color: #a78bfa;
    animation: spin 0.7s linear infinite;
    flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }
.gemini-error { color: #f87171; font-size: 0.82rem; }
.gemini-empty { color: var(--text-muted); font-size: 0.82rem; }

/* ── Barra de progreso IA (inyectada en timeline-tab durante la llamada a Gemini) ── */
.gemini-progress-wrap {
    display: none;
    margin: 0 0 0.75rem;
    padding: 0.65rem 0.9rem;
    background: linear-gradient(135deg, rgba(124,58,237,0.08) 0%, rgba(99,102,241,0.06) 100%);
    border: 1px solid rgba(124,58,237,0.22);
    border-radius: 10px;
    backdrop-filter: blur(4px);
}
.gemini-progress-header {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    margin-bottom: 0.45rem;
}
.gemini-spinner-sm {
    width: 13px; height: 13px; border-radius: 50%;
    border: 2px solid rgba(124,58,237,0.2);
    border-top-color: #a78bfa;
    animation: spin 0.7s linear infinite;
    flex-shrink: 0;
}
.gemini-progress-label {
    font-size: 0.78rem;
    color: #a78bfa;
    flex: 1;
    font-weight: 500;
}
.gemini-progress-pct {
    font-size: 0.72rem;
    color: #7c3aed;
    font-weight: 700;
    min-width: 2.2rem;
    text-align: right;
}
.gemini-progress-track {
    height: 5px;
    background: rgba(124,58,237,0.12);
    border-radius: 3px;
    overflow: hidden;
}
.gemini-progress-fill {
    height: 100%;
    width: 0%;
    border-radius: 3px;
    background: linear-gradient(90deg, #7c3aed, #a78bfa);
    transition: width 0.4s ease;
}
.gemini-progress-fill.gemini-progress-done {
    background: linear-gradient(90deg, #059669, #34d399);
    transition: width 0.3s ease;
}
.gemini-progress-fill.gemini-progress-error {
    background: linear-gradient(90deg, #dc2626, #f87171);
}

/* ── Spinner inline en el botón Generar durante la llamada ── */
.btn-spinner {
    width: 14px; height: 14px; border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.25);
    border-top-color: #fff;
    animation: spin 0.7s linear infinite;
    flex-shrink: 0;
    display: inline-block;
    vertical-align: middle;
    margin-right: 6px;
}

/* Ratings bar */
.skill-meter-row {
    margin-bottom: 0.85rem;
}

.skill-meter-row:last-child {
    margin-bottom: 0;
}

.skill-meta-bar {
    display: flex;
    justify-content: space-between;
    font-size: 0.82rem;
    color: var(--text-secondary);
    margin-bottom: 0.2rem;
}

.skill-name {
    font-weight: 500;
}

.skill-val-label {
    font-weight: 700;
    color: #ffffff;
}

/* Spider circular metrics alternative for HME */
.skills-spider-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
}

.spider-item {
    background: rgba(255,255,255,0.01);
    border: 1px dashed var(--border-glass);
    border-radius: 8px;
    padding: 0.6rem;
    text-align: center;
}

.spider-num {
    display: block;
    font-size: 1.3rem;
    font-weight: 800;
    color: #38bdf8;
    line-height: 1.1;
    font-family: var(--font-heading);
}

.spider-label {
    font-size: 0.72rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* ==========================================================================
   PESTAÑA 3: CONCILIO DE EXPERTOS & BLUEPRINT (PESTAÑA 3)
   ========================================================================== */
.council-welcome {
    display: flex;
    align-items: center;
    background: rgba(124, 58, 237, 0.05);
    border: 1px solid rgba(124, 58, 237, 0.15);
    border-radius: 12px;
    padding: 1.25rem;
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.welcome-icon {
    width: 2.75rem;
    height: 2.75rem;
    color: #c084fc;
}

.council-text h2 {
    font-size: 1.3rem;
    margin-bottom: 0.15rem;
}

.council-text p {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Cuadrícula Auto-Ajustable de Expertos (Soporta de 1 a 8 tarjetas responsivamente) */
.experts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.experts-grid .expert-card {
    border-radius: 12px;
}

.experts-grid .expert-card-header {
    padding: 1rem;
}

.experts-grid .expert-card-body {
    padding: 1rem;
    font-size: 0.82rem;
}

/* Colores de Borde Superior de las Tarjetas de Expertos */
.expert-card.coach-card::before { background: var(--gradient-primary); }
.expert-card.trainer-card::before { background: var(--color-sub-1); }
.expert-card.psychologist-card::before { background: var(--gradient-accent); }
.expert-card.backend-card::before { background: #ec4899; }
.expert-card.frontend-card::before { background: #8b5cf6; }
.expert-card.medicine-card::before { background: #10b981; }
.expert-card.devops-card::before { background: #38bdf8; }
.expert-card.qa-card::before { background: #fb7185; }

/* Badges e Identificadores de Especialidad */
.expert-badge.coach { background-color: var(--color-suma-1); }
.expert-badge.trainer { background-color: var(--color-sub-1); }
.expert-badge.psychologist { background-color: var(--color-accent); }
.expert-badge.backend { background-color: #ec4899; }
.expert-badge.frontend { background-color: #8b5cf6; }
.expert-badge.medicine { background-color: #10b981; }
.expert-badge.devops { background-color: #38bdf8; }
.expert-badge.qa { background-color: #fb7185; }

/* Avatares adicionales en barra lateral */
.mini-avatar.medicine { background-color: #10b981; }
.mini-avatar.devops { background-color: #38bdf8; }
.mini-avatar.qa { background-color: #fb7185; }

/* Tarjeta Visual de Sincronización Offline-First */
.offline-sync-panel {
    background: radial-gradient(circle at 10% 10%, rgba(56, 189, 248, 0.04) 0%, transparent 60%);
    border: 1px dashed rgba(56, 189, 248, 0.25);
    border-radius: 12px;
    padding: 1rem;
    margin-top: 1rem;
    font-size: 0.8rem;
}

.offline-sync-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    color: #38bdf8;
    margin-bottom: 0.4rem;
}

.offline-sync-header i {
    width: 1.1rem;
    height: 1.1rem;
}

.offline-sync-desc {
    color: var(--text-secondary);
    line-height: 1.4;
}


/* Plano Arquitectónico del Sistema */
.architecture-blueprint {
    background-color: var(--bg-dark-panel);
    border: 1px solid var(--border-glass);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: var(--shadow-soft);
}

.blueprint-header {
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-glass);
    padding-bottom: 0.75rem;
}

.blueprint-header h3 {
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.blueprint-header h3 i {
    color: #ec4899;
}

.blueprint-diagram-grid {
    display: grid;
    grid-template-columns: 1fr auto 1fr auto 1fr;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.flow-block {
    background-color: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-glass);
    border-radius: 10px;
    padding: 1rem;
    min-height: 110px;
}

.flow-block.highlight-db {
    background-color: rgba(236, 72, 153, 0.03);
    border-color: rgba(236, 72, 153, 0.25);
}

.flow-block-title {
    font-size: 0.8rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 0.4rem;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    border-bottom: 1px solid var(--border-glass);
    padding-bottom: 0.25rem;
}

.flow-block-desc {
    font-size: 0.75rem;
    color: var(--text-secondary);
    line-height: 1.35;
}

.flow-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
}

.flow-arrow i {
    color: var(--text-muted);
    width: 1.5rem;
    height: 1.5rem;
}

/* Base de Datos schemas */
.db-schemas-list {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.schema-box {
    background-color: rgba(15, 20, 35, 0.75);
    border: 1px solid var(--border-glass);
    border-radius: 8px;
    padding: 0.85rem;
    font-size: 0.78rem;
}

.schema-box-title {
    font-family: monospace;
    font-weight: 700;
    color: #38bdf8;
    display: block;
    margin-bottom: 0.25rem;
}

.schema-box.tenant {
    border-left: 3px solid #ec4899;
}

.schema-box.tenant .schema-box-title {
    color: #f472b6;
}

.schema-box p {
    color: var(--text-secondary);
    line-height: 1.35;
}

/* R2 bucket */
.r2-box {
    background: rgba(245, 158, 11, 0.02);
    border: 1px dashed rgba(245, 158, 11, 0.25);
    border-radius: 8px;
    padding: 0.85rem;
    font-size: 0.78rem;
}

.r2-title {
    font-weight: 700;
    color: #fbbf24;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    margin-bottom: 0.25rem;
}

.r2-title i {
    width: 0.95rem;
    height: 0.95rem;
}

.r2-box p {
    color: var(--text-secondary);
}

/* ==========================================================================
   MODAL COMPONENT
   ========================================================================== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
}

.modal.active {
    display: flex;
    animation: fadeIn 0.25s ease-out;
}

.modal-content {
    background-color: var(--bg-dark-panel);
    border: 1px solid var(--border-glass-hover);
    border-radius: 16px;
    width: 100%;
    max-width: 500px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.6);
    overflow: hidden;
    animation: slideUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

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

.close-modal:hover {
    color: #ffffff;
}

.modal-body {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.modal-input {
    width: 100%;
    background-color: rgba(15, 20, 35, 0.75);
    border: 1px solid var(--border-glass);
    border-radius: 8px;
    padding: 0.65rem 0.85rem;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.88rem;
    transition: var(--transition-fast);
}

.modal-input:focus {
    outline: none;
    border-color: var(--color-accent);
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-glass);
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

/* ==========================================================================
   ANIMATIONS & TRANSITIONS
   ========================================================================== */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { transform: translateY(30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.animate-pulse {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.03); opacity: 0.8; }
}

.empty-state {
    color: var(--text-muted);
    text-align: center;
    padding: 4rem 1rem;
    font-style: italic;
}

.empty-list-item {
    color: var(--text-muted);
    text-align: center;
    padding: 1rem;
    font-size: 0.82rem;
}

/* ════════════════════════════════════════════════════════════
   SYNC STATUS BADGE — Indicador de sincronización
   ════════════════════════════════════════════════════════════ */
.sync-status-badge {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 10.5px;
    font-weight: 500;
    margin: 4px 8px 6px;
    transition: background 0.3s, color 0.3s;
    cursor: default;
    user-select: none;
}
.sync-status-badge svg {
    width: 11px;
    height: 11px;
    flex-shrink: 0;
}
/* En vivo desde la API */
.sync-status-badge.sync-online {
    background: rgba(72, 187, 120, 0.12);
    border: 1px solid rgba(72, 187, 120, 0.25);
    color: #48bb78;
}
/* Caché local (offline) */
.sync-status-badge.sync-cached {
    background: rgba(237, 137, 54, 0.12);
    border: 1px solid rgba(237, 137, 54, 0.25);
    color: #ed8936;
}
/* Sin sesión */
.sync-status-badge.sync-offline {
    background: rgba(160, 174, 192, 0.08);
    border: 1px solid rgba(160, 174, 192, 0.15);
    color: #718096;
}

/* ══════════════════════════════════════════════════════════
   MÓDULO CLÍNICO — Upload + Análisis Gemini Vision
   ══════════════════════════════════════════════════════════ */
.clinical-upload-row {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(255,255,255,0.07);
}

.btn-clinical-upload {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(159,122,234,0.12);
    border: 1px solid rgba(159,122,234,0.3);
    color: #9f7aea;
    border-radius: 8px;
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}
.btn-clinical-upload:hover {
    background: rgba(159,122,234,0.22);
    border-color: rgba(159,122,234,0.5);
}
.btn-clinical-upload svg { width: 13px; height: 13px; }

.clinical-analysis-result { margin-top: 10px; }

.clinical-loading {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #9f7aea;
    font-size: 12px;
    padding: 8px 0;
}

.clinical-analysis-card {
    background: rgba(159,122,234,0.07);
    border: 1px solid rgba(159,122,234,0.2);
    border-radius: 10px;
    padding: 12px 14px;
    margin-top: 4px;
}

.clinical-analysis-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11.5px;
    font-weight: 600;
    color: #9f7aea;
    margin-bottom: 8px;
}
.clinical-analysis-title svg { width: 14px; height: 14px; }

.clinical-analysis-body {
    font-size: 12px;
    color: #cbd5e0;
    line-height: 1.6;
    white-space: pre-wrap;
}

.clinical-file-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 8px;
    font-size: 11px;
    color: #63b3ed;
    text-decoration: none;
}
.clinical-file-link:hover { text-decoration: underline; }
.clinical-file-link svg { width: 11px; height: 11px; }

.clinical-error {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #fc8181;
    font-size: 12px;
    padding: 6px 0;
}
.clinical-error svg { width: 13px; height: 13px; }

/* ══════════════════════════════════════════════════════════
   RADAR CHART SVG — Habilidades específicas por jugadora
   ══════════════════════════════════════════════════════════ */
.radar-chart-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 6px 0;
}

.radar-svg {
    overflow: visible;
    filter: drop-shadow(0 0 6px rgba(99,179,237,0.18));
}

/* Leyenda numérica debajo del radar */
.radar-legend {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
}

.radar-val-badge {
    background: rgba(99,179,237,0.08);
    border: 1px solid rgba(99,179,237,0.2);
    border-radius: 20px;
    padding: 3px 10px;
    font-size: 11px;
    color: #94a3b8;
    display: flex;
    align-items: center;
    gap: 4px;
}
.radar-val-badge b {
    color: #63b3ed;
    font-size: 12px;
    font-weight: 700;
}
.radar-val-badge small {
    font-size: 10px;
    color: #64748b;
}

.placeholder-text {
    color: var(--text-muted);
    text-align: center;
    padding: 4rem 1rem;
    font-style: italic;
    font-size: 0.95rem;
}

/* ==========================================================================
   SPRINT 6 — SKILL MATRIX SELECTOR · CHIPS DE HABILIDADES MOTRICES
   ========================================================================== */

/* ── Contenedor principal ── */
.skill-matrix-container {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    margin-top: 0.25rem;
}

/* ── Grupo por categoría (HMB / HME / HMA) ── */
.skill-cat-group { display: flex; flex-direction: column; gap: 0.35rem; }

.skill-cat-header {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    padding: 0.2rem 0;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    color: rgba(255,255,255,0.5);
}
.skill-cat-header svg { width: 12px; height: 12px; flex-shrink: 0; }

/* Colores de encabezado por categoría */
.skill-cat-hmb { color: #68d391; }
.skill-cat-hmb svg { color: #68d391; }
.skill-cat-hme { color: #63b3ed; }
.skill-cat-hme svg { color: #63b3ed; }
.skill-cat-hma { color: #f6ad55; }
.skill-cat-hma svg { color: #f6ad55; }

.skill-cat-na {
    margin-left: auto;
    font-size: 0.62rem;
    font-weight: 400;
    color: rgba(255,255,255,0.25);
    letter-spacing: 0;
    text-transform: none;
}
.skill-cat-disabled .skill-cat-header { opacity: 0.4; }

/* ── Fila de chips ── */
.skill-chips-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

/* ── Chip base ── */
.skill-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.28rem 0.55rem;
    font-size: 0.7rem;
    font-family: inherit;
    font-weight: 500;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.04);
    color: rgba(255,255,255,0.45);
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.1s;
    line-height: 1;
    white-space: nowrap;
}
.skill-chip:hover {
    background: rgba(255,255,255,0.09);
    color: rgba(255,255,255,0.75);
    border-color: rgba(255,255,255,0.2);
}
.skill-chip:active { transform: scale(0.95); }

/* ── Estado activo (seleccionado) ── */
.skill-chip.skill-chip-active {
    background: rgba(99,179,237,0.15);
    border-color: rgba(99,179,237,0.5);
    color: #bee3f8;
}
.skill-chip.skill-chip-active:hover {
    background: rgba(99,179,237,0.22);
}

/* Chips HMB activos → verde */
[data-category="hmb"].skill-chip-active {
    background: rgba(104,211,145,0.15);
    border-color: rgba(104,211,145,0.45);
    color: #c6f6d5;
}
/* Chips HMA activos → naranja */
[data-category="hma"].skill-chip-active {
    background: rgba(246,173,85,0.15);
    border-color: rgba(246,173,85,0.45);
    color: #feebc8;
}

/* ── Chips recomendadas (★) — borde sutil dorado cuando inactivas ── */
.skill-chip.skill-chip-rec:not(.skill-chip-active) {
    border-color: rgba(246,173,85,0.2);
    color: rgba(255,255,255,0.55);
}

/* ==========================================================================
   SPRINT 6 — LOGIN WALL · PANTALLA DE AUTENTICACIÓN COMPLETA
   Cubre la interfaz hasta que el usuario se autentica.
   ========================================================================== */

/* ── Contenedor principal ── */
.login-screen {
    position: fixed;
    inset: 0;
    z-index: 9000;
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    background: var(--bg-primary, #0a0f1e);
    opacity: 0;
    transition: opacity 0.35s ease;
    overflow: hidden;
}
.login-screen.login-screen-visible {
    opacity: 1;
}

/* Animación de entrada de la app tras login */
.app-container.app-fade-in {
    animation: appFadeIn 0.4s ease forwards;
}
@keyframes appFadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Decoración de fondo ── */
.login-bg-decor {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}
.login-bg-circle {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.12;
}
.login-bg-c1 {
    width: 600px; height: 600px;
    background: #1a7340;
    top: -150px; left: -100px;
}
.login-bg-c2 {
    width: 500px; height: 500px;
    background: #63b3ed;
    bottom: -100px; right: -80px;
}
.login-bg-c3 {
    width: 350px; height: 350px;
    background: #9f7aea;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
}

/* ── Card de login ── */
.login-card {
    position: relative;
    z-index: 1;
    width: min(420px, 92vw);
    background: rgba(255,255,255,0.035);
    border: 1px solid rgba(255,255,255,0.09);
    border-radius: 20px;
    padding: 2.25rem 2rem;
    backdrop-filter: blur(24px);
    box-shadow:
        0 0 0 1px rgba(255,255,255,0.04),
        0 24px 64px rgba(0,0,0,0.55),
        0 4px 16px rgba(0,0,0,0.3);
    animation: loginCardIn 0.45s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
@keyframes loginCardIn {
    from { opacity: 0; transform: translateY(24px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ── Branding ── */
.login-brand {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    margin-bottom: 0;
}
.login-logo-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #1a7340 0%, #2ecc71 100%);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 4px 16px rgba(26, 115, 64, 0.4);
}
.login-logo-icon svg {
    width: 26px;
    height: 26px;
    color: #ffffff;
}
.login-brand-name {
    font-family: 'Outfit', sans-serif;
    font-size: 1.5rem;
    font-weight: 800;
    color: #ffffff;
    margin: 0;
    line-height: 1.1;
    letter-spacing: -0.01em;
}
.login-brand-name span {
    color: #2ecc71;
}
.login-brand-sub {
    font-size: 0.72rem;
    color: rgba(255,255,255,0.45);
    margin: 0.2rem 0 0;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.login-divider {
    height: 1px;
    background: rgba(255,255,255,0.07);
    margin: 1.5rem 0;
}

/* ── Títulos ── */
.login-header-text {
    margin-bottom: 1.25rem;
}
.login-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #ffffff;
    margin: 0 0 0.35rem;
}
.login-subtitle {
    font-size: 0.8rem;
    color: rgba(255,255,255,0.45);
    margin: 0;
    line-height: 1.55;
}

/* ── Error ── */
.login-screen .login-error {
    background: rgba(245,101,101,0.1);
    border: 1px solid rgba(245,101,101,0.3);
    border-radius: 8px;
    padding: 0.6rem 0.875rem;
    font-size: 0.8rem;
    color: #feb2b2;
    margin-bottom: 1rem;
}

/* ── Formulario ── */
.login-form {
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
}
.login-field {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}
.login-label {
    font-size: 0.78rem;
    font-weight: 500;
    color: rgba(255,255,255,0.55);
    display: flex;
    align-items: center;
    gap: 0.35rem;
}
.login-label svg {
    width: 13px;
    height: 13px;
}
.login-input {
    background: rgba(15, 20, 35, 0.7);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 10px;
    padding: 0.7rem 0.875rem;
    color: #ffffff;
    font-size: 0.875rem;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
    width: 100%;
    box-sizing: border-box;
    outline: none;
}
.login-input:focus {
    border-color: rgba(99, 179, 237, 0.5);
    box-shadow: 0 0 0 3px rgba(99, 179, 237, 0.12);
}
.login-input::placeholder {
    color: rgba(255,255,255,0.2);
}

.login-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}
.login-input-wrapper .login-input {
    padding-right: 2.75rem;
}
.login-eye-btn {
    position: absolute;
    right: 0.6rem;
    background: none;
    border: none;
    cursor: pointer;
    color: rgba(255,255,255,0.35);
    padding: 0.25rem;
    display: flex;
    align-items: center;
    transition: color 0.2s;
}
.login-eye-btn:hover { color: #fff; }
.login-eye-btn svg   { width: 16px; height: 16px; }

/* ── Botón principal ── */
.btn-login-primary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, #1a7340 0%, #27ae60 100%);
    border: none;
    border-radius: 10px;
    color: #ffffff;
    font-size: 0.9rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: filter 0.2s, transform 0.15s, box-shadow 0.2s;
    box-shadow: 0 4px 16px rgba(26, 115, 64, 0.35);
    margin-top: 0.25rem;
}
.btn-login-primary:hover:not(:disabled) {
    filter: brightness(1.1);
    box-shadow: 0 6px 20px rgba(26, 115, 64, 0.5);
}
.btn-login-primary:active:not(:disabled) {
    transform: scale(0.98);
}
.btn-login-primary:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}
.btn-login-primary svg {
    width: 16px;
    height: 16px;
}

/* ── Demo hint ── */
.login-demo-hint {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: 1.25rem;
    padding: 0.6rem 0.75rem;
    background: rgba(99, 179, 237, 0.06);
    border: 1px solid rgba(99, 179, 237, 0.15);
    border-radius: 8px;
    font-size: 0.75rem;
    color: rgba(255,255,255,0.45);
    line-height: 1.5;
}
.login-demo-hint svg  { width: 13px; height: 13px; color: #63b3ed; flex-shrink: 0; }
.login-demo-hint strong { color: rgba(255,255,255,0.7); }

/* ── Footer ── */
.login-footer {
    position: relative;
    z-index: 1;
    margin-top: 1.5rem;
    font-size: 0.72rem;
    color: rgba(255,255,255,0.18);
    text-align: center;
}

/* ==========================================================================
   SPRINT 5 — MASTER TENANT CONFIG · GEMINI ENGINE STATUS · TOAST MESSAGES
   ========================================================================== */

/* ── Gemini Engine Status Panel (reemplaza el panel con API key hardcodeada) */
.gemini-engine-panel .api-panel-header {
    justify-content: flex-start;
}

.btn-icon-small {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    padding: 0.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    margin-left: auto;
    transition: color 0.2s, background 0.2s;
}
.btn-icon-small:hover {
    color: var(--text-primary);
    background: rgba(255,255,255,0.08);
}
.btn-icon-small svg {
    width: 14px;
    height: 14px;
}

/* ── Modal: Tenant Config ── */
.tenant-config-card {
    width: min(540px, 96vw);
    max-height: 90vh;
    overflow-y: auto;
}

.modal-title-with-icon {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
}
.modal-title-with-icon svg {
    width: 18px;
    height: 18px;
    color: var(--color-sub-1);
}

/* Config Tabs */
.config-tabs {
    display: flex;
    gap: 0.25rem;
    margin-bottom: 1.25rem;
    border-bottom: 1px solid var(--border-glass);
    padding-bottom: 0.5rem;
}

.config-tab {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    padding: 0.4rem 0.75rem;
    border-radius: 6px 6px 0 0;
    font-size: 0.82rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    transition: color 0.2s, background 0.2s;
}
.config-tab svg {
    width: 13px;
    height: 13px;
}
.config-tab:hover {
    color: var(--text-primary);
    background: rgba(255,255,255,0.05);
}
.config-tab.active {
    color: var(--color-sub-1);
    background: rgba(99, 179, 237, 0.08);
    border-bottom: 2px solid var(--color-sub-1);
}

/* Config Section */
.config-section {
    padding: 0.25rem 0 0.5rem;
}
.config-section-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin: 0 0 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.config-section-title svg {
    width: 14px;
    height: 14px;
    color: var(--color-sub-1);
}
.config-desc {
    font-size: 0.78rem;
    color: var(--text-muted);
    line-height: 1.55;
    margin-bottom: 0.75rem;
}

.config-key-input {
    margin-bottom: 0.6rem;
}
.config-key-input input {
    background: none;
    border: none;
    outline: none;
    color: var(--text-primary);
    padding: 0.5rem;
    font-size: 0.8rem;
    font-family: monospace;
    flex-grow: 1;
    width: 100%;
}
#toggle-tenant-key-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    padding: 0.25rem;
    display: flex;
    align-items: center;
}
#toggle-tenant-key-btn:hover { color: #fff; }

.config-status-line {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.78rem;
    color: var(--text-muted);
    margin: 0;
}

/* Tenant Info rows */
.config-info-row {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-glass);
}
.config-info-row:last-child { border-bottom: none; }
.config-info-label {
    font-size: 0.78rem;
    color: var(--text-muted);
    min-width: 160px;
    flex-shrink: 0;
}
.config-readonly-value {
    font-size: 0.82rem;
    color: var(--text-primary);
    word-break: break-all;
    margin: 0;
}
.config-readonly-value.monospace {
    font-family: monospace;
    font-size: 0.78rem;
    color: var(--color-sub-1);
}

/* ── Toast Messages ── */
.toast-message {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 9999;
    padding: 0.7rem 1.25rem;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    box-shadow: 0 4px 16px rgba(0,0,0,0.4);
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.25s ease, transform 0.25s ease;
    pointer-events: none;
    max-width: 360px;
}
.toast-message.toast-visible {
    opacity: 1;
    transform: translateY(0);
}
.toast-success {
    background: rgba(72, 187, 120, 0.15);
    border: 1px solid rgba(72, 187, 120, 0.4);
    color: #9ae6b4;
}
.toast-error {
    background: rgba(245, 101, 101, 0.15);
    border: 1px solid rgba(245, 101, 101, 0.4);
    color: #feb2b2;
}
.toast-info {
    background: rgba(99, 179, 237, 0.12);
    border: 1px solid rgba(99, 179, 237, 0.3);
    color: #bee3f8;
}
.toast-warning {
    background: rgba(246, 173, 85, 0.15);
    border: 1px solid rgba(246, 173, 85, 0.45);
    color: #fbd38d;
}


/* ==========================================================================
   SPRINT B — NUEVOS CONTROLES: AI Suggest · Player Toggle · Chip Heredada
   ========================================================================== */

/* ── Grupo especial: label + toggle switch en línea ── */
.form-group-toggle { padding: 0.6rem 0 0.5rem; }
.toggle-row {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    font-size: 0.78rem;
    font-weight: 500;
    color: rgba(255,255,255,0.7);
    flex: 1;
    cursor: pointer;
    line-height: 1.3;
}
.toggle-row svg { flex-shrink: 0; width: 14px; height: 14px; margin-top: 2px; }
.toggle-row .toggle-hint {
    display: block;
    font-size: 0.65rem;
    font-weight: 400;
    color: rgba(255,255,255,0.35);
    margin-top: 2px;
}
.form-group-toggle > label:first-of-type {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
/* El contenedor flex de toggle-row + switch */
.form-group.form-group-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    border-top: 1px solid rgba(255,255,255,0.06);
    border-bottom: 1px solid rgba(255,255,255,0.06);
    padding: 0.55rem 0;
    margin-bottom: 0.2rem;
}

/* ── Toggle Switch ── */
.toggle-switch { position: relative; display: inline-block; width: 36px; height: 20px; flex-shrink: 0; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
    position: absolute; inset: 0;
    background: rgba(255,255,255,0.1);
    border-radius: 20px;
    transition: background 0.2s;
    cursor: pointer;
    border: 1px solid rgba(255,255,255,0.12);
}
.toggle-slider::before {
    content: '';
    position: absolute;
    width: 14px; height: 14px;
    left: 2px; top: 2px;
    background: rgba(255,255,255,0.5);
    border-radius: 50%;
    transition: transform 0.2s, background 0.2s;
}
.toggle-switch input:checked + .toggle-slider { background: rgba(99,179,237,0.4); border-color: rgba(99,179,237,0.5); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(16px); background: #63b3ed; }

/* ── Label + AI Suggest button ── */
.label-with-ai {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}
.label-with-ai label { margin: 0; }

.btn-ai-suggest {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.25rem 0.6rem;
    font-size: 0.68rem;
    font-weight: 600;
    font-family: inherit;
    background: rgba(246,173,85,0.12);
    border: 1px solid rgba(246,173,85,0.3);
    border-radius: 6px;
    color: #f6ad55;
    cursor: pointer;
    transition: all 0.15s;
    line-height: 1;
}
.btn-ai-suggest svg { width: 11px; height: 11px; }
.btn-ai-suggest:hover { background: rgba(246,173,85,0.22); border-color: rgba(246,173,85,0.5); }
.btn-ai-suggest:disabled { opacity: 0.5; cursor: not-allowed; }

/* Flash verde cuando se sugiere el objetivo */
textarea#objective-input.ai-suggested {
    border-color: rgba(104,211,145,0.6) !important;
    box-shadow: 0 0 0 2px rgba(104,211,145,0.2);
    animation: ai-flash 1.8s ease forwards;
}
@keyframes ai-flash {
    0%   { border-color: rgba(104,211,145,0.8); }
    100% { border-color: rgba(255,255,255,0.15); }
}

/* ── Chips heredadas (de etapas anteriores) ── */
.skill-chip.skill-chip-inherited {
    opacity: 0.6;
    border-style: dashed;
    font-style: italic;
}
.skill-chip.skill-chip-inherited:hover { opacity: 0.9; }
.chip-stage-tag {
    font-size: 0.6rem;
    font-weight: 700;
    opacity: 0.65;
    margin-right: 0.3rem;
    background: rgba(255,255,255,0.08);
    border-radius: 3px;
    padding: 0.05rem 0.25rem;
    font-style: normal;
}

/* ==========================================================================
   SPRINT B — CALENDARIO HISTÓRICO DE SESIONES
   ========================================================================== */

/* ── Loading state ── */
.cal-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    color: rgba(255,255,255,0.4);
    font-size: 0.85rem;
    padding: 3rem 1rem;
}
.cal-loading svg { width: 18px; height: 18px; animation: cal-spin 1s linear infinite; }
@keyframes cal-spin { to { transform: rotate(360deg); } }

/* ── Wrapper ── */
.cal-wrapper {
    max-width: 700px;
    margin: 0 auto;
    padding: 1.25rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* ── Cabecera del calendario ── */
.cal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}
.cal-title {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 0.85rem;
    color: rgba(255,255,255,0.5);
    line-height: 1.2;
}
.cal-title strong {
    font-size: 1.2rem;
    font-weight: 700;
    color: rgba(255,255,255,0.9);
}
.cal-nav-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px; height: 34px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.04);
    color: rgba(255,255,255,0.6);
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
}
.cal-nav-btn:hover { background: rgba(255,255,255,0.1); color: #fff; border-color: rgba(255,255,255,0.2); }
.cal-nav-btn svg { width: 16px; height: 16px; }

/* ── Barra de estadísticas del mes ── */
.cal-stats-bar {
    display: flex;
    gap: 1rem;
    justify-content: center;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 10px;
    padding: 0.65rem 1rem;
}
.cal-stat { display: flex; flex-direction: column; align-items: center; gap: 0.15rem; }
.cal-stat-val { font-size: 1.4rem; font-weight: 700; color: #63b3ed; line-height: 1; }
.cal-stat-lbl { font-size: 0.65rem; color: rgba(255,255,255,0.4); text-transform: uppercase; letter-spacing: 0.04em; }

/* ── Encabezados de días de la semana ── */
.cal-grid-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    margin-bottom: 2px;
}
.cal-dow {
    text-align: center;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: rgba(255,255,255,0.3);
    padding: 0.3rem 0;
}

/* ── Grid de días ── */
.cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}
.cal-day {
    min-height: 52px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.06);
    background: rgba(255,255,255,0.02);
    padding: 0.35rem 0.3rem;
    cursor: pointer;
    transition: background 0.12s, border-color 0.12s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
    position: relative;
}
.cal-day:hover { background: rgba(255,255,255,0.06); border-color: rgba(255,255,255,0.14); }
.cal-day-empty { cursor: default; background: transparent; border-color: transparent; }
.cal-day-empty:hover { background: transparent; border-color: transparent; }
.cal-day-num {
    font-size: 0.75rem;
    font-weight: 600;
    color: rgba(255,255,255,0.55);
    line-height: 1;
}
.cal-today { border-color: rgba(99,179,237,0.45); background: rgba(99,179,237,0.06); }
.cal-today .cal-day-num { color: #63b3ed; }
.cal-has-sessions { border-color: rgba(255,255,255,0.12); }
.cal-selected {
    border-color: rgba(246,173,85,0.5) !important;
    background: rgba(246,173,85,0.08) !important;
}
.cal-selected .cal-day-num { color: #f6ad55; }

/* ── Puntos de sesiones en el día ── */
.cal-dots { display: flex; gap: 3px; align-items: center; flex-wrap: wrap; justify-content: center; }
.cal-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.cal-more { font-size: 0.55rem; color: rgba(255,255,255,0.4); line-height: 1; }

/* ── Panel de detalle del día ── */
#cal-day-detail { min-height: 40px; }
.cal-detail-empty {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: rgba(255,255,255,0.3);
    font-size: 0.8rem;
    padding: 0.75rem 0.25rem;
}
.cal-detail-empty svg { width: 16px; height: 16px; }
.cal-detail-panel {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    padding-top: 0.5rem;
}
.cal-detail-header {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: rgba(255,255,255,0.7);
    border-bottom: 1px solid rgba(255,255,255,0.08);
    padding-bottom: 0.5rem;
}
.cal-detail-header svg { width: 14px; height: 14px; }
.cal-session-card {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.07);
    border-left: 3px solid #63b3ed;
    border-radius: 8px;
    padding: 0.65rem 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}
.cal-session-header { display: flex; align-items: center; justify-content: space-between; }
.cal-session-stage { font-size: 0.75rem; font-weight: 700; }
.cal-session-dur {
    font-size: 0.7rem;
    background: rgba(255,255,255,0.07);
    border-radius: 4px;
    padding: 0.1rem 0.4rem;
    color: rgba(255,255,255,0.5);
}
.cal-session-obj { font-size: 0.73rem; color: rgba(255,255,255,0.6); font-style: italic; margin: 0; }
.cal-session-skills { font-size: 0.65rem; color: rgba(255,255,255,0.35); }
.cal-session-meta { font-size: 0.62rem; color: rgba(255,255,255,0.25); margin-top: 0.1rem; }

/* ==========================================================================
   PRINT LAYOUT SHEET (CRITICAL FOR FIELD COACH)
   ========================================================================== */
@media print {
    body {
        background: #ffffff !important;
        color: #000000 !important;
        font-size: 11px;
        line-height: 1.35;
    }
    
    .app-container {
        display: block;
        height: auto;
    }
    
    .sidebar, .main-header .header-actions, .workspace-tabs-container, .modal, .api-key-panel, .players-sidebar, .board-header, .board-legend {
        display: none !important;
    }
    
    .main-content {
        padding: 0;
        background: none !important;
    }
    
    #session-title {
        color: #000000 !important;
        font-size: 1.6rem;
        margin-bottom: 0.5rem;
    }
    
    .dashboard-metrics {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
        margin-bottom: 1.25rem;
    }
    
    .metric-card {
        background: #f1f5f9 !important;
        border: 1px solid #cbd5e1 !important;
        color: #0f172a !important;
        padding: 6px 10px;
    }
    
    .metric-icon {
        display: none !important;
    }
    
    .metric-status {
        color: #0f172a !important;
        font-weight: 700;
    }
    
    .tab-content {
        display: block !important; /* Imprimir todo */
    }
    
    .timeline-layout {
        display: block;
    }
    
    .tactical-board-panel {
        page-break-before: always;
        background: #ffffff !important;
        border: 1px solid #cbd5e1 !important;
        color: #000000 !important;
        margin-top: 20px;
    }
    
    .soccer-pitch {
        background-color: #f8fafc !important;
        border: 1.5px solid #000000 !important;
    }
    
    .timeline-card {
        background: #ffffff !important;
        border: 1px solid #94a3b8 !important;
        border-left: 6px solid #0f172a !important;
        color: #000000 !important;
        page-break-inside: avoid;
        margin-bottom: 12px;
        padding: 10px;
        box-shadow: none !important;
    }
    
    .card-actions-buttons, .action-btn {
        display: none !important;
    }
    
    .provocation-rule-box {
        background: #f8fafc !important;
        border: 1px dashed #94a3b8 !important;
        color: #1e293b !important;
    }
    
    /* Mostrar sección de expertos en el impreso */
    .experts-grid {
        grid-template-columns: 1fr;
        gap: 15px;
        margin-top: 2rem;
        page-break-before: always;
    }
    
    .expert-card {
        background: #ffffff !important;
        border: 1px solid #94a3b8 !important;
        box-shadow: none !important;
        color: #000000 !important;
    }
    
    .expert-card-header {
        border-bottom: 1px solid #cbd5e1 !important;
        padding: 8px;
    }
    
    .expert-card-header h4, .expert-card-body h5 {
        color: #000000 !important;
    }
    
    .placeholder-text {
        display: none !important;
    }
}

/* ════════════════════════════════════════════════════════════
   BACKEND API PANEL + LOGIN MODAL
   Agente: nestjs-api-builder & frontend-expert
   ════════════════════════════════════════════════════════════ */

/* ── Backend API Panel (sidebar) ─────────────────────────── */
.backend-api-panel {
    margin-top: 8px;
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 10px;
}

.backend-env-badge {
    font-size: 9px;
    font-weight: 700;
    background: rgba(255,255,255,0.12);
    color: #94a3b8;
    border-radius: 4px;
    padding: 1px 5px;
    margin-left: auto;
    letter-spacing: 0.04em;
}

.btn-backend-login {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 6px;
    justify-content: center;
    padding: 7px 10px;
    border: 1px solid rgba(26,115,64,0.5);
    border-radius: 6px;
    background: rgba(26,115,64,0.15);
    color: #4ade80;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 6px;
}

.btn-backend-login:hover {
    background: rgba(26,115,64,0.3);
    border-color: #4ade80;
}

.btn-backend-logout {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 6px;
    justify-content: center;
    padding: 5px 10px;
    border: 1px solid rgba(239,68,68,0.3);
    border-radius: 6px;
    background: rgba(239,68,68,0.1);
    color: #f87171;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 6px;
}

.btn-backend-logout:hover { background: rgba(239,68,68,0.2); }

.backend-user-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-top: 4px;
}

.backend-user-info span:first-child {
    font-size: 11px;
    color: #e2e8f0;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.backend-tenant-badge {
    font-size: 9px;
    color: #4ade80;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

/* ── Modal Overlay ───────────────────────────────────────── */
/* ══════════════════════════════════════════════════════════
   MODAL CREAR / EDITAR JUGADORA — más ancho que el login
   ══════════════════════════════════════════════════════════ */
.player-modal-card {
    max-width: 560px !important;
}

/* Cuerpo del formulario — scroll si es muy largo */
.modal-form {
    max-height: 65vh;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.15) transparent;
}

/* Título de sección interna del formulario */
.form-section-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #94a3b8;
    margin: 16px 0 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(255,255,255,0.07);
}
.form-section-title:first-of-type { margin-top: 0; }
.form-section-title i { width: 13px; height: 13px; }

.form-optional-label {
    font-size: 10px;
    font-weight: 400;
    color: #475569;
    text-transform: none;
    letter-spacing: 0;
    margin-left: 4px;
}

/* Grid 2 columnas para campos de formulario */
.form-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
@media (max-width: 480px) {
    .form-grid-2 { grid-template-columns: 1fr; }
}

/* Footer con botones de acción del modal */
.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 14px 20px;
    border-top: 1px solid rgba(255,255,255,0.08);
    background: rgba(0,0,0,0.15);
}

.btn-secondary {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 8px;
    color: #94a3b8;
    cursor: pointer;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: background 0.15s;
}
.btn-secondary:hover { background: rgba(255,255,255,0.1); color: #e2e8f0; }
.btn-secondary i { width: 14px; height: 14px; }

/* ── Selects y inputs dentro del modal ── */
.modal-body select {
    width: 100%;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    color: #e2e8f0;
    padding: 8px 10px;
    font-size: 13px;
    outline: none;
    cursor: pointer;
    transition: border-color 0.15s;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 28px;
}
.modal-body select:focus { border-color: #63b3ed; }
.modal-body select option { background: #1e293b; }

.modal-body input[type="number"],
.modal-body input[type="date"] {
    -moz-appearance: textfield;
}
.modal-body input[type="number"]::-webkit-inner-spin-button,
.modal-body input[type="number"]::-webkit-outer-spin-button { opacity: 0.4; }

.modal-body .form-group input:disabled,
.modal-body .form-group select:disabled { opacity: 0.4; cursor: not-allowed; }

.modal-body .btn.btn-primary { min-width: 140px; }

.modal-body .btn.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ══════════════════════════════════════════════════════════ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: fadeInOverlay 0.15s ease;
}

@keyframes fadeInOverlay {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* ── Login Modal Card ────────────────────────────────────── */
.modal-card {
    background: #1e293b;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 16px;
    width: 100%;
    max-width: 380px;
    padding: 0;
    overflow: hidden;
    box-shadow: 0 24px 64px rgba(0,0,0,0.5);
    animation: slideUpModal 0.2s ease;
}

@keyframes slideUpModal {
    from { transform: translateY(20px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}

.modal-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 18px 20px 14px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.modal-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    font-size: 14px;
    font-weight: 700;
    color: #e2e8f0;
}

.modal-close {
    background: none;
    border: none;
    color: #64748b;
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    transition: color 0.15s;
}

.modal-close:hover { color: #e2e8f0; }

.modal-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.modal-subtitle {
    font-size: 12px;
    color: #64748b;
    line-height: 1.5;
    margin: 0;
}

.login-error {
    background: rgba(239,68,68,0.1);
    border: 1px solid rgba(239,68,68,0.3);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 12px;
    color: #f87171;
}

.modal-hint {
    font-size: 11px;
    color: #475569;
    text-align: center;
    margin: 0;
    padding-top: 4px;
    border-top: 1px solid rgba(255,255,255,0.06);
}

.modal-hint code {
    background: rgba(255,255,255,0.08);
    border-radius: 4px;
    padding: 1px 5px;
    font-size: 10px;
    color: #94a3b8;
}

/* ==========================================================================
   EDITOR DE SKILLS — Sliders de Habilidades Específicas (Radar)
   ========================================================================== */

.skills-edit-panel {
    margin-top: 10px;
    display: none;
    flex-direction: column;
    gap: 6px;
    animation: fadeSlideIn 0.18s ease;
}
.skills-edit-panel.active {
    display: flex;
}
@keyframes fadeSlideIn {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Botón Editar en header de sección */
.btn-edit-toggle {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    font-size: 11px;
    font-weight: 600;
    color: #63b3ed;
    background: rgba(99,179,237,0.08);
    border: 1px solid rgba(99,179,237,0.25);
    border-radius: 20px;
    cursor: pointer;
    transition: background 0.18s, border-color 0.18s, color 0.18s;
    white-space: nowrap;
}
.btn-edit-toggle:hover {
    background: rgba(99,179,237,0.18);
    border-color: rgba(99,179,237,0.55);
}
.btn-edit-toggle.active {
    color: #fc8181;
    background: rgba(252,129,129,0.08);
    border-color: rgba(252,129,129,0.3);
}
.btn-edit-toggle i {
    width: 11px;
    height: 11px;
    pointer-events: none;
}

.skill-edit-row {
    display: grid;
    grid-template-columns: 86px 1fr 22px;
    align-items: center;
    gap: 8px;
}

.skill-edit-label {
    font-size: 11px;
    color: #94a3b8;
    text-align: right;
    white-space: nowrap;
}

.skill-slider {
    width: 100%;
    height: 4px;
    accent-color: #63b3ed;
    cursor: pointer;
    border-radius: 4px;
}

.skill-edit-val {
    font-size: 13px;
    font-weight: 700;
    color: #63b3ed;
    text-align: center;
    min-width: 16px;
}

.skills-edit-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 4px;
}

.btn-save-skills {
    padding: 5px 14px;
    background: rgba(99,179,237,0.1);
    border: 1px solid rgba(99,179,237,0.3);
    border-radius: 8px;
    color: #63b3ed;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: background 0.2s, border-color 0.2s;
    white-space: nowrap;
}

.btn-save-skills:hover:not(:disabled) {
    background: rgba(99,179,237,0.22);
    border-color: rgba(99,179,237,0.55);
}

.btn-save-skills:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.skills-save-msg {
    font-size: 11px;
    min-height: 16px;
}

.skills-save-msg.success { color: #48bb78; }
.skills-save-msg.error   { color: #fc8181; }


/* --- Editor numérico de Biometría --- */
.bio-input {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(99,179,237,0.25);
    border-radius: 6px;
    color: #e2e8f0;
    font-size: 13px;
    font-weight: 600;
    padding: 4px 8px;
    width: 80px;
    text-align: center;
    outline: none;
    transition: border-color 0.2s;
    -moz-appearance: textfield;
}
.bio-input:focus            { border-color: rgba(99,179,237,0.6); }
.bio-input::-webkit-inner-spin-button,
.bio-input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }

/* ══════════════════════════════════════════════════════════════════
   TEAMS SCREEN — Pantalla de selección de equipos post-login
   ══════════════════════════════════════════════════════════════════ */

.teams-screen {
    display: none;
    flex-direction: column;
    min-height: 100vh;
    background: linear-gradient(135deg, #0f0c29, #302b63, #24243e);
    color: #e2e8f0;
    opacity: 0;
    transition: opacity 0.35s ease;
}
.teams-screen.teams-screen-visible {
    opacity: 1;
}

/* Header */
.teams-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 2rem;
    background: rgba(255,255,255,0.05);
    border-bottom: 1px solid rgba(255,255,255,0.08);
    backdrop-filter: blur(8px);
}
.teams-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    flex: 1;
    color: #fff;
}
.teams-brand .highlight { color: #63b3ed; }
.teams-brand i          { color: #f6ad55; }
.teams-tenant-badge {
    font-size: 0.8rem;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    background: rgba(99,179,237,0.15);
    border: 1px solid rgba(99,179,237,0.3);
    color: #63b3ed;
    font-weight: 600;
}
.btn-teams-logout {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 1rem;
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 8px;
    color: #a0aec0;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}
.btn-teams-logout:hover { background: rgba(245,101,101,0.2); color: #fc8181; }

/* Body */
.teams-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 3rem 2rem 4rem;
}
.teams-title {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 1.8rem;
    font-weight: 700;
    color: #fff;
    margin: 0 0 0.5rem;
}
.teams-title i { color: #f6ad55; }
.teams-subtitle {
    color: #a0aec0;
    font-size: 0.95rem;
    margin: 0 0 2.5rem;
}

/* Grid de equipos */
.teams-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.25rem;
    width: 100%;
    max-width: 900px;
}

/* Tarjeta de equipo */
.team-card {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 16px;
    padding: 1.5rem;
    cursor: pointer;
    transition: transform 0.2s, background 0.2s, border-color 0.2s;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.team-card:hover {
    transform: translateY(-3px);
    background: rgba(99,179,237,0.1);
    border-color: rgba(99,179,237,0.4);
}
.team-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.team-card-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, #63b3ed, #4299e1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
}
.team-card-category {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.2rem 0.65rem;
    border-radius: 999px;
    background: rgba(246,173,85,0.15);
    border: 1px solid rgba(246,173,85,0.3);
    color: #f6ad55;
}
.team-card-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
    margin: 0;
}
.team-card-meta {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}
.team-meta-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.82rem;
    color: #a0aec0;
}
.team-meta-item i { width: 14px; height: 14px; }
.btn-team-enter {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.55rem;
    border-radius: 10px;
    background: linear-gradient(135deg, #4299e1, #3182ce);
    color: #fff;
    font-weight: 600;
    font-size: 0.88rem;
    border: none;
    cursor: pointer;
    transition: opacity 0.2s;
    margin-top: auto;
}
.btn-team-enter:hover { opacity: 0.85; }

/* ── PIZARRA TÁCTICA — MODO ANIMACIÓN ─────────────────────── */
.board-header-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.board-view-toggle {
    display: flex;
    gap: 0.35rem;
    flex-shrink: 0;
}

.board-toggle-btn {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.75rem;
    font-size: 0.78rem;
    font-weight: 500;
    border-radius: 8px;
    border: 1px solid var(--border-glass);
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.18s;
}
.board-toggle-btn i { width: 14px; height: 14px; }
.board-toggle-btn:hover { border-color: var(--color-accent); color: var(--color-accent); }
.board-toggle-btn.active {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    border-color: #6366f1;
    color: #fff;
    box-shadow: 0 2px 10px rgba(99,102,241,0.35);
}

.tactical-anim-canvas {
    width: 100%;
    height: auto;
    border: 1px solid var(--border-glass-hover);
    border-radius: 8px;
    background: #0d1c33;
    display: block;
}

.anim-status-bar {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem 0.85rem;
    background: rgba(99,102,241,0.12);
    border: 1px solid rgba(99,102,241,0.3);
    border-radius: 8px;
    font-size: 0.8rem;
    color: #a5b4fc;
}

.anim-spinner {
    width: 14px; height: 14px;
    border: 2px solid #a5b4fc;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

.anim-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.5rem;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border-glass);
    border-radius: 10px;
}

.anim-ctrl-btn {
    width: 30px; height: 30px;
    border-radius: 7px;
    border: 1px solid var(--border-glass);
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    transition: all 0.15s;
}
.anim-ctrl-btn i { width: 14px; height: 14px; }
.anim-ctrl-btn:hover { background: rgba(99,102,241,0.18); color: #a5b4fc; border-color: #6366f1; }
.anim-ctrl-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.anim-export-btn { margin-left: auto; }

.anim-progress {
    flex: 1;
    height: 5px;
    background: rgba(255,255,255,0.1);
    border-radius: 3px;
    overflow: hidden;
}
.anim-progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #6366f1, #8b5cf6);
    border-radius: 3px;
    transition: width 0.1s linear;
}

.anim-time {
    font-size: 0.75rem;
    color: var(--text-muted);
    min-width: 28px;
    text-align: right;
}

.anim-disclaimer {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-align: center;
    margin: 0;
    opacity: 0.7;
}

.teams-empty {
    grid-column: 1 / -1;
    text-align: center;
    color: #718096;
    padding: 3rem;
    font-size: 0.95rem;
}

/* Header breadcrumb */
#header-breadcrumb {
    font-size: 0.82rem;
    color: #a0aec0;
    padding: 0.2rem 0.6rem;
    border-radius: 6px;
    background: rgba(255,255,255,0.05);
}

/* ══════════════════════════════════════════════════════════════════
   PANEL DE ADMINISTRACIÓN — Gestión de Equipos y Usuarios
   ══════════════════════════════════════════════════════════════════ */

/* Botón "Administrar" en el header de equipos */
.btn-admin-panel {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.15s;
}
.btn-admin-panel:hover { opacity: 0.88; transform: translateY(-1px); }
.btn-admin-panel i { width: 15px; height: 15px; }

/* Pantalla principal del panel admin */
.admin-screen {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: var(--bg-primary, #0f172a);
    color: var(--text-primary, #e2e8f0);
    opacity: 0;
    transition: opacity 0.3s ease;
}
.admin-screen.admin-screen-visible { opacity: 1; }

/* Header del panel admin */
.admin-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 2rem;
    background: rgba(255,255,255,0.04);
    border-bottom: 1px solid rgba(255,255,255,0.08);
    flex-wrap: wrap;
}
.admin-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.1rem;
    font-weight: 700;
    color: #e2e8f0;
}
.admin-brand i { color: #6366f1; width: 22px; height: 22px; }
.admin-title {
    flex: 1;
    font-size: 1.15rem;
    font-weight: 600;
    color: #e2e8f0;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.admin-title i { color: #6366f1; width: 20px; height: 20px; }
.admin-header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-left: auto;
}
.btn-admin-back {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.9rem;
    background: rgba(255,255,255,0.08);
    color: #e2e8f0;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-admin-back:hover { background: rgba(255,255,255,0.14); }

/* Nav de secciones */
.admin-nav {
    display: flex;
    gap: 0.25rem;
    padding: 0.75rem 2rem;
    background: rgba(255,255,255,0.02);
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.admin-nav-btn {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.55rem 1.2rem;
    background: transparent;
    color: #94a3b8;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}
.admin-nav-btn:hover { background: rgba(255,255,255,0.06); color: #e2e8f0; }
.admin-nav-btn.active {
    background: linear-gradient(135deg, rgba(99,102,241,0.2), rgba(139,92,246,0.15));
    color: #a5b4fc;
    font-weight: 600;
}
.admin-nav-btn i { width: 16px; height: 16px; }

/* Cuerpo del panel */
.admin-body {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
}
.admin-section { animation: fadeIn 0.3s ease; }

/* Toolbar de sección */
.admin-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
    gap: 0.75rem;
}
.admin-toolbar h2 {
    font-size: 1.05rem;
    font-weight: 600;
    color: #e2e8f0;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.45rem;
}
.admin-toolbar h2 i { color: #6366f1; width: 18px; height: 18px; }
.btn-admin-create {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.55rem 1.1rem;
    background: linear-gradient(135deg, #10b981, #059669);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.15s;
}
.btn-admin-create:hover { opacity: 0.88; transform: translateY(-1px); }
.btn-admin-create i { width: 15px; height: 15px; }

/* Tabla de administración */
.admin-table-wrap {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 12px;
    overflow: hidden;
}
.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}
.admin-table thead th {
    padding: 0.75rem 1rem;
    text-align: left;
    font-weight: 600;
    color: #94a3b8;
    background: rgba(255,255,255,0.04);
    border-bottom: 1px solid rgba(255,255,255,0.08);
    white-space: nowrap;
}
.admin-table tbody tr {
    border-bottom: 1px solid rgba(255,255,255,0.04);
    transition: background 0.15s;
}
.admin-table tbody tr:last-child { border-bottom: none; }
.admin-table tbody tr:hover { background: rgba(255,255,255,0.04); }
.admin-table td {
    padding: 0.75rem 1rem;
    color: #cbd5e1;
    vertical-align: middle;
}
.admin-table td strong { color: #e2e8f0; }

/* Badges de rol */
.role-badge {
    display: inline-block;
    padding: 0.18rem 0.55rem;
    border-radius: 5px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.role-badge-ADMIN    { background: rgba(99,102,241,0.2);  color: #a5b4fc; }
.role-badge-COACH    { background: rgba(245,158,11,0.2);  color: #fbbf24; }
.role-badge-TRAINER  { background: rgba(16,185,129,0.2);  color: #34d399; }
.role-badge-DOCTOR   { background: rgba(239,68,68,0.2);   color: #f87171; }
.role-badge-ASSISTANT_COACH { background: rgba(59,130,246,0.2); color: #93c5fd; }
.role-badge-SUPERADMIN { background: rgba(168,85,247,0.2); color: #c084fc; }

.status-badge-active   { color: #34d399; font-size: 0.8rem; }
.status-badge-inactive { color: #f87171; font-size: 0.8rem; }

/* Botones de acción en tabla */
.btn-tbl {
    padding: 0.3rem 0.65rem;
    border-radius: 6px;
    border: none;
    font-size: 0.78rem;
    font-weight: 500;
    cursor: pointer;
    transition: opacity 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}
.btn-tbl i { width: 13px; height: 13px; }
.btn-tbl:hover { opacity: 0.8; }
.btn-tbl-edit   { background: rgba(99,102,241,0.2);  color: #a5b4fc; }
.btn-tbl-staff  { background: rgba(16,185,129,0.2);  color: #34d399; }
.btn-tbl-delete { background: rgba(239,68,68,0.15);  color: #f87171; }

/* Modal admin */
.admin-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(4px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    animation: fadeIn 0.2s ease;
}
.admin-modal {
    background: #1e293b;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 16px;
    padding: 2rem;
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.25s ease;
}
.admin-modal h3 {
    font-size: 1.05rem;
    font-weight: 600;
    color: #e2e8f0;
    margin: 0 0 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.admin-modal h3 i { color: #6366f1; width: 18px; height: 18px; }
.admin-form-group {
    margin-bottom: 1rem;
}
.admin-form-group label {
    display: block;
    font-size: 0.82rem;
    font-weight: 500;
    color: #94a3b8;
    margin-bottom: 0.35rem;
}
.admin-form-group input,
.admin-form-group select {
    width: 100%;
    padding: 0.6rem 0.85rem;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    color: #e2e8f0;
    font-size: 0.88rem;
    outline: none;
    transition: border-color 0.2s;
    box-sizing: border-box;
}
.admin-form-group input:focus,
.admin-form-group select:focus {
    border-color: #6366f1;
}
.admin-form-group select option { background: #1e293b; }
.admin-modal-footer {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
}
.btn-modal-cancel {
    padding: 0.55rem 1.1rem;
    background: rgba(255,255,255,0.06);
    color: #94a3b8;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-modal-cancel:hover { background: rgba(255,255,255,0.1); }
.btn-modal-save {
    padding: 0.55rem 1.3rem;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
}
.btn-modal-save:hover { opacity: 0.88; }
.btn-modal-save:disabled { opacity: 0.5; cursor: not-allowed; }

/* Staff list en modal */
.staff-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
}
.staff-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem 0.85rem;
    background: rgba(255,255,255,0.04);
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.06);
}
.staff-item-info {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.85rem;
    color: #cbd5e1;
}
.admin-empty {
    text-align: center;
    padding: 2.5rem;
    color: #64748b;
    font-size: 0.9rem;
}
.admin-error-msg {
    color: #f87171;
    font-size: 0.82rem;
    margin-top: 0.5rem;
    display: none;
}

/* ══════════════════════════════════════════════════════════════════
   PANEL MASTER — SUPERADMIN GLOBAL
   ══════════════════════════════════════════════════════════════════ */

/* ── Pantalla principal ───────────────────────────────────────── */
.master-screen {
    position: fixed;
    inset: 0;
    background: #0f172a;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 200;
}

/* ── Header ───────────────────────────────────────────────────── */
.master-header {
    background: #1e293b;
    border-bottom: 1px solid #334155;
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    min-height: 56px;
    flex-shrink: 0;
}
.master-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #e2e8f0;
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}
.master-brand .highlight {
    color: #a78bfa;
}
.master-badge {
    background: linear-gradient(135deg, #7c3aed, #a78bfa);
    color: #fff;
    font-size: 0.6rem;
    font-weight: 800;
    padding: 0.1rem 0.45rem;
    border-radius: 4px;
    letter-spacing: 0.05em;
    vertical-align: middle;
    margin-left: 0.2rem;
}
.master-title {
    flex: 1;
    font-size: 0.95rem;
    font-weight: 600;
    color: #94a3b8;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin: 0;
}
.master-header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.master-user-badge {
    background: #334155;
    color: #94a3b8;
    padding: 0.25rem 0.7rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

/* ── Nav tabs ─────────────────────────────────────────────────── */
.master-nav {
    background: #1e293b;
    border-bottom: 1px solid #334155;
    display: flex;
    gap: 0;
    padding: 0 1rem;
    flex-shrink: 0;
}
.master-nav-btn {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.75rem 1.1rem;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: #64748b;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: color .15s, border-color .15s;
    margin-bottom: -1px;
}
.master-nav-btn:hover {
    color: #cbd5e1;
}
.master-nav-btn.active {
    color: #a78bfa;
    border-bottom-color: #a78bfa;
}
.master-nav-btn i { width: 16px; height: 16px; }

/* ── Body / tab area ──────────────────────────────────────────── */
.master-body {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
}
.master-tab-content { display: flex; flex-direction: column; gap: 1.5rem; }

/* ── Stats grid ───────────────────────────────────────────────── */
.master-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}
.mstat-card {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 12px;
    padding: 1.1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}
.mstat-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #fff;
}
.mstat-icon i { width: 22px; height: 22px; }
.mstat-info { display: flex; flex-direction: column; }
.mstat-value { font-size: 1.5rem; font-weight: 800; color: #e2e8f0; line-height: 1; }
.mstat-label { font-size: 0.75rem; color: #64748b; margin-top: 0.2rem; }

/* ── Section card ─────────────────────────────────────────────── */
.master-section-card {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
}
.master-section-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #e2e8f0;
    display: flex;
    align-items: center;
    gap: 0.45rem;
    margin: 0 0 1rem 0;
}
.master-section-title i { width: 18px; height: 18px; color: #a78bfa; }

/* ── Toolbar ─────────────────────────────────────────────────── */
.master-tab-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 12px;
    padding: 1rem 1.25rem;
}
.master-tab-toolbar .master-section-title { margin: 0; }
.master-filter-row { display: flex; gap: 0.5rem; flex-wrap: wrap; }

/* ── Buttons ─────────────────────────────────────────────────── */
.master-btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, #7c3aed, #a78bfa);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity .15s, transform .1s;
}
.master-btn-primary:hover { opacity: 0.9; transform: translateY(-1px); }
.master-btn-primary:active { transform: translateY(0); }
.master-btn-primary i { width: 14px; height: 14px; }

.master-btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.5rem 1rem;
    background: #334155;
    color: #94a3b8;
    border: none;
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s;
}
.master-btn-secondary:hover { background: #475569; color: #e2e8f0; }
.master-btn-secondary i { width: 14px; height: 14px; }

.master-btn-sm {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.3rem 0.65rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: opacity .15s;
}
.master-btn-sm:hover { opacity: 0.8; }
.master-btn-sm.btn-edit       { background: #1e3a5f; color: #60a5fa; }
.master-btn-sm.btn-users      { background: rgba(16,185,129,.15); color: #34d399; }
.master-btn-sm.btn-ia         { background: rgba(245,158,11,.15); color: #fbbf24; }
.master-btn-sm.btn-assign     { background: rgba(124,58,237,.2); color: #a78bfa; }
.master-btn-sm.btn-toggle-on  { background: rgba(5,150,105,.2); color: #34d399; }
.master-btn-sm.btn-toggle-off { background: rgba(220,38,38,.15); color: #f87171; }
.master-btn-sm.btn-danger { background: rgba(220,38,38,.15); color: #f87171; }
.master-btn-sm i { width: 12px; height: 12px; }

/* ── Table ───────────────────────────────────────────────────── */
.master-table-wrap {
    overflow-x: auto;
    border-radius: 10px;
    border: 1px solid #334155;
}
.master-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.83rem;
}
.master-table thead tr { background: #0f172a; }
.master-table th {
    padding: 0.65rem 1rem;
    text-align: left;
    font-size: 0.72rem;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
    border-bottom: 1px solid #334155;
}
.master-table td {
    padding: 0.65rem 1rem;
    color: #cbd5e1;
    border-bottom: 1px solid #1e293b;
    vertical-align: middle;
}
.master-table tbody tr:last-child td { border-bottom: none; }
.master-table tbody tr:hover td { background: rgba(255,255,255,.03); }
.master-table-empty {
    text-align: center;
    color: #475569;
    padding: 2rem !important;
    font-size: 0.85rem;
}

/* ── Badges ──────────────────────────────────────────────────── */
.master-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.2rem 0.55rem;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.master-status-badge.active   { background: rgba(5,150,105,.2);   color: #34d399; }
.master-status-badge.inactive { background: rgba(100,116,139,.2); color: #94a3b8; }
.master-status-badge.trial    { background: rgba(217,119,6,.2);   color: #fbbf24; }
.master-status-badge.expired  { background: rgba(220,38,38,.15);  color: #f87171; }
.master-status-badge.suspended{ background: rgba(220,38,38,.2);   color: #f87171; }

.master-plan-badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 5px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}
.plan-badge-trial      { background: rgba(100,116,139,.3); color: #94a3b8; }
.plan-badge-basic      { background: rgba(59,130,246,.2);  color: #60a5fa; }
.plan-badge-standard   { background: rgba(124,58,237,.2);  color: #a78bfa; }
.plan-badge-premium    { background: rgba(217,119,6,.2);   color: #fbbf24; }
.plan-badge-enterprise { background: rgba(5,150,105,.2);   color: #34d399; }
.plan-badge-none       { background: rgba(100,116,139,.15); color: #64748b; }

/* ── Plan distribution grid ───────────────────────────────────── */
.master-plan-dist-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.75rem;
}
.master-plan-dist-card {
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 8px;
    padding: 0.85rem 1rem;
    text-align: center;
}
.master-plan-dist-count {
    font-size: 2rem;
    font-weight: 800;
    color: #a78bfa;
    line-height: 1;
}
.master-plan-dist-label {
    font-size: 0.75rem;
    color: #64748b;
    margin-top: 0.3rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ── Plans grid (pricing cards) ───────────────────────────────── */

/* ══════════════════════════════════════════════════════════════════
   MASTER PANEL — TAB "CONTEXTO IA" (Prompt Template Editor)
   ══════════════════════════════════════════════════════════════════ */

.pt-card { padding: 1.25rem 1.5rem; }
.pt-label { font-size: 0.85rem; font-weight: 600; color: #cbd5e1; margin-bottom: 6px; display: block; }
.pt-hint  { font-size: 0.78rem; color: #64748b; }
.pt-subtitle {
    font-size: 0.95rem; font-weight: 700; color: #e2e8f0;
    display: flex; align-items: center; gap: 6px; margin-bottom: 4px;
}
.pt-subtitle i { width: 16px; height: 16px; }

.pt-textarea {
    width: 100%; box-sizing: border-box;
    resize: vertical; min-height: 90px;
    font-family: 'Fira Mono', 'Courier New', monospace;
    font-size: 0.82rem; line-height: 1.55;
}

/* ── Blocks list ──────────────────────────────────────────────── */
.pt-blocks-list { display: flex; flex-direction: column; gap: 12px; }
.pt-block-item {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 10px;
    padding: 0.9rem 1rem;
}
.pt-block-header {
    display: flex; align-items: center; gap: 8px; margin-bottom: 8px;
}
.pt-block-order {
    width: 28px; height: 28px; border-radius: 6px;
    background: #334155; color: #a78bfa;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 0.8rem; flex-shrink: 0;
}
.pt-block-label { font-weight: 600; color: #e2e8f0; flex: 1; font-size: 0.88rem; }
.pt-block-toggle {
    position: relative; width: 40px; height: 22px; flex-shrink: 0;
}
.pt-block-toggle input { opacity: 0; width: 0; height: 0; }
.pt-block-toggle .slider {
    position: absolute; inset: 0; background: #334155;
    border-radius: 22px; cursor: pointer; transition: background .2s;
}
.pt-block-toggle .slider:before {
    content: ''; position: absolute;
    width: 16px; height: 16px; left: 3px; top: 3px;
    background: #94a3b8; border-radius: 50%; transition: .2s;
}
.pt-block-toggle input:checked + .slider { background: #7c3aed; }
.pt-block-toggle input:checked + .slider:before { transform: translateX(18px); background: #fff; }

.pt-block-textarea {
    width: 100%; box-sizing: border-box;
    background: #0f172a; color: #e2e8f0;
    border: 1px solid #334155; border-radius: 7px;
    padding: 8px 10px; font-size: 0.8rem; line-height: 1.5;
    font-family: 'Fira Mono', 'Courier New', monospace;
    resize: vertical; min-height: 72px; transition: border-color .2s;
}
.pt-block-textarea:focus { outline: none; border-color: #7c3aed; }

/* ── Output schema ────────────────────────────────────────────── */
.pt-schema-list { display: flex; flex-direction: column; gap: 6px; }
.pt-schema-row {
    display: flex; align-items: center; gap: 8px;
}
.pt-schema-key {
    width: 180px; flex-shrink: 0;
    background: #0f172a; color: #a78bfa;
    border: 1px solid #334155; border-radius: 6px;
    padding: 6px 9px; font-family: 'Fira Mono', monospace;
    font-size: 0.78rem;
}
.pt-schema-val {
    flex: 1;
    background: #0f172a; color: #e2e8f0;
    border: 1px solid #334155; border-radius: 6px;
    padding: 6px 9px; font-size: 0.78rem;
}
.pt-schema-del {
    background: transparent; border: 1px solid #334155; border-radius: 6px;
    color: #ef4444; cursor: pointer; padding: 5px 7px; transition: background .15s;
}
.pt-schema-del:hover { background: #450a0a; }

/* ── Variables chips ──────────────────────────────────────────── */
.pt-vars-grid {
    display: flex; flex-wrap: wrap; gap: 6px;
}
.pt-var-chip {
    background: #1e1b4b; color: #a78bfa;
    border: 1px solid #4c1d95; border-radius: 5px;
    padding: 3px 9px; font-size: 0.75rem;
    font-family: 'Fira Mono', 'Courier New', monospace;
    cursor: default; user-select: all;
}
.pt-var-chip:hover { background: #2e1065; }

/* ── Status bar ───────────────────────────────────────────────── */
.pt-status-bar {
    padding: 10px 14px; border-radius: 8px;
    font-size: 0.83rem; font-weight: 600;
}
.pt-status-bar.success { background: #052e16; color: #4ade80; border: 1px solid #166534; }
.pt-status-bar.error   { background: #450a0a; color: #f87171; border: 1px solid #7f1d1d; }

/* ── Modal de confirmación genérico ──────────────────────────── */
.master-modal--sm { max-width: 440px; }

.master-modal-header--warning {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 1.4rem 1.5rem 1rem;
    border-bottom: 1px solid #1e293b;
}
.master-modal-header--warning h3 {
    margin: 0 0 2px;
    font-size: 1rem;
    font-weight: 700;
    color: #f1f5f9;
}

.master-confirm-icon {
    width: 40px; height: 40px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    background: linear-gradient(135deg, #78350f, #d97706);
    color: #fff;
}
.master-confirm-icon i { width: 20px; height: 20px; }
.master-confirm-icon.danger {
    background: linear-gradient(135deg, #7f1d1d, #ef4444);
}
.master-confirm-icon.info {
    background: linear-gradient(135deg, #1e3a5f, #3b82f6);
}

.master-confirm-subtitle {
    margin: 0;
    font-size: 0.75rem;
    color: #64748b;
    font-weight: 400;
}
.master-confirm-body {
    color: #94a3b8;
    font-size: 0.88rem;
    line-height: 1.6;
    margin: 0;
}

.master-btn-danger {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 16px; border-radius: 8px; border: none;
    background: linear-gradient(135deg, #dc2626, #ef4444);
    color: #fff; font-size: 0.85rem; font-weight: 600;
    cursor: pointer; transition: opacity .15s;
}
.master-btn-danger:hover { opacity: .85; }
.master-btn-danger i { width: 15px; height: 15px; }

.master-plans-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1rem;
}
.master-plan-card {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 14px;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    position: relative;
}
.master-plan-card.plan-inactive { opacity: 0.55; }
.master-plan-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.5rem;
}
.master-plan-card-name {
    font-size: 1rem;
    font-weight: 800;
    color: #e2e8f0;
}
.master-plan-card-code {
    font-size: 0.7rem;
    color: #64748b;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-top: 0.15rem;
}
.master-plan-card-price {
    display: flex;
    align-items: baseline;
    gap: 0.25rem;
}
.master-plan-card-price .price-amount {
    font-size: 1.4rem;
    font-weight: 800;
    color: #a78bfa;
}
.master-plan-card-price .price-period {
    font-size: 0.75rem;
    color: #64748b;
}
.master-plan-card-limits {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.master-plan-limit-tag {
    background: #0f172a;
    border: 1px solid #334155;
    color: #94a3b8;
    padding: 0.2rem 0.5rem;
    border-radius: 5px;
    font-size: 0.72rem;
}
.master-plan-card-desc {
    font-size: 0.8rem;
    color: #64748b;
    line-height: 1.5;
    flex: 1;
}
.master-plan-card-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    padding-top: 0.25rem;
    border-top: 1px solid #334155;
}
.master-inactive-overlay {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: rgba(100,116,139,.25);
    color: #64748b;
    border-radius: 6px;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.15rem 0.4rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

/* ── Stages list ─────────────────────────────────────────────── */
.master-stages-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.master-stage-card {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 12px;
    overflow: hidden;
}
.master-stage-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1.1rem;
    cursor: pointer;
    user-select: none;
    transition: background .15s;
}
.master-stage-header:hover { background: rgba(255,255,255,.03); }
.master-stage-dot {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 800;
    flex-shrink: 0;
    background: linear-gradient(135deg, #7c3aed, #a78bfa);
    color: #fff;
}
.master-stage-info { flex: 1; }
.master-stage-name {
    font-size: 0.9rem;
    font-weight: 700;
    color: #e2e8f0;
}
.master-stage-meta {
    font-size: 0.75rem;
    color: #64748b;
    margin-top: 0.15rem;
}
.master-stage-chevron {
    color: #475569;
    transition: transform .2s;
    width: 18px;
    height: 18px;
}
.master-stage-card.open .master-stage-chevron { transform: rotate(180deg); }
.master-stage-body {
    display: none;
    border-top: 1px solid #334155;
    padding: 1rem 1.1rem;
}
.master-stage-card.open .master-stage-body { display: block; }
.master-stage-contents-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}
.master-contents-list {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}
.master-content-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    background: #0f172a;
    border: 1px solid #1e293b;
    border-radius: 6px;
    padding: 0.5rem 0.7rem;
}
.master-content-type-tag {
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    flex-shrink: 0;
    background: rgba(124,58,237,.2);
    color: #a78bfa;
}
.master-content-title { flex: 1; font-size: 0.82rem; color: #cbd5e1; }
.master-content-actions { display: flex; gap: 0.25rem; }

/* ── Select / Input ──────────────────────────────────────────── */
.master-select {
    background: #0f172a;
    border: 1px solid #334155;
    color: #94a3b8;
    padding: 0.4rem 0.7rem;
    border-radius: 6px;
    font-size: 0.8rem;
    cursor: pointer;
}
.master-select:focus { outline: none; border-color: #7c3aed; }

/* ── Modal overlay ────────────────────────────────────────────── */
.master-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.65);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9000;
    padding: 1rem;
}
.master-modal {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 14px;
    width: 100%;
    max-width: 480px;
    max-height: 92vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}
.master-modal-wide { max-width: 640px; }
.master-modal-xl   { max-width: 860px; }
.master-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #334155;
    flex-shrink: 0;
}
.master-modal-header h3 {
    font-size: 0.95rem;
    font-weight: 700;
    color: #e2e8f0;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin: 0;
}
.master-modal-header h3 i { width: 18px; height: 18px; color: #a78bfa; }
.master-modal-close {
    background: none;
    border: none;
    color: #64748b;
    cursor: pointer;
    padding: 0.25rem;
    display: flex;
    align-items: center;
    border-radius: 4px;
    transition: color .15s;
}
.master-modal-close:hover { color: #e2e8f0; }
.master-modal-close i { width: 18px; height: 18px; }
.master-modal-body {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    flex: 1;
}
.master-modal-footer {
    padding: 0.85rem 1.25rem;
    border-top: 1px solid #334155;
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    flex-shrink: 0;
}
.master-modal-error {
    color: #f87171;
    font-size: 0.82rem;
    background: rgba(220,38,38,.1);
    border: 1px solid rgba(220,38,38,.25);
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
}

/* ── AI Params Guide Modal ─────────────────────────────────────────────── */
.ai-guide-body {
    gap: 0;
    padding: 0;
    overflow-y: auto;
    max-height: 68vh;
}
.ai-guide-section {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #1e293b;
}
.ai-guide-section:last-child { border-bottom: none; }
.ai-guide-section-title {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.78rem;
    font-weight: 700;
    color: #a78bfa;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 0.75rem;
}
.ai-guide-section-title i   { width: 13px; height: 13px; }
.ai-guide-section-title span { font-size: 0.85rem; color: #f6ad55; }
.ai-guide-table { display: flex; flex-direction: column; gap: 0.55rem; }
.ai-guide-row {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    font-size: 0.8rem;
    line-height: 1.55;
    color: #94a3b8;
}
.ai-guide-row strong { color: #e2e8f0; }
.ai-guide-badge {
    flex-shrink: 0;
    font-size: 0.66rem;
    font-weight: 700;
    padding: 0.2rem 0.55rem;
    border-radius: 4px;
    margin-top: 0.15rem;
    white-space: nowrap;
    letter-spacing: 0.03em;
}
.ai-guide-badge--star     { background: rgba(246,173,85,0.15); color: #f6ad55; border: 1px solid rgba(246,173,85,0.3); }
.ai-guide-badge--available{ background: rgba(148,163,184,0.1);  color: #94a3b8; border: 1px solid rgba(148,163,184,0.2); }
.ai-guide-badge--inherited{ background: rgba(99,102,241,0.12);  color: #818cf8; border: 1px solid rgba(99,102,241,0.25); }
.ai-guide-desc {
    font-size: 0.8rem;
    color: #94a3b8;
    line-height: 1.6;
    margin: 0 0 0.65rem;
}
.ai-guide-desc strong { color: #e2e8f0; }
.ai-guide-desc em     { color: #a78bfa; font-style: normal; }
.ai-guide-example {
    background: rgba(167,139,250,0.07);
    border: 1px solid rgba(167,139,250,0.2);
    border-left: 3px solid #a78bfa;
    border-radius: 6px;
    padding: 0.6rem 0.85rem;
    font-size: 0.79rem;
    color: #cbd5e1;
    line-height: 1.55;
}
.ai-guide-example em          { color: #f6ad55; font-style: normal; font-weight: 600; }
.ai-guide-example-label {
    display: inline-block;
    font-size: 0.64rem;
    font-weight: 700;
    color: #a78bfa;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-right: 0.4rem;
}
.ai-guide-tips {
    margin: 0;
    padding-left: 1.35rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.ai-guide-tips li            { font-size: 0.8rem; color: #94a3b8; line-height: 1.55; }
.ai-guide-tips li strong     { color: #e2e8f0; }
.ai-guide-tips li em         { color: #f6ad55; font-style: normal; }

/* ── Form groups ─────────────────────────────────────────────── */
.master-form-group {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}
/* ── Badges de usuario ───────────────────────────────────────── */
.user-role-badge {
    display: inline-block;
    padding: .18rem .55rem;
    border-radius: 4px;
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.user-role-badge.ADMIN   { background: rgba(99,102,241,.2); color: #818cf8; }
.user-role-badge.COACH   { background: rgba(59,130,246,.2); color: #60a5fa; }
.user-role-badge.VIEWER  { background: rgba(100,116,139,.2); color: #94a3b8; }
.user-active-badge {
    display: inline-block;
    padding: .18rem .55rem;
    border-radius: 4px;
    font-size: .72rem;
    font-weight: 700;
}
.user-active-badge.active   { background: rgba(5,150,105,.15); color: #34d399; }
.user-active-badge.inactive { background: rgba(220,38,38,.15); color: #f87171; }
/* Range input para temperature de Gemini */
input[type=range].master-input {
    padding: 0;
    height: 6px;
    cursor: pointer;
    accent-color: #a78bfa;
}

/* ══════════════════════════════════════════════════
   TOKEN USAGE METER — sidebar del motor Gemini S2S
   ══════════════════════════════════════════════════ */
.token-usage-meter {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(255,255,255,0.06);
}
.token-meter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
}
.token-meter-label {
    font-size: 0.72rem;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 3px;
}
.token-meter-label .icon-inline {
    width: 11px;
    height: 11px;
    stroke-width: 2.5;
}
.token-meter-count {
    font-size: 0.72rem;
    font-weight: 700;
    color: #94a3b8;
    font-variant-numeric: tabular-nums;
}
.token-meter-bar-bg {
    height: 5px;
    background: rgba(255,255,255,0.08);
    border-radius: 3px;
    overflow: hidden;
}
.token-meter-bar-fill {
    height: 100%;
    width: 0%;
    border-radius: 3px;
    background: #22c55e;
    transition: width 0.6s ease, background 0.4s ease;
}
.token-meter-bar-fill.pct-medium  { background: #f59e0b; }
.token-meter-bar-fill.pct-high    { background: #ef4444; }
.token-meter-bar-fill.pct-full    { background: #dc2626; animation: token-pulse 1.5s ease infinite; }
@keyframes token-pulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.6; }
}
.token-meter-footer {
    font-size: 0.68rem;
    color: #475569;
    margin-top: 3px;
    text-align: right;
}
/* Bloqueador Gemini cuando se supera el límite */
.gemini-limit-exceeded {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px;
    background: rgba(220,38,38,0.1);
    border: 1px solid rgba(220,38,38,0.25);
    border-radius: 8px;
    text-align: center;
}
.gemini-limit-exceeded strong { color: #f87171; font-size: 0.85rem; }
.gemini-limit-exceeded p { color: #94a3b8; font-size: 0.78rem; margin: 0; }


.master-form-group label {
    font-size: 0.78rem;
    font-weight: 600;
    color: #94a3b8;
}
.master-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}
.master-form-row.cols-3 { grid-template-columns: 1fr 1fr 1fr; }
.master-input {
    background: #0f172a;
    border: 1px solid #334155;
    color: #e2e8f0;
    padding: 0.5rem 0.75rem;
    border-radius: 7px;
    font-size: 0.85rem;
    width: 100%;
    box-sizing: border-box;
    transition: border-color .15s;
}
.master-input:focus { outline: none; border-color: #7c3aed; }
.master-input::placeholder { color: #475569; }
.master-input[readonly] { color: #64748b; cursor: default; }
.master-input-hint {
    font-size: 0.72rem;
    color: #475569;
    margin-top: 0.15rem;
}
textarea.master-input { resize: vertical; min-height: 70px; }

/* ── Toggle Tipo de Tenant (TRAINING / CHAMPIONSHIP) ─────────── */
.master-tenant-type-toggle {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    margin-top: 0.15rem;
}
.master-type-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    padding: 0.85rem 0.5rem;
    background: #0f172a;
    border: 2px solid #334155;
    border-radius: 10px;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Outfit', sans-serif;
}
.master-type-btn i { width: 20px; height: 20px; }
.master-type-btn span { font-size: 0.82rem; font-weight: 700; }
.master-type-btn small { font-size: 0.67rem; color: #475569; }
.master-type-btn:hover {
    border-color: #475569;
    background: rgba(255,255,255,0.03);
    color: #94a3b8;
}
/* Estado activo TRAINING — Cyan */
.master-type-btn.active#btn-type-training {
    border-color: hsl(187, 100%, 42%);
    background: rgba(0, 212, 220, 0.08);
    color: hsl(187, 100%, 60%);
    box-shadow: 0 0 16px rgba(0, 212, 220, 0.15);
}
.master-type-btn.active#btn-type-training small { color: hsl(187, 80%, 50%); }
/* Estado activo CHAMPIONSHIP — Violet */
.master-type-btn.active#btn-type-championship {
    border-color: hsl(262, 83%, 68%);
    background: rgba(124, 58, 237, 0.1);
    color: hsl(262, 100%, 80%);
    box-shadow: 0 0 16px rgba(124, 58, 237, 0.2);
}
.master-type-btn.active#btn-type-championship small { color: hsl(262, 80%, 72%); }

/* Input especial para slug de campeonato — borde Violet */
.master-input-championship {
    border-color: rgba(124, 58, 237, 0.4) !important;
    background: rgba(124, 58, 237, 0.04) !important;
}
.master-input-championship:focus { border-color: hsl(262,83%,68%) !important; }

/* ── Insignias de Tipo Tenant en tabla ───────────────────────── */
.tenant-type-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.18rem 0.55rem;
    border-radius: 5px;
    font-size: 0.67rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
}
.tenant-type-badge.training {
    background: rgba(0, 212, 220, 0.1);
    color: hsl(187, 100%, 60%);
    border: 1px solid rgba(0, 212, 220, 0.25);
}
.tenant-type-badge.championship {
    background: rgba(124, 58, 237, 0.12);
    color: hsl(262, 100%, 78%);
    border: 1px solid rgba(124, 58, 237, 0.3);
}
.tenant-type-badge i { width: 10px; height: 10px; }

/* Enlace de slug público en tabla de tenants */
.tenant-slug-link {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    font-size: 0.72rem;
    color: hsl(262, 100%, 76%);
    text-decoration: none;
    padding: 0.1rem 0.35rem;
    border-radius: 4px;
    background: rgba(124, 58, 237, 0.07);
    transition: background 0.15s;
    margin-top: 0.25rem;
}
.tenant-slug-link:hover { background: rgba(124, 58, 237, 0.15); }
.tenant-slug-link i { width: 10px; height: 10px; }

/* ═══════════════════════════════════════════════════════════════════
   BARRA DE GUARDADO DE SESIÓN — FASE 2
   ═══════════════════════════════════════════════════════════════════ */

.session-save-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.8rem 1.25rem;
    background: rgba(10, 18, 35, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 12px;
    margin-top: 0.75rem;
    gap: 1rem;
    backdrop-filter: blur(8px);
}
.ssb-left {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.84rem;
    color: var(--text-secondary, #94a3b8);
}
.ssb-left svg { width: 15px; height: 15px; flex-shrink: 0; }
.ssb-icon-pending { color: #475569; }
.ssb-icon-ready   { color: #63b3ed; }
.ssb-icon-saved   { color: #68d391; }
.ssb-right { flex-shrink: 0; }

.ssb-btn-save {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.55rem 1.3rem;
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.ssb-btn-save svg { width: 15px; height: 15px; }
.ssb-btn-save:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.45);
}
.ssb-btn-save:active:not(:disabled) { transform: translateY(0); }
.ssb-btn-save:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Confirmación body estilos */
.ssb-confirm-body {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    margin-top: 0.25rem;
}
.ssb-confirm-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.875rem;
    padding: 0.3rem 0;
    border-bottom: 1px solid rgba(255,255,255,0.04);
}
.ssb-confirm-row span  { color: #94a3b8; }
.ssb-confirm-row strong { color: #e2e8f0; font-weight: 600; }
.ssb-confirm-row--highlight strong { color: #63b3ed; }
.ssb-warning-badge {
    padding: 0.45rem 0.75rem;
    background: rgba(251, 191, 36, 0.1);
    border: 1px solid rgba(251, 191, 36, 0.25);
    border-radius: 6px;
    font-size: 0.82rem;
    color: #fbbf24;
    margin-bottom: 0.4rem;
}

/* ═══════════════════════════════════════════════════════════════════
   FILTRO DE ETAPA EN CALENDARIO HISTÓRICO — FASE 3
   ═══════════════════════════════════════════════════════════════════ */

.cal-filter-bar {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 0;
    margin-bottom: 0.25rem;
}
.cal-filter-label {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.8rem;
    color: #64748b;
    white-space: nowrap;
}
.cal-filter-label svg { width: 13px; height: 13px; }
.cal-filter-select {
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid #334155;
    color: #cbd5e1;
    padding: 0.3rem 0.65rem;
    border-radius: 6px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: border-color 0.15s;
    flex: 1;
    max-width: 200px;
}
.cal-filter-select:focus { outline: none; border-color: #6366f1; }

/* ═══════════════════════════════════════════════════════════════════
   MÓDULO DE EVALUACIÓN DE PARTIDOS — PRESTIGIO & GLASSMORPHISM
   ═══════════════════════════════════════════════════════════════════ */

.matches-container {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 1.5rem;
    min-height: 580px;
    height: auto;
}

.matches-sidebar {
    backdrop-filter: blur(12px);
    background: rgba(13, 28, 51, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 1.2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.match-view-panel {
    backdrop-filter: blur(16px);
    background: rgba(13, 28, 51, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 1.5rem;
    min-height: 500px;
}

.evaluation-table {
    width: 100%;
    border-collapse: collapse;
}

.evaluation-table th {
    text-align: left;
    padding: 12px 14px;
    font-family: 'Outfit', sans-serif;
    color: #94a3b8;
    font-size: 0.82rem;
    border-bottom: 2px solid rgba(255, 255, 255, 0.08);
    background: rgba(13, 28, 51, 0.4);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.evaluation-table td {
    padding: 12px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.88rem;
    color: #e2e8f0;
    vertical-align: middle;
}

.evaluation-table tbody tr {
    transition: background 0.2s;
}

.evaluation-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

/* Sliders de Capacidades Core */
.capacity-slider-group {
    background: rgba(13, 28, 51, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.capacity-slider-item {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.capacity-label-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    font-weight: 500;
}

/* Sliders personalizados Conmebol */
.slider-custom {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 8px;
    border-radius: 4px;
    outline: none;
    transition: background 0.3s;
    background: rgba(255, 255, 255, 0.1);
}

/* Colores gradiente para rangos adaptativos */
.slider-custom.slider-tier-low {
    background: linear-gradient(90deg, #ef4444 0%, #f97316 100%) !important;
}

.slider-custom.slider-tier-mid {
    background: linear-gradient(90deg, #f59e0b 0%, #eab308 100%) !important;
}

.slider-custom.slider-tier-high {
    background: linear-gradient(90deg, #10b981 0%, #06b6d4 100%) !important;
}

.slider-custom::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 0 10px rgba(6, 182, 212, 0.8);
    cursor: pointer;
    border: 3px solid #091220;
    transition: transform 0.15s;
}

.slider-custom::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.slider-custom::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 0 10px rgba(6, 182, 212, 0.8);
    cursor: pointer;
    border: 3px solid #091220;
    transition: transform 0.15s;
}

.slider-custom::-moz-range-thumb:hover {
    transform: scale(1.2);
}

/* Items de lista de partidos */
.match-item {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 10px 12px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.match-item:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(99, 102, 241, 0.3);
    transform: translateX(2px);
}

.match-item.active {
    background: rgba(99, 102, 241, 0.1);
    border-color: rgba(99, 102, 241, 0.5);
    box-shadow: inset 3px 0 0 #6366f1;
}

.match-item-title {
    font-weight: 600;
    color: #e2e8f0;
    font-size: 0.9rem;
}

.match-item-meta {
    font-size: 0.75rem;
    color: #94a3b8;
    display: flex;
    justify-content: space-between;
}

/* Estilo para el experto Analista IA */
.expert-card.match-analyst-card {
    border-color: rgba(6, 182, 212, 0.2);
}

.expert-card.match-analyst-card .expert-card-header {
    background: rgba(6, 182, 212, 0.05);
    border-bottom: 1px solid rgba(6, 182, 212, 0.1);
}

.mini-avatar.match-analyst {
    font-weight: 700;
    font-family: 'Outfit', sans-serif;
}

/* ==========================================================================
   EXTENSIONES DE ANALÍTICA Y SEGUIMIENTO EVOLUTIVO DE JUGADORAS (PREMIUM GLOWS)
   ========================================================================== */

/* Sub-pestañas de Navegación */
.matches-subtabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding-bottom: 0.5rem;
    background: rgba(13, 28, 51, 0.2);
    border-radius: 8px 8px 0 0;
    padding: 0.5rem 0.75rem;
}

.subtab-btn {
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-secondary, #94a3b8);
    font-family: var(--font-heading, 'Outfit', sans-serif);
    font-weight: 600;
    font-size: 0.88rem;
    padding: 0.5rem 1rem;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    border-radius: 4px 4px 0 0;
}

.subtab-btn:hover {
    color: var(--text-primary, #ffffff);
    background: rgba(255, 255, 255, 0.03);
}

.subtab-btn.active {
    color: #22d3ee !important;
    font-weight: 700;
    border-bottom: 2px solid #22d3ee;
    text-shadow: 0 0 10px rgba(34, 211, 238, 0.3);
    background: rgba(34, 211, 238, 0.05);
}

/* Rejilla de Subviews */
.matches-subview {
    display: none;
    animation: fadeIn 0.35s ease-out;
}

/* Tarjetas Analíticas con Glow */
.stats-grid .metric-card {
    background: rgba(13, 28, 51, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 1.25rem;
    box-shadow: var(--shadow-soft);
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.stats-grid .metric-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(to bottom, var(--glow-start, #7c3aed), var(--glow-end, #4f46e5));
    border-radius: 4px 0 0 4px;
}

.stats-grid .metric-card:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.15);
    background: rgba(13, 28, 51, 0.6);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4), 0 0 15px rgba(var(--glow-start-rgb, 99, 102, 241), 0.15);
}

/* Indicadores de Goles */
.score-input {
    width: 35px;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    text-align: center;
    color: #fff;
    font-size: 1.15rem;
    font-weight: 700;
    padding: 2px 4px;
    outline: none;
    transition: all 0.2s;
    font-family: monospace;
}

.score-input:focus {
    border-color: #22d3ee;
    background: rgba(15, 23, 42, 0.85);
    box-shadow: 0 0 8px rgba(34, 211, 238, 0.4);
}

/* Barras de Capacidad - Premium Neon Glows */
.capability-bar-container {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    height: 8px;
    overflow: hidden;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.02);
}

.capability-bar-fill {
    height: 100%;
    border-radius: 8px;
    width: 0%;
    transition: width 0.75s cubic-bezier(0.19, 1, 0.22, 1);
}

/* Colores Dinámicos de Capacidades Conmebol */
#track-bar-technical {
    background: linear-gradient(to right, #63b3ed, #3182ce);
    box-shadow: 0 0 10px rgba(99, 179, 237, 0.6);
}

#track-bar-tactical {
    background: linear-gradient(to right, #4299e1, #2b6cb0);
    box-shadow: 0 0 10px rgba(66, 153, 225, 0.6);
}

#track-bar-physical {
    background: linear-gradient(to right, #68d391, #2f855a);
    box-shadow: 0 0 10px rgba(104, 211, 145, 0.6);
}

#track-bar-psychological {
    background: linear-gradient(to right, #f6ad55, #dd6b20);
    box-shadow: 0 0 10px rgba(246, 173, 85, 0.6);
}

#track-bar-personality {
    background: linear-gradient(to right, #b794f4, #6b46c1);
    box-shadow: 0 0 10px rgba(183, 148, 244, 0.6);
}

/* Estilo para tabla de Jugadoras de Seguimiento */
#tracking-players-tbody tr {
    cursor: pointer;
    transition: all 0.2s;
}

#tracking-players-tbody tr:hover {
    background: rgba(99, 102, 241, 0.05);
}

#tracking-players-tbody tr.active-row {
    background: rgba(34, 211, 238, 0.08) !important;
    border-left: 3px solid #22d3ee;
}

#tracking-players-tbody tr.active-row td {
    color: #22d3ee !important;
}

/* Transiciones de Panel Lateral */
#tracking-evolution-panel {
    transition: all 0.3s ease-in-out;
}

/* ==========================================================================
   INTERACCIÓN DRAG & DROP EN CALENDARIO DE HISTORIAL (PREMIUM METRICS)
   ========================================================================== */

/* Arrastrar tarjetas de sesión */
.cal-session-card[draggable="true"] {
    cursor: grab;
    transition: transform 0.2s, box-shadow 0.2s;
}

.cal-session-card[draggable="true"]:active {
    cursor: grabbing;
    transform: scale(0.97);
}

/* Día del calendario como drop target activo */
.cal-day {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.cal-day.cal-drag-over {
    background: rgba(34, 211, 238, 0.12) !important;
    border-color: #22d3ee !important;
    box-shadow: 0 0 15px rgba(34, 211, 238, 0.4), inset 0 0 8px rgba(34, 211, 238, 0.2);
    transform: scale(1.05);
    z-index: 10;
    animation: cal-pulse-drag 1.2s ease-in-out infinite alternate;
}

@keyframes cal-pulse-drag {
    0% {
        box-shadow: 0 0 8px rgba(34, 211, 238, 0.3);
    }
    100% {
        box-shadow: 0 0 18px rgba(34, 211, 238, 0.6);
    }
}

/* ==========================================================================
   FUTBOLFORMATIVO AI - PREMIUM REDESIGN LANDING & DUAL-LOGIN SYSTEM
   ========================================================================== */

/* Variables del Portal Dinámico - LuduSport Brand Themes */
.theme-formative {
    --color-theme-accent: #00f0ff; /* Cyan Eléctrico (LuduSport Formativo) */
    --color-theme-accent-hover: #00d8e6;
    --gradient-theme: linear-gradient(135deg, #00f0ff 0%, #0099ff 100%);
    --glow-theme: 0 0 15px rgba(0, 240, 255, 0.35);
}

.theme-championship {
    --color-theme-accent: #b026ff; /* Violeta Neón (LuduSport Campeonatos) */
    --color-theme-accent-hover: #990ce8;
    --gradient-theme: linear-gradient(135deg, #b026ff 0%, #7c3aed 100%);
    --glow-theme: 0 0 15px rgba(176, 38, 255, 0.35);
}

/* Contenedor Login Dinámico */
.login-screen-dynamic {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow-y: auto;
    background-color: #060913 !important;
    z-index: 9000 !important; /* Asegurar que cubra todo */
}

.landing-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    z-index: 10;
}

/* Header de la Landing */
.landing-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 1rem;
}

.landing-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.landing-logo-icon {
    width: 2.5rem;
    height: 2.5rem;
    background: var(--gradient-theme);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--glow-theme);
    transition: all 0.5s ease;
}

.landing-logo-icon i {
    color: #fff;
    width: 1.3rem;
    height: 1.3rem;
}

.landing-brand-name {
    font-size: 1.6rem;
    font-weight: 800;
    line-height: 1;
    color: #ffffff;
}

.landing-brand-name span {
    background: var(--gradient-theme);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    transition: all 0.5s ease;
}

.landing-brand-sub {
    font-size: 0.75rem;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 0.2rem;
}

.landing-badge-trust {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.75rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 20px;
    font-size: 0.78rem;
    color: #94a3b8;
}

.landing-badge-trust i {
    width: 14px;
    height: 14px;
    color: #10b981;
}

/* Layout Dual en Grid */
.landing-dual-layout {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 2rem;
    align-items: stretch;
}

@media (max-width: 900px) {
    .landing-dual-layout {
        grid-template-columns: 1fr;
    }
}

/* Tarjeta de Promesa de Valor (Izquierda) */
.landing-info-card {
    background: rgba(13, 18, 34, 0.45);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 20px;
    padding: 2.2rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
}

.landing-info-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 6px;
    background: var(--gradient-theme);
    transition: background 0.5s ease;
}

.info-section {
    display: none;
    animation: fadeIn 0.45s ease-out forwards;
}

.info-section.active {
    display: block;
}

.info-tag {
    display: inline-block;
    padding: 0.25rem 0.65rem;
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: 5px;
    letter-spacing: 0.05em;
    margin-bottom: 1.25rem;
}

.tag-green { background: rgba(16, 185, 129, 0.12); color: #34d399; }
.tag-blue { background: rgba(37, 99, 235, 0.12); color: #60a5fa; }

.info-title {
    font-size: 2.1rem;
    font-weight: 800;
    color: #fff;
    line-height: 1.2;
    margin-bottom: 1rem;
    letter-spacing: -0.03em;
}

.info-description {
    font-size: 0.95rem;
    color: #94a3b8;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.info-features {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding-left: 0;
}

.info-features li {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.9rem;
    color: #cbd5e1;
}

.info-features li i {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.txt-green { color: #34d399; }
.txt-blue { color: #60a5fa; }

/* Badges de Autoridad */
.landing-authority-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 1.5rem;
    margin-top: 2rem;
}

.authority-label {
    font-size: 0.72rem;
    color: #64748b;
    font-weight: 700;
    letter-spacing: 0.08em;
    margin-bottom: 0.75rem;
}

.authority-badges {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.auth-badge {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.8rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    font-size: 0.78rem;
    color: #cbd5e1;
}

.auth-badge i {
    width: 14px;
    height: 14px;
    color: var(--color-theme-accent);
    transition: color 0.5s ease;
}

/* Tarjeta de Formulario (Derecha) */
.landing-login-panel {
    background: rgba(13, 18, 34, 0.6);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 20px;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

/* Pestañas Dual-Login */
.dual-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    background: rgba(15, 20, 35, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 0.3rem;
}

.tab-trigger {
    background: none;
    border: none;
    padding: 0.65rem;
    color: #64748b;
    font-size: 0.88rem;
    font-weight: 600;
    border-radius: 9px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

.tab-trigger inherit {
    color: inherit;
}

.tab-trigger i {
    width: 16px;
    height: 16px;
}

.tab-trigger.active {
    background: var(--gradient-theme);
    color: #fff;
    box-shadow: var(--glow-theme);
}

/* Contenido del Formulario */
.login-form-container {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.form-header-context {
    border-left: 3px solid var(--color-theme-accent);
    padding-left: 0.75rem;
    transition: border-color 0.5s ease;
}

.form-context-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: #fff;
    margin: 0;
}

.form-context-sub {
    font-size: 0.78rem;
    color: #94a3b8;
    margin: 0.2rem 0 0;
}

/* Campos de Login */
.login-field {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin-bottom: 0.85rem;
}

.login-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: #cbd5e1;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.login-label i {
    width: 14px;
    height: 14px;
    color: var(--color-theme-accent);
    transition: color 0.5s ease;
}

.login-input {
    width: 100%;
    background-color: rgba(15, 20, 35, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 0.65rem 0.85rem;
    color: #fff;
    font-size: 0.88rem;
    outline: none;
    transition: all 0.25s;
    box-sizing: border-box;
}

.login-input:focus {
    border-color: var(--color-theme-accent);
    box-shadow: 0 0 0 2px rgba(var(--color-theme-accent-rgb), 0.15);
}

.login-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.login-eye-btn {
    position: absolute;
    right: 0.75rem;
    background: none;
    border: none;
    cursor: pointer;
    color: #64748b;
    padding: 0.25rem;
    display: flex;
    align-items: center;
    z-index: 10;
}

.login-eye-btn:hover { color: #fff; }
.login-eye-btn i { width: 16px; height: 16px; }

/* Botón Iniciar Sesión */
.btn-login-primary {
    width: 100%;
    border: none;
    border-radius: 8px;
    padding: 0.8rem 1.25rem;
    background: var(--gradient-theme);
    color: #fff;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    box-shadow: var(--glow-theme);
    transition: all 0.3s ease;
}

.btn-login-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(var(--color-theme-accent-rgb), 0.5);
    filter: brightness(1.15);
}

.btn-login-primary:active {
    transform: translateY(0);
}

.btn-login-primary i {
    width: 1.1rem;
    height: 1.1rem;
}

/* Errores */
.login-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.25);
    color: #f87171;
    font-size: 0.82rem;
    padding: 0.6rem 0.85rem;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    animation: shake 0.35s ease;
}

/* Sección Demo Prefills (Friction Buster) */
.demo-prefill-section {
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 1rem;
}

.demo-title {
    font-size: 0.78rem;
    color: #64748b;
    margin-bottom: 0.6rem;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.demo-title i {
    width: 12px;
    height: 12px;
    color: #fbbf24;
}

.demo-chips-group {
    display: none;
    gap: 0.5rem;
    flex-wrap: wrap;
    animation: fadeIn 0.3s ease-out;
}

.demo-chips-group.active {
    display: flex;
}

.demo-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.75rem;
    background: rgba(16, 185, 129, 0.06);
    border: 1px solid rgba(16, 185, 129, 0.15);
    color: #34d399;
    font-size: 0.78rem;
    font-weight: 600;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s;
}

.demo-chip:hover {
    background: rgba(16, 185, 129, 0.15);
    border-color: rgba(16, 185, 129, 0.4);
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(16, 185, 129, 0.15);
}

.demo-chip.chip-blue {
    background: rgba(37, 99, 235, 0.06);
    border: 1px solid rgba(37, 99, 235, 0.15);
    color: #60a5fa;
}

.demo-chip.chip-blue:hover {
    background: rgba(37, 99, 235, 0.15);
    border-color: rgba(37, 99, 235, 0.4);
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.15);
}

.demo-chip i {
    width: 12px;
    height: 12px;
}

/* Efectos visuales de inyección (Friction Buster Feedback) */
.prefilled-pulse {
    animation: pulseGlow 0.8s ease;
    border-color: var(--color-theme-accent) !important;
}

.chip-active {
    transform: scale(0.95);
    filter: brightness(1.3);
}

/* Footer Global de la Landing */
.landing-footer-global {
    text-align: center;
    font-size: 0.75rem;
    color: #475569;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* Animaciones */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-4px); }
    75% { transform: translateX(4px); }
}

@keyframes pulseGlow {
    0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.6); }
    100% { box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
}

/* ==========================================================================
   FUTBOLFORMATIVO AI - SPRINT 8 — MOBILE-FIRST PORTAL DE DELEGADO & PLANILLERA
   ========================================================================== */

/* Contenedor Móvil del Delegado */
.champ-mobile-container {
    width: 100%;
    max-width: 540px; /* Tamaño ideal de un celular moderno */
    margin: 0 auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    box-sizing: border-box;
}

/* Tarjeta Perfil de Equipo Móvil */
.team-profile-mobile-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 16px;
    padding: 1.2rem;
    backdrop-filter: blur(16px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
}

.team-profile-mobile-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; bottom: 0; width: 4px;
    background: linear-gradient(to bottom, #2563eb, #7c3aed);
}

.mobile-team-shield {
    width: 50px;
    height: 50px;
    background: rgba(37, 99, 235, 0.1);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(37, 99, 235, 0.2);
}

.mobile-team-name {
    font-family: 'Outfit', sans-serif;
    font-size: 1.2rem;
    font-weight: 800;
    color: #ffffff;
    margin: 0;
}

.mobile-team-cat {
    font-size: 0.8rem;
    color: #94a3b8;
    margin: 0.1rem 0 0;
}

.mobile-team-details {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.4rem;
    font-size: 0.82rem;
    color: #cbd5e1;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    padding-top: 10px;
    margin-top: 10px;
}

.mobile-team-details span {
    color: #ffffff;
    font-weight: 500;
}

/* Banner de Estatus de Inscripción */
.chm-banner {
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 0.82rem;
    line-height: 1.4;
    display: flex;
    align-items: center;
    gap: 10px;
    box-sizing: border-box;
}

.chm-banner.success {
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.25);
    color: #34d399;
}

.chm-banner.error {
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.25);
    color: #f87171;
}

/* Listado de Tarjetas de Jugadora (Touch-ready Cards) */
.mobile-roster-list {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.mobile-roster-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 14px;
    padding: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    transition: all 0.2s ease;
}

.mobile-roster-card:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.08);
}

.roster-card-jersey {
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #ffffff;
    font-weight: 700;
    font-size: 1rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.roster-card-content {
    flex-grow: 1;
}

.roster-card-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: #ffffff;
    margin: 0;
}

.roster-card-meta {
    font-size: 0.76rem;
    color: #94a3b8;
    margin-top: 0.2rem;
    display: flex;
    gap: 8px;
    align-items: center;
}

.roster-card-pos {
    background: rgba(37, 99, 235, 0.12);
    color: #60a5fa;
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
}

.roster-card-actions {
    display: flex;
    gap: 8px;
}

.btn-roster-action {
    background: none;
    border: none;
    cursor: pointer;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    transition: all 0.2s;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.btn-roster-action:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
}

.btn-roster-action.edit:hover {
    color: #60a5fa;
    border-color: rgba(96, 165, 250, 0.2);
}

.btn-roster-action.delete:hover {
    color: #f87171;
    border-color: rgba(248, 113, 113, 0.2);
}

.btn-roster-action i {
    width: 14px;
    height: 14px;
}

/* ==========================================================================
   RESPONSIVE MOBILE OVERRIDES FOR PLANILLERA
   ========================================================================== */

@media (max-width: 768px) {
    /* Ocultar barra lateral estática de planillera y adaptarla arriba */
    .planillera-grid {
        grid-template-columns: 1fr !important;
        flex-direction: column;
        gap: 1.5rem;
    }
    
    .planillera-sidebar {
        border-right: none !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.06);
        padding-bottom: 1rem !important;
        max-height: 250px;
        overflow-y: auto;
    }

    .scoreboard-container {
        flex-direction: column !important;
        padding: 2rem 1rem !important;
        gap: 1rem;
        height: auto !important;
        align-items: center;
    }

    .scoreboard-score {
        font-size: 2.5rem !important;
    }
    
    .scoreboard-team {
        width: 100% !important;
        text-align: center;
        flex-direction: column;
    }

    #pla-controls-actions {
        flex-direction: column;
        width: 100%;
        gap: 10px !important;
    }

    #pla-controls-actions .btn {
        width: 100%;
        box-sizing: border-box;
        justify-content: center;
    }
}

/* ==========================================================================
   OPTIMIZACIÓN DEL PORTAL DE DELEGADO (SPRINT 9) — MÉTRICAS Y EDAD
   ========================================================================== */

/* Barra de métricas */
.team-metrics-bar {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 15px;
    box-sizing: border-box;
}

.metric-card {
    position: relative;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 10px 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-sizing: border-box;
}

.metric-card:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.08);
    transform: translateY(-1px);
}

.metric-card i {
    width: 20px;
    height: 20px;
    color: #60a5fa;
    flex-shrink: 0;
}

.metric-info {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.metric-val {
    font-family: 'Outfit', sans-serif;
    font-size: 0.95rem;
    font-weight: 800;
    color: #ffffff;
}

.metric-lbl {
    font-size: 0.65rem;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

/* Tooltips de CSS Premium */
.metric-card[data-tooltip],
.roster-card-age-large[data-tooltip] {
    position: relative;
}

.metric-card[data-tooltip]::after,
.roster-card-age-large[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%) translateY(6px);
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #f1f5f9;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 0.72rem;
    white-space: normal;
    width: 160px;
    text-align: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    line-height: 1.3;
}

.metric-card[data-tooltip]:hover::after,
.roster-card-age-large[data-tooltip]:hover::after {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Badge de Edad Grande Destacada */
.roster-card-age-large {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    padding: 4px;
    min-width: 44px;
    height: 44px;
    text-align: center;
    margin-right: 8px;
    flex-shrink: 0;
    box-sizing: border-box;
    cursor: pointer;
    transition: all 0.2s ease;
}

.roster-card-age-large:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(96, 165, 250, 0.2);
}

.roster-card-age-large .age-num {
    font-family: 'Outfit', sans-serif;
    font-size: 1.15rem;
    font-weight: 800;
    color: #60a5fa;
    line-height: 1.1;
}

.roster-card-age-large .age-lbl {
    font-size: 0.55rem;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 1px;
}

/* Animación de Pulso Verde para Campos Auto-rellenados */
.prefilled-pulse {
    animation: pulseGreenGlow 1.2s ease;
    border-color: #34d399 !important;
    background-color: rgba(16, 185, 129, 0.04) !important;
}

@keyframes pulseGreenGlow {
    0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.6); }
    100% { box-shadow: 0 0 0 10px rgba(16, 185, 129, 0); }
}

/* Corregir scroll bloqueado en el portal de delegado */
#section-championship-team.champ-screen {
    overflow-y: auto !important;
}

/* Chips de Resumen de Equipos en Admin */
.team-summary-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
    margin-bottom: 12px;
}
.team-summary-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    padding: 3px 8px;
    font-size: 0.72rem;
    color: #cbd5e1;
    cursor: pointer;
    transition: all 0.2s ease;
}
.team-summary-chip:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}
/* Re-vincular los tooltips asíncronos para estos chips */
.team-summary-chip[data-tooltip] {
    position: relative;
}
.team-summary-chip[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%) translateY(6px);
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #f1f5f9;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 0.72rem;
    white-space: normal;
    width: 180px;
    text-align: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    line-height: 1.3;
}
.team-summary-chip[data-tooltip]:hover::after {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Bracket Eliminatorio de Copas (Oro y Plata) */
.bracket-line-right {
    width: 25px;
    height: 2px;
    background: rgba(255, 255, 255, 0.08);
    transition: background 0.3s ease;
}
.bracket-line-right.gold {
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.08), #fbbf24);
}
.bracket-line-left {
    width: 25px;
    height: 2px;
    background: rgba(255, 255, 255, 0.08);
}
.bracket-connector-vertical {
    width: 2px;
    height: 120px;
    background: rgba(255, 255, 255, 0.08);
    margin-left: -17px;
    margin-right: 17px;
}
.bracket-match-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.bracket-match-card:hover {
    border-color: rgba(99, 179, 237, 0.3) !important;
    box-shadow: 0 8px 24px rgba(99, 179, 237, 0.1);
    transform: translateY(-2px);
}
@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

/* ==========================================================================
   INTERACCIÓN DRAG & DROP Y TIRA DE FECHAS EN EL FIXTURE (PREMIUM FIXTURE)
   ========================================================================== */

/* Contenedor horizontal de tira de fechas */
#grid-date-strip {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 10px 5px;
    margin-bottom: 1.5rem;
    width: 100%;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 15px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

#grid-date-strip::-webkit-scrollbar {
    height: 4px;
}

#grid-date-strip::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

/* Pastilla individual de día del calendario */
.grid-date-pill {
    cursor: pointer;
    padding: 8px 16px;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 70px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    background: rgba(13, 28, 51, 0.45);
    backdrop-filter: blur(8px);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
}

.grid-date-pill:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

.grid-date-pill.active {
    border-color: #22d3ee !important;
    background: rgba(34, 211, 238, 0.12) !important;
    box-shadow: 0 0 15px rgba(34, 211, 238, 0.35), inset 0 0 8px rgba(34, 211, 238, 0.1);
}

.grid-date-pill.active span {
    text-shadow: 0 0 8px rgba(34, 211, 238, 0.5);
}

/* Estado Drag-Over en la pastilla de fecha */
.grid-date-pill.drag-over-date {
    background: rgba(168, 85, 247, 0.2) !important;
    border-color: #c084fc !important;
    border-style: dashed !important;
    box-shadow: 0 0 20px rgba(168, 85, 247, 0.6), inset 0 0 10px rgba(168, 85, 247, 0.2);
    transform: scale(1.08) translateY(-4px);
    animation: drag-pulse 1s infinite alternate;
}

@keyframes drag-pulse {
    0% { box-shadow: 0 0 15px rgba(168, 85, 247, 0.4); }
    100% { box-shadow: 0 0 25px rgba(168, 85, 247, 0.7); }
}

/* Efectos en la tarjeta de partido que se arrastra */
.agenda-match-card {
    transition: all 0.2s ease;
}

.agenda-match-card.dragging {
    opacity: 0.35 !important;
    transform: scale(0.95);
    border-color: #22d3ee !important;
    box-shadow: 0 0 15px rgba(34, 211, 238, 0.2) !important;
}

/* Estilos de celda Drop Target en la agenda */
.agenda-drop-cell {
    transition: all 0.25s ease;
    position: relative;
}

.agenda-drop-cell.drag-over-valid {
    background: rgba(34, 211, 238, 0.06) !important;
    border: 2px dashed rgba(34, 211, 238, 0.5) !important;
    box-shadow: inset 0 0 12px rgba(34, 211, 238, 0.15);
}

.agenda-drop-cell.drag-over-invalid {
    background: rgba(239, 68, 68, 0.08) !important;
    border: 2px dashed rgba(239, 68, 68, 0.4) !important;
    cursor: not-allowed !important;
}

/* Celda en estado cargando (soltado procesando) */
.agenda-drop-cell.drop-loading {
    position: relative;
    opacity: 0.6;
}

.agenda-drop-cell.drop-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 24px;
    height: 24px;
    margin: -12px 0 0 -12px;
    border: 2px solid rgba(255,255,255,0.1);
    border-top-color: #22d3ee;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    z-index: 10;
}

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

.agenda-available-slot {
    font-size: 0.78rem;
    color: #475569;
    font-weight: 500;
    transition: color 0.2s;
}

.agenda-drop-cell:hover .agenda-available-slot {
    color: #94a3b8;
}

/* ==========================================================================
   TEAM COLOR PICKER COMPONENT (PREMIUM UX)
   ========================================================================== */
.team-color-picker-container {
    background: rgba(15, 23, 42, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    padding: 12px;
    margin-top: 6px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

.color-presets-label {
    font-size: 0.72rem;
    color: #94a3b8;
    margin-bottom: 6px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.color-presets-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    margin-bottom: 10px;
}

.color-preset-pill {
    height: 26px;
    border-radius: 5px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.color-preset-pill::before,
.color-preset-pill::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 50%;
}

.color-preset-pill::before {
    left: 0;
    background-color: var(--primary-color);
}

.color-preset-pill::after {
    right: 0;
    background-color: var(--secondary-color);
}

.color-preset-pill:hover {
    transform: translateY(-1px) scale(1.03);
    border-color: rgba(255, 255, 255, 0.3);
}

.color-preset-pill.active {
    border-color: #06b6d4;
    box-shadow: 0 0 6px rgba(6, 182, 212, 0.5);
    transform: scale(1.03);
}

.color-input-wrapper {
    position: relative;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    overflow: hidden;
    border: 1.5px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    transition: all 0.15s ease;
}

.color-input-wrapper:hover {
    border-color: rgba(255, 255, 255, 0.45);
    transform: scale(1.08);
}

.color-input-dot {
    position: absolute;
    top: -5px;
    left: -5px;
    width: 36px;
    height: 36px;
    border: none;
    padding: 0;
    cursor: pointer;
    background: none;
}

.team-color-preview-box {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    transition: all 0.2s ease;
}

.team-color-preview-box:hover {
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(255, 255, 255, 0.18);
}

.team-color-display {
    display: inline-flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 500;
}

/* ==========================================================================
   SPRINT 13: MÓDULO ECONÓMICO & FINANZAS DEPORTIVAS (LuduSport)
   ========================================================================== */
.fin-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    gap: 4px;
}
.fin-badge.pending {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.25);
}
.fin-badge.paid {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.25);
}
.fin-badge.partial {
    background: rgba(168, 85, 247, 0.15);
    color: #c084fc;
    border: 1px solid rgba(168, 85, 247, 0.25);
}
.fin-tx-amount {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 0.95rem;
}
.fin-tx-amount.debit {
    color: #f87171;
}
.fin-tx-amount.credit {
    color: #34d399;
}
.fin-tx-type-tag {
    font-size: 0.65rem;
    font-weight: 800;
    padding: 1px 6px;
    border-radius: 4px;
    text-transform: uppercase;
}
.fin-tx-type-tag.debit {
    background: rgba(239, 68, 68, 0.12);
    color: #ef4444;
}
.fin-tx-type-tag.credit {
    background: rgba(16, 185, 129, 0.12);
    color: #10b981;
}
.fin-row-action-btn {
    background: rgba(34, 211, 238, 0.08);
    border: 1px solid rgba(34, 211, 238, 0.2);
    color: #22d3ee;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.78rem;
    cursor: pointer;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: all 0.2s ease;
}
.fin-row-action-btn:hover {
    background: #22d3ee;
    color: #0f172a;
    box-shadow: 0 0 8px rgba(34, 211, 238, 0.4);
}
/* Transacciones en versión móvil del delegado */
.del-tx-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    padding: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: transform 0.2s;
}
.del-tx-card:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.05);
}
.del-tx-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.del-tx-concept {
    font-size: 0.88rem;
    font-weight: 600;
    color: #f8fafc;
}
.del-tx-date {
    font-size: 0.72rem;
    color: #64748b;
}
.del-tx-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

/* ── Tooltip de asignaciones — Calendario General del Torneo ─────────────── */
.agenda-match-card {
    position: relative;
}
.amt-panel {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.22s ease, opacity 0.18s ease, padding-top 0.18s ease, border-color 0.18s ease;
    border-top: 1px solid transparent;
    padding-top: 0;
    margin-top: 2px;
    pointer-events: none;
}
.agenda-match-card:hover .amt-panel {
    max-height: 220px;
    opacity: 1;
    border-top: 1px solid rgba(99, 102, 241, 0.25);
    padding-top: 8px;
    pointer-events: auto;
}
.amt-title {
    font-size: 0.6rem;
    font-weight: 800;
    color: #818cf8;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 6px;
}
.amt-row {
    display: flex;
    align-items: flex-start;
    gap: 5px;
    font-size: 0.67rem;
    color: #cbd5e1;
    line-height: 1.35;
    margin-bottom: 3px;
    text-align: left;
}
.amt-row:last-child {
    margin-bottom: 0;
}
.amt-icon {
    flex-shrink: 0;
    width: 13px;
    text-align: center;
    font-size: 0.65rem;
    margin-top: 1px;
    opacity: 0.85;
}
.amt-lbl {
    color: #64748b;
    font-size: 0.62rem;
    margin-right: 2px;
}
.amt-ok   { color: #34d399; }
.amt-warn { color: #f87171; }
.amt-dim  { color: #475569; }

/* Expansión forzada de todos los paneles cuando el toggle está activo */
.show-assignments .agenda-match-card .amt-panel {
    max-height: 220px;
    opacity: 1;
    border-top: 1px solid rgba(99, 102, 241, 0.25);
    padding-top: 8px;
    pointer-events: auto;
}

/* ═══════════════════════════════════════════════════════════════════════════
   BRACKET TREE V2 — SISTEMA VISUAL SUPREMO (Copa de Oro / Copa de Plata)
   ═══════════════════════════════════════════════════════════════════════════ */

.bracket-scroll-wrapper {
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: rgba(99,179,237,0.2) transparent;
    padding-bottom: 12px;
}
.bracket-scroll-wrapper::-webkit-scrollbar { height: 4px; }
.bracket-scroll-wrapper::-webkit-scrollbar-thumb {
    background: rgba(99,179,237,0.2);
    border-radius: 4px;
}

.bracket-tree {
    display: flex;
    gap: 0;
    align-items: flex-start;
    position: relative;
    min-width: max-content;
    padding: 12px 20px 60px 20px;
}

.bracket-round-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 216px;
    width: 216px;
    flex-shrink: 0;
    position: relative;
}

.bracket-round-header {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.9px;
    text-transform: uppercase;
    margin-bottom: 12px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 4px 12px;
    border-radius: 20px;
    border: 1px solid currentColor;
    white-space: nowrap;
}
.bracket-round-header.status-pending     { color: #475569; border-color: #334155; background: rgba(30,41,59,0.4); }
.bracket-round-header.status-in_progress { color: #60a5fa; border-color: #3b82f6; background: rgba(30,58,95,0.6); }
.bracket-round-header.status-completed   { color: #4ade80; border-color: #22c55e; background: rgba(15,46,30,0.5); }
.bracket-round-header.status-tiebreak    { color: #fbbf24; border-color: #f59e0b; background: rgba(45,31,5,0.6); }

@keyframes bracket-pulse-blue {
    0%,100% { box-shadow: 0 0 6px rgba(59,130,246,0.25); }
    50%     { box-shadow: 0 0 16px rgba(59,130,246,0.65), 0 0 28px rgba(59,130,246,0.18); }
}
.bracket-round-header.status-in_progress { animation: bracket-pulse-blue 2.2s ease-in-out infinite; }

@keyframes bracket-pulse-amber {
    0%,100% { box-shadow: 0 0 6px rgba(245,158,11,0.25); }
    50%     { box-shadow: 0 0 16px rgba(245,158,11,0.65); }
}
.bracket-round-header.status-tiebreak { animation: bracket-pulse-amber 1.6s ease-in-out infinite; }

/* ─── Tarjeta de Partido v2 ─── */
.bracket-match-card-v2 {
    width: 216px;
    height: 88px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.06);
    background: rgba(15,23,42,0.78);
    backdrop-filter: blur(8px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    cursor: default;
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
    position: relative;
    flex-shrink: 0;
}
.bracket-match-card-v2:hover {
    transform: translateY(-2px) scale(1.01);
    border-color: rgba(99,179,237,0.3);
    box-shadow: 0 8px 24px rgba(0,0,0,0.38), 0 0 0 1px rgba(99,179,237,0.08);
}
.bracket-match-card-v2::before {
    content: '';
    display: block;
    height: 2px;
    width: 100%;
    background: rgba(255,255,255,0.04);
    flex-shrink: 0;
}
.bracket-match-card-v2.match-finished::before  { background: #22c55e; }
.bracket-match-card-v2.match-scheduled::before { background: #3b82f6; }
.bracket-match-card-v2.match-live::before      { background: #ef4444; animation: bracket-bar-live 1s ease-in-out infinite; }

@keyframes bracket-bar-live {
    0%,100% { opacity:1; }
    50%     { opacity:0.3; }
}

.bracket-card-header {
    padding: 2px 9px;
    font-size: 0.6rem;
    color: #475569;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.bracket-card-body {
    padding: 5px 9px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    flex: 1;
    justify-content: center;
}
.bracket-card-team {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 5px;
    transition: opacity 0.2s ease;
}
.bracket-card-team.loser { opacity: 0.35; }
.bracket-card-team-name {
    font-size: 0.79rem;
    font-weight: 500;
    color: #cbd5e1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    min-width: 0;
    transition: color 0.2s ease, font-weight 0.2s ease;
}
.bracket-card-team.winner .bracket-card-team-name { color: #f1f5f9; font-weight: 700; }
.bracket-card-score {
    font-size: 0.83rem;
    font-weight: 700;
    color: #64748b;
    min-width: 18px;
    text-align: right;
    flex-shrink: 0;
}
.bracket-card-team.winner .bracket-card-score { color: #4ade80; }
.bracket-card-pen {
    font-size: 0.6rem;
    color: #fbbf24;
    margin-left: 1px;
}
.bracket-shield {
    width: 13px;
    height: 13px;
    flex-shrink: 0;
    opacity: 0.4;
    color: #94a3b8;
    transition: opacity 0.2s ease;
}
.bracket-card-team.winner .bracket-shield { opacity: 0.85; color: #4ade80; }

/* ─── Tarjeta slot pendiente ─── */
.bracket-slot-card {
    width: 216px;
    height: 88px;
    border-radius: 10px;
    border: 1px dashed rgba(255,255,255,0.07);
    background: rgba(15,23,42,0.3);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    color: #334155;
    font-size: 0.72rem;
    font-style: italic;
    flex-shrink: 0;
}
.bracket-slot-card.best-loser { border-color: rgba(251,191,36,0.18); }

/* ─── Gap entre columnas (hueco SVG) ─── */
.bracket-col-gap {
    width: 48px;
    flex-shrink: 0;
    align-self: stretch;
    position: relative;
}

/* ─── SVG overlay de conectores ─── */
.bracket-svg-overlay {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    pointer-events: none;
    overflow: visible;
    z-index: 0;
}
.bracket-connector-path {
    fill: none;
    stroke: rgba(255,255,255,0.08);
    stroke-width: 1.5;
    transition: stroke 0.35s ease;
}
.bracket-connector-path.gold   { stroke: rgba(251,191,36,0.22); }
.bracket-connector-path.silver { stroke: rgba(226,232,240,0.18); }
.bracket-connector-path.active.gold   { stroke: rgba(251,191,36,0.45); stroke-width: 2; }
.bracket-connector-path.active.silver { stroke: rgba(200,214,229,0.38); stroke-width: 2; }

/* ─── Bloque campeón ─── */
.bracket-champion-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 16px 20px;
    border-radius: 12px;
    background: rgba(251,191,36,0.05);
    border: 1px solid rgba(251,191,36,0.2);
    min-width: 130px;
    text-align: center;
    position: relative;
    overflow: hidden;
    align-self: center;
    animation: champion-appear 0.75s cubic-bezier(0.34,1.56,0.64,1) both;
    flex-shrink: 0;
}
.bracket-champion-block::before {
    content: '';
    position: absolute; inset: 0;
    background: radial-gradient(circle at 50% 0%, rgba(251,191,36,0.1) 0%, transparent 70%);
    pointer-events: none;
}
@keyframes champion-appear {
    from { transform: scale(0.45); opacity: 0; }
    to   { transform: scale(1);    opacity: 1; }
}
.bracket-champion-trophy {
    font-size: 2rem;
    display: block;
    animation: champion-bounce 1.5s ease-in-out 0.9s infinite alternate;
    filter: drop-shadow(0 0 10px rgba(251,191,36,0.55));
}
@keyframes champion-bounce {
    from { transform: translateY(0) rotate(-4deg); }
    to   { transform: translateY(-6px) rotate(4deg); }
}
.bracket-champion-name {
    font-size: 0.9rem;
    font-weight: 800;
    color: #fbbf24;
    letter-spacing: 0.2px;
    text-shadow: 0 0 18px rgba(251,191,36,0.35);
    word-break: break-word;
    max-width: 120px;
}
.bracket-champion-label {
    font-size: 0.62rem;
    font-weight: 700;
    color: #4ade80;
    letter-spacing: 1.4px;
    text-transform: uppercase;
}

/* ─── Confetti partículas CSS ─── */
@keyframes confetti-fall {
    0%   { transform: translateY(-10px) rotate(0deg);   opacity: 1; }
    100% { transform: translateY(90px)  rotate(380deg); opacity: 0; }
}
.bracket-confetti-particle {
    position: absolute;
    width: 5px; height: 5px;
    border-radius: 1px;
    pointer-events: none;
    animation: confetti-fall 1.8s ease-in both;
}





