/* =============================================================================
 * Archivo   : /s-internos/hemeroteca/recursos/css/hemeroteca.css
 * Propósito : Estilos propios sobre AdminLTE 3 con enfoque "Hero", UNIFICADOS con el
 *             sistema /s-internos/aprendizaje/: colores institucionales en contraste
 *             con gris muy claro de fondo, tarjetas con elevación, tipografía
 *             jerárquica, notificaciones, indicador de carga, DataTables, calendario,
 *             tarjetas de periódicos, controles "al toque" y diseño responsivo.
 *
 * Colores institucionales (variables):
 *   --hem-guinda #691b31  --hem-carmin #A02142  --hem-dorado #BC955B
 *   --hem-arena  #DDC9A3  --hem-gris   #98989A  --hem-grisosc #6F7271
 *
 * Índice: 1 Variables · 2 Base · 3 Botones y formularios · 4 Cabecera · 5 Menú ·
 * 6 Hero y contenido · 7 Tarjetas de estadísticas · 8 Etiquetas, estados y avance ·
 * 9 Gráficas y sin datos · 10 Toasts · 11 Cargando · 12 Acceso · 13 Contraseña ·
 * 14 Tablas (DataTables) · 15 Modales · 16 Control de escaneos · 17 Bitácora ·
 * 18 Responsivo · 19 Movimiento reducido.
 *
 * BITÁCORA DE CAMBIOS
 *   2026-11-21 | v1.0.0 | Creación del archivo.
 *   2026-11-22 | v1.0.1 | .hem-cedula-celda: botón "Imprimir cédula" junto a la
 *                         tarjeta del periódico seleccionado.
 * ========================================================================== */

/* 1. VARIABLES ------------------------------------------------------------ */
:root {
    --hem-guinda: #691b31;
    --hem-guinda-osc: #4d1223;
    --hem-carmin: #A02142;
    --hem-dorado: #BC955B;
    --hem-arena: #DDC9A3;
    --hem-gris: #98989A;
    --hem-grisosc: #6F7271;
    --hem-gris-texto: #5E6261;   /* gris para TEXTO: 5.6:1 sobre el fondo (cumple WCAG AA) */
    --hem-fondo: #F2F3F4;
    --hem-texto: #2b2b2b;
    --hem-verde: #1f7a3f;
    --hem-rojo: #c0262d;
    --hem-sombra: 0 2px 10px rgba(40, 20, 28, .08);
    --hem-sombra-alta: 0 14px 30px rgba(105, 27, 49, .22);
    --hem-radio: 14px;
}

/* 2. BASE ------------------------------------------------------------------ */
.hem-cuerpo { background: var(--hem-fondo); color: var(--hem-texto); font-family: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; }
.hem-cuerpo a { color: var(--hem-carmin); }
.hem-cuerpo a:hover { color: var(--hem-guinda); }
:focus-visible { outline: 3px solid var(--hem-dorado); outline-offset: 2px; }
[hidden] { display: none !important; }
.hem-saltar { position: absolute; left: -9999px; top: 0; z-index: 4000; background: var(--hem-guinda); color: #fff !important; padding: .6rem 1rem; border-radius: 0 0 8px 0; }
.hem-saltar:focus { left: 0; }
.hem-num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.hem-texto-gris { color: var(--hem-gris-texto); }
.hem-mono { font-family: Consolas, "Courier New", monospace; font-size: .86rem; }

/* 3. BOTONES Y FORMULARIOS ------------------------------------------------- */
.btn-hem { background: var(--hem-guinda); border: 2px solid var(--hem-guinda); color: #fff !important; font-weight: 600; transition: background .2s, transform .2s, box-shadow .2s; }
.btn-hem:hover, .btn-hem:focus { background: var(--hem-carmin); border-color: var(--hem-carmin); box-shadow: var(--hem-sombra); }
.btn-hem:active { transform: translateY(1px); }
.btn-hem[disabled] { opacity: .65; }
.btn-hem-sec { background: #fff; border: 2px solid var(--hem-guinda); color: var(--hem-guinda) !important; font-weight: 600; }
.btn-hem-sec:hover, .btn-hem-sec:focus { background: var(--hem-arena); }
.btn-hem-dorado { background: var(--hem-dorado); border: 2px solid var(--hem-dorado); color: #2b1a0a !important; font-weight: 700; }
.btn-hem-dorado:hover, .btn-hem-dorado:focus { background: #a9824a; border-color: #a9824a; }
.hem-btn-peligro { background: #fff; border: 2px solid var(--hem-rojo); color: var(--hem-rojo) !important; font-weight: 600; }
.hem-btn-peligro:hover, .hem-btn-peligro:focus { background: var(--hem-rojo); color: #fff !important; }
.hem-btn-peligro-lleno { background: var(--hem-rojo); border: 2px solid var(--hem-rojo); color: #fff !important; font-weight: 700; }
.hem-btn-peligro-lleno:hover { background: #9d1d23; }
.form-control:focus, .custom-select:focus { border-color: var(--hem-carmin); box-shadow: 0 0 0 .2rem rgba(160, 33, 66, .2); }
.input-group-text { background: var(--hem-arena); border-color: #ced4da; color: var(--hem-guinda); }
.hem-error-campo { min-height: 1.1rem; color: var(--hem-rojo); font-size: .85rem; margin-top: .25rem; display: block; }
.custom-control-input:checked ~ .custom-control-label::before { background-color: var(--hem-guinda); border-color: var(--hem-guinda); }
label { font-weight: 600; color: var(--hem-texto); }
.hem-requerido::after { content: " *"; color: var(--hem-carmin); }

/* 4. CABECERA -------------------------------------------------------------- */
.hem-cabecera.main-header { background: var(--hem-guinda); border-bottom: 3px solid var(--hem-dorado); }
.hem-cabecera .nav-link { color: #fff; }
.hem-cabecera .nav-link:hover, .hem-cabecera .nav-link:focus { color: var(--hem-arena); }
.hem-reloj { flex: 1 1 auto; text-align: center; color: #fff; line-height: 1.15; padding: 0 .5rem; min-width: 0; }
.hem-reloj-fecha { display: block; font-size: .95rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hem-reloj-fecha i { color: var(--hem-dorado); margin-right: .25rem; }
.hem-reloj-hora { display: block; font-size: 1.15rem; font-weight: 700; letter-spacing: .06em; color: var(--hem-arena); font-variant-numeric: tabular-nums; }
.hem-avatar { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 50%; background: var(--hem-dorado); color: var(--hem-guinda-osc); font-weight: 800; font-size: .9rem; flex: 0 0 auto; box-shadow: 0 0 0 3px rgba(255,255,255,.18); }
.hem-avatar-grande { width: 60px; height: 60px; font-size: 1.25rem; margin-bottom: .35rem; }
.hem-usuario-texto { flex-direction: column; margin-left: .6rem; line-height: 1.1; text-align: left; }
.hem-usuario-texto small { color: var(--hem-arena); }
.hem-usuario-menu { min-width: 300px; padding: 0; overflow: hidden; border: 0; box-shadow: var(--hem-sombra-alta); border-radius: 12px; }
.hem-usuario-datos { display: flex; flex-direction: column; align-items: center; gap: .2rem; padding: 1rem; background: #faf6ee; text-align: center; font-size: .85rem; border-bottom: 3px solid var(--hem-arena); }
.hem-usuario-datos strong { font-size: 1.05rem; color: var(--hem-guinda); }
.hem-usuario-datos i { color: var(--hem-dorado); width: 1.1rem; }
.hem-insignia-rol { background: var(--hem-guinda); color: #fff; font-size: .75rem; padding: .3rem .6rem; border-radius: 999px; margin-bottom: .2rem; }
.hem-insignia-rol i { color: var(--hem-arena) !important; }
.hem-usuario-menu .dropdown-item { padding: .65rem 1rem; }
.hem-usuario-menu .dropdown-item:hover, .hem-usuario-menu .dropdown-item:focus { background: var(--hem-arena); color: var(--hem-guinda); }
.hem-salir { color: var(--hem-rojo) !important; font-weight: 600; }

/* 5. MENÚ LATERAL ---------------------------------------------------------- */
.hem-sidebar.main-sidebar { background: var(--hem-guinda-osc); }
.hem-marca.brand-link { background: var(--hem-guinda); border-bottom: 3px solid var(--hem-dorado) !important; display: flex; align-items: center; gap: .6rem; height: auto; padding: .7rem 1rem; }
.hem-marca-icono { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 10px; background: var(--hem-dorado); color: var(--hem-guinda-osc); font-size: 1.2rem; flex: 0 0 auto; }
.hem-marca .brand-text { color: #fff; font-weight: 700; line-height: 1.1; }
.hem-marca .brand-text small { display: block; font-weight: 400; color: var(--hem-arena); font-size: .72rem; }
.hem-sidebar .nav-sidebar > .nav-item > .nav-link { color: #f1e6e9; border-radius: .45rem; margin-bottom: .15rem; transition: background .2s, padding-left .2s; }
.hem-sidebar .nav-sidebar > .nav-item > .nav-link:hover { background: rgba(255, 255, 255, .1); color: #fff; padding-left: 1.1rem; }
.hem-sidebar .nav-sidebar > .nav-item > .nav-link.active { background: var(--hem-carmin); color: #fff; box-shadow: inset 4px 0 0 var(--hem-dorado); }
.hem-sidebar .nav-header { color: var(--hem-dorado); font-size: .7rem; letter-spacing: .1em; padding-top: 1rem !important; }

/* 6. HERO Y CONTENIDO ------------------------------------------------------ */
.hem-contenido.content-wrapper { background: var(--hem-fondo); }
.hem-hero.content-header { background: linear-gradient(120deg, var(--hem-guinda) 0%, var(--hem-carmin) 100%); color: #fff; padding: 1.4rem .5rem 1.6rem; margin-bottom: 1.25rem; box-shadow: var(--hem-sombra); position: relative; overflow: hidden; }
.hem-hero.content-header::after { content: ""; position: absolute; right: -60px; top: -60px; width: 220px; height: 220px; border-radius: 50%; background: rgba(221, 201, 163, .12); pointer-events: none; }
.hem-hero-icono { display: inline-flex; align-items: center; justify-content: center; width: 54px; height: 54px; border-radius: 14px; background: rgba(255,255,255,.14); color: var(--hem-arena); font-size: 1.5rem; margin-right: .9rem; flex: 0 0 auto; }
.hem-hero-titulo { margin: 0; font-size: 1.75rem; font-weight: 700; letter-spacing: .01em; }
.hem-hero-subtitulo { margin: .15rem 0 0; color: var(--hem-arena); font-size: .95rem; }
.hem-migas.breadcrumb { background: transparent; margin: 0; padding: 0; }
.hem-migas .breadcrumb-item, .hem-migas .breadcrumb-item a { color: var(--hem-arena) !important; }
.hem-migas .breadcrumb-item.active { color: #fff; }
.hem-migas .breadcrumb-item + .breadcrumb-item::before { color: var(--hem-arena); }
.hem-pie.main-footer { background: #fff; color: var(--hem-gris-texto); border-top: 3px solid var(--hem-arena); font-size: .86rem; }
.hem-pie i { color: var(--hem-dorado); }
.hem-barra-herramientas { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .6rem; margin-bottom: 1rem; }
.hem-generado { color: var(--hem-gris-texto); font-size: .9rem; margin: 0; }
.hem-seccion-titulo { font-size: 1.08rem; font-weight: 700; color: var(--hem-guinda); margin: 0 0 .8rem; letter-spacing: .01em; }
.hem-seccion-titulo i { color: var(--hem-dorado); margin-right: .4rem; }
.hem-panel { background: #fff; border-radius: var(--hem-radio); box-shadow: var(--hem-sombra); padding: 1.15rem 1.25rem; margin-bottom: 1.25rem; }
.hem-panel-encabezado { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .6rem; margin-bottom: .9rem; padding-bottom: .7rem; border-bottom: 2px solid #f1ebe0; }
.hem-panel-encabezado :is(h2, h3) { margin: 0; font-size: 1.08rem; font-weight: 700; color: var(--hem-guinda); }
.hem-panel-encabezado :is(h2, h3) i { color: var(--hem-dorado); margin-right: .4rem; }
.hem-filtros { display: flex; flex-wrap: wrap; gap: .6rem; align-items: flex-end; }
.hem-filtros .form-group { margin: 0; min-width: 160px; }
.hem-filtros label { font-size: .8rem; color: var(--hem-gris-texto); margin-bottom: .2rem; }
.hem-alerta { display: flex; gap: .8rem; align-items: flex-start; background: #faf6ee; border: 1px solid var(--hem-dorado); border-left-width: 5px; border-radius: .6rem; padding: .85rem 1rem; margin-bottom: 1rem; }
.hem-alerta > i { color: var(--hem-guinda); font-size: 1.35rem; margin-top: .1rem; }
.hem-alerta-peligro { background: #fdeeee; border-color: var(--hem-rojo); }
.hem-alerta-peligro > i { color: var(--hem-rojo); }
.hem-alerta-exito { background: #edf7f0; border-color: var(--hem-verde); }
.hem-alerta-exito > i { color: var(--hem-verde); }

/* 7. TARJETAS DE ESTADÍSTICAS (con elevación y contador) ------------------- */
.hem-tono-guinda { --tono: var(--hem-guinda); }
.hem-tono-carmin { --tono: var(--hem-carmin); }
.hem-tono-dorado { --tono: var(--hem-dorado); }
.hem-tono-gris { --tono: var(--hem-gris); }
.hem-tono-grisoscuro { --tono: var(--hem-grisosc); }
.hem-tono-rojo { --tono: var(--hem-rojo); }
.hem-tono-verde { --tono: var(--hem-verde); }

.hem-rejilla { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; }
.hem-tarjeta {
    position: relative; display: flex; align-items: center; gap: 1rem; padding: 1.2rem 1.25rem; background: #fff; overflow: hidden;
    border-radius: var(--hem-radio); border-left: 6px solid var(--tono, var(--hem-guinda)); box-shadow: var(--hem-sombra);
    transition: transform .25s ease, box-shadow .25s ease; color: inherit; text-decoration: none !important;
}
.hem-tarjeta::after { content: ""; position: absolute; right: -28px; bottom: -28px; width: 96px; height: 96px; border-radius: 50%; background: var(--tono, var(--hem-guinda)); opacity: .06; }
.hem-tarjeta:hover, .hem-tarjeta:focus { transform: translateY(-6px); box-shadow: var(--hem-sombra-alta); }
button.hem-tarjeta { width: 100%; text-align: left; cursor: pointer; border-top: 0; border-right: 0; border-bottom: 0; }
button.hem-tarjeta[aria-pressed="true"] { box-shadow: 0 0 0 3px var(--tono, var(--hem-guinda)), var(--hem-sombra-alta); }
.text-guinda { color: var(--hem-guinda) !important; }
.hem-tarjeta-icono { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; width: 64px; height: 64px; border-radius: 18px; background: var(--tono, var(--hem-guinda)); color: #fff; font-size: 1.85rem; box-shadow: 0 6px 14px rgba(0,0,0,.12); }
.hem-tarjeta.hem-tono-dorado .hem-tarjeta-icono, .hem-tarjeta.hem-tono-gris .hem-tarjeta-icono { color: #2b1a0a; }
.hem-tarjeta-cuerpo { display: flex; flex-direction: column; min-width: 0; }
.hem-tarjeta-numero { font-size: 2.15rem; font-weight: 800; line-height: 1.05; color: var(--hem-texto); font-variant-numeric: tabular-nums; }
.hem-tarjeta-titulo { font-weight: 700; color: var(--hem-guinda); line-height: 1.2; margin-top: .15rem; }
.hem-tarjeta-detalle { font-size: .8rem; color: var(--hem-gris-texto); line-height: 1.25; }

/* 8. ETIQUETAS, ESTADOS Y AVANCE ------------------------------------------- */
.hem-etiquetas { display: flex; flex-wrap: wrap; gap: .6rem; }
.hem-etiqueta {
    display: inline-flex; align-items: center; gap: .55rem; padding: .5rem 1rem; border-radius: 999px; background: var(--tono); border: 2px solid var(--tono);
    color: #fff; font-weight: 600; box-shadow: var(--hem-sombra); transition: transform .2s, box-shadow .2s, background .2s; cursor: default;
}
button.hem-etiqueta { cursor: pointer; }
.hem-etiqueta.hem-tono-dorado, .hem-etiqueta.hem-tono-gris { color: #2b1a0a; }
.hem-etiqueta:hover, .hem-etiqueta:focus { transform: translateY(-3px); box-shadow: var(--hem-sombra-alta); }
.hem-etiqueta.hem-inactiva { background: #fff; color: var(--hem-texto); }
.hem-etiqueta-numero { background: rgba(0, 0, 0, .22); border-radius: 999px; padding: 0 .6rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.hem-etiqueta.hem-inactiva .hem-etiqueta-numero { background: var(--tono); color: #fff; }
.hem-estado { display: inline-flex; align-items: center; gap: .35rem; padding: .18rem .65rem; border-radius: 999px; font-size: .78rem; font-weight: 700; white-space: nowrap; background: var(--tono); color: #fff; }
.hem-estado.hem-tono-dorado, .hem-estado.hem-tono-gris { color: #2b1a0a; }
.hem-avance { display: flex; align-items: center; gap: .5rem; min-width: 120px; }
.hem-avance-pista { flex: 1 1 auto; height: 9px; background: #ebe5da; border-radius: 999px; overflow: hidden; }
.hem-avance-barra { display: block; height: 100%; background: var(--tono); border-radius: 999px; transition: width .6s ease; }
.hem-avance-texto { font-size: .8rem; font-weight: 700; color: var(--hem-gris-texto); font-variant-numeric: tabular-nums; min-width: 3rem; text-align: right; }
.hem-chip { display: inline-block; padding: .1rem .55rem; border-radius: 6px; background: #f3ece0; color: var(--hem-guinda); font-size: .8rem; font-weight: 600; margin: .1rem .15rem .1rem 0; }
.hem-chip-rojo { background: #fdeeee; color: var(--hem-rojo); }

/* 9. GRÁFICAS Y "SIN DATOS" ------------------------------------------------ */
.hem-grafica-tarjeta { background: #fff; border-radius: var(--hem-radio); padding: 1.1rem 1.25rem 1.25rem; box-shadow: var(--hem-sombra); height: 100%; transition: box-shadow .25s; }
.hem-grafica-tarjeta:hover, .hem-grafica-tarjeta:focus-within { box-shadow: var(--hem-sombra-alta); }
.hem-grafica { position: relative; height: 320px; }
.hem-sin-datos { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; background: rgba(255,255,255,.95); color: var(--hem-gris-texto); border: 2px dashed var(--hem-arena); border-radius: 10px; padding: 1rem; }
.hem-sin-datos i { font-size: 2.4rem; color: var(--hem-dorado); margin-bottom: .5rem; }
.hem-sin-datos p { margin: 0; font-weight: 700; color: var(--hem-guinda); font-size: 1.05rem; }
.hem-sin-datos small { margin-top: .25rem; }
.hem-sin-datos-estatico { position: static; min-height: 200px; }
.hem-medidor { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .4rem; text-align: center; }
.hem-medidor-texto { font-size: .85rem; color: var(--hem-gris-texto); }
.hem-actividad { list-style: none; margin: 0; padding: 0; }
.hem-actividad li { display: flex; gap: .75rem; padding: .6rem 0; border-bottom: 1px solid #f1ebe0; }
.hem-actividad li:last-child { border-bottom: 0; }
.hem-actividad-punto { flex: 0 0 auto; width: 34px; height: 34px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--hem-arena); color: var(--hem-guinda); }
.hem-actividad small { color: var(--hem-gris-texto); display: block; }
.hem-rango-anios { padding: .3rem .4rem 0; }
.hem-rango-anios .ui-slider { height: .55rem; border: 0; background: #ebe5da; }
.hem-rango-anios .ui-slider-range { background: var(--hem-carmin); }
.hem-rango-anios .ui-slider-handle { width: 1.2rem; height: 1.2rem; top: -.35rem; border-radius: 50%; background: var(--hem-guinda) !important; border: 3px solid var(--hem-dorado) !important; cursor: grab; }

/* 10. TOASTS --------------------------------------------------------------- */
.hem-toasts { position: fixed; top: 70px; right: 1rem; z-index: 2000; display: flex; flex-direction: column; gap: .6rem; width: min(390px, calc(100vw - 2rem)); pointer-events: none; }
.hem-toast { position: relative; display: flex; gap: .75rem; padding: .85rem 2.4rem .95rem .9rem; background: #fff; border-radius: 12px; border-left: 6px solid var(--hem-guinda); box-shadow: var(--hem-sombra-alta); overflow: hidden; pointer-events: auto; animation: hem-entrada .3s ease-out; }
.hem-toast.hem-saliendo { animation: hem-salida .25s ease-in forwards; }
.hem-toast-icono { font-size: 1.45rem; line-height: 1.2; }
.hem-toast-cuerpo { min-width: 0; }
.hem-toast-titulo { display: block; font-weight: 700; color: var(--hem-texto); }
.hem-toast-mensaje { display: block; font-size: .9rem; color: #444; overflow-wrap: anywhere; }
.hem-toast-pie { display: block; margin-top: .25rem; font-size: .75rem; color: var(--hem-gris-texto); }
.hem-toast-cerrar { position: absolute; top: .35rem; right: .45rem; border: 0; background: transparent; font-size: 1.2rem; line-height: 1; color: var(--hem-gris-texto); cursor: pointer; padding: .2rem .4rem; }
.hem-toast-cerrar:hover { color: var(--hem-guinda); }
.hem-toast-barra { position: absolute; left: 0; bottom: 0; height: 4px; width: 100%; background: currentColor; transform-origin: left; animation-name: hem-barra; animation-timing-function: linear; animation-fill-mode: forwards; opacity: .55; }
.hem-toast-exito { border-left-color: var(--hem-verde); color: var(--hem-verde); }
.hem-toast-error { border-left-color: var(--hem-rojo); color: var(--hem-rojo); }
.hem-toast-aviso { border-left-color: var(--hem-dorado); color: #8a6420; }
.hem-toast-info { border-left-color: var(--hem-guinda); color: var(--hem-guinda); }
@keyframes hem-entrada { from { opacity: 0; transform: translateX(40px); } to { opacity: 1; transform: none; } }
@keyframes hem-salida { to { opacity: 0; transform: translateX(40px); } }
@keyframes hem-barra { from { transform: scaleX(1); } to { transform: scaleX(0); } }

/* 11. INDICADOR DE CARGA (anillo institucional con periódico al centro) ---- */
.hem-cargando { position: fixed; inset: 0; z-index: 3000; display: flex; flex-direction: column; align-items: center; justify-content: center; background: rgba(242, 243, 244, .9); backdrop-filter: blur(2px); opacity: 0; visibility: hidden; transition: opacity .25s, visibility .25s; }
.hem-cargando.hem-visible { opacity: 1; visibility: visible; }
.hem-cargador { position: relative; width: 74px; height: 74px; display: flex; align-items: center; justify-content: center; }
.hem-cargador-anillo { position: absolute; inset: 0; border-radius: 50%; border: 6px solid var(--hem-arena); border-top-color: var(--hem-guinda); border-right-color: var(--hem-dorado); animation: hem-giro .9s linear infinite; }
.hem-cargador-icono { font-size: 1.6rem; color: var(--hem-guinda); animation: hem-latido 1.2s ease-in-out infinite; }
.hem-cargando-texto { margin: 1rem 0 0; color: var(--hem-guinda); font-weight: 700; }
@keyframes hem-giro { to { transform: rotate(360deg); } }
@keyframes hem-latido { 50% { transform: scale(.82); opacity: .7; } }

/* 12. ACCESO --------------------------------------------------------------- */
.hem-login-cuerpo { background: radial-gradient(circle at 15% 20%, rgba(188,149,91,.25), transparent 40%), linear-gradient(135deg, var(--hem-guinda-osc) 0%, var(--hem-guinda) 45%, var(--hem-carmin) 100%); min-height: 100vh; }
.hem-login-contenedor { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 1.25rem; }
.hem-login-tarjeta { width: 100%; max-width: 450px; background: #fff; border-radius: 20px; overflow: hidden; box-shadow: 0 24px 60px rgba(0, 0, 0, .35); border-top: 6px solid var(--hem-dorado); animation: hem-subir .5s ease-out; }
.hem-login-encabezado { text-align: center; padding: 1.6rem 1.5rem 1rem; background: #faf6ee; border-bottom: 2px solid #f1ebe0; }
.hem-login-icono { display: inline-flex; align-items: center; justify-content: center; width: 72px; height: 72px; border-radius: 20px; background: var(--hem-guinda); color: var(--hem-arena); font-size: 2rem; margin-bottom: .6rem; box-shadow: 0 8px 18px rgba(105,27,49,.3); }
.hem-login-encabezado h1 { font-size: 1.2rem; font-weight: 700; color: var(--hem-guinda); margin: 0; }
.hem-login-encabezado p { margin: .25rem 0 0; color: var(--hem-gris-texto); font-size: .9rem; }
.hem-login-formulario { padding: 1.4rem 1.6rem 1.6rem; }
.hem-captcha-texto { display: inline-block; padding: 0 .6rem; border-radius: 6px; background: var(--hem-arena); color: var(--hem-guinda); font-size: 1.2rem; letter-spacing: .1em; }
.hem-login-pie { margin-top: 1.25rem; color: var(--hem-arena); font-size: .8rem; text-align: center; }
.hem-login-tarjeta.hem-sacudir { animation: hem-sacudir .4s; }
@keyframes hem-sacudir { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }
@keyframes hem-subir { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }

/* 13. CONTRASEÑA ----------------------------------------------------------- */
.hem-fortaleza { height: 8px; border-radius: 6px; background: #e4e4e6; margin-top: .5rem; overflow: hidden; }
.hem-fortaleza span { display: block; height: 100%; width: 0; background: var(--hem-rojo); transition: width .3s, background .3s; }
.hem-requisitos { list-style: none; padding: 0; margin: 0 0 1rem; }
.hem-requisitos li { padding: .3rem 0; color: var(--hem-gris-texto); }
.hem-requisitos li i { width: 1.4rem; }
.hem-requisitos li.hem-cumple { color: var(--hem-verde); font-weight: 600; }
.hem-password-caja { display: flex; align-items: center; justify-content: space-between; gap: .6rem; background: #faf6ee; border: 2px dashed var(--hem-dorado); border-radius: 10px; padding: .75rem 1rem; font-family: Consolas, monospace; font-size: 1.35rem; font-weight: 700; color: var(--hem-guinda); letter-spacing: .06em; word-break: break-all; }

/* 14. TABLAS (DataTables) -------------------------------------------------- */
.hem-tabla { width: 100% !important; background: #fff; }
.hem-tabla thead th { background: var(--hem-guinda); color: #fff; border: 0 !important; font-weight: 600; white-space: nowrap; vertical-align: middle; }
.hem-tabla thead th.sorting::before, .hem-tabla thead th.sorting::after,
.hem-tabla thead th.sorting_asc::before, .hem-tabla thead th.sorting_asc::after,
.hem-tabla thead th.sorting_desc::before, .hem-tabla thead th.sorting_desc::after { color: var(--hem-arena); opacity: .8; }
.hem-tabla tbody td { vertical-align: middle; }
.hem-tabla tbody tr { transition: background .15s; }
.hem-tabla tbody tr:hover, .hem-tabla tbody tr:focus { background: #faf3e6 !important; outline: none; }
.hem-tabla tbody tr:focus { box-shadow: inset 4px 0 0 var(--hem-dorado); }
.hem-tabla .hem-fila-faltante td:first-child { box-shadow: inset 5px 0 0 var(--hem-rojo); }
.hem-tabla .hem-fila-faltante { background: #fff7f7; }
.dataTables_wrapper .dataTables_filter input { border-radius: 999px; padding-left: .9rem; min-width: 220px; }
.dataTables_wrapper .dataTables_filter label { display: flex; align-items: center; gap: .4rem; color: var(--hem-guinda); justify-content: flex-end; }
.dataTables_wrapper .dataTables_length select { border-radius: 8px; }
.dataTables_wrapper .dataTables_info { color: var(--hem-gris-texto); font-size: .88rem; }
.page-item.active .page-link { background: var(--hem-guinda); border-color: var(--hem-guinda); }
.page-link { color: var(--hem-guinda); }
.page-link:hover { color: var(--hem-carmin); background: var(--hem-arena); }
div.dataTables_wrapper div.dataTables_processing { background: #fff; border: 2px solid var(--hem-arena); border-radius: 12px; box-shadow: var(--hem-sombra-alta); color: var(--hem-guinda); font-weight: 700; padding: .8rem 1rem; z-index: 5; }
div.dataTables_wrapper div.dataTables_processing > div:last-child { display: none; }
.hem-sin-datos-tabla { display: inline-flex; align-items: center; gap: .5rem; padding: 1.2rem; color: var(--hem-gris-texto); font-style: italic; }
.hem-sin-datos-tabla i { color: var(--hem-dorado); font-size: 1.3rem; }
table.dataTable.dtr-inline.collapsed > tbody > tr > td.dtr-control::before { background-color: var(--hem-carmin); }
.hem-acciones-fila { display: flex; flex-wrap: wrap; gap: .3rem; }
.hem-acciones-fila .btn { white-space: nowrap; }
.hem-texto-largo { max-width: 520px; white-space: normal; }

/* 15. MODALES -------------------------------------------------------------- */
.hem-modal { border: 0; border-radius: 16px; overflow: hidden; box-shadow: var(--hem-sombra-alta); }
.hem-modal-encabezado { background: var(--hem-guinda); color: #fff; border-bottom: 3px solid var(--hem-dorado); }
.hem-modal-encabezado .modal-title i { color: var(--hem-dorado); margin-right: .4rem; }
.hem-modal-encabezado .close { color: #fff; opacity: .85; text-shadow: none; }
.hem-modal-peligro .hem-modal-encabezado { background: var(--hem-rojo); }
.hem-confirmar-cuerpo { display: flex; gap: .9rem; align-items: center; }
.hem-confirmar-icono { flex: 0 0 auto; width: 48px; height: 48px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--hem-arena); color: var(--hem-guinda); font-size: 1.4rem; }
.hem-modal-peligro .hem-confirmar-icono { background: #fdeeee; color: var(--hem-rojo); }
.hem-ficha { display: grid; grid-template-columns: minmax(130px, auto) 1fr; gap: .35rem 1rem; margin: 0; font-size: .9rem; }
.hem-ficha dt { color: var(--hem-gris-texto); font-weight: 600; }
.hem-ficha dd { margin: 0; overflow-wrap: anywhere; }
.hem-pre { white-space: pre-wrap; word-break: break-word; font-size: .8rem; background: #2b2b2b; color: #f3e9d2; padding: .8rem; border-radius: 8px; max-height: 320px; overflow: auto; margin: 0; }

/* 16. CONTROL DE ESCANEOS -------------------------------------------------- */
.hem-calendario .ui-datepicker { width: 100%; border: 0; padding: 0; font-family: inherit; background: transparent; }
.hem-calendario .ui-datepicker-header { background: var(--hem-guinda); border: 0; border-radius: 10px; color: #fff; padding: .45rem 0; }
.hem-calendario .ui-datepicker-title select { color: var(--hem-texto); border-radius: 6px; border: 0; padding: .15rem .3rem; margin: 0 .15rem; font-size: .9rem; }
.hem-calendario .ui-datepicker-prev, .hem-calendario .ui-datepicker-next { top: .45rem !important; cursor: pointer; }
.hem-calendario .ui-datepicker-prev span, .hem-calendario .ui-datepicker-next span { filter: invert(1); }
.hem-calendario .ui-datepicker-prev-hover, .hem-calendario .ui-datepicker-next-hover { background: rgba(255,255,255,.18); border: 0; }
.hem-calendario .ui-datepicker table { font-size: .9rem; margin-top: .4rem; }
.hem-calendario .ui-datepicker th { color: var(--hem-guinda); font-weight: 700; }
.hem-calendario .ui-state-default { text-align: center; border-radius: 8px; border: 1px solid transparent; background: #f7f7f8; color: #b3b3b5; padding: .35rem 0; }
.hem-calendario .hem-dia-con .ui-state-default { background: #fff; color: var(--hem-guinda); font-weight: 700; border-color: var(--hem-arena); }
.hem-calendario .hem-dia-avance .ui-state-default { background: #fbf3e2; border-color: var(--hem-dorado); }
.hem-calendario .hem-dia-completo .ui-state-default { background: #e6f3ea; border-color: var(--hem-verde); color: var(--hem-verde); }
.hem-calendario .hem-dia-exento .ui-state-default { background: #eeeeef; border-color: var(--hem-grisosc); color: var(--hem-grisosc); }
.hem-calendario .hem-dia-con .ui-state-default:hover { background: var(--hem-arena); }
.hem-calendario .ui-state-active, .hem-calendario .hem-dia-con .ui-state-active { background: var(--hem-carmin) !important; color: #fff !important; border-color: var(--hem-carmin) !important; }
.hem-calendario .ui-state-highlight { box-shadow: inset 0 0 0 2px var(--hem-dorado); }
.hem-leyenda-cal { display: flex; flex-wrap: wrap; gap: .3rem .9rem; list-style: none; padding: 0; margin: .7rem 0 0; font-size: .8rem; color: var(--hem-gris-texto); }
.hem-leyenda-cal span { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: .3rem; vertical-align: middle; border: 1px solid; }

.hem-periodicos { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: .8rem; }
.hem-periodico {
    position: relative; display: flex; flex-direction: column; gap: .45rem; text-align: left; width: 100%; background: #fff; border: 1px solid #e7dfd1;
    border-left: 6px solid var(--tono, var(--hem-arena)); border-radius: 12px; padding: .85rem 1rem; cursor: pointer; color: var(--hem-texto);
    box-shadow: var(--hem-sombra); transition: transform .2s, box-shadow .2s, border-color .2s;
}
.hem-periodico:hover, .hem-periodico:focus { transform: translateY(-4px); box-shadow: var(--hem-sombra-alta); outline: none; border-color: var(--hem-dorado); }
.hem-periodico.activo { border-color: var(--hem-guinda); background: #fbf3f5; box-shadow: 0 0 0 3px rgba(160,33,66,.18), var(--hem-sombra-alta); }
.hem-periodico-nombre { font-weight: 700; color: var(--hem-guinda); line-height: 1.25; }
.hem-periodico-datos { display: flex; flex-wrap: wrap; gap: .3rem .8rem; font-size: .8rem; color: var(--hem-gris-texto); }
.hem-periodico-sello { position: absolute; top: .6rem; right: .7rem; font-size: 1.35rem; color: var(--hem-verde); }
/* Celda de la cuadrícula, junto a la tarjeta seleccionada, con el botón "Imprimir cédula". */
.hem-cedula-celda { align-self: center; justify-self: start; }

.hem-detalle-encabezado { display: flex; flex-wrap: wrap; gap: 1rem; align-items: flex-start; justify-content: space-between; }
.hem-detalle-titulo { font-size: 1.25rem; font-weight: 800; color: var(--hem-guinda); margin: 0; }
.hem-ubicacion { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: .75rem; background: #faf6ee; border: 1px solid #eadfca; border-radius: 12px; padding: .85rem 1rem; margin: 1rem 0; }
.hem-ubicacion label { font-size: .8rem; color: var(--hem-guinda); margin-bottom: .2rem; }
.hem-ubicacion-estado { font-size: .78rem; color: var(--hem-gris-texto); min-height: 1rem; }
.hem-metricas { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: .6rem; margin: .5rem 0 1rem; }
.hem-metricas > div { background: #fff; border: 1px solid #ece4d6; border-radius: 10px; padding: .55rem .8rem; }
.hem-metricas dt { font-size: .72rem; text-transform: uppercase; letter-spacing: .03em; color: var(--hem-gris-texto); font-weight: 700; }
.hem-metricas dd { margin: 0; font-size: 1.3rem; font-weight: 800; color: var(--hem-guinda); font-variant-numeric: tabular-nums; }

/* Interruptores "al toque" */
.hem-toque { display: inline-flex; align-items: center; gap: .45rem; border: 2px solid var(--hem-gris); background: #fff; color: var(--hem-gris-texto); border-radius: 999px; padding: .28rem .8rem .28rem .35rem; font-weight: 700; font-size: .8rem; cursor: pointer; transition: all .2s; white-space: nowrap; }
.hem-toque .hem-toque-punto { width: 22px; height: 22px; border-radius: 50%; background: #e3e3e5; display: inline-flex; align-items: center; justify-content: center; color: #fff; font-size: .7rem; transition: background .2s, transform .2s; }
.hem-toque:hover, .hem-toque:focus { border-color: var(--hem-guinda); color: var(--hem-guinda); }
.hem-toque[aria-pressed="true"] { background: var(--hem-verde); border-color: var(--hem-verde); color: #fff; }
.hem-toque[aria-pressed="true"] .hem-toque-punto { background: #fff; color: var(--hem-verde); transform: scale(1.08); }
.hem-toque.hem-toque-digital[aria-pressed="true"] { background: var(--hem-guinda); border-color: var(--hem-guinda); }
.hem-toque.hem-toque-digital[aria-pressed="true"] .hem-toque-punto { color: var(--hem-guinda); }
.hem-toque[disabled] { opacity: .5; cursor: not-allowed; }
.hem-especial { font-size: .76rem; }
.hem-especial-etiqueta { display: inline-flex; align-items: center; gap: .3rem; padding: .15rem .55rem; border-radius: 999px; font-weight: 700; background: #fdeeee; color: var(--hem-rojo); font-size: .75rem; }
.hem-especial-etiqueta.otra { background: #f3ece0; color: var(--hem-guinda); }
.hem-quien { display: block; font-size: .7rem; color: var(--hem-gris-texto); margin-top: .15rem; white-space: normal; }

/* Sello grande de "periódico digitalizado" */
.hem-sello-digital { display: flex; align-items: center; gap: 1.2rem; background: linear-gradient(120deg, #e7f4eb, #ffffff); border: 2px solid var(--hem-verde); border-radius: 16px; padding: 1.1rem 1.4rem; margin: 1rem 0; animation: hem-aparecer .6s cubic-bezier(.2,1.4,.4,1); }
.hem-sello-digital i { font-size: 4.2rem; color: var(--hem-verde); filter: drop-shadow(0 6px 10px rgba(31,122,63,.35)); }
.hem-sello-digital strong { display: block; font-size: 1.45rem; color: var(--hem-verde); line-height: 1.15; }
.hem-sello-digital span { color: var(--hem-gris-texto); }
.hem-sello-exento { background: linear-gradient(120deg, #eeeeef, #ffffff); border-color: var(--hem-grisosc); }
.hem-sello-exento i, .hem-sello-exento strong { color: var(--hem-grisosc); }
@keyframes hem-aparecer { from { opacity: 0; transform: scale(.85); } to { opacity: 1; transform: none; } }
.hem-instrucciones { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; min-height: 260px; color: var(--hem-gris-texto); border: 2px dashed var(--hem-arena); border-radius: 14px; padding: 1.5rem; }
.hem-instrucciones i { font-size: 3rem; color: var(--hem-dorado); margin-bottom: .6rem; }
.hem-instrucciones strong { color: var(--hem-guinda); font-size: 1.1rem; }

/* jQuery UI: autocompletado con colores institucionales */
.ui-autocomplete { max-height: 300px; overflow-y: auto; overflow-x: hidden; z-index: 2100 !important; border-radius: 10px; box-shadow: var(--hem-sombra-alta); font-family: inherit; font-size: .9rem; }
.ui-menu .ui-menu-item-wrapper.ui-state-active { background: var(--hem-guinda); border-color: var(--hem-guinda); color: #fff; margin: 0; }

/* 17. BITÁCORA ------------------------------------------------------------- */
.hem-pestanas .nav-link { color: var(--hem-guinda); font-weight: 600; border-radius: 10px 10px 0 0; }
.hem-pestanas .nav-link.active { background: var(--hem-guinda); color: #fff; border-color: var(--hem-guinda); }
.hem-pestanas .nav-link i { margin-right: .3rem; }
.hem-codigo { font-family: Consolas, monospace; font-size: .78rem; font-weight: 700; padding: .12rem .45rem; border-radius: 6px; background: #f3ece0; color: var(--hem-guinda); }
.hem-codigo.navegador { background: #e9eef8; color: #24447a; }

/* 17-B. MANUAL (docsify sin tema: hereda la identidad del sistema) ------- */
.hem-manual .markdown-section { max-width: 920px; margin: 0 auto; line-height: 1.65; }
.hem-manual .markdown-section h1 { color: var(--hem-guinda); font-weight: 800; font-size: 1.8rem; border-bottom: 3px solid var(--hem-dorado); padding-bottom: .4rem; }
.hem-manual .markdown-section h2 { color: var(--hem-guinda); font-size: 1.3rem; font-weight: 700; margin-top: 2rem; }
.hem-manual .markdown-section h2::before { content: "\f02d"; font-family: "Font Awesome 5 Free"; font-weight: 900; color: var(--hem-dorado); margin-right: .5rem; font-size: 1rem; }
.hem-manual .markdown-section a.anchor { color: inherit; text-decoration: none; }
.hem-manual .markdown-section table { width: 100%; margin: 1rem 0; border-collapse: collapse; }
.hem-manual .markdown-section th { background: var(--hem-guinda); color: #fff; padding: .5rem .7rem; }
.hem-manual .markdown-section td { border-bottom: 1px solid #eee5d6; padding: .45rem .7rem; vertical-align: top; }
.hem-manual .markdown-section blockquote { background: #faf6ee; border-left: 5px solid var(--hem-dorado); margin: 1rem 0; padding: .6rem 1rem; color: var(--hem-gris-texto); }
.hem-manual .markdown-section code { background: #f3ece0; color: var(--hem-guinda); padding: .05rem .35rem; border-radius: 4px; }
.hem-manual .app-nav, .hem-manual .github-corner, .hem-manual .sidebar, .hem-manual .sidebar-toggle { display: none !important; }

/* 18. RESPONSIVO ----------------------------------------------------------- */
@media (max-width: 991.98px) {
    .hem-reloj-fecha { font-size: .8rem; }
    .hem-reloj-hora { font-size: 1rem; }
}
@media (max-width: 767.98px) {
    .hem-hero-titulo { font-size: 1.4rem; }
    .hem-hero-icono { width: 44px; height: 44px; font-size: 1.2rem; }
    .dataTables_wrapper .dataTables_filter, .dataTables_wrapper .dataTables_length { text-align: left !important; margin-bottom: .4rem; }
    .dataTables_wrapper .dataTables_filter label { justify-content: flex-start; }
    .dataTables_wrapper .dataTables_filter input { min-width: 0; width: 100%; }
    .hem-ficha { grid-template-columns: 1fr; }
}
@media (max-width: 575.98px) {
    .hem-tarjeta-numero { font-size: 1.75rem; }
    .hem-tarjeta-icono { width: 52px; height: 52px; font-size: 1.45rem; }
    .hem-grafica { height: 260px; }
    .hem-toasts { top: 64px; right: .5rem; }
    .hem-login-formulario { padding: 1.1rem; }
    .hem-reloj-hora { font-size: .9rem; }
    .hem-reloj-fecha { font-size: .72rem; }
    .hem-sello-digital { flex-direction: column; text-align: center; }
    .hem-filtros .form-group { min-width: 100%; }
}
@media (pointer: coarse) {
    .hem-toque { padding: .45rem .9rem .45rem .45rem; }
    .btn-sm { min-height: 38px; }
}

/* 19. MOVIMIENTO REDUCIDO -------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
    .hem-tarjeta:hover, .hem-periodico:hover { transform: none; }
}

/* IMPRESIÓN: solo el contenido */
@media print {
    .main-header, .main-sidebar, .main-footer, .hem-toasts, .hem-cargando, .dataTables_filter, .dataTables_length, .dataTables_paginate, .btn { display: none !important; }
    .content-wrapper { margin: 0 !important; }
}
