@import url("https://fonts.googleapis.com/css2?family=Darker+Grotesque:wght@700;800;900&family=Poppins:wght@400;500;600;700;800;900&display=swap");

:root {
  --ink: #131313;
  --ink-soft: #262422;
  --muted: #616161;
  --muted-light: #ababab;
  --paper: #f7f8f9;
  --surface: #ffffff;
  --line: #d9d9d9;
  --line-strong: #d9d9d9;
  --green: #006e5b;
  --brand: var(--green);
  --green-dark: #005a4a;
  --mint: #e6f1ee;
  --blue: #1e6bb8;
  --blue-soft: rgba(30, 107, 184, 0.14);
  --amber: #e2a600;
  --amber-soft: rgba(226, 166, 0, 0.14);
  --red: #e20000;
  --red-soft: rgba(226, 0, 0, 0.12);
  --violet: #6955c7;
  --violet-soft: #eeeafe;
  --shadow: none;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--paper);
  color: var(--ink);
  font-family: Poppins, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 13px;
}

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

button {
  cursor: pointer;
}

.shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 240px 1fr;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 24px 16px;
  border-right: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.brand {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 24px;
  min-width: 0;
}

.brand-on-light .brand-title {
  color: var(--ink);
}

.brand-on-light .brand-subtitle {
  color: var(--muted);
}

.brand-mark {
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 0;
  border: 0;
  background: transparent;
  color: #fff;
  font-weight: 900;
  box-shadow: none;
}

.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.brand-title {
  color: var(--ink);
  font-family: "Darker Grotesque", Poppins, sans-serif;
  font-size: 22px;
  font-weight: 800;
  line-height: 0.95;
}

.brand-subtitle {
  margin-top: 6px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 500;
  line-height: 1.2;
}

.nav {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  display: grid;
  gap: 4px;
  align-content: start;
  padding-right: 2px;
  padding-bottom: 12px;
}

.nav button {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 36px;
  padding: 8px 14px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--ink-soft);
  text-align: left;
  font-size: 13px;
  font-weight: 500;
}

.nav button.active {
  background: rgba(0, 110, 91, 0.08);
  color: var(--green);
  font-weight: 700;
}

.nav button.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  width: 3px;
  height: 24px;
  border-radius: 2px;
  background: var(--green);
}

.nav-symbol {
  width: 16px;
  color: inherit;
  text-align: center;
  font-weight: 500;
  font-size: 14px;
  letter-spacing: 0;
}

.sidebar-footer {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 18px;
  padding: 12px;
  border-radius: 12px;
  background: var(--paper);
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

.main {
  min-width: 0;
  padding: 24px 32px;
}

.topbar,
.panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.topbar {
  margin-bottom: 22px;
}

.eyebrow {
  color: var(--green);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

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

h1 {
  margin-top: 4px;
  font-family: "Darker Grotesque", Poppins, sans-serif;
  font-size: 30px;
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: 0;
}

h2 {
  color: var(--ink-soft);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0;
}

h3 {
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
}

.muted {
  color: var(--muted);
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* Notifications bell + dropdown panel (topbar). Tokens only. */
.notif-wrap {
  position: relative;
  display: inline-flex;
}

.notif-bell {
  position: relative;
}

.notif-wrap.open .notif-bell {
  border: 1px solid var(--green);
  background: var(--mint);
}

.notif-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  line-height: 1;
}

.notif-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 50;
  width: 340px;
  max-width: 88vw;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
}

.notif-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}

.notif-head strong {
  font-size: 13px;
  font-weight: 700;
}

.notif-readall {
  border: 0;
  background: transparent;
  color: var(--green);
  font-size: 11px;
  font-weight: 700;
}

.notif-list {
  max-height: 380px;
  overflow-y: auto;
}

.notif-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
  padding: 11px 14px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  text-align: left;
}

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

.notif-item:hover {
  background: var(--paper);
}

.notif-item.notif-unread {
  background: var(--mint);
}

.notif-item.notif-unread:hover {
  background: var(--mint);
}

.notif-item-icon {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: var(--paper);
  font-size: 14px;
}

.notif-item-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1 1 auto;
}

.notif-item-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--ink);
}

.notif-item-body {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.35;
}

.notif-item-time {
  margin-top: 2px;
  font-size: 10px;
  color: var(--muted-light);
}

.notif-dot {
  flex: 0 0 auto;
  align-self: center;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--green);
}

.notif-empty {
  padding: 24px 14px;
  text-align: center;
  font-size: 12px;
  color: var(--muted);
}

.status-pill,
.badge {
  display: inline-flex;
  align-items: center;
  min-height: 18px;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--mint);
  color: var(--green);
  font-size: 10px;
  font-weight: 800;
}

.badge.warning,
.status-pill.warning {
  background: var(--amber-soft);
  color: var(--amber);
}

.badge.danger,
.status-pill.danger {
  background: var(--red-soft);
  color: var(--red);
}

.badge.blue,
.status-pill.blue {
  background: var(--blue-soft);
  color: var(--blue);
}

.badge.violet,
.status-pill.violet {
  background: var(--violet-soft);
  color: var(--violet);
}

.button,
.ghost-button {
  min-height: 40px;
  padding: 9px 16px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
}

.button {
  border: 1px solid var(--green);
  background: var(--green);
  color: #fff;
}

.button:hover {
  background: var(--green-dark);
}

.button:disabled,
.button:disabled:hover {
  border-color: var(--line-strong);
  background: var(--paper);
  color: var(--muted);
  cursor: not-allowed;
}

.ghost-button {
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
}

.grid {
  display: grid;
  gap: 16px;
}

.grid > * {
  min-width: 0;
}

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

.two-col {
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
}

.three-col {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.four-col {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.full-span {
  grid-column: 1 / -1;
}

.panel,
.metric,
.login-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
}

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

.panel-header {
  margin-bottom: 14px;
}

.metric {
  padding: 16px;
}

.metric-value {
  color: var(--ink);
  font-family: "Darker Grotesque", Poppins, sans-serif;
  font-size: 36px;
  font-weight: 800;
  line-height: 1;
}

.metric-label {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
}

table {
  width: 100%;
  min-width: 1040px;
  border-collapse: collapse;
  background: #fff;
}

th,
td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  font-size: 12px;
}

th {
  color: var(--muted-light);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0;
}

tr:last-child td {
  border-bottom: 0;
}

.selected-row td {
  background: var(--mint);
}

.link-button {
  border: 0;
  background: transparent;
  color: var(--green);
  padding: 0;
  font-weight: 800;
}

.link-button:disabled {
  color: var(--muted);
  cursor: not-allowed;
}

.danger-link {
  color: var(--red);
}

.handoff-form,
.delivery-form,
.reconciliation-form {
  display: grid;
  grid-template-columns: minmax(120px, 0.7fr) minmax(140px, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-width: 340px;
}

.handoff-form select,
.handoff-form input,
.delivery-form select,
.delivery-form input,
.reconciliation-form input {
  min-width: 0;
  padding: 8px 10px;
  border-radius: 8px;
}

.reconciliation-form {
  grid-template-columns: minmax(150px, 1fr) auto;
  margin-top: 8px;
  min-width: 260px;
}

.payroll-filter-bar {
  display: grid;
  grid-template-columns: minmax(180px, 1.3fr) repeat(4, minmax(140px, 1fr)) auto;
  gap: 12px;
  align-items: end;
  margin-bottom: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
}

.filter-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.filter-actions .button,
.filter-actions .ghost-button {
  min-height: 42px;
}

.inline-filter,
.role-management-form {
  display: flex;
  align-items: center;
  gap: 8px;
}

.inline-filter label {
  font-size: 12px;
  font-weight: 800;
  color: var(--muted);
}

.inline-filter select,
.role-management-form select {
  min-width: 150px;
  padding: 8px 10px;
  border-radius: 8px;
}

.user-table {
  min-width: 1060px;
}

.invitation-table {
  min-width: 980px;
}

.onboarding-create-panel {
  border-color: rgba(0, 110, 91, 0.22);
  background: var(--surface);
}

.onboarding-stat-row,
.onboarding-create-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.onboarding-create-form {
  display: grid;
  gap: 14px;
}

.onboarding-create-actions {
  justify-content: space-between;
  padding-top: 4px;
}

.onboarding-create-actions p {
  margin: 0;
}

.review-panel-actions {
  display: grid;
  justify-items: end;
  gap: 10px;
  min-width: min(100%, 520px);
}

.review-filter-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.review-filter-bar button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 7px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
}

.review-filter-bar button.active {
  border-color: rgba(0, 110, 91, 0.3);
  background: var(--mint);
  color: var(--green);
}

.review-filter-bar span {
  min-width: 22px;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(19, 19, 19, 0.08);
  text-align: center;
}

.review-filter-bar button.active span {
  background: rgba(0, 110, 91, 0.12);
}

.agency-onboarding-review-panel {
  border-color: rgba(0, 110, 91, 0.18);
}

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

.agency-onboarding-review-card {
  display: grid;
  gap: 14px;
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.agency-onboarding-review-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.agency-onboarding-review-card-header h3,
.agency-onboarding-review-card-header p,
.review-note {
  overflow-wrap: anywhere;
}

.agency-onboarding-review-meta {
  display: grid;
  grid-template-columns: repeat(4, minmax(110px, 1fr));
  gap: 10px;
  margin: 0;
}

.agency-onboarding-review-meta dt {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.agency-onboarding-review-meta dd {
  margin: 2px 0 0;
  font-weight: 800;
}

.review-note {
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--blue-soft);
  color: var(--blue);
  font-weight: 800;
}

.credential-review-block {
  display: grid;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.credential-review-block.is-update {
  border-color: rgba(245, 158, 11, 0.32);
  background: #fffbeb;
}

.credential-review-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.credential-review-header strong,
.credential-review-header span,
.credential-review-footnote,
.credential-column dd {
  overflow-wrap: anywhere;
}

.credential-review-header strong {
  display: block;
}

.credential-review-header span,
.credential-review-footnote {
  color: var(--muted);
  font-size: 12px;
}

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

.credential-comparison-grid.single {
  grid-template-columns: 1fr;
}

.credential-column {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 10px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid var(--line);
}

.credential-column.current {
  border-color: rgba(0, 110, 91, 0.24);
}

.credential-column-label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.credential-column dl {
  display: grid;
  gap: 8px;
  margin: 0;
}

.credential-column dt {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.credential-column dd {
  margin: 2px 0 0;
  color: var(--ink);
  font-weight: 800;
}

.mini-change {
  display: inline-block;
  margin-top: 4px;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(0, 110, 91, 0.1);
  color: var(--green);
  font-size: 11px;
  font-weight: 900;
}

.credential-review-footnote {
  margin: 0;
}

.credential-attachments {
  display: grid;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid rgba(219, 229, 223, 0.9);
}

.credential-attachments > strong {
  color: var(--ink);
  font-size: 13px;
}

.credential-attachments > div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.credential-attachments a {
  display: inline-flex;
  flex-direction: column;
  max-width: 100%;
  min-width: 180px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--green);
  font-weight: 900;
  text-decoration: none;
}

.credential-attachments span,
.credential-attachments small {
  overflow-wrap: anywhere;
}

.credential-attachments small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.credential-timeline {
  display: grid;
  gap: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(219, 229, 223, 0.9);
}

.credential-timeline-item {
  position: relative;
  display: grid;
  grid-template-columns: 14px 1fr;
  gap: 10px;
  min-width: 0;
}

.credential-timeline-item:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 6px;
  top: 16px;
  bottom: -8px;
  width: 2px;
  background: var(--line);
}

.credential-timeline-dot {
  position: relative;
  z-index: 1;
  width: 14px;
  height: 14px;
  margin-top: 2px;
  border-radius: 999px;
  border: 3px solid #fff;
  background: var(--amber);
  box-shadow: 0 0 0 1px rgba(169, 101, 0, 0.25);
}

.credential-timeline-item.credential_submitted .credential-timeline-dot,
.credential-timeline-item.agency_approved .credential-timeline-dot,
.credential-timeline-item.scheduling_unlocked .credential-timeline-dot {
  background: var(--green);
  box-shadow: 0 0 0 1px rgba(0, 110, 91, 0.24);
}

.credential-timeline-item strong,
.credential-timeline-item p {
  overflow-wrap: anywhere;
}

.credential-timeline-item strong {
  display: block;
  color: var(--ink);
  font-size: 13px;
}

.credential-timeline-item p {
  margin: 2px 0;
  color: var(--muted);
  font-size: 12px;
}

.credential-timeline-item small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.agency-onboarding-review-form {
  display: grid;
  grid-template-columns: minmax(160px, 0.8fr) minmax(180px, 1.2fr) minmax(180px, 1.2fr) auto;
  gap: 12px;
  align-items: end;
  min-width: 0;
}

.agency-onboarding-review-form textarea {
  min-height: 70px;
  resize: vertical;
}

.training-module-grid {
  display: grid;
  gap: 14px;
}

.training-module-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.training-module-card h3 {
  margin: 0;
}

.training-module-card p {
  margin: 0;
}

.training-module-card dl {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 10px;
  margin: 0;
}

.training-module-card dt {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.training-module-card dd {
  margin: 2px 0 0;
  font-weight: 800;
}

.training-module-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 12px;
  align-items: end;
  min-width: 0;
}

.training-module-form textarea {
  min-height: 68px;
  resize: vertical;
  overflow-wrap: anywhere;
}

.training-module-form .wide {
  grid-column: span 4;
}

.training-compliance-table {
  min-width: 860px;
}

.training-compliance-table-wrap {
  margin-top: 14px;
}

.onboarding-public {
  min-height: 100vh;
  padding: 24px;
  background: var(--paper);
}

.onboarding-shell {
  max-width: 980px;
  margin: 0 auto;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: none;
}

.onboarding-shell.narrow {
  max-width: 560px;
  text-align: center;
}

.onboarding-logo {
  width: 56px;
  height: 56px;
  object-fit: contain;
}

.onboarding-hero {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 18px;
  align-items: center;
  margin-bottom: 22px;
}

.onboarding-hero h1,
.onboarding-shell h1 {
  margin: 6px 0 8px;
  font-size: 30px;
  line-height: 1.1;
}

.onboarding-hero p {
  max-width: 720px;
  margin: 0;
  color: var(--muted);
}

.onboarding-progress {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 18px;
}

.onboarding-progress button {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font-weight: 800;
  cursor: pointer;
}

.onboarding-progress button.active {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
}

.onboarding-progress span {
  display: inline-grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.22);
}

.onboarding-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.section-title {
  margin-bottom: 16px;
}

.section-title h2 {
  margin: 8px 0 4px;
}

.form-grid.two {
  grid-template-columns: repeat(2, minmax(180px, 1fr));
}

.training-list {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
}

.training-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfa;
}

.training-row span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
}

.training-icon {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 8px;
  background: var(--mint);
  color: var(--brand);
  font-weight: 900;
}

.onboarding-check-list {
  display: grid;
  gap: 10px;
}

.onboarding-check {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: start;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfa;
  font-weight: 700;
}

.onboarding-check input {
  width: 18px;
  height: 18px;
  margin-top: 1px;
}

.onboarding-review {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.onboarding-review div {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfa;
}

.onboarding-review span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.onboarding-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 16px;
}

.onboarding-correction-notice {
  margin-bottom: 16px;
}

.onboarding-correction-notice p {
  margin: 6px 0 0;
}

.onboarding-correction-list {
  margin: 8px 0 0;
  padding-left: 18px;
}

.onboarding-correction-list li + li {
  margin-top: 4px;
}

.onboarding-password-note {
  align-self: end;
}

.compact-table {
  min-width: 0;
}

.caregiver-profile-table {
  min-width: 980px;
}

.caregiver-profile-table td:first-child {
  width: 240px;
}

.caregiver-profile-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(130px, 1fr)) auto;
  gap: 12px;
  align-items: end;
}

.caregiver-profile-form .full {
  grid-column: 1 / -2;
}

.caregiver-profile-form textarea {
  min-height: 46px;
}

.client-profile-table {
  min-width: 1120px;
}

.client-profile-table td:first-child {
  width: 230px;
}

.client-profile-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(150px, 1fr)) auto;
  gap: 12px;
  align-items: end;
}

.client-profile-form .full {
  grid-column: 1 / -2;
}

.client-profile-form textarea {
  min-height: 70px;
}

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

.check-row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: start;
  min-height: 56px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.check-row input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
}

.check-row span {
  min-width: 0;
}

.check-row strong,
.check-row small {
  display: block;
  overflow-wrap: anywhere;
}

.check-row small {
  margin-top: 2px;
  color: var(--muted);
}

.day-program-roster {
  display: grid;
  gap: 12px;
}

.day-program-block {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(160px, 0.8fr) minmax(260px, 1.5fr) auto;
  gap: 14px;
  align-items: start;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.day-program-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-start;
}

.day-program-group-form {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 12px;
  align-items: end;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.day-program-review-form {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(160px, 0.7fr) minmax(220px, 1.5fr) auto;
  gap: 12px;
  align-items: end;
  min-width: 0;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.day-program-review-form p {
  grid-column: 1 / -1;
  margin: 0;
}

.roster-chip {
  display: inline-block;
  max-width: 100%;
  margin: 4px 6px 0 0;
  padding: 4px 8px;
  border-radius: 999px;
  background: #e8f4f1;
  color: var(--brand);
  font-size: 12px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.roster-chip small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.2;
}

.pickup-summary {
  display: inline-block;
  margin-top: 3px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.pickup-picked_up {
  background: var(--mint);
  color: var(--green);
}

.pickup-not_picked_up {
  background: var(--red-soft);
  color: var(--red);
}

.pickup-pending {
  background: var(--amber-soft);
  color: var(--amber);
}

.dropoff-dropped_off small:last-child {
  color: var(--green);
}

.dropoff-not_dropped_off small:last-child {
  color: var(--red);
}

.dropoff-pending small:last-child {
  color: var(--amber);
}

.schedule-table {
  min-width: 1080px;
}

.schedule-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}

.inline-action-form {
  margin: 0;
}

.visit-edit-row td {
  background: #f8fbfa;
}

.visit-edit-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 12px;
  align-items: end;
}

.day-program-group-form .wide,
.day-program-review-form .wide,
.visit-edit-form .wide {
  grid-column: span 3;
}

.export-count {
  margin: 6px 0 10px;
  font-size: 13px;
  font-weight: 700;
}

.payroll-history-table {
  min-width: 1600px;
}

.payroll-history-table th:nth-child(1),
.payroll-history-table td:nth-child(1) {
  min-width: 150px;
}

.payroll-history-table th:nth-child(2),
.payroll-history-table td:nth-child(2),
.payroll-history-table th:nth-child(10),
.payroll-history-table td:nth-child(10) {
  white-space: nowrap;
}

.payroll-history-table th:nth-child(6),
.payroll-history-table td:nth-child(6),
.payroll-history-table th:nth-child(7),
.payroll-history-table td:nth-child(7),
.payroll-history-table th:nth-child(8),
.payroll-history-table td:nth-child(8) {
  min-width: 170px;
}

.payroll-history-table th:nth-child(11),
.payroll-history-table td:nth-child(11) {
  min-width: 120px;
}

.payroll-detail-panel {
  display: grid;
  gap: 16px;
}

.detail-grid {
  align-items: start;
}

.detail-grid section {
  display: grid;
  gap: 12px;
}

.detail-table {
  min-width: 760px;
}

.detail-table-wrap {
  border-radius: 10px;
}

.notes-layout {
  grid-template-columns: minmax(360px, 1.05fr) minmax(320px, 0.95fr);
  align-items: start;
}

.notes-panel-header {
  align-items: flex-start;
}

.progress-note-filters {
  justify-content: flex-start;
}

.progress-note-list {
  display: grid;
  gap: 10px;
}

.progress-note-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  width: 100%;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  text-align: left;
}

.progress-note-row.active {
  border-color: rgba(0, 110, 91, 0.45);
  background: var(--mint);
}

.progress-note-row span {
  min-width: 0;
}

.progress-note-row strong,
.progress-note-row small,
.progress-note-row em {
  display: block;
  overflow-wrap: anywhere;
}

.progress-note-row small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.progress-note-row em {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
  font-style: normal;
  line-height: 1.35;
}

.progress-note-preview {
  display: grid;
  gap: 14px;
}

.progress-note-preview p {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

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

.progress-note-detail-grid .notice {
  overflow-wrap: anywhere;
}

.signature-box {
  display: grid;
  gap: 4px;
  padding: 14px;
  border-radius: 10px;
  background: var(--paper);
}

.signature-box span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.signature-box strong {
  font-size: 24px;
  font-style: italic;
  overflow-wrap: anywhere;
}

.progress-note-review-form {
  display: grid;
  grid-template-columns: minmax(160px, 0.7fr) minmax(220px, 1.2fr) auto;
  gap: 12px;
  align-items: end;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.progress-note-review-form textarea {
  min-height: 74px;
  resize: vertical;
}

.audit-list {
  display: grid;
  gap: 10px;
  max-height: 360px;
  overflow: auto;
}

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

.field {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.field.full {
  grid-column: 1 / -1;
}

.field-help {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

label {
  font-size: 13px;
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  padding: 10px 12px;
  outline: none;
}

textarea {
  min-height: 88px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(0, 110, 91, 0.14);
}

.stack {
  display: grid;
  gap: 12px;
}

.notice {
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.notice.warning {
  border-color: rgba(226, 166, 0, 0.34);
  background: var(--amber-soft);
  color: var(--ink);
}

.notice.danger {
  border-color: rgba(226, 0, 0, 0.28);
  background: var(--red-soft);
  color: var(--ink);
}

.provider-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--mint);
}

.exception-card {
  display: grid;
  gap: 12px;
}

.login-screen {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 420px;
}

.login-story {
  padding: 58px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background:
    linear-gradient(135deg, rgba(0, 110, 91, 0.12), transparent 42%),
    var(--paper);
}

.login-card {
  align-self: center;
  margin: 40px;
  padding: 24px;
}

.login-title {
  max-width: 850px;
  font-size: 34px;
  font-weight: 900;
}

.login-proof {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.proof-box {
  padding: 16px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid var(--line);
}

.proof-box strong {
  display: block;
  margin-bottom: 4px;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 20;
  max-width: 420px;
  padding: 13px 16px;
  border-radius: 12px;
  background: var(--green);
  color: #fff;
  box-shadow: var(--shadow);
}

code {
  white-space: pre-wrap;
  color: var(--muted);
}

.brand-mark-web {
  background: transparent;
  border-radius: 0;
  color: var(--green);
}

.tg-logo-symbol {
  width: 100%;
  height: 100%;
  display: block;
  fill: currentColor;
}

.nav-badge {
  margin-left: auto;
  min-width: 22px;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  text-align: center;
  font-size: 10px;
  font-weight: 800;
}

.sidebar-profile {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: 40px 1fr auto;
  align-items: center;
  gap: 8px;
  min-width: 0;
  margin-top: 16px;
  padding: 12px 8px;
  border-radius: 12px;
  background: var(--paper);
}

.sidebar-profile strong,
.sidebar-profile small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.avatar-sm,
.top-avatar,
.avatar-xs {
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(0, 110, 91, 0.12);
  color: var(--green);
  font-weight: 800;
}

.avatar-sm {
  width: 40px;
  height: 40px;
}

.avatar-xs {
  width: 24px;
  height: 24px;
  margin-right: 8px;
  font-size: 9px;
}

.sidebar-profile small,
.profile-more {
  color: var(--muted);
}

.top-search {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 280px;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 20px;
  background: var(--paper);
  color: var(--muted-light);
  font-size: 12px;
}

.icon-button,
.top-avatar {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 20px;
  background: var(--paper);
  color: var(--ink);
}

.top-avatar {
  width: 44px;
}

.agency-login {
  grid-template-columns: 1fr 1fr;
  background: var(--paper);
}

.figma-brand-panel {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  padding: 56px 48px;
  background: var(--green);
  color: #fff;
}

.brand-orb {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

.brand-orb-top {
  top: -80px;
  right: -80px;
  width: 260px;
  height: 260px;
  background: rgba(255, 255, 255, 0.10);
}

.brand-orb-bottom {
  left: -110px;
  bottom: -80px;
  width: 420px;
  height: 420px;
  background: rgba(255, 255, 255, 0.10);
}

.login-brand-row {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 14px;
  font-weight: 900;
  font-size: 18px;
}

.login-brand-row img {
  width: 38px;
  height: 38px;
}

.login-brand-row .tg-logo-symbol {
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
}

.login-story-copy {
  position: relative;
  z-index: 1;
  max-width: 624px;
  margin-top: 160px;
}

.login-story-copy h1 {
  margin: 0;
  max-width: 624px;
  color: #fff;
  font-family: "Darker Grotesque", Poppins, sans-serif;
  font-size: 48px;
  font-weight: 900;
  line-height: 1.16;
}

.login-story-copy p {
  margin: 78px 0 0;
  max-width: 564px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 16px;
  line-height: 1.65;
}

.figma-proof {
  position: relative;
  z-index: 1;
  margin-top: 76px;
  max-width: 568px;
}

.figma-proof .proof-box {
  min-height: 80px;
  border: 0;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.figma-proof .proof-box strong {
  font-family: "Darker Grotesque", Poppins, sans-serif;
  font-size: 28px;
  line-height: 1;
}

.figma-proof .proof-box span {
  color: rgba(255, 255, 255, 0.72);
  font-size: 11px;
}

.login-copyright {
  position: absolute;
  left: 48px;
  bottom: 52px;
  color: rgba(255, 255, 255, 0.5);
  font-size: 11px;
}

.login-form-panel {
  position: relative;
  min-height: 100vh;
  background: #fff;
}

.signup-prompt {
  position: absolute;
  top: 32px;
  right: 24px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
}

.figma-login-form {
  width: 480px;
  margin: 196px 0 0 120px;
}

.form-heading h1 {
  margin: 0 0 8px;
  font-size: 40px;
}

.form-heading p {
  margin: 0 0 34px;
  color: var(--muted);
}

.figma-login-form .field {
  margin-bottom: 16px;
}

.figma-login-form input {
  height: 52px;
  border-radius: 12px;
}

.login-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 6px 0 24px;
  color: var(--ink-soft);
  font-size: 12px;
}

.login-options label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.login-options input {
  width: 18px;
  height: 18px;
  accent-color: var(--green);
}

.login-options button {
  border: 0;
  background: transparent;
  color: var(--green);
  font-weight: 800;
}

.figma-login-form > .button {
  width: 100%;
  height: 56px;
  border-radius: 28px;
}

.login-divider {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 40px;
  align-items: center;
  margin: 32px 0 28px;
  color: var(--muted-light);
  font-size: 11px;
  font-style: normal;
}

.login-divider span {
  height: 1px;
  background: var(--line);
}

.login-divider em {
  font-style: normal;
}

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

.sso-row .ghost-button {
  justify-content: center;
  height: 48px;
  border-radius: 24px;
}

.login-demo-note {
  margin-top: 16px;
  text-align: center;
}

.figma-metrics {
  gap: 16px;
}

.figma-metric {
  min-height: 116px;
  display: grid;
  align-content: start;
  gap: 8px;
}

.metric-trend {
  color: var(--green);
  font-size: 11px;
  font-weight: 800;
}

.metric-trend.warn {
  color: var(--amber);
}

.metric-trend.bad {
  color: var(--red);
}

.dashboard-figma-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(320px, 1fr);
  gap: 24px;
  margin-top: 24px;
}

.figma-chart-panel,
.figma-approval-panel {
  min-height: 0;
}

.figma-chart-panel {
  height: 360px;
}

.figma-activity-panel {
  height: 360px;
}

.figma-approval-panel {
  height: 268px;
}

.figma-med-panel {
  height: 268px;
}

/* ===================================================================
   Figma web-parity shared components
   =================================================================== */

/* Topbar: per-view subtitle + breadcrumb */
.topbar-heading {
  min-width: 0;
}

.topbar-subtitle {
  margin-top: 6px;
  font-size: 12px;
  font-weight: 500;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 2px;
  font-size: 11px;
  color: var(--muted);
}

.crumb-back {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 0;
  font-size: 11px;
  font-weight: 600;
}

.crumb-back:hover {
  color: var(--green);
}

.crumb-sep {
  color: var(--muted-light);
}

.crumb-current {
  color: var(--ink-soft);
  font-weight: 600;
}

/* Sidebar 'More' section label */
.nav-section {
  margin: 16px 8px 4px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted-light);
}

/* Per-view toolbar row (between topbar and content) */
.page-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.page-toolbar .spacer {
  flex: 1 1 auto;
}

/* Segment / filter pills */
.seg-bar {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.seg-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 7px 16px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 600;
}

.seg-pill .seg-count {
  color: var(--muted-light);
  font-weight: 700;
}

.seg-pill.active {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}

.seg-pill.active .seg-count {
  color: rgba(255, 255, 255, 0.8);
}

/* Filter dropdown chip */
.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 0 8px 0 14px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 600;
}

.filter-chip select {
  border: 0;
  background: transparent;
  font-weight: 600;
  color: var(--ink-soft);
  cursor: pointer;
}

/* Search pill */
.search-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 16px;
  border-radius: 20px;
  background: var(--paper);
  color: var(--muted);
  font-size: 13px;
  min-width: 240px;
}

.search-pill input {
  border: 0;
  background: transparent;
  flex: 1;
  min-width: 0;
  color: var(--ink);
}

/* Segmented control */
.segmented {
  display: inline-flex;
  padding: 4px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: var(--surface);
  gap: 2px;
}

.segmented button {
  border: 0;
  background: transparent;
  min-height: 30px;
  padding: 0 16px;
  border-radius: 16px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

.segmented button.active {
  background: var(--green);
  color: #fff;
}

/* Stat / KPI cards */
.stat-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px 19px;
  min-width: 0;
}

.stat-card .stat-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.stat-card .stat-value {
  margin-top: 8px;
  font-family: "Darker Grotesque", Poppins, sans-serif;
  font-size: 36px;
  font-weight: 800;
  line-height: 1;
  color: var(--ink);
}

.stat-card.kpi .stat-value {
  font-size: 28px;
}

.stat-card .stat-sub {
  margin-top: 10px;
  font-size: 11px;
  font-weight: 700;
}

.stat-sub.up {
  color: var(--green);
}

.stat-sub.warn {
  color: var(--amber);
}

.stat-sub.down {
  color: var(--red);
}

/* Avatars */
.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(0, 110, 91, 0.12);
  color: var(--green);
  font-weight: 700;
  flex: 0 0 auto;
  overflow: hidden;
}

.avatar.sz-24 { width: 24px; height: 24px; font-size: 9px; }
.avatar.sz-28 { width: 28px; height: 28px; font-size: 10px; }
.avatar.sz-32 { width: 32px; height: 32px; font-size: 11px; }
.avatar.sz-40 { width: 40px; height: 40px; font-size: 14px; }
.avatar.sz-48 { width: 48px; height: 48px; font-size: 16px; }
.avatar.sz-88 { width: 88px; height: 88px; font-size: 30px; }

/* Tab pills */
.tab-pills {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.tab-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 7px 16px;
  border-radius: 18px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.tab-pill .tab-count {
  color: var(--muted-light);
}

.tab-pill.active {
  background: var(--green);
  color: #fff;
}

.tab-pill.active .tab-count {
  color: rgba(255, 255, 255, 0.8);
}

.tab-pill:not(.active):hover {
  background: var(--paper);
}

/* Generic data card (white, 14px radius) */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 20px 22px;
  min-width: 0;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink-soft);
}

/* Figma-style borderless data table */
.fig-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 0;
}

.fig-table th {
  text-transform: uppercase;
  font-size: 10px;
  font-weight: 700;
  color: var(--muted-light);
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  letter-spacing: 0.02em;
}

.fig-table td {
  font-size: 12px;
  color: var(--ink-soft);
  padding: 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

.fig-table tr:last-child td {
  border-bottom: 0;
}

.fig-table .cell-strong {
  font-weight: 600;
  color: var(--ink-soft);
}

.cell-id {
  display: flex;
  align-items: center;
  gap: 10px;
}

.cell-id .id-sub {
  color: var(--muted);
  font-size: 10px;
  font-weight: 500;
}

/* Roster / status badges */
.s-badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 3px 10px;
  border-radius: 11px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.s-badge.active,
.s-badge.approved,
.s-badge.ok { background: rgba(0, 110, 91, 0.12); color: var(--green); }
.s-badge.onboarding,
.s-badge.pending,
.s-badge.late { background: rgba(226, 166, 0, 0.16); color: #8a6d00; }
.s-badge.leave,
.s-badge.inactive { background: rgba(171, 171, 171, 0.18); color: var(--muted); }
.s-badge.refused,
.s-badge.danger { background: rgba(226, 0, 0, 0.12); color: var(--red); }

/* Pagination */
.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 16px;
}

.pager-info {
  color: var(--muted);
  font-size: 11px;
}

.pager-controls {
  display: flex;
  gap: 6px;
}

.pager-controls button {
  width: 32px;
  height: 32px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 600;
}

.pager-controls button.active {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}

/* Removable / tag chips */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 16px;
  font-size: 12px;
  font-weight: 600;
}

.chip.solid {
  background: rgba(0, 110, 91, 0.1);
  border: 1px solid rgba(0, 110, 91, 0.3);
  color: var(--green);
}

.chip.ghost {
  background: transparent;
  border: 1px dashed var(--line-strong);
  color: var(--muted);
}

.chip.tag {
  background: var(--paper);
  color: var(--muted);
  min-height: 24px;
  font-size: 11px;
}

/* Floating-label form field */
.float-field {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 14px 7px;
  background: var(--surface);
}

.float-field label {
  display: block;
  font-size: 10px;
  color: var(--muted-light);
  font-weight: 600;
}

.float-field input,
.float-field select,
.float-field textarea {
  width: 100%;
  border: 0;
  background: transparent;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
  padding: 2px 0 0;
}

.float-field textarea {
  resize: vertical;
  min-height: 60px;
  font-weight: 500;
}

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

.float-grid.cols-1 { grid-template-columns: 1fr; }
.float-grid .span-2 { grid-column: 1 / -1; }

.section-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted-light);
  margin: 8px 0 2px;
}

/* Toggle switch */
.toggle {
  width: 40px;
  height: 22px;
  border-radius: 11px;
  background: var(--line-strong);
  position: relative;
  border: 0;
  flex: 0 0 auto;
}

.toggle.on {
  background: var(--green);
}

.toggle::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  transition: left 0.15s;
}

.toggle.on::after {
  left: 20px;
}

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
}

/* Two-column page layout (detail/add screens) */
.split-2 {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(320px, 1fr);
  gap: 16px;
  align-items: start;
}

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

/* Stepper (wizard) */
.stepper {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: 18px;
}

.stepper .step {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--muted-light);
  font-size: 12px;
  font-weight: 600;
}

.stepper .step .step-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line-strong);
  font-size: 11px;
}

.stepper .step.active { color: var(--ink-soft); }
.stepper .step.active .step-num {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}

.stepper .step-line {
  flex: 1 1 auto;
  height: 1px;
  background: var(--line);
  margin: 0 14px;
  min-width: 24px;
}

/* Form action footer */
.form-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 18px;
}

.form-actions .spacer { flex: 1 1 auto; }

/* Card grid (patients, locations) */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

/* Patient card */
.patient-card {
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 184px;
}

.patient-card:hover {
  border-color: rgba(0, 110, 91, 0.45);
}

.pc-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.pc-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-soft);
}

.pc-sub {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}

.pc-meta {
  font-size: 11px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pc-foot {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.pc-care {
  font-size: 11px;
  color: var(--muted-light);
}

/* Patient detail header */
.patient-header {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 18px;
}

.ph-main {
  min-width: 0;
  flex: 0 0 auto;
}

.ph-name {
  font-family: "Darker Grotesque", Poppins, sans-serif;
  font-size: 30px;
  font-weight: 800;
  color: var(--ink);
  line-height: 1.05;
}

.ph-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.ph-stats {
  display: flex;
  gap: 28px;
  margin-left: 16px;
  flex: 1;
  min-width: 0;
}

.ph-stat-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted-light);
}

.ph-stat-value {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-soft);
  margin-top: 6px;
}

.ph-actions {
  display: flex;
  gap: 10px;
  margin-left: auto;
  flex: 0 0 auto;
}

.med-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}

.med-row:last-child {
  border-bottom: 0;
}

.care-line {
  font-size: 12px;
  color: var(--ink-soft);
  padding: 7px 0;
}

details > summary::-webkit-details-marker {
  display: none;
}

/* float-field that uses a <span> as its label (Add Visit) */
.float-field > span {
  display: block;
  font-size: 10px;
  color: var(--muted-light);
  font-weight: 600;
}

/* ---- Care Plan Editor ---- */
.cp-tabs { margin-bottom: 16px; }
.cp-card { padding: 23px 31px; }
.cp-head { align-items: flex-start; margin-bottom: 0; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.cp-helper { font-size: 12px; color: var(--muted); margin-top: 6px; }
.cp-rows { display: grid; gap: 14px; padding-top: 16px; }
.cp-row {
  display: grid;
  grid-template-columns: 18px minmax(0, 360px) 180px 120px minmax(0, 1fr) 28px;
  align-items: center;
  gap: 16px;
}
.cp-grip { color: var(--muted-light); font-weight: 700; font-size: 14px; cursor: grab; user-select: none; }
.cp-cell { background: var(--paper); border-radius: 10px; min-height: 48px; padding: 0 14px; display: flex; align-items: center; color: var(--ink-soft); }
.cp-name { font-weight: 600; font-size: 13px; }
.cp-freq, .cp-dur { font-size: 12px; }
.cp-note { font-size: 11px; color: var(--muted); line-height: 1.35; }
.cp-note.is-empty { color: var(--muted-light); }
.cp-del { border: 0; background: none; cursor: pointer; padding: 0; font-size: 14px; color: var(--muted); line-height: 1; justify-self: center; }
.cp-del:hover { color: var(--red); }
.cp-footer { display: flex; align-items: center; gap: 12px; margin-top: 16px; }
.cp-saved { display: inline-flex; align-items: center; background: var(--mint); color: var(--green); font-size: 11px; font-weight: 600; padding: 7px 16px; border-radius: 15px; white-space: nowrap; }

/* ---- Add Employee ---- */
.ae-grid { margin-bottom: 4px; }
.ae-mt { margin-top: 4px; }
.ae-chips { gap: 8px; }
.ae-chip-x { border: 0; background: transparent; cursor: pointer; color: var(--green); font-size: 14px; line-height: 1; padding: 0; margin-left: 2px; }
.ae-chip-add { cursor: pointer; }
.ae-docs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 24px; margin-top: 4px; }
.ae-check { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--ink-soft); cursor: pointer; }
.ae-check input { position: absolute; opacity: 0; width: 0; height: 0; }
.ae-check-box { width: 16px; height: 16px; border-radius: 3px; border: 1px solid var(--line); background: var(--surface); display: inline-flex; align-items: center; justify-content: center; color: transparent; font-size: 11px; font-weight: 700; flex: 0 0 auto; }
.ae-check input:checked + .ae-check-box { background: var(--green); border-color: var(--green); color: #fff; }
.ae-preview { background: rgba(0, 110, 91, 0.04); border-color: rgba(0, 110, 91, 0.2); display: flex; flex-direction: column; gap: 16px; }
.ae-preview-title { font-size: 13px; font-weight: 600; color: var(--green); }
.ae-preview-sub { font-size: 11px; color: var(--muted); margin-top: 2px; }
.ae-email { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 13px; }
.ae-email-from { font-size: 11px; font-weight: 600; color: var(--muted); }
.ae-email-subj { font-size: 12px; font-weight: 600; color: var(--ink-soft); margin-top: 4px; }
.ae-email-rule { height: 1px; background: var(--line); margin: 12px 0; }
.ae-email-hi { font-size: 13px; font-weight: 600; color: var(--ink-soft); }
.ae-email-body { font-size: 11px; font-weight: 500; color: var(--ink-soft); line-height: 1.6; margin: 8px 0 0; }
.ae-email-cta { text-align: center; margin: 18px 0; }
.ae-email-btn { display: inline-block; background: var(--green); color: #fff; font-size: 12px; font-weight: 600; padding: 12px 28px; border-radius: 20px; }
.ae-email-copy { font-size: 10px; color: var(--muted); line-height: 1.4; margin-bottom: 14px; }
.ae-email-need { font-size: 11px; font-weight: 600; color: var(--ink-soft); }
.ae-email-list { list-style: none; margin: 6px 0 0; padding: 0; }
.ae-email-list li { font-size: 10px; color: var(--muted); line-height: 1.6; }
.ae-email-list li::before { content: "• "; }
.ae-email-sign { font-size: 11px; font-weight: 500; color: var(--ink-soft); line-height: 1.5; margin-top: 14px; }

/* ---- Add Visit ---- */
.card-sub { margin: 2px 0 0; font-size: 12px; color: var(--muted); }
.task-list { display: flex; flex-direction: column; gap: 12px; }
.task-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; border: 1px solid var(--line); border-radius: 8px; padding: 12px 16px; background: var(--surface); }
.task-row-title { display: block; font-size: 13px; font-weight: 600; color: var(--ink-soft); }
.task-row-desc { margin: 3px 0 0; font-size: 11px; color: var(--muted); }
.task-flag { flex: 0 0 auto; font-size: 12px; font-weight: 600; color: var(--green); }

/* ---- Permissions & Roles ---- */
.role-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
.role-card { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; }
.role-dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; vertical-align: middle; margin-right: 8px; }
.role-dot-red { background: var(--red); }
.role-dot-green { background: var(--green); }
.role-dot-blue { background: var(--blue); }
.role-dot-violet { background: var(--violet); }
.role-dot-grey { background: var(--muted-light); }
.role-name { display: inline-block; font-size: 14px; font-weight: 600; color: var(--ink-soft); }
.role-users { margin-top: 4px; margin-left: 20px; font-size: 11px; font-weight: 500; color: var(--muted); }
.role-summary { margin-top: 14px; font-size: 11px; font-weight: 500; color: var(--muted); }
.role-edit { position: absolute; right: 18px; bottom: 16px; font-size: 11px; }
.perm-matrix-sub { margin: 2px 0 0; font-size: 11px; }
.perm-table-wrap { overflow-x: auto; }
.perm-table th.perm-col, .perm-table td.perm-col { text-align: center; width: 110px; }
.perm-cell { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 50%; box-sizing: border-box; }
.perm-cell.perm-on { background: var(--green); }
.perm-on .perm-mark { color: #fff; font-size: 13px; font-weight: 700; line-height: 1; }
.perm-cell.perm-off { background: transparent; border: 1px solid var(--line); }
.perm-off .perm-mark { color: var(--muted-light); font-size: 13px; font-weight: 500; line-height: 1; }

/* ---- Locations ---- */
.loc-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 16px; }
.loc-card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 15px; min-width: 0; }
.loc-map { height: 100px; border-radius: 8px; margin-bottom: 12px; display: flex; align-items: center; justify-content: center; background: radial-gradient(120% 120% at 70% 30%, var(--mint) 0%, rgba(230, 241, 238, 0) 60%), linear-gradient(135deg, var(--paper) 0%, var(--mint) 100%); border: 1px solid var(--line); }
.loc-pin { font-size: 22px; line-height: 1; filter: drop-shadow(0 1px 1px rgba(19, 19, 19, 0.18)); }
.loc-name { font-size: 14px; font-weight: 600; color: var(--ink-soft); margin-bottom: 6px; }
.loc-meta { font-size: 11px; font-weight: 500; color: var(--muted); line-height: 1.45; }
.service-area-card { padding: 0; overflow: hidden; }
.service-area-card .card-head { margin: 0; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.service-area-map { position: relative; height: 480px; overflow: hidden; background: repeating-linear-gradient(to right, var(--line) 0, var(--line) 1px, transparent 1px, transparent 48px), repeating-linear-gradient(to bottom, var(--line) 0, var(--line) 1px, transparent 1px, transparent 48px); background-color: var(--paper); }
.sam-circle { position: absolute; border-radius: 50%; transform: translate(-50%, -50%); display: flex; align-items: center; justify-content: center; }
.sam-circle .sam-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px rgba(0, 110, 91, 0.18); }
.sam-a { width: 320px; height: 320px; left: 25%; top: 50%; background: rgba(0, 110, 91, 0.10); }
.sam-b { width: 400px; height: 400px; left: 50%; top: 42%; background: rgba(0, 110, 91, 0.14); }
.sam-c { width: 360px; height: 360px; left: 78%; top: 62%; background: rgba(0, 110, 91, 0.18); }

/* ---- Report Builder ---- */
.chip.chip-blue { background: var(--blue-soft); border: 1px solid var(--blue-soft); color: var(--blue); }
.report-preview-card { display: flex; flex-direction: column; }
.report-column-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.report-preview-card .form-actions { margin-top: auto; }

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

/* ---- Medication Report ---- */
.med-report-grid { display: grid; grid-template-columns: 380px minmax(0, 1fr); gap: 16px; margin-bottom: 16px; }
.med-date-chip { cursor: default; color: var(--ink-soft); }
.donut-wrap { display: flex; align-items: center; gap: 22px; }
.donut { position: relative; width: 160px; height: 160px; border-radius: 50%; flex: 0 0 auto; }
.donut-hole { position: absolute; inset: 26px; background: var(--surface); border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; }
.donut-value { font-family: "Darker Grotesque", Poppins, sans-serif; font-weight: 800; font-size: 36px; line-height: 1; color: var(--green); }
.donut-sub { font-size: 10px; font-weight: 600; letter-spacing: 0.04em; color: var(--muted); }
.donut-legend { flex: 1 1 auto; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.donut-legend-row { display: flex; align-items: center; gap: 10px; }
.donut-dot { width: 10px; height: 10px; border-radius: 50%; flex: 0 0 auto; }
.donut-legend-label { font-size: 12px; font-weight: 500; color: var(--ink-soft); }
.donut-legend-count { margin-left: auto; font-size: 12px; font-weight: 700; color: var(--ink-soft); }
.med-goal-caption { font-size: 11px; font-weight: 600; color: var(--green); }
.mr-bars { position: relative; display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; height: 200px; padding: 16px 4px 0; }
.mr-goal { position: absolute; left: 0; right: 0; height: 1px; background: rgba(0, 110, 91, 0.4); pointer-events: none; }
.mr-col { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; height: 100%; }
.mr-value { font-size: 10px; font-weight: 600; color: var(--ink-soft); margin-bottom: 4px; }
.mr-track { flex: 1 1 auto; width: 100%; max-width: 60px; display: flex; align-items: flex-end; }
.mr-fill { width: 100%; border-radius: 6px; min-height: 4px; }
.mr-fill.good { background: rgba(0, 110, 91, 0.85); }
.mr-fill.warn { background: rgba(226, 166, 0, 0.85); }
.mr-day { font-size: 10px; font-weight: 500; color: var(--muted); margin-top: 8px; }
.mr-day.is-today { color: var(--green); font-weight: 600; }
.med-action-sub { font-size: 11px; margin-top: 2px; }
.med-note { font-style: italic; font-size: 11px; color: var(--muted); line-height: 16px; display: inline-block; max-width: 220px; }
.med-actions { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.med-btn-accept, .med-btn-refuse { min-width: 76px; min-height: 32px; padding: 0 12px; border-radius: 16px; font-size: 11px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.med-btn-accept { background: var(--green); border: 1px solid var(--green); color: #fff; }
.med-btn-accept:hover { background: var(--green-dark); border-color: var(--green-dark); }
.med-btn-refuse { background: var(--surface); border: 1px solid var(--red); color: var(--red); }
.med-btn-refuse:hover { background: rgba(226, 0, 0, 0.06); }
@media (max-width: 1100px) { .med-report-grid { grid-template-columns: 1fr; } }

/* ---- Announcements ---- */
.ann-feed { display: flex; flex-direction: column; gap: 16px; }
.ann-card { padding: 18px; position: relative; }
.ann-card-pinned { border: 2px solid var(--green); padding: 17px; }
.ann-pin-pill { display: inline-flex; align-items: center; height: 22px; padding: 0 12px; margin-bottom: 12px; border-radius: 11px; background: var(--green); color: #fff; font-size: 10px; font-weight: 800; }
.ann-meta { display: flex; align-items: flex-start; gap: 12px; }
.ann-avatar { margin-top: 2px; }
.ann-byline { flex: 1 1 auto; min-width: 0; }
.ann-byline-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ann-author { font-size: 13px; font-weight: 600; color: var(--ink-soft); }
.ann-role { padding: 2px 8px; font-size: 9px; }
.ann-when { font-size: 11px; font-weight: 500; color: var(--muted); margin-top: 3px; }
.ann-menu { flex: 0 0 auto; border: 0; background: transparent; color: var(--muted); font-size: 18px; font-weight: 700; line-height: 1; padding: 0 4px; cursor: pointer; }
.ann-menu:hover { color: var(--ink-soft); }
.ann-title { margin: 14px 0 0; font-size: 16px; font-weight: 600; color: var(--ink-soft); }
.ann-body { margin: 8px 0 0; font-size: 12px; font-weight: 500; line-height: 18px; color: var(--muted); }
.ann-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; }
.ann-tags { display: flex; gap: 8px; flex-wrap: wrap; }
.ann-stats { flex: 0 0 auto; font-size: 11px; font-weight: 500; color: var(--muted-light); white-space: nowrap; text-align: right; }
.ann-composer { padding: 22px; align-self: start; }
.ann-composer-title { margin: 0 0 4px; font-size: 14px; }
.ann-composer .section-label { margin-top: 18px; }
.ann-audience { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 44px; padding: 0 14px; border-radius: 10px; background: var(--mint); }
.ann-audience-text { font-size: 13px; font-weight: 600; color: var(--green); }
.ann-audience-change { border: 0; background: transparent; color: var(--green); font-size: 11px; font-weight: 700; cursor: pointer; }
.ann-field { margin-top: 8px; }
.ann-message { min-height: 120px; line-height: 18px; }
.ann-format-bar { display: flex; align-items: center; gap: 8px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.ann-tool-btn { width: 30px; height: 26px; border: 0; background: transparent; color: var(--muted); font-size: 13px; font-weight: 600; border-radius: 6px; cursor: pointer; }
.ann-tool-btn:hover { background: var(--paper); color: var(--ink-soft); }
.ann-tag-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.ann-tag-on { min-height: 28px; border-radius: 14px; background: rgba(0, 110, 91, 0.1); color: var(--green); font-size: 11px; font-weight: 600; }
.ann-tag-add { min-height: 28px; border-radius: 14px; background: var(--paper); border: 1px solid var(--line); color: var(--muted); font-size: 11px; font-weight: 600; cursor: pointer; }
.ann-tag-add:hover { color: var(--ink-soft); }
.ann-toggles { margin-top: 12px; }
.ann-toggle-label { font-size: 12px; font-weight: 600; color: var(--ink-soft); }
.toggle[data-toggle-card] { cursor: pointer; }
.ann-composer-foot { display: flex; gap: 12px; margin-top: 16px; }
.ann-post-btn { flex: 1 1 auto; }

/* ---- Reports & Analytics ---- */
.reports-charts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
.page-toolbar .range-pill { background: var(--surface); border: 1px solid var(--line); color: var(--ink-soft); font-weight: 600; border-radius: 20px; padding: 10px 18px; }
.line-chart { width: 100%; height: 200px; display: block; overflow: visible; }
.line-chart .lc-line { fill: none; stroke: var(--green); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.line-chart .lc-dot { fill: var(--green); }
.line-chart .lc-label { fill: var(--muted-light); font-family: Poppins, sans-serif; font-size: 10px; font-weight: 500; text-anchor: middle; }
.bar-roles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); align-items: end; gap: 16px; height: 200px; padding-top: 8px; }
.bar-role { display: grid; grid-template-rows: auto 1fr auto; align-items: end; justify-items: center; height: 100%; gap: 8px; }
.bar-role-value { font-size: 10px; font-weight: 600; color: var(--ink-soft); }
.bar-role-col { display: flex; align-items: flex-end; justify-content: center; width: 100%; height: 100%; }
.bar-role-fill { width: 80px; max-width: 100%; border-radius: 8px; }
.bar-role-fill.green { background: var(--green); }
.bar-role-fill.violet { background: var(--violet); }
.bar-role-fill.blue { background: var(--blue); }
.bar-role-label { font-size: 10px; font-weight: 500; color: var(--muted); }
.reports-saved .saved-list { display: flex; flex-direction: column; }
.saved-row { display: flex; align-items: center; gap: 12px; padding: 14px 0; border-top: 1px solid var(--line); }
.saved-row:first-child { border-top: 0; }
.saved-icon { font-size: 16px; line-height: 1; }
.saved-text { flex: 1 1 auto; min-width: 0; }
.saved-title { font-size: 13px; font-weight: 600; color: var(--ink-soft); }
.saved-meta { margin-top: 2px; font-size: 11px; font-weight: 500; color: var(--muted); }
.saved-run { flex: 0 0 auto; }
@media (max-width: 900px) { .reports-charts { grid-template-columns: minmax(0, 1fr); } }

/* ---- Agency Users ---- */
.user-row-list { display: flex; flex-direction: column; gap: 12px; }
.user-row { display: flex; align-items: center; gap: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px 18px; }
.user-row-id { min-width: 0; flex: 1 1 auto; }
.user-row-name { font-size: 13px; font-weight: 600; color: var(--ink); }
.user-row-sub { margin-top: 2px; font-size: 11px; color: var(--muted); }
.user-row-controls { display: flex; align-items: center; gap: 12px; flex: 0 0 auto; }
.user-role-form { display: inline-flex; align-items: center; gap: 8px; }
.user-role-form select { min-height: 34px; padding: 0 12px; border: 1px solid var(--line); border-radius: 17px; background: var(--surface); color: var(--ink-soft); font-size: 12px; font-weight: 600; }
.user-row-access { font-size: 12px; }
.au-mt { margin-top: 14px; }
.au-perm-chips { margin-top: 2px; }
.au-perm { font-weight: 600; border: 1px solid transparent; }
.au-perm-mint { background: var(--mint); color: var(--green); border-color: rgba(0, 110, 91, 0.18); }
.au-perm-blue { background: var(--blue-soft); color: var(--blue); border-color: rgba(30, 107, 184, 0.2); }
.au-perm-grey { background: var(--paper); color: var(--muted); border-color: var(--line); }

.panel-title-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 16px;
}

.panel-title-row h2 {
  margin: 0;
  color: var(--ink-soft);
  font-size: 15px;
}

.chart-legend {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 11px;
}

.dot {
  width: 8px;
  height: 8px;
  display: inline-block;
  border-radius: 50%;
}

.dot.green {
  background: var(--green);
}

.dot.amber {
  background: var(--amber);
}

.dot.red {
  background: var(--red);
}

.bar-chart {
  display: grid;
  grid-template-columns: repeat(13, minmax(28px, 1fr));
  align-items: end;
  gap: 14px;
  height: 286px;
  padding-top: 12px;
}

.bar-item {
  display: grid;
  justify-items: center;
  align-items: end;
  gap: 10px;
  height: 100%;
}

.bar-stack {
  position: relative;
  width: 36px;
  max-height: 216px;
  border-radius: 6px;
  background: rgba(0, 110, 91, 0.85);
}

.bar-stack span {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 10px;
  border-radius: 4px;
  background: var(--amber);
}

.bar-item small {
  color: var(--muted-light);
  font-size: 10px;
}

.activity-list {
  display: grid;
  gap: 2px;
}

.activity-item {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  align-items: start;
  gap: 4px;
  min-height: 50px;
  padding: 6px 0;
}

.activity-item strong,
.activity-item small {
  display: block;
}

.activity-item strong {
  color: var(--ink-soft);
  font-size: 12px;
}

.activity-item small,
.activity-item em {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
}

.activity-item em {
  color: var(--muted-light);
  font-size: 10px;
}

.figma-table {
  display: grid;
}

.figma-table-head,
.figma-table-row {
  display: grid;
  grid-template-columns: 1.3fr 1.05fr 0.7fr 0.9fr 90px;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  border-bottom: 1px solid var(--line);
}

.figma-table-head {
  min-height: 34px;
  color: var(--muted-light);
  font-size: 11px;
  font-weight: 700;
}

.figma-table-row {
  color: var(--ink-soft);
  font-size: 12px;
}

.figma-table-row > span:first-child {
  display: flex;
  align-items: center;
}

.approval-actions {
  display: flex;
  gap: 8px;
}

.approval-actions button {
  width: 38px;
  height: 26px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fff;
  color: var(--muted);
  font-weight: 800;
}

.approval-actions button:first-child {
  border-color: var(--green);
  background: var(--green);
  color: #fff;
}

.med-summary-body {
  display: grid;
  grid-template-columns: 110px 1fr;
  align-items: center;
  gap: 18px;
  margin: 16px 0 20px;
}

.donut {
  width: 100px;
  height: 100px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, #fff 0 52%, transparent 53%),
    conic-gradient(var(--green) 0 82%, var(--amber) 82% 96%, var(--red) 96% 100%);
  color: var(--green);
  font-family: "Darker Grotesque", Poppins, sans-serif;
  font-size: 24px;
  font-weight: 900;
  line-height: 0.9;
  text-align: center;
}

.donut small {
  display: block;
  color: var(--muted);
  font-family: Poppins, sans-serif;
  font-size: 9px;
}

.med-legend {
  display: grid;
  gap: 10px;
  font-size: 12px;
}

.med-legend div {
  display: grid;
  grid-template-columns: 14px 1fr auto;
  align-items: center;
  gap: 6px;
}

.soft-action {
  width: 100%;
  min-height: 40px;
  border: 0;
  border-radius: 20px;
  background: var(--mint);
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
}

.dashboard-extra-grid {
  display: grid;
  gap: 16px;
  margin-top: 24px;
}

@media (max-width: 1100px) {
  .shell,
  .login-screen {
    grid-template-columns: 1fr;
  }

  .figma-brand-panel,
  .login-form-panel {
    min-height: auto;
  }

  .login-story-copy {
    margin-top: 80px;
  }

  .figma-login-form {
    width: min(480px, calc(100% - 40px));
    margin: 56px auto;
  }

  .dashboard-figma-grid {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    overflow: visible;
  }

  .sidebar-footer,
  .sidebar-profile {
    position: static;
    margin-top: 18px;
  }

  .nav {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    overflow: visible;
    padding-right: 0;
  }

  .metrics,
  .two-col,
  .three-col,
  .four-col,
  .agency-onboarding-review-grid,
  .payroll-filter-bar,
  .notes-layout {
    grid-template-columns: 1fr;
  }

  .login-card {
    margin: 20px;
  }

  .top-search {
    width: min(280px, 100%);
  }
}

@media (max-width: 720px) {
  .main,
  .login-story {
    padding: 16px;
  }

  .topbar,
  .panel-header {
    flex-direction: column;
    align-items: stretch;
  }

  .review-panel-actions,
  .review-filter-bar {
    justify-items: stretch;
    justify-content: flex-start;
  }

  .form-grid,
  .nav,
  .login-proof,
  .sso-row,
  .client-checklist {
    grid-template-columns: 1fr;
  }

  .login-story-copy h1 {
    font-size: 38px;
  }

  .login-story-copy p {
    margin-top: 32px;
  }

  .bar-chart {
    gap: 6px;
    overflow-x: auto;
  }

  .bar-stack {
    width: 24px;
  }

  .figma-table-head,
  .figma-table-row {
    grid-template-columns: 1fr;
    gap: 4px;
    padding: 10px 0;
  }

  .handoff-form,
  .delivery-form,
  .reconciliation-form,
  .day-program-block,
  .day-program-group-form,
  .day-program-review-form,
  .visit-edit-form,
  .progress-note-review-form {
    grid-template-columns: 1fr;
    min-width: 220px;
  }

  .onboarding-public {
    padding: 12px;
  }

  .onboarding-shell {
    padding: 16px;
  }

  .onboarding-hero,
  .form-grid.two,
  .onboarding-review,
  .agency-onboarding-review-meta,
  .agency-onboarding-review-form,
  .credential-comparison-grid,
  .progress-note-detail-grid,
  .training-module-form,
  .training-module-card dl {
    grid-template-columns: 1fr;
  }

  .progress-note-row {
    grid-template-columns: 1fr;
  }

  .training-module-form .wide {
    grid-column: auto;
  }

  .onboarding-progress {
    grid-template-columns: repeat(2, 1fr);
  }

  .onboarding-create-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .agency-onboarding-review-card-header {
    flex-direction: column;
  }

  .onboarding-actions {
    flex-direction: column;
  }

  .day-program-group-form .wide,
  .day-program-review-form .wide,
  .visit-edit-form .wide {
    grid-column: auto;
  }

  .filter-actions {
    flex-direction: column;
    align-items: stretch;
  }

  h1 {
    font-size: 24px;
  }
}

/* ======================================================================
   Figma parity — Screen 1: Employees roster (renderUsers)
   ====================================================================== */
.emp-toolbar { margin-bottom: 16px; }

.emp-filter-card { padding: 10px 14px; margin-bottom: 16px; }
.emp-filter-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.emp-roster-card { padding: 0; overflow: hidden; }
.emp-roster-table { min-width: 920px; }
.emp-roster-table th:first-child,
.emp-roster-table td:first-child { padding-left: 22px; }
.emp-roster-table th:last-child,
.emp-roster-table td:last-child { padding-right: 22px; text-align: right; }
.emp-roster-table td { vertical-align: middle; }
.emp-muted { color: var(--muted); font-size: 11px; }

.emp-row-more {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 8px;
}
.emp-row-more:hover { background: var(--paper); color: var(--ink-soft); }

.emp-pager {
  padding: 12px 22px;
  border-top: 1px solid var(--line);
}

/* Collapsible details cards used to retain the legacy admin tooling */
.emp-details { margin-top: 16px; }
.emp-details > summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
}
.emp-details > summary::before {
  content: "▸";
  font-size: 11px;
  color: var(--muted);
  transition: transform 0.15s;
}
.emp-details[open] > summary::before { transform: rotate(90deg); }
.emp-details > summary::-webkit-details-marker { display: none; }
.emp-details-body { margin-top: 16px; }
.emp-details-body .grid { margin: 0; }

/* ======================================================================
   Figma parity — Screen 2: Schedule week calendar (renderSchedule)
   ====================================================================== */
.sch-toolbar { margin-bottom: 16px; gap: 12px; }
.sch-segmented { flex: 0 0 auto; }

.sch-calendar-card { padding: 0; overflow: hidden; }

.sch-grid-head {
  display: grid;
  grid-template-columns: 60px repeat(7, 1fr);
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}
.sch-gutter-cell { border-right: 1px solid var(--line-soft, #efefef); }
.sch-day-head {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 56px;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
}
.sch-day-head.is-today { color: var(--green); }
.sch-today-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(0, 110, 91, 0.12);
  color: var(--green);
  font-weight: 700;
}

.sch-grid-body { display: grid; grid-template-columns: 60px 1fr; }
.sch-gutter { position: relative; }
.sch-hour-label {
  height: 53.67px;
  padding: 4px 0 0 7px;
  font-size: 10px;
  color: var(--muted-light);
}

.sch-canvas { position: relative; }
.sch-hour-rule {
  height: 53.67px;
  border-bottom: 1px solid #efefef;
  box-sizing: border-box;
}
.sch-col-lines {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  pointer-events: none;
}
.sch-col-line { border-right: 1px solid #efefef; }
.sch-col-line:last-child { border-right: 0; }

.sch-block {
  position: absolute;
  background: var(--green);
  color: #fff;
  border-radius: 8px;
  padding: 8px;
  box-sizing: border-box;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: inset 0 0 0 2px var(--surface);
}
.sch-block.flagged { background: rgba(226, 166, 0, 0.85); color: var(--ink); }
.sch-block-client { font-size: 11px; font-weight: 600; line-height: 1.2; }
.sch-block-care { font-size: 10px; opacity: 0.85; }

.sch-now-line {
  position: absolute;
  height: 2px;
  background: var(--red);
  z-index: 3;
}
.sch-now-dot {
  position: absolute;
  left: -4px;
  top: -3px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--red);
}

.sch-details { margin-top: 16px; }
.sch-details > summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
}
.sch-details > summary::before {
  content: "▸";
  font-size: 11px;
  color: var(--muted);
  transition: transform 0.15s;
}
.sch-details[open] > summary::before { transform: rotate(90deg); }
.sch-details > summary::-webkit-details-marker { display: none; }
.sch-details-body { margin-top: 16px; }
.sch-details-body .grid { margin: 0; }

/* ======================================================================
   Figma parity — Screen 3: Time & Approvals master/detail (renderLive)
   ====================================================================== */
.appr-pills { width: 100%; }

.appr-layout {
  grid-template-columns: minmax(0, 1.95fr) minmax(320px, 1fr);
  align-items: start;
  gap: 16px;
}

.appr-list-card { align-self: stretch; }
.appr-list { display: flex; flex-direction: column; gap: 14px; }

.appr-card {
  display: grid;
  grid-template-columns: 22px 40px 1fr auto;
  gap: 14px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 15px;
}
.appr-card.selected { background: var(--mint); border-color: var(--green); }

.appr-check {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  border-radius: 4px;
  border: 1px solid var(--muted-light);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
}
.appr-check.on { background: var(--green); border-color: var(--green); }

.appr-name { font-size: 14px; font-weight: 600; color: var(--ink-soft); }
.appr-with { font-size: 12px; color: var(--muted); margin-top: 2px; }
.appr-meta { display: flex; align-items: center; gap: 12px; margin-top: 6px; font-size: 12px; color: var(--ink-soft); }
.appr-meta span { color: var(--muted); font-weight: 500; }
.appr-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }

.chip.mint {
  background: rgba(0, 110, 91, 0.12);
  color: var(--green);
  min-height: 20px;
  font-size: 9px;
  font-weight: 600;
  padding: 0 10px;
}
.chip.amber {
  background: rgba(226, 166, 0, 0.18);
  color: var(--ink);
  min-height: 20px;
  font-size: 9px;
  font-weight: 600;
  padding: 0 10px;
}

.appr-actions { display: flex; flex-direction: column; gap: 8px; }
.appr-approve {
  border: 0;
  background: var(--green);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  border-radius: 18px;
  padding: 9px 16px;
  cursor: pointer;
}
.appr-approve:hover { background: var(--green-dark); }
.appr-reject {
  border: 1px solid var(--red);
  background: transparent;
  color: var(--red);
  font-size: 12px;
  font-weight: 600;
  border-radius: 18px;
  padding: 8px 16px;
  cursor: pointer;
}

.appr-detail-card { position: sticky; top: 16px; }
.appr-total {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  background: rgba(0, 110, 91, 0.08);
  border-radius: 12px;
  padding: 14px 16px;
  margin: 14px 0 6px;
}
.appr-total-label { font-size: 10px; font-weight: 600; color: var(--green); }
.appr-total-value {
  font-family: "Darker Grotesque", Poppins, sans-serif;
  font-size: 32px;
  font-weight: 800;
  line-height: 1;
  color: var(--ink);
  margin-top: 4px;
}
.appr-total-range { font-size: 11px; color: var(--muted); margin-top: 8px; }
.appr-total-gross { text-align: right; }
.appr-total-gross strong { display: block; font-size: 14px; color: var(--green); }
.appr-total-gross span { font-size: 10px; color: var(--muted); }

.appr-evv, .appr-meds {
  list-style: none;
  margin: 6px 0 0;
  padding: 0;
}
.appr-evv li, .appr-meds li { font-size: 11px; color: var(--ink-soft); padding: 3px 0; }

.appr-note {
  margin: 6px 0 0;
  background: var(--paper);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 11px;
  font-style: italic;
  line-height: 1.5;
  color: var(--muted);
}

.appr-detail-approve { width: 100%; margin-top: 18px; }

.appr-details { margin-top: 16px; }
.appr-details > summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
}
.appr-details > summary::before {
  content: "▸";
  font-size: 11px;
  color: var(--muted);
  transition: transform 0.15s;
}
.appr-details[open] > summary::before { transform: rotate(90deg); }
.appr-details > summary::-webkit-details-marker { display: none; }
.appr-details-body { margin-top: 16px; }
.appr-details-body .grid { margin: 0; }

/* ======================================================================
   Figma parity — Screen 4: Payroll dashboard (renderPayroll)
   ====================================================================== */
.pay-integration {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(0, 110, 91, 0.06);
  border-radius: 8px;
  padding: 9px 14px;
  margin-bottom: 16px;
  font-size: 11px;
  font-weight: 500;
  color: var(--green);
}
.pay-switch { color: var(--green); font-weight: 600; text-decoration: underline; }

.pay-breakdown-card { padding: 0; overflow: hidden; }
.pay-breakdown-card .card-head { padding: 16px 22px 0; margin-bottom: 12px; }
.pay-breakdown-search { min-width: 200px; }
.pay-breakdown-table { min-width: 900px; }
.pay-breakdown-table th:first-child,
.pay-breakdown-table td:first-child { padding-left: 22px; }
.pay-breakdown-table th:last-child,
.pay-breakdown-table td:last-child { padding-right: 22px; }
.pay-breakdown-table td { vertical-align: middle; }
.pay-muted { color: var(--muted); }

.pay-details { margin-top: 16px; }
.pay-details > summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
}
.pay-details > summary::before {
  content: "▸";
  font-size: 11px;
  color: var(--muted);
  transition: transform 0.15s;
}
.pay-details[open] > summary::before { transform: rotate(90deg); }
.pay-details > summary::-webkit-details-marker { display: none; }
.pay-details-body { margin-top: 16px; }
.pay-details-body .grid { margin: 0; }

/* ======================================================================
   Figma parity — Screen 5: Notes & MAR (renderNotesMar)
   ====================================================================== */
.nmar-filter-card { padding: 11px 14px; margin-bottom: 16px; }
.nmar-filter-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.nmar-chip {
  flex-direction: column;
  align-items: flex-start;
  height: auto;
  padding: 6px 12px;
  gap: 0;
}
.nmar-chip-label { font-size: 9px; font-weight: 700; color: var(--muted-light); letter-spacing: 0.03em; }
.nmar-chip select { font-size: 12px; font-weight: 600; color: var(--ink-soft); }
.nmar-export { background: var(--green); }

.nmar-metrics { margin-bottom: 16px; }
.nmar-metric-sub { margin-top: 8px; font-size: 10px; color: var(--muted); font-weight: 500; }
.nmar-metrics .stat-value { font-size: 24px; }

.notes-list-panel .notes-panel-header { align-items: center; }
.nmar-row {
  display: grid;
  grid-template-columns: 44px 1fr auto auto;
  align-items: center;
  gap: 12px;
  text-align: left;
}
.nmar-type-chip {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 20px;
  padding: 0 8px;
  border-radius: 4px;
  font-size: 9px;
  font-weight: 700;
}
.nmar-type-chip.note { background: rgba(0, 110, 91, 0.18); color: var(--green); }
.nmar-type-chip.mar { background: rgba(226, 166, 0, 0.18); color: var(--ink); }
.nmar-row-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.nmar-row-time { font-size: 11px; color: var(--muted); }
.nmar-row-body strong { font-size: 13px; color: var(--ink-soft); }
.nmar-row-body em {
  font-style: normal;
  font-size: 11px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nmar-late {
  background: rgba(226, 0, 0, 0.15);
  color: var(--red);
  font-size: 9px;
  font-weight: 700;
  border-radius: 9px;
  padding: 3px 8px;
}
.nmar-row-sign { display: flex; align-items: center; gap: 6px; }
.nmar-row-sign small { font-size: 10px; color: var(--green); font-weight: 600; }

.nmar-preview-title {
  margin: 14px 0 4px;
  font-family: "Darker Grotesque", Poppins, sans-serif;
  font-size: 22px;
  font-weight: 800;
  color: var(--ink);
}
.nmar-preview-meta { margin: 0 0 12px; font-size: 11px; color: var(--muted); }
.nmar-caregiver-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(0, 110, 91, 0.06);
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-soft);
}
.nmar-preview-body { font-size: 12px; line-height: 1.6; color: var(--ink-soft); margin: 14px 0; }
.nmar-signature { background: var(--paper); }
.nmar-preview-actions { display: flex; gap: 12px; margin-top: 14px; }
.nmar-preview-actions .ghost-button,
.nmar-preview-actions .button { flex: 1 1 0; justify-content: center; }

/* ======================================================================
   Figma parity — Screen 6: Settings (renderSettings)
   ====================================================================== */
.set-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.set-nav { padding: 12px; position: sticky; top: 16px; }
.set-nav-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--muted-light);
  letter-spacing: 0.04em;
  padding: 8px 12px;
}
.set-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  border-radius: 10px;
  padding: 11px 12px;
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-soft);
  cursor: pointer;
}
button.set-nav-item:hover { background: var(--paper); }
.set-nav-item.active {
  background: rgba(0, 110, 91, 0.08);
  color: var(--green);
  font-weight: 600;
  position: relative;
}
.set-nav-item.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 9px;
  bottom: 9px;
  width: 3px;
  border-radius: 2px;
  background: var(--green);
}
.set-nav-icon { font-size: 13px; }

.set-content { display: flex; flex-direction: column; gap: 16px; }
.set-card { padding: 24px 28px; }
.set-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 8px;
}
.set-card-title {
  margin: 0;
  font-family: "Darker Grotesque", Poppins, sans-serif;
  font-size: 24px;
  font-weight: 800;
  color: var(--ink);
}
.set-card-sub { margin: 6px 0 0; font-size: 12px; color: var(--muted); }
.set-card .section-label { margin-top: 18px; }

@media (max-width: 900px) {
  .set-layout { grid-template-columns: 1fr; }
  .set-nav { position: static; }
}

/* Add Agency User — notification channels */
.au-channel-list { margin-top: 4px; }
.au-channel-list .toggle-row + .toggle-row { border-top: 1px solid var(--line); }

/* Messages — two-pane inbox + thread */
.msg-layout {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 16px;
  align-items: stretch;
  height: calc(100vh - 168px);
  min-height: 480px;
}

.msg-inbox {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
}

.msg-inbox-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.msg-inbox-title {
  font-size: 13px;
  font-weight: 800;
  color: var(--ink);
}

.msg-inbox-count {
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--mint);
  color: var(--green);
  font-size: 11px;
  font-weight: 800;
}

.msg-inbox-list {
  flex: 1;
  overflow-y: auto;
}

.msg-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
  padding: 13px 16px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  text-align: left;
  cursor: pointer;
}

.msg-row:hover { background: var(--paper); }

.msg-row-active,
.msg-row-active:hover { background: var(--mint); }

.msg-row-avatar { flex: 0 0 auto; }

.msg-row-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.msg-row-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.msg-row-subject {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.msg-row-time {
  flex: 0 0 auto;
  font-size: 11px;
  color: var(--muted);
}

.msg-row-preview {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.msg-row-tag {
  align-self: flex-start;
  margin-top: 2px;
  font-size: 10px;
  font-weight: 700;
  color: var(--green);
}

.msg-thread {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
}

.msg-thread-head {
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}

.msg-thread-subject {
  font-size: 15px;
  font-weight: 800;
  color: var(--ink);
}

.msg-thread-participants {
  margin-top: 2px;
  font-size: 12px;
  color: var(--muted);
}

.msg-thread-body {
  flex: 1;
  overflow-y: auto;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--paper);
}

.msg-thread-empty {
  margin: auto;
  color: var(--muted);
  font-size: 13px;
}

.msg-bubble-row {
  display: flex;
  max-width: 100%;
}

.msg-bubble-row.msg-received { justify-content: flex-start; }
.msg-bubble-row.msg-sent { justify-content: flex-end; }

.msg-bubble {
  max-width: 72%;
  padding: 9px 13px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--surface);
}

.msg-sent .msg-bubble {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}

.msg-bubble-sender {
  font-size: 11px;
  font-weight: 800;
  color: var(--green);
  margin-bottom: 2px;
}

.msg-bubble-body {
  font-size: 13px;
  line-height: 1.4;
  white-space: pre-wrap;
  word-break: break-word;
}

.msg-bubble-time {
  margin-top: 4px;
  font-size: 10px;
  color: var(--muted);
  text-align: right;
}

.msg-sent .msg-bubble-time { color: rgba(255, 255, 255, 0.78); }

.msg-composer {
  display: flex;
  gap: 10px;
  padding: 14px 16px;
  border-top: 1px solid var(--line);
  background: var(--surface);
}

.msg-composer-input {
  flex: 1;
  height: 42px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  font-size: 13px;
  color: var(--ink);
}

.msg-composer-input:focus {
  outline: none;
  border-color: var(--green);
  background: var(--surface);
}

.msg-send-btn { flex: 0 0 auto; }

.msg-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 6px;
  padding: 40px;
  color: var(--muted);
}

.msg-empty-full {
  grid-column: 1 / -1;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
}

.msg-empty-icon { font-size: 34px; }
.msg-empty-title { font-size: 15px; font-weight: 800; color: var(--ink); margin: 0; }
.msg-empty-sub { font-size: 13px; margin: 0; }

@media (max-width: 900px) {
  .msg-layout {
    grid-template-columns: 1fr;
    height: auto;
  }
  .msg-inbox { max-height: 320px; }
  .msg-thread { min-height: 420px; }
}

/* ======================================================================
   Production hardening — accessibility primitives
   Global keyboard focus ring + loading/error scaffolding. Tokens only.
   ====================================================================== */

/* Visible focus ring for keyboard users on every interactive control.
   :focus-visible only paints for keyboard/programmatic focus, so mouse
   clicks stay clean. Layered on top of the existing :focus border tweaks. */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
  border-radius: 6px;
}

/* Skip painting the legacy :focus outline once :focus-visible is supported,
   so we don't double up on mouse focus. */
a:focus:not(:focus-visible),
button:focus:not(:focus-visible),
[tabindex]:focus:not(:focus-visible) {
  outline: none;
}

/* Centered loading + error states shown by render() before agency data
   arrives (state.dataLoaded) or after a failed load (state.loadError). */
.app-state {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 32px;
  background: var(--paper);
}

.app-state-card {
  display: grid;
  justify-items: center;
  gap: 14px;
  width: min(420px, 100%);
  padding: 32px 28px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--surface);
  text-align: center;
}

.app-state-card h2 {
  margin: 0;
  font-family: "Darker Grotesque", Poppins, sans-serif;
  font-size: 26px;
  font-weight: 800;
  color: var(--ink);
}

.app-state-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.app-state-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 4px;
}

.app-state-icon {
  font-size: 30px;
  line-height: 1;
}

/* Lightweight spinner (no images, no JS animation loop). */
.app-spinner {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 3px solid rgba(0, 110, 91, 0.18);
  border-top-color: var(--green);
  animation: app-spin 0.8s linear infinite;
}

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

@media (prefers-reduced-motion: reduce) {
  .app-spinner { animation-duration: 1.8s; }
}

/* ======================================================================
   Production hardening — responsive layout
   Additive breakpoints (1024 / 820 / 560) layered AFTER the legacy
   1100/720 rules so equal-specificity declarations win here. The desktop
   layout above 1024px is untouched.
   ====================================================================== */

/* --- 1024px: tighten content, let 2-up grids wrap ----------------------- */
@media (max-width: 1024px) {
  .main {
    padding: 20px 22px;
  }

  /* Keep the real sidebar (not the stacked 1100px treatment) down to the
     tablet rail breakpoint. */
  .shell {
    grid-template-columns: 220px minmax(0, 1fr);
  }

  .sidebar {
    position: sticky;
    height: 100vh;
    overflow: hidden;
  }

  .nav {
    grid-template-columns: none;
    overflow-y: auto;
  }

  .sidebar-profile {
    position: static;
    margin-top: 16px;
  }

  /* Two-up content grids collapse to one column so cards can breathe. */
  .split-2,
  .split-2.even,
  .reports-charts,
  .med-report-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  /* Wide KPI rows wrap to 2-up instead of 4-up. */
  .stat-row,
  .metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .card-grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  }
}

/* --- 820px: collapse sidebar to an icon rail (~64px) -------------------- */
@media (max-width: 820px) {
  .shell {
    grid-template-columns: 64px minmax(0, 1fr);
  }

  .sidebar {
    padding: 18px 8px;
    align-items: stretch;
  }

  /* Hide brand text + profile text/name; keep the logo + avatar glyphs. */
  .brand {
    justify-content: center;
    margin-bottom: 18px;
  }

  .brand > div,
  .sidebar-profile > div,
  .sidebar-profile .profile-more,
  .nav-section {
    display: none;
  }

  .sidebar-profile {
    grid-template-columns: 1fr;
    justify-items: center;
    padding: 10px 4px;
  }

  /* Nav: icon-only, centered, active state preserved. */
  .nav button {
    justify-content: center;
    gap: 0;
    padding: 8px 0;
  }

  /* Hide the text label (the bare <span> after .nav-symbol) and the count
     badge; the .nav-symbol glyph stays. */
  .nav button > span:not(.nav-symbol):not(.nav-badge) {
    display: none;
  }

  .nav-badge {
    position: absolute;
    top: 2px;
    right: 6px;
    margin-left: 0;
    min-width: 16px;
    padding: 1px 5px;
    font-size: 9px;
  }

  .nav button.active::before {
    left: 0;
  }

  /* Topbar: drop the pill search to reclaim width. */
  .top-search {
    display: none;
  }

  /* Stack the remaining 2-up content grids fully. */
  .stat-row,
  .metrics,
  .card-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .card-grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  }

  /* Any table or fig-table that isn't already wrapped gets horizontal
     scroll so columns are reachable instead of clipped. */
  .table-wrap,
  .fig-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

/* --- 560px: mobile. Sidebar becomes a horizontally-scrolling top bar --- */
@media (max-width: 560px) {
  .shell {
    grid-template-columns: minmax(0, 1fr);
  }

  /* Sidebar pinned to the top as a horizontal, scrollable icon strip. */
  .sidebar {
    position: sticky;
    top: 0;
    z-index: 30;
    height: auto;
    flex-direction: row;
    align-items: center;
    gap: 6px;
    padding: 8px 10px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
  }

  .brand {
    flex: 0 0 auto;
    margin-bottom: 0;
    margin-right: 4px;
  }

  .nav {
    flex: 1 1 auto;
    display: flex;
    flex-direction: row;
    gap: 4px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 0;
  }

  .nav button {
    flex: 0 0 auto;
    width: auto;
    min-height: 40px;
    padding: 6px 10px;
  }

  /* Active indicator as an underline-free pill (the vertical bar doesn't
     read in a horizontal strip). */
  .nav button.active::before {
    display: none;
  }

  /* Profile chip is redundant in the strip — the topbar avatar covers it. */
  .sidebar-profile {
    display: none;
  }

  .main {
    padding: 14px 14px 24px;
  }

  /* Topbar stacks (already handled at 720px, re-asserted for the avatar row). */
  .top-actions {
    width: 100%;
    justify-content: flex-start;
  }

  /* Single-column everything for the common content grids. */
  .split-2,
  .split-2.even,
  .stat-row,
  .metrics,
  .card-grid,
  .two-col,
  .three-col,
  .four-col,
  .reports-charts,
  .med-report-grid,
  .role-grid,
  .loc-grid {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .app-state-card {
    padding: 26px 20px;
  }
}
