/* CareDesk HMS — private engineering release. No external fonts or assets. */
:root {
  color-scheme: light;
  --canvas: #f3f6f8;
  --surface: #fff;
  --surface-alt: #f7f9fa;
  --ink: #182c3c;
  --muted: #536574;
  --line: #d8e1e7;
  --control: #80929f;
  --accent: #08736f;
  --accent-hover: #086661;
  --accent-soft: #e6f5f2;
  --on-accent: #fff;
  --navy: #122d40;
  --rail: #0e2536;
  --rail-ink: #e2ecf3;
  --rail-muted: #b3c6d3;
  --rail-active: #264555;
  --focus: #0867b5;
  --warn: #81540b;
  --warn-bg: #fff6df;
  --danger: #b12d38;
  --danger-bg: #fff0f1;
  --good: #116447;
  --good-bg: #e7f5ed;
  --info: #235f93;
  --info-bg: #eaf3fc;
  --radius: 12px;
  --shadow: 0 2px 4px #112c4010, 0 12px 32px #112c4010;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    color-scheme: dark;
    --canvas: #111c25;
    --surface: #182732;
    --surface-alt: #20323e;
    --ink: #edf4f8;
    --muted: #b6c7d3;
    --line: #3e5260;
    --control: #8299a9;
    --accent: #79ded1;
    --accent-hover: #a4eadf;
    --accent-soft: #203e40;
    --on-accent: #0a292c;
    --navy: #cce4f2;
    --focus: #90c9fa;
    --warn: #f4cf7f;
    --warn-bg: #3b3220;
    --danger: #ffacb4;
    --danger-bg: #432b32;
    --good: #9cdec0;
    --good-bg: #213d36;
    --info: #aed4ff;
    --info-bg: #233c53;
    --shadow: 0 2px 4px #0002, 0 12px 32px #0002;
  }
}
:root[data-theme='dark'] {
  color-scheme: dark;
  --canvas: #111c25;
  --surface: #182732;
  --surface-alt: #20323e;
  --ink: #edf4f8;
  --muted: #b6c7d3;
  --line: #3e5260;
  --control: #8299a9;
  --accent: #79ded1;
  --accent-hover: #a4eadf;
  --accent-soft: #203e40;
  --on-accent: #0a292c;
  --navy: #cce4f2;
  --focus: #90c9fa;
  --warn: #f4cf7f;
  --warn-bg: #3b3220;
  --danger: #ffacb4;
  --danger-bg: #432b32;
  --good: #9cdec0;
  --good-bg: #213d36;
  --info: #aed4ff;
  --info-bg: #233c53;
  --shadow: 0 2px 4px #0002, 0 12px 32px #0002;
}
* {
  box-sizing: border-box;
}
html {
  font:
    16px/1.5 -apple-system,
    BlinkMacSystemFont,
    'Segoe UI',
    sans-serif;
  scroll-behavior: auto;
}
body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  min-width: 0;
}
button,
input,
select,
textarea {
  font: inherit;
}
a {
  color: var(--accent);
  text-underline-offset: 3px;
}
button,
a,
input,
select,
textarea,
summary {
  -webkit-tap-highlight-color: transparent;
}
button,
a,
summary {
  touch-action: manipulation;
}
button {
  cursor: pointer;
}
button:disabled {
  cursor: not-allowed;
  opacity: 0.64;
}
:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1 {
  font-size: 32px;
  line-height: 1.2;
  letter-spacing: -0.7px;
  font-weight: 680;
}
h2 {
  font-size: 22px;
  line-height: 1.35;
  letter-spacing: -0.3px;
  font-weight: 650;
}
h3 {
  font-size: 18px;
  line-height: 1.4;
  font-weight: 650;
}
small,
.small {
  font-size: 14px;
  line-height: 1.5;
}
.muted {
  color: var(--muted);
}
strong {
  font-weight: 650;
}
button svg,
.icon {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
[hidden] {
  display: none !important;
}
.skip-link {
  position: fixed;
  top: -120px;
  left: 16px;
  background: var(--surface);
  padding: 12px 20px;
  border: 2px solid var(--focus);
  z-index: 1000;
}
.skip-link:focus {
  top: 12px;
}
.shell {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  min-height: 100vh;
}
.sidebar {
  background: var(--rail);
  color: var(--rail-ink);
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 28px 16px 20px;
  overflow-y: auto;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 12px;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid #6a9d9d;
  border-radius: 10px;
  background: #154f54;
  color: #b9f1e5;
  flex: 0 0 40px;
}
.brand-mark svg {
  width: 25px;
  height: 25px;
}
.brand-word {
  font-size: 24px;
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -0.5px;
}
.brand-word small {
  font-weight: 400;
  font-size: 14px;
  letter-spacing: 0.5px;
  margin-left: 6px;
  color: var(--rail-muted);
}
.hospital-name {
  margin: 20px 12px 24px;
  padding-top: 20px;
  border-top: 1px solid #456274;
  color: var(--rail-muted);
  font-size: 14px;
  overflow-wrap: anywhere;
}
.nav {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.nav-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.nav-label {
  font-size: 14px;
  color: var(--rail-muted);
  padding: 0 12px 4px;
}
.nav a {
  display: flex;
  gap: 12px;
  align-items: center;
  min-height: 46px;
  padding: 10px 12px;
  text-decoration: none;
  border-radius: 8px;
  color: var(--rail-ink);
  font-size: 15px;
  border: 1px solid transparent;
}
.nav a:hover {
  background: #1b394c;
}
.nav a[aria-current='page'] {
  background: var(--rail-active);
  border-color: #7898a4;
  color: #fff;
  font-weight: 650;
}
.sidebar-foot {
  margin-top: auto;
  padding: 28px 12px 0;
  color: var(--rail-muted);
  font-size: 14px;
}
.sidebar-foot span {
  display: block;
  margin-top: 4px;
}
.workspace {
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.topbar {
  min-height: 80px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 16px 32px;
}
.topbar-context {
  font-size: 14px;
  color: var(--muted);
}
.topbar-context strong {
  font-size: 16px;
  color: var(--ink);
  display: block;
  font-weight: 600;
}
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  border: 0;
  background: transparent;
  color: var(--ink);
  text-align: left;
  padding: 0 8px;
  max-width: 240px;
}
.avatar {
  width: 36px;
  height: 36px;
  border: 1px solid var(--control);
  border-radius: 50%;
  background: var(--surface-alt);
  display: grid;
  place-items: center;
  font-size: 14px;
  font-weight: 650;
  flex-shrink: 0;
}
.user-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 170px;
  display: block;
  font-size: 14px;
  font-weight: 600;
}
.role {
  display: block;
  font-size: 14px;
  color: var(--muted);
}
.content {
  padding: 28px 32px 48px;
  width: 100%;
  max-width: 1536px;
  margin: 0 auto;
  min-width: 0;
}
.release {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 24px;
}
.release strong {
  font-weight: 650;
  color: var(--ink);
}
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}
.page-header > div:first-child {
  min-width: 0;
}
.page-header p {
  margin-top: 10px;
  max-width: 740px;
  color: var(--muted);
}
.eyebrow {
  display: block;
  text-transform: uppercase;
  letter-spacing: 1.25px;
  font-weight: 650;
  font-size: 14px;
  color: var(--accent);
  margin-bottom: 8px;
}
.header-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
  flex-shrink: 0;
  padding-top: 12px;
}
.btn {
  border: 1px solid var(--control);
  border-radius: 8px;
  min-height: 44px;
  padding: 10px 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--surface);
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  line-height: 1.45;
  max-width: 100%;
  text-align: center;
  white-space: normal;
}
.btn:hover:not(:disabled) {
  background: var(--surface-alt);
  border-color: var(--ink);
}
.btn.primary {
  background: var(--accent);
  color: var(--on-accent);
  border-color: var(--accent);
}
.btn.primary:hover:not(:disabled) {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}
.btn.danger {
  background: var(--danger-bg);
  color: var(--danger);
  border-color: var(--danger);
}
.btn.quiet {
  border-color: transparent;
  background: transparent;
  color: var(--accent);
}
.btn.quiet:hover {
  border-color: var(--control);
}
.btn.icon-only {
  width: 44px;
  padding: 10px;
  flex: 0 0 44px;
}
.btn.small {
  padding: 8px 12px;
  min-height: 44px;
}
.button-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.stack {
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-width: 0;
}
.stack.tight {
  gap: 12px;
}
.grid {
  display: grid;
  gap: 20px;
  min-width: 0;
}
.grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.metric {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 24px;
  min-width: 0;
}
.metric .metric-top {
  display: flex;
  gap: 12px;
  justify-content: space-between;
  align-items: center;
  color: var(--muted);
  font-size: 14px;
}
.metric .metric-value {
  font-size: 32px;
  line-height: 1.25;
  letter-spacing: -0.7px;
  font-weight: 650;
  margin: 12px 0 6px;
  overflow-wrap: anywhere;
  font-variant-numeric: tabular-nums;
}
.metric .small {
  color: var(--muted);
}
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  min-width: 0;
  overflow: hidden;
}
.panel-body {
  padding: 24px;
  min-width: 0;
}
.panel-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.panel-header p {
  color: var(--muted);
  font-size: 14px;
  margin-top: 4px;
}
.panel-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--line);
  background: var(--surface-alt);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.workflow-link {
  display: flex;
  gap: 16px;
  align-items: center;
  padding: 18px 24px;
  border: 0;
  border-bottom: 1px solid var(--line);
  width: 100%;
  background: transparent;
  color: var(--ink);
  text-decoration: none;
  text-align: left;
  min-height: 80px;
}
.workflow-link:last-child {
  border-bottom: 0;
}
.workflow-link:hover {
  background: var(--surface-alt);
}
.workflow-link .icon-box {
  background: var(--accent-soft);
  color: var(--accent);
  width: 42px;
  height: 42px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.workflow-link strong {
  font-size: 16px;
}
.workflow-link p {
  font-size: 14px;
  color: var(--muted);
  margin-top: 2px;
}
.workflow-link > .icon {
  margin-left: auto;
}
.toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 24px;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.search-form {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  flex: 1;
  max-width: 560px;
  min-width: 0;
}
.search-form .field {
  flex: 1;
  min-width: 0;
  margin: 0;
}
.count-label {
  font-size: 14px;
  color: var(--muted);
}
.table-scroll {
  width: 100%;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  min-width: 0;
}
table {
  border-collapse: collapse;
  width: 100%;
  text-align: left;
  min-width: 660px;
  font-size: 14px;
}
caption {
  padding: 12px 24px;
  text-align: left;
  font-size: 14px;
  color: var(--muted);
}
th {
  color: var(--muted);
  font-weight: 600;
  background: var(--surface-alt);
  font-size: 14px;
  white-space: nowrap;
}
th,
td {
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
td {
  max-width: 360px;
  overflow-wrap: anywhere;
}
tbody tr:last-child td {
  border-bottom: 0;
}
tbody tr:hover {
  background: var(--surface-alt);
}
th:first-child,
td:first-child {
  padding-left: 24px;
}
th:last-child,
td:last-child {
  padding-right: 24px;
}
td .subtext {
  font-size: 14px;
  color: var(--muted);
  margin-top: 2px;
}
.cell-title {
  font-weight: 600;
  color: var(--ink);
  font-size: 15px;
}
.link-button {
  min-width: 44px;
  padding: 8px 0;
  min-height: 44px;
  color: var(--accent);
  background: none;
  border: 0;
  text-align: left;
  font-size: 15px;
  font-weight: 600;
  overflow-wrap: anywhere;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
.number {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  min-height: 28px;
  background: var(--surface-alt);
  color: var(--muted);
  border: 1px solid var(--control);
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
}
.badge.good {
  background: var(--good-bg);
  color: var(--good);
  border-color: var(--good);
}
.badge.warn {
  background: var(--warn-bg);
  color: var(--warn);
  border-color: var(--warn);
}
.badge.info {
  background: var(--info-bg);
  color: var(--info);
  border-color: var(--info);
}
.badge.danger {
  background: var(--danger-bg);
  color: var(--danger);
  border-color: var(--danger);
}
.empty,
.loading {
  padding: 48px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
  color: var(--muted);
}
.empty h2,
.empty h3 {
  color: var(--ink);
}
.empty p {
  max-width: 480px;
}
.empty > .icon {
  width: 32px;
  height: 32px;
}
.loading .spinner {
  margin-bottom: 8px;
}
.spinner {
  width: 24px;
  height: 24px;
  border: 2px solid var(--control);
  border-top-color: var(--accent);
  border-radius: 50%;
  display: inline-block;
  animation: spin 1s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
@media (prefers-reduced-motion: reduce) {
  .spinner {
    animation: none;
    border-top-width: 5px;
  }
}
.notice {
  padding: 16px;
  border: 1px solid var(--control);
  border-radius: 8px;
  background: var(--surface-alt);
  color: var(--muted);
  font-size: 14px;
  overflow-wrap: anywhere;
}
.notice.warn {
  border-color: var(--warn);
  background: var(--warn-bg);
  color: var(--warn);
}
.notice.error {
  border-color: var(--danger);
  background: var(--danger-bg);
  color: var(--danger);
}
.notice.info {
  border-color: var(--info);
  background: var(--info-bg);
  color: var(--info);
}
.notice p + p {
  margin-top: 6px;
}
.notice .button-row {
  margin-top: 12px;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
  min-width: 0;
}
.field:last-child {
  margin-bottom: 0;
}
label,
.field-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}
.required-note {
  color: var(--muted);
  font-weight: 400;
}
input,
select,
textarea {
  min-width: 0;
  width: 100%;
  min-height: 46px;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--control);
  border-radius: 7px;
  padding: 10px 12px;
  font-size: 16px;
  line-height: 1.45;
}
textarea {
  resize: vertical;
  min-height: 112px;
  max-width: 100%;
}
input:disabled,
select:disabled,
textarea:disabled {
  background: var(--surface-alt);
}
input::placeholder,
textarea::placeholder {
  color: var(--muted);
  opacity: 1;
}
input[type='checkbox'] {
  appearance: auto;
  width: 20px;
  height: 20px;
  min-height: 20px;
  margin: 2px 0;
  accent-color: var(--accent);
  flex: 0 0 20px;
}
.check-label {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 0;
  min-height: 44px;
  font-size: 14px;
  font-weight: 400;
  cursor: pointer;
}
.field-hint {
  font-size: 14px;
  color: var(--muted);
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 16px;
}
.form-grid > .full {
  grid-column: 1/-1;
}
fieldset {
  border: 0;
  padding: 0;
  margin: 0;
  min-width: 0;
}
legend {
  font-size: 16px;
  font-weight: 650;
  margin-bottom: 12px;
}
.picker {
  margin-bottom: 20px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-alt);
}
.picker-search {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  margin-bottom: 12px;
}
.picker-search .field {
  flex: 1;
  margin-bottom: 0;
  min-width: 0;
}
.repeat-row {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  margin: 12px 0;
  background: var(--surface-alt);
}
.repeat-row-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.repeat-row .form-grid {
  gap: 12px 16px;
}
.repeat-row .field {
  margin: 0;
}
.attestation {
  border: 1px solid var(--warn);
  background: var(--warn-bg);
  padding: 4px 16px;
  border-radius: 8px;
  color: var(--warn);
  margin-top: 20px;
}
.attestation label {
  color: var(--warn);
}
dialog {
  border: 1px solid var(--control);
  padding: 0;
  border-radius: 12px;
  width: calc(100% - 32px);
  max-width: 660px;
  max-height: calc(100dvh - 32px);
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 24px 80px #06172355;
  overflow: auto;
  overscroll-behavior: contain;
}
dialog.wide {
  max-width: 900px;
}
dialog::backdrop {
  background: #071d2bd1;
}
.modal-header {
  padding: 24px 24px 16px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  background: var(--surface);
}
.modal-header h2 {
  padding-top: 4px;
}
.modal-header p {
  color: var(--muted);
  font-size: 14px;
  margin-top: 6px;
}
.modal-body {
  padding: 4px 24px 24px;
}
.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--line);
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  flex-wrap: wrap;
  background: var(--surface-alt);
}
.modal-error {
  margin: 0 24px 20px;
}
.modal-error:empty {
  display: none;
}
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  max-width: min(500px, calc(100% - 32px));
  z-index: 150;
  background: var(--navy);
  color: var(--canvas);
  padding: 16px 20px;
  border-radius: 8px;
  box-shadow: var(--shadow);
  font-size: 14px;
}
.boot {
  min-height: 100vh;
  display: grid;
  place-items: center;
}
.auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(280px, 400px) minmax(0, 1fr);
}
.auth-aside {
  background: var(--rail);
  color: var(--rail-ink);
  padding: 40px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 48px;
}
.auth-aside .brand {
  padding: 0;
}
.auth-aside .auth-caption {
  font-size: 28px;
  line-height: 1.3;
  letter-spacing: -0.5px;
  max-width: 290px;
  font-weight: 600;
  margin-bottom: 16px;
}
.auth-aside p {
  color: var(--rail-muted);
  font-size: 16px;
}
.auth-main {
  padding: 40px 24px;
  display: grid;
  place-items: center;
  position: relative;
}
.auth-card {
  width: 100%;
  max-width: 420px;
}
.auth-card h1 {
  margin-top: 8px;
  margin-bottom: 12px;
}
.auth-card > p {
  color: var(--muted);
  margin-bottom: 28px;
}
.auth-card .notice {
  margin: 20px 0;
}
.auth-card form > .btn {
  width: 100%;
  margin-top: 12px;
}
.auth-footer {
  font-size: 14px;
  color: var(--muted);
  padding-top: 24px;
  border-top: 1px solid var(--line);
  margin-top: 28px;
}
.auth-theme {
  position: absolute;
  top: 20px;
  right: 20px;
}
.record-banner {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  justify-content: space-between;
  align-items: flex-start;
}
.record-banner h1 {
  overflow-wrap: anywhere;
}
.record-meta {
  display: flex;
  gap: 8px 24px;
  flex-wrap: wrap;
  margin-top: 12px;
  color: var(--muted);
  font-size: 14px;
}
.tabs {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  overscroll-behavior: contain;
  border-bottom: 1px solid var(--line);
  margin: 24px 0;
  max-width: 100%;
  padding: 0 0 4px;
}
.tabs .btn {
  flex-shrink: 0;
  border-color: transparent;
  background: transparent;
  color: var(--muted);
  white-space: nowrap;
}
.tabs .btn[aria-current='page'] {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: var(--accent);
}
.detail-list {
  margin: 0;
  display: grid;
  grid-template-columns: minmax(120px, 1fr) minmax(0, 2fr);
  gap: 12px 24px;
  font-size: 14px;
}
.detail-list dt {
  color: var(--muted);
}
.detail-list dd {
  margin: 0;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}
.note-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
  background: var(--surface);
  scroll-margin-top: 24px;
}
.note-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.prose {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 16px;
  max-width: 760px;
  line-height: 1.65;
}
.note-card .button-row {
  margin-top: 16px;
}
.note-card:target,
.source-highlight {
  outline: 3px solid var(--focus);
  outline-offset: 4px;
}
.timeline-item {
  border-left: 2px solid var(--line);
  padding: 0 0 24px 20px;
}
.timeline-item:last-child {
  padding-bottom: 0;
}
.code-label {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 14px;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}
.bed-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  padding: 24px;
}
.bed {
  border: 1px solid var(--control);
  background: var(--surface-alt);
  border-radius: 8px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}
.bed.occupied {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.bed .bed-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.bed h3 {
  overflow-wrap: anywhere;
}
.recovery-codes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  list-style: none;
  padding: 16px;
  background: var(--surface-alt);
  border: 1px solid var(--control);
  border-radius: 8px;
  margin: 16px 0;
}
footer.app-footer {
  margin-top: 32px;
  color: var(--muted);
  font-size: 14px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  border-top: 1px solid var(--line);
  padding-top: 20px;
}
@media (min-width: 1600px) {
  .content {
    padding-top: 32px;
  }
  .metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (max-width: 1150px) {
  .shell {
    grid-template-columns: 212px minmax(0, 1fr);
  }
  .sidebar {
    padding-left: 12px;
    padding-right: 12px;
  }
  .content {
    padding: 24px;
  }
  .topbar {
    padding: 16px 24px;
  }
  .page-header {
    flex-wrap: wrap;
    gap: 12px;
  }
  .header-actions {
    justify-content: flex-start;
    padding: 0;
  }
  .metric {
    padding: 20px;
  }
  .metric .metric-value {
    font-size: 28px;
  }
  .bed-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 850px) {
  .shell {
    display: block;
  }
  .sidebar {
    position: static;
    height: auto;
    overflow: visible;
    padding: 16px 16px 0;
  }
  .sidebar .brand {
    padding: 0;
    display: inline-flex;
  }
  .hospital-name {
    display: inline-block;
    margin: 0 0 0 20px;
    border: 0;
    padding: 0;
    vertical-align: middle;
    max-width: calc(100% - 210px);
  }
  .nav {
    display: flex;
    flex-direction: row;
    gap: 6px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    padding: 16px 0 12px;
    margin: 0 -4px;
  }
  .nav-group {
    display: contents;
  }
  .nav-label,
  .sidebar-foot {
    display: none;
  }
  .nav a {
    flex-shrink: 0;
    white-space: nowrap;
    font-size: 14px;
  }
  .nav a .icon {
    width: 18px;
    height: 18px;
    flex-basis: 18px;
  }
  .topbar {
    min-height: 70px;
  }
  .topbar-context strong {
    font-size: 14px;
  }
  .metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .grid.two {
    grid-template-columns: minmax(0, 1fr);
  }
  .grid.three {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .auth-shell {
    grid-template-columns: minmax(0, 1fr);
  }
  .auth-aside {
    padding: 24px;
    display: block;
  }
  .auth-aside > div:not(:first-child),
  .auth-aside > .small {
    display: none;
  }
  .auth-main {
    padding: 64px 24px 32px;
  }
  .auth-theme {
    top: 12px;
    right: 16px;
  }
}
@media (max-width: 560px) {
  h1 {
    font-size: 28px;
  }
  h2 {
    font-size: 21px;
  }
  .content {
    padding: 20px 16px 32px;
  }
  .topbar {
    padding: 12px 16px;
    gap: 8px;
  }
  .topbar-context {
    max-width: 120px;
  }
  .topbar-context span {
    display: none;
  }
  .topbar-actions {
    gap: 4px;
  }
  .user-chip {
    padding: 0 4px;
    max-width: 158px;
  }
  .user-name {
    max-width: 106px;
  }
  .avatar {
    display: none;
  }
  .role {
    font-size: 14px;
  }
  .brand-word {
    font-size: 22px;
  }
  .hospital-name {
    display: block;
    max-width: 100%;
    margin: 12px 0 0;
    padding: 0;
  }
  .nav {
    padding-top: 12px;
  }
  .release {
    margin-bottom: 20px;
  }
  .page-header {
    margin-bottom: 20px;
  }
  .page-header p {
    font-size: 15px;
  }
  .header-actions {
    width: 100%;
    gap: 8px;
  }
  .metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }
  .metric {
    padding: 16px;
  }
  .metric .metric-value {
    font-size: 25px;
    margin-top: 12px;
  }
  .metric .metric-top {
    align-items: flex-start;
    gap: 4px;
  }
  .metric .metric-top > .icon {
    display: none;
  }
  .metric .small {
    font-size: 14px;
  }
  .grid.three {
    grid-template-columns: minmax(0, 1fr);
  }
  .panel-body {
    padding: 20px;
  }
  .panel-header {
    padding: 16px 20px;
    flex-wrap: wrap;
  }
  .toolbar {
    padding: 16px;
    gap: 12px;
  }
  .search-form {
    width: 100%;
    flex: 1 1 100%;
  }
  .search-form .btn {
    padding: 10px 12px;
  }
  .panel-footer {
    padding: 16px;
  }
  .table-scroll table {
    min-width: 640px;
  }
  .form-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }
  .form-grid > .full {
    grid-column: auto;
  }
  .field {
    margin-bottom: 16px;
  }
  .modal-header {
    padding: 20px 20px 16px;
  }
  .modal-body {
    padding: 0 20px 20px;
  }
  .modal-footer {
    padding: 16px 20px;
  }
  .modal-error {
    margin: 0 20px 16px;
  }
  .modal-footer .btn {
    flex: 1;
  }
  .picker {
    padding: 12px;
  }
  .picker-search {
    align-items: flex-end;
  }
  .picker-search .btn {
    padding: 10px;
  }
  .repeat-row {
    padding: 12px;
  }
  .repeat-row .form-grid {
    gap: 12px;
  }
  .detail-list {
    grid-template-columns: minmax(0, 1fr);
    gap: 4px;
  }
  .detail-list dd {
    margin-bottom: 12px;
  }
  .record-banner {
    padding: 20px;
    gap: 20px;
  }
  .record-meta {
    gap: 8px 16px;
  }
  .note-card {
    padding: 16px;
  }
  .note-top {
    gap: 12px;
  }
  .bed-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 16px;
    gap: 12px;
  }
  .bed {
    padding: 12px;
  }
  .bed-top {
    flex-wrap: wrap;
  }
  .workflow-link {
    padding: 16px 20px;
  }
  .toast {
    bottom: 16px;
    right: 16px;
  }
  footer.app-footer {
    flex-direction: column;
    gap: 4px;
  }
  .tabs {
    margin: 20px 0;
  }
  .recovery-codes {
    grid-template-columns: minmax(0, 1fr);
  }
}
@media print {
  @page {
    margin: 12mm 15mm;
    size: auto;
  }
  *, *::before, *::after {
    color-adjust: exact !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
  body {
    background: #fff !important;
    color: #0f172a !important;
    font-size: 11pt !important;
  }
  .sidebar,
  .topbar,
  .header-actions,
  .release,
  .btn,
  .button-row,
  .toast,
  .app-footer,
  .modal-header button,
  .theme-btn,
  #toast {
    display: none !important;
  }
  body:has(dialog[open]) .shell {
    display: none !important;
  }
  dialog[open] {
    display: block !important;
    position: static !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    background: #fff !important;
    color: #0f172a !important;
  }
  dialog[open] .modal-header {
    border-bottom: 2px solid #0f172a !important;
    padding-bottom: 8px !important;
    margin-bottom: 12px !important;
  }
  dialog[open] .modal-header h2 {
    color: #0f172a !important;
  }
  dialog[open] .modal-body {
    padding: 0 !important;
  }
  .bangla-rx-sheet,
  .discharge-summary-sheet,
  .printable-slip,
  .printable-invoice,
  .printable-report {
    background: #fff !important;
    color: #0f172a !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    width: 100% !important;
  }
  .bangla-rx-sheet *,
  .discharge-summary-sheet *,
  .printable-slip *,
  .printable-invoice *,
  .printable-report * {
    color: #0f172a !important;
  }
  .hospital-print-logo {
    max-height: 48px !important;
    max-width: 140px !important;
    object-fit: contain !important;
    display: block !important;
    margin-left: auto !important;
  }
  .shell {
    display: block !important;
  }
  .content {
    padding: 0 !important;
  }
  .panel {
    break-inside: avoid;
    box-shadow: none !important;
    border: 1px solid #cbd5e1 !important;
    background: #fff !important;
    color: #0f172a !important;
    margin-bottom: 16px !important;
  }
  .table-scroll {
    overflow: visible !important;
  }
  table {
    width: 100% !important;
    border-collapse: collapse !important;
  }
  th, td {
    border-bottom: 1px solid #e2e8f0 !important;
    color: #0f172a !important;
  }
}

/* Keep explanatory notices and asynchronous status text separate from labels. */
.modal-body > .notice:not(:last-child) {
  margin-bottom: 16px;
}
.modal-body > .field-hint {
  margin-bottom: 16px;
}

/* Preserve readable column widths; wide worklists scroll inside their region. */
/* Preserve readable column widths; wide worklists scroll inside their region. */
.table-scroll th,.table-scroll td{min-width:140px}
.table-scroll th:first-child,.table-scroll td:first-child{min-width:220px}
.table-scroll td .prose{min-width:220px}

/* =====================================================================
   Enterprise World-Class HMS Enhancements
   ===================================================================== */
.badge-esi {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 9999px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.badge-esi-1 { background: #d32f2f; color: #fff; box-shadow: 0 0 8px #d32f2f80; animation: pulse 2s infinite; }
.badge-esi-2 { background: #e65100; color: #fff; }
.badge-esi-3 { background: #fbc02d; color: #1a1a1a; }
.badge-esi-4 { background: #2e7d32; color: #fff; }
.badge-esi-5 { background: #0288d1; color: #fff; }

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.04); }
  100% { transform: scale(1); }
}

.badge-news {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 6px;
  font-weight: 700;
  font-size: 0.82rem;
}
.badge-news-high { background: var(--danger-bg); color: var(--danger); border: 1px solid var(--danger); }
.badge-news-medium { background: var(--warn-bg); color: var(--warn); border: 1px solid var(--warn); }
.badge-news-low-medium { background: #fff9e6; color: #856404; border: 1px solid #ffeeba; }
.badge-news-low { background: var(--good-bg); color: var(--good); border: 1px solid var(--good); }

/* eMAR & BCMA Station */
.emar-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin-top: 16px;
}
.emar-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  transition: box-shadow 0.2s ease;
}
.emar-card:hover {
  box-shadow: var(--shadow);
}
.emar-card.status-given {
  border-left: 5px solid var(--good);
  background: var(--surface);
}
.emar-card.status-scheduled {
  border-left: 5px solid var(--accent);
}
.emar-card.status-held {
  border-left: 5px solid var(--warn);
}
.emar-drug-name {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--ink);
}
.emar-meta {
  font-size: 0.85rem;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* BCMA Bedside Scanning Modal */
.bcma-scanner-box {
  background: var(--surface-alt);
  border: 2px dashed var(--accent);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  margin-bottom: 16px;
}
.bcma-scanner-box input {
  font-size: 1.1rem;
  font-family: monospace;
  text-align: center;
  letter-spacing: 0.1em;
}
.bcma-checklist {
  list-style: none;
  padding: 0;
  margin: 16px 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.bcma-checklist li {
  background: var(--surface-alt);
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
}

/* CDSS Interaction & Alert Dialog */
.cdss-alert-box {
  background: var(--danger-bg);
  border-left: 4px solid var(--danger);
  border-radius: 8px;
  padding: 14px;
  margin: 12px 0;
  color: var(--ink);
}
.cdss-alert-title {
  font-weight: 700;
  color: var(--danger);
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}

/* CPOE Order Sets */
.cpoe-bundle-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 16px;
  margin-bottom: 14px;
}
.cpoe-bundle-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.cpoe-item-pill {
  display: inline-block;
  background: var(--surface-alt);
  border: 1px solid var(--line);
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 0.8rem;
  margin: 2px 4px 2px 0;
}

/* DICOM PACS Card */
.dicom-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 14px;
}
.modality-badge {
  background: #283593;
  color: #fff;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
}

/* -------------------------------------------------------------------------
   Operation Theatre (OT) Suites & WHO Surgical Safety Checklist
   ------------------------------------------------------------------------- */
.ot-room-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}
.ot-room-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.ot-room-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.ot-room-card.ot-status-available {
  border-left: 4px solid var(--good);
}
.ot-room-card.ot-status-busy {
  border-left: 4px solid var(--danger);
  background: var(--danger-bg);
}
.ot-room-card.ot-status-offline {
  border-left: 4px solid var(--control);
  opacity: 0.8;
}
.ot-room-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.ot-badge {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  text-transform: uppercase;
}
.ot-badge.ot-status-available {
  background: var(--good-bg);
  color: var(--good);
}
.ot-badge.ot-status-busy {
  background: var(--danger);
  color: #fff;
}
.ot-badge.ot-status-offline {
  background: var(--surface-alt);
  color: var(--muted);
}
.ot-active-case-info {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px dashed var(--line);
}

/* WHO Checklist Styling */
.who-checklist-section {
  background: var(--surface-alt);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
}
.who-checklist-section h3 {
  margin: 0 0 4px 0;
  font-size: 1rem;
  color: var(--ink);
}
.who-signatures-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 2px solid var(--line);
}

/* -------------------------------------------------------------------------
   Blood Bank Component Matrix & TTIs
   ------------------------------------------------------------------------- */
.blood-stock-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}
.blood-group-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.blood-group-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding-bottom: 8px;
  margin-bottom: 10px;
}
.blood-type-symbol {
  font-size: 1.4rem;
  font-weight: 900;
  color: #b71c1c;
  background: #ffebee;
  padding: 2px 10px;
  border-radius: 8px;
}
.blood-unit-total {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--muted);
}
.blood-component-breakdown {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.85rem;
}
.blood-component-breakdown .comp-row {
  display: flex;
  justify-content: space-between;
  color: var(--ink);
}

/* -------------------------------------------------------------------------
   OPD Token Queue Digital Billboard & Doctor Consoles
   ------------------------------------------------------------------------- */
.opd-tv-billboard {
  background: #0f172a;
  color: #f8fafc;
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 24px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.4);
}
.opd-billboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid #334155;
  padding-bottom: 12px;
  margin-bottom: 16px;
}
.billboard-title {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #38bdf8;
}
.billboard-clock {
  font-family: monospace;
  font-size: 0.95rem;
  color: #94a3b8;
}
.opd-billboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}
.opd-billboard-chamber {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 10px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.chamber-badge-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.chamber-number {
  background: #0284c7;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 4px;
  letter-spacing: 0.05em;
}
.chamber-room {
  font-size: 0.8rem;
  color: #94a3b8;
}
.chamber-doctor-name {
  font-weight: 700;
  font-size: 0.95rem;
  color: #e2e8f0;
}
.chamber-token-box {
  background: #090d16;
  border-radius: 8px;
  padding: 12px;
  text-align: center;
  border: 1px solid #1e293b;
}
.token-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: #94a3b8;
  margin-bottom: 4px;
}
.token-number-led {
  font-family: "Courier New", Courier, monospace;
  font-size: 2.2rem;
  font-weight: 900;
  color: #4ade80;
  text-shadow: 0 0 10px rgba(74, 222, 128, 0.5);
  line-height: 1.1;
}
.token-patient-name {
  font-size: 0.85rem;
  color: #cbd5e1;
  margin-top: 4px;
}
.chamber-next-queue {
  font-size: 0.8rem;
  color: #94a3b8;
  padding-top: 4px;
}
.opd-console-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

/* -------------------------------------------------------------------------
   Bilingual Bangladeshi Prescription Layout
   ------------------------------------------------------------------------- */
.bangla-rx-sheet {
  background: #fff;
  color: #1a202c;
  border: 1px solid #cbd5e0;
  border-radius: 8px;
  padding: 24px;
  max-width: 800px;
  margin: 0 auto;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
.rx-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  border-bottom: 2px solid #08736f;
  padding-bottom: 16px;
  margin-bottom: 12px;
}
.rx-doc-name {
  font-size: 1.25rem;
  color: #08736f;
}
.rx-doc-degree {
  font-size: 0.9rem;
  font-weight: 600;
  color: #4a5568;
}
.rx-doc-bmdc {
  font-size: 0.85rem;
  font-weight: 700;
  color: #2b6cb0;
}
.rx-patient-bar {
  background: #edf2f7;
  padding: 10px 14px;
  border-radius: 6px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.9rem;
  margin-bottom: 18px;
}
.rx-body-grid {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 20px;
  min-height: 380px;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 16px;
}
.rx-left-col {
  border-right: 1px solid #e2e8f0;
  padding-right: 16px;
}
.rx-left-col h4 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #718096;
  margin: 0 0 8px 0;
}
.rx-clinical-item {
  font-size: 0.85rem;
  margin-bottom: 4px;
}
.rx-investigation-list {
  padding-left: 18px;
  margin: 0;
  font-size: 0.85rem;
}
.rx-right-col {
  display: flex;
  flex-direction: column;
}
.rx-symbol {
  font-size: 2rem;
  font-weight: 900;
  color: #08736f;
  line-height: 1;
  margin-bottom: 10px;
}
.rx-medications-list {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.rx-med-item strong {
  font-size: 0.95rem;
  color: #1a202c;
}
.rx-timing-bn {
  font-size: 0.9rem;
  color: #08736f;
  font-weight: 600;
  margin-top: 2px;
}
.rx-advice-box {
  margin-top: 20px;
  background: #f7fafc;
  border: 1px dashed #cbd5e0;
  border-radius: 6px;
  padding: 10px 14px;
}
.rx-advice-box h4 {
  margin: 0 0 4px 0;
  font-size: 0.85rem;
  color: #4a5568;
}
.rx-advice-box p {
  margin: 0;
  font-size: 0.85rem;
  color: #2d3748;
}
.rx-footer {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding-top: 24px;
}
.rx-sign-box {
  text-align: center;
  width: 180px;
}
.sign-line {
  border-top: 1px solid #718096;
  margin-bottom: 4px;
}

/* Hospital Clinical Document Styles */
.printable-wristband {
  max-width: 420px;
  margin: 0 auto;
  border: 2px dashed #000;
  padding: 14px;
  background: #fff !important;
  color: #000 !important;
  border-radius: 6px;
}

.bed-card-sheet {
  background: #fff !important;
  color: #000 !important;
  padding: 24px;
  border: 2px solid #000;
  border-radius: 8px;
}

.printable-label {
  max-width: 320px;
  margin: 0 auto;
  padding: 12px;
  background: #fff !important;
  color: #000 !important;
  border: 1px dashed #000;
  border-radius: 6px;
  font-family: monospace;
}

.medical-certificate-sheet {
  background: #fff !important;
  color: #000 !important;
  padding: 28px;
  border: 2px solid #000;
  border-radius: 8px;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-top: 16px;
  margin-bottom: 24px;
}
.kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.kpi-label {
  font-size: 0.85rem;
  color: var(--muted);
  font-weight: 600;
}

.metric .metric-desc {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
  margin-top: 4px;
}

.metric-value.text-success {
  color: #10b981 !important;
}
.metric-value.text-warn {
  color: #f59e0b !important;
}
.metric-value.text-error {
  color: #ef4444 !important;
}

th.number,
td.number {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.topbar-context {
  display: flex;
  align-items: center;
  gap: 16px;
}

.role .icon {
  width: 14px;
  height: 14px;
  stroke: var(--accent, #0ea5e9);
  flex-shrink: 0;
  display: inline-block;
  vertical-align: -1px;
}

/* Branch Switcher & Multi-Branch Network */
.branch-switcher-wrap {
  display: inline-flex;
  align-items: center;
}
.branch-switcher-btn {
  font-weight: 600 !important;
  font-size: 0.95rem !important;
  padding: 6px 14px !important;
  border-radius: 8px !important;
  background: var(--surface-raised, rgba(255, 255, 255, 0.06)) !important;
  border: 1px solid var(--border, rgba(255, 255, 255, 0.12)) !important;
  color: var(--text) !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  cursor: pointer !important;
  transition: all 0.15s ease !important;
}
.branch-switcher-btn:hover {
  background: var(--surface, rgba(255, 255, 255, 0.12)) !important;
  border-color: var(--accent, #0ea5e9) !important;
}
.branch-switcher-btn .icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}
.branch-switcher-btn .branch-caret {
  width: 14px;
  height: 14px;
  opacity: 0.7;
  stroke: currentColor;
  flex-shrink: 0;
}

.branch-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
}
.branch-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  transition: border-color 0.15s ease;
}
.branch-card.current {
  border-color: var(--accent, #0ea5e9);
  background: rgba(14, 165, 233, 0.05);
}
.branch-card-info strong {
  font-size: 1.05rem;
  display: block;
  margin-bottom: 4px;
}

/* Pricing Showcase & Marketing Cards */
.showcase-pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
  margin-top: 24px;
}
.pricing-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  box-sizing: border-box;
}
.pricing-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent, #0ea5e9);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.12);
}
.pricing-card.popular {
  border: 2px solid var(--accent, #0ea5e9);
  box-shadow: 0 10px 30px rgba(14, 165, 233, 0.18);
}
.popular-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent, #0ea5e9);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  padding: 4px 14px;
  border-radius: 9999px;
  box-shadow: 0 2px 8px rgba(14, 165, 233, 0.4);
}
.pricing-plan {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}
.pricing-price {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--accent, #0ea5e9);
  line-height: 1.1;
  margin-bottom: 12px;
  font-variant-numeric: tabular-nums;
}
.pricing-price small {
  font-size: 1rem;
  font-weight: 500;
  color: var(--muted);
}
.pricing-sub {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.45;
  margin: 0 0 20px;
  min-height: 48px;
}
.pricing-features {
  list-style: none;
  padding: 0;
  margin: 0 0 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex-grow: 1;
}
.pricing-features li {
  font-size: 0.9rem;
  line-height: 1.4;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 10px;
}
.pricing-features li > .icon {
  width: 16px;
  height: 16px;
  stroke: #10b981;
  flex-shrink: 0;
}
.pricing-card button {
  width: 100%;
  justify-content: center;
  margin-top: auto;
}

.agency-banner {
  margin-top: 40px;
  padding: 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}
.agency-banner h3 {
  margin: 0 0 8px;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
}
.agency-contact-row {
  display: flex;
  gap: 20px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 12px;
}
.agency-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--accent, #0ea5e9);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
}
.agency-link .icon {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  flex-shrink: 0;
}
.agency-link:hover {
  text-decoration: underline;
}

/* Innovera IT & Hospital Tenant Branding Logos */
.innovera-topbar-logo {
  height: 40px !important;
  max-height: 40px !important;
  width: auto !important;
  max-width: 48px !important;
  object-fit: contain !important;
  display: inline-block !important;
  flex-shrink: 0 !important;
}

.innovera-login-logo {
  height: 64px !important;
  max-height: 64px !important;
  width: auto !important;
  max-width: 220px !important;
  object-fit: contain !important;
  display: block !important;
  margin: 0 auto 8px auto !important;
}

.hospital-sidebar-logo {
  height: 36px !important;
  max-height: 36px !important;
  width: auto !important;
  max-width: 140px !important;
  object-fit: contain !important;
  display: inline-block !important;
  flex-shrink: 0 !important;
}

.hospital-preview-logo {
  height: 56px !important;
  max-height: 56px !important;
  width: auto !important;
  max-width: 180px !important;
  object-fit: contain !important;
  display: block !important;
  background: var(--surface-hover, rgba(0, 0, 0, 0.02));
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 6px;
  padding: 4px 8px;
}

.hospital-table-logo {
  height: 28px !important;
  max-height: 28px !important;
  width: auto !important;
  max-width: 60px !important;
  object-fit: contain !important;
  display: inline-block !important;
  vertical-align: middle !important;
  border-radius: 4px;
}

.hospital-print-logo {
  height: 48px !important;
  max-height: 48px !important;
  width: auto !important;
  max-width: 140px !important;
  object-fit: contain !important;
  display: block !important;
}

.topbar-brand {
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
  min-width: 0 !important;
}

.topbar-brand .brand-text {
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
  line-height: 1.2 !important;
}

.topbar-brand .brand-header-row {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
}

.topbar-brand .brand-title {
  font-weight: 700 !important;
  font-size: 16px !important;
  letter-spacing: -0.2px !important;
  color: var(--ink, currentColor) !important;
}

/* =====================================================================
   Innovera IT SaaS Fleet Hub UI (Clean, Strict CSP Compliant)
   ===================================================================== */

/* Single clean Fleet Hub entry in Hospital Login */
.auth-agency-aside {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
}

.auth-agency-label {
  margin-bottom: 8px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: rgba(255, 255, 255, 0.7);
}

.auth-agency-btn {
  background: rgba(255, 255, 255, 0.08) !important;
  border: 1px solid rgba(255, 255, 255, 0.22) !important;
  width: 100% !important;
  justify-content: flex-start !important;
  color: #ffffff !important;
  padding: 10px 14px !important;
  border-radius: 8px !important;
  font-size: 13.5px !important;
  font-weight: 500 !important;
  box-shadow: none !important;
  backdrop-filter: blur(4px);
  transition: all 0.15s ease-in-out !important;
}

.auth-agency-btn:hover {
  background: rgba(255, 255, 255, 0.18) !important;
  border-color: rgba(255, 255, 255, 0.45) !important;
  color: #ffffff !important;
}

.auth-agency-btn .icon {
  color: #38bdf8 !important;
}

/* Agency Login Shell & Card */
.agency-login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--canvas);
}

.agency-login-card {
  width: 100%;
  max-width: 440px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.agency-login-header {
  text-align: center;
  padding: 32px 28px 24px;
  border-bottom: 1px solid var(--line);
}

.agency-login-brand-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 8px;
}

.agency-login-title {
  font-size: 22px;
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.3px;
  color: var(--ink);
}

.agency-login-subtitle {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.8px;
  text-transform: uppercase;
  margin-top: 4px;
}

.agency-login-desc {
  color: var(--muted);
  font-size: 13px;
  margin: 10px 0 0 0;
  line-height: 1.4;
}

.agency-login-body {
  padding: 28px;
}

.agency-login-body .field {
  margin-bottom: 16px;
}

.agency-login-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 24px;
}

.agency-login-actions .btn {
  width: 100%;
  justify-content: center;
  text-align: center;
  text-decoration: none;
}

.agency-login-footer {
  text-align: center;
  padding: 16px 24px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--muted);
  background: var(--surface-alt);
}

/* Agency Dashboard Views */
.agency-content {
  max-width: 1240px;
  margin: 0 auto;
  padding: 32px 24px 64px;
}

.agency-hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 28px;
}

.agency-hero-left {
  flex: 1;
  min-width: 280px;
}

.agency-hero-title {
  margin: 0 0 6px 0;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.3px;
  color: var(--ink);
}

.agency-hero-desc {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.agency-hero-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.agency-kpi-grid {
  margin-bottom: 36px;
}

.agency-section {
  margin-bottom: 40px;
}

.agency-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.agency-section-title {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: var(--ink);
}

.agency-client-cell {
  display: flex;
  align-items: center;
  gap: 12px;
}

.agency-client-empty-icon {
  width: 42px;
  height: 42px;
  border-radius: 6px;
  border: 1px dashed var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  opacity: 0.7;
  flex-shrink: 0;
}

.agency-client-info strong {
  display: block;
  font-size: 14px;
  color: var(--ink);
}

.agency-preview-box {
  text-align: center;
  margin-bottom: 20px;
  padding: 16px;
  background: var(--surface-alt);
  border: 1px dashed var(--line);
  border-radius: 8px;
}

.agency-footer-block {
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid var(--line);
}

/* =====================================================================
   Dental Odontogram 16-Column Adult Matrix
   ===================================================================== */
.odontogram-card {
  padding: 24px;
  margin-bottom: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.odontogram-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 0;
  margin-bottom: 6px;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--ink);
}
.odontogram-grid-wrapper {
  overflow-x: auto;
  padding: 14px 0;
  -webkit-overflow-scrolling: touch;
}
.odontogram-row {
  display: grid !important;
  grid-template-columns: repeat(16, minmax(44px, 1fr)) !important;
  gap: 6px !important;
  text-align: center;
  margin-bottom: 12px !important;
  min-width: 720px;
}
.odontogram-tooth {
  border-radius: 6px;
  padding: 8px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  user-select: none;
  cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.15s ease;
}
.odontogram-tooth:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}
.odontogram-tooth.upper {
  background: rgba(59, 130, 246, 0.12);
  border: 1.5px solid #3b82f6;
  color: #1d4ed8;
}
[data-theme="dark"] .odontogram-tooth.upper {
  background: rgba(59, 130, 246, 0.2);
  color: #93c5fd;
  border-color: #60a5fa;
}
.odontogram-tooth.lower {
  background: rgba(16, 185, 129, 0.12);
  border: 1.5px solid #10b981;
  color: #047857;
}
[data-theme="dark"] .odontogram-tooth.lower {
  background: rgba(16, 185, 129, 0.2);
  color: #6ee7b7;
  border-color: #34d399;
}
.odontogram-arch-label {
  font-size: 9px;
  text-transform: uppercase;
  font-weight: 600;
  opacity: 0.75;
  line-height: 1;
}
.odontogram-number {
  font-size: 14px;
  font-weight: 800;
  line-height: 1.2;
}

/* Tooth Conditions */
.odontogram-tooth.caries {
  background: rgba(239, 68, 68, 0.16) !important;
  border-color: #ef4444 !important;
  color: #dc2626 !important;
}
[data-theme="dark"] .odontogram-tooth.caries {
  background: rgba(239, 68, 68, 0.3) !important;
  color: #fca5a5 !important;
}
.odontogram-tooth.filled {
  background: rgba(59, 130, 246, 0.18) !important;
  border-color: #3b82f6 !important;
  color: #1d4ed8 !important;
}
[data-theme="dark"] .odontogram-tooth.filled {
  background: rgba(59, 130, 246, 0.3) !important;
  color: #93c5fd !important;
}
.odontogram-tooth.crown {
  background: rgba(245, 158, 11, 0.18) !important;
  border-color: #f59e0b !important;
  color: #b45309 !important;
}
[data-theme="dark"] .odontogram-tooth.crown {
  background: rgba(245, 158, 11, 0.3) !important;
  color: #fde68a !important;
}
.odontogram-tooth.rct {
  background: rgba(168, 85, 247, 0.18) !important;
  border-color: #a855f7 !important;
  color: #7e22ce !important;
}
[data-theme="dark"] .odontogram-tooth.rct {
  background: rgba(168, 85, 247, 0.3) !important;
  color: #d8b4fe !important;
}
.odontogram-tooth.missing {
  background: rgba(100, 116, 139, 0.15) !important;
  border-color: #94a3b8 !important;
  color: #64748b !important;
  text-decoration: line-through;
  opacity: 0.7;
}
.odontogram-tooth.implant {
  background: rgba(20, 184, 166, 0.18) !important;
  border-color: #14b8a6 !important;
  color: #0f766e !important;
}
[data-theme="dark"] .odontogram-tooth.implant {
  background: rgba(20, 184, 166, 0.3) !important;
  color: #5eead4 !important;
}

.odontogram-surface-tag {
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.5px;
  background: rgba(0, 0, 0, 0.1);
  padding: 1px 4px;
  border-radius: 2px;
  line-height: 1;
}

.odontogram-dmft-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--surface-alt);
  padding: 10px 16px;
  border-radius: 8px;
  margin: 12px 0 16px;
  border: 1px solid var(--border);
}
.dmft-stats {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 13px;
  font-weight: 600;
}
.dmft-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.dmft-badge-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
}




