:root {
  color-scheme: light;
  --ink: #18231f;
  --muted: #68756e;
  --line: #dbe3dd;
  --paper: #fbfcf9;
  --panel: #ffffff;
  --sage: #45675a;
  --teal: #167f7a;
  --coral: #c65c4a;
  --gold: #a97826;
  --wash: #eef5f1;
  --shadow: 0 18px 50px rgba(40, 61, 52, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.login-page {
  min-height: 100vh;
  background: linear-gradient(135deg, #f7fbf9 0%, #eef5f1 46%, #fbfcf9 100%);
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
}

.login-card {
  width: min(460px, 100%);
  display: grid;
  gap: 22px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.login-brand {
  color: var(--ink);
}

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

.login-back {
  display: inline-grid;
  place-items: center;
  text-decoration: none;
}

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

button {
  cursor: pointer;
}

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

.sidebar {
  background: #20372f;
  color: #f7fbf8;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

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

.brand-logo {
  width: 92px;
  height: auto;
  display: block;
  border-radius: 8px;
  background: #fff;
}

.login-brand {
  align-items: flex-start;
}

.login-brand .brand-logo {
  width: 128px;
}

.brand-mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #f6f0dc;
  color: #20372f;
  font-size: 24px;
  font-weight: 800;
}

.brand strong,
.brand span {
  display: block;
}

.brand span,
.sidebar-note {
  color: rgba(247, 251, 248, 0.72);
}

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

.nav-button {
  border: 1px solid transparent;
  background: transparent;
  color: inherit;
  text-align: left;
  padding: 12px 14px;
  border-radius: 8px;
}

.nav-button.active,
.nav-button:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.14);
}

.sidebar-note {
  margin-top: auto;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.16);
  font-size: 13px;
  line-height: 1.5;
}

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

.topbar,
.panel-heading,
.detail-head,
.report-toolbar,
menu {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.topbar {
  margin-bottom: 20px;
}

.app-footer {
  margin-top: 28px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

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

h1 {
  font-size: 32px;
  line-height: 1.1;
}

h2 {
  font-size: 18px;
}

h3 {
  font-size: 14px;
}

.eyebrow {
  margin-bottom: 6px;
  color: var(--teal);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

.user-chip {
  min-height: 40px;
  display: grid;
  align-content: center;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7fbf9;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.login-help {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.access-note {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff9f6;
  color: #6a473c;
}

.primary,
.secondary,
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 14px;
  min-height: 40px;
  color: var(--ink);
  background: var(--panel);
  text-decoration: none;
}

.primary {
  border-color: #245b51;
  background: #245b51;
  color: white;
  font-weight: 700;
}

.secondary:hover,
.primary:hover {
  filter: brightness(0.97);
}

.small {
  min-height: 32px;
  padding: 6px 10px;
}

.icon-button {
  width: 36px;
  padding: 0;
  font-size: 22px;
}

.filters {
  display: grid;
  grid-template-columns: minmax(220px, 2fr) repeat(4, minmax(150px, 1fr)) auto;
  gap: 12px;
  align-items: end;
  margin-bottom: 20px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 6px 24px rgba(40, 61, 52, 0.05);
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

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

input:focus,
select:focus,
textarea:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(22, 127, 122, 0.12);
}

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

.view {
  display: none;
}

.view.active {
  display: block;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.kpi,
.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 6px 24px rgba(40, 61, 52, 0.05);
}

.kpi {
  padding: 16px;
}

button.kpi {
  width: 100%;
  color: inherit;
  text-align: left;
  font: inherit;
  cursor: pointer;
}

button.kpi:hover {
  border-color: rgba(22, 127, 122, 0.42);
  transform: translateY(-1px);
}

button.kpi:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 3px;
}

.kpi span,
.kpi small,
.panel-heading span,
td span,
.detail-head span,
.activity-item span,
.activity-item small,
.followup-card span,
.followup-card small {
  color: var(--muted);
}

.kpi strong {
  display: block;
  margin: 8px 0 4px;
  font-size: 30px;
  line-height: 1;
}

.dashboard-mode-row {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-bottom: 14px;
}

.dashboard-mode-row .active {
  border-color: rgba(22, 127, 122, 0.6);
  background: #f4fbf8;
  color: #0f6662;
  font-weight: 800;
}

.today-schedule-panel {
  margin-bottom: 20px;
}

.schedule-kpis {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 14px;
}

.schedule-kpi strong {
  font-size: 26px;
}

.schedule-toolbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 14px;
}

.schedule-toolbar label {
  width: min(280px, 100%);
}

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

.doctor-planning-panel {
  margin-top: 20px;
}

.schedule-type-section {
  display: grid;
  gap: 10px;
}

.schedule-type-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px;
  border-radius: 8px;
  background: #eef5f1;
}

.schedule-type-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.schedule-table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

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

.schedule-table th {
  background: #dcefd4;
  color: #20372f;
}

.schedule-table td {
  background: #fff;
}

.schedule-table tbody tr:nth-child(odd) td {
  background: #fffef3;
}

.schedule-table tbody tr:hover td {
  background: #eef8f4;
}

.schedule-table td:nth-child(1),
.schedule-table td:nth-child(2) {
  white-space: nowrap;
}

.schedule-table td:nth-child(4),
.schedule-table td:nth-child(6),
.schedule-table td:nth-child(8),
.schedule-table td:nth-child(9) {
  min-width: 150px;
}

.schedule-status-select {
  min-width: 190px;
  padding: 7px 9px;
  font-size: 12px;
}

.reception-table textarea {
  min-height: 42px;
  height: 42px;
  min-width: 180px;
}

.reception-table .muted-cell > * {
  display: none;
}

.reception-table .muted-cell::after {
  content: "-";
  color: var(--muted);
  font-weight: 800;
}

.schedule-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 210px;
}

.schedule-item {
  width: 100%;
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fff;
  color: var(--ink);
  text-align: left;
}

.schedule-item:hover {
  border-color: rgba(22, 127, 122, 0.45);
  background: #f7fbf9;
}

.schedule-item time {
  display: grid;
  place-items: center;
  min-height: 44px;
  border-radius: 8px;
  background: var(--wash);
  color: #245b51;
  font-weight: 900;
}

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

.schedule-item span,
.schedule-item small {
  color: var(--muted);
}

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

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

.brand-settings {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.logo-preview {
  width: 108px;
  height: 108px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f6f0dc;
  color: #20372f;
  font-size: 48px;
  font-weight: 800;
}

.logo-preview img,
.brand-mark img,
.print-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.button-row {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.compact-actions {
  align-items: center;
  margin-top: 0;
}

.status-pill {
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 7px 10px;
}

.settings-list {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.settings-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfb;
}

.settings-item span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.large-textarea {
  min-height: 160px;
}

.template-editor {
  min-height: 260px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  line-height: 1.5;
}

.storage-grid {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}

.storage-grid div {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfb;
}

.storage-grid span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.print-report-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}

.print-logo {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid #dce5df;
  border-radius: 8px;
  background: #f6f0dc;
  color: #20372f;
  font-size: 26px;
  font-weight: 800;
  flex: 0 0 auto;
}

.pdf-steps,
.followup-types {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.step-card {
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: var(--panel);
  color: var(--ink);
  text-align: left;
  box-shadow: 0 6px 24px rgba(40, 61, 52, 0.05);
}

.step-card span,
.step-card small {
  color: var(--muted);
}

.step-card strong {
  font-size: 15px;
}

.step-card.active {
  border-color: rgba(22, 127, 122, 0.6);
  background: #f4fbf8;
  box-shadow: inset 0 0 0 1px rgba(22, 127, 122, 0.16);
}

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

.wide {
  grid-column: 1 / -1;
}

.panel-heading {
  margin-bottom: 16px;
}

.bar-list,
.activity-list,
.followup-list,
.call-slots {
  display: grid;
  gap: 10px;
}

.bar-row {
  display: block;
}

button.bar-row {
  width: 100%;
  border: 0;
  padding: 0;
  color: inherit;
  background: transparent;
  text-align: left;
  font: inherit;
  cursor: pointer;
}

button.bar-row:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 4px;
}

button.bar-row:hover .bar-label span {
  color: var(--teal);
}

button.bar-row:hover .bar-track {
  background: #e7f1ed;
}

.bar-label {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
  font-size: 13px;
}

.bar-track {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--wash);
}

.bar-track div {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--teal), var(--gold));
}

.activity-item,
.followup-card {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fff;
  text-align: left;
}

.activity-item:hover,
.followup-card:hover,
.followup-card.selected {
  border-color: rgba(22, 127, 122, 0.45);
  background: #f7fbf9;
}

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

.split {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(380px, 0.8fr);
  gap: 20px;
  align-items: start;
}

.table-panel,
.detail-panel {
  min-height: 560px;
}

.table-wrap {
  overflow: auto;
  max-height: 68vh;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.compact {
  max-height: 70vh;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f5f8f4;
  color: #4f6258;
  text-align: left;
  font-size: 12px;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 12px;
  vertical-align: top;
}

tbody tr {
  cursor: pointer;
}

tbody tr:hover,
tbody tr.selected {
  background: #f7fbf9;
}

td strong,
td span {
  display: block;
}

.detail-head {
  align-items: flex-start;
  margin-bottom: 18px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.report-detail-head {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.report-detail-head > div:first-child {
  justify-self: start;
}

.report-detail-head .compact-actions {
  justify-self: end;
}

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

.detail-grid div {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfb;
}

.detail-grid span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.detail-grid strong {
  font-size: 13px;
  word-break: break-word;
}

.remarks-block {
  margin-top: 16px;
  padding: 14px;
  border-left: 4px solid var(--coral);
  background: #fff9f6;
  border-radius: 0 8px 8px 0;
}

.remarks-block h3 {
  margin-bottom: 8px;
}

.remarks-block p {
  color: #5d493f;
  line-height: 1.55;
}

.folder-link {
  display: inline-block;
  margin-top: 14px;
  color: var(--teal);
  font-weight: 800;
}

.disabled-link {
  opacity: 0.45;
  pointer-events: none;
}

.call-slot {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fbfdfb;
}

.call-slot h3 {
  margin-bottom: 12px;
}

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

.call-slot-head h3 {
  margin-bottom: 0;
}

.appointment-manager {
  display: grid;
  gap: 12px;
  padding: 0 14px 14px;
}

.appointment-card {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfb;
}

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

.appointment-card textarea {
  min-height: 48px;
}

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

.patient-flow {
  display: grid;
  gap: 10px;
  max-height: 68vh;
  overflow: auto;
  padding-right: 4px;
}

.patient-flow details {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfb;
}

.patient-flow summary {
  cursor: pointer;
  padding: 13px 14px;
  color: var(--ink);
  font-weight: 800;
}

.update-status-card {
  display: grid;
  grid-template-columns: 1fr minmax(220px, 280px);
  gap: 16px;
  align-items: end;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7fbf9;
  padding: 14px;
}

.update-status-card span,
.update-status-card strong {
  display: block;
}

.update-status-card span {
  color: var(--teal);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.update-status-card strong {
  margin-top: 4px;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.35;
}

.patient-flow details .form-grid {
  padding: 0 14px 14px;
}

#patient-modal .patient-flow details .form-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

#patient-modal .address-field {
  grid-column: span 2;
}

#patient-modal .address-field textarea {
  min-height: 42px;
  height: 42px;
}

.form-grid.tight {
  gap: 10px;
}

.check-field {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px 12px;
}

.check-field legend {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  padding: 0 6px;
}

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

.check-option {
  align-items: center;
  display: flex;
  flex-direction: row;
  gap: 7px;
  font-size: 13px;
  font-weight: 700;
}

.check-option input {
  width: auto;
}

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

dialog {
  width: min(860px, calc(100vw - 28px));
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0;
  box-shadow: var(--shadow);
}

dialog::backdrop {
  background: rgba(18, 31, 26, 0.36);
}

.modal-form {
  padding: 20px;
}

menu {
  margin: 18px 0 0;
  padding: 0;
  justify-content: flex-end;
}

.report-dialog {
  width: min(980px, calc(100vw - 24px));
  max-height: 92vh;
  overflow: auto;
}

.report-toolbar {
  position: sticky;
  top: 0;
  z-index: 3;
  padding: 12px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.split-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.split-toolbar h2 {
  margin: 0;
}

.split-toolbar span {
  color: var(--muted);
  font-size: 13px;
}

.pipeline-dialog {
  max-height: 88vh;
  overflow: auto;
}

.dashboard-modal-filters {
  margin-bottom: 14px;
}

.printable-report {
  box-sizing: border-box;
  width: min(794px, 100%);
  margin: 0 auto;
  padding: 34px;
  background: #fff;
  color: #1f2924;
}

.printable-report header {
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 3px solid #245b51;
}

.printable-report header h1 {
  font-size: 26px;
}

.printable-report header p {
  margin: 6px 0;
  color: var(--muted);
}

.printable-report .letter-intro {
  margin-bottom: 18px;
  line-height: 1.6;
}

.printable-report section {
  margin-bottom: 18px;
}

.printable-report h3 {
  margin-bottom: 8px;
  color: #245b51;
  font-size: 15px;
}

.printable-report th {
  position: static;
  width: 34%;
  background: #f5f8f4;
}

.printable-report td,
.printable-report th {
  border: 1px solid #dce5df;
  padding: 9px 10px;
}

.printable-report footer {
  margin-top: 28px;
}

.clinical-doc-template {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 1040px;
  overflow: visible;
  background: #fff;
  font-family: "Times New Roman", Georgia, serif;
  color: #111;
}

.printable-report .clinical-doc-template {
  margin: -34px;
}

.clinical-letterhead {
  display: block;
  width: 100%;
  height: auto;
  margin-bottom: 6px;
}

.clinical-watermark {
  position: absolute;
  top: 330px;
  left: 50%;
  width: 290px;
  opacity: 0.08;
  transform: translateX(-50%);
  pointer-events: none;
}

.clinical-doc-body {
  position: relative;
  z-index: 1;
  padding: 0 34px 72px;
}

.clinical-date {
  margin: 0 0 8px;
  text-align: right;
}

.clinical-footer {
  position: relative;
  z-index: 2;
  display: block;
  width: 100%;
  height: auto;
  margin-top: auto;
}

.clinical-doc-template h1 {
  margin: 12px 0 14px;
  text-align: center;
  font-family: Arial, sans-serif;
  font-size: 18px;
  font-weight: 800;
  text-decoration: underline;
}

.clinical-doc-template h2 {
  margin: 14px 0 6px;
  font-family: Arial, sans-serif;
  font-size: 13px;
  font-weight: 800;
  text-decoration: underline;
}

.clinical-ref,
.clinical-line,
.clinical-paragraph {
  margin: 7px 0;
  font-size: 14px;
  line-height: 1.35;
}

.clinical-section {
  margin-bottom: 10px;
}

.clinical-section table {
  border-collapse: collapse;
  width: 100%;
  table-layout: fixed;
}

.clinical-section th,
.clinical-section td {
  border: 1px solid #111;
  padding: 6px 7px;
  font-size: 13px;
  line-height: 1.25;
  vertical-align: middle;
}

.clinical-section th {
  width: 28%;
  background: transparent;
  font-weight: 700;
  text-align: left;
}

.clinical-section td {
  width: 22%;
}

.clinical-signoff {
  margin-top: 22px;
  font-size: 14px;
  line-height: 1.35;
}

.clinical-signoff img {
  display: block;
  width: 145px;
  height: auto;
  margin: 22px 0 2px;
}

.referral-letter-page {
  padding-top: 18px;
}

.referral-letter-body {
  font-size: 16px;
  line-height: 1.65;
}

.clinical-page-break {
  margin-top: 28px;
  border-top: 1px dashed #c8d7d0;
  padding-top: 28px;
}

.signature-space {
  display: block;
  height: 42px;
}

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

.empty strong {
  overflow-wrap: anywhere;
}

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

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 4;
    padding: 14px 18px;
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
  }

  .nav {
    grid-auto-flow: column;
    overflow-x: auto;
  }

  .sidebar-note {
    display: none;
  }

  .filters,
  .kpi-grid,
  .schedule-kpis,
  .dashboard-grid,
  .admin-grid,
  .pdf-steps,
  .followup-types,
  .split {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 720px) {
  .main {
    padding: 18px;
  }

  .topbar,
  .panel-heading,
  .detail-head {
    align-items: stretch;
    flex-direction: column;
  }

  .kpi-grid,
  .schedule-kpis,
  .detail-grid,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-mode-row,
  .schedule-toolbar {
    justify-content: stretch;
  }

  .schedule-toolbar label {
    width: 100%;
  }

  .schedule-item {
    grid-template-columns: 1fr;
  }

  .schedule-item time {
    width: 92px;
  }

  #patient-modal .patient-flow details .form-grid {
    grid-template-columns: 1fr;
  }

  #patient-modal .address-field {
    grid-column: 1 / -1;
  }

  .update-status-card {
    grid-template-columns: 1fr;
  }

  .filters {
    padding: 12px;
  }

  h1 {
    font-size: 26px;
  }
}

@media print {
  @page {
    size: A4;
    margin: 10mm;
  }

  body {
    background: #fff;
  }

  .app-shell,
  .report-toolbar {
    display: none;
  }

  #report-modal {
    display: block;
    position: static;
    width: auto;
    max-height: none;
    border: 0;
    padding: 0;
    box-shadow: none;
    overflow: visible;
  }

  #report-modal::backdrop {
    display: none;
  }

  #printable-report {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
    box-shadow: none;
  }

  .clinical-doc-template {
    min-height: auto;
    overflow: visible;
  }

  .printable-report .clinical-doc-template {
    margin: 0;
  }

  .clinical-page-break {
    break-before: page;
    page-break-before: always;
    margin-top: 0;
    border-top: 0;
    padding-top: 0;
  }
}
