/* Diseño pensado primero para celulares; en pantallas anchas se acomoda solo. */

:root {
    --fondo: #e9e7e1;
    --superficie: #f5f4f0;
    --blanco: #ffffff;
    --oscuro: #013d5f;  /* azul marino del logo */
    --texto: #14212c;
    --suave: #6b7682;
    --borde: #e4e2da;
    --azul: #013d5f;
    --azul-suave: #e4edf3;
    --rojo: #a0121c;   /* rojo del escudo */
    --rojo-suave: #f8e3e4;
    --dorado: #f9d85e;  /* escuadra y tintero */
    --dorado-texto: #8a6a10;
    --crema: #e3daa4;   /* hojas del libro */
    --dorado-suave: #fbf3d4;
    --radio-grande: 28px;
    --radio: 20px;
    --radio-chico: 14px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    min-height: 100vh;
    background: var(--fondo);
    color: var(--texto);
    font: 15px/1.5 "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; }
h1, h2, h3 { letter-spacing: -.02em; }

.icono {
    width: 20px;
    height: 20px;
    flex: none;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* ---------- Estructura general ---------- */

.app { min-height: 100vh; background: var(--blanco); }

.lateral {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 30;
    width: min(300px, 85vw);
    display: flex;
    flex-direction: column;
    gap: .5rem;
    padding: 1.25rem;
    background: var(--blanco);
    transform: translateX(-100%);
    transition: transform .25s ease;
    overflow-y: auto;
}
.menu-abierto .lateral { transform: none; box-shadow: 0 0 40px rgba(0, 0, 0, .2); }

.velo {
    position: fixed;
    inset: 0;
    z-index: 20;
    background: rgba(18, 19, 22, .4);
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s;
}
.menu-abierto .velo { opacity: 1; pointer-events: auto; }

.lateral-cabeza { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }

.logo {
    display: flex;
    align-items: center;
    gap: .75rem;
    text-decoration: none;
    font-weight: 800;
    line-height: 1.2;
}
.logo small { display: block; font-weight: 500; font-size: .75rem; color: var(--suave); }
.logo-img { width: 52px; height: auto; flex: none; }

/* Franja con los colores del escudo */
.franja { height: 5px; border-radius: 999px; background: linear-gradient(90deg, var(--azul) 0 60%, var(--rojo) 60% 88%, var(--dorado) 88%); }

.menu-titulo {
    margin: 1.5rem 0 .25rem;
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .2em;
    text-transform: uppercase;
    color: var(--suave);
}

.menu { display: grid; gap: .25rem; }
.menu a, .menu-salir {
    display: flex;
    align-items: center;
    gap: .75rem;
    width: 100%;
    padding: .8rem 1rem;
    border: 0;
    border-radius: 999px;
    background: none;
    color: var(--suave);
    font: inherit;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
}
.menu a:hover, .menu-salir:hover { background: var(--superficie); color: var(--texto); }
.menu a.activo { background: var(--oscuro); color: #fff; }
.menu-flecha {
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    margin-left: auto;
    border-radius: 50%;
    background: rgba(255, 255, 255, .15);
}
.menu-flecha .icono { width: 16px; height: 16px; }

.lateral-pie { margin-top: auto; padding-top: 1rem; }

.principal { display: flex; flex-direction: column; min-height: 100vh; }

.superior {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .75rem 1rem;
    background: var(--blanco);
    border-bottom: 1px solid var(--borde);
}

/* Buscador con forma de pastilla */
.buscador {
    display: none;
    flex: 1;
    align-items: center;
    gap: .6rem;
    max-width: 640px;
    height: 52px;
    padding: 0 .4rem 0 1.1rem;
    border-radius: 999px;
    background: var(--superficie);
    color: var(--suave);
}
.buscador input {
    flex: 1;
    min-width: 0;
    padding: 0;
    border: 0;
    background: none;
    outline: none;
}
.buscador input:focus { outline: none; background: none; }
.buscador:focus-within { outline: 2px solid var(--oscuro); }
.buscador-filtro {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    color: var(--texto);
}
.buscador-filtro:hover { background: var(--blanco); }
.buscar-movil { margin-left: auto; }

/* Chip de la cuenta: foto, nombre y rol */
.perfil-chip {
    display: flex;
    align-items: center;
    gap: .7rem;
    padding: 0;
    border: 0;
    background: none;
    color: var(--texto);
    font: inherit;
    text-align: left;
    cursor: pointer;
}
.perfil-texto { display: none; line-height: 1.25; }
.perfil-texto strong { font-weight: 600; white-space: nowrap; }
.perfil-texto small { display: block; color: var(--suave); white-space: nowrap; }

/* Menús desplegables */
.desplegable-caja { position: relative; }
.desplegable {
    position: absolute;
    top: calc(100% + .6rem);
    right: 0;
    z-index: 40;
    display: grid;
    gap: .15rem;
    width: min(320px, calc(100vw - 2rem));
    padding: .5rem;
    border: 1px solid var(--borde);
    border-radius: var(--radio);
    background: var(--blanco);
    box-shadow: 0 16px 40px rgba(1, 61, 95, .15);
}
.desplegable-titulo { margin: .25rem .6rem .4rem; font-weight: 700; color: var(--azul); }
.desplegable-vacio { margin: 0; padding: .6rem; color: var(--suave); font-size: .9rem; }
.desplegable form { margin: 0; }
.desplegable-item {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .2rem .6rem;
    width: 100%;
    padding: .7rem .75rem;
    border: 0;
    border-radius: var(--radio-chico);
    background: none;
    color: var(--texto);
    font: inherit;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
}
a.desplegable-item:hover, button.desplegable-item:hover { background: var(--superficie); }
div.desplegable-item { display: grid; }
.desplegable-item small { color: var(--suave); }

/* Punto rojo de notificaciones nuevas */
.punto {
    position: absolute;
    top: 10px;
    right: 11px;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--rojo);
    box-shadow: 0 0 0 2px var(--superficie);
}

/* Botón de tema: sol en modo claro, luna en modo oscuro */
.icono-sol, .icono-luna { display: grid; }
.icono-luna { display: none; }
[data-tema="oscuro"] .icono-sol { display: none; }
[data-tema="oscuro"] .icono-luna { display: grid; }

.solo-pc { display: none !important; }

.avatar {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    flex: none;
    border-radius: 50%;
    background: var(--azul-suave);
    color: var(--azul);
    font-weight: 700;
    box-shadow: 0 0 0 2px var(--blanco), 0 0 0 4px var(--azul);
}

.boton-icono {
    position: relative;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    flex: none;
    border: 0;
    border-radius: 50%;
    background: var(--superficie);
    color: var(--texto);
    cursor: pointer;
}
.boton-icono:hover { background: var(--borde); }

.contenido {
    flex: 1;
    display: grid;
    align-content: start;
    gap: 1rem;
    padding: 1rem;
    background: var(--superficie);
}

/* ---------- Componentes ---------- */

.titulo-grande { margin: .25rem 0; font-size: 1.9rem; font-weight: 800; line-height: 1.15; }
.bajada { margin: 0; color: var(--suave); }

.tarjeta {
    background: var(--blanco);
    border-radius: var(--radio-grande);
    padding: 1.25rem;
}
.tarjeta-cabeza {
    display: flex;
    align-items: center;
    gap: .75rem;
    margin-bottom: 1rem;
}
.tarjeta-cabeza h2 { margin: 0; font-size: 1.2rem; }
.tarjeta-cabeza .pastilla { margin-left: auto; }

.burbuja {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    flex: none;
    border-radius: 50%;
    border: 1px solid var(--borde);
}
.burbuja.azul { background: var(--azul-suave); color: var(--azul); border: 0; }
.burbuja.rojo { background: var(--rojo-suave); color: var(--rojo); border: 0; }
.burbuja.dorado { background: var(--dorado-suave); color: var(--dorado-texto); border: 0; }

.pastilla {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .35rem .8rem;
    border: 1px solid var(--borde);
    border-radius: 999px;
    background: var(--blanco);
    font-size: .8rem;
    font-weight: 600;
    white-space: nowrap;
    text-decoration: none;
}
.pastilla.azul { background: var(--azul); border-color: var(--azul); color: #fff; }
.pastilla.rojo { background: var(--rojo); border-color: var(--rojo); color: #fff; }
.pastilla.gris { background: var(--superficie); border-color: var(--superficie); color: var(--suave); }

.aviso-negro {
    display: flex;
    align-items: center;
    gap: .9rem;
    padding: .9rem 1.1rem;
    border-radius: var(--radio);
    background: var(--oscuro);
    color: #fff;
}
.aviso-negro .burbuja { background: var(--rojo); color: #fff; border: 0; }
.aviso-negro p { margin: 0; }

/* Accesos del panel */
.accesos { display: grid; gap: 1rem; }
.acceso-item {
    display: grid;
    gap: .75rem;
    padding: 1.1rem;
    border-radius: var(--radio);
    background: var(--superficie);
    text-decoration: none;
}
a.acceso-item:hover { outline: 2px solid var(--oscuro); }
.acceso-item h3 { margin: 0; font-size: 1.05rem; }
.acceso-item p { margin: 0; color: var(--suave); font-size: .9rem; }
.acceso-item .fila { display: flex; align-items: center; justify-content: space-between; }

/* Calendario */
.calendario { display: grid; grid-template-columns: repeat(7, 1fr); gap: .35rem; text-align: center; }
.calendario .dia-nombre { font-size: .8rem; font-weight: 600; color: var(--suave); padding-bottom: .25rem; }
.calendario .dia {
    display: grid;
    place-items: center;
    aspect-ratio: 1;
    border-radius: 50%;
    background: var(--superficie);
    font-size: .9rem;
    font-weight: 500;
}
.calendario .dia.finde { color: var(--suave); }
.calendario .dia.hoy { background: var(--oscuro); color: #fff; }
.calendario .dia.vacio {
    background: repeating-linear-gradient(135deg, var(--superficie) 0 4px, var(--blanco) 4px 8px);
}

/* Formularios: campos grandes para tocar fácil en el celular */
.formulario { display: grid; gap: 1rem; }
label { display: grid; gap: .4rem; font-weight: 600; font-size: .9rem; }
input, select, textarea {
    width: 100%;
    padding: .85rem 1rem;
    font: inherit;
    font-size: 16px; /* evita el zoom automático en iPhone */
    border: 1px solid var(--borde);
    border-radius: var(--radio-chico);
    background: var(--superficie);
    color: var(--texto);
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--oscuro); outline-offset: 1px; background: var(--blanco); }
label.check { display: flex; align-items: center; gap: .6rem; font-weight: 500; }
label.check input { width: 20px; height: 20px; accent-color: var(--azul); }
.ayuda { font-weight: 400; color: var(--suave); font-size: .85rem; }

.boton {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    padding: .85rem 1.4rem;
    border: 0;
    border-radius: 999px;
    background: var(--oscuro);
    color: #fff;
    font: inherit;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
}
.boton:hover { background: #012b44; }
.boton.azul { background: var(--azul); }
.boton.claro { background: var(--blanco); color: var(--texto); border: 1px solid var(--borde); }
.botones { display: flex; flex-wrap: wrap; gap: .75rem; }

.alerta { margin: 0; padding: .85rem 1.1rem; border-radius: var(--radio-chico); font-weight: 500; }
.alerta.ok { background: var(--azul-suave); color: var(--azul); }
.alerta.error { background: var(--rojo-suave); color: var(--rojo); }
.alerta ul { margin: 0; padding-left: 1.2rem; }

/* Pantalla de ingreso */
.acceso {
    min-height: 100vh;
    display: grid;
    align-content: center;
    gap: 1rem;
    max-width: 1000px;
    margin: 0 auto;
    padding: 1rem;
}
.acceso-caja { display: grid; gap: 1rem; }
.acceso-caja > .tarjeta { align-content: center; }

/* Presentación con el escudo, sobre el fondo claro */
.acceso-presentacion {
    display: grid;
    gap: 1rem;
    justify-items: center;
    align-content: center;
    padding: 1rem;
    text-align: center;
}
.acceso-logo-marco { display: block; line-height: 0; }
.acceso-logo { width: 120px; height: auto; }
.acceso-presentacion .titulo-grande { margin: 0; font-size: 1.6rem; }
.acceso-presentacion .franja { width: 120px; }
.acceso-presentacion .aviso-negro { background: var(--blanco); color: var(--texto); text-align: left; }

/* Listado de usuarios */
.filtros { display: grid; gap: .75rem; }
.tabla { width: 100%; border-collapse: collapse; }
.tabla th, .tabla td { padding: .75rem; text-align: left; vertical-align: middle; }
.persona { display: flex; align-items: center; gap: .75rem; }
.persona .avatar { width: 36px; height: 36px; font-size: .8rem; box-shadow: none; }
.persona small { display: block; color: var(--suave); }

/* En el celular cada fila de la tabla se muestra como una tarjeta */
@media (max-width: 799px) {
    .tabla thead { display: none; }
    .tabla tr {
        display: grid;
        gap: .5rem;
        padding: 1rem;
        margin-bottom: .75rem;
        border-radius: var(--radio);
        background: var(--superficie);
    }
    .tabla td { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 0; }
    .tabla td[data-titulo]::before { content: attr(data-titulo); font-weight: 600; color: var(--suave); font-size: .85rem; }
}

/* ---------- Pantallas anchas ---------- */

@media (min-width: 800px) {
    .solo-movil { display: none; }
    .perfil-texto { display: block; }
    .solo-pc { display: grid !important; }
    .buscador { display: flex; }
    .boton-icono { width: 52px; height: 52px; }
    .superior .perfil-chip { margin-left: .5rem; }
    .solo-movil-bloque { display: none; }

    body { padding: 1rem; }
    .app {
        display: grid;
        grid-template-columns: 270px 1fr;
        min-height: calc(100vh - 2rem);
        border-radius: 36px;
        padding: .75rem;
    }
    .lateral {
        position: sticky;
        top: 1rem;
        height: calc(100vh - 3.5rem);
        width: auto;
        transform: none;
        padding: 1rem 1rem 1rem .5rem;
    }
    .velo { display: none; }

    .principal { min-height: 0; gap: .75rem; }
    .superior { position: static; padding: .25rem .25rem 0; border: 0; gap: .6rem; }
    .superior .conectados-caja { display: block; margin: 0 .75rem 0 auto; }
    .contenido { border-radius: var(--radio-grande); padding: 1.5rem; gap: 1.25rem; }

    .titulo-grande { font-size: 2.4rem; }
    .accesos { grid-template-columns: repeat(2, 1fr); }
    .panel-grilla { display: grid; grid-template-columns: 1.6fr 1fr; gap: 1.25rem; align-items: start; }
    .form-doble { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
    .filtros { grid-template-columns: 2fr 1fr auto; align-items: end; }

    .tabla th { font-size: .8rem; color: var(--suave); font-weight: 600; border-bottom: 1px solid var(--borde); }
    .tabla tbody tr + tr td { border-top: 1px solid var(--borde); }

    .acceso-caja { grid-template-columns: 1fr 1fr; gap: 1.5rem; align-items: stretch; }
    .acceso .tarjeta { padding: 2rem; }
    .acceso-presentacion { padding: 2rem; }
    .acceso-logo { width: 220px; }
    .acceso-presentacion .titulo-grande { font-size: 2.1rem; }
}

@media (min-width: 1200px) {
    .accesos { grid-template-columns: repeat(2, 1fr); }
    .panel-grilla { grid-template-columns: 2fr 1fr; }
}

/* ---------- Agregados ---------- */

[hidden] { display: none !important; }
fieldset.sin-borde { margin: 0; border: 0; min-width: 0; }

/* Lista de datos (perfil, mi cursada) */
.datos { display: grid; grid-template-columns: auto 1fr; gap: .6rem 1rem; margin: 0 0 1rem; }
.datos dt { color: var(--suave); font-size: .9rem; }
.datos dd { margin: 0; font-weight: 600; text-align: right; }

/* Números grandes (matrícula) */
.numeros { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.numero {
    display: grid;
    gap: .1rem;
    padding: 1rem;
    border-radius: var(--radio);
    text-decoration: none;
}
.numero strong { font-size: 2rem; line-height: 1; font-weight: 800; }
.numero span { font-size: .85rem; font-weight: 600; }
.numero.azul { background: var(--azul-suave); color: var(--azul); }
.numero.rojo { background: var(--rojo-suave); color: var(--rojo); }

/* Títulos en el azul del escudo */
.tarjeta-cabeza h2 { color: var(--azul); }
.titulo-grande { color: var(--azul); }

.acceso-caja.angosta { max-width: 460px; width: 100%; margin: 0 auto; grid-template-columns: 1fr; }
.acceso-caja.ancha { max-width: 640px; }
textarea { resize: vertical; min-height: 120px; }

/* Campo trampa para robots: invisible para las personas */
.oculto { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Comprobante de soporte */
.numero-ticket {
    margin: 0;
    padding: 1rem;
    border: 2px dashed var(--rojo);
    border-radius: var(--radio);
    background: var(--rojo-suave);
    color: var(--rojo);
    font-size: clamp(1.6rem, 7vw, 2.2rem);
    font-weight: 800;
    letter-spacing: .05em;
    text-align: center;
}

/* En el celular el panel del escudo se achica para que el formulario se vea sin bajar */
@media (max-width: 799px) {
    .acceso { align-content: start; }
    .acceso-presentacion { padding: .5rem 0 0; gap: .75rem; }
    .acceso-logo { width: 90px; }
    .acceso-presentacion .titulo-grande { font-size: 1.3rem; }
    .acceso-presentacion .bajada,
    .acceso-presentacion .aviso-negro { display: none; }
}

/* ---------- Modo oscuro ---------- */

[data-tema="oscuro"] {
    --fondo: #0b131b;
    --superficie: #131f2a;
    --blanco: #182634;
    --oscuro: #1e6496;
    --texto: #e7edf3;
    --suave: #93a3b3;
    --borde: #263748;
    --azul: #8cc0e6;
    --azul-suave: #1b3346;
    --rojo: #f07a80;
    --rojo-suave: #3a1e25;
    --dorado-suave: #3a3218;
    --dorado-texto: #f0cf6a;
    color-scheme: dark;
}
[data-tema="oscuro"] .boton:hover { background: #2577b1; }
[data-tema="oscuro"] .logo-img,
[data-tema="oscuro"] .acceso-logo { filter: drop-shadow(0 0 1px rgba(255, 255, 255, .6)); }

/* ---------- Personas conectadas ---------- */

.conectados-caja { display: none; }
.conectados {
    display: flex;
    align-items: center;
    padding: 0;
    border: 0;
    background: none;
    cursor: pointer;
}
.pila { display: flex; align-items: center; }
.avatar.mini {
    position: relative;
    width: 46px;
    height: 46px;
    font-size: .85rem;
    box-shadow: 0 0 0 3px var(--blanco);
}
.pila .avatar.mini + .avatar.mini { margin-left: -8px; }
.avatar.color-0 { background: var(--azul-suave); color: var(--azul); }
.avatar.color-1 { background: var(--rojo-suave); color: var(--rojo); }
.avatar.color-2 { background: var(--dorado-suave); color: var(--dorado-texto); }
.avatar.mas {
    background: var(--blanco);
    color: var(--texto);
    font-weight: 600;
    outline: 1.5px dashed var(--borde);
    outline-offset: -1.5px;
}

/* Punto de estado: verde = activo, rojo = inactivo */
.estado {
    position: absolute;
    right: 1px;
    bottom: 1px;
    width: 11px;
    height: 11px;
    border-radius: 50%;
    box-shadow: 0 0 0 2px var(--blanco);
}
.estado.verde { background: #22a565; }
.estado.rojo { background: var(--rojo); }

.desplegable-item.conectado { display: flex; flex-wrap: nowrap; gap: .75rem; }
.desplegable-item.conectado .avatar.mini { width: 38px; height: 38px; font-size: .75rem; box-shadow: none; }
.desplegable-item.conectado small { display: block; }
#lista-conectados { max-height: 60vh; overflow-y: auto; }

/* ---------- Cursos ---------- */

.ciclos { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
a.pastilla.azul { color: #fff; }
.ciclo-nuevo { display: flex; gap: .5rem; margin-left: auto; }
.ciclo-nuevo input { width: 110px; padding: .55rem .8rem; }
.ciclo-nuevo .boton { padding: .55rem 1rem; }

/* Tres columnas: cada fila es un año con sus divisiones A, B y C */
.grilla-cursos { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .75rem; }
.curso {
    display: grid;
    gap: .2rem;
    padding: 1rem;
    border-radius: var(--radio);
    background: var(--superficie);
    text-decoration: none;
}
.curso strong { font-size: 1.4rem; font-weight: 800; color: var(--azul); }
.curso small { color: var(--suave); }
.curso:hover { outline: 2px solid var(--oscuro); }

/* Listas de personas (búsqueda, docentes de un curso) */
.lista-resultados { display: grid; gap: .25rem; }
.resultado { padding: .6rem; border-radius: var(--radio-chico); text-decoration: none; color: inherit; }
.resultado:hover { background: var(--superficie); }
.fila-persona { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.fila-persona form { margin: 0; }
.pastilla .icono, .pastilla svg { width: 14px; height: 14px; }
button.pastilla { cursor: pointer; font: inherit; font-size: .8rem; font-weight: 600; color: var(--texto); }
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: .6rem 1rem; }
@media (min-width: 800px) {
    .filtros.con-cargo { grid-template-columns: 2fr 1fr 1fr auto; }
}
.separado { margin-top: 1rem; }

/* ---------- Soporte y auditoría ---------- */

/* Aviso mientras el superadministrador usa la cuenta de otra persona */
.aviso-soporte {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .6rem 1rem;
    margin: .75rem 1rem 0;
    padding: .75rem 1rem;
    border-radius: var(--radio);
    background: var(--rojo);
    color: #fff;
}
.aviso-soporte form { margin: 0 0 0 auto; }
.aviso-soporte .boton { padding: .55rem 1rem; background: #fff; color: var(--rojo); }
button.pastilla.rojo { color: #fff; }

.paginas { display: flex; align-items: center; justify-content: center; gap: 1rem; }

@media (min-width: 800px) {
    .aviso-soporte { margin: 0 0 .25rem; }
    .filtros.auditoria-filtros { grid-template-columns: 2fr 1.2fr 1fr 1fr auto; }
}
.acciones-fila { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; justify-content: flex-end; }
.acciones-fila form { margin: 0; }

/* ---------- Calendario con eventos ---------- */

.calendario-mes { margin-left: auto; }
.calendario-mes .pastilla .icono { width: 15px; height: 15px; }
.selector-mes { width: 240px; gap: .6rem; padding: .9rem; }
.calendario-nav { display: flex; justify-content: space-between; align-items: center; margin-bottom: .75rem; }
.calendario-nav .boton-icono { width: 36px; height: 36px; font-size: 1.2rem; text-decoration: none; }

a.dia { text-decoration: none; color: inherit; }
.dia.con-evento { font-weight: 700; color: #fff; }
.dia.con-evento.azul { background: var(--azul); }
.dia.con-evento.rojo { background: var(--rojo); }
.dia.con-evento.dorado { background: var(--dorado); color: #3d2e00; }
.dia.hoy.con-evento { box-shadow: 0 0 0 3px var(--oscuro); }
[data-tema="oscuro"] .dia.con-evento.azul { background: #1e6496; }

.eventos-lista { display: grid; gap: .5rem; margin-top: 1rem; }
.evento { display: flex; align-items: center; gap: .75rem; scroll-margin-top: 6rem; }
.evento > span:nth-child(2) { flex: 1; min-width: 0; }
.evento small { display: block; color: var(--suave); }
.evento form { margin: 0; }
.evento-fecha {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    flex: none;
    border-radius: 50%;
    font-weight: 700;
    color: #fff;
}
.evento-fecha.azul { background: var(--azul); }
.evento-fecha.rojo { background: var(--rojo); }
.evento-fecha.dorado { background: var(--dorado); color: #3d2e00; }
.evento:target { outline: 2px solid var(--oscuro); outline-offset: 4px; border-radius: var(--radio-chico); }

/* Buscador de personal */
.selector-persona { position: relative; min-width: 200px; }
.selector-resultados { left: 0; right: auto; width: max(100%, 280px); max-height: 320px; overflow-y: auto; }
.selector-resultados .desplegable-item { display: grid; gap: .1rem; }
.campo { display: grid; gap: .4rem; }
.campo-titulo { font-weight: 600; font-size: .9rem; }

/* ---------- Designaciones e historial ---------- */

.boton.rojo { background: var(--rojo); }
.boton.rojo:hover { background: #7d0e16; }
details.tarjeta summary { cursor: pointer; }
.historial { list-style: none; margin: 0; padding: 0; display: grid; gap: .6rem; }
.historial li {
    position: relative;
    padding: .7rem 1rem .7rem 1.6rem;
    border-radius: var(--radio-chico);
    background: var(--superficie);
}
.historial li::before {
    content: "";
    position: absolute;
    left: .7rem;
    top: 1.1rem;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--suave);
}
.historial li.vigente::before { background: #22a565; }
.historial small { display: block; color: var(--suave); }
td small.ayuda { display: block; }
