:root {
  color-scheme: light;
  --shell-width: 56rem;
  --shell-width-wide: 72rem;
  --bg: #edf2f7;
  --surface: #ffffff;
  --surface-alt: #f8fbfe;
  --surface-soft: #f1f5f9;
  --border: #ccd7e3;
  --border-strong: #98a9bb;
  --text: #172433;
  --muted: #5b6b7b;
  --brand: #123b63;
  --brand-strong: #0b4aa2;
  --accent: #0f62fe;
  --accent-soft: #dce9ff;
  --success: #216a3f;
  --success-soft: #dff2e7;
  --warning: #8a5b00;
  --warning-soft: #f8e9c7;
  --danger: #b42318;
  --danger-soft: #fde2e0;
  --bg-end: #f7fafc;
  --bg-accent: rgba(18, 59, 99, 0.09);
  --control-bg: #ffffff;
  --placeholder: #4f5f70;
  --selected: #dce9ff;
  --table-stripe: #f8fbff;
  --focus-ring: rgba(15, 98, 254, 0.28);
  --focus-shadow: rgba(15, 98, 254, 0.14);
  --danger-control: #fff7f7;
  --on-action: #ffffff;
  --shadow-sm: 0 4px 8px rgba(15, 23, 42, 0.08);
  --shadow-md: 0 8px 16px rgba(15, 23, 42, 0.09);
  --radius-lg: 1.25rem;
  --radius-md: 0.9rem;
  --radius-sm: 0.7rem;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0f1922;
  --bg-end: #14212c;
  --bg-accent: rgba(69, 132, 196, 0.08);
  --surface: #1a2835;
  --surface-alt: #202f3d;
  --surface-soft: #283b4b;
  --border: #32485a;
  --border-strong: #4b6478;
  --text: #edf3f8;
  --muted: #b8c7d3;
  --brand: #d7e6f2;
  --brand-strong: #4f8fc8;
  --accent: #7bb8eb;
  --accent-soft: #29445b;
  --success: #84d5a5;
  --success-soft: #193b2b;
  --warning: #f1c76d;
  --warning-soft: #453719;
  --danger: #ff9d95;
  --danger-soft: #4b2424;
  --control-bg: #15232f;
  --placeholder: #aebdca;
  --selected: #284760;
  --table-stripe: #223543;
  --focus-ring: rgba(119, 183, 255, 0.42);
  --focus-shadow: rgba(119, 183, 255, 0.2);
  --danger-control: #3d2224;
  --on-action: #f5f9fc;
  --shadow-sm: 0 3px 7px rgba(0, 0, 0, 0.18);
  --shadow-md: 0 6px 12px rgba(0, 0, 0, 0.22);
}

:root[data-theme="dark"] .site-header {
  background: var(--surface-alt);
}

:root[data-theme="dark"] .message.success {
  background: #123326;
  border-color: #6fae8d;
  color: var(--text);
}

:root[data-theme="dark"] .site-brand-name,
:root[data-theme="dark"] .site-nav a,
:root[data-theme="dark"] label,
:root[data-theme="dark"] .provider-login-form h2 {
  font-weight: 600;
}

:root[data-theme="dark"] .site-header {
  padding-block: 0.7rem 0.75rem;
}

:root[data-theme="dark"] .site-header-top {
  padding-bottom: 0.65rem;
}

:root[data-theme="dark"] .site-brand {
  gap: 0.14rem;
}

:root[data-theme="dark"] .site-brand-link {
  gap: 0.12rem;
}

:root[data-theme="dark"] .site-nav {
  margin-top: 0.6rem;
}

:root[data-theme="dark"] .site-nav a {
  min-height: 2rem;
  border-color: var(--border);
  background: var(--surface-alt);
}

:root[data-theme="dark"] .site-nav a:hover,
:root[data-theme="dark"] .site-nav a[aria-current="page"],
:root[data-theme="dark"] button,
:root[data-theme="dark"] .button.primary {
  border-color: var(--brand-strong);
  background: var(--brand-strong);
}

:root[data-theme="dark"] .card,
:root[data-theme="dark"] .site-header {
  border-color: var(--border);
}

:root[data-theme="dark"] .toolbar-panel {
  border-color: var(--border);
  background: var(--surface-alt);
}

:root[data-theme="dark"] .report-nav {
  background: var(--surface-alt);
}

:root[data-theme="dark"] .report-nav .button.secondary {
  border-color: transparent;
  background: transparent;
  color: var(--muted);
}

:root[data-theme="dark"] .report-nav .button.secondary:hover,
:root[data-theme="dark"] .report-nav .button.secondary:focus-visible {
  border-color: var(--border-strong);
  background: var(--surface-soft);
  color: var(--text);
}

:root[data-theme="dark"] .report-filters {
  background: var(--surface-alt);
}

:root[data-theme="dark"] .table-wrap {
  border-color: var(--border);
  background: var(--surface-alt);
}

:root[data-theme="dark"] th {
  background: var(--surface-soft);
  color: var(--text);
}

:root[data-theme="dark"] td {
  background: var(--surface);
}

:root[data-theme="dark"] th,
:root[data-theme="dark"] td {
  border-bottom-color: var(--border);
}

:root[data-theme="dark"] tbody tr:hover td {
  background: var(--table-stripe);
}

:root[data-theme="dark"] .empty-state {
  border-color: var(--border);
  background: var(--surface-alt);
  color: var(--muted);
}

.owner-admin-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem 1.5rem;
  margin-bottom: 1rem;
}

.platform-owner-provider-filter__controls {
  align-items: end;
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
}

.platform-owner-provider-filter__controls input {
  flex: 1 1 20rem;
  min-width: 14rem;
}

.platform-owner-provider-table th,
.platform-owner-provider-table td {
  vertical-align: top;
}

.platform-owner-provider-summary,
.platform-owner-provider-details {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  margin: 0;
}

.platform-owner-provider-summary div,
.platform-owner-provider-details div {
  min-width: 0;
}

.platform-owner-provider-summary dt,
.platform-owner-provider-details dt {
  color: var(--muted);
  font-size: .82rem;
  font-weight: 700;
  margin-bottom: .2rem;
}

.platform-owner-provider-summary dd,
.platform-owner-provider-details dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.platform-owner-provider-associations {
  display: grid;
  gap: 1rem;
}

.platform-owner-provider-association {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
}

.platform-owner-provider-association > header {
  align-items: start;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.platform-owner-provider-association h3 {
  margin: 0;
}

.owner-admin-heading h1 {
  margin-bottom: 0.35rem;
}

.owner-admin-primary-actions,
.owner-admin-security-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
}

.owner-admin-security-actions {
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.owner-admin-security-actions form {
  margin: 0;
}

.owner-admin-form-page {
  max-width: 58rem;
  margin-inline: auto;
}

.owner-audit-filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
  align-items: end;
  gap: 0.75rem;
  padding: 1rem;
  border-radius: var(--radius-md);
  background: var(--surface-alt);
}

.owner-audit-filters p {
  margin: 0;
}

.owner-audit-filters button {
  width: fit-content;
}

.owner-admin-table pre {
  max-width: 28rem;
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 0.82rem;
}

@media (max-width: 42rem) {
  .owner-admin-primary-actions,
  .owner-admin-security-actions,
  .owner-admin-primary-actions .button,
  .owner-admin-security-actions form,
  .owner-admin-security-actions button {
    width: 100%;
  }
}

:root[data-theme="dark"] .site-user-settings,
:root[data-theme="dark"] .site-theme-toggle {
  border-color: var(--border);
  background: var(--surface-alt);
  color: var(--muted);
}

/* Superior expediente detail */
.superior-expediente-page {
  display: grid;
  gap: 1rem;
  min-width: 0;
}

.superior-expediente-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1rem 1.5rem;
  padding: 1.25rem 1.5rem 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.superior-expediente-header h1,
.superior-expediente-header p,
.superior-expediente-header dl {
  margin-top: 0;
}

.superior-expediente-header h1 {
  margin-bottom: 0.5rem;
  font-size: 1.8rem;
}

.superior-expediente-status {
  margin-bottom: 0;
  color: var(--muted);
}

.superior-expediente-actions {
  display: flex;
  align-items: start;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.superior-expediente-actions .button {
  min-height: 2.35rem;
  padding: 0.52rem 0.75rem;
  font-size: 0.92rem;
}

.superior-expediente-facts {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: minmax(0, 1.5fr) repeat(4, minmax(7rem, 0.75fr));
  margin: 0;
  border-top: 1px solid var(--border);
}

.superior-expediente-facts div {
  min-width: 0;
  padding: 0.8rem 0.85rem 0.95rem;
}

.superior-expediente-facts div + div {
  border-left: 1px solid var(--border);
}

.superior-expediente-facts dt,
.superior-detail-grid dt {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.superior-expediente-facts dd,
.superior-detail-grid dd {
  margin: 0.2rem 0 0;
  overflow-wrap: anywhere;
  color: var(--text);
  font-weight: 700;
}

.superior-expediente-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(18rem, 0.75fr);
  align-items: start;
  gap: 1rem;
  min-width: 0;
}

.superior-expediente-main,
.superior-expediente-side {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.superior-expediente-section,
.superior-side-section {
  min-width: 0;
  padding: 1.25rem;
}

.superior-expediente-section + .superior-expediente-section,
.superior-side-section + .superior-side-section {
  border-top: 1px solid var(--border);
}

.superior-section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.superior-section-heading h2,
.superior-side-section h2,
.superior-risk-zone h2 {
  margin: 0;
  color: var(--brand);
  font-size: 1.2rem;
}

.superior-section-heading .eyebrow,
.superior-side-section .eyebrow,
.superior-risk-zone .eyebrow {
  margin-bottom: 0.2rem;
}

.superior-section-count,
.superior-section-helper,
.superior-section-total,
.superior-payment-summary {
  color: var(--muted);
  font-size: 0.88rem;
}

.superior-section-count {
  white-space: nowrap;
}

.superior-section-helper {
  margin: 0 0 0.8rem;
  line-height: 1.45;
}

.superior-section-total {
  margin: 0.8rem 0 0;
}

.superior-record-list {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--border);
}

.superior-record-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.75rem 1rem;
  min-width: 0;
  padding: 0.78rem 0;
  border-bottom: 1px solid var(--border);
}

.superior-record-main {
  display: grid;
  gap: 0.18rem;
  min-width: 0;
}

.superior-record-main > span,
.superior-record-filename {
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 0.88rem;
}

.superior-record-filename {
  word-break: break-word;
}

.superior-record-amount {
  white-space: nowrap;
  color: var(--brand);
}

.superior-record-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 0.45rem;
  min-width: 0;
}

.superior-record-actions .button,
.superior-record-actions button {
  min-height: 2.2rem;
  padding: 0.45rem 0.7rem;
  font-size: 0.88rem;
}

.superior-record-actions .inline-form {
  margin: 0;
}

.superior-record-note {
  grid-column: 1 / -1;
  margin: 0.2rem 0 0;
  min-width: 0;
}

.superior-record-note p {
  margin: 0;
}

.superior-record-note pre {
  max-width: 100%;
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.superior-payment-summary {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.8rem;
  text-align: right;
}

.superior-payment-summary strong {
  color: var(--text);
}

.superior-expediente-form {
  min-width: 0;
}

.superior-expediente-form fieldset {
  margin: 1rem 0 0;
  background: var(--surface-alt);
}

.superior-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  margin: 1rem 0 0;
  border-top: 1px solid var(--border);
}

.superior-detail-grid div {
  min-width: 0;
  padding: 0.7rem 0.65rem 0.7rem 0;
  border-bottom: 1px solid var(--border);
}

.superior-detail-grid div:nth-child(even) {
  padding-left: 0.65rem;
  border-left: 1px solid var(--border);
}

.superior-detail-grid a {
  overflow-wrap: anywhere;
}

.superior-risk-zone {
  overflow: hidden;
  border: 1px solid #e5a39d;
  border-radius: var(--radius-lg);
  background: var(--danger-soft);
}

.superior-risk-zone summary {
  padding: 1rem 1.5rem;
  color: var(--danger);
  font-weight: 800;
  cursor: pointer;
}

.superior-risk-zone[open] summary {
  border-bottom: 1px solid #e5a39d;
}

.superior-risk-content {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(18rem, 26rem);
  align-items: start;
  gap: 1rem 1.5rem;
  padding: 1.25rem 1.5rem;
}

.superior-risk-zone p:not(.eyebrow) {
  max-width: 58ch;
  margin: 0.45rem 0 0;
  color: var(--text);
}

.superior-risk-zone h2 {
  color: var(--danger);
}

.superior-risk-form {
  gap: 0.65rem;
}

.superior-risk-form label {
  margin-top: 0.2rem;
}

.superior-risk-form button.destructive {
  border-color: var(--danger);
  background: var(--danger);
  color: #fff;
}

@media (max-width: 900px) {
  .superior-expediente-header {
    grid-template-columns: 1fr;
  }

  .superior-expediente-actions {
    justify-content: flex-start;
  }

  .superior-expediente-facts {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .superior-expediente-facts div:nth-child(4) {
    border-left: 0;
  }

  .superior-expediente-layout,
  .superior-risk-content {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .superior-expediente-header {
    padding: 1rem 1rem 0;
  }

  .superior-expediente-facts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .superior-expediente-facts div:nth-child(odd) {
    border-left: 0;
  }

  .superior-expediente-section,
  .superior-side-section {
    padding: 1rem;
  }

  .superior-risk-zone summary,
  .superior-risk-content {
    padding: 1rem;
  }

  .superior-section-heading,
  .superior-payment-summary {
    align-items: flex-start;
    justify-content: flex-start;
    text-align: left;
  }

  .superior-section-heading {
    display: grid;
  }

  .superior-payment-summary {
    gap: 0.5rem 0.8rem;
  }

  .superior-record-row {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .superior-record-actions {
    justify-content: stretch;
    width: 100%;
  }

  .superior-record-actions .button,
  .superior-record-actions button,
  .superior-record-actions .inline-form {
    width: 100%;
  }

  .superior-detail-grid {
    grid-template-columns: 1fr;
  }

  .superior-detail-grid div:nth-child(even) {
    padding-left: 0;
    border-left: 0;
  }

  .superior-risk-content {
    gap: 1rem;
  }
}

/* Provider edit: compact, sectioned form rhythm. */
.provider-edit-page {
  width: min(62rem, calc(100% - 2rem));
  margin-inline: auto;
  gap: 0.85rem;
}

.provider-edit-page .municipio-identity-banner {
  gap: 0.18rem;
  padding: 0.7rem 0.9rem;
  border-width: 1px;
}

.provider-edit-page .municipio-identity-banner strong {
  font-size: 1.2rem;
}

.provider-edit-page h1 {
  margin-block: 0.1rem 0.35rem;
}

.provider-edit-form {
  gap: 0.85rem;
}

.provider-edit-section {
  display: grid;
  gap: 0.75rem;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-alt);
}

.provider-edit-section h2 {
  margin: 0;
  font-size: 1.2rem;
}

.provider-edit-section .provider-form-grid {
  gap: 0.75rem;
}

.provider-edit-section label,
.provider-phone-label {
  font-weight: 600;
}

.provider-edit-section .provider-field {
  display: grid;
  gap: 0.35rem;
  min-width: 0;
}

.provider-phone-row {
  display: grid;
  grid-template-columns: minmax(6.25rem, auto) minmax(0, 1fr) minmax(0, 1.45fr);
  align-items: end;
  gap: 0.6rem;
  width: 100%;
  max-width: 42rem;
}

.provider-edit-page .provider-phone-prefix {
  width: auto;
  min-width: 0;
  max-width: none;
  flex: none;
  justify-content: center;
}

.provider-phone-segment {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: end;
  gap: 0.35rem;
  min-width: 0;
}

.provider-phone-part-label {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
}

.provider-phone-segment .provider-phone-input {
  width: 100%;
  min-width: 0;
  max-width: none;
}

.provider-phone-segment .provider-phone-static {
  padding-bottom: 0.72rem;
  font-size: 0.9rem;
}

.provider-cbu-status {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.35rem 0.6rem;
  margin: 0;
  color: var(--muted);
}

.provider-cbu-status strong,
.provider-cbu-filename {
  color: var(--text);
  font-weight: 500;
  overflow-wrap: anywhere;
}

.provider-cbu-status a {
  font-weight: 500;
}

.provider-edit-page .provider-file-control {
  width: 100%;
  min-height: 2.6rem;
  padding: 0.15rem 0;
  font-weight: 400;
}

.provider-cbu-upload-action {
  justify-self: start;
}

.provider-edit-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
  padding-top: 0.25rem;
}

.provider-edit-actions .button {
  min-height: 2.6rem;
}

.site-user-area {
  gap: 0.8rem;
}

.site-user-session {
  padding-inline: 0.7rem;
}

@media (max-width: 38rem) {
  .provider-edit-page {
    width: calc(100% - 1rem);
  }

  .provider-edit-page .municipio-identity-banner strong {
    font-size: 1.05rem;
  }

  .provider-edit-section {
    padding: 0.85rem;
  }

  .provider-phone-row {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr);
  }

  .provider-edit-page .provider-phone-prefix {
    grid-column: 1 / -1;
    justify-self: start;
  }

  .provider-edit-actions,
  .provider-cbu-upload-action {
    width: 100%;
  }

  .provider-edit-actions .button,
  .provider-cbu-upload-action {
    justify-content: center;
    width: 100%;
  }
}

/* Administrativo expediente workspace */
.administrativo-expediente-page {
  display: grid;
  gap: 1rem;
  min-width: 0;
}

.administrativo-expediente-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1rem 1.5rem;
  padding: 1.35rem 1.5rem 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.administrativo-expediente-header h1,
.administrativo-expediente-header p {
  margin-top: 0;
}

.administrativo-expediente-header h1 {
  margin-bottom: 0.45rem;
  font-size: 1.8rem;
}

.administrativo-expediente-status {
  color: var(--muted);
}

.administrativo-expediente-actions {
  display: flex;
  align-items: start;
  justify-content: end;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.administrativo-expediente-actions .button,
.administrativo-document-action {
  min-height: 2.35rem;
  padding: 0.5rem 0.7rem;
  font-size: 0.9rem;
}

.administrativo-expediente-facts,
.administrativo-provider-summary,
.administrativo-payment-summary {
  margin: 0;
}

.administrativo-expediente-facts {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: minmax(0, 1.6fr) repeat(3, minmax(8rem, 0.8fr));
  border-top: 1px solid var(--border);
}

.administrativo-expediente-facts div {
  min-width: 0;
  padding: 0.8rem 0.85rem 0.95rem;
}

.administrativo-expediente-facts div + div {
  border-left: 1px solid var(--border);
}

.administrativo-expediente-facts dt,
.administrativo-provider-summary dt,
.administrativo-payment-summary dt {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
}

.administrativo-expediente-facts dd,
.administrativo-provider-summary dd,
.administrativo-payment-summary dd {
  margin: 0.2rem 0 0;
  overflow-wrap: anywhere;
}

.administrativo-expediente-facts dd {
  font-size: 1rem;
  font-weight: 700;
}

.administrativo-expediente-warning {
  grid-column: 1 / -1;
  margin: 0 -0.25rem 1rem;
}

.administrativo-expediente-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(20rem, 0.85fr);
  gap: 1.25rem;
  align-items: start;
}

.administrativo-expediente-main,
.administrativo-expediente-side {
  display: grid;
  gap: 1rem;
  min-width: 0;
}

.administrativo-expediente-section,
.administrativo-workflow {
  min-width: 0;
  padding: 1.15rem 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.administrativo-expediente-section h2,
.administrativo-workflow h2,
.administrativo-workflow legend {
  margin: 0 0 0.85rem;
  color: var(--brand);
  font-size: 1.12rem;
}

.administrativo-workflow {
  background: var(--surface-alt);
}

.administrativo-workflow fieldset {
  padding: 0;
  border: 0;
}

.administrativo-provider-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem 1.25rem;
}

.administrativo-provider-summary div {
  min-width: 0;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid var(--border);
}

.administrativo-invoice-list,
.administrativo-document-list,
.administrativo-payment-list {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.administrativo-invoice-list li,
.administrativo-payment-list li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--border);
}

.administrativo-invoice-list li > *,
.administrativo-payment-list li > * {
  min-width: 0;
  overflow-wrap: anywhere;
}

.administrativo-document-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.55rem 1rem;
  align-items: center;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
}

.administrativo-document-main,
.administrativo-payment-list li > div:first-child {
  display: grid;
  gap: 0.2rem;
  min-width: 0;
}

.administrativo-document-main span,
.administrativo-payment-list li span {
  color: var(--muted);
  font-size: 0.88rem;
  overflow-wrap: anywhere;
}

.administrativo-document-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: end;
  gap: 0.4rem;
}

.administrativo-document-row > .message,
.administrativo-ocr {
  grid-column: 1 / -1;
  margin: 0;
}

.administrativo-payment-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  margin-bottom: 0.8rem;
}

.administrativo-payment-summary div {
  padding: 0.7rem 0.8rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.administrativo-payment-summary dd {
  font-weight: 700;
}

.administrativo-payment-form {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.administrativo-workflow input[type="file"] {
  width: 100%;
  min-height: 2.6rem;
  padding: 0.35rem;
  color: var(--text);
  background: var(--control-bg);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
}

@media (max-width: 58rem) {
  .administrativo-expediente-workspace {
    grid-template-columns: 1fr;
  }

  .administrativo-expediente-side {
    order: -1;
  }
}

@media (max-width: 42rem) {
  .administrativo-expediente-header {
    grid-template-columns: 1fr;
    padding: 1rem;
  }

  .administrativo-expediente-actions {
    justify-content: start;
  }

  .administrativo-expediente-facts,
  .administrativo-provider-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .administrativo-expediente-facts div + div {
    border-left: 0;
  }

  .administrativo-expediente-section,
  .administrativo-workflow {
    padding: 1rem;
  }

  .administrativo-document-row {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .administrativo-document-actions {
    justify-content: start;
  }

  .administrativo-document-actions .button,
  .administrativo-document-actions form,
  .administrativo-document-actions form .button {
    width: auto;
  }
}

@media (max-width: 25rem) {
  .administrativo-expediente-facts,
  .administrativo-provider-summary,
  .administrativo-payment-summary {
    grid-template-columns: 1fr;
  }

  .administrativo-expediente-facts div + div {
    border-top: 1px solid var(--border);
  }

  .administrativo-invoice-list li,
  .administrativo-payment-list li {
    align-items: start;
    flex-direction: column;
    gap: 0.35rem;
  }
}

/* Provider draft workflow */
.provider-draft .provider-panel {
  background: var(--surface);
}

.provider-draft .button.primary {
  border-color: var(--brand-strong);
  background: var(--brand-strong);
  box-shadow: none;
}

.provider-draft .button.primary:hover {
  background: var(--brand);
}

.provider-draft-header.provider-draft-header--compact {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.85rem;
  padding-bottom: 1rem;
}

.provider-draft-heading,
.provider-item-heading,
.provider-summary-heading,
.provider-header-actions,
.provider-uploaded-file {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.provider-draft-heading h1,
.provider-summary-heading h2,
.provider-blockers h3,
.provider-warnings h3 {
  margin: 0;
}

.provider-draft-heading h1 {
  margin-top: 0.2rem;
  font-size: 1.65rem;
  line-height: 1.2;
}

.provider-header-facts,
.provider-summary-metrics {
  display: grid;
  margin: 0;
}

.provider-header-facts {
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr) minmax(8rem, 0.55fr);
  border-block: 1px solid var(--border);
}

.provider-header-facts div {
  min-width: 0;
  padding: 0.65rem 0.8rem;
}

.provider-header-facts div + div {
  border-left: 1px solid var(--border);
}

.provider-header-facts dt,
.provider-summary-metrics dt {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.provider-header-facts dd,
.provider-summary-metrics dd {
  margin: 0.15rem 0 0;
  overflow-wrap: anywhere;
  color: var(--text);
  font-weight: 700;
}

.provider-summary-amount-words {
  margin: -0.35rem 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.provider-header-actions {
  justify-content: flex-start;
  flex-wrap: wrap;
}

.provider-inline-link {
  color: var(--brand-strong);
  font-weight: 700;
}

.provider-inline-note {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.provider-draft-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(18rem, 21rem);
  align-items: start;
  gap: 1rem;
}

.provider-draft-main {
  min-width: 0;
}

.provider-summary-panel {
  position: sticky;
  top: 1rem;
  display: grid;
  gap: 0.9rem;
  min-width: 0;
  padding: 1rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.provider-summary-heading h2 {
  margin: 0;
  font-size: 1.3rem;
  line-height: 1.2;
  white-space: nowrap;
}

.provider-edit-action {
  border-color: var(--brand-strong) !important;
  background: var(--accent-soft) !important;
  color: var(--brand-strong) !important;
  font-weight: 700;
}

.provider-summary-panel:focus {
  outline: 3px solid rgba(15, 98, 254, 0.28);
  outline-offset: 3px;
}

.provider-status {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  max-width: 100%;
  padding: 0.25rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 0.4rem;
  background: var(--surface-soft);
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.25;
  text-align: left;
}

.provider-status--success {
  border-color: #8fc9a5;
  background: var(--success-soft);
  color: var(--success);
}

.provider-status--warning {
  border-color: #d9b660;
  background: var(--warning-soft);
  color: #6e4700;
}

.provider-status--danger {
  border-color: #e5a39d;
  background: var(--danger-soft);
  color: var(--danger);
}

.provider-item-list,
.provider-document-checklist {
  display: grid;
  gap: 0.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.provider-invoice-item,
.provider-document-item {
  display: grid;
  gap: 0.75rem;
  min-width: 0;
  padding: 0.9rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-alt);
}

.provider-invoice-amount {
  margin: 0;
}

.provider-invoice-amount-preview {
  display: block;
  min-height: 1.35rem;
  margin-top: 0.35rem;
  color: var(--brand);
  font-size: 0.9rem;
  font-weight: 700;
}

.provider-invoice-state {
  margin: -0.25rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.provider-inline-success {
  margin: 0;
  padding: 0.6rem 0.7rem;
}

.provider-ready-panel {
  display: flex;
  gap: 0.75rem;
  margin: 1rem 0;
  padding: 0.9rem;
  border: 1px solid #a8cfe8;
  border-radius: var(--radius-sm);
  background: #eef8ff;
}

.provider-ready-panel h3,
.provider-ready-panel p {
  margin: 0 0 0.35rem;
}

.provider-ready-panel p:last-child {
  margin-bottom: 0;
}

.provider-ready-indicator {
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  background: var(--success);
  color: #fff;
  font-weight: 700;
}

.provider-item-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.provider-upload-box,
.provider-document-upload {
  display: grid;
  align-items: end;
  gap: 0.75rem;
  min-width: 0;
}

.provider-upload-box {
  grid-template-columns: minmax(12rem, 0.75fr) minmax(16rem, 1.25fr);
  padding: 0.9rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface-alt);
}

.provider-upload-control {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
}

.provider-upload-control input[type="file"],
.provider-document-upload input[type="file"] {
  min-width: 0;
  max-width: 100%;
}

.provider-invoice-completion {
  padding: 0.9rem;
  border: 1px solid #d9b660;
  border-radius: var(--radius-sm);
  background: var(--warning-soft);
}

.provider-invoice-completion h3,
.provider-invoice-guidance {
  margin: 0;
}

.provider-invoice-guidance {
  color: var(--muted);
}

.provider-invoice-actions {
  margin-top: 0.1rem;
}

.provider-invoice-actions .inline-form {
  margin-left: 0;
}

.provider-invoice-actions .button,
.provider-invoice-actions button {
  min-height: 2.45rem;
}

.provider-disclosure,
.provider-contract-disclosure,
.provider-draft-actions {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.provider-disclosure > summary,
.provider-contract-disclosure > summary,
.provider-draft-actions > summary {
  padding: 0.8rem 0.9rem;
  color: var(--brand);
  font-weight: 700;
  cursor: pointer;
}

.provider-disclosure > summary:hover,
.provider-contract-disclosure > summary:hover,
.provider-draft-actions > summary:hover {
  background: var(--surface-soft);
}

.provider-disclosure[open] > summary,
.provider-contract-disclosure[open] > summary,
.provider-draft-actions[open] > summary {
  border-bottom: 1px solid var(--border);
}

.provider-disclosure-body,
.provider-contract-body,
.provider-draft-actions-body {
  margin: 0;
  padding: 0.9rem;
}

.provider-disclosure--compact {
  width: fit-content;
}

.provider-contract-disclosure > summary span {
  display: grid;
  gap: 0.25rem;
}

.provider-contract-disclosure > summary small {
  max-width: 68ch;
  color: var(--muted);
  font-weight: 400;
}

.provider-contract-disclosure > summary,
.provider-draft-actions > summary {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  list-style: none;
}

.provider-contract-disclosure > summary::-webkit-details-marker,
.provider-draft-actions > summary::-webkit-details-marker {
  display: none;
}

.provider-contract-disclosure > summary::before,
.provider-draft-actions > summary::before {
  content: "";
  flex: 0 0 0.55rem;
  width: 0.55rem;
  height: 0.55rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg);
  transition: transform 0.18s ease;
}

.provider-contract-disclosure[open] > summary::before,
.provider-draft-actions[open] > summary::before {
  transform: rotate(45deg);
}

.provider-contract-body {
  display: grid;
  gap: 0.75rem;
}

.provider-document-upload {
  grid-template-columns: minmax(10rem, 0.65fr) minmax(12rem, 1fr) auto;
}

.provider-uploaded-file {
  min-width: 0;
  padding: 0.65rem 0;
  border-top: 1px solid var(--border);
}

.provider-uploaded-file > span {
  min-width: 0;
  overflow-wrap: anywhere;
  font-weight: 700;
}

.provider-summary-metrics {
  gap: 0;
  border-block: 1px solid var(--border);
}

.provider-summary-metrics div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.6rem 0;
}

.provider-summary-metrics div + div {
  border-top: 1px solid var(--border);
}

.provider-summary-metrics dd {
  color: var(--brand);
  text-align: right;
}

.provider-summary-note {
  display: block !important;
  padding: 0.6rem 0;
  color: var(--muted);
}

.provider-summary-note p {
  margin: 0;
}

.provider-blockers,
.provider-warnings {
  padding: 0.8rem;
  border: 1px solid #e5a39d;
  border-radius: var(--radius-sm);
  background: var(--danger-soft);
}

.provider-blockers p {
  margin: 0;
}

.provider-blockers h3,
.provider-warnings h3 {
  font-size: 1rem;
}

.provider-blockers ul {
  display: grid;
  gap: 0.4rem;
  margin: 0.55rem 0 0;
  padding-left: 1.2rem;
}

.provider-warnings {
  border-color: #d9b660;
  background: var(--warning-soft);
  color: #5f3d00;
}

.provider-warnings p {
  margin: 0.45rem 0 0;
}

.provider-warnings ul {
  margin: 0.45rem 0 0;
  padding-left: 1.2rem;
}

.provider-submit-form,
.provider-submit-form .button {
  width: 100%;
}

.provider-submit-form .button:disabled {
  border-color: #cbd3dc;
  background: #e7ebef;
  box-shadow: none;
  color: #66717d;
  cursor: not-allowed;
}

.provider-submit-note {
  margin: -0.45rem 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.provider-submit-dialog {
  width: min(32rem, calc(100% - 2rem));
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 0.8rem;
  box-shadow: 0 1.25rem 3rem rgb(18 33 51 / 24%);
}

.provider-submit-dialog::backdrop {
  background: rgb(18 33 51 / 58%);
}

.provider-submit-dialog-content {
  display: grid;
  gap: 1rem;
  padding: 1.5rem;
}

.provider-submit-dialog-content h2,
.provider-submit-dialog-content p {
  margin: 0;
}

.provider-submit-dialog-summary {
  display: grid;
  gap: 0.45rem;
}

.provider-submit-dialog-warning {
  padding: 0.8rem;
  border-left: 0.25rem solid #a8cfe8;
  background: #eef8ff;
}

:root[data-theme="dark"] .provider-submit-dialog-warning {
  border-left-color: var(--accent);
  background: var(--accent-soft);
  color: var(--text);
}

.provider-submit-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

@media (max-width: 36rem) {
  .provider-submit-dialog-actions {
    flex-direction: column-reverse;
  }

  .provider-submit-dialog-actions .button {
    width: 100%;
  }
}

.provider-constancia-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.provider-draft-actions {
  border-color: var(--border);
}

.provider-draft-actions-body {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.provider-draft-actions-body p {
  margin: 0;
  color: var(--muted);
}

.provider-destructive-area {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.8rem;
  border: 1px solid #e5a39d;
  border-radius: var(--radius-sm);
  background: var(--danger-soft);
}

.provider-document-item > .provider-disclosure--compact {
  margin-left: auto;
}

@media (max-width: 850px) {
  .provider-draft {
    width: min(100% - 1rem, 70rem);
  }

  .provider-draft-layout,
  .provider-header-facts,
  .provider-upload-box,
  .provider-document-upload {
    grid-template-columns: minmax(0, 1fr);
  }

  .provider-summary-panel {
    position: static;
    grid-row: auto;
  }

  .provider-draft-heading,
  .provider-item-heading,
  .provider-summary-heading,
  .provider-uploaded-file,
  .provider-draft-actions-body,
  .provider-destructive-area {
    align-items: flex-start;
    flex-direction: column;
  }

  .provider-header-facts div + div {
    border-top: 1px solid var(--border);
    border-left: 0;
  }

  .provider-upload-control {
    align-items: stretch;
    flex-direction: column;
  }

  .provider-upload-control .button,
  .provider-document-upload .button,
  .provider-item-actions .button,
  .provider-item-actions .inline-form,
  .provider-item-actions button {
    width: 100%;
  }

  .provider-item-actions {
    align-items: stretch;
    flex-direction: column;
    width: 100%;
  }
}

html {
  min-height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: "Segoe UI", "Trebuchet MS", Arial, sans-serif;
  background:
    radial-gradient(circle at top left, var(--bg-accent), transparent 34%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-end) 100%);
}

body.public-landing-page {
  background: var(--bg);
}

.site-header--public {
  margin-top: 1.25rem;
}

.public-site-header-top {
  padding-bottom: 0;
  border-bottom: 0;
}

.public-site-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

.public-site-brand-mark {
  display: inline-grid;
  width: 2.35rem;
  height: 2.35rem;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 0.7rem;
  background: var(--brand-strong);
  color: var(--on-action);
  font-size: 1.25rem;
  font-weight: 800;
}

.public-site-brand-copy {
  display: grid;
  gap: 0.08rem;
}

.public-site-brand-name {
  color: var(--brand);
  font-size: 1.25rem;
  font-weight: 800;
  line-height: 1.1;
}

.public-site-brand-subtitle {
  color: var(--muted);
  font-size: 0.82rem;
}

.public-site-header-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.7rem;
  flex-wrap: wrap;
}

.public-landing-page .page-shell {
  width: min(68rem, calc(100% - 2rem));
  margin-top: 1.75rem;
}

.public-landing {
  display: grid;
  gap: 0;
}

.public-landing-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(16rem, 0.65fr);
  gap: clamp(2rem, 6vw, 5rem);
  align-items: center;
  padding: clamp(2rem, 5vw, 4.5rem) clamp(1.25rem, 5vw, 4.5rem);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.public-landing-hero-copy {
  min-width: 0;
}

.public-landing-kicker,
.public-landing-note-label {
  margin: 0 0 0.75rem;
  color: var(--brand-strong);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.public-landing h1,
.public-landing h2,
.public-landing h3,
.public-landing p {
  text-wrap: pretty;
}

.public-landing h1 {
  max-width: 13ch;
  margin: 0;
  color: var(--brand);
  font-size: clamp(2.2rem, 5vw, 4rem);
  letter-spacing: -0.03em;
  line-height: 1.04;
}

.public-landing-lead {
  max-width: 60ch;
  margin: 1.35rem 0 0;
  color: var(--text);
  font-size: clamp(1.05rem, 1.7vw, 1.2rem);
  line-height: 1.65;
}

.public-landing-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 1.8rem;
}

.public-landing-actions .button.primary {
  min-height: 3rem;
  padding-inline: 1.25rem;
  font-weight: 700;
}

.public-landing-secondary-action {
  color: var(--brand-strong);
  font-weight: 700;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2rem;
}

.public-landing-action-note {
  max-width: 48ch;
  margin: 0.8rem 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.public-landing-hero-note {
  min-width: 0;
  padding: 1.35rem;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.public-landing-hero-note h2 {
  margin: 0;
  color: var(--brand);
  font-size: clamp(1.25rem, 2.2vw, 1.65rem);
  line-height: 1.2;
}

.public-landing-hero-note p {
  margin: 0.8rem 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.public-landing-steps,
.public-landing-trust,
.public-landing-staff {
  padding: clamp(2.5rem, 6vw, 4.5rem) clamp(0.25rem, 2vw, 1.25rem);
  border-bottom: 1px solid var(--border);
}

.public-landing-section-heading h2 {
  max-width: 28ch;
  margin: 0;
  color: var(--brand);
  font-size: clamp(1.5rem, 2.8vw, 2.1rem);
  line-height: 1.15;
}

.public-landing-step-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(1rem, 3vw, 2.5rem);
  margin: 2rem 0 0;
  padding: 0;
  list-style: none;
}

.public-landing-step-list li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.8rem;
  min-width: 0;
}

.public-landing-step-number {
  display: inline-grid;
  width: 2rem;
  height: 2rem;
  place-items: center;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--brand-strong);
  font-weight: 800;
}

.public-landing-step-list h3 {
  margin: 0;
  color: var(--text);
  font-size: 1.05rem;
  line-height: 1.25;
}

.public-landing-step-list p,
.public-landing-staff p {
  margin: 0.45rem 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.public-landing-trust {
  display: grid;
  grid-template-columns: minmax(13rem, 0.8fr) minmax(0, 1.2fr);
  gap: clamp(1.5rem, 5vw, 4rem);
  align-items: start;
}

.public-landing-trust-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem 1.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.public-landing-trust-list li {
  min-width: 0;
  padding: 0.75rem 0;
  border-top: 1px solid var(--border);
  color: var(--text);
  line-height: 1.45;
}

.public-landing-trust-list li::before {
  margin-right: 0.5rem;
  color: var(--brand-strong);
  content: "✓";
  font-weight: 800;
}

.public-landing-staff {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.public-landing-staff h2 {
  margin: 0;
  color: var(--brand);
  font-size: 1.35rem;
}

.public-landing-footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 0 0.5rem;
  color: var(--muted);
  font-size: 0.85rem;
}

.public-landing-footer span:first-child {
  color: var(--brand);
  font-weight: 800;
}

@media (max-width: 760px) {
  .public-landing-hero,
  .public-landing-trust {
    grid-template-columns: 1fr;
  }

  .public-landing-hero {
    gap: 2rem;
    padding: 2rem 1.25rem;
  }

  .public-landing h1 {
    max-width: 16ch;
    font-size: clamp(2rem, 10vw, 3rem);
  }

  .public-landing-step-list,
  .public-landing-trust-list {
    grid-template-columns: 1fr;
  }

  .public-landing-staff,
  .public-landing-footer {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 520px) {
  .site-header--public {
    margin-top: 0.65rem;
  }

  .public-site-header-top {
    align-items: start;
    grid-template-columns: 1fr;
  }

  .public-site-header-actions {
    justify-content: flex-start;
  }

  .public-landing-page .page-shell {
    width: min(100% - 1.25rem, 68rem);
    margin-top: 1rem;
  }

  .public-landing-steps,
  .public-landing-trust,
  .public-landing-staff {
    padding-inline: 0.25rem;
  }
}

a {
  color: var(--brand-strong);
}

a:hover {
  text-decoration-thickness: 2px;
}

p,
li {
  line-height: 1.6;
}

.app-shell {
  min-height: 100vh;
}

.site-header {
  box-sizing: border-box;
  width: min(var(--shell-width-wide), calc(100% - 2rem));
  margin: 1rem auto 0;
  padding: 0.9rem 1rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.site-header--wide {
  width: min(var(--shell-width-wide), calc(100% - 2rem));
}

.site-header--wide {
  box-sizing: border-box;
}

.site-header-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--border);
}

.site-brand {
  display: grid;
  gap: 0.22rem;
  min-width: 0;
}

.site-municipio-identity {
  color: var(--brand);
  font-size: clamp(1.65rem, 1.2rem + 1.45vw, 2.25rem);
  font-weight: 800;
  line-height: 1.05;
  overflow-wrap: anywhere;
  text-wrap: balance;
}

.site-brand-link {
  display: grid;
  gap: 0.2rem;
  text-decoration: none;
  color: inherit;
}

.site-brand-kicker {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.72rem;
  color: var(--muted);
}

.site-brand-name {
  font-size: 1.08rem;
  font-weight: 800;
  color: var(--brand);
  line-height: 1.2;
}

.site-brand-subtitle {
  margin: 0;
  color: var(--muted);
}

.site-user-area {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.6rem;
  flex-wrap: wrap;
  flex: 0 0 auto;
}

.site-user-session {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 0;
  padding: 0.45rem 0.55rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-alt);
}

.site-user-summary {
  display: grid;
  gap: 0.12rem;
  min-width: 0;
}

.site-user-label {
  padding-inline: 0.15rem;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1;
}

.site-user-name {
  display: inline-flex;
  align-items: center;
  min-height: 1.75rem;
  padding: 0.18rem 0.15rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: transparent;
  color: var(--brand);
  font-weight: 700;
  line-height: 1.15;
}

a.site-user-name {
  text-decoration: none;
}

a.site-user-name:hover,
a.site-user-name[aria-current="page"] {
  border-color: var(--brand-strong);
  background: var(--brand-strong);
  color: #fff;
}

.site-user-settings,
.site-theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-width: 2.35rem;
  min-height: 2.35rem;
  padding: 0.35rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--muted);
  font-weight: 700;
  text-decoration: none;
}

.site-user-settings svg,
.site-theme-toggle svg {
  width: 1.05rem;
  height: 1.05rem;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.site-user-settings,
.site-theme-toggle {
  box-sizing: border-box;
  flex: 0 0 auto;
  width: 2.35rem;
  min-width: 2.35rem;
  height: 2.35rem;
  padding: 0;
}

.site-theme-toggle .theme-icon--sun {
  display: none;
}

:root[data-theme="dark"] .site-theme-toggle .theme-icon--moon {
  display: none;
}

:root[data-theme="dark"] .site-theme-toggle .theme-icon--sun {
  display: block;
}

.site-user-settings:hover,
.site-user-settings:focus-visible,
.site-user-settings[aria-current="page"] {
  border-color: var(--brand-strong);
  background: var(--accent-soft);
  color: var(--brand-strong);
}

.site-user-settings-label,
.site-theme-toggle-label {
  display: none;
}

.site-user-logout {
  margin: 0;
}

.site-user-login {
  display: inline-flex;
  align-items: center;
  min-height: 2.35rem;
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--brand-strong);
  background: var(--accent-soft);
  color: var(--brand-strong);
  font-weight: 700;
  text-decoration: none;
  transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.site-user-login:hover,
.site-user-login[aria-current="page"] {
  border-color: var(--brand-strong);
  background: var(--brand-strong);
  color: #fff;
}

.site-user-area--home {
  align-items: center;
}

.site-user-home {
  display: inline-flex;
  align-items: center;
  min-height: 2.35rem;
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--brand);
  font-weight: 700;
  text-decoration: none;
  transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.site-user-home:hover,
.site-user-home:focus-visible {
  border-color: var(--brand-strong);
  background: var(--accent-soft);
  color: var(--brand-strong);
}

.site-user-logout button {
  min-height: 2.2rem;
  padding: 0.45rem 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--danger);
  background: var(--surface);
  color: var(--danger);
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.site-user-logout button:hover {
  border-color: var(--danger);
  background: var(--danger);
  color: #fff;
}

:root[data-theme="dark"] .site-user-logout button {
  min-height: 2.35rem;
  padding: 0.35rem 0.75rem;
  border-color: var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-alt);
  color: var(--muted);
}

:root[data-theme="dark"] .site-user-logout button:hover,
:root[data-theme="dark"] .site-user-logout button:focus-visible {
  border-color: var(--border-strong);
  background: var(--surface-soft);
  color: var(--text);
}

.site-nav {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr));
  gap: 0.45rem;
  margin-top: 0.8rem;
}

.site-nav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.1rem;
  padding: 0.4rem 0.5rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  text-decoration: none;
  color: var(--brand);
  background: var(--surface-alt);
  font-weight: 700;
  font-size: 0.9rem;
  line-height: 1.15;
  white-space: nowrap;
  transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  border-color: var(--brand-strong);
  background: var(--brand-strong);
  color: #fff;
  text-decoration: none;
}

@media (max-width: 48rem) {
  .site-header-top {
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
    gap: 0.85rem;
  }

  .site-user-area {
    justify-content: flex-start;
    width: 100%;
    box-sizing: border-box;
  }
}

.page-shell {
  position: relative;
  box-sizing: border-box;
  width: min(var(--shell-width), calc(100% - 2rem));
  margin: 1rem auto 2rem;
  display: grid;
  gap: 1rem;
}

.page-shell.is-partial-navigation-loading .page-content {
  opacity: 0.62;
}

.page-shell.is-partial-navigation-loading::before {
  content: "";
  position: absolute;
  z-index: 1;
  inset: 0 auto auto 0;
  width: 38%;
  height: 0.2rem;
  border-radius: var(--radius-sm);
  background: var(--accent);
  animation: partial-navigation-progress 0.8s ease-in-out infinite alternate;
}

@keyframes partial-navigation-progress {
  from {
    transform: translateX(0);
  }

  to {
    transform: translateX(160%);
  }
}

.page-shell--wide {
  width: min(var(--shell-width-wide), calc(100% - 2rem));
}

html:has(.page-shell--wide) {
  overflow-x: clip;
}

html:has(.page-shell--wide) body {
  overflow-x: clip;
}

.page-content {
  display: grid;
  gap: 1rem;
  transition: opacity 0.16s ease;
}

.system-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
  width: min(var(--shell-width), calc(100% - 2rem));
  margin: 0 auto 1.5rem;
  padding: 0.85rem 0;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.82rem;
}

.system-footer p {
  margin: 0;
}

.system-footer-attribution a,
.system-footer-attribution button,
.system-footer-links a {
  color: inherit;
  font-weight: 700;
}

.system-footer-attribution button {
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.system-footer-links {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.85rem;
}

.system-footer-links button {
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 0.15em;
  cursor: pointer;
}

.system-footer-links a:hover,
.system-footer-links a:focus-visible,
.system-footer-links button:hover,
.system-footer-links button:focus-visible,
.system-footer-attribution button:hover,
.system-footer-attribution button:focus-visible {
  color: var(--brand-strong);
}

.system-about-dialog {
  width: min(38rem, calc(100% - 2rem));
  max-height: min(42rem, calc(100% - 2rem));
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 1.25rem 3rem rgb(18 33 51 / 24%);
}

.system-about-dialog::backdrop {
  background: rgb(18 33 51 / 58%);
}

.system-about-dialog__content {
  display: grid;
  gap: 1rem;
  padding: clamp(1.25rem, 4vw, 1.75rem);
}

.system-about-dialog__header h2,
.system-about-dialog__header p,
.system-about-dialog__details p {
  margin: 0;
}

.system-about-dialog__header {
  display: grid;
  gap: 0.35rem;
}

.system-about-dialog__header h2 {
  color: var(--brand);
  font-size: 1.35rem;
  line-height: 1.25;
}

.system-about-dialog__details {
  display: grid;
  gap: 0.5rem;
  line-height: 1.45;
}

.system-about-dialog__support-note {
  margin-top: 0.35rem !important;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.9rem;
}

.system-about-dialog__actions {
  display: flex;
  justify-content: flex-end;
}

.site-ingreso-dialog {
  width: min(28rem, calc(100% - 2rem));
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 1.25rem 3rem rgb(18 33 51 / 24%);
}

.site-ingreso-dialog::backdrop {
  background: rgb(18 33 51 / 58%);
}

.site-ingreso-dialog__content {
  display: grid;
  gap: 1rem;
  padding: clamp(1.25rem, 4vw, 1.75rem);
}

.site-ingreso-dialog__options {
  display: grid;
  gap: 0.6rem;
}

.site-ingreso-dialog__option {
  display: block;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-alt);
  color: var(--brand-strong);
  font-weight: 800;
}

.site-ingreso-dialog__option:hover,
.site-ingreso-dialog__option:focus-visible {
  border-color: var(--brand-strong);
  background: var(--accent-soft);
  text-decoration: none;
}

.site-ingreso-dialog__actions {
  display: flex;
  justify-content: flex-end;
}

@media (max-width: 600px) {
  .system-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .system-footer-links {
    justify-content: flex-start;
  }

  .system-about-dialog__actions .button {
    width: 100%;
  }
}

.access-denied-card {
  display: grid;
  gap: 1.5rem;
  max-width: 42rem;
  margin-inline: auto;
  padding: clamp(1.5rem, 4vw, 2.5rem);
  background: linear-gradient(180deg, var(--surface) 0%, var(--surface-alt) 100%);
}

.access-denied-card__content {
  display: grid;
  gap: 0.5rem;
  max-width: 38ch;
}

.access-denied-card__content h1,
.access-denied-card__content p {
  margin: 0;
}

.access-denied-card__content p:last-child {
  color: var(--muted);
}

.access-denied-card__actions {
  align-items: center;
}

.ingreso-card {
  max-width: 60rem;
  margin-inline: auto;
  padding: 2rem;
  background: linear-gradient(180deg, #ffffff 0%, var(--surface-alt) 100%);
}

.administrativo-home {
  padding: 0;
}

.administrativo-home-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1.25rem;
  padding: 1.5rem 1.5rem 1.25rem;
}

.administrativo-home-header h1 {
  margin: 0 0 0.35rem;
  font-size: 1.55rem;
}

.administrativo-home-header .page-header__main,
.administrativo-home-section-header {
  display: grid;
  gap: 0.25rem;
}

.administrativo-home-header p,
.administrativo-home-section-header p {
  margin: 0;
  color: var(--muted);
}

.administrativo-home-body {
  display: grid;
  gap: 1.25rem;
  padding: 0 1.5rem 1.5rem;
}

.administrativo-home-body section {
  display: grid;
  gap: 0.75rem;
}

.administrativo-home-body h2 {
  margin: 0;
  color: var(--brand);
  font-size: 1.1rem;
}

table.report-table.administrativo-home-table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
  margin: 0;
}

table.report-table.administrativo-home-table .administrativo-home-table__expediente {
  width: 9.5rem;
}

table.report-table.administrativo-home-table .administrativo-home-table__provider {
  width: auto;
}

table.report-table.administrativo-home-table .administrativo-home-table__status {
  width: 10rem;
}

table.report-table.administrativo-home-table .administrativo-home-table__submitted {
  width: 10.5rem;
  text-align: right;
  white-space: nowrap;
}

table.report-table.administrativo-home-table th,
table.report-table.administrativo-home-table td {
  vertical-align: middle;
}

table.report-table.administrativo-home-table .administrativo-home-table__provider {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.provider-login-card {
  width: 100%;
  max-width: 62rem;
  margin-inline: auto;
  justify-self: center;
  padding: 1.5rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(20rem, 23rem);
  gap: 2rem;
  align-items: start;
}

.provider-login-copy {
  display: grid;
  gap: 0.7rem;
  align-content: start;
  max-width: 34rem;
}

.provider-login-intro {
  margin: 0;
  max-width: 34ch;
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.65;
}

.provider-login-options {
  display: grid;
  gap: 1rem;
  min-width: 0;
  padding-left: 1.75rem;
  border-left: 1px solid var(--border);
}

.provider-login-form {
  gap: 0.65rem;
}

.provider-login-form h2 {
  margin: 0;
  color: var(--brand);
  font-size: 1.05rem;
  line-height: 1.3;
}

.provider-login-form input {
  width: 100%;
}

.provider-login-form .button {
  box-sizing: border-box;
}

.provider-login-form--email {
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.provider-login-field {
  display: grid;
  gap: 0.35rem;
}

.provider-login-note {
  margin: 0;
  max-width: 34ch;
  color: var(--muted);
  line-height: 1.6;
}

.provider-login-help {
  margin: 0;
  max-width: 28ch;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.45;
}

.provider-login-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.55rem;
}

.provider-login-actions .button {
  width: 100%;
  min-width: 0;
}

.provider-login-actions .button.secondary {
  width: auto;
  padding-inline: 0.75rem;
  white-space: nowrap;
}

/* Shared public provider password-reset page */
.provider-password-reset-page .site-header {
  margin-top: 0.75rem;
}

.provider-password-reset-page .site-municipio-identity {
  font-size: clamp(1.25rem, 1rem + 1.15vw, 1.9rem);
  line-height: 1.15;
}

.provider-password-reset-page .site-brand-name {
  font-size: 1rem;
}

.provider-password-reset-page .page-shell {
  margin-top: 1.25rem;
}

.provider-password-reset-card {
  max-width: 42rem;
  margin-inline: auto;
  padding: clamp(1.25rem, 3vw, 2rem);
  display: grid;
  gap: 1.25rem;
  box-shadow: none;
}

.provider-password-reset-intro {
  display: grid;
  gap: 0.45rem;
  max-width: 38rem;
  padding-bottom: 0.9rem;
  border-bottom: 1px solid var(--border);
}

.provider-password-reset-intro .eyebrow {
  margin: 0 0 0.15rem;
  color: var(--brand-strong);
}

.provider-password-reset-intro h1 {
  margin: 0 0 0.25rem;
  font-size: 2rem;
}

.provider-password-reset-copy {
  max-width: 55ch;
  margin: 0;
  color: var(--muted);
}

.provider-password-reset-form {
  max-width: 36rem;
  gap: 0.85rem;
}

.provider-password-reset-field {
  display: grid;
  gap: 0.35rem;
}

.provider-password-reset-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding-top: 0.25rem;
  border-top: 1px solid var(--border);
}

.provider-password-reset-actions .button.primary {
  min-width: 11rem;
}

.provider-password-reset-back {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  padding: 0.4rem 0;
}

.ingreso-header {
  max-width: 42rem;
  margin-bottom: 1.5rem;
}

.ingreso-header p {
  margin: 0;
  color: var(--muted);
}

.ingreso-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  align-items: stretch;
  grid-auto-rows: 1fr;
}

.ingreso-option {
  display: grid;
  align-content: start;
  gap: 0.75rem;
  padding: 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, var(--surface) 0%, var(--surface-alt) 100%);
  color: var(--text);
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  transition:
    border-color 0.18s ease,
    background-color 0.18s ease,
    transform 0.18s ease,
    box-shadow 0.18s ease;
}

.ingreso-option:hover {
  border-color: var(--border-strong);
  background: linear-gradient(180deg, #ffffff 0%, #f4f8fc 100%);
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
  text-decoration: none;
}

.ingreso-option:focus,
.ingreso-option:focus-visible {
  outline: 3px solid rgba(15, 98, 254, 0.28);
  outline-offset: 3px;
  border-color: var(--accent);
  text-decoration: none;
}

.ingreso-option:focus .ingreso-option-title,
.ingreso-option:focus-visible .ingreso-option-title,
.ingreso-option:hover .ingreso-option-title {
  color: var(--brand);
}

.ingreso-option-title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--brand);
}

.ingreso-option-text {
  margin: 0;
  color: var(--muted);
}

.ingreso-option-cta {
  margin-top: auto;
  font-weight: 800;
  color: var(--brand-strong);
}

/* Shared public ingreso selector */
.login-page {
  background: var(--bg);
}

.login-page .site-header {
  margin-top: 0.75rem;
}

.login-page .site-municipio-identity {
  font-size: clamp(1.25rem, 1rem + 1.15vw, 1.9rem);
  line-height: 1.15;
}

.login-page .page-shell {
  margin-top: 1.25rem;
}

.staff-login {
  max-width: 38rem;
  margin-inline: auto;
  padding: clamp(1.25rem, 3vw, 1.75rem);
  box-shadow: none;
}

.staff-login__header {
  display: grid;
  gap: 0.35rem;
  margin-bottom: 1.25rem;
}

.staff-login__header .eyebrow {
  margin-bottom: 0;
  color: var(--brand-strong);
}

.staff-login__header h1 {
  margin-bottom: 0.15rem;
  font-size: 2rem;
  overflow-wrap: anywhere;
}

.staff-login__header p:last-child {
  max-width: 48ch;
  margin: 0;
  color: var(--muted);
}

.staff-login > .message {
  margin: 0 0 1rem;
}

.staff-login__form {
  gap: 0.85rem;
}

.staff-login__form p {
  gap: 0.35rem;
}

.staff-login__form input {
  min-height: 2.75rem;
}

.staff-login__actions {
  display: flex;
  align-items: center;
  margin-top: 0.1rem;
}

.staff-login__actions button {
  min-height: 2.75rem;
}

.staff-login__links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.staff-login__links a {
  overflow-wrap: anywhere;
}

.provider-access-card {
  width: min(100%, 56rem);
  margin-inline: auto;
}

.provider-access-options {
  display: grid;
  gap: 0.7rem;
}

.provider-access-option {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-alt);
  cursor: pointer;
}

.provider-access-option:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.provider-access-option input[type="radio"] {
  width: auto;
  margin: 0;
  flex: 0 0 auto;
}

.provider-access-option span {
  display: grid;
  gap: 0.15rem;
}

.provider-access-option small {
  color: var(--muted);
}

@media (max-width: 760px) {
  .staff-login {
    max-width: none;
    padding: 1rem;
  }

  .staff-login__header {
    margin-bottom: 1rem;
  }

  .staff-login__header h1 {
    font-size: 1.75rem;
  }

  .staff-login__actions button {
    width: 100%;
  }
}

.ingreso-page {
  background: var(--bg);
}

.ingreso-page .site-header {
  margin-top: 0.75rem;
}

.ingreso-page .site-municipio-identity {
  font-size: clamp(1.25rem, 1rem + 1.15vw, 1.9rem);
  line-height: 1.15;
}

.ingreso-page .site-brand-name {
  font-size: 1rem;
}

.ingreso-page .page-shell {
  margin-top: 1.25rem;
}

.ingreso-page .ingreso-card {
  max-width: none;
  padding: clamp(1.25rem, 3vw, 2rem);
  background: var(--surface);
  box-shadow: none;
}

.ingreso-page .ingreso-header {
  max-width: 48rem;
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.ingreso-page .ingreso-header .eyebrow {
  margin: 0 0 0.3rem;
  color: var(--brand-strong);
}

.ingreso-page .ingreso-header h1 {
  margin: 0 0 0.35rem;
  font-size: clamp(1.65rem, 3vw, 2.3rem);
}

.ingreso-page .ingreso-header p:last-child {
  max-width: 48ch;
}

.ingreso-page .ingreso-options {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.ingreso-page .ingreso-option {
  min-width: 0;
  min-height: 12rem;
  padding: 1.25rem 1.25rem 1.1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-alt);
  box-shadow: none;
  transition: border-color 0.18s ease, background-color 0.18s ease;
}

.ingreso-page .ingreso-option--provider {
  border-color: var(--brand-strong);
  background: var(--accent-soft);
}

.ingreso-page .ingreso-option:hover,
.ingreso-page .ingreso-option:focus-visible {
  border-color: var(--brand-strong);
  background: var(--surface);
  transform: none;
  box-shadow: none;
}

.ingreso-page .ingreso-option:focus,
.ingreso-page .ingreso-option:focus-visible {
  outline: 3px solid rgba(15, 98, 254, 0.34);
  outline-offset: 3px;
}

.ingreso-page .ingreso-option-kicker {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1.3;
}

.ingreso-page .ingreso-option--provider .ingreso-option-kicker {
  color: var(--brand-strong);
}

.ingreso-page .ingreso-option-title {
  margin-top: 0.25rem;
  font-size: 1.2rem;
  line-height: 1.25;
}

.ingreso-page .ingreso-option-text {
  max-width: 38ch;
}

.ingreso-page .ingreso-option-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding-top: 0.25rem;
}

@media (max-width: 760px) {
  .ingreso-page .ingreso-card {
    padding: 1rem;
  }

  .ingreso-page .ingreso-options {
    grid-template-columns: 1fr;
  }

  .ingreso-page .ingreso-option {
    min-height: 0;
  }
}

.card {
  width: 100%;
  box-sizing: border-box;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.page-header {
  display: grid;
  gap: 1rem;
  padding: 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, var(--surface) 0%, var(--surface-alt) 100%);
}

.page-header__main {
  display: grid;
  gap: 0.45rem;
  max-width: 68ch;
}

.page-header__main h1,
.page-header__main h2,
.page-header__main p {
  margin: 0;
}

.page-header__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.page-header__actions .button {
  min-height: 2.35rem;
}

.toolbar-panel {
  display: grid;
  gap: 0.75rem;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-alt);
}

/* Layout-only control groups leave the visible surface to their direct controls. */
.toolbar-panel--controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.toolbar-panel form {
  gap: 0.75rem;
}

.toolbar-panel .button-row,
.toolbar-panel button {
  margin-top: 0;
}

.user-list {
  display: grid;
  gap: 0.6rem;
  padding: 0;
  margin: 0;
  list-style: none;
}

.user-list__item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-alt);
}

.user-list__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
}

.user-admin {
  gap: 1.5rem;
}

.user-admin .page-header {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
}

.user-admin__workspace {
  display: grid;
  grid-template-columns: minmax(15rem, 0.7fr) minmax(0, 1.8fr);
  gap: 1.5rem;
  align-items: start;
}

.user-admin__directory {
  display: grid;
  gap: 1rem;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-alt);
}

.user-admin__directory-heading,
.user-admin__editor-heading,
.user-admin__save-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.user-admin__directory-heading h2,
.user-admin__directory-heading p,
.user-admin__editor-heading h2,
.user-admin__editor-heading p {
  margin: 0;
}

.user-admin__directory-heading h2,
.user-admin__editor-heading h2 {
  font-size: 1.2rem;
}

.user-admin__count,
.user-admin__status {
  display: inline-flex;
  align-items: center;
  min-height: 1.8rem;
  padding: 0.1rem 0.55rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--brand);
  font-size: 0.82rem;
  font-weight: 800;
  white-space: nowrap;
}

.user-admin__status--active {
  border-color: #a6d6bb;
  background: var(--success-soft);
  color: var(--success);
}

.user-admin__list {
  gap: 0.45rem;
}

.user-admin__user {
  display: grid;
  gap: 0.45rem;
  padding: 0.75rem;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text);
  text-decoration: none;
  width: 100%;
  box-sizing: border-box;
  transition: background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.user-admin__user:hover,
.user-admin__user:focus-visible {
  border-color: var(--border-strong);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
}

.user-admin__user--selected,
.user-admin__user--selected:hover {
  border-color: #7ca7df;
  background: #e7f0ff;
  color: var(--brand);
}

:root[data-theme="dark"] .user-admin__user--selected,
:root[data-theme="dark"] .user-admin__user--selected:hover {
  border-color: var(--accent);
  background: var(--selected);
  color: var(--text);
}

.user-admin__user-name {
  font-weight: 800;
  overflow-wrap: anywhere;
}

.user-admin__user-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.user-admin__hint,
.user-admin__empty {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.user-admin__hint {
  padding-top: 0.85rem;
  border-top: 1px solid var(--border);
}

.user-admin__editor {
  display: grid;
  gap: 1.25rem;
  min-width: 0;
}

.user-admin__editor-heading {
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.user-admin__editor-heading .eyebrow {
  margin-bottom: 0.25rem;
}

.user-admin__editor-subtitle,
.user-admin__section-heading p,
.user-admin__context-copy {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.user-admin__form {
  gap: 1.25rem;
}

.user-admin__context,
.user-admin__permissions-section,
.user-admin__access-actions {
  margin: 0;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.user-admin__context legend,
.user-admin__permissions-grid legend {
  padding: 0 0.35rem;
  color: var(--brand);
  font-weight: 800;
}

.user-admin__context-copy {
  margin-top: 0;
}

.user-admin__password-control {
  display: flex;
  align-items: stretch;
  gap: 0.5rem;
}

.user-admin__password-control input {
  min-width: 0;
  flex: 1 1 auto;
}

.user-admin__password-control .button {
  flex: 0 0 auto;
}

.user-admin__section-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.9rem;
}

.user-admin__section-heading h3 {
  margin: 0;
  font-size: 1.05rem;
}

.user-admin__access-note p {
  margin: 0;
}

.user-admin__access-note p + p {
  margin-top: 0.35rem;
}

:root[data-theme="dark"] .user-admin__access-note {
  background: var(--accent-soft);
  border-color: var(--border-strong);
  color: var(--text);
}

.user-admin__fields,
.user-admin__permissions-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 1rem;
}

.user-admin__context .user-admin__fields {
  grid-template-columns: 330px 362px;
}

.user-admin__context-field input {
  box-sizing: border-box;
  height: 42px;
}

.user-admin__context-field--email input {
  width: 330px;
}

.user-admin__context-field--password input {
  width: 286px;
  flex: 0 0 286px;
}

.user-admin__context-field--password .button {
  box-sizing: border-box;
  width: 68px;
  height: 42px;
  padding-inline: 0.35rem;
}

.user-admin__permissions-grid fieldset,
.user-admin__municipios {
  height: 100%;
  box-sizing: border-box;
}

.user-admin__permission-group {
  display: grid;
  align-content: start;
  gap: 0.55rem;
  min-width: 0;
}

.user-admin__permission-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.user-admin__permission-group-header h3,
.user-admin__permission-group-header h4 {
  margin: 0;
  color: var(--brand);
  font-size: 1rem;
}

.user-admin__selectable-permissions {
  margin: 0;
}

.user-admin__municipio-context {
  display: grid;
  gap: 0.15rem;
  margin-top: 1rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border);
}

.user-admin__municipio-label {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.user-admin__municipio-context strong {
  overflow-wrap: anywhere;
}

.user-admin__save-row {
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
  justify-content: space-between;
}

.user-admin__save-row > div {
  display: grid;
  gap: 0.15rem;
  min-width: 0;
}

.user-admin__save-row span {
  color: var(--muted);
  font-size: 0.9rem;
}

.user-admin__access-actions {
  background: var(--surface-alt);
}

.user-admin__access-actions-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.user-admin__access-actions .inline-form {
  margin: 0;
}

.user-admin__blank-state {
  max-width: 48ch;
  padding: 2rem 1rem;
  color: var(--muted);
}

.user-admin__blank-state h2,
.user-admin__blank-state p {
  margin: 0;
}

.user-admin__blank-state p {
  margin-top: 0.45rem;
}

@media (max-width: 760px) {
  .user-admin .page-header,
  .user-admin__workspace,
  .user-admin__fields,
  .user-admin__permissions-grid {
    grid-template-columns: 1fr;
  }

  .user-admin__workspace {
    gap: 1rem;
  }

  .user-admin__directory {
    padding: 0.85rem;
  }

  .user-admin__save-row,
  .user-admin__password-control {
    align-items: stretch;
  }

  .user-admin__save-row > button {
    width: 100%;
  }

  .user-admin__context .user-admin__fields {
    grid-template-columns: 1fr;
  }

  .user-admin__context-field--email input {
    width: 100%;
  }

  .user-admin__context-field--password input {
    width: auto;
    flex: 1 1 auto;
  }

  .user-admin__context-field--password .button {
    flex: 0 0 68px;
  }

  .user-admin__user {
    padding: 0.7rem;
  }
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.landing-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

/* Authenticated account workspace */
.account-page {
  display: grid;
  gap: 1rem;
  min-width: 0;
}

.account-context,
.account-destinations {
  min-width: 0;
  padding: 1.25rem 1.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.account-context {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(15rem, 19rem);
  align-items: center;
  gap: 1rem 1.5rem;
}

.account-context__intro {
  display: grid;
  align-content: center;
  gap: 0.35rem;
  min-width: 0;
}

.account-context__intro .eyebrow,
.account-context__intro h1,
.account-context__summary {
  margin: 0;
}

.account-context__intro .eyebrow,
.account-destinations__header .eyebrow {
  color: var(--brand-strong);
}

.account-context__intro h1 {
  color: var(--brand);
  font-size: 1.85rem;
}

.account-context__summary {
  max-width: 55ch;
  color: var(--muted);
}

.account-session {
  display: grid;
  align-content: start;
  gap: 0.2rem;
  min-width: 0;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-alt);
}

.account-session__label {
  margin: 0;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.account-session__user,
.account-session__role {
  margin: 0;
  overflow-wrap: anywhere;
}

.account-session__user {
  color: var(--brand);
  font-weight: 800;
}

.account-session__role {
  color: var(--muted);
  font-size: 0.9rem;
}

.account-session__password {
  justify-self: start;
  margin-top: 0.5rem;
  min-height: 2.75rem;
  padding: 0.45rem 0.75rem;
  font-size: 0.92rem;
}

.account-session__password:focus,
.account-session__password:focus-visible {
  outline: 3px solid rgba(15, 98, 254, 0.28);
  outline-offset: 2px;
}

.account-destinations {
  display: grid;
  gap: 1rem;
}

.account-destinations__header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--border);
}

.account-destinations__header .eyebrow,
.account-destinations__header h2,
.account-destinations__hint,
.account-destinations__empty {
  margin: 0;
}

.account-destinations__header h2 {
  color: var(--brand);
  font-size: 1.35rem;
}

.account-destinations__hint,
.account-destinations__empty {
  color: var(--muted);
}

.account-destination-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.account-destination {
  display: grid;
  align-content: start;
  gap: 0.3rem;
  min-width: 0;
  min-height: 5.25rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-alt);
  color: var(--text);
  text-decoration: none;
  transition: background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.account-destination__label,
.account-destination__description {
  overflow-wrap: anywhere;
}

.account-destination__label {
  color: var(--brand);
  font-weight: 800;
  line-height: 1.25;
}

.account-destination__description {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.4;
}

.account-destination--primary {
  border-color: var(--brand-strong);
  background: var(--accent-soft);
}

.account-destination:hover,
.account-destination:focus-visible {
  border-color: var(--brand-strong);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
}

.account-destination--primary:hover,
.account-destination--primary:focus-visible {
  background: var(--surface);
}

.account-destinations--limited .account-destination {
  width: min(100%, 28rem);
}

@media (max-width: 760px) {
  .account-context,
  .account-destinations {
    padding: 1rem;
  }

  .account-context {
    grid-template-columns: 1fr;
  }

  .account-destinations__header {
    align-items: start;
    flex-direction: column;
  }

  .account-destination-grid {
    grid-template-columns: 1fr;
  }

  .account-destination {
    min-height: 0;
  }
}

.superior-operations-panel {
  display: grid;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.settings-page {
  display: grid;
  gap: 1rem;
}

.settings-page__header,
.settings-section {
  min-width: 0;
  padding: 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.settings-page__header {
  background: var(--surface-alt);
}

.settings-page__header h1,
.settings-page__header p,
.settings-section__header h2,
.settings-section__header p {
  margin: 0;
}

.settings-page__header h1 {
  margin-top: 0.15rem;
  margin-bottom: 0.3rem;
  color: var(--brand);
  font-size: 1.7rem;
}

.settings-page__header p:last-child,
.settings-section__header p {
  color: var(--muted);
}

.settings-page__sections {
  display: grid;
  gap: 1rem;
}

.settings-section__header {
  margin-bottom: 1rem;
}

.settings-section__header h2 {
  color: var(--brand);
  font-size: 1.25rem;
}

.superior-operations-panel__header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 1rem;
  padding: 1.1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface-alt);
}

.superior-operations-panel__header h1,
.superior-operations-panel__header p,
.superior-parameters-area__header h2,
.superior-parameters-area__header p {
  margin: 0;
}

.superior-operations-panel__section {
  color: var(--brand);
  font-size: 0.78rem;
  font-weight: 800;
}

.superior-operations-panel__header h1 {
  margin-top: 0.15rem;
  margin-bottom: 0.25rem;
  font-size: 1.55rem;
}

.superior-operations-panel__header p {
  color: var(--muted);
}

.superior-operations-panel__municipio {
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  white-space: nowrap;
}

.superior-operations-panel__body {
  display: grid;
  min-height: 22rem;
}

.superior-parameters-area {
  display: grid;
  align-content: start;
  gap: 1rem;
  padding: 1.1rem 1.25rem 1.25rem;
  background: var(--surface);
}

.superior-parameters-area__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.superior-parameters-area__header h2 {
  color: var(--brand);
  font-size: 1.25rem;
}

.superior-parameters-area__header p {
  margin-top: 0.25rem;
  color: var(--muted);
}

.superior-municipio-selector {
  gap: 0.45rem;
}

.superior-parameters-form {
  display: grid;
  gap: 0.85rem;
  max-width: 36rem;
}

.superior-parameters-form p {
  margin: 0;
}

.superior-parameters-form label {
  margin-bottom: 0.35rem;
  color: var(--text);
}

.superior-parameters-form input {
  max-width: 24rem;
}

.superior-parameters-form button {
  margin-top: 0.2rem;
}

.eyebrow {
  margin: 0 0 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.75rem;
  color: var(--muted);
}

h1,
h2,
h3,
h4,
h5,
h6 {
  margin-top: 0;
  line-height: 1.2;
  text-wrap: balance;
}

h1 {
  margin-bottom: 1rem;
  font-size: clamp(1.9rem, 4vw, 2.8rem);
}

h2 {
  margin-bottom: 0.5rem;
  font-size: clamp(1.2rem, 2vw, 1.55rem);
}

h3 {
  margin-bottom: 0.4rem;
  font-size: 1.05rem;
}

.stack {
  display: grid;
  gap: 1rem;
}

form {
  display: grid;
  gap: 1rem;
}

form p {
  margin: 0;
  display: grid;
  gap: 0.35rem;
}

label {
  display: block;
  font-weight: 700;
}

input,
select,
textarea,
button,
.button {
  font: inherit;
}

input,
select,
textarea {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 0.72rem 0.8rem;
  background: var(--control-bg);
  color: var(--text);
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background-color 0.16s ease;
}

input::placeholder,
textarea::placeholder {
  color: #4f5f70;
}

input:hover,
select:hover,
textarea:hover {
  border-color: var(--brand);
}

textarea {
  min-height: 7rem;
  resize: vertical;
}

input[type="file"] {
  padding: 0.5rem;
}

button,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  width: fit-content;
  min-height: 2.6rem;
  padding: 0.65rem 1rem;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-decoration: none;
  touch-action: manipulation;
  transition:
    background-color 0.16s ease,
    border-color 0.16s ease,
    color 0.16s ease,
    box-shadow 0.16s ease;
}

button,
.button.primary {
  background: var(--brand-strong);
  color: #fff;
}

.button.secondary,
button.secondary {
  background: var(--surface);
  color: var(--brand);
  border-color: var(--border);
}

button:hover,
.button:hover {
  filter: brightness(0.97);
}

button:active,
.button:active,
a.site-user-name:active,
.site-user-login:active,
.site-nav a:active {
  transform: translateY(1px);
}

button:focus-visible,
.button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(15, 98, 254, 0.28);
  outline-offset: 2px;
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(15, 98, 254, 0.14);
}

button:disabled,
.button:disabled,
button[aria-disabled="true"],
.button[aria-disabled="true"],
input:disabled,
select:disabled,
textarea:disabled {
  cursor: not-allowed;
  opacity: 0.62;
  filter: none;
}

button[aria-busy="true"],
.button[aria-busy="true"] {
  position: relative;
  pointer-events: none;
}

button[aria-busy="true"]::after,
.button[aria-busy="true"]::after {
  content: "";
  width: 0.85rem;
  height: 0.85rem;
  margin-left: 0.45rem;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.45);
  border-top-color: #fff;
  animation: spin 0.8s linear infinite;
}

input[aria-invalid="true"],
select[aria-invalid="true"],
textarea[aria-invalid="true"] {
  border-color: var(--danger);
  background: var(--danger-control);
}

input[aria-invalid="true"]:focus-visible,
select[aria-invalid="true"]:focus-visible,
textarea[aria-invalid="true"]:focus-visible {
  box-shadow: 0 0 0 3px rgba(180, 35, 24, 0.16);
}

.inline-form {
  display: inline-flex;
  margin-left: 0.5rem;
}

fieldset {
  display: grid;
  gap: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1rem;
  background: var(--surface-soft);
}

legend {
  padding: 0 0.35rem;
  font-weight: 700;
}

.report-permissions-list {
  gap: 0.7rem;
}

.report-permission-option {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0;
  font-weight: 600;
}

.report-permission-option input[type="checkbox"] {
  width: auto;
  margin: 0;
  flex: 0 0 auto;
}

.report-permission-option span {
  line-height: 1.35;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
}

table {
  width: 100%;
  border-collapse: collapse;
}

.report-table {
  min-width: 980px;
  table-layout: fixed;
}

table.report-table.report-table--financial {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
}

table.report-table.report-table--financial .financial-col-expediente {
  width: 12%;
}

table.report-table.report-table--financial .financial-col-cuit {
  width: 12%;
}

table.report-table.report-table--financial .financial-col-provider {
  width: 29%;
}

table.report-table.report-table--financial .financial-col-date {
  width: 0;
}

table.report-table.report-table--financial .financial-col-total,
table.report-table.report-table--financial .financial-col-total-paid,
table.report-table.report-table--financial .financial-col-pending {
  width: 12%;
}

table.report-table.report-table--financial .financial-col-status {
  width: 11%;
}

table.report-table.report-table--financial th,
table.report-table.report-table--financial td {
  overflow: hidden;
  text-overflow: ellipsis;
}

table.report-table.report-table--financial .table-header--provider,
table.report-table.report-table--financial .table-cell--provider {
  min-width: 0;
  max-width: none;
  white-space: nowrap;
  overflow: hidden;
  overflow-wrap: normal;
  word-break: normal;
  text-overflow: ellipsis;
}

table.report-table.report-table--financial .table-cell--provider {
  font-family: "Segoe UI", "Trebuchet MS", Arial, sans-serif;
  font-size: 0.95rem;
  font-weight: 400;
  letter-spacing: normal;
  line-height: 1.4;
}

table.report-table.report-table--financial .table-header--money,
table.report-table.report-table--financial .table-cell--money {
  white-space: nowrap;
  overflow-wrap: normal;
  word-break: normal;
  text-align: right;
}

table.report-table.report-table--financial .table-header--expediente,
table.report-table.report-table--financial .table-header--cuit,
table.report-table.report-table--financial .table-header--status,
table.report-table.report-table--financial .table-cell--expediente,
table.report-table.report-table--financial .table-cell--cuit,
table.report-table.report-table--financial .table-cell--status {
  white-space: nowrap;
  overflow-wrap: normal;
  word-break: normal;
}

table.report-table.administrativo-expediente-table {
  min-width: 74rem;
}

.administrativo-expediente-table .admin-col-expediente {
  width: 9rem;
}

.administrativo-expediente-table .admin-col-cuit {
  width: 8.5rem;
}

.administrativo-expediente-table .admin-col-provider {
  width: 28rem;
}

.administrativo-expediente-table .admin-col-date {
  width: 7.5rem;
}

.administrativo-expediente-table .admin-col-total {
  width: 9.5rem;
}

.administrativo-expediente-table .admin-col-status {
  width: 8.5rem;
}

table.report-table.administrativo-expediente-table .table-cell--provider {
  min-width: 0;
  max-width: 28rem;
  white-space: normal;
  overflow: hidden;
  overflow-wrap: anywhere;
  word-break: normal;
  text-overflow: clip;
}

table.report-table.administrativo-expediente-table .table-header--total,
table.report-table.administrativo-expediente-table .table-cell--money {
  width: 9.5rem;
  white-space: nowrap;
  text-align: right;
}

.report-print-table {
  min-width: 980px;
  table-layout: fixed;
}

th,
td {
  text-align: left;
  border-bottom: 1px solid #e3eaf1;
  padding: 0.75rem 0.8rem;
  white-space: normal;
  overflow-wrap: anywhere;
  vertical-align: top;
}

th {
  background: var(--surface-soft);
  font-size: 0.92rem;
  white-space: nowrap;
}

.registry-table--compact th,
.registry-table--compact td {
  padding: 0.5rem 0.65rem;
  font-size: 0.92rem;
}

.owner-admin-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  align-items: start;
}

.owner-admin-confirm-password {
  grid-column: 2;
}

.owner-admin-create-action {
  align-self: start;
}

.owner-admin-municipios {
  gap: 0.7rem;
  background: var(--surface-alt);
}

.owner-admin-form-page [data-municipio-cardinality][hidden] {
  display: none;
}

.owner-admin-form-page [data-staff-permissions][hidden] {
  display: none;
}

.owner-admin-municipios > div {
  display: grid;
  gap: 0.55rem;
}

.owner-admin-municipios label {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  margin: 0;
  font-weight: 600;
  line-height: 1.4;
}

.owner-admin-municipios input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  margin: 0.18rem 0 0;
  padding: 0;
  flex: 0 0 auto;
}

.owner-admin-table {
  table-layout: fixed;
}

.owner-admin-col-user {
  width: 15%;
}

.owner-admin-col-email,
.owner-admin-col-municipios {
  width: 22%;
}

.owner-admin-col-status {
  width: 10%;
}

.owner-admin-col-actions {
  width: 31%;
}

.owner-admin-table td {
  vertical-align: top;
}

.owner-admin-inline-action {
  display: inline-flex;
}

.owner-admin-municipio-list {
  display: grid;
  gap: 0.2rem;
  margin: 0;
  padding-left: 1.15rem;
}

.owner-admin-empty-scope {
  margin: 0;
  color: var(--muted);
  font-weight: 600;
}

.owner-admin-row-actions {
  display: grid;
  gap: 0.65rem;
  min-width: 0;
}

.owner-admin-action-details {
  min-width: 0;
}

.owner-admin-action-details summary {
  width: fit-content;
  color: var(--brand-strong);
  font-weight: 600;
  cursor: pointer;
}

.owner-admin-action-details form {
  margin-top: 0.65rem;
  padding: 0.85rem;
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
}

.owner-admin-municipios--edit {
  padding: 0.75rem;
  background: var(--surface);
}

.owner-admin-row-actions button {
  max-width: 100%;
}

.owner-status-active {
  color: var(--success);
  border-color: #a6d6bb;
  background: var(--success-soft);
}

@media (max-width: 900px) {
  .owner-admin-table {
    min-width: 52rem;
  }
}

.report-print-table th,
.report-print-table td {
  white-space: nowrap;
}

.report-table th:nth-child(1),
.report-table td:nth-child(1),
.report-print-table th:nth-child(1),
.report-print-table td:nth-child(1) {
  width: 9rem;
}

.report-table th:nth-child(2),
.report-table td:nth-child(2),
.report-print-table th:nth-child(2),
.report-print-table td:nth-child(2) {
  width: 8.5rem;
}

.report-table th:nth-child(4),
.report-table td:nth-child(4),
.report-print-table th:nth-child(4),
.report-print-table td:nth-child(4) {
  width: 7.5rem;
  white-space: nowrap;
}

.report-table th:nth-child(5),
.report-table td:nth-child(5),
.report-table th:nth-child(6),
.report-table td:nth-child(6),
.report-table th:nth-child(7),
.report-table td:nth-child(7),
.report-print-table th:nth-child(5),
.report-print-table td:nth-child(5),
.report-print-table th:nth-child(6),
.report-print-table td:nth-child(6),
.report-print-table th:nth-child(7),
.report-print-table td:nth-child(7) {
  width: 7.25rem;
}

.report-table th:nth-child(8),
.report-table td:nth-child(8),
.report-print-table th:nth-child(8),
.report-print-table td:nth-child(8) {
  width: 9rem;
}

.registry-table .table-cell--nowrap,
.report-table .table-cell--nowrap,
.report-print-table .table-cell--nowrap {
  white-space: nowrap;
  overflow-wrap: normal;
  word-break: normal;
}

.registry-table .table-cell--nowrap a,
.report-table .table-cell--nowrap a,
.report-print-table .table-cell--nowrap a {
  white-space: nowrap;
}

.report-table .table-cell--provider,
.report-print-table .table-cell--provider {
  min-width: 12rem;
  max-width: 24rem;
  white-space: nowrap;
  overflow: hidden;
  overflow-wrap: normal;
  word-break: normal;
  text-overflow: ellipsis;
}

.report-table .table-cell--date,
.report-table .table-cell--money,
.report-table .table-cell--cuit,
.report-table .table-cell--expediente,
.report-table .table-cell--status,
.report-print-table .table-cell--date,
.report-print-table .table-cell--money,
.report-print-table .table-cell--cuit,
.report-print-table .table-cell--expediente,
.report-print-table .table-cell--status {
  white-space: nowrap;
  overflow-wrap: normal;
  word-break: normal;
}

@media screen {
  .report-table:not(.superior-expediente-table) .table-header--date,
  .report-table:not(.superior-expediente-table) .table-cell--date {
    display: none;
  }

  table.report-table.report-table--financial .financial-col-date {
    display: none;
    width: 0;
  }
}

@media screen and (max-width: 760px) {
  table.report-table.report-table--financial {
    min-width: 52rem;
  }
}

.field-legend {
  margin: 0;
  font-size: 0.88rem;
  color: var(--muted);
}

tbody tr:hover {
  background: var(--table-stripe);
}

.messages {
  display: grid;
  gap: 0.65rem;
}

.municipio-suspension-notice {
  margin: 0;
  border: 1px solid var(--warning);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.85rem;
  background: var(--warning-soft);
  color: var(--text);
  font-weight: 600;
}

.page-shell--municipio-read-only .page-content form[method="post" i]:not([data-read-only-allowed]) button,
.page-shell--municipio-read-only .page-content form[method="post" i]:not([data-read-only-allowed]) input[type="submit"] {
  display: none;
}

.message {
  margin: 0;
  border-radius: var(--radius-sm);
  padding: 0.75rem 0.9rem;
  background: var(--accent-soft);
  border: 1px solid #a9c5ff;
  color: var(--text);
}

.message.success {
  background: var(--success-soft);
  border-color: #a6d6bb;
}

.message.info {
  background: #e8f2ff;
  border-color: #b9d3ff;
}

.message.warning {
  background: var(--warning-soft);
  border-color: #eacb88;
}

.message.error {
  background: var(--danger-soft);
  border-color: #f0aba6;
}

.provider-upload-error {
  border: 4px solid var(--danger);
  background: var(--surface);
  color: var(--danger);
  padding: 1rem 1.1rem;
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1.45;
}

.provider-upload-error .errorlist {
  color: inherit;
  font-weight: inherit;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.18rem 0.6rem;
  border-radius: 999px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--brand);
}

.provider-draft {
  width: min(70rem, calc(100% - 2rem));
  margin-inline: auto;
  gap: 1.25rem;
}

.provider-draft-header {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(16rem, 21rem);
  gap: 0.65rem;
  align-items: start;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid #e3eaf1;
}

.municipio-identity-banner {
  display: grid;
  gap: 0.25rem;
  padding: 1rem 1.1rem;
  border: 2px solid var(--brand);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--brand);
}

.municipio-identity-banner--prominent {
  align-content: center;
  min-height: 3rem;
}

.municipio-identity-name {
  font-size: clamp(1.5rem, 3vw, 2rem);
  line-height: 1.15;
  overflow-wrap: anywhere;
  text-wrap: balance;
}

.municipio-identity-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--muted);
}

.municipio-identity-banner strong {
  font-size: 1.45rem;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.provider-panel {
  min-width: 0;
}

.provider-panel {
  padding: 1.15rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, #ffffff 0%, var(--surface-alt) 100%);
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

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

.provider-section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: start;
  justify-content: space-between;
  gap: 0.75rem;
  padding-bottom: 0.7rem;
  border-bottom: 1px solid #dbe5ef;
}

.provider-dashboard-shell {
  gap: 0.85rem;
}

.provider-dashboard-card {
  gap: 1rem;
}

.provider-dashboard-intro {
  display: grid;
  gap: 0.25rem;
  margin-bottom: 0.35rem;
}

.provider-dashboard-intro h1,
.provider-dashboard-intro p {
  margin-top: 0;
}

.provider-dashboard-intro h1 {
  margin-bottom: 0.15rem;
}

.provider-dashboard-intro p:last-child {
  margin-bottom: 0;
}

.provider-section-head h2 {
  margin-bottom: 0.25rem;
  color: var(--brand);
}

.provider-section-head p,
.provider-detail-label,
.provider-list-meta,
.provider-upload-meta,
.provider-draft-status,
.provider-summary p {
  margin: 0;
}

.provider-details-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
}

.provider-detail-card {
  display: grid;
  gap: 0.3rem;
  padding: 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface-soft);
  min-height: 5.5rem;
  box-sizing: border-box;
}

.provider-detail-card--stacked {
  align-content: start;
}

.provider-detail-value,
.provider-list-title {
  word-break: break-word;
}

.provider-list-title-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.provider-detail-note {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.4;
}

.provider-list {
  display: grid;
  gap: 0.65rem;
  padding-left: 0;
  list-style: none;
}

.provider-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.9rem;
  padding: 0.9rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface-soft);
}

.provider-list-main {
  display: grid;
  gap: 0.25rem;
}

.provider-upload-meta {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.provider-upload-file-label {
  font-weight: 700;
}

.provider-list-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: center;
  justify-content: flex-end;
  min-width: 0;
}

.provider-list-actions--danger {
  padding: 0.6rem 0.65rem;
  border: 1px solid #efb5b0;
  border-radius: var(--radius-sm);
  background: var(--danger-soft);
}

.provider-list-actions--safe {
  padding: 0.3rem 0;
}

.provider-list-item--document {
  align-items: flex-start;
}

.provider-upload-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.9rem;
}

.provider-dashboard-upload {
  align-items: stretch;
  background: var(--surface-alt);
}

.provider-dashboard-upload .provider-list-main {
  align-content: center;
}

.provider-dashboard-upload .provider-list-actions {
  flex: 1 1 34rem;
}

.provider-file-control {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
  flex: 1 1 18rem;
  cursor: pointer;
}

.provider-file-control input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.provider-file-control:focus-within .button {
  outline: 3px solid rgba(15, 98, 254, 0.28);
  outline-offset: 2px;
}

.provider-file-name {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--muted);
}

.provider-dashboard-actions {
  align-items: stretch;
  gap: 0.65rem;
  margin-top: 0.1rem;
}

.provider-dashboard-actions > .button,
.provider-dashboard-actions > form,
.provider-dashboard-actions > form .button {
  min-height: 2.6rem;
}

.provider-dashboard-actions > form {
  display: flex;
}

.provider-dashboard-expedientes {
  gap: 0.8rem;
}

.provider-dashboard-expedientes h2 {
  margin-bottom: 0.1rem;
}

.provider-dashboard-expedientes .provider-list {
  gap: 0.55rem;
  margin-top: 0;
}

.provider-dashboard-expedientes .provider-list-item {
  min-height: 4.15rem;
  box-sizing: border-box;
}

.provider-dashboard-expedientes .provider-list-main {
  min-width: 0;
}

.provider-dashboard-expedientes .provider-list-actions {
  flex: 0 0 auto;
}

.provider-form {
  gap: 0.95rem;
  padding: 1rem;
  border: 1px solid #d8e2ee;
  border-radius: var(--radius-md);
  background: var(--surface);
}

.provider-form-grid {
  display: grid;
  gap: 0.9rem;
}

.provider-form-grid--provider {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.provider-form-grid--invoice {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.staff-provider-page {
  gap: 1.5rem;
  padding: 1.5rem;
}

.staff-provider-header {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  padding: 0 0 1.25rem;
  border: 0;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  background: transparent;
}

.staff-provider-header h1 {
  margin-bottom: 0.35rem;
  font-size: 1.8rem;
}

.staff-provider-form {
  display: grid;
  gap: 1.25rem;
  width: 100%;
}

.staff-provider-form__section {
  display: grid;
  gap: 1rem;
}

.staff-provider-form__section-header h2,
.staff-provider-form__section-header p {
  margin: 0;
}

.staff-provider-form__section-header h2 {
  color: var(--brand);
  font-size: 1.15rem;
}

.staff-provider-form__section-header p {
  margin-top: 0.2rem;
  color: var(--muted);
}

.staff-provider-form__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.staff-provider-form__field {
  display: grid;
  gap: 0.35rem;
  min-width: 0;
}

.staff-provider-form__field--wide {
  grid-column: 1 / -1;
}

.staff-provider-form__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.staff-provider-form__actions .field-legend {
  margin: 0;
  margin-right: auto;
}

.provider-start-page {
  display: grid;
  gap: 0.75rem;
  max-width: 46rem;
  margin-inline: auto;
}

.provider-start-page > .eyebrow,
.provider-start-page > h1 {
  margin: 0;
}

.provider-start-page > h1 {
  font-size: 1.55rem;
  line-height: 1.2;
}

.provider-start-intro {
  display: grid;
  gap: 0.2rem;
  max-width: 65ch;
}

.provider-start-intro p {
  margin: 0;
}

.provider-start-identity {
  display: flex;
  align-items: center;
  min-height: 2.5rem;
  padding: 0.55rem 0.75rem;
  border-left: 0.25rem solid var(--brand);
  background: var(--surface-alt);
  color: var(--brand);
}

.provider-start-identity .municipio-identity-name {
  font-size: 1rem;
  line-height: 1.25;
}

.provider-start-form {
  display: grid;
  gap: 1.1rem;
  margin-top: 0.25rem;
}

.provider-start-form .provider-form-grid--provider {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  align-items: start;
}

.provider-start-form .provider-field {
  min-width: 0;
}

.provider-start-page .provider-phone-row {
  display: grid;
  grid-template-columns: minmax(6.25rem, max-content) minmax(9rem, 11rem) minmax(0, 1fr);
  gap: 0;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.provider-start-page .provider-phone-row > * {
  height: 2.75rem;
  box-sizing: border-box;
}

.provider-start-page .provider-phone-prefix,
.provider-start-page .provider-phone-static {
  min-height: 2.75rem;
  border: 0;
  border-radius: 0;
}

.provider-start-page .provider-phone-prefix,
.provider-start-page .provider-phone-static {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding-inline: 0.65rem;
  border-left: 1px solid var(--border);
  background: var(--surface-soft);
}

.provider-start-page .provider-phone-segment {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  align-items: stretch;
  min-width: 0;
  box-sizing: border-box;
  border-left: 1px solid var(--border);
  background: var(--surface-soft);
}

.provider-start-page .provider-phone-segment .provider-phone-static {
  border-left: 0;
}

.provider-start-page .provider-phone-prefix {
  min-width: 0;
  max-width: none;
  border-left: 0;
}

.provider-start-page .provider-phone-input {
  width: 100%;
  max-width: none;
  box-sizing: border-box;
  padding-inline: 0.8rem;
  border-left: 1px solid var(--border);
  background: var(--surface);
}

.provider-start-page .provider-phone-input:focus-visible {
  border-left-color: var(--accent);
  box-shadow: inset 0 0 0 2px rgba(15, 98, 254, 0.14);
}

.provider-start-actions {
  display: flex;
  justify-content: flex-start;
  padding-top: 0.9rem;
  border-top: 1px solid var(--border);
}

.provider-registry-page {
  display: grid;
  gap: 1.25rem;
  padding: 1.5rem;
}

.provider-registry-header {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
}

.provider-registry-header h1,
.provider-registry-header p {
  margin: 0;
}

.provider-registry-header h1 {
  margin-top: 0.35rem;
  margin-bottom: 0.35rem;
  color: var(--brand);
  font-size: 1.8rem;
}

.provider-registry-header > div > p:last-child {
  color: var(--muted);
}

.provider-registry-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-alt);
}

.provider-registry-search {
  display: grid;
  flex: 1 1 34rem;
  gap: 0.35rem;
}

.provider-registry-search__controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.provider-registry-search__controls input {
  flex: 1 1 18rem;
  min-width: 0;
}

.provider-registry-toolbar__exports,
.output-icon-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
}

.output-icon-action {
  display: inline-flex;
  width: 2.6rem;
  height: 2.6rem;
  min-width: 2.6rem;
  min-height: 2.6rem;
  flex: 0 0 2.6rem;
  align-items: center;
  justify-content: center;
  padding: 0;
  overflow: hidden;
  line-height: 1;
}

.output-icon-action svg {
  width: 1.2rem;
  height: 1.2rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.output-icon-action:focus-visible {
  outline: 3px solid rgba(15, 98, 254, 0.35);
  outline-offset: 2px;
}

.provider-registry-table-wrap {
  border-color: var(--border);
}

table.registry-table.provider-registry-table {
  width: 100%;
  min-width: 68rem;
  table-layout: fixed;
}

table.registry-table.provider-registry-table .provider-registry-table__cuit {
  width: 9rem;
}

table.registry-table.provider-registry-table .provider-registry-table__business-name {
  width: 13%;
}

table.registry-table.provider-registry-table .provider-registry-table__fantasy-name {
  width: 10%;
}

table.registry-table.provider-registry-table .provider-registry-table__email {
  width: 16%;
}

table.registry-table.provider-registry-table .provider-registry-table__contact {
  width: 13%;
}

table.registry-table.provider-registry-table .provider-registry-table__status {
  width: 7rem;
}

table.registry-table.provider-registry-table .provider-registry-table__actions {
  width: 8.25rem;
}

table.registry-table.provider-registry-table th,
table.registry-table.provider-registry-table td {
  vertical-align: middle;
}

table.registry-table.provider-registry-table td:not(.provider-registry-table__actions) {
  overflow: hidden;
  text-overflow: ellipsis;
}

.provider-registry-status--active {
  border-color: #a9d4b8;
  background: var(--success-soft);
  color: var(--success);
}

.provider-registry-status--inactive {
  color: var(--muted);
}

.provider-registry-actions {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.4rem;
  align-items: center;
}

.provider-registry-actions form {
  display: contents;
}

.provider-registry-icon-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  min-width: 2.25rem;
  min-height: 2.25rem;
  height: 2.25rem;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 0.55rem;
  background: var(--surface);
  box-sizing: border-box;
  color: var(--brand-strong);
  font: inherit;
  cursor: pointer;
}

.provider-registry-icon-action svg {
  width: 1rem;
  height: 1rem;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.provider-registry-icon-action:hover {
  border-color: var(--brand-strong);
  background: var(--accent-soft);
  color: var(--brand);
}

.provider-registry-icon-action--deactivate {
  color: var(--warning);
}

.provider-registry-icon-action--deactivate:hover {
  border-color: var(--warning);
  background: var(--warning-soft);
  color: var(--warning);
}

.provider-registry-icon-action--restore {
  color: var(--success);
}

.provider-registry-icon-action--restore:hover {
  border-color: var(--success);
  background: var(--success-soft);
  color: var(--success);
}

.provider-field {
  display: grid;
  gap: 0.35rem;
}

.provider-field-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.provider-field-hint {
  color: var(--muted);
  font-size: 0.92rem;
  white-space: nowrap;
}

.provider-phone-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.5rem;
  width: fit-content;
  max-width: 100%;
}

.provider-phone-label {
  display: block;
  font-weight: 700;
}

.provider-phone-prefix {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  flex: 0 0 clamp(5.75rem, 10vw, 8.125rem);
  min-width: 5.75rem;
  max-width: 8.125rem;
  min-height: 2.6rem;
  padding: 0.45rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--text);
  font-weight: 600;
  line-height: 1.2;
  box-sizing: border-box;
}

.provider-phone-prefix-code {
  white-space: nowrap;
}

.provider-phone-static {
  flex: 0 0 auto;
  font-weight: 600;
  color: var(--muted);
}

.provider-phone-input {
  width: auto;
  min-width: 0;
}

.provider-phone-input--area {
  flex: 0 0 clamp(5.75rem, 10vw, 8.125rem);
  max-width: 8.125rem;
}

.provider-phone-input--number {
  flex: 1 1 clamp(13.75rem, 26vw, 18rem);
  min-width: 13.75rem;
  max-width: 18.75rem;
}

.provider-field--small input,
.provider-field--small select {
  max-width: 100%;
}

.provider-field--wide {
  grid-column: 1 / -1;
}

.provider-field .errorlist,
.provider-form .errorlist {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--danger);
}

.provider-form input[type="file"] {
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 0.45rem 0.5rem;
  background: var(--surface-alt);
}

.provider-form input[type="file"]::file-selector-button {
  margin-right: 0.65rem;
  border: 1px solid var(--border);
  border-radius: 0.55rem;
  padding: 0.38rem 0.68rem;
  background: var(--surface);
  color: var(--brand);
  font-weight: 700;
  cursor: pointer;
}

.provider-form input[type="file"]:hover::file-selector-button {
  border-color: var(--brand-strong);
  color: var(--brand-strong);
}

.detail-list {
  display: grid;
  gap: 0.65rem;
  padding-left: 0;
  list-style: none;
}

.detail-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.9rem;
  padding: 0.9rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface-soft);
}

.detail-list-main {
  display: grid;
  gap: 0.25rem;
  min-width: 0;
}

.detail-list-title {
  word-break: break-word;
}

.detail-list-meta {
  color: var(--muted);
  overflow-wrap: anywhere;
}

/* Consolidated expediente: dense selection rows with a single task toolbar. */
.consolidated-expediente-page {
  gap: 0.75rem;
  padding: 1.25rem;
}

.consolidated-expediente-page h1,
.consolidated-expediente-page > p {
  margin-block: 0;
}

.consolidated-expediente-form {
  gap: 0.75rem;
}

.consolidated-expediente-form fieldset {
  gap: 0.65rem;
  padding: 0.75rem;
}

.consolidated-selection-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.1rem 0.15rem 0.25rem;
}

.consolidated-select-all,
.consolidated-document-label {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin: 0;
  font-weight: 700;
  cursor: pointer;
}

.consolidated-select-all input,
.consolidated-document-label input {
  width: 1.1rem;
  height: 1.1rem;
  flex: 0 0 auto;
  margin: 0;
  accent-color: var(--brand-strong);
}

.consolidated-selection-hint {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 600;
}

.consolidated-document-list {
  display: grid;
  gap: 0.4rem;
  padding: 0;
  margin: 0;
  list-style: none;
}

.consolidated-document-row {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.consolidated-document-row:has(input:checked) {
  border-color: var(--brand);
  background: var(--surface-alt);
}

.consolidated-document-label {
  min-width: 0;
  padding: 0.58rem 0.7rem;
}

.consolidated-document-copy {
  display: grid;
  min-width: 0;
  gap: 0.12rem;
}

.consolidated-document-copy strong,
.consolidated-document-copy span {
  overflow-wrap: anywhere;
}

.consolidated-document-copy span {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 500;
}

.consolidated-expediente-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
}

.consolidated-expediente-actions .primary {
  background: var(--brand-strong);
  color: #fff;
}

@media (max-width: 38rem) {
  .consolidated-expediente-page {
    padding: 1rem;
  }

  .consolidated-selection-toolbar,
  .consolidated-expediente-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .consolidated-expediente-actions > *,
  .consolidated-select-all {
    width: 100%;
  }

  .consolidated-expediente-actions > * {
    box-sizing: border-box;
  }
}

.detail-list-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: center;
  justify-content: flex-end;
  min-width: 0;
}

.detail-list-actions .inline-form {
  margin-left: 0;
}

.detail-list-actions .button,
.detail-list-actions button {
  width: fit-content;
}

.detail-list-item .button,
.detail-list-item button,
.detail-list-item a {
  min-width: 0;
}

.detail-list-item a {
  overflow-wrap: anywhere;
}

.provider-constancia {
  gap: 0.7rem;
}

.provider-constancia h1,
.provider-constancia h2,
.provider-constancia p,
.provider-constancia-list {
  margin-block: 0;
}

.provider-constancia-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.35rem 1rem;
}

.provider-constancia-list {
  gap: 0.3rem;
}

.provider-constancia-list .detail-list-item {
  padding: 0.4rem 0.6rem;
}

@media print {
  :root,
  :root[data-theme="dark"] {
    color-scheme: light;
    --bg: #ffffff;
    --bg-end: #ffffff;
    --bg-accent: transparent;
    --surface: #ffffff;
    --surface-alt: #f8fbfe;
    --surface-soft: #f1f5f9;
    --border: #ccd7e3;
    --border-strong: #98a9bb;
    --text: #172433;
    --muted: #5b6b7b;
    --brand: #123b63;
    --brand-strong: #0b4aa2;
    --control-bg: #ffffff;
    --table-stripe: #f8fbff;
    --on-action: #ffffff;
  }

  @page administrativo-report {
    size: A4 landscape;
    margin: 0.35in;
  }

  @page provider-registry {
    size: A4 landscape;
    margin: 0.35in;
  }

  @page provider-constancia {
    size: A4 portrait;
    margin: 0.35in;
  }

  @page staff-expediente-print {
    size: A4 portrait;
    margin: 0.35in;
  }

  .administrativo-report-print-page {
    page: administrativo-report;
    background: #fff;
  }

  .administrativo-report-print-page .site-header,
  .administrativo-report-print-page .report-print-actions {
    display: none;
  }

  .administrativo-report-print-page .page-shell,
  .administrativo-report-print-page .page-content {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
  }

  .administrativo-report-print-page .report-print-card {
    padding: 0;
    border: 0;
    box-shadow: none;
    gap: 0.35rem;
  }

  .administrativo-report-print-page .report-print-card h1 {
    margin: 0 0 0.25rem;
    font-size: 13pt;
    line-height: 1.15;
  }

  .administrativo-report-print-page .report-print-table-wrap {
    overflow: visible;
    border: 0;
    border-radius: 0;
  }

  .administrativo-report-print-page .report-print-table {
    min-width: 0;
    table-layout: fixed;
    font-size: 8.5pt;
  }

  .administrativo-report-print-page .report-print-table th,
  .administrativo-report-print-page .report-print-table td {
    padding: 0.14rem 0.18rem;
    white-space: nowrap;
    overflow-wrap: normal;
    word-break: normal;
    vertical-align: middle;
  }

  .administrativo-report-print-page .report-print-table th {
    font-size: 8pt;
  }

  .administrativo-report-print-page .report-print-table th:nth-child(3),
  .administrativo-report-print-page .report-print-table td:nth-child(3) {
    width: 2.15in;
    min-width: 2.15in;
  }

  .administrativo-report-print-page .report-print-table .table-cell--provider {
    max-width: 2.15in;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .administrativo-report-print-page .report-print-table .table-cell--expediente {
    width: 0.9in;
  }

  .administrativo-report-print-page .report-print-table .table-cell--cuit {
    width: 0.95in;
  }

  .administrativo-report-print-page .report-print-table .table-cell--date {
    width: 0.75in;
  }

  .administrativo-report-print-page .report-print-table .table-cell--money {
    width: 0.85in;
  }

  .administrativo-report-print-page .report-print-table .table-cell--status {
    width: 0.9in;
  }

  .staff-expediente-print-page {
    page: staff-expediente-print;
    background: #fff;
  }

  .staff-expediente-print-page .site-header,
  .staff-expediente-print-page .staff-print-actions button,
  .staff-expediente-print-page .detail-list-actions {
    display: none;
  }

  .staff-expediente-print-page .page-shell,
  .staff-expediente-print-page .page-content {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
  }

  .staff-expediente-print-page .staff-print-card {
    padding: 0;
    border: 0;
    box-shadow: none;
    gap: 0.35rem;
  }

  .staff-expediente-print-page h1 {
    font-size: 16pt;
  }

  .staff-expediente-print-page h2 {
    margin-block: 0.35rem 0.1rem;
    font-size: 11pt;
  }

  .staff-expediente-print-page .provider-details-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 0.2rem;
  }

  .staff-expediente-print-page .provider-detail-card,
  .staff-expediente-print-page .detail-list-item {
    padding: 0.18rem 0.25rem;
    break-inside: avoid;
  }

  .staff-expediente-print-page .detail-list {
    gap: 0.15rem;
  }

  body.provider-registry-print-page {
    page: provider-registry;
    background: #fff;
    min-height: 0;
  }

  body.provider-registry-print-page .app-shell,
  body.provider-registry-print-page .page-shell,
  body.provider-registry-print-page .page-content {
    min-height: 0;
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
  }

  body.provider-registry-print-page .site-header,
  body.provider-registry-print-page .provider-registry-print-actions {
    display: none;
  }

  body.provider-registry-print-page .provider-registry-print-card {
    padding: 0;
    border: 0;
    box-shadow: none;
    gap: 0.35rem;
  }

  body.provider-registry-print-page .provider-registry-print-card h1,
  body.provider-registry-print-page .provider-registry-print-card p {
    margin-block: 0;
  }

  body.provider-registry-print-page .provider-registry-print-table-wrap {
    overflow: visible;
    border: 0;
    border-radius: 0;
  }

  body.provider-registry-print-page .provider-registry-print-table {
    min-width: 0;
    table-layout: auto;
    font-size: 8.5pt;
  }

  body.provider-registry-print-page .provider-registry-print-table th,
  body.provider-registry-print-page .provider-registry-print-table td {
    padding: 0.14rem 0.18rem;
    overflow-wrap: normal;
    word-break: normal;
    vertical-align: middle;
  }

  body.provider-registry-print-page .provider-registry-print-table th:first-child,
  body.provider-registry-print-page .provider-registry-print-table td:first-child,
  body.provider-registry-print-page .provider-registry-print-table th:nth-child(4),
  body.provider-registry-print-page .provider-registry-print-table td:nth-child(4),
  body.provider-registry-print-page .provider-registry-print-table th:nth-child(5),
  body.provider-registry-print-page .provider-registry-print-table td:nth-child(5) {
    white-space: nowrap;
  }

  body.provider-registry-print-page .provider-registry-print-table th:first-child,
  body.provider-registry-print-page .provider-registry-print-table td:first-child {
    font-variant-numeric: tabular-nums;
  }

  body.provider-constancia-print-page {
    page: provider-constancia;
    background: #fff;
    min-height: 0;
  }

  body.provider-constancia-print-page .app-shell,
  body.provider-constancia-print-page .page-shell,
  body.provider-constancia-print-page .page-content {
    min-height: 0;
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
  }

  body.provider-constancia-print-page .site-header {
    display: none;
  }

  body.provider-constancia-print-page .system-footer-links,
  body.provider-constancia-print-page .system-about-dialog {
    display: none;
  }

  body.provider-constancia-print-page .provider-constancia {
    padding: 0;
    border: 0;
    box-shadow: none;
    font-size: 10pt;
    gap: 0.35rem;
    break-after: auto;
    page-break-after: auto;
  }

  body.provider-constancia-print-page .provider-constancia-actions,
  body.provider-constancia-print-page .provider-constancia .detail-list-actions {
    display: none;
  }

  body.provider-constancia-print-page .provider-constancia h1 {
    font-size: 16pt;
  }

  body.provider-constancia-print-page .provider-constancia h2 {
    font-size: 12pt;
  }

  body.provider-constancia-print-page .provider-constancia-list .detail-list-item {
    padding: 0.2rem 0;
    border: 0;
    border-radius: 0;
    background: transparent;
  }
}

.provider-form-actions {
  display: flex;
  justify-content: flex-end;
}

.destructive {
  color: var(--danger);
  border-color: #efb5b0;
  background: var(--surface);
}

.provider-panel .button.primary {
  border-color: #083a81;
  background: linear-gradient(180deg, var(--brand-strong) 0%, #083f90 100%);
  box-shadow: 0 6px 8px rgba(11, 74, 162, 0.16);
}

.provider-panel .button.primary:hover {
  filter: none;
  background: linear-gradient(180deg, #0d53b5 0%, #0a448f 100%);
}

.provider-panel .button.secondary {
  border-color: #b7c7d9;
  background: var(--surface);
  color: var(--brand);
}

.provider-panel .button.secondary:hover {
  filter: none;
  border-color: var(--brand-strong);
  background: var(--accent-soft);
}

.provider-panel .button.destructive {
  border-color: #e5a39d;
  background: var(--danger-control);
}

.provider-panel .button.destructive:hover {
  filter: none;
  border-color: var(--danger);
  background: var(--danger-soft);
}

.empty-state {
  margin: 0;
  padding: 0.95rem 1rem;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-md);
  background: #fbfdff;
  color: var(--muted);
}

.table-empty-cell {
  padding: 1rem;
  background: var(--surface-alt);
}

.table-empty-cell .empty-state {
  padding: 0;
  border-color: transparent;
  background: transparent;
}

.report-nav {
  gap: 0.5rem;
}

.report-nav .button {
    white-space: normal;
    text-align: center;
  }

.report-filters {
  grid-template-columns: minmax(9rem, 10.5rem) minmax(9rem, 10.5rem) minmax(12rem, 1fr) minmax(9rem, 0.8fr) max-content;
  align-items: end;
  gap: 0.75rem;
  padding: 0.9rem;
}

.report-filter-field {
  min-width: 0;
}

.report-filter-field label {
  margin-bottom: 0.25rem;
  font-size: 0.82rem;
}

.report-filter-field input,
.report-filter-field select,
.report-filter-actions .button,
.report-filter-actions button {
  min-height: 2.6rem;
}

.report-filter-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  min-width: max-content;
  align-self: start;
  margin-top: 1.45rem;
}

.site-theme-toggle:hover,
.site-theme-toggle:focus-visible {
  border-color: var(--brand-strong);
  background: var(--accent-soft);
  color: var(--brand-strong);
}

.report-filter-actions .button,
.report-filter-actions button {
  white-space: nowrap;
  box-sizing: border-box;
  height: 2.6rem;
  flex: 0 0 auto;
}

.report-filters .message {
  grid-column: 1 / -1;
}

.expediente-report-page {
  width: 100%;
  max-width: 74rem;
  min-width: 0;
  margin-inline: auto;
}

.expediente-report-page #report-content,
.expediente-report-page .table-wrap {
  min-width: 0;
}

.expediente-report-page {
  gap: 0.8rem;
  padding: 1.1rem 1.25rem 1.25rem;
}

.expediente-report-page .report-page-header {
  gap: 0.35rem;
  padding: 0 0 0.85rem;
  border: 0;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.expediente-report-page .report-page-header h1 {
  margin: 0;
  font-size: 1.85rem;
  line-height: 1.15;
}

.expediente-report-page .report-page-header .eyebrow {
  margin-bottom: 0.1rem;
  font-size: 0.7rem;
}

.expediente-report-page .report-page-header .muted {
  font-size: 0.92rem;
}

.expediente-report-page .report-toolbar {
  display: grid;
  gap: 0.55rem;
}

.expediente-report-page .report-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  width: 100%;
  gap: 0.15rem;
  padding: 0.2rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
}

.expediente-report-page .report-nav .button {
  flex: 1 1 auto;
  min-height: 2.25rem;
  padding: 0.4rem 0.7rem;
  border-color: transparent;
  border-radius: calc(var(--radius-sm) - 0.2rem);
  box-shadow: none;
  font-size: 0.9rem;
}

.expediente-report-page .report-nav .button.secondary {
  background: transparent;
}

.expediente-report-page .report-nav .button.primary {
  border-color: var(--brand-strong);
  background: var(--brand-strong);
  color: var(--surface);
}

.expediente-report-page .report-filters {
  display: grid;
  grid-template-columns: minmax(7.5rem, 9rem) minmax(7.5rem, 9rem) minmax(12rem, 1fr) minmax(9rem, 11rem) minmax(8rem, 10rem) max-content;
  align-items: end;
  gap: 0.6rem;
  padding: 0.75rem;
  background: var(--surface-alt);
}

.expediente-report-page .report-filter-submit {
  min-height: 2.6rem;
  white-space: nowrap;
}

.expediente-report-page .report-filter-field--provider {
  width: 100%;
}

.expediente-report-page .report-filter-field--status {
  width: 100%;
}

@media (max-width: 1000px) {
  .expediente-report-page .report-filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .expediente-report-page .report-filter-field--provider,
  .expediente-report-page .report-filter-actions {
    grid-column: 1 / -1;
  }

  .expediente-report-page .report-filter-actions {
    margin-top: 0;
  }
}

.expediente-report-page .report-results {
  display: grid;
  gap: 0.35rem;
}

.expediente-report-page .report-results-toolbar {
  display: flex;
  justify-content: flex-end;
  min-height: 2.4rem;
}

.expediente-report-page .report-export-actions {
  display: inline-flex;
  gap: 0.45rem;
  align-items: center;
}

.expediente-report-page .table-wrap {
  margin-top: 0;
  border-radius: var(--radius-sm);
}

.expediente-report-page .report-table th,
.expediente-report-page .report-table td {
  padding: 0.62rem 0.7rem;
}

.expediente-report-page .report-table th {
  color: var(--brand);
  font-size: 0.82rem;
  letter-spacing: 0.01em;
  border-bottom-color: var(--border-strong);
}

.expediente-report-page .report-table tbody tr:last-child td {
  border-bottom: 0;
}

.expediente-report-page .table-empty-cell {
  padding: 0.75rem;
}

.expediente-report-page .table-empty-cell .empty-state {
  padding: 0.7rem 0.8rem;
  border: 0;
  background: var(--surface-alt);
  color: var(--muted);
}

@media (max-width: 760px) {
  .expediente-report-page .report-filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .expediente-report-page .report-filter-field--provider,
  .expediente-report-page .report-filter-submit {
    grid-column: 1 / -1;
  }

  .expediente-report-page .report-filter-field--status {
    grid-column: 1 / -1;
    max-width: 18rem;
  }
}

@media (max-width: 480px) {
  .expediente-report-page .report-nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  .expediente-report-page .report-nav .button {
    width: auto;
  }

  .expediente-report-page .report-filters {
    grid-template-columns: minmax(0, 1fr);
  }

  .expediente-report-page .report-filter-field--provider,
  .expediente-report-page .report-filter-field--status,
  .expediente-report-page .report-filter-submit {
    grid-column: auto;
    max-width: none;
  }
}

  .superior-report-screen {
    gap: 1.1rem;
  }

  .superior-report-screen .report-actions {
    justify-content: flex-start;
    margin-top: -0.25rem;
  }

  .superior-report-screen .report-nav {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 0.45rem;
    padding: 0;
  }

  .superior-report-screen .report-nav .button {
    min-height: 2.7rem;
    padding: 0.55rem 0.9rem;
  }

  .superior-report-screen .report-nav .button.secondary {
    background: transparent;
    color: var(--text);
  }

  .superior-report-screen .report-nav .button.primary {
    background: var(--surface);
    border-color: var(--border-strong);
    box-shadow: 0 1px 2px rgba(20, 55, 90, 0.08);
    color: var(--primary);
  }

  .superior-report-screen .report-filters {
    grid-template-columns: repeat(4, minmax(0, 1fr)) auto;
    align-items: end;
    gap: 0.75rem;
    padding: 0.9rem;
  }

.superior-report-screen .report-filters .message {
    grid-column: 1 / -1;
  }

  .superior-expediente-report .superior-report-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    padding: 0;
  }

  .superior-expediente-report .superior-report-tabs .button {
    min-height: 2.7rem;
    border-color: transparent;
    padding-inline: 0.95rem;
  }

  .superior-expediente-report .superior-report-tabs .button.secondary {
    background: transparent;
    color: var(--text);
  }

  .superior-expediente-report .superior-report-tabs .button.primary {
    background: #e7f0ff;
    border-color: #7ca7df;
    box-shadow: inset 0 -3px 0 var(--primary);
    color: var(--primary);
  }

  .superior-expediente-report .superior-report-date-filter {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    column-gap: 0.7rem;
    row-gap: 0.4rem;
    padding: 0.85rem 0.2rem 0.25rem;
  }

  .superior-expediente-report .superior-report-filter-group {
    display: grid;
    grid-template-columns: 10.5rem 10.5rem auto;
    align-items: start;
    gap: 0.7rem;
  }

  .superior-expediente-report .superior-report-filter-group > .button {
    align-self: start;
    min-height: 2.55rem;
    margin-top: 1.42rem;
  }

  .superior-expediente-report .superior-report-date-filter label {
    display: block;
    margin-bottom: 0.25rem;
    font-size: 0.82rem;
    font-weight: 700;
  }

  .superior-expediente-report .superior-report-date-field input[type="date"] {
    width: 100%;
    min-height: 2.55rem;
  }

  .superior-expediente-report .superior-report-date-hint {
    display: block;
    margin-top: 0.18rem;
    color: var(--muted);
    font-size: 0.72rem;
    line-height: 1.2;
  }

  .superior-expediente-report .superior-report-date-filter .message {
    grid-column: 1 / -1;
  }

  .superior-expediente-report .superior-report-export-actions {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-left: auto;
    justify-self: end;
  }

  .superior-expediente-report .superior-report-export-actions .button {
    min-height: 2.7rem;
  }

  @media (max-width: 760px) {
    .superior-expediente-report .superior-report-date-filter {
      grid-template-columns: 1fr;
    }

    .superior-expediente-report .superior-report-filter-group {
      grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .superior-expediente-report .superior-report-filter-group > .button {
      grid-column: 1 / -1;
      width: fit-content;
      margin-top: 0;
    }

    .superior-expediente-report .superior-report-export-actions {
      grid-column: 1 / -1;
      width: 100%;
      margin-left: 0;
      justify-self: start;
    }
  }

  .superior-expediente-report .superior-expediente-table-wrap {
    margin-top: 0.35rem;
  }

  table.report-table.superior-expediente-table {
    min-width: 70rem;
  }

  table.report-table.superior-expediente-table th:nth-child(4),
  table.report-table.superior-expediente-table td:nth-child(4) {
    width: 8.5rem;
  }

  table.report-table.superior-expediente-table th:nth-child(5),
  table.report-table.superior-expediente-table .table-cell--money {
    text-align: right;
  }

  .superior-expediente-report .table-empty-cell {
    padding: 1.65rem 1.25rem;
    background: var(--surface-alt);
    text-align: center;
  }

  .superior-expediente-report .superior-report-empty-state {
    display: inline-block;
    max-width: 34rem;
    color: var(--muted);
    font-size: 0.94rem;
  }

  @media (max-width: 900px) {
    .report-filters {
      grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .report-filter-actions {
      grid-column: 1 / -1;
    }
  }

@media (max-width: 600px) {
    .report-filters {
      grid-template-columns: 1fr;
    }

    .report-filters > * {
      min-width: 0;
    }

    .report-filter-actions {
      align-items: stretch;
      flex-direction: column;
      width: 100%;
      min-width: 0;
    }

    .report-filter-actions .button,
    .report-filter-actions button {
      width: 100%;
    }
  }

.link-list {
  display: grid;
  gap: 0.45rem;
  padding-left: 0;
  list-style: none;
}

@media (max-width: 760px) {
  .superior-report-screen .report-nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  .superior-report-screen .report-nav .button {
    width: auto;
  }

  .superior-report-screen .report-filters {
    grid-template-columns: minmax(0, 1fr);
  }

  .superior-report-screen .report-filter-field--provider,
  .superior-report-screen .report-filter-field--status,
  .superior-report-screen .report-filter-submit {
    grid-column: auto;
    max-width: none;
  }

  .superior-report-screen .report-filter-actions {
    margin-top: 0;
  }
}

.link-list li {
  margin: 0;
}

.link-list a {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.muted {
  color: var(--muted);
}

@media (max-width: 760px) {
  .site-header,
  .page-shell {
    width: calc(100% - 1rem);
    margin-left: auto;
    margin-right: auto;
  }

  .site-header {
    margin-top: 0.5rem;
    padding: 0.9rem;
    border-radius: 1rem;
  }

  .site-user-settings-label,
  .site-theme-toggle-label {
    display: inline;
  }

  .site-user-settings,
  .site-theme-toggle {
    flex: 1 1 auto;
    width: auto;
    height: auto;
    padding: 0.35rem 0.5rem;
  }

  .owner-admin-form-grid {
    grid-template-columns: 1fr;
  }

  .owner-admin-confirm-password {
    grid-column: auto;
  }

  .page-shell {
    margin-top: 0.75rem;
    margin-bottom: 1rem;
  }

  .card {
    border-radius: 1rem;
    padding: 1rem;
  }

  .staff-provider-page {
    padding: 1rem;
  }

  .staff-provider-header {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .staff-provider-form__grid {
    grid-template-columns: 1fr;
  }

  .staff-provider-form__field--wide {
    grid-column: auto;
  }

  .staff-provider-form__actions {
    flex-direction: column;
    align-items: stretch;
  }

  .staff-provider-form__actions .field-legend {
    margin-right: 0;
  }

  .site-user-session {
    flex: 1 1 15rem;
    flex-wrap: wrap;
  }

  .user-admin__permission-group-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .provider-start-page .provider-form-grid--provider {
    grid-template-columns: 1fr;
  }

  .provider-start-page .provider-phone-row {
    grid-template-columns: minmax(5.75rem, max-content) minmax(7rem, 8rem) minmax(0, 1fr);
    width: 100%;
  }

  .provider-start-page .provider-phone-input--number {
    min-width: 0;
  }

  .provider-start-actions {
    justify-content: flex-start;
  }

  .provider-registry-page {
    padding: 1rem;
  }

  .provider-registry-header {
    align-items: stretch;
  }

  .provider-registry-toolbar {
    align-items: stretch;
  }

  .provider-registry-search__controls {
    flex-direction: column;
  }

  .provider-registry-search__controls input {
    flex-basis: auto;
  }

  .provider-registry-toolbar__exports {
    align-self: flex-end;
  }

  .provider-password-reset-card {
    max-width: none;
    padding: 1rem;
    gap: 1rem;
  }

  .provider-password-reset-intro h1 {
    font-size: 1.75rem;
  }

  .provider-password-reset-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .provider-password-reset-actions .button.primary,
  .provider-password-reset-back {
    width: 100%;
  }

  .provider-password-reset-back {
    justify-content: center;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface-alt);
    text-decoration: none;
  }

  .provider-login-card {
    grid-template-columns: 1fr;
    gap: 1.25rem;
    padding: 1.5rem;
  }

  .provider-login-copy {
    max-width: none;
  }

  .ingreso-card {
    padding: 1rem;
  }

  .access-denied-card {
    gap: 1.25rem;
    padding: 1.25rem;
  }

  .access-denied-card__actions {
    align-items: stretch;
    flex-direction: column;
  }

  .access-denied-card__actions .button {
    width: 100%;
    box-sizing: border-box;
  }

  .administrativo-home {
    padding: 0;
  }

  .administrativo-home-header,
  .administrativo-home-body {
    padding: 1.25rem;
  }

  .administrativo-home-header {
    align-items: stretch;
    flex-direction: column;
  }

  .landing-grid {
    grid-template-columns: 1fr;
  }

  .superior-operations-panel__header {
    grid-template-columns: 1fr;
  }

  .superior-operations-panel__header {
    align-items: start;
    padding: 1rem;
  }

  .superior-operations-panel__municipio {
    white-space: normal;
  }

  .superior-parameters-area {
    padding: 1rem;
  }

  .superior-parameters-area__header {
    display: grid;
  }

  .superior-parameters-form,
  .superior-parameters-form input {
    max-width: none;
  }

  .ingreso-options {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: clamp(1.55rem, 8vw, 2.1rem);
  }

  .site-nav {
    grid-template-columns: 1fr;
  }

  .site-nav a,
  button,
  .button {
    width: 100%;
  }

  .page-header {
    padding: 1rem;
  }

  .page-header__actions {
    flex-direction: column;
  }

  .button-row {
    flex-direction: column;
  }

  .provider-login-intro,
  .provider-login-note,
  .provider-login-help {
    max-width: none;
  }

  .provider-login-options {
    padding-left: 0;
    border-left: 0;
    border-top: 1px solid var(--border);
    padding-top: 1.25rem;
  }

  .provider-login-actions {
    grid-template-columns: minmax(0, 1fr);
  }

  .provider-draft-header,
  .provider-details-grid,
  .provider-form-grid--invoice {
    grid-template-columns: 1fr;
  }

  .provider-list-item {
    align-items: flex-start;
  }

  .provider-list-actions,
  .detail-list-actions,
  .provider-form-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .provider-phone-row {
    width: 100%;
  }

  .provider-phone-prefix,
  .provider-phone-input--area {
    flex-basis: clamp(5.75rem, 38vw, 8.125rem);
  }

  .provider-phone-input--number {
    flex-basis: 100%;
    max-width: none;
  }

  .provider-list-item,
  .provider-upload-row,
  .detail-list-item {
    flex-direction: column;
    align-items: stretch;
  }

  .provider-dashboard-upload .provider-list-actions,
  .provider-dashboard-actions {
    width: 100%;
  }

  .provider-file-control {
    width: 100%;
    flex-basis: auto;
  }

  .provider-dashboard-actions > .button,
  .provider-dashboard-actions > form,
  .provider-dashboard-actions > form .button {
    width: 100%;
  }

  .provider-list-actions,
  .detail-list-actions {
    align-items: stretch;
  }

  .provider-panel {
    padding: 0.95rem;
  }

  .provider-list-actions .button,
  .provider-list-actions button,
  .detail-list-actions .button,
  .detail-list-actions button,
  .inline-form {
    width: 100%;
  }

  .provider-section-head a.button,
  .provider-list-actions .button.secondary,
  .detail-list-actions .button.secondary {
    width: 100%;
  }

  .provider-list-actions--danger {
    padding: 0.55rem;
  }

  .provider-list-main,
  .detail-list-main {
    min-width: 0;
  }

  .inline-form {
    display: flex;
    margin-left: 0;
    margin-top: 0.5rem;
    width: 100%;
  }

  .table-wrap {
    border-radius: 0.8rem;
  }

}

/* Keep provider edit overrides after the shared provider controls. */
.provider-edit-page .provider-phone-row {
  display: grid;
  grid-template-columns: minmax(6.25rem, auto) minmax(0, 1fr) minmax(0, 1.45fr);
  align-items: end;
  width: 100%;
  max-width: 42rem;
}

.provider-edit-actions .button,
.provider-cbu-upload-action {
  white-space: nowrap;
}

@media (max-width: 38rem) {
  .provider-edit-page .provider-phone-row {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr);
  }

  .provider-edit-page .provider-phone-prefix {
    grid-column: 1 / -1;
    justify-self: start;
  }
}

/* Staff draft workflow */
.staff-draft-page {
  display: grid;
  gap: 1rem;
  min-width: 0;
}

.staff-draft-header,
.staff-draft-section {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.staff-draft-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1rem 1.5rem;
  padding: 1.35rem 1.5rem 0;
}

.staff-draft-header h1,
.staff-draft-header p {
  margin-top: 0;
}

.staff-draft-header h1 {
  margin-bottom: 0.35rem;
  font-size: 1.85rem;
}

.staff-draft-subtitle {
  max-width: 58ch;
  margin-bottom: 0;
  color: var(--muted);
}

.staff-draft-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(8rem, 1fr));
  gap: 0.75rem 1.25rem;
  min-width: min(23rem, 100%);
  margin: 0;
}

.staff-draft-summary dt {
  color: var(--muted);
  font-size: 0.78rem;
}

.staff-draft-summary dd {
  margin: 0.15rem 0 0;
  overflow-wrap: anywhere;
  font-weight: 600;
}

.staff-draft-progress {
  display: flex;
  grid-column: 1 / -1;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.8rem 0;
  border-top: 1px solid var(--border);
}

.staff-status {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.86rem;
}

.staff-status.is-complete,
.staff-requirement-list .is-complete {
  color: var(--success);
}

.staff-draft-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(18rem, 0.75fr);
  align-items: start;
  gap: 1rem;
  min-width: 0;
}

.staff-draft-main,
.staff-draft-side {
  display: grid;
  gap: 1rem;
  min-width: 0;
}

.staff-draft-section {
  padding: 1.2rem 1.25rem;
}

.staff-section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.85rem;
}

.staff-section-heading h2 {
  margin: 0;
  color: var(--brand);
  font-size: 1.2rem;
}

.staff-section-heading p {
  margin: 0.25rem 0 0;
  font-size: 0.9rem;
  line-height: 1.45;
}

.staff-section-count {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 0.86rem;
  white-space: nowrap;
}

.staff-upload-form,
.staff-invoice-form {
  gap: 0.75rem;
}

.staff-upload-fields {
  display: grid;
  grid-template-columns: minmax(11rem, 0.65fr) minmax(0, 1.35fr);
  gap: 0.75rem 1rem;
}

.staff-file-field {
  display: grid;
  gap: 0.35rem;
  min-width: 0;
}

.staff-file-field > label:first-child {
  margin-bottom: 0;
}

.staff-file-field .provider-file-control {
  min-height: 2.65rem;
  padding: 0.15rem 0;
}

.staff-inline-action {
  justify-self: start;
}

.staff-record-list,
.staff-invoice-list,
.staff-requirement-list {
  margin: 1rem 0 0;
  padding: 0;
  list-style: none;
}

.staff-record-list {
  border-top: 1px solid var(--border);
}

.staff-record-row,
.staff-invoice-row {
  display: grid;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
}

.staff-record-row {
  grid-template-columns: minmax(0, 1fr) auto;
}

.staff-record-main,
.staff-invoice-row > div {
  display: grid;
  gap: 0.18rem;
  min-width: 0;
}

.staff-record-main span,
.staff-invoice-row span,
.staff-file-status span {
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 0.88rem;
}

.staff-record-main .message {
  margin-top: 0.35rem;
}

.staff-record-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.45rem;
}

.staff-record-actions .button,
.staff-record-actions button,
.staff-invoice-row .button,
.staff-invoice-row button {
  min-height: 2.25rem;
  padding: 0.45rem 0.7rem;
  font-size: 0.88rem;
}

.staff-record-actions .inline-form,
.staff-invoice-row .inline-form {
  margin: 0;
}

.staff-manual-fallback {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-alt);
}

.staff-manual-fallback summary {
  padding: 0.75rem 0.85rem;
  cursor: pointer;
  color: var(--brand);
  font-weight: 600;
}

.staff-manual-fallback[open] summary {
  border-bottom: 1px solid var(--border);
}

.staff-invoice-form {
  padding: 0.85rem;
}

.staff-invoice-list {
  display: grid;
  gap: 0;
  border-top: 1px solid var(--border);
}

.staff-invoice-row {
  grid-template-columns: minmax(0, 1fr) auto auto;
}

.staff-file-status {
  display: grid;
  gap: 0.2rem;
  margin: 0 0 0.85rem;
}

.staff-draft-side .staff-upload-form {
  margin-top: 0.85rem;
}

.staff-review-section {
  border-color: var(--brand-strong);
}

.staff-total {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.8rem 0;
  border-block: 1px solid var(--border);
}

.staff-total span {
  color: var(--muted);
}

.staff-total strong {
  color: var(--brand);
  font-size: 1.35rem;
}

.staff-requirement-list {
  display: grid;
  gap: 0.5rem;
}

.staff-requirement-list li {
  display: flex;
  gap: 0.5rem;
  align-items: baseline;
  color: var(--muted);
  font-size: 0.9rem;
}

.staff-requirement-list li span {
  width: 1rem;
  color: var(--warning);
  font-weight: 700;
  text-align: center;
}

.staff-requirement-list .is-complete span {
  color: var(--success);
}

.staff-submit-form {
  margin-top: 1rem;
}

.staff-submit-form button {
  width: 100%;
  min-height: 2.8rem;
}

.public-landing .button {
  box-sizing: border-box;
  width: auto;
  max-width: 100%;
}

@media (max-width: 520px) {
  .public-landing .button {
    white-space: normal;
  }
}

@media (max-width: 900px) {
  .staff-draft-header {
    grid-template-columns: 1fr;
  }

  .staff-draft-summary {
    min-width: 0;
  }

  .staff-draft-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .staff-draft-header {
    padding: 1rem 1rem 0;
  }

  .staff-draft-header h1 {
    font-size: 1.55rem;
  }

  .staff-draft-summary {
    grid-template-columns: 1fr 1fr;
    gap: 0.7rem;
  }

  .staff-draft-section {
    padding: 1rem;
  }

  .staff-section-heading {
    display: grid;
    align-items: start;
    gap: 0.35rem;
  }

  .staff-upload-fields {
    grid-template-columns: 1fr;
  }

  .staff-inline-action,
  .staff-record-actions,
  .staff-record-actions .button,
  .staff-record-actions button,
  .staff-record-actions .inline-form,
  .staff-invoice-row .button,
  .staff-invoice-row button {
    width: 100%;
  }

  .staff-record-row,
  .staff-invoice-row {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .staff-record-actions {
    justify-content: stretch;
  }
}
