/*
 * PQRS Almacén Madeira — capa de marca sobre Bootstrap 5.3.
 * Paleta: rojo Madeira #E3051A (acción en #C8102E para contraste AA) y tinta casi negra.
 * (Comentario original de la paleta abajo, con los valores ya cambiados.)
 *   azul «ciudadanía» #C8102E (acción principal), azul «Con» #E3051A,
 *   azul noche del lema #1F1A17 (texto), y los acentos del símbolo:
 *   naranja #ED8142, violeta #7056A0, verde #51B785, rosa #E86078.
 * Los acentos solo marcan estado (semáforo) y la franja de marca; nunca decoran.
 */

:root {
    --brand: #C8102E;
    --brand-hover: #9E0B22;
    --brand-soft: #FCEBED;
    --brand-sky: #E3051A;
    --ink: #1B2340;
    --ink-2: #4A5470;          /* texto secundario: 7.4:1 sobre blanco */
    --ink-3: #5B6479;          /* ayudas y metadatos: 5.9:1 sobre blanco */
    --night: #1F1A17;
    --surface: #FFFFFF;
    --canvas: #F4F6FA;
    --line: #DDE3EC;
    --line-strong: #C5CFDD;
    --orange: #ED8142;
    --violet: #7056A0;
    --green: #51B785;
    --pink: #E86078;

    /* Semáforo de vencimiento: tonos oscuros para texto (AA) y claros de fondo */
    --ok-ink: #1F6B47;   --ok-bg: #E5F5EC;
    --soon-ink: #8A4410; --soon-bg: #FDEBDD;
    --late-ink: #A0213A; --late-bg: #FBE3E8;

    --radius: 10px;
    --radius-sm: 6px;
    --shadow-1: 0 1px 2px rgba(27, 35, 64, .06), 0 2px 8px rgba(27, 35, 64, .05);

    /* Bootstrap */
    --bs-body-font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --bs-body-color: var(--ink);
    --bs-body-bg: var(--canvas);
    --bs-primary: #C8102E;
    --bs-primary-rgb: 200, 16, 46;
    --bs-link-color: #C8102E;
    --bs-link-color-rgb: 200, 16, 46;
    --bs-link-hover-color: #9E0B22;
    --bs-link-hover-color-rgb: 12, 63, 127;
    --bs-border-color: var(--line);
    --bs-border-radius: var(--radius-sm);
    --bs-secondary-color: var(--ink-3);
    --bs-emphasis-color: var(--ink);
    --bs-focus-ring-color: rgba(200, 16, 46, .35);
}

html { -webkit-text-size-adjust: 100%; }
body {
    font-family: var(--bs-body-font-family);
    color: var(--ink);
    background: var(--canvas);
    font-feature-settings: 'cv11', 'ss01';
    line-height: 1.55;
}
::selection { background: rgba(57, 129, 191, .25); color: var(--ink); }
a { text-underline-offset: .18em; }
h1, h2, h3, h4 { color: var(--ink); letter-spacing: -0.01em; text-wrap: balance; }
h1, .h1 { font-size: 1.75rem; font-weight: 700; }
h2, .h2 { font-size: 1.25rem; font-weight: 650; }
h3, .h3 { font-size: 1.0625rem; font-weight: 650; }
.text-body-secondary { color: var(--ink-3) !important; }
.tabular { font-variant-numeric: tabular-nums; }
.measure { max-width: 68ch; }

/* Foco visible y consistente */
:focus-visible { outline: 3px solid rgba(200, 16, 46, .45); outline-offset: 2px; }
.form-control:focus, .form-select:focus, .form-check-input:focus, .btn:focus-visible {
    border-color: var(--brand);
    box-shadow: 0 0 0 .2rem rgba(200, 16, 46, .2);
    outline: none;
}

/* Saltar al contenido */
.skip-link { position: absolute; left: -9999px; top: 0; z-index: 2000; }
.skip-link:focus { left: 1rem; top: 1rem; background: var(--surface); padding: .5rem 1rem; border-radius: var(--radius-sm); box-shadow: var(--shadow-1); }

/* Franja de marca: los cuatro colores del símbolo, cortes nítidos */
.brand-strip {
    height: 4px;
    background: var(--brand-sky);
}

/* ---------- Botones ---------- */
.btn { font-weight: 600; border-radius: var(--radius-sm); padding: .625rem 1.125rem; transition: background-color .15s ease, border-color .15s ease, color .15s ease; }
.btn-lg { padding: .75rem 1.5rem; font-size: 1.0625rem; }
.btn-sm { padding: .375rem .75rem; font-size: .875rem; }
.btn-primary {
    --bs-btn-bg: var(--brand); --bs-btn-border-color: var(--brand);
    --bs-btn-hover-bg: var(--brand-hover); --bs-btn-hover-border-color: var(--brand-hover);
    --bs-btn-active-bg: #0A3468; --bs-btn-active-border-color: #0A3468;
    --bs-btn-disabled-bg: var(--brand); --bs-btn-disabled-border-color: var(--brand);
}
.btn-outline-primary {
    --bs-btn-color: var(--brand); --bs-btn-border-color: var(--line-strong);
    --bs-btn-hover-bg: var(--brand-soft); --bs-btn-hover-color: var(--brand-hover); --bs-btn-hover-border-color: var(--brand);
    --bs-btn-active-bg: var(--brand-soft); --bs-btn-active-color: var(--brand-hover); --bs-btn-active-border-color: var(--brand);
}
.btn-quiet { color: var(--ink-2); background: transparent; border: 1px solid transparent; }
.btn-quiet:hover { color: var(--brand); background: var(--brand-soft); }
.btn-danger-quiet { color: var(--late-ink); background: transparent; border: 1px solid var(--line); }
.btn-danger-quiet:hover { background: var(--late-bg); border-color: var(--late-ink); color: var(--late-ink); }
.btn .bi { font-size: 1em; vertical-align: -.1em; }
.btn[aria-busy="true"] { pointer-events: none; opacity: .85; }

/* ---------- Formularios ---------- */
.form-label { font-weight: 600; color: var(--ink); margin-bottom: .375rem; }
.form-text { color: var(--ink-3); font-size: .875rem; }
.form-control, .form-select { border-color: var(--line-strong); border-radius: var(--radius-sm); padding: .625rem .875rem; font-size: 1rem; }
.form-control::placeholder { color: #7A8296; }
.form-control.is-invalid, .form-select.is-invalid { border-color: var(--late-ink); }
.invalid-feedback { color: var(--late-ink); font-weight: 500; }
.required-mark { color: var(--late-ink); }
.optional-mark { color: var(--ink-3); font-weight: 400; font-size: .875rem; }

/* Campo trampa antispam: fuera de pantalla, no se muestra a personas */
.hp-field { position: absolute !important; left: -10000px !important; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Alertas ---------- */
.alert { border-radius: var(--radius-sm); border: 1px solid transparent; padding: .875rem 1rem; }
.alert .bi { flex-shrink: 0; margin-top: .15rem; }
.alert-success { background: var(--ok-bg); color: var(--ok-ink); border-color: #BFE3CE; }
.alert-warning { background: var(--soon-bg); color: var(--soon-ink); border-color: #F6CBA9; }
.alert-danger { background: var(--late-bg); color: var(--late-ink); border-color: #F2B8C4; }
.alert-info { background: var(--brand-soft); color: var(--night); border-color: #F4C7CD; }

/* ---------- Superficies ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-1); }
.panel-body { padding: 1.25rem; }
@media (min-width: 768px) { .panel-body { padding: 1.75rem; } }
.panel-title { font-size: 1.0625rem; font-weight: 650; margin: 0 0 1rem; }

/* ---------- Encabezado y pie públicos ---------- */
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); }
.site-header .container { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 72px; }
.site-brand { display: flex; align-items: center; gap: .875rem; text-decoration: none; color: var(--ink); }
.site-brand img { height: 36px; width: auto; }
.site-brand .site-name { border-left: 1px solid var(--line-strong); padding-left: .875rem; font-weight: 650; font-size: .9375rem; color: var(--night); line-height: 1.2; }
.site-nav { display: flex; gap: .25rem; }
.site-nav a { color: var(--ink-2); text-decoration: none; font-weight: 600; font-size: .9375rem; padding: .5rem .75rem; border-radius: var(--radius-sm); }
.site-nav a:hover { color: var(--brand); background: var(--brand-soft); }
.site-nav a[aria-current="page"] { color: var(--brand); box-shadow: inset 0 -2px 0 var(--brand); border-radius: 0; }
@media (max-width: 575.98px) {
    .site-brand img { height: 30px; }
    .site-brand .site-name { display: none; }
    .site-nav a { padding: .5rem .5rem; font-size: .875rem; }
}
.site-main { flex: 1 0 auto; padding: 2rem 0 3rem; }
@media (min-width: 768px) { .site-main { padding: 3rem 0 4rem; } }
.site-footer { background: var(--night); color: #FFFFFF; font-size: .875rem; }
.site-footer a { color: #FFFFFF; }
.site-footer .container { padding-top: 2rem; padding-bottom: 2rem; }
.site-footer dt { color: #D9D2CC; font-weight: 500; font-size: .8125rem; }
.site-footer dd { margin-bottom: .75rem; }

/* ---------- Inicio público ---------- */
.home-lead { font-size: 1.125rem; color: var(--ink-2); max-width: 56ch; }
.home-actions { display: grid; gap: 1rem; }
@media (min-width: 768px) { .home-actions { grid-template-columns: 3fr 2fr; } }
.action-primary { background: var(--brand); color: #fff; border-radius: var(--radius); padding: 1.5rem; text-decoration: none; display: flex; flex-direction: column; gap: .5rem; transition: background-color .15s ease; }
.action-primary:hover { background: var(--brand-hover); color: #fff; }
.action-primary h2 { color: #fff; margin: 0; font-size: 1.375rem; }
.action-primary p { color: #DCE7F6; margin: 0; }
.action-secondary { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.5rem; text-decoration: none; color: var(--ink); display: flex; flex-direction: column; gap: .5rem; transition: border-color .15s ease; }
.action-secondary:hover { border-color: var(--brand); color: var(--ink); }
.action-secondary h2 { margin: 0; font-size: 1.375rem; color: var(--brand); }
.action-secondary p { color: var(--ink-2); margin: 0; }
.action-go { margin-top: auto; padding-top: .75rem; font-weight: 600; display: inline-flex; align-items: center; gap: .375rem; }
.types-list { display: grid; gap: .25rem 2rem; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); padding: 0; list-style: none; margin: 0; }
.types-list li { display: flex; justify-content: space-between; gap: 1rem; padding: .625rem 0; border-bottom: 1px solid var(--line); }
.types-list .days { color: var(--ink-3); white-space: nowrap; font-size: .9375rem; }

/* ---------- Formulario de radicado ---------- */
.form-shell { max-width: 760px; margin: 0 auto; }
.step { border: 0; padding: 0; margin: 0 0 2.25rem; }
.step-legend { display: flex; align-items: center; gap: .75rem; font-size: 1.1875rem; font-weight: 650; margin-bottom: .375rem; float: none; width: auto; }
.step-num { display: inline-grid; place-items: center; width: 1.875rem; height: 1.875rem; border-radius: 50%; background: var(--brand); color: #fff; font-size: .9375rem; font-weight: 700; flex-shrink: 0; }
.step-hint { color: var(--ink-3); margin: 0 0 1rem 2.625rem; font-size: .9375rem; }
@media (max-width: 575.98px) { .step-hint { margin-left: 0; } }

.type-options { display: grid; gap: .625rem; }
@media (min-width: 640px) { .type-options { grid-template-columns: 1fr 1fr; } }
.type-option { position: relative; display: block; cursor: pointer; margin: 0; }
.type-option input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.type-option .type-card { display: block; height: 100%; background: var(--surface); border: 1.5px solid var(--line-strong); border-radius: var(--radius-sm); padding: .875rem 1rem .875rem 2.75rem; transition: border-color .15s ease, background-color .15s ease; }
.type-option .type-card::before { content: ''; position: absolute; left: 1rem; top: 1.0625rem; width: 1.125rem; height: 1.125rem; border-radius: 50%; border: 2px solid var(--line-strong); background: #fff; transition: border-color .15s ease, box-shadow .15s ease; }
.type-option:hover .type-card { border-color: var(--brand-sky); }
.type-option input:checked + .type-card { border-color: var(--brand); background: var(--brand-soft); }
.type-option input:checked + .type-card::before { border-color: var(--brand); box-shadow: inset 0 0 0 3.5px #fff; background: var(--brand); }
.type-option input:focus-visible + .type-card { outline: 3px solid rgba(200, 16, 46, .45); outline-offset: 2px; }
.type-name { display: block; font-weight: 650; color: var(--ink); }
.type-desc { display: block; color: var(--ink-2); font-size: .9063rem; margin-top: .125rem; }
.type-days { display: block; color: var(--ink-3); font-size: .8125rem; margin-top: .375rem; }
.type-options.is-invalid .type-card { border-color: var(--late-ink); }

.consent { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 1rem 1rem 1rem 2.75rem; }
.consent .form-check-input { margin-left: -1.75rem; width: 1.25rem; height: 1.25rem; margin-top: .125rem; }
.consent .form-check-input:checked { background-color: var(--brand); border-color: var(--brand); }
.consent details summary { color: var(--brand); cursor: pointer; font-weight: 500; margin-top: .5rem; }
.consent details p { font-size: .875rem; color: var(--ink-2); margin: .5rem 0 0; }

.submit-bar { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; justify-content: space-between; border-top: 1px solid var(--line); padding-top: 1.5rem; }
@media (max-width: 575.98px) { .submit-bar .btn-lg { width: 100%; } }

/* ---------- Constancia y consulta ---------- */
.receipt-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 1rem; }
.receipt-label { color: var(--ink-3); font-size: .875rem; font-weight: 500; margin: 0; }
.receipt-number { font-size: 2rem; font-weight: 750; letter-spacing: .02em; color: var(--night); font-variant-numeric: tabular-nums; line-height: 1.1; margin: .125rem 0 0; }
@media (min-width: 768px) { .receipt-number { font-size: 2.5rem; } }
.facts { display: grid; gap: 1rem 2rem; margin: 1.5rem 0 0; grid-template-columns: 1fr; }
@media (min-width: 576px) { .facts { grid-template-columns: 1fr 1fr; } }
.facts dt { color: var(--ink-3); font-size: .8125rem; font-weight: 500; margin: 0; }
.facts dd { margin: .125rem 0 0; font-weight: 600; color: var(--ink); }
.facts dd small { display: block; font-weight: 500; color: var(--ink-2); }
.created-banner { display: flex; gap: .875rem; align-items: flex-start; background: var(--ok-bg); color: var(--ok-ink); border-radius: var(--radius); padding: 1.125rem 1.25rem; margin-bottom: 1.5rem; }
.created-banner .bi { font-size: 1.5rem; line-height: 1; }
.created-banner h1 { color: var(--ok-ink); font-size: 1.25rem; margin: 0 0 .25rem; }
.created-banner p { margin: 0; color: #24553D; }

.quote { background: var(--canvas); border-radius: var(--radius-sm); padding: 1rem 1.125rem; white-space: normal; color: var(--ink); overflow-wrap: anywhere; }

/* ---------- Estados y semáforo ---------- */
.state-badge { display: inline-flex; align-items: center; gap: .4rem; font-weight: 600; font-size: .8125rem; color: var(--ink); background: var(--surface); border: 1px solid var(--line-strong); border-radius: 999px; padding: .1875rem .625rem; white-space: nowrap; }
.state-badge::before { content: ''; width: .5rem; height: .5rem; border-radius: 50%; background: var(--state-color, #6B7280); }
.deadline { display: inline-flex; align-items: center; gap: .375rem; font-size: .8125rem; font-weight: 600; border-radius: 999px; padding: .1875rem .625rem; white-space: nowrap; }
.deadline .bi { font-size: .75em; }
.deadline-on_time { color: var(--ok-ink); background: var(--ok-bg); }
.deadline-due_soon { color: var(--soon-ink); background: var(--soon-bg); }
.deadline-overdue { color: var(--late-ink); background: var(--late-bg); }

/* ---------- Línea de tiempo ---------- */
.timeline { list-style: none; padding: 0; margin: 0; position: relative; }
.timeline::before { content: ''; position: absolute; left: 15px; top: 8px; bottom: 8px; width: 2px; background: var(--line); }
.tl-item { position: relative; padding: 0 0 1.5rem 3rem; }
.tl-item:last-child { padding-bottom: 0; }
.tl-dot { position: absolute; left: 0; top: 0; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); border: 2px solid var(--line-strong); color: var(--ink-2); }
.tl-dot .bi { font-size: .9375rem; }
.tl-response .tl-dot { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); }
.tl-note .tl-dot { border-color: var(--violet); color: var(--violet); background: #F0ECF7; }
.tl-origin .tl-dot { border-color: var(--green); color: var(--ok-ink); background: var(--ok-bg); }
.tl-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: .25rem .75rem; }
.tl-kind { font-weight: 650; color: var(--ink); }
.tl-meta { color: var(--ink-3); font-size: .875rem; }
.tl-change { display: flex; flex-wrap: wrap; align-items: center; gap: .375rem; margin: .5rem 0 0; font-size: .875rem; color: var(--ink-2); }
.tl-body { margin-top: .625rem; }
.tl-note .tl-body .quote { background: #F5F2FA; }
.kind-tag { font-size: .75rem; font-weight: 600; border-radius: 4px; padding: .0625rem .4375rem; }
.kind-tag-note { color: #4F3A78; background: #ECE6F5; }
.kind-tag-response { color: var(--brand-hover); background: var(--brand-soft); }

.file-list { list-style: none; padding: 0; margin: .75rem 0 0; display: flex; flex-direction: column; gap: .375rem; }
.file-list a { display: inline-flex; align-items: center; gap: .5rem; text-decoration: none; font-weight: 500; overflow-wrap: anywhere; }
.file-list a:hover { text-decoration: underline; }
.file-list .file-meta { color: var(--ink-3); font-size: .8125rem; font-weight: 400; }

/* ---------- Panel interno ---------- */
.admin-body { min-height: 100vh; }
.admin-topbar { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 1020; }
.admin-topbar .inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 60px; padding: 0 1rem; }
.admin-topbar img { height: 30px; }
.admin-user { display: flex; align-items: center; gap: .75rem; font-size: .875rem; color: var(--ink-2); }
.admin-shell { display: flex; min-height: calc(100vh - 64px); }
.admin-nav { width: 232px; flex-shrink: 0; background: var(--surface); border-right: 1px solid var(--line); padding: 1.25rem .75rem; }
.admin-nav a { display: flex; align-items: center; gap: .75rem; color: var(--ink-2); text-decoration: none; font-weight: 550; padding: .625rem .75rem; border-radius: var(--radius-sm); margin-bottom: .125rem; }
.admin-nav a:hover { background: var(--canvas); color: var(--ink); }
.admin-nav a[aria-current="page"] { background: var(--brand-soft); color: var(--brand); }
.admin-nav .bi { font-size: 1.0625rem; }
.admin-main { flex: 1; min-width: 0; padding: 1.5rem 1rem 6rem; }
@media (min-width: 992px) { .admin-main { padding: 2rem 2.5rem 3rem; } }
.admin-tabbar { position: fixed; bottom: 0; left: 0; right: 0; z-index: 1030; background: var(--surface); border-top: 1px solid var(--line); display: flex; padding-bottom: env(safe-area-inset-bottom); }
.admin-tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: .125rem; padding: .5rem 0 .5rem; color: var(--ink-3); text-decoration: none; font-size: .75rem; font-weight: 600; }
.admin-tabbar a .bi { font-size: 1.25rem; }
.admin-tabbar a[aria-current="page"] { color: var(--brand); }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: .75rem 1rem; margin-bottom: 1.25rem; }
.page-head h1 { margin: 0; }
.page-sub { color: var(--ink-3); margin: .25rem 0 0; }
.back-link { display: inline-flex; align-items: center; gap: .375rem; color: var(--ink-2); text-decoration: none; font-weight: 500; font-size: .9375rem; margin-bottom: .75rem; }
.back-link:hover { color: var(--brand); }

/* Resumen de vencimientos: filtros rápidos */
.deadline-tabs { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1rem; }
.deadline-tab { display: inline-flex; align-items: center; gap: .5rem; padding: .4375rem .875rem; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink-2); text-decoration: none; font-weight: 600; font-size: .875rem; }
.deadline-tab .count { font-variant-numeric: tabular-nums; color: var(--ink); }
.deadline-tab:hover { border-color: var(--brand); color: var(--brand); }
.deadline-tab[aria-current="true"] { background: var(--night); border-color: var(--night); color: #fff; }
.deadline-tab[aria-current="true"] .count { color: #fff; }
.deadline-tab .dot { width: .5rem; height: .5rem; border-radius: 50%; }

.filters { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; margin-bottom: 1rem; }
.filters .search { position: relative; }
.filters .search .bi { position: absolute; left: .875rem; top: 50%; transform: translateY(-50%); color: var(--ink-3); pointer-events: none; }
.filters .search input { padding-left: 2.5rem; }
.filters .form-label { font-size: .8125rem; font-weight: 600; color: var(--ink-2); margin-bottom: .25rem; }
.filters .form-select, .filters .form-control { padding-top: .5rem; padding-bottom: .5rem; }
.filters-more summary { list-style: none; cursor: pointer; color: var(--brand); font-weight: 600; font-size: .9375rem; display: inline-flex; align-items: center; gap: .375rem; padding: .5rem 0; }
.filters-more summary::-webkit-details-marker { display: none; }
.results-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem 1rem; margin: 0 0 .75rem; color: var(--ink-2); font-size: .9375rem; }
.results-bar strong { color: var(--ink); font-variant-numeric: tabular-nums; }

.case-table { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.case-table th { font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-3); font-weight: 600; background: #F8F9FC; padding: .75rem 1rem; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
.case-table td { padding: .875rem 1rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.case-table tr:last-child td { border-bottom: 0; }
.case-table tbody tr { transition: background-color .12s ease; }
.case-table tbody tr:hover { background: #F8FAFD; }
.case-table .tn a { font-weight: 700; font-variant-numeric: tabular-nums; color: var(--brand); text-decoration: none; }
.case-table .tn a:hover { text-decoration: underline; }
.case-table .tn a::after { content: ''; position: absolute; inset: 0; }
.case-table tbody tr { position: relative; }
.case-who { font-weight: 600; color: var(--ink); }
.case-sub { color: var(--ink-3); font-size: .8125rem; }
@media (max-width: 767.98px) {
    .case-table, .case-table tbody, .case-table tr, .case-table td { display: block; width: 100%; }
    .case-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
    .case-table tr { padding: .875rem 1rem; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 1fr auto; gap: .25rem .75rem; }
    .case-table tr:last-child { border-bottom: 0; }
    .case-table td { padding: 0; border: 0; }
    .case-table td.cell-who { grid-column: 1 / -1; }
    .case-table td.cell-date { color: var(--ink-3); font-size: .8125rem; }
    .case-table td.cell-state { justify-self: start; }
    .case-table td.cell-date, .case-table td.cell-deadline { justify-self: end; text-align: right; }
    .case-table td.tn { grid-column: 1 / -1; }
}

.pagination { --bs-pagination-color: var(--brand); --bs-pagination-active-bg: var(--brand); --bs-pagination-active-border-color: var(--brand); --bs-pagination-border-color: var(--line); --bs-pagination-hover-bg: var(--brand-soft); --bs-pagination-focus-box-shadow: 0 0 0 .2rem rgba(200, 16, 46, .2); }
.pagination .page-link { font-variant-numeric: tabular-nums; }

.empty-state { text-align: center; padding: 3rem 1rem; background: var(--surface); border: 1px dashed var(--line-strong); border-radius: var(--radius); color: var(--ink-2); }
.empty-state .bi { font-size: 2rem; color: var(--ink-3); }
.empty-state h2 { font-size: 1.0625rem; margin: .75rem 0 .25rem; }

/* Ficha de gestión */
.case-grid { display: grid; gap: 1.25rem; }
@media (min-width: 1200px) { .case-grid { grid-template-columns: minmax(0, 1fr) 360px; align-items: start; } .case-aside { position: sticky; top: 84px; } }
.case-aside .facts { grid-template-columns: 1fr; margin-top: 0; }
.entry-switch { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; margin-bottom: 1rem; }
.entry-switch label { display: flex; gap: .625rem; align-items: flex-start; border: 1.5px solid var(--line-strong); border-radius: var(--radius-sm); padding: .75rem .875rem; cursor: pointer; background: var(--surface); position: relative; transition: border-color .15s ease, background-color .15s ease; }
.entry-switch input { position: absolute; opacity: 0; }
.entry-switch .bi { font-size: 1.125rem; margin-top: .05rem; }
.entry-switch strong { display: block; font-size: .9375rem; }
.entry-switch small { display: block; color: var(--ink-3); font-size: .8125rem; line-height: 1.35; }
.entry-switch label:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.entry-switch label.is-note:has(input:checked) { border-color: var(--violet); background: #F3F0F9; }
.entry-switch label:has(input:focus-visible) { outline: 3px solid rgba(200, 16, 46, .45); outline-offset: 2px; }
@media (max-width: 575.98px) { .entry-switch { grid-template-columns: 1fr; } }

/* Tablas simples (usuarios, categorías) */
.data-table { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin: 0; }
.data-table > :not(caption) > * > * { padding: .875rem 1rem; border-bottom-color: var(--line); }
.data-table thead th { font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-3); font-weight: 600; background: #F8F9FC; white-space: nowrap; }
.data-table tbody tr:last-child > * { border-bottom: 0; }
.tag { display: inline-block; font-size: .75rem; font-weight: 600; border-radius: 4px; padding: .125rem .5rem; background: var(--canvas); color: var(--ink-2); }
.tag-on { background: var(--ok-bg); color: var(--ok-ink); }
.tag-admin { background: var(--brand-soft); color: var(--brand-hover); }

/* Indicadores del panel */
.stat-row { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.125rem; text-decoration: none; color: var(--ink); display: block; transition: border-color .15s ease; }
a.stat:hover { border-color: var(--brand); color: var(--ink); }
.stat .stat-label { display: flex; align-items: center; gap: .5rem; color: var(--ink-2); font-size: .875rem; font-weight: 600; }
.stat .stat-value { display: block; font-size: 1.75rem; font-weight: 700; font-variant-numeric: tabular-nums; margin-top: .25rem; color: var(--ink); }
.stat .dot { width: .5rem; height: .5rem; border-radius: 50%; }

/* Login */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 1.5rem 1rem; }
.login-card { width: 100%; max-width: 420px; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; animation: none !important; }
}
@media print {
    .site-header nav, .site-footer, .no-print, .admin-nav, .admin-tabbar, .admin-topbar { display: none !important; }
    body { background: #fff; }
    .panel { box-shadow: none; border-color: #999; }
}
.consent .form-check-input.is-invalid ~ .form-check-label { color: var(--ink); }
.consent .form-check-input.is-invalid { border-color: var(--late-ink); }
.footer-facts { display: grid; gap: 0 2rem; }
@media (min-width: 576px) { .footer-facts { grid-template-columns: 1fr 1fr; } }
