/*
 * TRAMA — estilos propios de las pantallas (componentes que no son de Bootstrap).
 * Los colores y fuentes salen de las variables --c-* / --f-* de theme.css, que header.php
 * pisa con lo cargado en configuracion. No usar colores fijos acá.
 */

body.app-body { min-height: 100vh; }

.app-titulo { font-family: var(--f-title); font-weight: 600; }
.app-main.container-fluid { max-width: 1440px; padding: 2.25rem 1.75rem 4rem !important; }

/* Encabezado de página: título + subtítulo a la izquierda, acciones a la derecha */
.page-header { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1.75rem; }
.page-titulo { font-size: clamp(1.6rem, 2.4vw, 2.1rem); margin: 0; }
.page-subtitulo { color: var(--c-muted); margin: .25rem 0 0; }
.page-acciones { display: flex; flex-wrap: wrap; gap: .5rem; }

/* Métricas del tablero */
.stat-card {
    display: flex; flex-direction: column; gap: .35rem; height: 100%;
    padding: 1.25rem 1.35rem;
    background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radio);
    box-shadow: var(--sombra); color: var(--c-text); text-decoration: none;
    transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease;
}
.stat-card:hover, .stat-card:focus { color: var(--c-text); border-color: rgba(var(--c-primary-rgb), .35); transform: translateY(-2px); box-shadow: 0 6px 24px rgba(var(--c-text-rgb), .07); }
.stat-icono {
    width: 2.4rem; height: 2.4rem; border-radius: 50%; margin-bottom: .4rem;
    display: inline-flex; align-items: center; justify-content: center;
    background: rgba(var(--c-primary-rgb), .07); color: var(--c-primary); font-size: .95rem;
}
.stat-etiqueta { color: var(--c-muted); font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; }
.stat-valor { font-family: var(--f-title); font-weight: 600; font-size: 2.2rem; line-height: 1.1; }

/* Bloque de fecha (día + mes) para listas de eventos */
.fecha-bloque {
    flex: 0 0 auto; width: 3.1rem; padding: .35rem 0; text-align: center;
    border: 1px solid var(--c-border); border-radius: 10px; background: var(--c-bg); line-height: 1.1;
}
.fecha-dia { display: block; font-family: var(--f-title); font-weight: 600; font-size: 1.3rem; color: var(--c-text); }
.fecha-mes { display: block; font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--c-primary); }
.min-w-0 { min-width: 0; }

/* Estado vacío */
.empty-state { text-align: center; padding: 3rem 1.5rem; color: var(--c-muted); }
.empty-state > i { font-size: 2rem; opacity: .35; margin-bottom: .9rem; display: block; }
.empty-state p { margin-bottom: 1.1rem; }

/* Filas etiqueta / valor (resúmenes de plata) */
.fila-dato { display: flex; justify-content: space-between; align-items: baseline; padding: .6rem 0; border-bottom: 1px solid var(--c-border); }
.fila-dato > span:first-child { color: var(--c-muted); }
.fila-dato > span:last-child { font-weight: 700; }
.fila-dato.fila-total { border-bottom: 0; padding-top: .9rem; }
.fila-dato.fila-total > span:first-child { color: var(--c-text); font-weight: 700; }
.fila-dato.fila-total > span:last-child { font-family: var(--f-title); font-weight: 600; font-size: 1.5rem; }

/* Link con flecha (ver todos, ver reporte) */
.link-flecha { font-weight: 700; text-decoration: none; }
.link-flecha::after { content: "\2192"; margin-left: .3rem; display: inline-block; transition: transform .15s ease; }
.link-flecha:hover::after { transform: translateX(3px); }

/* Lista de accesos rápidos */
.lista-accesos a {
    display: flex; align-items: center; gap: .9rem; padding: .9rem 1.25rem;
    color: var(--c-text); text-decoration: none; border-top: 1px solid var(--c-border);
}
.lista-accesos a:first-child { border-top: 0; }
.lista-accesos a > i { width: 1.25rem; text-align: center; color: var(--c-primary); }
.lista-accesos a > span { flex: 1; font-weight: 700; }
.lista-accesos a small { display: block; font-weight: 400; color: var(--c-muted); }
.lista-accesos a::after { content: "\2192"; color: var(--c-muted); transition: transform .15s ease, color .15s ease; }
.lista-accesos a:hover { background: var(--c-bg); }
.lista-accesos a:hover::after { color: var(--c-primary); transform: translateX(3px); }
.lista-accesos a:last-child { border-bottom-left-radius: var(--radio); border-bottom-right-radius: var(--radio); }

/* Tarjetas de persona / candidato */
.tarjeta-persona { border-radius: var(--radio); overflow: hidden; }
.tarjeta-persona .foto { aspect-ratio: 4/5; object-fit: cover; width: 100%; background: var(--c-bg); }
.tarjeta-persona .foto-cuadrada { aspect-ratio: 1/1; object-fit: cover; width: 100%; background: var(--c-bg); }
.foto-vacia { background: var(--c-bg); color: var(--c-muted); border: 1px dashed var(--c-border); }

/* Vista enfrentada de macheo */
.vista-enfrentada { display: grid; grid-template-columns: 1fr auto 1fr; gap: 1rem; align-items: start; }
.vista-enfrentada .versus { display:flex; align-items:center; justify-content:center; font-size:1.5rem; color: var(--c-primary); }
@media (max-width: 767px) {
    .vista-enfrentada { grid-template-columns: 1fr; }
    .vista-enfrentada .versus { display:none; }
}

/* DataTables: en celular se cae a formato "tarjeta" (child rows) — ver responsive.bootstrap5 */
.dtr-details { list-style: none; padding-left: 0; }
.dtr-details li { padding: 3px 0; border-bottom: 1px dashed var(--c-border); }

.puntaje-badge { font-size: 1.1rem; font-weight: 700; }
.puntaje-alto { color: var(--c-success); }
.puntaje-medio { color: color-mix(in srgb, var(--c-accent) 70%, black); }
.puntaje-bajo { color: var(--c-muted); }

.crop-contenedor { max-height: 60vh; background: var(--c-bg); }
.crop-contenedor img { display:block; max-width:100%; }

.leaflet-mapa { height: 320px; border-radius: 10px; border: 1px solid var(--c-border); }

.badge-etiqueta { background: var(--c-surface); color: var(--c-text); border: 1px solid var(--c-border); font-weight: 400; }

/* Layout público (socio / candidatos): más íntimo, centrado */
.publico-contenedor { max-width: 720px; margin: 0 auto; padding: 40px 16px 64px; }
.publico-logo { max-height: 64px; margin-bottom: 12px; }
.publico-marca { letter-spacing: .02em; }

@media (max-width: 575px) {
    .app-main.container-fluid { padding-left: 1rem; padding-right: 1rem; padding-top: 1.25rem !important; }
}
