:root {
  --ink: #1E2D34;
  --ink-soft: #3C4C52;
  --muted: #58676D;
  --line: #E8E1D4;
  --line-2: #EFE9DE;
  --panel: #FFFEFB;
  --wash: #F2EEE5;
  --navy: #1E2D34;
  --teal: #0B765B;
  --teal-deep: #0B6E55;
  --teal-soft: #E4F0EA;
  --amber: #B07E2E;
  --amber-soft: #F6ECD7;
  --red: #B0492E;
  --red-soft: #F6E3DC;
  --blue: #3F6E8C;
  --shadow: 0 14px 34px rgba(60, 45, 25, 0.07), 0 2px 6px rgba(60, 45, 25, 0.04);
  --serif: "Newsreader", Georgia, serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

.role-hidden { display: none !important; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: #FAF8F3;
  font-family: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

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

.is-hidden { display: none !important; }

.admin-login-shell {
  width: min(1200px, calc(100vw - 48px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 28px 0 56px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(380px, 0.58fr);
  gap: 24px;
  align-items: center;
}

.admin-login-intro,
.admin-login-panel {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
}

.admin-login-intro {
  min-height: 560px;
  padding: 42px;
}

.admin-login-intro .brand {
  margin-bottom: 46px;
  color: var(--ink);
}

.admin-login-intro .brand-mark {
  background: var(--navy);
  color: #fff;
}

.admin-login-intro .brand small {
  color: var(--muted);
}

.admin-login-intro h1 {
  margin: 10px 0 12px;
  max-width: 760px;
  font-size: clamp(34px, 5vw, 58px);
  line-height: 1;
}

.admin-login-intro > p:not(.eyebrow) {
  max-width: 720px;
  color: var(--muted);
  font-weight: 500;
  line-height: 1.5;
}

.admin-access-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 52px;
}

.admin-access-list div {
  min-height: 120px;
  padding: 16px;
  border-radius: 12px;
  background: var(--wash);
}

.admin-access-list span {
  display: grid;
  width: 28px;
  height: 28px;
  margin-bottom: 14px;
  place-items: center;
  border-radius: 50%;
  background: var(--teal-soft);
  color: #0d765f;
  font-weight: 600;
}

.admin-access-list strong,
.admin-access-list small {
  display: block;
}

.admin-access-list small {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.admin-login-panel {
  display: grid;
  gap: 16px;
  padding: 24px;
}

.admin-login-panel h2 {
  margin: 4px 0 0;
}

.admin-login-form {
  display: grid;
  gap: 14px;
}

.admin-login-form label {
  display: grid;
  gap: 7px;
}

.admin-login-form label > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
}

.admin-login-form input,
.admin-login-form select {
  min-height: 48px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0 14px;
  color: var(--ink);
  font-weight: 500;
  background: #fff;
}

.admin-login-form input:focus,
.admin-login-form select:focus {
  outline: 3px solid rgba(24, 185, 145, 0.18);
  border-color: var(--teal);
}

.admin-password-field {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0 7px 0 0;
  background: #fff;
}

.admin-password-field:focus-within {
  outline: 3px solid rgba(24, 185, 145, 0.18);
  border-color: var(--teal);
}

.admin-password-field input {
  border: 0;
  min-height: 46px;
}

.admin-password-field input:focus {
  outline: 0;
}

.admin-password-field button {
  min-height: 32px;
  border: 0;
  border-radius: 12px;
  padding: 0 10px;
  background: var(--wash);
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
}

.admin-login-status {
  min-height: 22px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}

.admin-login-status.success { color: #087c61; }
.admin-login-status.error { color: var(--red); }
.admin-login-status.critical {
  border: 1px solid #7A2E1D;
  border-radius: 10px;
  padding: 10px 12px;
  background: var(--red-soft);
  color: #7A2E1D;
  font-weight: 800;
}

.admin-mfa-heading h2,
.admin-mfa-heading h3 {
  margin: 4px 0 6px;
  font-size: 22px;
}

.admin-mfa-heading > p:last-child {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.admin-mfa-message {
  min-height: 18px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.admin-security-summary {
  display: grid;
  gap: 5px;
  padding: 14px;
  border: 1px solid rgba(24, 185, 145, 0.32);
  border-radius: 12px;
  background: var(--wash);
}

.admin-security-summary strong {
  color: var(--ink);
  font-size: 14px;
}

.admin-security-summary small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.admin-mfa-enrollment {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--wash);
}

.admin-mfa-enrollment[hidden] { display: none; }

.admin-mfa-enrollment img {
  width: min(100%, 190px);
  aspect-ratio: 1;
  object-fit: contain;
  border-radius: 8px;
  background: #fff;
}

.admin-mfa-enrollment > p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.admin-mfa-enrollment > .admin-mfa-sensitive-note {
  font-size: 12px;
  font-weight: 600;
}

.admin-mfa-manual {
  width: 100%;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.admin-mfa-manual summary {
  cursor: pointer;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 600;
  text-align: center;
}

.admin-mfa-manual > div {
  margin-top: 12px;
  padding: 12px;
  border-radius: 9px;
  background: var(--panel);
}

.admin-mfa-manual strong,
.admin-mfa-manual code {
  display: block;
}

.admin-mfa-manual strong {
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 12px;
}

.admin-mfa-manual code {
  overflow-wrap: anywhere;
  user-select: all;
  color: var(--ink);
  font-size: 12px;
}

.captcha-shell {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.captcha-shell > div { min-height: 65px; }

.captcha-shell p {
  min-height: 18px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.captcha-shell p.error { color: var(--red); }

.admin-mfa-restart {
  min-height: 40px;
  border: 0;
  background: transparent;
  color: var(--ink-soft);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.admin-session-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 6px 0 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.09);
  color: rgba(255, 255, 255, 0.82);
  font-size: 12px;
  font-weight: 600;
}

.admin-session-chip button {
  min-height: 30px;
  border: 0;
  border-radius: 7px;
  padding: 0 10px;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
}

.app-shell {
  min-height: 100vh;
  background:
    radial-gradient(circle at 15% 10%, rgba(24, 185, 145, 0.10), transparent 28rem),
    radial-gradient(circle at 95% 0%, rgba(79, 121, 168, 0.10), transparent 24rem);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: 260px 1fr auto;
  align-items: center;
  gap: 28px;
  padding: 14px 28px;
  background: var(--navy);
  color: white;
  box-shadow: 0 1px 0 rgba(255,255,255,0.08);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: white;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid rgba(255,255,255,0.22);
  border-radius: 10px;
  background: rgba(255,255,255,0.09);
  font-weight: 500;
}

.brand strong, .brand small { display: block; }
.brand small { color: rgba(255,255,255,0.62); font-size: 12px; margin-top: 2px; }

.top-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.top-nav a {
  color: rgba(255,255,255,0.74);
  text-decoration: none;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.top-nav a:hover,
.top-nav a.active {
  color: white;
  background: rgba(255,255,255,0.11);
}

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

.icon-button,
.primary-action,
.secondary-action {
  border: 0;
  border-radius: 12px;
  min-height: 40px;
  font-weight: 500;
}

.icon-button {
  width: 40px;
  background: rgba(255,255,255,0.09);
  color: white;
}

.primary-action {
  padding: 0 18px;
  background: var(--navy);
  color: white;
  box-shadow: 0 8px 18px rgba(36, 59, 74, 0.18);
}

.topbar .primary-action {
  background: white;
  color: var(--navy);
  box-shadow: none;
}

.topbar .top-secondary {
  background: rgba(255,255,255,0.09);
  color: white;
  border-color: rgba(255,255,255,0.14);
}

.secondary-action {
  padding: 0 18px;
  background: #e7eff3;
  color: var(--ink);
  border: 1px solid var(--line);
}

.workspace {
  width: min(1500px, calc(100% - 48px));
  margin: 0 auto;
  padding: 34px 0 56px;
}

.is-hidden {
  display: none !important;
}

.page-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding: 24px 4px 28px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

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

.page-hero h1 {
  margin-bottom: 8px;
  font-size: clamp(34px, 4vw, 54px);
  line-height: 1;
  letter-spacing: -0.04em;
}

.page-hero p:not(.eyebrow) {
  max-width: 690px;
  color: #566D7A;
  font-size: 17px;
  line-height: 1.6;
}

.hero-actions {
  display: flex;
  gap: 12px;
  margin-bottom: 8px;
}

.command-center {
  display: grid;
  grid-template-columns: minmax(340px, 0.82fr) minmax(0, 1.2fr);
  gap: 14px;
  margin-bottom: 18px;
}

.hero-work-card,
.five-step-panel,
.command-stat-grid article {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255,255,255,0.94);
  box-shadow: 0 1px 0 rgba(32, 59, 74, 0.04);
}

.hero-work-card {
  display: grid;
  align-content: center;
  min-height: 264px;
  padding: 26px;
  border-top: 5px solid var(--navy);
}

.hero-work-card h2 {
  margin-bottom: 10px;
  font-size: 28px;
  line-height: 1.05;
  letter-spacing: 0;
}

.hero-work-card p:not(.eyebrow) {
  color: var(--muted);
  font-weight: 500;
  line-height: 1.45;
}

.five-step-panel {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 18px;
  align-items: center;
  padding: 22px;
}

.five-step-panel h2 {
  margin-bottom: 18px;
  font-size: 24px;
  line-height: 1.05;
  letter-spacing: 0;
}

.step-rail {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.step-rail li {
  min-height: 140px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--wash);
}

.step-rail li.active {
  border-color: rgba(24, 185, 145, 0.45);
  background: var(--teal-soft);
}

.step-rail span {
  display: grid;
  width: 28px;
  height: 28px;
  margin-bottom: 16px;
  place-items: center;
  border-radius: 50%;
  background: white;
  font-weight: 600;
}

.step-rail strong,
.step-rail small {
  display: block;
}

.step-rail strong {
  font-size: 13px;
}

.step-rail small {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.35;
}

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

.command-stat-grid article {
  min-height: 112px;
  padding: 18px;
}

.command-stat-grid strong {
  display: block;
  font-size: 32px;
  line-height: 1;
}

.command-stat-grid span {
  display: block;
  margin-top: 10px;
  font-weight: 600;
}

.command-stat-grid small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-weight: 500;
}

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

.metric-card {
  min-height: 122px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  box-shadow: 0 1px 0 rgba(32, 59, 74, 0.04);
}

.metric-card span,
.metric-card small {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.metric-card strong {
  display: block;
  margin: 10px 0 8px;
  font-size: 36px;
  line-height: 1;
  letter-spacing: -0.05em;
}

.metric-card.success { border-top: 4px solid var(--teal); }
.metric-card.warning { border-top: 4px solid var(--amber); }
.metric-card.danger { border-top: 4px solid var(--red); }

.onboarding-layout {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.status-rail,
.queue-panel,
.workflow-panel,
.clinician-workflow-panel,
.review-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255,255,255,0.92);
  box-shadow: var(--shadow);
}

.status-rail {
  position: sticky;
  top: 82px;
  padding: 12px;
}

.status-filter {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 12px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.status-filter span {
  font-weight: 700;
}

.status-filter strong {
  color: var(--muted);
  font-size: 13px;
}

.status-filter.active,
.status-filter:hover {
  background: #e8eef2;
}

.queue-panel {
  min-width: 0;
  overflow: hidden;
}

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

.search-field {
  display: flex;
  align-items: center;
  gap: 9px;
  width: min(460px, 100%);
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--wash);
}

.search-field input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
}

.filters {
  display: flex;
  gap: 10px;
}

.compact-action {
  min-height: 42px;
  white-space: nowrap;
}

select,
.drawer-filters input {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
  color: var(--ink);
  padding: 0 12px;
  font-weight: 600;
}

.queue-list {
  display: grid;
  gap: 12px;
  padding: 18px;
}

.clinician-card {
  position: relative;
  display: grid;
  grid-template-columns: 82px minmax(280px, 1fr) 410px 40px;
  gap: 16px;
  align-items: center;
  min-height: 118px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
  box-shadow: 0 8px 20px rgba(32, 59, 74, 0.06);
}

.avatar {
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  border-radius: 50%;
  background: #edf3f5;
  color: var(--ink);
  font-weight: 500;
  overflow: hidden;
}

.avatar img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar.has-photo {
  background: #edf3f5;
  color: transparent;
}

.avatar.photo { background: linear-gradient(135deg, #f6d7c9, #bcd8d5); }
.avatar.teal { background: #d8f3ec; color: #087c61; }
.avatar.rose { background: #f6d7dc; color: #8f2431; }
.avatar.blue { background: #dfeafb; color: #315f99; }

.profile-photo-control {
  display: grid;
  justify-items: center;
  gap: 6px;
}

.attach-photo-button {
  display: inline-grid;
  min-height: 28px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--wash);
  color: var(--ink);
  padding: 0 10px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  white-space: nowrap;
}

.attach-photo-button:hover,
.attach-photo-button:focus-within {
  border-color: rgba(24, 185, 145, 0.42);
  background: var(--teal-soft);
}

.attach-photo-button input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.profile-photo-control small {
  min-height: 12px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  line-height: 1;
  text-align: center;
}

.profile-photo-control small.is-success {
  color: #087c61;
}

.profile-photo-control small.is-error {
  color: #a72b2b;
}

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

.clinician-heading h2 {
  margin: 0 0 5px;
  font-size: 17px;
  letter-spacing: -0.02em;
}

.clinician-heading p,
.drawer-header p {
  color: var(--muted);
  line-height: 1.45;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  white-space: nowrap;
  border-radius: 999px;
  padding: 0 11px;
  font-size: 12px;
  font-weight: 500;
}

.pill.green { background: var(--teal-soft); color: #087c61; }
.pill.amber { background: var(--amber-soft); color: #8c5e09; }
.pill.red { background: var(--red-soft); color: #9f2727; }
.pill.slate { background: #edf3f5; color: #556c7a; }

.insurance-expiration-chip {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  min-height: 26px;
  margin: 10px 0 0;
  border: 1px solid #f0d28a;
  border-radius: 999px;
  background: #fff7df;
  color: #7a5208;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 800;
}

.insurance-expiration-chip.urgent {
  border-color: #efb6b6;
  background: var(--red-soft);
  color: #9f2727;
}

.progress-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.progress-bar,
.portal-progress,
.drawer-progress {
  display: block;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e6edf0;
}

.progress-bar { flex: 1; height: 6px; }
.progress-bar span,
.portal-progress span,
.drawer-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--teal);
}
.progress-bar.amber span { background: var(--amber); }
.progress-bar.green span { background: var(--teal); }

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

.card-meta div {
  min-height: 58px;
  padding: 12px;
  border-radius: 12px;
  background: var(--wash);
}

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

.card-meta dd {
  margin: 4px 0 0;
  font-size: 13px;
  font-weight: 500;
}

.menu-button {
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 12px;
  background: var(--wash);
  color: var(--ink);
  font-size: 20px;
}

.menu-button[aria-expanded="true"] {
  background: var(--ink);
  color: white;
}

.card-actions {
  position: relative;
  display: flex;
  justify-content: flex-end;
}

.action-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 20;
  display: none;
  min-width: 172px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
  box-shadow: 0 16px 36px rgba(32, 59, 74, 0.16);
}

.card-actions.open-up .action-menu {
  top: auto;
  bottom: calc(100% + 8px);
}

.card-actions.open .action-menu {
  display: grid;
  gap: 2px;
}

.action-menu button {
  width: 100%;
  min-height: 38px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
  padding: 0 10px;
  text-align: left;
  font-weight: 500;
}

.action-menu button:hover,
.action-menu button:focus-visible {
  background: var(--wash);
  outline: none;
}

.action-menu .danger-action {
  color: #a72b2b;
}

.clinician-card.is-archived {
  opacity: 0.72;
}

.inline-warning {
  display: inline-block;
  margin-top: 10px;
  color: #9b6409;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
}

.split-section {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(340px, 0.65fr);
  gap: 18px;
  margin-top: 18px;
}

.workflow-panel,
.clinician-workflow-panel,
.review-card {
  padding: 26px;
}

.section-title h2 {
  margin-bottom: 18px;
  font-size: 23px;
  letter-spacing: -0.03em;
}

.compact-title h2 {
  margin-bottom: 12px;
  font-size: 18px;
}

.template-grid {
  display: grid;
  gap: 12px;
  margin-bottom: 18px;
}

.workflow-template-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
}

.workflow-template-card.active {
  border-color: rgba(24, 185, 145, 0.42);
  box-shadow: inset 4px 0 0 var(--teal);
}

.workflow-template-card span,
.workflow-select span,
.workflow-progress-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.workflow-template-card h3,
.workflow-template-card p {
  margin: 0;
}

.workflow-template-card h3 {
  margin: 4px 0 5px;
  font-size: 17px;
}

.workflow-template-card p {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.45;
}

.template-editor {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
}

.task-table {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
}

.table-head,
.task-row {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 0.8fr;
  gap: 14px;
  align-items: center;
  padding: 15px 18px;
}

.table-head {
  color: var(--muted);
  background: var(--wash);
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.task-row + .task-row { border-top: 1px solid var(--line); }
.task-row span { color: var(--muted); font-size: 13px; font-weight: 700; }

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

.clinician-workflow-panel {
  padding: 26px;
}

.workflow-select {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

.workflow-select select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
  color: var(--ink);
  padding: 0 12px;
  font-weight: 500;
}

.workflow-progress-card {
  display: grid;
  gap: 12px;
  padding: 16px;
  border-radius: 12px;
  background: var(--wash);
}

.workflow-progress-card strong {
  display: block;
  margin-bottom: 4px;
  font-size: 18px;
}

.clinician-flow {
  display: grid;
  gap: 12px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}

.clinician-flow li {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
}

.clinician-flow > li > span {
  width: 22px;
  height: 22px;
  margin-top: 1px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: white;
}

.clinician-flow li.done > span {
  border-color: #b9e5da;
  background: var(--teal);
}

.clinician-flow li.review > span {
  border-color: #f1d08e;
  background: var(--amber);
}

.clinician-flow strong,
.clinician-flow p {
  margin: 0;
}

.clinician-flow p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.45;
}

.review-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px;
  margin-top: 18px;
}

.review-list {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.review-list li {
  display: grid;
  grid-template-columns: 170px 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 15px;
  border-radius: 12px;
  background: var(--wash);
}

.review-list span,
.review-list em,
.readiness-list span {
  color: var(--muted);
  font-size: 13px;
  font-style: normal;
  font-weight: 700;
}

.review-list strong { font-size: 14px; }

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

.readiness-list div {
  min-height: 88px;
  padding: 18px;
  border-radius: 12px;
  background: var(--wash);
}

.readiness-list strong {
  display: block;
  margin-top: 8px;
  font-size: 24px;
}

.standard-forms-card {
  grid-column: 1 / -1;
}

.document-library-title {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 18px;
}

.document-count {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--wash);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.document-library-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.document-upload-form {
  display: grid;
  grid-template-columns: minmax(170px, 1.2fr) minmax(150px, 0.9fr) minmax(150px, 1fr) 110px auto;
  gap: 12px;
  align-items: end;
  margin-bottom: 10px;
}

.document-upload-form label {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.document-upload-form label span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
}

.document-upload-form input,
.document-upload-form select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
  color: var(--ink);
  padding: 0 12px;
  font-weight: 700;
}

.document-upload-form input[type="file"] {
  padding: 8px 12px;
}

.document-description-field {
  grid-column: span 2;
}

.document-file-field {
  grid-column: span 2;
}

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

.document-modal-form .document-description-field,
.document-modal-form .document-file-field,
.document-modal-form .invite-status,
.document-modal-form .invite-actions {
  grid-column: 1 / -1;
}

.standard-document-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.standard-document-row {
  display: grid;
  grid-template-columns: minmax(220px, 1.4fr) minmax(130px, 0.8fr) minmax(150px, 0.9fr) 82px minmax(190px, auto);
  gap: 14px;
  align-items: center;
  padding: 15px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: var(--wash);
}

.standard-document-row.needs-file {
  transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.standard-document-row.has-file {
  border-color: rgba(24, 185, 145, 0.22);
  background: linear-gradient(90deg, rgba(24, 185, 145, 0.08) 0 5px, var(--wash) 5px);
}

.standard-document-row.needs-file.drag-over {
  border-color: rgba(24, 185, 145, 0.72);
  background: var(--teal-soft);
  box-shadow: 0 0 0 3px rgba(24, 185, 145, 0.14);
}

.standard-document-row h3 {
  margin: 0 0 5px;
  font-size: 15px;
}

.standard-document-row p,
.standard-document-row span,
.standard-document-row em {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-style: normal;
  font-weight: 700;
  line-height: 1.4;
}

.standard-document-row strong {
  font-size: 13px;
}

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

.standard-document-actions a,
.standard-document-actions > button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  border-radius: 12px;
  padding: 0 12px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}

.standard-document-actions a {
  background: white;
  border: 1px solid var(--line);
}

.document-attached-chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border: 1px solid rgba(24, 185, 145, 0.26);
  border-radius: 999px;
  padding: 0 10px;
  background: var(--teal-soft);
  color: #13745e;
  font-size: 12px;
  font-weight: 600;
}

.document-attached-chip::before {
  width: 7px;
  height: 7px;
  margin-right: 7px;
  border-radius: 50%;
  background: var(--teal);
  content: "";
}

.standard-document-actions > button {
  border: 1px solid var(--line);
  background: white;
}

.standard-document-actions > button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.standard-document-menu {
  flex: 0 0 auto;
}

.details-drawer {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: none;
}

.details-drawer.open { display: block; }

.drawer-overlay {
  position: absolute;
  inset: 0;
  background: rgba(17, 34, 44, 0.34);
  backdrop-filter: blur(2px);
}

.drawer-panel {
  position: absolute;
  top: 0;
  right: 0;
  width: min(620px, 100%);
  height: 100%;
  overflow: auto;
  padding: 28px;
  background: white;
  box-shadow: -26px 0 60px rgba(32, 59, 74, 0.18);
}

.drawer-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 12px;
  background: var(--wash);
  color: var(--ink);
  font-size: 26px;
}

.scanner-handoff-panel code {
  overflow-wrap: anywhere;
  color: var(--ink);
}

.scanner-handoff-form {
  margin-top: 22px;
}

.scanner-handoff-form textarea {
  width: 100%;
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
  line-height: 1.5;
}

.scanner-handoff-result {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid rgba(8, 124, 97, 0.25);
  border-radius: 14px;
  background: rgba(8, 124, 97, 0.06);
}

.scanner-handoff-result[hidden] { display: none; }

.scanner-handoff-result p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.confirm-modal {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: none;
}

.confirm-modal.open {
  display: block;
}

.confirm-modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(17, 34, 44, 0.42);
  backdrop-filter: blur(3px);
}

.confirm-modal-panel {
  position: absolute;
  top: 50%;
  left: 50%;
  display: grid;
  width: min(520px, calc(100% - 32px));
  gap: 14px;
  transform: translate(-50%, -50%);
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
  padding: 28px;
  box-shadow: 0 24px 70px rgba(32, 59, 74, 0.24);
}

.confirm-modal-panel h2 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(26px, 4vw, 34px);
  line-height: 1;
}

.confirm-modal-panel p {
  margin: 0;
  color: var(--muted);
  font-weight: 500;
  line-height: 1.5;
}

.confirm-modal-warning {
  border: 1px solid rgba(167, 43, 43, 0.24);
  border-radius: 12px;
  background: #fff7f6;
  color: #8d2626;
  padding: 12px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.45;
}

.confirm-modal-warning:empty {
  display: none;
}

.confirm-modal-actions {
  margin-top: 4px;
}

.danger-confirm-action {
  background: #a72b2b;
}

.danger-confirm-action:hover,
.danger-confirm-action:focus-visible {
  background: #862121;
}

.drawer-header {
  display: flex;
  gap: 16px;
  align-items: center;
  padding-right: 50px;
}

.drawer-header h2 {
  margin: 0 0 4px;
  font-size: 30px;
  letter-spacing: -0.04em;
}

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

.drawer-summary div {
  padding: 15px;
  border-radius: 12px;
  background: var(--wash);
}

.drawer-summary span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.drawer-summary strong { display: block; margin-top: 6px; }
.drawer-progress { margin-bottom: 24px; }

.drawer-filters {
  display: grid;
  grid-template-columns: 1fr 160px;
  gap: 10px;
  margin-bottom: 14px;
}

.drawer-task-list {
  display: grid;
  gap: 10px;
}

.drawer-task-list article,
.drawer-task-link {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.drawer-task-link {
  color: var(--ink);
  text-decoration: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.drawer-task-review-button {
  width: 100%;
  appearance: none;
  background: transparent;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.drawer-task-review-button:disabled {
  cursor: wait;
  opacity: 0.72;
}

.drawer-document-status {
  margin: 10px 2px 0;
}

.drawer-task-link:hover,
.drawer-task-link:focus-visible {
  border-color: rgba(24, 185, 145, 0.5);
  box-shadow: 0 12px 28px rgba(32, 59, 74, 0.1);
  outline: none;
  transform: translateY(-1px);
}

.drawer-task-list h3 {
  margin: 0 0 4px;
  font-size: 15px;
}

.drawer-task-list p,
.drawer-task-list small {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.drawer-task-list small {
  display: block;
  margin-top: 5px;
  font-weight: 500;
}

.drawer-task-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.drawer-open-contract {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--wash);
  color: var(--ink);
  padding: 0 11px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.drawer-review-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  margin-top: 16px;
  padding: 16px;
  border: 1px solid rgba(240, 185, 63, 0.36);
  border-radius: 12px;
  background: #fff9ea;
}

.drawer-review-actions.approved {
  border-color: rgba(24, 185, 145, 0.32);
  background: var(--teal-soft);
}

.drawer-review-actions strong {
  display: block;
  margin-bottom: 4px;
  font-size: 15px;
}

.drawer-review-actions p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.45;
}

.drawer-review-buttons {
  display: flex;
  gap: 10px;
  align-items: center;
}

.drawer-review-actions .primary-action,
.drawer-review-actions .secondary-action {
  min-width: 160px;
  white-space: nowrap;
}

.invite-panel {
  width: min(860px, calc(100% - 48px));
}

#standardDocumentDrawer .drawer-panel,
#contractDrawer .drawer-panel,
#detailsDrawer .drawer-panel,
#inviteDrawer .drawer-panel {
  top: 50%;
  left: 50%;
  right: auto;
  width: min(860px, calc(100% - 48px));
  height: auto;
  max-height: calc(100vh - 72px);
  transform: translate(-50%, -50%);
  border-radius: 12px;
  box-shadow: 0 28px 80px rgba(32, 59, 74, 0.22);
}

.document-modal-panel {
  width: min(780px, calc(100% - 48px));
}

#standardDocumentDrawer .document-modal-panel {
  width: min(780px, calc(100% - 48px));
}

#contractDrawer .drawer-panel {
  width: min(1080px, calc(100% - 48px));
}

#detailsDrawer .drawer-panel {
  width: min(1080px, calc(100% - 48px));
}

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

.invite-form label {
  display: grid;
  gap: 8px;
  color: var(--ink);
  font-weight: 500;
}

.invite-form label span {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.invite-form input,
.invite-form select,
.invite-form textarea {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
  color: var(--ink);
  padding: 0 13px;
  font-weight: 700;
}

.invite-form textarea {
  min-height: 112px;
  padding: 12px 13px;
  line-height: 1.5;
  resize: vertical;
}

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

.invite-checklist {
  display: grid;
  gap: 10px;
  padding: 14px;
  border-radius: 12px;
  background: var(--wash);
}

.invite-checklist label {
  display: flex;
  grid-template-columns: none;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.35;
  text-transform: none;
}

.invite-checklist input[type="checkbox"] {
  flex: 0 0 22px;
  width: 22px;
  min-height: 22px;
  padding: 0;
  accent-color: var(--teal);
}

.contract-template-panel {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto;
  gap: 12px;
  align-items: end;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--wash);
}

.attach-contract-panel {
  align-items: stretch;
  padding: 12px;
  background: #f8fbfc;
}

.contract-file-field {
  display: grid;
  position: relative;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-height: 76px;
  border: 1px dashed #b9cbd5;
  border-radius: 12px;
  background: white;
  padding: 12px;
  text-transform: none;
  transition: border-color 0.18s ease, background 0.18s ease;
}

.contract-file-field:hover,
.contract-file-field:focus-within {
  border-color: rgba(24, 185, 145, 0.72);
  background: #fbfefd;
}

.contract-file-icon {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 12px;
  background: var(--teal-soft);
  color: #13745e;
  font-size: 24px;
  font-weight: 600;
}

.contract-file-copy strong,
.contract-file-copy small {
  display: block;
}

.contract-file-copy strong {
  margin-bottom: 4px;
  font-size: 15px;
  text-transform: none;
}

.contract-file-copy small {
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.35;
  text-transform: none;
}

.contract-file-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  border-radius: 12px;
  padding: 0 13px;
  background: var(--wash);
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  text-transform: none;
}

.contract-file-field input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.contract-template-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
}

.signature-field-card {
  display: grid;
  grid-template-columns: minmax(260px, 0.85fr) minmax(320px, 1.15fr);
  gap: 16px;
  align-items: center;
  padding: 16px;
  border: 1px solid rgba(24, 185, 145, 0.22);
  border-radius: 12px;
  background: linear-gradient(90deg, rgba(24, 185, 145, 0.12), rgba(255, 255, 255, 0.92));
}

.signature-field-card h3,
.signature-field-card p {
  margin: 0;
}

.signature-field-card h3 {
  margin-bottom: 6px;
  font-size: 18px;
}

.signature-field-card p {
  color: #13745e;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.45;
}

.signature-field-card label {
  gap: 7px;
}

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

.signature-marker-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.signature-marker-field input {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

.internal-comp-card {
  display: grid;
  grid-template-columns: minmax(240px, 0.9fr) minmax(280px, 1.1fr);
  gap: 16px;
  align-items: center;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8fbfc;
}

.internal-comp-card h3,
.internal-comp-card p {
  margin: 0;
}

.internal-comp-card h3 {
  margin-bottom: 6px;
  font-size: 18px;
}

.internal-comp-card p {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.45;
}

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

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

.contract-gate div {
  min-height: 112px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--wash);
}

.contract-gate strong,
.contract-gate p {
  display: block;
  margin: 0;
}

.contract-gate strong {
  margin: 9px 0 5px;
}

.contract-gate p {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
}

.gate-step {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 50%;
  background: white;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.gate-step.active {
  background: var(--navy);
  color: white;
}

.gate-step.locked {
  background: var(--amber-soft);
  color: #8c5e09;
}

.email-preview {
  display: grid;
  gap: 10px;
  max-height: 320px;
  overflow: auto;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
}

.email-preview div {
  display: grid;
  gap: 4px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.email-preview span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
}

.email-preview p,
.email-preview ul {
  margin: 0;
  color: #48606f;
  font-size: 13px;
  line-height: 1.5;
}

.email-preview ul {
  padding-left: 18px;
}

.invite-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 6px;
}

.invite-status {
  min-height: 22px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}

.invite-status.success { color: #087c61; }
.invite-status.error { color: var(--red); }

.primary-action[disabled],
.secondary-action[disabled] {
  cursor: not-allowed;
  opacity: 0.62;
}

@media (max-width: 1180px) {
  .admin-login-shell { grid-template-columns: 1fr; align-items: start; padding-top: 24px; }
  .topbar { grid-template-columns: 1fr; }
  .top-nav { overflow-x: auto; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .onboarding-layout,
  .command-center,
  .split-section,
  .review-grid { grid-template-columns: 1fr; }
  .five-step-panel { grid-template-columns: 1fr; }
  .step-rail,
  .command-stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .status-rail { position: static; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .clinician-card { grid-template-columns: 58px 1fr 40px; }
  .card-meta { grid-column: 2 / -1; }
}

@media (max-width: 760px) {
  .admin-login-shell { width: min(100% - 28px, 1200px); }
  .admin-login-intro { min-height: auto; padding: 24px; }
  .admin-access-list { grid-template-columns: 1fr; margin-top: 28px; }
  .workspace { width: min(100% - 28px, 1500px); padding-top: 20px; }
  .page-hero, .toolbar, .hero-actions, .filters { flex-direction: column; align-items: stretch; }
  .topbar { padding: 12px 14px; }
  .top-actions { flex-wrap: wrap; }
  .metric-grid, .status-rail, .card-meta, .step-rail, .command-stat-grid, .template-task-table .table-head, .template-task-table .task-row, .workflow-template-card, .drawer-summary, .drawer-filters, .readiness-list, .form-grid, .contract-template-panel, .signature-field-card, .internal-comp-card, .comp-split-grid, .contract-gate, .document-upload-form, .standard-document-row { grid-template-columns: 1fr; }
  .clinician-card { grid-template-columns: 76px 1fr; padding: 14px; }
  .avatar { width: 44px; height: 44px; }
  .card-actions { grid-column: 2; justify-self: end; }
  .review-list li, .table-head, .task-row { grid-template-columns: 1fr; }
  .document-description-field,
  .document-file-field { grid-column: auto; }
  .document-library-title,
  .document-library-actions { flex-direction: column; align-items: stretch; }
  .standard-document-actions { justify-content: stretch; }
  .standard-document-actions a,
  .standard-document-actions button { flex: 1; }
  .standard-document-menu { flex: 0 0 auto; margin-left: auto; }
  .invite-actions { flex-direction: column; }
#standardDocumentDrawer .drawer-panel,
  #detailsDrawer .drawer-panel,
  #contractDrawer .drawer-panel,
  #inviteDrawer .drawer-panel {
    width: min(100% - 28px, 560px);
    max-height: calc(100vh - 28px);
  }
}


/* ============================================================
   WARM THEME SKIN — layered after the base rules above.
   Turns the navy chrome light, accents teal, display serif.
   ============================================================ */
body { letter-spacing: -0.003em; -webkit-font-smoothing: antialiased; }
body::before {
  content: ''; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.035'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
}
.admin-login-shell, .app-shell, .workspace { position: relative; z-index: 1; }
.app-shell { background: transparent; }

/* topbar → light warm */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(250, 248, 243, 0.86); backdrop-filter: blur(14px);
  color: var(--ink); border-bottom: 1px solid var(--line-2); box-shadow: none;
}
.brand { color: var(--ink); }
.brand small { color: var(--muted); }
.brand-mark { background: var(--navy); color: #fff; border: 0; font-family: var(--serif); font-weight: 600; }
.top-nav a { color: var(--muted); font-weight: 600; text-transform: none; letter-spacing: -0.01em; font-size: 13.5px; }
.top-nav a:hover { color: var(--ink); background: transparent; }
.top-nav a.active { color: var(--ink); background: transparent; font-weight: 600; box-shadow: inset 0 -2px 0 var(--teal); }
.icon-button { background: var(--panel); color: var(--ink-soft); border: 1px solid var(--line); }
.topbar .primary-action { background: var(--teal); color: #fff; box-shadow: none; }
.topbar .top-secondary { background: var(--panel); color: var(--ink); border: 1px solid var(--line); }
.admin-session-chip { background: var(--panel); color: var(--ink-soft); border: 1px solid var(--line); }
.admin-session-chip button { background: var(--wash); color: var(--ink-soft); }

/* login screen chrome */
.admin-login-intro .brand-mark, .admin-login-intro .brand { color: var(--ink); }
.admin-login-intro .brand-mark { color: #fff; }

/* primary / secondary actions */
.primary-action { background: var(--teal); color: #fff; box-shadow: 0 6px 16px rgba(15,138,107,0.22); font-weight: 600; }
.secondary-action { background: var(--panel); color: var(--ink); border: 1px solid var(--line); font-weight: 600; }

/* display headings → serif */
.admin-login-intro h1, .page-hero h1, .hero-work-card h2, .section-title h2,
.five-step-panel h2, .command-stat-grid strong, .metric-card strong, .drawer-header h2 {
  font-family: var(--serif); font-weight: 500; letter-spacing: -0.015em;
}

/* eyebrows + accent details */
.eyebrow { color: var(--teal-deep); font-weight: 600; }
.hero-work-card { border-top-color: var(--teal); }
.metric-card.success { border-top-color: var(--teal); }
.step-rail li.active, .workflow-template-card.active { border-color: rgba(15,138,107,0.4); }

/* Operational clarity and accessible interaction states */
button:focus-visible,
a:focus-visible,
select:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(11, 118, 91, 0.25);
  outline-offset: 2px;
}

.section-note,
.read-only-note {
  margin: 8px 0 0;
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.5;
}

.read-only-note {
  padding: 14px 16px;
  border-radius: 12px;
  background: var(--wash);
}

.read-only-chip {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 999px;
  background: var(--wash);
  color: var(--ink-soft);
  padding: 7px 11px;
  font-size: 12px;
  font-weight: 600;
}

.queue-empty-state {
  margin: 0 18px 18px;
  border: 1px dashed var(--line);
  border-radius: 12px;
  padding: 24px;
  color: var(--ink-soft);
  text-align: center;
}

.drawer-delivery-panel {
  display: grid;
  gap: 12px;
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  padding: 16px;
}

.drawer-delivery-panel strong { display: block; margin-bottom: 4px; font-size: 15px; }
.drawer-delivery-panel p { margin: 0; color: var(--ink-soft); font-size: 14px; line-height: 1.5; }

.drawer-delivery-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.drawer-delivery-buttons .primary-action,
.drawer-delivery-buttons .secondary-action { min-height: 42px; }

.import-agreement-form,
.change-request-form {
  display: grid;
  gap: 12px;
  width: 100%;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.import-agreement-form[hidden],
.change-request-form[hidden] { display: none; }

.import-agreement-form label,
.change-request-form label {
  display: grid;
  gap: 7px;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 600;
}

.import-agreement-form input,
.change-request-form textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff;
  color: var(--ink);
  padding: 10px 12px;
}

.change-request-form textarea { min-height: 104px; resize: vertical; line-height: 1.5; }

.drawer-review-actions {
  position: sticky;
  bottom: -28px;
  z-index: 3;
  flex-wrap: wrap;
  margin: 18px -28px -28px;
  border-right: 0;
  border-bottom: 0;
  border-left: 0;
  border-radius: 0;
  padding: 18px 28px 22px;
  box-shadow: 0 -12px 28px rgba(30, 45, 52, 0.09);
}

.drawer-review-actions .change-request-form { flex-basis: 100%; }
.drawer-review-actions .change-request-status { flex-basis: 100%; }

.admin-access-list small,
.admin-login-form label > span,
.step-rail small,
.drawer-summary span,
.email-preview span { font-size: 13px; }

.profile-photo-control small { font-size: 12px; line-height: 1.25; }

@media (max-width: 1180px) {
  .topbar {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px 16px;
  }
  .top-nav { grid-column: 1 / -1; grid-row: 2; }
  .top-actions { grid-column: 2; grid-row: 1; }
}

@media (max-width: 760px) {
  .workspace {
    display: flex;
    flex-direction: column;
  }
  .onboarding-layout[data-view-section~="dashboard"] { order: -1; }
  .admin-login-panel { order: -1; margin-top: 6px; }
  .admin-login-intro { padding: 22px; }
  .admin-login-intro .brand { margin-bottom: 24px; }
  .admin-login-intro h1 { font-size: 32px; }
  .admin-access-list { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 22px; }
  .admin-access-list div { min-height: 0; }
  .topbar { grid-template-columns: minmax(0, 1fr) auto; }
  .topbar .top-secondary { display: none; }
  .admin-session-chip { padding-left: 6px; }
  .admin-session-chip > span { display: none; }
  .top-actions { gap: 6px; }
  .top-actions > .primary-action { padding: 0 12px; }
  .status-rail {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 8px;
    scroll-snap-type: x proximity;
    scrollbar-width: thin;
  }
  .status-rail .status-filter {
    flex: 0 0 148px;
    scroll-snap-align: start;
  }
  .drawer-review-actions {
    bottom: -14px;
    margin: 18px -28px -28px;
    padding: 16px 28px 22px;
  }
  .drawer-review-buttons,
  .drawer-delivery-buttons { width: 100%; flex-direction: column; align-items: stretch; }
  .drawer-review-actions .primary-action,
  .drawer-review-actions .secondary-action { width: 100%; min-width: 0; }
}
