:root {
  --ink: #17231f;
  --ink-soft: #5f6d67;
  --paper: #ffffff;
  --canvas: #f2f5f2;
  --line: #dbe2dd;
  --line-strong: #c5d0ca;
  --green-900: #123f38;
  --green-800: #17534a;
  --green-700: #176b5c;
  --green-100: #e2f1eb;
  --green-50: #f0f8f4;
  --coral: #c96849;
  --coral-50: #fcf1ed;
  --blue: #356e91;
  --blue-50: #edf5fa;
  --warning: #9b6b1f;
  --danger: #b9443e;
  --shadow: 0 8px 30px rgba(22, 54, 45, 0.08);
  --radius: 8px;
  color-scheme: light;
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans SC", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--canvas);
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background:
    linear-gradient(rgba(23, 83, 74, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(23, 83, 74, 0.025) 1px, transparent 1px),
    var(--canvas);
  background-size: 32px 32px;
  font-size: 14px;
  line-height: 1.5;
}

button,
input,
select {
  font: inherit;
}

button {
  color: inherit;
}

button,
select {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

svg {
  display: block;
}

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

.app-shell {
  width: min(1520px, calc(100% - 48px));
  margin: 0 auto;
}

.topbar {
  position: relative;
  z-index: 5;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
}

.topbar::before {
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: linear-gradient(90deg, var(--green-800) 0 68%, var(--coral) 68% 82%, var(--blue) 82%);
  content: "";
}

.topbar-inner {
  min-height: 82px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-top: 4px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 13px;
  min-width: 0;
}

.brand-mark {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  display: grid;
  place-items: center;
  color: white;
  border-radius: var(--radius);
  background: var(--green-800);
  box-shadow: 0 5px 16px rgba(18, 63, 56, 0.18);
}

.brand-mark svg {
  width: 23px;
  height: 23px;
  stroke-width: 2.2;
}

.brand h1 {
  margin: 0;
  font-size: 21px;
  line-height: 1.25;
  font-weight: 700;
}

.brand p {
  margin: 3px 0 0;
  color: var(--ink-soft);
  font-size: 12px;
}

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

.save-state {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 11px;
  color: var(--green-800);
  border: 1px solid #c7ddd4;
  border-radius: 999px;
  background: var(--green-50);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.save-state svg {
  width: 15px;
  height: 15px;
}

main.app-shell {
  padding-top: 20px;
  padding-bottom: 40px;
}

.summary-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: 0 4px 20px rgba(22, 54, 45, 0.04);
}

.summary-item {
  position: relative;
  min-height: 72px;
  display: flex;
  align-items: baseline;
  gap: 0;
  padding: 17px 22px;
}

.summary-item + .summary-item::before {
  position: absolute;
  inset: 18px auto 18px 0;
  width: 1px;
  background: var(--line);
  content: "";
}

.summary-label {
  align-self: center;
  width: 68px;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 600;
}

.summary-item strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 30px;
  line-height: 1;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.summary-unit {
  margin-left: 5px;
  color: var(--ink-soft);
  font-size: 12px;
}

.workbench {
  display: grid;
  grid-template-columns: minmax(370px, 420px) minmax(0, 1fr);
  align-items: start;
  gap: 18px;
}

.entry-panel,
.records-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: var(--shadow);
}

.entry-panel {
  position: sticky;
  top: 16px;
  max-height: calc(100vh - 32px);
  overflow: auto;
  scrollbar-color: #bdcac3 transparent;
  scrollbar-width: thin;
}

.panel-heading,
.records-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.panel-heading {
  position: sticky;
  top: 0;
  z-index: 3;
  min-height: 75px;
  padding: 17px 20px 14px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(10px);
}

.section-kicker {
  margin: 0 0 3px;
  color: var(--green-700);
  font-size: 11px;
  font-weight: 700;
}

h2 {
  margin: 0;
  font-size: 18px;
  line-height: 1.3;
}

.icon-button {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  color: var(--ink-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
  transition: border-color 150ms ease, color 150ms ease, background 150ms ease;
}

.icon-button:hover {
  color: var(--green-800);
  border-color: #a9bdb4;
  background: var(--green-50);
}

.icon-button svg {
  width: 17px;
  height: 17px;
}

form#recordForm {
  padding-bottom: 18px;
}

.form-section {
  padding: 18px 20px;
  border-bottom: 1px solid #e7ece9;
}

.form-section:last-of-type {
  border-bottom: 0;
}

.field-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 0.85fr);
  gap: 12px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-top: 13px;
}

.field:first-child {
  margin-top: 0;
}

.field-wide {
  min-width: 0;
}

.field-label {
  color: #35453f;
  font-size: 12px;
  font-weight: 700;
}

input,
select {
  width: 100%;
  height: 41px;
  padding: 0 11px;
  color: var(--ink);
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  outline: 0;
  background: #fff;
  transition: border-color 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

textarea {
  width: 100%;
  min-height: 76px;
  resize: vertical;
  padding: 10px 11px;
  color: var(--ink);
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  outline: 0;
  background: #fff;
  font: inherit;
  line-height: 1.5;
  transition: border-color 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

textarea:focus {
  border-color: var(--green-700);
  box-shadow: 0 0 0 3px rgba(23, 107, 92, 0.12);
}

input::placeholder {
  color: #9ba6a1;
}

input:hover,
select:hover {
  border-color: #aab9b2;
}

input:focus,
select:focus {
  border-color: var(--green-700);
  box-shadow: 0 0 0 3px rgba(23, 107, 92, 0.12);
}

input.is-invalid,
select.is-invalid {
  border-color: var(--danger);
  background: #fff9f8;
}

.segmented.is-invalid,
.choice-grid.is-invalid {
  padding: 5px;
  border: 1px solid var(--danger);
  border-radius: 7px;
  background: #fff9f8;
}

.location-dimensions.is-invalid {
  padding: 6px;
  border: 1px solid var(--danger);
  border-radius: 7px;
  background: #fff9f8;
}

.segmented {
  height: 41px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: #f4f7f5;
}

.segmented button {
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 600;
}

.segmented button:hover {
  color: var(--green-800);
}

.segmented button[aria-pressed="true"] {
  color: var(--green-800);
  background: white;
  box-shadow: 0 1px 5px rgba(28, 59, 49, 0.13);
}

.autofill-note {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 13px 0 0;
  color: var(--blue);
  font-size: 11px;
}

.autofill-note svg {
  width: 14px;
  height: 14px;
}

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

.section-heading p {
  margin: 2px 0 0;
  color: var(--ink-soft);
  font-size: 11px;
}

.field-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 14px 0 10px;
}

.text-button {
  padding: 2px;
  color: var(--green-700);
  border: 0;
  background: transparent;
  font-size: 11px;
  font-weight: 600;
}

.text-button:hover {
  color: var(--green-900);
  text-decoration: underline;
}

.choice-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.choice-chip,
.location-chip,
.selected-tag {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 5px 10px;
  line-height: 1.2;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  font-size: 12px;
  transition: border-color 150ms ease, background 150ms ease, color 150ms ease, transform 100ms ease;
}

.choice-chip:hover,
.location-chip:hover {
  border-color: #9eb6ab;
  transform: translateY(-1px);
}

.choice-chip[aria-pressed="true"],
.location-chip[aria-pressed="true"] {
  color: var(--green-800);
  border-color: #9cc9b9;
  background: var(--green-100);
  font-weight: 700;
}

.choice-chip[aria-pressed="true"]::before,
.location-chip[aria-pressed="true"]::before {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green-700);
  content: "";
}

.inline-add {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 7px;
  margin-top: 9px;
}

.inline-add input {
  height: 35px;
  font-size: 12px;
}

.button {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  transition: background 150ms ease, border-color 150ms ease, color 150ms ease, transform 100ms ease, box-shadow 150ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button:active {
  transform: translateY(0);
}

.button svg {
  width: 16px;
  height: 16px;
}

.button-primary {
  color: white;
  background: var(--green-800);
  box-shadow: 0 4px 12px rgba(18, 63, 56, 0.16);
}

.button-primary:hover {
  background: var(--green-900);
}

.button-secondary {
  color: var(--ink);
  border-color: var(--line-strong);
  background: white;
}

.button-secondary:hover {
  color: var(--green-800);
  border-color: #9eb5aa;
  background: var(--green-50);
}

.button-quiet {
  min-height: 35px;
  padding: 0 12px;
  color: var(--green-800);
  border-color: #c8dcd3;
  background: var(--green-50);
  font-size: 12px;
}

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

.button-submit {
  flex: 1;
  min-height: 46px;
  font-size: 14px;
}

.location-dimensions {
  display: grid;
  gap: 13px;
}

.location-dimensions .choice-grid {
  gap: 6px;
}

.location-group-heading {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 7px;
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 700;
}

.location-group-heading::after {
  height: 1px;
  flex: 1;
  background: #edf0ee;
  content: "";
}

.location-chip {
  min-height: 29px;
  padding: 4px 9px;
  font-size: 11px;
}

.selected-summary {
  min-height: 32px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 9px;
  padding: 6px 8px;
  border: 1px dashed #c9d7d0;
  border-radius: 7px;
  background: #f9fbfa;
}

.selected-placeholder {
  color: #8b9892;
  font-size: 11px;
}

.selected-tag {
  min-height: 24px;
  padding: 3px 8px;
  color: var(--green-800);
  border-color: #bfd8cd;
  background: white;
  font-size: 10px;
  font-weight: 600;
}

.selected-tag button {
  width: 16px;
  height: 16px;
  display: grid;
  place-items: center;
  padding: 0;
  color: var(--ink-soft);
  border: 0;
  border-radius: 50%;
  background: transparent;
}

.selected-tag button:hover {
  color: var(--danger);
  background: var(--coral-50);
}

.selected-tag svg {
  width: 12px;
  height: 12px;
}

.form-actions {
  display: flex;
  gap: 8px;
  padding: 17px 20px 2px;
}

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

.records-heading {
  min-height: 85px;
  padding: 19px 22px 17px;
  border-bottom: 1px solid var(--line);
}

.records-heading-actions {
  display: flex;
  gap: 8px;
}

.table-toolbar {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 13px 16px;
  border-bottom: 1px solid #e8edea;
  background: #fbfcfb;
}

.search-box {
  position: relative;
  min-width: 210px;
  flex: 1;
}

.search-box svg {
  position: absolute;
  top: 50%;
  left: 12px;
  width: 16px;
  height: 16px;
  color: #7d8b85;
  transform: translateY(-50%);
  pointer-events: none;
}

.search-box input {
  height: 38px;
  padding-left: 36px;
  background: white;
  font-size: 12px;
}

.toolbar-field {
  height: 38px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding-left: 10px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: white;
}

.toolbar-field span {
  color: var(--ink-soft);
  font-size: 11px;
  white-space: nowrap;
}

.toolbar-field select {
  width: auto;
  height: 36px;
  min-width: 82px;
  padding: 0 28px 0 2px;
  border: 0;
  background: transparent;
  font-size: 12px;
  font-weight: 600;
  box-shadow: none;
}

.table-toolbar .icon-button {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
}

.table-meta {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 9px 18px;
  color: var(--ink-soft);
  border-bottom: 1px solid #edf1ee;
  font-size: 11px;
}

.table-scroll {
  position: relative;
  overflow: auto;
  max-height: calc(100vh - 250px);
  min-height: 370px;
  scrollbar-color: #b8c5bf #f6f8f7;
  scrollbar-width: thin;
}

table {
  width: 100%;
  min-width: 1360px;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 12px;
}

th,
td {
  padding: 11px 12px;
  text-align: left;
  vertical-align: middle;
  border-bottom: 1px solid #e8edea;
}

th {
  position: sticky;
  top: 0;
  z-index: 2;
  color: #53615b;
  background: #f4f7f5;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

tbody tr {
  background: white;
  transition: background 120ms ease;
}

tbody tr:hover {
  background: #f8fbf9;
}

tbody tr:last-child td {
  border-bottom: 0;
}

td {
  color: #2c3934;
}

.col-sequence {
  width: 54px;
}

.col-date {
  width: 105px;
  white-space: nowrap;
}

.col-name {
  width: 90px;
  font-weight: 700;
  white-space: nowrap;
}

.col-gender {
  width: 52px;
}

.col-admission {
  width: 105px;
  white-space: nowrap;
}

.col-doctor {
  width: 110px;
}

.col-treatment {
  width: 135px;
}

.col-guidance {
  width: 105px;
}

.col-location {
  width: 160px;
}

.col-complications {
  width: 190px;
  color: var(--ink-soft);
  overflow-wrap: anywhere;
}

.col-submitted {
  width: 132px;
  color: var(--ink-soft);
  font-size: 10px;
  white-space: nowrap;
}

.col-actions {
  width: 74px;
  text-align: right;
}

.cell-muted {
  color: var(--ink-soft);
  font-size: 11px;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 7px;
  color: var(--blue);
  border: 1px solid #cfe1eb;
  border-radius: 999px;
  background: var(--blue-50);
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.data-tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 7px;
  color: #33463e;
  border-radius: 5px;
  background: #eef3f0;
  font-size: 10px;
  white-space: nowrap;
}

.data-tag.treatment {
  color: #76503d;
  background: var(--coral-50);
}

.row-actions {
  display: flex;
  justify-content: flex-end;
  gap: 4px;
}

.row-action {
  width: 30px;
  height: 30px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  color: #74817b;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
}

.row-action:hover {
  color: var(--green-800);
  border-color: var(--line);
  background: white;
}

.row-action.danger:hover {
  color: var(--danger);
  border-color: #edd0cd;
  background: #fff7f6;
}

.row-action svg {
  width: 14px;
  height: 14px;
}

.empty-state {
  position: sticky;
  left: 0;
  min-height: 300px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--ink-soft);
  text-align: center;
}

.empty-state svg {
  width: 38px;
  height: 38px;
  margin-bottom: 10px;
  color: #91a29a;
}

.empty-state strong {
  color: #4d5b55;
  font-size: 14px;
}

.empty-state span {
  margin-top: 3px;
  font-size: 11px;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 50;
  min-height: 46px;
  display: flex;
  align-items: center;
  gap: 9px;
  max-width: min(360px, calc(100vw - 32px));
  padding: 10px 14px;
  color: white;
  border-radius: var(--radius);
  background: #1d3d34;
  box-shadow: 0 10px 30px rgba(11, 35, 28, 0.26);
  font-size: 12px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.toast svg {
  width: 17px;
  height: 17px;
  flex: 0 0 17px;
}

.confirm-dialog {
  width: min(390px, calc(100vw - 32px));
  padding: 0;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
  box-shadow: 0 24px 70px rgba(17, 40, 34, 0.28);
}

.confirm-dialog::backdrop {
  background: rgba(19, 31, 27, 0.45);
  backdrop-filter: blur(2px);
}

.confirm-dialog form {
  padding: 25px;
  text-align: center;
}

.dialog-icon {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  margin: 0 auto 13px;
  color: var(--danger);
  border-radius: 50%;
  background: #fff0ef;
}

.dialog-icon svg {
  width: 21px;
  height: 21px;
}

.confirm-dialog h2 {
  font-size: 18px;
}

.confirm-dialog p {
  margin: 8px 0 20px;
  color: var(--ink-soft);
  font-size: 12px;
}

.export-dialog {
  width: min(500px, calc(100vw - 32px));
  padding: 0;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
  box-shadow: 0 24px 70px rgba(17, 40, 34, 0.28);
}

.export-dialog::backdrop {
  background: rgba(19, 31, 27, 0.45);
  backdrop-filter: blur(2px);
}

.export-dialog-content {
  padding: 22px;
}

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

.quick-range {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 5px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f3f6f4;
}

.quick-range button {
  min-height: 34px;
  color: var(--ink-soft);
  border: 0;
  border-radius: 5px;
  background: transparent;
  font-size: 12px;
  font-weight: 600;
}

.quick-range button:hover,
.quick-range button[aria-pressed="true"] {
  color: var(--green-800);
  background: white;
  box-shadow: 0 1px 5px rgba(28, 59, 49, 0.12);
}

.date-range-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 18px 0 14px;
}

.date-range-grid .field {
  margin-top: 0;
}

.export-preview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 42px;
  margin-bottom: 16px;
  padding: 8px 11px;
  color: var(--green-800);
  border-radius: 7px;
  background: var(--green-50);
  font-size: 12px;
  font-weight: 700;
}

#exportRangeLabel {
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 500;
}

.dialog-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}

.print-heading {
  display: none;
}

@media (max-width: 1080px) {
  .workbench {
    grid-template-columns: minmax(340px, 390px) minmax(0, 1fr);
  }

  .summary-item {
    padding-inline: 16px;
  }

  .summary-label {
    width: 56px;
  }

  .toolbar-field span {
    display: none;
  }

  .table-toolbar {
    flex-wrap: wrap;
  }

  .search-box {
    flex-basis: 100%;
  }
}

@media (max-width: 820px) {
  .app-shell {
    width: min(100% - 28px, 760px);
  }

  .topbar-inner {
    align-items: flex-start;
    padding: 15px 0;
  }

  .topbar-actions {
    align-items: flex-end;
    flex-direction: column-reverse;
    gap: 6px;
  }

  .save-state {
    min-height: auto;
    padding: 0;
    border: 0;
    background: transparent;
    font-size: 10px;
  }

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

  .summary-item:nth-child(3)::before {
    display: none;
  }

  .summary-item:nth-child(n+3) {
    border-top: 1px solid var(--line);
  }

  .workbench {
    display: block;
  }

  .entry-panel {
    position: static;
    max-height: none;
  }

  .table-scroll {
    max-height: 62vh;
  }
}

@media (max-width: 560px) {
  .app-shell {
    width: calc(100% - 20px);
  }

  .topbar-inner {
    min-height: 74px;
    gap: 10px;
  }

  .brand-mark {
    width: 36px;
    height: 36px;
    flex-basis: 36px;
  }

  .brand h1 {
    font-size: 16px;
  }

  .brand p {
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .topbar-actions .button {
    min-height: 36px;
    padding: 0 10px;
    font-size: 11px;
  }

  .summary-item {
    min-height: 64px;
    padding: 14px 13px;
  }

  .summary-label {
    width: 52px;
    font-size: 11px;
  }

  .summary-item strong {
    font-size: 25px;
  }

  .panel-heading,
  .form-section {
    padding-inline: 15px;
  }

  .records-heading {
    align-items: flex-start;
    flex-direction: column;
    padding: 16px 15px;
  }

  .records-heading-actions {
    width: 100%;
  }

  .records-heading-actions .button {
    flex: 1;
  }

  .table-toolbar {
    padding: 11px;
  }

  .toolbar-field {
    flex: 1;
  }

  .toolbar-field select {
    width: 100%;
  }

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

  .date-range-grid {
    grid-template-columns: 1fr;
  }

  .form-actions {
    padding-inline: 15px;
  }

  .toast {
    right: 12px;
    bottom: 12px;
  }
}

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

  body {
    background: white;
    font-size: 9pt;
  }

  .topbar,
  .summary-strip,
  .entry-panel,
  .records-heading,
  .table-toolbar,
  .col-actions,
  .toast,
  .confirm-dialog,
  .export-dialog {
    display: none !important;
  }

  main.app-shell {
    width: 100%;
    padding: 0;
  }

  .workbench {
    display: block;
  }

  .records-panel {
    border: 0;
    box-shadow: none;
  }

  .print-heading {
    display: block;
    margin-bottom: 8mm;
    text-align: center;
  }

  .print-heading h1 {
    margin: 0;
    font-size: 18pt;
  }

  .print-heading p {
    margin: 2mm 0 0;
    color: #555;
    font-size: 9pt;
  }

  .table-meta {
    border: 0;
    padding: 0 0 2mm;
  }

  #printMeta {
    display: block;
  }

  .table-scroll {
    max-height: none;
    overflow: visible;
  }

  table {
    min-width: 0;
    width: 100%;
    page-break-inside: auto;
    font-size: 7.5pt;
  }

  tr {
    break-inside: avoid;
  }

  th,
  td {
    padding: 2mm 1.4mm;
    border: 1px solid #c9c9c9;
  }

  th {
    position: static;
    background: #eef1ef;
  }

  .col-sequence,
  .col-date,
  .col-name,
  .col-gender,
  .col-admission,
  .col-doctor,
  .col-treatment,
  .col-guidance,
  .col-location,
  .col-complications,
  .col-submitted,
  .col-actions {
    width: auto;
  }

  .tag-list {
    display: block;
  }

  .data-tag {
    padding: 0;
    background: transparent;
    white-space: normal;
  }

  .data-tag + .data-tag::before {
    content: " / ";
  }

  .empty-state {
    display: none !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
