:root {
  --ink: #172026;
  --muted: #63717a;
  --line: #dfe7eb;
  --panel: #ffffff;
  --page: #f5f8f7;
  --brand: #0f766e;
  --brand-dark: #0b4f4a;
  --accent: #2563eb;
  --warning: #b7791f;
  --warning-bg: #fff4d6;
  --danger: #c2413c;
  --danger-bg: #ffe4e1;
  --safe: #15803d;
  --safe-bg: #dcfce7;
  --shadow: 0 18px 45px rgba(23, 32, 38, 0.1);
  color-scheme: light;
  font-family: Inter, "Segoe UI Variable", "Segoe UI", Aptos, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  line-height: 1.45;
  text-rendering: geometricPrecision;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
  letter-spacing: 0;
}

.brand-mark__icon {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: #ffffff;
  color: var(--brand-dark);
  font-weight: 900;
}

.brand-mark__icon.has-logo {
  overflow: hidden;
  background: #ffffff;
  padding: 3px;
}

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

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

.button {
  border: 0;
  border-radius: 8px;
  padding: 12px 16px;
  font-weight: 760;
  color: #ffffff;
  background: var(--brand);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
}

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

.button.secondary {
  color: var(--ink);
  background: #eef5f3;
  border: 1px solid #d5e2de;
}

.button.danger {
  color: #ffffff;
  background: var(--danger);
}

.button.danger:hover {
  background: #9f332f;
}

.icon-button {
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  font-weight: 800;
}

.alert-icon-button {
  position: relative;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: inline-grid;
  place-items: center;
  background: #ffffff;
  color: var(--ink);
}

.alert-icon-button:hover {
  border-color: #b7d8d1;
  background: #f1fbf8;
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.1);
}

.alert-icon-svg svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.alert-count-badge {
  position: absolute;
  top: -7px;
  right: -7px;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border: 2px solid #ffffff;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  background: var(--danger);
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 780;
  line-height: 1;
}

.alert-icon-button::after {
  content: attr(data-tooltip);
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 30;
  width: max-content;
  max-width: 240px;
  padding: 7px 9px;
  border-radius: 8px;
  background: #172026;
  color: #ffffff;
  font-size: 0.78rem;
  font-weight: 650;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-4px);
  transition: opacity 0.16s ease, transform 0.16s ease;
}

.alert-icon-button:hover::after,
.alert-icon-button:focus-visible::after {
  opacity: 1;
  transform: translateY(0);
}

.field {
  display: grid;
  gap: 8px;
  color: #2f3d44;
  font-weight: 650;
}

.field input,
.field select,
.field textarea,
.search-input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  color: var(--ink);
  background: #ffffff;
  outline: none;
}

.field input:focus,
.field select:focus,
.field textarea:focus,
.search-input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.14);
}

.field textarea {
  min-height: 96px;
  line-height: 1.45;
  resize: vertical;
}

.compact-cell-title {
  display: inline-block;
  max-width: 160px;
  vertical-align: middle;
}

.compact-actions {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex-wrap: nowrap;
}

.compact-actions .table-action,
.table-action.note-dot {
  min-height: 30px;
  padding: 5px 8px;
  font-size: 0.78rem;
}

.table-action.note-dot {
  margin-left: 6px;
  color: var(--brand);
  background: #eefbf8;
  border-color: #cdeae2;
}

.date-field input[type="date"] {
  color-scheme: light;
  cursor: pointer;
}

.date-field input[type="date"]::-webkit-calendar-picker-indicator {
  cursor: pointer;
  border-radius: 8px;
  padding: 4px;
  background-color: #eaf7f7;
}

.login-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(360px, 0.95fr);
  background: #ffffff;
}

.login-visual {
  position: relative;
  min-height: 100vh;
  padding: 48px;
  color: #ffffff;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
}

.login-visual img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.82) contrast(0.95);
}

.login-visual::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, rgba(11, 79, 74, 0.92), rgba(15, 118, 110, 0.55));
}

.login-visual > * {
  position: relative;
  z-index: 1;
}

.login-copy { max-width: 650px; }

.login-copy h1 {
  margin: 0 0 16px;
  font-size: clamp(2.6rem, 4vw, 5rem);
  line-height: 0.98;
  letter-spacing: 0;
}

.login-copy p {
  max-width: 560px;
  margin: 0;
  font-size: 1.16rem;
  line-height: 1.65;
}

.login-card {
  min-height: 100vh;
  display: grid;
  align-content: center;
  padding: 56px;
}

.login-card__inner {
  width: min(100%, 430px);
  margin: auto;
}

.login-card h2 {
  margin: 18px 0 8px;
  font-size: 2rem;
}

.form-stack {
  display: grid;
  gap: 18px;
  margin-top: 32px;
}

.login-links {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 20px;
  color: var(--muted);
  font-size: 0.92rem;
}

.login-links a {
  color: var(--brand-dark);
  text-decoration: none;
  font-weight: 700;
}

.password-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}

.password-field input {
  min-width: 0;
}

.password-field .table-action {
  min-height: 38px;
  align-self: end;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 22px 18px;
  background: #ffffff;
  border-right: 1px solid var(--line);
}

.sidebar .brand-mark {
  color: var(--brand-dark);
  padding: 7px 8px 22px;
}

.sidebar .brand-mark__icon {
  background: var(--brand);
  color: #ffffff;
}

.nav {
  display: grid;
  gap: 6px;
}

.nav button {
  width: 100%;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #405057;
  padding: 11px 12px;
  text-align: left;
  font-weight: 700;
}

.nav button.active,
.nav button:hover {
  background: #eaf5f3;
  color: var(--brand-dark);
}

.main { min-width: 0; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  min-height: 76px;
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(260px, 420px) auto;
  gap: 18px;
  align-items: center;
  padding: 16px 28px;
  background: rgba(245, 248, 247, 0.92);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(223, 231, 235, 0.85);
}

.topbar h1 {
  margin: 0;
  font-size: 1.55rem;
}

.topbar-actions {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
}

.connection-pill {
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  display: inline-flex;
  font-size: 12px;
  gap: 6px;
  min-height: 34px;
  padding: 0 10px;
  white-space: nowrap;
}

.connection-pill.connected {
  background: #eefcf5;
  border-color: #cdeedb;
  color: #2f7d4f;
}

.connection-pill.local {
  background: #f8fafc;
}

.connection-dot {
  background: #94a3b8;
  border-radius: 999px;
  display: inline-block;
  height: 7px;
  width: 7px;
}

.connection-pill.connected .connection-dot {
  background: #2f9e61;
}

.topbar-add-button,
.owner-profile-pill {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  background: #ffffff;
  color: var(--ink);
  font: inherit;
  cursor: pointer;
  transition: border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.topbar-add-button:hover,
.owner-profile-pill:hover {
  border-color: #b7d8d1;
  background: #f6fcfb;
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.08);
  transform: translateY(-1px);
}

.topbar-add-button {
  gap: 6px;
  padding: 0 13px;
  background: var(--brand);
  border-color: var(--brand);
  color: #ffffff;
}

.topbar-add-button:hover {
  background: var(--brand-dark);
  border-color: var(--brand-dark);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}

.topbar-add-button span {
  font-size: 1rem;
  line-height: 1;
}

.owner-profile-pill {
  gap: 9px;
  padding: 4px 10px 4px 5px;
  text-align: left;
}

.owner-profile-pill span {
  display: grid;
  gap: 1px;
}

.owner-profile-pill strong,
.owner-profile-pill small {
  display: block;
  white-space: nowrap;
}

.owner-profile-pill strong {
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 500;
}

.owner-profile-pill small {
  color: var(--muted);
  font-size: 0.68rem;
}

.avatar,
.client-photo {
  border-radius: 8px;
  object-fit: cover;
}

.avatar {
  width: 34px;
  height: 34px;
  border: 2px solid #ffffff;
  box-shadow: 0 0 0 1px var(--line);
}

.rail-avatar[data-owner-profile] {
  cursor: pointer;
}

.rail-avatar[data-owner-profile]:hover {
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.16);
}

.content {
  width: min(100%, 1440px);
  margin: 0 auto;
  padding: 28px;
}

.page-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.page-actions h2 {
  margin: 0;
  font-size: 1.45rem;
}

.action-row,
.filters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.filters { margin-bottom: 18px; }

.filters input,
.filters select {
  width: auto;
  min-width: 170px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: #ffffff;
}

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

.kpi-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.two-column { grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr); }
.profile-grid { grid-template-columns: minmax(0, 1fr) 360px; }

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 1px 0 rgba(23, 32, 38, 0.02);
}

.card.pad { padding: 18px; }

.card h3 {
  margin: 0 0 14px;
  font-size: 1.02rem;
}

.kpi-card {
  padding: 18px;
  min-height: 128px;
  display: grid;
  align-content: space-between;
}

.kpi-card p {
  margin: 0;
  color: var(--muted);
  font-weight: 700;
}

.kpi-card strong {
  display: block;
  margin-top: 12px;
  font-size: 2rem;
  line-height: 1;
}

.trend {
  color: var(--safe);
  font-weight: 800;
  font-size: 0.9rem;
}

.alert-list,
.activity-list,
.detail-list {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.alert-item,
.activity-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px;
  border-radius: 8px;
  background: #f7faf9;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 99px;
  margin-top: 6px;
  flex: 0 0 auto;
}

.dot.red { background: var(--danger); }
.dot.yellow { background: #d99a17; }
.dot.green { background: var(--safe); }
.dot.blue { background: var(--accent); }

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

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

th,
td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
}

th {
  color: #53646c;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0;
  background: #fbfdfc;
}

td {
  color: #26343a;
  font-size: 0.94rem;
}

.table-action {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 8px 10px;
  color: var(--brand-dark);
  font-weight: 760;
  cursor: pointer;
}

.table-action:hover {
  border-color: rgba(24, 119, 121, 0.34);
  background: #eefafa;
}

.detail-card .mini-action {
  margin-top: 8px;
  padding: 6px 8px;
  min-height: 28px;
}

.payroll-box-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 7px;
  padding: 12px;
}

.payroll-entry-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: center;
  min-height: 48px;
  padding: 6px 8px 6px 10px;
  border: 1px solid #cfd8dd;
  border-radius: 8px;
  background: #f8fafb;
  box-shadow: inset 3px 0 0 #3aa9bd;
}

.payroll-entry-card.verified {
  background: #f4fbf6;
  box-shadow: inset 3px 0 0 var(--safe);
}

.payroll-entry-card.unverified {
  background: #fffafa;
  box-shadow: inset 3px 0 0 var(--warning);
}

.payroll-entry-card span,
.payroll-entry-card div > span {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.18;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.payroll-entry-card strong {
  display: block;
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 680;
  line-height: 1.18;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.payroll-entry-main em {
  color: var(--muted);
  font-style: normal;
  font-weight: 520;
}

.payroll-card-actions {
  display: inline-flex;
  gap: 4px;
  justify-content: flex-end;
  align-items: center;
}

.personnel-pill-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 8px;
  padding: 12px;
}

.personnel-pill-card {
  display: grid;
  grid-template-columns: 38px minmax(0, 1.25fr) minmax(120px, 0.75fr) auto auto;
  gap: 8px;
  align-items: center;
  min-height: 58px;
  padding: 8px 10px;
  border: 1px solid #cfd8dd;
  border-radius: 8px;
  background: #f8fafb;
  box-shadow: inset 3px 0 0 #3aa9bd;
}

.personnel-pill-card.active {
  background: #f4fbf6;
  box-shadow: inset 3px 0 0 var(--safe);
}

.personnel-pill-card.inactive {
  background: #fffafa;
  box-shadow: inset 3px 0 0 var(--warning);
}

.personnel-pill-avatar {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: #e8eef0;
  color: #354248;
  font-size: 0.78rem;
  font-weight: 650;
}

.personnel-pill-main,
.personnel-pill-meta {
  min-width: 0;
}

.personnel-pill-card strong,
.personnel-pill-card span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.personnel-pill-card strong {
  color: var(--ink);
  font-size: 0.84rem;
  line-height: 1.18;
}

.personnel-pill-card strong em {
  color: var(--muted);
  font-style: normal;
  font-weight: 520;
}

.personnel-pill-card span {
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.2;
}

.settings-pill-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 12px;
}

.settings-pill-card {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: center;
  min-height: 58px;
  padding: 8px 10px;
  border: 1px solid #cfd8dd;
  border-radius: 8px;
  background: #f8fafb;
  box-shadow: inset 3px 0 0 #3aa9bd;
}

.settings-pill-card.active {
  background: #f4fbf6;
  box-shadow: inset 3px 0 0 var(--safe);
}

.settings-pill-card.inactive {
  background: #fffafa;
  box-shadow: inset 3px 0 0 var(--warning);
}

.settings-pill-avatar {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: #e8eef0;
  color: #354248;
  font-size: 0.72rem;
  font-weight: 650;
}

.settings-pill-avatar.code {
  width: 42px;
  font-size: 0.7rem;
  letter-spacing: 0;
}

.settings-pill-main {
  min-width: 0;
}

.settings-pill-card strong,
.settings-pill-card span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.settings-pill-card strong {
  color: var(--ink);
  font-size: 0.84rem;
  line-height: 1.18;
}

.settings-pill-card span {
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.2;
}

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

.readiness-blocker-card {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: center;
  min-height: 54px;
  padding: 8px 10px;
  border: 1px solid #cfd8dd;
  border-radius: 8px;
  background: #f8fafb;
  box-shadow: inset 3px 0 0 #3aa9bd;
}

.readiness-blocker-card.urgent {
  background: #fffafa;
  box-shadow: inset 3px 0 0 var(--danger);
}

.readiness-blocker-card.warning,
.readiness-blocker-card.pending {
  background: #fffaf0;
  box-shadow: inset 3px 0 0 var(--warning);
}

.readiness-blocker-lane {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: #e8eef0;
  color: #354248;
  font-size: 0.78rem;
  font-weight: 650;
}

.readiness-blocker-main {
  min-width: 0;
}

.readiness-blocker-card strong,
.readiness-blocker-card span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.readiness-blocker-card strong {
  color: var(--ink);
  font-size: 0.84rem;
  line-height: 1.18;
}

.readiness-blocker-card span {
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.2;
}

.coverage-gap-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 12px;
}

.coverage-gap-card {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: center;
  min-height: 56px;
  padding: 8px 10px;
  border: 1px solid #cfd8dd;
  border-radius: 8px;
  background: #fffaf0;
  box-shadow: inset 3px 0 0 var(--warning);
}

.coverage-gap-code {
  width: 52px;
  height: 34px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: #e8eef0;
  color: #354248;
  font-size: 0.72rem;
  font-weight: 650;
}

.coverage-gap-main {
  min-width: 0;
}

.coverage-gap-card strong,
.coverage-gap-card span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.coverage-gap-card strong {
  color: var(--ink);
  font-size: 0.84rem;
  line-height: 1.18;
}

.coverage-gap-card span {
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.2;
}

.yes-no-icon {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--muted);
  font-weight: 700;
  font-size: 0.72rem;
}

.yes-no-icon svg {
  width: 16px;
  height: 16px;
  border-radius: 999px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.yes-no-icon.yes {
  color: var(--safe);
}

.yes-no-icon.no {
  color: var(--danger);
}

.table-action.icon-action {
  display: inline-grid;
  place-items: center;
  min-width: 28px;
  min-height: 28px;
  padding: 4px;
}

.table-action.icon-action .yes-no-icon span {
  display: none;
}

.task-action-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}

.task-action-label {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 8px;
  border-radius: 8px;
  background: #f2f5f6;
  color: #53646c;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.action-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfc;
}

.action-card p {
  margin: 4px 0 0;
}

.action-alert {
  align-items: flex-start;
}

.action-alert.is-clear {
  opacity: 0.78;
}

.priority-alert-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.priority-alert-card {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 10px;
  align-items: flex-start;
  min-height: 92px;
  padding: 10px;
  border: 1px solid #cfd8dd;
  border-radius: 8px;
  background: #f8fafb;
  box-shadow: inset 3px 0 0 #3aa9bd;
}

.priority-alert-card.red {
  background: #fffafa;
  box-shadow: inset 3px 0 0 var(--danger);
}

.priority-alert-card.yellow {
  background: #fffaf0;
  box-shadow: inset 3px 0 0 var(--warning);
}

.priority-alert-card.blue {
  background: #f4fbff;
  box-shadow: inset 3px 0 0 #3aa9bd;
}

.priority-alert-card.green,
.priority-alert-card.is-clear {
  background: #f4fbf6;
  box-shadow: inset 3px 0 0 var(--safe);
}

.priority-alert-mark {
  width: 38px;
  height: 34px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: #e8eef0;
  color: #354248;
  font-size: 0.76rem;
  font-weight: 650;
}

.priority-alert-main {
  min-width: 0;
}

.priority-alert-main strong,
.priority-alert-main span {
  display: block;
}

.priority-alert-main strong {
  color: var(--ink);
  font-size: 0.86rem;
  line-height: 1.2;
}

.priority-alert-main > span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.32;
}

.priority-alert-main .task-action-strip {
  margin-top: 8px;
}

.qa-guidance {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  margin-top: 14px;
  padding: 12px;
  border: 1px solid #cfe4e8;
  border-radius: 8px;
  background: #f2fbfc;
  color: #25535d;
}

.qa-guidance strong {
  color: var(--ink);
}

.qa-guidance span {
  font-size: 0.86rem;
  line-height: 1.4;
}

.qa-section {
  margin-top: 18px;
}

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

.qa-check-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 178px;
  padding: 12px;
  border: 1px solid #dce4e7;
  border-radius: 8px;
  background: #fbfcfd;
  box-shadow: inset 3px 0 0 #7b8b95;
}

.qa-check-card.safe {
  background: #f6fff8;
  box-shadow: inset 3px 0 0 var(--safe);
}

.qa-check-card.due {
  background: #fffdf4;
  box-shadow: inset 3px 0 0 var(--warning);
}

.qa-check-card.urgent {
  background: #fff7f7;
  box-shadow: inset 3px 0 0 var(--danger);
}

.qa-check-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.qa-check-head > span {
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.qa-check-card strong {
  color: var(--ink);
  font-size: 0.95rem;
  line-height: 1.25;
}

.qa-check-card p,
.qa-check-card small {
  color: var(--muted);
  line-height: 1.38;
}

.qa-check-card p {
  margin: 0;
  font-size: 0.82rem;
}

.qa-check-card small {
  display: block;
  margin-top: auto;
  font-size: 0.76rem;
}

.recovery-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: #f6f8f9;
}

.recovery-card {
  width: min(680px, 100%);
  padding: 24px;
  border: 1px solid #dbe4e7;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 18px 42px rgba(37, 54, 61, 0.08);
}

.recovery-card h1 {
  margin: 14px 0 8px;
  color: var(--ink);
  font-size: 1.4rem;
}

.status {
  display: inline-flex;
  align-items: center;
  border-radius: 8px;
  padding: 5px 9px;
  font-weight: 800;
  font-size: 0.78rem;
}

.status.safe {
  color: var(--safe);
  background: var(--safe-bg);
}

.status.due {
  color: var(--warning);
  background: var(--warning-bg);
}

.status.urgent {
  color: var(--danger);
  background: var(--danger-bg);
}

.status.neutral {
  color: #37515f;
  background: #eaf1f4;
}

.chart-placeholder {
  height: 112px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, transparent 0 24%, rgba(223, 231, 235, 0.65) 25% 26%, transparent 27% 49%, rgba(223, 231, 235, 0.65) 50% 51%, transparent 52% 74%, rgba(223, 231, 235, 0.65) 75% 76%, transparent 77%),
    linear-gradient(105deg, transparent 0 8%, rgba(15, 118, 110, 0.18) 8% 18%, transparent 18% 31%, rgba(37, 99, 235, 0.18) 31% 45%, transparent 45% 60%, rgba(15, 118, 110, 0.18) 60% 76%, transparent 76%);
}

.profile-header {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  margin-bottom: 18px;
}

.client-photo {
  width: 76px;
  height: 76px;
}

.profile-header h2 { margin: 0 0 6px; }

.meta-line {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 0.94rem;
}

.tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.tabs button {
  border: 1px solid var(--line);
  background: #ffffff;
  color: #44545c;
  border-radius: 8px;
  padding: 10px 12px;
  font-weight: 750;
}

.tabs button.active {
  background: var(--brand);
  border-color: var(--brand);
  color: #ffffff;
}

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

.mini-stat {
  padding: 14px;
  border-radius: 8px;
  background: #f7faf9;
}

.mini-stat span {
  display: block;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
}

.mini-stat strong {
  display: block;
  margin-top: 7px;
  font-size: 1.2rem;
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: rgba(23, 32, 38, 0.28);
}

.drawer {
  position: fixed;
  inset: 0 0 0 auto;
  z-index: 21;
  width: min(920px, calc(100vw - 132px));
  background: #ffffff;
  border-left: 1px solid var(--line);
  box-shadow: var(--shadow);
  transform: translateX(105%);
  transition: transform 180ms ease;
  display: grid;
  grid-template-rows: auto 1fr;
}

.drawer.open { transform: translateX(0); }

.drawer__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 22px;
  border-bottom: 1px solid var(--line);
}

.drawer__header h2 { margin: 5px 0 0; }

.drawer__body {
  padding: 22px;
  overflow-y: auto;
  overflow-x: hidden;
}

.drawer .table-wrap {
  overflow-x: visible;
}

.drawer table {
  min-width: 0;
  table-layout: auto;
}

.drawer th,
.drawer td {
  white-space: normal;
}

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

.drawer .detail-list li {
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfc;
}

.drawer .detail-list strong {
  text-align: left;
}

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

.drawer .compact-form {
  gap: 10px;
}

.drawer .compact-form .field {
  gap: 4px;
  font-size: 0.76rem;
}

.drawer .compact-form .field input,
.drawer .compact-form .field select {
  min-height: 32px;
  padding: 7px 9px;
}

.drawer .compact-form .field textarea {
  min-height: 56px;
  padding: 8px 9px;
}

.drawer .client-form-grid {
  gap: 10px 12px;
}

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

.detail-section {
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}

.detail-section:first-child { padding-top: 0; }
.detail-section h3 { margin: 0 0 12px; }

.detail-list li {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: var(--muted);
}

.detail-list strong {
  color: var(--ink);
  text-align: right;
}

.empty {
  padding: 42px;
  text-align: center;
  color: var(--muted);
}

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

.report-card {
  min-height: 178px;
  display: grid;
  align-content: space-between;
}

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

.settings-tabs {
  align-items: flex-start;
}

.bar-list {
  display: grid;
  gap: 14px;
}

.bar-row {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) 78px;
  gap: 12px;
  align-items: center;
  color: var(--muted);
  font-weight: 700;
}

.bar-track {
  height: 12px;
  border-radius: 8px;
  background: #e8eff1;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: 8px;
  background: var(--brand);
}

.switch-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

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

.toggle {
  width: 46px;
  height: 26px;
  border-radius: 99px;
  border: 0;
  background: var(--brand);
  position: relative;
  flex: 0 0 auto;
}

.toggle::after {
  content: "";
  position: absolute;
  top: 4px;
  right: 4px;
  width: 18px;
  height: 18px;
  border-radius: 99px;
  background: #ffffff;
}

.toast-region {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 40;
  display: grid;
  gap: 10px;
  width: min(360px, calc(100vw - 36px));
}

.toast {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--brand);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
  color: var(--ink);
  font-weight: 700;
}

.notice {
  padding: 12px 14px;
  border: 1px solid #d5e2de;
  border-radius: 8px;
  background: #f3faf8;
  color: var(--brand-dark);
  font-weight: 700;
}

@media (max-width: 1040px) {
  .login-page,
  .app-shell,
  .two-column,
  .profile-grid,
  .kpi-grid {
    grid-template-columns: 1fr;
  }

  .login-visual { min-height: 420px; }

  .login-card {
    min-height: auto;
    padding: 36px 22px;
  }

  .sidebar {
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

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

@media (max-width: 680px) {
  .login-visual { padding: 28px; }

  .content,
  .topbar {
    padding: 18px;
  }

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

  .page-actions,
  .profile-header {
    grid-template-columns: 1fr;
    display: grid;
  }

  .action-row,
  .topbar-actions {
    justify-content: stretch;
  }

  .button,
  .filters input,
  .filters select {
    width: 100%;
  }

  .mini-stat-grid { grid-template-columns: 1fr; }
  .report-grid,
  .form-grid {
    grid-template-columns: 1fr;
  }
}

/* Calm clinical admin redesign */
:root {
  --ink: #1f282c;
  --muted: #657176;
  --line: #e8edf0;
  --panel: #ffffff;
  --page: #fbfcfc;
  --brand: #2a8a8a;
  --brand-dark: #1d5f61;
  --accent: #4f7f8a;
  --shadow: 0 8px 22px rgba(31, 40, 44, 0.06);
}

body {
  background: var(--page);
  font-size: 15px;
}

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

.sidebar {
  position: sticky;
  top: 0;
  z-index: 10;
  height: auto;
  padding: 10px 18px 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  background: rgba(255, 255, 255, 0.96);
  border-right: 0;
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.sidebar .brand-mark {
  padding: 0 0 10px;
  gap: 8px;
  font-size: 0.95rem;
}

.brand-mark__icon,
.sidebar .brand-mark__icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  font-size: 0.82rem;
  background: #e8f5f4;
  color: var(--brand-dark);
}

.nav {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: thin;
  padding-bottom: 10px;
}

.nav button {
  width: auto;
  flex: 0 0 auto;
  padding: 9px 12px;
  border-radius: 8px;
  color: #556267;
  font-size: 0.9rem;
  font-weight: 650;
  white-space: nowrap;
}

.nav button.active,
.nav button:hover {
  background: #eaf7f7;
  color: var(--brand-dark);
}

.topbar {
  position: sticky;
  top: 49px;
  min-height: 56px;
  grid-template-columns: minmax(190px, 0.85fr) minmax(220px, 430px) auto;
  padding: 10px 18px;
  gap: 12px;
  background: rgba(251, 252, 252, 0.95);
  border-bottom: 1px solid var(--line);
}

.topbar h1 {
  font-size: 1.12rem;
  font-weight: 720;
}

.topbar p {
  margin: 2px 0 0;
  font-size: 0.78rem;
}

.content {
  width: 100%;
  margin: 0;
  padding: 16px 18px 28px;
}

.button {
  min-height: 34px;
  padding: 7px 11px;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 680;
  box-shadow: none;
}

.button.secondary {
  background: #ffffff;
  color: #405057;
}

.icon-button {
  width: auto;
  min-width: 34px;
  height: 34px;
  padding: 0 9px;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 680;
}

.avatar {
  width: 34px;
  height: 34px;
}

.search-input,
.field input,
.field select,
.field textarea,
.filters input,
.filters select {
  min-height: 34px;
  padding: 8px 10px;
  border-radius: 8px;
  background: #ffffff;
  font-size: 0.9rem;
}

.page-actions {
  align-items: flex-start;
  margin-bottom: 12px;
}

.page-actions h2 {
  font-size: 1.18rem;
}

.page-actions p {
  margin: 4px 0 0;
}

.grid {
  gap: 12px;
}

.kpi-grid {
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.card {
  border-color: var(--line);
  border-radius: 8px;
  box-shadow: none;
}

.card.pad {
  padding: 14px;
}

.card h3 {
  margin-bottom: 10px;
  font-size: 0.98rem;
}

.kpi-card {
  min-height: 92px;
  padding: 14px;
}

.kpi-card p {
  font-size: 0.82rem;
  font-weight: 650;
}

.kpi-card strong {
  margin-top: 8px;
  font-size: 1.42rem;
}

.trend {
  font-size: 0.78rem;
  font-weight: 650;
}

.filters {
  margin-bottom: 12px;
  gap: 8px;
}

table {
  min-width: 700px;
}

th,
td {
  padding: 9px 11px;
}

th {
  background: #fbfcfc;
  color: #6b777c;
  font-size: 0.72rem;
  font-weight: 720;
  text-transform: none;
}

td {
  font-size: 0.9rem;
}

.table-action {
  padding: 6px 8px;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 650;
}

.status {
  padding: 3px 7px;
  border-radius: 8px;
  font-size: 0.72rem;
  font-weight: 720;
}

.tabs {
  gap: 0;
  margin: 0;
  padding: 0 18px;
  border-bottom: 1px solid var(--line);
  background: #ffffff;
}

.tabs button {
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  padding: 12px 14px 10px;
  background: transparent;
  color: #566368;
  font-size: 0.9rem;
  font-weight: 650;
}

.tabs button.active {
  background: #eefafa;
  border-color: var(--brand);
  color: var(--brand-dark);
}

.record-topbar {
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 18px;
  margin: -16px -18px 0;
  background: #ffffff;
  border-bottom: 1px solid var(--line);
}

.record-identity {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.record-identity h2 {
  margin: 0;
  font-size: 1.12rem;
  font-weight: 720;
}

.record-avatar {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: inline-grid;
  place-items: center;
  background: #eef2f2;
  color: #2f3d42;
  font-size: 0.78rem;
  font-weight: 780;
}

.record-avatar.large {
  width: 48px;
  height: 48px;
  margin-bottom: 12px;
  font-size: 1rem;
}

.record-org {
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: #3b494e;
  background: #fbfcfc;
  font-weight: 650;
}

.meta-line {
  gap: 10px;
  align-items: center;
  font-size: 0.82rem;
}

.client-record {
  display: grid;
  grid-template-columns: 420px minmax(0, 1fr);
  min-height: calc(100vh - 170px);
  margin: 0 -18px -28px;
  background: #ffffff;
}

.profile-side-panel {
  border-right: 1px solid var(--line);
  background: #fbfcfc;
  overflow: auto;
}

.side-section {
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.side-section h3,
.workspace-heading h3 {
  margin: 0 0 14px;
  font-size: 0.96rem;
  font-weight: 720;
}

.info-list {
  display: grid;
  gap: 15px;
  margin: 0;
}

.info-list div {
  display: grid;
  grid-template-columns: 24px 110px minmax(0, 1fr);
  column-gap: 10px;
  align-items: center;
}

.info-list div::before {
  content: "";
  width: 18px;
  height: 18px;
  margin-top: 2px;
  border: 1px solid #b7c3c8;
  border-radius: 5px;
}

.info-list dt {
  color: #788288;
  font-size: 0.78rem;
}

.info-list dd {
  margin: 0;
  color: #253137;
  font-weight: 650;
}

.profile-section-nav {
  display: grid;
}

.profile-section-nav button {
  border: 0;
  border-bottom: 1px solid var(--line);
  border-left: 3px solid transparent;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 13px 18px;
  background: transparent;
  color: #2f3b40;
  text-align: left;
  font-weight: 650;
}

.profile-section-nav button.active,
.profile-section-nav button:hover {
  border-left-color: var(--brand);
  background: #eaf7f7;
  color: var(--brand-dark);
}

.profile-workspace {
  padding: 18px 24px;
  overflow: auto;
}

.workspace-section {
  max-width: none;
}

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

.contact-record {
  position: relative;
  max-width: none;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px 58px 16px 16px;
  background: #ffffff;
}

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

.contact-grid div {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  column-gap: 10px;
}

.contact-grid div::before {
  content: "";
  width: 18px;
  height: 18px;
  margin-top: 3px;
  border: 1px solid #aebbc0;
  border-radius: 5px;
}

.contact-grid span,
.compact-summary span {
  display: block;
  color: #788288;
  font-size: 0.78rem;
}

.contact-grid strong,
.compact-summary strong {
  display: block;
  margin-top: 2px;
  color: #253137;
  font-size: 0.9rem;
}

.compact-summary small {
  display: block;
  margin-top: 8px;
  color: #788288;
  font-size: 0.76rem;
  line-height: 1.35;
}

.contact-actions {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  gap: 6px;
}

.compact-summary {
  max-width: none;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--line);
}

.compact-summary div {
  min-height: 70px;
  padding: 12px;
  background: #ffffff;
}

.profile-section-page {
  display: grid;
  gap: 14px;
}

.section-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.section-title-row.sub {
  margin-top: 18px;
}

.section-title-row h3 {
  margin: 0;
  font-size: 1.08rem;
  font-weight: 650;
}

.profile-contact-card,
.profile-record-row,
.diagnosis-record {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.profile-contact-card {
  width: min(680px, 100%);
  padding: 16px 64px 16px 16px;
}

.profile-info-stack {
  display: grid;
  gap: 14px;
}

.profile-info-stack.compact {
  gap: 16px;
}

.profile-info-item {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.profile-row-icon {
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: #172026;
  font-size: 0.62rem;
  font-weight: 760;
}

.profile-row-icon.svg-icon svg {
  width: 25px;
  height: 25px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.profile-info-item span,
.profile-record-row span,
.diagnosis-record span {
  display: block;
  color: #737f86;
  font-size: 0.82rem;
}

.profile-info-item strong,
.profile-record-row strong,
.diagnosis-record strong {
  display: block;
  margin-top: 2px;
  color: #1f282c;
  font-size: 0.94rem;
  font-weight: 520;
}

.profile-record-row {
  min-height: 84px;
  display: grid;
  grid-template-columns: 34px repeat(3, minmax(150px, 1fr)) auto;
  gap: 18px;
  align-items: center;
  padding: 14px 16px;
}

.profile-record-row .wide {
  grid-column: span 2;
}

.care-team-pill-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.care-team-pill {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 62px;
  padding: 10px;
  border: 1px solid #d8e3e6;
  border-radius: 8px;
  background: #fbfcfd;
  box-shadow: inset 3px 0 0 #3aa9bd;
}

.care-team-pill.active {
  background: #f4fbf6;
  box-shadow: inset 3px 0 0 var(--safe);
}

.care-team-pill.pending {
  background: #fffaf0;
  box-shadow: inset 3px 0 0 var(--warning);
}

.care-team-pill-avatar {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: #eef3f5;
  color: var(--ink);
  font-size: 0.72rem;
  font-weight: 760;
}

.care-team-pill-main,
.care-team-pill-meta {
  min-width: 0;
}

.care-team-pill strong,
.care-team-pill span {
  display: block;
}

.care-team-pill-main strong {
  color: var(--ink);
  font-size: 0.9rem;
  line-height: 1.2;
}

.care-team-pill-main span,
.care-team-pill-meta span {
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.care-team-pill-meta {
  text-align: right;
}

.care-team-pill-meta strong {
  margin-top: 2px;
  color: #31565d;
  font-size: 0.75rem;
  font-weight: 620;
}

.staff-check-pill-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 12px;
}

.staff-check-pill {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 72px;
  padding: 10px;
  border: 1px solid #d8e3e6;
  border-radius: 8px;
  background: #fbfcfd;
  box-shadow: inset 3px 0 0 #7b8b95;
}

.staff-check-pill.safe {
  background: #f4fbf6;
  box-shadow: inset 3px 0 0 var(--safe);
}

.staff-check-pill.due {
  background: #fffaf0;
  box-shadow: inset 3px 0 0 var(--warning);
}

.staff-check-pill.urgent {
  background: #fff7f7;
  box-shadow: inset 3px 0 0 var(--danger);
}

.staff-check-pill-avatar {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: #eef3f5;
  color: var(--ink);
  font-size: 0.72rem;
  font-weight: 760;
}

.staff-check-pill-main {
  min-width: 0;
}

.staff-check-pill strong,
.staff-check-pill span {
  display: block;
}

.staff-check-pill-main strong {
  color: var(--ink);
  font-size: 0.86rem;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.staff-check-pill-main span {
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.staff-check-pill .status {
  justify-self: end;
}

.staff-check-pill .payroll-card-actions {
  grid-column: 2 / -1;
}

.personnel-page-compact .kpi-grid {
  gap: 10px;
}

.personnel-page-compact .kpi-card {
  min-height: 78px;
  padding: 10px 12px;
}

.personnel-page-compact .kpi-card strong {
  margin-top: 4px;
  font-size: 1.24rem;
}

.personnel-page-compact .trend {
  font-size: 0.74rem;
}

.personnel-workspace {
  height: clamp(500px, calc(100vh - 202px), 760px);
  min-height: 0;
  margin-top: 10px;
}

.personnel-workspace .workspace-panel-head {
  padding: 12px 12px 8px;
}

.personnel-workspace .workspace-filter {
  padding: 0 12px 8px;
}

.personnel-workspace .workspace-list-item {
  min-height: 48px;
  padding: 7px 12px;
}

.personnel-workspace .workspace-detail {
  padding: 12px;
}

.personnel-workspace .workspace-detail-actions {
  min-height: 30px;
  margin-bottom: 8px;
}

.personnel-workspace .record-hero {
  padding: 10px 12px;
}

.personnel-workspace .record-detail-grid {
  margin-top: 10px;
}

.personnel-workspace .record-detail-grid div {
  min-height: 54px;
  padding: 9px 10px;
}

.personnel-workspace .staff-check-pill-list {
  gap: 8px;
  padding: 10px;
}

.personnel-workspace .staff-check-pill {
  min-height: 58px;
  padding: 8px;
  gap: 8px;
}

.personnel-workspace .staff-check-pill .payroll-card-actions {
  margin-top: 0;
}

input[type="date"] {
  cursor: pointer;
}

.revenue-hero-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.revenue-hero-card {
  min-height: 104px;
  padding: 15px 17px;
  border-radius: 8px;
  color: #ffffff;
  overflow: hidden;
  position: relative;
  transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

.revenue-hero-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0));
  pointer-events: none;
}

.revenue-hero-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(23, 32, 38, 0.12);
  filter: brightness(1.03);
}

.revenue-hero-card.blue {
  background: linear-gradient(135deg, #5bb9d0, #74c7d8);
}

.revenue-hero-card.pink {
  background: linear-gradient(135deg, #cf2d91, #ea4aa2);
}

.revenue-hero-card.teal {
  background: linear-gradient(135deg, #5ab8aa, #89d2bd);
}

.revenue-hero-card.gold {
  background: linear-gradient(135deg, #e5b91f, #f1cc36);
}

.revenue-hero-card span,
.revenue-hero-card strong,
.revenue-hero-card p {
  position: relative;
  z-index: 1;
}

.revenue-hero-card span {
  display: block;
  text-transform: uppercase;
  font-size: 0.68rem;
  opacity: 0.9;
}

.revenue-hero-card strong {
  display: block;
  margin-top: 10px;
  font-size: 1.9rem;
  line-height: 1;
  color: #ffffff;
  font-weight: 500;
}

.revenue-hero-card p {
  margin: 8px 0 0;
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.78rem;
}

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

.revenue-pill-list.single {
  grid-template-columns: 1fr;
}

.revenue-pill-list.client-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.revenue-pill-card {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) minmax(250px, 1.2fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: inset 3px 0 0 #4aa889;
}

.revenue-pill-card.safe {
  background: #f4fbf6;
}

.revenue-pill-card.urgent {
  background: #fff7f7;
  box-shadow: inset 3px 0 0 var(--danger);
}

.revenue-pill-card.cpt {
  grid-template-columns: 58px minmax(0, 1fr) minmax(260px, 1fr);
}

.revenue-pill-avatar {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: #edf4f4;
  color: #31565d;
  font-size: 0.75rem;
  font-weight: 500;
}

.revenue-pill-avatar.code {
  width: 54px;
}

.revenue-pill-main,
.revenue-pill-metrics,
.revenue-pill-detail {
  min-width: 0;
}

.revenue-pill-main strong,
.revenue-pill-main span,
.revenue-pill-metrics span,
.revenue-pill-detail span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.revenue-pill-main strong {
  color: var(--ink);
  font-size: 0.9rem;
}

.revenue-pill-main span,
.revenue-pill-detail span {
  color: var(--muted);
  font-size: 0.75rem;
}

.revenue-pill-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 10px;
}

.revenue-pill-metrics span {
  color: var(--muted);
  font-size: 0.72rem;
}

.revenue-pill-metrics strong {
  color: var(--ink);
  font-size: 0.84rem;
  font-weight: 500;
}

.revenue-pill-detail {
  display: grid;
  gap: 2px;
}

.revenue-pill-list.client-grid .revenue-pill-card {
  grid-template-columns: 38px minmax(0, 1fr);
  align-content: start;
}

.revenue-pill-list.client-grid .revenue-pill-metrics,
.revenue-pill-list.client-grid .revenue-pill-detail,
.revenue-pill-list.client-grid .revenue-pill-card .payroll-card-actions {
  grid-column: 2 / -1;
}

.revenue-controls {
  display: grid;
  grid-template-columns: minmax(220px, 1.4fr) repeat(3, minmax(160px, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.revenue-controls input,
.revenue-controls select {
  min-height: 36px;
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  font: inherit;
}

.revenue-trend-chart {
  height: 184px;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  align-items: end;
  gap: 12px;
  margin-top: 14px;
  padding: 18px 14px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, transparent 0 32%, rgba(223, 231, 235, 0.7) 33% 34%, transparent 35% 66%, rgba(223, 231, 235, 0.7) 67% 68%, transparent 69%),
    #ffffff;
}

.revenue-trend-column {
  height: 100%;
  min-width: 0;
  display: grid;
  grid-template-rows: 1fr auto auto;
  align-items: end;
  gap: 5px;
  text-align: center;
}

.revenue-trend-bar {
  width: 100%;
  max-width: 42px;
  justify-self: center;
  border-radius: 8px 8px 4px 4px;
  background: #2f80ed;
}

.revenue-trend-bar.tone-0 {
  background: #2f80ed;
}

.revenue-trend-bar.tone-1 {
  background: #27ae60;
}

.revenue-trend-bar.tone-2 {
  background: #f2c94c;
}

.revenue-trend-bar.tone-3 {
  background: #eb5757;
}

.revenue-trend-column span,
.revenue-trend-column strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.revenue-trend-column span {
  color: var(--muted);
  font-size: 0.72rem;
}

.revenue-trend-column strong {
  color: #26343a;
  font-size: 0.72rem;
  font-weight: 500;
}

.inline-select {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 10px;
  background: #ffffff;
  color: var(--ink);
  font: inherit;
}

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

.remit-summary-card {
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfc;
}

.remit-summary-card.active {
  background: #f2fbf5;
  box-shadow: inset 3px 0 0 var(--safe);
}

.remit-summary-card span,
.remit-summary-card strong {
  display: block;
}

.remit-summary-card span {
  color: var(--muted);
  font-size: 0.75rem;
}

.remit-summary-card strong {
  margin-top: 4px;
  color: var(--ink);
  font-size: 1rem;
  font-weight: 500;
}

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

.remit-pill-card {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: inset 3px 0 0 var(--safe);
}

.remit-pill-date {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: #edf4f4;
  color: #31565d;
  font-size: 0.74rem;
}

.remit-pill-main,
.remit-pill-amount,
.remit-pill-note {
  min-width: 0;
}

.remit-pill-main strong,
.remit-pill-main span,
.remit-pill-amount span,
.remit-pill-amount strong,
.remit-pill-note span,
.remit-pill-note small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.remit-pill-main strong {
  color: var(--ink);
  font-size: 0.86rem;
}

.remit-pill-main span,
.remit-pill-amount span,
.remit-pill-note span,
.remit-pill-note small {
  color: var(--muted);
  font-size: 0.72rem;
}

.remit-pill-amount strong {
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 500;
}

.remit-pill-note {
  grid-column: 2 / -1;
}

.remit-pill-card .table-action {
  justify-self: end;
}

.diagnosis-record {
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 64px 16px 18px;
}

.soft-pill {
  display: inline-flex;
  margin-left: 8px;
  padding: 3px 8px;
  border-radius: 8px;
  background: #eaf7f7;
  color: var(--brand-dark);
  font-size: 0.76rem;
  font-style: normal;
}

.empty-line {
  margin: 22px 0;
  text-align: center;
  color: var(--muted);
}

.mini-stat {
  padding: 11px;
  border-radius: 8px;
}

.alert-item,
.activity-item {
  padding: 10px;
}

.workspace-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 0;
  min-height: calc(100vh - 188px);
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #ffffff;
}

.workspace-panel {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  min-height: 0;
  border-right: 1px solid var(--line);
  background: #fbfcfc;
}

.workspace-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 16px 14px 10px;
}

.workspace-panel-head h2 {
  margin: 0;
  font-size: 1.04rem;
}

.workspace-panel-head p {
  margin: 3px 0 0;
  font-size: 0.82rem;
}

.workspace-filter {
  padding: 0 14px 12px;
}

.workspace-filter input {
  width: 100%;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  background: #ffffff;
}

.workspace-list {
  min-height: 0;
  overflow-y: auto;
}

.workspace-list-item {
  width: 100%;
  min-height: 56px;
  border: 0;
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px 14px;
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.workspace-list-item:hover,
.workspace-list-item.active {
  background: #eaf7f7;
}

.workspace-avatar {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: #e5e8ea;
  color: #445157;
  font-size: 0.72rem;
  font-weight: 760;
}

.workspace-avatar.has-icon {
  background: #eef7f8;
  color: #367487;
}

.workspace-avatar.has-icon svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.workspace-list-item:hover .workspace-avatar.has-icon,
.workspace-list-item.active .workspace-avatar.has-icon {
  background: #d9f2f5;
  color: #207f91;
}

.workspace-list-item strong,
.workspace-list-item small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace-list-item small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 500;
}

.workspace-list-item em {
  border-radius: 8px;
  padding: 3px 6px;
  background: #eef2f3;
  color: #536168;
  font-size: 0.7rem;
  font-style: normal;
  font-weight: 720;
}

.workspace-detail {
  min-width: 0;
  padding: 18px;
  overflow: auto;
}

.workspace-detail .table-wrap {
  overflow-x: visible;
}

.workspace-detail table {
  min-width: 0;
  table-layout: auto;
}

.workspace-detail th,
.workspace-detail td {
  white-space: normal;
}

.workspace-detail-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
  min-height: 34px;
  margin-bottom: 12px;
}

.record-hero {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfc;
}

.record-hero h2 {
  margin: 0;
  font-size: 1.28rem;
}

.record-hero p {
  margin: 4px 0 0;
}

.record-detail-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 1px;
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--line);
}

.record-detail-grid div {
  min-height: 72px;
  padding: 12px;
  background: #ffffff;
}

.record-detail-grid .detail-card {
  border: 1px solid transparent;
  transition: background 0.16s ease, border-color 0.16s ease, transform 0.16s ease;
}

.record-detail-grid .detail-card:hover {
  transform: translateY(-1px);
}

.record-detail-grid .detail-card.safe {
  background: #f2fbf5;
}

.record-detail-grid .detail-card.safe:hover {
  border-color: #bbf7d0;
  background: #dcfce7;
}

.record-detail-grid .detail-card.attention {
  background: #fff9e8;
}

.record-detail-grid .detail-card.attention:hover {
  border-color: #fde68a;
  background: #fef3c7;
}

.record-detail-grid .detail-card.danger {
  background: #fff1f1;
}

.record-detail-grid .detail-card.danger:hover {
  border-color: #fecaca;
  background: #ffe4e1;
}

.record-detail-grid .detail-card.neutral {
  background: #f4f8fb;
}

.record-detail-grid .detail-card.neutral:hover {
  border-color: #bfdbfe;
  background: #eaf3ff;
}

.record-detail-grid span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
}

.record-detail-grid strong {
  display: block;
  margin-top: 5px;
  color: var(--ink);
  font-size: 0.95rem;
}

@media (max-width: 1040px) {
  .sidebar {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .topbar {
    top: 91px;
    grid-template-columns: 1fr;
  }

  .client-record {
    grid-template-columns: 1fr;
  }

  .profile-side-panel {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

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

  .profile-record-row {
    grid-template-columns: 34px repeat(2, minmax(0, 1fr));
  }

  .profile-record-row .wide {
    grid-column: span 2;
  }

  .profile-section-nav {
    display: flex;
    overflow-x: auto;
  }

  .profile-section-nav button {
    flex: 0 0 auto;
    border-left: 0;
    border-bottom: 2px solid transparent;
  }

  .workspace-shell {
    grid-template-columns: 240px minmax(0, 1fr);
  }

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

@media (max-width: 680px) {
  .content,
  .topbar {
    padding: 12px;
  }

  .record-topbar,
  .tabs,
  .client-record {
    margin-left: -12px;
    margin-right: -12px;
  }

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

  .tabs {
    padding: 0 12px;
    overflow-x: auto;
    flex-wrap: nowrap;
  }

  .profile-workspace {
    padding: 14px;
  }

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

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

  .profile-record-row,
  .diagnosis-record {
    grid-template-columns: 1fr;
    display: grid;
  }

  .profile-record-row .wide {
    grid-column: auto;
  }

  .profile-contact-card,
  .diagnosis-record {
    padding-right: 16px;
  }

  .workspace-shell {
    grid-template-columns: 1fr;
  }

  .workspace-panel {
    max-height: 340px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .workspace-detail-actions {
    justify-content: stretch;
  }

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

/* Left icon rail navigation */
.app-shell {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 100vh;
  min-height: 0;
  padding: 10px 8px;
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 6px;
  align-items: stretch;
  background: #ffffff;
  border-right: 1px solid var(--line);
  border-bottom: 0;
  overflow: visible;
}

.sidebar .brand-mark {
  justify-content: center;
  padding: 0;
  gap: 0;
}

.sidebar .brand-mark span:last-child {
  display: none;
}

.sidebar .brand-mark__icon {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: linear-gradient(135deg, #dff7fb, #ffffff);
  color: #1d7f91;
  box-shadow: 0 10px 20px rgba(37, 99, 235, 0.08);
}

.sidebar .brand-mark__icon.has-logo {
  background: #ffffff;
  padding: 3px;
}

.nav {
  display: block;
  min-height: 0;
  padding: 0;
  overflow-x: visible;
  overflow-y: hidden;
  scrollbar-width: none;
}

.nav::-webkit-scrollbar {
  width: 0;
}

.nav-group {
  display: grid;
  gap: 3px;
  padding: 5px 0;
  border-top: 1px solid #eef2f3;
}

.nav-group:first-child {
  border-top: 0;
  padding-top: 0;
}

.nav-group-label {
  display: block;
  width: 100%;
  height: 1px;
  overflow: hidden;
  color: transparent;
}

.nav button {
  position: relative;
  width: 58px;
  min-height: 44px;
  padding: 0;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #367487;
  white-space: normal;
}

.nav button.active,
.nav button:hover {
  background: transparent;
  color: #ffffff;
}

.nav-icon {
  width: 38px;
  height: 38px;
  padding: 8px;
  border: 1px solid transparent;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: #f6fbfb;
  color: currentColor;
  box-shadow: 0 6px 16px rgba(23, 32, 38, 0.04);
  transition: transform 150ms ease, background 150ms ease, box-shadow 150ms ease, color 150ms ease;
}

.nav-icon svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav button.active .nav-icon,
.nav button:hover .nav-icon {
  border-color: transparent;
  background: linear-gradient(135deg, #39b6cf, #2f9fbd);
  color: #ffffff;
  box-shadow: 0 10px 22px rgba(47, 159, 189, 0.24);
  transform: translateY(-1px);
}

.nav-label {
  position: absolute;
  left: 68px;
  top: 50%;
  z-index: 30;
  max-width: 210px;
  padding: 8px 10px;
  border-radius: 8px;
  background: #1f282c;
  color: #ffffff;
  box-shadow: 0 8px 18px rgba(31, 40, 44, 0.16);
  font-size: 0.88rem;
  font-weight: 500;
  opacity: 0;
  pointer-events: none;
  transform: translate(-4px, -50%);
  transition: opacity 140ms ease, transform 140ms ease;
  white-space: nowrap;
}

.nav button:hover .nav-label,
.nav button:focus-visible .nav-label {
  opacity: 1;
  transform: translate(0, -50%);
}

.sidebar-footer {
  display: grid;
  place-items: center;
}

.rail-avatar {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 8px;
  background: #e5e8ea;
  color: #354248;
  font-weight: 680;
}

.main {
  min-width: 0;
}

.topbar {
  top: 0;
  z-index: 12;
}

@media (max-width: 1040px) {
  .app-shell {
    grid-template-columns: 88px minmax(0, 1fr);
  }

  .sidebar {
    height: 100vh;
    border-right: 1px solid var(--line);
    border-bottom: 0;
  }

  .nav {
    display: block;
    overflow-y: auto;
  }

  .topbar {
    top: 0;
    grid-template-columns: 1fr;
  }

  .drawer {
    width: min(760px, calc(100vw - 88px));
  }

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

@media (max-width: 680px) {
  .app-shell {
    grid-template-columns: 78px minmax(0, 1fr);
  }

  .sidebar {
    padding: 10px 6px;
  }

  .sidebar .brand-mark span:last-child {
    display: none;
  }

  .nav button {
    width: 58px;
    min-height: 58px;
  }

  .nav-icon {
    width: 48px;
    height: 48px;
    padding: 11px;
  }

  .nav-icon svg {
    width: 24px;
    height: 24px;
  }

  .nav-label {
    left: 66px;
  }

  .drawer {
    width: calc(100vw - 24px);
  }

  .drawer__header,
  .drawer__body {
    padding: 16px;
  }
}

/* Softer typography trial: keep current sizes, reduce heavy weights. */
body {
  font-weight: 400;
}

h1,
h2,
h3,
h4,
strong,
b,
.brand-mark,
.brand-mark__icon,
.field,
.kpi-card strong,
.mini-stat strong,
.record-detail-grid strong,
.detail-list strong,
.workspace-list-item strong,
.record-hero h2,
.profile-side-panel h3,
.profile-info-item strong,
.profile-record-row strong,
.diagnosis-record strong,
.alert-item strong,
.activity-item strong {
  font-weight: 500;
}

.button,
.icon-button,
.topbar-add-button,
.owner-profile-pill strong,
th,
.status,
.table-action,
.task-action-label,
.nav button,
.nav-group-label,
.trend,
.kpi-card p,
.workspace-list-item em,
.meta-line,
.soft-pill {
  font-weight: 400;
}

.dashboard-hero {
  padding: 22px;
  border: 1px solid rgba(37, 99, 235, 0.18);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(37, 99, 235, 0.08), rgba(20, 184, 166, 0.07)),
    #ffffff;
  box-shadow: 0 14px 36px rgba(23, 32, 38, 0.06);
}

.dashboard-hero h2 {
  margin: 0 0 6px;
}

.dashboard-hero p {
  margin: 0;
  color: #44545c;
}

.dashboard-kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.dashboard-kpi-card {
  position: relative;
  overflow: hidden;
  min-height: 142px;
  padding: 16px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: #f4fbf7;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease, background 160ms ease;
}

.dashboard-kpi-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 34px rgba(23, 32, 38, 0.1);
}

.dashboard-kpi-card.safe {
  background: #f2fbf5;
}

.dashboard-kpi-card.safe:hover {
  border-color: #bbf7d0;
  background: #dcfce7;
}

.dashboard-kpi-card.attention {
  background: #fff9e8;
}

.dashboard-kpi-card.attention:hover {
  border-color: #fde68a;
  background: #fef3c7;
}

.dashboard-kpi-card.danger {
  background: #fff1f1;
}

.dashboard-kpi-card.danger:hover {
  border-color: #fecaca;
  background: #ffe4e1;
}

.dashboard-kpi-card.neutral {
  background: #f4f8fb;
}

.dashboard-kpi-card.neutral:hover {
  border-color: #bfdbfe;
  background: #eaf3ff;
}

.kpi-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: #172026;
  font-size: 0.98rem;
}

.kpi-arrow {
  width: 38px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid #d7e0e5;
  border-radius: 8px;
  background: #ffffff;
  color: #172026;
  font-size: 1.5rem;
  line-height: 1;
  transition: transform 160ms ease, border-color 160ms ease;
}

.dashboard-kpi-card:hover .kpi-arrow {
  transform: translateX(2px);
  border-color: rgba(23, 32, 38, 0.18);
}

.dashboard-kpi-card strong {
  display: block;
  margin-top: 10px;
  font-size: 1.42rem;
  line-height: 1;
}

.dashboard-kpi-card p {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 12px 0 0;
  padding: 4px 9px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.66);
  color: #315c48;
  font-size: 0.86rem;
}

.dashboard-kpi-card.attention p {
  color: #8a4f16;
}

.dashboard-kpi-card.danger p {
  color: #9f1d1d;
}

.kpi-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #2f855a;
}

.dashboard-kpi-card.attention .kpi-dot {
  background: #b45309;
}

.dashboard-kpi-card.danger .kpi-dot {
  background: #b91c1c;
}

.dashboard-kpi-card.neutral .kpi-dot {
  background: #2563eb;
}

.kpi-card-fade {
  display: none;
}

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

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

.dashboard-chart-card,
.dashboard-panel {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 10px 26px rgba(0, 123, 255, 0.06);
}

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

.chart-card-head h3,
.dashboard-panel h3 {
  margin: 0;
}

.section-title-row.compact {
  margin-bottom: 14px;
}

.section-title-row.compact .button {
  min-height: 34px;
  padding: 7px 10px;
}

.focus-card-list {
  display: grid;
  gap: 10px;
}

.focus-card {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(145deg, #ffffff, #f8fbfb);
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.focus-card:hover {
  transform: translateY(-2px);
  border-color: rgba(111, 66, 193, 0.28);
  box-shadow: 0 12px 24px rgba(111, 66, 193, 0.1);
}

.focus-card > div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.focus-card > div > span {
  color: #53646c;
  font-size: 0.84rem;
}

.focus-card strong {
  font-size: 1rem;
}

.focus-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
}

.focus-card .table-action {
  justify-self: start;
}

.chart-card-head span {
  color: var(--muted);
  font-size: 0.82rem;
}

.dashboard-bars {
  display: grid;
  gap: 12px;
}

.dashboard-bar-row {
  display: grid;
  gap: 7px;
}

.dashboard-bar-row div:first-child {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.84rem;
  color: #53646c;
}

.dashboard-bar-track {
  height: 10px;
  overflow: hidden;
  border-radius: 8px;
  background: #edf3f5;
}

.dashboard-bar-track i {
  display: block;
  height: 100%;
  border-radius: 8px;
  transition: width 180ms ease;
}

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

.status-chip-card {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 58px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfc;
}

.status-chip-card > span {
  width: 10px;
  height: 38px;
  border-radius: 8px;
}

.status-chip-card strong {
  display: block;
  font-size: 1.2rem;
}

.status-chip-card small {
  color: var(--muted);
}

.dashboard-sparkline {
  height: 130px;
  display: flex;
  align-items: end;
  gap: 12px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, transparent 0 32%, rgba(223, 231, 235, 0.75) 33% 34%, transparent 35% 66%, rgba(223, 231, 235, 0.75) 67% 68%, transparent 69%),
    #fbfdfc;
}

.dashboard-sparkline i {
  flex: 1;
  min-width: 18px;
  border-radius: 8px 8px 4px 4px;
  background: linear-gradient(180deg, #2563EB, #14B8A6);
}

.dashboard-snapshot-note {
  display: grid;
  gap: 2px;
  margin-top: 14px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #f6faf9;
  border: 1px solid #e8edf0;
}

.dashboard-snapshot-note strong {
  color: #172026;
  font-size: 0.86rem;
}

.dashboard-snapshot-note span {
  color: var(--muted);
  font-size: 0.84rem;
}

.dashboard-mini-columns {
  height: 170px;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  align-items: end;
  gap: 12px;
  margin-top: 12px;
  padding: 16px 14px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, transparent 0 31%, rgba(223, 231, 235, 0.75) 32% 33%, transparent 34% 65%, rgba(223, 231, 235, 0.75) 66% 67%, transparent 68%),
    #ffffff;
}

.mini-column {
  height: 100%;
  min-width: 0;
  display: grid;
  grid-template-rows: 1fr auto auto;
  gap: 5px;
  align-items: end;
  text-align: center;
}

.mini-column-bar {
  width: 100%;
  max-width: 38px;
  justify-self: center;
  border-radius: 8px 8px 4px 4px;
  background: linear-gradient(180deg, #2563EB, #14B8A6);
}

.mini-column span {
  color: #63717a;
  font-size: 0.72rem;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mini-column strong {
  color: #26343a;
  font-size: 0.72rem;
}

.dashboard-donut-wrap {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  margin-top: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.dashboard-donut {
  width: 176px;
  aspect-ratio: 1;
  border-radius: 50%;
  display: grid;
  place-items: center;
  box-shadow: inset 0 0 0 1px rgba(223, 231, 235, 0.9);
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.dashboard-donut:hover {
  transform: scale(1.025);
  box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.22), 0 12px 24px rgba(37, 99, 235, 0.1);
}

.dashboard-donut > div {
  width: 104px;
  aspect-ratio: 1;
  border-radius: 50%;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 2px;
  background: #ffffff;
  text-align: center;
}

.dashboard-donut span {
  color: var(--muted);
  font-size: 0.72rem;
}

.dashboard-donut strong {
  color: #172026;
  font-size: 1rem;
}

.dashboard-donut-legend {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.donut-legend-item {
  width: 100%;
  min-height: 34px;
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: center;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 6px 8px;
  background: #f8fbfb;
  color: #26343a;
  text-align: left;
}

.donut-legend-item:hover {
  border-color: rgba(37, 99, 235, 0.22);
  background: #f2f7ff;
}

.donut-legend-item i {
  width: 10px;
  height: 22px;
  border-radius: 8px;
}

.donut-legend-item span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #26343a;
}

.donut-legend-item strong,
.donut-legend-item em {
  color: var(--muted);
  font-size: 0.78rem;
  font-style: normal;
  white-space: nowrap;
}

.logo-upload-preview {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfc;
}

.logo-upload-preview span {
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #ffffff;
  color: var(--brand-dark);
  font-size: 1.4rem;
  border: 1px solid var(--line);
  overflow: hidden;
}

.logo-upload-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.logo-upload-preview strong,
.logo-upload-preview p {
  margin: 0;
}

@media (max-width: 1280px) {
  .dashboard-kpi-grid,
  .dashboard-chart-grid,
  .revenue-hero-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .revenue-pill-list {
    grid-template-columns: 1fr;
  }

  .revenue-pill-list.client-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .remit-pill-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1281px) {
  .drawer:has(.client-form-grid) {
    width: min(1120px, calc(100vw - 96px));
  }

  .drawer .client-form-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .dashboard-kpi-grid,
  .dashboard-chart-grid,
  .dashboard-focus-grid,
  .revenue-hero-grid,
  .status-chip-grid {
    grid-template-columns: 1fr;
  }

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

  .dashboard-donut {
    justify-self: center;
  }

  .payroll-box-list {
    grid-template-columns: 1fr;
  }

  .payroll-entry-card {
    grid-template-columns: minmax(0, 1fr) auto auto;
  }

  .payroll-card-actions {
    grid-column: auto;
  }

  .personnel-pill-list {
    grid-template-columns: 1fr;
  }

  .personnel-pill-card {
    grid-template-columns: 34px minmax(0, 1fr) auto;
  }

  .personnel-pill-meta,
  .personnel-pill-card .payroll-card-actions {
    grid-column: 2 / -1;
  }

  .settings-pill-list {
    grid-template-columns: 1fr;
  }

  .settings-pill-card {
    grid-template-columns: 42px minmax(0, 1fr) auto;
  }

  .settings-pill-card .payroll-card-actions {
    grid-column: 2 / -1;
  }

  .readiness-blocker-list {
    grid-template-columns: 1fr;
  }

  .readiness-blocker-card {
    grid-template-columns: 34px minmax(0, 1fr) auto;
  }

  .readiness-blocker-card .payroll-card-actions {
    grid-column: 2 / -1;
  }

  .coverage-gap-list {
    grid-template-columns: 1fr;
  }

  .coverage-gap-card {
    grid-template-columns: 58px minmax(0, 1fr) auto;
  }

  .coverage-gap-card .payroll-card-actions {
    grid-column: 2 / -1;
  }

  .care-team-pill-list {
    grid-template-columns: 1fr;
  }

  .care-team-pill {
    grid-template-columns: 38px minmax(0, 1fr);
  }

  .care-team-pill-meta {
    grid-column: 2 / -1;
    text-align: left;
  }

  .staff-check-pill-list {
    grid-template-columns: 1fr;
  }

  .staff-check-pill {
    grid-template-columns: 34px minmax(0, 1fr) auto;
  }

  .revenue-pill-card,
  .revenue-pill-card.cpt {
    grid-template-columns: 38px minmax(0, 1fr);
  }

  .revenue-pill-metrics,
  .revenue-pill-detail,
  .revenue-pill-card .payroll-card-actions {
    grid-column: 2 / -1;
  }

  .revenue-pill-list.client-grid {
    grid-template-columns: 1fr;
  }

  .revenue-controls,
  .revenue-trend-chart,
  .remit-pill-list,
  .remit-summary-grid {
    grid-template-columns: 1fr;
  }

  .remit-pill-card {
    grid-template-columns: 74px minmax(0, 1fr) auto;
  }

  .revenue-trend-chart {
    height: auto;
  }

  .revenue-trend-column {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: auto auto;
    text-align: left;
  }

  .revenue-trend-bar {
    grid-column: 1 / -1;
    height: 22px !important;
    max-width: none;
  }

  .priority-alert-grid {
    grid-template-columns: 1fr;
  }

  .qa-check-grid,
  .qa-guidance {
    grid-template-columns: 1fr;
  }
}
