﻿:root {
  --btf-ink: #12364d;
  --btf-deep: #1f6f97;
  --btf-blue: #2b8fbd;
  --btf-sky: #32a9d9;
  --btf-soft: #eaf8fc;
  --btf-soft-2: #f4fbfd;
  --btf-line: #c8e5ee;
  --btf-orange: #f5a623;
}
body {
  background: var(--btf-soft-2);
  color: var(--btf-ink);
}
.page-shell {
  padding: 24px;
}
.page-shell:has(.province-dashboard) {
  background: var(--btf-soft-2);
  overflow-x: auto;
  padding: 0;
}
.page-shell:has(.intake-panel) {
  background: var(--btf-soft-2);
}
.panel,
.stat {
  background: #fff;
  border: 1px solid var(--btf-line);
  border-radius: 8px;
  padding: 18px;
}
.navbar .navbar-nav {
  gap: 4px;
}
.navbar.bg-white {
  background:
    linear-gradient(90deg, rgba(224, 247, 253, 0.98) 0%, #fff 48%, rgba(255, 248, 235, 0.86) 100%) !important;
  border-color: rgba(43, 143, 189, 0.22) !important;
}
.navbar .navbar-brand {
  color: var(--btf-deep);
  font-weight: 900 !important;
}
.navbar .nav-link {
  border-radius: 8px;
  color: #2d617e;
  font-weight: 800;
  padding-left: 12px;
  padding-right: 12px;
}
.navbar .nav-link:hover {
  background: rgba(50, 169, 217, 0.12);
  color: var(--btf-deep);
}
.navbar .nav-link.active {
  background: linear-gradient(135deg, var(--btf-blue) 0%, var(--btf-deep) 100%);
  border-bottom: 3px solid var(--btf-orange);
  color: #fff;
  box-shadow: 0 8px 20px rgba(43, 143, 189, 0.2);
}
.navbar .nav-link.active:hover {
  background: linear-gradient(135deg, #247fa8 0%, #195f88 100%);
  color: #fff;
}
.navbar .nav-link.disabled {
  background: transparent;
  box-shadow: none;
  color: #94a3b8;
}
.navbar-account-actions {
  align-items: center;
  display: flex;
  gap: 8px;
}
.navbar-account-actions form {
  align-items: center;
  display: flex;
  margin: 0;
}
.navbar-account-actions .btn {
  align-items: center;
  display: inline-flex;
  height: 34px;
  justify-content: center;
  line-height: 1;
  white-space: nowrap;
}
.narrow {
  max-width: 680px;
}
.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at top left, rgba(50, 169, 217, 0.18), transparent 34%),
    radial-gradient(circle at bottom right, rgba(245, 166, 35, 0.12), transparent 28%),
    linear-gradient(180deg, #f5fbfc 0%, #eef6f8 100%);
  padding: 24px;
}
.login-panel {
  width: min(440px, 92vw);
  background: #fff;
  border-radius: 8px;
  padding: 28px;
  box-shadow: 0 18px 44px rgba(15, 23, 42, 0.12);
  text-align: center;
}
.login-brand {
  display: grid;
  justify-items: center;
  margin-bottom: 22px;
}
.login-brand img {
  height: auto;
  margin-bottom: 14px;
  max-width: min(230px, 72vw);
  width: 100%;
}
.login-domain {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  margin-bottom: 10px;
  padding: 4px 10px;
  border: 1px solid #bfe7f5;
  border-radius: 999px;
  background: #f0fbff;
  color: #075985;
  font-size: 13px;
  font-weight: 850;
}
.login-brand h1 {
  color: #0f172a;
  font-size: 27px;
  font-weight: 900;
  margin: 0 0 4px;
}
.login-brand p {
  color: #64748b;
  font-weight: 700;
  margin: 0;
}
.login-notice {
  display: grid;
  gap: 4px;
  margin: 0 0 18px;
  padding: 12px 14px;
  border: 1px solid #d7edf7;
  border-left: 5px solid #0ea5e9;
  border-radius: 8px;
  background: #f8fcff;
  text-align: left;
}
.login-notice strong {
  color: #0f3654;
  font-weight: 950;
}
.login-notice span {
  color: #475569;
  font-size: 13px;
  font-weight: 750;
}
.login-panel form {
  text-align: left;
}
.login-panel .btn {
  font-weight: 800;
}
.login-help {
  margin: 14px 0 0;
  color: #64748b;
  font-size: 13px;
  font-weight: 750;
}
.btn-primary {
  --bs-btn-bg: var(--btf-blue);
  --bs-btn-border-color: var(--btf-blue);
  --bs-btn-hover-bg: var(--btf-deep);
  --bs-btn-hover-border-color: var(--btf-deep);
  --bs-btn-active-bg: var(--btf-deep);
  --bs-btn-active-border-color: var(--btf-deep);
}
.btn-outline-primary {
  --bs-btn-color: var(--btf-deep);
  --bs-btn-border-color: var(--btf-blue);
  --bs-btn-hover-bg: var(--btf-blue);
  --bs-btn-hover-border-color: var(--btf-blue);
}
.form-control:focus,
.form-select:focus {
  border-color: var(--btf-sky);
  box-shadow: 0 0 0 0.2rem rgba(50, 169, 217, 0.18);
}
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}
.stat span {
  display: block;
  color: #6b7280;
  font-size: 14px;
}
.stat strong {
  display: block;
  font-size: 32px;
}
.bar-row {
  display: grid;
  grid-template-columns: 80px 1fr 48px;
  gap: 12px;
  align-items: center;
  margin: 12px 0;
}
.bar {
  height: 12px;
  border-radius: 999px;
  background: #e5e7eb;
  overflow: hidden;
}
.bar i {
  display: block;
  height: 100%;
  background: var(--btf-blue);
}
.module-list {
  display: grid;
  gap: 10px;
}
.module-list a {
  display: block;
  color: var(--btf-deep);
  text-decoration: none;
  border: 1px solid #dde3ea;
  border-radius: 8px;
  padding: 10px 12px;
}
.table-actions {
  display: inline-flex;
  justify-content: flex-end;
  gap: 6px;
  white-space: nowrap;
}
.table-actions form {
  margin: 0;
}
.vulnerable-public {
  background: #dbeafe;
  color: #1d4ed8;
}
.vulnerable-rental {
  background: #fef3c7;
  color: #92400e;
}
.panel form p {
  margin-bottom: 12px;
}
.panel label {
  font-weight: 600;
  margin-bottom: 4px;
}
.form-check-input + label,
input[type="checkbox"] + label {
  display: inline;
  margin-left: 6px;
  font-weight: 500;
}
.choice-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  list-style: none;
  padding-left: 0;
  margin: 6px 0 0;
}
.choice-list li {
  background: #f8fafc;
  border: 1px solid #dde3ea;
  border-radius: 8px;
  padding: 8px 10px;
}
.choice-list label {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  font-weight: 500;
}
.choice-list input {
  margin: 0;
}
.resume-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
}
.wide {
  grid-column: 1 / -1;
}
.score {
  font-size: 48px;
  font-weight: 700;
}
.timeline-item {
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid #edf1f5;
  padding: 10px 0;
}
.individual-dashboard {
  display: grid;
  gap: 16px;
}
.profile-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  background: #fff;
  border: 1px solid #dde3ea;
  border-radius: 8px;
  padding: 18px;
}
.profile-main {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}
.profile-photo {
  width: 104px;
  height: 104px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid #dde3ea;
  flex: 0 0 auto;
}
.profile-photo-empty {
  display: grid;
  place-items: center;
  background: #edf2f7;
  color: #64748b;
  font-size: 13px;
}
.eyebrow {
  color: #64748b;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}
.profile-hero h1 {
  margin: 2px 0 8px;
  font-size: 30px;
}
.profile-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  color: #475569;
  font-size: 14px;
}
.status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  border-radius: 999px;
  padding: 6px 12px;
  font-weight: 700;
  white-space: nowrap;
}
.status-success {
  background: #dcfce7;
  color: #166534;
}
.status-warning {
  background: #fef3c7;
  color: #92400e;
}
.status-danger {
  background: #fee2e2;
  color: #991b1b;
}
.action-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.summary-cards {
  display: grid;
  grid-template-columns: repeat(6, minmax(140px, 1fr));
  gap: 12px;
}
.summary-card {
  background: #fff;
  border: 1px solid #dde3ea;
  border-radius: 8px;
  padding: 14px;
  min-height: 96px;
}
.summary-card span {
  display: block;
  color: #64748b;
  font-size: 13px;
}
.summary-card strong {
  display: block;
  margin-top: 8px;
  font-size: 18px;
  line-height: 1.25;
}
.dashboard-columns {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(260px, 0.9fr) minmax(300px, 1.1fr);
  gap: 14px;
  align-items: start;
}
.resume-list {
  margin: 0;
}
.resume-list dt {
  color: #334155;
  font-weight: 700;
  margin-top: 12px;
}
.resume-list dt:first-child {
  margin-top: 0;
}
.resume-list dd {
  margin: 4px 0 0;
  color: #475569;
}
.check-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 10px;
}
.check-list li {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 10px;
  border-radius: 8px;
  background: #f8fafc;
}
.check-list span {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  font-weight: 800;
}
.check-list .ok span {
  background: #dcfce7;
  color: #166534;
}
.check-list .no span {
  background: #fee2e2;
  color: #991b1b;
}
.timeline-year {
  font-weight: 800;
  color: #0f4c81;
  margin-bottom: 8px;
}
.case-timeline {
  position: relative;
  display: grid;
  gap: 10px;
  padding-left: 18px;
}
.case-timeline::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: #cbd5e1;
}
.case-timeline-item {
  position: relative;
  display: grid;
  grid-template-columns: 58px 1fr;
  gap: 8px;
}
.case-timeline-item::before {
  content: "";
  position: absolute;
  left: -18px;
  top: 7px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #0f766e;
}
.case-timeline-item.child::before {
  background: #64748b;
}
.case-timeline-item span {
  color: #64748b;
  font-size: 13px;
}
.case-timeline-item strong {
  color: #1f2933;
}
.case-timeline-item em {
  grid-column: 2;
  color: #64748b;
  font-size: 13px;
  font-style: normal;
}
.map {
  height: calc(100vh - 150px);
  min-height: 520px;
  border: 1px solid #dde3ea;
  border-radius: 8px;
}
@media (max-width: 1180px) {
  .summary-cards {
    grid-template-columns: repeat(3, minmax(160px, 1fr));
  }
  .dashboard-columns {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 640px) {
  .page-shell {
    padding: 14px;
  }
  .bar-row {
    grid-template-columns: 1fr;
  }
  .profile-hero,
  .profile-main {
    align-items: flex-start;
    flex-direction: column;
  }
  .profile-hero h1 {
    font-size: 24px;
  }
  .summary-cards {
    grid-template-columns: 1fr;
  }
  .action-bar .btn {
    width: 100%;
  }
}

.resume-page {
  background: #f1eee6;
  border-top: 2px solid #202020;
  border-bottom: 2px solid #202020;
  color: #1e1e1e;
  margin: -24px;
  min-height: calc(100vh - 58px);
  padding: 38px 24px;
}
.resume-sheet {
  max-width: 1120px;
  margin: 0 auto;
  padding: 28px 42px 58px;
}
.resume-toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
  margin-bottom: 24px;
}
.resume-tool-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border: 1px solid #262626;
  border-radius: 999px;
  background: #fff;
  color: #1e1e1e;
  font-weight: 800;
  line-height: 1.1;
  padding: 8px 16px;
  text-decoration: none;
}
.resume-tool-icon {
  width: 42px;
  min-width: 42px;
  min-height: 34px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 900;
  padding: 0;
}
.resume-tool-icon[aria-label="ปริ้น"] {
  font-size: 20px;
}
.resume-tool-button:hover {
  background: #f4e9b8;
  color: #111;
}
.resume-tool-primary {
  background: #262626;
  color: #fff;
}
.resume-tool-primary:hover {
  background: #71554d;
  color: #fff;
}
.resume-top {
  display: grid;
  grid-template-columns: minmax(320px, 0.95fr) minmax(360px, 1.05fr);
  gap: 58px;
  align-items: start;
}
.resume-identity {
  text-align: center;
}
.resume-photo {
  width: min(420px, 100%);
  aspect-ratio: 1;
  border: 8px solid #f7efc8;
  border-radius: 50%;
  object-fit: cover;
  background: #c7b2a1;
  box-shadow: 0 0 0 1px rgba(30, 30, 30, 0.04);
}
.resume-photo-empty {
  display: inline-grid;
  place-items: center;
  color: #6f625b;
  font-size: 20px;
  font-weight: 800;
}
.resume-identity h1 {
  margin: 34px 0 2px;
  font-size: clamp(30px, 4vw, 45px);
  font-weight: 900;
  line-height: 1;
  text-transform: uppercase;
}
.resume-identity p {
  margin: 0;
  font-size: clamp(22px, 3vw, 34px);
  font-weight: 900;
}
.resume-about {
  padding-top: 74px;
  text-align: center;
}
.resume-script-title {
  color: #000;
  font-family: "Times New Roman", Georgia, serif;
  font-size: clamp(86px, 12vw, 138px);
  font-style: italic;
  line-height: 0.88;
  margin-bottom: 48px;
}
.resume-about h2,
.resume-box h2,
.resume-section h2 {
  color: #2b2b2b;
  font-size: clamp(28px, 3vw, 38px);
  font-weight: 900;
  line-height: 1.15;
}
.resume-about h2 {
  color: #71554d;
  margin-bottom: 18px;
}
.resume-about p {
  max-width: 500px;
  margin: 0 auto;
  color: #2d2d2d;
  font-size: 22px;
  line-height: 1.18;
}
.resume-body {
  display: grid;
  grid-template-columns: minmax(320px, 0.9fr) minmax(420px, 1.1fr);
  gap: 78px;
  margin-top: 44px;
}
.resume-left,
.resume-right {
  display: grid;
  gap: 20px;
  align-content: start;
}
.resume-right {
  gap: 58px;
  padding-top: 34px;
}
.resume-box {
  background: #fff;
  border: 2px solid #1f1f1f;
  border-radius: 48px;
  padding: 40px 48px;
}
.resume-box h2 {
  margin: 0 0 34px;
  text-align: center;
}
.resume-contact,
.resume-bullets {
  display: grid;
  gap: 15px;
  margin: 0;
  padding: 0;
}
.resume-contact {
  list-style: none;
}
.resume-contact li {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 14px;
  align-items: start;
  color: #2f2f2f;
  font-size: 21px;
}
.resume-contact span {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #333;
  color: #fff;
  font-size: 20px;
  line-height: 1;
}
.resume-contact strong {
  min-width: 0;
  overflow-wrap: anywhere;
  font-weight: 500;
}
.resume-bullets {
  padding-left: 24px;
  color: #3f3f3f;
  font-size: 22px;
  line-height: 1.32;
}
.resume-section h2 {
  margin: 0 0 30px;
}
.resume-timeline {
  display: grid;
  gap: 11px;
}
.resume-row {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 28px;
  align-items: start;
  border-bottom: 2px dotted #2d2d2d;
  padding-bottom: 10px;
}
.resume-row span {
  display: inline-grid;
  place-items: center;
  min-height: 34px;
  border-radius: 999px;
  background: #f2cdbd;
  color: #222;
  font-size: 22px;
  font-weight: 800;
  padding: 2px 18px;
}
.resume-row-gold span {
  background: #f4e9b8;
}
.resume-row strong {
  display: block;
  color: #242424;
  font-size: 22px;
  font-weight: 900;
  line-height: 1.1;
}
.resume-row p {
  margin: 4px 0 0;
  color: #2c2c2c;
  font-size: 19px;
  line-height: 1.15;
}
.resume-page-survey {
  background: #f5f9fc;
  border: 0;
  color: #0f172a;
}
.resume-survey-sheet {
  max-width: 1180px;
  padding: 22px 24px 52px;
}
.resume-survey-hero {
  align-items: stretch;
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 22px;
  margin-bottom: 18px;
}
.resume-main-photo {
  background: #fff;
  border: 1px solid #dce7ee;
  border-radius: 8px;
  min-height: 300px;
  overflow: hidden;
}
.resume-main-photo img,
.resume-photo-placeholder {
  height: 100%;
  min-height: 300px;
  width: 100%;
}
.resume-main-photo img {
  object-fit: cover;
}
.resume-photo-placeholder {
  align-items: center;
  background: #e2e8f0;
  color: #64748b;
  display: flex;
  font-weight: 900;
  justify-content: center;
}
.resume-summary {
  background: #fff;
  border: 1px solid #dce7ee;
  border-radius: 8px;
  display: grid;
  align-content: center;
  gap: 12px;
  padding: 28px;
}
.resume-kicker {
  color: #0f766e;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0;
  margin: 0;
}
.resume-summary h1 {
  color: #0f172a;
  font-size: clamp(32px, 4vw, 54px);
  font-weight: 900;
  line-height: 1.05;
  margin: 0;
}
.resume-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.resume-badges span {
  background: #e6f7f7;
  border: 1px solid #bce7e5;
  border-radius: 999px;
  color: #0f766e;
  font-size: 12px;
  font-weight: 900;
  padding: 6px 10px;
}
.resume-personal-history {
  color: #475569;
  font-size: 16px;
  line-height: 1.55;
  margin: 0;
}
.resume-photo-panel,
.resume-survey-card {
  background: #fff;
  border: 1px solid #dce7ee;
  border-radius: 8px;
  padding: 18px;
}
.resume-panel-head {
  align-items: end;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}
.resume-panel-head h2,
.resume-survey-card h2 {
  color: #0f172a;
  font-size: 18px;
  font-weight: 900;
  margin: 0;
}
.resume-panel-head p {
  color: #64748b;
  font-weight: 700;
  margin: 0;
}
.resume-photo-slots {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}
.resume-photo-slot {
  display: grid;
  gap: 8px;
}
.resume-slot-preview {
  aspect-ratio: 4 / 3;
  background: #eef2f7;
  border: 1px dashed #b6c7d4;
  border-radius: 8px;
  display: grid;
  overflow: hidden;
  place-items: center;
}
.resume-slot-preview img {
  height: 100%;
  object-fit: cover;
  width: 100%;
}
.resume-slot-preview span {
  color: #64748b;
  font-weight: 900;
}
.resume-slot-upload input {
  height: 1px;
  opacity: 0;
  position: absolute;
  width: 1px;
}
.resume-slot-upload label span {
  border: 1px solid #b9d9d7;
  border-radius: 8px;
  color: #0f766e;
  cursor: pointer;
  display: block;
  font-size: 12px;
  font-weight: 900;
  padding: 7px 8px;
  text-align: center;
}
.resume-survey-grid {
  align-items: start;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 14px;
}
.resume-survey-grid .resume-survey-card {
  align-self: start;
}
.resume-data-list {
  display: grid;
  gap: 10px;
  margin: 14px 0 0;
}
.resume-data-list div {
  border-bottom: 1px solid #e2e8f0;
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 12px;
  padding-bottom: 9px;
}
.resume-data-list div:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}
.resume-data-list dt {
  color: #64748b;
  font-size: 13px;
  font-weight: 900;
}
.resume-data-list dd {
  color: #0f172a;
  font-weight: 800;
  margin: 0;
  overflow-wrap: anywhere;
}
.resume-case-card {
  margin-top: 14px;
}
.resume-case-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}
.resume-case-item {
  align-items: start;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  display: grid;
  grid-template-columns: 108px minmax(0, 1fr);
  gap: 10px 14px;
  padding: 12px;
}
.resume-case-item span {
  background: #e6f7f7;
  border-radius: 999px;
  color: #0f766e;
  font-size: 12px;
  font-weight: 900;
  padding: 5px 8px;
  text-align: center;
}
.resume-case-item strong {
  color: #0f172a;
  font-weight: 900;
}
.resume-case-item p {
  color: #475569;
  grid-column: 2;
  margin: -4px 0 0;
}
.resume-empty-text {
  color: #64748b;
  font-weight: 800;
  margin: 0;
}

@media (max-width: 900px) {
  .resume-page {
    margin: -14px;
    padding: 20px 12px;
  }
  .resume-sheet {
    padding: 18px 10px 36px;
  }
  .resume-toolbar {
    justify-content: flex-end;
  }
  .resume-tool-button {
    flex: 0 0 auto;
  }
  .resume-top,
  .resume-body {
    grid-template-columns: 1fr;
    gap: 28px;
  }
  .resume-script-title {
    margin-bottom: 26px;
  }
  .resume-about p {
    font-size: 18px;
  }
  .resume-body {
    margin-top: 20px;
  }
  .resume-right {
    gap: 34px;
    padding-top: 0;
  }
  .resume-box {
    border-radius: 30px;
    padding: 28px 24px;
  }
  .resume-row {
    grid-template-columns: 88px 1fr;
    gap: 16px;
  }
  .resume-row span,
  .resume-row strong {
    font-size: 18px;
  }
  .resume-row p,
  .resume-contact li,
  .resume-bullets {
    font-size: 16px;
  }
}

@media print {
  .navbar,
  .resume-toolbar {
    display: none !important;
  }
  .page-shell,
  .resume-page {
    margin: 0 !important;
    padding: 0 !important;
  }
  .resume-page {
    border: 0;
    background: #f1eee6 !important;
  }
  .resume-sheet {
    max-width: none;
    padding: 18mm;
  }
}

.intake-panel {
  max-width: 1100px;
  margin: 0 auto;
  background:
    linear-gradient(180deg, #ffffff 0%, #f8fcfd 100%);
  border-color: var(--btf-line);
  box-shadow: 0 18px 42px rgba(31, 111, 151, 0.1);
  padding: 22px;
}
.intake-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--btf-line);
  margin: -2px 0 18px;
  padding-bottom: 16px;
}
.intake-header h1 {
  color: var(--btf-ink);
  font-size: 28px;
  font-weight: 900;
  letter-spacing: 0;
}
.intake-header p {
  color: #5f7187 !important;
  font-weight: 700;
}
.intake-safe-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 18px;
}
.intake-safe-strip div {
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid #cfe8f3;
  border-radius: 8px;
  background: #f8fdff;
}
.intake-safe-strip strong,
.intake-safe-strip span {
  display: block;
}
.intake-safe-strip strong {
  color: #0f3654;
  font-size: 14px;
  font-weight: 950;
}
.intake-safe-strip span {
  margin-top: 2px;
  color: #64748b;
  font-size: 12px;
  font-weight: 750;
  line-height: 1.35;
}
.intake-steps {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  padding: 0;
  margin: 0 0 22px;
  list-style: none;
}
.intake-steps li {
  min-height: 48px;
  border: 1px solid var(--btf-line);
  border-radius: 8px;
  background: #f8fdff;
  color: #315d76;
  padding: 0;
  overflow: hidden;
  position: relative;
}
.intake-steps li::before {
  background: #9fd7e8;
  border-radius: 999px;
  content: "";
  height: 7px;
  left: 12px;
  position: absolute;
  top: 10px;
  width: 7px;
}
.intake-steps button {
  width: 100%;
  min-height: 48px;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 14px;
  font-weight: 900;
  line-height: 1.25;
  padding: 12px 10px 10px 28px;
  text-align: left;
  cursor: pointer;
}
.intake-steps button:hover {
  background: rgba(50, 169, 217, 0.1);
}
.intake-steps li.active {
  background: linear-gradient(135deg, var(--btf-blue), var(--btf-deep));
  border-color: var(--btf-blue);
  color: #fff;
  box-shadow: 0 10px 24px rgba(43, 143, 189, 0.2);
}
.intake-steps li.active button:hover {
  background: rgba(255, 255, 255, 0.1);
}
.intake-steps li.active::before {
  background: var(--btf-orange);
}
.intake-steps li.complete {
  background: #eef9fd;
  border-color: #9fd7e8;
  color: var(--btf-deep);
}
.intake-steps li.complete::before {
  background: var(--btf-sky);
}
.intake-step-page {
  display: none;
}
.intake-step-page.active {
  display: block;
}
.intake-step-page > h2 {
  align-items: center;
  color: var(--btf-ink);
  display: flex;
  font-size: 22px;
  font-weight: 900;
  gap: 10px;
  margin: 6px 0 16px;
}
.intake-step-page > h2::before {
  background: var(--btf-blue);
  border-radius: 999px;
  content: "";
  height: 14px;
  width: 5px;
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(240px, 1fr));
  gap: 16px 18px;
}
.field-block {
  min-width: 0;
}
.field-block.wide > h3 {
  align-items: center;
  background: var(--btf-soft);
  border: 1px solid var(--btf-line);
  border-left: 5px solid var(--btf-blue);
  border-radius: 8px;
  color: var(--btf-deep);
  display: flex;
  font-size: 15px;
  font-weight: 900;
  min-height: 42px;
  padding: 10px 12px;
  width: 100%;
}
.collection-field-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 14px 16px;
}
.intake-two-column-row {
  display: grid;
  gap: 14px 16px;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
}
.health-body-row {
  align-items: start;
  display: grid;
  gap: 14px 16px;
  grid-template-columns: minmax(220px, 0.55fr) minmax(260px, 1fr);
}
.field-block label {
  display: block;
  color: #263b50;
  font-size: 14px;
  font-weight: 900;
  margin-bottom: 6px;
}
.field-block .form-control,
.field-block .form-select,
.field-block textarea,
.field-block input[type="text"],
.field-block input[type="email"],
.field-block input[type="number"],
.field-block input[type="tel"],
.field-block input[type="date"],
.field-block select {
  background-color: #fff;
  border-color: #cfdee5;
  border-radius: 8px;
  color: #0f172a;
  min-height: 42px;
}
.field-block textarea {
  min-height: 72px;
}
.field-block .form-control:focus,
.field-block .form-select:focus,
.field-block textarea:focus,
.field-block input[type="text"]:focus,
.field-block input[type="email"]:focus,
.field-block input[type="number"]:focus,
.field-block input[type="tel"]:focus,
.field-block input[type="date"]:focus,
.field-block select:focus {
  border-color: var(--btf-sky);
  box-shadow: 0 0 0 0.2rem rgba(50, 169, 217, 0.18);
}
.field-block input[type="date"] {
  font-size: 16px;
  min-width: 0;
}
.field-block input[type="checkbox"],
.field-block input[type="radio"] {
  accent-color: var(--btf-blue);
}
.field-block .errorlist {
  color: #991b1b;
  margin: 6px 0 0;
  padding-left: 18px;
}
.assistance-services {
  background: #f8fcff;
  border: 1px solid #d9ebf2;
  border-radius: 10px;
  padding: 14px;
}
.assistance-services-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(260px, 1fr));
  margin-top: 12px;
}
.assistance-service-card {
  background: #fff;
  border: 1px solid #dce8ef;
  border-radius: 8px;
  min-width: 0;
  padding: 12px;
}
.assistance-service-card > label,
.assistance-other-field label {
  align-items: center;
  background: linear-gradient(90deg, #e7f7fb, #f8fcff);
  border: 1px solid #c5e8f3;
  border-left: 5px solid var(--btf-blue);
  border-radius: 8px;
  color: #0f3f5f;
  display: flex;
  font-size: 15px;
  font-weight: 900;
  line-height: 1.35;
  margin-bottom: 10px;
  min-height: 40px;
  padding: 9px 12px;
  width: 100%;
}
.assistance-service-card > label::before,
.assistance-other-field label::before {
  background: var(--btf-sky);
  border-radius: 999px;
  content: "";
  flex: 0 0 auto;
  height: 8px;
  margin-right: 8px;
  width: 8px;
}
.assistance-other-field {
  margin-top: 10px;
}
.assistance-food-card {
  align-items: center;
  display: flex;
}
.assistance-food-toggle {
  align-items: center;
  display: flex !important;
  gap: 8px;
  margin: 0 !important;
}
.assistance-food-toggle::before {
  content: none !important;
}
.field-block.field-muted label {
  color: #64748b;
}
.field-block.field-muted .form-control,
.field-block.field-muted .form-select,
.field-block.field-muted select {
  background-color: #f8fafc;
  border-color: #dbe5ee;
  color: #94a3b8;
}
.duplicate-suggestions {
  border: 1px solid #f59e0b;
  border-radius: 8px;
  background: #fffbeb;
  color: #78350f;
  padding: 12px;
}
.duplicate-suggestions > div:first-child {
  display: grid;
  gap: 2px;
  margin-bottom: 10px;
}
.duplicate-suggestions span,
.duplicate-suggestions small {
  color: #92400e;
}
.duplicate-results {
  display: grid;
  gap: 8px;
}
.duplicate-result {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid #fde68a;
  border-radius: 8px;
  background: #fff;
  padding: 10px;
}
.duplicate-result.cross-province {
  border-color: #38bdf8;
  background: #f0f9ff;
}
.duplicate-result strong,
.duplicate-result span,
.duplicate-result small {
  display: block;
}
.duplicate-badge {
  display: inline-flex !important;
  align-items: center;
  width: fit-content;
  margin-top: 4px;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 0.76rem;
  font-weight: 900;
}
.duplicate-badge.warning {
  background: #fee2e2;
  color: #b91c1c;
}
.duplicate-reasons {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}
.duplicate-reasons span {
  border: 1px solid #fde68a;
  border-radius: 999px;
  background: #fff7ed;
  color: #92400e;
  padding: 2px 8px;
  font-size: 0.78rem;
  font-weight: 800;
}
.duplicate-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}
.duplicate-note {
  max-width: 170px;
  border: 1px solid #bae6fd;
  border-radius: 8px;
  background: #e0f2fe;
  color: #075985 !important;
  padding: 6px 8px;
  font-size: 0.78rem;
  font-weight: 800;
  text-align: center;
}
.check-field {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  color: #334155;
  font-weight: 800;
}
.check-field label {
  display: inline;
  margin: 0;
}
.intake-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  align-items: center;
  background: rgba(248, 253, 255, 0.96);
  border-top: 1px solid var(--btf-line);
  bottom: 0;
  margin: 24px -22px -22px;
  padding: 14px 22px;
  position: sticky;
  z-index: 12;
}
.photo-mode {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.photo-mode .active {
  background: var(--btf-blue);
  border-color: var(--btf-blue);
  color: #fff;
}
.photo-control-row {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
}
.photo-primary-check {
  margin-left: auto;
}
.photo-file-hidden input[type="file"] {
  display: none;
}
.photo-file-hidden .errorlist {
  margin-top: 8px;
}
.intake-subsection {
  background: #fbfdfe;
  border: 1px solid #dbe8ec;
  border-radius: 8px;
  margin-top: 24px;
  padding: 16px;
}
.intake-subsection h3 {
  margin-bottom: 14px;
  color: #0f766e;
  font-weight: 800;
}
.intake-map {
  height: 340px;
  width: 100%;
  border: 1px solid #c7dde2;
  border-radius: 8px;
  margin: 10px 0 8px;
  background: #eef2f7;
  overflow: hidden;
}
.map-search {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  margin-top: 8px;
}
.map-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}
.map-fallback {
  display: grid;
  place-items: center;
  color: #64748b;
  font-weight: 700;
}
.collapsible-options {
  border: 1px solid #cfdee5;
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}
.collapsible-options summary {
  background: #f3fafb;
  cursor: pointer;
  color: #263b50;
  font-weight: 900;
  padding: 10px 12px;
}
.collapsible-options-body {
  border-top: 1px solid #dbe8ec;
  padding: 12px;
}
.collapsible-options .choice-list {
  margin: 0;
}

@media (max-width: 980px) {
  .intake-steps {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .intake-panel {
    padding: 16px;
  }
  .intake-steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .intake-actions {
    margin: 22px -16px -16px;
    padding: 12px 16px;
  }
}

.dashboard-shell {
  display: grid;
  gap: 16px;
}
.dashboard-header,
.panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.dashboard-header h1 {
  margin: 0;
  font-size: 32px;
  font-weight: 800;
}
.dashboard-header p,
.panel-heading p {
  margin: 4px 0 0;
  color: #64748b;
}
.dashboard-filters,
.metric-grid,
.chart-grid {
  display: grid;
  gap: 12px;
}
.dashboard-filters {
  grid-template-columns: repeat(4, minmax(160px, 1fr)) auto;
  align-items: end;
  background: #fff;
  border: 1px solid #dde3ea;
  border-radius: 8px;
  padding: 14px;
}
.filter-field label {
  color: #334155;
  font-size: 13px;
  font-weight: 800;
  margin-bottom: 4px;
}
.dashboard-reset {
  min-height: 38px;
  white-space: nowrap;
}
.metric-grid {
  grid-template-columns: repeat(5, minmax(150px, 1fr));
}
.metric-card,
.dashboard-map-panel,
.chart-panel {
  background: #fff;
  border: 1px solid #dde3ea;
  border-radius: 8px;
}
.metric-card {
  min-height: 112px;
  padding: 16px;
}
.metric-card span {
  display: block;
  color: #64748b;
  font-size: 13px;
  font-weight: 700;
}
.metric-card strong {
  display: block;
  margin-top: 8px;
  font-size: 34px;
  line-height: 1;
}
.metric-total strong {
  color: #0f766e;
}
.dashboard-map-panel {
  padding: 16px;
}
.panel-heading h2,
.chart-panel h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
}
.map-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px 14px;
  color: #475569;
  font-size: 13px;
  font-weight: 700;
}
.map-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
}
.dot-public {
  background: #2563eb;
}
.dot-rental {
  background: #d97706;
}
.dashboard-map {
  height: 430px;
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  margin-top: 14px;
  background: #eef2f7;
  overflow: hidden;
}
.dashboard-marker {
  display: grid;
  place-items: center;
}
.dashboard-marker span {
  display: block;
  width: 18px;
  height: 18px;
  border: 3px solid #fff;
  border-radius: 999px;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.35);
}
.chart-grid {
  grid-template-columns: repeat(2, minmax(260px, 1fr));
}
.chart-panel {
  padding: 16px;
}
.chart-bars {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}
.chart-row {
  display: grid;
  grid-template-columns: minmax(120px, 0.9fr) minmax(120px, 1.5fr) 44px;
  align-items: center;
  gap: 10px;
}
.chart-label {
  min-width: 0;
  overflow: hidden;
  color: #334155;
  font-size: 14px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chart-track {
  height: 13px;
  border-radius: 999px;
  background: #e5e7eb;
  overflow: hidden;
}
.chart-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
}
.chart-row strong {
  text-align: right;
}
.empty-state {
  margin: 0;
  color: #64748b;
}

.exec-dashboard {
  display: grid;
  gap: 16px;
}
.exec-header,
.exec-section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.exec-header h1 {
  margin: 0;
  font-size: 32px;
  font-weight: 800;
}
.exec-header p,
.exec-section-heading p {
  margin: 4px 0 0;
  color: #64748b;
}
.risk-legend,
.heat-legend,
.line-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px 14px;
  color: #475569;
  font-size: 13px;
  font-weight: 700;
}
.risk-legend span,
.heat-legend span,
.line-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.risk-dot,
.heat-dot,
.line-legend i {
  width: 12px;
  height: 12px;
  border-radius: 999px;
}
.risk-low,
.heat-low {
  background: #16a34a;
}
.risk-watch,
.heat-mid {
  background: #eab308;
}
.risk-high {
  background: #f97316;
}
.risk-critical,
.heat-hot {
  background: #dc2626;
}
.exec-kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(240px, 1fr));
  gap: 12px;
}
.exec-kpi-card,
.exec-filter-bar,
.exec-map-section,
.exec-panel {
  background: #fff;
  border: 1px solid #dde3ea;
  border-radius: 8px;
}
.exec-kpi-card {
  min-height: 190px;
  padding: 18px;
  border-top: 5px solid #16a34a;
}
.exec-kpi-card.kpi-rental {
  border-top-color: #eab308;
}
.exec-kpi-card.kpi-critical {
  border-top-color: #dc2626;
}
.kpi-title {
  color: #334155;
  font-size: 15px;
  font-weight: 800;
}
.kpi-total {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 12px 0;
}
.kpi-total strong {
  font-size: 48px;
  line-height: 1;
}
.kpi-total span {
  color: #64748b;
  font-weight: 700;
}
.kpi-mini-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.kpi-mini-grid div {
  min-height: 58px;
  border-radius: 8px;
  background: #f8fafc;
  padding: 8px 10px;
}
.kpi-mini-grid span {
  display: block;
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
}
.kpi-mini-grid strong {
  display: block;
  margin-top: 2px;
  font-size: 22px;
}
.exec-filter-bar {
  display: grid;
  grid-template-columns: repeat(5, minmax(150px, 1fr)) auto;
  align-items: end;
  gap: 12px;
  padding: 14px;
}
.exec-filter-bar label {
  color: #334155;
  font-size: 13px;
  font-weight: 800;
  margin-bottom: 4px;
}
.exec-map-section,
.exec-panel {
  padding: 16px;
}
.exec-section-heading h2,
.exec-panel h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
}
.exec-map {
  height: 460px;
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  margin-top: 14px;
  background: #eef2f7;
  overflow: hidden;
}
.exec-marker {
  display: grid;
  place-items: center;
}
.exec-marker span {
  align-items: center;
  color: #fff;
  display: flex;
  font-size: 10px;
  font-weight: 900;
  width: 18px;
  height: 18px;
  justify-content: center;
  line-height: 1;
  border: 3px solid #fff;
  border-radius: 999px;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.35);
}
.exec-marker-group span {
  align-items: center;
  color: #fff;
  display: flex;
  font-size: 13px;
  font-weight: 900;
  height: 30px;
  justify-content: center;
  width: 30px;
}
.exec-two-column,
.exec-chart-grid {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(280px, 1fr);
  gap: 16px;
}
.line-chart {
  margin-top: 12px;
}
.line-chart svg {
  width: 100%;
  height: 220px;
  border-radius: 8px;
  background: linear-gradient(#f8fafc 1px, transparent 1px) 0 0 / 100% 44px;
}
.line-legend {
  justify-content: flex-start;
  margin-top: 8px;
}
.risk-matrix {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}
.risk-cell {
  min-height: 116px;
  border-radius: 8px;
  color: #fff;
  padding: 14px;
}
.risk-cell span {
  display: block;
  font-weight: 800;
}
.risk-cell strong {
  display: block;
  margin-top: 12px;
  font-size: 38px;
  line-height: 1;
}
.donut-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 12px;
  margin-top: 14px;
}
.donut-card {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 10px;
  min-width: 0;
}
.donut {
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: #e5e7eb;
  position: relative;
}
.donut::after {
  content: "";
  position: absolute;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #fff;
}
.donut strong {
  position: relative;
  z-index: 1;
  font-size: 18px;
}
.donut-card h3,
.health-columns h3 {
  margin: 0 0 6px;
  font-size: 14px;
  font-weight: 800;
}
.donut-card h3,
.donut-card li {
  min-width: 0;
  overflow-wrap: anywhere;
}
.donut-card ul {
  display: grid;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
  color: #475569;
  font-size: 12px;
}
.donut-card li {
  display: flex;
  align-items: center;
  gap: 6px;
}
.donut-card li i {
  width: 9px;
  height: 9px;
  border-radius: 999px;
}
.exec-bars,
.progress-list,
.funnel {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}
.exec-bar-row {
  display: grid;
  grid-template-columns: minmax(120px, 0.9fr) minmax(140px, 1.4fr) 44px;
  align-items: center;
  gap: 10px;
}
.exec-bar-row span {
  min-width: 0;
  overflow: hidden;
  color: #334155;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.exec-bar-row div,
.progress-row p {
  height: 13px;
  border-radius: 999px;
  background: #e5e7eb;
  overflow: hidden;
}
.exec-bar-row i,
.progress-row i {
  display: block;
  height: 100%;
  border-radius: inherit;
}
.exec-bar-row strong {
  text-align: right;
}
.health-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  gap: 14px;
  margin-top: 14px;
}
.health-group-card {
  border: 1px solid #dbe4ef;
  border-radius: 8px;
  padding: 12px;
}
.health-group-card h3 {
  border-radius: 6px;
  color: #fff;
  display: inline-flex;
  margin-bottom: 10px;
  padding: 6px 10px;
}
.health-public-card {
  background: #eff6ff;
  border-color: #93c5fd;
}
.health-public-card h3 {
  background: #2563eb;
}
.health-rental-card {
  background: #fff7ed;
  border-color: #fdba74;
}
.health-rental-card h3 {
  background: #f97316;
}
.progress-row div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: #334155;
  font-weight: 700;
}
.progress-row p {
  margin: 5px 0 0;
}
.funnel {
  justify-items: center;
}
.funnel-row {
  display: flex;
  justify-content: space-between;
  min-height: 38px;
  border-radius: 8px;
  background: #0f766e;
  color: #fff;
  font-weight: 800;
  padding: 8px 12px;
}
.funnel-row:nth-child(2) {
  background: #2563eb;
}
.funnel-row:nth-child(3) {
  background: #eab308;
  color: #1f2933;
}
.funnel-row:nth-child(4) {
  background: #f97316;
}
.funnel-row:nth-child(5) {
  background: #dc2626;
}
.network-diagram {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 220px;
  margin-top: 14px;
}
.network-diagram span {
  display: inline-grid;
  place-items: center;
  min-width: 92px;
  min-height: 42px;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  background: #f8fafc;
  color: #334155;
  font-weight: 800;
  padding: 8px 12px;
}
.network-diagram .network-center {
  min-width: 124px;
  min-height: 60px;
  background: #0f766e;
  color: #fff;
}
.case-table-wrap {
  margin-top: 14px;
  overflow-x: auto;
}
.case-table th {
  color: #475569;
  font-size: 13px;
}
.case-risk {
  display: inline-flex;
  min-width: 64px;
  justify-content: center;
  border-radius: 999px;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  padding: 4px 8px;
}
@media (max-width: 640px) {
  .intake-header,
  .intake-actions {
    flex-direction: column;
  }
  .intake-header .btn,
  .intake-actions .btn {
    width: 100%;
  }
  .intake-steps,
  .form-grid {
    grid-template-columns: 1fr;
  }
  .intake-two-column-row {
    grid-template-columns: 1fr;
  }
  .health-body-row {
    grid-template-columns: 1fr;
  }
  .map-search {
    grid-template-columns: 1fr;
  }
  .dashboard-header,
  .panel-heading {
    flex-direction: column;
  }
  .dashboard-header .btn {
    width: 100%;
  }
  .dashboard-filters,
  .metric-grid,
  .chart-grid {
    grid-template-columns: 1fr;
  }
  .dashboard-map {
    height: 360px;
  }
  .chart-row {
    grid-template-columns: 1fr 52px;
  }
  .chart-track {
    grid-column: 1 / -1;
    order: 3;
  }
  .exec-header,
  .exec-section-heading {
    flex-direction: column;
  }
  .exec-kpi-grid,
  .exec-filter-bar,
  .exec-two-column,
  .exec-chart-grid,
  .donut-grid,
  .health-columns,
  .risk-matrix {
    grid-template-columns: 1fr;
  }
  .exec-filter-bar .btn {
    width: 100%;
  }
  .exec-map {
    height: 360px;
  }
  .exec-bar-row {
    grid-template-columns: 1fr 44px;
  }
  .exec-bar-row div {
    grid-column: 1 / -1;
    order: 3;
  }
}

.province-dashboard {
  display: grid;
  grid-template-columns: 188px minmax(1040px, 1fr);
  min-height: calc(100vh - 76px);
  min-width: 1228px;
  margin: 0;
  background: var(--btf-soft-2);
}
.province-sidebar {
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 14px;
  background: linear-gradient(180deg, #ffffff 0%, #f3fbfe 100%);
  border-right: 1px solid var(--btf-line);
  padding: 18px 10px 14px;
}
.province-menu-title { color: var(--btf-ink); font-weight: 900; }
.province-sidebar nav {
  align-content: start;
  display: grid;
  gap: 4px;
}
.province-sidebar a {
  border-radius: 8px;
  color: #315d76;
  font-weight: 800;
  line-height: 1.2;
  padding: 9px 10px;
  text-decoration: none;
  white-space: nowrap;
}
.province-sidebar a.active,
.province-sidebar a:hover { background: var(--btf-soft); color: var(--btf-deep); }
.province-sidebar a.active {
  background: linear-gradient(135deg, var(--btf-blue), var(--btf-deep));
  color: #fff;
  box-shadow: 0 8px 18px rgba(43, 143, 189, 0.16);
}
.province-sidebar-note {
  border: 1px solid var(--btf-line);
  border-radius: 8px;
  background: var(--btf-soft);
  color: var(--btf-deep);
  display: grid;
  gap: 6px;
  font-size: 12px;
  padding: 14px;
}
.province-main { display: grid; gap: 14px; min-width: 0; padding: 22px 24px; }
.province-header,
.province-filters,
.panel-head { align-items: center; display: flex; justify-content: space-between; gap: 14px; }
.province-header h1 { color: var(--btf-ink); font-size: 26px; font-weight: 900; margin: 0; }
.province-header p { color: #64748b; margin: 4px 0 0; }
.province-updated { color: #475569; display: grid; font-size: 12px; text-align: right; }
.province-updated strong { color: #0f172a; }
.province-filters { display: grid; grid-template-columns: minmax(240px, 1.35fr) minmax(310px, 1.45fr) repeat(4, minmax(150px, 1fr)) auto; }
.province-filters label { color: #334155; font-size: 12px; font-weight: 900; margin-bottom: 3px; }
.province-filters > div { min-width: 0; }
.province-filters .date-filter { min-width: 0; }
.dashboard-search-filter .form-control { min-height: 38px; }
.dashboard-filter-summary {
  align-self: end;
  color: #64748b;
  font-size: 12px;
  font-weight: 900;
  grid-column: 1 / -1;
  margin: -4px 0 0;
}
.date-range { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.date-range .form-control { min-height: 38px; }
.dashboard-refresh {
  align-self: end;
  border: 1px solid var(--btf-line);
  border-radius: 8px;
  background: #fff;
  color: var(--btf-deep);
  font-weight: 900;
  min-height: 38px;
  padding: 0 14px;
}
.province-kpis { display: grid; grid-template-columns: repeat(7, minmax(130px, 1fr)); gap: 12px; }
.province-kpi,
.province-panel {
  background: #fff;
  border: 1px solid var(--btf-line);
  border-radius: 8px;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.05);
}
.province-kpi { display: grid; min-height: 106px; padding: 16px; }
.province-kpi span { color: #0f172a; font-weight: 900; }
.province-kpi strong { font-size: 34px; line-height: 1; margin-top: 6px; }
.province-kpi small { color: #64748b; font-weight: 700; }
.province-kpi.teal { border-color: #9fd7e8; color: var(--btf-blue); }
.province-kpi.blue { border-color: #bfdbfe; color: #2f80ed; }
.province-kpi.red { border-color: #fecaca; color: #ef4444; }
.province-kpi.amber { border-color: #fed7aa; color: var(--btf-orange); }
.province-kpi.rose { border-color: #fecdd3; color: #e11d48; }
.province-kpi.green { border-color: #bbf7d0; color: #16a34a; }
.province-kpi.violet { border-color: #ddd6fe; color: #7c3aed; }
.survey-insight-grid { display: grid; grid-template-columns: minmax(520px, 1.35fr) minmax(360px, 0.95fr); gap: 14px; }
.survey-panel { background: linear-gradient(180deg, #ffffff 0%, #f8fbfc 100%); }
.mini-dashboard-grid { display: grid; grid-template-columns: 180px minmax(0, 1fr) minmax(0, 1fr); gap: 16px; margin-top: 16px; }
.survey-donut-card,
.survey-bars-card { min-width: 0; }
.survey-donut-card h3,
.survey-bars-card h3 { color: #334155; font-size: 14px; font-weight: 900; margin: 0 0 10px; }
.survey-donut { display: grid; justify-items: center; }
.survey-legend { display: grid; gap: 6px; margin-top: 10px; }
.survey-legend span { align-items: center; color: #334155; display: flex; gap: 7px; font-size: 12px; font-weight: 800; }
.survey-legend i { border-radius: 999px; flex: 0 0 auto; height: 9px; width: 9px; }
.survey-legend small { color: #64748b; font-weight: 800; margin-left: auto; }
.compact-bars { display: grid; gap: 8px; }
.compact-bar { align-items: center; display: grid; grid-template-columns: minmax(76px, 0.85fr) minmax(90px, 1.2fr) 36px; gap: 8px; }
.compact-bar span { color: #334155; font-size: 12px; font-weight: 900; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.compact-bar p { background: #e8eef4; border-radius: 999px; height: 10px; margin: 0; overflow: hidden; }
.compact-bar i { border-radius: inherit; display: block; height: 100%; }
.compact-bar strong { color: #0f172a; font-size: 13px; text-align: right; }
.survey-summary-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 14px 0; }
.survey-summary-row div { background: #f1f7f8; border: 1px solid #d9eaec; border-radius: 8px; display: grid; gap: 4px; padding: 10px; }
.survey-summary-row span { color: #475569; font-size: 12px; font-weight: 900; }
.survey-summary-row strong { color: #0f766e; font-size: 24px; line-height: 1; }
.province-grid { display: grid; gap: 14px; }
.province-grid.top { grid-template-columns: minmax(280px, 0.82fr) minmax(420px, 1.18fr); }
.province-grid.middle { grid-template-columns: minmax(0, 1fr) minmax(0, 0.9fr); }
.province-grid.bottom { grid-template-columns: minmax(420px, 1.5fr) minmax(240px, 0.6fr) minmax(280px, 0.7fr); }
.province-panel { min-width: 0; padding: 16px; }
.province-panel h2 { font-size: 18px; font-weight: 900; margin: 0; }
.trend-controls { display: grid; grid-template-columns: minmax(100px, 1fr) minmax(86px, 0.8fr); gap: 8px; }
.province-line-chart svg {
  background: linear-gradient(#eef2f7 1px, transparent 1px) 0 0 / 100% 46px;
  border-radius: 8px;
  height: 218px;
  width: 100%;
}
.province-legend { display: flex; gap: 22px; justify-content: center; color: #475569; font-weight: 800; }
.province-legend span { align-items: center; display: inline-flex; gap: 8px; }
.province-legend i { border-radius: 999px; height: 8px; width: 22px; }
.pipeline { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 0; margin-top: 14px; overflow: hidden; }
.pipeline-step {
  color: #fff;
  display: grid;
  gap: 2px;
  min-height: 96px;
  padding: 12px 8px 12px 18px;
  place-items: center;
  text-align: center;
  clip-path: polygon(0 0, calc(100% - 16px) 0, 100% 50%, calc(100% - 16px) 100%, 0 100%, 16px 50%);
}
.pipeline-step:first-child {
  border-radius: 8px 0 0 8px;
  clip-path: polygon(0 0, calc(100% - 16px) 0, 100% 50%, calc(100% - 16px) 100%, 0 100%);
  padding-left: 10px;
}
.pipeline-step:last-child { border-radius: 0 8px 8px 0; }
.pipeline-step span { font-size: 11px; font-weight: 900; line-height: 1.2; }
.pipeline-step strong { font-size: 20px; line-height: 1; }
.pipeline-step small { font-weight: 900; }
.pipeline-rate { color: #475569; font-weight: 800; margin: 12px 0 0; text-align: center; }
.dashboard-year-help-grid { grid-template-columns: 1fr; }
.assistance-plan-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.assistance-service-grid { grid-template-columns: minmax(360px, 0.85fr) minmax(420px, 1.15fr); }
.dashboard-year-only-grid { grid-template-columns: 1fr; }
.assistance-main .health-kpis { grid-template-columns: repeat(5, minmax(150px, 1fr)); }
.assistance-main .horizontal-bars + .horizontal-bars { margin-top: 16px; }
.annual-encounter-chart,
.assistance-summary {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}
.annual-row {
  align-items: start;
  background: #f8fafc;
  border: 1px solid #dce7ee;
  border-radius: 8px;
  display: grid;
  gap: 10px;
  grid-template-columns: 74px minmax(0, 1fr);
  padding: 12px;
}
.annual-row > strong {
  color: #0f172a;
  font-size: 20px;
  line-height: 1;
}
.annual-bars {
  display: grid;
  gap: 8px;
  min-width: 0;
}
.annual-bar {
  align-items: center;
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(104px, 0.85fr) minmax(120px, 1.35fr) 34px;
}
.annual-bar span,
.assistance-item span {
  color: #334155;
  font-size: 12px;
  font-weight: 900;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.annual-bar p,
.assistance-item p {
  background: #e8eef4;
  border-radius: 999px;
  height: 12px;
  margin: 0;
  min-width: 0;
  overflow: hidden;
}
.annual-bar i,
.assistance-item i {
  border-radius: inherit;
  display: block;
  height: 100%;
}
.annual-bar b,
.assistance-item strong {
  color: #0f172a;
  font-size: 13px;
  text-align: right;
}
.assistance-stat-row {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.assistance-stat-row div {
  background: #f8fafc;
  border: 1px solid #dce7ee;
  border-radius: 8px;
  display: grid;
  gap: 4px;
  padding: 10px;
}
.assistance-stat-row span {
  color: #475569;
  font-size: 12px;
  font-weight: 900;
}
.assistance-stat-row strong {
  font-size: 24px;
  line-height: 1;
}
.assistance-breakdown {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(260px, 1fr));
}
.assistance-breakdown section {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 10px;
}
.assistance-breakdown h3 {
  color: #0f172a;
  font-size: 13px;
  font-weight: 900;
  margin: 0;
}
.assistance-item {
  align-items: center;
  display: grid;
  gap: 7px;
  grid-template-columns: minmax(160px, 0.95fr) minmax(120px, 1.1fr) 34px;
}
.geo-map-panel { grid-column: auto; }
.geo-map-head p { color: #64748b; font-weight: 700; margin: 4px 0 0; }
.geo-map-legend { align-items: center; display: flex; gap: 16px; color: #334155; font-size: 13px; font-weight: 900; }
.geo-map-legend span { align-items: center; display: inline-flex; gap: 6px; white-space: nowrap; }
.geo-map-legend i { border-radius: 999px; display: inline-block; height: 12px; width: 12px; }
.geo-map-legend .low { background: #16a34a; }
.geo-map-legend .medium { background: #eab308; }
.geo-map-legend .high { background: #f97316; }
.geo-map-legend .critical { background: #dc2626; }
.geo-map-head { align-items: center; }
.geo-map-summary { color: #475569; font-size: 13px; font-weight: 900; margin-left: auto; white-space: nowrap; }
.map-filter-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(160px, 1fr));
  gap: 10px;
  margin-top: 12px;
}
.map-filter-row label {
  color: #334155;
  font-size: 12px;
  font-weight: 900;
  margin-bottom: 3px;
}
.area-dashboard { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 12px; margin-top: 12px; }
.area-dashboard.geographic-map { grid-template-columns: 1fr; }
.area-stats { display: grid; align-content: start; gap: 8px; }
.area-stats div,
.rental-cards div { border: 1px solid #dbeafe; border-radius: 8px; background: #f8fafc; padding: 10px; }
.area-stats span,
.rental-cards span { color: #64748b; display: block; font-size: 12px; font-weight: 800; }
.area-stats strong,
.rental-cards strong { color: #0f172a; font-size: 24px; }
.province-map { height: 240px; border-radius: 8px; overflow: hidden; background: #e2e8f0; }
.geographic-map .province-map { height: 180px; }
.area-map-main { min-height: calc(100vh - 74px); }
.area-map-panel { min-height: calc(100vh - 170px); }
.area-map-toolbar {
  grid-template-columns: minmax(310px, 1.4fr) repeat(2, minmax(170px, 1fr)) auto;
  margin-bottom: 14px;
}
.area-map-large { margin-top: 14px; }
.area-map-large .province-map {
  height: min(600px, calc(100vh - 370px));
  min-height: 420px;
}
.area-map-filters { grid-template-columns: repeat(3, minmax(180px, 1fr)); }
.map-person-popup {
  color: var(--btf-ink);
  display: grid;
  gap: 10px;
  min-width: 218px;
}
.map-popup-head {
  align-items: center;
  display: grid;
  gap: 10px;
  grid-template-columns: 58px minmax(0, 1fr);
}
.map-popup-head strong {
  display: block;
  font-size: 15px;
  font-weight: 900;
  line-height: 1.25;
}
.map-popup-head span {
  color: #64748b;
  display: block;
  font-size: 12px;
  font-weight: 800;
  margin-top: 2px;
}
.map-popup-photo,
.map-popup-photo-empty {
  align-items: center;
  background: #eaf8fc;
  border: 1px solid #c8e5ee;
  border-radius: 8px;
  display: flex;
  height: 58px;
  justify-content: center;
  overflow: hidden;
  width: 58px;
}
.map-popup-photo img {
  height: 100%;
  object-fit: cover;
  width: 100%;
}
.map-popup-photo-empty {
  color: var(--btf-deep);
  font-size: 18px;
  font-weight: 900;
}
.map-person-popup dl {
  display: grid;
  gap: 5px;
  margin: 0;
}
.map-person-popup dl div {
  display: grid;
  gap: 8px;
  grid-template-columns: 42px minmax(0, 1fr);
}
.map-person-popup dt {
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
}
.map-person-popup dd {
  font-weight: 800;
  margin: 0;
}
.map-popup-link {
  align-items: center;
  background: var(--btf-blue);
  border-radius: 6px;
  color: #fff;
  display: inline-flex;
  font-weight: 900;
  justify-content: center;
  min-height: 32px;
  padding: 6px 10px;
  text-decoration: none;
}
.map-popup-link:hover {
  background: var(--btf-deep);
  color: #fff;
}
.map-group-popup {
  color: var(--btf-ink);
  display: grid;
  gap: 10px;
  min-width: 260px;
}
.map-group-popup header {
  border-bottom: 1px solid #dbe8ec;
  display: grid;
  gap: 2px;
  padding-bottom: 8px;
}
.map-group-popup header strong {
  font-size: 15px;
  font-weight: 900;
}
.map-group-popup header span {
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
}
.map-group-list {
  display: grid;
  gap: 8px;
  max-height: 280px;
  overflow: auto;
}
.map-group-person {
  align-items: center;
  border: 1px solid #dbe8ec;
  border-radius: 8px;
  color: var(--btf-ink);
  display: grid;
  gap: 9px;
  grid-template-columns: 48px minmax(0, 1fr);
  padding: 7px;
  text-decoration: none;
}
.map-group-person:hover {
  background: #f4fbfd;
  color: var(--btf-deep);
}
.map-group-person .map-popup-photo,
.map-group-person .map-popup-photo-empty {
  height: 48px;
  width: 48px;
}
.map-group-person strong,
.map-group-person small {
  display: block;
}
.map-group-person strong {
  font-size: 14px;
  font-weight: 900;
  line-height: 1.25;
}
.map-group-person small {
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
  margin-top: 2px;
}
.health-summary-main { min-height: calc(100vh - 74px); }
.health-summary-filters {
  grid-template-columns: minmax(310px, 1.4fr) repeat(3, minmax(160px, 1fr)) auto;
}
.health-kpis {
  display: grid;
  grid-template-columns: repeat(5, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}
.health-kpi {
  background: #fff;
  border: 1px solid #dce7ee;
  border-radius: 8px;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.05);
  display: grid;
  min-height: 108px;
  padding: 16px;
}
.health-kpi span { color: #0f172a; font-weight: 900; }
.health-kpi strong { font-size: 34px; line-height: 1; margin-top: 6px; }
.health-kpi small { color: #64748b; font-weight: 700; }
.health-kpi.teal { border-color: #99e5df; color: #0f9f9a; }
.health-kpi.orange { border-color: #fed7aa; color: #f97316; }
.health-kpi.red { border-color: #fecaca; color: #ef4444; }
.health-kpi.blue { border-color: #bfdbfe; color: #2f80ed; }
.health-kpi.green { border-color: #bbf7d0; color: #16a34a; }
.health-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 14px;
}
.panel-note { color: #64748b; font-size: 12px; font-weight: 800; }
.health-bars .horizontal-bar { grid-template-columns: minmax(120px, 0.9fr) minmax(160px, 1.4fr) 44px; }
.health-follow-panel { margin-bottom: 18px; }
.occupation-main { min-height: calc(100vh - 74px); }
.occupation-filters {
  grid-template-columns: minmax(310px, 1.4fr) repeat(3, minmax(160px, 1fr)) auto;
}
.occupation-kpis { margin-bottom: 14px; }
.occupation-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 14px;
}
.occupation-table-panel { margin-bottom: 18px; }
.rights-main { min-height: calc(100vh - 74px); }
.rights-filters {
  grid-template-columns: minmax(310px, 1.4fr) repeat(3, minmax(160px, 1fr)) auto;
}
.rights-kpis { margin-bottom: 14px; }
.rights-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 14px;
}
.rights-table-panel { margin-bottom: 18px; }
.report-main { min-height: calc(100vh - 74px); }
.report-filters {
  grid-template-columns: minmax(310px, 1.4fr) repeat(3, minmax(160px, 1fr)) auto;
}
.report-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(170px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}
.report-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.report-card {
  display: grid;
  gap: 12px;
  align-content: start;
}
.report-card h2 { font-size: 18px; font-weight: 900; margin: 0; }
.report-card p { color: #64748b; font-weight: 700; margin: 0; }
.report-preview {
  display: grid;
  gap: 8px;
}
.report-preview div,
.report-links a {
  align-items: center;
  background: #f8fafc;
  border: 1px solid #dce7ee;
  border-radius: 8px;
  color: #0f172a;
  display: flex;
  justify-content: space-between;
  padding: 10px 12px;
  text-decoration: none;
}
.report-preview span { color: #475569; font-weight: 800; }
.report-preview strong { color: #0f766e; }
.report-links,
.report-export-actions {
  display: grid;
  gap: 8px;
}
.report-links.compact {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.report-export-actions {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.report-mode-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 14px;
}
.report-mode-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 0.85fr);
  gap: 14px;
  align-items: start;
}
.report-mode-card span {
  color: #0f766e;
  font-size: 13px;
  font-weight: 900;
}
.report-mode-card h2 {
  margin: 4px 0 6px;
  color: #0f172a;
  font-size: 20px;
  font-weight: 950;
}
.report-mode-card p {
  margin: 0;
  color: #64748b;
  font-weight: 750;
}
.horizontal-bars,
.referral-bars { display: grid; gap: 10px; margin-top: 14px; }
.horizontal-bar { display: grid; grid-template-columns: minmax(96px, 0.8fr) minmax(140px, 1.4fr) 44px; gap: 10px; align-items: center; }
.horizontal-bar span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 800; }
.horizontal-bar p { background: #edf2f7; border-radius: 999px; height: 14px; margin: 0; overflow: hidden; }
.horizontal-bar i { display: block; height: 100%; border-radius: inherit; }
.dashboard-income-panel { overflow: hidden; }
.dashboard-income-panel .referral-bars { min-width: 0; }
.dashboard-income-panel .horizontal-bar {
  grid-template-columns: minmax(0, 88px) minmax(0, 1fr) 28px;
  gap: 8px;
  min-width: 0;
}
.dashboard-income-panel .horizontal-bar span {
  font-size: 13px;
  max-width: 100%;
}
.dashboard-income-panel .horizontal-bar p {
  min-width: 0;
}
.dashboard-income-panel .horizontal-bar strong {
  min-width: 24px;
  text-align: right;
}
.urgent-table { margin: 10px 0 0; }
.urgent-table th { color: #64748b; font-size: 12px; }
.tag-soft,
.status-pill { border-radius: 999px; display: inline-flex; font-size: 12px; font-weight: 900; padding: 4px 8px; }
.tag-soft { background: #e0f2fe; color: #0369a1; }
.status-pill.warn { background: #ffedd5; color: #c2410c; }
.status-pill.danger { background: #fee2e2; color: #dc2626; }
.rental-summary { align-items: center; display: grid; grid-template-columns: 126px minmax(0, 1fr); gap: 16px; margin-top: 14px; }
.large-donut { display: grid; justify-items: center; gap: 8px; }
.donut.big { width: 118px; height: 118px; background: conic-gradient(#0f9f9a 0 62%, #bbf7d0 62% 84%, #fecaca 84% 100%); }
.donut.big::after { width: 68px; height: 68px; }
.rental-cards { display: grid; gap: 8px; }
.rental-cards div {
  border: 1px solid #dce7ee;
  border-left: 4px solid #0f9f9a;
  border-radius: 8px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
}
.rental-cards span { color: #475569; font-weight: 900; }
.rental-cards strong { color: #0f172a; font-size: 18px; }
.survey-rights-cards { margin-top: 14px; }
.empty-state { color: #64748b; margin: 0; }

.directory-dashboard { background: #f5f9fc; }
.directory-main { background: #f5f9fc; }
.directory-toolbar {
  align-items: end;
  margin-bottom: 0;
}
.directory-toolbar h1 {
  color: #0f172a;
  font-size: 28px;
  font-weight: 900;
  margin: 0;
}
.directory-toolbar p {
  color: #64748b;
  margin: 4px 0 0;
}
.directory-quick-search {
  align-items: center;
  display: grid;
  grid-template-columns: 260px auto;
  gap: 8px;
}
.directory-quick-search .form-control,
.directory-quick-search .btn {
  min-height: 34px;
}
.directory-page-filters {
  align-items: end;
  background: transparent;
  border: 0;
  border-radius: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(170px, 220px)) auto 1fr;
  gap: 12px;
  min-width: 0;
  padding: 4px 0 2px;
}
.directory-page-filters > div {
  min-width: 0;
}
.directory-page-filters label {
  color: #334155;
  font-size: 12px;
  font-weight: 900;
  margin-bottom: 4px;
}
.directory-clear-filter {
  border: 1px solid #b9d9d7;
  border-radius: 8px;
  color: #0f766e !important;
  display: inline-flex;
  font-size: 13px;
  font-weight: 900;
  justify-content: center;
  min-height: 38px;
  padding: 9px 12px !important;
  text-align: center;
  text-decoration: none;
}
.directory-result-line {
  color: #64748b;
  font-weight: 900;
  margin-top: 0;
}
.directory-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 18px 24px;
}
.directory-card {
  align-items: center;
  display: flex;
  flex-direction: column;
  gap: 0;
}
.directory-card-deceased {
  opacity: 0.86;
}
.directory-card-deceased .directory-photo-link img,
.directory-card-deceased .directory-photo-empty {
  filter: grayscale(1);
}
.directory-photo-link {
  display: block;
  margin-bottom: 6px;
  width: 100%;
}
.directory-photo-link img,
.directory-photo-empty {
  aspect-ratio: 4 / 3;
  background: #e2e8f0;
  border: 1px solid #dce7ee;
  display: grid;
  object-fit: cover;
  place-items: center;
  width: 100%;
}
.directory-photo-link img {
  display: block;
  object-position: center 18%;
}
.directory-photo-empty {
  color: #64748b;
  font-size: 32px;
  font-weight: 900;
}
.directory-name {
  color: #2563eb;
  font-size: 13px;
  font-weight: 900;
  line-height: 1.25;
  margin: 0;
  text-align: center;
  text-decoration: none;
}
.directory-name:hover {
  text-decoration: underline;
}
.directory-status-row {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  justify-content: center;
  margin-top: 3px;
}
.directory-status-badge {
  border-radius: 999px;
  display: inline-flex;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
  padding: 5px 8px;
}
.directory-status-badge.deceased {
  background: #0f172a;
  color: #ffffff;
}
.directory-status-badge.tracking {
  background: #e0f2fe;
  color: #075985;
}
.directory-empty {
  background: #fff;
  border: 1px solid #dce7ee;
  border-radius: 8px;
  color: #64748b;
  font-weight: 800;
  grid-column: 1 / -1;
  padding: 28px;
  text-align: center;
}

@media (max-width: 1180px) {
  .directory-dashboard {
    grid-template-columns: 1fr;
  }
  .directory-dashboard .province-sidebar {
    display: none;
  }
  .directory-main {
    padding: 18px;
  }
  .directory-toolbar {
    align-items: stretch;
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .directory-page-filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  .directory-clear-filter {
    align-self: end;
  }
  .directory-quick-search {
    grid-template-columns: minmax(0, 1fr) auto;
    max-width: 100%;
  }
  .directory-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 22px 18px;
  }
  .directory-photo-link {
    max-width: 100%;
  }
}

@media (max-width: 860px) {
  .directory-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .province-dashboard { grid-template-columns: 1fr; margin: -16px; }
  .province-sidebar { display: none; }
  .province-kpis { grid-template-columns: repeat(3, minmax(160px, 1fr)); }
  .directory-quick-search,
  .directory-page-filters,
  .collection-field-row,
  .survey-insight-grid,
  .mini-dashboard-grid,
  .survey-summary-row,
  .province-grid.top,
  .province-grid.middle,
  .province-grid.bottom,
  .dashboard-year-only-grid,
  .dashboard-year-help-grid,
  .assistance-stat-row,
  .assistance-breakdown { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .province-main { padding: 16px; }
  .province-header,
  .panel-head { align-items: flex-start; flex-direction: column; }
  .province-filters,
  .province-kpis,
  .survey-insight-grid,
  .mini-dashboard-grid,
  .survey-summary-row,
  .area-dashboard,
  .rental-summary,
  .dashboard-year-only-grid,
  .dashboard-year-help-grid,
  .assistance-stat-row,
  .assistance-breakdown { grid-template-columns: 1fr; }
  .pipeline { grid-template-columns: 1fr; }
  .pipeline-step,
  .pipeline-step:first-child { clip-path: none; border-radius: 8px; }
}

@media (max-width: 760px) {
  .page-shell:has(.province-dashboard) {
    overflow-x: hidden;
    padding: 0;
  }
  .province-dashboard {
    display: block;
    margin: 0;
    min-height: auto;
    min-width: 0;
    width: 100%;
  }
  .province-sidebar {
    border-bottom: 1px solid #dbe8ee;
    border-right: 0;
    display: block;
    overflow-x: auto;
    padding: 10px 12px;
    position: sticky;
    top: 57px;
    z-index: 20;
  }
  .province-menu-title,
  .province-sidebar-note {
    display: none;
  }
  .province-sidebar nav {
    display: flex;
    gap: 8px;
    min-width: max-content;
  }
  .province-sidebar a {
    background: #f8fafc;
    border: 1px solid #dbe8ee;
    flex: 0 0 auto;
    padding: 8px 11px;
  }
  .province-main {
    gap: 12px;
    padding: 14px 12px 20px;
  }
  .province-header {
    align-items: flex-start;
    gap: 8px;
  }
  .province-header h1 {
    font-size: 22px;
    line-height: 1.25;
  }
  .province-header p {
    font-size: 13px;
  }
  .province-updated {
    text-align: left;
  }
  .province-filters,
  .health-summary-filters,
  .occupation-filters,
  .report-filters,
  .area-map-toolbar {
    display: grid;
    gap: 10px;
    grid-template-columns: 1fr;
  }
  .date-range {
    grid-template-columns: 1fr;
  }
  .dashboard-refresh {
    width: 100%;
  }
  .province-kpis,
  .health-kpis,
  .occupation-kpis,
  .assistance-kpis,
  .rights-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .province-kpi {
    min-height: 96px;
    padding: 12px;
  }
  .province-kpi strong {
    font-size: 30px;
  }
  .province-panel {
    padding: 14px;
  }
  .survey-insight-grid,
  .mini-dashboard-grid,
  .survey-summary-row,
  .province-grid.top,
  .province-grid.middle,
  .province-grid.bottom,
  .dashboard-year-only-grid,
  .dashboard-year-help-grid,
  .assistance-plan-grid,
  .health-grid,
  .occupation-grid,
  .rights-grid,
  .report-mode-grid,
  .report-grid,
  .report-summary,
  .area-map-filters {
    grid-template-columns: 1fr;
  }
  .panel-head {
    align-items: flex-start;
    gap: 8px;
  }
  .trend-controls {
    grid-template-columns: 1fr 1fr;
    width: 100%;
  }
  .province-line-chart svg {
    height: 190px;
  }
  .province-legend {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }
  .compact-bar,
  .horizontal-bar,
  .annual-bar,
  .assistance-item,
  .dashboard-income-panel .horizontal-bar {
    grid-template-columns: minmax(0, 88px) minmax(0, 1fr) 30px;
  }
  .annual-row {
    grid-template-columns: 1fr;
  }
  .assistance-stat-row,
  .assistance-breakdown {
    grid-template-columns: 1fr;
  }
  .pipeline {
    grid-template-columns: 1fr;
    gap: 8px;
    overflow: visible;
  }
  .pipeline-step,
  .pipeline-step:first-child,
  .pipeline-step:last-child {
    border-radius: 8px;
    clip-path: none;
    margin: 0;
  }
  .urgent-panel .table-responsive {
    overflow-x: auto;
  }
  .province-map,
  .geographic-map .province-map {
    height: 360px;
  }
  .health-summary-main,
  .report-main {
    min-width: 0;
    overflow-x: hidden;
  }
  .health-kpi {
    min-width: 0;
    padding: 12px;
  }
  .health-kpi span,
  .health-kpi small {
    min-width: 0;
    overflow-wrap: anywhere;
  }
  .health-kpi strong {
    font-size: 30px;
  }
  .health-bars .horizontal-bar,
  .report-preview div,
  .report-links a {
    min-width: 0;
  }
  .health-bars .horizontal-bar {
    grid-template-columns: minmax(0, 92px) minmax(0, 1fr) 30px;
  }
  .report-card {
    min-width: 0;
  }
  .report-mode-card {
    grid-template-columns: 1fr;
  }
  .report-links.compact {
    grid-template-columns: 1fr;
  }
  .report-card p,
  .report-preview span,
  .report-links a {
    overflow-wrap: anywhere;
  }
  .report-preview div {
    gap: 10px;
  }
  .report-preview span {
    min-width: 0;
  }
  .report-preview strong {
    flex: 0 0 auto;
  }
  .report-export-actions {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 420px) {
  .province-kpis,
  .health-kpis,
  .occupation-kpis,
  .rights-kpis,
  .report-summary {
    grid-template-columns: 1fr;
  }
}

/* Ban Thor Fun platform theme */
.page-shell,
.page-shell:has(.province-dashboard),
.page-shell:has(.intake-panel) {
  background:
    radial-gradient(circle at 8% 0%, rgba(50, 169, 217, 0.08), transparent 28%),
    linear-gradient(180deg, #f4fbfd 0%, #eef7fb 100%);
}
.panel,
.stat,
.intake-panel,
.province-panel,
.exec-kpi-card,
.exec-filter-bar,
.exec-map-section,
.exec-panel,
.health-kpi,
.report-preview div,
.report-links a,
.directory-empty {
  border-color: var(--btf-line);
  box-shadow: 0 8px 24px rgba(31, 111, 151, 0.06);
}
.panel h1,
.panel h2,
.panel h3,
.province-header h1,
.panel-head h2,
.exec-header h1,
.exec-section-heading h2,
.intake-header h1,
.intake-step-page > h2,
.report-card h2 {
  color: var(--btf-ink);
}
.province-sidebar,
.page-shell:has(.province-dashboard) .province-sidebar {
  background: linear-gradient(180deg, #ffffff 0%, #f2fbfe 100%);
  border-color: var(--btf-line);
}
.province-sidebar a,
.directory-page-filters label,
.province-filters label,
.map-filter-row label {
  color: #315d76;
}
.province-sidebar a.active,
.province-sidebar a:hover {
  background: linear-gradient(135deg, var(--btf-blue), var(--btf-deep));
  color: #fff;
}
.province-sidebar-note {
  background: var(--btf-soft);
  border-color: var(--btf-line);
  color: var(--btf-deep);
}
.dashboard-refresh,
.directory-clear-filter {
  border-color: var(--btf-line);
  color: var(--btf-deep) !important;
}
.dashboard-refresh:hover,
.directory-clear-filter:hover {
  background: var(--btf-soft);
}
.intake-steps li.active,
.photo-mode .active {
  background: linear-gradient(135deg, var(--btf-blue), var(--btf-deep));
  border-color: var(--btf-blue);
}
.intake-steps li.complete {
  background: #eef9fd;
  border-color: #9fd7e8;
  color: var(--btf-deep);
}
.field-block.wide > h3 {
  background: var(--btf-soft);
  border-color: var(--btf-line);
  border-left-color: var(--btf-blue);
  color: var(--btf-deep);
}
.province-kpi.teal,
.health-kpi.teal {
  border-color: #9fd7e8;
  color: var(--btf-blue);
}
.province-kpi.amber,
.health-kpi.orange {
  color: var(--btf-orange);
}
.survey-summary-row strong,
.report-preview strong,
.directory-name {
  color: var(--btf-deep);
}
.network-diagram .network-center,
.funnel-row:first-child {
  background: var(--btf-deep);
}
.donut.big {
  background: conic-gradient(var(--btf-blue) 0 62%, #8fd8ef 62% 84%, var(--btf-orange) 84% 100%);
}
.report-card {
  border-top: 3px solid rgba(43, 143, 189, 0.35);
}

@media (max-width: 760px) {
  .province-sidebar a.active,
  .province-sidebar a:hover {
    background: linear-gradient(135deg, var(--btf-blue), var(--btf-deep));
    border-color: var(--btf-blue);
    color: #fff;
  }
}

/* Dashboard responsive polish */
.province-dashboard,
.province-main,
.province-panel,
.health-kpi,
.report-card,
.dashboard-income-panel,
.horizontal-bars,
.referral-bars,
.compact-bars,
.report-grid,
.health-grid,
.occupation-grid,
.rights-grid {
  max-width: 100%;
  min-width: 0;
}
.table-responsive {
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.urgent-table {
  width: 100%;
}
.horizontal-bar,
.health-bars .horizontal-bar,
.dashboard-income-panel .horizontal-bar {
  max-width: 100%;
  min-width: 0;
}
.horizontal-bar strong,
.compact-bar strong {
  justify-self: end;
  min-width: 24px;
}
.report-preview div,
.report-links a,
.rental-cards div {
  min-width: 0;
}
.report-preview span,
.report-links a span,
.rental-cards span {
  min-width: 0;
  overflow-wrap: anywhere;
}

@media (max-width: 1180px) {
  .page-shell:has(.province-dashboard) {
    overflow-x: hidden;
  }
  .province-dashboard {
    grid-template-columns: 176px minmax(0, 1fr);
    min-width: 0;
  }
  .province-kpis {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .health-kpis,
  .occupation-kpis,
  .rights-kpis,
  .report-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .survey-insight-grid,
  .province-grid.top,
  .province-grid.middle,
  .province-grid.bottom {
    grid-template-columns: 1fr;
  }
  .mini-dashboard-grid {
    grid-template-columns: minmax(160px, 0.8fr) minmax(0, 1fr) minmax(0, 1fr);
  }
  .pipeline {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    overflow: visible;
  }
  .pipeline-step,
  .pipeline-step:first-child,
  .pipeline-step:last-child {
    border-radius: 8px;
    clip-path: none;
    padding: 10px;
  }
  .directory-dashboard.province-dashboard {
    grid-template-columns: 1fr;
  }
  .directory-dashboard .province-sidebar {
    display: none;
  }
  .directory-dashboard .province-main {
    padding: 18px;
  }
  .directory-toolbar {
    align-items: stretch;
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .directory-page-filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .directory-quick-search {
    grid-template-columns: minmax(0, 1fr) auto;
    max-width: 100%;
  }
  .directory-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 22px 18px;
  }
}

@media (max-width: 760px) {
  .province-sidebar {
    scrollbar-width: thin;
  }
  .province-sidebar nav {
    padding-bottom: 2px;
  }
  .province-header,
  .panel-head,
  .directory-toolbar {
    align-items: stretch;
  }
  .province-updated {
    justify-self: start;
  }
  .province-filters select,
  .province-filters input,
  .dashboard-refresh,
  .directory-quick-search .form-control,
  .directory-quick-search .btn {
    width: 100%;
  }
  .health-kpi,
  .province-kpi {
    min-height: auto;
  }
  .health-grid,
  .occupation-grid,
  .rights-grid,
  .report-grid {
    gap: 12px;
  }
  .horizontal-bar,
  .health-bars .horizontal-bar,
  .dashboard-income-panel .horizontal-bar {
    grid-template-columns: minmax(0, 82px) minmax(0, 1fr) minmax(24px, auto);
    gap: 8px;
  }
  .horizontal-bar span,
  .compact-bar span {
    font-size: 12px;
  }
  .report-preview div,
  .report-links a,
  .rental-cards div {
    gap: 8px;
    padding: 9px 10px;
  }
  .report-preview strong,
  .rental-cards strong {
    flex: 0 0 auto;
  }
  .assistance-services-grid {
    grid-template-columns: 1fr;
  }
  .urgent-table {
    min-width: 640px;
  }
  .area-map-large .province-map {
    height: 360px;
    min-height: 320px;
  }
  .directory-grid {
    gap: 24px 14px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .province-kpis,
  .health-kpis,
  .occupation-kpis,
  .rights-kpis,
  .report-summary,
  .mini-dashboard-grid,
  .directory-page-filters,
  .directory-quick-search {
    grid-template-columns: 1fr;
  }
  .province-panel h2 {
    font-size: 16px;
  }
  .province-kpi strong,
  .health-kpi strong {
    font-size: 28px;
  }
  .compact-bar,
  .horizontal-bar,
  .health-bars .horizontal-bar,
  .dashboard-income-panel .horizontal-bar {
    grid-template-columns: minmax(0, 78px) minmax(0, 1fr) minmax(22px, auto);
  }
  .survey-summary-row {
    grid-template-columns: 1fr;
  }
  .directory-grid {
    grid-template-columns: 1fr;
  }
}


/* Dashboard overflow containment */
.page-shell:has(.province-dashboard) {
  overflow-x: hidden;
}
.province-dashboard {
  grid-template-columns: 188px minmax(0, 1fr);
  min-width: 0;
  width: 100%;
}
.province-main {
  max-width: 100%;
  min-width: 0;
  overflow-x: hidden;
}
.province-filters {
  grid-template-columns: minmax(210px, 1.25fr) minmax(260px, 1.35fr) repeat(4, minmax(120px, 1fr)) auto;
}
.province-kpis {
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
}
.province-kpi {
  min-width: 0;
}
.province-kpi span,
.province-kpi small {
  overflow-wrap: anywhere;
}
.province-panel,
.survey-insight-grid,
.province-grid,
.dashboard-year-only-grid,
.mini-dashboard-grid,
.pipeline,
.annual-encounter-chart {
  max-width: 100%;
  min-width: 0;
}
@media (max-width: 1320px) {
  .province-dashboard {
    grid-template-columns: 176px minmax(0, 1fr);
  }
  .province-filters {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .dashboard-refresh {
    width: 100%;
  }
  .dashboard-filter-summary {
    grid-column: 1 / -1;
  }
}

/* Mobile containment for resume and assistance/referral pages */
.resume-page,
.resume-sheet,
.resume-page-survey,
.resume-survey-sheet,
.resume-survey-hero,
.resume-summary,
.resume-photo-panel,
.resume-survey-card,
.resume-photo-slots,
.resume-photo-slot,
.resume-survey-grid,
.resume-data-list,
.resume-case-card,
.resume-case-list,
.resume-case-item,
.assistance-main,
.assistance-main .province-panel,
.assistance-main .health-kpis,
.assistance-main .health-kpi,
.assistance-summary,
.assistance-stat-row,
.assistance-breakdown,
.assistance-breakdown section,
.assistance-item,
.assistance-table-panel,
.assistance-service-grid,
.dashboard-year-help-grid {
  max-width: 100%;
  min-width: 0;
}

.resume-page,
.resume-page-survey,
.page-shell:has(.assistance-main) {
  overflow-x: hidden;
}

@media (max-width: 768px) {
  .resume-page,
  .resume-page-survey {
    margin: -16px;
    padding: 10px;
  }

  .resume-sheet,
  .resume-survey-sheet {
    border-radius: 0;
    max-width: 100%;
    padding: 12px 10px 24px;
    width: 100%;
  }

  .resume-toolbar {
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .resume-survey-hero {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .resume-main-photo {
    min-height: 0;
  }

  .resume-main-photo img,
  .resume-photo-placeholder {
    aspect-ratio: 4 / 3;
    height: auto;
    min-height: 0;
  }

  .resume-summary {
    padding: 16px;
  }

  .resume-summary h1 {
    font-size: 30px;
    line-height: 1.12;
    overflow-wrap: anywhere;
  }

  .resume-personal-history {
    font-size: 14px;
  }

  .resume-panel-head {
    align-items: start;
    display: grid;
    gap: 6px;
  }

  .resume-photo-slots {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .resume-survey-grid {
    grid-template-columns: 1fr;
  }

  .resume-photo-panel,
  .resume-survey-card {
    padding: 14px;
  }

  .resume-data-list div {
    grid-template-columns: minmax(92px, 38%) minmax(0, 1fr);
    gap: 8px;
  }

  .resume-data-list dt {
    font-size: 12px;
  }

  .resume-data-list dd {
    font-size: 14px;
    overflow-wrap: anywhere;
  }

  .resume-case-item {
    grid-template-columns: 1fr;
  }

  .resume-case-item p {
    grid-column: auto;
    margin-top: 0;
  }

  .page-shell:has(.assistance-main) {
    padding-left: 0;
    padding-right: 0;
  }

  .province-dashboard:has(.assistance-main) {
    margin-left: 0;
    margin-right: 0;
    overflow-x: hidden;
    width: 100%;
  }

  .assistance-main.province-main {
    overflow-x: hidden;
    padding: 12px 10px 24px;
    width: 100%;
  }

  .assistance-main .province-header {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .assistance-main .province-header h1 {
    font-size: 24px;
    line-height: 1.16;
  }

  .assistance-filters,
  .assistance-main .province-filters {
    grid-template-columns: 1fr;
  }

  .assistance-main .date-range {
    grid-template-columns: 1fr;
  }

  .assistance-main .health-kpis,
  .assistance-kpis {
    grid-template-columns: 1fr;
  }

  .dashboard-year-help-grid,
  .assistance-service-grid {
    grid-template-columns: 1fr !important;
  }

  .assistance-summary,
  .assistance-stat-row,
  .assistance-breakdown {
    grid-template-columns: 1fr;
  }

  .assistance-item {
    grid-template-columns: minmax(0, 1fr) 44px;
    gap: 8px;
  }

  .assistance-item p {
    grid-column: 1 / -1;
    min-width: 0;
  }

  .assistance-item span {
    min-width: 0;
    overflow-wrap: anywhere;
    white-space: normal;
  }

  .assistance-table-panel .table-responsive {
    max-width: 100%;
    overflow-x: auto;
    width: 100%;
    -webkit-overflow-scrolling: touch;
  }

  .assistance-table-panel .urgent-table {
    min-width: 720px;
  }
}

@media (max-width: 420px) {
  .resume-photo-slots {
    grid-template-columns: 1fr;
  }

  .resume-data-list div {
    grid-template-columns: 1fr;
  }

  .assistance-main .health-kpi {
    padding: 12px;
  }

  .assistance-main .health-kpi strong {
    font-size: 28px;
  }
}

/* Graph-focused main dashboard */
.chart-dashboard-main {
  background: #eef6fb;
  gap: 12px;
  padding: 16px 18px 24px;
}

.chart-dashboard .province-header {
  background: #1f436d;
  border-bottom: 5px solid #62b7df;
  color: #fff;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 14px 18px;
}

.chart-dashboard .province-header h1 {
  color: #fff;
  font-size: 30px;
  letter-spacing: 0;
  line-height: 1.1;
  text-transform: uppercase;
}

.chart-dashboard .province-header p,
.chart-dashboard .province-updated {
  color: rgba(255, 255, 255, 0.82);
}

.chart-dashboard .province-updated strong {
  color: #fff;
}

.chart-dashboard .province-filters {
  background: #fff;
  border: 1px solid #c8e5ee;
  border-radius: 8px;
  box-shadow: 0 6px 18px rgba(31, 67, 109, 0.06);
  padding: 12px;
}

.dashboard-mode-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr)) minmax(260px, 0.8fr);
  gap: 12px;
  margin: 12px 0;
}

.dashboard-mode-strip article,
.dashboard-mode-strip nav {
  min-width: 0;
  padding: 14px;
  border: 1px solid #bfe7f5;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.04);
}

.dashboard-mode-strip span,
.dashboard-mode-strip small {
  display: block;
  color: #64748b;
  font-weight: 800;
}

.dashboard-mode-strip span {
  color: #0f766e;
  font-size: 13px;
  font-weight: 950;
}

.dashboard-mode-strip strong {
  display: block;
  margin: 4px 0;
  color: #0f3654;
  font-size: 17px;
  font-weight: 950;
}

.dashboard-mode-strip nav {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.dashboard-mode-strip a {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid #cfe8f3;
  border-radius: 8px;
  background: #f8fdff;
  color: #075985;
  font-size: 13px;
  font-weight: 900;
  text-align: center;
  text-decoration: none;
}

.dashboard-mode-strip a:hover {
  background: #e0f2fe;
}

.chart-kpi-strip {
  gap: 4px;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.chart-kpi-strip .province-kpi {
  align-content: center;
  border: 0;
  border-radius: 3px;
  box-shadow: none;
  color: #fff;
  min-height: 88px;
  padding: 10px 12px;
  text-align: center;
}

.chart-kpi-strip .province-kpi span,
.chart-kpi-strip .province-kpi small {
  color: rgba(255, 255, 255, 0.9);
}

.chart-kpi-strip .province-kpi strong {
  color: #fff;
  font-size: 30px;
}

.chart-kpi-strip .province-kpi.teal {
  background: #0f766e;
}

.chart-kpi-strip .province-kpi.blue {
  background: #1d4ed8;
}

.chart-kpi-strip .province-kpi.red {
  background: #b91c1c;
}

.chart-kpi-strip .province-kpi.violet {
  background: #6d28d9;
}

.chart-kpi-strip .province-kpi.amber {
  background: #b45309;
}

.chart-kpi-strip .province-kpi.rose {
  background: #be185d;
}

.chart-kpi-strip .province-kpi.green {
  background: #15803d;
}

.dashboard-report-section {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.dashboard-section-title {
  background: linear-gradient(90deg, #1d4ed8, #1f436d);
  border-radius: 3px;
  color: #fff;
  font-size: 16px;
  font-weight: 900;
  line-height: 1.2;
  margin: 0;
  padding: 8px 12px;
  text-align: center;
}

.dashboard-chart-grid {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.dashboard-chart-grid-population {
  grid-template-columns: minmax(220px, 0.8fr) minmax(250px, 1fr) minmax(250px, 1fr);
}

.dashboard-chart-grid-trend {
  grid-template-columns: minmax(420px, 1.12fr) minmax(420px, 0.88fr);
}

.dashboard-chart-grid-survey {
  grid-template-columns: repeat(3, minmax(260px, 1fr));
}

.chart-card-wide {
  grid-column: 1 / -1;
}

.chart-card {
  background:
    linear-gradient(180deg, #ffffff 0%, #f6f7f8 100%);
  border-color: #d0d7de;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
  min-height: 248px;
  padding: 14px;
}

.chart-card .panel-head {
  border-bottom: 1px solid #dfe6ec;
  margin-bottom: 12px;
  padding-bottom: 9px;
}

.chart-card .panel-head h3 {
  color: #26384f;
  font-size: 18px;
  font-weight: 900;
  line-height: 1.2;
  margin: 0;
}

.chart-card .panel-note {
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
}

.chart-card .survey-donut {
  margin-top: 6px;
}

.chart-card .donut.big {
  height: 148px;
  width: 148px;
}

.chart-card .donut.big::after {
  height: 82px;
  width: 82px;
}

.chart-card .donut.big strong {
  font-size: 22px;
}

.chart-legend {
  max-width: 280px;
}

.chart-bars {
  gap: 10px;
}

.chart-card .horizontal-bar,
.chart-card .compact-bar,
.chart-card .annual-bar,
.chart-card .dashboard-income-panel .horizontal-bar {
  grid-template-columns: minmax(96px, 0.9fr) minmax(120px, 1.5fr) 38px;
}

.chart-card .horizontal-bar span,
.chart-card .compact-bar span,
.chart-card .annual-bar span {
  color: #334155;
  white-space: normal;
}

.chart-card .horizontal-bar p,
.chart-card .compact-bar p,
.chart-card .annual-bar p {
  background: #e6ebf0;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.08);
}

.chart-card .province-line-chart svg {
  background:
    linear-gradient(#dfe6ec 1px, transparent 1px) 0 0 / 100% 46px,
    #f8fafc;
  min-height: 240px;
}

.chart-card .province-legend {
  flex-wrap: wrap;
  gap: 10px 18px;
  margin-top: 8px;
}

.chart-card .pipeline {
  gap: 6px;
  overflow: visible;
}

.chart-card .pipeline-step,
.chart-card .pipeline-step:first-child,
.chart-card .pipeline-step:last-child {
  border-radius: 8px;
  clip-path: none;
  min-height: 86px;
  padding: 10px 8px;
}

.chart-card .annual-encounter-chart {
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr;
  margin-top: 12px;
}

.chart-card .annual-row {
  background: rgba(255, 255, 255, 0.72);
}

.annual-column-chart {
  background:
    repeating-linear-gradient(to top, rgba(31, 67, 109, 0.08) 0 1px, transparent 1px 25%),
    #f8fafc;
  border: 1px solid #dfe6ec;
  border-radius: 8px;
  display: grid;
  gap: 10px;
  grid-template-columns: 44px minmax(0, 1fr);
  height: min(42vw, 360px);
  min-height: 320px;
  overflow-x: auto;
  padding: 12px 12px 10px;
}

.annual-scale {
  color: #64748b;
  display: flex;
  flex-direction: column;
  font-size: 12px;
  font-weight: 900;
  justify-content: space-between;
  padding: 24px 0 34px;
  text-align: right;
}

.annual-column-plot {
  align-items: end;
  border-bottom: 2px solid #334155;
  border-left: 1px solid #cbd5e1;
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(10, minmax(48px, 1fr));
  min-width: 0;
  padding: 22px 8px 28px;
}

.annual-column-year {
  align-items: end;
  display: grid;
  grid-template-rows: 20px minmax(0, 1fr) 20px;
  height: 100%;
  min-width: 0;
  text-align: center;
}

.annual-total {
  color: #0f172a;
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
}

.annual-columns {
  align-items: end;
  display: flex;
  gap: 5px;
  height: 100%;
  justify-content: center;
  min-height: 0;
}

.annual-column {
  border-radius: 6px 6px 0 0;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3);
  display: block;
  max-width: 30px;
  min-width: 10px;
  width: min(24px, calc((100% - 5px) / 2));
}

.annual-column.new {
  background: #2563eb;
}

.annual-column.old {
  background: #d97706;
}

.annual-column.empty {
  background: transparent;
  border-top: 2px solid #cbd5e1;
  box-shadow: none;
}

.annual-column b {
  display: none;
}

.annual-year-label {
  color: #334155;
  font-size: 11px;
  font-weight: 900;
  line-height: 1.1;
  padding-top: 7px;
  white-space: nowrap;
}

.annual-column-legend {
  align-items: center;
  color: #475569;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  justify-content: center;
  font-size: 12px;
  font-weight: 900;
}

.annual-column-legend span {
  align-items: center;
  display: inline-flex;
  gap: 7px;
}

.annual-column-legend i {
  border-radius: 999px;
  height: 9px;
  width: 22px;
}

.annual-column-legend b {
  color: #0f172a;
}

.dual-chart {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.dual-chart h4 {
  color: #334155;
  font-size: 13px;
  font-weight: 900;
  margin: 0 0 8px;
}

.urgent-chart-card {
  min-height: 0;
}

.urgent-chart-card .dual-chart {
  gap: 18px;
  grid-template-columns: repeat(2, minmax(280px, 1fr));
}

.urgent-chart-card .dual-chart > div {
  background: rgba(248, 250, 252, 0.78);
  border: 1px solid #dfe6ec;
  border-radius: 8px;
  min-width: 0;
  padding: 12px;
}

.urgent-chart-card .horizontal-bar {
  grid-template-columns: minmax(120px, 0.85fr) minmax(160px, 1.35fr) 40px;
}

/* Clear chart headers across the main and sub dashboards. */
.province-panel > .panel-head,
.chart-card > .panel-head {
  background: linear-gradient(90deg, #eaf7f8 0%, #f4f8fb 62%, #ffffff 100%);
  border-bottom: 1px solid #cfe0e8;
  border-left: 5px solid #0f9f9a;
  border-radius: 8px 8px 0 0;
  margin: -16px -16px 14px;
  padding: 12px 14px 11px;
}

.chart-card > .panel-head {
  margin: -14px -14px 14px;
}

.province-panel > .panel-head h2,
.chart-card > .panel-head h3 {
  color: #10384f;
  font-size: 19px;
  font-weight: 950;
  line-height: 1.25;
}

.province-panel > .panel-head .panel-note,
.chart-card > .panel-head .panel-note {
  color: #557083;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.35;
  text-align: right;
}

@media (max-width: 1320px) {
  .chart-kpi-strip {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .dashboard-mode-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-mode-strip nav {
    grid-column: 1 / -1;
  }

  .dashboard-chart-grid-population,
  .dashboard-chart-grid-trend,
  .dashboard-chart-grid-survey {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .chart-dashboard-main {
    padding: 12px 10px 22px;
  }

  .chart-dashboard .province-header {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 13px 12px;
  }

  .chart-dashboard .province-header h1 {
    font-size: 24px;
  }

  .chart-dashboard .province-updated {
    text-align: left;
  }

  .chart-kpi-strip,
  .dashboard-mode-strip,
  .dashboard-chart-grid-population,
  .dashboard-chart-grid-trend,
  .dashboard-chart-grid-survey {
    grid-template-columns: 1fr;
  }

  .dashboard-mode-strip nav {
    grid-column: auto;
    grid-template-columns: 1fr;
  }

  .chart-card {
    min-height: 0;
    padding: 12px;
  }

  .chart-card .panel-head {
    align-items: flex-start;
    display: grid;
    gap: 4px;
  }

  .province-panel > .panel-head .panel-note,
  .chart-card > .panel-head .panel-note {
    text-align: left;
  }

  .chart-card .horizontal-bar,
  .chart-card .compact-bar,
  .chart-card .annual-bar {
    grid-template-columns: minmax(0, 92px) minmax(0, 1fr) 34px;
  }

  .chart-card .province-line-chart svg {
    min-height: 200px;
  }

  .annual-column-chart {
    grid-template-columns: 34px minmax(0, 1fr);
    height: 300px;
    min-height: 300px;
    overflow-x: auto;
    padding: 10px 8px 8px;
  }

  .annual-column-plot {
    gap: 7px;
    grid-template-columns: repeat(10, minmax(44px, 1fr));
    min-width: 520px;
    padding-left: 6px;
    padding-right: 6px;
  }

  .annual-scale {
    padding-bottom: 32px;
  }

  .dual-chart {
    grid-template-columns: 1fr;
  }

  .urgent-chart-card .dual-chart {
    grid-template-columns: 1fr;
  }

  .urgent-chart-card .horizontal-bar {
    grid-template-columns: minmax(0, 92px) minmax(0, 1fr) 34px;
  }
}

@media (max-width: 430px) {
  .chart-kpi-strip .province-kpi {
    min-height: 76px;
  }

  .chart-kpi-strip .province-kpi strong {
    font-size: 28px;
  }

  .chart-card .horizontal-bar,
  .chart-card .compact-bar,
  .chart-card .annual-bar {
    grid-template-columns: 1fr 1fr 30px;
  }

  .annual-column-chart {
    height: 280px;
    min-height: 280px;
  }
}
/* Data quality report and field form guard */
.quality-page {
  max-width: 1180px;
  margin: 0 auto;
  padding: 24px 16px 40px;
}

.quality-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 22px;
  border: 1px solid #bae6fd;
  border-radius: 8px;
  background: linear-gradient(135deg, #e0f2fe 0%, #f8fafc 58%, #ecfdf5 100%);
}

.quality-kicker {
  margin: 0 0 4px;
  color: #0f766e;
  font-weight: 900;
}

.quality-hero h1 {
  margin: 0;
  color: #0f172a;
  font-size: 30px;
  font-weight: 950;
}

.quality-hero p:last-child {
  margin: 6px 0 0;
  color: #475569;
  font-weight: 700;
}

.quality-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0;
}

.quality-summary article,
.quality-panel {
  border: 1px solid #cfe8f3;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.04);
}

.quality-summary article {
  padding: 16px;
  border-left: 5px solid #0ea5e9;
}

.quality-summary article.ok {
  border-left-color: #10b981;
}

.quality-summary article.warn {
  border-left-color: #f97316;
}

.quality-summary span,
.quality-summary small {
  display: block;
  color: #475569;
  font-weight: 800;
}

.quality-summary strong {
  display: block;
  margin-top: 6px;
  color: #0f172a;
  font-size: 34px;
  line-height: 1;
}

.quality-grid {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 14px;
}

.quality-panel {
  min-width: 0;
  padding: 16px;
}

.quality-panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid #e2e8f0;
}

.quality-panel-head h2 {
  margin: 0;
  color: #0f172a;
  font-size: 18px;
  font-weight: 950;
}

.quality-panel-head span {
  color: #64748b;
  font-size: 13px;
  font-weight: 800;
}

.quality-section-list {
  display: grid;
  gap: 8px;
}

.quality-section-list div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #f8fafc;
  color: #334155;
  font-weight: 850;
}

.quality-section-list strong {
  color: #0f766e;
}

.quality-table-wrap {
  overflow-x: auto;
}

.quality-table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
}

.quality-table th,
.quality-table td {
  padding: 12px 10px;
  border-bottom: 1px solid #e2e8f0;
  vertical-align: top;
}

.quality-table th {
  color: #475569;
  font-size: 13px;
  text-align: left;
}

.quality-table td strong,
.quality-table td small {
  display: block;
}

.quality-table td small {
  color: #64748b;
  font-weight: 750;
}

.quality-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.quality-tags span {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #eef6ff;
  color: #075985;
  font-size: 13px;
  font-weight: 850;
}

.quality-actions {
  white-space: nowrap;
}

.quality-empty {
  margin: 0;
  color: #64748b;
  font-weight: 800;
}

.form-guard-status {
  display: none;
  margin-right: auto;
  color: #b45309;
  font-weight: 850;
}

.form-guard-status.active {
  display: inline-flex;
  align-items: center;
}

@media (max-width: 900px) {
  .quality-hero,
  .quality-panel-head {
    flex-direction: column;
  }

  .quality-summary,
  .quality-grid {
    grid-template-columns: 1fr;
  }

  .quality-hero .btn {
    width: 100%;
  }
}

.system-summary article strong {
  font-size: 28px;
}

.system-health-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0;
}

.system-health-grid article {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 14px;
  border: 1px solid #cfe8f3;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.04);
}

.system-health-grid strong,
.system-health-grid small {
  display: block;
}

.system-health-grid strong {
  color: #0f172a;
  font-weight: 950;
}

.system-health-grid small {
  color: #64748b;
  font-weight: 800;
}

.system-health-dot {
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  border-radius: 999px;
  background: #10b981;
  box-shadow: 0 0 0 5px rgba(16, 185, 129, 0.14);
}

.system-health-grid .warn .system-health-dot {
  background: #f97316;
  box-shadow: 0 0 0 5px rgba(249, 115, 22, 0.14);
}

.system-messages {
  display: grid;
  gap: 8px;
  margin: 12px 0;
}

.system-message {
  padding: 10px 12px;
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  background: #f0fdf4;
  color: #166534;
  font-weight: 850;
}

.system-backup-form {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.system-backup-form .btn {
  justify-self: start;
}

.system-backup-form small {
  color: #64748b;
  font-weight: 750;
}

.system-domain-list strong {
  overflow-wrap: anywhere;
  text-align: right;
}

.system-domain-link {
  margin-top: 12px;
}

.system-warning-note {
  margin: 12px 0 0;
  padding: 10px 12px;
  border: 1px solid #fed7aa;
  border-radius: 8px;
  background: #fff7ed;
  color: #9a3412;
  font-weight: 800;
}

.system-cron {
  margin: 14px 0 0;
  padding: 12px;
  border-radius: 8px;
  background: #0f172a;
  color: #e2e8f0;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 12px;
}

.guide-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.guide-grid h2 {
  margin: 0 0 8px;
  color: #0f172a;
  font-size: 18px;
  font-weight: 950;
}

.guide-grid p {
  margin: 0 0 8px;
  color: #475569;
  font-weight: 750;
}

.field-guide-strip,
.monthly-export-summary {
  display: grid;
  gap: 12px;
  margin: 14px 0;
}

.field-guide-strip {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.field-guide-strip article,
.monthly-export-summary article {
  min-width: 0;
  padding: 14px;
  border: 1px solid #cfe8f3;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.04);
}

.field-guide-strip span,
.field-guide-strip small,
.monthly-export-summary span,
.monthly-export-summary small {
  display: block;
  color: #64748b;
  font-weight: 800;
}

.field-guide-strip strong,
.monthly-export-summary strong {
  display: block;
  margin: 5px 0;
  color: #0f172a;
  font-weight: 950;
}

.monthly-export-form {
  display: grid;
  grid-template-columns: minmax(220px, 320px) auto;
  gap: 10px;
  align-items: end;
}

.monthly-export-form label {
  display: block;
  margin-bottom: 6px;
  color: #334155;
  font-weight: 850;
}

.monthly-export-summary {
  grid-template-columns: minmax(0, 220px) minmax(0, 1fr);
  align-items: center;
}

.monthly-export-summary strong {
  font-size: 34px;
  color: #0f766e;
}

.saved-page {
  display: grid;
  place-items: center;
  min-height: calc(100vh - 180px);
  padding: 18px;
}

.saved-card {
  width: min(760px, 100%);
  padding: 28px;
  border: 1px solid #bfe7f5;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.08);
  text-align: center;
}

.saved-check {
  display: inline-grid;
  place-items: center;
  width: 68px;
  height: 68px;
  border-radius: 999px;
  background: #10b981;
  color: #fff;
  font-size: 42px;
  font-weight: 950;
}

.saved-kicker {
  margin: 14px 0 4px;
  color: #0f766e;
  font-weight: 950;
}

.saved-card h1 {
  margin: 0;
  color: #0f3654;
  font-size: 30px;
  font-weight: 950;
}

.saved-card p {
  color: #475569;
  font-weight: 800;
}

.saved-meta,
.saved-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.saved-meta {
  margin: 12px 0;
}

.saved-meta span {
  padding: 5px 10px;
  border-radius: 999px;
  background: #e0f2fe;
  color: #075985;
  font-size: 13px;
  font-weight: 900;
}

.saved-actions {
  margin-top: 18px;
}

.follow-work-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.follow-work-list {
  display: grid;
  gap: 8px;
}

.follow-work-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid #dbeafe;
  border-radius: 8px;
  background: #f8fbff;
  text-decoration: none;
}

.follow-work-item strong,
.follow-work-item span,
.follow-work-item small {
  display: block;
}

.follow-work-item strong {
  color: #0f3654;
  font-weight: 950;
}

.follow-work-item span {
  color: #475569;
  font-weight: 800;
}

.follow-work-item small {
  color: #64748b;
  font-weight: 750;
}

.follow-work-item b {
  flex: 0 0 auto;
  color: #0369a1;
  font-size: 13px;
  font-weight: 950;
}

.follow-work-danger {
  border-top: 4px solid #dc2626;
}

.follow-work-orange {
  border-top: 4px solid #f97316;
}

.follow-work-blue {
  border-top: 4px solid #2563eb;
}

.follow-work-green {
  border-top: 4px solid #10b981;
}

.follow-work-slate {
  border-top: 4px solid #64748b;
}

.follow-work-purple {
  border-top: 4px solid #7c3aed;
}

@media (max-width: 900px) {
  .system-health-grid,
  .field-guide-strip,
  .monthly-export-form,
  .monthly-export-summary,
  .follow-work-grid {
    grid-template-columns: 1fr;
  }

  .monthly-export-form .btn,
  .system-backup-form .btn {
    width: 100%;
  }

  .saved-actions .btn,
  .follow-work-item {
    width: 100%;
  }

  .follow-work-item {
    align-items: stretch;
    flex-direction: column;
  }
}

@media (max-width: 1180px) {
  .directory-dashboard.province-dashboard {
    grid-template-columns: 1fr;
    margin: 0;
  }

  .directory-dashboard .province-sidebar {
    display: none;
  }

  .directory-dashboard .province-main {
    width: 100%;
    padding: 16px;
  }

  .directory-toolbar {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .directory-page-filters,
  .directory-quick-search {
    width: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .directory-quick-search {
    display: grid;
  }

  .directory-quick-search .form-control {
    min-width: 0;
  }

  .directory-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 18px;
  }
}

@media (max-width: 760px) {
  .directory-page-filters,
  .directory-quick-search,
  .guide-grid {
    grid-template-columns: 1fr;
  }

  .directory-card {
    max-width: none;
  }

  .resume-page,
  .resume-page-survey {
    padding: 8px;
  }

  .resume-sheet,
  .resume-survey-sheet {
    width: 100%;
    max-width: 100%;
    padding: 12px;
  }

  .resume-survey-hero,
  .resume-survey-grid,
  .resume-photo-slots {
    grid-template-columns: 1fr;
  }

  .resume-data-list div {
    grid-template-columns: 1fr;
    gap: 4px;
  }

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

  .report-export-actions .btn {
    width: 100%;
  }
}

.intake-header-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.form-draft-status {
  display: none;
  color: #0f766e;
  font-weight: 850;
}

.form-draft-status.active {
  display: inline-flex;
  align-items: center;
}

.duplicate-search-page {
  display: grid;
  gap: 14px;
  max-width: 1180px;
  margin: 0 auto;
  padding: 16px;
}

.duplicate-search-hero,
.duplicate-search-form,
.duplicate-person-card {
  border: 1px solid #bfe7f5;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
}

.duplicate-search-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 18px;
}

.duplicate-search-hero h1 {
  margin: 0 0 4px;
  color: #0f3654;
  font-size: 28px;
  font-weight: 950;
}

.duplicate-search-hero p {
  margin: 0;
  color: #475569;
  font-weight: 750;
}

.duplicate-search-form {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(180px, 260px) auto auto;
  align-items: end;
  gap: 10px;
  padding: 14px;
}

.duplicate-search-form label {
  display: block;
  margin-bottom: 5px;
  color: #334155;
  font-weight: 850;
}

.duplicate-search-count,
.duplicate-search-empty {
  color: #475569;
  font-weight: 850;
}

.duplicate-search-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 12px;
}

.duplicate-person-card {
  display: grid;
  grid-template-columns: 118px minmax(0, 1fr);
  gap: 12px;
  padding: 12px;
}

.duplicate-person-card.is-deceased {
  border-color: #c4b5fd;
  background: #faf8ff;
}

.duplicate-person-photo {
  display: grid;
  overflow: hidden;
  place-items: center;
  width: 118px;
  height: 118px;
  border-radius: 8px;
  background: #e2e8f0;
  color: #475569;
  font-size: 32px;
  font-weight: 950;
  text-decoration: none;
}

.duplicate-person-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.duplicate-person-body {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.duplicate-person-title {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.duplicate-person-title strong {
  color: #0f3654;
  font-size: 17px;
}

.duplicate-person-title span {
  padding: 2px 8px;
  border-radius: 999px;
  background: #ede9fe;
  color: #6d28d9;
  font-size: 12px;
  font-weight: 900;
}

.duplicate-person-card dl {
  display: grid;
  gap: 4px;
  margin: 0;
}

.duplicate-person-card dl div {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 8px;
}

.duplicate-person-card dt {
  color: #64748b;
  font-weight: 800;
}

.duplicate-person-card dd {
  margin: 0;
  color: #0f172a;
  font-weight: 850;
  word-break: break-word;
}

.duplicate-person-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.local-drafts-page {
  display: grid;
  gap: 14px;
  max-width: 980px;
  margin: 0 auto;
  padding: 16px;
}

.local-draft-list {
  display: grid;
  gap: 10px;
}

.local-draft-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px;
  border: 1px solid #bfe7f5;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
}

.local-draft-card strong,
.local-draft-card span,
.local-draft-card small {
  display: block;
}

.local-draft-card strong {
  color: #0f3654;
  font-size: 17px;
  font-weight: 950;
}

.local-draft-card span {
  color: #334155;
  font-weight: 850;
}

.local-draft-card small {
  color: #64748b;
  font-weight: 750;
  word-break: break-word;
}

.local-draft-actions,
.resume-audit-list {
  display: grid;
  gap: 8px;
}

.local-draft-actions {
  min-width: 150px;
}

.resume-audit-card {
  margin-top: 14px;
}

.resume-audit-item {
  display: grid;
  grid-template-columns: 130px minmax(0, 160px) minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 10px 0;
  border-bottom: 1px solid #e2e8f0;
}

.resume-audit-item:last-child {
  border-bottom: 0;
}

.resume-audit-item span {
  color: #64748b;
  font-weight: 800;
}

.resume-audit-item strong {
  color: #0f3654;
  font-weight: 950;
  word-break: break-word;
}

.resume-audit-item p {
  margin: 0;
  color: #334155;
  font-weight: 800;
}

.duplicate-review-list,
.field-today-list {
  display: grid;
  gap: 10px;
}

.duplicate-review-card {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr) minmax(180px, 0.7fr);
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid #dbeafe;
  border-radius: 8px;
  background: #f8fbff;
}

.duplicate-review-score {
  display: grid;
  place-items: center;
  min-height: 70px;
  border-radius: 8px;
  background: #0f766e;
  color: #fff;
}

.duplicate-review-score strong {
  font-size: 28px;
  line-height: 1;
}

.duplicate-review-score span {
  font-size: 12px;
  font-weight: 850;
}

.duplicate-review-people {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.duplicate-review-people div,
.field-today-list a {
  display: grid;
  gap: 3px;
  padding: 10px;
  border-radius: 8px;
  background: #fff;
  text-decoration: none;
}

.duplicate-review-people strong,
.field-today-list strong {
  color: #0f3654;
  font-weight: 950;
}

.duplicate-review-people span,
.field-today-list span {
  color: #64748b;
  font-weight: 800;
}

.duplicate-review-people a {
  color: #0369a1;
  font-weight: 850;
}

.friendly-error {
  max-width: 760px;
  margin: 30px auto;
  padding: 28px;
  border: 1px solid #bfe7f5;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
}

.friendly-error h1 {
  color: #0f3654;
  font-weight: 950;
}

.friendly-error p {
  color: #475569;
  font-weight: 800;
}

.friendly-error-tips {
  display: grid;
  gap: 8px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}

.friendly-error-tips li {
  padding: 10px 12px;
  border: 1px solid #d7edf7;
  border-radius: 8px;
  background: #f8fcff;
  color: #334155;
  font-weight: 800;
}

.friendly-error-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.readiness-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 14px 0;
  padding: 14px 16px;
  border: 1px solid #fed7aa;
  border-radius: 8px;
  background: #fff7ed;
}

.readiness-banner.ok {
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.readiness-banner strong {
  color: #0f172a;
  font-size: 22px;
  font-weight: 950;
}

.readiness-banner span {
  color: #475569;
  font-weight: 850;
}

.readiness-check-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.readiness-check-grid article {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  min-width: 0;
  padding: 14px;
  border: 1px solid #bae6fd;
  border-left: 5px solid #0ea5e9;
  border-radius: 8px;
  background: #fff;
}

.readiness-check-grid article.ok {
  border-left-color: #10b981;
}

.readiness-check-grid article.warn {
  border-left-color: #f97316;
}

.readiness-dot {
  width: 12px;
  height: 12px;
  margin-top: 5px;
  border-radius: 999px;
  background: #0ea5e9;
}

.readiness-check-grid article.ok .readiness-dot {
  background: #10b981;
}

.readiness-check-grid article.warn .readiness-dot {
  background: #f97316;
}

.readiness-check-grid strong,
.readiness-check-grid small,
.readiness-check-grid p {
  display: block;
}

.readiness-check-grid strong {
  color: #0f172a;
  font-weight: 950;
}

.readiness-check-grid small {
  color: #0369a1;
  font-weight: 900;
}

.readiness-check-grid p {
  margin: 4px 0 0;
  color: #475569;
  font-size: 13px;
  font-weight: 800;
}

.readiness-summary {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.readiness-grid {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.readiness-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.readiness-actions a {
  display: flex;
  align-items: center;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid #bfe7f5;
  border-radius: 8px;
  background: #f8fcff;
  color: #075985;
  font-weight: 900;
  text-decoration: none;
}

.readiness-actions a:hover {
  border-color: #0ea5e9;
  background: #e0f2fe;
}

.updated-today-table td:first-child {
  min-width: 220px;
}

.updated-today-table td:nth-child(2) {
  min-width: 150px;
}

.quality-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 9px;
  border-radius: 999px;
  background: #e0f2fe;
  color: #075985;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.guide-role-table {
  width: 100%;
  border-collapse: collapse;
}

.guide-role-table th,
.guide-role-table td {
  padding: 10px 8px;
  border-bottom: 1px solid #e2e8f0;
  vertical-align: top;
}

.guide-role-table th {
  color: #334155;
  font-size: 13px;
}

.guide-role-table td {
  color: #0f172a;
  font-weight: 800;
}

@media (max-width: 900px) {
  .duplicate-search-hero,
  .duplicate-search-form {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .duplicate-search-hero {
    flex-direction: column;
    align-items: stretch;
  }

  .duplicate-search-hero .btn,
  .duplicate-search-form .btn {
    width: 100%;
  }
}

@media (max-width: 760px) {
  .intake-header {
    gap: 10px;
  }

  .intake-safe-strip {
    grid-template-columns: 1fr;
  }

  .intake-header-actions,
  .intake-header-actions .btn {
    width: 100%;
  }

  .intake-header-actions .btn {
    min-height: 44px;
  }

  .intake-panel {
    padding: 12px;
  }

  .intake-steps {
    display: flex;
    overflow-x: auto;
    padding-bottom: 4px;
    scroll-snap-type: x mandatory;
  }

  .intake-steps li {
    min-width: 150px;
    scroll-snap-align: start;
  }

  .intake-actions {
    position: sticky;
    bottom: 0;
    z-index: 20;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin: 12px -12px -12px;
    padding: 10px 12px;
    border-top: 1px solid #cbe7f3;
    background: rgba(248, 252, 255, 0.96);
    backdrop-filter: blur(8px);
  }

  .intake-actions .btn {
    width: 100%;
    min-height: 46px;
  }

  .form-guard-status,
  .form-draft-status {
    grid-column: 1 / -1;
    margin: 0;
    justify-content: center;
    text-align: center;
  }

  .duplicate-result {
    align-items: stretch;
    flex-direction: column;
  }

  .duplicate-actions {
    justify-content: stretch;
  }

  .duplicate-actions .btn,
  .duplicate-note {
    width: 100%;
    max-width: none;
  }

  .duplicate-search-page {
    padding: 10px;
  }

  .duplicate-search-grid {
    grid-template-columns: 1fr;
  }

  .duplicate-person-card {
    grid-template-columns: 88px minmax(0, 1fr);
    padding: 10px;
  }

  .duplicate-person-photo {
    width: 88px;
    height: 88px;
    font-size: 26px;
  }

  .duplicate-person-card dl div {
    grid-template-columns: 1fr;
    gap: 1px;
  }

  .local-drafts-page {
    padding: 10px;
  }

  .local-draft-card {
    display: grid;
    gap: 10px;
  }

  .local-draft-actions {
    grid-template-columns: 1fr;
    min-width: 0;
  }

  .local-draft-actions .btn {
    width: 100%;
    min-height: 42px;
  }

  .resume-toolbar {
    position: sticky;
    top: 72px;
    z-index: 15;
    justify-content: flex-start;
    padding: 8px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.94);
  }

  .resume-badges {
    gap: 6px;
  }

  .resume-badges span {
    max-width: 100%;
    white-space: normal;
  }

  .resume-audit-item {
    grid-template-columns: 1fr;
    gap: 3px;
  }

  .duplicate-review-card,
  .duplicate-review-people {
    grid-template-columns: 1fr;
  }

  .directory-photo-link,
  .directory-photo-empty {
    aspect-ratio: 4 / 3;
    height: auto;
  }

  .friendly-error {
    margin: 12px auto;
    padding: 18px;
  }

  .friendly-error-actions,
  .friendly-error-actions .btn-primary,
  .friendly-error-actions .btn-secondary,
  .friendly-error-actions .btn-outline-primary {
    width: 100%;
  }

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

  .readiness-check-grid,
  .readiness-summary,
  .readiness-grid,
  .readiness-actions {
    grid-template-columns: 1fr;
  }

  .updated-today-table {
    min-width: 760px;
  }
}
