:root {
  --bg-page-start: #eef3fb;
  --bg-page-end: #e5edf8;
  --sidebar-bg: #102a43;
  --sidebar-surface: #16385a;
  --sidebar-active: #1a3f66;
  --sidebar-text: #e8f1fb;
  --sidebar-muted: #bdd0e4;
  --surface: #ffffff;
  --surface-soft: #f4f9ff;
  --surface-muted: #f8fbff;
  --stroke: #cfdeed;
  --stroke-soft: #d7e3f0;
  --text-strong: #16395f;
  --text-body: #4f6b88;
  --text-muted: #6f8298;
  --cta-start: #1e67b2;
  --cta-end: #2a7ccc;
  --focus: #7fb7f1;
  --shadow: 0 14px 28px rgba(15, 60, 115, 0.12);
  --radius-panel: 16px;
  --radius-control: 10px;
  --radius-button: 11px;
  --control-height: 2.7rem;
  --control-padding-y: 0.6rem;
  --control-padding-x: 0.8rem;
  --select-bg: #eef2f6;
  --select-bg-hover: #e6edf4;
  --select-border: #c4d2df;
  --select-border-focus: #9eb4cb;
  --select-text: #254c73;
  --select-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23345f87' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.8' d='M3.5 6.5 8 11l4.5-4.5'/%3E%3C/svg%3E");
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --sidebar-width-desktop: 248px;
  --sidebar-width-collapsed: 72px;
  --sidebar-width-mobile: 72px;
  --content-max: 1240px;
  --content-max-wide: 3840px;
  --content-gutter: clamp(1rem, 1.9vw, 1.85rem);
  --font-main: "IBM Plex Sans", "Segoe UI", "Helvetica Neue", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: var(--font-main);
  color: var(--text-body);
  background: linear-gradient(140deg, var(--bg-page-start), var(--bg-page-end));
  line-height: 1.45;
}

a {
  color: inherit;
}

h1,
h2,
h3,
p {
  margin: 0;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: #fff;
  color: #123a62;
  padding: 0.7rem 1rem;
  border-radius: 0 0 8px 8px;
  z-index: 1300;
}

.skip-link:focus {
  left: 1rem;
}

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

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-width-desktop);
  height: 100vh;
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  padding: 1.25rem 1.35rem 1.35rem;
  overflow-y: auto;
  overscroll-behavior: contain;
  transition: width 180ms ease, padding 180ms ease;
}

.brand {
  margin-bottom: 1.75rem;
}

.brand-title {
  font-size: 1.78rem;
  font-weight: 700;
}

.brand-subtitle {
  margin-top: 0.35rem;
  color: #9fb5cc;
  font-size: 0.81rem;
}

.brand-mobile {
  display: none;
}

.sidebar-collapse-toggle {
  align-self: flex-end;
  width: 2rem;
  height: 2rem;
  margin: -0.35rem 0 0.65rem;
  border: 1px solid rgb(189 208 228 / 38%);
  border-radius: 999px;
  color: var(--sidebar-text);
  background: transparent;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}

.sidebar-collapse-toggle:hover,
.sidebar-collapse-toggle:focus-visible {
  background: var(--sidebar-active);
}

.nav-icon {
  display: inline-grid;
  width: 1.85rem;
  min-width: 1.85rem;
  height: 1.85rem;
  place-items: center;
  color: #9ed0fb;
  background: rgb(143 192 237 / 12%);
  border: 1px solid rgb(143 192 237 / 20%);
  border-radius: 12px;
  line-height: 1;
  transition: color 150ms ease, background 150ms ease, border-color 150ms ease, transform 150ms ease;
}

.nav-icon svg {
  width: 1.08rem;
  height: 1.08rem;
  stroke: currentcolor;
  stroke-width: 1.85;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sidebar-accordion-title .nav-icon {
  width: 1.95rem;
  min-width: 1.95rem;
  height: 1.95rem;
}

.sidebar-accordion-heading {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
}

.sidebar-nav {
  display: grid;
  gap: 0.45rem;
}

.sidebar-accordion {
  border-top: 1px solid rgb(189 208 228 / 24%);
  padding-top: 0.45rem;
}

.sidebar-accordion-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 2.45rem;
  padding: 0.45rem 0.86rem;
  color: var(--sidebar-text);
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  list-style: none;
}

.sidebar-accordion-title::-webkit-details-marker {
  display: none;
}

.sidebar-accordion-title::after {
  content: "";
  width: 0.46rem;
  height: 0.46rem;
  border-right: 2px solid currentcolor;
  border-bottom: 2px solid currentcolor;
  transform: rotate(45deg) translateY(-0.14rem);
  transition: transform 150ms ease;
}

.sidebar-accordion[open] .sidebar-accordion-title::after {
  transform: rotate(225deg) translate(-0.14rem, -0.14rem);
}

.sidebar-accordion-title:hover,
.sidebar-accordion-title:focus-visible,
.sidebar-accordion.is-current .sidebar-accordion-title {
  color: #f2f7fd;
  background: var(--sidebar-active);
  border-radius: 10px;
}

.sidebar-accordion-links {
  display: grid;
  gap: 0.25rem;
  margin-top: 0.2rem;
  padding-left: 0.65rem;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: var(--sidebar-muted);
  padding: 0.72rem 0.86rem;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.95rem;
}

.nav-item:hover .nav-icon,
.nav-item:focus-visible .nav-icon,
.nav-item.is-current .nav-icon,
.sidebar-accordion.is-current .nav-icon,
.sidebar-accordion-title:hover .nav-icon,
.sidebar-accordion-title:focus-visible .nav-icon {
  color: #f2f7fd;
  background: rgb(242 247 253 / 16%);
  border-color: rgb(242 247 253 / 24%);
  transform: translateY(-1px);
}

.nav-item:hover,
.nav-item:focus-visible,
.nav-item.is-current {
  color: #f2f7fd;
  background: var(--sidebar-active);
}

.sidebar-cta {
  margin-top: auto;
  border-radius: 12px;
  background: var(--sidebar-surface);
  padding: 1rem;
}

.sidebar-cta-text {
  margin-bottom: 0.8rem;
  color: #b9cce0;
  font-size: 0.83rem;
}

.content {
  margin-left: var(--sidebar-width-desktop);
  padding: 1.6rem var(--content-gutter) 2.8rem;
  transition: margin-left 180ms ease;
}

body.sidebar-collapsed .sidebar {
  width: var(--sidebar-width-collapsed);
  padding: 0.9rem 0.55rem;
  align-items: center;
}

body.sidebar-collapsed .content {
  margin-left: var(--sidebar-width-collapsed);
}

body.sidebar-collapsed .brand {
  margin-bottom: 0.8rem;
}

body.sidebar-collapsed .brand-desktop,
body.sidebar-collapsed .nav-label {
  display: none;
}

body.sidebar-collapsed .brand-mobile {
  display: grid;
}

body.sidebar-collapsed .sidebar-collapse-toggle {
  align-self: center;
  margin-inline: auto;
}

body.sidebar-collapsed .sidebar-nav,
body.sidebar-collapsed .sidebar-accordion {
  width: 100%;
}

body.sidebar-collapsed .sidebar-accordion-title,
body.sidebar-collapsed .nav-item {
  justify-content: center;
  padding-inline: 0;
}

body.sidebar-collapsed .sidebar-accordion-title::after,
body.sidebar-collapsed .sidebar-accordion-links {
  display: none;
}

body.sidebar-collapsed .sidebar-accordion-title,
body.sidebar-collapsed .nav-item {
  min-height: 2.5rem;
}

body.sidebar-collapsed .nav-icon,
body.sidebar-collapsed .sidebar-accordion-title .nav-icon {
  width: 2.05rem;
  min-width: 2.05rem;
  height: 2.05rem;
  border-radius: 14px;
}

body.sidebar-collapsed .nav-icon svg,
body.sidebar-collapsed .sidebar-accordion-title .nav-icon svg {
  width: 1.18rem;
  height: 1.18rem;
}

.sidebar-flyout {
  position: fixed;
  z-index: 1400;
  min-width: 15rem;
  max-width: min(18rem, calc(100vw - 1.5rem));
  padding: 0.7rem;
  border: 1px solid rgb(189 208 228 / 26%);
  border-radius: 18px;
  background: #173a5d;
  box-shadow: 0 18px 34px rgba(7, 22, 39, 0.32);
}

.sidebar-flyout[hidden] {
  display: none;
}

.sidebar-flyout::before {
  content: "";
  position: absolute;
  left: -0.45rem;
  top: 1.15rem;
  width: 0.9rem;
  height: 0.9rem;
  border-top: 1px solid rgb(189 208 228 / 26%);
  border-left: 1px solid rgb(189 208 228 / 26%);
  background: #173a5d;
  transform: rotate(-45deg);
}

.sidebar-flyout-title {
  margin-bottom: 0.45rem;
  padding: 0.2rem 0.4rem 0.5rem;
  color: #f2f7fd;
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.sidebar-flyout-links {
  display: grid;
  gap: 0.22rem;
}

.sidebar-flyout-link {
  color: var(--sidebar-muted);
}

.sidebar-flyout-link:hover,
.sidebar-flyout-link:focus-visible,
.sidebar-flyout-link.is-current {
  color: #f2f7fd;
  background: var(--sidebar-active);
}

body.sidebar-collapsed .sidebar-flyout .nav-label {
  display: inline;
}

body.sidebar-collapsed .sidebar-flyout .nav-item {
  justify-content: flex-start;
  padding-inline: 0.86rem;
}

.topbar,
.page-header,
.content-body,
.content-panel,
.master-detail {
  width: min(var(--content-max), 100%);
  margin-inline: auto;
}

.content-wide .topbar,
.content-wide .page-header,
.content-wide .content-body,
.content-wide .content-panel,
.content-wide .master-detail {
  width: min(var(--content-max-wide), 100%);
}

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

.topbar {
  border: 1px solid var(--stroke);
  border-radius: 14px;
  background: #f7fafd;
  padding: 0.85rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.crumbs {
  font-size: 0.86rem;
  color: var(--text-muted);
}

.account-pill {
  background: #fff;
  border: 1px solid var(--stroke);
  border-radius: 999px;
  min-height: 2.55rem;
  padding: 0.3rem 0.85rem;
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  font-size: 0.9rem;
}

.account-inline {
  color: #24598f;
  font-weight: 700;
  text-decoration: none;
}

.account-pill form {
  margin: 0;
}

.page-header {
  margin-top: 1rem;
  display: grid;
  gap: 0.5rem;
}

.intro {
  font-size: 1rem;
}

.compact-header {
  margin-bottom: 1rem;
}

.eyebrow {
  color: #31577d;
  font-size: 0.95rem;
}

h1,
h2,
h3 {
  color: var(--text-strong);
  line-height: 1.2;
}

h1 {
  font-size: clamp(1.7rem, 3vw, 2.2rem);
  margin-bottom: 0.4rem;
}

h2 {
  font-size: 1.32rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  border-radius: var(--radius-button);
  font-weight: 700;
  border: 0;
  cursor: pointer;
  min-height: var(--control-height);
  padding: 0 var(--space-4);
  font-family: inherit;
}

.btn-primary,
.btn-login {
  background: linear-gradient(90deg, var(--cta-start), var(--cta-end));
  color: #fff;
}

.btn-primary:hover,
.btn-primary:focus-visible,
.btn-login:hover,
.btn-login:focus-visible {
  color: #fff;
}

.btn-secondary {
  background: #738497;
  color: #fff;
}

.btn-inline {
  min-height: auto;
  background: transparent;
  color: #1d5b98;
  padding: 0;
  border-radius: 0;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--stroke);
  border-radius: var(--radius-panel);
  box-shadow: var(--shadow);
}

.content-panel {
  padding: 1.15rem;
}

.panel-section {
  margin-top: var(--space-4);
  padding: var(--space-5);
}

.page-toolbar {
  margin-top: var(--space-4);
}

.page-toolbar .btn {
  min-width: 9.25rem;
}

.form-panel {
  margin-top: var(--space-4);
  max-width: 1040px;
  padding: var(--space-5);
}

.app-form {
  display: grid;
  gap: var(--space-4);
}

.app-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-4);
}

.app-form label {
  display: grid;
  gap: var(--space-2);
  color: #214f7f;
  font-weight: 700;
}

.app-form .form-check {
  margin-top: 0.2rem;
}

.field-span-2 {
  grid-column: 1 / -1;
}

.form-actions,
.page-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-top: var(--space-1);
}

.record-create-action {
  margin-left: auto;
}

.detail-panel {
  margin-top: 0.9rem;
  padding: 1.1rem;
}

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

.detail-list > div {
  border: 1px solid var(--stroke-soft);
  border-radius: 12px;
  background: var(--surface-muted);
  padding: 0.85rem 0.9rem;
}

.detail-list dt {
  color: #466682;
  font-size: 0.84rem;
  margin-bottom: 0.28rem;
}

.detail-list dd {
  margin: 0;
  color: #173f66;
  font-weight: 700;
}

.danger-panel {
  border-color: #ebc9c9;
  background: #fffafb;
}

.danger-note {
  border: 1px solid #ebc9c9;
  background: #fff2f2;
  color: #8f2d2d;
  border-radius: 10px;
  padding: 0.7rem 0.85rem;
  margin-bottom: 0.85rem;
  font-weight: 600;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.services-panel {
  margin-top: var(--space-3);
  padding: var(--space-5);
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

.search-wrap {
  border: 1px solid var(--stroke-soft);
  border-radius: var(--radius-control);
  background: #f9fbfe;
  min-height: var(--control-height);
  padding: var(--control-padding-y) var(--control-padding-x);
  color: #31516f;
  display: flex;
  flex: 1 1 250px;
}

.search-wrap input {
  border: 0;
  background: transparent;
  width: 100%;
  min-height: auto;
  padding: 0;
}

.toolbar-select {
  min-width: 11.5rem;
}

.toolbar-select select {
  width: 100%;
  min-height: var(--control-height);
}

.segmented-control {
  display: inline-flex;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--stroke-soft);
}

.segmented-btn {
  border: 0;
  background: #f2f6fb;
  color: #6f8298;
  min-height: 2.7rem;
  min-width: 5rem;
  font-family: inherit;
  font-weight: 700;
  cursor: pointer;
}

.segmented-btn.is-active {
  background: #fff;
  color: #25588e;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 820px;
}

.cell-actions {
  white-space: normal;
}

.cell-actions > * + * {
  margin-left: 0.55rem;
}

.people-cell-actions {
  white-space: nowrap;
  vertical-align: middle;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 5.4rem;
  min-height: 1.85rem;
  padding: 0 0.7rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
}

.status-pill-active {
  background: #e8f5ec;
  color: #2d7d46;
}

.grid-wrap {
  margin-top: 0.9rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 0.75rem;
}

.pagination {
  margin-top: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.8rem;
  color: #5f7590;
  font-size: 0.9rem;
}

.pager-links {
  display: inline-flex;
  gap: 0.45rem;
}

.pager-links a {
  text-decoration: none;
  border: 1px solid #d4e1ef;
  border-radius: 8px;
  min-width: 2.2rem;
  min-height: 2rem;
  padding: 0.35rem 0.7rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.pager-links a[aria-current="page"] {
  background: #eef4fb;
  color: #346190;
}

.service-tile {
  border: 1px solid var(--stroke-soft);
  border-radius: 12px;
  background: var(--surface-muted);
  padding: 0.95rem;
  display: grid;
  gap: 0.6rem;
}

.master-detail {
  display: grid;
  grid-template-columns: clamp(300px, 22vw, 360px) minmax(0, 1fr);
  gap: 1rem;
  margin-top: 1rem;
}

.master-detail.master-column-collapsed {
  grid-template-columns: 3.25rem minmax(0, 1fr);
}

.master-column,
.detail-column {
  padding: 1rem;
}

.master-column-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  margin-bottom: 0.75rem;
}

.master-column h2 {
  margin-bottom: 0.75rem;
}

.master-column-header .master-column-title {
  margin-bottom: 0;
}

.master-column-toggle {
  width: 2.25rem;
  min-width: 2.25rem;
  min-height: 2.25rem;
  border: 1px solid var(--stroke-soft);
  border-radius: var(--radius-control);
  background: var(--surface-muted);
  color: #1f4f80;
  cursor: pointer;
  font: inherit;
  font-size: 1.5rem;
  line-height: 1;
}

.master-column.is-collapsed {
  padding: 0.5rem;
}

.master-column.is-collapsed .master-column-header {
  justify-content: center;
  margin-bottom: 0;
}

.master-column.is-collapsed .master-column-title {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.detail-column {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.service-list {
  margin-top: 0.9rem;
  display: grid;
  gap: 0.65rem;
}

.service-item {
  border: 1px solid var(--stroke-soft);
  border-radius: 12px;
  background: #fff;
  text-align: left;
  padding: 0.8rem;
  display: grid;
  gap: 0.35rem;
  color: #2a4c6c;
  font-family: inherit;
  text-decoration: none;
}

.service-item strong {
  color: #1f4f80;
}

.service-item.is-selected {
  background: #e9f2fc;
  border-color: #bed2e7;
}

.service-card {
  background: var(--surface-muted);
  border: 1px solid var(--stroke-soft);
  border-radius: 14px;
  padding: 1rem;
}

.service-card p {
  margin-top: 0.45rem;
}

.service-section-tabs {
  display: flex;
  gap: 0.25rem;
  overflow-x: auto;
  border-bottom: 1px solid var(--stroke-soft);
}

.service-detail-tab {
  flex: 0 0 auto;
  padding: 0.8rem 1rem;
  border: 0;
  border-bottom: 3px solid transparent;
  border-radius: 0;
  background: transparent;
  color: #466682;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  white-space: nowrap;
}

.service-detail-tab.is-active {
  border-bottom-color: #25588e;
  background: #e9f2fc;
  color: #183e65;
}

.service-detail-tab:focus-visible {
  outline: 3px solid #173f67;
  outline-offset: -3px;
}

.service-detail-panel {
  padding-top: 0.25rem;
}

.service-section-content {
  padding: 0 1rem 1rem;
}

.eligibility-config-layout {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(19rem, 1fr);
  gap: 1rem;
  margin-top: 1rem;
}

.eligibility-config-block {
  border: 1px solid var(--stroke-soft);
  padding: 1rem;
}

.eligibility-config-block h4,
.eligibility-config-block p {
  margin-top: 0;
}

.eligibility-config-block .app-form {
  margin-top: 1rem;
}

.eligibility-file-input input[type="file"],
.bulk-file-input input[type="file"] {
  width: 100%;
  padding: 0.45rem;
  border: 1px dashed #8aa8c5;
  border-radius: 0;
  background: #f8fbff;
  color: #214f7f;
  cursor: pointer;
}

.eligibility-file-input input[type="file"]::file-selector-button,
.bulk-file-input input[type="file"]::file-selector-button {
  margin-right: 0.7rem;
  padding: 0.55rem 0.8rem;
  border: 1px solid #25588e;
  border-radius: 0;
  background: #25588e;
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
}

.eligibility-file-input input[type="file"]:hover::file-selector-button,
.eligibility-file-input input[type="file"]:focus-visible::file-selector-button,
.bulk-file-input input[type="file"]:hover::file-selector-button,
.bulk-file-input input[type="file"]:focus-visible::file-selector-button {
  background: #1d4773;
}

.detail-kpis {
  margin: 0.8rem 0 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.7rem;
}

.detail-kpis dt {
  color: #466682;
  font-size: 0.85rem;
}

.detail-kpis dd {
  margin: 0.18rem 0 0;
  color: #183e65;
  font-weight: 700;
}

.assignment-toolbar {
  display: grid;
  gap: 0.7rem;
  margin: 1rem 0 0.75rem;
}

.assignment-actions,
.assignment-calculation-summary,
.assignment-table-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
}

.assignment-action-divider {
  align-self: stretch;
  border-left: 1px solid var(--stroke-soft);
}

.assignment-calculation-summary {
  color: #466682;
  font-size: 0.95rem;
}

.assignment-table-filters {
  margin-bottom: 0.7rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--stroke-soft);
}

.assignment-table-filters label {
  display: grid;
  gap: 0.35rem;
  color: #214f7f;
  font-weight: 700;
}

.assignment-table-filter-actions {
  margin: 0 0 0 auto;
}

.status-pill-draft {
  background: #eef2f7;
  color: #5f7285;
}

.status-pill-inserted {
  background: #eaf2fd;
  color: #2b5f95;
}

.inline-form {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}

.btn-inline-danger {
  color: #b23b3b;
}

.btn-danger {
  background: #b23b3b;
  border-color: #b23b3b;
}

.btn-danger:hover,
.btn-danger:focus-visible {
  background: #9d3030;
  border-color: #9d3030;
}

.app-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 39, 64, 0.42);
  padding: 2rem 1rem;
  overflow-y: auto;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  z-index: 1200;
}

.app-modal {
  width: min(940px, 100%);
  background: #fff;
  border-radius: 16px;
  border: 1px solid var(--stroke);
  box-shadow: 0 20px 42px rgba(8, 39, 67, 0.28);
}

.app-modal-header,
.app-modal-footer {
  padding: 1rem 1.2rem;
  border-bottom: 1px solid #dbe6f2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
}

.app-modal-header h2 {
  font-size: clamp(1.5rem, 3.1vw, 2.15rem);
}

.app-modal-close {
  border: 0;
  background: transparent;
  font-size: 1.9rem;
  color: #7d91a6;
  cursor: pointer;
}

.app-modal-form {
  padding: 1rem 1.2rem;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
}

.app-modal-form label {
  display: grid;
  gap: 0.35rem;
  color: #214f7f;
  font-weight: 700;
}

.app-modal-form label:last-child {
  grid-column: 1 / -1;
}

.app-modal-form input {
  border: 1px solid var(--stroke-soft);
  border-radius: 10px;
  background: #fff;
  min-height: 2.7rem;
  padding: 0.6rem 0.8rem;
}

.people-rubrica-modal {
  width: min(1100px, 100%);
}

.people-rubrica-modal .table-wrap {
  grid-column: 1 / -1;
  max-height: min(40vh, 24rem);
  border: 1px solid var(--stroke-soft);
  border-radius: 10px;
}

.people-rubrica-modal .data-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
}

.people-rubrica-actions {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  white-space: nowrap;
}

.app-modal-footer {
  border-top: 1px solid #dbe6f2;
  border-bottom: 0;
  justify-content: flex-end;
}

.app-modal-error {
  grid-column: 1 / -1;
  margin-bottom: 0.2rem;
}

.bulk-csv-example {
  grid-column: 1 / -1;
  margin: 0;
  padding: 0.65rem;
  border-left: 3px solid #25588e;
  background: #f2f6fb;
  white-space: pre-wrap;
}

.bulk-summary {
  grid-column: 1 / -1;
  border: 1px solid #dbe6f2;
  border-radius: 10px;
  padding: 0.8rem;
  background: #f8fbff;
}

.bulk-summary p {
  margin-bottom: 0.4rem;
}

.bulk-summary p:last-child {
  margin-bottom: 0;
}

body.modal-open {
  overflow: hidden;
}

.content-panel > :last-child {
  margin-bottom: 0;
}

.content-panel .table {
  margin-bottom: 0;
  --bs-table-bg: transparent;
}

.content-panel .table th,
.content-panel .table td {
  border-bottom: 1px solid #e3ecf5;
  padding: var(--space-3) var(--space-4);
  vertical-align: middle;
}

.content-panel .table thead th {
  background: #f1f6fc;
  color: #244d78;
  font-weight: 700;
  border-bottom-width: 1px;
}

.content-panel .table-striped > tbody > tr:nth-of-type(odd) > * {
  --bs-table-accent-bg: #fbfdff;
}

.content-panel .table a {
  color: #1d5b98;
  text-decoration: none;
  font-weight: 600;
}

.table-wrap {
  overflow-x: auto;
  scrollbar-gutter: stable both-edges;
}

.content-panel .form-control,
.content-panel textarea,
.content-panel input[type="search"],
.content-panel input[type="text"],
.content-panel input[type="number"],
.content-panel input[type="date"] {
  border: 1px solid var(--stroke-soft);
  border-radius: var(--radius-control);
  background: #f9fbfe;
  min-height: var(--control-height);
  padding: var(--control-padding-y) var(--control-padding-x);
  color: #31516f;
}

select:not([multiple]):not([size]),
.form-select,
.toolbar-select select,
.app-modal-form select {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  border: 1px solid var(--select-border);
  border-radius: var(--radius-control);
  background-color: var(--select-bg);
  background-image: var(--select-chevron);
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 0.95rem;
  color: var(--select-text);
  min-height: var(--control-height);
  padding-top: var(--control-padding-y);
  padding-bottom: var(--control-padding-y);
  padding-left: var(--control-padding-x);
  padding-right: 2.2rem;
}

select:not([multiple]):not([size]):hover,
.form-select:hover,
.toolbar-select select:hover,
.app-modal-form select:hover {
  background-color: var(--select-bg-hover);
  border-color: #b8c8d9;
}

select:not([multiple]):not([size]):focus,
.form-select:focus,
.toolbar-select select:focus,
.app-modal-form select:focus {
  border-color: var(--select-border-focus);
  box-shadow: 0 0 0 0.2rem rgba(36, 91, 147, 0.12);
}

.content-panel textarea.form-control {
  min-height: 7rem;
}

.content-panel .form-control::placeholder,
.content-panel input::placeholder,
.content-panel textarea::placeholder {
  color: #657d96;
  opacity: 1;
}

.content-panel .form-control:disabled,
.content-panel .form-select:disabled,
.btn:disabled,
.btn.disabled {
  background: #edf3fa;
  border-color: #cedae8;
  color: #6e8297;
  opacity: 1;
  cursor: not-allowed;
}

.content-panel .text-danger,
.content-panel .validation-summary-errors {
  margin-top: var(--space-1);
}

.summary-list {
  margin-bottom: var(--space-4);
}

.content-panel .form-check-input {
  border-color: #9cb6d1;
}

.content-panel hr {
  border-color: #d6e3f1;
}

.content-panel ul {
  padding-left: 1.25rem;
}

.btn:focus-visible,
.nav-item:focus-visible,
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

@media (max-width: 760px) {
  .sidebar {
    width: var(--sidebar-width-mobile);
    padding: 0.9rem 0.55rem;
    align-items: center;
  }

  .brand-desktop,
  .sidebar-cta {
    display: none;
  }

  .brand-mobile {
    display: grid;
    width: 2.2rem;
    height: 2.2rem;
    border-radius: 999px;
    background: #1a3f66;
    place-items: center;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
  }

  .sidebar-nav {
    width: 100%;
    display: grid;
    gap: 0.55rem;
  }

  .sidebar-nav::before {
    content: "";
    display: block;
    width: 1.5rem;
    height: 0.44rem;
    border-radius: 999px;
    background: #62a5e0;
    margin: 0.3rem auto;
  }

  .sidebar-accordion {
    width: 100%;
    padding-top: 0.35rem;
  }

  .sidebar-accordion-title {
    display: grid;
    place-items: center;
    min-height: 2.2rem;
    padding: 0;
    border-radius: 999px;
    font-size: 1rem;
  }

  .sidebar-accordion-title::before {
    display: none;
  }

  .sidebar .nav-label {
    display: none;
  }

  .sidebar-accordion-title::after {
    display: none;
  }

  .sidebar-accordion-links {
    gap: 0.4rem;
    margin-top: 0.4rem;
    padding-left: 0;
  }

  .nav-item {
    display: grid;
    place-items: center;
    min-height: 2.2rem;
    padding: 0;
    font-size: 1rem;
    border-radius: 999px;
  }

  .nav-icon,
  .sidebar-accordion-title .nav-icon {
    width: 1.9rem;
    min-width: 1.9rem;
    height: 1.9rem;
  }

  .nav-icon svg,
  .sidebar-accordion-title .nav-icon svg {
    width: 1.05rem;
    height: 1.05rem;
  }

  .nav-item::before {
    display: none;
  }

  .content {
    margin-left: var(--sidebar-width-mobile);
    padding: 1rem 0.95rem 1.5rem;
  }

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

  .account-pill {
    width: 100%;
    justify-content: space-between;
  }

  .content-panel {
    padding: 0.9rem;
  }

  .toolbar {
    flex-direction: column;
  }

  .search-wrap,
  .toolbar-select,
  .segmented-control,
  .segmented-btn {
    width: 100%;
  }

  .grid-wrap {
    grid-template-columns: 1fr;
  }

  .app-form-grid,
  .detail-list {
    grid-template-columns: 1fr;
  }

  .page-actions,
  .form-actions {
    flex-direction: column;
    align-items: flex-start;
  }

  .assignment-action-divider {
    display: none;
  }

  .assignment-table-filter-actions {
    margin-left: 0;
  }

  .record-create-action {
    margin-left: 0;
  }

  .master-detail,
  .detail-kpis,
  .app-modal-form,
  .eligibility-config-layout {
    grid-template-columns: 1fr;
  }

  .data-table {
    min-width: 640px;
  }

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

  .app-modal-backdrop {
    padding: 0.8rem;
  }
}

@media (max-width: 1180px) {
  .master-detail,
  .master-detail.master-column-collapsed {
    grid-template-columns: 1fr;
  }

  .detail-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
