/* ================================================================
   Sistema de Denuncias DS 22
   CSS institucional — confianza, discrecion, profesionalismo
   ================================================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
    background: #f5f6f8;
    color: #1a1a2e;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ================================================================
   HEADER INSTITUCIONAL
   ================================================================ */

header {
    background: white;
    border-bottom: 3px solid #1a3a5c;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.header-nav-wrap {
    max-width: 960px;
    margin: 0 auto;
    padding: 0.4rem 1.5rem 0;
    position: relative;
}

.nav-top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.35rem;
}

.nav-site-label {
    flex: 1;
    font-size: 0.85rem;
    font-weight: 700;
    color: #1a3a5c;
    letter-spacing: 0.03em;
    line-height: 1.3;
}

.nav-auth {
    display: none;
}

.nav-auth a.btn-logout,
.nav-auth a.btn-login {
    text-decoration: none;
    border-radius: 4px;
    font-size: 0.73rem;
    padding: 0.35rem 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.nav-auth a.btn-logout {
    color: #8b2020;
    border: 1px solid #b04040;
    background: #fff5f5;
}

.nav-auth a.btn-logout:hover {
    background: #8b2020;
    color: white;
}

.nav-auth a.btn-login {
    color: #1a3a5c;
    border: 1px solid #7a9cbe;
    background: #eaf1fb;
}

.nav-auth a.btn-login:hover {
    background: #1a3a5c;
    color: white;
}

.nav-bar-mobile {
    display: none;
}

.nav-bar-mobile-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: #1a3a5c;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.nav-hamburger {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 2.5rem;
    height: 2.5rem;
    padding: 0.45rem;
    border: 1px solid #1a3a5c;
    border-radius: 6px;
    background: white;
    cursor: pointer;
    flex-shrink: 0;
    margin-right: 0.75rem;
}

.nav-hamburger-bar {
    display: block;
    height: 2px;
    width: 100%;
    background: #1a3a5c;
    border-radius: 1px;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

body.nav-open .nav-hamburger-bar:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}
body.nav-open .nav-hamburger-bar:nth-child(2) {
    opacity: 0;
}
body.nav-open .nav-hamburger-bar:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

.menu-global.menu-drawer {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: min(300px, 88vw);
    height: 100vh;
    margin: 0;
    padding: 1.25rem 1rem 1.5rem;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 0.5rem;
    border-radius: 0;
    border: none;
    border-right: 3px solid #1a3a5c;
    background: #f8fafc;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.15);
    z-index: 999;
    overflow-y: auto;
}

.nav-drawer-user-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.4rem;
    padding: 0 0.35rem 0.5rem;
    flex-wrap: nowrap;
}

.nav-user-icon {
    flex: 0 0 auto;
    width: 15px;
    height: 15px;
    color: #6b7280;
    margin-right: 2px;
}

.nav-drawer-email {
    font-size: 0.78rem;
    font-weight: 600;
    color: #374151;
    padding: 0.35rem 0.4rem;
    line-height: 1.35;
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nav-drawer-menu {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 0.5rem;
}

.menu-global.menu-drawer .nav-drawer-menu a {
    width: 100%;
    text-align: left;
    padding: 0.55rem 0.75rem;
    font-size: 0.85rem;
    box-sizing: border-box;
}

.nav-drawer-footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.55rem 0.75rem 0.75rem;
    text-align: center;
}

.menu-global.menu-drawer .nav-drawer-footer a.nav-guia-link {
    display: inline-block;
    width: auto;
    margin: 0;
    padding: 0;
    font-size: 0.76rem;
    font-weight: 500;
    color: #1a3a5c;
    background: none;
    border: none;
    border-radius: 0;
    box-shadow: none;
    text-align: center;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.menu-global.menu-drawer .nav-drawer-footer a.nav-guia-link:hover {
    color: #0f2847;
    background: none;
}

.menu-global.menu-drawer .nav-drawer-footer a.nav-drawer-footer-auth {
    width: auto;
    text-align: center;
    padding: 0.25rem 0.5rem;
    font-size: 0.78rem;
}

.nav-drawer-footer .nav-drawer-logout-form {
    width: 100%;
    margin: 0;
    display: flex;
    justify-content: center;
}

.menu-global.menu-drawer .nav-drawer-footer button.btn-logout,
.menu-global.menu-drawer .nav-drawer-footer .nav-drawer-logout-form .btn-logout {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    width: auto;
    margin: 0 auto;
    padding: 0.35rem 0.75rem;
    text-align: center;
    font-size: 0.78rem;
    font-weight: 600;
    color: #8b2020 !important;
    background: #fff5f5 !important;
    border: 1px solid #b04040 !important;
    border-radius: 4px;
    cursor: pointer;
    box-sizing: border-box;
}

.menu-global.menu-drawer .nav-drawer-footer button.btn-logout:hover {
    background: #8b2020 !important;
    color: #fff !important;
}

.nav-drawer-auth {
    width: 100%;
    text-align: left !important;
    box-sizing: border-box;
    padding: 0.3rem 0.4rem !important;
    font-size: 0.78rem !important;
}

.menu-global a.btn-logout.nav-drawer-auth svg,
.menu-global a.btn-logout.nav-drawer-footer-auth svg,
.menu-global button.btn-logout.nav-drawer-footer-auth svg {
    vertical-align: -2px;
    margin-right: 4px;
    flex-shrink: 0;
}

.nav-drawer-sep {
    border: none;
    border-top: 1px solid #c5ced8;
    margin: 0.5rem 0;
    width: 100%;
    flex-shrink: 0;
}

.nav-drawer-logo {
    margin-top: auto;
    padding-top: 1.25rem;
    text-align: center;
}

.nav-drawer-logo img {
    height: 52px;
    width: auto;
    max-width: 100%;
}

body.nav-open .menu-global.menu-drawer {
    display: flex;
}

.menu-global.menu-drawer a {
    width: 100%;
    text-align: left;
    padding: 0.55rem 0.75rem;
    font-size: 0.85rem;
}

.menu-global.menu-drawer .nav-sep {
    display: none;
}

.nav-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    z-index: 998;
}

body.nav-open .nav-overlay {
    display: block;
}

.nav-overlay[hidden] {
    display: none !important;
}

body.nav-open .nav-overlay[hidden] {
    display: none !important;
}

.guia-fase-header {
    font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
    font-size: 13px;
    font-weight: 700;
    color: #1a3a5c;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 8px 0 6px;
    margin-bottom: 4px;
    line-height: 1.35;
}

.guia-codigo-acto {
    font-family: 'Courier New', Courier, monospace;
    font-weight: 700;
}

.guia-col-fecha {
    width: 80px;
    max-width: 80px;
    font-size: 11px;
    line-height: 1.35;
    white-space: normal;
}

.guia-col-tramitacion {
    width: 112px;
    max-width: 112px;
    vertical-align: middle;
}

.guia-plazo-stamp {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.3;
    white-space: nowrap;
}

.stamp-box-vulneracion {
    background: #fef2f2;
    border: 1px solid #fca5a5;
    border-left-width: 4px;
    border-left-color: #991b1b;
}

.guia-plazo-stamp--rojo {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

.stamp-box-activo {
    border-left-color: #d97706 !important;
    background: #fef3cd !important;
}

.stamp-box-acto-activo {
    border-left-color: #1a3a5c !important;
    background: #D8E7F3 !important;
}

.stamp-box-activo .estampa-badge-responsable {
    color: #856404 !important;
    border-color: #d97706 !important;
}

.tramitacion-banner.stamp-box-acto-activo {
    color: #1a3a5c;
}

.tramitacion-banner.stamp-box-acto-activo > div > div:first-child {
    color: #5a6a7a;
}

.tramitacion-banner.stamp-box-acto-activo [style*="font-weight:700"] {
    color: #1a3a5c;
}

.nav-sep {
    width: 1px;
    height: 1.2rem;
    background: #c5ced8;
    margin: 0 0.2rem;
}

.menu-global a.btn-logout {
    text-decoration: none;
    background: transparent;
    border: none;
    color: #8b2020;
    border-radius: 4px;
    font-size: 0.78rem;
    padding: 0.3rem 0.4rem;
    font-weight: 500;
    white-space: nowrap;
}

.menu-global a.btn-logout:hover {
    background: transparent;
    color: #5c1010;
    text-decoration: underline;
}

.menu-global a.btn-login {
    text-decoration: none;
    color: #1a3a5c;
    border: 1px solid #7a9cbe;
    background: #eaf1fb;
    border-radius: 4px;
    font-size: 0.73rem;
    padding: 0.2rem 0.6rem;
    font-weight: 600;
    white-space: nowrap;
}

.menu-global a.btn-login:hover {
    background: #1a3a5c;
    border-color: #1a3a5c;
    color: white;
}

.menu-global a {
    text-decoration: none;
    color: #1a3a5c;
    border: 1px solid #1a3a5c;
    background: white;
    border-radius: 4px;
    font-size: 0.73rem;
    padding: 0.2rem 0.5rem;
    font-weight: 600;
}

.menu-global a:hover {
    background: #1a3a5c;
    color: white;
}

.header-institucional {
    max-width: 960px;
    margin: 0 auto;
    padding: 0.8rem 1.5rem;
}

.header-logos {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
}

.logo-fechida {
    height: 52px;
    width: auto;
    object-fit: contain;
    margin: 0 0.5rem;
}

.logo-entidad {
    height: 38px;
    width: auto;
    object-fit: contain;
    opacity: 0.85;
    transition: opacity 0.2s;
}

.logo-entidad:hover {
    opacity: 1;
}

.header-bar {
    background: #1a3a5c;
    color: white;
    text-align: center;
    padding: 0.7rem 2rem;
}

.header-title {
    display: block;
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.header-subtitle {
    display: block;
    font-size: 0.75rem;
    font-weight: 300;
    opacity: 0.8;
    margin-top: 0.15rem;
}

/* ================================================================
   MAIN CONTENT
   ================================================================ */

main {
    max-width: 860px;
    margin: 0 auto;
    padding: 2rem;
    flex: 1;
    width: 100%;
}

.container {
    width: 100%;
}

/* ================================================================
   CARD — contenedor principal
   ================================================================ */

.card {
    background: white;
    border-radius: 6px;
    padding: 2.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 0 0 1px rgba(0,0,0,0.04);
}

h1 {
    font-size: 1.4rem;
    color: #1a3a5c;
    margin-bottom: 0.3rem;
    font-weight: 700;
}

h2 {
    font-size: 1.05rem;
    color: #5a6a7a;
    font-weight: 400;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e8eaed;
}

h3 {
    font-size: 0.95rem;
    color: #1a3a5c;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.subtitle {
    color: #5a6a7a;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e8eaed;
}

/* ================================================================
   INFO BOX — bloques informativos
   ================================================================ */

.info-box {
    background: #f8f9fb;
    border-left: 3px solid #1a3a5c;
    padding: 1rem 1.2rem;
    margin: 1rem 0;
    border-radius: 0 4px 4px 0;
    font-size: 0.92rem;
}

.info-box.warning {
    background: #fef9ec;
    border-left-color: #c9920e;
}

.info-box.reserva {
    background: #f0f4f8;
    border-left-color: #2d5f8a;
}

.info-box p {
    margin-bottom: 0.5rem;
}

.info-box p:last-child {
    margin-bottom: 0;
}

.info-box ul {
    margin-left: 1.2rem;
    margin-top: 0.4rem;
}

.info-box li {
    margin-bottom: 0.25rem;
}

/* ================================================================
   BUTTONS
   ================================================================ */

.btn {
    display: inline-block;
    padding: 0.75rem 2rem;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
    text-align: center;
}

.btn-primary {
    background: #1a3a5c;
    color: white;
}

.btn-primary:hover {
    background: #24506e;
    box-shadow: 0 2px 8px rgba(26,58,92,0.25);
}

.btn-secondary {
    background: white;
    color: #1a3a5c;
    border: 1px solid #1a3a5c;
}

.btn-secondary:hover {
    background: #f0f4f8;
}

.btn-lg {
    padding: 1rem 3rem;
    font-size: 1.05rem;
    width: 100%;
    margin-top: 1.5rem;
}

/* ================================================================
   FORMS
   ================================================================ */

fieldset {
    border: 1px solid #dde1e6;
    border-radius: 6px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    background: #fafbfc;
}

legend {
    font-weight: 700;
    font-size: 0.95rem;
    color: #1a3a5c;
    padding: 0 0.6rem;
    background: white;
    border-radius: 3px;
}

.form-group {
    margin-bottom: 1.2rem;
}

.form-group > label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.35rem;
    font-size: 0.88rem;
    color: #2a3a4a;
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group input[type="email"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.6rem 0.8rem;
    border: 1px solid #c4cad0;
    border-radius: 4px;
    font-size: 0.92rem;
    font-family: inherit;
    background: white;
    color: #1a1a2e;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group textarea {
    resize: vertical;
    line-height: 1.5;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #1a3a5c;
    box-shadow: 0 0 0 3px rgba(26,58,92,0.1);
}

.form-group small {
    display: block;
    color: #7a8a9a;
    font-size: 0.78rem;
    margin-top: 0.3rem;
}

.form-group input[type="file"] {
    padding: 0.5rem;
    font-size: 0.88rem;
    border: 1px dashed #c4cad0;
    border-radius: 4px;
    background: white;
    width: 100%;
    cursor: pointer;
}

/* Radio y checkbox */
.radio-group,
.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.2rem;
}

.radio-group label,
.checkbox-group label {
    font-weight: 400;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.9rem;
    color: #2a3a4a;
    padding: 0.3rem 0;
}

.radio-group input,
.checkbox-group input {
    width: auto;
    accent-color: #1a3a5c;
}

.confirmacion label {
    font-size: 0.88rem;
    line-height: 1.5;
    align-items: flex-start;
    padding: 0.5rem 0.8rem;
    background: #f8f9fb;
    border-radius: 4px;
    border: 1px solid #e8eaed;
}

.confirmacion input {
    margin-top: 0.25rem;
    flex-shrink: 0;
}

/* ================================================================
   CONFIRMACION DE DENUNCIA
   ================================================================ */

.confirmacion-card {
    text-align: center;
}

.confirmacion-card h1 {
    font-size: 1.5rem;
}

.confirmacion-card .info-box {
    text-align: left;
}

.confirmacion-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #1a3a5c;
    color: white;
    font-size: 1.8rem;
    line-height: 60px;
    margin: 0 auto 1rem;
}

.caso-numero {
    font-family: 'Courier New', Courier, monospace;
    font-size: 1.3rem;
    font-weight: 700;
    color: #1a3a5c;
    background: #f0f4f8;
    padding: 0.8rem 1.5rem;
    border-radius: 4px;
    display: inline-block;
    margin: 1rem 0 1.5rem;
    letter-spacing: 0.05em;
    border: 1px solid #d0d8e0;
}

.tag {
    display: inline-block;
    background: #e8eef4;
    color: #1a3a5c;
    padding: 0.15rem 0.6rem;
    border-radius: 3px;
    font-size: 0.82rem;
    font-weight: 600;
    margin: 0.1rem 0.2rem;
}

.nna-alerta {
    color: #8a4500;
    margin-top: 0.5rem;
}

/* ================================================================
   VISTA DE CASO — HEADER
   ================================================================ */

.caso-header-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.caso-numero-grande {
    font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
    font-size: 1.4rem;
    font-weight: 700;
    color: #1a3a5c;
    letter-spacing: 0.03em;
}

.caso-fecha {
    font-size: 0.85rem;
    color: #5a6a7a;
    margin-top: 0.2rem;
}

.caso-estado {
    font-size: 0.8rem;
    font-weight: 700;
    padding: 0.35rem 0.9rem;
    border-radius: 4px;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

.estado-ingresado {
    background: #e8eef4;
    color: #1a3a5c;
}

.estado-en_proceso {
    background: #fef3cd;
    color: #856404;
}

.estado-resuelto {
    background: #d4edda;
    color: #155724;
}

.estado-cerrado {
    background: #e2e3e5;
    color: #383d41;
}

.caso-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid #e8eaed;
}

.caso-tags {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.tag-nna {
    background: #fef3cd;
    color: #856404;
    font-weight: 700;
}

.tag-identidad {
    background: #e0e7ff;
    color: #3730a3;
    font-weight: 700;
}

.btn-sm {
    padding: 0.4rem 1rem;
    font-size: 0.82rem;
}

/* ================================================================
   TIMELINE
   ================================================================ */

.timeline-titulo {
    border-bottom: none;
    margin-bottom: 0.5rem;
    padding-bottom: 0.5rem;
}

.timeline-fase {
    margin-bottom: 0.5rem;
    padding: 1rem 0;
    border-bottom: 1px solid #e8eaed;
}

.timeline-fase:last-child {
    border-bottom: none;
}

.fase-header h3 {
    font-size: 0.82rem;
    font-weight: 700;
    color: #1a3a5c;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin-bottom: 0.6rem;
}

.timeline-subfase .fase-header h3 {
    color: #5a6a7a;
}

.timeline-inactiva {
    opacity: 0.4;
    pointer-events: none;
}

.timeline-item {
    display: flex;
    align-items: flex-start;
    gap: 0.7rem;
    padding: 0.5rem 0.5rem;
    border-radius: 4px;
    margin-bottom: 0.15rem;
    transition: background 0.15s;
}

.timeline-item:hover {
    background: #f8f9fb;
}

.item-check {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.check-done {
    color: #28a745;
    font-size: 1.1rem;
    font-weight: 700;
}

.check-pending {
    color: #c4cad0;
    font-size: 1.2rem;
}

.item-completado .item-texto {
    color: #5a6a7a;
    text-decoration: line-through;
    text-decoration-color: #c4cad0;
}

.item-contenido {
    flex: 1;
    min-width: 0;
}

.item-texto {
    font-size: 0.9rem;
    color: #1a1a2e;
    line-height: 1.4;
}

.item-meta {
    font-size: 0.75rem;
    color: #7a8a9a;
    margin-top: 0.15rem;
}

.item-plazo {
    font-size: 0.78rem;
    color: #5a6a7a;
    margin-top: 0.2rem;
    padding: 0.2rem 0.5rem;
    background: #f0f4f8;
    border-radius: 3px;
    display: inline-block;
}

.plazo-urgente {
    background: #fef3cd;
    color: #856404;
    font-weight: 600;
}

.plazo-vencido {
    background: #f8d7da;
    color: #721c24;
    font-weight: 700;
}

.item-vencido {
    background: #fff5f5;
}

.item-accion {
    flex-shrink: 0;
}

.btn-marcar {
    padding: 0.3rem 0.8rem;
    font-size: 0.78rem;
    background: white;
    color: #1a3a5c;
    border: 1px solid #1a3a5c;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.15s;
}

.btn-marcar:hover {
    background: #1a3a5c;
    color: white;
}

/* ================================================================
   DETERMINACIÓN
   ================================================================ */

.determinacion-box {
    background: #f8f9fb;
    border: 2px solid #1a3a5c;
    border-radius: 6px;
    padding: 1.2rem;
    margin: 1rem 0.5rem 0.5rem;
}

.determinacion-box h4 {
    font-size: 0.9rem;
    color: #1a3a5c;
    margin-bottom: 0.3rem;
}

.determinacion-box p {
    font-size: 0.85rem;
    color: #5a6a7a;
    margin-bottom: 1rem;
}

.determinacion-form {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.btn-determinacion {
    padding: 0.7rem 1rem;
    font-size: 0.85rem;
    font-weight: 600;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    text-align: left;
    transition: all 0.15s;
}

.btn-delito {
    background: #dc3545;
    color: white;
}

.btn-delito:hover {
    background: #c82333;
}

.btn-no-delito {
    background: #ffc107;
    color: #1a1a2e;
}

.btn-no-delito:hover {
    background: #e0a800;
}

.btn-desestimar {
    background: #e2e3e5;
    color: #383d41;
}

.btn-desestimar:hover {
    background: #d6d8db;
}

.determinacion-resultado {
    padding: 0.5rem;
    margin-top: 0.5rem;
}

.det-tag {
    display: inline-block;
    padding: 0.4rem 1rem;
    border-radius: 4px;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.03em;
}

.det-delito {
    background: #f8d7da;
    color: #721c24;
}

.det-no-delito {
    background: #fef3cd;
    color: #856404;
}

.det-desestimada {
    background: #e2e3e5;
    color: #383d41;
}

/* ================================================================
   PANEL DE LISTADO DE CASOS
   ================================================================ */

.listado-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.listado-header h1 {
    margin-bottom: 0;
}

.listado-total {
    font-size: 0.85rem;
    color: #5a6a7a;
    background: #f0f4f8;
    padding: 0.3rem 0.8rem;
    border-radius: 12px;
}

.tabla-responsive {
    overflow-x: auto;
}

.tabla-casos {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
}

.tabla-casos thead th {
    background: #1a3a5c;
    color: white;
    padding: 0.6rem 0.5rem;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    white-space: nowrap;
}

.tabla-casos tbody tr {
    border-bottom: 1px solid #f0f2f5;
    transition: background 0.1s;
}

.tabla-casos tbody tr:hover {
    background: #f8f9fb;
}

.tabla-casos td {
    padding: 0.7rem 0.5rem;
    vertical-align: top;
}

.fila-resuelta {
    opacity: 0.6;
}

.col-id {
    font-family: 'Courier New', Courier, monospace;
    font-weight: 700;
    font-size: 0.78rem;
    color: #1a3a5c;
    white-space: nowrap;
}

/* N14 · Responsable por acto en timeline (C-04 del walkthrough) */
.item-responsable {
    display: inline-block;
    margin-left: 8px;
    padding: 1px 7px;
    font-size: 0.65rem;
    font-family: 'Courier New', Courier, monospace;
    font-weight: 700;
    letter-spacing: 0.5px;
    border-radius: 3px;
    vertical-align: middle;
    text-transform: uppercase;
}
.responsable-ri          { background: #e8eef4; color: #1a3a5c; border: 1px solid #1a3a5c; }
.responsable-tdh         { background: #fef9ec; color: #5a4a2a; border: 1px solid #c9920e; }
.responsable-directorio  { background: #f0f0f0; color: #555;    border: 1px solid #888; }
.responsable-denunciante { background: #e8f4ea; color: #1e5a2a; border: 1px solid #28a745; }
.responsable-denunciado  { background: #fdecea; color: #7a1f15; border: 1px solid #e74c3c; }
.responsable-sistema     { background: #f5f5f5; color: #666;    border: 1px solid #aaa; font-style: italic; }

/* N11 · ID del caso como link (P-04 del walkthrough) */
.id-link {
    color: #1a3a5c;
    text-decoration: none;
    font-weight: 700;
    border-bottom: 1px dashed #1a3a5c;
    padding-bottom: 1px;
    transition: border-color 0.15s, color 0.15s;
}
.id-link:hover,
.id-link:focus {
    color: #0d2238;
    border-bottom-color: #0d2238;
    border-bottom-style: solid;
}

.col-fecha {
    white-space: nowrap;
    font-size: 0.8rem;
}

.texto-secundario {
    color: #7a8a9a;
    font-size: 0.75rem;
}

.tag-sm {
    font-size: 0.7rem;
    padding: 0.1rem 0.4rem;
}

.col-tramitacion {
    min-width: 140px;
}

.tramitacion-items {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.tram-item {
    font-size: 0.75rem;
    white-space: nowrap;
}

.tram-ok {
    color: #28a745;
}

.tram-pendiente {
    color: #c4cad0;
}

.tram-det {
    color: #1a3a5c;
    font-weight: 600;
}

.col-plazos {
    min-width: 150px;
}

.plazo-item {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    font-size: 0.75rem;
    padding: 0.5rem 0.7rem;
    margin: 0.2rem 0;
    border-radius: 8px;
    background: #fde8e8;
    color: #991b1b;
}

.plazo-item.plazo-urgente {
    background: #dc3545;
    color: white;
    font-weight: 700;
}

.plazo-item.plazo-vencido {
    background: #7f1d1d;
    color: white;
    font-weight: 700;
    animation: pulso 1.5s ease-in-out infinite;
}

/* Plazo DE PARTE vencido: no es alarma institucional (precluye un derecho de la
   parte) sino aviso para llevar el expediente al despacho. Informativo, gris. */
.plazo-item.plazo-departe {
    background: #e9ecef;
    color: #495057;
    border-left: 3px solid #6c757d;
    font-weight: 600;
}

@keyframes pulso {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.plazo-header {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.plazo-icono {
    font-size: 0.8rem;
}

.plazo-texto {
    font-family: 'Courier New', Courier, monospace;
    font-weight: 700;
    font-size: 0.78rem;
}

.plazo-items {
    margin: 0;
    padding-left: 1.1rem;
    font-size: 0.68rem;
    opacity: 0.85;
    list-style: disc;
}

.plazo-items li {
    margin: 0.1rem 0;
    line-height: 1.4;
}

.col-accion {
    white-space: nowrap;
    text-align: center;
}

/* ================================================================
   SEGUIMIENTO DENUNCIANTE
   ================================================================ */

.seguimiento-form {
    margin: 1.5rem 0;
}

.seguimiento-input-row {
    display: flex;
    gap: 0.5rem;
}

.seguimiento-input-row input {
    flex: 1;
    font-family: 'Courier New', Courier, monospace;
    font-size: 1rem;
    letter-spacing: 0.03em;
}

.seguimiento-resultado {
    margin-top: 1.5rem;
}

.seguimiento-caso-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.seguimiento-datos {
    width: 100%;
    font-size: 0.9rem;
}

.seguimiento-datos td {
    padding: 0.4rem 0;
    vertical-align: top;
}

.seguimiento-datos td:first-child {
    width: 160px;
    white-space: nowrap;
}

/* ================================================================
   EXPEDIENTE DIGITAL
   ================================================================ */

.exp-seccion-titulo {
    font-size: 0.9rem;
    color: #1a3a5c;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.8rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e8eaed;
}

.exp-archivo {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem 0.5rem;
    border-bottom: 1px solid #f0f2f5;
}

.exp-archivo:last-of-type {
    border-bottom: none;
}

.exp-archivo-info {
    display: flex;
    align-items: center;
    gap: 0.7rem;
}

.exp-icono {
    font-size: 1.3rem;
}

.exp-nombre {
    font-size: 0.88rem;
    font-weight: 600;
    color: #1a1a2e;
}

.exp-meta {
    font-size: 0.75rem;
    color: #7a8a9a;
}

.exp-vacio {
    font-size: 0.85rem;
    color: #a0aab4;
    font-style: italic;
    padding: 0.5rem 0;
}

.exp-subir {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e8eaed;
}

.exp-subir-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: #2a3a4a;
    margin-bottom: 0.4rem;
}

.exp-subir-row {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.exp-subir-row input[type="file"] {
    flex: 1;
    font-size: 0.85rem;
}

.caso-acciones {
    display: flex;
    gap: 0.5rem;
}

/* ================================================================
   FOOTER INSTITUCIONAL
   ================================================================ */

footer {
    background: white;
    border-top: 3px solid #1a3a5c;
    margin-top: auto;
}

.footer-institucional {
    max-width: 860px;
    margin: 0 auto;
    padding: 1.5rem 2rem;
}

.footer-org {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e8eaed;
}

.logo-footer {
    height: 50px;
    width: auto;
    object-fit: contain;
    flex-shrink: 0;
}

.footer-datos {
    display: flex;
    flex-direction: column;
    font-size: 0.82rem;
    color: #4a5a6a;
    line-height: 1.5;
}

.footer-datos strong {
    color: #1a3a5c;
    font-size: 0.88rem;
}

.footer-datos a {
    color: #1a3a5c;
    text-decoration: none;
}

.footer-datos a:hover {
    text-decoration: underline;
}

.footer-legal {
    font-size: 0.78rem;
    color: #7a8a9a;
    line-height: 1.5;
}

.footer-legal p {
    margin-bottom: 0.3rem;
}

.footer-operado {
    font-size: 0.72rem;
    color: #a0aab4;
    margin-top: 0.5rem;
}

/* Política institucional — normativa */
.normativa-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.normativa-list li {
    padding: 0.55rem 0;
    border-bottom: 1px solid #e5e9ee;
    line-height: 1.5;
}
.normativa-list li:last-child {
    border-bottom: none;
}
.normativa-list a {
    font-size: 0.82rem;
    color: #1a3a5c;
    text-decoration: none;
}
.normativa-list a:hover {
    text-decoration: underline;
}
.doc-list li {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}
.doc-link {
    flex: 0 0 auto;
    font-size: 0.80rem;
    font-weight: 600;
    color: #1a3a5c !important;
    white-space: nowrap;
}

/* ================================================================
   RESPONSIVE
   ================================================================ */

@media (max-width: 600px) {
    main {
        padding: 1rem;
    }

    .card {
        padding: 1.5rem;
    }

    fieldset {
        padding: 1rem;
    }

    .header-logos {
        gap: 0.8rem;
        flex-wrap: wrap;
    }

    .logo-entidad {
        height: 26px;
    }

    .logo-fechida {
        height: 38px;
    }

    .footer-org {
        flex-direction: column;
        text-align: center;
    }

    .footer-datos {
        align-items: center;
    }

    .header-institucional {
        padding: 0.8rem 1rem;
    }

    .btn-lg {
        padding: 0.9rem 2rem;
    }
}

/* ================================================================
   EXPEDIENTE DIGITAL — Jerarquía visual por tipo de folio
   ================================================================ */

.expediente-folios-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    min-width: 720px;
}

.expediente-folios-table thead tr {
    background: #f0f4f8;
    color: #1a3a5c;
    border-bottom: 2px solid #1a3a5c;
}

.expediente-folios-table th {
    padding: 10px 8px;
    text-align: left;
}

.expediente-folios-table th:first-child {
    text-align: center;
    width: 56px;
}

.folio-row {
    border-bottom: 1px solid #e5e7eb;
}

.folio-row:nth-child(odd) {
    background: #fafbfc;
}

.folio-row td {
    padding: 10px 8px;
    vertical-align: top;
}

.folio-numero {
    text-align: center;
    font-family: 'Courier New', monospace;
    color: #1a3a5c;
}

.folio-col-fecha {
    width: 88px;
}

.folio-col-tipo {
    width: 100px;
}

.folio-col-acto,
.folio-col-registro {
    width: 1%;
    white-space: nowrap;
    vertical-align: top;
}

.expediente-folios-table th.folio-col-acto,
.expediente-folios-table th.folio-col-registro {
    font-size: 11px;
    line-height: 1.25;
    vertical-align: bottom;
}

.folio-fecha {
    font-size: 12px;
    color: #374151;
    line-height: 1.35;
    font-family: 'Courier New', Courier, monospace;
}

.folio-reservado {
    font-size: 11px;
    color: #b45309;
    font-weight: 600;
}

/* ── Centro de acciones del administrador ── */
.centro-acciones { position: fixed; bottom: 22px; right: 22px; z-index: 900; }

.ca-fab {
    display: flex; align-items: center; gap: 8px;
    background: #1a3a5c; color: #fff; border: none; cursor: pointer;
    border-radius: 28px; padding: 12px 20px; font-size: 14px; font-weight: 700;
    box-shadow: 0 6px 20px rgba(0,0,0,.28); letter-spacing: .02em;
}
.ca-fab:hover { background: #16314e; }
.ca-fab-icon { font-size: 18px; line-height: 1; }

.ca-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 899; }

.ca-panel {
    position: absolute; bottom: 64px; right: 0; width: 280px;
    background: #fff; border: 1px solid #e5e7eb; border-radius: 8px;
    box-shadow: 0 10px 36px rgba(0,0,0,.22); overflow: hidden;
}
.ca-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 16px; background: #1a3a5c; color: #fff;
    font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
}
.ca-close { background: none; border: none; color: #fff; font-size: 16px; cursor: pointer; line-height: 1; }
.ca-body { max-height: 60vh; overflow-y: auto; padding: 8px 0; }
.ca-group { padding: 6px 0; border-bottom: 1px solid #f3f4f6; }
.ca-group:last-child { border-bottom: none; }
.ca-group-title {
    font-size: 10px; font-weight: 800; color: #1a3a5c;
    text-transform: uppercase; letter-spacing: .07em; padding: 8px 16px 2px;
}
.ca-item {
    display: flex; align-items: center; gap: 11px; width: 100%; text-align: left; box-sizing: border-box;
    background: #fff; cursor: pointer; text-decoration: none;
    margin: 6px 12px; padding: 10px 12px; font-size: 13px; color: #1f2937; font-weight: 600;
    width: calc(100% - 24px);
    border: 1px solid #e5e7eb; border-left: 3px solid #1a3a5c; border-radius: 6px;
    transition: transform .08s ease, box-shadow .12s ease, background .12s ease;
}
.ca-item:hover { background: #f7fafc; transform: translateX(2px); box-shadow: 0 2px 8px rgba(26,58,92,.12); }
.ca-item .ca-ic {
    flex: 0 0 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center;
    background: #eef2f7; border-radius: 50%; font-size: 14px;
}
.ca-badge {
    display: inline-block; min-width: 18px; padding: 0 5px; margin-left: 4px;
    background: #4338ca; color: #fff; border-radius: 9px; font-size: 11px; font-weight: 700; text-align: center;
}
.ca-item--danger { color: #991b1b; border-left-color: #991b1b; }
.ca-item--danger .ca-ic { background: #fde8e8; }
.ca-item--confid { color: #b45309; border-left-color: #b45309; }
.ca-item--confid .ca-ic { background: #fef3c7; }

/* Resaltado al saltar a los folios desde "Confidencialidad de folios" */
.ca-flash-target { animation: caFlash 1.6s ease; }
@keyframes caFlash {
    0%, 100% { box-shadow: none; }
    20%, 60% { box-shadow: 0 0 0 3px rgba(180,83,9,.45); }
}

/* Móvil: el FAB se vuelve redondo y el panel una hoja inferior a pantalla completa */
@media (max-width: 768px) {
    .centro-acciones { bottom: 16px; right: 16px; }
    .ca-fab { border-radius: 50%; width: 56px; height: 56px; justify-content: center; padding: 0; }
    .ca-fab-text { display: none; }
    .ca-panel {
        position: fixed; bottom: 0; left: 0; right: 0; width: 100%;
        border-radius: 14px 14px 0 0; max-height: 78vh; z-index: 1001;
    }
    .ca-body { max-height: calc(78vh - 48px); }
    .ca-item { padding: 14px 18px; font-size: 15px; }
}

.estampa-reserva {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    border: 1.5px solid;
}

.estampa-reserva--fiscal {
    background: #fef3c7;
    color: #92400e;
    border-color: #b45309;
}

.estampa-reserva--identidad {
    background: #e0e7ff;
    color: #3730a3;
    border-color: #4338ca;
}

/* Folio confidencial: el botón de abrir SIGUE diciendo "Acto PDF" (misma acción),
   pero en rojo y con candado 🔒 dentro del stamp. El candado solo aparece cuando
   el folio fue decretado confidencial. La gestión se hace en el modal. */
.folio-adjunto-btn--confidencial,
.expediente-folios-table a.folio-adjunto-btn--confidencial {
    background: #fbdada !important;
    border: 1px solid #d98a8a !important;
    color: #b02525 !important;
    font-weight: 700 !important;
}
.folio-adjunto-btn--confidencial:hover,
.expediente-folios-table a.folio-adjunto-btn--confidencial:hover { background: #f8c9c9 !important; }
.folio-reservado--confidencial { color: #c0392b; }

/* ── Tramitación: 5 pasos (redactar·validar·firmar·notificar·registrar) ── */
.tram-pasos { display: flex; flex-direction: column; gap: 3px; }
.tram-paso {
    display: flex; align-items: center; gap: 6px;
    font-size: 10.5px; font-weight: 600; color: #9ca3af; line-height: 1.2;
    white-space: nowrap;
}
.tram-paso-dot {
    display: inline-block; width: 9px; height: 9px; border-radius: 50%;
    background: #d1d5db; border: 1px solid #b0b6bf; flex: 0 0 auto;
}
.tram-paso--ok { color: #15803d; }
.tram-paso--ok .tram-paso-dot,
.tram-paso-dot--ok { background: #22c55e; border-color: #16a34a; }
.tram-no-aplicable { font-size: 11px; color: #9ca3af; font-style: italic; }

/* Tipo de acto: constancia / resolución */
.tram-tipo-stamp {
    display: inline-block; padding: 2px 8px; border-radius: 3px;
    font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em;
}
.tram-tipo-stamp--resolucion { background: #dbeafe; color: #1e40af; }
.tram-tipo-stamp--constancia { background: #f3f4f6; color: #4b5563; }

/* Emisión por catálogo (dropdowns Resoluciones / Constancias) */
.tram-emitir {
    display: flex; gap: 24px; flex-wrap: wrap; margin-bottom: 18px;
    padding: 14px 16px; background: #f8fafc; border: 1px solid #e5e7eb; border-radius: 6px;
}
.tram-emitir-grupo { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.tram-emitir-label {
    flex-basis: 100%; font-size: 11px; font-weight: 700; color: #1a3a5c;
    text-transform: uppercase; letter-spacing: .04em;
}
.tram-emitir-select {
    padding: 7px 8px; border: 1px solid #cbd5e1; border-radius: 4px;
    font-size: 12px; min-width: 240px; max-width: 360px; background: #fff;
}
.tram-emitir-select:disabled { background: #f3f4f6; color: #9ca3af; }

.folio-tipo {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.folio-asunto {
    color: #111827;
    line-height: 1.4;
    font-weight: 400;
}

/* Resolución — máxima jerarquía */
.folio-row--resolucion .folio-numero,
.folio-row--resolucion .folio-asunto,
.folio-row--resolucion .folio-tipo {
    font-weight: 700;
}

.folio-row--resolucion .folio-tipo {
    color: #1a3a5c;
}

.folio-row--resolucion:nth-child(odd) {
    background: #fff;
}

/* Constancia — peso normal */
.folio-row--constancia .folio-tipo {
    color: #6b7280;
    font-weight: 400;
}

.folio-row--constancia .folio-asunto {
    color: #374151;
}

.folio-constancia-solo {
    color: #6b7280;
    font-size: 11px;
    font-style: italic;
}

/* Escrito — normal, sin competir con resolución */
.folio-row--escrito .folio-tipo {
    color: #065f46;
    font-weight: 400;
}

.folio-row--escrito .folio-asunto {
    color: #374151;
}

/* Otro */
.folio-row--otro .folio-tipo {
    color: #6b7280;
    font-weight: 400;
}

/* Notificación — atenuada, tono azul claro */
.folio-row--notificacion {
    opacity: 0.82;
    background: #eef4fb !important;
}

.folio-row--notificacion .folio-numero {
    font-weight: 400;
    color: #7a94b0;
}

.folio-row--notificacion .folio-fecha,
.folio-row--notificacion .folio-asunto {
    color: #64748b;
}

.folio-row--notificacion .folio-tipo {
    color: #5b7a99;
    font-weight: 400;
}

.folio-adjunto-vacio {
    color: #9ca3af;
    font-size: 12px;
}

.folio-col-acto .folio-adjunto-btn,
.folio-col-registro .folio-adjunto-btn {
    display: block;
    width: 100%;
    max-width: 11.5rem;
    margin-bottom: 4px;
    text-align: center;
}

.folio-col-acto .folio-adjunto-btn:last-child,
.folio-col-registro .folio-adjunto-btn:last-child {
    margin-bottom: 0;
}

.folio-adjunto-btn {
    font-size: 11px !important;
    padding: 4px 8px !important;
    line-height: 1.25 !important;
    white-space: normal;
}

/* "Acto PDF" (y "🔒 Acto PDF" confidencial) en una sola línea. El botón de
   registro va en otra columna, así que sigue pudiendo envolver. */
.folio-col-acto .folio-adjunto-btn {
    white-space: nowrap;
}

.folio-adjunto-btn--anexo {
    font-size: 10px !important;
}

.folio-adjunto-btn--registro {
    border-color: #93c5fd !important;
    color: #1e40af !important;
    background: #eff6ff !important;
    max-width: 13rem;
}
