:root {
    --bg: #f8faf8;
    --surface: #ffffff;
    --ink: #20312b;
    --ink-strong: #192e24;
    --muted: #56665c;
    --muted-2: #617267;
    --line: #e2e9e3;
    --line-soft: #eef1ee;
    --green: #1e6245;
    --green-strong: #174e37;
    --green-100: #eaf3ed;
    --green-50: #f1f7f2;
    --danger: #a4231c;
    --danger-bg: #fdecea;
    --warn: #7a5200;
    --warn-bg: #fbf2dd;
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 16px;
    --shadow: 0 1px 2px rgba(16, 40, 28, .04), 0 10px 30px rgba(16, 40, 28, .05);
    --sidebar-w: 264px;
    --font: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html { font-size: 16px; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { color: var(--ink-strong); margin: 0 0 .5rem; line-height: 1.25; }
h1 { font-size: 28px; font-weight: 700; letter-spacing: -.01em; }
h2 { font-size: 18px; font-weight: 700; }
h3 { font-size: 15px; font-weight: 700; }
h4 { font-size: 13px; font-weight: 700; color: var(--muted); }
p { margin: 0 0 .75rem; }
small { color: var(--muted-2); }
a { color: var(--green); text-decoration: none; }
a:hover { text-decoration: underline; }
a { text-underline-offset: 3px; }
::selection { background: #cee5d5; color: var(--ink-strong); }
strong { color: var(--ink-strong); }
.text-danger { color: var(--danger) !important; }

:focus-visible { outline: 3px solid #a96b00; outline-offset: 2px; border-radius: 4px; }

.skip-link {
    position: absolute; left: 12px; top: -60px; z-index: 100;
    background: var(--green); color: #fff; padding: 10px 16px; border-radius: var(--radius-sm);
    transition: top .15s ease;
}
.skip-link:focus { top: 12px; }
.sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); clip-path: inset(50%); white-space: nowrap; border: 0;
}

/* Shell */
.app-shell { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100vh; }
.app-shell > aside {
    background: var(--surface);
    border-right: 1px solid var(--line);
    padding: 22px 16px 16px;
    display: flex; flex-direction: column;
    position: sticky; top: 0; height: 100vh; overflow-y: auto;
}

.app-shell .brand { padding: 2px 6px 20px; border-bottom: 1px solid var(--line-soft); margin-bottom: 8px; }
.brand img.brand-full { width: 158px; height: auto; display: block; }
.brand-compact { display: none; }
.menu-toggle { display: none; }

.app-shell > aside nav { display: flex; flex-direction: column; gap: 2px; }
.nav-family {
    margin: 16px 10px 4px;
    font-size: 10.5px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase;
    color: var(--muted-2);
}
.app-shell > aside nav a {
    display: flex; align-items: center; gap: 10px;
    height: 38px; padding: 0 12px;
    border-radius: var(--radius-sm);
    color: var(--muted); font-size: 13.5px; font-weight: 500;
    text-decoration: none;
    transition: background .12s ease, color .12s ease;
}
.app-shell > aside nav a:hover { background: var(--green-50); color: var(--ink-strong); text-decoration: none; }
.app-shell > aside nav a.active { background: var(--green-100); color: var(--green); font-weight: 700; }
.app-shell > aside nav a .ui-icon { width: 18px; height: 18px; }
.institution {
    margin: auto 0 0; padding: 14px 10px 2px;
    font-size: 11px; color: var(--muted-2); border-top: 1px solid var(--line-soft);
}

.workspace { display: flex; flex-direction: column; min-width: 0; }
.topbar {
    position: sticky; top: 0; z-index: 20;
    height: 64px; padding: 0 32px;
    display: flex; align-items: center; justify-content: space-between; gap: 16px;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
}
.topbar-title { font-size: 13px; font-weight: 600; color: var(--muted); }
.topbar-actions { display: flex; align-items: center; gap: 14px; }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 5px 12px 5px 6px; border: 1px solid var(--line); border-radius: 999px; background: #fff; }
.avatar {
    width: 30px; height: 30px; border-radius: 50%;
    display: grid; place-items: center;
    background: var(--green-100); color: var(--green);
    font-size: 11px; font-weight: 700; letter-spacing: .02em;
}
.user-chip .who { display: flex; flex-direction: column; line-height: 1.15; }
.user-chip .who strong { font-size: 12.5px; }
.user-chip .who small { font-size: 10.5px; text-transform: capitalize; }

.workspace > main { padding: 32px clamp(20px, 3vw, 48px) 48px; flex: 1; width: 100%; max-width: 1600px; margin-inline: auto; }
.workspace > footer {
    border-top: 1px solid var(--line); color: var(--muted-2);
    font-size: 11.5px; padding: 14px 32px; background: var(--surface);
}

/* Page header */
.workspace main header, .catalogo > header, .ensayos > header {
    display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
    margin-bottom: 20px; flex-wrap: wrap;
}
.workspace main header small, .catalogo > header small, .ensayos > header small {
    display: block; margin-bottom: 4px;
    color: var(--green); font-size: 10.5px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase;
}
.workspace main header p, .catalogo > header p, .ensayos > header p { color: var(--muted); margin: 2px 0 0; }
.breadcrumb, .ruta {
    margin: 0 0 10px; color: var(--muted-2);
    font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
}

/* Surfaces */
.card, .panel, .surface {
    display: block;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 22px 24px;
}
.card + .card, .panel + .panel, .surface + .surface { margin-top: 20px; }
.metrics > .card + .card, .charts > .card + .card { margin-top: 0; }
#contenido > .card, #contenido > .panel, #contenido > .surface { margin-top: 24px; }
.workspace > section > .surface, .workspace > section > .panel, .workspace > section > .card { margin-bottom: 16px; }
.workspace > section > .metrics, .workspace > section > .charts { margin-bottom: 16px; }

/* Dashboard */
.welcome {
    display: flex; align-items: center; justify-content: space-between; gap: 24px;
    padding: 0; margin-bottom: 28px;
}
.welcome h1 { font-size: 28px; margin-bottom: 6px; }
.welcome p { color: var(--muted); margin-bottom: 0; }
.welcome > a { flex: none; }

.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 28px; padding: 22px 0; border-block: 1px solid var(--line); }
.metrics .card { padding: 0 24px; border: 0; border-radius: 0; background: transparent; }
.metrics .card:first-child { padding-left: 0; }
.metrics .card + .card { border-left: 1px solid var(--line); }
.metrics .card { color: var(--muted); font-size: 12px; font-weight: 500; }
.metrics .card strong { display: block; margin-top: 6px; font-size: 32px; font-weight: 700; color: var(--ink-strong); font-variant-numeric: tabular-nums; }
.metrics .card small { display: block; margin-top: 2px; font-size: 11px; }

.charts { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 24px; margin-bottom: 28px; align-items: start; }
.charts .card { min-width: 0; }
.charts .card h2 { margin-bottom: 16px; }
.charts .card p { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0; padding: 9px 0; border-bottom: 1px solid var(--line-soft); color: var(--muted); }
.charts .card p:last-child { border-bottom: 0; }
.charts .card p strong { color: var(--ink-strong); font-size: 14px; }

/* Toolbars and actions */
.toolbar, .filters, .busqueda { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; }
.toolbar { margin-bottom: 20px; }
.toolbar > label { margin-bottom: 0; flex: 1 1 240px; max-width: 420px; }
.toolbar > button { flex: none; }
.toolbar > span { align-self: center; color: var(--muted); }
.filters { display: block; }
.busqueda { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; margin-bottom: 24px; max-width: 640px; }
.busqueda label { margin: 0; }
.busqueda input { margin-top: 6px; }
.row-actions { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.panel > button { margin: 12px 8px 0 0; }
.action-list { display: grid; margin-top: 20px; }
.action-list a { display: flex; align-items: center; gap: 14px; padding: 18px 0; min-height: 56px; border-top: 1px solid var(--line); color: var(--green); font-weight: 600; }
.action-list a > .ui-icon:last-child { margin-left: auto; }
.action-list a:hover { color: var(--green-strong); }
.quick-actions { margin-top: 28px; padding-top: 24px; border-top: 1px solid var(--line); }
.quick-actions .toolbar { margin: 16px 0 0; }
.report-form { max-width: 840px; margin-bottom: 24px; }
.report-id { overflow-wrap: anywhere; min-width: 140px; }
.workspace main header > a, .catalogo > header > button, .ensayos > header > a {
    align-self: center; white-space: nowrap;
}

/* Buttons */
button, .btn, a.primary, a.secondary, a.secundario {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 40px; padding: 0 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: #fff; color: var(--ink);
    font-family: inherit; font-size: 13.5px; font-weight: 600;
    cursor: pointer; text-decoration: none;
    transition: background .12s ease, border-color .12s ease, color .12s ease;
}
button:hover, .btn:hover { background: var(--green-50); border-color: var(--green-100); text-decoration: none; }
button:disabled { opacity: .55; cursor: not-allowed; }
.btn-danger-outline { color: var(--danger); border-color: #e7c7c4; }
.btn-danger-outline:hover { background: var(--danger-bg); border-color: #d69e98; color: var(--danger); }
.btn-success, button[type="submit"], .primary, .primary-action {
    background: var(--green); border-color: var(--green); color: #fff;
}
.btn-success:hover, button[type="submit"]:hover, .primary:hover, .primary-action:hover {
    background: var(--green-strong); border-color: var(--green-strong); color: #fff;
}
.btn-outline-success, .btn-light, .secondary, .secundario {
    background: #fff; border-color: var(--line); color: var(--green);
}
.btn-outline-success:hover, .btn-light:hover, .secondary:hover, .secundario:hover { background: var(--green-50); }
.secondary, .secundario { color: var(--ink); }
.ui-icon-button {
    min-width: 40px; min-height: 40px; padding: 0; gap: 0;
    background: #fff; border: 1px solid var(--line);
}
.ui-icon { display: block; width: 18px; height: 18px; flex: none; }
.btn .ui-icon, button .ui-icon { width: 17px; height: 17px; }
a.ui-icon-button { display: inline-flex; align-items: center; justify-content: center; }

/* Forms */
label { display: block; font-size: 12.5px; font-weight: 600; color: var(--ink); margin-bottom: 12px; }
input, select, textarea {
    display: block; width: 100%; max-width: 100%;
    margin-top: 5px;
    min-height: 42px; padding: 9px 12px;
    border: 1px solid #829487; border-radius: var(--radius-sm);
    background: #fff; color: var(--ink);
    font-family: inherit; font-size: 13.5px; caret-color: var(--green);
}
textarea { min-height: 84px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--green); outline: none; box-shadow: 0 0 0 3px rgba(30, 98, 69, .16); }
input[readonly] { background: var(--bg); color: var(--muted); }
input[type="checkbox"], input[type="radio"] { display: inline-block; width: auto; min-height: 0; margin: 0 6px 0 0; accent-color: var(--green); }
fieldset { border: 0; padding: 0; margin: 0 0 16px; min-width: 0; }
legend { float: none; width: auto; padding: 0; margin: 0 0 10px; font-size: 12.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.form-control, .form-check-input { font-family: inherit; }
.form-floating > .form-control { height: auto; }
.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); gap: 12px 20px; }
.field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr)); gap: 12px 20px; align-items: end; margin-bottom: 4px; }
.field-row > label { margin-bottom: 0; }
.campos { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); gap: 16px 20px; }
.campo label { margin-bottom: 0; }
.cultivos { grid-column: 1 / -1; }
.cultivos label { display: inline-flex; align-items: center; gap: 6px; margin: 0 16px 8px 0; font-weight: 500; }
fieldset > footer, .panel > footer, .surface > footer, form > footer {
    display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end;
    margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line-soft);
}
.password-field { position: relative; display: flex; align-items: center; gap: 8px; }
.password-field input { margin-top: 0; }

/* Tables */
.table-wrap, .table-scroll, .scroll, .tabla { overflow-x: auto; max-width: 100%; }
.table-wrap, .surface.table-scroll { padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.table-scroll, .tabla { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; }
caption { text-align: left; padding: 14px 18px 0; color: var(--muted-2); font-size: 11.5px; }
th, td { padding: 12px 18px; text-align: left; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
thead th {
    background: #f8faf8;
    color: var(--muted-2);
    font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
    white-space: nowrap;
}
tbody tr:last-child td { border-bottom: 0; }
tbody td { font-size: 13.5px; font-variant-numeric: tabular-nums; }
td:last-child { width: 1%; white-space: nowrap; }
@media (hover: hover) { tbody tr:hover { background: #f7faf8; } }

/* Status and messages */
.error, .notice, .empty, .note, .validation-message { border-radius: var(--radius-sm); }
.error {
    background: var(--danger-bg); border: 1px solid #f3c9c5; color: var(--danger);
    padding: 14px 16px; margin-bottom: 16px; font-size: 13px;
}
.error button { margin-top: 8px; }
.notice, .note {
    background: var(--green-50); border: 1px solid var(--green-100); color: var(--green-strong);
    padding: 14px 16px; font-size: 13px; margin-bottom: 16px;
}
.note { background: transparent; border: 0; border-left: 3px solid var(--green-100); border-radius: 0; color: var(--muted); padding: 4px 0 4px 12px; }
.empty {
    border: 1px dashed #cdd8d0; background: #fff; color: var(--muted);
    padding: 36px 20px; text-align: center; margin-bottom: 16px;
}
[role="alert"] { color: var(--danger); }
.notice[role="alert"] { color: var(--green-strong); }
[role="status"] { color: var(--muted); }

/* Detail lists */
dl { display: grid; grid-template-columns: minmax(140px, 220px) 1fr; gap: 8px 18px; margin: 0 0 16px; }
dt { color: var(--muted-2); font-size: 12px; font-weight: 600; }
dd { margin: 0; font-size: 13.5px; }
article { border-top: 1px solid var(--line); padding: 20px 0; margin-top: 16px; }

/* Tabs and pagination */
.workspace nav[aria-label="Catálogos"], .catalogo nav[aria-label="Catálogos"] {
    display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 18px;
}
.catalogo nav[aria-label="Catálogos"] a {
    padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line);
    background: #fff; color: var(--muted); font-size: 12.5px; font-weight: 600;
}
.catalogo nav[aria-label="Catálogos"] a[aria-current="page"] { background: var(--green-100); border-color: var(--green-100); color: var(--green); }
.workspace nav[aria-label="Administración"] {
    display: flex; flex-wrap: wrap; gap: 18px;
    margin: 0 0 18px; padding-bottom: 10px;
    border-bottom: 1px solid var(--line-soft);
}
.workspace nav[aria-label="Administración"] a { color: var(--muted); font-size: 12.5px; font-weight: 600; }
.workspace nav[aria-label="Administración"] a:hover { color: var(--green); }
.workspace nav[aria-label="Administración"] a { padding: 10px 0; }
.workspace nav[aria-label="Administración"] a.active { color: var(--green); box-shadow: 0 2px var(--green); }
.workspace nav[aria-label^="Página"], .workspace nav[aria-label="Páginas de resultados"], .workspace nav[aria-label="Páginas de reportes"], .workspace nav[aria-label="Paginación"] {
    display: flex; align-items: center; gap: 10px; margin-top: 16px; flex-wrap: wrap;
}
.workspace nav[aria-label^="Página"] span, .workspace nav[aria-label="Páginas de resultados"] span, .workspace nav[aria-label="Páginas de reportes"] span, .workspace nav[aria-label="Paginación"] span {
    color: var(--muted); font-size: 12.5px;
}

/* Access / login (artifact: IDIAP Acceso institucional v3) */
.access {
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    font-size: 16px; line-height: 1.5; color: #1b2a21;
    display: grid; grid-template-columns: 42% minmax(0, 1fr);
    min-height: 100svh; background: #f4f8f4;
    background-image: radial-gradient(ellipse at 97% 0, #dceee0, transparent 33%), radial-gradient(ellipse at 86% 105%, #e0f0e3, transparent 36%);
}
.access .visual {
    isolation: isolate; position: relative;
    display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between;
    gap: 32px; padding: clamp(28px, 3.3vw, 64px); padding-bottom: 38svh;
    clip-path: polygon(0 0, 100% 0, 91% 100%, 0 100%);
    background: radial-gradient(ellipse at 0 0, #235a3d, transparent 58%), #0e3424;
    color: #fff;
}
.access .field-photo {
    position: absolute; z-index: -1; inset: auto 0 0; width: 100%; height: 48%;
    object-fit: cover; object-position: center 65%; opacity: .75;
    -webkit-mask-image: linear-gradient(transparent, #000 27%);
    mask-image: linear-gradient(transparent, #000 27%);
}
.access .visual::after {
    content: ""; position: absolute; inset: 52% 0 0; z-index: -1;
    background: linear-gradient(transparent, #071b13a1);
}
.access .brand {
    display: block; width: clamp(144px, 13vw, 234px); height: auto;
    filter: brightness(0) invert(1);
}
.access .visual p {
    margin: 0; max-width: 17ch; color: #fff;
    font-size: clamp(1.65rem, 2.4vw, 2.85rem); font-weight: 720;
    line-height: 1.1; letter-spacing: -.023em; text-wrap: balance;
}
.access .login { display: grid; place-items: center; padding: 48px clamp(24px, 4vw, 76px); }
.access .inner {
    display: block; width: min(100%, 540px); padding: clamp(28px, 3vw, 52px);
    background: #fff; border: 1px solid #dce6de; border-radius: 24px;
    box-shadow: 0 24px 52px -28px #153c2d60, 0 2px 6px #153c2d0d;
}
.access .inner h1 {
    font-size: clamp(1.75rem, 2.2vw, 2.5rem); letter-spacing: -.025em; line-height: 1.15;
    text-align: center; margin: 0 0 30px; color: var(--ink);
}
.access .eyebrow {
    display: block; margin: -18px 0 22px; text-align: center;
    color: #54695b; font-size: .875rem;
}
.access .row { position: relative; margin-bottom: 16px; }
.access .row input {
    color: #1b2a21; background: #fff;
    border: 1px solid #84998c; border-radius: 11px;
    width: 100%; min-height: 56px; margin-top: 0;
    padding: 12px 46px 12px 50px; font: inherit; font-size: 16px;
}
.access .row input::placeholder { color: #54695b; opacity: 1; }
.access .row input:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(30, 98, 69, .16); }
.access .field-icon {
    position: absolute; left: 17px; top: 50%; translate: 0 -50%;
    color: #54695b; pointer-events: none;
}
.access .field-icon, .access .eye svg, .access .primary svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }
.access .eye {
    display: grid; place-items: center; position: absolute; right: 4px; top: 5px; bottom: 5px;
    width: 44px; min-height: 0; padding: 0; background: transparent; border: 0;
    color: var(--green); border-radius: 7px; box-shadow: none;
}
.access .eye .slash { display: none; }
.access .eye[aria-pressed="true"] .slash { display: block; }
@media (hover: hover) {
    .access .eye:hover { background: #edf4ee; }
}
.access .primary {
    display: flex; align-items: center; justify-content: center; gap: 9px;
    width: 100%; min-height: 56px; padding: 0 16px; margin-top: 4px;
    border: 0; border-radius: 11px;
    background: linear-gradient(#247446, #1c6039); color: #fff;
    font-weight: 650; box-shadow: 0 9px 18px -8px #12492e70;
}
.access .primary:hover, .access .ghost:hover { text-decoration: none; }
.access .primary:hover { background: #194f31; border: 0; }
.access .ghost {
    display: flex; align-items: center; justify-content: center; gap: 9px;
    width: 100%; min-height: 56px; margin-top: 10px;
    border: 1px solid #84998c; border-radius: 11px;
    background: #fff; color: var(--green); font-weight: 650;
}
.access .ghost:hover { background: #edf4ee; }
.access .help { margin: -3px 0 15px; color: #54695b; font-size: .875rem; text-align: right; }
.access .help summary { display: inline-flex; align-items: center; cursor: pointer; min-height: 38px; color: var(--green); font-weight: 650; }
.access .help p { margin: 6px 0 0; text-align: start; }
.access .status { margin: 0; }
.access .status:not(:empty) {
    margin-top: 14px; padding: 10px 12px; background: #edf4ee; border-radius: 7px; font-size: .875rem;
}
.access .status[role="alert"]:not(:empty) { background: #fdecea; color: #a4231c; }
.access .links { margin: 14px 0 0; text-align: center; font-size: .875rem; }
.access .links a { display: inline-block; margin: 0 8px; color: var(--green); font-weight: 600; }
.access :focus-visible { outline: 3px solid #1c5f89; outline-offset: 2px; }

@media (max-width: 760px) {
    .access { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
    .access .visual { clip-path: none; padding: 24px; min-height: 225px; gap: 24px; padding-bottom: 24px; }
    .access .field-photo { height: 100%; opacity: .45; -webkit-mask-image: linear-gradient(90deg, transparent, #000 58%); mask-image: linear-gradient(90deg, transparent, #000 58%); }
    .access .visual::after { inset: 0; background: linear-gradient(90deg, #092719a1, transparent); }
    .access .visual p { font-size: 1.7rem; max-width: 20ch; }
    .access .login { padding: 24px 16px; }
    .access .inner { border-radius: 18px; }
}

/* Blazor template affordances */
.validation-message { color: var(--danger); font-size: 12px; }
.valid.modified:not([type=checkbox]) { outline: 1px solid #2f7a4d; }
.invalid { outline: 1px solid var(--danger); }
.blazor-error-boundary {
    background: var(--danger-bg); color: var(--danger);
    border: 1px solid #f3c9c5; border-radius: var(--radius-sm);
    padding: 16px 16px 16px 16px; margin: 16px 0;
}
.blazor-error-boundary::after { content: "Ocurrió un error."; font-weight: 600; }
#blazor-error-ui {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 1000; display: none;
    background: var(--ink-strong); color: #fff; padding: 12px 20px; font-size: 13px;
    box-shadow: 0 -6px 24px rgba(0, 0, 0, .18);
}
#blazor-error-ui a { color: #9fe0bd; margin-left: 8px; }
.components-reconnect-container { padding: 12px 16px; }

/* Responsive */
@media (max-width: 960px) {
    .app-shell { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
    .app-shell > aside { position: static; height: auto; padding: 14px 18px; border-right: 0; border-bottom: 1px solid var(--line); }
    .app-shell .brand { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0; margin: 0; border: 0; }
    .app-shell .brand img.brand-full { width: 132px; }
    .menu-toggle { display: inline-flex; }
    .app-shell > aside nav { display: none; padding-top: 12px; }
    .app-shell > aside nav.is-open { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .app-shell > aside .nav-family { grid-column: 1 / -1; }
    .app-shell > aside .institution { display: none; }
    .topbar { padding: 0 18px; }
    .workspace > main { padding: 20px 18px 36px; }
    .workspace > footer { padding: 14px 18px; }
    .user-chip { padding-right: 6px; }
    .user-chip .who { display: none; }
    .charts { grid-template-columns: 1fr; }
    .metrics .card { padding-inline: 16px; }
}
@media (max-width: 560px) {
    .app-shell > aside nav.is-open { grid-template-columns: 1fr; }
    .welcome { align-items: flex-start; flex-direction: column; gap: 16px; }
    .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 0; }
    .metrics .card:nth-child(odd) { padding-left: 0; border-left: 0; }
    .card, .panel, .surface { padding: 20px 16px; }
    .busqueda { grid-template-columns: 1fr; }
    .busqueda button { justify-self: start; }
    .row-actions { gap: 8px; }
    .topbar-title { font-size: 12px; }
    .ui-icon-button { min-width: 44px; min-height: 44px; }
    th, td { padding: 10px 12px; }
    dl { grid-template-columns: 1fr; gap: 2px; }
    dt { margin-top: 8px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
