/* =============================================================================
   DIIMA — design system
   House standard: `professional-page-design`, "Light Control-Tower" mode.
   Brand overlay: ASEBC wine. One accent, everything else grayscale-warm.
   Re-theme by swapping the token block below — pages must never hardcode hex.
   ========================================================================== */

:root {
    /* --- brand overlay (the ONE accent family) --- */
    --brand:          #5C1626;   /* deep wine — hero panel, drawer          */
    --brand-bright:   #7E2338;   /* wine bright — gradient end              */
    --brand-accent:   #A8324A;   /* action / focus / active nav             */
    --brand-tint:     #F3E9EB;   /* wash for selected rows, soft fills      */

    /* --- surfaces --- */
    --page:           #F5F3F4;   /* warm light, never pure white            */
    --card:           #FFFFFF;
    --card-2:         #FBF9FA;   /* zebra / inset panels                    */

    /* --- ink --- */
    --ink:            #241A1D;   /* darkest text, deliberately not #000     */
    --text-2:         #6B5A5F;
    --text-muted:     #8C7C81;
    --on-brand:       #FBF6F7;
    --on-brand-2:     #D8BCC3;

    /* --- semantics --- */
    --ok:             #1D7A3A;
    --ok-bg:          #E4F2E8;
    --warn:           #8A6100;
    --warn-bg:        #FCF2DA;
    --bad:            #B3242B;
    --bad-bg:         #F9E6E6;
    --info:           #2B4DA8;
    --info-bg:        #E6EAF8;

    /* --- lines, geometry, depth --- */
    --line:           rgba(36,26,29,.10);
    --line-soft:      rgba(36,26,29,.06);
    --radius:         14px;
    --radius-sm:      9px;
    --shadow-card:    0 1px 2px rgba(36,26,29,.04), 0 1px 3px rgba(36,26,29,.03);
    --shadow-hover:   0 4px 14px rgba(36,26,29,.07);
    --shadow-pop:     0 18px 48px rgba(36,26,29,.16);

    /* --- type --- */
    --font-display: "Source Serif 4", Georgia, "Times New Roman", serif;
    --font-body:    "IBM Plex Sans", "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.5;
    color: var(--ink);
    background: var(--page);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

/* Ambient layer — two very slow radial blobs, rendered once behind everything.
   This is the entire motion budget for the app background. */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background:
        radial-gradient(58ch 46ch at 12% 8%,  rgba(168,50,74,.055), transparent 70%),
        radial-gradient(52ch 40ch at 88% 92%, rgba(92,22,38,.05),   transparent 70%);
    animation: diima-drift 78s ease-in-out infinite alternate;
}

@keyframes diima-drift {
    from { transform: translate3d(0,0,0)      scale(1); }
    to   { transform: translate3d(-1.5%,1%,0) scale(1.06); }
}

h1, h2, h3, .diima-logo, .login-logo, .diima-kpi-v {
    font-family: var(--font-display);
    font-weight: 600;
    letter-spacing: -.015em;
}

h1 { font-size: 1.9rem; line-height: 1.15; margin: 0 0 .15rem; }
h2 { font-size: 1.15rem; line-height: 1.35; margin: 0 0 .5rem; }
h3 { font-size: 1rem;    line-height: 1.4;  margin: 0 0 .4rem; }

a { color: var(--brand-accent); text-underline-offset: 2px; }

/* ---------- labels & micro type ---------- */
.diima-eyebrow,
.diima-nav-group,
.diima-table thead th,
.diima-kpi-l {
    font-size: .7rem;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
}

/* =============================== controls ================================ */
.btn-primary {
    display: inline-flex; align-items: center; gap: .45rem;
    background: var(--brand-accent); color: #fff; border: 0;
    padding: .6rem 1.05rem; border-radius: var(--radius-sm);
    font: inherit; font-weight: 600; font-size: .9rem;
    cursor: pointer; min-height: 40px;
    transition: background .1s ease-out, box-shadow .1s ease-out;
}
.btn-primary:hover { background: #93283F; box-shadow: var(--shadow-hover); }
.btn-primary:disabled { background: var(--text-muted); cursor: default; box-shadow: none; }
/* Un botón que además navega se escribe como <a>, y entonces hereda el subrayado de los
   enlaces. Se quita aquí, una vez, en vez de por pantalla. */
a.btn-primary, a.btn-ghost { text-decoration: none; }

.btn-ghost {
    display: inline-flex; align-items: center; gap: .45rem;
    background: var(--card); color: var(--ink);
    border: 1px solid var(--line); border-radius: var(--radius-sm);
    padding: .6rem 1.05rem; font: inherit; font-weight: 600; font-size: .9rem;
    cursor: pointer; min-height: 40px; transition: background .1s ease-out;
}
.btn-ghost:hover { background: var(--card-2); }

.btn-link {
    display: inline-flex; align-items: center; gap: .3rem;
    background: none; border: 0; color: var(--brand-accent);
    cursor: pointer; padding: .25rem .4rem; font: inherit; font-size: .88rem;
    border-radius: 6px; transition: background .1s ease-out;
}
.btn-link, a.btn-link { text-decoration: none; }
.btn-link:hover { background: var(--brand-tint); text-decoration: none; }

input:not([type]), input[type=text], input[type=email], input[type=password],
input[type=number], input[type=date], select, textarea {
    width: 100%; padding: .6rem .75rem;
    border: 1px solid var(--line); border-radius: var(--radius-sm);
    font: inherit; font-size: .92rem; margin-top: .3rem;
    background: var(--card); color: var(--ink);
    transition: border-color .1s ease-out, box-shadow .1s ease-out;
}
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--brand-accent);
    box-shadow: 0 0 0 3px rgba(168,50,74,.15);
}
input[type=file] { display: block; margin-top: .35rem; font: inherit; font-size: .88rem; }
input[type=file]::file-selector-button {
    font: inherit; font-weight: 600; padding: .45rem .85rem; margin-right: .7rem;
    border: 1px solid var(--line); border-radius: var(--radius-sm);
    background: var(--card-2); color: var(--ink); cursor: pointer;
}
input[type=file]::file-selector-button:hover { background: var(--brand-tint); }

label { display: block; margin: .75rem 0 0; font-size: .85rem; font-weight: 500; color: var(--text-2); }
.uppercase { text-transform: uppercase; }

/* Visible keyboard focus everywhere — never suppressed without a replacement. */
a:focus-visible, button:focus-visible, [tabindex="0"]:focus-visible {
    outline: 3px solid rgba(168,50,74,.45);
    outline-offset: 2px;
    border-radius: 6px;
}
/* …except programmatic focus targets. Blazor's <FocusOnNavigate Selector="h1"/> parks focus
   on the page heading (tabindex="-1") after every navigation; a ring there is not a keyboard
   affordance, it just boxes the title on arrival. */
h1:focus, h1:focus-visible, [tabindex="-1"]:focus, [tabindex="-1"]:focus-visible { outline: none; }

/* ================================ login ================================== */
.login-wrap {
    min-height: 100vh; display: grid; place-items: center;
    padding: 24px;
    background:
        radial-gradient(70ch 50ch at 20% 0%, rgba(168,50,74,.10), transparent 70%),
        var(--page);
}

.login-split {
    display: grid; grid-template-columns: 1.05fr .95fr;
    width: min(980px, 100%);
    background: var(--card);
    border-radius: 20px; overflow: hidden;
    box-shadow: 0 30px 70px rgba(36,26,29,.13), 0 2px 6px rgba(36,26,29,.05);
}

/* Left: the branded panel — deep wine, gradient, woven diagonal texture. */
.login-hero {
    position: relative;
    padding: 44px 42px;
    color: var(--on-brand);
    background:
        linear-gradient(150deg, var(--brand) 0%, #6C1C2E 45%, var(--brand-bright) 100%);
    display: flex; flex-direction: column;
}
.login-hero::before {                       /* texture */
    content: ""; position: absolute; inset: 0; opacity: .5; pointer-events: none;
    background-image: repeating-linear-gradient(
        -45deg, rgba(255,255,255,.045) 0 1px, transparent 1px 9px);
}
.login-hero::after {                        /* light bloom */
    content: ""; position: absolute; inset: 0; pointer-events: none;
    background: radial-gradient(40ch 30ch at 85% 15%, rgba(255,255,255,.10), transparent 65%);
}
.login-hero > * { position: relative; z-index: 1; }

.login-mark { display: flex; align-items: center; gap: 14px; margin-bottom: 32px; }
.login-mark-badge {
    width: 46px; height: 46px; flex: none;
    display: grid; place-items: center;
    border-radius: 13px;
    background: linear-gradient(150deg, rgba(255,255,255,.22), rgba(255,255,255,.07));
    border: 1px solid rgba(255,255,255,.22);
    font-family: var(--font-display); font-size: 1.4rem; font-weight: 700; color: #fff;
}
.login-logo { font-size: 1.55rem; letter-spacing: .16em; color: #fff; font-weight: 700; }
.login-sub { display: block; font-size: .62rem; letter-spacing: .13em; color: var(--on-brand-2);
             text-transform: uppercase; margin-top: 3px; font-family: var(--font-body); font-weight: 500; }

.login-pill {
    align-self: flex-start; margin-bottom: 20px;
    padding: .34rem .8rem; border-radius: 999px;
    border: 1px solid rgba(255,255,255,.26);
    font-size: .64rem; letter-spacing: .12em; text-transform: uppercase;
    font-weight: 600; color: var(--on-brand);
}

.login-head {
    font-family: var(--font-display); font-size: 2.35rem; line-height: 1.1;
    font-weight: 600; letter-spacing: -.02em; margin: 0 0 16px; color: #fff;
}
.login-head em { font-style: normal; color: #F0A9B8; }
.login-copy { font-size: .92rem; line-height: 1.6; color: var(--on-brand-2); margin: 0 0 32px; max-width: 42ch; }

.login-points { display: flex; flex-direction: column; gap: 14px; margin-top: auto; }
.login-point { display: flex; align-items: center; gap: 12px; font-size: .87rem; color: var(--on-brand); }
.login-point-i {
    width: 32px; height: 32px; flex: none; display: grid; place-items: center;
    border-radius: 9px; background: rgba(255,255,255,.11);
    border: 1px solid rgba(255,255,255,.14); color: #fff;
}
.login-rule { width: 44px; height: 2px; background: rgba(255,255,255,.35); margin: 32px 0 12px; }
.login-org { font-size: .64rem; letter-spacing: .13em; text-transform: uppercase; color: var(--on-brand-2); }

/* Right: the form */
.login-form { padding: 48px 44px; display: flex; flex-direction: column; justify-content: center; }
.login-form h2 { font-size: 1.6rem; font-weight: 600; margin: 0 0 6px; letter-spacing: -.02em; }
.login-form-sub { color: var(--text-2); font-size: .9rem; margin: 0 0 26px; }
.login-form label { font-size: .7rem; font-weight: 600; letter-spacing: .08em;
                    text-transform: uppercase; color: var(--text-2); margin: 0 0 6px; }
.login-field { margin-bottom: 18px; }
.login-field input { margin-top: 0; background: var(--card-2); }
.login-form .btn-primary { width: 100%; justify-content: center; margin-top: 8px;
                           min-height: 46px; font-size: .95rem; }
.login-error {
    display: flex; align-items: center; gap: .5rem;
    background: var(--bad-bg); color: var(--bad);
    padding: .65rem .85rem; border-radius: var(--radius-sm);
    font-size: .85rem; font-weight: 500; margin-bottom: 18px;
}
.login-foot { margin-top: 26px; padding-top: 20px; border-top: 1px solid var(--line-soft);
              font-size: .74rem; color: var(--text-muted); text-align: center; line-height: 1.6; }

@media (max-width: 860px) {
    .login-split { grid-template-columns: 1fr; }
    .login-hero { padding: 34px 28px; }
    .login-head { font-size: 1.85rem; }
    .login-points { margin-top: 26px; }
    .login-form { padding: 34px 28px; }
}

/* ============================== app shell ================================ */
.diima-shell { display: grid; grid-template-columns: 254px 1fr; min-height: 100vh; }

.diima-sidebar {
    position: relative;
    background: linear-gradient(168deg, var(--brand) 0%, #4E1220 62%, #3E0E1A 100%);
    color: var(--on-brand-2);
    display: flex; flex-direction: column;
}
.diima-sidebar::before {
    content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .55;
    background-image: repeating-linear-gradient(
        -45deg, rgba(255,255,255,.04) 0 1px, transparent 1px 10px);
}
.diima-sidebar > * { position: relative; z-index: 1; }

.diima-brand {
    padding: 22px 22px 18px;
    border-bottom: 1px solid rgba(255,255,255,.09);
    display: flex; align-items: baseline; gap: 9px;
}
.diima-logo { font-size: 1.32rem; font-weight: 700; letter-spacing: .15em; color: #fff; }
.diima-tag {
    font-size: .58rem; font-family: var(--font-body); font-weight: 600;
    letter-spacing: .13em; color: var(--on-brand-2);
    border: 1px solid rgba(255,255,255,.2); border-radius: 999px; padding: .12rem .45rem;
}

.diima-nav { padding: 12px 0; display: flex; flex-direction: column; }
.diima-nav-group { padding: 18px 22px 7px; color: rgba(216,188,195,.65); }
.diima-nav a {
    display: flex; align-items: center; gap: .65rem;
    color: var(--on-brand-2); text-decoration: none;
    padding: .58rem 22px; font-size: .88rem; font-weight: 500;
    border-left: 3px solid transparent;
    transition: background .1s ease-out, color .1s ease-out;
}
.diima-nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.diima-nav a.active {
    background: linear-gradient(90deg, rgba(255,255,255,.13), rgba(255,255,255,.02));
    border-left-color: #E8909F; color: #fff; font-weight: 600;
}
.diima-nav .diima-icon { opacity: .85; }
.diima-nav a.active .diima-icon { opacity: 1; }

.diima-sidebar-foot {
    margin-top: auto; padding: 16px 22px;
    border-top: 1px solid rgba(255,255,255,.09);
    font-size: .64rem; letter-spacing: .1em; text-transform: uppercase;
    color: rgba(216,188,195,.6);
}

.diima-main { display: flex; flex-direction: column; min-width: 0; }
.diima-topbar {
    height: 62px; background: rgba(255,255,255,.86);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--line);
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 24px; position: sticky; top: 0; z-index: 20;
}
.diima-topbar-title { font-size: .78rem; letter-spacing: .06em; color: var(--text-muted); }
.diima-user { display: flex; align-items: center; gap: 14px; }
.diima-avatar {
    width: 32px; height: 32px; border-radius: 50%; flex: none;
    display: grid; place-items: center;
    background: var(--brand-tint); color: var(--brand);
    font-size: .74rem; font-weight: 700;
}
.diima-user-name { font-size: .85rem; font-weight: 500; color: var(--ink); }
.diima-logout button {
    display: inline-flex; align-items: center; gap: .4rem;
    background: none; border: 1px solid var(--line); border-radius: var(--radius-sm);
    padding: .42rem .8rem; cursor: pointer; font: inherit; font-size: .82rem;
    color: var(--text-2); min-height: 36px; transition: background .1s ease-out;
}
.diima-logout button:hover { background: var(--brand-tint); color: var(--brand); }

.diima-content { padding: 24px; max-width: 1440px; width: 100%; }

/* ============================= page header =============================== */
.diima-page-head {
    display: flex; align-items: flex-start; justify-content: space-between;
    gap: 24px; flex-wrap: wrap; margin-bottom: 24px;
}
.diima-page-head h1 { font-size: 1.9rem; }
.diima-page-head + .diima-lead { margin-top: -18px; margin-bottom: 24px; }
.diima-lead { color: var(--text-2); font-size: .95rem; margin: 0 0 24px; max-width: 76ch; }

/* ============================ cards & tiles ============================== */
.diima-card {
    background: var(--card); border: 1px solid var(--line);
    border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow-card);
}

.diima-tiles {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(258px, 1fr));
    gap: 18px; margin-top: 24px;
}
.diima-tile {
    position: relative; display: flex; flex-direction: column; gap: .45rem;
    padding: 22px; background: var(--card); border: 1px solid var(--line);
    border-radius: var(--radius); box-shadow: var(--shadow-card);
    text-decoration: none; color: var(--ink); overflow: hidden;
    transition: box-shadow .1s ease-out, border-color .1s ease-out;
}
.diima-tile::before {
    content: ""; position: absolute; inset: 0 auto 0 0; width: 3px;
    background: linear-gradient(180deg, var(--brand-accent), var(--brand));
}
.diima-tile:hover { box-shadow: var(--shadow-hover); border-color: rgba(168,50,74,.28); }
.diima-tile.is-soon { opacity: .62; }
.diima-tile.is-soon::before { background: var(--text-muted); }
.diima-tile-i {
    width: 36px; height: 36px; display: grid; place-items: center; margin-bottom: 6px;
    border-radius: 10px; background: var(--brand-tint); color: var(--brand);
}
.diima-tile-h { font-family: var(--font-display); font-size: 1.05rem; font-weight: 600; }
.diima-tile-d { font-size: .85rem; color: var(--text-2); line-height: 1.55; }

/* KPI row — number and unit render 2:1, never wrapped */
.diima-kpis {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 18px; margin-bottom: 24px;
}
.diima-kpi {
    background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 18px 20px; box-shadow: var(--shadow-card);
}
.diima-kpi-l { color: var(--text-muted); display: block; margin-bottom: 6px; }
.diima-kpi-v { font-size: 2rem; line-height: 1; color: var(--ink); white-space: nowrap; }
.diima-kpi-v small { font-family: var(--font-body); font-size: .5em; font-weight: 500;
                     color: var(--text-muted); margin-left: .25em; }

/* ================================ tables ================================= */
.diima-table-wrap { overflow-x: auto; border-radius: var(--radius);
                    border: 1px solid var(--line); box-shadow: var(--shadow-card); background: var(--card); }
.diima-table { width: 100%; border-collapse: collapse; background: var(--card);
               border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
               box-shadow: var(--shadow-card); font-variant-numeric: tabular-nums; }
.diima-table-wrap > .diima-table { border: 0; border-radius: 0; box-shadow: none; }
.diima-table th, .diima-table td {
    text-align: left; padding: .68rem .95rem;
    border-bottom: 1px solid var(--line-soft); font-size: .875rem;
}
/* Deliberately NOT sticky: `.diima-table-wrap` is an overflow container, so a sticky thead
   resolves against it instead of the page and floats over the first row. The tables here are
   short (7 municipios, a page of 20) — a sticky header buys nothing and cost a visible bug. */
.diima-table thead th {
    background: var(--card-2); color: var(--text-2);
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
}
.diima-table tbody tr { transition: background .1s ease-out; }
.diima-table tbody tr:nth-child(even) { background: var(--card-2); }
.diima-table tbody tr:hover { background: var(--brand-tint); }
.diima-table tbody tr:last-child td { border-bottom: 0; }
.diima-table tr.is-inactive { color: var(--text-muted); }
.diima-table tr.is-inactive td:first-child { font-style: italic; }
.ta-right { text-align: right; font-variant-numeric: tabular-nums; }
.th-sort {
    background: none; border: 0; padding: 0; font: inherit; color: inherit;
    text-transform: inherit; letter-spacing: inherit; font-weight: inherit;
    cursor: pointer; display: inline-flex; align-items: center; gap: .3rem;
}
.th-sort:hover { color: var(--brand-accent); }
.diima-table td.ta-right .btn-link, .diima-table td.ta-right a { margin-left: .3rem; }

/* Nested detail table (the per-concept breakdown inside an expanded dictamen row) */
.diima-subtable { border: 1px solid var(--line); border-radius: var(--radius-sm);
                  box-shadow: none; margin: 6px 0; background: var(--card); }
.diima-subtable thead th { position: static; background: var(--brand-tint); color: var(--brand); }
.diima-subtable tbody tr:nth-child(even) { background: var(--card-2); }
.diima-subtable tbody tr:hover { background: var(--card-2); }
.diima-table td:has(> .diima-subtable) { background: var(--card-2); padding: 10px 14px; }

/* ================================ pager ================================== */
.diima-pager { display: flex; align-items: center; gap: .5rem; margin-top: 14px; font-size: .82rem; }
.diima-pager-info { color: var(--text-muted); }
.diima-pager .btn-link:disabled { color: var(--text-muted); cursor: default; opacity: .45; background: none; }

/* ================================ badges ================================= */
/* Status is never colour alone: a 6px dot plus the word. */
.badge {
    display: inline-flex; align-items: center; gap: .4rem;
    padding: .22rem .62rem .22rem .55rem; border-radius: 999px;
    font-size: .7rem; font-weight: 600; letter-spacing: .04em; white-space: nowrap;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%;
                 background: currentColor; flex: none; }
.badge-borrador, .badge-cargado { background: #ECE8E9; color: #5C5054; }
.badge-enaprobacion, .badge-previo { background: var(--warn-bg); color: var(--warn); }
.badge-aprobada, .badge-admitido { background: var(--ok-bg); color: var(--ok); }
.badge-publicada { background: var(--info-bg); color: var(--info); }
.badge-cerrada { background: var(--brand-tint); color: var(--brand); }
.badge-rechazado { background: var(--bad-bg); color: var(--bad); }

/* ================================ modal ================================== */
.diima-modal-backdrop {
    position: fixed; inset: 0; background: rgba(36,26,29,.42);
    backdrop-filter: blur(3px);
    display: grid; place-items: center; z-index: 50; padding: 24px;
    animation: diima-fade .2s ease-out;
}
.diima-modal {
    width: min(460px, 100%); background: var(--card); border-radius: var(--radius);
    padding: 26px; box-shadow: var(--shadow-pop);
    max-height: 88vh; overflow-y: auto;
    animation: diima-rise .2s ease-out;
}
.diima-modal h2, .diima-modal h3 { margin-top: 0; }
.diima-modal-actions { display: flex; justify-content: flex-end; gap: 12px; margin-top: 24px; }
@keyframes diima-fade { from { opacity: 0 } to { opacity: 1 } }
@keyframes diima-rise { from { opacity: 0; transform: translateY(8px) } to { opacity: 1; transform: none } }

.diima-check { display: flex; align-items: center; gap: .45rem; }
.diima-check input[type=checkbox] { width: auto; margin: 0; accent-color: var(--brand-accent); }
.diima-permisos {
    border: 1px solid var(--line); border-radius: var(--radius-sm);
    padding: .6rem .9rem .8rem; margin: .8rem 0; background: var(--card-2);
}
.diima-permisos legend { font-size: .7rem; font-weight: 600; letter-spacing: .08em;
                         text-transform: uppercase; color: var(--text-muted); padding: 0 .35rem; }
.diima-permisos .diima-check { margin: .35rem 0; font-size: .86rem; }

/* ============================ states & notices =========================== */
.diima-denied { padding: 24px; }

.diima-empty {
    display: flex; flex-direction: column; align-items: center; text-align: center;
    padding: 56px 24px; background: var(--card); border: 1px dashed var(--line);
    border-radius: var(--radius); color: var(--text-2);
}
.diima-empty-i { width: 46px; height: 46px; display: grid; place-items: center; margin-bottom: 14px;
                 border-radius: 13px; background: var(--brand-tint); color: var(--brand); }
.diima-empty h3 { font-size: 1.05rem; margin: 0 0 .3rem; color: var(--ink); }
.diima-empty p { margin: 0; font-size: .88rem; max-width: 46ch; }

.diima-notfound { padding: 72px 24px; text-align: center; }
.diima-notfound-code {
    font-family: var(--font-display); font-size: 5rem; font-weight: 600; line-height: 1;
    letter-spacing: -.04em; color: var(--brand-tint);
}
.diima-notfound h1 { margin: 10px 0 6px; font-size: 1.5rem; }
.diima-notfound p { margin: 0 0 24px; color: var(--text-2); }

.diima-banner {
    display: flex; align-items: flex-start; gap: .6rem;
    background: var(--info-bg); color: var(--info);
    padding: .75rem 1rem; border-radius: var(--radius-sm);
    margin: 18px 0; font-size: .88rem;
}
.diima-action-card {
    background: var(--card); border: 1px solid var(--line);
    border-left: 3px solid var(--brand-accent); border-radius: var(--radius);
    padding: 20px 22px; margin: 18px 0; box-shadow: var(--shadow-card);
}
.diima-action-card h3 { margin-top: 0; }
.diima-action-card .btn-primary { margin-top: 12px; }
.diima-findings {
    background: var(--card-2); border: 1px solid var(--line);
    border-radius: var(--radius); padding: 20px 22px; margin: 18px 0;
}
/* Aviso de párrafo: una frase con negritas dentro.
   NO es flex, y ésa es toda la razón de que exista. `.login-error` y `.diima-banner` sí lo son —les
   sirve, porque llevan un icono y una línea corta— pero un contenedor flex convierte cada hijo en
   una columna, así que un texto con <b> en medio se parte en tres bloques y la frase se lee a
   saltos: «…no hay forma de deducir lo que quiso | no se puede aceptar | el archivo». */
.diima-aviso {
    display: block; padding: .75rem 1rem; border-radius: var(--radius-sm);
    margin: 14px 0; font-size: .88rem; line-height: 1.55;
}
.diima-aviso-bad { background: var(--bad-bg); color: var(--bad); }
.diima-aviso-warn { background: var(--warn-bg); color: var(--warn); }
.diima-aviso-ok { background: var(--ok-bg); color: var(--ok); }

.diima-findings h3 { margin-top: 0; }
.diima-violaciones { color: var(--bad); font-size: .85rem; margin: .4rem 0; }
.diima-nota { color: var(--warn); font-size: .85rem; margin: .2rem 0; }
.diima-checks { list-style: none; padding: 0; margin: .5rem 0; }
.diima-checks li { padding: .2rem 0; font-size: .88rem; }

/* ================================ icons ================================== */
.diima-icon { vertical-align: -.125em; flex-shrink: 0; }

/* ==================== formatos de captura · mapa de columnas ==============
   Una hoja pide diez referencias de columna. Puestas en fila son ilegibles, así que van
   agrupadas por lo que significan (bloque 1, bloque 2, observaciones, variaciones) y los
   campos son angostos: se teclea "A" o "AB", no una frase.                              */
.fmt-grid { display: flex; flex-wrap: wrap; gap: 0 24px; }
.fmt-grid > label { min-width: 240px; }

.fmt-hint { color: var(--text-muted); font-size: .8rem; font-weight: 400; display: block; margin-top: .2rem; }

.fmt-radios { border: 0; padding: 0; margin: .9rem 0 0; }
.fmt-radios legend { font-size: .85rem; font-weight: 500; color: var(--text-2); padding: 0; }
.fmt-radio { display: flex; gap: .55rem; align-items: flex-start; margin: .5rem 0 0; font-weight: 400; }
.fmt-radio input { margin-top: .2rem; flex: none; }

.fmt-check { display: flex; gap: .55rem; align-items: center; font-weight: 400; margin: .5rem 0 0; }
.fmt-check input { flex: none; }

.fmt-hoja { padding-top: 14px; }
.fmt-hoja-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: .35rem 1rem; }
.fmt-hoja-head .fmt-check { margin: 0; }
.fmt-hoja-off { opacity: .55; }

.fmt-cols { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.fmt-col-group {
    display: flex; flex-wrap: wrap; align-items: flex-end; gap: .5rem;
    border: 1px solid var(--line); border-radius: var(--radius-sm);
    padding: .55rem .7rem .7rem; background: var(--card-2);
}
.fmt-col-title {
    flex-basis: 100%; font-size: .68rem; font-weight: 600; letter-spacing: .07em;
    text-transform: uppercase; color: var(--text-muted);
}
.fmt-col-group label { margin: 0; font-size: .78rem; font-weight: 400; }
input.fmt-col { width: 4.2rem; text-transform: uppercase; text-align: center; }

.fmt-actions { display: flex; gap: 12px; align-items: center; margin-top: 14px; }
.fmt-row-off td { color: var(--text-muted); font-style: italic; }

/* ===================== cotejo de cargas municipales ====================== */
/* El texto legal de un renglón puede ser un párrafo entero: se le pone techo para que la tabla de
   diferencias siga siendo una tabla, y el resto se lee en el archivo. */
.cmp-texto { max-width: 22rem; font-size: .8rem; color: var(--text-2); }
.cmp-decision { white-space: nowrap; }
/* La decisión tomada se ve en la fila, no sólo en el botón: en una lista larga hay que poder
   distinguir de un vistazo lo que ya se resolvió de lo que sigue pendiente. */
.cmp-decision .cmp-on { font-weight: 600; text-decoration: underline; }
.cmp-aceptada td { background: var(--ok-bg); }
.cmp-rechazada td { background: var(--bad-bg); }

/* ============================= responsive ================================ */
@media (max-width: 900px) {
    .diima-shell { grid-template-columns: 1fr; }
    .diima-sidebar { flex-direction: row; align-items: center; overflow-x: auto; }
    .diima-nav { flex-direction: row; padding: 0; }
    .diima-nav-group, .diima-sidebar-foot { display: none; }
    .diima-nav a { border-left: 0; border-bottom: 3px solid transparent; white-space: nowrap; }
    .diima-nav a.active { border-left: 0; border-bottom-color: #E8909F; }
    .diima-table thead th { position: static; }
    .diima-content { padding: 18px; }
}

/* ===== Blazor framework leftovers (kept — the error UI still uses them) ==== */
h1:focus { outline: none; }
.valid.modified:not([type=checkbox]) { outline: 1px solid var(--ok); }
.invalid { outline: 1px solid var(--bad); }
.validation-message { color: var(--bad); }
.blazor-error-boundary { background: var(--bad); padding: 1rem; color: #fff; }
.blazor-error-boundary::after { content: "Ocurrió un error."; }

/* ========================= reduced motion honoured ======================== */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
}
