/* =====================================================================
   app.css — estilos compartidos (login + portales). Mobile-first.
   ===================================================================== */

:root {
    --azul:        #0b3d91;   /* azul aeronáutico */
    --azul-claro:  #1565c0;
    --celeste:     #e8f0fe;
    --texto:       #1a1a2e;
    --gris:        #6b7280;
    --gris-claro:  #f4f6fb;
    --borde:       #d8dee9;
    --error:       #c0392b;
    --ok:          #1e7e34;
    --radio:       14px;
    --sombra:      0 10px 30px rgba(11, 61, 145, .12);
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    font-family: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
    color: var(--texto);
    background: var(--gris-claro);
    -webkit-font-smoothing: antialiased;
}

/* ---------- Login ---------- */
.login-wrap {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: linear-gradient(160deg, var(--azul) 0%, var(--azul-claro) 100%);
}

.login-card {
    width: 100%;
    max-width: 400px;
    background: #fff;
    border-radius: var(--radio);
    box-shadow: var(--sombra);
    padding: 32px 26px;
    animation: subir .4s ease;
}

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

.login-logo {
    text-align: center;
    margin-bottom: 22px;
}
.login-logo .icono {
    font-size: 42px;
    line-height: 1;
}
/* Logo de la escuela en el login. Alto acotado y `contain` para que entre
   cualquier proporción sin deformarse ni empujar la tarjeta. */
.login-logo .logo-escuela {
    max-height: 72px;
    max-width: 220px;
    width: auto;
    object-fit: contain;
    display: block;
    margin: 0 auto;
}
.login-logo h1 {
    font-size: 1.25rem;
    margin: 8px 0 2px;
    color: var(--azul);
}
.login-logo p {
    margin: 0;
    color: var(--gris);
    font-size: .9rem;
}

.campo { margin-bottom: 16px; }
.campo label {
    display: block;
    font-size: .85rem;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--texto);
}
.campo input {
    width: 100%;
    padding: 13px 14px;
    border: 1.5px solid var(--borde);
    border-radius: 10px;
    font-size: 1rem;
    transition: border-color .15s, box-shadow .15s;
}
.campo input:focus {
    outline: none;
    border-color: var(--azul-claro);
    box-shadow: 0 0 0 3px rgba(21, 101, 192, .15);
}

.btn {
    display: block;
    width: 100%;
    padding: 13px;
    border: none;
    border-radius: 10px;
    background: var(--azul);
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s, transform .05s;
}
.btn:hover  { background: var(--azul-claro); }
.btn:active { transform: scale(.99); }
/* Segunda acción del login (volver al sitio de la escuela): mismo tamaño que el
   botón principal para que la tarjeta no quede despareja, pero sin competirle. */
a.btn { text-decoration: none; text-align: center; box-sizing: border-box; }
.btn-secundario {
    background: #fff;
    color: var(--azul);
    border: 1.5px solid var(--borde);
    margin-top: 10px;
}
.btn-secundario:hover { background: var(--gris-claro); border-color: var(--azul-claro); }

.alerta {
    padding: 11px 14px;
    border-radius: 10px;
    font-size: .9rem;
    margin-bottom: 16px;
}
.alerta-error { background: #fdecea; color: var(--error); border: 1px solid #f5c6cb; }
.alerta-ok    { background: #e6f4ea; color: var(--ok);    border: 1px solid #b7dfc1; }
/* Ni error ni éxito: algo que el admin tiene que decidir (ej. el plan cambió). */
.alerta-aviso { background: #fff8e1; color: #8a6100; border: 1px solid #f0dca0; }
.alerta-aviso strong { color: #6b4b00; }
.alerta-fila  { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* ---------- Portales ---------- */
.portal-top {
    background: var(--azul);
    color: #fff;
    padding: 16px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.portal-top .marca { font-weight: 700; font-size: 1.05rem; }
.portal-top .salir {
    color: #fff;
    text-decoration: none;
    background: rgba(255, 255, 255, .15);
    padding: 8px 14px;
    border-radius: 8px;
    font-size: .9rem;
    border: none;
    cursor: pointer;
    font-family: inherit;
}
.portal-top .salir:hover { background: rgba(255, 255, 255, .28); }

.portal-main { padding: 22px 18px; max-width: 900px; margin: 0 auto; }
.portal-main h2 { margin: 0 0 4px; }
.portal-main .sub { color: var(--gris); margin: 0 0 22px; }

.tarjeta {
    background: #fff;
    border: 1px solid var(--borde);
    border-radius: var(--radio);
    padding: 18px 20px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, .04);
    margin-bottom: 16px;
}
.tarjeta h3 { margin: 0 0 10px; font-size: 1rem; color: var(--azul); }
.dato { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px dashed var(--borde); font-size: .92rem; }
.dato:last-child { border-bottom: none; }
.dato .k { color: var(--gris); }
.dato .v { font-weight: 600; word-break: break-all; }

.badge {
    display: inline-block;
    background: var(--celeste);
    color: var(--azul);
    border-radius: 999px;
    padding: 3px 11px;
    font-size: .78rem;
    font-weight: 600;
    margin: 2px 4px 2px 0;
}

/* =====================================================================
   Layout con sidebar colapsable (portales). Mobile-first.
   ===================================================================== */
:root { --sidebar-min: 60px; --sidebar-max: 262px; }

.sidebar {
    position: fixed;
    top: 0; left: 0;
    height: 100vh; height: 100dvh;
    width: var(--sidebar-min);
    background: var(--azul);
    color: #fff;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 50;
    transition: width .22s ease;
}
/* Desktop: se expande al pasar el mouse (overlay, no empuja el contenido). */
@media (hover: hover) and (min-width: 769px) {
    .sidebar:hover { width: var(--sidebar-max); box-shadow: var(--sombra); }
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 13px;
    height: var(--sidebar-min);
    padding: 0 18px;
    flex-shrink: 0;
    white-space: nowrap;
    border-bottom: 1px solid rgba(255, 255, 255, .1);
}
.sidebar-logo .icono { font-size: 19px; line-height: 1; }
/* El logo de la escuela ocupa el lugar del avioncito. Cuadrado y contenido,
   así entra igual sea apaisado o vertical, y no empuja el ancho del sidebar. */
.sidebar-logo .icono-img { width: 26px; height: 26px; object-fit: contain; flex-shrink: 0;
                           background: #fff; border-radius: 6px; padding: 2px; }
.sidebar-logo .txt   { font-weight: 700; font-size: .92rem; letter-spacing: .3px; opacity: 0; transition: opacity .2s; }

.sidebar-nav { display: flex; flex-direction: column; padding: 8px 0; gap: 2px; overflow-y: auto; overflow-x: hidden; }
.sidebar-nav::-webkit-scrollbar { width: 6px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .2); border-radius: 3px; }
.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 16px;
    height: 44px;
    padding: 0 18px;
    color: rgba(255, 255, 255, .78);
    text-decoration: none;
    font-size: .885rem;
    white-space: nowrap;
    border-left: 3px solid transparent;
    transition: background .15s, color .15s;
}
.sidebar-nav a svg { width: 21px; height: 21px; flex-shrink: 0; }
.sidebar-nav a .etiqueta { opacity: 0; font-weight: 500; letter-spacing: .2px; transition: opacity .2s; }
.sidebar-nav a:hover { background: rgba(255, 255, 255, .09); color: #fff; }
.sidebar-nav a.activo { background: rgba(255, 255, 255, .15); color: #fff; border-left-color: #fff; }
.sidebar-nav a.activo .etiqueta { font-weight: 600; }

/* Texto visible cuando el sidebar está expandido (hover en desktop). */
@media (hover: hover) and (min-width: 769px) {
    .sidebar:hover .sidebar-logo .txt,
    .sidebar:hover .sidebar-nav a .etiqueta { opacity: 1; }
}

/* Contenedor del contenido, desplazado por el ancho mínimo del sidebar. */
.app { margin-left: var(--sidebar-min); min-height: 100vh; display: flex; flex-direction: column; }

.topbar {
    position: sticky;
    top: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: #fff;
    border-bottom: 1px solid var(--borde);
    padding: 12px 18px;
    z-index: 20;
}
.topbar .tb-izq { display: flex; align-items: center; gap: 12px; min-width: 0; }
.topbar .tb-titulo { font-weight: 700; font-size: 1.05rem; color: var(--azul); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .usuario { display: flex; align-items: center; gap: 12px; font-size: .9rem; }
.topbar .usuario .nombre { color: var(--gris); white-space: nowrap; }
/* Identidad: foto + nombre, y es el acceso a Mi perfil. */
.topbar .yo { display: inline-flex; align-items: center; gap: 9px; padding: 4px 10px 4px 4px; border-radius: 999px; text-decoration: none; transition: background .14s ease; }
.topbar .yo:hover { background: var(--azul-claro); }
.topbar .yo .nombre { font-weight: 600; color: var(--texto); }
@media (max-width: 560px) { .topbar .yo { padding: 4px; } }
.topbar .salir {
    background: var(--azul);
    color: #fff;
    text-decoration: none;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: .88rem;
    white-space: nowrap;
    border: none;
    cursor: pointer;
    font-family: inherit;
}
.topbar .salir:hover { background: var(--azul-claro); }
/* Switcher de portal: solo se muestra a quien tiene más de un rol. */
.topbar .switcher { display: inline-flex; align-items: center; gap: 6px; position: relative; }
.topbar .switcher .sw-ico { display: inline-flex; color: var(--gris); pointer-events: none; position: absolute; left: 10px; }
.topbar .switcher .sw-ico svg { width: 15px; height: 15px; }
.topbar .switcher select { padding: 8px 30px 8px 32px; font-size: .85rem; background-position: right 9px center; }
@media (max-width: 560px) { .topbar .usuario .nombre { display: none; } }

.topbar .hamburguesa { display: none; background: none; border: none; cursor: pointer; color: var(--azul); padding: 4px; }
.topbar .hamburguesa svg { width: 26px; height: 26px; display: block; }

.contenido { padding: 22px 18px; max-width: 1000px; width: 100%; margin: 0 auto; }
.contenido h2 { margin: 0 0 4px; }
.contenido .sub { color: var(--gris); margin: 0 0 22px; }

/* En computadora se aprovecha todo el ancho: 20px de margen a cada lado y sin
   tope de 1000px. El sidebar extendido se superpone al contenido (es overlay),
   así que no hace falta reservarle lugar. En mobile queda como estaba. */
@media (min-width: 769px) {
    .contenido { max-width: none; margin: 0; padding: 22px 40px; }
    .topbar { padding: 12px 40px; }
}

.backdrop { display: none; position: fixed; inset: 0; background: rgba(0, 0, 0, .45); z-index: 40; }

/* Mobile: sidebar fuera de pantalla; se abre con el botón ☰. */
@media (max-width: 768px) {
    .sidebar { width: var(--sidebar-max); transform: translateX(-100%); transition: transform .22s ease; }
    .sidebar .sidebar-logo .txt, .sidebar .sidebar-nav a .etiqueta { opacity: 1; }
    .sidebar.abierto { transform: translateX(0); box-shadow: var(--sombra); }
    .app { margin-left: 0; }
    .topbar .hamburguesa { display: inline-flex; }
    .backdrop.visible { display: block; }
}

/* =====================================================================
   Módulo Usuarios — listado, filtros, formularios.
   ===================================================================== */
.barra-acciones { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }

.btn-sec { display: inline-flex; align-items: center; gap: 8px; background: var(--azul); color: #fff; text-decoration: none; border: none; cursor: pointer; padding: 10px 16px; border-radius: 9px; font-size: .9rem; font-weight: 600; }
.btn-sec:hover { background: var(--azul-claro); }
.btn-sec svg { width: 18px; height: 18px; }
.btn-claro { background: #fff; color: var(--azul); border: 1.5px solid var(--borde); }
.btn-claro:hover { background: var(--gris-claro); }

.filtros { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
/* OJO: background-COLOR, no el atajo `background`, que borraría la flecha
   custom del select (background-image) y lo dejaría sin ninguna. */
.filtros input, .filtros select { padding: 10px 12px; border: 1.5px solid var(--borde); border-radius: 9px; font-size: .9rem; background-color: #fff; }
.filtros input[type=search] { flex: 1 1 220px; min-width: 0; }

/* Selects con estilo propio (flecha custom, no el default del navegador).
   Incluye la caja completa para que un <select> suelto —fuera de .campo o de
   .filtros— ya se vea bien: con appearance:none pierde la piel nativa, así que
   sin borde ni padding propios quedaba desnudo. */
select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    font-family: inherit;
    font-size: .9rem;
    color: var(--texto);
    cursor: pointer;
    padding: 10px 34px 10px 12px;
    border: 1.5px solid var(--borde);
    border-radius: 9px;
    background-color: #fff;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 15px;
}
select:focus { outline: none; border-color: var(--azul-claro); box-shadow: 0 0 0 3px rgba(21, 101, 192, .15); }
.filtros select { padding-right: 34px; }
.campo select {
    width: 100%;
    padding: 13px 40px 13px 14px;
    border: 1.5px solid var(--borde);
    border-radius: 10px;
    font-size: 1rem;
    background-color: #fff;
}
.campo select:focus { border-color: var(--azul-claro); box-shadow: 0 0 0 3px rgba(21, 101, 192, .15); }

/* Opción de radio/checkbox apilada, en caja clickeable. Reemplaza al radio
   suelto con texto al lado, que quedaba desalineado al forzarle display:block. */
.opcion-radio {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 10px 12px;
    margin-bottom: 6px;
    border: 1.5px solid var(--borde);
    border-radius: 9px;
    font-size: .9rem;
    color: var(--texto);
    cursor: pointer;
}
.opcion-radio:hover { border-color: var(--azul-claro); background: var(--gris-claro); }
.opcion-radio input { margin: 0; flex: none; accent-color: var(--azul); width: 17px; height: 17px; }
.opcion-radio .op-txt { flex: 1; min-width: 0; }
.opcion-radio .op-monto { font-weight: 700; color: var(--azul); white-space: nowrap; }

/* Inputs de fecha sueltos (fuera de .campo y .filtros). */
.input-fecha {
    padding: 10px 12px;
    border: 1.5px solid var(--borde);
    border-radius: 9px;
    font-size: .9rem;
    font-family: inherit;
    color: var(--texto);
    background: #fff;
}
.input-fecha:focus { outline: none; border-color: var(--azul-claro); box-shadow: 0 0 0 3px rgba(21, 101, 192, .15); }

/* El icono nativo del calendario viene gris deslavado; se le sube el contraste. */
input[type=date]::-webkit-calendar-picker-indicator,
input[type=month]::-webkit-calendar-picker-indicator,
input[type=time]::-webkit-calendar-picker-indicator { cursor: pointer; opacity: .55; }
input[type=date]:hover::-webkit-calendar-picker-indicator,
input[type=month]:hover::-webkit-calendar-picker-indicator,
input[type=time]:hover::-webkit-calendar-picker-indicator { opacity: 1; }

/* Navegador de período: ‹ mes año ▾ › */
.periodo-nav { display: inline-flex; align-items: center; gap: 6px; }
.periodo-nav select { padding: 10px 34px 10px 12px; border: 1.5px solid var(--borde); border-radius: 9px; font-size: .9rem; background-color: #fff; min-width: 172px; }
.periodo-nav .pn-flecha {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border: 1.5px solid var(--borde);
    border-radius: 9px;
    background: #fff;
    color: var(--azul);
    text-decoration: none;
}
.periodo-nav .pn-flecha:hover { border-color: var(--azul-claro); background: var(--celeste); }
.periodo-nav .pn-flecha svg { width: 18px; height: 18px; }

.lista-usuarios { display: flex; flex-direction: column; gap: 10px; }
.u-card { display: flex; align-items: center; gap: 14px; background: #fff; border: 1px solid var(--borde); border-radius: 12px; padding: 14px 16px; flex-wrap: wrap; }
/* ---------- Avatares ----------
   Un solo componente para foto o iniciales: mismas medidas y misma forma, así
   una lista mezclada (que es lo normal) no queda despareja. */
.u-avatar { width: 42px; height: 42px; border-radius: 50%; background: var(--celeste); color: var(--azul); display: flex; align-items: center; justify-content: center; font-weight: 700; flex-shrink: 0; overflow: hidden; font-size: .95rem; letter-spacing: .5px; user-select: none; }
.u-avatar.con-foto { background: var(--borde); }
.u-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.u-avatar.av-sm { width: 30px; height: 30px; font-size: .72rem; }
.u-avatar.av-lg { width: 104px; height: 104px; font-size: 2rem; border: 3px solid #fff; box-shadow: 0 2px 10px rgba(16, 24, 40, .12); }
.u-info { flex: 1 1 200px; min-width: 0; }
.u-info .nom { font-weight: 600; }
.u-info .mail { color: var(--gris); font-size: .85rem; word-break: break-all; }
.u-roles { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.u-acciones { display: flex; gap: 6px; flex-wrap: wrap; }

.btn-mini { display: inline-flex; align-items: center; gap: 5px; font-size: .8rem; padding: 6px 10px; border-radius: 7px; border: 1px solid var(--borde); background: #fff; color: var(--texto); text-decoration: none; cursor: pointer; }
.btn-mini:hover { background: var(--gris-claro); }
.btn-mini.peligro { color: var(--error); border-color: #f0c3c0; }
.btn-mini.peligro:hover { background: #fdecea; }
.btn-mini.exito { color: var(--ok); border-color: #b7dfc1; }
.btn-mini.exito:hover { background: #e6f4ea; }

.estado { display: inline-block; border-radius: 999px; padding: 3px 10px; font-size: .75rem; font-weight: 600; white-space: nowrap; }
.estado-activo { background: #e6f4ea; color: var(--ok); }
.estado-pendiente { background: #fff4e0; color: #b76e00; }
.estado-inactivo { background: #f0f1f4; color: var(--gris); }

.form-card { background: #fff; border: 1px solid var(--borde); border-radius: 14px; padding: 22px; max-width: 660px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 560px) { .form-grid { grid-template-columns: 1fr; } }
.sub-form { font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; color: var(--azul); border-bottom: 1px solid var(--borde); padding-bottom: 6px; margin-top: 6px; }
.roles-check { display: flex; flex-wrap: wrap; gap: 10px; }
.roles-check label { display: flex; align-items: center; gap: 7px; border: 1.5px solid var(--borde); border-radius: 9px; padding: 8px 12px; cursor: pointer; font-size: .9rem; font-weight: 500; }
.roles-check input { width: auto; }
.error-text { color: var(--error); font-size: .8rem; margin-top: 4px; }
.campo input.invalido, .campo select.invalido { border-color: var(--error); }

/* El botón nativo de los file inputs es distinto en cada navegador y desentona
   con todo lo demás. Se lo viste una vez acá y aplica a TODAS las subidas. */
input[type=file] { font-size: .84rem; color: var(--gris); max-width: 100%; }
input[type=file]::file-selector-button {
    font: inherit; font-weight: 600; color: var(--azul); background: var(--azul-claro);
    border: 1px solid var(--borde); border-radius: 8px; padding: 8px 13px; margin-right: 10px;
    cursor: pointer; transition: background .14s ease, border-color .14s ease;
}
input[type=file]::file-selector-button:hover { background: var(--celeste); border-color: #cdd6e6; }
.campo input[type=file] { padding: 9px; border: 1.5px dashed var(--borde); background: #fbfcfe; }
.form-acciones { display: flex; gap: 10px; margin-top: 18px; }
.vacio { text-align: center; color: var(--gris); padding: 40px 20px; background: #fff; border: 1px dashed var(--borde); border-radius: 12px; }
.enlace-box { background: #eef6ff; border: 1px solid #bcd9f5; border-radius: 10px; padding: 12px 14px; margin-bottom: 16px; font-size: .85rem; word-break: break-all; }
.enlace-box strong { color: var(--azul); }
.ficha .dato .v { text-align: right; }

/* Buscador con ícono de lupa */
.buscador { position: relative; flex: 1 1 240px; min-width: 0; display: flex; }
.buscador svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--gris); pointer-events: none; }
.buscador input { width: 100%; padding-left: 38px; }

/* Hover de tarjetas de usuario */
.u-card { transition: box-shadow .15s, transform .15s, border-color .15s; }
.u-card:hover { box-shadow: 0 8px 22px rgba(11, 61, 145, .09); border-color: #c4d4ec; transform: translateY(-1px); }

/* =====================================================================
   Modal
   ===================================================================== */
.modal-overlay {
    position: fixed; inset: 0;
    background: rgba(11, 30, 60, .5);
    backdrop-filter: blur(2px);
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding: 24px 16px;
    z-index: 100;
    overflow-y: auto;
}
.modal-overlay.abierto { display: flex; animation: fadeIn .15s ease; }
.modal {
    background: #fff;
    border-radius: 16px;
    width: 100%;
    max-width: 660px;
    margin: auto;
    box-shadow: 0 24px 60px rgba(0, 0, 0, .25);
    animation: modalUp .2s ease;
}
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--borde); }
.modal-header h3 { margin: 0; color: var(--azul); font-size: 1.1rem; }
.modal-close { background: none; border: none; font-size: 1.7rem; line-height: 1; color: var(--gris); cursor: pointer; padding: 0 4px; }
.modal-close:hover { color: var(--texto); }
.modal-body { padding: 22px; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }

/* Auditoría */
.audit-list { display: flex; flex-direction: column; }
.audit-item { display: flex; gap: 14px; padding: 11px 0; border-bottom: 1px dashed var(--borde); font-size: .88rem; flex-wrap: wrap; }
.audit-item:last-child { border-bottom: none; }
.audit-item .cuando { color: var(--gris); font-size: .8rem; white-space: nowrap; min-width: 130px; }
.audit-item .cuerpo { flex: 1 1 240px; min-width: 0; }
.audit-item .que { font-weight: 600; }
.audit-item .quien { color: var(--gris); font-size: .8rem; }
.audit-item .detalle { color: var(--gris); font-size: .78rem; word-break: break-word; }

/* Estado vencido (documentos) */
.estado-vencido { background: #fdecea; color: var(--error); }

/* Cabecera de perfil con foto */
.perfil-cabecera { display: flex; align-items: center; gap: 16px; }
.pf-foto { width: 72px; height: 72px; border-radius: 50%; overflow: hidden; flex-shrink: 0; background: var(--celeste); display: flex; align-items: center; justify-content: center; }
.pf-foto img { width: 100%; height: 100%; object-fit: cover; }
.pf-iniciales { color: var(--azul); font-weight: 700; font-size: 1.5rem; }
.pf-info { min-width: 0; }
.pf-nom { font-weight: 700; font-size: 1.05rem; }
.pf-mail { color: var(--gris); font-size: .9rem; word-break: break-all; }

/* Lista de documentos del legajo */
.doc-list { display: flex; flex-direction: column; }
.doc-item { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px dashed var(--borde); flex-wrap: wrap; }
.doc-item:last-child { border-bottom: none; }
.doc-item.doc-cma { background: #f6faff; margin: 0 -14px; padding: 12px 14px; border-radius: 10px; border-bottom: none; }

/* Resaltado de controles de mantenimiento por estado */
.doc-item.mant-alerta { background: #fff8ec; border-radius: 10px; padding: 12px; border-bottom: none; box-shadow: inset 4px 0 0 #e0a800; margin-bottom: 4px; }
.doc-item.mant-critico { background: #fdecec; border-radius: 10px; padding: 12px; border-bottom: none; box-shadow: inset 4px 0 0 var(--error); margin-bottom: 4px; }
.doc-item.mant-critico .doc-nom { color: var(--error); }
.doc-ico { width: 26px; height: 26px; color: var(--azul); flex-shrink: 0; }
.doc-info { flex: 1 1 200px; min-width: 0; }
.doc-nom { font-weight: 600; }
.doc-meta { color: var(--gris); font-size: .82rem; }

/* =====================================================================
   Ficha de usuario (detalle) — hero + columnas
   ===================================================================== */
.ficha-hero { background: #fff; border: 1px solid var(--borde); border-radius: 16px; overflow: hidden; margin-bottom: 16px; box-shadow: var(--sombra); }
.ficha-hero .banner { height: 74px; background: linear-gradient(135deg, var(--azul), var(--azul-claro)); }
.ficha-hero .hero-foto { padding: 0 22px; margin-top: -46px; }
.ficha-hero .hero-cuerpo { display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap; align-items: flex-start; padding: 12px 22px 18px; }

.foto-wrap { position: relative; display: inline-block; }
.foto-wrap .foto { width: 94px; height: 94px; border-radius: 50%; border: 4px solid #fff; background: var(--celeste); display: flex; align-items: center; justify-content: center; overflow: hidden; box-shadow: 0 4px 12px rgba(0, 0, 0, .12); }
.foto-wrap .foto img { width: 100%; height: 100%; object-fit: cover; }
.foto-wrap .foto .ini { color: var(--azul); font-weight: 700; font-size: 1.9rem; }
.foto-cam { position: absolute; right: 0; bottom: 2px; width: 30px; height: 30px; border-radius: 50%; background: var(--azul); color: #fff; border: 2px solid #fff; display: flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; }
.foto-cam:hover { background: var(--azul-claro); }
.foto-cam svg { width: 15px; height: 15px; }

.ficha-hero .h-info { flex: 1 1 240px; min-width: 0; }
.ficha-hero .h-nom { font-size: 1.3rem; font-weight: 700; line-height: 1.2; color: var(--texto); }
.ficha-hero .h-mail { color: var(--gris); font-size: .9rem; word-break: break-all; }
.ficha-hero .h-badges { margin-top: 9px; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.ficha-hero .h-acciones { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; padding-top: 4px; }

.chip { display: inline-flex; align-items: center; gap: 5px; border-radius: 999px; padding: 3px 11px; font-size: .76rem; font-weight: 600; }
.chip-cma-vigente { background: #e6f4ea; color: var(--ok); }
.chip-cma-pendiente { background: #fff4e0; color: #b76e00; }
.chip-cma-vencido { background: #fdecea; color: var(--error); }
.chip-cma-none { background: #f0f1f4; color: var(--gris); }

/* ---------- Notificaciones ---------- */
/* Campanita de la barra: el contador es lo único que se ve desde cualquier pantalla. */
.topbar .campana { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 50%; color: var(--azul); text-decoration: none; transition: background .14s ease; }
.topbar .campana:hover { background: var(--azul-claro); }
.topbar .campana svg { width: 19px; height: 19px; }
.topbar .campana .cuenta { position: absolute; top: 1px; right: 0; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: var(--error); color: #fff; font-size: .66rem; font-weight: 700; line-height: 17px; text-align: center; box-shadow: 0 0 0 2px #fff; }

.noti-badge { display: inline-block; min-width: 20px; padding: 1px 7px; border-radius: 10px; background: var(--error); color: #fff; font-size: .72rem; font-weight: 700; vertical-align: middle; margin-left: 6px; }

/* Bandeja desplegable del inicio. Cerrada por defecto: la cabecera ya dice
   cuántos avisos hay, así que informa lo mismo sin ocupar la pantalla. */
.noti-bloque { background: #fff; border: 1px solid var(--borde); border-radius: 14px; margin-bottom: 18px; overflow: hidden; }
.noti-bloque > summary.nb-cab {
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    padding: 13px 16px; cursor: pointer; list-style: none; user-select: none;
    transition: background .12s ease;
}
.noti-bloque > summary.nb-cab::-webkit-details-marker { display: none; }
.noti-bloque > summary.nb-cab:hover { background: var(--gris-claro); }
.noti-bloque[open] > summary.nb-cab { border-bottom: 1px solid var(--borde); }
.noti-bloque .nb-cab h3 { margin: 0; font-size: 1rem; }
.noti-bloque .nb-chevron { flex: none; color: var(--gris); transition: transform .18s ease; }
.noti-bloque .nb-chevron svg { width: 17px; height: 17px; display: block; }
.noti-bloque[open] > .nb-cab .nb-chevron { transform: rotate(90deg); }
.noti-bloque .nb-hint { font-size: .82rem; color: var(--gris); }
/* Empuja las acciones a la derecha y les devuelve el cursor normal. */
.noti-bloque .nb-acc { margin-left: auto; display: inline-flex; gap: 8px; align-items: center; cursor: default; }
.noti-bloque .nb-cuerpo { padding: 4px 18px 16px; }
@media (max-width: 560px) {
    .noti-bloque .nb-hint { display: none; }
    .noti-bloque .nb-acc { margin-left: 0; width: 100%; }
}

.noti-lista { display: flex; flex-direction: column; }
.noti { display: flex; align-items: flex-start; gap: 11px; padding: 12px 2px; border-bottom: 1px solid var(--borde); }
.noti:last-child { border-bottom: none; }
/* El punto de color es el nivel. Sin leer va lleno; leída, hueca y apagada. */
.noti .n-punto { flex-shrink: 0; width: 9px; height: 9px; border-radius: 50%; margin-top: 6px; background: var(--borde); }
.noti.sin-leer.nivel-info .n-punto    { background: var(--azul); }
.noti.sin-leer.nivel-aviso .n-punto   { background: #e67e22; }
.noti.sin-leer.nivel-urgente .n-punto { background: var(--error); }
.noti .n-cuerpo { flex: 1; min-width: 0; }
.noti .n-tit { font-weight: 600; font-size: .92rem; }
.noti:not(.sin-leer) .n-tit { font-weight: 500; color: var(--gris); }
.noti .n-txt { font-size: .84rem; color: var(--gris); margin-top: 2px; }
.noti .n-pie { display: flex; gap: 12px; align-items: center; font-size: .76rem; color: var(--gris); margin-top: 5px; }
.noti .n-acc { flex-shrink: 0; }

/* ---------- Configuración ----------
   Es una pantalla larga de un solo formulario. Lo que la hacía pesada no eran
   los campos sino la falta de jerarquía: tres tarjetas iguales y el botón de
   guardar al final de todo. */
.cfg-wrap { max-width: 960px; }
.cfg-barra { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; background: rgba(255, 255, 255, .93); backdrop-filter: blur(6px); border: 1px solid var(--borde); border-radius: 12px; padding: 12px 16px; margin-bottom: 18px; box-shadow: 0 1px 3px rgba(16, 24, 40, .05); }
.cfg-barra .txt { min-width: 0; }
.cfg-barra .txt strong { display: block; font-size: 1rem; color: var(--azul); }
.cfg-barra .txt span { font-size: .82rem; color: var(--gris); }

.cfg-card { background: #fff; border: 1px solid var(--borde); border-radius: 14px; margin-bottom: 16px; overflow: hidden; }
.cfg-card > .cab { display: flex; align-items: flex-start; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--borde); background: #fbfcfe; }
.cfg-card > .cab .ico { flex-shrink: 0; width: 34px; height: 34px; border-radius: 9px; background: var(--azul-claro); color: var(--azul); display: flex; align-items: center; justify-content: center; }
.cfg-card > .cab .ico svg { width: 18px; height: 18px; }
.cfg-card > .cab h3 { margin: 0; font-size: .98rem; }
.cfg-card > .cab p { margin: 2px 0 0; font-size: .82rem; color: var(--gris); }
.cfg-card > .cuerpo { padding: 18px; }

/* Días operativos y otros toggles: pastillas en vez de checkboxes sueltos. */
.cfg-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.cfg-pills label { position: relative; display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px; border: 1.5px solid var(--borde); border-radius: 999px; font-size: .86rem; font-weight: 600; color: var(--gris); cursor: pointer; user-select: none; transition: all .14s ease; }
.cfg-pills label:hover { border-color: #cdd6e6; background: #fbfcfe; }
.cfg-pills input { position: absolute; opacity: 0; width: 0; height: 0; }
.cfg-pills input:checked + span { color: var(--azul); }
.cfg-pills label:has(input:checked) { border-color: var(--azul); background: var(--azul-claro); color: var(--azul); }
.cfg-pills label:has(input:focus-visible) { box-shadow: 0 0 0 3px rgba(21, 101, 192, .18); }

/* Interruptor con texto explicativo (ej. exigir CMA). */
.cfg-switch { display: flex; align-items: flex-start; gap: 11px; padding: 13px 14px; border: 1.5px solid var(--borde); border-radius: 11px; cursor: pointer; transition: border-color .14s ease, background .14s ease; }
.cfg-switch:hover { border-color: #cdd6e6; }
.cfg-switch:has(input:checked) { border-color: var(--azul); background: var(--azul-claro); }
.cfg-switch input { margin-top: 2px; flex-shrink: 0; }
.cfg-switch .t { font-weight: 600; font-size: .9rem; display: block; }
.cfg-switch .d { font-size: .8rem; color: var(--gris); }

/* Un tipo de recurso dentro de Horarios. */
.cfg-tipo { border: 1px solid var(--borde); border-radius: 11px; padding: 14px 16px; margin-bottom: 12px; }
.cfg-tipo:last-child { margin-bottom: 0; }
.cfg-tipo > .nom { font-weight: 700; font-size: .88rem; color: var(--azul); margin-bottom: 12px; }
.cfg-grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
@media (max-width: 720px) { .cfg-grid4 { grid-template-columns: repeat(2, 1fr); } }

/* Logo de la escuela: previsualización + subida. */
.cfg-logo { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.cfg-logo .prev { width: 132px; height: 82px; border: 1.5px dashed var(--borde); border-radius: 10px; display: flex; align-items: center; justify-content: center; background: #fbfcfe; overflow: hidden; flex-shrink: 0; }
.cfg-logo .prev img { max-width: 100%; max-height: 100%; object-fit: contain; }
.cfg-logo .prev .nada { font-size: .74rem; color: var(--gris); }
.cfg-logo .lado { flex: 1; min-width: 230px; }

/* ---------- Mi perfil: cabecera de identidad ---------- */
.perfil-hero { display: flex; gap: 20px; align-items: flex-start; flex-wrap: wrap; background: linear-gradient(180deg, var(--azul-claro) 0%, #fff 78%); border: 1px solid var(--borde); border-radius: 14px; padding: 20px 22px; margin-bottom: 18px; }
.perfil-hero .ph-foto { flex-shrink: 0; }
.perfil-hero .ph-datos { flex: 1; min-width: 240px; }
.perfil-hero h3 { margin: 0 0 2px; font-size: 1.2rem; }
.perfil-hero .ph-mail { color: var(--gris); font-size: .88rem; }
.perfil-hero .ph-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 14px; }
.perfil-hero .ph-foto-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.perfil-hero .ph-ayuda { display: block; margin-top: 8px; color: var(--gris); font-size: .78rem; }

.ficha-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.ficha-grid .col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.ficha-grid .tarjeta { margin-bottom: 0; }
@media (max-width: 820px) { .ficha-grid { grid-template-columns: 1fr; } }

.tarjeta h3 .h-ico { width: 17px; height: 17px; vertical-align: -3px; margin-right: 6px; color: var(--azul); }

.info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 18px; }
.info-grid .full { grid-column: 1 / -1; }
.info-item .lbl { font-size: .72rem; text-transform: uppercase; letter-spacing: .4px; color: var(--gris); margin-bottom: 2px; }
.info-item .val { font-weight: 600; word-break: break-word; }
@media (max-width: 460px) { .info-grid { grid-template-columns: 1fr; } }

/* =====================================================================
   Grilla de recursos (aeronaves.php) — cards clickeables
   ===================================================================== */
.rec-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(245px, 1fr)); gap: 16px; }
.rec-card { background: #fff; border: 1px solid var(--borde); border-radius: 14px; overflow: hidden; cursor: pointer; display: flex; flex-direction: column; transition: box-shadow .15s, transform .15s, border-color .15s; }
.rec-card:hover { box-shadow: 0 12px 28px rgba(11, 61, 145, .13); transform: translateY(-3px); border-color: #c4d4ec; }
.rec-foto { position: relative; height: 158px; background: linear-gradient(135deg, #eaf1fb, #f7f9fd); display: flex; align-items: center; justify-content: center; }
.rec-foto img { width: 100%; height: 100%; object-fit: cover; }
.rec-foto .ph { width: 56px; height: 56px; color: var(--azul); opacity: .35; }
.rec-foto .rec-estado { position: absolute; top: 10px; right: 10px; box-shadow: 0 1px 4px rgba(0, 0, 0, .12); }
.rec-body { padding: 14px 16px 8px; display: flex; flex-direction: column; gap: 3px; flex: 1; }
.rec-titulo { font-weight: 700; font-size: 1.08rem; line-height: 1.2; word-break: break-word; color: var(--texto); }
.rec-sub { color: var(--gris); font-size: .85rem; }
.rec-meta { color: var(--azul); font-size: .82rem; font-weight: 600; margin-top: 2px; }
.rec-acciones { display: flex; gap: 6px; padding: 0 14px 14px; flex-wrap: wrap; }

/* Paginación */
.paginacion { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; margin-top: 18px; }
.pg-link { display: inline-flex; align-items: center; justify-content: center; min-width: 36px; height: 36px; padding: 0 10px; border: 1px solid var(--borde); border-radius: 8px; background: #fff; color: var(--texto); text-decoration: none; font-size: .9rem; }
.pg-link:hover { background: var(--gris-claro); }
.pg-link.activo { background: var(--azul); color: #fff; border-color: var(--azul); font-weight: 600; }
.pg-link.disabled { color: #c0c4cc; cursor: default; }
.pg-ell { display: inline-flex; align-items: center; padding: 0 4px; color: var(--gris); }

/* Enlace "Ver todo" al pie de una card */
.ver-todo { display: inline-block; margin-top: 10px; color: var(--azul); font-size: .85rem; font-weight: 600; text-decoration: none; }
.ver-todo:hover { text-decoration: underline; }

/* ===== Planificador de reservas ===== */
.plan-toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }
.plan-toolbar .crece { flex: 1; }
.seg { display: inline-flex; border: 1.5px solid var(--borde); border-radius: 9px; overflow: hidden; }
.seg a { padding: 8px 14px; font-size: .85rem; font-weight: 600; color: var(--azul); text-decoration: none; background: #fff; }
.seg a + a { border-left: 1.5px solid var(--borde); }
.seg a.activo { background: var(--azul); color: #fff; }
.plan-nav { display: inline-flex; align-items: center; gap: 6px; }
.plan-nav a { display: inline-flex; align-items: center; justify-content: center; min-width: 34px; height: 34px; padding: 0 10px; border: 1.5px solid var(--borde); border-radius: 8px; background: #fff; color: var(--azul); text-decoration: none; font-weight: 600; font-size: .85rem; }
.plan-nav a:hover { background: var(--gris-claro); }
.plan-rango { font-weight: 700; color: var(--azul); padding: 0 6px; }

.plan-scroll { overflow-x: auto; border: 1px solid var(--borde); border-radius: 12px; background: #fff; -webkit-overflow-scrolling: touch; }
table.plan-grid { border-collapse: collapse; width: 100%; min-width: 560px; }
table.plan-grid th, table.plan-grid td { border: 1px solid var(--borde); padding: 0; vertical-align: top; }
table.plan-grid thead th { background: var(--gris-claro); color: var(--azul); font-size: .8rem; padding: 8px 6px; text-align: center; }
table.plan-grid thead th small { display: block; color: var(--gris); font-weight: 400; }
table.plan-grid thead th.hoy-col { background: var(--celeste); }
.col-hora { width: 60px; }
td.hora, th.col-hora { background: var(--gris-claro); color: var(--gris); font-size: .76rem; text-align: center; padding: 4px 6px; white-space: nowrap; font-weight: 600; }
td.celda { height: 46px; min-width: 96px; }
td.no-op { background: repeating-linear-gradient(45deg, #f7f8fb, #f7f8fb 6px, #eef0f5 6px, #eef0f5 12px); }
table.plan-grid td.bloq-band { background: repeating-linear-gradient(45deg, #f3f4f8, #f3f4f8 8px, #e7e9f1 8px, #e7e9f1 16px); color: var(--gris); font-size: .74rem; font-weight: 600; text-align: center; letter-spacing: .3px; padding: 7px; }
table.plan-grid td.bloq-cell { background: repeating-linear-gradient(45deg, #f3f4f8, #f3f4f8 7px, #e7e9f1 7px, #e7e9f1 14px); }
table.plan-grid td.fuera { background: #fafbfd; }
table.plan-grid tr.fila-bloq td.hora { color: var(--gris); font-style: italic; }
td.celda.libre { cursor: pointer; }
td.celda.libre:hover { background: var(--celeste); }

.res-block { display: block; height: 100%; min-height: 56px; padding: 5px 7px; border-radius: 7px; font-size: .76rem; line-height: 1.25; cursor: pointer; border-left: 4px solid var(--azul); background: var(--celeste); color: var(--texto); overflow: hidden; }
.res-block .r-tit { font-weight: 700; color: var(--azul); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.res-block .r-sub { color: var(--gris); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.res-block.estado-realizada { background: #e6f4ea; border-left-color: var(--ok); }
.res-block.estado-realizada .r-tit { color: var(--ok); }
.res-block.estado-ausente { background: #fdecea; border-left-color: var(--error); }
.res-block.estado-ausente .r-tit { color: var(--error); text-decoration: line-through; }
.res-block .r-falta { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #e67e22; margin-left: 3px; vertical-align: middle; }
/* Tercera línea del bloque: quién más va en el turno (instructor, piloto de seguridad). */
.res-block .r-ins { display: block; color: var(--gris); font-size: .72rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.res-block .r-ins .ico { width: 11px; height: 11px; vertical-align: -1px; }
.res-block .r-ins .r-sin { color: #b76e00; font-style: italic; }

.res-leyenda { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 12px; font-size: .78rem; color: var(--gris); align-items: center; }
.res-leyenda .lg { display: inline-flex; align-items: center; gap: 6px; }
.res-leyenda .sw { width: 16px; height: 14px; border-radius: 4px; border-left: 3px solid var(--azul); background: var(--celeste); }
.res-leyenda .sw.realizada { border-left-color: var(--ok); background: #e6f4ea; }
.res-leyenda .sw.ausente { border-left-color: var(--error); background: #fdecea; }
.res-leyenda .sw.falta { background: #e67e22; border: none; border-radius: 50%; width: 9px; height: 9px; }

/* ===== KPIs (compactos, modernos) ===== */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(178px, 1fr)); gap: 12px; margin-bottom: 18px; }
.kpi { display: flex; align-items: flex-start; gap: 11px; background: #fff; border: 1px solid var(--borde); border-radius: 13px; padding: 13px 14px; box-shadow: 0 1px 3px rgba(16, 24, 40, .04); transition: box-shadow .14s ease, transform .14s ease, border-color .14s ease; }
.kpi:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(11, 61, 145, .09); border-color: #cdd6e6; }
.kpi-ico { width: 32px; height: 32px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; background: var(--celeste); color: var(--azul); flex-shrink: 0; }
.kpi-ico .ico { width: 16px; height: 16px; }
.kpi.ok .kpi-ico { background: #e6f4ea; color: var(--ok); }
.kpi.warn .kpi-ico { background: #fff4e0; color: #b76e00; }
.kpi.error .kpi-ico { background: #fdecea; color: var(--error); }
/* ---------------------------------------------------------------------
   Planillas de seguimiento: la grilla de ítems y los pads de firma.
   --------------------------------------------------------------------- */
.pl-seccion { margin: 20px 0 8px; padding: 8px 12px; background: var(--celeste); border-left: 4px solid var(--azul);
              border-radius: 0 8px 8px 0; font-size: .92rem; font-weight: 700; color: var(--azul); }
.pl-item { display: grid; grid-template-columns: 1fr auto minmax(180px, 1fr); gap: 10px; align-items: center;
           padding: 9px 12px; border-bottom: 1px solid #eef1f6; }
.pl-item:last-child { border-bottom: none; }
.pl-item .pl-txt { font-size: .9rem; min-width: 0; }
.pl-valores { display: inline-flex; gap: 4px; flex-shrink: 0; }

/* Los tres valores son radios: se ven como botones y solo uno puede quedar. */
.pl-valores label { position: relative; }
.pl-valores input { position: absolute; opacity: 0; width: 0; height: 0; }
.pl-valores span { display: inline-block; padding: 5px 11px; border: 1.5px solid var(--borde); border-radius: 8px;
                   font-size: .78rem; font-weight: 700; cursor: pointer; background: #fff; color: var(--gris);
                   transition: background .12s, border-color .12s, color .12s; user-select: none; }
.pl-valores input:focus-visible + span { box-shadow: 0 0 0 3px rgba(21, 101, 192, .25); }
.pl-valores input:checked + span.v-nr  { background: #f0f1f4; border-color: #cfd4de; color: var(--gris); }
.pl-valores input:checked + span.v-std { background: #e6f4ea; border-color: var(--ok); color: var(--ok); }
.pl-valores input:checked + span.v-no  { background: #fdecea; border-color: var(--error); color: var(--error); }

.pl-item input[type="text"] { width: 100%; height: 34px; border: 1.5px solid var(--borde); border-radius: 8px;
                              padding: 0 10px; font-size: .84rem; }

.firma-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; margin-top: 8px; }
.firma-pad { border: 1.5px solid var(--borde); border-radius: 11px; padding: 10px; background: #fff; }
.firma-pad .fp-tit { font-size: .8rem; font-weight: 700; color: var(--gris); margin-bottom: 6px; }
.firma-pad canvas { width: 100%; height: 150px; border: 1px dashed var(--borde); border-radius: 8px;
                    background: #fcfdff; touch-action: none; cursor: crosshair; display: block; }
.firma-pad .fp-pie { display: flex; justify-content: space-between; align-items: center; margin-top: 7px; gap: 8px; }
.firma-pad .fp-ayuda { font-size: .74rem; color: var(--gris); }

/* Firma ya guardada, en la vista de consulta. */
.firma-hecha { border: 1px solid var(--borde); border-radius: 9px; padding: 8px; background: #fff; }
.firma-hecha img { width: 100%; max-width: 260px; height: auto; display: block; }

@media (max-width: 620px) {
    .pl-item { grid-template-columns: 1fr; gap: 7px; }
    .pl-valores { justify-content: flex-start; }
}

/* Pestañas de Historiales: son <a> reales, así que andan también sin JS. */
.tabs-hist { display: flex; gap: 4px; border-bottom: 1.5px solid var(--borde); margin-bottom: 16px; flex-wrap: wrap; }
.tabs-hist a {
    padding: 9px 16px; font-size: .9rem; font-weight: 600; color: var(--gris);
    text-decoration: none; border-bottom: 2.5px solid transparent; margin-bottom: -1.5px;
    border-radius: 8px 8px 0 0; transition: color .12s, background .12s;
}
.tabs-hist a:hover { color: var(--azul); background: var(--celeste); }
.tabs-hist a.activa { color: var(--azul); border-bottom-color: var(--azul); }

/* KPI que además filtra: es un <a>, así que hay que sacarle el look de enlace. */
.kpi-link { text-decoration: none; color: inherit; cursor: pointer; }
.kpi-link.kpi-activo { border-color: var(--azul); box-shadow: 0 0 0 2px rgba(11, 61, 145, .12); }
.kpi-link.kpi-activo .k { color: var(--azul); }

.kpi-body { min-width: 0; flex: 1; }
.kpi .k { color: var(--gris); font-size: .68rem; font-weight: 600; text-transform: uppercase; letter-spacing: .4px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi .v { font-size: 1.35rem; font-weight: 700; color: var(--texto); line-height: 1.2; margin-top: 4px; display: block; white-space: nowrap; font-variant-numeric: tabular-nums; letter-spacing: -.4px; }
.kpi.error .v { color: var(--error); }
.kpi.ok .v { color: var(--ok); }
.kpi .sub { font-size: .7rem; color: var(--gris); margin-top: 1px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ===== Gráficos ===== */
.charts-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; }
.chart-card { background: #fff; border: 1px solid #eef0f5; border-radius: 14px; padding: 16px 18px; box-shadow: 0 1px 3px rgba(16, 24, 40, .04); }
.chart-card h3 { margin: 0 0 14px; padding-bottom: 11px; border-bottom: 1px solid #f0f2f7; font-size: .82rem; color: #475467; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; }
.chart-wrap { width: 100%; overflow-x: auto; }
svg.chart { width: 100%; height: auto; display: block; }
svg.chart .bar { transition: opacity .12s; cursor: pointer; }
svg.chart .bar:hover { opacity: .8; }
svg.chart .bar-val { font-size: 10.5px; font-weight: 600; fill: #667085; }
svg.chart .bar-lbl { font-size: 10.5px; fill: #98a2b3; }
.chart-vacio { text-align: center; color: var(--gris); padding: 30px 10px; font-size: .9rem; }

.hbars { display: flex; flex-direction: column; gap: 10px; }
.hbar { display: grid; grid-template-columns: 130px 1fr auto; align-items: center; gap: 10px; }
.hb-lbl { font-size: .85rem; color: var(--texto); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hb-track { background: var(--gris-claro); border-radius: 8px; height: 16px; overflow: hidden; }
.hb-fill { display: block; height: 100%; border-radius: 8px; background: linear-gradient(90deg, #1565c0, #0b3d91); cursor: pointer; transition: filter .12s; }
.hb-fill:hover { filter: brightness(1.12); }
.hb-val { font-size: .82rem; font-weight: 700; color: var(--azul); white-space: nowrap; }

.dona-wrap { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
svg.dona { width: 150px; height: 150px; flex-shrink: 0; }
svg.dona .seg { cursor: pointer; transition: opacity .12s; }
svg.dona .seg:hover { opacity: .82; }
svg.dona .dona-tot { font-size: 17px; font-weight: 800; fill: var(--texto); }
svg.dona .dona-sub { font-size: 9px; fill: var(--gris); text-transform: uppercase; letter-spacing: .4px; }
.dona-leg { display: flex; flex-direction: column; gap: 8px; font-size: .85rem; }
.dona-leg .dl { display: flex; align-items: center; gap: 8px; }
.dona-leg .dot { width: 12px; height: 12px; border-radius: 3px; flex-shrink: 0; }

.chart-tip { position: fixed; z-index: 9999; background: #1a1a2e; color: #fff; padding: 6px 10px; border-radius: 7px; font-size: .8rem; font-weight: 600; pointer-events: none; box-shadow: 0 6px 20px rgba(0,0,0,.25); white-space: nowrap; }

/* ===== Lista de cargos para aplicar un pago ===== */
.pend-list { display: flex; flex-direction: column; gap: 4px; max-height: 210px; overflow-y: auto; border: 1px solid var(--borde); border-radius: 10px; padding: 7px; }
.pend-item { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 8px; cursor: pointer; font-size: .88rem; }
.pend-item:hover { background: var(--gris-claro); }
.pend-con { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pend-mon { font-weight: 700; color: var(--error); white-space: nowrap; }

/* ===== Tabla de datos genérica ===== */
.tabla-scroll { overflow-x: auto; border: 1px solid var(--borde); border-radius: 12px; background: #fff; box-shadow: 0 4px 16px rgba(11, 61, 145, .06); }
table.tabla { width: 100%; border-collapse: collapse; min-width: 720px; }
table.tabla th { background: var(--gris-claro); color: var(--azul); text-align: left; font-size: .74rem; text-transform: uppercase; letter-spacing: .3px; padding: 10px 12px; white-space: nowrap; }
table.tabla td { padding: 10px 12px; border-top: 1px solid var(--borde); font-size: .9rem; vertical-align: middle; }
table.tabla tr.anulada td:not(.acc) { color: var(--gris); text-decoration: line-through; }
table.tabla .acc { display: flex; gap: 6px; white-space: nowrap; }
.chip-mini { display: inline-block; padding: 2px 8px; border-radius: 20px; font-size: .72rem; font-weight: 700; background: var(--celeste); color: var(--azul); }
.chip-mini.anu { background: #fdecea; color: var(--error); }

/* =====================================================================
   Portales cliente — Turnos: mis turnos + reserva en tres pasos
   ===================================================================== */

.sec-titulo { display: flex; align-items: center; gap: 9px; margin: 26px 0 12px; font-size: 1.05rem; color: var(--azul); }
.sec-titulo:first-of-type { margin-top: 8px; }
.sec-titulo .cuenta { display: inline-flex; align-items: center; justify-content: center; min-width: 23px; height: 23px; padding: 0 7px; border-radius: 999px; background: var(--celeste); color: var(--azul); font-size: .78rem; font-weight: 700; }

/* --- Tarjetas de turnos próximos --- */
.turnos-lista { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }
.turno-card {
    display: flex;
    align-items: center;
    gap: 14px;
    background: #fff;
    border: 1px solid var(--borde);
    border-left: 4px solid var(--azul);
    border-radius: 13px;
    padding: 13px 15px;
    box-shadow: 0 3px 12px rgba(11, 61, 145, .05);
}
.turno-card.hoy { border-left-color: var(--ok); background: #fbfffc; }
.turno-fecha { display: flex; flex-direction: column; align-items: center; min-width: 52px; flex: none; line-height: 1.1; }
.turno-fecha .dow { font-size: .68rem; text-transform: uppercase; letter-spacing: .07em; color: var(--gris); }
.turno-fecha .d { font-size: 1.65rem; font-weight: 800; color: var(--azul); }
.turno-fecha .m { font-size: .68rem; text-transform: uppercase; color: var(--gris); }
.turno-info { flex: 1; min-width: 0; }
.turno-hora { font-size: 1.02rem; color: var(--texto); }
.turno-rec { font-weight: 700; color: var(--azul); margin-top: 1px; }
.turno-meta { font-size: .8rem; color: var(--gris); margin-top: 3px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.turno-acc { flex: none; }
.turno-nota { display: block; font-size: .72rem; color: var(--gris); text-align: right; line-height: 1.35; }

/* --- Pasos de la reserva --- */
.paso { background: #fff; border: 1px solid var(--borde); border-radius: 14px; padding: 16px 18px; margin-bottom: 12px; }
.paso-cab { display: flex; align-items: center; gap: 10px; margin-bottom: 13px; flex-wrap: wrap; }
.paso-cab h4 { margin: 0; font-size: .98rem; color: var(--texto); }
.paso-num { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; flex: none; border-radius: 50%; background: var(--azul); color: #fff; font-size: .82rem; font-weight: 700; }

/* Paso 1: recursos como tarjetas con foto */
.rsv-recursos { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 12px; }
.rsv-rec { display: block; border: 2px solid var(--borde); border-radius: 13px; overflow: hidden; background: #fff; text-decoration: none; color: inherit; transition: border-color .14s, transform .1s, box-shadow .14s; }
.rsv-rec:hover { border-color: var(--azul-claro); transform: translateY(-2px); box-shadow: 0 6px 18px rgba(11, 61, 145, .12); }
.rsv-rec.sel { border-color: var(--azul); box-shadow: 0 0 0 3px rgba(21, 101, 192, .16); }
.rsv-rec .foto { position: relative; display: flex; align-items: center; justify-content: center; height: 92px; background: var(--gris-claro) center / cover no-repeat; color: var(--azul-claro); }
.rsv-rec .foto svg { width: 34px; height: 34px; opacity: .55; }
/* El tilde está siempre en el DOM (el JS solo cambia la clase .sel de la tarjeta). */
.rsv-rec .foto .tilde { position: absolute; top: 7px; right: 7px; display: none; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 50%; background: var(--azul); color: #fff; }
.rsv-rec.sel .foto .tilde { display: inline-flex; }
.rsv-rec .foto .tilde .ico { width: 15px; height: 15px; }
.rsv-rec .cuerpo { display: block; padding: 9px 11px 11px; }
.rsv-rec .tit { display: block; font-weight: 700; color: var(--azul); }
.rsv-rec .meta { display: block; font-size: .76rem; color: var(--gris); }
.rsv-rec .tarifa { display: inline-block; margin-top: 5px; font-size: .74rem; font-weight: 700; background: var(--celeste); color: var(--azul); padding: 2px 8px; border-radius: 20px; }

/* Paso 2: tira de días. El degradado del borde avisa que sigue hacia el costado. */
.rsv-dias-wrap { position: relative; }
.rsv-dias-wrap::after {
    content: '';
    position: absolute;
    top: 0; right: 0; bottom: 8px;
    width: 30px;
    background: linear-gradient(to right, rgba(255, 255, 255, 0), #fff);
    pointer-events: none;
}
.rsv-dias { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 8px; scrollbar-width: thin; scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; }
.rsv-dia { scroll-snap-align: center; }
.rsv-dia { flex: none; width: 76px; display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 9px 5px; border: 1.5px solid var(--borde); border-radius: 12px; background: #fff; text-decoration: none; color: inherit; transition: border-color .14s, transform .1s; }
.rsv-dia:hover { border-color: var(--azul-claro); transform: translateY(-2px); }
.rsv-dia .dow { font-size: .68rem; text-transform: uppercase; letter-spacing: .06em; color: var(--gris); }
.rsv-dia .num { font-size: 1.32rem; font-weight: 800; color: var(--azul); line-height: 1.05; }
.rsv-dia .mes { font-size: .66rem; text-transform: uppercase; color: var(--gris); }
.rsv-dia .libres { margin-top: 3px; font-size: .66rem; font-weight: 700; color: var(--ok); }
/* Separador de mes: la tira llega hasta fin de mes (o del siguiente) y sin esto
   es una hilera larga de números donde uno se pierde. */
.rsv-mes-sep { flex: none; align-self: stretch; display: flex; align-items: center; padding: 0 4px; }
.rsv-mes-sep span { writing-mode: vertical-rl; text-orientation: mixed; font-size: .64rem; font-weight: 800; text-transform: uppercase; letter-spacing: .1em; color: var(--azul); background: var(--azul-claro); border-radius: 6px; padding: 8px 3px; }
/* Cuándo se abre el mes que viene. Al lado del paso, no dentro de la tira:
   adentro habría que scrollear hasta el final para encontrarlo. */
.rsv-aviso-mes { margin-left: auto; font-size: .78rem; font-weight: 600; color: #8a6100; background: #fff8e1; border: 1px solid #f0dca0; border-radius: 999px; padding: 5px 12px; }
@media (max-width: 560px) { .rsv-aviso-mes { margin: 6px 0 0; width: 100%; text-align: center; } }

.rsv-dia.sel { background: var(--azul); border-color: var(--azul); }
.rsv-dia.sel .dow, .rsv-dia.sel .num, .rsv-dia.sel .mes, .rsv-dia.sel .libres { color: #fff; }
.rsv-dia.lleno .libres, .rsv-dia.cerrado .libres { color: var(--gris); }
.rsv-dia.cerrado { opacity: .5; pointer-events: none; }

/* Paso 3: horarios agrupados por franja */
.rsv-franja { margin-bottom: 14px; }
.rsv-franja h5 { margin: 0 0 8px; font-size: .78rem; text-transform: uppercase; letter-spacing: .07em; color: var(--gris); }
.slot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; }
.slot {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
    padding: 11px 8px;
    border-radius: 11px;
    font-family: inherit;
    border: 1.5px solid var(--borde);
}
.slot .hh { font-size: 1.02rem; font-weight: 700; }
.slot .hasta { font-size: .68rem; }
.slot.libre { background: #fff; color: var(--azul); cursor: pointer; transition: background .12s, border-color .12s, transform .08s, box-shadow .12s; }
.slot.libre .hasta { color: var(--gris); }
.slot.libre:hover { background: var(--celeste); border-color: var(--azul); transform: translateY(-2px); box-shadow: 0 5px 14px rgba(11, 61, 145, .13); }
.slot.ocupado { background: var(--gris-claro); color: #9aa3b2; cursor: not-allowed; border-style: dashed; }
.slot.ocupado .hasta { color: #b3bac6; }

/* Resumen dentro del modal de confirmación */
.rsv-resumen { display: flex; flex-direction: column; gap: 2px; background: var(--celeste); border-radius: 11px; padding: 12px 14px; margin-bottom: 14px; }
.rsv-resumen .rr-rec { font-weight: 800; color: var(--azul); font-size: 1.05rem; }
.rsv-resumen .rr-cuando { color: var(--texto); font-size: .92rem; }
.rsv-resumen.peligro { background: #fdecea; }
.rsv-resumen.peligro .rr-rec { color: var(--error); }

/* Mientras se refresca una sección por fetch. `.seccion-viva` cubre a todas las
   que se cablean por atributos; `.paso` son los pasos de reserva del alumno. */
.paso.cargando,
.seccion-viva.cargando { opacity: .5; pointer-events: none; transition: opacity .12s; }

/* ---------------------------------------------------------------------
   Turnos en mobile: menos apretado y con blancos de toque más grandes.
   --------------------------------------------------------------------- */
@media (max-width: 600px) {
    .sec-titulo { margin: 20px 0 10px; font-size: 1rem; }

    /* Una tarjeta por fila y la acción abajo, a lo ancho. */
    .turnos-lista { grid-template-columns: 1fr; }
    .turno-card { flex-wrap: wrap; padding: 12px 13px; gap: 12px; }
    .turno-info { flex: 1 1 auto; min-width: 0; }
    .turno-acc { flex: 1 0 100%; }
    .turno-acc .btn-mini { width: 100%; justify-content: center; padding: 10px; }
    .turno-nota { text-align: center; }

    /* Los pasos respiran menos y el número no se come el título. */
    .paso { padding: 13px 13px 15px; border-radius: 12px; }
    .paso-cab { margin-bottom: 11px; gap: 8px; }
    .paso-cab h4 { font-size: .92rem; }

    /* Tarjetas de recurso: 2 por fila cómodas, con la foto más baja. */
    .rsv-recursos { grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 9px; }
    .rsv-rec .foto { height: 70px; }
    .rsv-rec .cuerpo { padding: 8px 9px 10px; }
    .rsv-rec .tit { font-size: .92rem; }
    .rsv-rec .meta { font-size: .72rem; }

    /* La tira de días se despega de los bordes del paso para que se note el scroll. */
    .rsv-dias-wrap { margin: 0 -13px; }
    .rsv-dias { padding: 2px 13px 8px; }
    .rsv-dias-wrap::after { width: 22px; }

    /* Horarios: objetivos de toque de 56px. */
    .slot-grid { grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 7px; }
    .slot { padding: 13px 6px; min-height: 56px; }
    .slot .hh { font-size: 1.05rem; }
}

/* En pantallas muy chicas, una sola columna de recursos deja leer el modelo. */
@media (max-width: 380px) {
    .rsv-recursos { grid-template-columns: 1fr 1fr; }
    .slot-grid { grid-template-columns: 1fr 1fr; }
}

/* Modales como hoja inferior en mobile: se alcanzan con el pulgar. */
@media (max-width: 560px) {
    .modal-overlay { padding: 0; align-items: flex-end; }
    .modal {
        max-width: none;
        margin: 0;
        border-radius: 18px 18px 0 0;
        max-height: 92vh;
        overflow-y: auto;
        animation: hojaSube .22s ease;
    }
    .modal-header { position: sticky; top: 0; background: #fff; z-index: 1; padding: 15px 18px; border-radius: 18px 18px 0 0; }
    .modal-body { padding: 18px; }
    /* La acción principal, abajo y a lo ancho. */
    .form-acciones { flex-direction: column-reverse; }
    .form-acciones > .btn-sec { width: 100%; justify-content: center; padding: 13px 16px; }
}
@keyframes hojaSube { from { transform: translateY(100%); } to { transform: translateY(0); } }

/* Historial plegable */
.historial { margin-top: 24px; }
.historial > summary { cursor: pointer; font-weight: 600; color: var(--azul); padding: 10px 14px; background: #fff; border: 1px solid var(--borde); border-radius: 10px; list-style: none; }
.historial > summary::-webkit-details-marker { display: none; }
.historial > summary::before { content: '▸ '; }
.historial[open] > summary::before { content: '▾ '; }
.historial > summary:hover { background: var(--gris-claro); }

/* ===== Cursos y planes de estudio ===== */
.fase-card { background: #fff; border: 1px solid var(--borde); border-radius: 14px; margin-bottom: 14px; overflow: hidden; box-shadow: 0 4px 16px rgba(11, 61, 145, .06); }
.fase-cab { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 14px 16px; background: var(--gris-claro); border-bottom: 1px solid var(--borde); }

/* --- La fase como acordeón (details/summary nativo) --- */
details.fase-card > summary.fase-cab {
    cursor: pointer;
    list-style: none;
    user-select: none;
    transition: background .12s;
}
details.fase-card > summary.fase-cab::-webkit-details-marker { display: none; }
details.fase-card > summary.fase-cab:hover { background: #e9edf5; }
/* Cerrada, la cabecera es el único borde: sin línea colgando. */
details.fase-card:not([open]) > summary.fase-cab { border-bottom: none; }
.fase-chevron { flex: none; color: var(--gris); transition: transform .18s ease; }
.fase-chevron svg { width: 18px; height: 18px; display: block; }
details.fase-card[open] > .fase-cab .fase-chevron { transform: rotate(90deg); }
/* Los botones de la cabecera no deben abrir ni cerrar la fase. */
details.fase-card > summary.fase-cab .fase-acc { cursor: default; }

/* Resumen que se ve con la fase cerrada (cuántos ítems, cuánto avance). */
.fase-resumen { display: flex; align-items: center; gap: 8px; font-size: .8rem; color: var(--gris); white-space: nowrap; }
.fase-resumen .barra { width: 90px; }

/* Botonera para abrir / cerrar todo. */
.acc-todos { display: flex; gap: 6px; align-items: center; margin-bottom: 10px; }
.fase-tit { display: flex; align-items: center; gap: 12px; min-width: 0; }
.fase-num { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; flex: none; border-radius: 50%; background: var(--azul); color: #fff; font-weight: 700; font-size: .9rem; }
.fase-acc, .item-acc { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

.item-row, .eval-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 11px 16px; border-top: 1px solid #eef1f7; }
.item-row:first-of-type { border-top: none; }
.eval-row { padding-left: 52px; background: #fbfcfe; font-size: .9rem; }
.item-main { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; }
.item-txt { min-width: 0; }

/* Color por tipo de ítem, para leer el plan de un vistazo. */
.chip-tipo { display: inline-block; flex: none; padding: 3px 10px; border-radius: 20px; font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.chip-tipo.tipo-teoria     { background: var(--celeste); color: var(--azul); }
.chip-tipo.tipo-horas      { background: #e6f4ea; color: #1e7e34; }
.chip-tipo.tipo-integrador { background: #fff4e0; color: #b76e00; }

/* Fase bloqueada: la anterior todavía no cerró (aviso, no impedimento). */
.fase-card.bloqueada { opacity: .72; }
.fase-card.bloqueada .fase-cab { background: #fdf6e8; }
.fase-card.completa .fase-num { background: var(--ok); }

/* Barra de avance de un ítem de horas. */
.barra { height: 7px; border-radius: 20px; background: #e9edf5; overflow: hidden; min-width: 120px; }
.barra > span { display: block; height: 100%; border-radius: 20px; background: linear-gradient(90deg, #1565c0, #0b3d91); }
.barra.ok > span { background: linear-gradient(90deg, #2ecc71, #1e7e34); }
.item-prog { display: flex; align-items: center; gap: 10px; font-size: .82rem; color: var(--gris); white-space: nowrap; }

/* Anillo de progreso general de la cursada. */
.pct-pill { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; color: var(--azul); }
.pct-pill .barra { width: 130px; }

/* Aviso de requisitos de ingreso en el modal de asignación. */
.aviso-req { border: 1.5px solid #f0c987; background: #fff9ef; border-radius: 10px; padding: 12px 14px; }
.aviso-req > strong { display: flex; align-items: center; gap: 7px; color: #b76e00; font-size: .9rem; margin-bottom: 8px; }
.aviso-req > strong .ico { width: 1.05em; height: 1.05em; flex: none; }
.aviso-req ul { margin: 0 0 10px; padding-left: 20px; font-size: .88rem; }
.aviso-req li { margin-bottom: 3px; }
.aviso-req .opcion-radio { background: #fff; margin-bottom: 4px; }

/* ===== Salarios ===== */
/* Aviso de horas trabajadas que no se pueden liquidar por falta de valor hora. */
.sal-aviso { display: flex; align-items: center; gap: 5px; margin-top: 4px; font-size: .76rem; color: #b76e00; }
.sal-aviso .ico { width: 1em; height: 1em; flex: none; }

/* ===== Calendario mensual ===== */
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal-grid .cab { text-align: center; font-size: .78rem; font-weight: 700; color: var(--gris); padding: 4px 0; }
.cal-cell { min-height: 82px; border: 1px solid var(--borde); border-radius: 10px; background: #fff; padding: 6px; text-decoration: none; color: var(--texto); display: flex; flex-direction: column; gap: 5px; }
.cal-cell.vacia { background: transparent; border: none; }
.cal-cell.hoy { border-color: var(--azul); box-shadow: 0 0 0 2px rgba(11, 61, 145, .15); }
.cal-cell.no-op { background: repeating-linear-gradient(45deg, #f7f8fb, #f7f8fb 6px, #eef0f5 6px, #eef0f5 12px); }
.cal-cell .dnum { font-weight: 700; font-size: .85rem; color: var(--azul); }
.cal-cell .chip { align-self: flex-start; background: var(--celeste); color: var(--azul); border-radius: 20px; padding: 2px 9px; font-size: .72rem; font-weight: 700; }
a.cal-cell:hover { background: var(--gris-claro); }

/* Aviso de reservas sin instructor */
.aviso-banner { display: flex; align-items: center; gap: 10px; background: #fff4e0; border: 1px solid #ffd38a; color: #8a5a00; border-radius: 10px; padding: 10px 14px; margin-bottom: 14px; font-size: .9rem; }
.aviso-banner a { color: #8a5a00; font-weight: 700; }
.aviso-banner .ab-ico { display: inline-flex; }
.aviso-banner .ab-ico .ico { width: 20px; height: 20px; color: #c77700; }

/* ===== Iconos SVG inline ===== */
.ico { width: 1em; height: 1em; vertical-align: -0.14em; flex-shrink: 0; }
.btn-sec .ico { width: 1.05em; height: 1.05em; }
.seg a { display: inline-flex; align-items: center; gap: 6px; }
.seg a .ico { width: 1em; height: 1em; }
.btn-mini { display: inline-flex; align-items: center; gap: 5px; }
.btn-mini .ico { width: 14px; height: 14px; }
.btn-mini.exito { color: var(--ok); border-color: #bfe3c9; }
.btn-mini.exito:hover { background: #e6f4ea; }
.btn-mini.peligro { color: var(--error); border-color: #f0bdb6; }
.btn-mini.peligro:hover { background: #fdecea; }
.ico-btn { padding: 0 9px !important; }
.ico-btn .ico { width: 18px; height: 18px; vertical-align: middle; }

/* ===== Autocompletar personas ===== */
.ac { position: relative; }
.ac-input { width: 100%; height: 42px; border: 1.5px solid var(--borde); border-radius: 11px; padding: 0 14px; font-size: .92rem; background: #fff; color: var(--texto); transition: border-color .12s, box-shadow .12s; }
.ac-input::placeholder { color: #9aa3b2; }
.ac-input:focus { outline: none; border-color: var(--azul-claro); box-shadow: 0 0 0 3px rgba(21, 101, 192, .15); }
/* El buscador con lupa se usa solo o junto a .ac (autocompletar). Trae su propio
   position:relative para que la lupa se ancle acá, y estila cualquier input que
   contenga —no solo los .ac-input—, así un buscador de filtrado simple no queda
   con la piel default del navegador. */
.buscador-pro { position: relative; }
.buscador-pro > svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--gris); pointer-events: none; z-index: 1; }
.buscador-pro input {
    width: 100%;
    height: 42px;
    border: 1.5px solid var(--borde);
    border-radius: 11px;
    padding: 0 14px 0 42px;
    font-size: .92rem;
    font-family: inherit;
    background: #fff;
    color: var(--texto);
    transition: border-color .12s, box-shadow .12s;
}
.buscador-pro input::placeholder { color: #9aa3b2; }
.buscador-pro input:focus { outline: none; border-color: var(--azul-claro); box-shadow: 0 0 0 3px rgba(21, 101, 192, .15); }
.ac-list { position: absolute; left: 0; right: 0; top: 100%; z-index: 30; background: #fff; border: 1px solid var(--borde); border-radius: 10px; box-shadow: var(--sombra); margin-top: 4px; max-height: 240px; overflow-y: auto; display: none; }
.ac-list.abierta { display: block; }
.ac-item { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 9px 12px; font-size: .9rem; cursor: pointer; border-bottom: 1px solid #f0f2f7; }
.ac-item:last-child { border-bottom: none; }
.ac-item:hover { background: var(--celeste); }
.ac-dni { color: var(--gris); font-size: .8rem; white-space: nowrap; }
.ac-vacio { padding: 11px 12px; font-size: .85rem; color: var(--gris); }

/* Variante apilada: el DNI va DEBAJO del nombre, no al costado. */
.ac-list.apilada .ac-item { flex-direction: column; align-items: flex-start; gap: 1px; }
.ac-list.apilada .ac-nom { font-weight: 600; }

/* Pill de actividad (tipo derivado del recurso) */
.pill-actividad { display: inline-flex; align-items: center; gap: 8px; background: var(--celeste); color: var(--azul); font-weight: 700; font-size: .9rem; padding: 9px 14px; border-radius: 10px; }
.chk-inline { font-size: .82rem; display: inline-flex; align-items: center; gap: 5px; color: var(--gris); }

/* Sombras suaves para dar profundidad */
.plan-scroll { box-shadow: 0 4px 16px rgba(11, 61, 145, .06); }
.cal-cell { transition: box-shadow .12s, transform .12s; }
a.cal-cell:hover { box-shadow: 0 4px 14px rgba(11, 61, 145, .1); }
