:root {
  --ink: #16212f;
  --muted: #667085;
  --line: #d7e0e7;
  --paper: #f6f8fb;
  --panel: #ffffff;
  --sidebar: #102238;
  --sidebar-soft: #183555;
  --teal: #146c69;
  --teal-soft: #d8f3ec;
  --blue: #0b82a6;
  --blue-soft: #e8f0ff;
  --learning-blue: #0799bf;
  --learning-purple: #d9252e;
  --learning-red: #b42318;
  --warm-stone: #c7bfb4;
  --coral: #ef7b45;
  --coral-soft: #fff0e9;
  --red: #b42318;
  --amber: #a15c07;
  --gold: #fff5dd;
  --shadow: 0 20px 50px rgba(16, 34, 56, 0.09);
  --shadow-soft: 0 10px 28px rgba(16, 34, 56, 0.07);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 8%, rgba(0, 159, 227, 0.10), transparent 28rem),
    radial-gradient(circle at 96% 6%, rgba(201, 79, 242, 0.08), transparent 24rem),
    linear-gradient(140deg, #eef6f5 0%, #f7f8fb 44%, #f1f5fb 100%);
  font-family: Inter, "Segoe UI", Arial, Helvetica, sans-serif;
}

button,
input {
  font: inherit;
}

button {
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease, border-color 160ms ease;
}

button:hover {
  transform: translateY(-1px);
}

.login-screen {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(135deg, rgba(16, 34, 56, 0.92), rgba(0, 159, 227, 0.72)),
    #102238;
}

.login-screen.hidden {
  display: none;
}

.login-card {
  width: min(460px, 100%);
  padding: 28px;
  border-radius: 8px;
  background: white;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.28);
}

.login-card img {
  width: 160px;
  height: auto;
  margin-bottom: 18px;
}

.login-card h1 {
  margin-bottom: 10px;
}

.login-card p {
  color: var(--muted);
  line-height: 1.5;
}

.login-card small {
  display: block;
  margin-top: 14px;
  color: var(--muted);
  line-height: 1.45;
}

#loginStatus[data-level="error"] {
  color: var(--red);
}

#loginStatus[data-level="ok"] {
  color: var(--teal);
}

.form-status {
  display: block;
  color: var(--muted);
  line-height: 1.45;
}

.form-status[data-level="error"] {
  color: var(--red);
}

.form-status[data-level="ok"] {
  color: var(--teal);
}

.login-form {
  display: grid;
  gap: 12px;
}

.login-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-weight: 800;
}

.login-form input {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 296px 1fr;
}

.sidebar {
  position: sticky;
  top: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.07), transparent 32%),
    var(--sidebar);
  color: #fff;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.brand {
  display: grid;
  grid-template-columns: 92px 1fr;
  align-items: center;
  gap: 13px;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.13);
}

.brand-logo {
  width: 92px;
  height: 56px;
  object-fit: contain;
  object-position: center;
  border-radius: 8px;
  background: white;
  padding: 6px;
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.18);
}

.brand strong,
.brand span {
  display: block;
}

.brand strong {
  font-size: 18px;
  line-height: 1.18;
}

.brand span,
.trust-panel p,
.trust-panel span {
  color: #cad8e7;
}

.nav-list {
  display: grid;
  gap: 14px;
  min-height: 0;
  overflow-y: auto;
  padding-right: 4px;
}

.nav-section {
  display: grid;
  gap: 6px;
}

.nav-section h2 {
  margin: 0 0 2px;
  color: #9fb5cc;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  line-height: 1.2;
  text-transform: uppercase;
}

.nav-item {
  width: 100%;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 9px 12px;
  text-align: left;
  color: #eaf2f9;
  background: transparent;
  cursor: pointer;
  font-size: 14px;
  line-height: 1.15;
}

.nav-item:hover {
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
}

.nav-item.active {
  color: var(--sidebar);
  background: #ffffff;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.16);
}

.nav-item:disabled,
.nav-item.nav-item-restricted {
  opacity: 0.45;
  cursor: not-allowed;
  border-color: rgba(255, 255, 255, 0.1);
}

.nav-item:disabled:hover,
.nav-item.nav-item-restricted:hover {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.1);
}

.trust-panel {
  margin-top: auto;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.07);
}

.trust-panel strong,
.trust-panel span {
  display: block;
}

.trust-panel strong {
  margin: 6px 0;
}

.trust-panel p {
  margin-bottom: 0;
  line-height: 1.45;
}

.main {
  padding: 30px;
  overflow-x: hidden;
}

.topbar,
.toolbar,
.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  margin: -30px -30px 24px;
  padding: 24px 30px;
  background: rgba(246, 248, 251, 0.86);
  border-bottom: 1px solid rgba(215, 224, 231, 0.72);
  backdrop-filter: blur(18px);
}

.topbar-status {
  margin-left: auto;
  padding: 9px 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  box-shadow: var(--shadow-soft);
}

.topbar-status.is-authenticated {
  border-color: rgba(20, 108, 105, 0.26);
  background: linear-gradient(180deg, #f3fbf9 0%, #ffffff 100%);
}

.topbar-status span,
.topbar-status strong {
  display: block;
}

.topbar-status span {
  color: var(--muted);
  font-size: 12px;
}

.topbar-status small {
  display: block;
  margin-top: 3px;
  color: var(--teal);
  font-size: 12px;
  font-weight: 700;
}

#topbarModuleAccess {
  max-width: 300px;
}

.topbar-status.is-authenticated small:first-of-type {
  color: var(--teal);
}

.topbar-status.is-authenticated small:last-of-type {
  color: var(--blue);
}

.topbar-actions #logoutButton:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.eyebrow,
.toolbar p,
.panel-header span,
.metric-card span,
.metric-card small,
.source-list,
.activity-log,
.client-meta,
.invoice-card small {
  color: var(--muted);
}

.eyebrow {
  margin: 0 0 4px;
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  color: var(--teal);
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 34px;
  line-height: 1.1;
}

h2 {
  margin-bottom: 6px;
  font-size: 21px;
}

h3 {
  line-height: 1.2;
}

.topbar-actions {
  display: flex;
  gap: 10px;
}

.primary-button,
.ghost-button {
  min-height: 42px;
  border-radius: 8px;
  padding: 0 16px;
  border: 1px solid transparent;
  cursor: pointer;
  font-weight: 800;
}

.primary-button {
  background: var(--learning-blue);
  color: white;
  box-shadow: 0 12px 24px rgba(0, 159, 227, 0.22);
}

.primary-button:hover {
  background: #0086bf;
}

.ghost-button {
  background: white;
  border-color: var(--line);
  color: var(--ink);
}

.view {
  display: none;
}

.active-view {
  display: block;
}

.active-view.jump-highlight .toolbar,
.active-view.jump-highlight .command-band,
.active-view.jump-highlight .panel {
  box-shadow: 0 0 0 2px rgba(7, 153, 191, 0.24), var(--shadow);
}

.active-view.jump-highlight .toolbar,
.active-view.jump-highlight .panel {
  transition: box-shadow 180ms ease;
}

.command-band {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 180px;
  gap: 18px;
  align-items: center;
  margin-bottom: 18px;
  padding: 24px;
  overflow: hidden;
  border-radius: 8px;
  border: 1px solid rgba(20, 108, 105, 0.16);
  background:
    linear-gradient(110deg, rgba(16, 34, 56, 0.94), rgba(7, 153, 191, 0.72) 60%, rgba(217, 37, 46, 0.52)),
    url("./assets/advanced-home-care-hero.jpg") center / cover,
    #102238;
  color: white;
  box-shadow: var(--shadow);
}

.command-band::after {
  content: "";
  position: absolute;
  right: -44px;
  bottom: -56px;
  width: 250px;
  height: 250px;
  border: 28px solid rgba(255, 255, 255, 0.10);
  border-radius: 999px;
}

.command-band h2 {
  position: relative;
  margin: 14px 0 8px;
  font-size: 30px;
}

.command-band p {
  position: relative;
  max-width: 720px;
  margin-bottom: 0;
  color: rgba(255, 255, 255, 0.88);
  line-height: 1.55;
}

.command-stats {
  position: relative;
  justify-self: end;
  min-width: 150px;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.14);
}

.command-stats strong,
.command-stats span {
  display: block;
}

.command-stats strong {
  font-size: 38px;
}

.command-stats span {
  color: rgba(255, 255, 255, 0.82);
}

.command-launch {
  min-width: 190px;
  min-height: 52px;
  align-self: center;
  font-size: 16px;
  padding-inline: 20px;
}

.command-actions {
  display: grid;
  gap: 10px;
  justify-items: end;
}

.command-actions .command-launch {
  min-width: 190px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.metric-card,
.panel,
.client-card,
.invoice-card {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(215, 224, 231, 0.9);
  border-radius: 8px;
  box-shadow: var(--shadow-soft);
}

.metric-card {
  position: relative;
  padding: 18px;
  overflow: hidden;
}

.metric-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: var(--teal);
}

.metric-card:nth-child(2)::before {
  background: var(--learning-blue);
}

.metric-card:nth-child(3)::before {
  background: var(--learning-purple);
}

.metric-card:nth-child(4)::before {
  background: var(--amber);
}

.manager-hub {
  margin-bottom: 16px;
}

.exception-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.queue-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 10px;
}

.queue-filter-chip {
  border: 1px solid #cdd8e2;
  border-radius: 999px;
  padding: 7px 12px;
  background: #f7fbfc;
  color: var(--ink);
  font-weight: 700;
  font-size: 13px;
}

.queue-filter-chip.active {
  border-color: var(--teal);
  background: #e8f7fa;
  color: #0f5666;
}

.queue-filter-meta {
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 13px;
}

.exception-summary article {
  padding: 14px;
  border: 1px solid #d7e0e7;
  border-radius: 8px;
  background: #f7fbfc;
}

.exception-summary strong,
.exception-summary span {
  display: block;
}

.exception-summary strong {
  color: var(--learning-blue);
  font-size: 24px;
}

.exception-summary span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
}

.exception-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.exception-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-left: 4px solid #d7e0e7;
  border-radius: 8px;
  background: white;
}

.exception-item.active {
  border-left-color: var(--learning-red);
  background: #fff8f8;
}

.exception-item.warn {
  border-left-color: var(--amber);
  background: #fffdf7;
}

.exception-item.normal {
  border-left-color: #b9c8d6;
}

.exception-item div,
.exception-item p {
  min-width: 0;
}

.exception-item strong {
  display: block;
  margin-top: 6px;
}

.exception-item small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.exception-item p {
  grid-column: 1 / -1;
  margin: 0;
  color: #425066;
  font-size: 13px;
  line-height: 1.42;
}

.exception-item-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.exception-item-title {
  margin-top: 6px;
}

.exception-item .queue-actions {
  grid-column: 1 / -1;
  justify-content: flex-start;
}

.task-board {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.task-column {
  min-height: 360px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7fbfc;
}

.task-list {
  display: grid;
  gap: 10px;
}

.task-card {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid #d7e0e7;
  border-left: 4px solid var(--learning-blue);
  border-radius: 8px;
  background: white;
}

.task-card strong,
.task-card small {
  display: block;
}

.task-card p {
  margin: 0;
  color: #425066;
  font-size: 13px;
  line-height: 1.42;
}

.task-card small {
  color: var(--muted);
}

.handover-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: start;
}

.handover-list {
  display: grid;
  gap: 10px;
  max-height: 520px;
  overflow: auto;
}

.handover-card {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--teal);
  border-radius: 8px;
  background: var(--paper);
}

.handover-card strong,
.handover-card small {
  display: block;
}

.handover-card p {
  margin: 0;
  color: #425066;
  line-height: 1.42;
}

.handover-card small {
  color: var(--muted);
  font-weight: 800;
}

.handover-panel {
  margin-top: 18px;
}

.checklist-panel {
  margin-top: 16px;
}

.checklist-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.checklist-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7fbfc;
}

.checklist-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: start;
}

.checklist-head strong,
.checklist-head span {
  display: block;
}

.checklist-head > span {
  color: var(--teal);
  font-weight: 900;
}

.progress-bar {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #d7e0e7;
}

.progress-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--teal);
}

.checklist-items {
  display: grid;
  gap: 8px;
}

.metric-card strong {
  display: block;
  margin: 8px 0;
  font-size: 31px;
}

.split-layout,
.settings-grid {
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  gap: 16px;
}

.foundation-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 16px;
}

.cover-grid {
  margin-top: 16px;
}

.panel {
  padding: 18px;
}

.visit-list,
.check-list,
.activity-log {
  display: grid;
  gap: 10px;
}

.visit-item,
.check-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 13px;
  background: linear-gradient(180deg, #fff, #f9fbfc);
}

.visit-item {
  display: grid;
  grid-template-columns: 110px 1fr auto;
  gap: 12px;
  align-items: center;
}

.visit-item span:not(.status-pill) {
  color: var(--muted);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  min-height: 26px;
  width: max-content;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 800;
  background: var(--teal-soft);
  color: var(--teal);
}

.command-band .status-pill {
  background: rgba(255, 255, 255, 0.18);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.24);
}

.status-pill.warn {
  background: var(--gold);
  color: var(--amber);
}

.status-pill.risk {
  background: #fff0ee;
  color: var(--red);
}

.status-pill.complaint {
  background: #fff1eb;
  color: var(--learning-red);
}

.toolbar {
  margin-bottom: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: var(--shadow-soft);
}

.toolbar p {
  margin-bottom: 0;
}

.segmented-control {
  display: inline-grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(58px, auto);
  padding: 4px;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #edf3f8;
}

.segmented-control button {
  border: 0;
  border-radius: 8px;
  padding: 9px 12px;
  background: transparent;
  cursor: pointer;
  font-weight: 800;
  color: var(--muted);
}

.segmented-control button.active {
  background: white;
  color: var(--ink);
  box-shadow: var(--shadow-soft);
}

.search-box {
  display: grid;
  gap: 6px;
  min-width: min(420px, 100%);
  color: var(--muted);
  font-weight: 800;
}

.search-box input,
.search-box select,
.rules-form input,
.rules-form select,
.rules-form textarea {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: white;
  color: var(--ink);
  outline: 0;
}

.rules-form textarea {
  min-height: 104px;
  padding: 12px;
  resize: vertical;
}

.rules-form select[multiple] {
  min-height: 144px;
  padding: 10px 12px;
}

.search-box input:focus,
.search-box select:focus,
.rules-form input:focus,
.rules-form select:focus,
.rules-form textarea:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 4px rgba(20, 108, 105, 0.12);
}

.client-grid,
.invoice-grid,
.onboarding-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.onboarding-grid {
  grid-template-columns: 1fr 1fr;
  margin-bottom: 16px;
}

.client-card,
.invoice-card {
  padding: 16px;
}

.client-card {
  border-top: 4px solid var(--teal);
}

.client-card:nth-child(2n) {
  border-top-color: var(--learning-blue);
}

.client-card:nth-child(3n) {
  border-top-color: var(--learning-purple);
}

.client-card h3,
.invoice-card h3 {
  margin: 12px 0 6px;
}

.client-card p {
  color: #425066;
  line-height: 1.48;
}

.client-meta {
  display: grid;
  gap: 6px;
  margin: 14px 0;
  font-size: 14px;
}

.client-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.timeline-picker {
  min-width: min(360px, 100%);
}

.timeline-layout {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.timeline-profile-card h3 {
  margin: 12px 0 6px;
}

.timeline-profile-card p {
  color: #425066;
  line-height: 1.48;
}

.timeline-profile-card dl {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 8px 12px;
  margin: 16px 0;
}

.timeline-profile-card dt {
  color: var(--muted);
  font-weight: 800;
}

.timeline-profile-card dd {
  margin: 0;
  font-weight: 800;
}

.timeline-review-note {
  margin-top: 10px;
}

.timeline-events {
  display: grid;
  gap: 10px;
  max-height: 680px;
  overflow: auto;
}

.timeline-complaint-panel {
  margin-top: 16px;
}

.timeline-complaint-case {
  min-height: 120px;
}

.complaint-case-layout {
  display: grid;
  grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.complaint-case-list {
  display: grid;
  gap: 10px;
}

.complaint-case-card,
.complaint-case-detail-card,
.complaint-audit-item {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
}

.complaint-case-card {
  padding: 14px;
  background: linear-gradient(180deg, #fff7f5 0%, #ffffff 100%);
}

.complaint-case-card.active {
  border-color: rgba(180, 35, 24, 0.35);
  box-shadow: 0 0 0 3px rgba(180, 35, 24, 0.08);
}

.complaint-case-card-header,
.complaint-audit-item-header {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.complaint-case-card strong {
  display: block;
  margin-top: 10px;
}

.complaint-case-card p,
.complaint-case-detail-text,
.complaint-case-summary-box p,
.complaint-audit-item p {
  margin: 6px 0 0;
  color: #425066;
  line-height: 1.48;
}

.complaint-case-card small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
}

.complaint-case-detail-card {
  padding: 16px;
}

.complaint-case-meta {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 8px 12px;
  margin: 16px 0;
}

.complaint-case-meta dt {
  color: var(--muted);
  font-weight: 800;
}

.complaint-case-meta dd {
  margin: 0;
  font-weight: 700;
}

.complaint-case-summary-box {
  margin: 16px 0;
  padding: 12px 14px;
  border-radius: 8px;
  background: #f6f8fb;
}

.complaint-share-box {
  display: grid;
  gap: 10px;
}

.complaint-share-box-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.complaint-share-box textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  font: inherit;
  color: var(--ink);
  background: white;
  resize: vertical;
  min-height: 160px;
}

.complaint-share-stamp {
  color: var(--muted);
  font-size: 0.92rem;
}

.complaint-case-action-form {
  display: grid;
  gap: 12px;
  margin: 0 0 18px;
  padding: 14px;
  border: 1px solid rgba(20, 108, 105, 0.18);
  border-radius: 8px;
  background: linear-gradient(180deg, #f6fbfb 0%, #ffffff 100%);
}

.complaint-case-action-form textarea,
.complaint-case-action-form input,
.complaint-case-action-form select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  font: inherit;
  color: var(--ink);
  background: white;
}

.complaint-case-action-form textarea {
  resize: vertical;
  min-height: 84px;
}

.complaint-case-audit {
  display: grid;
  gap: 10px;
}

.complaint-case-audit h3 {
  margin: 6px 0 0;
}

.complaint-audit-item {
  padding: 12px 14px;
}

.timeline-event {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}

.timeline-event-focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(28, 116, 119, 0.12);
  background: #f4fbfb;
}

.timeline-event-complaint {
  border-color: rgba(180, 35, 24, 0.18);
  background: linear-gradient(180deg, #fff7f5 0%, #ffffff 100%);
}

.timeline-event-disruption {
  border-color: rgba(161, 92, 7, 0.18);
  background: linear-gradient(180deg, #fffaf1 0%, #ffffff 100%);
}

.timeline-event-leave .status-pill {
  border-color: #ffd8a8;
  background: #fff7eb;
  color: #9a5d00;
}

.timeline-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.timeline-event strong {
  display: block;
  margin-top: 8px;
}

.timeline-event p {
  margin: 5px 0 0;
  color: #425066;
  line-height: 1.45;
}

.timeline-event-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.timeline-actions {
  gap: 8px;
  align-items: end;
  flex-wrap: wrap;
}

.ghost-button.active {
  border-color: var(--navy);
  color: var(--navy);
  background: #edf3ff;
}

.action-fields .field-note {
  margin-top: 6px;
  font-size: 12px;
  color: #667085;
}

.commissioner-return-card {
  gap: 12px;
}

.commissioner-return-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.commissioner-return-header p {
  margin: 4px 0 0;
  color: var(--muted);
}

#authorityReturnPreview {
  min-height: 168px;
  resize: vertical;
  font-size: 13px;
  line-height: 1.5;
  font-family: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
  color: var(--ink);
  background: #f8fbff;
}

#authorityFamilyPreview {
  min-height: 168px;
  resize: vertical;
  font-size: 13px;
  line-height: 1.55;
  color: var(--ink);
  background: #fbfcff;
}

.timeline-event small {
  color: var(--muted);
  font-weight: 800;
  white-space: nowrap;
}

.staff-row .queue-actions {
  justify-content: flex-end;
}

.directory-panel {
  display: none;
  margin-bottom: 16px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  box-shadow: var(--shadow-soft);
}

.directory-panel.open {
  display: block;
}

.staff-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  max-height: 420px;
  overflow: auto;
}

.staff-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}

.staff-row strong,
.staff-row span {
  display: block;
}

.staff-row span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.mini-button {
  border: 1px solid var(--line);
  background: white;
  border-radius: 8px;
  padding: 8px 10px;
  cursor: pointer;
  font-weight: 700;
}

.mini-button:hover {
  border-color: var(--teal);
  color: var(--teal);
}

.mini-button.active {
  border-color: var(--navy);
  color: var(--navy);
  background: #edf3ff;
}

.mini-button.danger {
  border-color: #fed7d7;
  color: var(--red);
}

.data-table {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  box-shadow: var(--shadow);
}

.careplan-panel {
  margin-top: 18px;
}

.careplan-summary article:nth-child(2) {
  background: #f5f3ff;
  border-color: #c4b5fd;
}

.careplan-summary article:nth-child(3) {
  background: #fff7ed;
  border-color: #fed7aa;
}

.careplan-table small {
  color: var(--muted);
  font-weight: 700;
  line-height: 1.4;
}

.client-card.selected {
  border-color: var(--teal);
  box-shadow: 0 0 0 2px rgba(20, 184, 166, 0.18), var(--shadow);
}

.service-user-record-panel {
  margin-top: 18px;
}

.service-user-record-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 16px;
}

.service-user-record-header h2 {
  margin: 8px 0 4px;
}

.service-user-record-header p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.service-user-record-kpis {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.service-user-record-kpis article {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}

.service-user-record-kpis article.warn {
  border-color: #fed7aa;
  background: #fff7ed;
}

.service-user-record-kpis article.risk {
  border-color: #fecaca;
  background: #fff1f2;
}

.service-user-record-kpis span {
  font-size: 12px;
  color: var(--muted);
  font-weight: 800;
}

.service-user-record-kpis strong {
  color: var(--ink);
}

.service-user-record-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.service-user-record-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.service-user-record-workspace {
  display: grid;
  grid-template-columns: 290px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.service-user-access-guide {
  display: grid;
  gap: 12px;
}

.service-user-access-menu,
.service-user-readiness {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}

.service-user-access-menu h3,
.service-user-readiness h3 {
  margin: 0 0 4px;
  font-size: 15px;
}

.service-user-access-menu button {
  display: grid;
  gap: 3px;
  width: 100%;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  text-align: left;
  cursor: pointer;
}

.service-user-access-menu button.active {
  border-color: var(--teal);
  background: #ecfeff;
}

.service-user-access-menu strong,
.service-user-readiness strong {
  color: var(--ink);
}

.service-user-access-menu span,
.service-user-readiness span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.service-user-readiness article {
  display: grid;
  gap: 3px;
  padding: 9px;
  border-radius: 8px;
  background: white;
  border: 1px solid var(--line);
}

.service-user-readiness article.warn {
  border-color: #fed7aa;
  background: #fff7ed;
}

.service-user-readiness article.done {
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.service-user-record-form label {
  display: grid;
  gap: 6px;
}

.service-user-record-form label.full,
.service-user-record-actions.full {
  grid-column: 1 / -1;
}

.service-user-record-form span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.service-user-record-form input,
.service-user-record-form select,
.service-user-record-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  font: inherit;
  background: white;
}

.service-user-record-form textarea {
  resize: vertical;
  min-height: 96px;
}

.service-user-record-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.service-user-record-actions .form-status {
  margin: 0;
}

.service-user-medication-editor {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcff;
}

.service-user-medication-editor h3 {
  margin: 0;
}

.medication-item-card {
  display: grid;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.medication-item-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.medication-item-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.roster-layout {
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.roster-workspace {
  display: grid;
  gap: 16px;
}

.roster-sidebar {
  position: sticky;
  top: 108px;
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  box-shadow: var(--shadow-soft);
}

.roster-kpis {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.roster-kpis div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px;
  border-radius: 8px;
  background: var(--paper);
}

.roster-kpis strong {
  font-size: 24px;
}

.roster-kpis span {
  color: var(--muted);
  font-weight: 800;
}

.roster-kpis div:last-child {
  grid-column: 1 / -1;
}

#toggleRosterConflicts.active {
  border-color: rgba(15, 118, 110, 0.35);
  background: #edf9f7;
  color: var(--teal);
}

.roster-filter-button {
  width: 100%;
}

.display-options {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfd;
}

.display-options > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0;
}

.display-option-buttons {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.display-option-buttons button {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  background: white;
  color: var(--ink);
  font-weight: 800;
}

.display-option-buttons button.active {
  background: var(--blue-soft);
  border-color: rgba(16, 159, 227, 0.25);
  color: var(--learning-blue);
}

.day-focus-bar {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.day-focus-bar button {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  background: white;
  color: var(--ink);
  font-weight: 800;
}

.day-focus-bar button.active {
  background: var(--blue-soft);
  border-color: rgba(16, 159, 227, 0.25);
  color: var(--learning-blue);
}

.day-focus-bar button:disabled {
  opacity: 0.55;
  transform: none;
}

.roster-day-summary {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

#resetRosterFilters {
  margin-top: -2px;
}

.day-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.day-strip button {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  background: white;
  color: var(--muted);
  font-weight: 800;
}

.day-strip button.active {
  background: var(--blue-soft);
  border-color: rgba(16, 159, 227, 0.25);
  color: var(--learning-blue);
}

.roster-warnings {
  display: grid;
  gap: 8px;
  max-height: 260px;
  overflow: auto;
}

.warning-item {
  padding: 10px;
  border: 1px solid #fed7aa;
  border-radius: 8px;
  background: #fff7ed;
}

.warning-item strong,
.warning-item span {
  display: block;
}

.warning-item strong {
  color: var(--amber);
}

.warning-item span {
  margin-top: 4px;
  color: #7c4a03;
  font-size: 13px;
  line-height: 1.35;
}

.roster-board {
  max-height: calc(100vh - 190px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  box-shadow: var(--shadow);
}

.day-planner-panel {
  margin-top: 18px;
}

.roster-workspace {
  display: grid;
  gap: 16px;
}

.unallocated-panel {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
  box-shadow: var(--shadow-soft);
}

.planner-unallocated-panel {
  margin-bottom: 8px;
}

.unallocated-note {
  margin-bottom: 12px;
  color: var(--muted);
  line-height: 1.45;
}

.unallocated-toolbar {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 10px;
  align-items: end;
  margin-bottom: 10px;
}

.compact-field {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.compact-field select {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  background: white;
}

.field-hint {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.urgency-chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.urgency-chip-option {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: white;
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.urgency-chip-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.urgency-chip-option:has(input:checked) {
  border-color: rgba(16, 159, 227, 0.3);
  background: var(--blue-soft);
  color: var(--learning-blue);
}

.urgency-chip-option:has(input:disabled) {
  opacity: 0.55;
  cursor: not-allowed;
}

.unallocated-meta {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.unallocated-card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.unallocated-visit-pool {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.unallocated-visit-card {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px dashed #c9d8e3;
  border-left: 4px solid var(--blue);
  border-radius: 8px;
  background: #f6fbff;
  cursor: grab;
}

.unallocated-visit-card.dragging {
  opacity: 0.6;
  cursor: grabbing;
}

.unallocated-visit-card strong,
.unallocated-visit-card span,
.unallocated-visit-card small {
  display: block;
}

.unallocated-visit-card span {
  color: var(--ink);
  font-weight: 800;
}

.unallocated-visit-card small {
  color: var(--muted);
  line-height: 1.35;
}

.unallocated-card-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.unallocated-visit-card .visit-status {
  margin-top: 0;
}

.unallocated-panel .empty-state {
  margin: 8px 0 0;
}

.day-planner-intro {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 0 14px;
}

.day-planner-intro span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.day-planner-intro p {
  margin: 0;
  color: var(--muted);
}

.day-planner-timeline {
  position: relative;
  min-height: 360px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, #fbfdff 0%, #f7fbfe 100%);
}

.planner-sheet {
  display: grid;
  width: max-content;
  min-width: 100%;
  background:
    repeating-linear-gradient(
      to right,
      rgba(215, 224, 231, 0.7) 0,
      rgba(215, 224, 231, 0.7) 1px,
      transparent 1px,
      transparent var(--planner-slot-width, 24px)
    );
}

.planner-corner,
.planner-slot-head,
.planner-name-cell,
.planner-track {
  box-sizing: border-box;
}

.planner-corner {
  position: sticky;
  top: 0;
  left: 0;
  z-index: 4;
  min-height: 34px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
  background: rgba(246, 248, 251, 0.98);
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.planner-slot-head {
  position: sticky;
  top: 0;
  z-index: 3;
  min-height: 34px;
  padding: 8px 0 6px;
  border-bottom: 1px solid var(--line);
  border-left: 1px solid rgba(215, 224, 231, 0.45);
  background: rgba(246, 248, 251, 0.98);
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-align: center;
}

.planner-slot-head.hour {
  color: var(--ink);
  font-weight: 900;
}

.planner-name-cell {
  position: sticky;
  left: 0;
  z-index: 2;
  min-height: var(--planner-row-height, 72px);
  padding: 10px 12px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.98);
  display: grid;
  gap: 4px;
  align-content: center;
}

.planner-name-cell strong {
  color: var(--ink);
  font-size: 14px;
}

.planner-name-cell span,
.planner-name-cell small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.planner-track {
  position: relative;
  min-height: var(--planner-row-height, 72px);
  overflow: visible;
  border-bottom: 1px solid var(--line);
  background:
    repeating-linear-gradient(
      to right,
      transparent 0,
      transparent calc(var(--planner-slot-width, 24px) - 1px),
      rgba(84, 106, 140, 0.12) calc(var(--planner-slot-width, 24px) - 1px),
      rgba(84, 106, 140, 0.12) var(--planner-slot-width, 24px)
    );
}

.planner-track.view-only {
  cursor: default;
}

.planner-track.planner-drop-active {
  outline: 2px solid rgba(7, 153, 191, 0.25);
  outline-offset: -2px;
}

.planner-track.planner-drop-active::after {
  position: absolute;
  top: 8px;
  bottom: 8px;
  left: var(--planner-preview-left, 0);
  z-index: 7;
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--planner-preview-width, var(--planner-slot-width, 24px));
  padding: 0 6px;
  border: 2px solid var(--teal);
  border-radius: 6px;
  background: rgba(7, 153, 191, 0.16);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.85), 0 8px 20px rgba(7, 153, 191, 0.2);
  box-sizing: border-box;
  color: #075f73;
  content: attr(data-drop-label);
  font-size: 11px;
  font-weight: 900;
  line-height: 1.1;
  overflow: hidden;
  pointer-events: none;
  text-align: center;
  text-overflow: clip;
  white-space: nowrap;
}

.planner-track.planner-drop-active::before {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--planner-preview-left, 0);
  z-index: 6;
  width: 2px;
  background: var(--teal);
  content: "";
  pointer-events: none;
}

.planner-track.planner-drop-invalid {
  outline-color: rgba(180, 35, 24, 0.28);
}

.planner-track.planner-drop-invalid::after {
  border-color: var(--red);
  background: rgba(180, 35, 24, 0.12);
  color: var(--red);
}

.planner-track.planner-drop-invalid::before {
  background: var(--red);
}

.planner-visit {
  position: absolute;
  top: 8px;
  bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  padding: 0 6px;
  border-left: 3px solid var(--teal);
  border-radius: 6px;
  background: #eef8f7;
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.04);
  box-sizing: border-box;
  cursor: grab;
  overflow: visible;
  z-index: 1;
  transition: transform 120ms ease, box-shadow 120ms ease, z-index 0ms linear 300ms;
}

.planner-visit.overlap-visit {
  border-left-color: var(--red);
  background: linear-gradient(180deg, #fff7f6 0%, #ffffff 100%);
  box-shadow: inset 0 0 0 1px rgba(180, 35, 24, 0.14), 0 1px 0 rgba(15, 23, 42, 0.04);
}

.planner-visit.leave-visit {
  border-left-color: var(--amber);
  background: linear-gradient(180deg, #fffaf1 0%, #ffffff 100%);
  box-shadow: inset 0 0 0 1px rgba(161, 92, 7, 0.14), 0 1px 0 rgba(15, 23, 42, 0.04);
}

.planner-visit.dragging {
  opacity: 0.65;
  cursor: grabbing;
}

.planner-visit:hover,
.planner-visit:focus-visible {
  z-index: 8;
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.16);
  transition-delay: 0ms;
}

.planner-visit strong {
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
  max-width: 100%;
  overflow: hidden;
  text-align: center;
  text-overflow: clip;
  white-space: nowrap;
}

.visit-carers {
  color: var(--teal);
  font-weight: 800;
}

.planner-meta {
  color: #6f42c1 !important;
  font-weight: 800;
}

.planner-visit::after {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 10px);
  z-index: 12;
  width: max-content;
  max-width: 280px;
  padding: 8px 10px;
  border: 1px solid rgba(15, 23, 42, 0.14);
  border-radius: 6px;
  background: #172033;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.22);
  color: #ffffff;
  content: attr(data-tooltip);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
  opacity: 0;
  pointer-events: none;
  text-align: left;
  transform: translateX(-50%) translateY(4px);
  transition: opacity 120ms ease 650ms, transform 120ms ease 650ms;
  white-space: normal;
}

.planner-visit::before {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 4px);
  z-index: 11;
  width: 10px;
  height: 10px;
  background: #172033;
  content: "";
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) rotate(45deg);
  transition: opacity 120ms ease 650ms;
}

.planner-visit:hover::after,
.planner-visit:hover::before,
.planner-visit:focus-visible::after,
.planner-visit:focus-visible::before {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.planner-visit:hover::before,
.planner-visit:focus-visible::before {
  transform: translateX(-50%) rotate(45deg);
}

.planner-overlap {
  display: inline-flex;
  width: max-content;
  padding: 2px 6px;
  border-radius: 999px;
  background: #ffe9e5;
  color: var(--red);
  font-size: 11px;
  font-weight: 900;
}

.planner-overlap.leave {
  background: #fff1db;
  color: var(--amber);
}

.planner-empty-state {
  position: sticky;
  left: 240px;
  top: 44px;
  display: inline-block;
  margin: 14px;
  padding: 12px 14px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: white;
  color: var(--muted);
  font-weight: 800;
}

.hr-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  gap: 16px;
  margin-bottom: 16px;
}

.hr-summary {
  margin-bottom: 16px;
}

.access-style-workspace {
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #ffffff;
}

.access-primary-tabs,
.access-secondary-tabs {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
}

.access-primary-tabs span,
.access-primary-tabs strong,
.access-secondary-tabs span,
.access-secondary-tabs strong {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 10px;
  border-right: 1px solid rgba(255, 255, 255, 0.55);
  font-size: 15px;
  font-weight: 850;
  line-height: 1.15;
  text-align: center;
}

.access-primary-tabs span {
  background: #eef2f5;
  color: var(--ink);
}

.access-primary-tabs strong,
.access-secondary-tabs strong,
.access-secondary-tabs span {
  background: #4aa39a;
  color: #ffffff;
}

.access-secondary-tabs {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.access-menu-ribbon {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: flex-start;
  padding: 10px 12px;
  border-top: 1px solid #d7e0e5;
  background: #eef3f4;
}

.access-menu-group {
  position: relative;
}

.access-menu-group button {
  min-width: 132px;
  min-height: 34px;
  border: 1px solid #c4d2d7;
  border-radius: 4px;
  background: #ffffff;
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  font-weight: 850;
  text-align: left;
  padding: 0 28px 0 10px;
  cursor: default;
}

.access-menu-group button::after {
  content: "";
  position: absolute;
  top: 15px;
  right: 10px;
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid #50646d;
}

.access-menu-panel {
  display: grid;
  min-width: 172px;
  margin-top: 4px;
  border-left: 18px solid #4aa39a;
  border-right: 1px solid #c8d3d7;
  border-bottom: 1px solid #c8d3d7;
  background: #ffffff;
  box-shadow: 0 8px 18px rgba(26, 44, 52, 0.08);
}

.access-menu-panel.wide {
  min-width: 238px;
}

.access-menu-panel span {
  min-height: 29px;
  padding: 7px 10px;
  border-top: 1px solid #dfe7ea;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.15;
}

.access-menu-panel span:hover {
  background: #eef6f5;
}

.access-filter-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(160px, 1fr));
  gap: 14px;
  padding: 16px;
  background: #f7f9fb;
}

.access-filter-grid .field {
  margin: 0;
}

.hr-pipeline,
.hr-employee-list {
  display: grid;
  gap: 10px;
}

.hr-card,
.hr-employee-row {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #ffffff;
}

.hr-card.active,
.hr-employee-row.active {
  border-color: #4aa39a;
  box-shadow: inset 4px 0 0 #4aa39a;
}

.hr-card-head,
.hr-employee-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 10px;
}

.hr-card-head strong,
.hr-card-head small,
.hr-employee-row strong,
.hr-employee-row span,
.hr-employee-row small {
  display: block;
}

.hr-card-head strong,
.hr-employee-row strong {
  margin-top: 6px;
  color: var(--ink);
  font-size: 15px;
}

.hr-card-head small,
.hr-card p,
.hr-employee-row span,
.hr-employee-row small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.hr-step-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 10px 0;
}

.hr-step-list span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.hr-step-list span.done {
  border-color: rgba(22, 163, 74, 0.26);
  background: #ecfdf3;
  color: #067647;
}

.hr-card .queue-actions {
  margin-top: 10px;
}

.hr-record-panel {
  margin-bottom: 16px;
}

.hr-testing-panel {
  margin: 16px 0;
}

.hr-test-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}

.hr-test-grid article {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 10px;
}

.hr-test-grid article.done {
  border-color: rgba(22, 163, 74, 0.24);
  background: #f0fdf4;
}

.hr-test-grid span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  background: #edf5f4;
  color: #11635b;
  font-size: 12px;
  font-weight: 900;
}

.hr-test-grid strong,
.hr-test-grid small {
  display: block;
}

.hr-test-grid strong {
  color: var(--ink);
  font-size: 12px;
  line-height: 1.25;
}

.hr-test-grid small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
}

.hr-feedback-form {
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.reference-link-list {
  display: grid;
  gap: 8px;
  margin: 12px 0;
}

.reference-link-list article {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 12px;
}

.reference-link-list article.done {
  border-color: rgba(22, 163, 74, 0.24);
  background: #f0fdf4;
}

.reference-link-list strong,
.reference-link-list span,
.reference-link-list small {
  display: block;
}

.reference-link-list span,
.reference-link-list small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.public-reference-page {
  min-height: 100vh;
  display: grid;
  place-items: start center;
  background: #eef4f3;
  padding: 24px;
}

.public-reference-card {
  width: min(100%, 520px);
  border: 1px solid #cfd8df;
  border-radius: 18px;
  background: #ffffff;
  box-shadow: 0 14px 28px rgba(23, 37, 46, 0.12);
  overflow: hidden;
}

.public-reference-content {
  display: grid;
  gap: 12px;
  padding: 18px;
}

.public-reference-content h1,
.public-reference-content p {
  margin: 0;
}

.public-reference-content h1 {
  color: var(--ink);
  font-size: 24px;
}

.public-reference-content p {
  color: var(--muted);
  line-height: 1.45;
}

.public-reference-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.public-reference-form label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.public-reference-form label.full,
.public-reference-form button,
.public-reference-form .form-status {
  grid-column: 1 / -1;
}

.public-reference-form input,
.public-reference-form select,
.public-reference-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--ink);
  font: inherit;
  padding: 9px;
}

@media (max-width: 900px) {
  .hr-test-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .hr-test-grid,
  .public-reference-form {
    grid-template-columns: 1fr;
  }

  .public-reference-page {
    padding: 12px;
  }
}

.hr-record-profile {
  display: grid;
  gap: 14px;
}

.hr-record-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
}

.hr-record-head h3 {
  margin: 8px 0 4px;
  color: var(--ink);
  font-size: 24px;
}

.hr-record-head p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.hr-record-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
}

.hr-record-tabs button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  font-weight: 850;
  padding: 0 12px;
}

.hr-record-tabs button.active {
  border-color: #4aa39a;
  background: #e7f4f2;
  color: #11635b;
}

.hr-record-grid,
.hr-check-table {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.hr-record-grid article,
.hr-check-table article {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 12px;
}

.hr-record-grid label {
  display: grid;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 12px;
}

.hr-record-grid label.full {
  grid-column: 1 / -1;
}

.hr-record-grid span,
.hr-check-table span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.hr-record-grid strong,
.hr-check-table strong {
  display: block;
  margin-top: 5px;
  color: var(--ink);
  font-size: 14px;
}

.hr-record-grid input,
.hr-record-grid select,
.hr-record-grid textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  font: inherit;
  padding: 9px 10px;
}

.starter-meeting-form {
  display: grid;
  gap: 12px;
}

.hr-edit-form {
  display: grid;
  gap: 12px;
}

.hr-edit-form .applicant-detail-group {
  margin-bottom: 0;
}

.hr-edit-form .hr-record-grid > label:has(textarea) {
  grid-column: 1 / -1;
}

.hr-record-field-group {
  display: grid;
  gap: 10px;
}

.hr-record-field-group h4 {
  margin: 10px 0 0;
  color: var(--ink);
  font-size: 15px;
}

.hr-check-table article.done {
  border-color: rgba(22, 163, 74, 0.24);
  background: #f0fdf4;
}

.hr-availability-text {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  line-height: 1.5;
  padding: 12px;
  white-space: pre-wrap;
}

.roster-row {
  display: grid;
  grid-template-columns: 230px repeat(var(--roster-day-count, 7), minmax(164px, 1fr)) 150px;
  min-width: var(--roster-min-width, 1528px);
}

.roster-row > div {
  min-height: 82px;
  padding: 10px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.roster-header {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #edf5f4;
  font-weight: 900;
}

.roster-header > div {
  min-height: auto;
  color: #344054;
}

.roster-header strong,
.roster-header span {
  display: block;
}

.roster-header span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.roster-summary {
  position: sticky;
  right: 0;
  z-index: 1;
  display: grid;
  align-content: center;
  gap: 4px;
  background: #f7fbfb;
  text-align: center;
}

.roster-header .roster-summary {
  z-index: 3;
  background: #edf5f4;
}

.roster-summary strong,
.roster-summary span {
  display: block;
}

.roster-summary strong {
  font-size: 18px;
  color: var(--teal);
}

.roster-summary span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.roster-person {
  position: sticky;
  left: 0;
  z-index: 1;
  background: #ffffff;
}

.roster-header .roster-person {
  z-index: 3;
  background: #edf5f4;
}

.roster-person strong,
.roster-person span {
  display: block;
}

.roster-person span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.roster-cell {
  display: grid;
  align-content: start;
  gap: 6px;
  background: #fff;
}

.roster-cell.empty {
  color: #7d8593;
  background: linear-gradient(180deg, #fbfcfe 0%, #f7fbfc 100%);
  border-style: dashed;
}

.roster-cell.view-only {
  cursor: default;
}

.roster-cell.empty span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 100%;
  border: 1px dashed #d6e2ea;
  border-radius: 6px;
  color: #7d8593;
  font-size: 12px;
  font-weight: 800;
}

.roster-cell.view-only.empty span {
  border-style: solid;
  background: #f8fafc;
}

.roster-visit {
  padding: 8px;
  border-left: 3px solid var(--learning-blue);
  border-radius: 8px;
  background: #f2f8ff;
  cursor: grab;
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.04);
}

.roster-visit.overlap-visit {
  border-left-color: var(--red);
  background: linear-gradient(180deg, #fff7f6 0%, #ffffff 100%);
  box-shadow: inset 0 0 0 1px rgba(180, 35, 24, 0.14), 0 1px 0 rgba(15, 23, 42, 0.04);
}

.roster-visit.leave-visit {
  border-left-color: var(--amber);
  background: linear-gradient(180deg, #fffaf1 0%, #ffffff 100%);
  box-shadow: inset 0 0 0 1px rgba(161, 92, 7, 0.14), 0 1px 0 rgba(15, 23, 42, 0.04);
}

.roster-visit.dragging {
  opacity: 0.55;
  cursor: grabbing;
  box-shadow: 0 8px 22px rgba(9, 82, 120, 0.18);
}

.roster-visit strong,
.roster-visit span {
  display: block;
}

.roster-visit span {
  margin-top: 3px;
  color: #425066;
  font-size: 12px;
}

.visit-status,
.travel-badge {
  display: inline-flex;
  width: max-content;
  margin-top: 5px;
  padding: 2px 6px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.2;
}

.visit-status.planned {
  background: #e8f7fb;
  color: var(--learning-blue);
}

.visit-status.changed {
  background: var(--gold);
  color: var(--amber);
}

.visit-status.completed {
  background: #e8f8ee;
  color: #1f7a3e;
}

.visit-status.review {
  background: #fff0ee;
  color: var(--red);
}

.visit-status.overlap {
  background: #ffe9e5;
  color: var(--red);
}

.visit-status.leave-block {
  background: #fff1db;
  color: var(--amber);
}

.visit-status.cancelled {
  background: #f2f4f7;
  color: #667085;
}

.travel-badge {
  background: #f8f1ff;
  color: #6f42c1;
}

.roster-visit .mini-button {
  margin-top: 6px;
  padding: 5px 7px;
  font-size: 12px;
}

.roster-cell.drop-active {
  background: #e8f7fb;
  outline: 2px solid rgba(31, 146, 186, 0.35);
  outline-offset: -2px;
}

.roster-row.conflict-row > div {
  background: #fffaf6;
}

.roster-row.conflict-row .roster-person {
  background: #fff5ee;
}

.roster-row.conflict-row .roster-summary {
  background: #fff5ee;
}

.roster-row.conflict-row .roster-visit {
  border-left-color: var(--amber);
  background: #fffaf6;
}

.changed-label {
  display: inline-flex;
  width: max-content;
  margin-top: 5px;
  padding: 2px 6px;
  border-radius: 999px;
  background: var(--gold);
  color: var(--amber);
  font-weight: 800;
}

.changed-label.risk {
  background: #fff0ee;
  color: var(--red);
}

.onboarding-queue {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.family-portal-layout {
  display: grid;
  grid-template-columns: minmax(320px, 0.9fr) minmax(0, 1.1fr);
  gap: 16px;
}

.family-portal-profile,
.family-portal-visits,
.family-portal-messages {
  display: grid;
  gap: 10px;
}

.family-snapshot h3 {
  margin: 8px 0;
  color: var(--ink);
  font-size: 22px;
}

.family-snapshot dl {
  display: grid;
  grid-template-columns: minmax(120px, 0.45fr) minmax(0, 1fr);
  gap: 8px 12px;
  margin: 12px 0;
}

.family-snapshot dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.family-snapshot dd {
  margin: 0;
  color: var(--ink);
  font-size: 13px;
}

.family-visit-card {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-left: 4px solid #4aa39a;
  border-radius: 8px;
  background: #ffffff;
  padding: 12px;
}

.family-visit-card.blocked {
  border-left-color: var(--red);
  background: #fff8f7;
}

.family-visit-card strong,
.family-visit-card span,
.family-visit-card small {
  display: block;
}

.family-visit-card span,
.family-visit-card small,
.family-message-row p {
  color: var(--muted);
}

.applicant-phone-shell {
  margin-top: 14px;
}

.applicant-phone-empty {
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #f8fafc;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  padding: 18px;
}

.applicant-phone {
  max-width: 390px;
  border: 1px solid #cfd8df;
  border-radius: 18px;
  background: #f2f5f7;
  box-shadow: 0 14px 28px rgba(23, 37, 46, 0.12);
  overflow: hidden;
}

.public-applicant-card {
  max-width: 460px;
}

.public-applicant-phone {
  margin: 0 auto;
  max-width: 430px;
}

.public-family-card {
  max-width: 560px;
}

.public-family-portal {
  max-width: 520px;
  margin: 0 auto;
  border: 1px solid #cfd8df;
  border-radius: 18px;
  background: #f2f5f7;
  overflow: hidden;
  box-shadow: 0 14px 28px rgba(23, 37, 46, 0.12);
}

.public-family-blocked {
  display: grid;
  gap: 12px;
  text-align: left;
}

.public-family-blocked h1 {
  margin: 0;
  color: var(--ink);
}

.applicant-phone-top {
  display: grid;
  gap: 4px;
  padding: 16px;
  background: #11635b;
  color: #ffffff;
}

.applicant-phone-top span {
  font-size: 12px;
  font-weight: 800;
  opacity: 0.86;
}

.applicant-phone-top strong {
  font-size: 19px;
}

.applicant-phone-section {
  margin: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 14px;
}

.applicant-phone-section h3,
.applicant-phone-section h4,
.applicant-phone-section p {
  margin: 0;
}

.applicant-phone-section h3 {
  margin-top: 4px;
  color: var(--ink);
  font-size: 22px;
}

.applicant-phone-section h4 {
  margin-bottom: 10px;
  color: var(--ink);
  font-size: 16px;
}

.applicant-phone-section p,
.applicant-phone-section small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.applicant-mobile-grid {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
}

.applicant-detail-group {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}

.applicant-detail-group > strong {
  color: var(--ink);
  font-size: 13px;
}

.applicant-mobile-grid label {
  display: grid;
  gap: 5px;
}

.applicant-mobile-grid span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.applicant-mobile-grid input,
.applicant-mobile-grid select,
.applicant-mobile-grid textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  font: inherit;
  padding: 9px 10px;
}

.applicant-mobile-grid .portal-check {
  grid-template-columns: 18px 1fr;
  align-items: center;
}

.applicant-mobile-grid .portal-check input {
  width: 16px;
  height: 16px;
  padding: 0;
}

.portal-upload-list {
  display: grid;
  gap: 8px;
}

.portal-upload-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 58px;
  min-height: 42px;
  border: 1px solid #a9cfc9;
  border-radius: 6px;
  background: #eef8f6;
  padding: 10px;
}

.portal-upload-card > div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.portal-upload-card strong,
.portal-upload-card span,
.portal-upload-card small {
  overflow-wrap: anywhere;
}

.portal-upload-card strong {
  color: var(--ink);
  font-size: 13px;
}

.portal-upload-card span,
.portal-upload-card small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.portal-upload-card.is-uploaded {
  border-color: #6ab7aa;
  background: #f4fbf9;
}

.portal-upload-card button,
.upload-review-pill {
  min-height: 34px;
  border: 1px solid #a9cfc9;
  border-radius: 6px;
  background: #ffffff;
  color: #11635b;
  font: inherit;
  font-size: 12px;
  font-weight: 900;
  padding: 0 12px;
}

.portal-file-input {
  display: none;
}

.upload-review-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.hr-upload-review-list {
  margin-top: 12px;
}

.hr-document-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.hr-document-actions button {
  min-height: 32px;
  white-space: nowrap;
}

.hr-next-step-banner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, auto);
  gap: 12px;
  align-items: center;
  margin: 12px 0;
  border: 1px solid #b8d8d0;
  border-radius: 8px;
  background: #f3fbf8;
  padding: 12px;
}

.hr-command-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.hr-command-strip .primary-button,
.hr-command-strip .mini-button {
  min-height: 36px;
}

.hr-next-step-banner.warn {
  border-color: #e2c26d;
  background: #fff8e5;
}

.hr-next-step-banner.risk {
  border-color: #e29b93;
  background: #fff0ee;
}

.hr-next-step-banner span,
.hr-next-step-banner small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.hr-next-step-banner strong {
  display: block;
  margin-top: 2px;
  color: var(--ink);
  font-size: 16px;
}

.hr-next-step-banner p {
  margin: 4px 0 0;
  color: var(--muted);
  line-height: 1.4;
}

.policy-read-meter {
  height: 9px;
  margin: 10px 0 4px;
  border-radius: 999px;
  background: #e4e7ec;
  overflow: hidden;
}

.policy-read-meter span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #4aa39a;
}

.queue-item {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}

.queue-item strong {
  display: block;
  margin: 10px 0 6px;
}

.queue-item p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.4;
}

.voice-console {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 16px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(16, 34, 56, 0.94), rgba(7, 153, 191, 0.78)),
    var(--sidebar);
  color: white;
  box-shadow: var(--shadow);
}

.voice-console p {
  color: rgba(255, 255, 255, 0.84);
}

.voice-console textarea {
  width: 100%;
  min-height: 140px;
  margin: 12px 0;
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: 8px;
  padding: 14px;
  resize: vertical;
  color: white;
  background: rgba(255, 255, 255, 0.12);
}

.voice-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.voice-result {
  padding: 18px;
  border-radius: 8px;
  background: white;
  color: var(--ink);
}

.voice-result p {
  color: var(--muted);
}

.contact-queue-panel {
  margin-top: 16px;
}

.contact-queue {
  display: grid;
  gap: 10px;
}

.voice-action-queue {
  display: grid;
  gap: 10px;
}

.voice-action-item {
  display: grid;
  grid-template-columns: minmax(240px, 0.9fr) minmax(260px, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid #b8d9e0;
  border-left: 4px solid var(--teal);
  border-radius: 8px;
  background: #eef8fa;
}

.voice-action-item strong,
.voice-action-item span {
  display: block;
}

.voice-action-item span,
.voice-action-item p {
  color: #425066;
}

.voice-action-item p {
  margin: 0;
}

.queue-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.contact-item {
  display: grid;
  grid-template-columns: minmax(220px, 0.8fr) minmax(260px, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}

.contact-item strong,
.contact-item span {
  display: block;
}

.contact-item span,
.empty-state {
  color: var(--muted);
}

.contact-item p {
  margin-bottom: 0;
  color: #425066;
}

.feedback-layout {
  display: grid;
  grid-template-columns: minmax(320px, 420px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.feedback-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.feedback-form .full {
  grid-column: 1 / -1;
}

.feedback-queue {
  display: grid;
  gap: 10px;
}

.feedback-item {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}

.feedback-meta {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 10px;
}

.feedback-meta strong,
.feedback-meta span,
.feedback-item small {
  display: block;
}

.feedback-meta span,
.feedback-item small {
  color: var(--muted);
}

.mobile-grid {
  display: grid;
  grid-template-columns: 330px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

body.carer-app-mode {
  background: linear-gradient(180deg, #f1f7f8 0%, #f9fbf7 48%, #eef4f1 100%);
}

body.carer-app-mode.carer-app-signed-in {
  height: 100vh;
  overflow: hidden;
}

.carer-app-header,
.carer-roster-list button,
.mobile-current-visit,
.mobile-visit-brief article,
.mobile-medication-card,
.mobile-ai-suggestions {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.82);
  border-radius: 8px;
}

.carer-app-header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 12px;
  margin-bottom: 12px;
  font-size: 13px;
}

.carer-app-header strong {
  color: #123541;
}

.carer-roster-list {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 2px;
  scroll-snap-type: x mandatory;
}

.carer-roster-list button {
  display: grid;
  gap: 3px;
  flex: 0 0 78%;
  min-width: 210px;
  padding: 10px 12px;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  scroll-snap-align: start;
}

.carer-roster-list button.active {
  border-color: #2b8e99;
  background: #eef9f7;
  box-shadow: 0 0 0 2px rgba(43, 142, 153, 0.14);
}

.carer-roster-list span,
.mobile-visit-brief span,
.mobile-medication-card span,
.mobile-medication-card small,
.mobile-ai-suggestions span {
  color: var(--muted);
  font-size: 12px;
}

.mobile-step-progress {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin: 12px 0;
}

.mobile-step-progress article {
  min-height: 52px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.mobile-step-progress strong,
.mobile-step-progress span {
  display: block;
}

.mobile-step-progress strong {
  color: var(--ink);
  font-size: 12px;
}

.mobile-step-progress span {
  color: var(--muted);
  font-size: 11px;
}

.mobile-step-progress article.done {
  border-color: #86c7a7;
  background: #effaf4;
}

.mobile-step-progress article.active {
  border-color: #2b8e99;
  background: #eef9fb;
  box-shadow: 0 0 0 2px rgba(43, 142, 153, 0.14);
}

.mobile-step-progress article.blocked {
  border-color: #efc47d;
  background: #fff8ed;
}

.mobile-action-feedback {
  display: none;
  padding: 10px;
  border: 1px solid #c8dce1;
  border-radius: 8px;
  background: #f7fbfb;
  color: #123541;
  font-size: 13px;
}

.mobile-action-feedback.show {
  display: block;
}

.mobile-action-feedback.ok {
  border-color: #8ec9ae;
  background: #effaf4;
  color: #176b4d;
}

.mobile-action-feedback.warn {
  border-color: #efc47d;
  background: #fff8ed;
  color: #71420b;
}

.mobile-action-feedback.risk {
  border-color: #f0b5a2;
  background: #fff5f0;
  color: #7c2d12;
}

.mobile-conflict-card {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid #efc47d;
  border-radius: 8px;
  background: #fff8ed;
  color: #4b2a05;
}

.mobile-conflict-card[hidden] {
  display: none;
}

.mobile-conflict-card strong,
.mobile-conflict-card span,
.mobile-conflict-card small {
  display: block;
}

.mobile-conflict-card span,
.mobile-conflict-card small {
  font-size: 13px;
}

.mobile-conflict-steps {
  display: grid;
  gap: 4px;
  margin: 2px 0 0;
  padding-left: 18px;
  color: #603807;
  font-size: 13px;
  line-height: 1.35;
}

.mobile-conflict-card .mobile-completion-actions {
  margin-top: 2px;
}

.mobile-completion-card {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid #8ec9ae;
  border-radius: 8px;
  background: #effaf4;
  color: #123541;
}

.mobile-completion-card[hidden] {
  display: none;
}

.mobile-completion-card strong,
.mobile-completion-card span,
.mobile-completion-card small {
  display: block;
}

.mobile-completion-card span,
.mobile-completion-card small {
  color: var(--muted);
  font-size: 13px;
}

.mobile-completion-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.mobile-geofence-hint {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 13px;
}

.mobile-geofence-hint.ok {
  color: #176b4d;
}

.mobile-geofence-hint.warn {
  color: #9a5b00;
}

.mobile-geofence-hint.risk {
  color: #a33333;
}

.mobile-live-location {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 4px 10px;
  padding: 10px 12px;
  border: 1px solid #b8d9e0;
  border-radius: 8px;
  background: #f7fbfb;
  font-size: 12px;
}

.mobile-live-location span {
  color: var(--muted);
  font-weight: 800;
}

.mobile-live-location strong {
  min-width: 0;
  color: #123541;
  overflow-wrap: anywhere;
}

.mobile-visit-brief,
.mobile-task-list,
.mobile-medication-list {
  display: grid;
  gap: 10px;
}

.mobile-visit-brief h3 {
  margin: 0;
  font-size: 16px;
}

.mobile-detail-card {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.84);
}

.mobile-detail-card summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
  list-style: none;
}

.mobile-detail-card summary::-webkit-details-marker {
  display: none;
}

.mobile-detail-card summary::after {
  content: "+";
  color: #0f766e;
  font-weight: 900;
}

.mobile-detail-card[open] summary::after {
  content: "-";
}

.mobile-detail-card span,
.mobile-detail-card p {
  display: block;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  white-space: pre-line;
}

.mobile-task-row {
  gap: 10px;
}

.mobile-task-row input {
  flex: 0 0 auto;
}

.mobile-task-icon {
  display: grid;
  place-items: center;
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: #e9f8f5;
  color: #0f766e;
  font-size: 19px;
}

.mobile-home-link {
  justify-self: start;
  border: 1px solid #b8d9e0;
  border-radius: 8px;
  background: #ffffff;
  color: #0f766e;
  padding: 8px 12px;
  font: inherit;
  font-weight: 800;
}

.mobile-view-header {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
}

.mobile-view-header span {
  grid-column: 2;
}

.mobile-view-panel {
  display: none;
  grid-column: 1 / -1;
}

.mobile-view-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 0 0 8px;
}

.mobile-view-tabs button {
  flex: 0 0 auto;
  border: 1px solid #c8dce1;
  border-radius: 8px;
  background: #ffffff;
  color: #123541;
  padding: 9px 12px;
  font: inherit;
  font-weight: 800;
}

.mobile-view-tabs button.active {
  border-color: #0f766e;
  background: #e9f8f5;
  color: #0f766e;
}

.mobile-role-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.mobile-role-actions:empty {
  display: none;
}

.mobile-manager-panel {
  gap: 12px;
}

.mobile-manager-panel h3,
.mobile-manager-panel p {
  grid-column: 1 / -1;
  margin: 0;
}

.mobile-manager-panel p {
  color: var(--muted);
}

.mobile-visit-brief {
  grid-column: 1 / -1;
  margin-bottom: 14px;
}

.mobile-visit-brief article,
.mobile-medication-card,
.mobile-ai-suggestions {
  padding: 12px;
}

.mobile-visit-brief strong,
.mobile-medication-card strong,
.mobile-ai-suggestions strong {
  display: block;
  margin-bottom: 4px;
}

.mobile-task-list h3,
.mobile-medication-list h3 {
  margin: 0;
  font-size: 15px;
}

.mobile-medication-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 0.35fr);
  gap: 10px;
  align-items: center;
}

.mobile-medication-card select {
  width: 100%;
}

.mobile-auth-panel {
  grid-column: 1 / -1;
  display: grid;
  gap: 12px;
  padding: 12px;
  border: 1px solid #c8dce1;
  border-radius: 8px;
  background: #f7fbfb;
}

.mobile-auth-panel strong,
.mobile-auth-panel span,
.mobile-auth-panel small {
  display: block;
}

.mobile-auth-panel span,
.mobile-auth-panel small {
  color: var(--muted);
  font-size: 13px;
}

.mobile-auth-panel.is-signed-in {
  border-color: #9fd0bf;
  background: #f1fbf6;
}

.mobile-auth-panel[hidden],
.mobile-login-form[hidden],
#mobileAuthActions[hidden] {
  display: none;
}

.mobile-login-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  align-items: end;
}

.mobile-login-form label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
}

.mobile-login-form input {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  font: inherit;
}

.mobile-login-form button {
  min-height: 40px;
}

body.carer-app-mode .sidebar,
body.carer-app-mode .login-screen,
body.carer-app-mode .topbar,
body.carer-app-mode .topbar .topbar-actions,
body.carer-app-mode .topbar-status {
  display: none;
}

body.carer-app-mode .app-shell {
  grid-template-columns: 1fr;
}

body.carer-app-mode .main {
  width: 100%;
  max-width: 720px;
  height: 100vh;
  margin: 0 auto;
  overflow: hidden;
  padding: calc(14px + env(safe-area-inset-top, 0px)) 14px calc(14px + env(safe-area-inset-bottom, 0px));
}

body.carer-app-mode .topbar {
  position: static;
  margin: calc(-18px - env(safe-area-inset-top, 0px)) -14px 14px;
  padding-top: calc(18px + env(safe-area-inset-top, 0px));
}

body.carer-app-mode #mobile > .toolbar {
  align-items: flex-start;
  border: 1px solid #d6e5e4;
  border-radius: 8px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.74);
  box-shadow: 0 14px 38px rgba(20, 48, 58, 0.08);
  margin-top: 0;
}

body.carer-app-mode #mobile > .toolbar .toolbar-actions {
  display: none;
}

body.carer-app-mode #mobile > .toolbar h2 {
  margin-bottom: 4px;
  color: #123541;
  font-size: clamp(22px, 8vw, 34px);
  line-height: 1.05;
}

body.carer-app-mode .view:not(#mobile) {
  display: none;
}

body.carer-app-mode #mobile {
  display: block;
}

body.carer-app-mode.carer-app-signed-in #mobile {
  height: 100%;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 10px;
  overflow: hidden;
}

body.carer-app-mode .mobile-grid {
  grid-template-columns: minmax(0, 1fr);
}

body.carer-app-mode.carer-app-signed-in .mobile-grid {
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

body.carer-app-mode .mobile-login-form {
  grid-template-columns: minmax(0, 1fr);
}

body.carer-app-mode .mobile-current-visit {
  order: 1;
}

body.carer-app-mode #mobile .panel {
  order: 2;
}

body.carer-app-mode #mobile .panel .panel-header {
  align-items: flex-start;
}

body.carer-app-mode #mobileSecureStatus {
  order: 3;
}

body.carer-app-mode #mobileAuthPanel {
  order: 4;
}

body.carer-app-mode #mobileAuthPanel[hidden] {
  display: none;
}

body.carer-app-mode #mobileTestModelPanel {
  order: 5;
}

body.carer-app-mode .variance-panel {
  order: 6;
}

body.carer-app-mode:not(.carer-app-signed-in) #mobile {
  min-height: calc(100vh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
  display: grid;
  align-content: center;
}

body.carer-app-mode:not(.carer-app-signed-in) #mobile > .toolbar {
  border: 0;
  background: transparent;
  box-shadow: none;
  padding: 0 4px 18px;
}

body.carer-app-mode:not(.carer-app-signed-in) #mobile > .toolbar h2 {
  font-size: clamp(36px, 12vw, 54px);
}

body.carer-app-mode:not(.carer-app-signed-in) #mobile > .toolbar p {
  max-width: 30rem;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.4;
}

body.carer-app-mode:not(.carer-app-signed-in) .mobile-grid {
  display: block;
}

body.carer-app-mode:not(.carer-app-signed-in) #mobileAuthPanel {
  display: grid;
  gap: 18px;
  border-color: #cfe3e0;
  border-radius: 14px;
  padding: 22px;
  background:
    linear-gradient(180deg, rgba(20, 184, 166, 0.08), rgba(255, 255, 255, 0.9)),
    #ffffff;
  box-shadow: 0 24px 60px rgba(15, 118, 110, 0.16);
}

body.carer-app-mode:not(.carer-app-signed-in) #mobileAuthPanel strong {
  color: #123541;
  font-size: 28px;
  line-height: 1.1;
}

body.carer-app-mode:not(.carer-app-signed-in) #mobileAuthPanel span,
body.carer-app-mode:not(.carer-app-signed-in) #mobileAuthPanel small {
  font-size: 15px;
  line-height: 1.4;
}

body.carer-app-mode:not(.carer-app-signed-in) .mobile-login-form {
  gap: 14px;
}

body.carer-app-mode:not(.carer-app-signed-in) .mobile-login-form label {
  font-size: 14px;
}

body.carer-app-mode:not(.carer-app-signed-in) .mobile-login-form input {
  min-height: 52px;
  font-size: 16px;
}

body.carer-app-mode:not(.carer-app-signed-in) .mobile-login-form button {
  min-height: 54px;
  font-size: 18px;
}

body.carer-app-mode:not(.carer-app-signed-in) #mobileSecureStatus,
body.carer-app-mode:not(.carer-app-signed-in) #mobileTestModelPanel,
body.carer-app-mode:not(.carer-app-signed-in) .mobile-current-visit,
body.carer-app-mode:not(.carer-app-signed-in) #mobile .panel,
body.carer-app-mode:not(.carer-app-signed-in) .variance-panel {
  display: none;
}

body.carer-app-mode.carer-app-signed-in #mobile > .toolbar {
  padding: 0 2px;
  border: 0;
  background: transparent;
  box-shadow: none;
}

body.carer-app-mode.carer-app-signed-in #mobile > .toolbar h2 {
  margin: 0;
  font-size: clamp(22px, 8vw, 34px);
}

body.carer-app-mode.carer-app-signed-in #mobile > .toolbar h2::after {
  content: attr(data-mobile-title);
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

body.carer-app-mode.carer-app-signed-in #mobile > .toolbar p {
  display: none;
}

body.carer-app-mode.carer-app-signed-in #mobileAuthPanel,
body.carer-app-mode.carer-app-signed-in #mobileTestModelPanel,
body.carer-app-mode.carer-app-signed-in #mobileSecureStatus,
body.carer-app-mode.carer-app-signed-in .variance-panel {
  display: none;
}

body.carer-app-mode.carer-app-signed-in #mobile .panel,
body.carer-app-mode.carer-app-signed-in .variance-panel {
  display: none;
}

body.carer-app-mode.carer-app-signed-in:not(.mobile-visit-sheet-open) #mobile .mobile-visit-sheet-panel {
  display: none !important;
}

body.carer-app-mode.carer-app-signed-in.mobile-visit-sheet-open #mobile .mobile-visit-sheet-panel {
  display: grid;
  align-content: start;
  height: 100%;
  max-height: 100%;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 14px 14px calc(96px + env(safe-area-inset-bottom, 0px));
}

body.carer-app-mode.carer-app-signed-in[data-mobile-view="tasks"] [data-mobile-view-panel="tasks"],
body.carer-app-mode.carer-app-signed-in[data-mobile-view="medication"] [data-mobile-view-panel="medication"],
body.carer-app-mode.carer-app-signed-in[data-mobile-view="note"] [data-mobile-view-panel="note"],
body.carer-app-mode.carer-app-signed-in[data-mobile-view="location"] [data-mobile-view-panel="location"],
body.carer-app-mode.carer-app-signed-in[data-mobile-view="spotcheck"] [data-mobile-view-panel="spotcheck"] {
  display: grid;
  align-content: start;
  gap: 12px;
}

body.carer-app-mode.carer-app-signed-in.mobile-visit-sheet-open .mobile-current-visit {
  display: none;
}

body.carer-app-mode.carer-app-signed-in:not(.mobile-visit-sheet-open) .mobile-current-visit {
  display: grid;
  align-content: start;
  gap: 12px;
  height: 100%;
  min-height: 0;
  overflow-y: auto;
  padding: 14px;
}

body.carer-app-mode.carer-app-signed-in:not(.mobile-visit-sheet-open) .mobile-conflict-card,
body.carer-app-mode.carer-app-signed-in:not(.mobile-visit-sheet-open) .mobile-completion-card {
  margin-top: 8px;
}

body.carer-app-mode.carer-app-signed-in .mobile-visit-sheet-panel .panel-header {
  position: sticky;
  top: -14px;
  z-index: 3;
  background: #ffffff;
  padding-bottom: 10px;
}

body.carer-app-mode.carer-app-signed-in .mobile-visit-sheet-panel .mobile-view-tabs {
  position: sticky;
  top: 48px;
  z-index: 2;
  background: #ffffff;
}

body.carer-app-mode.carer-app-signed-in .mobile-visit-sheet-panel .visit-note-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  min-height: 0;
  overflow: visible;
  padding-bottom: 6px;
}

body.carer-app-mode.carer-app-signed-in #mobile input,
body.carer-app-mode.carer-app-signed-in #mobile select,
body.carer-app-mode.carer-app-signed-in #mobile textarea {
  font-size: 16px;
}

body.carer-app-mode.carer-app-signed-in .mobile-medication-card {
  grid-template-columns: minmax(0, 1fr);
}

body.carer-app-mode.carer-app-signed-in .mobile-action-deck {
  grid-template-columns: minmax(0, 1fr);
}

.mobile-secure-banner {
  grid-column: 1 / -1;
  padding: 12px;
  border: 1px solid #c9d8df;
  border-radius: 8px;
  background: #f5fbfc;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.45;
}

.mobile-secure-banner.warn {
  border-color: #efd59a;
  background: #fff9ec;
}

.mobile-secure-banner strong {
  display: block;
  margin-bottom: 3px;
}

.mobile-test-model {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid #d4e4e8;
  border-radius: 8px;
  background: #fbfdfe;
}

.mobile-test-model[hidden] {
  display: none;
}

.mobile-test-model strong,
.mobile-test-model span {
  display: block;
}

.mobile-test-model span,
.mobile-test-model-state {
  color: var(--muted);
  font-size: 13px;
}

.mobile-test-model-state {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.mobile-test-model-state article {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.mobile-test-model-state strong {
  color: var(--teal);
  font-size: 18px;
}

.mobile-checkout-blockers {
  display: grid;
  gap: 6px;
}

.mobile-checkout-blockers article {
  padding: 10px;
  border: 1px solid #efc47d;
  border-radius: 8px;
  background: #fff8ed;
  color: #71420b;
  font-size: 13px;
}

.mobile-checkout-blockers article.ok {
  border-color: #8ec9ae;
  background: #effaf4;
  color: #176b4d;
}

.mobile-action-deck,
.mobile-critical-actions {
  display: grid;
  gap: 8px;
}

.mobile-action-deck {
  grid-template-columns: 1fr 1fr;
}

.mobile-action-deck .primary-button {
  grid-column: 1 / -1;
}

.mobile-action-deck button,
.mobile-critical-actions button {
  min-height: 46px;
}

.mobile-critical-actions {
  grid-template-columns: 1fr 1fr;
}

.mobile-critical-actions .ghost-button {
  border-color: #f0b5a2;
  background: #fff5f0;
  color: #7c2d12;
}

.security-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.inspection-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: start;
}

.access-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.75fr);
  gap: 16px;
  align-items: start;
}

.access-mobile-panel {
  margin-top: 16px;
}

.access-mobile-note {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 13px;
}

.access-mobile-demo-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 12px;
  padding: 10px 12px;
  border: 1px solid #cfe1e5;
  border-radius: 8px;
  background: #f8fcfd;
}

.access-mobile-demo-actions span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.access-mobile-filters {
  margin-bottom: 10px;
}

.access-mobile-queue {
  display: grid;
  gap: 12px;
}

.mobile-device-review-panel {
  display: grid;
  gap: 10px;
  margin: 0 0 12px;
}

.mobile-device-review-panel:empty {
  display: none;
}

.mobile-device-review-panel > strong {
  font-size: 13px;
  color: var(--ink);
}

.mobile-device-review-panel p {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid #b7decf;
  border-radius: 8px;
  background: #f0fbf6;
  color: #176b4d;
  font-size: 13px;
}

.mobile-device-review-panel article {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) auto;
  gap: 4px 10px;
  padding: 10px 12px;
  border: 1px solid #f2c37e;
  border-radius: 8px;
  background: #fff8ed;
}

.mobile-device-review-panel article span,
.mobile-device-review-panel article b,
.mobile-device-review-panel article small {
  display: block;
}

.mobile-device-review-panel article span,
.mobile-device-review-panel article b {
  font-weight: 850;
  color: #71420b;
}

.mobile-device-review-panel article small {
  grid-column: 1 / -1;
  color: #8a5a17;
  line-height: 1.45;
}

.device-row-review {
  background: #fffaf2;
}

.access-mobile-work-item {
  grid-template-columns: minmax(220px, 0.85fr) minmax(300px, 1fr) auto;
}

.access-mobile-work-item p {
  margin: 0;
}

.access-mobile-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.representative-access-item {
  align-items: start;
}

.representative-access-meta {
  display: block;
  margin-top: 10px;
  color: var(--muted);
  line-height: 1.45;
}

.report-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.report-panel {
  margin-top: 18px;
}

.report-ledger-header {
  align-items: center;
}

.report-ledger-header > div {
  display: grid;
  gap: 4px;
}

.report-ledger-filters {
  margin-bottom: 10px;
}

.report-ledger-footnote {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 13px;
}

.report-workbench-strip {
  margin-top: 12px;
}

.report-workbench-note {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 13px;
}

.ledger-trust-stamps {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.ledger-evidence-note {
  display: grid;
  gap: 6px;
  margin-top: 8px;
}

.ledger-evidence-note small {
  color: var(--muted);
  line-height: 1.4;
}

.ledger-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.role-matrix,
.control-list {
  display: grid;
  gap: 10px;
  max-height: 360px;
  overflow: auto;
}

.role-card,
.control-item {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}

.role-card strong,
.role-card span,
.control-item strong,
.control-item span {
  display: block;
}

.role-card span,
.control-item span {
  margin-top: 5px;
  color: var(--muted);
  line-height: 1.45;
}

.role-card small {
  display: block;
  margin-top: 8px;
  color: var(--teal);
  font-weight: 800;
}

.compact-select {
  width: 100%;
  min-width: 170px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  background: white;
  color: #263445;
  font-weight: 800;
}

.audit-table {
  margin-top: 16px;
}

.phone-frame {
  box-sizing: border-box;
  display: grid;
  gap: 14px;
  width: min(100%, 430px);
  max-width: 100%;
  justify-self: center;
  padding: 18px;
  border: 9px solid #17212d;
  border-radius: 30px;
  background: linear-gradient(180deg, #fbfffe 0%, #f5fbfb 100%);
  box-shadow: 0 28px 70px rgba(18, 35, 45, 0.22);
}

body.carer-app-mode .phone-frame {
  width: 100%;
  border: 8px solid #17212d;
  border-radius: 30px;
  padding: 16px;
  box-shadow: 0 22px 56px rgba(18, 35, 45, 0.18);
}

body.carer-app-mode .phone-top {
  display: block;
  width: 78px;
  height: 6px;
}

.mobile-current-visit.mobile-complete .geo-ring,
.mobile-current-visit.mobile-complete .mobile-geofence-hint,
.mobile-current-visit.mobile-complete .mobile-checkout-blockers,
.mobile-current-visit.mobile-complete .mobile-action-deck,
.mobile-current-visit.mobile-complete .mobile-critical-actions {
  display: none;
}

.phone-top {
  justify-self: center;
  width: 92px;
  height: 7px;
  border-radius: 999px;
  background: #d0d5dd;
}

.geo-ring {
  display: grid;
  place-items: center;
  width: 168px;
  height: 168px;
  justify-self: center;
  border: 14px solid #d8f2ea;
  border-top-color: #2b8e99;
  border-radius: 999px;
  text-align: center;
}

.geo-ring strong,
.geo-ring span {
  display: block;
}

.geo-ring strong {
  font-size: 36px;
}

.geo-ring span {
  max-width: 120px;
  color: var(--muted);
  font-size: 13px;
}

.detail-dialog {
  width: min(720px, calc(100% - 32px));
  border: 0;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 30px 90px rgba(16, 34, 56, 0.26);
}

.detail-dialog::backdrop {
  background: rgba(16, 34, 56, 0.54);
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin: 18px 0 0;
  padding: 0;
}

.action-dialog {
  width: min(860px, calc(100% - 32px));
}

.action-dialog .panel-header > div {
  min-width: 0;
}

.action-dialog .panel-header span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 14px;
}

.action-impact {
  display: grid;
  gap: 14px;
  margin: 18px 0;
  padding: 16px;
  border: 1px solid #b8d9e0;
  border-radius: 8px;
  background: #eef8fa;
}

.action-impact article {
  padding-left: 12px;
  border-left: 4px solid var(--teal);
}

.action-impact p {
  margin: 6px 0 0;
  color: #344054;
}

.action-impact ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 18px;
  color: #344054;
}

.action-fields {
  margin-top: 6px;
}

.action-support-card {
  grid-column: 1 / -1;
  padding: 14px 16px;
  border: 1px solid #d8e4ea;
  border-radius: 8px;
  background: #f8fbfc;
}

.action-support-card strong {
  display: block;
}

.action-support-card p {
  margin: 8px 0 0;
  color: #425066;
  line-height: 1.45;
}

.action-status-grid {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.record-pack-dialog {
  width: min(980px, calc(100% - 32px));
}

.record-pack-preview {
  max-height: min(62vh, 720px);
  margin: 18px 0 0;
  padding: 18px;
  overflow: auto;
  border: 1px solid #d8e4ea;
  border-radius: 8px;
  background: #f8fbfc;
  color: #263445;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 13px;
  line-height: 1.55;
  white-space: pre-wrap;
}

@media print {
  body.record-pack-printing > *:not(.record-pack-print-area) {
    display: none !important;
  }

  .record-pack-print-area {
    display: block !important;
    color: #111827;
    font-family: Arial, sans-serif;
    white-space: pre-wrap;
  }
}

.dialog-footnote {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

#leaveRequestImpact ul {
  display: grid;
  gap: 8px;
  margin: 10px 0 0;
  padding-left: 18px;
  color: #344054;
}

.leave-impact-visit-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.leave-impact-visit {
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 14px;
  background: rgba(248, 250, 252, 0.9);
  padding: 12px 14px;
  display: grid;
  gap: 8px;
}

.leave-impact-visit-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  color: #0f172a;
}

.leave-impact-visit-header span {
  color: var(--muted);
  font-size: 13px;
}

.leave-impact-visit-meta {
  display: grid;
  gap: 4px;
  color: #334155;
  font-size: 13px;
}

.leave-impact-visit-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.leave-impact-empty {
  margin: 14px 0 0;
  color: var(--muted);
}

.toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.gdpr-panel {
  margin-top: 18px;
}

.inspection-panel {
  margin-top: 18px;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #344054;
  font-weight: 800;
}

.check-row.full {
  grid-column: 1 / -1;
}

.check-row input {
  width: 18px;
  height: 18px;
  accent-color: var(--teal);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 820px;
}

th,
td {
  padding: 13px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  background: #edf5f4;
  font-size: 13px;
  color: #344054;
}

tbody tr:hover {
  background: #fbfefe;
}

.invoice-card {
  border-top: 4px solid var(--learning-blue);
}

.invoice-card dl {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 12px;
  margin: 14px 0 0;
}

.invoice-card dt {
  color: var(--muted);
}

.invoice-card dd {
  margin: 0;
  font-weight: 800;
}

.variance-panel {
  margin-top: 18px;
}

.variance-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.payroll-summary {
  margin-bottom: 16px;
}

.variance-summary article {
  padding: 14px;
  border: 1px solid #b8d9e0;
  border-radius: 8px;
  background: #eef8fa;
}

.summary-jump {
  padding: 14px;
  border: 1px solid #b8d9e0;
  border-radius: 8px;
  background: #eef8fa;
  text-align: left;
  font: inherit;
  cursor: pointer;
  width: 100%;
}

.summary-jump:hover {
  border-color: var(--teal);
  background: #e3f3f4;
}

.variance-summary strong,
.variance-summary span {
  display: block;
}

.variance-summary strong {
  font-size: 22px;
  color: var(--teal);
}

.variance-summary span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.access-recovery {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
  padding: 12px 14px;
  border: 1px solid #f1d19a;
  border-radius: 14px;
  background: #fff8eb;
}

.access-recovery strong {
  display: block;
  margin-bottom: 4px;
  color: #8a5a12;
}

.access-recovery span {
  color: var(--muted);
}

.access-recovery .mini-button {
  white-space: nowrap;
}

.access-setup {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
  padding: 14px 16px;
  border: 1px solid #b8d9e0;
  border-radius: 14px;
  background: #f4fbfc;
}

.access-setup-copy {
  min-width: 0;
}

.access-setup-copy strong {
  display: block;
  margin-bottom: 4px;
  color: var(--teal);
}

.access-setup-copy span {
  color: var(--muted);
}

.access-setup-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.import-summary {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.import-summary small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.35;
}

.import-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
  gap: 16px;
  align-items: start;
}

.import-panel {
  margin-top: 16px;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  font-weight: 900;
  font-size: 12px;
}

.status-badge.ok {
  color: var(--teal);
  background: var(--teal-soft);
}

.status-badge.hold {
  color: var(--amber);
  background: var(--gold);
}

.control-list {
  display: grid;
  gap: 10px;
}

.control-item {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 10px;
  align-items: start;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfefe;
}

.control-item p {
  margin: 5px 0 0;
  color: var(--muted);
  line-height: 1.4;
}

.control-index {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: var(--blue-soft);
  color: var(--blue);
  font-weight: 900;
}

.baseline-copy {
  max-width: 960px;
  line-height: 1.5;
}

.baseline-copy h3 {
  margin-top: 0;
}

.baseline-steps,
.gate-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 14px 0;
}

.baseline-steps div,
.gate-card {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.baseline-steps strong,
.baseline-steps span,
.gate-card strong,
.gate-card span {
  display: block;
}

.baseline-steps span,
.gate-card p {
  margin: 7px 0 0;
  color: var(--muted);
  line-height: 1.4;
}

.gate-card {
  border-left: 4px solid var(--line);
}

.gate-card.active {
  border-left-color: var(--blue);
}

.gate-card.done {
  border-left-color: var(--teal);
}

.gate-card.waiting {
  border-left-color: var(--amber);
}

.gate-card span {
  margin-top: 6px;
  color: var(--teal);
  font-weight: 900;
}

.dry-run-plan {
  display: grid;
  gap: 14px;
}

.dry-run-grid {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 12px;
  align-items: start;
}

.dry-run-summary,
.dry-run-empty {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, #f7fcfd 0%, #ffffff 100%);
}

.dry-run-summary strong,
.dry-run-summary span,
.dry-run-empty strong,
.dry-run-empty p {
  display: block;
}

.dry-run-summary strong {
  font-size: 18px;
  color: var(--teal);
  text-transform: uppercase;
  letter-spacing: 0;
}

.dry-run-summary span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
}

.dry-run-summary p,
.dry-run-empty p {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.dry-run-blockers {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.dry-run-blocker {
  padding: 12px 14px;
  border: 1px solid #d5e6ea;
  border-radius: 8px;
  background: #f8fcfd;
  color: var(--ink);
  line-height: 1.45;
}

.rules-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.field {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-weight: 800;
}

.field.full {
  grid-column: 1 / -1;
}

.readonly-note {
  padding: 10px 12px;
  border: 1px dashed rgba(107, 114, 128, 0.35);
  border-radius: 8px;
  background: #f8fbfd;
  color: var(--ink);
  font-weight: 700;
  line-height: 1.45;
}

.source-list {
  display: grid;
  gap: 12px;
  line-height: 1.5;
}

.source-list p {
  margin-bottom: 0;
}

.activity-entry {
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.audit-panel {
  margin-top: 16px;
}

@media (max-width: 1120px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    min-height: auto;
  }

  .nav-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    overflow: visible;
  }

  .nav-section {
    align-content: start;
  }

  .day-planner-body {
    grid-template-columns: 1fr;
  }

  .metric-grid,
  .feedback-layout,
  .hr-layout,
  .hr-record-grid,
  .hr-check-table,
  .access-filter-grid,
  .exception-summary,
  .variance-summary,
  .exception-list,
  .task-board,
  .handover-grid,
  .checklist-grid,
  .client-grid,
  .service-user-record-kpis,
  .service-user-record-workspace,
  .invoice-grid,
  .onboarding-grid,
  .onboarding-queue,
  .split-layout,
  .complaint-case-layout,
  .timeline-layout,
  .settings-grid,
  .foundation-grid,
  .voice-console,
  .mobile-grid,
  .mobile-test-model,
  .mobile-test-model-state,
  .security-grid,
  .inspection-grid,
  .access-grid,
  .mobile-medication-card,
  .report-grid,
  .import-grid,
  .gate-list,
  .baseline-steps,
  .dry-run-grid,
  .dry-run-blockers,
  .staff-list,
  .contact-item {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 760px) {
  .main {
    padding: 18px;
  }

  .topbar {
    position: static;
    margin: -18px -18px 18px;
    padding: 18px;
  }

  .topbar,
  .toolbar,
  .panel-header,
  .visit-item {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar-status {
    margin-left: 0;
  }

  .topbar-actions {
    flex-wrap: wrap;
  }

  .command-band,
  .command-actions,
  .metric-grid,
  .feedback-layout,
  .hr-layout,
  .hr-record-head,
  .hr-next-step-banner,
  .hr-record-grid,
  .hr-check-table,
  .access-filter-grid,
  .exception-summary,
  .variance-summary,
  .exception-list,
  .task-board,
  .handover-grid,
  .checklist-grid,
  .client-grid,
  .service-user-record-kpis,
  .service-user-record-workspace,
  .service-user-record-form,
  .invoice-grid,
  .onboarding-grid,
  .onboarding-queue,
  .split-layout,
  .complaint-case-layout,
  .timeline-layout,
  .settings-grid,
  .foundation-grid,
  .rules-form,
  .nav-list,
  .roster-layout,
  .voice-console,
  .mobile-grid,
  .mobile-test-model,
  .mobile-test-model-state,
  .security-grid,
  .inspection-grid,
  .access-grid,
  .mobile-medication-card,
  .report-grid,
  .import-grid,
  .gate-list,
  .baseline-steps,
  .dry-run-grid,
  .dry-run-blockers,
  .staff-list,
  .contact-item {
    grid-template-columns: 1fr;
  }

  .access-primary-tabs,
  .access-secondary-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .access-menu-ribbon {
    flex-wrap: nowrap;
    overflow-x: auto;
  }

  .access-menu-group {
    flex: 0 0 auto;
  }

  .hr-command-strip,
  .hr-command-strip .primary-button,
  .hr-command-strip .mini-button {
    width: 100%;
  }

  .hr-command-strip {
    display: grid;
    grid-template-columns: 1fr;
    justify-content: stretch;
  }

  .hr-record-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hr-record-tabs button {
    width: 100%;
    padding: 0 8px;
  }

  .service-user-record-header,
  .service-user-record-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .service-user-record-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .service-user-record-tabs button,
  .service-user-record-actions .primary-button {
    width: 100%;
  }

  .roster-sidebar {
    position: static;
  }

  .queue-filter-bar {
    gap: 8px;
  }

  .command-band h2 {
    font-size: 24px;
  }

  .command-stats {
    justify-self: stretch;
  }

  .visit-item {
    display: grid;
    grid-template-columns: 1fr;
  }

  .roster-board {
    max-height: calc(100vh - 160px);
  }

  .roster-row {
    min-width: 1240px;
  }

  .roster-row > div {
    min-height: 72px;
    padding: 8px;
  }

  .roster-visit {
    padding: 6px;
  }

  .roster-summary strong {
    font-size: 16px;
  }
}
