/* ==========================================================================
   Portal de Información Contable – LGCG
   Paleta tomada del comunicado institucional: verde oscuro, dorado, crema y azul.
   Mobile-first; Bootstrap 5.3 como base.
   ========================================================================== */

:root {
    --pj-verde-950: #011f10;
    --pj-verde-900: #012e17;
    --pj-verde-800: #024911;
    --pj-verde-600: #15731d;
    --pj-verde-100: #e6f1e8;
    --pj-dorado: #c79912;
    --pj-dorado-osc: #957119;
    --pj-dorado-claro: #f3e3b0;
    --pj-crema: #fdf9ee;
    --pj-fondo: #f5f7f2;
    --pj-azul: #06275c;
    --pj-texto: #1c2a21;
    --pj-suave: #5b6b60;
    --pj-borde: #dfe6dc;

    /* semáforo de cumplimiento */
    --sem-rojo: #c62828;      --sem-rojo-bg: #fdecea;
    --sem-naranja: #ef7d00;   --sem-naranja-bg: #fff1e0;
    --sem-amarillo: #f2b705;  --sem-amarillo-bg: #fff8db;
    --sem-verde: #2e7d32;     --sem-verde-bg: #e6f4ea;
    --sem-gris: #98a2b3;      --sem-gris-bg: #f2f4f7;

    --bs-primary: #024911;
    --bs-primary-rgb: 2, 73, 17;
    --bs-link-color: #024911;
    --bs-link-color-rgb: 2, 73, 17;
    --bs-link-hover-color: #15731d;
    --bs-link-hover-color-rgb: 21, 115, 29;
    --bs-body-font-family: 'Segoe UI', system-ui, -apple-system, 'Helvetica Neue', Arial, sans-serif;
    --bs-body-color: var(--pj-texto);
    --bs-body-bg: var(--pj-fondo);
    --bs-border-radius: .6rem;
    --bs-border-radius-lg: .9rem;
    --bs-focus-ring-color: rgba(21, 115, 29, .25);
}

body { background: var(--pj-fondo); color: var(--pj-texto); }
h1, h2, h3, h4, h5 { color: var(--pj-verde-900); font-weight: 650; letter-spacing: -.01em; }
a { text-underline-offset: 2px; }

.btn-primary {
    --bs-btn-bg: var(--pj-verde-800); --bs-btn-border-color: var(--pj-verde-800);
    --bs-btn-hover-bg: var(--pj-verde-600); --bs-btn-hover-border-color: var(--pj-verde-600);
    --bs-btn-active-bg: var(--pj-verde-900); --bs-btn-active-border-color: var(--pj-verde-900);
    --bs-btn-disabled-bg: var(--pj-verde-800); --bs-btn-disabled-border-color: var(--pj-verde-800);
    --bs-btn-focus-shadow-rgb: 21, 115, 29;
}
.btn-outline-primary {
    --bs-btn-color: var(--pj-verde-800); --bs-btn-border-color: var(--pj-verde-800);
    --bs-btn-hover-bg: var(--pj-verde-800); --bs-btn-hover-border-color: var(--pj-verde-800);
    --bs-btn-active-bg: var(--pj-verde-900); --bs-btn-active-border-color: var(--pj-verde-900);
}
.btn-gold {
    --bs-btn-color: #2b2000; --bs-btn-bg: var(--pj-dorado); --bs-btn-border-color: var(--pj-dorado);
    --bs-btn-hover-color: #2b2000; --bs-btn-hover-bg: #d8a92a; --bs-btn-hover-border-color: #d8a92a;
    --bs-btn-active-bg: var(--pj-dorado-osc); --bs-btn-active-border-color: var(--pj-dorado-osc);
    font-weight: 600;
}
.form-control:focus, .form-select:focus { border-color: var(--pj-verde-600); box-shadow: 0 0 0 .2rem rgba(21, 115, 29, .18); }
.form-check-input:checked { background-color: var(--pj-verde-800); border-color: var(--pj-verde-800); }
.form-label { font-weight: 600; font-size: .875rem; color: var(--pj-verde-900); }
.card { border-color: var(--pj-borde); box-shadow: 0 1px 2px rgba(1, 46, 23, .04); }
.card-header { background: #fff; border-bottom-color: var(--pj-borde); font-weight: 600; }
.text-suave { color: var(--pj-suave) !important; }
.min-w-0 { min-width: 0; }

/* ---------------------------------------------------------------- Encabezado público */
.site-header { background: var(--pj-verde-900); position: relative; z-index: 20; }
.header-top { display: flex; align-items: center; gap: .9rem; padding-top: 1rem; padding-bottom: .75rem; }
.brand { display: flex; align-items: center; gap: .9rem; min-width: 0; flex: 1; text-decoration: none; }
.brand-escudo { width: 52px; height: 52px; flex: none; }
.brand-sep { width: 1px; align-self: stretch; background: linear-gradient(transparent, var(--pj-dorado), transparent); flex: none; }
.brand-franja { flex: 1; min-width: 0; overflow: hidden; display: flex; justify-content: center; }
.brand-franja img { height: 24px; width: auto; flex: none; max-width: none; }
@media (min-width: 576px) { .brand-franja img { height: 32px; } }
.header-acciones { flex: none; }
.header-titulo { color: var(--pj-dorado-claro); font-size: .78rem; letter-spacing: .14em; text-transform: uppercase; text-align: center; padding-bottom: .35rem; }

.public-nav { padding: 0 0 .9rem; }
.public-nav .navbar-toggler { border-color: rgba(255, 255, 255, .35); }
.public-nav .nav-link { color: #fff; font-weight: 500; padding: .55rem .9rem; border-radius: .5rem; }
.public-nav .nav-link:hover, .public-nav .nav-link.show, .public-nav .nav-link.active { color: var(--pj-dorado-claro); background: rgba(255, 255, 255, .08); }

.mega-menu {
    padding: .5rem; border: 1px solid var(--pj-borde); border-radius: .9rem;
    box-shadow: 0 18px 40px rgba(1, 31, 16, .25); min-width: min(420px, 92vw);
    max-height: 70vh; overflow-y: auto;
}
.mega-menu .accordion { --bs-accordion-border-width: 0; --bs-accordion-bg: transparent; }
.mega-menu .accordion-button { font-weight: 600; font-size: .92rem; padding: .65rem .8rem; border-radius: .55rem !important; color: var(--pj-verde-900); background: transparent; box-shadow: none; }
.mega-menu .accordion-button:not(.collapsed) { background: var(--pj-verde-100); }
.mega-menu .accordion-body { padding: .25rem .4rem .6rem; }
.mega-menu .tema-link { display: block; padding: .38rem .8rem; border-radius: .45rem; color: var(--pj-texto); text-decoration: none; font-size: .88rem; line-height: 1.3; }
.mega-menu .tema-link:hover { background: var(--pj-crema); color: var(--pj-verde-800); }
.mega-menu .cat-direct { display: block; padding: .65rem .8rem; border-radius: .55rem; font-weight: 600; font-size: .92rem; color: var(--pj-verde-900); text-decoration: none; }
.mega-menu .cat-direct:hover { background: var(--pj-verde-100); }

.header-wave { height: 26px; line-height: 0; margin-bottom: -1px; }
.header-wave svg { width: 100%; height: 100%; display: block; }

@media (min-width: 768px) {
    .brand-escudo { width: 68px; height: 68px; }
    .brand-franja img { height: 46px; }
    .header-top { padding-top: 1.25rem; }
}
@media (min-width: 992px) {
    .brand-franja { justify-content: flex-start; }
    .brand-franja img { height: 58px; }
    .public-nav { padding-bottom: 1.1rem; }
    .header-wave { height: 34px; }
}

/* ---------------------------------------------------------------- Portada pública */
.hero { padding: 2.2rem 0 1.4rem; text-align: center; }
.hero h1 { font-size: clamp(1.55rem, 4vw, 2.4rem); font-weight: 750; margin-bottom: .6rem; }
.hero p { max-width: 46rem; margin: 0 auto; color: var(--pj-suave); font-size: 1.02rem; }
.ornamento { display: flex; align-items: center; justify-content: center; gap: .7rem; margin: 0 auto 1rem; color: var(--pj-dorado); }
.ornamento::before, .ornamento::after { content: ''; height: 2px; width: min(90px, 18vw); background: linear-gradient(90deg, transparent, var(--pj-dorado)); }
.ornamento::after { transform: scaleX(-1); }

.filter-card { background: var(--pj-crema); border: 1px solid var(--pj-dorado-claro); border-radius: 1rem; padding: 1.1rem; }

.cat-card {
    display: flex; gap: .9rem; align-items: flex-start; height: 100%; padding: 1.05rem 1.1rem;
    background: #fff; border: 1px solid var(--pj-borde); border-radius: 1rem; text-decoration: none; color: inherit;
    transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.cat-card:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(1, 46, 23, .1); border-color: var(--pj-dorado); color: inherit; }
.cat-icon { width: 46px; height: 46px; flex: none; display: grid; place-items: center; border-radius: .8rem; background: var(--pj-verde-800); color: var(--pj-dorado-claro); font-size: 1.3rem; }
.cat-card h3 { font-size: 1rem; margin: 0 0 .25rem; line-height: 1.25; }
.cat-card .meta { font-size: .82rem; color: var(--pj-suave); }

.tema-card { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .95rem 1.1rem; background: #fff; border: 1px solid var(--pj-borde); border-radius: .8rem; text-decoration: none; color: var(--pj-texto); }
.tema-card:hover { border-color: var(--pj-dorado); background: var(--pj-crema); color: var(--pj-verde-800); }

.page-title { margin: 1.6rem 0 1.2rem; }
.page-title h1 { font-size: clamp(1.35rem, 3.4vw, 2rem); margin: 0; }
.breadcrumb { --bs-breadcrumb-divider-color: var(--pj-dorado-osc); font-size: .88rem; margin-bottom: .6rem; }

/* Ejercicios y trimestres (acordeones) */
.ej-acordeon .accordion-item { border: 1px solid var(--pj-borde); border-radius: 1rem !important; overflow: hidden; margin-bottom: .8rem; background: #fff; }
.ej-acordeon > .accordion-item > .accordion-header > .accordion-button { background: var(--pj-verde-900); color: #fff; font-weight: 650; font-size: 1.1rem; box-shadow: none; }
.ej-acordeon > .accordion-item > .accordion-header > .accordion-button.collapsed { background: var(--pj-verde-800); }
.ej-acordeon > .accordion-item > .accordion-header > .accordion-button::after { filter: brightness(0) invert(1); }
.ej-acordeon .accordion-button:focus { box-shadow: 0 0 0 .2rem rgba(199, 153, 18, .35); }
.tri-acordeon .accordion-item { border: 0; border-bottom: 1px solid var(--pj-borde); border-radius: 0 !important; margin: 0; }
.tri-acordeon .accordion-item:last-child { border-bottom: 0; }
.tri-acordeon .accordion-button { background: #fff; color: var(--pj-verde-900); font-weight: 600; box-shadow: none; }
.tri-acordeon .accordion-button:not(.collapsed) { background: var(--pj-crema); }
.tri-badge { display: inline-grid; place-items: center; width: 2.1rem; height: 2.1rem; border-radius: 50%; background: var(--pj-dorado); color: #2b2000; font-weight: 700; font-size: .85rem; margin-right: .7rem; flex: none; }

.pub-bloque + .pub-bloque { margin-top: 1rem; padding-top: 1rem; border-top: 1px dashed var(--pj-borde); }
.nota-pub { background: var(--pj-crema); border-left: 4px solid var(--pj-dorado); border-radius: .35rem .7rem .7rem .35rem; padding: .7rem .95rem; margin-bottom: .75rem; font-size: .93rem; }
.nota-pub p:last-child, .nota-pub ul:last-child, .nota-pub ol:last-child { margin-bottom: 0; }

.archivo-item { display: flex; align-items: center; gap: .8rem; padding: .65rem .8rem; border: 1px solid var(--pj-borde); border-radius: .7rem; background: #fff; }
.archivo-item + .archivo-item { margin-top: .5rem; }
.archivo-item .ico { font-size: 1.7rem; flex: none; line-height: 1; }
.archivo-item .nombre { font-weight: 600; word-break: break-word; line-height: 1.3; }
.archivo-item .meta { font-size: .78rem; color: var(--pj-suave); text-transform: uppercase; letter-spacing: .03em; }
.archivo-item .acciones { margin-left: auto; display: flex; gap: .4rem; flex: none; }
@media (max-width: 575.98px) {
    .archivo-item { flex-wrap: wrap; }
    .archivo-item .acciones { width: 100%; margin-left: 0; }
    .archivo-item .acciones .btn { flex: 1; }
}

.resultado-grupo { border: 1px solid var(--pj-borde); border-radius: 1rem; background: #fff; overflow: hidden; }
.resultado-grupo + .resultado-grupo { margin-top: 1rem; }
.resultado-grupo > .cabecera { background: var(--pj-verde-800); color: #fff; padding: .7rem 1.1rem; font-weight: 650; }
.resultado-tema { padding: 1rem 1.1rem; border-top: 1px solid var(--pj-borde); }
.resultado-tema:first-of-type { border-top: 0; }
.resultado-tema .cat-mini { font-size: .76rem; text-transform: uppercase; letter-spacing: .05em; color: var(--pj-dorado-osc); font-weight: 650; }

.vacio { text-align: center; padding: 2.5rem 1rem; color: var(--pj-suave); }
.vacio .bi { font-size: 2.4rem; color: var(--pj-dorado); display: block; margin-bottom: .5rem; }

.site-footer { background: var(--pj-verde-900); color: #cfe0d3; margin-top: 3rem; padding: 2rem 0 1.4rem; border-top: 4px solid var(--pj-dorado); font-size: .9rem; }
.site-footer img { width: 54px; height: 54px; }
.site-footer a { color: var(--pj-dorado-claro); }
.site-footer .legal { color: #9db6a4; font-size: .8rem; }

/* ---------------------------------------------------------------- Login */
.auth-body { min-height: 100vh; display: grid; place-items: center; padding: 1.2rem; background:
    radial-gradient(1200px 500px at 15% -10%, rgba(199, 153, 18, .18), transparent 60%),
    linear-gradient(160deg, var(--pj-verde-950), var(--pj-verde-800)); }
.auth-card { width: 100%; max-width: 430px; background: #fff; border-radius: 1.2rem; overflow: hidden; box-shadow: 0 30px 70px rgba(0, 0, 0, .35); }
.auth-head { background: var(--pj-verde-900); text-align: center; padding: 1.5rem 1.2rem 1.1rem; border-bottom: 4px solid var(--pj-dorado); }
.auth-head img.escudo { width: 84px; height: 84px; }
.auth-head img.franja { height: 22px; width: auto; flex: none; max-width: none; }
@media (min-width: 576px) { .auth-head img.franja { height: 28px; } }
.auth-body > div { min-width: 0; }
.auth-head .franja-wrap { overflow: hidden; display: flex; justify-content: center; margin-top: .8rem; }
.auth-head .titulo { color: var(--pj-dorado-claro); font-size: .78rem; letter-spacing: .12em; text-transform: uppercase; margin-top: .6rem; }
.auth-form { padding: 1.5rem 1.5rem 1.6rem; }
.auth-volver { text-align: center; margin-top: 1.1rem; }
.auth-volver a { color: #cfe0d3; font-size: .9rem; }

/* ---------------------------------------------------------------- Panel interno */
.panel-wrap { min-height: 100vh; display: flex; }
.panel-sidebar { width: 268px; flex: none; background: var(--pj-verde-900); color: #dbe8de; display: flex; flex-direction: column; }
.panel-sidebar .brand-side { display: flex; align-items: center; gap: .75rem; padding: 1.1rem 1.1rem 1rem; border-bottom: 1px solid rgba(255, 255, 255, .1); text-decoration: none; }
.panel-sidebar .brand-side img { width: 44px; height: 44px; }
.panel-sidebar .brand-side span { color: #fff; font-weight: 650; line-height: 1.2; font-size: .92rem; }
.panel-sidebar .brand-side small { display: block; color: var(--pj-dorado-claro); font-weight: 500; font-size: .72rem; letter-spacing: .05em; text-transform: uppercase; }
.side-nav { padding: .8rem .7rem; overflow-y: auto; flex: 1; }
.side-nav .titulo { font-size: .68rem; text-transform: uppercase; letter-spacing: .12em; color: #8fae97; padding: .9rem .8rem .35rem; }
.side-nav a { display: flex; align-items: center; gap: .7rem; padding: .6rem .8rem; color: #dbe8de; text-decoration: none; border-radius: .6rem; font-size: .93rem; }
.side-nav a .bi { font-size: 1.05rem; color: var(--pj-dorado-claro); width: 1.2rem; text-align: center; }
.side-nav a:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.side-nav a.activo { background: var(--pj-dorado); color: #2b2000; font-weight: 650; }
.side-nav a.activo .bi { color: #2b2000; }
.side-pie { padding: .9rem 1.1rem; border-top: 1px solid rgba(255, 255, 255, .1); font-size: .8rem; color: #9db6a4; }
.panel-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.panel-top { background: #fff; border-bottom: 1px solid var(--pj-borde); padding: .6rem 1rem; display: flex; align-items: center; gap: .8rem; position: sticky; top: 0; z-index: 30; }
.panel-top .titulo-pagina { font-weight: 650; color: var(--pj-verde-900); font-size: 1.05rem; margin: 0; }
.panel-content { padding: 1.2rem 1rem 3rem; flex: 1; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--pj-verde-800); color: var(--pj-dorado-claro); display: grid; place-items: center; font-weight: 700; font-size: .9rem; flex: none; }
.offcanvas.panel-offcanvas { background: var(--pj-verde-900); width: 285px; }
@media (min-width: 992px) {
    .panel-content { padding: 1.6rem 1.8rem 3rem; }
    .panel-top { padding: .7rem 1.8rem; }
    .panel-sidebar.fija { position: sticky; top: 0; height: 100vh; }
}
@media (max-width: 991.98px) { .panel-sidebar.fija { display: none; } }

.page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .8rem; margin-bottom: 1.2rem; }
.page-head h1 { font-size: 1.5rem; margin: 0; }
.page-head p { margin: .2rem 0 0; color: var(--pj-suave); }

.stat-card { background: #fff; border: 1px solid var(--pj-borde); border-radius: 1rem; padding: 1rem 1.15rem; height: 100%; }
.stat-card .valor { font-size: 1.9rem; font-weight: 750; color: var(--pj-verde-900); line-height: 1.1; }
.stat-card .etiqueta { color: var(--pj-suave); font-size: .84rem; }

.badge-rol { font-weight: 600; letter-spacing: .02em; }
.badge-rol.su { background: var(--pj-azul); color: #fff; }
.badge-rol.admin { background: var(--pj-dorado); color: #2b2000; }
.badge-rol.user { background: var(--pj-verde-100); color: var(--pj-verde-800); }

.table > :not(caption) > * > * { padding: .7rem .8rem; }
.table thead th { background: var(--pj-verde-100); color: var(--pj-verde-900); font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; border-bottom: 0; white-space: nowrap; }
.table-hover > tbody > tr:hover > * { --bs-table-bg-state: var(--pj-crema); }
.tabla-archivos a { display: block; text-decoration: none; word-break: break-word; font-size: .88rem; }

.chip { display: inline-flex; align-items: center; gap: .3rem; padding: .18rem .6rem; border-radius: 2rem; font-size: .76rem; font-weight: 650; white-space: nowrap; }
.chip-verde { background: var(--sem-verde-bg); color: #1b5e20; }
.chip-naranja { background: var(--sem-naranja-bg); color: #9a5200; }
.chip-rojo { background: var(--sem-rojo-bg); color: #9b1c1c; }
.chip-amarillo { background: var(--sem-amarillo-bg); color: #6b5200; }
.chip-gris { background: var(--sem-gris-bg); color: #475467; }
.chip-azul { background: #e5ecfb; color: var(--pj-azul); }

/* ---------------------------------------------------------------- Seguimiento */
.tri-tabs { display: grid; grid-template-columns: repeat(2, 1fr); gap: .6rem; }
@media (min-width: 768px) { .tri-tabs { grid-template-columns: repeat(4, 1fr); } }
.tri-tab { display: block; padding: .75rem .9rem; background: #fff; border: 2px solid var(--pj-borde); border-radius: .9rem; text-decoration: none; color: var(--pj-texto); position: relative; overflow: hidden; }
.tri-tab:hover { border-color: var(--pj-dorado); color: var(--pj-texto); }
.tri-tab.activo { border-color: var(--pj-verde-800); box-shadow: 0 0 0 3px rgba(2, 73, 17, .12); }
.tri-tab .t { font-weight: 700; color: var(--pj-verde-900); }
.tri-tab .rango { font-size: .76rem; color: var(--pj-suave); }
.tri-tab .pct { font-size: 1.35rem; font-weight: 750; line-height: 1.1; margin-top: .25rem; }
.tri-tab .franja { position: absolute; left: 0; top: 0; bottom: 0; width: 6px; }

.sem-rojo { --c: var(--sem-rojo); --cbg: var(--sem-rojo-bg); }
.sem-naranja { --c: var(--sem-naranja); --cbg: var(--sem-naranja-bg); }
.sem-amarillo { --c: var(--sem-amarillo); --cbg: var(--sem-amarillo-bg); }
.sem-verde { --c: var(--sem-verde); --cbg: var(--sem-verde-bg); }
.sem-gris { --c: var(--sem-gris); --cbg: var(--sem-gris-bg); }
.franja { background: var(--c); }
.pct-txt { color: var(--c); }

.cat-tile { background: #fff; border: 1px solid var(--pj-borde); border-left: 7px solid var(--c); border-radius: .9rem; overflow: hidden; height: 100%; }
.cat-tile > button { all: unset; box-sizing: border-box; display: block; width: 100%; padding: .9rem 1rem; cursor: pointer; }
.cat-tile > button:focus-visible { outline: 3px solid rgba(199, 153, 18, .6); outline-offset: -3px; }
.cat-tile .nombre { font-weight: 650; color: var(--pj-verde-900); line-height: 1.25; }
.cat-tile .conteo { font-size: 1.7rem; font-weight: 800; color: var(--c); line-height: 1; white-space: nowrap; }
.cat-tile .conteo small { font-size: .85rem; font-weight: 600; color: var(--pj-suave); }
.barra { height: 8px; background: var(--sem-gris-bg); border-radius: 8px; overflow: hidden; margin-top: .7rem; }
.barra > span { display: block; height: 100%; background: var(--c); border-radius: 8px; transition: width .5s ease; }
.cat-tile .detalle { background: #fbfcfa; border-top: 1px solid var(--pj-borde); padding: .4rem 1rem .7rem; }
.tema-fila { display: flex; gap: .7rem; align-items: flex-start; justify-content: space-between; padding: .55rem 0; border-bottom: 1px dashed var(--pj-borde); font-size: .87rem; }
.tema-fila:last-child { border-bottom: 0; }
.tema-fila .nombre { min-width: 0; flex: 1; line-height: 1.3; }
.tema-fila .sub { display: block; color: var(--pj-suave); font-size: .75rem; margin-top: .1rem; }

.leyenda { display: flex; flex-wrap: wrap; gap: .4rem .9rem; font-size: .8rem; color: var(--pj-suave); }
.leyenda i { display: inline-block; width: .8rem; height: .8rem; border-radius: 50%; margin-right: .3rem; vertical-align: -1px; background: var(--c); }

.toast-pub { position: fixed; right: 1rem; bottom: 1rem; z-index: 1080; max-width: min(380px, calc(100vw - 2rem)); }
.toast-pub .toast { border: 0; border-left: 5px solid var(--pj-dorado); box-shadow: 0 12px 30px rgba(1, 31, 16, .25); }
.en-vivo { display: inline-flex; align-items: center; gap: .4rem; font-size: .78rem; color: var(--pj-suave); }
.en-vivo::before { content: ''; width: .55rem; height: .55rem; border-radius: 50%; background: var(--sem-verde); box-shadow: 0 0 0 0 rgba(46, 125, 50, .6); animation: pulso 2s infinite; }
.en-vivo.pausa::before { background: var(--sem-gris); animation: none; }
@keyframes pulso { 70% { box-shadow: 0 0 0 7px rgba(46, 125, 50, 0); } 100% { box-shadow: 0 0 0 0 rgba(46, 125, 50, 0); } }

/* ---------------------------------------------------------------- Formulario de publicación */
.dropzone { border: 2px dashed #b8c6b9; border-radius: 1rem; background: #fbfcfa; padding: 1.6rem 1rem; text-align: center; cursor: pointer; transition: all .15s; }
.dropzone:hover, .dropzone.arrastrando { border-color: var(--pj-verde-600); background: var(--pj-verde-100); }
.dropzone .bi { font-size: 2.2rem; color: var(--pj-verde-800); }
.dropzone:focus-visible { outline: 3px solid rgba(199, 153, 18, .6); outline-offset: 2px; }
.up-item { display: flex; align-items: center; gap: .8rem; padding: .7rem .85rem; border: 1px solid var(--pj-borde); border-radius: .8rem; background: #fff; }
.up-item + .up-item { margin-top: .5rem; }
.up-item .ico { font-size: 1.6rem; flex: none; }
.up-item .info { flex: 1; min-width: 0; }
.up-item .nombre { font-weight: 600; word-break: break-word; line-height: 1.25; }
.up-item .estado { font-size: .78rem; color: var(--pj-suave); }
.up-item .progress { height: 6px; margin-top: .35rem; }
.up-item .progress-bar { background: var(--pj-verde-600); }
.up-item.error { border-color: #f1b0a9; background: var(--sem-rojo-bg); }
.up-item.error .estado { color: var(--sem-rojo); font-weight: 600; }
.up-item.listo .estado { color: var(--sem-verde); font-weight: 600; }
.up-item.quitado { opacity: .5; }
.up-item.quitado .nombre { text-decoration: line-through; }

.editor-wrap .ql-toolbar.ql-snow { border-color: #ced4da; border-radius: .6rem .6rem 0 0; background: #fbfcfa; }
.editor-wrap .ql-container.ql-snow { border-color: #ced4da; border-radius: 0 0 .6rem .6rem; font-family: inherit; font-size: .95rem; }
.editor-wrap .ql-editor { min-height: 120px; }
.editor-wrap .ql-editor.ql-blank::before { font-style: normal; color: #98a2b3; }
.editor-wrap:focus-within .ql-toolbar.ql-snow, .editor-wrap:focus-within .ql-container.ql-snow { border-color: var(--pj-verde-600); }

/* ---------------------------------------------------------------- Matriz de configuración */
.matriz th, .matriz td { text-align: center; vertical-align: middle; }
.matriz td.tema { text-align: left; min-width: 260px; font-size: .88rem; }
.matriz tr.cat-row td { background: var(--pj-verde-800); color: #fff; font-weight: 650; text-align: left; }
.matriz .todo { font-size: .7rem; color: var(--pj-dorado-claro); font-weight: 500; text-decoration: underline; cursor: pointer; margin-left: .5rem; background: none; border: 0; padding: 0; }
.matriz input[type=date] { font-size: .75rem; padding: .15rem .3rem; min-width: 128px; }
.matriz .fecha-tema { display: none; margin-top: .3rem; }
.matriz.ver-fechas .fecha-tema { display: block; }
.matriz td.no-aplica { background: var(--sem-gris-bg); }
.matriz td.no-aplica .fecha-tema { display: none !important; }
.tri-config { border: 1px solid var(--pj-borde); border-radius: .9rem; padding: 1rem; background: #fff; height: 100%; }
.tri-config.hab { border-color: var(--sem-verde); background: #f7fbf7; }

/* ---------------------------------------------------------------- Estadísticas */
.barras-dia { display: flex; align-items: flex-end; gap: 2px; height: 150px; padding-top: .5rem; }
.barras-dia .col { flex: 1; min-width: 3px; display: flex; flex-direction: column; justify-content: flex-end; height: 100%; }
.barras-dia .seg { width: 100%; }
.barras-dia .seg.v { background: var(--pj-verde-800); }
.barras-dia .seg.c { background: var(--pj-dorado); }
.barras-dia .seg.d { background: var(--pj-azul); }
.hbar { height: 8px; border-radius: 6px; background: var(--sem-gris-bg); overflow: hidden; min-width: 60px; }
.hbar > span { display: block; height: 100%; background: var(--pj-verde-600); }

@media print { .panel-sidebar, .panel-top, .no-print { display: none !important; } }

@media (max-width: 575.98px) {
    .tema-fila { flex-direction: column; gap: .35rem; }
    .tema-fila .chip { align-self: flex-start; }
}

/* ---------------------------------------------------------------- Visor de documentos (Excel/CSV/Word) */
.visor-card { background: #fff; border: 1px solid var(--pj-borde); border-radius: 1rem; overflow: hidden; margin-bottom: 2rem; }
.visor-cabecera { display: flex; align-items: center; gap: .9rem; padding: 1rem 1.15rem; border-bottom: 1px solid var(--pj-borde); background: var(--pj-crema); }
.visor-cabecera .bi { font-size: 2rem; flex: none; }
.visor-cabecera .nombre { font-weight: 650; color: var(--pj-verde-900); }
.visor-cabecera .meta { font-size: .78rem; color: var(--pj-suave); }
.visor-tabs { display: flex; gap: .3rem; padding: .6rem .8rem 0; overflow-x: auto; background: #fbfcfa; border-bottom: 1px solid var(--pj-borde); }
.visor-tab { border: 1px solid var(--pj-borde); border-bottom: 0; background: #fff; color: var(--pj-suave); font-size: .82rem; font-weight: 600; padding: .5rem .9rem; border-radius: .5rem .5rem 0 0; white-space: nowrap; cursor: pointer; }
.visor-tab.activa { color: var(--pj-verde-800); background: var(--pj-crema); border-color: var(--pj-borde); }
.visor-cuerpo { max-height: 75vh; overflow: auto; }
.visor-tabla { padding: 0; }
.visor-tabla table { width: max-content; min-width: 100%; font-size: .85rem; }
.visor-tabla table td, .visor-tabla table th { padding: .35rem .6rem; white-space: pre-wrap; border-color: var(--pj-borde) !important; }
.visor-tabla table tr:first-child { background: var(--pj-verde-100); font-weight: 600; }
.visor-docx { padding: 1.5rem; background: #fff; display: flex; justify-content: center; }
.visor-docx .docx-wrapper { background: transparent; padding: 0; }
.visor-docx section.docx { box-shadow: 0 1px 4px rgba(1, 46, 23, .12) !important; margin-bottom: 1rem !important; max-width: 100%; }
