/* =====================================================================
   POLIDEPORTIVO: ficha, imágenes, carnet, presencia, cámara, deportes
   (se carga después de style.css)
   ===================================================================== */
.timeline-icon { background: var(--fluent-orange-primary); }
.card-highlight { border: 2px solid var(--fluent-warning); }
code { background: var(--fluent-neutral-bg-alt); padding: 1px 6px; border-radius: 4px; }

/* Ficha */
.ficha-top { display: flex; gap: var(--space-md); align-items: center; }
.ficha-foto { flex: 0 0 96px; height: 120px; border-radius: 8px; background: var(--fluent-neutral-bg-alt); display: flex; align-items: center; justify-content: center; overflow: hidden; color: var(--fluent-neutral-tertiary); font-size: 40px; }
.ficha-foto img { width: 100%; height: 100%; object-fit: cover; }
.ficha-datos { display: grid; grid-template-columns: 140px 1fr; gap: 6px 12px; margin: var(--space-md) 0 0; }
.ficha-datos dt { color: var(--fluent-neutral-secondary); font-weight: 600; }
.ficha-datos dd { margin: 0; word-break: break-word; }
@media (max-width: 480px) {
    .ficha-datos { grid-template-columns: 1fr; }
    .ficha-datos dd { margin-bottom: 6px; }
}

/* Imágenes (foto / DNI) */
.img-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: var(--space-md); }
.img-slot { border: 2px dashed var(--fluent-neutral-border); border-radius: 8px; padding: 8px; display: flex; flex-direction: column; gap: 6px; background: var(--fluent-neutral-bg); }
.img-slot-label { font-weight: 600; font-size: var(--font-size-sm); }
.img-slot img { width: 100%; height: 130px; object-fit: contain; background: #fff; border-radius: 4px; display: none; }
.img-slot.has-img img { display: block; }
.img-slot.has-img .img-slot-empty { display: none; }
.img-slot-empty { height: 130px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; color: var(--fluent-neutral-tertiary); }
.img-slot-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.img-slot-actions label { cursor: pointer; margin: 0; }

/* Inscripción */
.modulo-group { margin-bottom: var(--space-md); }
.modulo-title { font-weight: 700; margin-bottom: 6px; color: var(--fluent-orange-primary); }
.option-item:has(input[type=radio]:checked) { border-color: var(--fluent-orange-primary); background: #F0F9FF; }
.option-item input[type=radio] { width: 18px; height: 18px; accent-color: var(--fluent-orange-primary); }

/* Resultado sanitario */
.resultado-toggle { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-sm); }
.resultado-toggle label { border: 2px solid var(--fluent-neutral-border); border-radius: 8px; padding: 14px; text-align: center; font-weight: 700; font-size: 1.1rem; cursor: pointer; }
.resultado-toggle input { display: none; }
.resultado-toggle .res-apto:has(input:checked) { border-color: var(--fluent-success); background: #DFF6DD; color: var(--fluent-success); }
.resultado-toggle .res-noapto:has(input:checked) { border-color: var(--fluent-error); background: #FDE7E9; color: var(--fluent-error); }

/* Presencia */
.scan-input-lg { font-size: 1.15rem; min-height: 48px; }
.area-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-sm); margin-bottom: var(--space-md); }
.area-tab { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-radius: 10px; background: var(--fluent-white); box-shadow: var(--shadow-2); color: var(--fluent-neutral-text); text-decoration: none; border: 2px solid transparent; }
.area-tab i { font-size: 1.4rem; color: var(--fluent-orange-primary); }
.area-tab span { flex: 1; font-weight: 600; }
.area-tab strong { font-size: 1.4rem; }
.area-tab.active { border-color: var(--fluent-orange-primary); background: #F0F9FF; }
@media (max-width: 600px) {
    .area-tabs { grid-template-columns: 1fr; }
}

.presencia-result { display: flex; gap: var(--space-md); align-items: center; padding: var(--space-lg); border-radius: 12px; min-height: 150px; background: var(--fluent-white); box-shadow: var(--shadow-4); border-left: 10px solid var(--fluent-neutral-border); }
.presencia-result.res-ok { border-color: var(--fluent-success); background: #DFF6DD; }
.presencia-result.res-error { border-color: var(--fluent-error); background: #FDE7E9; }
.presencia-result.res-warn { border-color: var(--fluent-warning); background: #FFF4CE; }
.pr-foto { flex: 0 0 110px; height: 130px; border-radius: 8px; background: rgba(255, 255, 255, 0.7); display: flex; align-items: center; justify-content: center; overflow: hidden; font-size: 52px; color: var(--fluent-neutral-tertiary); }
.pr-foto img { width: 100%; height: 100%; object-fit: cover; }
.res-ok .pr-foto i { color: var(--fluent-success); }
.res-error .pr-foto i { color: var(--fluent-error); }
.pr-body { flex: 1; min-width: 0; }
.pr-estado { font-size: 1.25rem; font-weight: 700; margin-bottom: 6px; }
.res-ok .pr-estado { color: var(--fluent-success); }
.res-error .pr-estado { color: var(--fluent-error); }
.res-warn .pr-estado { color: #8a6d00; }
.pr-nombre { font-size: 1.5rem; font-weight: 700; line-height: 1.2; }
.pr-datos { color: var(--fluent-neutral-secondary); margin-top: 4px; }
.pr-acciones { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
@media (max-width: 480px) {
    .presencia-result { flex-direction: column; text-align: center; }
    .pr-acciones { justify-content: center; }
}

/* Cámara */
.cam-overlay { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.75); z-index: 2000; display: flex; align-items: center; justify-content: center; padding: 12px; }
.cam-box { background: #111; border-radius: 12px; width: 100%; max-width: 640px; overflow: hidden; color: #fff; }
.cam-head { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px; }
.cam-video-wrap { position: relative; background: #000; }
.cam-video-wrap video { width: 100%; display: block; max-height: 70vh; object-fit: cover; }
.cam-frame { position: absolute; left: 8%; right: 8%; top: 30%; bottom: 30%; border: 3px solid rgba(125, 211, 252, 0.9); border-radius: 8px; box-shadow: 0 0 0 999px rgba(0, 0, 0, 0.25); pointer-events: none; }
.cam-msg { padding: 10px 12px; font-size: var(--font-size-sm); color: #cbd5e1; }

/* Deportes */
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: var(--space-md); }
.cat-card { display: block; text-decoration: none; color: var(--fluent-neutral-text); border-top: 4px solid var(--fluent-orange-primary); margin: 0; }
.cat-card.inactivo { opacity: 0.55; }
.cat-deporte { font-size: var(--font-size-sm); text-transform: uppercase; letter-spacing: 1px; color: var(--fluent-orange-primary); font-weight: 700; }
.cat-nombre { font-size: 1.2rem; font-weight: 700; margin-bottom: 6px; }
.cat-stats { display: flex; justify-content: space-between; margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--fluent-neutral-border); font-size: var(--font-size-sm); }
.asistencia-table th, .asistencia-table td { white-space: nowrap; }

/* Chips (deportes en planilla) */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border: 1px solid var(--fluent-neutral-border); border-radius: 999px; cursor: pointer; background: var(--fluent-white); }
.chip:has(input:checked) { border-color: var(--fluent-orange-primary); background: #F0F9FF; color: var(--fluent-orange-primary); font-weight: 600; }
.form-control-sm { min-height: 30px; padding: 4px 8px; font-size: var(--font-size-sm); }
.qty-big { font-size: 1.3rem; font-weight: 700; text-align: center; }
.btn-group-tabs { display: flex; gap: 4px; }
.list-group-item.text-left { text-align: left; background: var(--fluent-white); border: 0; border-bottom: 1px solid var(--fluent-neutral-border); cursor: pointer; font: inherit; }
.list-group-item.text-left:hover, a.list-group-item:hover { background: #F0F9FF; }
a.list-group-item { display: block; color: var(--fluent-neutral-text); text-decoration: none; }

/* Barras de estadística */
.bars { display: flex; flex-direction: column; gap: 4px; }
.bar-row { display: flex; align-items: center; gap: 8px; font-size: var(--font-size-sm); }
.bar-label { flex: 0 0 42px; color: var(--fluent-neutral-secondary); }
.bar-track { flex: 1; display: flex; height: 14px; background: var(--fluent-neutral-bg-alt); border-radius: 4px; overflow: hidden; }
.bar-seg { height: 100%; }
.bar-val { flex: 0 0 34px; text-align: right; font-weight: 600; }
.b1 { background: #0369A1; }
.b2 { background: #0EA5E9; }
.b3 { background: #10B981; }
.b4 { background: #F59E0B; }
.bar-legend { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-top: 8px; font-size: var(--font-size-sm); }
.bar-legend span { display: inline-block; width: 12px; height: 12px; border-radius: 3px; }

.flash-row { animation: flashIn 1.2s ease; }

/* =====================================================================
   COLORES OLÍMPICOS: acento de 5 colores y un color por módulo
   Pileta = azul · Natación = amarillo · Colonia = verde · Deportes = rojo · Administración = negro
   ===================================================================== */
:root {
    --oli-azul: #0081C8;
    --oli-amarillo: #FCB131;
    --oli-negro: #1F2937;
    --oli-verde: #00A651;
    --oli-rojo: #EE334E;
    --oli-franja: linear-gradient(90deg,
        var(--oli-azul) 0 20%, var(--oli-amarillo) 20% 40%, #000 40% 60%,
        var(--oli-verde) 60% 80%, var(--oli-rojo) 80% 100%);
}

/* Franja bajo el encabezado, en el login y en el pie */
.app-header::after { content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 4px; background: var(--oli-franja); }
.app-logo-img { height: 42px; width: auto; margin-right: 10px; }
.app-footer { border-top: 0; position: relative; }
.app-footer::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--oli-franja); }
.login-card { position: relative; overflow: hidden; }
.login-card::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 6px; background: var(--oli-franja); }
.login-logo img { height: 96px !important; width: auto; }

/* Menú lateral: color por sección */
.nav-section { display: flex; align-items: center; gap: 8px; }
.nav-section::before { content: ''; width: 10px; height: 10px; border-radius: 50%; border: 3px solid currentColor; flex: 0 0 auto; }
.nav-section.oli-azul { color: var(--oli-azul); }
.nav-section.oli-amarillo { color: #C98A00; }
.nav-section.oli-negro { color: var(--oli-negro); }
.nav-section.oli-verde { color: var(--oli-verde); }
.nav-section.oli-rojo { color: var(--oli-rojo); }
.nav-item.oli-azul .nav-icon { color: var(--oli-azul); }
.nav-item.oli-amarillo .nav-icon { color: #D99A00; }
.nav-item.oli-negro .nav-icon { color: var(--oli-negro); }
.nav-item.oli-verde .nav-icon { color: var(--oli-verde); }
.nav-item.oli-rojo .nav-icon { color: var(--oli-rojo); }
.nav-item.oli-azul .nav-link.active { background: var(--oli-azul); }
.nav-item.oli-amarillo .nav-link.active { background: #E09B00; }
.nav-item.oli-negro .nav-link.active { background: var(--oli-negro); }
.nav-item.oli-verde .nav-link.active { background: var(--oli-verde); }
.nav-item.oli-rojo .nav-link.active { background: var(--oli-rojo); }
.app-sidebar .nav-item .nav-link.active .nav-icon { color: #fff; }

/* Colores por módulo (pestañas de presencia, tarjetas y títulos) */
.area-tabs .area-tab:nth-child(1) { --c: var(--oli-azul); }
.area-tabs .area-tab:nth-child(2) { --c: #E09B00; }
.area-tabs .area-tab:nth-child(3) { --c: var(--oli-verde); }
.area-tab { border-top: 4px solid var(--c, var(--oli-azul)); }
.area-tab i { color: var(--c, var(--oli-azul)); }
.area-tab.active { border-color: var(--c); background: #fff; box-shadow: 0 0 0 2px var(--c); }
.modulo-group:nth-of-type(1) .modulo-title { color: var(--oli-azul); }
.modulo-group:nth-of-type(2) .modulo-title { color: #C98A00; }
.modulo-group:nth-of-type(3) .modulo-title { color: var(--oli-verde); }
.cat-card { border-top-color: var(--oli-rojo); }
.cat-deporte { color: var(--oli-rojo); }

/* KPIs del panel con los 5 colores */
.kpi-icon-primary { background: rgba(0, 129, 200, .12); color: var(--oli-azul); }
.kpi-icon-info { background: rgba(252, 177, 49, .18); color: #B87E00; }
.kpi-icon-success { background: rgba(0, 166, 81, .12); color: var(--oli-verde); }
.kpi-icon-danger { background: rgba(238, 51, 78, .12); color: var(--oli-rojo); }
.kpi-icon-secondary { background: rgba(0, 0, 0, .07); color: var(--oli-negro); }

/* Títulos de sección: el número toma los colores de los anillos */
.split-col .card:nth-child(5n+1) .section-num { background: var(--oli-azul); }
.split-col .card:nth-child(5n+2) .section-num { background: #E09B00; }
.split-col .card:nth-child(5n+3) .section-num { background: #000; }
.split-col .card:nth-child(5n+4) .section-num { background: var(--oli-verde); }
.split-col .card:nth-child(5n+5) .section-num { background: var(--oli-rojo); }

/* Barras de estadística: mismo código de colores */
.b1 { background: var(--oli-azul); }
.b2 { background: var(--oli-amarillo); }
.b3 { background: var(--oli-verde); }
.b4 { background: var(--oli-rojo); }
.timeline-item:nth-child(5n+1) .timeline-icon { background: var(--oli-azul); }
.timeline-item:nth-child(5n+2) .timeline-icon { background: #E09B00; }
.timeline-item:nth-child(5n+3) .timeline-icon { background: #000; }
.timeline-item:nth-child(5n+4) .timeline-icon { background: var(--oli-verde); }
.timeline-item:nth-child(5n+5) .timeline-icon { background: var(--oli-rojo); }
