/* css/style.css - VERSIÓN CORREGIDA FINAL */
:root {
    --color-verde: #63b74c;
    --color-naranja: #fc9010;
    --color-blanco: #ffffff;
    --color-negro: #1a1a1a;
    --color-gris-oscuro: #333;
    
    --font-heading: 'Times New Roman', serif;
    --font-body: 'Segoe UI', Tahoma, sans-serif;
}

body {
    margin: 0;
    font-family: var(--font-body);
    background-color: #f4f6f9;
    overflow-x: hidden;
}

/* --- 1. HEADER (Fijo y Negro) --- */
.top-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 60px;
    background-color: var(--color-negro);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    box-sizing: border-box;
    border-bottom: 3px solid var(--color-verde);
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.header-left, .header-right { display: flex; align-items: center; height: 100%; gap: 20px; }
.logo-link { display: flex; align-items: center; height: 100%; text-decoration: none; }
.main-logo { height: 45px; width: auto; object-fit: contain; transition: transform 0.2s; }
.main-logo:hover { transform: scale(1.05); }

.user-info { text-align: right; line-height: 1.2; }
.user-role { display: block; font-size: 0.65rem; color: var(--color-naranja); font-weight: 700; letter-spacing: 1px; }
.user-name { display: block; color: var(--color-blanco); font-size: 0.9rem; font-weight: 500; }

.header-btn-logout {
    color: #666; font-size: 1.1rem; transition: color 0.2s;
    background: rgba(255,255,255,0.1); width: 35px; height: 35px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 0; text-decoration: none;
}
.header-btn-logout:hover { background: var(--color-naranja); color: white; }

/* --- 2. SIDEBAR (Lateral Blanco) --- */
.sidebar {
    position: fixed; top: 60px; left: 0; width: 240px; height: calc(100vh - 60px);
    background-color: #ffffff; border-right: 1px solid #e0e0e0;
    overflow-y: auto; z-index: 900; padding-top: 20px;
}
.nav-links { list-style: none; padding: 0; margin: 0; }
.nav-item { width: 100%; }
.nav-link {
    display: flex; align-items: center; padding: 15px 25px;
    color: var(--color-gris-oscuro); text-decoration: none;
    font-weight: 600; font-size: 0.95rem; transition: all 0.2s;
    border-left: 4px solid transparent;
}
.nav-link i { margin-right: 15px; width: 20px; text-align: center; color: #999; }
.nav-link:hover, .nav-link.active {
    background-color: #f0fdf4; color: var(--color-verde); border-left-color: var(--color-verde);
}
.nav-link:hover i, .nav-link.active i { color: var(--color-verde); }

/* --- 3. CONTENIDO PRINCIPAL --- */
.main-content {
    margin-top: 60px; margin-left: 240px; padding: 30px; min-height: calc(100vh - 60px);
}
.page-header {
    margin-bottom: 20px; border-bottom: 1px solid #ddd; padding-bottom: 10px;
    display: flex; justify-content: space-between; align-items: center;
}
.page-title { margin: 0; font-size: 1.8rem; color: var(--color-negro); font-family: var(--font-heading); }

/* --- 4. LOGIN --- */
.login-page {
    height: 100vh; width: 100%; display: flex; justify-content: center; align-items: center; position: relative;
    background: url('https://images.unsplash.com/photo-1612872087720-bb876e2e67d1?q=80&w=1920&auto=format&fit=crop') no-repeat center center/cover;
}
.login-page::before { content: ''; position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0, 0, 0, 0.6); backdrop-filter: blur(8px); z-index: 1; }
.login-wrapper { position: relative; z-index: 2; background: var(--color-blanco); width: 400px; box-shadow: 0 20px 50px rgba(0,0,0,0.5); border-radius: 0; clip-path: polygon(0 0, 100% 0, 100% 95%, 90% 100%, 0 100%); }
.login-content { padding: 40px; }
.brand-area { text-align: center; margin-bottom: 30px; border-bottom: 2px solid #eee; padding-bottom: 20px; }
.login-logo { max-width: 120px; display: block; margin: 0 auto 15px auto; }
.brand-title { font-family: var(--font-heading); color: var(--color-negro); text-transform: uppercase; font-size: 1.5rem; letter-spacing: 1px; margin: 0; font-weight: 700; }
.form-group { margin-bottom: 20px; }
.form-group label { display: block; font-size: 0.8rem; font-weight: 700; color: var(--color-verde); margin-bottom: 5px; text-transform: uppercase; }
.form-control { width: 100%; padding: 12px; background: #f8f8f8; border: 2px solid #e0e0e0; border-radius: 0; font-size: 1rem; color: #333; box-sizing: border-box; }
.form-control:focus { outline: none; border-color: var(--color-naranja); background: #fff; border-left-width: 5px; }
.btn-login { width: 100%; padding: 15px; background-color: var(--color-negro); color: var(--color-blanco); border: none; border-radius: 0; font-size: 1.1rem; font-weight: 700; text-transform: uppercase; cursor: pointer; transition: background 0.3s; }
.btn-login:hover { background-color: var(--color-verde); }
.diagonal-accent { height: 5px; width: 100%; background: linear-gradient(90deg, var(--color-verde) 60%, var(--color-naranja) 60%); }
.alert-error { background-color: #ffe6e6; color: #d8000c; border-left: 4px solid #d8000c; padding: 10px; margin-bottom: 20px; font-size: 0.9rem; font-weight: 600; }

/* --- 5. COMPONENTES GLOBALES (KPIs, Charts, Botones) --- */
.dropdown-container { position: relative; display: inline-block; }
.magic-btn { border-radius: 0; font-weight: 800; letter-spacing: 1px; clip-path: polygon(10% 0, 100% 0, 100% 100%, 0 100%, 0 20%); background: var(--color-naranja); color: white; padding: 10px 20px; border: none; cursor: pointer; }
.dropdown-content { display: none; position: absolute; right: 0; background-color: #f9f9f9; min-width: 200px; box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2); z-index: 1001; border-top: 4px solid var(--color-naranja); }
.dropdown-content a { color: black; padding: 12px 16px; text-decoration: none; display: block; font-size: 0.9rem; font-weight: 600; }
.dropdown-content a:hover { background-color: #ddd; }
.show { display: block; }

.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; margin-bottom: 30px; }
.stat-card { background: white; padding: 20px; box-shadow: 0 2px 10px rgba(0,0,0,0.05); display: flex; align-items: center; gap: 15px; border-radius: 0; border-left-width: 5px; border-left-style: solid; }
.border-green { border-left-color: var(--color-verde); }
.border-orange { border-left-color: var(--color-naranja); }
.border-red { border-left-color: #d8000c; }
.border-blue { border-left-color: #007bff; }
.stat-icon { width: 50px; height: 50px; display: flex; justify-content: center; align-items: center; font-size: 1.5rem; color: #555; }
.bg-green-light { background: #e8f5e9; color: var(--color-verde); }
.bg-orange-light { background: #fff3e0; color: var(--color-naranja); }
.bg-red-light { background: #ffebee; color: #d8000c; }
.bg-blue-light { background: #e3f2fd; color: #007bff; }
.stat-data h3 { margin: 0; font-size: 0.75rem; color: #888; text-transform: uppercase; letter-spacing: 1px; }
.stat-number { margin: 5px 0; font-size: 1.5rem; font-weight: 800; color: #333; font-family: var(--font-body); }
.stat-trend { font-size: 0.75rem; font-weight: 600; }
.positive { color: var(--color-verde); }
.negative { color: #d8000c; }

.chart-section { background: white; padding: 25px; box-shadow: 0 2px 10px rgba(0,0,0,0.05); margin-bottom: 30px; }
.chart-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; border-bottom: 1px solid #eee; padding-bottom: 15px; }
.section-title { font-size: 1.2rem; margin: 0; color: #333; }
.time-selector { display: flex; gap: 5px; }
.time-btn { background: transparent; border: 1px solid #ddd; padding: 5px 15px; cursor: pointer; font-weight: 600; color: #666; transition: all 0.2s; }
.time-btn:hover { background: #f0f0f0; }
.time-btn.active { background: var(--color-negro); color: white; border-color: var(--color-negro); clip-path: polygon(0 0, 100% 0, 100% 85%, 85% 100%, 0 100%); }
.chart-container { position: relative; height: 300px; width: 100%; }

/* --- 6. TABLAS, TOOLBARS Y FILTROS (Flat Design) --- */
.toolbar-card { background: white; margin: 20px 0; padding: 15px 20px; display: flex; justify-content: space-between; align-items: center; box-shadow: 0 4px 12px rgba(0,0,0,0.03); border: 1px solid #f0f0f0; }
.search-wrapper { position: relative; width: 350px; }
.search-icon { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: #aaa; }
.clean-input { width: 100%; padding: 12px 12px 12px 40px; border: 1px solid #eee; background: #fcfcfc; font-size: 0.95rem; color: #333; outline: none; border-radius: 0; }
.clean-input:focus { border-color: var(--color-verde); background: white; }
.clean-select { border: none; background: transparent; font-weight: 700; color: #555; cursor: pointer; outline: none; font-size: 0.9rem; }
.filter-group, .filter-wrapper { display: flex; align-items: center; gap: 15px; }
.divider-vertical { width: 1px; height: 20px; background: #ddd; }

.table-container { background: white; box-shadow: 0 4px 12px rgba(0,0,0,0.03); border: 1px solid #f0f0f0; overflow-x: auto; }
.flat-table { width: 100%; border-collapse: collapse; min-width: 900px; }
.flat-table th { text-align: left; padding: 15px 10px; font-size: 0.75rem; color: #888; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; border-bottom: 2px solid #f0f0f0; }
.table-row:hover { background-color: #fcfcfc; }
.table-row td { padding: 16px 10px; border-bottom: 1px solid #f9f9f9; vertical-align: top; }

/* Botones Planos */
.flat-btn { border-radius: 0; padding: 10px 20px; font-weight: 600; letter-spacing: 0.5px; font-size: 0.9rem; transition: all 0.2s; text-decoration: none; display: inline-flex; align-items: center; gap: 8px; border: none; cursor: pointer; background: #eee; color: #333; }
.flat-btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--color-negro); color: white; }
.btn-secondary { background: var(--color-naranja); color: white; }
.icon-btn { background: none; border: none; cursor: pointer; color: #bbb; font-size: 1rem; padding: 5px; transition: color 0.2s; display: inline-block; }
.icon-btn:hover { color: var(--color-negro); }

/* --- 7. ESTILOS ESPECÍFICOS: ATLETAS --- */
.carnet-badge { background: var(--color-negro); color: white; padding: 4px 8px; font-family: monospace; font-weight: 700; font-size: 0.85rem; border-radius: 4px; display: inline-block; margin-bottom: 5px; }
.orden-ref { font-size: 0.75rem; color: #999; }
.orden-ref strong { color: #555; }
.athlete-name { font-weight: 700; color: #333; font-size: 1rem; margin-bottom: 4px; text-transform: capitalize; }
.athlete-meta { font-size: 0.8rem; color: #666; display: flex; align-items: center; gap: 5px; }
.meta-separator { color: #ccc; font-size: 0.6rem; }
.schedule-badge { background: #e3f2fd; color: #1565c0; padding: 6px 10px; border-radius: 4px; font-size: 0.8rem; font-weight: 600; display: inline-block; }
.contact-line { font-size: 0.85rem; color: #444; margin-bottom: 3px; display: flex; align-items: center; gap: 8px; }
.address-line { font-size: 0.75rem; color: #888; margin-top: 5px; font-style: italic; }
.tutor-name { font-weight: 600; color: #555; font-size: 0.9rem; margin-bottom: 3px; text-transform: capitalize; }
.sub-text { font-size: 0.8rem; color: #777; }
.text-pink { color: #e91e63; }
.text-blue { color: #2196f3; }

/* Media Query Móvil (SIEMPRE AL FINAL) */
@media (max-width: 768px) {
    .sidebar { display: none; }
    .main-content { margin-left: 0; }
}