@font-face {
  font-family: "Poppins";
  src: url("../fonts/Poppins-Regular.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Poppins";
  src: url("../fonts/Poppins-Medium.ttf") format("truetype");
  font-style: normal;
  font-weight: 500;
  font-display: swap;
}

@font-face {
  font-family: "Poppins";
  src: url("../fonts/Poppins-SemiBold.ttf") format("truetype");
  font-style: normal;
  font-weight: 600;
  font-display: swap;
}

@font-face {
  font-family: "Poppins";
  src: url("../fonts/Poppins-Bold.ttf") format("truetype");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

@font-face {
  font-family: "Poppins";
  src: url("../fonts/Poppins-ExtraBold.ttf") format("truetype");
  font-style: normal;
  font-weight: 800;
  font-display: swap;
}

@font-face {
  font-family: "Source Sans 3";
  src: url("../fonts/SourceSans3-Variable.ttf") format("truetype");
  font-style: normal;
  font-weight: 200 900;
  font-display: swap;
}

@font-face {
  font-family: "IBM Plex Mono";
  src: url("../fonts/IBMPlexMono-Regular.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "IBM Plex Mono";
  src: url("../fonts/IBMPlexMono-Bold.ttf") format("truetype");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

:root {
  --primary: #15643a;
  --primary-interactive: #1b7a4b;
  --primary-deep: #0e4a2c;
  --primary-soft: #eaf6ee;
  --surface: #ffffff;
  --surface-soft: #f5f7f5;
  --surface-muted: #edf1ee;
  --border: #d7dfd9;
  --border-strong: #aebbb2;
  --text: #17231b;
  --muted: #5c6c62;
  --blue: #1d4ed8;
  --blue-soft: #e9efff;
  --amber: #9a4807;
  --amber-soft: #fff3df;
  --red: #a71717;
  --red-soft: #feeeee;
  --green: #137638;
  --green-soft: #e8f6ec;
  --slate: #475569;
  --state-draft: #475569;
  --state-review: #1d4ed8;
  --state-resolution: #0369a1;
  --state-correction: #b45309;
  --state-approved: #15803d;
  --state-rejected: #b91c1c;
  --shadow-sm: 0 1px 2px rgba(18, 43, 27, 0.05), 0 3px 12px rgba(18, 43, 27, 0.04);
  --shadow-md: 0 16px 40px rgba(18, 43, 27, 0.12);
  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 22px;
  --font-title: Poppins, "Avenir Next", "Segoe UI", sans-serif;
  --font-body: "Source Sans 3", "Segoe UI", Arial, sans-serif;
  --font-mono: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
  --bs-primary: #15643a;
  --bs-primary-rgb: 21, 100, 58;
  --bs-success: #137638;
  --bs-danger: #a71717;
  --bs-body-color: #17231b;
  --bs-body-bg: #f3f6f4;
  --bs-border-color: #d7dfd9;
  --bs-link-color: #0e4a2c;
  --bs-link-hover-color: #15643a;
  --bs-font-sans-serif: var(--font-body);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 9rem; }
body { margin: 0; background: #f3f6f4; color: var(--text); font-family: var(--font-body); font-size: 1rem; line-height: 1.55; }
button, input, select, textarea { font: inherit; }
button, a, select, input[type="checkbox"], input[type="file"] { touch-action: manipulation; }
button { color: inherit; }
a { color: var(--primary-deep); }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { font-family: var(--font-title); line-height: 1.2; }
h1 { margin-bottom: 10px; font-size: clamp(1.8rem, 3vw, 2.55rem); letter-spacing: -0.035em; }
h2 { margin-bottom: 0; font-size: 1.2rem; letter-spacing: -0.015em; }
h3 { font-size: 1rem; }
small { display: block; }

.skip-link { position: fixed; z-index: 1040; top: -100px; left: 8px; padding: 10px 14px; border-radius: 6px; background: var(--primary-deep); color: white; }
.skip-link:focus { top: 8px; }
:focus-visible { outline: 3px solid var(--amber); outline-offset: 3px; }
.sr-only { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }
[hidden] { display: none !important; }

.topbar { position: sticky; z-index: 1030; top: 0; display: flex; align-items: center; justify-content: space-between; min-height: 76px; padding: 10px 28px; border-bottom: 1px solid rgba(14, 74, 44, 0.09); background: rgba(255, 255, 255, 0.97); box-shadow: 0 6px 24px rgba(14, 74, 44, 0.06); backdrop-filter: blur(16px); }
.topbar { flex-wrap: nowrap; gap: 12px; }
.topbar .brand { min-width: 44px; }
.topbar .brand-mark, .topbar .topbar-actions { flex-shrink: 0; }
.brand { min-width: 44px; min-height: 44px; display: inline-flex; align-items: center; gap: 12px; color: var(--text); text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 46px; height: 46px; border: 2px solid #7db591; border-radius: 16px 16px 20px 20px; background: linear-gradient(145deg, var(--primary), var(--primary-deep)); color: white; box-shadow: 0 6px 14px rgba(14, 74, 44, 0.18); font-family: var(--font-title); font-size: 0.82rem; font-weight: 800; }
.brand-copy { min-width: 0; overflow-wrap: anywhere; display: grid; line-height: 1.25; }
.brand-copy strong { font-family: var(--font-title); font-size: 0.98rem; }
.brand-copy small { color: var(--muted); }
.topbar-actions { display: flex; align-items: center; gap: 14px; }
.prototype-role { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 0.82rem; font-weight: 700; }
.prototype-role select { min-height: 44px; padding: 0 34px 0 12px; border: 1px solid var(--border-strong); border-radius: 9px; background: white; color: var(--text); font-weight: 700; }
.notification-button, .icon-button, .dialog-close { display: inline-grid; place-items: center; width: 44px; height: 44px; border: 1px solid var(--border); border-radius: 10px; background: white; cursor: pointer; }
.notification-button { position: relative; color: var(--amber); }
.notification-count { position: absolute; top: -5px; right: -5px; display: grid; place-items: center; width: 20px; height: 20px; border: 2px solid white; border-radius: 50%; background: var(--red); color: white; font-size: 0.75rem; font-weight: 800; }
.account { display: flex; align-items: center; gap: 9px; min-width: 144px; }
.account > span:last-child { line-height: 1.25; }
.account strong, .account small { display: block; }
.account small { color: var(--muted); font-size: 0.82rem; }
.avatar { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--primary-deep); color: white; font-family: var(--font-title); font-size: 0.8rem; font-weight: 800; }
.account-button { min-height: 52px; padding: 5px 10px; border: 1px solid transparent; border-radius: 12px; background: transparent; text-align: left; cursor: pointer; }
.account-button:hover, .account-button[aria-expanded="true"] { border-color: #c8d9cd; background: var(--primary-soft); }
.account-button::after { margin-left: 6px; color: var(--muted); }
.account-menu { width: min(280px, calc(100vw - 32px)); margin-top: 8px !important; padding: 8px; border-color: var(--border); border-radius: 14px; box-shadow: 0 18px 45px rgba(14, 54, 30, 0.17); }
.account-menu-header { overflow-wrap: anywhere; padding: 10px 12px 7px; }
.account-menu-header strong, .account-menu-header small { display: block; }
.account-menu-header small { margin-top: 3px; color: var(--muted); }
.account-menu .dropdown-item { display: flex; align-items: center; gap: 10px; min-height: 44px; border-radius: 8px; font-weight: 700; }
.account-menu .dropdown-item .bi { width: 22px; color: var(--primary); font-size: 1rem; }
.account-menu .dropdown-item.text-danger .bi { color: inherit; }
.account-menu .dropdown-item:active { background: var(--primary); }

.app-shell { display: grid; grid-template-columns: 252px minmax(0, 1fr); min-height: calc(100vh - 76px); }
.sidebar { position: sticky; top: 76px; display: flex; flex-direction: column; height: calc(100vh - 76px); padding: 20px 14px; overflow-y: auto; border-right: 0; background: linear-gradient(180deg, #103f29 0%, #0b3220 100%); box-shadow: 8px 0 28px rgba(8, 44, 25, 0.08); color: white; }
.prototype-note { margin: 0 4px 18px; padding: 12px; border: 1px dashed rgba(193, 231, 204, 0.45); border-radius: 10px; background: rgba(255, 255, 255, 0.08); color: #effaf2; font-size: 0.82rem; }
.prototype-note strong { display: block; }
.nav-list { display: grid; gap: 5px; margin: 0; padding: 0; list-style: none; }
.nav-item { display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 9px; width: 100%; min-height: 48px; padding: 6px 10px; border: 0; border-radius: 10px; background: transparent; color: #cfe2d5; text-align: left; text-decoration: none; cursor: pointer; }
.nav-item:disabled { opacity: 0.65; cursor: not-allowed; }
.nav-item:not(:disabled):hover { background: rgba(255, 255, 255, 0.08); color: white; }
.nav-item.active { background: rgba(255, 255, 255, 0.13); color: white; font-weight: 800; box-shadow: inset 3px 0 #83d3a0; }
.nav-icon { display: grid; place-items: center; width: 32px; height: 32px; border: 1px solid rgba(255, 255, 255, 0.18); border-radius: 8px; background: rgba(255, 255, 255, 0.07); color: #dff1e4; font-family: var(--font-title); font-size: 0.76rem; font-weight: 800; }
.nav-item.active .nav-icon { border-color: #8dcba2; background: #e9f7ed; color: var(--primary-deep); }
.nav-icon .bi { font-size: 1.05rem; line-height: 1; }
.nav-badge { min-width: 24px; padding: 1px 6px; border-radius: 999px; background: rgba(255, 255, 255, 0.14); color: #effaf2; font-size: 0.75rem; font-weight: 800; text-align: center; }
.sidebar-help { margin-top: auto; padding: 18px 10px 4px; border-top: 1px solid rgba(255, 255, 255, 0.13); color: #e5f2e9; font-size: 0.84rem; }
.sidebar-help { display: grid; grid-template-columns: 34px 1fr; gap: 10px; }
.sidebar-help p { margin: 4px 0 6px; color: #afc8b7; }
.sidebar-help .link-button { grid-column: 2; justify-self: start; }
.sidebar-help .link-button { color: #ccebd5; }
.help-mark { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: rgba(255, 255, 255, 0.11); color: white; font-weight: 800; }

.main { overflow-wrap: anywhere; min-width: 0; padding: 38px clamp(20px, 4vw, 58px) 70px; background: radial-gradient(circle at 90% -10%, rgba(117, 179, 137, 0.12), transparent 34%), #f3f6f4; }
.view { display: none; width: 100%; max-width: 1480px; margin: 0 auto; }
.view.active { display: block; animation: view-in 180ms ease-out; }
@keyframes view-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 25px; }
.page-heading p { max-width: 800px; margin-bottom: 0; color: var(--muted); }
.eyebrow { margin-bottom: 5px !important; color: var(--primary) !important; font-family: var(--font-title); font-size: 0.75rem !important; font-weight: 800; letter-spacing: 0.11em; text-transform: uppercase; }
.breadcrumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; color: var(--muted); font-size: 0.86rem; }
.breadcrumbs a { display: inline-flex; align-items: center; min-height: 44px; min-width: 44px; color: var(--primary-deep); font-weight: 700; text-underline-offset: 3px; }
.code { font-family: var(--font-mono); letter-spacing: -0.025em; }
.heading-line { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; }
.heading-line h1, .heading-line h2 { margin-bottom: 0; }
.muted { color: var(--muted); font-size: 0.85rem; }

.button, .link-button, .table-link, .queue-item, .metric-button { cursor: pointer; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 9px 17px; border: 1px solid transparent; border-radius: 9px; font-weight: 800; text-decoration: none; }
.button .bi, .link-button .bi { margin-right: 4px; }
.button.primary, .btn-primary { --bs-btn-bg: var(--primary-interactive); --bs-btn-border-color: var(--primary-interactive); --bs-btn-hover-bg: var(--primary-deep); --bs-btn-hover-border-color: var(--primary-deep); --bs-btn-active-bg: var(--primary-deep); --bs-btn-active-border-color: var(--primary-deep); background: var(--primary-interactive); color: white; box-shadow: 0 4px 10px rgba(27, 122, 75, 0.18); }
.button.primary:hover { background: var(--primary-deep); }
.button.secondary, .btn-outline-primary { --bs-btn-color: var(--primary-deep); --bs-btn-border-color: var(--primary); --bs-btn-hover-bg: var(--primary); --bs-btn-hover-border-color: var(--primary); --bs-btn-active-bg: var(--primary-deep); --bs-btn-active-border-color: var(--primary-deep); border-color: var(--primary); background: white; color: var(--primary-deep); }
.button.secondary:hover, .button.soft { background: var(--primary-soft); }
.button.ghost { border-color: var(--border); background: white; color: var(--text); }
.button.success { background: var(--green); color: white; }
.button.danger { background: var(--red); color: white; }
.button.compact { min-height: 44px; padding: 7px 13px; }
.button.full { width: 100%; }
.button:disabled { border-color: var(--border); background: var(--surface-muted); color: #7e8a82; cursor: not-allowed; box-shadow: none; }
.button-group { display: flex; gap: 8px; }
.link-button, .table-link { display: inline-flex; align-items: center; min-width: 44px; min-height: 44px; padding: 7px 2px; border: 0; background: transparent; color: var(--primary-deep); font-weight: 800; text-decoration: underline; text-decoration-color: #9bbca5; text-underline-offset: 4px; }
.table-link { padding: 7px 2px; text-align: left; }
.table-link.code { font-weight: 700; }
.table-link.large { display: block; margin-top: 9px; font-size: 1rem; }
.icon-button { flex: 0 0 auto; color: var(--primary-deep); font-weight: 900; }

.notice { display: flex; align-items: center; gap: 13px; margin-bottom: 20px; padding: 14px 16px; border: 1px solid; border-radius: var(--radius); }
.notice > div { flex: 1; }
.notice p, .notice ul { margin: 2px 0 0; }
.notice small { margin-top: 6px; }
.notice.warning { border-color: #e2bd7e; background: var(--amber-soft); color: #572b05; }
.notice.info { border-color: #abc1f4; background: var(--blue-soft); color: #17377e; }
.notice.danger { border-color: #e1a2a2; background: var(--red-soft); color: #691212; }
.notice-icon { display: grid; place-items: center; flex: 0 0 auto; width: 34px; height: 34px; border: 1px solid currentColor; border-radius: 50%; font-weight: 900; }

.panel { overflow-wrap: anywhere; min-width: 0; overflow: hidden; border: 1px solid rgba(174, 187, 178, 0.68); border-radius: 16px; background: var(--surface); box-shadow: 0 8px 28px rgba(18, 43, 27, 0.06); }
.panel-heading { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; min-height: 70px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.compact-heading { min-height: 58px; }
.panel-heading p { margin-bottom: 0; }
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 20px; }
.home-metrics { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.metric-card { display: flex; align-items: center; gap: 13px; min-height: 126px; padding: 18px; border: 1px solid rgba(174, 187, 178, 0.62); border-radius: 16px; background: white; box-shadow: 0 8px 24px rgba(18, 43, 27, 0.055); transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease; }
.metric-card p, .metric-label { display: block; margin-bottom: 4px; color: var(--muted); font-size: 0.86rem; font-weight: 700; }
.metric-card strong { display: block; font-family: var(--font-title); font-size: 1.55rem; line-height: 1.1; }
.metric-card small { margin-top: 6px; color: var(--muted); font-size: 0.75rem; }
.metric-icon { display: grid; place-items: center; flex: 0 0 auto; width: 42px; height: 42px; border-radius: 11px; font-family: var(--font-title); font-size: 0.78rem; font-weight: 900; }
.metric-icon .bi { font-size: 1.15rem; line-height: 1; }
.metric-icon.green { background: var(--green-soft); color: var(--green); }
.metric-icon.amber { background: var(--amber-soft); color: var(--amber); }
.metric-icon.blue { background: var(--blue-soft); color: var(--blue); }
.metric-icon.gray { background: var(--surface-muted); color: var(--slate); }
.metric-button { width: 100%; color: var(--text); text-align: left; }
.metric-button:hover { transform: translateY(-2px); border-color: #8fba9c; box-shadow: 0 12px 28px rgba(21, 100, 58, 0.11); }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.8fr) minmax(300px, 0.72fr); gap: 20px; }
/* Inicio del Solicitante: estado y acción visibles sin desplazamiento horizontal. */
.home-dashboard { align-items: start; }
.home-total, .home-list-context, .home-request-identity p, .home-request-date { color: var(--muted); }
.home-total { margin-top: 4px; font-size: 0.9rem; }
.home-list-context { margin: 0; padding: 12px 20px; border-bottom: 1px solid var(--border); font-size: 0.85rem; }
.home-request-list { margin: 0; padding: 0; list-style: none; }
.home-request { display: grid; grid-template-columns: minmax(0, 1fr); align-items: center; gap: 16px; padding: 16px 20px; }
.home-request + .home-request { border-top: 1px solid var(--border); }
.home-request-identity { min-width: 0; }
.home-request-identity p { margin: 0; }
.home-request-summary { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.home-request-summary .status { max-width: 100%; white-space: normal; }
.home-request-date { margin: 0; font-size: 0.85rem; }
.home-request-date time { color: var(--text); font-variant-numeric: tabular-nums; }
.home-request-action { width: 100%; text-align: center; }
/* Mis solicitudes amplía la misma fila adaptable que Inicio. */
.request-actions { display: grid; gap: 8px; min-width: 0; }
.request-detail-link { justify-self: center; text-align: center; }
.request-details { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr)); grid-column: 1 / -1; gap: 16px; margin: 0; padding-top: 16px; border-top: 1px solid var(--border); }
.request-details > div { min-width: 0; }
.request-details dt { color: var(--muted); font-size: 0.85rem; font-weight: 600; }
.request-details dd { margin: 4px 0 0; }
.request-details time { font-variant-numeric: tabular-nums; }
.requests-pagination { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; border-top: 1px solid var(--border); }
.requests-pagination p { margin: 0 auto 0 0; }

.home-guidance-content { padding: 20px; }
.home-guidance-content > p { margin-bottom: 16px; }
.home-guidance-reference { color: var(--primary-deep); }
.home-guidance-reference strong { display: block; margin-top: 4px; }
@media (min-width: 680px) {
  .home-request { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 12rem); gap: 20px; }
  .home-request-summary { display: grid; justify-items: start; }
}
.table-scroll { position: relative; width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 14px 18px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: middle; }
th { background: #fafbfa; color: var(--muted); font-size: 0.76rem; letter-spacing: 0.03em; text-transform: uppercase; }
tbody tr:last-child td { border-bottom: 0; }
td small { margin-top: 3px; color: var(--muted); }
.data-table { table-layout: fixed; }
.table.data-table > :not(caption) > * > * { height: 68px; padding: 14px 18px; vertical-align: middle; }
.data-table thead th { height: 50px; line-height: 1.3; }
.data-table td > strong:first-child { display: block; line-height: 1.35; }
.data-table td small { line-height: 1.35; overflow-wrap: anywhere; }
.admin-recent-table { min-width: 44rem; }
.workload-table { min-width: 900px; }
.workload-table th:first-child { width: 22%; }
.workload-table th:nth-child(2) { width: 10%; }
.workload-table th:nth-child(3) { width: 12%; }
.workload-table th:nth-child(4) { width: 13%; }
.workload-table th:nth-child(5) { width: 27%; }
.workload-table th:nth-child(6) { width: 16%; }
.workload-table th:nth-child(2), .workload-table th:nth-child(3), .workload-table th:nth-child(4),
.workload-table td:nth-child(2), .workload-table td:nth-child(3), .workload-table td:nth-child(4) { text-align: center; }
.workload-table td:last-child { white-space: nowrap; }
.users-table { min-width: 760px; }
.users-table th:first-child { width: 34%; }
.users-table th:nth-child(2) { width: 18%; }
.users-table th:nth-child(3) { width: 16%; }
.users-table th:nth-child(4) { width: 20%; }
.users-table th:nth-child(5) { width: 12%; }
.users-table td:nth-child(2), .users-table td:nth-child(3), .users-table td:nth-child(4) { white-space: nowrap; }
.users-table th:last-child, .users-table td:last-child { text-align: center; }
.users-table td:last-child .link-button { min-width: 80px; padding-right: 10px; padding-left: 10px; }
.status { display: inline-flex; align-items: center; min-height: 30px; padding: 4px 10px; border: 1px solid; border-radius: 999px; font-size: 0.77rem; font-weight: 800; white-space: nowrap; }
.status.resolution { border-color: #7dd3fc; background: #e0f2fe; color: #0c4a6e; }
.status.review { border-color: #9cb4ed; background: var(--blue-soft); color: #163b9a; }
.status.correction { border-color: #deb472; background: var(--amber-soft); color: #773703; }
.status.approved { border-color: #91c8a4; background: var(--green-soft); color: #0b5c2c; }
.status.rejected { border-color: #e0a0a0; background: var(--red-soft); color: #8a1414; }
.status.draft { border-color: #b7c0ca; background: #f0f3f6; color: #3d4b5a; }
.next-steps { display: flex; flex-direction: column; padding-bottom: 18px; }
.task-list { position: relative; display: grid; gap: 0; margin: 10px 20px 16px; padding: 0; list-style: none; }
.task-list li { position: relative; display: grid; grid-template-columns: 34px 1fr; gap: 11px; min-height: 68px; }
.task-list li:not(:last-child)::after { content: ""; position: absolute; top: 34px; bottom: 0; left: 16px; width: 2px; background: var(--border); }
.task-list li > span { z-index: 1; display: grid; place-items: center; width: 34px; height: 34px; border: 2px solid var(--border-strong); border-radius: 50%; background: white; color: var(--muted); font-weight: 800; }
.task-list li.done > span { border-color: var(--primary); background: var(--primary); color: white; }
.task-list li.current > span { border-color: var(--amber); background: var(--amber-soft); color: var(--amber); }
.task-list strong { display: block; margin-top: 3px; }
.task-list small { color: var(--muted); }
.next-steps > .button { align-self: center; width: calc(100% - 40px); margin: auto 20px 0; }

.filter-panel { margin-bottom: 18px; }
.filter-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr auto; gap: 12px; align-items: end; padding: 17px 20px 20px; }
.filter-grid.five { grid-template-columns: repeat(4, minmax(130px, 1fr)) auto; }
label { display: grid; gap: 6px; color: var(--text); font-size: 0.88rem; font-weight: 700; }
label small, .form-hint { color: var(--muted); font-size: 0.79rem; font-weight: 400; }
input, select, textarea { width: 100%; min-height: 44px; padding: 10px 11px; border: 1px solid var(--border-strong); border-radius: 8px; background: white; color: var(--text); }
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus, .form-control:focus, .form-select:focus { border-color: var(--primary); box-shadow: 0 0 0 0.22rem rgba(27, 122, 75, 0.14); outline: 0; }
input[aria-invalid="true"], select[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: var(--red); }
.application-list { display: grid; }
.application-row { display: grid; grid-template-columns: minmax(230px, 1.15fr) minmax(360px, 1.8fr) auto; align-items: center; gap: 22px; padding: 20px; border-bottom: 1px solid var(--border); }
.application-row:last-child { border-bottom: 0; }
.application-row.urgent { box-shadow: inset 4px 0 var(--amber); }
.application-row p { margin: 5px 0 0; color: var(--muted); }
.application-row dl { display: grid; grid-template-columns: repeat(3, minmax(100px, 1fr)); gap: 16px; margin: 0; }
dt { color: var(--muted); font-size: 0.75rem; font-weight: 700; text-transform: uppercase; }
dd { margin: 3px 0 0; font-weight: 700; }

.stage-track, .form-stepper { display: grid; grid-template-columns: repeat(4, 1fr); margin: 0 0 20px; padding: 18px 24px; border: 1px solid var(--border); border-radius: var(--radius); background: white; list-style: none; box-shadow: var(--shadow-sm); }
.stage-track li, .form-stepper li { position: relative; display: flex; align-items: center; gap: 10px; }
.stage-track li:not(:last-child)::after, .form-stepper li:not(:last-child)::after { content: ""; position: absolute; z-index: 0; top: 18px; right: 8px; left: 52px; height: 2px; background: var(--border); }
.stage-track li > span, .form-stepper li > span { z-index: 1; display: grid; place-items: center; width: 36px; height: 36px; border: 2px solid var(--border-strong); border-radius: 50%; background: white; color: var(--muted); font-weight: 800; }
.stage-track li.complete > span, .form-stepper li.complete > span { border-color: var(--primary); background: var(--primary); color: white; }
.stage-track li.current > span, .form-stepper li.active > span { border-color: var(--amber); background: var(--amber-soft); color: var(--amber); }
.stage-track li div { z-index: 1; padding-right: 8px; background: white; }
.stage-track li small { color: var(--muted); }
.detail-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; }
.detail-main { display: grid; gap: 18px; }
.detail-main > .notice { margin-bottom: 0; }
.data-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; margin: 0; padding: 20px; }
.document-list { display: grid; }
.document-row { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto 44px; align-items: center; gap: 13px; padding: 14px 20px; border-bottom: 1px solid var(--border); }
.document-row small { color: var(--muted); }
.file-type { display: grid; place-items: center; width: 46px; height: 48px; border-radius: 8px; background: var(--surface-muted); color: var(--primary-deep); font-family: var(--font-mono); font-size: 0.75rem; font-weight: 700; }
.document-state { font-size: 0.8rem; font-weight: 800; }
.document-state.pending { color: var(--amber); }
.document-state.verified { color: var(--green); }
.upload-box { display: grid; grid-template-columns: minmax(220px, 1fr) minmax(180px, 1fr) auto; align-items: end; gap: 12px; margin: 18px 20px 20px; padding: 16px; border: 1px dashed #8db39a; border-radius: 10px; background: var(--primary-soft); }
.upload-box label span { color: var(--muted); font-weight: 400; }
.timeline { margin: 0; padding: 20px 22px 8px; list-style: none; }
.timeline li { position: relative; display: grid; grid-template-columns: 18px 1fr; gap: 12px; min-height: 84px; }
.timeline li:not(:last-child)::after { content: ""; position: absolute; top: 18px; bottom: -3px; left: 7px; width: 2px; background: var(--border); }
.timeline-dot { z-index: 1; width: 16px; height: 16px; margin-top: 2px; border: 4px solid var(--primary-soft); border-radius: 50%; background: var(--primary); box-shadow: 0 0 0 1px var(--primary); }
.timeline p { margin: 2px 0; color: var(--muted); }
.timeline small { color: var(--muted); }
.sticky-panel { position: sticky; top: 96px; padding-bottom: 18px; }
.summary-list { margin: 0; padding: 8px 20px; }
.summary-list div { padding: 12px 0; border-bottom: 1px solid var(--border); }
.summary-list div:last-child { border-bottom: 0; }
.sticky-panel > .button, .sticky-panel > p { width: calc(100% - 40px); margin-right: 20px; margin-left: 20px; }

.form-panel { padding: 0; overflow: hidden; }
.form-step { min-width: 0; margin: 0; padding: 28px; border: 0; }
.form-step legend { width: 100%; padding: 0; font-family: var(--font-title); font-size: 1.35rem; font-weight: 800; }
.form-step legend .eyebrow { display: block; }
.section-copy { color: var(--muted); }
.form-grid { display: grid; gap: 18px; }
.form-grid.two-columns { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.full-field { grid-column: 1 / -1; }
.form-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 28px; border-top: 1px solid var(--border); background: #fafbfa; }
.form-actions > div { display: flex; gap: 8px; }
.requirements-box { margin-bottom: 18px; padding: 16px 18px; border-left: 4px solid var(--primary); border-radius: 8px; background: var(--primary-soft); }
.requirements-box ul { margin: 8px 0; }
.requirements-box p { margin-bottom: 0; color: var(--muted); font-size: 0.86rem; }
.dropzone { place-items: center; min-height: 220px; padding: 22px; border: 2px dashed #8daa95; border-radius: var(--radius); background: #fbfdfb; text-align: center; cursor: pointer; }
.dropzone:hover { background: var(--primary-soft); }
.dropzone span { color: var(--muted); font-weight: 400; }
.dropzone input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.upload-mark { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; background: var(--primary-soft); color: var(--primary-deep) !important; font-size: 1.6rem; }
.selected-files { display: grid; gap: 8px; margin: 16px 0 0; padding: 0; list-style: none; }
.selected-files li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 13px; border: 1px solid var(--border); border-radius: 8px; background: white; }
.selected-files .empty-state { justify-content: center; border-style: dashed; color: var(--muted); }
.confirmation-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.confirmation-grid section { padding: 18px; border: 1px solid var(--border); border-radius: 10px; }
.confirmation-grid dl { margin-bottom: 0; }
.confirmation-grid dl div { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.check-label { grid-template-columns: 22px 1fr; align-items: start; gap: 10px; min-height: 44px; padding: 7px 0; cursor: pointer; }
.check-label input { width: 20px; min-height: 20px; margin-top: 1px; accent-color: var(--primary); }

.review-layout { display: grid; grid-template-columns: minmax(290px, 0.72fr) minmax(0, 1.5fr); gap: 18px; }
.queue-panel { align-self: start; overflow: hidden; }
.queue-panel select { width: auto; }
.queue-list { display: grid; }
.queue-item { display: flex; align-items: center; justify-content: space-between; gap: 15px; width: 100%; min-height: 96px; padding: 14px 18px; border: 0; border-bottom: 1px solid var(--border); background: white; text-align: left; }
.queue-item:last-child { border-bottom: 0; }
.queue-item:hover { background: var(--surface-soft); }
.queue-item.selected { background: var(--primary-soft); box-shadow: inset 4px 0 var(--primary); }
.queue-item > span { display: grid; gap: 4px; }
.queue-item > span:last-child { color: var(--muted); text-align: right; }
.queue-item .status { justify-self: start; }
.review-summary dl { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin: 0; padding: 17px 20px; border-bottom: 1px solid var(--border); }
.review-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; padding: 22px 20px; }
.observation { padding: 15px; border-left: 4px solid var(--amber); border-radius: 8px; background: var(--amber-soft); }
.observation p { margin: 4px 0; }
.observation small { color: #70451e; }
.action-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; padding: 16px 20px; border-top: 1px solid var(--border); background: #fafbfa; }
.action-bar > div { display: flex; gap: 8px; margin-left: auto; }
.admin-only-note { margin: 0 0 0 auto; color: var(--muted); font-size: 0.84rem; }

.reports-metrics { margin-top: 20px; }
.analytics-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-bottom: 18px; }
.report-chart-card { min-width: 0; }
.chart-heading-icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 11px; background: var(--primary-soft); color: var(--primary-deep); font-size: 1.1rem; }
.donut-layout { display: grid; grid-template-columns: minmax(210px, 0.82fr) minmax(230px, 1fr); align-items: center; gap: 24px; padding: 24px; }
.chart-canvas-wrap { position: relative; width: 100%; min-width: 0; }
.status-canvas-wrap { height: 270px; }
.trend-canvas-wrap { height: 270px; padding: 0 20px 12px; }
.chart-canvas-wrap canvas { width: 100% !important; height: 100% !important; }
.chart-legend { display: grid; gap: 3px; margin: 0; padding: 0; list-style: none; }
.chart-legend li { display: grid; grid-template-columns: 12px 1fr auto; align-items: center; gap: 10px; min-height: 47px; padding: 7px 0; border-bottom: 1px solid var(--border); }
.chart-legend li:last-child { border-bottom: 0; }
.chart-legend strong, .chart-legend small { display: block; }
.chart-legend small { color: var(--muted); font-size: 0.78rem; }
.chart-legend b { font-family: var(--font-title); font-size: 1rem; }
.legend-dot { width: 10px; height: 10px; border-radius: 50%; }
.draft-dot { background: #64748b; }
.review-dot { background: #2563eb; }
.correction-dot { background: #d97706; }
.approved-dot { background: #15803d; }
.rejected-dot { background: #b91c1c; }
.trend-badge { display: inline-flex; align-items: center; gap: 5px; min-height: 32px; padding: 5px 10px; border-radius: 999px; background: var(--green-soft); color: var(--green); font-size: 0.8rem; font-weight: 800; }
.trend-summary { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 20px 22px 8px; }
.trend-summary > div { display: flex; align-items: baseline; gap: 8px; }
.trend-summary strong { font-family: var(--font-title); font-size: 2rem; line-height: 1; }
.trend-summary span { color: var(--muted); font-weight: 700; }
.trend-summary p { margin: 0; color: var(--green); font-size: 0.82rem; font-weight: 700; }
.chart-footnotes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 0; padding: 14px 20px 20px; border-top: 1px solid var(--border); }
.chart-footnotes div { padding: 0 12px; border-right: 1px solid var(--border); }
.chart-footnotes div:last-child { border-right: 0; }
.chart-footnotes dt { font-size: 0.75rem; }
.chart-footnotes dd { font-size: 0.9rem; }
.workload-progress { display: grid; grid-template-columns: minmax(90px, 1fr) auto; align-items: center; gap: 8px; min-width: 150px; }
.workload-progress .progress { height: 8px; background: var(--surface-muted); }
.workload-progress .progress-bar { border-radius: 999px; background: linear-gradient(90deg, #3e9460, var(--primary-deep)); }
.workload-progress small { margin: 0; color: var(--muted); font-weight: 700; }

.auth-layout { display: flex; flex-wrap: wrap; min-height: 650px; overflow: hidden; border: 1px solid rgba(174, 187, 178, 0.72); border-radius: 26px; background: white; box-shadow: 0 24px 70px rgba(14, 74, 44, 0.15); }
.auth-intro { overflow-wrap: anywhere; display: flex; flex-direction: column; justify-content: center; padding: clamp(34px, 5vw, 64px); background: radial-gradient(circle at 10% 5%, rgba(146, 211, 166, 0.2), transparent 30%), linear-gradient(145deg, #135b36, #0b3421); color: white; }
.auth-intro .eyebrow { margin-top: 24px !important; color: #dff5e5 !important; }
.auth-intro h1 { max-width: 420px; margin: 16px 0 12px; font-size: clamp(1.55rem, 2.4vw, 2rem); text-wrap: balance; }
.auth-intro > p { color: #e5f2e9; }
.auth-logo { align-self: center; width: clamp(132px, 12vw, 156px); height: auto; border: 0; border-radius: 0; object-fit: contain; box-shadow: none; }
.auth-card { display: flex; flex-direction: column; justify-content: center; border: 0; border-radius: 0; box-shadow: none; }
.auth-panel { display: grid; gap: 22px; width: min(560px, 100%); margin: 0 auto; padding: 36px clamp(24px, 6vw, 70px); }
.auth-panel #login-title + p { margin: 7px 0 16px; color: var(--muted); }
.auth-options { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.auth-options .check-label { min-height: 44px; }
.password-rules { display: flex; flex-wrap: wrap; gap: 6px 20px; margin: -6px 0 0; padding: 12px 16px 12px 32px; border-radius: 8px; background: var(--surface-muted); color: var(--muted); font-size: 0.8rem; }
.public-page { display: flex; flex-direction: column; min-height: 100vh; background: radial-gradient(circle at 8% 22%, rgba(111, 177, 132, 0.18), transparent 25%), radial-gradient(circle at 92% 82%, rgba(70, 133, 91, 0.1), transparent 26%), #eef3ef; }
.access-main { display: flex; align-items: center; flex: 1; width: 100%; padding: clamp(24px, 4vw, 52px); }
.auth-landing { width: min(1220px, 100%); margin: 0 auto; }
.auth-panel #login-title { margin-bottom: 0; font-size: clamp(1.8rem, 3vw, 2.35rem); letter-spacing: -0.035em; }
.public-footer { width: min(1220px, calc(100% - 48px)); margin: 0 auto; padding: 0 0 30px; color: var(--primary-deep); font-size: 0.82rem; text-align: center; }
.public-footer p { margin: 0; }

.settings-layout { align-items: start; }
.settings-profile { position: sticky; top: 100px; }
.settings-profile-cover { height: 118px; background: radial-gradient(circle at 85% 15%, rgba(255, 255, 255, 0.2), transparent 25%), linear-gradient(135deg, var(--primary-interactive), var(--primary-deep)); }
.settings-profile-body { padding: 0 24px 24px; }
.settings-avatar { width: 82px; height: 82px; margin: -42px 0 18px; border: 5px solid white; box-shadow: 0 8px 22px rgba(14, 74, 44, 0.2); font-size: 1.05rem; }
.settings-profile h2 { font-size: 1.45rem; }
.settings-role { margin: 4px 0 20px; color: var(--muted); font-weight: 700; }
.settings-summary { margin: 0; }
.settings-summary div { padding: 13px 0; border-top: 1px solid var(--border); }
.settings-summary dd { overflow-wrap: anywhere; }
.settings-section-mark { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 11px; background: var(--primary-soft); color: var(--primary-deep); font-family: var(--font-mono); font-weight: 700; }
.settings-form { display: grid; gap: 22px; padding: 24px; }
.preference-list { display: grid; gap: 0; margin: 0; padding: 0; border: 0; }
.preference-list legend { margin-bottom: 8px; font-family: var(--font-title); font-size: 0.9rem; font-weight: 800; }
.preference-list .form-check { display: flex; align-items: center; min-height: 66px; margin: 0; padding: 11px 0 11px 3.25rem; border-bottom: 1px solid var(--border); }
.preference-list .form-check:last-child { border-bottom: 0; }
.preference-list .form-check-input { width: 2.25rem; min-height: 1.25rem; margin-left: -3.25rem; padding: 0; cursor: pointer; }
.preference-list .form-check-input:checked { border-color: var(--primary-interactive); background-color: var(--primary-interactive); }
.preference-list .form-check-label { display: block; margin: 0; cursor: pointer; }
.preference-list .form-check-label strong, .preference-list .form-check-label small { display: block; }
.preference-list .form-check-label small { margin-top: 2px; color: var(--muted); font-weight: 400; }
.settings-actions { display: flex; justify-content: flex-end; padding-top: 4px; }

dialog { width: min(600px, calc(100% - 28px)); padding: 0; border: 0; border-radius: var(--radius-lg); background: white; color: var(--text); box-shadow: var(--shadow-md); }
dialog::backdrop { background: rgba(9, 29, 16, 0.6); backdrop-filter: blur(2px); }
.dialog-card { display: grid; gap: 18px; padding: 24px; }
.dialog-card p { margin-bottom: 0; }
.dialog-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.dialog-close { border: 0; background: var(--surface-muted); font-size: 1.35rem; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 4px; }
.decision-summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 15px; border-radius: 9px; background: var(--surface-muted); }
.decision-summary strong { color: var(--primary-deep); }
.swal2-container { z-index: 2000; font-family: var(--font-body); }
.swal2-container.swal2-backdrop-show { background: rgba(9, 29, 16, 0.62); backdrop-filter: blur(2px); }
.swal2-popup.municipal-alert { width: min(500px, calc(100% - 28px)); padding: 28px; border: 1px solid var(--border); border-top: 5px solid var(--primary); border-radius: 20px; background: var(--surface); box-shadow: var(--shadow-md); }
.swal2-popup.municipal-alert-success { border-top-color: var(--state-approved); }
.swal2-popup.municipal-alert-info { border-top-color: var(--state-review); }
.swal2-popup.municipal-alert-warning { border-top-color: var(--state-correction); }
.swal2-popup.municipal-alert-error { border-top-color: var(--state-rejected); }
.swal2-popup.municipal-alert-question { border-top-color: var(--primary); }
.municipal-alert .swal2-title { padding: 0; color: var(--text); font-family: var(--font-title); font-size: 1.45rem; line-height: 1.25; }
.municipal-alert .swal2-html-container { margin: 12px 0 0; color: var(--muted); font-size: 1rem; line-height: 1.55; }
.municipal-alert .swal2-actions { gap: 9px; margin-top: 24px; }
.municipal-alert .swal2-confirm, .municipal-alert .swal2-cancel { margin: 0; }
.municipal-alert .swal2-close { color: var(--muted); }
.municipal-alert .swal2-close:hover { color: var(--primary-deep); }
.municipal-toast.swal2-popup { padding: 14px 16px; border: 1px solid var(--border); border-left: 5px solid var(--primary); border-radius: 14px; background: var(--surface); box-shadow: var(--shadow-md); }
.municipal-toast.swal2-popup.municipal-toast-success { border-color: #91c8a4; border-left-color: var(--state-approved); background: var(--green-soft); }
.municipal-toast.swal2-popup.municipal-toast-info { border-color: #9cb4ed; border-left-color: var(--state-review); background: var(--blue-soft); }
.municipal-toast.swal2-popup.municipal-toast-warning { border-color: #deb472; border-left-color: var(--state-correction); background: var(--amber-soft); }
.municipal-toast.swal2-popup.municipal-toast-error { border-color: #e0a0a0; border-left-color: var(--state-rejected); background: var(--red-soft); }
.municipal-toast.swal2-popup.municipal-toast-question { border-color: #8db39a; border-left-color: var(--primary); background: var(--primary-soft); }
.municipal-toast .swal2-title { color: var(--text); font-family: var(--font-title); font-size: 0.98rem; }
.municipal-toast .swal2-html-container { color: var(--muted); font-size: 0.88rem; line-height: 1.4; }
.municipal-toast .swal2-close { color: var(--muted); }
.municipal-toast-success .swal2-timer-progress-bar { background: var(--state-approved); }
.municipal-toast-info .swal2-timer-progress-bar { background: var(--state-review); }
.municipal-toast-warning .swal2-timer-progress-bar { background: var(--state-correction); }
.municipal-toast-error .swal2-timer-progress-bar { background: var(--state-rejected); }
.municipal-toast-question .swal2-timer-progress-bar { background: var(--primary); }
.swal2-icon.swal2-success { border-color: var(--state-approved); color: var(--state-approved); }
.swal2-icon.swal2-success .swal2-success-ring { border-color: rgba(21, 128, 61, 0.28); }
.swal2-icon.swal2-success [class^="swal2-success-line"] { background-color: var(--state-approved); }
.swal2-icon.swal2-warning { border-color: var(--state-correction); color: var(--state-correction); }
.swal2-icon.swal2-error { border-color: var(--state-rejected); color: var(--state-rejected); }
.swal2-icon.swal2-error [class^="swal2-x-mark-line"] { background-color: var(--state-rejected); }
.swal2-icon.swal2-info { border-color: var(--state-review); color: var(--state-review); }
.swal2-icon.swal2-question { border-color: var(--primary); color: var(--primary); }
.municipal-toast .swal2-success-fix,
.municipal-toast .swal2-success-circular-line-left,
.municipal-toast .swal2-success-circular-line-right { background-color: transparent !important; }

@media (max-width: 1280px) {
  .dashboard-grid { grid-template-columns: 1fr; }
}

@media (max-width: 1180px) {
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .detail-layout, .review-layout { grid-template-columns: 1fr; }
  .sticky-panel { position: static; }
  .filter-grid, .filter-grid.five { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filter-grid .button { align-self: end; }
  .application-row { grid-template-columns: 1fr auto; }
  .application-row dl { grid-column: 1 / -1; grid-row: 2; }
  .upload-box { grid-template-columns: 1fr 1fr; }
  .upload-box label { grid-column: 1 / -1; }
}

@media (max-width: 991.98px) {
  .auth-landing { min-height: 0; }
  .auth-intro { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 8px 14px; min-height: 0; padding: 16px 20px; align-items: center; }
  .auth-intro .auth-logo { grid-row: 1 / 3; width: 52px; }
  .auth-intro h1 { max-width: none; margin: 0; font-size: 1.2rem; text-wrap: pretty; }
  .auth-intro > p { grid-column: 2; margin: 0; font-size: 0.85rem; }
  .auth-panel { padding-block: 24px; }
}

@media (max-width: 860px) {
  .topbar { padding: 10px 16px; }
  .prototype-role span, .account > span:last-child, .notification-button { display: none; }
  .account { min-width: 0; }
  .app-shell { display: block; }
  .sidebar { position: sticky; z-index: 25; top: 76px; display: block; width: 100%; height: auto; padding: 8px 12px; overflow: visible; border-right: 0; border-bottom: 1px solid var(--border); }
  .prototype-note, .sidebar-help { display: none; }
  .nav-list { display: grid; min-width: 0; }
  .nav-item { grid-template-columns: 30px minmax(0, 1fr); min-height: 44px; width: 100%; padding-right: 13px; }
  .nav-icon { width: 28px; height: 28px; }
  .main { padding: 25px 18px 50px; }
  .page-heading { align-items: flex-start; }
  .data-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stage-track, .form-stepper { overflow-x: auto; }
  .stage-track li, .form-stepper li { min-width: 155px; }
  .analytics-grid { grid-template-columns: 1fr; }
  .auth-layout { min-height: 0; }
  .auth-intro { min-height: 0; }
  .settings-profile { position: static; }
}

@media (max-width: 620px) {
  .brand-copy strong { font-size: 0.84rem; }
  .brand-copy small { display: none; }
  .brand-mark { width: 40px; height: 40px; }
  .topbar-actions { gap: 7px; }
  .prototype-role select { width: 135px; padding-left: 8px; }
  .page-heading { display: grid; }
  .page-heading > .button, .page-heading > .button-group { width: 100%; }
  .page-heading .button-group .button { flex: 1; }
  .metric-grid, .filter-grid, .filter-grid.five, .form-grid.two-columns, .confirmation-grid, .review-columns { grid-template-columns: 1fr; }
  .metric-card { min-height: 106px; }
  .application-row { grid-template-columns: 1fr; }
  .application-row dl { grid-column: 1; grid-row: auto; grid-template-columns: 1fr 1fr; }
  .application-row .button { width: 100%; }
  .data-grid { grid-template-columns: 1fr; }
  .document-row { grid-template-columns: 45px 1fr 44px; }
  .document-state { grid-column: 2; }
  .upload-box { grid-template-columns: 1fr; }
  .upload-box label { grid-column: auto; }
  .form-step { padding: 22px 17px; }
  .form-actions { align-items: stretch; padding: 15px 17px; }
  .form-actions, .form-actions > div { display: grid; width: 100%; }
  .review-summary dl { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .action-bar > .button, .action-bar > div, .action-bar > div .button { width: 100%; }
  .action-bar > div { margin-left: 0; }
  .donut-layout { grid-template-columns: 1fr; padding: 20px; }
  .status-canvas-wrap { width: min(100%, 280px); height: 240px; margin: 0 auto; }
  .trend-summary { align-items: flex-start; flex-direction: column; }
  .trend-summary > div { align-items: flex-start; flex-direction: column; gap: 3px; }
  .trend-canvas-wrap { height: 250px; padding-inline: 8px; }
  .chart-footnotes { grid-template-columns: 1fr; gap: 10px; }
  .chart-footnotes div { padding: 0 0 10px; border-right: 0; border-bottom: 1px solid var(--border); }
  .chart-footnotes div:last-child { padding-bottom: 0; border-bottom: 0; }
  .dialog-card { padding: 19px; }
  .auth-panel { padding: 20px; }
  .auth-options { align-items: flex-start; flex-direction: column; }
  .access-main { padding: 18px 12px; }
  .public-footer { width: calc(100% - 32px); padding-top: 4px; }
  .settings-form { padding: 19px; }
  .settings-actions .button { width: 100%; }
  .swal2-popup.municipal-alert { padding: 22px 18px; }
  .municipal-alert .swal2-actions { display: grid; width: 100%; }
  .municipal-alert .swal2-confirm, .municipal-alert .swal2-cancel { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}

@media print {
  .topbar, .sidebar, .page-heading .button, .filter-panel, .action-bar { display: none !important; }
  .app-shell { display: block; }
  .main { padding: 0; }
  .view { display: none !important; }
  .view.active { display: block !important; }
  .panel, .metric-card { box-shadow: none; break-inside: avoid; }
}

/* Mensajes asociados a campos; el resumen conserva el foco tras el POST. */
.field-error { color: var(--red); font-weight: 700; }
.field-error:empty { display: none; }

/* Reflow en ventanas estrechas, incluido el zoom de navegador al 200 %. */
@media (max-width: 360px) {
  .topbar, .sidebar { position: static; }
  .main { padding: 20px 12px 32px; }
  .notice { flex-direction: column; align-items: flex-start; }
  .metric-card { flex-wrap: wrap; }
  .panel-heading { padding-inline: 12px; }
  .task-list { margin-inline: 12px; padding: 0; }
  .task-list li > div { min-width: 0; }
}
@media (max-width: 320px) {
  .topbar .brand-copy { display: none; }
  .task-list li { grid-template-columns: 1fr; gap: 6px; padding-block: 8px; }
  .task-list li::after { display: none; }
  .auth-intro { padding: 20px 12px; }
  .auth-panel { padding: 20px 12px; }
}

/* Anillo con contraste sobre superficies claras y oscuras, también en campos. */
:is(a, button, input, select, textarea, [tabindex]):focus-visible {
  outline: 3px solid var(--amber);
  outline-offset: 3px;
  box-shadow: 0 0 0 3px white !important;
}

/* Foco de campos integrado al borde, con un halo verde discreto. */
:is(input, select, textarea, .form-control, .form-select):focus-visible {
  border-color: var(--primary-interactive);
  outline: 2px solid var(--primary-interactive);
  outline-offset: -1px;
  box-shadow: 0 0 0 3px rgba(27, 122, 75, 0.12) !important;
}

/* Formulario real de borradores (SMV-20): errores y datos propios sin pasos simulados. */
/* SMV-90: contraste y densidad del formulario compartido de borradores. */
.borrador-identidad { padding: 16px 20px; border-bottom: 1px solid var(--border); }
.borrador-identidad h2 { font-size: 1rem; }
.borrador-identidad .confirmation-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 0.75fr); gap: 12px; margin: 8px 0; }
.borrador-identidad p { margin: 0; color: var(--muted); font-size: 0.85rem; }
#borrador-form .form-step { padding: 20px; }
.borrador-field { display: grid; align-content: start; gap: 6px; min-width: 0; }
.borrador-field .form-hint { font-size: 0.85rem; }
.borrador-field :is(.field-validation-valid, .field-validation-error):empty { display: none; }
#borrador-form :is(input, select, textarea) { border-color: var(--muted); background-color: white; }
#borrador-form :is(input, select, textarea):focus-visible { border-color: var(--primary-interactive); }
#borrador-form :is(input, select, textarea)[aria-invalid="true"] { border-color: var(--red); }
#borrador-errors a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
#borrador-errors li + li { margin-top: 8px; }
.borrador-ayuda { margin: 16px 0 0; font-size: 0.9rem; color: var(--muted); }
@media (max-width: 620px) {
  #borrador-form .form-actions { display: grid !important; grid-template-columns: minmax(0, 1fr); gap: 12px; }
  #borrador-form .form-actions > :is(a, button) { width: 100%; }
}

#borrador-form > .notice { margin: 18px; display: block; }
#borrador-form .field-validation-error { color: #691212; }
#borrador-form .input-validation-error { border-color: #9a2525; }
.borrador-confirmacion { display: block; }

/* SMV-22: lectura propia con columnas completas y paneles adaptables. */
.expedientes-table { min-width: 1060px; }
.expedientes-table th, .expedientes-table td { overflow-wrap: normal; }
.expedientes-table td:first-child, .expedientes-table td:nth-child(2),
.expedientes-table td:nth-child(6), .expedientes-table time { white-space: nowrap; }
.expedientes-table caption, .expedientes-paginacion { padding: 16px 20px; }
.expediente-acciones { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.expediente-panel { padding: 20px; margin-bottom: 20px; }
.expediente-panel h2 { margin-bottom: 20px; }
.expediente-datos { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)); gap: 20px; }
.expediente-documentos { min-width: 720px; }
.expediente-historial { padding-left: 24px; }
.expediente-historial li { padding: 12px 0; border-bottom: 1px solid var(--border); }
.expediente-historial li:last-child { border-bottom: 0; }
.expediente-contenido { white-space: pre-wrap; overflow-wrap: anywhere; }

/* SMV-87: navegación móvil visible, formularios y lectura del aviso. */
.navigation-toggle { display: none; min-height: 44px; padding: 10px; font-weight: 700; cursor: pointer; }
.portal-navigation { min-width: 0; }
.panel-copy { padding: 18px 20px 0; }
.account-create { margin-top: 24px; }
.account-create > summary { cursor: pointer; font-family: var(--font-title); font-size: 1.25rem; font-weight: 800; }
.account-create .form-grid > div { min-width: 0; }
.registration-panel { width: 100%; max-width: 76rem; margin: 0 auto; padding: clamp(18px, 3vw, 32px); }
.registration-panel .page-heading { margin-bottom: 18px; }
.registration-steps { display: flex; flex-wrap: wrap; gap: 10px 24px; margin: 0 0 24px; padding: 0; list-style: none; }
.registration-steps a { display: inline-flex; align-items: center; min-height: 44px; }
.registration-steps li:last-child { display: flex; align-items: center; min-height: 44px; }
.registration-privacy { margin-bottom: 28px; padding-bottom: 24px; border-bottom: 1px solid var(--border); }
.registration-panel .form-grid { max-width: 75ch; }
.filter-details > summary { min-height: 44px; margin: 0 28px; padding: 10px 0; color: var(--primary-deep); font-weight: 700; cursor: pointer; }
@media (max-width: 860px) {
  .navigation-toggle { display: list-item; list-style-position: inside; }
  .portal-navigation[open] .nav-list { max-height: 60vh; overflow-y: auto; }
  .sidebar { position: static; }
}
@media (max-width: 620px) {
  .filter-details > summary { margin-inline: 17px; }
  .registration-steps { gap: 4px 16px; }
  .registration-panel .page-heading { flex-direction: column; }
}

.usuarios-table { min-width: 760px; }
.usuarios-table td:last-child { min-width: 220px; }
.table-mobile-hint { display: none; margin: 0; padding: 0 20px 16px; color: var(--muted); }
.panel > .empty-state { margin: 0; padding: 24px; }
@media (max-width: 860px) {
  .table-mobile-hint { display: block; }
}
@media (max-width: 360px) {
  .auth-intro > p { display: none; }
  .auth-intro .auth-logo { grid-row: auto; }
}

/* Formularios de seguridad independientes del portal. */
.credential-card { width: min(100%, 40rem); padding: clamp(1.25rem, 4vw, 2.5rem); }

/* SMV-91: progresión del registro HU-003. */
.solicitud-progreso { margin: 24px 0 30px; }
.solicitud-progreso ol { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); list-style: none; padding: 0; margin: 0; }
.solicitud-progreso li { position: relative; display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; color: var(--muted); font-size: .875rem; }
.solicitud-progreso li:not(:last-child)::after { content: ""; position: absolute; top: 19px; left: 50%; width: 100%; height: 2px; background: var(--border-strong); }
.solicitud-progreso .solicitud-paso-numero { position: relative; z-index: 1; display: grid; place-items: center; width: 40px; height: 40px; border: 2px solid var(--border-strong); border-radius: 50%; background: var(--surface, #fff); font-weight: 800; }
.solicitud-progreso .actual { color: var(--primary-deep); font-weight: 800; }
.solicitud-progreso .actual .solicitud-paso-numero { border-color: var(--primary-interactive); background: var(--primary-interactive); color: #fff; }
.solicitud-progreso .visitado .solicitud-paso-numero { border-color: var(--primary-interactive); color: var(--primary-deep); }
@media (max-width: 480px) {
  .solicitud-progreso { margin: 20px 0 24px; }
  .solicitud-progreso li { gap: 8px; font-size: .8125rem; }
  .solicitud-progreso .solicitud-paso-numero { width: 32px; height: 32px; }
  .solicitud-progreso li:not(:last-child)::after { top: 15px; }
  [data-acciones-documentos] { flex-direction: column; align-items: stretch; }
}

/* SMV-91: recuperación visible y requisitos agrupados en los tres pasos. */
.solicitud-aviso { display: block; }
.solicitud-aviso h2 { font-size: 1.1rem; margin: 0 0 8px; }
.solicitud-aviso ul { padding-inline-start: 20px; }
.solicitud-aviso li + li { margin-top: 6px; }
.solicitud-aviso .button { margin-top: 8px; }
.requisitos-envio p { margin: 0 0 8px; }
.requisitos-pendientes { margin-block: 8px 12px; padding-inline-start: 20px; }
.requisitos-pendientes li { padding-block: 3px; }
.requisitos-pendientes span { margin-inline-start: 8px; color: var(--red); }
.requisitos-envio details { border-top: 1px solid var(--border); }
.requisitos-envio summary { min-height: 44px; padding-block: 10px; color: var(--primary-deep); cursor: pointer; font-weight: 700; }
.requisitos-envio details ul { padding-inline-start: 20px; }
.solicitud-ir-carga { display: inline-flex; align-items: center; min-height: 44px; margin-bottom: 8px; }
.solicitud-documentos #form-carga-documental :is(select, input) { border-color: var(--muted); background-color: white; }
.solicitud-documentos #form-carga-documental :is(select, input):focus-visible { border-color: var(--primary-interactive); }
.solicitud-documentos [data-acciones-documentos] { flex-wrap: wrap; }
.solicitud-documentos [data-acciones-documentos] .form-hint { flex-basis: 100%; margin: 0; }
.solicitud-documentos :is(h3, li), .solicitud-confirmacion :is(dd, li) { overflow-wrap: anywhere; }
@media (max-width: 620px) {
  .solicitud-progreso { margin-block: 16px 20px; }
  [data-view="nueva-solicitud"] .page-heading { margin-bottom: 12px; }
  .solicitud-documentos .expediente-panel h2 { margin-bottom: 12px; }
  .solicitud-aviso .button { width: 100%; }
  .solicitud-confirmacion .form-actions { padding-inline: 0; }
  .solicitud-confirmacion .form-actions .button, .solicitud-documentos .form-actions .button { width: 100%; }
}

.requisitos-envio .requisitos-faltantes { border-top: 0; }

/* SMV-97: lectura del aviso de privacidad, en el registro y como página propia. */
.privacy-notice { max-width: 70ch; margin-inline: auto; overflow-wrap: anywhere; }
.privacy-notice p { text-wrap: pretty; }
.privacy-notice > :is(h2, h3):not(#aviso-titulo) { margin: 2.25rem 0 0.6rem; scroll-margin-top: 1rem; }
.privacy-notice > h3 { font-size: 1.0625rem; }
.privacy-meta { margin-bottom: 0; color: var(--muted); font-size: 0.95rem; }
.privacy-meta strong { color: var(--text); font-weight: 600; }
.privacy-callout { align-items: flex-start; margin: 18px 0 22px; }
.privacy-callout p + p { margin-top: 8px; }
.privacy-plazos { display: grid; gap: 20px; margin: 0 0 18px; }
.privacy-plazos table { font-size: 0.95rem; }
.privacy-plazos caption { caption-side: top; padding: 0 0 6px; color: var(--text); font-weight: 700; text-align: left; }
.privacy-plazos :is(th, td) { padding: 9px 0; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.privacy-plazos thead th { padding-top: 0; background: none; color: var(--muted); font-size: 0.85rem; font-weight: 600; letter-spacing: normal; text-transform: none; }
.privacy-plazos tbody th { padding-right: 16px; background: none; color: var(--text); font-size: inherit; font-weight: 400; letter-spacing: normal; text-transform: none; }
.privacy-plazos tbody tr:last-child td { border-bottom: 1px solid var(--border); }
.privacy-plazos td { width: 42%; font-variant-numeric: tabular-nums; }
.public-footer a { display: inline-flex; align-items: center; min-height: 44px; }
html:has(body.public-page) { scroll-padding-top: 1.5rem; }

.privacy-page { width: 100%; max-width: 50rem; margin: 0 auto; padding: clamp(20px, 5vw, 52px); }
.privacy-page-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; max-width: 70ch; margin: -8px auto 28px; padding-bottom: 14px; border-bottom: 1px solid var(--border); }
.privacy-logo { flex: 0 0 auto; width: 40px; height: auto; }
.privacy-back { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; color: var(--primary-deep); font-weight: 600; text-decoration: none; }
.privacy-back:hover { text-decoration: underline; text-underline-offset: 4px; }
.privacy-back .bi { transition: transform 160ms ease-out; }
.privacy-back:hover .bi { transform: translateX(-3px); }
.privacy-page h1 { margin-bottom: 12px; font-size: clamp(1.6rem, 3.2vw, 2.25rem); text-wrap: balance; }
.privacy-toc { margin: 28px 0 0; padding: 16px 20px 10px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-soft); }
.privacy-toc-title { margin: 0 0 4px; font-size: 1rem; }
.privacy-toc ol { columns: 2 12rem; column-gap: 28px; margin: 0; padding-left: 1.4rem; }
.privacy-toc li { break-inside: avoid; }
.privacy-toc a { display: inline-flex; align-items: center; min-height: 44px; }
.privacy-page-end { max-width: 70ch; margin: 36px auto 0; padding-top: 12px; border-top: 1px solid var(--border); }
@media (max-width: 620px) {
  .privacy-callout { display: block; }
  .privacy-callout .notice-icon { display: none; }
}
@media print {
  .public-page { display: block; min-height: 0; background: none; }
  .skip-link, .public-footer, .privacy-page-heading, .privacy-toc, .privacy-page-end { display: none !important; }
  .access-main { display: block; padding: 0; }
  .privacy-page { max-width: none; padding: 0; border: 0; break-inside: auto; }
  .privacy-notice { max-width: none; }
  .privacy-callout, .privacy-plazos table { break-inside: avoid; }
}

/* SMV-110: página de salida compartida (404, error, acceso denegado) y comprobación del sistema. */
.salida-card { width: min(100%, 34rem); margin: 0 auto; padding: clamp(1.5rem, 4vw, 2.75rem); }
.salida-card h1 { margin: 0 0 8px; font-size: clamp(1.5rem, 2.6vw, 2rem); text-wrap: balance; }
.salida-card > p { max-width: 52ch; margin: 0; color: var(--muted); text-wrap: pretty; }
.salida-icono { display: grid; place-items: center; width: 52px; height: 52px; margin-bottom: 18px; border-radius: 14px; background: var(--primary-soft, #e8f3eb); color: var(--primary-deep, #0f4f2e); font-size: 1.5rem; }
.salida-referencia { margin-top: 14px !important; font-size: 0.9rem; }
.salida-referencia .code { font-family: var(--font-mono); font-size: 0.95em; letter-spacing: -0.01em; user-select: all; }
.salida-datos { margin: 18px 0 0; }
.salida-datos div { display: grid; gap: 2px; padding: 12px 0 0; border-top: 1px solid var(--border); }
.salida-datos dt { color: var(--muted); font-size: 0.85rem; font-weight: 600; }
.salida-datos dd { margin: 0; font-variant-numeric: tabular-nums; }
.salida-acciones { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.salida-acciones form { display: contents; }
@media (max-width: 620px) {
  .salida-acciones { flex-direction: column; }
  .salida-acciones .button { width: 100%; }
}

/* SMV-110: el registro muestra primero un resumen y el aviso completo plegado; abierto en registro asistido. */
.registration-privacy h2 { margin: 0 0 12px; font-size: 1.15rem; }
.privacy-summary { display: grid; gap: 8px 24px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr)); max-width: 75ch; margin: 0 0 16px; padding: 0; list-style: none; }
.privacy-summary li { position: relative; padding-left: 22px; color: var(--muted); text-wrap: pretty; }
.privacy-summary li::before { content: ""; position: absolute; top: 0.6em; left: 4px; width: 8px; height: 8px; border-radius: 50%; background: var(--primary); }
.privacy-summary strong { color: var(--text); }
.privacy-summary a { display: inline-flex; align-items: center; min-height: 44px; margin: -11px 0; }
.privacy-full { max-width: 75ch; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-soft, #f6f8f6); }
.privacy-full > summary { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 14px; min-height: 44px; padding: 10px 16px; color: var(--primary-deep); font-weight: 700; cursor: pointer; list-style: none; }
.privacy-full > summary::-webkit-details-marker { display: none; }
.privacy-full > summary::before { content: "\F282"; font-family: "bootstrap-icons"; font-weight: 400; transition: transform 160ms ease-out; }
.privacy-full[open] > summary::before { transform: rotate(90deg); }
.privacy-full > summary small { color: var(--muted); font-weight: 500; }
.privacy-full[open] > summary { border-bottom: 1px solid var(--border); }
.privacy-full .privacy-notice { margin: 0; padding: 18px 16px 22px; }
/* SMV-118: controles y ayuda del acceso público. */
#login-form .form-control { min-height: 48px; border-color: #73877a; background: var(--surface); color: var(--text); }
#login-form .form-control:focus-visible { border-color: var(--primary-interactive); }
#login-form .form-control[aria-invalid="true"] { border-color: var(--red); }
.auth-password { display: grid; gap: 7px; }
.auth-password label { margin: 0; }
.password-field { position: relative; }
.password-field.has-toggle .form-control { padding-inline-end: 6rem; }
.password-toggle { position: absolute; inset-block: 2px; inset-inline-end: 2px; min-height: 44px; padding: 0 12px; border: 0; border-radius: 6px; background: transparent; color: var(--primary-deep); font-weight: 600; cursor: pointer; }
.password-toggle:hover { background: var(--primary-soft); }
.auth-alt { display: grid; justify-items: start; margin-top: 12px; }
.auth-alt a { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; }
.auth-help { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--border); }
.auth-help summary { display: flex; align-items: center; gap: 8px; min-height: 44px; color: var(--primary-deep); font-weight: 600; cursor: pointer; list-style: none; }
.auth-help summary::-webkit-details-marker { display: none; }
.auth-help summary i { font-size: 0.75rem; }
.auth-help[open] summary i { transform: rotate(180deg); }
.auth-help > div { padding: 8px 0; overflow-wrap: anywhere; }
.auth-help p { margin: 0 0 6px; color: var(--muted); }
.auth-help a { display: inline-flex; align-items: center; min-height: 44px; }

/* Registro público: una lectura continua, aviso previo y campos agrupados. */
.registration-page { background: #f6f8f6; }
.registration-page .access-main { align-items: flex-start; padding: 32px 20px; }
.registration-page .registration-panel { max-width: 52rem; padding: 32px 40px; box-shadow: none; }
.registration-brand { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding-bottom: 24px; margin-bottom: 28px; border-bottom: 1px solid var(--border); }
.registration-brand > div { display: flex; align-items: center; gap: 12px; }
.registration-brand img { object-fit: contain; }
.registration-brand strong, .registration-brand small { display: block; }
.registration-brand small { color: var(--muted); }
.registration-brand > a { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; flex-shrink: 0; }
.registration-page h1, .registration-page h2 { font-family: "Source Sans 3", sans-serif; letter-spacing: -0.02em; }
.registration-page h1 { font-size: clamp(1.65rem, 4vw, 2rem); }
.registration-lead { margin: 8px 0 0; color: var(--muted); }
.registration-page .registration-steps { font-size: .875rem; gap: 4px 24px; margin-bottom: 24px; padding-bottom: 16px; border-bottom: 1px solid var(--border); }
.registration-page .privacy-summary { max-width: none; grid-template-columns: 1fr 1fr; gap: 12px 24px; }
.registration-page .privacy-full { max-width: none; border-radius: 0; border-width: 1px 0; background: transparent; }
.registration-page .privacy-full > summary { padding: 12px 0; }
.registration-page .registration-privacy { margin-bottom: 28px; padding-bottom: 0; border: 0; }
.registration-page #registro-datos { font-size: 1.25rem; margin-bottom: 8px; }
.registration-page #registro-datos + p { color: var(--muted); font-size: .9375rem; margin-bottom: 24px; }
.registration-page #registro-form { max-width: none; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 24px; align-items: start; }
.registration-page #registro-form label { min-width: 0; }
.registration-page #registro-form .form-control, .registration-page #registro-form .form-select { min-height: 48px; background-color: var(--surface); border-color: #73877a; }
.registration-page #registro-form [aria-invalid="true"] { border-color: var(--red); }
.registration-submit { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding-top: 24px; margin-top: 4px; border-top: 1px solid var(--border); }
.registration-submit p { margin: 0; max-width: 40ch; color: var(--muted); }
.registration-submit button { flex-shrink: 0; }
.registration-page .registration-panel > p:last-child { margin: 24px 0 0; }
@media (max-width: 620px) {
  .registration-page .access-main { padding: 16px 12px; }
  .registration-page .registration-panel { padding: 24px 20px; }
  .registration-brand { flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }
  .registration-page .privacy-summary, .registration-page #registro-form { grid-template-columns: 1fr; }
  .registration-page .registration-steps { display: block; }
  .registration-page .registration-submit { align-items: stretch; flex-direction: column; gap: 16px; }
}

.registration-acceptance { display: grid; gap: 12px; }
.registration-acceptance > button { justify-self: start; min-height: 44px; text-align: left; }
.registration-page #registro-form .terms-check { display: flex; align-items: flex-start; gap: 12px; min-height: 44px; cursor: pointer; }
.terms-check input[type="checkbox"] { width: 20px; height: 20px; min-height: 20px; flex: 0 0 20px; margin-top: 3px; accent-color: var(--primary); }
.registration-terms-dialog { width: min(48rem, calc(100% - 24px)); max-height: calc(100dvh - 32px); margin: auto; padding: 0; border: 1px solid var(--border); border-radius: 14px; color: var(--text); background: var(--surface); overflow: auto; }
.registration-terms-dialog::backdrop { background: rgb(19 32 26 / 55%); }
.registration-terms-dialog > header { position: sticky; top: 0; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 20px 24px; background: var(--surface); border-bottom: 1px solid var(--border); }
.registration-terms-dialog > header h2 { margin: 0; font: 650 1.25rem "Source Sans 3", sans-serif; }
.registration-terms-dialog .terms-document { max-width: 68ch; margin-inline: auto; padding: 32px; font-family: "Source Sans 3", sans-serif; font-size: 1rem; line-height: 1.65; overflow-wrap: anywhere; }
.terms-document h3 { margin: 28px 0 8px; font: 650 1.0625rem/1.45 "Source Sans 3", sans-serif; color: var(--text); }
.terms-document h3:first-child { margin-top: 0; }
.terms-document p { margin: 0 0 12px; color: var(--text); text-align: left; }
.terms-document p:last-child { margin-bottom: 0; }
.terms-document a { text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 620px) {
  .registration-terms-dialog > header { padding: 16px 20px; }
  .registration-terms-dialog .terms-document { padding: 24px 20px; }
}

.auth-intro .auth-identity h1 { margin-inline: auto; text-align: center; }

.resend-page { background: #f6f8f6; }
.resend-card { width: min(100%, 34rem); margin: auto; padding: 32px; border: 1px solid var(--border); border-radius: 14px; box-shadow: none; }
.resend-brand { display: flex; align-items: center; gap: 12px; padding-bottom: 24px; margin-bottom: 28px; border-bottom: 1px solid var(--border); }
.resend-brand img { flex: 0 0 32px; object-fit: contain; }
.resend-brand strong, .resend-brand small { display: block; }
.resend-brand strong { font-weight: 650; }
.resend-brand small { color: var(--muted); }
.resend-card h1 { font: 650 clamp(1.65rem, 3vw, 2rem)/1.2 "Source Sans 3", sans-serif; letter-spacing: -.02em; margin: 0 0 12px; }
.resend-card header p { color: var(--muted); margin: 0 0 24px; }
.resend-card .form-control { min-height: 48px; background: var(--surface); border-color: #73877a; }
.resend-card .resend-recovery { min-height: 44px; display: flex; align-items: center; justify-self: start; }
.resend-card footer { margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--border); }
.resend-card footer a { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; }
.resend-result { padding: 20px; margin-bottom: 24px; background: #f1f4f1; border: 1px solid var(--border); border-radius: 10px; }
.resend-result h2 { font: 650 1.125rem "Source Sans 3", sans-serif; margin: 0 0 8px; }
.resend-result p { margin: 0; }
@media (max-width: 620px) {
  .resend-page .access-main { padding: 20px 12px; }
  .resend-card { padding: 24px 20px; }
}

/* Confirmación del registro público y asistido (SMV-128). */
.registration-result-page { background: var(--surface-soft); }
.registration-result-container { padding-block: 24px; }
.panel.registration-result { width: min(100%, 38rem); margin: auto; padding: 32px; box-shadow: none; }
.registration-result h1 { margin: 0 0 8px; font: 650 clamp(1.75rem, 4vw, 2rem)/1.2 "Source Sans 3", sans-serif; letter-spacing: -.02em; }
.registration-result h2 { margin: 0 0 8px; font: 650 1.125rem/1.4 "Source Sans 3", sans-serif; }
.registration-result p { margin: 0; }
.registration-result-heading { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 28px; }
.registration-result-heading p { color: var(--muted); }
.registration-result-icon { display: grid; place-items: center; flex: 0 0 48px; height: 48px; border-radius: 12px; background: var(--primary-soft); color: var(--primary); font-size: 1.5rem; }
.registration-result-icon.pending { color: var(--amber); background: var(--amber-soft); }
.registration-result-next ol { margin: 16px 0; padding-left: 24px; }
.registration-result-next li { padding-left: 4px; margin-bottom: 8px; }
.registration-result-expiry { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.registration-result-help { margin: 24px 0; padding-top: 24px; border-top: 1px solid var(--border); }
.registration-result-help p { color: var(--muted); }
.registration-result-help a { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; margin-top: 4px; text-underline-offset: 3px; }
.registration-result .registration-result-assisted { margin-top: 24px; color: var(--muted); }
.registration-result footer { margin-top: 24px; }
.registration-result footer .button { width: 100%; }
@media (max-width: 620px) {
  .registration-result-page .access-main { padding: 20px 12px; }
  .panel.registration-result { padding: 24px 20px; }
  .registration-result-heading { gap: 12px; }
}

.registration-result-action { margin-top: 24px; }
.registration-result-action .button { width: 100%; }
.registration-result .button { gap: 8px; }
.registration-result [role="alert"] p + p { margin-top: 12px; }

/* Restablecimiento público de contraseña (SMV-129). */
.reset-password-card .form-grid { gap: 24px; }
.reset-password-card .form-grid label { display: grid; gap: 8px; }
.reset-password-card .form-control { min-height: 48px; background: var(--surface); border-color: #73877a; }
.reset-password-card label small { color: var(--muted); font-size: .875rem; line-height: 1.5; }
.reset-password-card footer { border-top: 1px solid var(--border); padding-top: 16px; }
.reset-password-card footer a { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; text-underline-offset: 3px; }
.reset-password-card .notice { margin: 0; }
.reset-password-card .notice a { display: inline-flex; align-items: center; min-height: 44px; }

/* SMV-152: errores compactos y orientación dentro del formulario de acceso. */
#login-error.auth-error { display:grid; grid-template-columns:20px minmax(0, 1fr); align-items:start; gap:10px; margin:0; padding:16px; border:1px solid #e1a2a2; border-radius:var(--radius); background:var(--red-soft); color:#691212; box-shadow:none; }
#login-error.auth-error:focus { outline:2px solid var(--red); outline-offset:3px; box-shadow:none; }
.auth-error-icon { margin-top:2px; font-size:1.125rem; line-height:1.4; }
.auth-error-content { min-width:0; }
.auth-error-content h3 { margin:0; font-family:var(--font-body); font-size:1rem; font-weight:700; line-height:1.4; letter-spacing:0; }
.auth-error-content p { margin:6px 0 0; font-size:.9375rem; line-height:1.5; overflow-wrap:anywhere; }
.auth-error-content .auth-error-context { margin-top:10px; font-size:.875rem; }
.auth-error-list { margin:4px 0 0; padding:0; list-style:none; }
.auth-error-list a { display:flex; align-items:center; gap:8px; min-height:44px; color:inherit; font-size:.9375rem; font-weight:600; line-height:1.4; text-underline-offset:3px; overflow-wrap:anywhere; }
.auth-error-list a:hover { text-decoration-thickness:2px; }
.auth-error-list a:focus-visible { outline:2px solid var(--red); outline-offset:2px; border-radius:4px; }
.auth-error-list .bi { flex:none; font-size:.875rem; }
#login-form .field-error { font-size:.875rem; font-weight:600; line-height:1.45; }
