/* ===== AFIS · Agenda de Formación del Instructor SENA ===== */
:root {
    --verde: #39A900;
    --verde-osc: #2d8500;
    --verde-claro: #eaf6e1;
    --azul: #0d6efd;
    --ambar: #f59f00;
    --rojo: #dc3545;
    --texto: #1f2933;
    --suave: #6b7785;
    --borde: #e3e7ec;
    --fondo: #f4f6f8;
    --tarjeta: #ffffff;
    --radio: 16px;
    --sombra: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 15px;
    line-height: 1.5;
    color: var(--texto);
    background: var(--fondo);
}
a { color: var(--verde-osc); }
h1 { font-size: 1.65rem; font-weight: 800; letter-spacing: -.02em; margin: 0 0 .2rem; }
h2 { font-size: 1.08rem; font-weight: 700; margin: 0 0 .8rem; }
h3 { font-size: 1rem; margin: 0; }
[hidden] { display: none !important; }

.texto-suave { color: var(--suave); margin: 0; }
.pequeno { font-size: .85rem; margin-top: .8rem; }
.centrado { text-align: center; }
.espaciador { flex: 1; }

/* ----- Barra superior ----- */
.barra {
    position: sticky; top: 0; z-index: 50;
    display: flex; align-items: center; gap: 1.5rem;
    padding: .55rem 1.5rem; color: #fff;
    background: linear-gradient(90deg, #2f9a00, var(--verde) 45%, #45b30d);
    box-shadow: 0 1px 0 rgba(0, 0, 0, .06);
    transition: box-shadow .25s;
}
body.con-scroll .barra { box-shadow: 0 10px 28px -12px rgba(31, 110, 0, .6); }
/* Textura: panal de hexágonos tenue (mismo motivo del login), más visible a la izquierda y que se
   desvanece hacia la derecha; brillo fino arriba y canto oscuro abajo para dar volumen */
.barra::before {
    content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='48' viewBox='0 0 28 48'%3E%3Cpath d='M14 0L28 8V24L14 32L0 24V8Z M14 32V48' fill='none' stroke='%23ffffff' stroke-opacity='.13' stroke-width='1'/%3E%3C/svg%3E");
    background-size: 28px 48px;
    -webkit-mask-image: linear-gradient(90deg, #000 0%, rgba(0, 0, 0, .55) 45%, rgba(0, 0, 0, .25) 100%);
    mask-image: linear-gradient(90deg, #000 0%, rgba(0, 0, 0, .55) 45%, rgba(0, 0, 0, .25) 100%);
}
.barra::after {
    content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .22), inset 0 -2px 0 rgba(0, 0, 0, .12);
}
.barra > * { position: relative; z-index: 1; }
.marca { display: flex; align-items: center; gap: .55rem; color: #fff; text-decoration: none; font-weight: 800; font-size: 1.08rem; letter-spacing: -.01em; white-space: nowrap; }
.logo {
    display: inline-grid; place-items: center;
    width: 34px; height: 34px; border-radius: 10px;
    background: #fff; color: var(--verde); font-weight: 800;
    box-shadow: 0 4px 10px -4px rgba(0, 0, 0, .35);
}
.logo img { display: block; width: 26px; height: auto; }
/* Nombre de la app: siglas grandes + significado pequeño */
.marca-texto { display: grid; line-height: 1.05; }
.marca-texto strong { font-size: 1.2rem; font-weight: 800; letter-spacing: .08em; }
.marca-texto small { font-size: .66rem; font-weight: 500; letter-spacing: .01em; opacity: .85; white-space: nowrap; }
.agenda-marca .marca-texto strong { font-size: 1.35rem; }
.agenda-marca .marca-texto small { font-size: .72rem; }
@media (min-width: 1001px) and (max-width: 1400px) { .barra .marca-texto small { display: none; } }
.logo-grande { width: 56px; height: 56px; font-size: 1.8rem; border-radius: 14px; background: var(--verde); color: #fff; }
.menu { display: flex; gap: .2rem; flex: 1; }
.menu a {
    color: rgba(255, 255, 255, .9); text-decoration: none;
    padding: .42rem .85rem; border-radius: 999px; font-weight: 500; font-size: .93rem; white-space: nowrap;
    transition: background .15s, color .15s, box-shadow .15s;
}
.menu a:hover { background: rgba(255, 255, 255, .16); color: #fff; }
.menu a.activo { background: #fff; color: var(--verde-osc); font-weight: 700; box-shadow: 0 4px 12px -5px rgba(0, 0, 0, .35); }
.menu a { display: inline-flex; align-items: center; gap: .45rem; position: relative; z-index: 1; }
.menu-icono {
    width: 18px; height: 18px; flex: none;
    fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
    transition: transform .3s cubic-bezier(.34, 1.56, .64, 1);
}
.menu a:hover .menu-icono, .menu a:focus-visible .menu-icono { transform: translateY(-2px) scale(1.12) rotate(-6deg); }
.menu a.activo .menu-icono { animation: icono-activo .6s cubic-bezier(.34, 1.56, .64, 1) .15s both; }
@keyframes icono-activo { 0% { transform: scale(.6); } 60% { transform: scale(1.18); } 100% { transform: scale(1); } }
.menu-indicador { display: none; }
.logo { transition: transform .35s cubic-bezier(.34, 1.56, .64, 1); }
.marca:hover .logo { transform: rotate(-8deg) scale(1.08); }

/* Escritorio: una píldora blanca se desliza hasta el enlace bajo el cursor y vuelve al activo */
@media (min-width: 1001px) {
    .menu { position: relative; }
    .menu-indicador {
        display: block; position: absolute; top: 0; bottom: 0; left: 0; z-index: 0;
        width: 0; opacity: 0; border-radius: 999px; background: #fff;
        box-shadow: 0 6px 16px -6px rgba(0, 0, 0, .4);
        transition: transform .38s cubic-bezier(.34, 1.3, .64, 1), width .38s cubic-bezier(.34, 1.3, .64, 1), opacity .2s;
        pointer-events: none;
    }
    .menu-indicador.sin-animar { transition: none; }
    .menu.con-indicador a, .menu.con-indicador a:hover, .menu.con-indicador a.activo { background: transparent; box-shadow: none; }
    .menu.con-indicador a { transition: color .25s; }
    .menu.con-indicador a.activo:not(.en-pildora) { color: #fff; }
    .menu.con-indicador a.en-pildora { color: var(--verde-osc); }
    /* Punto que marca la página actual mientras la píldora está en otro enlace */
    .menu.con-indicador a.activo::after {
        content: ""; position: absolute; left: 50%; bottom: -5px; width: 5px; height: 5px; margin-left: -2.5px;
        border-radius: 50%; background: #fff; opacity: 0; transform: scale(0); transition: opacity .2s, transform .25s;
    }
    .menu.con-indicador a.activo:not(.en-pildora)::after { opacity: 1; transform: scale(1); }
}
/* Pantallas medianas: menos espacio para que los 7 enlaces con ícono quepan en una línea */
@media (min-width: 1001px) and (max-width: 1280px) {
    .barra { gap: 1rem; }
    .menu a { padding: .42rem .6rem; gap: .35rem; font-size: .9rem; }
    .menu-icono { width: 16px; height: 16px; }
    .menu a[href*="ayuda"] span { display: none; }   /* el Manual queda solo con su ícono para que todo quepa */
    .menu a[href*="ayuda"] { padding-inline: .55rem; }
}
@media (prefers-reduced-motion: reduce) {
    .menu-indicador, .menu-icono, .logo { transition: none; }
    .menu a.activo .menu-icono { animation: none; }
    .menu a:hover .menu-icono, .marca:hover .logo { transform: none; }
}
.salir { display: flex; align-items: center; gap: .7rem; margin: 0; }
.usuario { font-size: .9rem; font-weight: 600; white-space: nowrap; max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
.menu-toggle { display: none; background: rgba(255, 255, 255, .14); border: 0; border-radius: 10px; width: 40px; height: 38px; color: #fff; font-size: 1.3rem; cursor: pointer; margin-left: auto; }

.avatar {
    display: inline-grid; place-items: center; flex: none;
    width: 30px; height: 30px; border-radius: 50%;
    background: #fff; color: var(--verde-osc); font-size: .75rem; font-weight: 800; letter-spacing: .02em;
}
.avatar-grande { width: 42px; height: 42px; font-size: .95rem; background: var(--verde-claro); }

/* Menú desplegable del usuario (avatar → cambiar contraseña / salir) */
.menu-usuario { position: relative; }
.menu-usuario > summary {
    list-style: none; cursor: pointer; display: flex; align-items: center; gap: .5rem;
    padding: .25rem .7rem .25rem .25rem; border-radius: 999px; color: #fff; white-space: nowrap;
    background: rgba(255, 255, 255, .12); transition: background .15s;
}
.menu-usuario > summary::-webkit-details-marker { display: none; }
.menu-usuario > summary::after { content: "▾"; font-size: .75rem; opacity: .85; transition: transform .2s; }
.menu-usuario > summary:hover { background: rgba(255, 255, 255, .22); }
.menu-usuario[open] > summary { background: rgba(0, 0, 0, .16); }
.menu-usuario[open] > summary::after { transform: rotate(180deg); }
.menu-usuario-panel {
    position: absolute; right: 0; top: calc(100% + .5rem); z-index: 60;
    min-width: 250px; padding: .45rem;
    background: var(--tarjeta); color: var(--texto);
    border: 1px solid var(--borde); border-radius: 16px;
    box-shadow: 0 20px 44px -14px rgba(16, 24, 40, .35);
    display: flex; flex-direction: column; gap: .15rem;
    transform-origin: top right; animation: panel-abrir .18s cubic-bezier(.2, .8, .2, 1);
}
@keyframes panel-abrir { from { opacity: 0; transform: translateY(-6px) scale(.97); } }
.mu-cabecera { display: flex; align-items: center; gap: .65rem; padding: .55rem .6rem .7rem; margin-bottom: .2rem; border-bottom: 1px solid var(--borde); }
.mu-cabecera strong { display: block; font-size: .9rem; line-height: 1.25; }
.mu-cabecera small { color: var(--suave); font-size: .78rem; }
.menu-usuario-panel form { margin: 0; }
.menu-usuario-panel .item-menu {
    display: block; width: 100%; text-align: left;
    background: none; border: 0; cursor: pointer;
    padding: .55rem .7rem; border-radius: 10px;
    font: inherit; font-size: .92rem; color: var(--texto); transition: background .15s, color .15s;
}
.menu-usuario-panel .item-menu:hover { background: var(--verde-claro); color: var(--verde-osc); }
.menu-usuario-panel .item-peligro { color: var(--rojo); }
.menu-usuario-panel .item-peligro:hover { background: #fdecee; color: var(--rojo); }

.contenido { max-width: 1320px; margin: 0 auto; padding: 1.5rem; }

/* ----- Tarjetas y rejillas ----- */
.tarjeta {
    background: var(--tarjeta); border: 1px solid var(--borde);
    border-radius: var(--radio); box-shadow: var(--sombra);
    padding: 1.3rem 1.4rem; margin-bottom: 1.25rem;
}
.contenido > * { animation: subir .45s cubic-bezier(.2, .8, .2, 1) backwards; }
.contenido > :nth-child(2) { animation-delay: 60ms; }
.contenido > :nth-child(3) { animation-delay: 120ms; }
.contenido > :nth-child(n + 4) { animation-delay: 180ms; }
@media (prefers-reduced-motion: reduce) { .contenido > *, .modal[open], .alerta, .menu-usuario-panel { animation: none; } }
.rejilla-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
.rejilla-2 > .tarjeta { margin-bottom: 0; }
.rejilla-2 { margin-bottom: 1.25rem; }
.rejilla-lateral { grid-template-columns: 1fr 340px; align-items: start; }
.ancho-medio { max-width: 760px; }

.encabezado-pagina { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; margin-bottom: 1.4rem; flex-wrap: wrap; }
.encabezado-pagina > div { max-width: 760px; }
.encabezado-pagina .texto-suave { font-size: .93rem; }

/* Estado vacío genérico */
.vacio-grande { display: grid; place-items: center; gap: .4rem; padding: 2.8rem 1.5rem; text-align: center; }
.vacio-grande .vg-icono {
    display: grid; place-items: center; width: 72px; height: 72px; margin-bottom: .4rem; border-radius: 22px; font-size: 2rem;
    background: var(--verde-claro); animation: agenda-flotar 4s ease-in-out infinite;
}
.vacio-grande h2 { margin: 0; }
.vacio-grande p { margin: 0 0 .6rem; color: var(--suave); max-width: 46ch; }

/* ----- Botones ----- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
    padding: .55rem 1.05rem; border-radius: 10px; border: 1px solid var(--borde);
    background: #fff; color: var(--texto); font: inherit; font-weight: 600; line-height: 1.3;
    cursor: pointer; text-decoration: none;
    transition: background .15s, border-color .15s, box-shadow .15s, transform .15s, color .15s;
}
.btn:hover { background: #f6f8fa; border-color: #d5dbe1; }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(57, 169, 0, .3); }
.btn-primario {
    background: linear-gradient(135deg, #43b80a, var(--verde-osc)); border-color: transparent; color: #fff;
    box-shadow: 0 6px 14px -6px rgba(45, 133, 0, .6);
}
.btn-primario:hover { background: linear-gradient(135deg, #3aa808, #257200); border-color: transparent; transform: translateY(-1px); box-shadow: 0 10px 18px -8px rgba(45, 133, 0, .7); }
.btn-peligro { color: var(--rojo); border-color: #f3c7cc; background: #fff; }
.btn-peligro:hover { background: #fdecee; border-color: var(--rojo); }
.btn-claro { background: rgba(255, 255, 255, .15); border-color: rgba(255, 255, 255, .4); color: #fff; }
.btn-claro:hover { background: rgba(255, 255, 255, .28); }
.btn-fantasma { background: transparent; border-style: dashed; color: var(--suave); }
.btn-fantasma:hover { background: #fff; color: var(--verde-osc); border-color: var(--verde); }
.btn-sm { padding: .32rem .7rem; font-size: .83rem; border-radius: 8px; }
.btn-bloque { width: 100%; }
.btn-icono { width: 34px; height: 34px; padding: 0; border-radius: 10px; }

/* ----- Formularios ----- */
.formulario label { display: flex; flex-direction: column; gap: .35rem; font-weight: 600; font-size: .88rem; margin-bottom: .95rem; }
.formulario label small { font-weight: 400; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date],
input[type=datetime-local], select, textarea {
    width: 100%; padding: .6rem .8rem; font: inherit; font-weight: 400;
    border: 1px solid #d9dfe5; border-radius: 10px; background: #fbfcfc; color: var(--texto);
    transition: border-color .15s, box-shadow .15s, background .15s;
}
input:hover:not(:focus), select:hover:not(:focus), textarea:hover:not(:focus) { border-color: #c5cdd5; }
input:focus, select:focus, textarea:focus { outline: none; background: #fff; border-color: var(--verde); box-shadow: 0 0 0 4px rgba(57, 169, 0, .14); }
input[type=color] {
    width: 46px; height: 40px; padding: 3px; border: 1px solid #d9dfe5; border-radius: 10px; background: #fff; cursor: pointer;
}
input[type=color]::-webkit-color-swatch-wrapper { padding: 0; }
input[type=color]::-webkit-color-swatch { border: 0; border-radius: 7px; }
textarea { resize: vertical; }
label.check { flex-direction: row !important; align-items: center; gap: .5rem !important; font-weight: 500 !important; cursor: pointer; }
label.check input { width: auto; accent-color: var(--verde); }
.fila-campos { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0 1rem; }
fieldset.asociar { border: 1px solid var(--borde); border-radius: 14px; padding: .8rem 1rem .2rem; margin: 0 0 1rem; background: #fcfdfc; }
fieldset.asociar legend { font-weight: 700; font-size: .85rem; padding: 0 .4rem; }
.segmentado { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .8rem; }
.segmentado label {
    flex-direction: row; align-items: center; gap: .35rem; margin: 0; font-weight: 600; font-size: .85rem; cursor: pointer;
    padding: .38rem .85rem; border: 1px solid var(--borde); border-radius: 999px; background: #fff; transition: all .15s;
}
.segmentado label:hover { border-color: #c5cdd5; }
.segmentado label:has(input:checked) { background: var(--verde-claro); border-color: var(--verde); color: var(--verde-osc); }
.segmentado label:has(input:focus-visible) { box-shadow: 0 0 0 3px rgba(57, 169, 0, .25); }
.segmentado input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
/* Grupo de píldoras con título (tipo / estado / prioridad del modal de tareas) */
.grupo-pildoras { border: 0; margin: 0 0 .9rem; padding: 0; min-width: 0; }
.grupo-pildoras legend { font-weight: 600; font-size: .88rem; padding: 0; margin-bottom: .35rem; }
.grupo-pildoras .segmentado { margin: 0; }
.segmentado label.p-alta:has(input:checked) { background: #fdecee; border-color: var(--rojo); color: var(--rojo); }
.segmentado label.p-baja:has(input:checked) { background: #eef1f4; border-color: #8a96a3; color: #4b5563; }
.segmentado label.e-en_progreso:has(input:checked) { background: #fff4de; border-color: var(--ambar); color: #9a6200; }
.segmentado label.e-pendiente:has(input:checked) { background: #e7f1ff; border-color: var(--azul); color: #0a58ca; }
.error-form { color: var(--rojo); font-weight: 600; margin: 0 0 .5rem; padding: .55rem .8rem; background: #fdecee; border-radius: 10px; font-size: .88rem; }
.en-linea { display: flex; gap: .6rem; align-items: center; }
.en-linea select { width: auto; }

/* ----- Alertas y avisos ----- */
.alerta {
    position: relative; padding: .85rem 2.6rem .85rem 2.85rem; border-radius: 14px; margin-bottom: 1rem;
    border: 1px solid; font-size: .93rem; animation: subir .35s cubic-bezier(.2, .8, .2, 1);
}
.alerta::before { position: absolute; left: 1rem; top: .85rem; font-size: 1rem; line-height: 1.4; }
.alerta-success { background: #f0f9ea; border-color: #c9e8b4; color: #2a5d0e; }
.alerta-success::before { content: "✅"; }
.alerta-danger { background: #fdf0f1; border-color: #f5c9ce; color: #842029; }
.alerta-danger::before { content: "⛔"; }
.alerta-warning { background: #fff8e6; border-color: #ffe3a3; color: #7a5b00; }
.alerta-warning::before { content: "⚠️"; }
.alerta-info { background: #eef5ff; border-color: #c7dcfd; color: #084298; }
.alerta-info::before { content: "ℹ️"; }
.cerrar {
    position: absolute; top: .55rem; right: .6rem; width: 30px; height: 30px; display: grid; place-items: center;
    background: none; border: 0; border-radius: 8px; font-size: 1.3rem; line-height: 1; cursor: pointer; color: inherit; opacity: .55;
    transition: opacity .15s, background .15s;
}
.cerrar:hover { opacity: 1; background: rgba(0, 0, 0, .06); }
.aviso-vacio { text-align: center; padding: 2.2rem; border: 2px dashed #cfe8bf; background: #fbfdf9; border-radius: 18px; }
.aviso-vacio p { color: var(--suave); }

.toast {
    position: fixed; bottom: 1.5rem; left: 50%;
    /* Oculto: fuera de la pantalla sea cual sea su alto (vacío mide ~21 px y con 150 % asomaba) */
    transform: translate(-50%, calc(100% + 2rem)); visibility: hidden;
    background: #1f2933; color: #fff; padding: .75rem 1.25rem; border-radius: 14px;
    box-shadow: 0 16px 36px -10px rgba(0, 0, 0, .4); z-index: 1000; font-weight: 600; font-size: .92rem;
    transition: transform .3s cubic-bezier(.2, .8, .2, 1.2), visibility .3s;
}
.toast.visible { transform: translate(-50%, 0); visibility: visible; }
.toast-error { background: var(--rojo); }

/* ----- Chips ----- */
.chip {
    --color: #6c757d;
    display: inline-flex; align-items: center; gap: .35rem;
    padding: .15rem .55rem; border-radius: 20px; font-size: .78rem; font-weight: 600;
    background: color-mix(in srgb, var(--color) 14%, white); color: color-mix(in srgb, var(--color) 75%, black);
    white-space: nowrap;
}
.chip .punto { width: 8px; height: 8px; border-radius: 50%; background: var(--color); }
.chip-gris { --color: #6c757d; }
.chip-verde { --color: var(--verde); }
.chip-rojo { --color: #dc3545; }
.chip-amarillo { --color: #c98a00; }
.lista-traslapes { margin: .5rem 0 1rem; padding-left: 1.2rem; }
.lista-traslapes li { margin-bottom: .35rem; }
.opciones-carga { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1rem; }
.leyenda { display: flex; flex-wrap: wrap; gap: .35rem; margin-left: auto; }

/* ===== Inicio (dashboard) ===== */

/* Entrada escalonada de las tarjetas */
.aparecer { animation: subir .55s cubic-bezier(.2, .8, .2, 1) backwards; animation-delay: calc(var(--i, 0) * 60ms + 120ms); }
@keyframes subir { from { opacity: 0; transform: translateY(16px); } }

/* Hero */
.hero {
    position: relative; overflow: hidden; isolation: isolate;
    display: flex; align-items: center; justify-content: space-between; gap: 1.5rem;
    padding: 1.9rem 2rem; margin-bottom: 1.25rem; border-radius: 22px; color: #fff;
    background:
        radial-gradient(120% 140% at 100% 0%, rgba(255, 255, 255, .18), transparent 55%),
        linear-gradient(135deg, #47b80f 0%, var(--verde) 40%, #1f6e00 100%);
    box-shadow: 0 18px 40px -18px rgba(31, 110, 0, .65);
    animation: subir .5s cubic-bezier(.2, .8, .2, 1) both;
}
.hero::after {   /* textura de puntos sutil */
    content: ""; position: absolute; inset: 0; z-index: -1; opacity: .18;
    background-image: radial-gradient(rgba(255, 255, 255, .7) 1px, transparent 1.4px);
    background-size: 18px 18px;
    mask-image: linear-gradient(90deg, transparent 30%, #000);
}
.hero-burbuja { position: absolute; z-index: -1; border-radius: 50%; background: rgba(255, 255, 255, .1); animation: agenda-flotar 9s ease-in-out infinite; }
.hero-burbuja.b1 { width: 240px; height: 240px; right: -60px; bottom: -120px; }
.hero-burbuja.b2 { width: 120px; height: 120px; left: 42%; top: -60px; animation-delay: -3s; }
.hero h1 { font-size: clamp(1.5rem, 3vw, 2.1rem); letter-spacing: -.02em; margin: .1rem 0 .35rem; }
.hero-fecha { margin: 0; font-size: .85rem; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; opacity: .85; }
.hero-fecha [data-reloj] { font-variant-numeric: tabular-nums; }
.hero-resumen { margin: 0 0 1.1rem; font-size: 1.02rem; opacity: .95; max-width: 52ch; }
.hero-alerta { background: rgba(255, 255, 255, .95); color: var(--rojo); padding: 0 .4rem; border-radius: 6px; }
.hero-acciones { display: flex; flex-wrap: wrap; gap: .5rem; }
.hero-btn, .hero-btn-principal {
    border-radius: 12px; padding: .55rem .95rem; transition: transform .15s, background .15s, box-shadow .15s;
}
.hero-btn { background: rgba(255, 255, 255, .14); border-color: rgba(255, 255, 255, .3); color: #fff; backdrop-filter: blur(6px); }
.hero-btn:hover { background: rgba(255, 255, 255, .26); transform: translateY(-2px); }
.hero-btn-principal { background: #fff; border-color: #fff; color: var(--verde-osc); box-shadow: 0 8px 18px -8px rgba(0, 0, 0, .35); }
.hero-btn-principal:hover { background: #fff; transform: translateY(-2px); box-shadow: 0 12px 22px -8px rgba(0, 0, 0, .4); }

/* Anillo de avance */
.hero-anillo { position: relative; flex: none; width: 150px; height: 150px; }
.hero-anillo svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.hero-anillo circle { fill: none; stroke-width: 11; }
.anillo-fondo { stroke: rgba(255, 255, 255, .2); }
.anillo-valor {
    stroke: #fff; stroke-linecap: round; stroke-dasharray: 100; stroke-dashoffset: 100;
    filter: drop-shadow(0 0 6px rgba(255, 255, 255, .5));
    animation: anillo 1.2s .3s cubic-bezier(.2, .8, .2, 1) forwards;
}
@keyframes anillo { to { stroke-dashoffset: calc(100 - var(--avance)); } }
.anillo-texto { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; line-height: 1.1; }
.anillo-texto strong { font-size: 2rem; font-weight: 800; letter-spacing: -.03em; }
.anillo-texto small { font-size: .72rem; opacity: .85; }

/* Estadísticas */
.estadisticas { display: grid; grid-template-columns: repeat(5, 1fr); gap: 1rem; margin-bottom: 1.25rem; }
.stat {
    --c: var(--azul);
    position: relative; overflow: hidden;
    display: flex; flex-direction: column; padding: 1rem 1.15rem 1.1rem; border-radius: 16px;
    background: var(--tarjeta); border: 1px solid var(--borde);
    text-decoration: none; color: var(--suave); box-shadow: var(--sombra); font-weight: 500;
    transition: transform .2s, box-shadow .2s, border-color .2s;
}
.stat::before {   /* resplandor de color en la esquina */
    content: ""; position: absolute; width: 110px; height: 110px; right: -40px; top: -40px; border-radius: 50%;
    background: color-mix(in srgb, var(--c) 14%, transparent); transition: transform .3s;
}
.stat:hover { transform: translateY(-4px); box-shadow: 0 14px 28px -12px color-mix(in srgb, var(--c) 45%, transparent); border-color: color-mix(in srgb, var(--c) 40%, var(--borde)); }
.stat:hover::before { transform: scale(1.35); }
.stat-icono {
    position: relative; display: grid; place-items: center; width: 40px; height: 40px; margin-bottom: .7rem;
    border-radius: 12px; font-size: 1.15rem; background: color-mix(in srgb, var(--c) 15%, white);
}
.stat-num { position: relative; font-size: 1.9rem; font-weight: 800; color: var(--texto); line-height: 1.1; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat-label { position: relative; font-size: .88rem; }
.stat-barra { margin-top: .7rem; height: 5px; border-radius: 5px; background: #eef1f4; overflow: hidden; }
.stat-barra i { display: block; height: 100%; border-radius: inherit; background: var(--c); transform-origin: left; animation: crecer 1s .4s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes crecer { from { transform: scaleX(0); } }
.stat-progreso { --c: var(--ambar); }
.stat-hecho { --c: var(--verde); }
.stat-neutro { --c: #adb5bd; }
div.stat:hover { transform: none; }

/* Paneles */
.panel { border-radius: 18px; padding: 1.3rem 1.4rem; }
.panel-cab { display: flex; align-items: center; justify-content: space-between; gap: .6rem; flex-wrap: wrap; margin-bottom: .6rem; }
.panel-cab h2 { margin: 0; }
.pequeno-top { font-size: .85rem; margin-bottom: .8rem; }
.ver-mas { display: inline-block; margin-top: .6rem; font-size: .88rem; font-weight: 600; text-decoration: none; }
.ver-mas:hover { text-decoration: underline; }
.panel-cab .ver-mas { margin: 0; }

/* Control segmentado Hoy / Mañana */
.segmento { position: relative; display: inline-flex; padding: 4px; border-radius: 12px; background: #eef1f4; }
.segmento button {
    position: relative; z-index: 1; border: 0; background: none; font: inherit; font-size: .85rem; font-weight: 600;
    padding: .3rem .8rem; border-radius: 9px; color: var(--suave); cursor: pointer; transition: color .2s;
}
.segmento button b { font-size: .72rem; margin-left: .2rem; padding: 0 .38rem; border-radius: 10px; background: rgba(0, 0, 0, .07); }
.segmento button.activo { color: var(--texto); }
.segmento-indicador {
    position: absolute; top: 4px; bottom: 4px; left: 4px; border-radius: 9px; background: #fff;
    box-shadow: 0 1px 3px rgba(16, 24, 40, .15); transition: transform .3s cubic-bezier(.2, .8, .2, 1), width .3s;
}
[data-panel].entrar { animation: subir .35s cubic-bezier(.2, .8, .2, 1); }

/* Línea de tiempo de formaciones */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { --color: var(--verde); display: grid; grid-template-columns: 54px 1fr; gap: .8rem; position: relative; padding-bottom: .75rem; }
.timeline li::before {   /* línea vertical */
    content: ""; position: absolute; left: 66px; top: 14px; bottom: 0; width: 2px; background: var(--borde);
}
.timeline li:last-child::before { display: none; }
.tl-hora { text-align: right; line-height: 1.2; padding-top: .55rem; font-variant-numeric: tabular-nums; }
.tl-hora strong { display: block; font-size: .95rem; }
.tl-hora small { color: var(--suave); font-size: .78rem; }
.tl-tarjeta {
    position: relative; margin-left: 14px; padding: .65rem .85rem; border-radius: 12px;
    background: color-mix(in srgb, var(--color) 7%, white); border: 1px solid color-mix(in srgb, var(--color) 22%, white);
    transition: transform .2s, box-shadow .2s;
}
.tl-tarjeta::before {   /* punto en la línea */
    content: ""; position: absolute; left: -21px; top: .8rem; width: 12px; height: 12px; border-radius: 50%;
    background: #fff; border: 3px solid var(--color);
}
.tl-tarjeta:hover { transform: translateX(3px); box-shadow: 0 6px 16px -10px color-mix(in srgb, var(--color) 70%, black); }
.tl-titulo { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .5rem; font-weight: 700; }
.tl-programa { margin: .1rem 0 .15rem; font-size: .88rem; }
.tl-estado { font-size: .72rem; font-weight: 700; padding: .1rem .5rem; border-radius: 20px; background: var(--verde); color: #fff; }
.tl-barra { display: none; height: 4px; margin-top: .5rem; border-radius: 4px; background: color-mix(in srgb, var(--color) 18%, white); overflow: hidden; }
.tl-barra i { display: block; height: 100%; width: var(--progreso, 0%); background: var(--color); border-radius: inherit; transition: width .6s; }
.timeline li.en-curso .tl-barra { display: block; }
.timeline li.en-curso .tl-tarjeta { box-shadow: 0 0 0 3px color-mix(in srgb, var(--color) 25%, transparent); }
.timeline li.en-curso .tl-tarjeta::before { background: var(--color); animation: latido 1.6s infinite; }
.timeline li.proxima .tl-estado { background: #eef1f4; color: var(--texto); }
.timeline li.terminada { opacity: .5; }
.timeline li.terminada .tl-tarjeta::before { background: var(--color); }
@keyframes latido { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--color) 55%, transparent); } 100% { box-shadow: 0 0 0 10px transparent; } }

.vacio-ilustrado { display: grid; place-items: center; gap: .3rem; padding: 1.6rem 1rem; text-align: center; color: var(--suave); border-radius: 14px; background: #f8f9fa; }
.vacio-ilustrado span { font-size: 2rem; animation: agenda-flotar 4s ease-in-out infinite; }
.vacio-ilustrado p { margin: 0; }

/* Filtros de tareas */
.filtros-tareas { display: flex; flex-wrap: wrap; gap: .3rem; }
.filtro {
    border: 1px solid var(--borde); background: var(--tarjeta); font: inherit; font-size: .8rem; font-weight: 600;
    padding: .22rem .65rem; border-radius: 20px; color: var(--suave); cursor: pointer; transition: all .15s;
}
.filtro b { margin-left: .15rem; }
.filtro:hover { border-color: var(--verde); color: var(--verde-osc); }
.filtro.activo { background: var(--texto); border-color: var(--texto); color: #fff; }
.filtro-rojo { color: var(--rojo); }
.filtro-rojo.activo { background: var(--rojo); border-color: var(--rojo); }

/* Listas */
.lista-clases, .lista-tareas, .lista-simple { list-style: none; padding: 0; margin: 0; }
.lista-clases li {
    --color: var(--verde);
    display: flex; flex-direction: column; gap: .1rem;
    padding: .6rem .8rem; border-left: 4px solid var(--color);
    background: #fafbfc; border-radius: 6px; margin-bottom: .5rem;
}
.lista-tareas li {
    --color: var(--verde);
    display: flex; align-items: center; gap: .75rem; cursor: pointer;
    padding: .65rem .8rem; margin-bottom: .45rem; border-radius: 12px;
    background: var(--tarjeta); border: 1px solid var(--borde);
    box-shadow: inset 4px 0 0 var(--color);
    transition: transform .18s, box-shadow .18s, background .18s, opacity .4s;
    animation: subir .4s cubic-bezier(.2, .8, .2, 1) backwards;
}
.lista-tareas li:hover { transform: translateX(3px); box-shadow: inset 4px 0 0 var(--color), 0 8px 18px -12px rgba(16, 24, 40, .4); }
.lista-tareas .lt-cuerpo { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.lista-tareas .titulo { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lista-tareas small { color: var(--suave); }
.lista-tareas li.vencida { background: #fff7f7; border-color: #f7d4d8; }
.lista-tareas li.vencida small { color: var(--rojo); font-weight: 600; }
.lt-prioridad { margin-left: .3rem; background: #fdecee; color: var(--rojo); border-radius: 4px; padding: 0 .35rem; font-size: .72rem; font-weight: 700; }
.check {
    flex: none; position: relative; width: 24px; height: 24px; border-radius: 50%; cursor: pointer;
    border: 2px solid color-mix(in srgb, var(--color) 60%, #adb5bd); background: #fff; transition: all .2s;
}
.check::after {
    content: "✓"; position: absolute; inset: 0; display: grid; place-items: center;
    font-size: .8rem; font-weight: 800; color: var(--verde); opacity: 0; transform: scale(.5); transition: all .2s;
}
.check:hover { border-color: var(--verde); background: var(--verde-claro); }
.check:hover::after { opacity: 1; transform: scale(1); }
.lista-tareas li.completando { opacity: .45; transform: translateX(10px); }
.lista-tareas li.completando .check { background: var(--verde); border-color: var(--verde); animation: pop .35s; }
.lista-tareas li.completando .check::after { color: #fff; opacity: 1; transform: scale(1); }
.lista-tareas li.completando .titulo { text-decoration: line-through; }
@keyframes pop { 50% { transform: scale(1.25); } }

/* Fichas */
.fichas-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: .8rem; }
.ficha-mini {
    --color: var(--verde);
    position: relative; overflow: hidden; display: flex; flex-direction: column; gap: .15rem;
    padding: .9rem 1rem; border-radius: 14px; text-decoration: none; color: var(--texto);
    background: linear-gradient(160deg, color-mix(in srgb, var(--color) 12%, white), var(--tarjeta) 70%);
    border: 1px solid color-mix(in srgb, var(--color) 25%, var(--borde));
    transition: transform .2s, box-shadow .2s;
}
.ficha-mini::before { content: ""; position: absolute; left: 0; top: 0; right: 0; height: 4px; background: var(--color); }
.ficha-mini:hover { transform: translateY(-3px); box-shadow: 0 12px 24px -14px color-mix(in srgb, var(--color) 80%, black); }
.fm-numero { font-size: 1.15rem; font-weight: 800; letter-spacing: .01em; }
.fm-programa { font-size: .85rem; color: var(--suave); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.5em; }
.fm-pie { display: flex; justify-content: space-between; gap: .5rem; margin-top: .4rem; font-size: .75rem; font-weight: 600; color: color-mix(in srgb, var(--color) 70%, black); }

.aviso-icono { display: block; font-size: 2.2rem; margin-bottom: .3rem; }

@media (prefers-reduced-motion: reduce) {
    .aparecer, .hero, .hero-burbuja, .stat-barra i, .lista-tareas li, .vacio-ilustrado span, [data-panel].entrar { animation: none; }
    .anillo-valor { animation: none; stroke-dashoffset: calc(100 - var(--avance)); }
}
@media (max-width: 760px) {
    .hero { flex-direction: column-reverse; align-items: flex-start; padding: 1.4rem 1.25rem; border-radius: 18px; }
    .hero-anillo { width: 104px; height: 104px; position: absolute; right: 1rem; top: 1rem; }
    .hero-anillo circle { stroke-width: 10; }
    .anillo-texto strong { font-size: 1.4rem; }
    .anillo-texto small { display: none; }
    .hero-texto { padding-right: 0; }
    .hero h1, .hero-fecha { max-width: calc(100% - 112px); }
    .hero-acciones .btn { flex: 1 1 calc(50% - .5rem); }
}
.lista-simple li { padding: .45rem 0; border-bottom: 1px solid var(--borde); }
.lista-simple li:last-child { border-bottom: 0; }

/* ----- Tablas ----- */
.tabla-scroll { overflow-x: auto; }
.tabla { width: 100%; border-collapse: separate; border-spacing: 0; font-size: .9rem; }
.tabla th {
    text-align: left; font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em;
    color: var(--suave); background: transparent; padding: .55rem .8rem; border-bottom: 1px solid var(--borde);
}
.tabla td { padding: .7rem .8rem; border-bottom: 1px solid #f0f2f5; vertical-align: middle; }
.tabla tbody tr { transition: background .15s; }
.tabla tbody tr:hover { background: #f8faf7; }
.tabla tbody tr:last-child td { border-bottom: 0; }
.tabla .acciones { display: flex; gap: .4rem; justify-content: flex-end; }
.tabla .acciones form { margin: 0; }
.barra-acciones {
    display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap;
    position: sticky; bottom: 1rem; z-index: 5; margin-top: 1rem; padding: .8rem 1rem;
    background: rgba(255, 255, 255, .85); backdrop-filter: blur(10px);
    border: 1px solid var(--borde); border-radius: 16px; box-shadow: 0 14px 34px -14px rgba(16, 24, 40, .35);
}
.barra-acciones form { margin: 0; }

/* ----- Subida de archivo ----- */
.zona-archivo {
    position: relative; display: flex !important; flex-direction: column; align-items: center; justify-content: center;
    gap: .45rem; padding: 2.6rem 1rem; border: 2px dashed #b9dca3; border-radius: 18px;
    background: radial-gradient(circle at 50% 0%, #f0f9ea, #fbfdf9 70%); cursor: pointer; text-align: center;
    font-weight: 500 !important; transition: background .2s, border-color .2s, transform .2s;
}
.zona-archivo:hover, .zona-archivo.arrastrando { background: var(--verde-claro); border-color: var(--verde); }
.zona-archivo.arrastrando { transform: scale(1.01); }
.zona-archivo:focus-within { box-shadow: 0 0 0 4px rgba(57, 169, 0, .15); }
.zona-archivo input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.zona-icono {
    display: grid; place-items: center; width: 64px; height: 64px; border-radius: 18px; font-size: 1.9rem;
    background: #fff; box-shadow: 0 10px 24px -10px rgba(45, 133, 0, .45); transition: transform .25s;
}
.zona-archivo:hover .zona-icono, .zona-archivo.arrastrando .zona-icono { transform: translateY(-4px) rotate(-4deg); }
.zona-texto { font-size: .95rem; }
.zona-sub { font-size: .8rem; color: var(--suave); }
.zona-nombre:not(:empty) {
    margin-top: .3rem; padding: .3rem .8rem; border-radius: 999px; background: #fff; border: 1px solid #bfe3a7;
    color: var(--verde-osc); font-weight: 700; font-size: .88rem;
}
.zona-archivo.con-archivo { border-style: solid; border-color: var(--verde); }
details.ayuda { background: #f8f9fa; border-radius: 14px; padding: .75rem 1rem; margin-bottom: 1rem; border: 1px solid #eef0f3; }
details.ayuda summary { cursor: pointer; font-weight: 600; list-style: none; display: flex; align-items: center; gap: .5rem; }
details.ayuda summary::-webkit-details-marker { display: none; }
details.ayuda summary::after { content: "▾"; margin-left: auto; color: var(--suave); transition: transform .2s; }
details.ayuda[open] summary::after { transform: rotate(180deg); }
.pasos { list-style: none; margin: .8rem 0 .2rem; padding: 0; display: grid; gap: .6rem; counter-reset: paso; }
.pasos li { position: relative; padding-left: 2.2rem; color: var(--suave); font-size: .9rem; counter-increment: paso; }
.pasos li::before {
    content: counter(paso); position: absolute; left: 0; top: 0; width: 1.55rem; height: 1.55rem; border-radius: 50%;
    display: grid; place-items: center; background: var(--verde-claro); color: var(--verde-osc); font-weight: 800; font-size: .78rem;
}

/* ----- Modal ----- */
.modal {
    width: min(640px, calc(100vw - 2rem)); max-height: calc(100vh - 2rem);
    border: 0; border-radius: 22px; padding: 0; color: var(--texto);
    box-shadow: 0 30px 80px -20px rgba(16, 24, 40, .5);
}
.modal[open] { animation: modal-entrar .28s cubic-bezier(.2, .8, .2, 1); }
.modal[open]::backdrop { animation: fundido .28s ease; }
@keyframes modal-entrar { from { opacity: 0; transform: translateY(18px) scale(.97); } }
@keyframes fundido { from { opacity: 0; } }
.modal-pequeno { width: min(450px, calc(100vw - 2rem)); }
.modal::backdrop { background: rgba(15, 23, 32, .42); backdrop-filter: blur(4px); }
.modal > form, .modal > div { padding: 1.4rem 1.6rem 1.3rem; }
.modal-cabecera {
    position: relative; display: flex; align-items: center; justify-content: space-between; gap: 1rem;
    margin: -1.4rem -1.6rem 1.2rem; padding: 1.1rem 1.1rem 1.1rem 1.6rem;
    border-bottom: 1px solid var(--borde); background: linear-gradient(180deg, #f5faf1, #fff);
}
.modal-cabecera h2 { margin: 0; font-size: 1.2rem; font-weight: 800; letter-spacing: -.01em; }
.modal-cabecera .cerrar { position: static; width: 36px; height: 36px; border-radius: 10px; color: var(--suave); opacity: 1; }
.modal-cabecera .cerrar:hover { background: #eef1f4; color: var(--texto); }
.modal-pie { display: flex; gap: .6rem; align-items: center; margin-top: .5rem; }
.modal .modal-pie {
    position: sticky; bottom: -1.3rem; z-index: 2;
    margin: 1rem -1.6rem -1.3rem; padding: .9rem 1.6rem; border-top: 1px solid var(--borde); background: #fafbfc;
}
.detalle { display: grid; grid-template-columns: auto 1fr; margin: 0 0 1rem; border: 1px solid var(--borde); border-radius: 14px; overflow: hidden; }
.detalle dt, .detalle dd { padding: .55rem .85rem; border-bottom: 1px solid #f0f2f5; }
.detalle dt { font-weight: 600; font-size: .85rem; color: var(--suave); background: #fafbfc; }
.detalle dd { margin: 0; }
.detalle dt:last-of-type, .detalle dd:last-of-type { border-bottom: 0; }

/* Interruptor genérico (también se usa en el modal de tareas) */
.formulario label.switch { flex-direction: row; align-items: center; gap: .55rem; font-weight: 600; margin: 0 0 .9rem; }

/* ----- Autenticación: agenda abierta (hoja del día + espiral + formulario) ----- */
body.sin-menu { background: #f4f7f2; }
/* Fondo del login: horario semanal vivo en canvas (lo dibuja app.js) */
.fondo-planner { position: fixed; inset: 0; z-index: 0; width: 100%; height: 100%; display: block; pointer-events: none; }
body.sin-menu .contenido { position: relative; z-index: 1; }
body.sin-menu .contenido { min-height: 100vh; display: flex; flex-direction: column; justify-content: center; align-items: center; }
body.sin-menu .contenido > .alerta { width: min(940px, 100%); }

.auth-agenda {
    --espiral: 38px;
    position: relative;
    display: grid; grid-template-columns: 1fr var(--espiral) 1.05fr;
    width: min(940px, 100%);
    border-radius: 24px;
    background: #fff;
    box-shadow: 0 30px 60px -20px rgba(16, 24, 40, .35), 0 12px 24px -12px rgba(16, 24, 40, .18);
    animation: agenda-entrar .6s cubic-bezier(.2, .8, .2, 1) both;
}
.agenda-hoja { position: relative; padding: 2.2rem 2.2rem 2rem; }

/* Página izquierda: la hoja del día */
.agenda-cal {
    overflow: hidden;
    border-radius: 24px 0 0 24px;
    color: #fff;
    background:
        radial-gradient(circle at 85% -10%, rgba(255, 255, 255, .22), transparent 40%),
        radial-gradient(circle at -10% 110%, rgba(0, 0, 0, .25), transparent 50%),
        linear-gradient(155deg, #43b80a 0%, var(--verde) 40%, #1f6e00 100%);
}
.agenda-cal::after {   /* cuadrícula tenue, como papel de agenda */
    content: ""; position: absolute; inset: 0; pointer-events: none;
    background: linear-gradient(rgba(255, 255, 255, .06) 1px, transparent 1px) 0 0 / 100% 28px;
}
.agenda-cal > * { position: relative; z-index: 1; }
.agenda-marca { display: flex; align-items: center; gap: .6rem; font-weight: 700; font-size: 1.05rem; letter-spacing: .01em; }
.logo-agenda { width: 40px; height: 40px; border-radius: 11px; box-shadow: 0 4px 12px rgba(0, 0, 0, .18); }
.logo-agenda img { width: 30px; }

.agenda-hoy { display: grid; margin: 1.6rem 0 1.2rem; line-height: 1; }
.agenda-dia-semana { font-size: .95rem; text-transform: uppercase; letter-spacing: .18em; opacity: .85; }
.agenda-numero {
    font-size: clamp(4.5rem, 9vw, 6.5rem); font-weight: 800; letter-spacing: -.04em; margin: .15rem 0 .1rem;
    text-shadow: 0 6px 18px rgba(0, 0, 0, .18);
}
.agenda-mes { font-size: 1.1rem; font-weight: 600; text-transform: capitalize; opacity: .95; }

.mini-cal {
    display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px;
    padding: .7rem; border-radius: 14px;
    background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .18);
    backdrop-filter: blur(6px);
    font-size: .78rem; text-align: center;
}
.mini-cal span { position: relative; display: grid; place-items: center; height: 26px; border-radius: 7px; }
.mc-cab { font-weight: 700; font-size: .68rem; opacity: .7; }
.mc-dia { font-variant-numeric: tabular-nums; }
.mc-finde { opacity: .55; }
.mc-hoy { background: #fff; color: var(--verde-osc); font-weight: 800; box-shadow: 0 4px 10px rgba(0, 0, 0, .2); }
.mc-punto { position: absolute; bottom: 2px; width: 4px; height: 4px; border-radius: 50%; }
.mc-blanco { background: rgba(255, 255, 255, .85); }
.mc-ambar { background: #ffc94d; }
.mc-azul { background: #8ec5ff; }
.mc-hoy .mc-punto { background: var(--verde); }

.agenda-eventos { list-style: none; margin: 1.1rem 0 0; padding: 0; display: grid; gap: .45rem; }
.agenda-eventos li {
    display: flex; align-items: center; gap: .55rem;
    padding: .5rem .75rem; border-radius: 10px;
    background: rgba(255, 255, 255, .16); border: 1px solid rgba(255, 255, 255, .22);
    backdrop-filter: blur(6px);
    font-size: .82rem;
    animation: agenda-flotar 6s ease-in-out infinite; animation-delay: var(--retraso, 0s);
}
.agenda-eventos li::before { content: ""; width: 4px; align-self: stretch; border-radius: 4px; background: #fff; }
.agenda-eventos li:has(.ev-ambar)::before { background: #ffc94d; }
.agenda-eventos li:has(.ev-azul)::before { background: #8ec5ff; }
.agenda-eventos li i { display: none; }
.agenda-eventos b { font-variant-numeric: tabular-nums; }
.agenda-lema { margin: 1.2rem 0 0; font-size: .88rem; opacity: .85; }

/* Espiral entre las dos páginas */
.agenda-espiral {
    position: relative; display: flex; flex-direction: column; justify-content: space-evenly; align-items: center;
    background: linear-gradient(90deg, #1f6e00 0%, #e9ecef 50%, #fff 100%);
}
.agenda-espiral::before {   /* sombra del pliegue */
    content: ""; position: absolute; inset: 0 0 0 50%;
    background: linear-gradient(90deg, rgba(16, 24, 40, .12), transparent 70%);
}
.agenda-espiral span {
    position: relative; width: calc(var(--espiral) + 18px); height: 12px; border-radius: 12px;
    background: linear-gradient(180deg, #f8f9fa, #adb5bd 55%, #6c757d);
    box-shadow: 0 2px 3px rgba(0, 0, 0, .3), inset 0 1px 0 rgba(255, 255, 255, .9);
}

/* Página derecha: el formulario */
.agenda-form { display: flex; align-items: center; border-radius: 0 24px 24px 0; }
.agenda-form::after {   /* esquina doblada */
    content: ""; position: absolute; right: 0; bottom: 0; width: 46px; height: 46px;
    border-radius: 0 0 24px 0;
    background: linear-gradient(315deg, #f4f7f2 0 48%, #dfe4ea 50%, #f1f3f5 75%, #fff 100%);   /* deja ver el fondo de la página */
    box-shadow: -3px -3px 6px rgba(16, 24, 40, .06);
}
.agenda-form .formulario { width: 100%; }
.agenda-etiqueta {
    display: inline-block; margin: 0 0 .5rem; padding: .2rem .65rem; border-radius: 20px;
    background: var(--verde-claro); color: var(--verde-osc); font-size: .75rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
}
.agenda-form h1 { font-size: 1.9rem; letter-spacing: -.02em; }
.agenda-sub { margin-bottom: 1.4rem; }
.agenda-form input {
    padding: .75rem .9rem; border-radius: 12px; background: #f8faf9; border: 1px solid var(--borde);
    transition: border-color .15s, box-shadow .15s, background .15s;
}
.agenda-form input:focus {
    outline: none; background: #fff; border-color: var(--verde);
    box-shadow: 0 0 0 4px rgba(57, 169, 0, .15);
}
.btn-agenda {
    margin-top: .4rem; padding: .8rem 1rem; border-radius: 12px; font-size: 1rem;
    background: linear-gradient(135deg, #43b80a, var(--verde-osc));
    box-shadow: 0 10px 20px -8px rgba(45, 133, 0, .6);
    transition: transform .15s, box-shadow .15s;
}
.btn-agenda span { display: inline-block; transition: transform .15s; }
.btn-agenda:hover { transform: translateY(-1px); box-shadow: 0 14px 24px -10px rgba(45, 133, 0, .7); }
.btn-agenda:hover span { transform: translateX(4px); }

@keyframes agenda-entrar { from { opacity: 0; transform: translateY(14px) scale(.98); } }
@keyframes agenda-flotar { 50% { transform: translateY(-4px); } }
@media (prefers-reduced-motion: reduce) {
    .auth-agenda, .agenda-eventos li { animation: none; }
}

/* Celular: la hoja del día queda arriba y compacta; el espiral pasa a horizontal */
@media (max-width: 760px) {
    .auth-agenda { grid-template-columns: 1fr; grid-template-rows: auto var(--espiral) auto; border-radius: 20px; }
    .agenda-hoja { padding: 1.4rem 1.25rem; }
    .agenda-cal { border-radius: 20px 20px 0 0; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: .5rem 1rem; }
    .agenda-marca { grid-column: 1 / -1; }
    .agenda-hoy { margin: .4rem 0 0; }
    .agenda-numero { font-size: 3.6rem; }
    .mini-cal, .agenda-eventos { display: none; }
    .agenda-lema { margin: 0; align-self: end; max-width: 16ch; font-size: .8rem; text-align: right; }
    .agenda-espiral { flex-direction: row; background: linear-gradient(180deg, #1f6e00 0%, #e9ecef 50%, #fff 100%); }
    .agenda-espiral::before { inset: 50% 0 0 0; background: linear-gradient(180deg, rgba(16, 24, 40, .12), transparent 70%); }
    .agenda-espiral span { width: 12px; height: calc(var(--espiral) + 18px); }
    .agenda-espiral span:nth-child(n + 8) { display: none; }
    .agenda-form { border-radius: 0 0 20px 20px; }
    .agenda-form::after { display: none; }
}

/* ----- Realismo de la agenda: fajo de hojas en los bordes, renglones con margen, separador y sombra (todo quieto) ----- */
.auth-agenda { isolation: isolate; box-shadow: none; }
/* Sombra de objeto apoyado sobre la mesa: abarca las páginas y el fajo de hojas (sin tapa visible) */
.auth-agenda::before {
    content: ""; position: absolute; inset: 0 -10px -10px -10px; z-index: -1;
    border-radius: 24px;
    /* Luz desde arriba a la izquierda: la sombra cae hacia abajo y a la derecha, más definida cerca y difusa lejos */
    box-shadow:
        0 1px 2px rgba(16, 24, 40, .18),
        3px 6px 10px -2px rgba(16, 24, 40, .16),
        12px 24px 36px -10px rgba(16, 24, 40, .30),
        30px 56px 90px -28px rgba(16, 24, 40, .38);
}
/* Halo de luz detrás de la agenda: aclara el fondo a su alrededor para que destaque
   (el contenedor lo recorta para que no aparezcan barras de desplazamiento) */
body.sin-menu .contenido { overflow: hidden; }
body.sin-menu .contenido::before {
    content: ""; position: absolute; left: 50%; top: 50%; z-index: -1; pointer-events: none;
    width: min(1400px, 150vw); height: min(1000px, 130vh);
    transform: translate(-50%, -50%);
    background: radial-gradient(closest-side, rgba(255, 255, 255, .95), rgba(255, 255, 255, .75) 45%, rgba(255, 255, 255, 0));
}
/* Brillo fino en el canto superior del papel */
.agenda-form, .agenda-espiral { border-top: 1px solid #fff; }
.agenda-cal { border-top: 1px solid rgba(255, 255, 255, .35); }
/* Separador de tela que asoma por debajo de las hojas (naranja SENA, con la punta en V) */
.auth-agenda::after {
    content: ""; position: absolute; z-index: -1;
    right: 18%; bottom: -54px; width: 16px; height: 70px;
    background: #fc7323;
    clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 82%, 0 100%);
    filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .25));
}
/* Fajo de hojas: muchas hojas escalonadas que asoman por el borde exterior y por abajo de cada
   página (blanco y gris alternados = el canto del papel), y la curva del papel hacia el lomo */
.agenda-cal {
    box-shadow:
        -1px 1px 0 #f7f6f1, -2px 2px 0 #dcdad1, -3px 3px 0 #faf9f5, -4px 4px 0 #d6d4cb,
        -5px 5px 0 #f7f6f1, -6px 6px 0 #d1cfc5, -7px 7px 0 #f5f4ef, -8px 8px 0 #cbc9bf,
        -9px 9px 0 #f3f2ec, -10px 10px 0 #c4c2b8,
        inset -22px 0 26px -18px rgba(0, 0, 0, .32);
}
.agenda-espiral {
    box-shadow:
        0 1px 0 #f7f6f1, 0 2px 0 #dcdad1, 0 3px 0 #faf9f5, 0 4px 0 #d6d4cb, 0 5px 0 #f7f6f1,
        0 6px 0 #d1cfc5, 0 7px 0 #f5f4ef, 0 8px 0 #cbc9bf, 0 9px 0 #f3f2ec, 0 10px 0 #c4c2b8;
}
.agenda-form {
    /* Papel de cuaderno: renglones azul tenue cada 30px y margen rojo a la izquierda */
    background:
        linear-gradient(90deg, transparent 22px, rgba(220, 53, 69, .28) 22px, rgba(220, 53, 69, .28) 23.5px, transparent 23.5px),
        repeating-linear-gradient(180deg, transparent 0 29px, rgba(13, 110, 253, .09) 29px 30px),
        #fffefa;
    background-position: 0 0, 0 18px, 0 0;
    box-shadow:
        1px 1px 0 #f7f6f1, 2px 2px 0 #dcdad1, 3px 3px 0 #faf9f5, 4px 4px 0 #d6d4cb,
        5px 5px 0 #f7f6f1, 6px 6px 0 #d1cfc5, 7px 7px 0 #f5f4ef, 8px 8px 0 #cbc9bf,
        9px 9px 0 #f3f2ec, 10px 10px 0 #c4c2b8,
        inset 22px 0 26px -18px rgba(16, 24, 40, .16);
}
@media (max-width: 760px) {
    .auth-agenda::before { inset: 0 -10px -10px -10px; border-radius: 20px; }
    .auth-agenda::after { bottom: -44px; height: 56px; }
    .agenda-cal { box-shadow: inset 0 -18px 22px -16px rgba(0, 0, 0, .28); }
    .agenda-espiral { box-shadow: none; }
    .agenda-form { padding-left: 2.1rem; }   /* que el texto no pise el margen rojo */
}

/* ----- Mensajes escritos a mano en la agenda (login / registro) ----- */
@font-face {
    font-family: 'Caveat';
    src: url('../fonts/caveat-latin.woff2') format('woff2');
    font-weight: 400 700; font-style: normal; font-display: swap;
}
.notas-agenda { margin: -.5rem 0 1rem; }
.notas-agenda:empty { display: none; }
.nota-manuscrita.nota-success { font-size: 1.75rem; }          /* la bienvenida, un poco más grande */
/* Frase al azar, en verde y sin ícono (doble clase para ganarle a la tinta roja por defecto de .nota-manuscrita) */
.nota-manuscrita.nota-frase { color: #2d6a1a; font-weight: 500; font-size: 1.4rem; transform: rotate(-.8deg); }
.nota-manuscrita.nota-frase::before { content: none; }
/* Al entrar bien, los campos se atenúan mientras se escribe la bienvenida */
.formulario.login-ok label, .formulario.login-ok .btn-agenda { opacity: .35; transition: opacity .4s; pointer-events: none; }
.nota-manuscrita {
    position: relative; margin: 0 0 .2rem; padding-left: 1.5rem;
    font-family: 'Caveat', 'Segoe Print', 'Bradley Hand', cursive;
    font-size: 1.5rem; font-weight: 600; line-height: 30px;   /* el alto de los renglones del papel */
    color: #c0262f;                                           /* tinta roja */
    transform: rotate(-1.2deg); transform-origin: left center;
}
.nota-manuscrita::before { content: "✗"; position: absolute; left: 0; top: 0; font-weight: 700; }
.nota-success { color: #237a00; }                             /* tinta verde */
.nota-success::before { content: "✓"; }
.nota-info, .nota-warning { color: #1d4f9c; }                 /* tinta azul */
.nota-info::before, .nota-warning::before { content: "✎"; }
/* Escritura letra por letra (app.js parte el texto en letras con su retraso) */
.nota-manuscrita .letra { display: inline-block; white-space: pre; opacity: 0; animation: tinta .22s ease-out forwards; }
@keyframes tinta { from { opacity: 0; transform: translateY(2px) scale(.9); filter: blur(1.2px); } to { opacity: 1; transform: none; filter: none; } }
.solo-lector { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Espiral por encima de las dos páginas: cada argolla cruza el lomo y entra en un agujero
   perforado en cada hoja (izquierda y derecha) */
.agenda-espiral { z-index: 2; }
.agenda-espiral span { width: calc(var(--espiral) + 40px); }
.agenda-espiral span::before, .agenda-espiral span::after {   /* agujeros de la perforación */
    content: ""; position: absolute; top: 50%; z-index: -1;
    width: 10px; height: 10px; border-radius: 50%; transform: translateY(-50%);
    background: #2b2f33; box-shadow: inset 0 2px 2px rgba(0, 0, 0, .6), 0 1px 0 rgba(255, 255, 255, .5);
}
.agenda-espiral span::before { left: -5px; }    /* asoman un poco por fuera de la punta de la argolla */
.agenda-espiral span::after { right: -5px; }
@media (max-width: 760px) {
    .agenda-espiral span { width: 12px; height: calc(var(--espiral) + 40px); }
    .agenda-espiral span::before, .agenda-espiral span::after { top: auto; left: 50%; right: auto; transform: translateX(-50%); }
    .agenda-espiral span::before { top: -5px; }
    .agenda-espiral span::after { bottom: -5px; }
}

/* ----- Calendario (FullCalendar) ----- */
.calendario-caja { padding: 1.1rem 1.3rem 1.3rem; border-radius: 18px; }

/* Barra de filtros compacta */
.cal-barra { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-bottom: .9rem; }
.cal-select {
    display: inline-flex; align-items: center; gap: .1rem; padding-left: .75rem;
    border: 1px solid var(--borde); border-radius: 10px; background: #f8f9fa;
    font-size: .78rem; font-weight: 600; color: var(--suave); transition: border-color .15s, background .15s, box-shadow .15s;
}
.cal-select select {
    width: auto; border: 0; background: transparent; outline: none !important; cursor: pointer;
    padding: .4rem .5rem .4rem .3rem; font-size: .85rem; font-weight: 600; color: var(--texto);
}
.cal-select:hover { background: #f1f3f5; }
.cal-select:focus-within { border-color: var(--verde); box-shadow: 0 0 0 3px rgba(57, 169, 0, .15); background: #fff; }
.cal-select.con-valor { background: var(--verde-claro); border-color: #bfe3a7; color: var(--verde-osc); }
.switch { position: relative; display: inline-flex; align-items: center; gap: .5rem; margin-left: .3rem; font-size: .85rem; font-weight: 600; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch-pista { position: relative; width: 36px; height: 20px; border-radius: 20px; background: #cfd6de; transition: background .2s; }
.switch-pista::after {
    content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%;
    background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .2s;
}
.switch input:checked + .switch-pista { background: var(--verde); }
.switch input:checked + .switch-pista::after { transform: translateX(16px); }
.switch input:focus-visible + .switch-pista { outline: 2px solid rgba(57, 169, 0, .45); outline-offset: 2px; }
.cal-limpiar { margin-left: auto; border: 0; background: none; font: inherit; font-size: .82rem; font-weight: 600; color: var(--suave); cursor: pointer; padding: .3rem .5rem; border-radius: 8px; }
.cal-limpiar:hover { background: #f1f3f5; color: var(--rojo); }

/* Resumen de horas: total + fichas clicables */
.resumen-horas {
    display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1rem; margin-bottom: 1rem;
    padding: .7rem .9rem; border-radius: 12px; background: #f8f9fa;
}
.resumen-total { display: flex; flex-direction: column; line-height: 1.15; padding-right: 1rem; border-right: 1px solid var(--borde); }
.resumen-total small { font-size: .72rem; font-weight: 600; color: var(--suave); text-transform: uppercase; letter-spacing: .05em; }
.resumen-total strong { font-size: 1.25rem; font-weight: 800; letter-spacing: -.02em; }
.chips-fichas { display: flex; flex-wrap: wrap; gap: .4rem; }
.chip-ficha {
    --color: var(--verde);
    display: inline-flex; align-items: center; gap: .4rem; padding: .25rem .65rem; border-radius: 20px;
    border: 1px solid var(--borde); background: #fff; font: inherit; font-size: .8rem; font-weight: 600; color: var(--texto);
    cursor: pointer; transition: border-color .15s, box-shadow .15s, transform .15s;
}
.chip-ficha .punto { width: 8px; height: 8px; border-radius: 50%; background: var(--color); }
.chip-ficha b { color: var(--suave); font-weight: 600; }
.chip-ficha:hover { border-color: var(--color); transform: translateY(-1px); box-shadow: 0 4px 10px -6px var(--color); }
.chip-ficha.activo { border-color: var(--color); background: color-mix(in srgb, var(--color) 12%, white); }
.chip-ficha.activo::after { content: "✕"; font-size: .7rem; color: var(--suave); }

/* Tema general */
.fc {
    --fc-border-color: #edf0f3; --fc-today-bg-color: #f5fbf0; --fc-neutral-bg-color: #fafbfc;
    --fc-page-bg-color: var(--tarjeta); --fc-list-event-hover-bg-color: #f6f8fa;
    --fc-now-indicator-color: var(--rojo);
}
.fc .fc-toolbar.fc-header-toolbar { margin-bottom: 1rem; gap: .6rem; }
.fc .fc-toolbar-title { font-size: 1.35rem; font-weight: 800; letter-spacing: -.02em; text-transform: none; }
.fc .fc-toolbar-title::first-letter { text-transform: uppercase; }
.fc .fc-button {
    background: #fff; border: 1px solid var(--borde); color: var(--texto); border-radius: 10px;
    padding: .4rem .8rem; font-size: .85rem; font-weight: 600; text-transform: capitalize; box-shadow: none !important;
    transition: background .15s, color .15s;
}
.fc .fc-button:hover { background: #f1f3f5; color: var(--texto); border-color: var(--borde); }
.fc .fc-button:disabled { opacity: .45; background: #fff; color: var(--texto); }
.fc .fc-button-group { gap: 2px; padding: 3px; border-radius: 12px; background: #eef1f4; }
.fc .fc-button-group > .fc-button { border: 0; border-radius: 9px !important; background: transparent; color: var(--suave); }
.fc .fc-button-group > .fc-button:hover { background: rgba(255, 255, 255, .7); color: var(--texto); }
.fc .fc-button-group > .fc-button.fc-button-active,
.fc .fc-button-group > .fc-button.fc-button-active:hover { background: #fff; color: var(--texto); box-shadow: 0 1px 3px rgba(16, 24, 40, .15) !important; }
.fc .fc-prev-button, .fc .fc-next-button { padding: .4rem .55rem; }

.fc-theme-standard .fc-scrollgrid { border: 0; }
.fc .fc-col-header-cell { border-left-color: transparent; border-right-color: transparent; padding: .45rem 0; }
.fc .fc-col-header-cell-cushion {
    color: var(--suave); text-decoration: none; text-transform: uppercase;
    font-size: .72rem; font-weight: 700; letter-spacing: .08em;
}
.fc .fc-day-today .fc-col-header-cell-cushion { color: var(--verde-osc); }

/* Mes */
.fc .fc-daygrid-day-frame { min-height: 92px; }
.fc .fc-daygrid-day { transition: background .15s; cursor: pointer; }
.fc .fc-day-sat:not(.fc-day-today), .fc .fc-day-sun:not(.fc-day-today) { background: #fcfcfd; }
.fc .fc-daygrid-day:hover { background: #f9fbf8; }
.fc .fc-daygrid-day-top { justify-content: space-between; }
.fc .fc-daygrid-day-number {
    display: grid; place-items: center; min-width: 1.75rem; height: 1.75rem; margin: .25rem .3rem 0; padding: 0 .3rem;
    border-radius: 20px; color: var(--texto); text-decoration: none; font-size: .8rem; font-weight: 600;
}
.fc .fc-day-today .fc-daygrid-day-number { background: var(--verde); color: #fff; box-shadow: 0 4px 10px -4px rgba(45, 133, 0, .7); }
.fc .fc-day-other .fc-daygrid-day-top { opacity: .35; }
.fc .fc-daygrid-day-top::after {   /* "+" discreto al pasar el mouse: agendar */
    content: "+"; margin: .3rem 0 0 .4rem; width: 1.4rem; height: 1.4rem; display: grid; place-items: center;
    border-radius: 6px; font-weight: 700; color: var(--verde-osc); background: var(--verde-claro); opacity: 0; transition: opacity .15s;
}
.fc .fc-daygrid-day:hover .fc-daygrid-day-top::after { opacity: 1; }
.fc .fc-daygrid-day-events { margin-top: 2px; }
.fc .fc-daygrid-more-link {
    display: inline-block; margin: 1px 0 0 5px; padding: 0 .45rem; border-radius: 6px;
    font-size: .72rem; font-weight: 700; color: var(--verde-osc); background: var(--verde-claro);
}
.fc .fc-daygrid-more-link:hover { background: #d8efc8; text-decoration: none; }
.fc .fc-popover { border: 1px solid var(--borde); border-radius: 14px; overflow: hidden; box-shadow: 0 18px 40px -12px rgba(16, 24, 40, .35); }
.fc .fc-popover-header { padding: .5rem .75rem; background: #f8f9fa; font-weight: 700; text-transform: capitalize; }
.fc .fc-popover-body { padding: .4rem; }

/* Eventos: tono suave del color de la ficha en vez de bloques sólidos */
.fc-event { cursor: pointer; font-size: .78rem; }
.fc .fc-event.ev-suave {
    background: color-mix(in srgb, var(--ev) 13%, white) !important;
    border: 0 !important; border-left: 3px solid var(--ev) !important; border-radius: 6px;
    color: color-mix(in srgb, var(--ev) 72%, black) !important; box-shadow: none;
    transition: background .15s, transform .15s, box-shadow .15s;
}
.fc .ev-suave .fc-event-main, .fc .ev-suave .fc-event-time, .fc .ev-suave .fc-event-title { color: inherit !important; }
.fc .fc-event.ev-suave:hover { background: color-mix(in srgb, var(--ev) 22%, white) !important; box-shadow: 0 4px 10px -6px var(--ev); }
.fc .fc-daygrid-event.ev-suave { margin: 1px 5px 2px !important; }
.fc .fc-daygrid-event.ev-suave:hover { transform: translateX(2px); }
.ev-linea { display: flex; align-items: center; gap: .35rem; min-width: 0; padding: 1px 5px; white-space: nowrap; overflow: hidden; }
.ev-linea b { font-weight: 700; font-size: .72rem; opacity: .75; font-variant-numeric: tabular-nums; }
.ev-linea span { overflow: hidden; text-overflow: ellipsis; font-weight: 600; }

/* Tareas: tarjeta blanca con borde, para distinguirlas de las formaciones */
.fc .fc-event.ev-tarea.ev-suave {
    background: #fff !important; border: 1px solid color-mix(in srgb, var(--ev) 40%, white) !important;
    border-left: 3px solid var(--ev) !important; color: var(--texto) !important;
}
.fc .fc-event.ev-tarea.ev-suave:hover { background: color-mix(in srgb, var(--ev) 8%, white) !important; }
.fc .ev-tarea.estado-en_progreso.ev-suave { border-style: dashed !important; border-left-style: solid !important; }
.fc .ev-tarea.estado-hecho { opacity: .5; }
.fc .ev-tarea.estado-hecho .ev-linea span, .fc .ev-tarea.estado-hecho .fc-event-title { text-decoration: line-through; }
.fc .ev-reposicion.ev-suave { border-left-style: dashed !important; }
.fc .ev-adicional.ev-suave { border-left-style: dotted !important; }
.fc .ev-cedida.ev-suave { opacity: .6; text-decoration: line-through; }

/* Festivo: solo el fondo con su etiqueta (la barra extra sobra en mes/semana) */
.fc-daygrid-event-harness:has(.ev-festivo-etiqueta) { display: none; }
.fc .fc-bg-event.ev-festivo { background: repeating-linear-gradient(135deg, #f7f8fa 0 6px, #eff1f4 6px 12px); opacity: 1; }
.fc .fc-bg-event .fc-event-title { font-style: normal; font-size: .7rem; font-weight: 700; color: var(--suave); margin: 2.3rem .5rem 0; }

/* Semana / día */
.fc .fc-timegrid-slot { height: 2.4em; }
.fc .fc-timegrid-slot-minor { border-top-color: transparent; }
.fc .fc-timegrid-slot-label-cushion, .fc .fc-timegrid-axis-cushion { font-size: .72rem; color: var(--suave); font-weight: 600; }
.fc .fc-timegrid-event.ev-suave { border-radius: 8px; }
.fc .fc-timegrid-event .fc-event-main { padding: 3px 6px; }
.fc .fc-timegrid-event .fc-event-time { font-size: .7rem; font-weight: 700; opacity: .8; }
.fc .fc-timegrid-event .fc-event-title { font-weight: 600; }
.fc .fc-timegrid-now-indicator-line { border-width: 2px 0 0; }

/* Agenda (lista) */
.fc .fc-list { border: 0; }
.fc .fc-list-day-cushion { background: #f8f9fa; text-transform: capitalize; font-size: .85rem; }
.fc .fc-list-event td { padding: .55rem .8rem; }
.fc .fc-list-event-dot { border-width: 5px; }
.fc .fc-list-event.ev-suave { background: none !important; border: 0 !important; color: var(--texto) !important; }


/* ----- Kanban ----- */
.kanban-caja { padding: 1rem 1.2rem; border-radius: 18px; }
.cal-select input[type=date] {
    width: auto; border: 0; background: transparent; outline: none !important; box-shadow: none;
    padding: .35rem .5rem .35rem .3rem; font-size: .85rem; font-weight: 600; color: var(--texto);
}

/* Barra de progreso general */
.kanban-progreso { display: flex; align-items: center; gap: 1rem; margin-top: .3rem; font-size: .85rem; }
.kp-barra { flex: 1; display: flex; height: 8px; border-radius: 8px; overflow: hidden; background: #eef1f4; max-width: 420px; }
.kp-barra i { display: block; height: 100%; width: 0; transition: width .6s cubic-bezier(.2, .8, .2, 1); }
/* La barra muestra avance: "Por hacer" es lo que falta, así que va vacío (con 0 % hechas la barra se ve vacía) */
.kp-pend { background: transparent; }
.kp-prog { background: var(--ambar); }
.kp-hecho { background: var(--verde); }
.kanban-progreso strong { color: var(--texto); }
.kp-vencidas { color: var(--rojo); font-weight: 700; }

/* Columnas */
.kanban { --col: var(--azul); display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.1rem; align-items: start; }
.kanban-columna {
    --col: var(--azul);
    position: relative; padding: .9rem .8rem .8rem; border-radius: 18px;
    background: color-mix(in srgb, var(--col) 5%, #f3f5f7);
    border: 1px solid color-mix(in srgb, var(--col) 12%, #e8ebef);
    transition: background .2s, border-color .2s, box-shadow .2s;
}
.kanban-columna.col-en_progreso { --col: var(--ambar); }
.kanban-columna.col-hecho { --col: var(--verde); }
.kanban-columna header { display: flex; justify-content: space-between; align-items: center; margin-bottom: .8rem; padding: 0 .3rem; }
.kanban-columna h2 { display: flex; align-items: center; gap: .55rem; margin: 0; font-size: 1rem; font-weight: 700; }
.kc-icono {
    display: grid; place-items: center; width: 30px; height: 30px; border-radius: 10px; font-size: .95rem;
    background: color-mix(in srgb, var(--col) 16%, white);
}
.contador {
    min-width: 1.8rem; text-align: center; border-radius: 20px; padding: .1rem .55rem; font-weight: 700; font-size: .8rem;
    background: color-mix(in srgb, var(--col) 15%, white); color: color-mix(in srgb, var(--col) 70%, black);
}
/* Cada columna tiene su propio scroll para que las tres queden siempre a la vista al arrastrar */
.kanban-lista {
    min-height: 120px; max-height: calc(100vh - 300px); overflow-y: auto;
    display: flex; flex-direction: column; gap: .6rem; padding: 3px 4px 6px 3px; border-radius: 12px;
    scrollbar-width: thin; scrollbar-color: #cfd6de transparent;
    transition: background .2s, outline-color .2s;
    outline: 2px dashed transparent; outline-offset: -2px;
}
.kanban-lista:empty::before {
    content: attr(data-vacio); display: grid; place-items: center; min-height: 110px; padding: 1rem;
    border: 2px dashed color-mix(in srgb, var(--col) 25%, #dfe3e8); border-radius: 12px;
    color: var(--suave); font-size: .85rem; text-align: center;
}
.kanban.arrastrando .kanban-lista { outline-color: color-mix(in srgb, var(--col) 35%, transparent); background: color-mix(in srgb, var(--col) 6%, transparent); }
.kanban.arrastrando .kanban-lista:empty::before { border-color: transparent; }
.kanban-agregar {
    width: 100%; margin-top: .5rem; padding: .55rem; border: 1px dashed #cfd6de; border-radius: 12px;
    background: transparent; font: inherit; font-weight: 600; font-size: .88rem; color: var(--suave); cursor: pointer;
    transition: background .15s, color .15s, border-color .15s;
}
.kanban-agregar:hover { background: #fff; color: var(--verde-osc); border-color: var(--verde); }

/* Tarjetas */
.kanban-tarjeta {
    --color: #6c757d;
    position: relative; background: #fff; border-radius: 14px; padding: .75rem .85rem .8rem 1rem;
    border: 1px solid #e9edf1; box-shadow: 0 1px 2px rgba(16, 24, 40, .05);
    cursor: grab; transition: box-shadow .2s, transform .2s, border-color .2s;
    animation: subir .4s cubic-bezier(.2, .8, .2, 1) backwards; animation-delay: calc(var(--i, 0) * 35ms);
}
.kanban-tarjeta::before {   /* acento del color de la ficha */
    content: ""; position: absolute; left: 0; top: .7rem; bottom: .7rem; width: 4px; border-radius: 0 4px 4px 0; background: var(--color);
}
.kanban-tarjeta:hover { border-color: color-mix(in srgb, var(--color) 35%, #e9edf1); box-shadow: 0 10px 22px -12px rgba(16, 24, 40, .35); transform: translateY(-2px); }
.kanban-tarjeta:active { cursor: grabbing; }
.kanban-tarjeta h3 { font-size: .93rem; font-weight: 650; line-height: 1.35; margin: .4rem 0 .6rem; word-break: break-word; }
.kt-cabecera { display: flex; align-items: center; gap: .4rem; font-size: .72rem; color: var(--suave); font-weight: 600; min-height: 24px; }
.kt-tipo { padding: .1rem .45rem; border-radius: 6px; background: #f3f5f7; }
.kt-prioridad { padding: .1rem .45rem; border-radius: 6px; background: #fdecee; color: var(--rojo); font-weight: 700; }
.kt-pie { display: flex; flex-wrap: wrap; gap: .4rem .6rem; align-items: center; justify-content: space-between; }
.kt-asoc {
    display: inline-flex; align-items: center; gap: .35rem; font-size: .76rem; font-weight: 600;
    color: color-mix(in srgb, var(--color) 70%, black);
}
.kt-asoc .punto { width: 8px; height: 8px; border-radius: 50%; background: var(--color); }
.kt-fecha { font-size: .74rem; color: var(--suave); font-weight: 500; padding: .1rem .45rem; border-radius: 6px; background: #f6f7f9; }
.kanban-tarjeta.alerta-vencida { border-color: #f5c9ce; background: linear-gradient(180deg, #fff8f8, #fff); }
.kanban-tarjeta.alerta-vencida .kt-fecha { color: var(--rojo); background: #fdecee; font-weight: 700; }
.kanban-tarjeta.alerta-proxima .kt-fecha { color: #b76e00; background: #fff4de; font-weight: 700; }

/* Mover con un clic: flechas discretas que aparecen al pasar el mouse */
.kt-mover { display: flex; gap: .25rem; margin-left: auto; opacity: 0; transition: opacity .15s; }
.kanban-tarjeta:hover .kt-mover, .kanban-tarjeta:focus-within .kt-mover { opacity: 1; }
.kt-mover button {
    display: grid; place-items: center; width: 24px; height: 24px; padding: 0; border-radius: 7px;
    border: 1px solid var(--borde); background: #fff; font: inherit; font-size: .8rem; font-weight: 700; color: var(--suave); cursor: pointer;
    transition: background .15s, color .15s, border-color .15s;
}
.kt-mover button:hover { background: var(--verde-claro); border-color: var(--verde); color: var(--verde-osc); }
.kt-mover [hidden] { display: none; }
@media (hover: none) { .kt-mover { opacity: 1; } }

/* Hechas */
.col-hecho .kanban-tarjeta { background: #fbfcfb; }
.col-hecho .kanban-tarjeta h3 { text-decoration: line-through; text-decoration-color: #adb5bd; color: var(--suave); }
.col-hecho .kanban-tarjeta::before { background: color-mix(in srgb, var(--color) 45%, white); }
.col-hecho .kanban-tarjeta .kt-fecha, .col-hecho .kanban-tarjeta .kt-prioridad { opacity: .7; }

/* Arrastre */
.kanban-fantasma { opacity: .4; border: 2px dashed var(--color) !important; background: color-mix(in srgb, var(--color) 8%, white) !important; box-shadow: none !important; }
.kanban-fantasma > * { visibility: hidden; }
.kanban-elegida { box-shadow: 0 0 0 2px color-mix(in srgb, var(--color) 50%, transparent); }
.kanban-arrastrada { transform: rotate(2deg); box-shadow: 0 20px 40px -12px rgba(16, 24, 40, .45) !important; opacity: 1 !important; }
@media (prefers-reduced-motion: reduce) { .kanban-tarjeta { animation: none; } }
@media (max-width: 640px) { .kanban-progreso { flex-direction: column; align-items: stretch; gap: .4rem; } .kp-barra { max-width: none; } }

/* ----- Responsivo ----- */
@media (max-width: 1000px) {
    .rejilla-2, .rejilla-lateral { grid-template-columns: 1fr; }
    .estadisticas { grid-template-columns: repeat(2, 1fr); }
    .kanban { grid-template-columns: 1fr; }
    .kanban-lista { max-height: 60vh; }
    .barra { flex-wrap: wrap; gap: .6rem; padding: .6rem 1rem; }
    .menu-toggle { display: block; }
    .menu, .menu-usuario { display: none; width: 100%; }
    body.menu-abierto .menu { display: flex; flex-direction: column; padding: .3rem 0; }
    body.menu-abierto .menu a { border-radius: 12px; }
    body.menu-abierto .menu-usuario { display: block; padding-bottom: .4rem; }
    .menu-usuario > summary { width: fit-content; }
    .menu-usuario-panel { position: static; box-shadow: none; margin-top: .4rem; animation: none; }
}
@media (max-width: 640px) {
    .contenido { padding: 1rem; }
    .fc .fc-toolbar { flex-direction: column; gap: .5rem; }
    .en-linea { flex-direction: column; align-items: stretch; }
}

/* ===== Modal SweetAlert con formulario (cambiar contraseña) ===== */
.swal-form-popup { width: min(430px, 94vw) !important; max-width: 94vw !important; padding: 1.25rem 1.5rem 1.75rem; }
.swal-form-popup .swal2-html-container { margin: .5rem 0 0; overflow: visible; }
.swal-form { display: flex; flex-direction: column; gap: .85rem; text-align: left; }
.swal-form label { display: flex; flex-direction: column; gap: .3rem; font-weight: 600; font-size: .88rem; color: var(--texto); margin: 0; }
.swal-form label small { font-weight: 400; color: var(--suave); }
.swal-form input { width: 100%; }
.swal-form-popup .swal2-actions { margin-top: 1.25rem; gap: .5rem; flex-wrap: wrap; }
@media (max-width: 480px) {
    .swal-form-popup { padding: 1rem 1rem 1.25rem; }
    .swal-form-popup .swal2-actions { flex-direction: column-reverse; width: 100%; }
    .swal-form-popup .swal2-actions .swal2-styled { width: 100%; margin: 0; }
}

/* ===== Modal de tareas ===== */
.fila-pildoras { display: flex; flex-wrap: wrap; gap: 0 1.5rem; }
.segmentado label { position: relative; }

/* ===== Fichas y categorías (tarjetas + formulario lateral) ===== */
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 1rem; align-content: start; }
.cat-tarjeta {
    --color: var(--verde);
    position: relative; overflow: hidden; display: flex; flex-direction: column; gap: .35rem;
    padding: 1.05rem 1.1rem .8rem; border-radius: 18px; background: var(--tarjeta);
    border: 1px solid color-mix(in srgb, var(--color) 22%, var(--borde));
    box-shadow: var(--sombra); transition: transform .2s, box-shadow .2s, border-color .2s;
    animation: subir .45s cubic-bezier(.2, .8, .2, 1) backwards; animation-delay: calc(var(--i, 0) * 45ms);
}
.cat-tarjeta::before {
    content: ""; position: absolute; inset: 0 0 auto; height: 70px; z-index: 0;
    background: linear-gradient(180deg, color-mix(in srgb, var(--color) 14%, white), transparent);
}
.cat-tarjeta > * { position: relative; }
.cat-tarjeta:hover { transform: translateY(-3px); box-shadow: 0 14px 28px -16px color-mix(in srgb, var(--color) 80%, black); }
.cat-tarjeta.editando { border-color: var(--color); box-shadow: 0 0 0 3px color-mix(in srgb, var(--color) 30%, transparent); }
.cat-tarjeta header { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.cat-numero { display: inline-flex; align-items: center; gap: .5rem; font-size: 1.15rem; font-weight: 800; letter-spacing: -.01em; }
.cat-numero::before { content: ""; width: 12px; height: 12px; border-radius: 50%; background: var(--color); box-shadow: 0 0 0 3px color-mix(in srgb, var(--color) 25%, white); }
.cat-estado { font-size: .7rem; font-weight: 700; padding: .12rem .5rem; border-radius: 999px; background: var(--verde-claro); color: var(--verde-osc); }
.cat-tarjeta.inactiva { opacity: .65; }
.cat-tarjeta.inactiva .cat-estado { background: #eef1f4; color: var(--suave); }
.cat-sub { margin: 0; font-size: .87rem; color: var(--suave); min-height: 1.4em; }
.cat-datos { display: flex; flex-wrap: wrap; gap: .4rem; margin: .3rem 0 .2rem; }
.cat-datos span { font-size: .78rem; color: var(--suave); padding: .2rem .55rem; border-radius: 8px; background: #f6f7f9; }
.cat-datos strong { color: var(--texto); }
.cat-acciones { display: flex; align-items: center; gap: .35rem; margin-top: .4rem; padding-top: .6rem; border-top: 1px solid #f0f2f5; }
.cat-acciones form { margin: 0; }
.cat-acciones .btn-icono { width: 32px; height: 32px; font-size: .85rem; opacity: .6; transition: opacity .15s, background .15s, border-color .15s; }
.cat-tarjeta:hover .btn-icono, .cat-acciones .btn-icono:focus-visible { opacity: 1; }
@media (hover: none) { .cat-acciones .btn-icono { opacity: 1; } }

.cat-form { position: sticky; top: 80px; --color: var(--verde); }
.cat-form.editando { border-color: color-mix(in srgb, var(--color) 50%, var(--borde)); }
.cat-vista {
    display: flex; align-items: center; gap: .55rem; margin: -1.3rem -1.4rem 1rem; padding: 1rem 1.4rem;
    border-radius: 16px 16px 0 0; font-weight: 800; font-size: 1.05rem;
    background: linear-gradient(135deg, color-mix(in srgb, var(--color) 18%, white), color-mix(in srgb, var(--color) 4%, white));
    border-bottom: 1px solid color-mix(in srgb, var(--color) 20%, var(--borde)); transition: background .2s;
}
.cat-vista .punto { width: 14px; height: 14px; border-radius: 50%; background: var(--color); box-shadow: 0 0 0 3px #fff; }
.campo-color { margin-bottom: 1rem; }
.campo-titulo { display: block; font-weight: 600; font-size: .88rem; margin-bottom: .45rem; }
.muestras { display: grid; grid-template-columns: repeat(auto-fill, 30px); gap: .45rem; align-items: center; }
.muestra {
    width: 30px; height: 30px; border-radius: 50%; border: 0; padding: 0; cursor: pointer; background: var(--m);
    box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .35); transition: transform .15s, box-shadow .15s;
}
.muestra:hover { transform: scale(1.12); }
.muestra.activa { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--m); transform: scale(1.05); }
.formulario .muestra-libre { margin: 0; }
.muestra-libre input[type=color] { width: 30px; height: 30px; border-radius: 50%; padding: 2px; }
.muestra-libre input[type=color]::-webkit-color-swatch { border-radius: 50%; }

/* ===== Cambios de formación ===== */
.cambios-lista { display: grid; grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); gap: 1rem; }
.cambio-tarjeta {
    --color: var(--verde);
    display: flex; flex-direction: column; gap: .9rem; padding: 1.1rem 1.2rem; border-radius: 18px;
    background: var(--tarjeta); border: 1px solid var(--borde); box-shadow: var(--sombra);
    border-top: 4px solid var(--color); transition: transform .2s, box-shadow .2s;
    animation: subir .45s cubic-bezier(.2, .8, .2, 1) backwards; animation-delay: calc(var(--i, 0) * 50ms);
}
.cambio-tarjeta:hover { transform: translateY(-2px); box-shadow: 0 14px 28px -16px rgba(16, 24, 40, .35); }
.cambio-tarjeta.pasado { opacity: .7; }
.cambio-cab { display: flex; justify-content: space-between; align-items: flex-start; gap: .6rem; }
.cambio-cab small { display: block; }
.cambio-ficha { display: inline-flex; align-items: center; gap: .45rem; font-weight: 800; font-size: 1.05rem; }
.cambio-ficha .punto { width: 10px; height: 10px; border-radius: 50%; background: var(--color); }
.cambio-meta { display: flex; flex-direction: column; align-items: flex-end; gap: .25rem; }
.cambio-flujo { display: grid; grid-template-columns: 1fr auto 1.3fr; align-items: stretch; gap: .6rem; }
.cambio-antes, .cambio-ahora { padding: .7rem .8rem; border-radius: 12px; font-size: .88rem; }
.cambio-antes { background: #f6f7f9; color: var(--suave); }
.cambio-ahora { background: color-mix(in srgb, var(--color) 9%, white); border: 1px solid color-mix(in srgb, var(--color) 25%, white); display: grid; gap: .35rem; }
.cambio-etiqueta { display: block; margin-bottom: .3rem; font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--suave); }
.cambio-bloque { display: flex; flex-wrap: wrap; gap: .1rem .5rem; align-items: baseline; }
.cambio-flecha { display: grid; place-items: center; font-size: 1.2rem; font-weight: 800; color: var(--color); }
.cambio-pie { display: flex; align-items: center; justify-content: space-between; gap: .8rem; }
.cambio-pie form { margin: 0; }
.cambio-nota { margin: 0; font-size: .86rem; color: var(--suave); }
@media (max-width: 560px) {
    .cambios-lista { grid-template-columns: 1fr; }
    .cambio-flujo { grid-template-columns: 1fr; }
    .cambio-flecha { transform: rotate(90deg); }
}

/* ===== Cargar horario ===== */
.subir-rejilla { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(260px, 1fr); gap: 1.25rem; align-items: start; }
.subir-rejilla > .tarjeta { margin-bottom: 0; }
.subir-info { background: linear-gradient(160deg, #f5faf1, #fff 60%); }
.subir-info .pasos { margin-top: .2rem; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none !important; box-shadow: none; }
@media (max-width: 860px) { .subir-rejilla { grid-template-columns: 1fr; } }
.estadisticas-4 { grid-template-columns: repeat(4, 1fr); }
.rango-fechas { font-size: 1rem; }
.lista-simple li { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; }

/* ===== Historial de cargas (línea de tiempo) ===== */
.historial { list-style: none; margin: 0; padding: 0; }
.historial-item { position: relative; display: grid; grid-template-columns: 92px 1fr; gap: 1.2rem; padding-bottom: 1rem; animation: subir .45s cubic-bezier(.2, .8, .2, 1) backwards; animation-delay: calc(var(--i, 0) * 50ms); }
.historial-item::before { content: ""; position: absolute; left: 110px; top: 18px; bottom: -4px; width: 2px; background: var(--borde); }
.historial-item:last-child::before { display: none; }
.historial-item::after {
    content: ""; position: absolute; left: 104px; top: 12px; width: 14px; height: 14px; border-radius: 50%;
    background: #fff; border: 3px solid #b9c2cc; box-sizing: border-box;
}
.historial-item.actual::after { border-color: var(--verde); background: var(--verde); box-shadow: 0 0 0 4px var(--verde-claro); }
.hi-fecha { text-align: right; padding-top: .55rem; line-height: 1.25; font-variant-numeric: tabular-nums; }
.hi-fecha small { display: block; color: var(--suave); }
.hi-tarjeta { margin: 0 0 0 1.4rem; padding: 1rem 1.2rem; transition: transform .2s, box-shadow .2s; }
.hi-tarjeta:hover { transform: translateX(3px); box-shadow: 0 12px 26px -16px rgba(16, 24, 40, .35); }
.hi-tarjeta header { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem; }
.hi-archivo { font-weight: 700; word-break: break-all; }
.hi-rango { margin: .5rem 0; color: var(--suave); font-size: .9rem; }
.hi-datos { display: flex; flex-wrap: wrap; gap: .4rem; }
.hi-datos span { font-size: .8rem; color: var(--suave); padding: .2rem .6rem; border-radius: 8px; background: #f6f7f9; }
.hi-datos strong { color: var(--texto); }
@media (max-width: 560px) {
    .historial-item { grid-template-columns: 1fr; gap: .3rem; padding-left: 1.4rem; }
    .historial-item::before { left: 6px; top: 16px; }
    .historial-item::after { left: 0; top: 4px; }
    .hi-fecha { text-align: left; padding-top: 0; }
    .hi-fecha small { display: inline; margin-left: .3rem; }
    .hi-tarjeta { margin: 0; }
}

/* ===== Cambiar contraseña ===== */
.auth-caja { display: grid; place-items: center; min-height: calc(100vh - 160px); }
.auth-tarjeta { position: relative; width: min(440px, 100%); padding: 2rem 2rem 1.6rem; border-radius: 22px; box-shadow: 0 24px 60px -24px rgba(16, 24, 40, .35); }
.auth-tarjeta h1 { font-size: 1.7rem; }
.auth-tarjeta input { padding: .75rem .9rem; border-radius: 12px; }
.auth-icono {
    position: absolute; top: -26px; right: 1.6rem; display: grid; place-items: center; width: 56px; height: 56px;
    border-radius: 18px; font-size: 1.6rem; background: linear-gradient(135deg, #43b80a, var(--verde-osc));
    box-shadow: 0 12px 24px -10px rgba(45, 133, 0, .7);
}
.auth-volver { margin-top: 1rem; }
.auth-volver a { text-decoration: none; font-weight: 600; }

/* ===== Páginas de error ===== */
.pagina-error { position: relative; overflow: hidden; width: min(480px, 100%); padding: 2.6rem 2rem 2.2rem; text-align: center; border-radius: 24px; box-shadow: 0 24px 60px -24px rgba(16, 24, 40, .35); }
.pe-icono { display: block; font-size: 2.6rem; animation: agenda-flotar 4s ease-in-out infinite; }
.pe-codigo {
    display: block; font-size: 4.5rem; font-weight: 900; letter-spacing: -.05em; line-height: 1; margin: .3rem 0 .4rem;
    background: linear-gradient(135deg, #43b80a, #1f6e00); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.pagina-error p { margin: 0 auto 1.4rem; max-width: 36ch; }
@media (max-width: 1000px) { .estadisticas-4 { grid-template-columns: repeat(2, 1fr); } .cat-form { position: static; } }

/* ===== Modales del calendario: cabecera con el color de la ficha ===== */
.modal-color { --color: var(--verde); }
.modal-hero {
    position: relative; overflow: hidden; isolation: isolate;
    margin: -1.4rem -1.6rem 1.2rem; padding: 1.3rem 1.6rem 1.25rem; color: #fff;
    background:
        radial-gradient(120% 140% at 100% 0%, rgba(255, 255, 255, .22), transparent 55%),
        linear-gradient(135deg, color-mix(in srgb, var(--color) 82%, white), var(--color) 45%, color-mix(in srgb, var(--color) 70%, black));
}
.modal-hero::after {   /* círculos decorativos */
    content: ""; position: absolute; z-index: -1; width: 190px; height: 190px; right: -60px; bottom: -110px;
    border-radius: 50%; background: rgba(255, 255, 255, .12); box-shadow: -120px -40px 0 -50px rgba(255, 255, 255, .08);
}
.modal-hero h2 { margin: .45rem 0 .1rem; font-size: 1.55rem; font-weight: 800; letter-spacing: -.02em; }
.modal-hero-compacto h2 { font-size: 1.3rem; }
.hero-sub { margin: 0; font-size: .92rem; opacity: .92; }
.modal-hero .cerrar { position: absolute; top: .8rem; right: .8rem; width: 34px; height: 34px; border-radius: 10px; color: #fff; opacity: .85; background: rgba(255, 255, 255, .15); }
.modal-hero .cerrar:hover { opacity: 1; background: rgba(255, 255, 255, .28); }
.hero-insignias { display: flex; flex-wrap: wrap; gap: .4rem; padding-right: 2.5rem; }
.insignia {
    display: inline-flex; align-items: center; gap: .3rem; padding: .18rem .6rem; border-radius: 999px;
    font-size: .74rem; font-weight: 700; background: #fff; color: color-mix(in srgb, var(--color) 75%, black);
}
.insignia-suave { background: rgba(255, 255, 255, .2); color: #fff; }
.insignia-suave:empty { display: none; }

/* Hora inicio ─── fin */
.hero-hora { display: flex; align-items: center; gap: .7rem; margin-top: 1rem; font-variant-numeric: tabular-nums; }
.hero-hora strong { font-size: 1.6rem; font-weight: 800; letter-spacing: -.02em; }
.hero-linea { flex: 1; position: relative; height: 4px; border-radius: 4px; background: rgba(255, 255, 255, .3); }
.hero-linea i { position: absolute; inset: 0; border-radius: inherit; background: #fff; transform-origin: left; animation: crecer .8s .15s cubic-bezier(.2, .8, .2, 1) both; }
.hero-linea::before, .hero-linea::after { content: ""; position: absolute; top: 50%; width: 10px; height: 10px; margin-top: -5px; border-radius: 50%; background: #fff; }
.hero-linea::before { left: -5px; } .hero-linea::after { right: -5px; }
.hero-duracion { padding: .2rem .55rem; border-radius: 8px; font-size: .8rem; font-weight: 700; background: rgba(0, 0, 0, .18); }

/* Datos con ícono */
.info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; margin-bottom: .4rem; }
.info-item {
    display: flex; align-items: center; gap: .7rem; padding: .65rem .75rem; border-radius: 14px;
    background: #f8f9fa; border: 1px solid #eef0f3; animation: subir .35s cubic-bezier(.2, .8, .2, 1) backwards;
}
.info-item:nth-child(2) { animation-delay: 40ms; } .info-item:nth-child(3) { animation-delay: 80ms; } .info-item:nth-child(n + 4) { animation-delay: 120ms; }
.info-item.ancho { grid-column: 1 / -1; }
.info-icono {
    flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 11px; font-size: 1rem;
    background: color-mix(in srgb, var(--color) 14%, white);
}
.info-item small { display: block; font-size: .72rem; font-weight: 600; color: var(--suave); text-transform: uppercase; letter-spacing: .05em; }
.info-item strong { display: block; font-size: .93rem; font-weight: 600; word-break: break-word; }
.modal-color .modal-pie { flex-wrap: wrap; }

/* Pasos del modal de cambio */
fieldset.paso { border: 0; margin: 0 0 1.1rem; padding: 0; min-width: 0; }
fieldset.paso[hidden] { display: none; }
fieldset.paso legend { display: flex; align-items: center; gap: .5rem; padding: 0; margin-bottom: .6rem; font-weight: 700; font-size: .95rem; }
.paso-num {
    display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; font-size: .78rem; font-weight: 800;
    background: var(--color); color: #fff; box-shadow: 0 4px 10px -4px var(--color);
}
fieldset.paso .fila-campos label { margin-bottom: .5rem; }

/* Cada día de reposición */
.bloque-cambio {
    position: relative; padding: .8rem .9rem .7rem; margin-bottom: .7rem; border-radius: 14px;
    background: #fbfcfc; border: 1px solid var(--borde); border-left: 4px solid var(--color);
    animation: subir .3s cubic-bezier(.2, .8, .2, 1); transition: opacity .2s, transform .2s;
}
.bloque-cambio.saliendo { opacity: 0; transform: translateX(16px); }
.bloque-cab { display: flex; align-items: center; gap: .5rem; margin-bottom: .55rem; }
.bloque-titulo { font-weight: 700; font-size: .9rem; }
.bloque-horas { padding: .1rem .5rem; border-radius: 999px; font-size: .75rem; font-weight: 700; background: color-mix(in srgb, var(--color) 14%, white); color: color-mix(in srgb, var(--color) 70%, black); }
.bloque-cab .btn-icono { margin-left: auto; width: 28px; height: 28px; font-size: .8rem; }
.bloque-cab [hidden] { display: none; }
.bloque-pie { display: flex; justify-content: space-between; align-items: center; gap: .5rem; }
.btn-pequeno { padding: .25rem .6rem; font-size: .8rem; }

/* Barra del día: ocupado vs. elegido */
.dia-barra {
    position: relative; height: 14px; margin: .2rem 0 .2rem; border-radius: 7px; overflow: hidden;
    background: repeating-linear-gradient(90deg, #eef1f4 0 calc(100% / 16 - 1px), #e2e6ea calc(100% / 16 - 1px) calc(100% / 16));
}
.dia-barra i { position: absolute; top: 0; bottom: 0; border-radius: 7px; transition: left .25s, width .25s; }
.db-ocupado { background: #9aa5b1; }
.db-elegido { background: var(--color); box-shadow: 0 0 0 2px #fff inset; opacity: .9; }
.dia-barra.choca .db-elegido { background: repeating-linear-gradient(45deg, var(--rojo) 0 6px, #e8606d 6px 12px); }
.dia-barra.festivo { background: repeating-linear-gradient(45deg, #f1f3f5 0 6px, #e2e6ea 6px 12px); }
.dia-escala { display: flex; justify-content: space-between; font-size: .66rem; color: var(--suave); font-variant-numeric: tabular-nums; margin-bottom: .3rem; }
.ocupacion { display: block; font-size: .8rem; }

/* Balance de horas cedidas / repuestas */
.balance { --avance: 0%; display: flex; align-items: center; gap: .8rem; margin-top: .7rem; padding: .65rem .8rem; border-radius: 12px; background: #f8f9fa; font-size: .88rem; }
.balance-barra { flex: none; width: 90px; height: 8px; border-radius: 8px; background: #e2e6ea; overflow: hidden; }
.balance-barra i { display: block; height: 100%; width: var(--avance); border-radius: inherit; background: var(--ambar); transition: width .35s cubic-bezier(.2, .8, .2, 1), background .2s; }
.balance.ok .balance-barra i { background: var(--verde); }
.balance.sobra .balance-barra i { background: var(--rojo); }
.balance-nota { font-weight: 700; }
.balance.ok .balance-nota { color: var(--verde-osc); }
.balance.falta .balance-nota { color: #b76e00; }
.balance.sobra .balance-nota { color: var(--rojo); }

@media (max-width: 520px) {
    .info-grid { grid-template-columns: 1fr; }
    .hero-hora strong { font-size: 1.3rem; }
}
/* 3 campos (fecha, bloque, ficha): el bloque necesita espacio para "06:00 – 12:00 (6 h)" */
.bloque-cambio .fila-campos { grid-template-columns: 1.15fr 1.45fr 1fr; gap: 0 .6rem; }
.bloque-cambio .fila-campos select, .bloque-cambio .fila-campos input { min-width: 0; width: 100%; }
@media (max-width: 560px) { .bloque-cambio .fila-campos { grid-template-columns: 1fr 1fr; } .bloque-cambio .fila-campos label:first-child { grid-column: 1 / -1; } }

/* Días pasados: no se agenda en ellos */
.fc .fc-daygrid-day.fc-day-past { cursor: default; }
.fc .fc-daygrid-day.fc-day-past:hover { background: inherit; }
.fc .fc-day-past .fc-daygrid-day-top::after { display: none; }
.fc .fc-daygrid-day.fc-day-past .fc-daygrid-day-number { color: #9aa5b1; }
.fc .fc-timegrid-col.fc-day-past { background: repeating-linear-gradient(135deg, transparent 0 10px, rgba(16, 24, 40, .025) 10px 20px); }

/* Tareas pasadas: solo consulta */
.aviso-bloqueo { margin: 0 0 1rem; padding: .65rem .9rem; border-radius: 12px; background: #f3f5f7; border: 1px solid var(--borde); color: var(--suave); font-weight: 600; font-size: .9rem; }
.modal.solo-lectura .segmentado label { cursor: default; }
.modal.solo-lectura .segmentado label:not(:has(input:checked)) { opacity: .45; }
.modal.solo-lectura input:disabled, .modal.solo-lectura select:disabled, .modal.solo-lectura textarea:disabled { background: #f6f7f9; color: var(--texto); cursor: default; opacity: 1; }
.modal.solo-lectura .switch { cursor: default; opacity: .7; }
.kanban-tarjeta.bloqueada { cursor: pointer; }
.kanban-tarjeta.bloqueada:hover { transform: none; }
.kt-candado { margin-left: auto; font-size: .8rem; opacity: .7; }
.check-bloqueado { display: grid; place-items: center; border-style: dashed; font-size: .65rem; cursor: default; }
.check-bloqueado::after { display: none; }
.fc .ev-bloqueada { cursor: pointer; }
.fc .ev-bloqueada .ev-linea span::before { content: "🔒 "; font-size: .65rem; }
.kt-mover-fijo { opacity: 1; align-items: center; }
.kt-mover-fijo .kt-candado { margin: 0 .2rem 0 0; }
.kt-mover-fijo [data-mover="hecho"] { background: var(--verde-claro); border-color: #bfe3a7; color: var(--verde-osc); }
.kanban-tarjeta.bloqueada:not(.fija) { cursor: grab; }

/* ===== Tareas no realizadas (vencieron sin marcarse como hechas) ===== */
.kanban { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.kanban-columna.col-no_realizada { --col: var(--rojo); }
.col-no_realizada .kanban-tarjeta { background: #fffafa; }
.col-no_realizada .kanban-tarjeta h3 { color: #6b2a31; }
.kp-no { background: var(--rojo); }
.estadisticas { grid-template-columns: repeat(6, 1fr); }
.segmentado label.e-no_realizada:has(input:checked) { background: #fdecee; border-color: var(--rojo); color: var(--rojo); }
.fc .fc-event.ev-tarea.estado-no_realizada.ev-suave { background: #fff5f5 !important; border-color: #f5c2c7 !important; border-left-color: var(--rojo) !important; }
.fc .ev-tarea.estado-no_realizada .ev-linea span, .fc .ev-tarea.estado-no_realizada .fc-event-title { text-decoration: line-through; text-decoration-color: var(--rojo); }
.fc .ev-bloqueada.estado-no_realizada .ev-linea span::before { content: "⛔ "; }
@media (max-width: 1200px) { .kanban { grid-template-columns: repeat(2, minmax(0, 1fr)); } .estadisticas { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 1000px) { .estadisticas { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 700px) { .kanban { grid-template-columns: 1fr; } }

/* =====================================================================
   Manual de uso (ayuda/index)
   ===================================================================== */
.m-hero {
    position: relative; overflow: hidden;
    display: flex; align-items: center; gap: 2rem;
    padding: 2rem 2.2rem; margin-bottom: 1.4rem; border-radius: 22px; color: #fff;
    background-color: #2f8f00;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='48' viewBox='0 0 28 48'%3E%3Cpath d='M14 0L28 8V24L14 32L0 24V8Z M14 32V48' fill='none' stroke='%23ffffff' stroke-opacity='.12' stroke-width='1'/%3E%3C/svg%3E");
    box-shadow: 0 18px 40px -22px rgba(31, 110, 0, .8), inset 0 1px 0 rgba(255, 255, 255, .2);
}
.m-hero-texto { flex: 1; min-width: 0; }
.m-hero-etiqueta { display: inline-block; padding: .2rem .7rem; border-radius: 99px; background: rgba(255, 255, 255, .18); font-size: .75rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.m-hero h1 { font-size: clamp(1.5rem, 3vw, 2.1rem); margin: .55rem 0 .4rem; color: #fff; }
.m-hero p { margin: 0; max-width: 62ch; opacity: .92; }
.m-hero-buscar { flex: 0 1 380px; min-width: 260px; align-self: center; }
.m-buscador {
    display: flex; align-items: center; gap: .6rem;
    padding: .25rem .4rem .25rem .9rem; border-radius: 14px; background: #fff; color: var(--texto);
    box-shadow: 0 10px 24px -12px rgba(0, 0, 0, .45);
}
.m-buscador input { flex: 1; border: 0; outline: 0; padding: .65rem .2rem; font: inherit; background: transparent; min-width: 0; }
.m-sin-resultados { margin-top: .7rem !important; padding: .5rem .8rem; border-radius: 10px; background: rgba(255, 255, 255, .18); }
.m-sin-resultados a { color: #fff; font-weight: 700; }
.manual { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 1.4rem; align-items: start; }
/* Índice lateral fijo */
.m-indice {
    position: sticky; top: 80px; display: grid; gap: 2px; padding: .7rem;
    border-radius: 18px; background: #fff; box-shadow: var(--sombra);
}
.m-indice-titulo { margin: .2rem .6rem .5rem; font-size: .72rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--suave); }
.m-indice a {
    position: relative; display: flex; align-items: center; gap: .6rem; padding: .5rem .6rem; border-radius: 11px;
    color: var(--texto); text-decoration: none; font-size: .9rem; font-weight: 500;
    transition: background .15s, color .15s, opacity .2s;
}
.m-indice a:hover { background: color-mix(in srgb, var(--c) 10%, white); }
.m-indice a.activo { background: color-mix(in srgb, var(--c) 14%, white); color: color-mix(in srgb, var(--c) 80%, black); font-weight: 700; }
.m-indice a.activo::before { content: ""; position: absolute; left: -.7rem; top: 20%; bottom: 20%; width: 4px; border-radius: 4px; background: var(--c); }
.m-indice a.apagado { opacity: .35; }
.m-ind-icono { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 9px; background: color-mix(in srgb, var(--c) 14%, white); font-size: .95rem; flex: none; }
.m-ind-nombre { flex: 1; }
.m-ind-check { width: 18px; height: 18px; display: grid; place-items: center; border-radius: 50%; font-size: .65rem; color: #fff; background: var(--verde); transform: scale(0); transition: transform .3s cubic-bezier(.34, 1.56, .64, 1); }
.m-indice a.leida .m-ind-check { transform: scale(1); }

/* Secciones */
.m-contenido { display: grid; gap: 1.2rem; }
.m-seccion {
    position: relative; padding: 1.5rem 1.6rem 1.6rem; border-radius: 20px; background: #fff;
    box-shadow: var(--sombra); scroll-margin-top: 80px; overflow: hidden;
    border-top: 4px solid var(--c);
}
.m-seccion::after {   /* acento de color en la esquina */
    content: ""; position: absolute; right: -40px; top: -40px; width: 140px; height: 140px; border-radius: 50%;
    background: color-mix(in srgb, var(--c) 8%, transparent); pointer-events: none;
}
.m-seccion.m-encontrada { box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 35%, transparent), var(--sombra); }
.m-seccion > p { margin: .2rem 0 .8rem; }
.m-cab { position: relative; z-index: 1; display: flex; align-items: center; gap: 1rem; margin-bottom: 1.1rem; flex-wrap: wrap; }
.m-cab > div { flex: 1; min-width: 200px; }
.m-cab h2 { font-size: 1.3rem; margin: 0; }
.m-cab p { margin: .1rem 0 0; color: var(--suave); }
.m-icono {
    width: 52px; height: 52px; display: grid; place-items: center; flex: none; border-radius: 15px; font-size: 1.6rem;
    background: color-mix(in srgb, var(--c) 15%, white); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c) 25%, white);
}
.m-ir { background: color-mix(in srgb, var(--c) 12%, white); color: color-mix(in srgb, var(--c) 80%, black); border-color: transparent; font-weight: 700; }
.m-ir:hover { background: var(--c); color: #fff; }
.m-subtitulo { font-weight: 700; margin: 1.2rem 0 .5rem; }

/* Ruta de inicio */
.m-ruta { list-style: none; margin: 0 0 1rem; padding: 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: .7rem; counter-reset: none; }
.m-ruta li { position: relative; }
.m-ruta li:not(:last-child)::after { content: "→"; position: absolute; right: -.62rem; top: 50%; transform: translateY(-50%); color: var(--suave); font-size: .9rem; z-index: 1; }
.m-ruta a {
    display: grid; gap: .5rem; height: 100%; padding: .9rem; border-radius: 14px; text-decoration: none; color: var(--texto);
    background: var(--verde-claro); border: 1px solid color-mix(in srgb, var(--verde) 20%, white);
    transition: transform .2s, box-shadow .2s;
}
.m-ruta a:hover { transform: translateY(-3px); box-shadow: 0 10px 20px -12px rgba(31, 110, 0, .6); }
.m-ruta b { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; background: var(--verde); color: #fff; }
.m-ruta span { font-size: .82rem; color: var(--suave); }
.m-ruta strong { display: block; color: var(--texto); font-size: .92rem; }

/* Pasos numerados */
.m-pasos { list-style: none; counter-reset: paso; margin: 0 0 1rem; padding: 0; display: grid; gap: .7rem; }
.m-pasos li { counter-increment: paso; position: relative; padding: .1rem 0 0 2.6rem; }
.m-pasos li::before {
    content: counter(paso); position: absolute; left: 0; top: 0; width: 30px; height: 30px; display: grid; place-items: center;
    border-radius: 50%; background: var(--c); color: #fff; font-weight: 800; font-size: .9rem;
    box-shadow: 0 4px 10px -4px var(--c);
}
.m-pasos li:not(:last-child)::after { content: ""; position: absolute; left: 14px; top: 32px; bottom: -.7rem; width: 2px; background: color-mix(in srgb, var(--c) 25%, white); }
.m-lista { margin: 0 0 1rem; padding-left: 1.2rem; display: grid; gap: .35rem; }

/* Mini tarjetas de funciones */
.m-tarjetas { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: .8rem; margin-bottom: 1rem; }
.m-mini { padding: 1rem; border-radius: 14px; background: #fafbfc; border: 1px solid var(--borde); transition: transform .2s, border-color .2s, box-shadow .2s; }
.m-mini:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--c) 45%, white); box-shadow: 0 10px 20px -14px rgba(16, 24, 40, .5); }
.m-mini > span { font-size: 1.5rem; display: block; margin-bottom: .3rem; }
.m-mini strong { display: block; margin-bottom: .2rem; }
.m-mini p { margin: 0; font-size: .87rem; color: var(--suave); }

/* Consejos */
.m-tip { display: flex; gap: .6rem; align-items: flex-start; padding: .75rem 1rem; border-radius: 12px; background: #fff8e6; border: 1px solid #ffe3a3; font-size: .92rem; }
.m-tip-aviso { background: #f1f5ff; border-color: #cfdcff; }

/* Desplegables */
.m-acordeon { margin-top: .6rem; border: 1px solid var(--borde); border-radius: 12px; background: #fff; transition: box-shadow .2s, border-color .2s; }
.m-acordeon[open] { border-color: color-mix(in srgb, var(--c) 40%, white); box-shadow: 0 8px 18px -14px rgba(16, 24, 40, .5); }
.m-acordeon summary { cursor: pointer; list-style: none; padding: .8rem 1rem; font-weight: 600; display: flex; align-items: center; gap: .6rem; }
.m-acordeon summary::-webkit-details-marker { display: none; }
.m-acordeon summary::before { content: "+"; width: 22px; height: 22px; flex: none; display: grid; place-items: center; border-radius: 50%; background: color-mix(in srgb, var(--c) 14%, white); color: color-mix(in srgb, var(--c) 80%, black); font-weight: 800; transition: transform .25s; }
.m-acordeon[open] summary::before { content: "−"; transform: rotate(180deg); }
.m-acordeon > :not(summary) { margin: 0 1rem .9rem 2.6rem; color: #3b4652; }
.m-acordeon ul { padding-left: 1.1rem; }

/* Demostraciones interactivas */
.m-demo {
    position: relative; margin: 1rem 0; padding: 1.4rem 1.2rem 1.1rem; border-radius: 16px;
    border: 2px dashed color-mix(in srgb, var(--c) 40%, white); background: color-mix(in srgb, var(--c) 4%, white);
}
.m-demo-etiqueta { position: absolute; top: -.75rem; left: 1rem; padding: .15rem .7rem; border-radius: 99px; background: var(--c); color: #fff; font-size: .72rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.m-demo-titulo { margin: 0 0 .8rem; }
.m-demo-explica { margin: .9rem 0 0; padding: .7rem .9rem; border-radius: 10px; background: #fff; border: 1px solid var(--borde); font-size: .92rem; animation: m-aparece .3s ease-out; }
@keyframes m-aparece { from { opacity: 0; transform: translateY(4px); } }
.m-demo-botones, .m-estados { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-bottom: .9rem; }
.m-demo-botones button, .m-estados button {
    border: 1px solid var(--borde); background: #fff; padding: .5rem .9rem; border-radius: 99px; font: inherit; font-weight: 600; cursor: pointer;
    transition: background .15s, color .15s, transform .15s, box-shadow .15s;
}
.m-demo-botones button:hover, .m-estados button:hover { transform: translateY(-1px); }
.m-demo-botones button.activo, .m-estados button.activo { background: var(--c); border-color: var(--c); color: #fff; box-shadow: 0 6px 14px -8px var(--c); }
.m-estados > span { color: var(--suave); }
.m-estados .m-estado-rojo { margin-left: auto; }
.m-estados .m-estado-rojo.activo { background: var(--rojo); border-color: var(--rojo); }
/* Semana de ejemplo (cargar horario) */
.m-semana { display: grid; grid-template-columns: repeat(4, 1fr); gap: .5rem; }
.m-dia { display: grid; gap: .35rem; align-content: start; padding: .5rem; border-radius: 12px; background: #fff; border: 1px solid var(--borde); min-height: 120px; }
.m-dia b { font-size: .78rem; text-transform: uppercase; color: var(--suave); text-align: center; }
.m-dia .ev { font-style: normal; font-size: .76rem; line-height: 1.25; padding: .35rem .45rem; border-radius: 8px; border-left: 4px solid; transition: opacity .35s, transform .35s, filter .35s; }
.ev-a { background: #e7f0ff; border-color: var(--azul) !important; }
.ev-n { background: var(--verde-claro); border-color: var(--verde) !important; }
.ev-x { background: #fdecee; border-color: var(--rojo) !important; }
[data-modo="agregar"] .ev-x { opacity: .55; text-decoration: line-through; }
[data-modo="agregar"] .ev-x::after { content: " · traslape"; color: var(--rojo); font-weight: 700; text-decoration: none; display: inline-block; }
[data-modo="reemplazar"] .ev-a { opacity: .18; transform: scale(.94); filter: grayscale(1); text-decoration: line-through; }
[data-modo="reemplazar"] .ev-x { background: var(--verde-claro); border-color: var(--verde) !important; }
/* Tarjeta de tarea de ejemplo */
.m-tarea-demo {
    position: relative; display: grid; gap: .1rem; max-width: 360px; padding: .8rem 1rem; border-radius: 12px; background: #fff;
    border-left: 5px solid var(--azul); box-shadow: 0 6px 16px -10px rgba(16, 24, 40, .5);
}
.m-tarea-demo small { color: var(--suave); }
.m-tarea-estado { position: absolute; right: .8rem; top: .8rem; padding: .1rem .55rem; border-radius: 99px; font-size: .72rem; font-weight: 700; background: #e7f0ff; color: var(--azul); }
.m-tarea-demo[data-estado="en_progreso"] { border-color: var(--ambar); }
.m-tarea-demo[data-estado="en_progreso"] .m-tarea-estado { background: #fff4d6; color: #a86b00; }
.m-tarea-demo[data-estado="hecho"] { border-color: var(--verde); }
.m-tarea-demo[data-estado="hecho"] strong { text-decoration: line-through; color: var(--suave); }
.m-tarea-demo[data-estado="hecho"] .m-tarea-estado { background: var(--verde-claro); color: var(--verde-osc); }
.m-tarea-demo[data-estado="no_realizada"] { border-color: var(--rojo); }
.m-tarea-demo[data-estado="no_realizada"] .m-tarea-estado { background: #fdecee; color: var(--rojo); }
.m-tarea-demo.salta { animation: m-salta .4s cubic-bezier(.34, 1.56, .64, 1); }
@keyframes m-salta { 40% { transform: translateY(-5px) scale(1.02); } }
/* Tipos de tarea */
.m-tipos { display: grid; grid-template-columns: repeat(3, 1fr); gap: .7rem; margin-bottom: 1rem; }
.m-tipos div { display: grid; justify-items: center; text-align: center; gap: .15rem; padding: .9rem .6rem; border-radius: 14px; background: #fafbfc; border: 1px solid var(--borde); }
.m-tipos span { font-size: 1.6rem; }
.m-tipos small { color: var(--suave); font-size: .8rem; }
/* Mini Kanban ilustrativo */
.m-kanban { display: grid; grid-template-columns: repeat(4, 1fr); gap: .5rem; margin-bottom: 1rem; }
.m-kanban div { display: grid; gap: .35rem; align-content: start; padding: .55rem; border-radius: 12px; background: #f3f5f7; min-height: 110px; }
.m-kanban b { font-size: .75rem; }
.m-kanban i { display: block; height: 22px; border-radius: 6px; background: #fff; box-shadow: 0 1px 2px rgba(16, 24, 40, .1); border-left: 3px solid var(--c); }
.m-kanban i.corta { width: 70%; }
.m-kanban i.roja { border-color: var(--rojo); }
/* Cambio antes/ahora */
.m-flujo { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.m-antes, .m-ahora { flex: 1; min-width: 160px; padding: .8rem 1rem; border-radius: 12px; background: #fff; border: 1px solid var(--borde); line-height: 1.5; }
.m-antes small, .m-ahora small { display: block; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--suave); margin-bottom: .2rem; }
.m-antes { opacity: .7; }
.m-ahora { border-color: color-mix(in srgb, var(--c) 40%, white); box-shadow: 0 6px 16px -12px var(--c); }
.m-flecha { font-size: 1.6rem; color: var(--c); animation: m-empuja 1.6s ease-in-out infinite; }
@keyframes m-empuja { 50% { transform: translateX(5px); } }
/* Bloques permitidos */
.m-bloques { display: flex; flex-wrap: wrap; gap: .5rem; }
.m-bloques span { padding: .45rem .8rem; border-radius: 10px; background: color-mix(in srgb, var(--c) 9%, white); border: 1px solid color-mix(in srgb, var(--c) 25%, white); font-weight: 700; font-variant-numeric: tabular-nums; }
.m-bloques small { font-weight: 500; color: var(--suave); margin-left: .25rem; }
/* Dos columnas (fichas / categorías) */
.m-dos { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; }
.m-dos > div { padding: 1rem 1.1rem; border-radius: 14px; background: #fafbfc; border: 1px solid var(--borde); }
.m-dos h3 { margin-bottom: .6rem; }
/* Glosario */
.m-glosario { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: .7rem; margin: 0; }
.m-glosario div { padding: .8rem 1rem; border-radius: 12px; background: #fafbfc; border: 1px solid var(--borde); border-left: 4px solid var(--c); }
.m-glosario dt { font-weight: 800; }
.m-glosario dd { margin: .15rem 0 0; color: var(--suave); font-size: .9rem; }

@media (prefers-reduced-motion: reduce) {
    .m-flecha, .m-tarea-demo.salta, .m-demo-explica { animation: none; }
}
@media (max-width: 1000px) {
    .manual { grid-template-columns: 1fr; }
    .m-indice { position: static; display: flex; overflow-x: auto; gap: .4rem; padding: .5rem; }
    .m-indice-titulo { display: none; }
    .m-indice a { flex: none; }
    .m-indice a.activo::before { display: none; }
    .m-ruta { grid-template-columns: 1fr 1fr; }
    .m-ruta li::after { display: none; }
}
@media (max-width: 640px) {
    .m-hero { flex-direction: column; align-items: stretch; padding: 1.4rem 1.2rem; }
    .m-hero-buscar { flex: none; min-width: 0; width: 100%; }
    .m-seccion { padding: 1.2rem 1rem; }
    .m-semana, .m-kanban { grid-template-columns: 1fr 1fr; }
    .m-tipos, .m-dos { grid-template-columns: 1fr; }
    .m-ruta { grid-template-columns: 1fr; }
    .m-estados .m-estado-rojo { margin-left: 0; }
}
/* ----- Primer ingreso: aviso, términos, aceptación y menú bloqueado ----- */
.m-primer-ingreso {
    display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
    margin-bottom: 1.2rem; padding: 1rem 1.2rem; border-radius: 16px;
    background: #fff8e6; border: 1px solid #ffe08a; box-shadow: 0 8px 20px -16px rgba(168, 107, 0, .7);
}
.m-primer-ingreso > div { flex: 1; min-width: 240px; }
.m-primer-ingreso p { margin: .2rem 0 0; color: #5c4a1a; font-size: .92rem; }
.m-pi-icono { font-size: 2rem; }
.m-terminos { padding: 1rem 1.2rem; border-radius: 14px; background: #fafbfc; border: 1px solid var(--borde); line-height: 1.6; }
.m-terminos h3 { margin: 1rem 0 .25rem; font-size: .98rem; }
.m-terminos h3:first-child { margin-top: 0; }
.m-terminos p { margin: 0; color: #3b4652; }
.m-fin { display: block; height: 1px; }
.m-aceptacion {
    position: relative; padding: 1.5rem 1.6rem; border-radius: 20px; background: #fff; scroll-margin-top: 80px;
    border: 2px solid #ffd666; box-shadow: 0 18px 40px -24px rgba(16, 24, 40, .5);
    transition: border-color .3s, box-shadow .3s;
}
.m-aceptacion.completo { border-color: var(--verde); box-shadow: 0 18px 40px -22px rgba(57, 169, 0, .6); }
.m-aceptacion header { display: flex; align-items: center; gap: 1rem; margin-bottom: .8rem; }
.m-aceptacion h2 { margin: 0; font-size: 1.3rem; }
.m-aceptacion header p { margin: .1rem 0 0; color: var(--suave); }
.m-aceptacion .m-icono { --c: var(--verde); }
.m-casilla { display: flex; gap: .75rem; align-items: flex-start; padding: .8rem 1rem; margin-bottom: .6rem; border-radius: 12px; border: 1px solid var(--borde); cursor: pointer; transition: background .15s, border-color .15s; }
.m-casilla input { width: 20px; height: 20px; margin-top: .1rem; flex: none; accent-color: var(--verde); cursor: inherit; }
.m-casilla:has(input:checked) { background: var(--verde-claro); border-color: color-mix(in srgb, var(--verde) 40%, white); }
.m-casilla:has(input:disabled) { opacity: .5; cursor: not-allowed; }
.m-btn-aceptar { margin-top: .4rem; padding: .85rem 1rem; font-size: 1rem; }
.m-btn-aceptar:disabled { opacity: .45; cursor: not-allowed; }
/* Menú bloqueado hasta aceptar */
.menu-bloqueado {
    display: inline-flex; align-items: center; gap: .45rem; position: relative; z-index: 1;
    padding: .42rem .85rem; border-radius: 999px; font-size: .93rem; white-space: nowrap;
    color: rgba(255, 255, 255, .5); cursor: not-allowed;
}
.menu-bloqueado i { font-style: normal; font-size: .7rem; }
@media (min-width: 1001px) and (max-width: 1280px) { .menu-bloqueado { padding: .42rem .6rem; font-size: .9rem; } .menu-bloqueado > span { display: none; } }
/* ----- Manual por pantallas: una sección a la vez con Anterior / Siguiente ----- */
.manual.por-pantallas .m-contenido { align-content: start; }
.m-seccion.entra { animation: m-entra .35s cubic-bezier(.2, .8, .2, 1); }
.m-seccion.entra-atras { animation: m-entra-atras .35s cubic-bezier(.2, .8, .2, 1); }
.m-aceptacion.entra, .m-aceptacion.entra-atras { animation: m-entra .35s cubic-bezier(.2, .8, .2, 1); }
@keyframes m-entra { from { opacity: 0; transform: translateX(28px); } to { opacity: 1; transform: none; } }
@keyframes m-entra-atras { from { opacity: 0; transform: translateX(-28px); } to { opacity: 1; transform: none; } }
.m-pasos {
    position: sticky; bottom: .8rem; z-index: 5;
    display: flex; align-items: center; gap: 1rem;
    padding: .7rem .8rem; border-radius: 16px; background: rgba(255, 255, 255, .94);
    backdrop-filter: blur(6px); box-shadow: 0 14px 30px -16px rgba(16, 24, 40, .45), 0 0 0 1px var(--borde);
}
.m-pasos[hidden] { display: none; }
.m-pasos-info { flex: 1; min-width: 0; display: grid; justify-items: center; gap: .4rem; text-align: center; }
.m-pasos-texto { font-size: .88rem; font-weight: 600; color: var(--suave); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.m-puntos { display: flex; flex-wrap: wrap; justify-content: center; gap: 5px; }
.m-puntos i { width: 8px; height: 8px; border-radius: 99px; background: #dfe4ea; transition: width .3s, background .3s; }
.m-puntos i.vista { background: color-mix(in srgb, var(--verde) 55%, white); }
.m-puntos i.actual { width: 22px; background: var(--verde); }
.m-pasos .btn { flex: none; }
.m-pasos .btn:disabled { opacity: .4; cursor: not-allowed; transform: none; }
.m-sig { max-width: 46%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-block; }
.m-sig.llamar { animation: m-llamar .6s ease; }
@keyframes m-llamar { 0%, 100% { transform: none; } 25% { transform: translateX(-5px); } 50% { transform: translateX(5px); } 75% { transform: translateX(-3px); } }
.m-indice a.bloqueada { opacity: .45; cursor: not-allowed; }
.m-indice a.bloqueada:hover { background: transparent; }
@media (max-width: 640px) {
    .m-pasos { gap: .5rem; padding: .55rem; }
    .m-pasos-texto { display: none; }
    .m-ant { padding-inline: .7rem; }
    .m-sig { max-width: 60%; }
}
@media (prefers-reduced-motion: reduce) {
    .m-seccion.entra, .m-seccion.entra-atras, .m-aceptacion.entra, .m-aceptacion.entra-atras, .m-sig.llamar { animation: none; }
}

/* ----- Pie de página: autoría y licencia Creative Commons ----- */
.pie-app {
    max-width: 1320px; margin: 1rem auto 0; padding: 1rem 1.5rem 1.4rem;
    display: grid; gap: .35rem; justify-items: center; text-align: center;
    font-size: .8rem; color: var(--suave); border-top: 1px solid var(--borde);
}
.pie-app p { margin: 0; }
.pie-licencia { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: .35rem .7rem; }
.pie-licencia a { display: inline-flex; align-items: center; gap: .45rem; color: var(--verde-osc); font-weight: 700; text-decoration: none; }
.pie-licencia a:hover span:last-child { text-decoration: underline; }
.cc-iconos { display: inline-flex; gap: 2px; }
.cc-iconos b {
    display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%;
    border: 1.5px solid currentColor; font-size: .6rem; font-weight: 800; text-transform: uppercase; letter-spacing: -.02em;
}
/* Login / registro: el pie va sobre el fondo de hexágonos, abajo de la agenda */
body.sin-menu { position: relative; }
body.sin-menu .contenido { padding-bottom: 5.5rem; }
body.sin-menu .pie-app { position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; max-width: none; margin: 0; border-top: 0; padding: .6rem 1rem 1rem; }

/* ----- Usabilidad: errores junto al campo, cruces en cambios, horario ya cargado ----- */
.formulario .campo-error, .campo-error { border-color: var(--rojo) !important; box-shadow: 0 0 0 3px rgba(220, 53, 69, .15) !important; }
.error-campo { display: block; margin-top: .3rem; color: var(--rojo); font-size: .82rem; font-weight: 600; }
.error-campo::before { content: "⚠ "; }
.ayuda-campo { display: block; margin: -.3rem 0 .6rem; }
.bloque-alerta { margin: .45rem 0 0; padding: .45rem .7rem; border-radius: 9px; background: #fdecee; color: var(--rojo); font-size: .84rem; font-weight: 600; }
.bloque-cambio.con-problema { border-color: color-mix(in srgb, var(--rojo) 45%, white); }
.tarjeta-ya-cargado { border: 2px solid color-mix(in srgb, var(--verde) 45%, white); }
.tarjeta-ya-cargado h2 { color: var(--verde-osc); }

/* Inicio: fichas sin programa */
.aviso-accion {
    display: flex; align-items: center; gap: .9rem; flex-wrap: wrap; margin-bottom: 1.2rem; padding: .85rem 1.1rem;
    border-radius: 14px; background: #fff8e6; border: 1px solid #f3dca0; font-size: .92rem;
}
.aviso-accion .aa-icono { font-size: 1.5rem; line-height: 1; }
.aviso-accion p { flex: 1; min-width: 220px; margin: 0; }
.aviso-accion .texto-suave { display: block; font-size: .84rem; }

/* Usuarios (administrador) */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.texto-rojo { color: var(--rojo); }
.usuarios-principal, .usuarios-lateral { display: grid; gap: 1.2rem; min-width: 0; }
.tabla-usuarios td { vertical-align: top; }
.tabla-usuarios td.num { font-variant-numeric: tabular-nums; font-weight: 700; text-align: center; }
.tabla-usuarios .chip { margin-left: .3rem; }
.tabla-usuarios td:first-child .chip { margin-left: .4rem; }
.tabla-usuarios .fila-eliminada td { color: var(--suave); }
.tabla-usuarios .fila-eliminada strong { text-decoration: line-through; font-weight: 600; }
.invitacion-creada { border: 2px solid color-mix(in srgb, var(--verde) 45%, white); background: #fbfdf8; display: grid; gap: .7rem; }
.invitacion-creada h2 { margin: 0; font-size: 1.05rem; overflow-wrap: anywhere; }
.invitacion-creada p { margin: 0; }
.enlace-invitacion { display: flex; flex-wrap: wrap; gap: .5rem; }
.enlace-invitacion input { flex: 1 1 260px; min-width: 0; font-family: ui-monospace, Consolas, monospace; font-size: .82rem; }
.lista-invitaciones { list-style: none; margin: 0; padding: 0; display: grid; gap: .8rem; }
.lista-invitaciones li { display: flex; justify-content: space-between; gap: .6rem; align-items: flex-start; padding-bottom: .8rem; border-bottom: 1px solid #f0f2f5; overflow-wrap: anywhere; }
.lista-invitaciones li:last-child { border-bottom: 0; padding-bottom: 0; }
.lista-invitaciones .acciones { display: flex; gap: .35rem; flex: none; }
.lista-invitaciones form { margin: 0; }

/* ---------------------------------------------------------------- Registro de seguridad (administrador) */
.seg-resumen { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .8rem; margin-bottom: 1.2rem; }
.seg-kpi { display: grid; gap: .1rem; padding: .9rem 1rem; }
.seg-kpi strong { font-size: 1.6rem; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.seg-kpi span { font-weight: 600; font-size: .9rem; }
.seg-kpi small { color: var(--suave); font-size: .75rem; }
.seg-kpi-alerta strong { color: #c0392b; }
.seg-filtros { display: flex; flex-wrap: wrap; gap: .7rem; align-items: flex-end; margin-bottom: 1.2rem; }
.seg-filtros label { display: grid; gap: .25rem; font-size: .82rem; font-weight: 600; min-width: 0; }
.seg-filtros select { max-width: 100%; }
.seg-filtros .seg-check { display: flex; align-items: center; gap: .4rem; padding-bottom: .55rem; }
.tabla-seguridad td { vertical-align: top; font-size: .88rem; }
.tabla-seguridad .seg-fecha { white-space: nowrap; }
.tabla-seguridad .seg-detalle { max-width: 280px; overflow-wrap: anywhere; }
.tabla-seguridad .chip { white-space: normal; }
.seg-fila-alerta td:first-child { box-shadow: inset 3px 0 0 #dc3545; }
.seg-paginas { display: flex; justify-content: center; align-items: center; gap: 1rem; margin-top: 1rem; flex-wrap: wrap; }
.tabla-usuarios .acciones { flex-wrap: nowrap; margin-left: auto; }
.tabla-usuarios td.ingreso { min-width: 120px; }
/* Usuarios: botones compactos */
.tabla-usuarios .btn-sm, .lista-invitaciones .btn-sm { padding: .18rem .5rem; font-size: .75rem; border-radius: 6px; }
.usuarios-lateral .formulario .btn-sm { justify-self: start; }
.tabla-usuarios .acciones { gap: .3rem; }
