:root {
  --bg: #f8fafc;
  --cd: #fff;
  --tx: #0f172a;
  --mu: #64748b;
  --bd: #e2e8f0;
  --p: #033993;
  --hv: #f1f5f9;
  --g: linear-gradient(90deg, #033993, #7c3aed);
  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b1220;
    --cd: #131c2e;
    --tx: #e5e9f2;
    --mu: #94a3b8;
    --bd: #25324a;
    --hv: #1b2840;
  }
}
:root[data-theme="dark"] {
  --bg: #0b1220;
  --cd: #131c2e;
  --tx: #e5e9f2;
  --mu: #94a3b8;
  --bd: #25324a;
  --hv: #1b2840;
}
html {
  scroll-padding-top: env(safe-area-inset-top, 0px);
}
html,
body {
  height: 100%;
  margin: 0;
}
body {
  font:
    14px/1.45 Inter,
    "Noto Sans Khmer",
    system-ui,
    sans-serif;
  background: var(--bg);
  color: var(--tx);
}
* {
  box-sizing: border-box;
}
button,
input,
select {
  font: inherit;
  color: inherit;
}
.mu {
  color: var(--mu);
}
h1 {
  font-size: 24px;
  margin: 0;
}
p {
  margin: 2px 0 0;
}
#app {
  display: flex;
  height: 100%;
}
aside {
  width: 240px;
  flex: none;
  background: var(--cd);
  border-right: 1px solid var(--bd);
  display: flex;
  flex-direction: column;
  padding: 12px;
  overflow: hidden;
}
.logo {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 4px;
  font-weight: 700;
  font-size: 19px;
  color: var(--p);
  padding: 12px 12px 12px 4px;
  border-radius: 12px;
  box-shadow: 0 2px 8px #0001;
  margin-bottom: 10px;
}
.logo img {
  display: block;
  width: 64px;
  height: 54px;
  max-width: 64px;
  object-fit: contain;
  margin-left: 0;
  flex: none;
}
.logo-name {
  display: flex;
  flex-direction: column;
  min-width: 0;
  color: #1b396b;
  font-size: 24px;
  font-weight: 400;
  line-height: 1.15;
  white-space: nowrap;
}
.logo-name span:last-child {
  font-size: 13px;
}
.nav {
  flex: 1;
  overflow: auto;
}
.gh {
  display: flex;
  justify-content: space-between;
  padding: 10px;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  border-radius: 8px;
}
.it {
  display: flex;
  gap: 10px;
  padding: 9px 12px;
  margin: 2px 0;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  color: var(--mu);
}
.it:hover {
  background: var(--hv);
}
.it.on {
  background: var(--g);
  color: #fff;
  font-weight: 600;
}
.it i {
  font-style: normal;
  filter: grayscale(1);
}
.it.on i {
  filter: grayscale(1) brightness(5);
}
.ft {
  border-top: 1px solid var(--bd);
  padding-top: 8px;
}
.out {
  color: #dc2626;
}
main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.top {
  height: 56px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 20px;
  background: var(--cd);
  border-bottom: 1px solid var(--bd);
  font-weight: 700;
  color: #1e3a8a;
}
.top .bg {
  display: none;
}
.top span {
  flex: 1;
}
.top button {
  border: 1px solid var(--bd);
  background: var(--cd);
  border-radius: 50%;
  width: 34px;
  height: 34px;
  cursor: pointer;
}
.language-picker {
  position: relative;
  flex: none;
}
.top .language-picker-trigger {
  font-size: 17px;
}
.language-picker-menu {
  position: absolute;
  z-index: 20;
  top: calc(100% + 8px);
  right: 0;
  display: grid;
  min-width: 170px;
  gap: 4px;
  padding: 6px;
  border: 1px solid var(--bd);
  border-radius: 10px;
  background: var(--cd);
  box-shadow: 0 8px 24px #0002;
}
.language-picker-menu[hidden] {
  display: none;
}
.top .language-picker-menu button {
  width: 100%;
  height: auto;
  padding: 9px 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  text-align: left;
  font-size: 13px;
}
.top .language-picker-menu button:hover,
.top .language-picker-menu button[aria-pressed="true"] {
  background: var(--hv);
  color: var(--tx);
}
@media (max-width: 560px) {
  .top {
    gap: 8px;
    padding: 0 10px;
  }
}
#v {
  flex: 1;
  overflow: auto;
  padding: 24px;
}
.w {
  max-width: 1800px;
  margin: 0 auto;
}
.hd {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.tools {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.btn {
  border: 1px solid var(--bd);
  background: var(--cd);
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
}
.btn.p {
  background: var(--p);
  border-color: var(--p);
  color: #fff;
}
.btn.g {
  background: var(--g);
  border: 0;
  color: #fff;
}
.btn.r {
  background: #ef4444;
  border-color: #ef4444;
  color: #fff;
}
.btn.s {
  padding: 4px 8px;
}
.in {
  border: 1px solid var(--bd);
  background: var(--cd);
  border-radius: 8px;
  padding: 8px 12px;
  min-width: 20px;
}
.card {
  background: var(--cd);
  border: 1px solid var(--bd);
  border-radius: 12px;
  overflow: auto;
  box-shadow: 0 1px 4px #0000000a;
}

.diagnosis-shell {
  width: 100%;
  max-width: none;
  margin: 0;
}

.diagnosis-search {
  position: relative;
  margin: 0 0 18px;
}

.diagnosis-search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  font-size: 16px;
}

.diagnosis-input {
  width: 100%;
  border: 1px solid var(--bd);
  background: var(--cd);
  border-radius: 10px;
  padding: 11px 14px 11px 38px;
  font-size: 14px;
  min-width: 0;
}

.diagnosis-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.diagnosis-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--cd);
  border: 1px solid var(--bd);
  border-radius: 10px;
  padding: 12px 14px 12px 18px;
  min-height: 54px;
}

.diagnosis-name {
  font-size: 15px;
  color: var(--tx);
  font-weight: 500;
}

.diagnosis-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn.diagnosis-secondary {
  border: 1px solid #033993;
  background: #fff;
  color: #033993;
  border-radius: 8px;
  padding: 8px 12px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn.diagnosis-icon {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  line-height: 1;
}

.btn.diagnosis-icon {
  background: linear-gradient(180deg, #033993, #1f5ed6);
  border-color: #033993;
  color: #fff;
}

.btn.diagnosis-primary {
  background: linear-gradient(90deg, #033993, #1d4ed8);
  border: 0;
  color: #fff;
  width: auto;
  min-width: 38px;
  height: 38px;
  padding: 8px 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 14px;
  line-height: 1;
  white-space: nowrap;
}

.btn.diagnosis-edit {
  background: linear-gradient(180deg, #033993, #1f5ed6);
  border-color: #033993;
  color: #fff;
  min-width: 58px;
}

.btn.diagnosis-delete {
  background: linear-gradient(180deg, #ef4444, #dc2626);
  border-color: #ef4444;
  color: #fff;
  min-width: 38px;
  padding: 6px 10px;
}

.diagnosis-empty {
  padding: 26px 16px;
  text-align: center;
  color: var(--mu);
  border: 1px dashed var(--bd);
  border-radius: 10px;
  background: rgba(148, 163, 184, 0.04);
}

table {
  width: 100%;
  border-collapse: collapse;
}
th {
  background: var(--g);
  color: #fff;
  text-align: left;
  padding: 12px;
  font-size: 13px;
  white-space: nowrap;
}
#v table.column-resizable-table .column-resize-cell {
  position: relative;
}
#v table.column-resizable-table .column-resize-cell:not(:last-child) {
  box-shadow: inset -1px 0 rgba(255, 255, 255, 0.7);
}
#v table.column-resizable-table .column-resize-cell::after {
  content: "";
  position: absolute;
  top: 0;
  right: -4px;
  width: 8px;
  height: 100%;
  cursor: col-resize;
  touch-action: none;
}
#v table.column-resizable-table .column-resize-cell:hover::after {
  background: rgba(255, 255, 255, 0.3);
}
#v table.column-resizable-table th,
#v table.column-resizable-table td {
  white-space: normal;
  overflow-wrap: anywhere;
}
body.column-resizing,
body.column-resizing * {
  cursor: col-resize !important;
  user-select: none !important;
}
td {
  padding: 11px 12px;
  border-top: 1px solid var(--bd);
}
tr:hover td {
  background: var(--hv);
}
.emp {
  padding: 40px;
}
.care-record-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 4px 12px;
  margin: 8px 0;
  font-size: 12px;
  text-align: center;
  color: var(--mu);
}
.bd {
  padding: 2px 10px;
  border-radius: 99px;
  font-size: 12px;
  background: #dcfce7;
  color: #166534;
}
.bd.x {
  background: #fee2e2;
  color: #991b1b;
}
.bd.b {
  background: #dbeafe;
  color: #1e40af;
}
.sts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin-bottom: 14px;
}
.st {
  border-radius: 10px;
  overflow: hidden;
  background: var(--cd);
  border: 1px solid var(--bd);
}
.st b {
  display: block;
  padding: 10px 14px;
  color: #fff;
  font-size: 13px;
}
.st div {
  padding: 14px;
  text-align: center;
  font-size: 22px;
  font-weight: 700;
}
.cs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  margin-top: 16px;
}
.cs .card {
  padding: 16px;
}
.service-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 16px;
  margin-top: 16px;
}
.service-card {
  display: flex;
  min-height: 172px;
  flex-direction: column;
  padding: 16px;
}
.service-card h3 {
  margin: 0 0 8px;
  font-size: 15px;
  overflow-wrap: anywhere;
}
.service-price {
  color: #1e3a8a;
  font-size: 16px;
}
.service-description {
  flex: 1;
  margin-top: 8px;
  color: var(--mu);
  font-size: 12px;
  white-space: pre-line;
  overflow-wrap: anywhere;
}
.service-description-empty {
  min-height: 18px;
}
.service-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 14px;
}
.br {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 7px 0;
  font-size: 12px;
}
.br:hover,
.br:focus-visible {
  z-index: 2;
}
.br::after {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 5;
  display: none;
  width: max-content;
  max-width: min(360px, calc(100vw - 48px));
  padding: 8px 10px;
  border: 1px solid var(--bd);
  border-radius: 6px;
  background: var(--cd);
  box-shadow: 0 4px 12px #0000001f;
  color: var(--tx);
  content: attr(data-tooltip);
  white-space: normal;
}
.br:hover::after,
.br:focus-visible::after {
  display: block;
}
.br u {
  flex: none;
  width: 90px;
  text-decoration: none;
  color: var(--mu);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.br s {
  display: block;
  height: 12px;
  border-radius: 3px;
  background: #818cf8;
}
.gr {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 16px;
}
.dc {
  padding: 16px;
  text-align: center;
  border-top: 4px solid #6366f1;
}
.av {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--hv);
  margin: 0 auto 8px;
  display: grid;
  place-items: center;
  font-size: 26px;
}
.tabs {
  display: flex;
  background: var(--hv);
  border-radius: 8px;
  padding: 3px;
}
.tabs button {
  border: 0;
  background: none;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
}
.tabs .on {
  background: var(--cd);
  font-weight: 600;
}
.patient-list-toolbar > .tabs button.on {
  border: 1px solid #033993;
  border-radius: 8px;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.18);
}
.pg {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 14px;
  color: var(--mu);
}
.pg div {
  display: flex;
  gap: 6px;
}
.pos {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 16px;
}
.pr {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 10px;
}
.pc {
  padding: 10px;
  text-align: center;
  cursor: pointer;
  font-size: 12px;
}
.pc:hover {
  border-color: var(--p);
}
.pc img.ph {
  display: block;
  width: 100%;
  height: 60px;
  object-fit: cover;
  background: none;
}
.av {
  overflow: hidden;
}
.av img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.tn {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  object-fit: cover;
  vertical-align: middle;
  margin-right: 8px;
}
.pp {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 4px;
  flex-wrap: wrap;
}
.pp img {
  width: 56px;
  height: 56px;
  border-radius: 8px;
  object-fit: cover;
}
.ph {
  height: 50px;
  border-radius: 6px;
  background: linear-gradient(135deg, #bae6fd, #bbf7d0);
  margin-bottom: 6px;
}
.cl {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  padding: 6px 0;
  font-size: 13px;
}
.pos-checkout-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.pos-checkout-actions > [data-a="co"] {
  flex: 1;
}
#md {
  display: none;
  position: fixed;
  inset: 0;
  background: #0007;
  place-items: center;
  z-index: 9;
}
#md.on {
  display: grid;
}
#md form {
  background: var(--cd);
  padding: 20px;
  border-radius: 12px;
  width: min(380px, 92vw);
}
#mf.leave-request-form {
  width: min(540px, 94vw);
  max-height: 92vh;
  overflow: auto;
}
.leave-form-heading,
.leave-form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.leave-form-heading h3 {
  margin: 0;
}
.leave-date-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.leave-request-form .in {
  width: 100%;
}
.leave-form-actions {
  justify-content: flex-end;
  margin-top: 16px;
}
#md label {
  display: block;
  margin: 10px 0;
  font-size: 13px;
}
#md input {
  width: 1%00;
  margin-top: 4px;
}
#ts {
  position: fixed;
  right: 16px;
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  background: #0f172a;
  color: #fff;
  padding: 10px 14px;
  border-radius: 8px;
  display: none;
  z-index: 10;
}
#lg {
  position: fixed;
  inset: 0;
  z-index: 5;
  overflow: auto;
  background: linear-gradient(180deg, #b7dfe6 0%, #b7dfe6 100%);
  display: grid;
  place-items: center;
  padding: 24px;
}
#lg[hidden] {
  display: none;
}
.lb {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  width: min(880px, 100%);
  background: rgba(255, 255, 255, 0.75);
  border-radius: 22px;
  overflow: hidden;
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.06);
}
.ll {
  background: transparent;
  color: #0d2a5c;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 28px 18px 12px;
  min-height: 0;
}
.brand-mark {
  width: min(21vw, 260px);
  max-width: 100%;
  display: grid;
  place-items: center;
  margin: 0 auto;
}
.brand-mark img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 23vh;
  object-fit: contain;
  filter: none;
}
.brand-name {
  margin-top: 6px;
  font-size: clamp(1.05rem, 1.6vw, 2.35rem);
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 1.1;
  text-transform: uppercase;
  text-align: center;
  color: #0d2a5c;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.brand-icons {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 18px;
}
.brand-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 14px;
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.12);
}
.brand-icon.blue {
  background: #1f6fe5;
}
.brand-icon.purple {
  background: #7b61ff;
}
.brand-icon.red {
  background: #e55050;
}
.brand-icon.green {
  background: #2cc48a;
}
.lr {
  padding: 32px 34px 24px 10px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  color: #0f172a;
}
.lr h2 {
  margin: 0;
  font-size: clamp(1.8rem, 2vw, 2.5rem);
  line-height: 1.2;
  font-weight: 800;
  color: #0f172a;
}
.lr .mu {
  margin: 10px 0 18px;
  font-size: 14px;
  color: #475569;
}
.lr label {
  display: block;
  margin: 12px 0 6px;
  font-size: 12px;
  font-weight: 600;
  color: #0f172a;
}
.lr .in {
  width: 100%;
  height: 40px;
  padding: 10px 12px;
  border: 1px solid #dfe7ef;
  border-radius: 10px;
  background: #edf1f5;
  color: #0f172a;
  font-size: 14px;
}
.lr .in::placeholder {
  color: #475569;
}
.remember {
  display: flex !important;
  align-items: center;
  gap: 8px;
  margin: 14px 0 18px !important;
  font-weight: 400 !important;
  color: #0f172a;
}
.remember input {
  width: 14px;
  height: 14px;
  accent-color: #1d4ed8;
}
.lr button {
  width: 100%;
  margin-top: 8px;
  background: linear-gradient(180deg, #1b7de6, #0c75d8);
  color: #fff;
  border: 0;
  border-radius: 10px;
  padding: 12px 18px;
  font-weight: 700;
  font-size: 18px;
  cursor: pointer;
  box-shadow: 0 8px 16px rgba(30, 111, 228, 0.25);
}
.alt-text {
  margin-top: 16px !important;
  font-size: 13px !important;
  text-align: center;
  color: #475569;
}
.lr {
  padding: 36px;
}
.lr label {
  display: block;
  font-weight: 600;
  font-size: 12px;
  margin: 14px 0 4px;
}
.lr .in {
  width: 100%;
  color: #0f172a;
  background: #fff;
}
.lr button {
  width: 100%;
  margin-top: 18px;
  background: #0076fd;
  color: #fff;
  border: 0;
  padding: 10px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
}
.lr button:disabled {
  cursor: wait;
  opacity: 0.7;
}
.login-loading[hidden] {
  display: none;
}
.login-loading {
  position: fixed;
  z-index: 1;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 16px;
  background: #0f172ab8;
  backdrop-filter: blur(4px);
}
.login-loading-card {
  display: grid;
  min-width: 230px;
  justify-items: center;
  gap: 10px;
  padding: 26px 32px;
  border: 1px solid #ffffff70;
  border-radius: 16px;
  background: #fff;
  color: #0f172a;
  box-shadow: 0 18px 50px #0004;
}
.login-loading-logo {
  display: grid;
  width: 64px;
  height: 64px;
  place-items: center;
  border-radius: 20px;
  background: linear-gradient(135deg, #033993, #7c3aed);
  color: #fff;
  animation: login-logo-pulse 1.2s ease-in-out infinite;
}
.login-loading-logo svg {
  width: 42px;
  height: 42px;
}
.login-loading-card strong {
  color: #033993;
  font-size: 14px;
  letter-spacing: 0.04em;
}
.login-loading-card > span {
  color: #64748b;
  font-size: 13px;
}
@keyframes login-logo-pulse {
  0%,
  100% {
    transform: scale(0.94);
    box-shadow: 0 0 0 0 #3b82f640;
  }
  50% {
    transform: scale(1);
    box-shadow: 0 0 0 10px #3b82f600;
  }
}
@media (prefers-reduced-motion: reduce) {
  .login-loading-logo {
    animation: none;
  }
}
@media (max-width: 820px) {
  aside {
    position: fixed;
    z-index: 6;
    inset: 0 auto 0 0;
    transform: translateX(-100%);
    transition: transform 0.2s;
  }
  aside.on {
    transform: none;
  }
  .top .bg {
    display: block;
  }
  .pos,
  .lb {
    grid-template-columns: 1fr;
  }
  .ll {
    display: none;
  }
  #v {
    padding: 14px;
  }
}
html[lang="km"] body {
  font-family: "Noto Sans Khmer", Inter, system-ui, sans-serif;
  line-height: 1.65;
}

.gr2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}
.fl {
  display: block;
  margin: 12px 0;
  font-size: 13px;
}
.fl .in {
  width: 100%;
  margin-top: 4px;
}
.ck {
  display: flex;
  gap: 8px;
  align-items: center;
  border: 1px solid var(--bd);
  border-radius: 8px;
  padding: 10px 14px;
  margin: 6px 0;
}
.ck input {
  width: auto;
  min-width: 0;
}
.clinic-settings-page {
  width: min(100%, 860px);
  margin: 22px auto 36px;
}
.clinic-settings-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}
.clinic-settings-heading h1 {
  max-width: 170px;
  margin: 0;
  color: #172033;
  font-size: 26px;
  line-height: 1.45;
}
.clinic-settings-heading p {
  margin: 5px 0 0;
  color: var(--mu);
  font-size: 13px;
}
.clinic-settings-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}
.clinic-settings-actions .tabs {
  margin: 0;
}
.clinic-settings-card {
  padding: 30px;
  overflow: visible;
  border-color: #edf0f5;
  border-radius: 16px;
  box-shadow: 0 12px 28px #10182812;
}
.clinic-settings-assets {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  gap: 24px;
  margin-bottom: 26px;
}
.clinic-settings-asset {
  min-width: 0;
}
.clinic-settings-asset > b {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
}
.clinic-settings-asset > label,
.clinic-settings-banner > label {
  display: block;
}
.clinic-settings-asset .pp {
  align-items: center;
  gap: 12px;
  margin: 0;
}
.clinic-settings-asset .pp img {
  width: 90px;
  height: 122px;
  flex: 0 0 auto;
  border: 1px solid var(--bd);
  border-radius: 7px;
  background: #fff;
  object-fit: contain;
}
.clinic-settings-asset .pp input {
  min-width: 0;
  width: 100%;
  max-width: 220px;
}
.clinic-settings-asset .pp .btn {
  flex: 0 0 auto;
}
.clinic-settings-doctor {
  align-self: start;
  margin-top: 27px;
  white-space: nowrap;
}
.clinic-settings-section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 2px 0 20px;
  color: #1f2937;
  font-size: 16px;
}
.clinic-settings-section-title > span {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 9px;
  background: #e8f0ff;
  color: #033993;
  font-size: 19px;
}
.clinic-settings-banner {
  margin-bottom: 20px;
}
.clinic-settings-banner-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}
.clinic-settings-banner-heading > span {
  padding: 4px 9px;
  border-radius: 999px;
  background: #f3f4f6;
  color: #667085;
  font-size: 11px;
}
.clinic-footer-options {
  display: flex;
  gap: 18px;
  margin: 0 0 12px;
}
.clinic-footer-options label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.clinic-settings-banner .pp {
  align-items: flex-start;
  flex-direction: column;
  gap: 10px;
  margin: 0;
}
.clinic-settings-banner .pp img#pv_banner,
.clinic-settings-footer-banner .pp img#pv_footer_banner {
  width: 100%;
  max-width: none;
  height: auto;
  max-height: 130px;
  border: 1px solid var(--bd);
  border-radius: 9px;
  object-fit: contain;
}
.clinic-settings-banner .pp input {
  width: min(100%, 360px);
}
.clinic-settings-toggles {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 18px 0 26px;
}
.clinic-settings-toggle {
  display: flex;
  min-width: 0;
  align-items: flex-start;
  gap: 10px;
  margin: 0;
  padding: 12px;
  border: 1px solid var(--bd);
  border-radius: 9px;
  background: var(--cd);
  cursor: pointer;
}
.clinic-settings-toggle input {
  width: 16px;
  min-width: 16px;
  height: 16px;
  margin: 2px 0 0;
  accent-color: #033993;
}
.clinic-settings-toggle span {
  display: grid;
  gap: 2px;
}
.clinic-settings-toggle b {
  font-size: 12px;
  font-weight: 500;
}
.clinic-settings-toggle small {
  color: var(--mu);
  font-size: 10px;
}
.clinic-print-template-settings {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 24px;
  margin: 0 0 20px;
  padding: 18px 0;
  border-top: 1px solid var(--bd);
  border-bottom: 1px solid var(--bd);
}
.clinic-print-template-settings > div {
  grid-column: 1 / -1;
}
.clinic-print-template-settings > div p {
  margin: 4px 0 8px;
  font-size: 12px;
}
.clinic-print-template-settings .clinic-settings-field {
  margin-bottom: 0;
}
.clinic-print-template-settings textarea.in {
  min-height: 70px;
  resize: vertical;
  white-space: pre-wrap;
}
.print-template-intro {
  margin-bottom: 18px;
}
.print-template-intro p {
  margin: 4px 0 0;
  font-size: 12px;
}
.print-template-grid,
.print-template-copy {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 24px;
}
.print-template-grid .clinic-settings-field,
.print-template-copy .clinic-settings-field {
  margin: 0;
}
.print-template-copy {
  margin-top: 16px;
}
.print-template-copy textarea.in {
  min-height: 78px;
  resize: vertical;
  white-space: pre-wrap;
}
.print-template-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--bd);
}
.template-editor {
  display: flex;
  min-height: calc(100vh - 106px);
  flex-direction: column;
  margin: -24px;
  background: #edf0f5;
  color: #233047;
}
.template-ribbon {
  display: flex;
  min-height: 108px;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 0;
  padding: 6px 10px 0;
  border-bottom: 1px solid #cbd2dc;
  background: #fff;
}
.template-ribbon-group {
  display: flex;
  min-width: 90px;
  align-items: center;
  align-content: center;
  flex-wrap: wrap;
  gap: 4px;
  padding: 5px 9px 16px;
  border-right: 1px solid #e1e5eb;
  position: relative;
}
.template-ribbon-group > b {
  position: absolute;
  bottom: 1px;
  left: 10px;
  color: #748094;
  font-size: 10px;
  font-weight: 500;
}
.template-ribbon-action {
  display: grid;
  min-width: 42px;
  min-height: 48px;
  align-content: center;
  justify-items: center;
  gap: 2px;
  padding: 4px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: #334155;
  cursor: pointer;
}
.template-ribbon-action:hover,
.template-tool-button:hover {
  background: #eef4ff;
  color: #1d4ed8;
}
.template-ribbon-action > span {
  font-size: 10px;
}
.template-ribbon-action.primary {
  background: #e9f1ff;
  color: #1d4ed8;
}
.template-ribbon-action:disabled,
.template-tool-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}
.template-grid-toggle {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
}
.template-grid-toggle input {
  min-width: 0;
}
.template-object-tools {
  max-width: 365px;
}
.template-tool-button {
  min-height: 30px;
  padding: 4px 7px;
  border: 1px solid #e0e5ec;
  border-radius: 5px;
  background: #fff;
  color: #334155;
  font-size: 10px;
  cursor: pointer;
}
.template-page-controls {
  flex: 1 1 250px;
  justify-content: flex-end;
  border-right: 0;
}
.template-page-controls .template-property {
  min-width: 82px;
  margin: 0;
  gap: 2px;
}
.template-page-controls .template-property > span {
  font-size: 9px;
}
.template-page-controls .in {
  min-height: 29px;
  padding: 3px 6px;
  font-size: 10px;
}
.template-workspace {
  display: grid;
  min-height: 600px;
  flex: 1;
  grid-template-columns: minmax(0, 1fr) 278px;
}
.template-canvas-scroll {
  min-width: 0;
  overflow: auto;
  padding: 22px;
}
.template-page {
  position: relative;
  width: min(100%, 620px);
  min-width: 420px;
  min-height: 760px;
  margin: 0 auto;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 2px 12px #25334b25;
  color: #1f2937;
  font:
    10px/1.35 Arial,
    "Noto Sans Khmer",
    sans-serif;
}
.template-page.landscape {
  width: min(100%, 830px);
  min-height: 580px;
}
.template-page:not(.grid-hidden) {
  background-image:
    linear-gradient(#dbe2eb 1px, transparent 1px),
    linear-gradient(90deg, #dbe2eb 1px, transparent 1px);
  background-size: 12px 12px;
}
.template-page-heading {
  display: flex;
  height: 75px;
  align-items: flex-start;
  justify-content: space-between;
  padding: 13px 22px 8px;
  border-bottom: 1px solid #cbd2dc;
  background: #ffffffed;
}
.template-page-heading > div {
  display: grid;
  gap: 2px;
}
.template-page-heading > div b {
  font-size: 14px;
}
.template-page-heading > strong {
  padding: 4px 10px;
  border: 1px solid #64748b;
  font-size: 15px;
}
.template-page-header,
.template-page-footer {
  position: relative;
  height: 83px;
  border-bottom: 1px dashed #94a3b8;
  background: #eff6ff9e;
}
.template-page-footer {
  height: 70px;
  border-top: 1px dashed #94a3b8;
  border-bottom: 0;
  background: #f8fafcde;
}
.template-page-content {
  min-height: 490px;
  padding: 14px 22px;
  background: #ffffffed;
}
.template-page.landscape .template-page-content {
  min-height: 225px;
}
.template-page-meta {
  display: flex;
  justify-content: space-between;
  min-height: 82px;
  padding: 5px 4px 12px;
}
.template-example-table,
.template-table-preview {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  background: #fff;
}
.template-example-table th,
.template-example-table td,
.template-table-preview th,
.template-table-preview td {
  padding: 6px 4px;
  border: 1px solid #64748b;
  text-align: left;
  overflow-wrap: anywhere;
}
.template-example-table th {
  background: #e2e8f0;
}
.template-example-table th:nth-child(2) {
  width: 48%;
}
.template-example-total {
  display: grid;
  width: 210px;
  grid-template-columns: 1fr auto;
  gap: 5px 12px;
  margin: 16px 0 0 auto;
  padding: 8px;
  background: #fff;
}
.template-content-caption {
  margin-top: 44px;
  padding: 10px;
  border: 1px dashed #94a3b8;
  color: #64748b;
  text-align: center;
}
.template-page-header,
.template-page-footer {
  isolation: isolate;
}
.print-template-node {
  position: absolute;
  z-index: 1;
  display: flex;
  min-width: 5%;
  min-height: 5%;
  align-items: center;
  overflow: visible;
  padding: 3px;
  touch-action: none;
  cursor: move;
}
.print-template-node.has-border {
  border: 1px solid #64748b;
}
.print-template-node.selected {
  z-index: 5;
  outline: 2px dashed #f59e0b;
  outline-offset: 1px;
}
.template-node-content {
  width: 100%;
  height: 100%;
  overflow: hidden;
}
.template-node-content > img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.template-image-placeholder {
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
  border: 1px dashed #94a3b8;
  color: #64748b;
}
.template-drag-handle,
.template-resize-handle {
  position: absolute;
  z-index: 6;
  display: grid;
  width: 16px;
  height: 16px;
  place-items: center;
  border: 1px solid #033993;
  border-radius: 3px;
  background: #fff;
  color: #033993;
  font-size: 11px;
  cursor: move;
}
.template-drag-handle {
  top: -10px;
  left: -9px;
}
.template-resize-handle {
  right: -9px;
  bottom: -9px;
  cursor: nwse-resize;
}
.template-line {
  display: block;
  width: 100%;
  border-top: 1px solid currentColor;
}
.template-line.vertical {
  width: 0;
  height: 100%;
  margin: 0 auto;
  border-top: 0;
  border-left: 1px solid currentColor;
}
.template-summary-preview {
  display: grid;
  gap: 3px;
  padding: 2px;
}
.template-summary-preview span,
.template-summary-preview strong {
  display: flex;
  justify-content: space-between;
}
.template-summary-preview i {
  font-style: normal;
}
.template-inspector {
  min-width: 0;
  overflow: auto;
  border-left: 1px solid #cbd2dc;
  background: #fff;
}
.template-inspector-tabs {
  position: sticky;
  z-index: 2;
  top: 0;
  display: flex;
  border-bottom: 1px solid #cbd2dc;
  background: #fff;
}
.template-inspector-tabs button {
  flex: 1;
  min-height: 40px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: #475569;
  cursor: pointer;
}
.template-inspector-tabs button.active {
  border-bottom-color: #033993;
  color: #1d4ed8;
  font-weight: 600;
}
.template-selected-title,
.template-page-settings {
  display: grid;
  gap: 8px;
  padding: 13px;
  border-bottom: 1px solid #e2e8f0;
}
.template-selected-title span {
  color: #64748b;
  font-size: 11px;
}
.template-property-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 13px;
}
.template-property-heading {
  grid-column: 1 / -1;
  font-size: 12px;
}
.template-property-wide {
  grid-column: 1 / -1;
}
.template-property {
  display: grid;
  min-width: 0;
  gap: 3px;
  margin: 0;
}
.template-property > span {
  color: #64748b;
  font-size: 10px;
}
.template-property > .in {
  width: 100%;
  min-height: 31px;
  padding: 5px 7px;
  font-size: 11px;
}
.template-property > input[type="color"] {
  width: 100%;
  height: 32px;
  padding: 2px;
  border: 1px solid #cbd2dc;
  border-radius: 5px;
  background: #fff;
}
.template-property > input[type="checkbox"] {
  justify-self: start;
  accent-color: #033993;
}
.template-property:has(textarea) {
  grid-column: 1 / -1;
}
.template-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 0 13px 12px;
  font-size: 11px;
}
.template-columns > b {
  grid-column: 1 / -1;
}
.template-columns label {
  display: flex;
  align-items: center;
  gap: 4px;
}
.template-columns input {
  accent-color: #033993;
}
.template-delete {
  margin: 0 13px 13px;
}
.template-inspector-empty {
  padding: 20px 14px;
  color: #64748b;
  font-size: 12px;
}
.template-editor-note {
  margin: 10px 13px;
  color: #64748b;
  font-size: 10px;
}
.clinic-settings-fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 4px 24px;
  padding-top: 20px;
  border-top: 1px solid var(--bd);
}
.clinic-settings-field {
  display: grid;
  min-width: 0;
  gap: 6px;
  margin: 0 0 10px;
  font-size: 13px;
}
.clinic-settings-field > span {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
}
.clinic-settings-field > span i {
  width: 15px;
  color: #4b5563;
  font-size: 15px;
  font-style: normal;
  text-align: center;
}
.clinic-settings-field .in {
  width: 100%;
  min-width: 0;
  min-height: 40px;
}
.clinic-settings-save {
  display: flex;
  justify-content: flex-end;
  margin-top: 22px;
}
.clinic-settings-save .btn {
  min-height: 40px;
  padding: 9px 16px;
  background: linear-gradient(110deg, #033993, #9333ea);
  border: 0;
  border-radius: 9px;
  color: #fff;
  box-shadow: 0 5px 12px #462be22b;
}
@media (max-width: 900px) {
  .clinic-settings-page {
    margin-top: 12px;
  }
  .clinic-settings-heading {
    align-items: flex-start;
    flex-direction: column;
  }
  .clinic-settings-assets {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
  }
  .clinic-settings-doctor {
    grid-column: 1 / -1;
    margin-top: 0;
  }
}
@media (max-width: 560px) {
  .clinic-settings-card {
    padding: 18px;
  }
  .clinic-settings-assets,
  .clinic-settings-toggles,
  .clinic-print-template-settings,
  .clinic-settings-fields,
  .print-template-grid,
  .print-template-copy {
    grid-template-columns: 1fr;
  }
  .clinic-settings-heading h1 {
    max-width: none;
    font-size: 22px;
  }
  .clinic-settings-actions {
    justify-content: flex-start;
  }
}
@media (max-width: 900px) {
  .template-editor {
    margin: -16px;
  }
  .template-ribbon {
    min-height: 0;
  }
  .template-page-controls {
    flex-basis: 100%;
    justify-content: flex-start;
    padding-bottom: 15px;
  }
  .template-workspace {
    grid-template-columns: minmax(0, 1fr) 250px;
  }
  .template-canvas-scroll {
    padding: 14px;
  }
  .template-page {
    min-width: 360px;
  }
}
@media (max-width: 640px) {
  .template-workspace {
    grid-template-columns: minmax(0, 1fr);
  }
  .template-inspector {
    min-height: 280px;
    border-top: 1px solid #cbd2dc;
    border-left: 0;
  }
  .template-ribbon-group {
    padding-right: 5px;
    padding-left: 5px;
  }
  .template-object-tools {
    max-width: none;
  }
}
.pp img#pv_banner {
  width: 100%;
  max-width: 560px;
  height: auto;
  max-height: 90px;
  object-fit: contain;
}
.logo img {
  display: block;
}
hr {
  border: 0;
  border-top: 1px solid var(--bd);
  margin: 18px 0;
}

#md {
  overflow: auto;
  padding: 16px;
}
#md form {
  max-height: 94vh;
  overflow: auto;
}
#mf.wide {
  width: min(640px, 96vw);
}
#mf.patient-contract-dialog {
  display: flex;
  width: min(850px, 96vw);
  max-height: 94vh;
  flex-direction: column;
  overflow: auto;
  padding: 18px 24px 0 !important;
}
.patient-contract-dialog > .operation-form-heading {
  position: sticky;
  z-index: 3;
  top: -19px;
  margin: -18px -24px 12px;
  padding: 14px 24px 10px;
  border-bottom: 1px solid var(--bd);
  background: var(--cd);
}
.patient-contract-dialog > .operation-form-heading h3 {
  font-size: 19px;
}
.patient-contract-form {
  display: grid;
  gap: 8px 16px;
}
.patient-contract-form .fl {
  min-width: 0;
  margin: 0;
}
.patient-contract-form .in {
  min-width: 0;
}
.patient-contract-full {
  min-width: 0;
}
.patient-contract-grid {
  gap: 8px 16px;
}
.patient-contract-consent {
  display: grid;
  gap: 3px;
}
.patient-contract-check {
  display: flex;
  align-items: flex-start;
  width: 100%;
  max-width: 100%;
  gap: 4px;
  white-space: normal;
}
.patient-contract-check input {
  flex: 0 0 auto;
  margin: 3px 0 0;
}
.patient-contract-check span {
  flex: 1 1 auto;
  min-width: 0;
}
.patient-contract-dialog > .fb {
  position: sticky;
  bottom: 0;
  z-index: 3;
  margin: 12px -24px 0;
  padding: 10px 24px 14px;
  background: var(--cd);
}
@media (max-width: 620px) {
  .patient-contract-grid.g3,
  .patient-contract-grid.g2 {
    grid-template-columns: 1fr;
  }
}
#mf.payall-dialog {
  width: min(780px, 96vw);
  max-height: 94vh;
  overflow: auto;
}
.payall-dialog .operation-form-heading {
  position: sticky;
  top: -1px;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: -1px -1px 12px;
  padding: 8px 0;
  background: var(--cd);
}
.payall-dialog .operation-form-heading h3 {
  margin: 0;
  font-size: 18px;
}
.payall-patient {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
  padding: 12px;
  border-radius: 8px;
  background: var(--hv);
}
.payall-patient > div {
  display: grid;
  gap: 2px;
}
.payall-patient small {
  color: var(--mu);
}
.payall-items-wrap {
  max-height: 220px;
  overflow: auto;
  border: 1px solid var(--bd);
  border-radius: 8px;
}
.payall-items {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}
.payall-items th,
.payall-items td {
  padding: 8px;
  border-bottom: 1px solid var(--bd);
  text-align: left;
  overflow-wrap: anywhere;
}
.payall-items th {
  position: sticky;
  top: 0;
  background: var(--hv);
  color: #033993;
}
.payall-items th:first-child,
.payall-items td:first-child {
  width: 44px;
  text-align: center;
}
.payall-items th:nth-child(3),
.payall-items td:nth-child(3) {
  width: 56px;
  text-align: center;
}
.payall-items th:last-child,
.payall-items td:last-child {
  width: 140px;
  text-align: right;
}
.payall-summary {
  display: grid;
  gap: 8px;
  margin: 12px 0;
  padding: 12px;
  border: 1px solid var(--bd);
  border-radius: 8px;
}
.payall-summary > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.payall-discount-row {
  flex-wrap: wrap;
}
.payall-discount-row > span {
  flex: 1 1 100px;
}
.payall-all-discount > label {
  flex: 1 1 180px;
  margin: 0;
}
#mf.payall-dialog .payall-all-discount > .in {
  width: 120px;
  min-width: 88px;
  margin: 0;
}
#mf.payall-dialog .payall-all-discount > select.in {
  width: 105px;
}
.payall-tag {
  min-width: 42px;
}
.payall-discount-overlay {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: grid;
  place-items: center;
  padding: 16px;
  background: #0009;
}
.payall-discount-dialog {
  width: min(565px, calc(100vw - 32px));
  min-width: 0;
  max-height: min(80vh, 560px);
  overflow: auto;
  padding: 20px 24px;
  border: 1px solid var(--bd);
  border-radius: 10px;
  background: var(--cd);
  box-shadow: 0 16px 48px #0005;
}
.payall-discount-dialog > header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}
.payall-discount-dialog h3 {
  min-width: 0;
  margin: 0;
  font-size: 17px;
  overflow-wrap: anywhere;
}
.payall-discount-list {
  display: grid;
  gap: 2px;
  max-height: 180px;
  overflow: auto;
  margin-bottom: 18px;
}
#md .payall-discount-item {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) minmax(100px, auto);
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 8px 4px;
  border-bottom: 1px solid var(--bd);
  font-size: 14px;
}
#md .payall-discount-item input {
  width: 18px;
  margin: 0;
}
.payall-discount-item span {
  min-width: 0;
  overflow-wrap: anywhere;
}
.payall-discount-item b {
  text-align: right;
  white-space: nowrap;
}
.payall-discount-selected {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}
.payall-discount-entry {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 92px;
  gap: 10px;
}
#md .payall-discount-entry .in {
  width: 100%;
  min-width: 0;
  margin: 0;
}
#md .payall-discount-entry select.in {
  min-width: 0;
}
.payall-discount-error {
  min-height: 22px;
  color: #dc2626;
}
.payall-discount-actions {
  display: flex;
  justify-content: flex-end;
}
.payment-receipt-item-discount {
  display: block;
  margin-top: 1mm;
  color: #475569;
  font-size: 8pt;
}
.payall-final {
  margin: 0 -12px -12px;
  padding: 12px;
  border-radius: 0 0 8px 8px;
  background: #dbeafe;
  color: #1d4ed8;
  font-size: 17px;
  font-weight: 700;
}
.payall-balance {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 12px;
  margin: 0 0 12px;
  padding: 10px 12px;
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  background: #f0fdf4;
  color: #166534;
}
.payall-balance b {
  text-align: right;
}
.payall-balance small {
  grid-column: 1 / -1;
  color: var(--mu);
}
.payall-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 12px;
}
#mf.payall-dialog .payall-fields .fl {
  min-width: 0;
  margin: 0;
}
.payall-shortcuts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.payall-shortcuts .btn {
  min-width: 54px;
}
.payall-more-actions {
  margin-top: 8px;
}
#mf.payall-dialog > .fb {
  position: sticky;
  bottom: -1px;
  z-index: 2;
  margin: 12px -1px -1px;
  padding: 10px 0 0;
  background: var(--cd);
}
@media (max-width: 560px) {
  .payall-fields {
    grid-template-columns: 1fr;
  }
  .payall-items th:last-child,
  .payall-items td:last-child {
    width: 100px;
  }
}
#mf.vaccination-form-dialog {
  width: min(860px, 96vw);
  max-height: 94vh;
  overflow: auto;
}
#mf.center-form-dialog {
  display: flex;
  flex-direction: column;
  width: min(98vw, 1800px);
  height: min(94vh, 900px);
  max-height: 94vh;
  overflow: hidden;
}
#mf.center-form-dialog > .operation-form-heading,
#mf.center-form-dialog > .fb,
#mf.center-form-dialog > .center-add-row {
  flex: 0 0 auto;
}
.center-form-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  border: 1px solid #3b82f6;
}
.center-form-table {
  width: max-content;
  min-width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  color: #033993;
  font-size: 14px;
}
.center-form-table th,
.center-form-table td {
  padding: 5px;
  border: 1px solid #3b82f6;
  vertical-align: middle;
}
.center-form-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #dbeafe;
  color: #033993;
  text-align: center;
  white-space: nowrap;
}
.center-form-table td {
  height: 210px;
}
.center-form-table td:first-child {
  position: sticky;
  left: 0;
  z-index: 1;
  width: 48px;
  background: var(--cd);
  box-shadow: inset -1px 0 #3b82f6;
  text-align: center;
}
.center-form-table th:first-child {
  left: 0;
  z-index: 2;
  box-shadow: inset -1px 0 #3b82f6;
}
.center-form-table td:last-child,
.center-form-table th:last-child {
  position: sticky;
  right: 0;
  z-index: 1;
  width: 54px;
  background: var(--cd);
  text-align: center;
}
.center-form-table th:last-child {
  z-index: 2;
}
.center-form-table td > .in {
  width: 100%;
  min-width: 0;
  color: var(--p);
}
.center-checks {
  display: grid;
  gap: 2px;
}
#md .center-checks .cb {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr);
  column-gap: 4px;
  align-items: flex-start;
  width: 100%;
  min-width: 0;
  margin: 0;
  color: var(--p);
  font-size: 13px;
  line-height: 1.35;
}
#md .center-checks .cb span {
  min-width: 0;
  overflow-wrap: anywhere;
  white-space: normal;
}
#md .center-checks .cb input {
  width: auto;
  min-width: 0;
}
.center-checks .cb input,
.center-single-check input {
  width: auto;
  min-width: 0;
  flex: 0 0 auto;
  margin: 1px 0 0;
}
.center-single-check {
  display: flex;
  justify-content: center;
}
.center-add-row {
  align-self: flex-start;
  margin-top: 8px;
}
.center-print-wrap {
  overflow-x: auto;
}
.center-print-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  border-spacing: 0;
  border: 0.3mm solid #033993;
  color: #033993;
  font-size: 6.5pt;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}
.center-print-table th,
.center-print-table td {
  box-sizing: border-box;
  border: 0.3mm solid #033993;
  background: #fff;
  color: #033993;
  overflow-wrap: anywhere;
  word-break: break-word;
  padding: 2px;
  text-align: center;
  white-space: normal;
  line-height: 1.15;
}
.center-print-table th {
  background: #fff;
  color: #033993;
  font-weight: 600;
}
.center-print-table .center-print-option {
  position: relative;
  height: 22mm;
  padding: 2px 1px;
  vertical-align: middle;
}
.center-print-table .center-print-option span {
  position: absolute;
  top: 50%;
  left: 50%;
  display: block;
  width: 20mm;
  overflow: hidden;
  font-size: 5pt;
  line-height: 1;
  text-align: center;
  text-overflow: clip;
  white-space: nowrap;
  transform: translate(-50%, -50%) rotate(-90deg);
}
.center-print-table tbody td {
  height: 16mm;
  vertical-align: middle;
}
.center-print-header {
  color: #033993;
  text-align: center;
}
.center-print-meta {
  display: flex;
  justify-content: space-between;
  font-size: 8pt;
}
.center-print-brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8mm;
  margin: 4mm 0 2mm;
}
.center-print-clinic {
  flex: 1;
  text-align: center;
}
.center-print-clinic img {
  display: block;
  max-width: 100%;
  max-height: 20mm;
  margin: 0 auto 2mm;
}
.center-print-clinic h1 {
  margin: 0;
  font-size: 20pt;
}
.center-print-cross {
  color: #033993;
  font-size: 34pt;
  font-weight: 700;
  line-height: 1;
}
.center-print-header h2 {
  margin: 2mm 0 4mm;
  color: #033993;
  font-size: 12pt;
}
#mf.operation-form-dialog {
  width: min(760px, 96vw);
  max-height: 94vh;
  overflow: auto;
  padding: 20px 24px;
}
.operation-form-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}
.operation-form-heading h3 {
  margin: 0;
  font-size: 16px;
}
.operation-form .operation-request-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.operation-form .operation-request-grid .fl,
.operation-form .operation-type {
  margin: 8px 0;
}
.operation-form .operation-participants {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0;
  font-size: 13px;
}
.operation-form #operation-participants {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.operation-participant-row {
  display: flex;
  align-items: center;
  gap: 6px;
}
.operation-participant-row select {
  min-width: 180px;
}
.operation-form .operation-type {
  display: block;
  width: min(220px, 100%);
}
.operation-form h4 {
  margin: 14px 0 8px;
  font-size: 16px;
}
.operation-form .operation-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.operation-form .operation-grid textarea.in {
  min-width: 0;
  min-height: 68px;
  margin: 0;
}
.operation-form .operation-grid .operation-full {
  grid-column: 1 / -1;
  min-height: 84px;
}
.operation-anesthesia {
  min-width: 0;
  margin: 0;
  padding: 8px;
  border: 1px solid var(--bd);
  border-radius: 6px;
}
.operation-anesthesia legend {
  padding: 0 4px;
  font-size: 13px;
}
.operation-anesthesia > div {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px 8px;
}
.operation-anesthesia .cb {
  margin: 0;
}
.operation-anesthesia input {
  width: auto;
  margin: 0;
}
@media (max-width: 560px) {
  #mf.operation-form-dialog {
    padding: 16px;
  }
  .operation-form .operation-request-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .operation-form .operation-grid {
    grid-template-columns: 1fr;
  }
  .operation-form .operation-grid .operation-full {
    grid-column: auto;
  }
}
.vaccination-form {
  display: grid;
  gap: 12px;
}
.vaccination-form .fl {
  margin: 0;
}
.vax-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin-top: 5px;
}
.vax-table-wrap {
  width: 100%;
  overflow-x: auto;
}
.vax-table {
  width: 100%;
  min-width: 650px;
  border-collapse: collapse;
}
.vax-table th {
  padding: 10px 8px;
  background: #033993;
  color: #fff;
  text-align: center;
  font-size: 13px;
}
.vax-table td {
  padding: 4px;
  border: 1px solid var(--bd);
}
.vax-table .in {
  min-width: 0;
}
.vax-name {
  display: flex;
  align-items: center;
  gap: 7px;
}
.vax-dose-index {
  display: inline-flex;
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 11px;
  font-weight: 600;
}
.vax-check {
  display: flex;
  justify-content: center;
}
.vax-check input {
  width: auto;
  min-width: 0;
}
.vax-footer {
  gap: 10px;
}
.vax-add-row {
  margin: 6px 0 12px;
}
.vax-footer .fl {
  margin: 0;
}
.vaccination-record > .bd {
  margin-left: 6px;
}
.vaccination-record-doses {
  display: grid;
  gap: 4px;
  margin-top: 8px;
}
.vaccination-record-doses > div {
  display: grid;
  grid-template-columns: minmax(100px, 1fr) minmax(90px, 140px) 90px minmax(
      100px,
      1fr
    );
  gap: 8px;
  padding: 5px 0;
  border-bottom: 1px solid var(--bd);
  font-size: 12px;
}
#mf.schedule-form {
  width: min(540px, 95vw);
  padding: 20px 22px;
}
#mf.service-form {
  width: min(380px, 92vw);
}
#mf.service-form textarea.in {
  width: 100%;
  min-height: 84px;
  margin-top: 4px;
  resize: vertical;
}
.sch-form {
  display: grid;
  gap: 10px;
}
.sch-form-row {
  display: grid;
  grid-template-columns: 118px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
}
.sch-form-row > label:first-child,
.sch-form-label {
  text-align: right;
  font-size: 13px;
}
.sch-form-row > .in,
.sch-form-row textarea.in {
  width: 100%;
  min-width: 0;
}
.sch-form-row textarea.in {
  resize: vertical;
}
.sch-selection-wrap,
.sch-amount {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  border: 1px solid var(--bd);
  border-radius: 7px;
  padding: 0 10px;
}
.sch-selection-wrap {
  border-color: #bfdbfe;
  color: var(--p);
}
.sch-selection {
  flex: 1;
  min-width: 0;
  border: 0 !important;
  color: var(--p) !important;
  background: transparent !important;
}
.sch-link {
  color: var(--p);
}
.sch-amount input.in {
  flex: 1;
  min-width: 0;
  border: 0;
  padding-left: 0;
}
.sch-amount > span:last-child {
  color: var(--mu);
  font-size: 12px;
}
.sch-radios,
.sch-check {
  display: flex;
  align-items: center;
  gap: 12px;
}
.sch-radio,
.sch-check {
  display: flex;
  font-size: 13px;
  margin: 0;
}
.sch-radio input,
.sch-check input {
  width: auto;
  min-width: 0;
  margin: 0 4px 0 0;
}
.sch-billing-icon {
  color: #f59e0b;
}
@media (max-width: 560px) {
  .sch-form-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }
  .sch-form-row > label:first-child,
  .sch-form-label {
    text-align: left;
  }
}
#mf.xl {
  width: min(920px, 96vw);
}
#mf.billing-dialog {
  width: min(1600px, 96vw);
  max-height: 94vh;
  overflow: auto;
}
#mf.doctor-form {
  width: min(430px, 96vw);
  padding: 16px 18px;
}
.doctor-form-head,
.doctor-form-actions,
.doctor-signature-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.doctor-form-head h2 {
  margin: 0;
  font-size: 18px;
}
.doctor-form-head p {
  margin-top: 2px;
  color: var(--mu);
  font-size: 12px;
}
.doctor-close {
  align-self: flex-start;
  border: 0;
  background: transparent;
  color: var(--mu);
  font-size: 22px;
  cursor: pointer;
}
.doctor-photo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin: 12px 0;
}
.doctor-avatar {
  width: 72px;
  height: 72px;
  overflow: hidden;
  border-radius: 50%;
  background: var(--hv);
  display: grid;
  place-items: center;
  font-size: 28px;
}
.doctor-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
#pf_photo {
  display: none;
}
.doctor-upload {
  font-size: 12px;
}
.doctor-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px 12px;
}
.doctor-fields label {
  display: block;
  margin: 6px 0;
  font-size: 11px;
}
.doctor-fields .in {
  display: block;
  width: 100%;
  min-width: 0;
  margin-top: 3px;
  padding: 7px 9px;
  font-size: 12px;
}
.doctor-fields .span2 {
  grid-column: 1 / -1;
}
.doctor-signature-label {
  display: block;
  margin: 8px 0 4px;
  font-size: 11px;
}
.doctor-signature {
  border: 1px solid var(--bd);
  border-radius: 7px;
  padding: 5px;
}
.doctor-signature canvas {
  display: block;
  width: 100%;
  height: 92px;
  border-radius: 4px;
  background: #f1f3f6;
  touch-action: none;
  cursor: crosshair;
}
.doctor-signature-tools {
  align-items: flex-start;
  margin: 7px 0 12px;
}
.doctor-colors {
  display: grid;
  grid-template-columns: repeat(6, 20px);
  gap: 7px;
}
.dr-color {
  width: 20px;
  height: 20px;
  border: 2px solid transparent;
  border-radius: 50%;
  background: var(--sig-color);
  cursor: pointer;
}
.dr-color.selected {
  outline: 2px solid var(--sig-color);
  outline-offset: 2px;
}
.doctor-form-actions {
  justify-content: flex-end;
}
.doctor-grid {
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}
.doctor-card {
  position: relative;
  overflow: hidden;
  padding: 20px 16px 0;
  border: 1px solid var(--bd);
  border-top: 5px solid transparent;
  border-image: linear-gradient(90deg, #3b82f6, #a855f7) 1;
  text-align: center;
}
.doctor-card-open {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  border: 0;
  background: transparent;
  cursor: pointer;
}
.doctor-card .av,
.doctor-card > b,
.doctor-card > .bd,
.doctor-card-info,
.doctor-card-actions {
  position: relative;
  z-index: 2;
}
.doctor-card .av {
  width: 76px;
  height: 76px;
  border: 3px solid #fff;
  box-shadow: 0 2px 8px #0f172a22;
}
.doctor-card-info {
  margin: 14px 4px 16px;
  padding: 10px;
  border-radius: 8px;
  background: var(--hv);
  color: var(--mu);
  text-align: left;
  font-size: 12px;
  line-height: 2;
}
.doctor-card-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 0 -16px;
  padding: 10px 14px;
  border-top: 1px solid var(--bd);
  background: var(--bg);
}
.doctor-card-actions button {
  cursor: pointer;
}
.doctor-history-button {
  position: relative;
  z-index: 3;
  width: 30px;
  height: 28px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #16a34a;
  font-size: 18px;
  cursor: pointer;
}
.doctor-history-button:hover {
  background: #dcfce7;
}
.doctor-card-link {
  position: relative;
  color: inherit;
  text-decoration: none;
}
.doctor-profile-head {
  display: flex;
  justify-content: space-between;
  margin-bottom: 12px;
}
.doctor-profile-card,
.doctor-profile-content {
  overflow: hidden;
  border: 1px solid var(--bd);
  border-radius: 10px;
  background: var(--cd);
  box-shadow: 0 1px 4px #0000000a;
}
.doctor-profile-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px;
}
.doctor-identity {
  display: flex;
  align-items: center;
  gap: 14px;
}
.doctor-identity h2 {
  margin: 0 0 6px;
  font-size: 20px;
}
.doctor-identity p {
  margin-top: 7px;
}
.doctor-icon {
  color: #16a34a;
}
.doctor-profile-avatar {
  display: grid;
  width: 76px;
  height: 76px;
  overflow: hidden;
  place-items: center;
  border-radius: 50%;
  background: var(--hv);
  color: var(--mu);
  font-size: 30px;
}
.doctor-profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.doctor-badges {
  display: flex;
  align-items: stretch;
  gap: 8px;
}
.doctor-badges > div:not(.doctor-barcode) {
  display: grid;
  min-width: 88px;
  padding: 10px;
  place-content: center;
  border: 1px solid var(--bd);
  border-radius: 7px;
  background: var(--bg);
  text-align: center;
}
.doctor-badges span,
.doctor-detail-grid span {
  display: block;
  margin-bottom: 4px;
  color: var(--mu);
  font-size: 11px;
}
.doctor-badges b {
  font-size: 12px;
}
.doctor-barcode {
  display: grid;
  justify-items: center;
  align-content: center;
  min-width: 70px;
  text-align: center;
}
.doctor-barcode div {
  display: flex;
  height: 26px;
  align-items: center;
  gap: 2px;
  margin: 2px 0;
}
.doctor-barcode i {
  display: block;
  background: var(--tx);
}
.doctor-detail-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px 18px;
  padding: 16px 18px;
  border-top: 1px solid var(--bd);
  background: var(--bg);
}
.doctor-detail-grid b {
  font-size: 12px;
  font-weight: 500;
}
.doctor-profile-content {
  margin-top: 14px;
}
.doctor-profile-tabs {
  display: flex;
  gap: 4px;
  padding: 8px 16px 0;
  overflow-x: auto;
  border-bottom: 1px solid var(--bd);
}
.doctor-profile-tabs button {
  padding: 8px 12px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--mu);
  cursor: pointer;
  white-space: nowrap;
}
.doctor-profile-tabs button.on {
  border-bottom-color: #22c55e;
  color: #16a34a;
}
.doctor-tab-content {
  padding: 16px;
}
.doctor-section {
  padding: 16px;
  border: 1px solid var(--bd);
  border-radius: 8px;
}
.doctor-section h3 {
  margin: 0 0 8px;
}
.payroll-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}
.payroll-summary > div {
  display: grid;
  gap: 6px;
  padding: 14px;
  border-radius: 8px;
  background: var(--hv);
}
.payroll-summary b {
  font-family: Georgia, serif;
  font-size: 13px;
}
.payroll-summary strong {
  font-size: 18px;
  font-weight: 500;
}
.payroll-toolbar {
  display: flex;
  justify-content: space-between;
  margin: 8px 0 12px;
}
.payroll-table-wrap {
  overflow-x: auto;
}
.payroll-table {
  min-width: 920px;
}
.payroll-table th {
  background: var(--hv);
  color: var(--tx);
  font-family: Georgia, serif;
  font-size: 12px;
}
.payroll-table td {
  white-space: nowrap;
  font-size: 12px;
}
.payroll-actions {
  display: flex;
  gap: 4px;
}
.payroll-empty {
  height: 120px;
  color: #f87171;
  text-align: center;
  font-size: 13px;
  font-style: italic;
}
.payslip-form {
  width: min(640px, 96vw);
  max-height: 94vh;
  overflow-y: auto;
}
.payslip-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}
.payslip-head h2 {
  margin: 0;
  font-size: 18px;
}
.payslip-head p {
  margin: 3px 0 14px;
  color: var(--mu);
  font-size: 12px;
}
.payslip-person {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 14px;
  padding: 12px;
  border: 1px solid var(--bd);
  border-radius: 7px;
  background: var(--bg);
}
.payslip-person span {
  display: block;
  color: var(--mu);
  font-size: 11px;
}
.payslip-person b {
  font-size: 12px;
}
.payslip-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 12px;
  align-items: end;
}
.payslip-fields label {
  display: block;
  font-size: 11px;
}
.payslip-fields .in {
  display: block;
  width: 100%;
  min-width: 0;
  margin-top: 4px;
  padding: 8px 10px;
  font-size: 12px;
}
.payslip-date-label {
  grid-column: 1 / -1;
  margin-bottom: -8px;
  font-size: 11px;
}
.payslip-fields .deduction {
  color: #ef4444;
}
.payslip-fields .payslip-note {
  grid-column: 1 / -1;
}
.payslip-fields textarea.in {
  resize: vertical;
}
.payslip-net {
  display: flex;
  justify-content: space-between;
  margin-top: 14px;
  padding: 12px;
  border: 1px solid #bfdbfe;
  border-radius: 6px;
  background: #eff6ff;
  color: #1d4ed8;
}
.payslip-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
@media (max-width: 820px) {
  .doctor-profile-top {
    align-items: flex-start;
    flex-direction: column;
  }
  .doctor-badges {
    width: 100%;
    overflow-x: auto;
  }
  .doctor-detail-grid,
  .payroll-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.sec {
  border: 1px solid var(--bd);
  border-radius: 10px;
  padding: 12px 14px;
  margin: 10px 0;
  background: var(--hv);
}
.sh {
  display: block;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--p);
  margin-bottom: 6px;
}
.g2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.g3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px 12px;
}
#mf .fl {
  margin: 8px 0;
}
#mf textarea.in {
  width: 100%;
  resize: vertical;
}
#mf select.in {
  width: 100%;
}
.pk2 {
  width: auto !important;
  float: right;
  font-size: 12px;
  padding: 2px 6px;
  min-width: 0;
}
.cb {
  display: flex;
  gap: 6px;
  align-items: center;
  margin: 4px 0;
  font-size: 13px;
}
.cb input {
  width: auto;
  min-width: 0;
  margin: 0;
}
.cbg {
  margin: 10px 0;
}
.mon {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin: 4px 0;
}
.in.sm {
  width: 80px;
  min-width: 0;
}
.dash {
  border: 1px dashed var(--p);
  color: var(--p);
  width: 100%;
  margin-top: 8px;
}
.fb {
  position: sticky;
  bottom: -1px;
  background: var(--cd);
  padding: 10px 0 2px;
  margin-top: 10px;
  border-top: 1px solid var(--bd);
}
#agebox[data-mode="manual"] :is(.m-ym, .m-dob),
#agebox[data-mode="ym"] :is(.m-manual, .m-dob),
#agebox[data-mode="dob"] :is(.m-manual, .m-ym) {
  display: none !important;
}
.mh {
  margin: 18px 0 4px;
  font-size: 15px;
}
.ms {
  margin: 12px 0 2px;
  font-size: 13px;
  color: var(--mu);
}
table.mt {
  width: 100%;
}
table.mt th {
  padding: 6px;
  font-size: 12px;
}
table.mt td {
  padding: 3px;
}
table.mt .in {
  width: 100%;
  min-width: 0;
}
a {
  color: var(--p);
  text-decoration: none;
  cursor: pointer;
}
a:hover {
  text-decoration: underline;
}
.pdh {
  display: flex;
  gap: 18px;
  padding: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.pda {
  text-align: center;
}
.pdi {
  flex: 1;
  min-width: 260px;
}
.av.big {
  width: 84px;
  height: 84px;
  font-size: 36px;
}
.pdg {
  margin-top: 10px;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}
.pdw {
  display: grid;
  grid-template-columns: 230px 1fr;
  gap: 16px;
  align-items: start;
}
.pdm {
  padding: 8px;
}
.pdm .it {
  margin: 2px 0;
}
.pdr {
  padding: 16px;
  min-height: 260px;
}
.patient-documents {
  min-height: 260px;
  padding: 8px 10px 24px;
}
.patient-documents-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}
.patient-documents-header h2 {
  margin: 0;
  color: #111827;
  font-size: 20px;
}
.patient-documents-actions {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
}
.patient-documents-type-button,
.patient-documents-upload {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  white-space: nowrap;
}
.patient-documents-type-button {
  min-width: 176px;
  justify-content: space-between;
  color: #273449;
}
.patient-documents-upload.btn.p {
  min-width: 100px;
  border: 0;
  background: linear-gradient(110deg, #033993, #9333ea);
  box-shadow: 0 6px 14px #03399333;
}
.patient-documents-type-menu {
  position: absolute;
  top: calc(100% + 5px);
  right: 48px;
  width: min(300px, calc(100vw - 48px));
  padding: 6px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: var(--cd, #fff);
  box-shadow: 0 5px 12px #0f172a24;
}
.patient-documents-type-option {
  display: flex;
  width: 100%;
  min-height: 34px;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--tx, #1f2937);
  cursor: pointer;
  font: inherit;
  text-align: left;
}
.patient-documents-type-option:hover,
.patient-documents-type-option:focus-visible {
  background: #f1f5f9;
  outline: none;
}
.patient-documents-type-option > span {
  display: inline-flex;
  width: 18px;
  flex: 0 0 18px;
  justify-content: center;
  color: #374151;
}
.patient-documents-list {
  display: grid;
  gap: 10px;
}
.patient-documents-list > .emp {
  margin: 0;
  padding: 0;
  color: var(--mu);
}
#mf.patient-medical-card-list-dialog {
  display: flex;
  width: min(710px, 94vw);
  max-height: 88vh;
  flex-direction: column;
  padding: 18px 24px 24px !important;
}
.patient-medical-card-list-dialog > .operation-form-heading {
  margin: -18px -24px 12px;
  padding: 14px 24px 10px;
}
.patient-medical-card-list-dialog > .tools.fb {
  margin-top: 16px;
}
.patient-medical-card-empty {
  margin: 0;
  padding: 4px 0 2px;
  color: #98a2b3;
  text-align: center;
}
.patient-medical-card-list {
  display: grid;
  gap: 8px;
  max-height: 55vh;
  overflow: auto;
}
.patient-medical-card-record {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--bd);
  border-radius: 6px;
}
.patient-medical-card-record > div:first-child {
  display: grid;
  gap: 4px;
}
.patient-medical-card-record > div:first-child > span {
  color: var(--mu);
  font-size: 13px;
}
.patient-medical-card-record-actions {
  display: flex;
  gap: 6px;
}
#mf.patient-medical-card-dialog {
  display: flex;
  width: min(950px, 96vw);
  max-height: 94vh;
  flex-direction: column;
  overflow: auto;
  padding: 18px 24px 0 !important;
}
.patient-medical-card-dialog > .operation-form-heading {
  position: sticky;
  z-index: 3;
  top: -19px;
  margin: -18px -24px 12px;
  padding: 14px 24px 10px;
  border-bottom: 1px solid var(--bd);
  background: var(--cd);
}
.patient-medical-card-dialog > .operation-form-heading h3 {
  font-size: 19px;
}
.patient-medical-card-form {
  display: grid;
  gap: 12px;
}
.patient-medical-card-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.patient-medical-card-form > .fl {
  min-width: 0;
  margin: 0;
}
.patient-medical-card-form > .fl .in {
  width: 100%;
  min-width: 0;
  height: 85px;
  margin-top: 4px;
}
.patient-medical-card-form > .fl:last-child .in {
  height: 145px;
}
.patient-medical-card-grid .in {
  width: 100%;
  min-width: 0;
  height: 42px;
  margin-top: 4px;
}
.patient-medical-card-dialog > .fb {
  position: sticky;
  bottom: 0;
  z-index: 3;
  margin: 12px -24px 0;
  padding: 10px 24px 14px;
  background: var(--cd);
}
@media (max-width: 600px) {
  .patient-documents-header {
    align-items: flex-start;
    flex-direction: column;
  }
  .patient-documents-actions {
    width: 100%;
  }
  .patient-documents-type {
    flex: 1;
    min-width: 0;
  }
  .patient-documents-type-button {
    width: 100%;
    min-width: 0;
  }
  .patient-documents-type-menu {
    top: calc(100% + 5px);
    right: 0;
  }
  .patient-medical-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  #mf.patient-medical-card-dialog,
  #mf.patient-medical-card-list-dialog {
    width: 96vw;
    padding-right: 16px !important;
    padding-left: 16px !important;
  }
  .patient-medical-card-dialog > .operation-form-heading,
  .patient-medical-card-list-dialog > .operation-form-heading {
    margin-right: -16px;
    margin-left: -16px;
    padding-right: 16px;
    padding-left: 16px;
  }
  .patient-medical-card-dialog > .fb {
    margin-right: -16px;
    margin-left: -16px;
    padding-right: 16px;
    padding-left: 16px;
  }
}
#mf.patient-prescription-note-dialog {
  display: flex;
  width: min(940px, 96vw);
  max-height: 94vh;
  flex-direction: column;
  overflow: auto;
  padding: 18px 22px 0 !important;
}
.patient-prescription-note-dialog > .operation-form-heading {
  position: sticky;
  z-index: 3;
  top: -19px;
  margin: -18px -22px 12px;
  padding: 14px 22px 10px;
  border-bottom: 1px solid var(--bd);
  background: var(--cd);
}
.patient-prescription-note-form {
  min-width: 0;
  overflow-x: auto;
}
.patient-prescription-note-table {
  width: 100%;
  border-collapse: collapse;
}
.patient-prescription-note-table th,
.patient-prescription-note-table td {
  padding: 9px 10px;
  border: 1px solid var(--bd);
  text-align: left;
  vertical-align: top;
}
.patient-prescription-note-table th {
  background: var(--bg);
  font-size: 13px;
}
.patient-prescription-note-table .patient-prescription-note-heading-emphasis {
  color: #000;
  font-weight: 700;
}
.patient-prescription-note-table label {
  display: block;
  margin: 0;
  font-size: 12px;
}
.patient-prescription-note-table .in {
  width: 100%;
  min-width: 0;
  margin-top: 5px;
}
.patient-prescription-note-table textarea.in {
  min-height: 76px;
  resize: vertical;
}
.patient-prescription-note-date-range {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.patient-prescription-note-dialog > .fb {
  position: sticky;
  bottom: 0;
  z-index: 3;
  margin: 12px -22px 0;
  padding: 10px 22px 14px;
  background: var(--cd);
}
@media (max-width: 600px) {
  #mf.patient-prescription-note-dialog {
    width: 96vw;
    padding-right: 14px !important;
    padding-left: 14px !important;
  }
  .patient-prescription-note-dialog > .operation-form-heading {
    margin-right: -14px;
    margin-left: -14px;
    padding-right: 14px;
    padding-left: 14px;
  }
  .patient-prescription-note-table th,
  .patient-prescription-note-table td {
    padding: 7px;
  }
  .patient-prescription-note-date-range {
    grid-template-columns: 1fr;
  }
  .patient-prescription-note-dialog > .fb {
    margin-right: -14px;
    margin-left: -14px;
    padding-right: 14px;
    padding-left: 14px;
  }
}
#mf.patient-referral-dialog {
  display: flex;
  width: min(1260px, 96vw);
  max-height: 94vh;
  flex-direction: column;
  overflow: auto;
  padding: 18px 24px 0 !important;
}
#mf.patient-hospital-dialog {
  display: flex;
  width: min(980px, 96vw);
  max-height: 94vh;
  flex-direction: column;
  overflow: auto;
  padding: 18px 24px 0 !important;
}
.patient-hospital-dialog > .operation-form-heading {
  position: sticky;
  z-index: 3;
  top: -19px;
  margin: -18px -24px 12px;
  padding: 14px 24px 10px;
  border-bottom: 1px solid var(--bd);
  background: var(--cd);
}
.patient-hospital-dialog > .operation-form-heading h3 {
  font-size: 19px;
}
.patient-hospital-form {
  display: grid;
  gap: 8px 14px;
}
.patient-hospital-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px 10px;
}
.patient-hospital-grid .fl {
  min-width: 0;
  margin: 3px 0;
}
.patient-hospital-grid .in {
  min-width: 0;
  height: 42px;
}
.patient-hospital-top {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  padding-bottom: 8px;
  border-bottom: 1px solid var(--bd);
}
.patient-hospital-section {
  padding: 0 0 9px;
  border-bottom: 1px solid var(--bd);
}
.patient-hospital-section h4 {
  margin: 0 0 7px;
  font-size: 14px;
}
.patient-hospital-status {
  display: flex;
  min-height: 36px;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px 16px;
}
.patient-hospital-status .cb {
  margin: 2px 0;
  white-space: nowrap;
}
.patient-hospital-children {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.patient-hospital-children .in {
  width: 84px;
  height: 40px;
}
.patient-hospital-grid-two {
  gap: 4px 10px;
}
.patient-hospital-vitals {
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px 8px;
}
.patient-hospital-admission {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px 8px;
}
.patient-hospital-grid textarea.in {
  height: auto;
  min-height: 86px;
}
.patient-hospital-discharge {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.patient-hospital-last {
  padding-bottom: 4px;
  border-bottom: 0;
}
.patient-hospital-dialog > .fb {
  position: sticky;
  bottom: 0;
  z-index: 3;
  margin: 10px -24px 0;
  padding: 10px 24px 14px;
  background: var(--cd);
}
@media (max-width: 700px) {
  #mf.patient-hospital-dialog {
    width: min(96vw, 560px);
    padding-right: 16px !important;
    padding-left: 16px !important;
  }
  .patient-hospital-dialog > .operation-form-heading,
  .patient-hospital-dialog > .fb {
    margin-right: -16px;
    margin-left: -16px;
    padding-right: 16px;
    padding-left: 16px;
  }
  .patient-hospital-top,
  .patient-hospital-admission {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .patient-hospital-vitals {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
#mf.patient-treatment-dialog {
  display: flex;
  width: min(980px, 96vw);
  max-height: 94vh;
  flex-direction: column;
  overflow: auto;
  padding: 18px 24px 0 !important;
}
.patient-treatment-dialog > .operation-form-heading {
  position: sticky;
  z-index: 3;
  top: -19px;
  margin: -18px -24px 12px;
  padding: 14px 24px 10px;
  border-bottom: 1px solid var(--bd);
  background: var(--cd);
}
.patient-treatment-dialog > .operation-form-heading h3 {
  font-size: 19px;
}
.patient-treatment-form {
  display: grid;
  gap: 12px;
}
.patient-treatment-fieldset {
  display: grid;
  min-width: 0;
  margin: 0;
  padding: 12px 16px 14px;
  border: 1px solid var(--bd);
  border-radius: 6px;
}
.patient-treatment-fieldset legend {
  padding: 0 8px;
  font-size: 15px;
  font-weight: 700;
}
.patient-treatment-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 16px;
}
.patient-treatment-patient {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.patient-treatment-grid .fl {
  min-width: 0;
  margin: 4px 0;
}
.patient-treatment-grid .in {
  width: 100%;
  min-width: 0;
  height: 42px;
  margin-top: 4px;
}
.patient-treatment-grid textarea.in {
  height: auto;
  min-height: 86px;
}
.patient-treatment-full {
  grid-column: 1 / -1;
}
.patient-treatment-signatures .in::placeholder {
  color: #94a3b8;
}
.patient-treatment-dialog > .fb {
  position: sticky;
  bottom: 0;
  z-index: 3;
  margin: 12px -24px 0;
  padding: 10px 24px 14px;
  background: var(--cd);
}
@media (max-width: 700px) {
  #mf.patient-treatment-dialog {
    width: min(96vw, 560px);
    padding-right: 16px !important;
    padding-left: 16px !important;
  }
  .patient-treatment-dialog > .operation-form-heading,
  .patient-treatment-dialog > .fb {
    margin-right: -16px;
    margin-left: -16px;
    padding-right: 16px;
    padding-left: 16px;
  }
  .patient-treatment-patient {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
#mf.patient-health-dialog {
  display: flex;
  width: min(1050px, 96vw);
  max-height: 94vh;
  flex-direction: column;
  overflow: auto;
  padding: 18px 24px 0 !important;
}
.patient-health-dialog > .operation-form-heading {
  position: sticky;
  z-index: 3;
  top: -19px;
  margin: -18px -24px 12px;
  padding: 14px 24px 10px;
  border-bottom: 1px solid var(--bd);
  background: var(--cd);
}
.patient-health-dialog > .operation-form-heading h3 {
  font-size: 19px;
}
.patient-health-form {
  display: grid;
  gap: 12px;
}
.patient-health-fieldset {
  min-width: 0;
  margin: 0;
  padding: 12px 14px 14px;
  border: 1px solid var(--bd);
  border-radius: 8px;
}
.patient-health-fieldset > legend {
  padding: 0 8px;
  font-size: 15px;
  font-weight: 700;
}
.patient-health-grid {
  display: grid;
  gap: 8px 14px;
  align-items: end;
}
.patient-health-patient {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.patient-health-address {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.patient-health-doctor {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.patient-health-grid .fl,
.patient-health-sections .fl {
  min-width: 0;
  margin: 4px 0;
}
.patient-health-grid .in,
.patient-health-sections .in {
  width: 100%;
  min-width: 0;
  margin-top: 4px;
}
.patient-health-sections {
  display: grid;
  gap: 8px;
}
.patient-health-sections textarea.in {
  min-height: 88px;
  resize: vertical;
}
.patient-health-dialog > .fb {
  position: sticky;
  bottom: 0;
  z-index: 3;
  margin: 12px -24px 0;
  padding: 10px 24px 14px;
  background: var(--cd);
}
@media (max-width: 700px) {
  #mf.patient-health-dialog {
    width: min(96vw, 600px);
    padding-right: 16px !important;
    padding-left: 16px !important;
  }
  .patient-health-dialog > .operation-form-heading,
  .patient-health-dialog > .fb {
    margin-right: -16px;
    margin-left: -16px;
    padding-right: 16px;
    padding-left: 16px;
  }
  .patient-health-patient,
  .patient-health-address {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
#mf.patient-medical-rest-a-dialog {
  display: flex;
  width: min(950px, 96vw);
  max-height: 94vh;
  flex-direction: column;
  overflow: auto;
  padding: 18px 24px 0 !important;
}
.patient-medical-rest-a-dialog > .operation-form-heading {
  position: sticky;
  z-index: 3;
  top: -19px;
  margin: -18px -24px 12px;
  padding: 14px 24px 10px;
  border-bottom: 1px solid var(--bd);
  background: var(--cd);
}
.patient-medical-rest-a-dialog > .operation-form-heading h3 {
  font-size: 19px;
}
.patient-medical-rest-a-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.patient-medical-rest-a-column {
  display: grid;
  min-width: 0;
  align-content: start;
  gap: 12px;
}
.patient-medical-rest-a-column .fl {
  min-width: 0;
  margin: 0;
}
.patient-medical-rest-a-column .in {
  width: 100%;
  min-width: 0;
  height: 42px;
  margin-top: 4px;
}
.patient-medical-rest-a-department {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
}
.patient-medical-rest-a-department > .cb {
  margin: 0 0 12px;
  white-space: nowrap;
}
.patient-medical-rest-a-patient {
  display: grid;
  grid-template-columns: 1.1fr 1.1fr 1fr;
  gap: 10px;
}
.patient-medical-rest-a-pair,
.patient-medical-rest-a-address-two {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.patient-medical-rest-a-address-title {
  margin: 0 0 -4px;
  font-size: 16px;
  text-align: left;
  text-decoration: underline;
}
.patient-medical-rest-a-address-three {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.patient-medical-rest-a-dialog > .fb {
  position: sticky;
  bottom: 0;
  z-index: 3;
  margin: 12px -24px 0;
  padding: 10px 24px 14px;
  background: var(--cd);
}
@media (max-width: 700px) {
  #mf.patient-medical-rest-a-dialog {
    width: min(96vw, 600px);
    max-height: 96vh;
    padding-right: 16px !important;
    padding-left: 16px !important;
  }
  .patient-medical-rest-a-dialog > .operation-form-heading,
  .patient-medical-rest-a-dialog > .fb {
    margin-right: -16px;
    margin-left: -16px;
    padding-right: 16px;
    padding-left: 16px;
  }
  .patient-medical-rest-a-form {
    grid-template-columns: minmax(0, 1fr);
  }
}
#mf.patient-birth-dialog {
  display: flex;
  width: min(1220px, 96vw);
  max-height: 90vh;
  flex-direction: column;
  overflow: auto;
  padding: 18px 24px 0 !important;
}
.patient-birth-dialog > .operation-form-heading {
  position: sticky;
  z-index: 3;
  top: -19px;
  margin: -18px -24px 12px;
  padding: 14px 24px 10px;
  border-bottom: 1px solid var(--bd);
  background: var(--cd);
}
.patient-birth-dialog > .operation-form-heading h3 {
  font-size: 19px;
}
.patient-birth-form {
  display: grid;
  gap: 12px;
}
.patient-birth-fieldset {
  min-width: 0;
  margin: 0;
  padding: 12px 14px 14px;
  border: 1px solid var(--bd);
  border-radius: 6px;
}
.patient-birth-fieldset > legend {
  padding: 0 8px;
  font-size: 15px;
  font-weight: 700;
}
.patient-birth-grid {
  display: grid;
  gap: 8px 16px;
  align-items: end;
}
.patient-birth-meta {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.patient-birth-parent,
.patient-birth-child {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.patient-birth-grid .fl {
  min-width: 0;
  margin: 4px 0;
}
.patient-birth-grid .in {
  width: 100%;
  min-width: 0;
  height: 42px;
  margin-top: 4px;
}
.patient-birth-dialog > .fb {
  position: sticky;
  bottom: 0;
  z-index: 3;
  margin: 12px -24px 0;
  padding: 10px 24px 14px;
  background: var(--cd);
}
@media (max-width: 700px) {
  #mf.patient-birth-dialog {
    width: min(96vw, 600px);
    max-height: 96vh;
    padding-right: 16px !important;
    padding-left: 16px !important;
  }
  .patient-birth-dialog > .operation-form-heading,
  .patient-birth-dialog > .fb {
    margin-right: -16px;
    margin-left: -16px;
    padding-right: 16px;
    padding-left: 16px;
  }
  .patient-birth-parent,
  .patient-birth-child {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.patient-referral-dialog > .operation-form-heading {
  position: sticky;
  z-index: 3;
  top: -19px;
  margin: -18px -24px 12px;
  padding: 14px 24px 10px;
  border-bottom: 1px solid var(--bd);
  background: var(--cd);
}
.patient-referral-dialog > .operation-form-heading h3 {
  font-size: 19px;
}
.patient-referral-dialog > .fb {
  position: sticky;
  bottom: 0;
  z-index: 3;
  margin: 12px -24px 0;
  padding: 10px 24px 14px;
  background: var(--cd);
}
.patient-referral-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 16px;
  min-width: 0;
  color: var(--tx);
}
.patient-referral-form .fl {
  min-width: 0;
  margin: 0;
}
.patient-referral-form .in {
  min-width: 0;
}
.patient-referral-full {
  grid-column: 1 / -1;
}
.patient-referral-note {
  margin: 2px 0;
  font-weight: 600;
}
.patient-referral-top-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 170px;
  gap: 16px;
  align-items: end;
}
.patient-referral-fieldset {
  min-width: 0;
  margin: 0;
  padding: 12px 14px 14px;
  border: 1px solid var(--bd);
  border-radius: 8px;
}
.patient-referral-fieldset > legend {
  padding: 0 8px;
  font-size: 15px;
  font-weight: 700;
}
.patient-referral-fieldset .fl {
  min-width: 0;
  margin: 4px 0 8px;
}
.patient-referral-fieldset .in {
  min-width: 0;
}
.patient-referral-patient-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 0.8fr 1.2fr 1fr 1.4fr;
  gap: 8px 14px;
  align-items: end;
}
.patient-referral-three-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px 14px;
  align-items: end;
}
.patient-referral-five-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px 14px;
}
.patient-referral-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  align-items: stretch;
}
.patient-referral-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 16px;
  align-items: center;
}
.patient-referral-checks .cb {
  min-height: 24px;
  margin: 0;
  white-space: normal;
}
#mf.patient-referral-dialog .patient-referral-fieldset input[type="checkbox"],
#mf.patient-referral-dialog .patient-referral-fieldset input[type="radio"] {
  width: 18px;
  min-width: 18px;
  margin: 0 4px 0 0;
}
.patient-referral-assessment {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1fr) minmax(0, 1.15fr);
  gap: 14px;
  align-items: stretch;
}
.patient-referral-body-diagram {
  display: flex;
  min-height: 180px;
  align-items: center;
  justify-content: center;
}
.patient-referral-body-diagram img {
  display: block;
  width: min(230px, 100%);
  max-height: 180px;
  height: auto;
  object-fit: contain;
}
.patient-referral-vitals {
  display: grid;
  gap: 12px;
}
.patient-referral-vital-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px 12px;
}
.patient-referral-form textarea.in {
  min-height: 64px;
  resize: vertical;
}
.patient-referral-record {
  border-left: 4px solid #033993;
}
@media (max-width: 900px) {
  .patient-referral-patient-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .patient-referral-five-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (max-width: 640px) {
  .patient-referral-dialog {
    width: 98vw;
    max-height: 96vh;
    padding: 14px 14px 0 !important;
  }
  .patient-referral-dialog > .operation-form-heading {
    top: -15px;
    margin: -14px -14px 10px;
    padding: 12px 14px 9px;
  }
  .patient-referral-dialog > .fb {
    flex-wrap: wrap;
    margin: 10px -14px 0;
    padding: 10px 14px 12px;
  }
  .patient-referral-top-grid,
  .patient-referral-patient-grid,
  .patient-referral-three-grid,
  .patient-referral-five-grid,
  .patient-referral-columns,
  .patient-referral-assessment {
    grid-template-columns: 1fr;
  }
  .patient-referral-form {
    grid-template-columns: 1fr;
  }
}
.consultation-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--bd);
}
.consultation-toolbar .btn {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 9px;
  white-space: nowrap;
}
.consultation-toolbar .consultation-icon-button {
  width: 42px;
  padding: 8px;
  font-size: 17px;
}
.consultation-toolbar .consultation-add-button {
  margin-left: auto;
  min-width: 96px;
  background: linear-gradient(110deg, #315efb, #8b2be2);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 5px 12px #462be22b;
}
.consultation-history,
.consultation-notes {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--bd);
}
.consultation-history h3,
.consultation-notes h3 {
  margin: 0 0 8px;
  font-size: 15px;
}
.consultation-record-details {
  display: grid;
  gap: 5px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--bd);
}
.consultation-form {
  display: grid;
  gap: 8px;
}
.consultation-form-section {
  min-width: 0;
  padding: 8px;
  border: 1px solid var(--bd);
  border-radius: 5px;
  background: var(--cd);
}
.consultation-form-section h4 {
  margin: 0 0 10px;
}
.consultation-patient-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 14px;
  margin-bottom: 4px;
  font-size: 12px;
}
.consultation-intake {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
}
.consultation-intake-left,
.consultation-intake-right,
.consultation-question-column {
  min-width: 0;
}
.consultation-intake-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2px 8px;
}
.consultation-intake-grid .fl:last-child {
  grid-column: 1 / -1;
}
.consultation-intake-right {
  display: grid;
  grid-template-rows: 1fr auto;
  align-content: space-between;
  gap: 6px;
  padding-top: 14px;
}
.consultation-time-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.consultation-time-grid .fl {
  min-width: 0;
}
.consultation-section-label,
.consultation-side-heading {
  display: block;
  margin-bottom: 4px;
  font-size: 12px;
  font-weight: 600;
}
.consultation-symptom-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 5px 10px;
}
.consultation-assessment-columns {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
}
.consultation-assessment-bottom {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--bd);
}
.consultation-classification {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
}
.consultation-classification-left {
  display: grid;
  gap: 4px;
}
.consultation-classification-left .consultation-checkbox-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.consultation-classification-right .consultation-checkbox-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.consultation-status-section .consultation-checkbox-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.consultation-questions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
}
.consultation-question-column {
  display: grid;
  align-content: start;
  gap: 3px;
}
.consultation-question-column > b {
  margin-bottom: 3px;
  font-size: 11px;
}
.consultation-question-column .consultation-fieldset {
  border: 0;
  padding: 0;
}
.consultation-question-column .consultation-checkbox-grid {
  display: flex;
  gap: 8px;
}
.consultation-question-inputs,
.consultation-final-dates {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}
.consultation-final-note > textarea.in {
  display: block;
  width: 100%;
  margin-top: 4px;
}
.consultation-exam-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2px 8px;
}
.consultation-form-grid,
.consultation-vitals-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 12px;
}
.consultation-form-grid .fl {
  min-width: 0;
}
.consultation-form-grid textarea.in,
.consultation-form-section > textarea.in {
  width: 100%;
  resize: vertical;
}
#mf.consultation-form-dialog {
  width: min(1480px, 98vw);
  height: min(94vh, 900px);
  max-height: 94vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
#mf.consultation-form-dialog .fl {
  margin: 3px 0;
  font-size: 11px;
}
#mf.consultation-form-dialog .in {
  margin-top: 3px;
  padding: 6px 8px;
  font-size: 12px;
}
#mf.consultation-form-dialog > .operation-form-heading,
#mf.consultation-form-dialog > .fb {
  flex: 0 0 auto;
}
.consultation-form-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding-right: 4px;
}
#mf.consultation-form-dialog > .fb {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--bd);
  background: var(--cd);
}
#mf.md-consultation-dialog {
  display: flex;
  flex-direction: column;
  width: min(1760px, 99vw);
  height: min(94vh, 900px);
  max-height: 94vh;
  overflow: hidden;
}
#mf.md-consultation-dialog > .operation-form-heading,
#mf.md-consultation-dialog > .fb {
  flex: 0 0 auto;
}
#mf.md-consultation-dialog .operation-form-heading {
  margin-bottom: 12px;
}
.md-consultation-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: 0 2px;
  color: #111;
}
.md-consultation-intake {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 4px 10px;
  padding: 8px;
  border: 1px solid #222;
}
.md-consultation-patient {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) 110px 150px;
  align-items: center;
  gap: 8px;
}
.md-inline-field {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  gap: 5px;
  margin: 0;
  white-space: nowrap;
  font-size: 14px;
}
#md .md-inline-field {
  display: inline-flex;
  margin: 0;
}
.md-inline-field .in,
#md .md-inline-field .in {
  flex: 1 1 70px;
  width: 70px;
  min-width: 0;
  height: 27px;
  margin: 0;
  padding: 3px 8px;
  font-size: 14px;
}
.md-consultation-patient .md-inline-field:first-child .in {
  min-width: 96px;
}
.md-consultation-conditions {
  grid-column: 2;
  grid-row: 1 / span 2;
}
.md-consultation-conditions .md-consultation-checks {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.md-consultation-checks {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-content: start;
  gap: 2px 8px;
}
#md .md-consultation-checks .cb,
#md .md-consultation-table .cb {
  display: flex;
  align-items: flex-start;
  min-width: 0;
  margin: 0;
  font-size: 14px;
  line-height: 1.3;
}
#md .md-consultation-checks .cb input,
#md .md-consultation-table .cb input {
  flex: 0 0 auto;
  width: auto;
  min-width: 14px;
  margin: 2px 5px 0 0;
}
.md-consultation-complaint {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-column: 1;
  align-items: center;
  gap: 6px;
  margin: 0;
  font-size: 14px;
}
.md-consultation-complaint .in {
  width: 100%;
  min-width: 0;
  height: 28px;
  margin: 0;
  padding: 3px 8px;
}
.md-consultation-vitals {
  display: flex;
  grid-column: 1;
  flex-wrap: wrap;
  align-items: center;
  gap: 3px 8px;
}
.md-consultation-vitals .md-inline-field .in {
  flex: 0 1 76px;
  width: 76px;
}
.md-consultation-times {
  display: flex;
  grid-column: 2;
  gap: 10px;
}
.md-consultation-times > div {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 4px;
}
.md-consultation-times .md-inline-field {
  flex: 1;
}
.md-consultation-table {
  width: 100%;
  margin-top: 8px;
  border-collapse: collapse;
  table-layout: fixed;
  color: #111;
}
.md-consultation-table th,
.md-consultation-table td {
  padding: 4px;
  border: 1px solid #222;
  background: var(--cd);
  color: #111;
  text-align: left;
  vertical-align: top;
  white-space: normal;
}
.md-consultation-table th {
  width: 25%;
  font-size: 14px;
  font-weight: 400;
}
.md-consultation-table th .cb {
  font-weight: 400;
}
.md-consultation-table td .md-consultation-checks {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.md-consultation-table .md-consultation-full-row th {
  width: auto;
}
.md-consultation-full-row .cb {
  display: inline-flex !important;
  vertical-align: middle;
}
.md-consultation-full-row textarea.in {
  display: inline-block;
  width: calc(100% - 190px);
  min-width: 180px;
  height: 28px;
  margin: 0 0 0 8px;
  padding: 3px 8px;
  vertical-align: middle;
}
.md-consultation-survey {
  display: grid;
  gap: 3px;
}
.md-consultation-survey > div {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 3px 10px;
}
.md-consultation-survey > div > span {
  flex: 0 0 auto;
}
.md-consultation-survey .md-consultation-checks {
  display: flex;
  flex: 1 1 auto;
  flex-wrap: wrap;
  gap: 2px 10px;
}
.md-consultation-survey .md-inline-field {
  margin: 0 5px;
}
.md-consultation-history,
.md-consultation-detail {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px 14px;
}
.md-consultation-history .md-consultation-checks {
  flex: 1 1 100%;
}
.md-consultation-detail .md-consultation-checks {
  flex: 0 0 120px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.md-consultation-detail .md-inline-field {
  min-width: 140px;
}
.md-consultation-detail > .md-consultation-checks {
  flex: 0 0 auto;
  display: flex;
  gap: 4px 10px;
}
.md-consultation-exam-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
}
#mf.md-consultation-dialog > .fb {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--bd);
  background: var(--cd);
}
.md-consultation-print {
  color: #111;
  font-family: "Noto Sans Khmer", Inter, system-ui, sans-serif;
  font-size: 9pt;
}
.md-print-header {
  margin: 0 0 6mm;
  text-align: center;
}
.md-print-header h1 {
  margin: 0;
  font-size: 14pt;
  font-weight: 700;
}
.md-print-top {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4mm;
  margin-bottom: 4mm;
  padding: 1mm 0 3mm;
}
.md-print-top-left,
.md-print-top-right {
  display: grid;
  align-content: start;
  gap: 1.5mm;
}
.md-print-field {
  display: inline-flex;
  align-items: baseline;
  gap: 1mm;
  margin-right: 2mm;
  vertical-align: baseline;
}
.md-print-field b {
  min-width: 10mm;
  min-height: 4mm;
  border-bottom: 0.2mm dotted #111;
  font-weight: 400;
}
.md-print-choices {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 1mm 3mm;
}
.md-print-choice {
  display: inline-flex;
  align-items: baseline;
  gap: 1mm;
  white-space: nowrap;
}
.md-print-box {
  display: inline-flex;
  width: 3.5mm;
  height: 3.5mm;
  align-items: center;
  justify-content: center;
  border: 0.25mm solid #111;
  font-size: 8pt;
  font-style: normal;
  line-height: 1;
}
.md-consultation-print table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  color: #111;
}
.md-consultation-print th,
.md-consultation-print td {
  padding: 1.5mm;
  border: 0.25mm solid #111;
  background: #fff;
  color: #111;
  font-size: 8.5pt;
  font-weight: 400;
  text-align: left;
  vertical-align: middle;
  white-space: normal;
}
.md-consultation-print th {
  width: 28%;
}
.md-consultation-print td > div + div {
  margin-top: 1mm;
}
.md-print-inline-value {
  display: inline-block;
  width: calc(100% - 45mm);
  min-height: 5mm;
  margin-left: 2mm;
  border-bottom: 0.2mm dotted #111;
  vertical-align: middle;
}
.md-consultation-print .md-print-exams {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1mm 2mm;
}
.payment-receipt {
  color: #111;
  font-family: "Noto Sans Khmer", Inter, system-ui, sans-serif;
  font-size: 9pt;
  line-height: 1.4;
}
.payment-receipt-header {
  min-height: 22mm;
  margin-bottom: 5mm;
  text-align: center;
}
.payment-receipt-banner {
  display: block;
  width: 100%;
  max-height: 28mm;
  object-fit: contain;
}
.payment-receipt-clinic {
  min-height: 22mm;
  padding: 3mm;
  color: #1d4ed8;
  font-size: 15pt;
  font-weight: 700;
  text-align: center;
}
.payment-receipt-clinic small {
  display: block;
  font-size: 8pt;
  font-weight: 400;
}
.payment-receipt h1 {
  margin: 0 0 7mm;
  font-size: 15pt;
  line-height: 1.35;
  text-align: center;
}
.payment-receipt h1 small {
  display: block;
  font-family: Inter, Arial, sans-serif;
  font-size: 9pt;
  font-weight: 400;
}
.payment-receipt-meta {
  display: flex;
  justify-content: space-between;
  gap: 8mm;
  margin-bottom: 8mm;
  font-size: 9pt;
}
.payment-receipt-meta > div {
  flex: 1;
  min-width: 0;
}
.payment-receipt-table {
  width: 100%;
  margin-bottom: 4mm;
  border-collapse: collapse;
  table-layout: fixed;
}
.payment-receipt-table th,
.payment-receipt-table td {
  padding: 2mm;
  color: #111;
  font-size: 9pt;
  text-align: left;
  vertical-align: middle;
  overflow-wrap: anywhere;
}
.payment-receipt-table thead {
  background: #e5e7eb;
}
.payment-receipt-table th:first-child,
.payment-receipt-table td:first-child {
  width: 7%;
}
.payment-receipt-table th:nth-child(2),
.payment-receipt-table td:nth-child(2) {
  width: 43%;
}
.payment-receipt-table th:nth-child(3),
.payment-receipt-table td:nth-child(3) {
  width: 12%;
  text-align: center;
}
.payment-receipt-table th:nth-child(4),
.payment-receipt-table td:nth-child(4),
.payment-receipt-table th:nth-child(5),
.payment-receipt-table td:nth-child(5) {
  width: 19%;
  text-align: right;
}
.payment-receipt-table tbody td {
  border-bottom: 0.2mm solid #d1d5db;
}
.payment-receipt-totals {
  width: 48%;
  margin: 0 0 18mm auto;
}
.payment-receipt-totals > div {
  display: flex;
  justify-content: space-between;
  gap: 4mm;
  padding: 2mm;
}
.payment-receipt-totals .payment-receipt-grand-total {
  background: #f3f4f6;
  font-weight: 700;
}
.payment-receipt-signatures {
  display: flex;
  justify-content: space-around;
  gap: 12mm;
  margin-top: 12mm;
  text-align: center;
}
.payment-receipt-signatures > div {
  display: grid;
  width: 40%;
  justify-items: center;
  gap: 2mm;
}
.payment-receipt-signatures i {
  width: 75%;
  margin-top: 10mm;
  border-top: 0.25mm solid #111;
}
.payment-receipt-signatures small {
  min-height: 5mm;
}
.consultation-template-print {
  color: #111;
  font-family: "Noto Sans Khmer", Inter, system-ui, sans-serif;
  font-size: 8pt;
  line-height: 1.3;
}
.consultation-print-header {
  position: relative;
  min-height: 17mm;
  margin-bottom: 1.5mm;
  text-align: center;
}
.consultation-print-clinic {
  position: absolute;
  top: 0;
  left: 0;
  max-width: 35%;
  text-align: left;
  font-size: 7pt;
}
.consultation-print-clinic small {
  display: block;
}
.consultation-print-logo {
  height: 10mm;
}
.consultation-print-logo img {
  width: 10mm;
  height: 10mm;
  object-fit: contain;
}
.consultation-print-header h1 {
  margin: 0;
  font-size: 11pt;
  text-decoration: underline;
}
.consultation-print-date {
  position: absolute;
  top: 0;
  right: 0;
  font-size: 7pt;
}
.consultation-print-patient {
  display: grid;
  gap: 1mm;
  margin-bottom: 1mm;
  padding: 1mm 0;
  border-bottom: 0.35mm solid #111;
}
.consultation-print-patient-main,
.consultation-print-demographics,
.consultation-print-vitals,
.consultation-print-visit {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  column-gap: 2mm;
  row-gap: 0.5mm;
}
.consultation-print-patient-main {
  font-size: 8.5pt;
}
.consultation-print-field {
  display: inline-flex;
  min-width: 0;
  align-items: baseline;
  gap: 0.5mm;
  vertical-align: baseline;
}
.consultation-print-field b {
  min-width: 9mm;
  min-height: 3.5mm;
  border-bottom: 0.2mm dotted #111;
  font-weight: 400;
  overflow-wrap: anywhere;
}
.consultation-print-demographics .consultation-print-field b {
  min-width: 14mm;
}
.consultation-print-vitals .consultation-print-field b {
  min-width: 8mm;
}
.consultation-print-visit {
  padding-top: 0.5mm;
}
.consultation-print-choice {
  display: inline-flex;
  align-items: baseline;
  gap: 0.6mm;
  margin-right: 1.5mm;
  white-space: nowrap;
}
.consultation-print-choice i {
  display: inline-flex;
  width: 3mm;
  height: 3mm;
  align-items: center;
  justify-content: center;
  border: 0.2mm solid #111;
  font-size: 7pt;
  font-style: normal;
  line-height: 1;
}
.consultation-print-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}
.consultation-print-label-col {
  width: 14%;
}
.consultation-print-table col:nth-child(2) {
  width: 32%;
}
.consultation-print-table col:nth-child(3) {
  width: 54%;
}
.consultation-print-table th,
.consultation-print-table td {
  padding: 1mm;
  border: 0.25mm solid #111;
  color: #111;
  font-size: 7.5pt;
  font-weight: 400;
  text-align: left;
  vertical-align: top;
  overflow-wrap: anywhere;
}
.consultation-print-table th {
  font-weight: 600;
}
.consultation-print-table b {
  font-weight: 600;
}
.consultation-print-table tr {
  break-inside: avoid;
}
.consultation-print-main-row td,
.consultation-print-classification-row td,
.consultation-print-history-row td {
  width: 43%;
}
.consultation-print-writing {
  min-height: 6mm;
  margin: 0.5mm 0 1mm;
  border-bottom: 0.2mm dotted #111;
  white-space: pre-wrap;
}
.consultation-print-exam-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 1mm;
}
.consultation-print-checks {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 0.5mm 1mm;
  margin: 0.5mm 0;
}
.consultation-print-signatures {
  display: flex;
  justify-content: space-between;
  margin-top: 2mm;
}
.consultation-fieldset {
  min-width: 0;
  margin: 2px 0;
  padding: 4px 6px;
  border: 1px solid var(--bd);
  border-radius: 4px;
}
.consultation-fieldset legend {
  padding: 0 4px;
  font-size: 12px;
  font-weight: 600;
}
.consultation-checkbox-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2px 8px;
}
.consultation-fieldset .cb {
  margin: 1px 0;
  font-size: 11px;
}
.consultation-fieldset .cb input {
  width: auto;
  min-width: 0;
  margin: 0 4px 0 0;
}
.consultation-form-picker {
  display: grid;
  gap: 10px;
}
.consultation-history-dialog {
  width: min(1440px, 98vw);
}
.consultation-history-table-wrap {
  width: 100%;
  overflow: auto;
  border: 1px solid #3b82f6;
  border-radius: 5px;
}
.consultation-history-table {
  width: max(100%, 1450px);
  border-collapse: collapse;
  font-size: 12px;
}
.consultation-history-table th,
.consultation-history-table td {
  min-width: 90px;
  padding: 7px;
  border: 1px solid #78a5ff;
  vertical-align: middle;
}
.consultation-history-table th {
  background: #eaf2ff;
  color: #033993;
  white-space: nowrap;
}
.consultation-history-table td:nth-child(7),
.consultation-history-table td:nth-child(11),
.consultation-history-table td:nth-child(12) {
  min-width: 160px;
}
.consultation-history-add {
  margin-top: 8px;
}
.consultation-form-option {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border: 1px solid var(--bd);
  border-radius: 8px;
  background: var(--cd);
  color: var(--tx);
  text-align: right;
  cursor: pointer;
}
.consultation-form-option:hover,
.consultation-form-option:focus-visible {
  border-color: var(--p);
  outline: none;
}
.consultation-form-option span {
  color: var(--mu);
  font-size: 12px;
}
@media (max-width: 720px) {
  .md-consultation-intake {
    grid-template-columns: 1fr;
  }
  .md-consultation-patient {
    grid-template-columns: minmax(0, 1fr) 80px 110px;
  }
  .md-consultation-conditions,
  .md-consultation-complaint,
  .md-consultation-vitals,
  .md-consultation-times {
    grid-column: 1;
    grid-row: auto;
  }
  .md-consultation-table th {
    width: 32%;
  }
  .md-consultation-table td .md-consultation-checks {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .consultation-intake,
  .consultation-assessment-columns,
  .consultation-assessment-bottom,
  .consultation-classification,
  .consultation-questions {
    grid-template-columns: 1fr;
  }
  .consultation-form-grid,
  .consultation-vitals-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .consultation-checkbox-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.investigation-request {
  padding: 16px;
  margin-bottom: 20px;
}
.investigation-request-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.investigation-request-head .tools {
  flex: 1;
  justify-content: flex-end;
}
.investigation-request-head .in {
  width: min(320px, 100%);
}
.investigation-service-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.investigation-service {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 58px;
  padding: 10px 12px;
  border: 1px solid var(--bd);
  border-radius: 9px;
  background: var(--cd);
  cursor: pointer;
}
.investigation-service.selected {
  border-color: var(--p);
  box-shadow: 0 0 0 1px var(--p) inset;
}
.investigation-service input {
  flex: 0 0 auto;
  accent-color: var(--p);
}
.investigation-service span {
  font-size: 13px;
}
.investigation-empty {
  grid-column: 1 / -1;
  margin: 8px;
}
.investigation-history h3 {
  margin: 0 0 8px;
  font-size: 16px;
}
.lab-result-picker {
  display: flex;
  flex-direction: column;
  width: min(660px, 96vw);
  height: min(700px, 92vh);
  padding: 18px;
}
.lab-result-picker .operation-form-heading {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.lab-result-picker .operation-form-heading h3 {
  margin: 0;
}
.lab-picker-search {
  display: flex !important;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px !important;
  padding: 0 10px;
  border: 1px solid var(--bd);
  border-radius: 8px;
}
.lab-picker-search .in {
  min-width: 0;
  margin: 0 !important;
  border: 0;
  box-shadow: none;
}
.lab-picker-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding-right: 4px;
}
.lab-picker-group {
  padding: 8px 0 14px;
  border-bottom: 1px solid var(--bd);
}
.lab-picker-group h4 {
  margin: 2px 0 12px;
}
.lab-picker-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding: 0 10px;
}
.lab-picker-card {
  display: flex;
  min-height: 58px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 8px;
  border: 1px solid var(--bd);
  border-radius: 6px;
  background: var(--cd);
  color: var(--tx);
  cursor: pointer;
  text-align: center;
}
.lab-picker-card:hover,
.lab-picker-card.selected {
  border-color: var(--p);
  box-shadow: 0 0 0 1px var(--p) inset;
}
.lab-picker-card span {
  font-size: 12px;
}
.lab-picker-card small {
  color: var(--p);
  font-size: 10px;
}
.lab-picker-footer {
  flex: 0 0 auto;
  justify-content: flex-end;
  padding-top: 10px;
}
.lab-result-template-meta {
  display: flex;
  justify-content: space-between;
  margin: 0 0 12px;
  color: var(--mu);
}
.lab-result-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 12px;
  margin: 12px 0;
}
.lab-result-field {
  min-width: 0;
}
.lab-result-field .fl {
  margin: 0;
}
.lab-result-field small {
  display: block;
  margin-top: 4px;
  color: var(--mu);
  font-size: 11px;
}
.lab-result-values {
  display: grid;
  gap: 6px;
  margin-top: 10px;
}
.lab-result-values > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 0;
  border-bottom: 1px solid var(--bd);
}
.lab-result-values small {
  display: block;
  color: var(--mu);
}
.lab-result-summary {
  display: flex;
  min-height: 82px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px;
  border-color: #dbe6ff;
  box-shadow: 0 3px 10px #0f172a0d;
}
.lab-result-summary-copy {
  display: grid;
  min-width: 0;
  gap: 4px;
}
.lab-result-summary-title {
  overflow-wrap: anywhere;
}
.lab-result-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #16a34a;
  font-size: 12px;
}
.lab-result-actions.ra {
  position: static;
  flex: 0 0 auto;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}
.lab-result-actions .btn {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
}
.lab-result-format {
  background: var(--cd);
}
.lab-report-format {
  margin: 0 0 3mm;
  text-align: center;
  font-weight: 700;
}
#mf.lab-result-form {
  display: flex;
  flex-direction: column;
  width: min(980px, 96vw);
  height: min(900px, 94vh);
  max-height: 94vh;
  overflow: hidden;
}
#mf.lab-result-form > .operation-form-heading,
#mf.lab-result-form > .fb {
  flex: 0 0 auto;
}
#mf.lab-result-form > .fb {
  justify-content: space-between !important;
  gap: 8px;
  margin-top: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--bd);
}
.lab-result-header-fields {
  display: grid;
  flex: 0 0 auto;
  grid-template-columns: repeat(3, minmax(110px, 1fr)) minmax(120px, 0.8fr);
  align-items: end;
  gap: 10px;
  padding: 4px 0 16px;
  border-bottom: 1px solid var(--bd);
}
.lab-result-header-fields .fl {
  min-width: 0;
  margin: 0;
  font-size: 12px;
}
.lab-result-header-fields .in {
  margin-top: 4px;
}
.lab-entry-total {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  padding: 0 4px 8px;
  color: var(--mu);
  font-size: 12px;
}
.lab-entry-total b {
  color: var(--p);
  font-size: 16px;
}
.lab-entry-sections {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: 4px 2px 8px 0;
}
.lab-entry-section {
  padding: 10px 0 12px;
  border-bottom: 1px solid var(--bd);
}
.lab-entry-section h4 {
  margin: 2px 0 12px;
  font-size: 15px;
}
.lab-entry-section h5 {
  margin: 10px 0 6px;
  font-size: 13px;
}
.lab-entry-columns,
.lab-entry-row {
  display: grid;
  grid-template-columns:
    minmax(110px, 1fr) minmax(110px, 150px) minmax(90px, 1fr)
    minmax(65px, 100px);
  align-items: center;
  gap: 10px;
}
.lab-entry-columns {
  margin-bottom: 4px;
  color: var(--mu);
  font-size: 11px;
}
.lab-entry-row {
  min-height: 40px;
  font-size: 12px;
}
.lab-entry-row .in {
  min-width: 0;
  margin: 0;
}
.lab-entry-name,
.lab-entry-range,
.lab-entry-unit {
  overflow-wrap: anywhere;
}
.lab-entry-range,
.lab-entry-unit {
  color: var(--mu);
}
#mf.lab-result-form > .fl {
  flex: 0 0 auto;
  margin: 6px 0 0;
}
#mf.lab-result-form > .fl textarea {
  width: 100%;
}
.lab-result-form > .fb [data-a="labresultprint"] {
  margin-right: auto;
}
.lab-result-form > .fb [data-a="labresultback"] {
  margin-left: auto;
}
.lab-workspace {
  padding: 20px;
  border: 1px solid var(--bd);
  border-radius: 10px;
  background: var(--cd);
}
.lab-workspace-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}
.lab-workspace-header .rh {
  margin: 0;
}
.lab-workspace-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}
.lab-workspace-actions .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 38px;
}
.lab-upload-button {
  color: var(--p);
}
.lab-workspace-tabs {
  display: flex;
  width: min(360px, 100%);
  gap: 4px;
  margin-bottom: 14px;
  padding: 4px;
  border-radius: 8px;
  background: var(--bg, #f1f5f9);
}
.lab-workspace-tab {
  display: inline-flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 0;
  padding: 8px 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--mu);
  cursor: pointer;
}
.lab-workspace-tab.on {
  background: var(--cd);
  color: var(--tx);
  box-shadow: 0 1px 3px #0f172a1a;
}
.lab-results-panel {
  display: grid;
  gap: 10px;
}
.lab-results-panel .emp {
  margin: 20px 0;
}
.lab-history-dialog {
  width: min(1000px, 96vw);
}
.lab-history-table-wrap {
  overflow-x: auto;
}
.lab-history-table {
  width: 100%;
  border-collapse: collapse;
}
.lab-history-table th,
.lab-history-table td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--bd);
  text-align: left;
  vertical-align: top;
}
.lab-history-table th {
  background: var(--bg, #f1f5f9);
  white-space: nowrap;
}
.echo-workspace {
  min-height: 330px;
  padding: 20px;
  border: 1px solid var(--bd);
  border-radius: 10px;
  background: var(--cd);
  box-shadow: 0 3px 10px #0f172a0d;
}
.echo-workspace-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}
.echo-workspace-header h2 {
  margin: 0;
  font-size: 18px;
}
.echo-workspace-actions,
.echo-report-card-actions,
.echo-print-options {
  display: flex;
  align-items: center;
  gap: 7px;
}
.echo-workspace-actions .btn,
.echo-report-card-actions .btn {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
}
.echo-size-button {
  min-width: 72px;
  justify-content: space-between !important;
}
.echo-workspace-actions [data-a="patient-echo-template"] {
  flex-wrap: wrap;
}
.echo-template-current {
  color: var(--mu);
  font-size: 11px !important;
}
.echo-workspace-tabs {
  display: flex;
  width: min(360px, 100%);
  gap: 4px;
  margin-bottom: 14px;
  padding: 4px;
  border-radius: 6px;
  background: #eef2f7;
}
.echo-workspace-tab {
  display: inline-flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 0;
  padding: 8px 10px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--mu);
  cursor: pointer;
}
.echo-workspace-tab.on {
  background: var(--cd);
  color: var(--tx);
  box-shadow: 0 1px 3px #0f172a1a;
}
.echo-report-list {
  display: grid;
  min-height: 180px;
  align-content: start;
  gap: 10px;
  padding: 15px;
  border: 1px solid var(--bd);
  border-radius: 7px;
}
.echo-report-card {
  display: flex;
  min-height: 82px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 0;
  padding: 14px 16px;
}
.echo-report-card-copy {
  display: grid;
  min-width: 0;
  gap: 7px;
}
.echo-report-card-copy > b {
  overflow-wrap: anywhere;
}
.echo-report-card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  color: var(--mu);
  font-size: 12px;
}
.echo-doctor-chip {
  padding: 3px 9px;
  border-radius: 12px;
  background: #eff6ff;
  color: #033993;
}
.echo-report-card-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}
.echo-print-options {
  gap: 0;
  padding: 3px;
  border: 1px solid var(--bd);
  border-radius: 6px;
}
.echo-print-options .btn {
  min-height: 29px;
  padding: 3px 8px;
  border: 0;
  box-shadow: none;
}
.echo-print-options .btn + .btn {
  border-left: 1px solid var(--bd);
  border-radius: 0;
}
.echo-template-options {
  display: grid;
  max-height: min(44vh, 320px);
  gap: 2px;
  overflow-y: auto;
  padding: 3px;
  scrollbar-color: #3b82f6 #f1f5f9;
}
.echo-template-search {
  display: flex;
  min-height: 38px;
  align-items: center;
  gap: 8px;
  margin: 0 0 8px;
  padding: 0 10px;
  border: 1px solid var(--bd);
  border-radius: 6px;
  color: var(--mu);
}
.echo-template-search .in {
  min-width: 0;
  border: 0;
  box-shadow: none;
}
.echo-template-picker-form {
  width: min(420px, 94vw);
  max-height: 80vh;
}
.echo-template-picker-form .operation-form-heading {
  margin-bottom: 12px;
}
.echo-template-option {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 32px;
  padding: 5px 8px;
  border-radius: 4px;
  cursor: pointer;
}
.echo-template-option:hover,
.echo-template-option:has(input:checked) {
  background: var(--hv);
}
.echo-template-option span {
  overflow-wrap: anywhere;
}
.echo-template-empty {
  margin: 0;
  padding: 12px 8px;
  color: var(--mu);
  text-align: center;
}
.echo-report-form {
  width: min(900px, 96vw);
  max-height: 92vh;
  overflow: auto;
}
.echo-report-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.echo-report-section {
  margin: 12px 0;
  padding: 12px;
  border: 1px solid var(--bd);
  border-radius: 7px;
}
.echo-report-section h4 {
  margin: 0 0 8px;
}
.echo-report-template-content {
  margin-bottom: 10px;
}
.echo-report-section .fl {
  margin-bottom: 8px;
}
.echo-report-view-dialog {
  width: min(900px, 96vw);
}
.echo-report-preview-dialog {
  display: grid;
  width: min(1480px, 98vw) !important;
  height: min(94vh, 1100px);
  max-height: 94vh !important;
  grid-template-rows: 48px minmax(0, 1fr);
  gap: 0;
  overflow: hidden !important;
  padding: 0 !important;
  border: 1px solid #d1d5db;
  border-radius: 9px;
  background: #e9eaed !important;
}
.echo-preview-toolbar {
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(150px, 1fr) auto minmax(150px, 1fr);
  align-items: center;
  gap: 12px;
  padding: 0 12px;
  border-bottom: 1px solid #d1d5db;
  background: #fff;
  color: #334155;
}
.echo-preview-title,
.echo-preview-controls,
.echo-preview-zoom-controls,
.echo-preview-text-controls,
.echo-preview-actions {
  display: flex;
  align-items: center;
}
.echo-preview-title {
  gap: 7px;
  font-size: 13px;
}
.echo-preview-title > span {
  color: #033993;
  font-size: 17px;
}
.echo-preview-controls {
  gap: 10px;
}
.echo-preview-zoom-controls,
.echo-preview-text-controls {
  height: 30px;
  gap: 7px;
  padding: 0 8px;
  border: 1px solid #e2e8f0;
  border-radius: 7px;
  background: #f8fafc;
}
.echo-preview-zoom-controls button,
.echo-preview-close {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: #475569;
  cursor: pointer;
}
.echo-preview-zoom-controls button:hover,
.echo-preview-close:hover {
  background: #e2e8f0;
}
.echo-preview-zoom-controls output {
  min-width: 35px;
  color: #334155;
  font-size: 10px;
  text-align: center;
}
.echo-preview-text-controls {
  gap: 5px;
}
.echo-preview-text-controls > span {
  font-size: 14px;
}
.echo-preview-text-controls small {
  color: #94a3b8;
  font-size: 8px;
}
.echo-preview-text-controls b {
  color: #64748b;
  font-size: 14px;
}
.echo-preview-text-controls input[type="range"] {
  width: 72px;
  height: 4px;
  accent-color: #033993;
}
.echo-preview-actions {
  justify-content: flex-end;
  gap: 8px;
}
.echo-preview-actions .btn {
  min-height: 29px;
  padding: 4px 10px;
  font-size: 11px;
}
.echo-preview-close {
  font-size: 16px;
}
.echo-preview-stage {
  min-height: 0;
  overflow: auto;
  padding: 12px;
  background: #e9eaed;
  text-align: center;
}
.echo-preview-paper {
  width: 210mm;
  min-height: 297mm;
  box-sizing: border-box;
  margin: 0 auto;
  padding: 8mm;
  background: #fff;
  box-shadow: 0 3px 12px #0f172a24;
  text-align: left;
  zoom: var(--echo-preview-zoom, 0.81);
}
.echo-preview-paper .echo-report-document-preview {
  min-height: 281mm;
  box-sizing: border-box;
  background: #fff !important;
}
.echo-preview-paper .echo-report-document {
  font-size: var(--echo-preview-text-size, 10pt);
}
.echo-preview-paper .echo-report-document-title {
  font-size: var(--echo-preview-title-size, 13pt);
}
.echo-preview-paper .echo-report-document-result > h3 {
  font-size: var(--echo-preview-section-title-size, 10pt);
}
.echo-report-view {
  max-height: 65vh;
  overflow: auto;
}
.echo-report-print-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8mm;
  padding-bottom: 3mm;
  border-bottom: 0.4mm solid #111;
}
.echo-report-print-section {
  margin: 0 0 6mm;
  break-inside: avoid;
  page-break-inside: avoid;
}
.echo-report-document {
  width: 100%;
  display: flex;
  flex-direction: column;
  color: #111;
  font-family: Arial, sans-serif;
  font-size: 10pt;
}
.echo-report-clinic-header {
  display: flex;
  min-height: 20mm;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1mm;
  margin-bottom: 3mm;
  color: #172554;
  text-align: center;
}
.echo-report-clinic-header span {
  font-size: 8pt;
}
.echo-report-clinic-banner {
  display: block;
  max-width: 100%;
  max-height: 22mm;
  object-fit: contain;
}
.echo-report-clinic-logo {
  display: block;
  max-width: 18mm;
  max-height: 18mm;
  object-fit: contain;
}
.echo-report-patient-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5mm 10mm;
  padding: 2.2mm 3mm;
  border-radius: 2mm;
  background: #eff6ff;
  color: #111827;
  print-color-adjust: exact;
  -webkit-print-color-adjust: exact;
}
.echo-report-patient-meta > div {
  display: grid;
  grid-template-columns: 18mm minmax(0, 1fr);
  gap: 2mm;
  min-width: 0;
}
.echo-report-patient-meta > div:nth-child(even) {
  text-align: left;
}
.echo-report-document-title {
  margin: 3mm 0 4mm !important;
  color: #244b9b;
  font-size: 13pt;
  text-align: center;
  text-decoration: underline;
}
.echo-report-document-columns {
  display: grid;
  flex: 0 0 auto;
  grid-template-columns: minmax(0, 1fr);
  gap: 4mm;
  align-items: start;
}
.echo-report-document-columns.has-images {
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
}
.echo-report-print-lf .echo-report-document-columns.has-images {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
}
.echo-report-print-lf .echo-report-document-images {
  order: -1;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.echo-report-print-lf .echo-report-document-result {
  order: 1;
}
.echo-report-print-pt .echo-report-document-columns {
  display: flex;
  flex-direction: column;
}
.echo-report-print-pt .echo-report-document-images {
  order: 0;
  width: 100%;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.echo-report-print-pt .echo-report-document-image {
  min-height: 0;
}
.echo-report-print-pt .echo-report-document-result {
  order: 1;
  width: 100%;
}
.echo-report-document-result {
  min-width: 0;
}
.echo-report-document-result > h3 {
  margin: 0 0 2mm !important;
  font-size: 10pt;
  font-weight: 400;
  text-decoration: underline;
}
.echo-report-document-content {
  overflow-wrap: anywhere;
  line-height: 1.45;
}
.echo-report-document-content p {
  margin: 1mm 0;
}
.echo-report-document-images {
  min-width: 0;
}
.echo-report-document-images:empty {
  display: none;
}
.echo-report-document-images {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2mm;
}
.echo-report-document-image {
  display: grid;
  min-width: 0;
  min-height: 30mm;
  margin: 0;
  place-items: center;
  overflow: hidden;
  border-radius: 1mm;
  break-inside: avoid;
  page-break-inside: avoid;
}
.echo-report-document-image img {
  display: block;
  width: 100%;
  max-height: 48mm;
  object-fit: contain;
}
.echo-report-document-signature {
  width: 42mm;
  margin: 10mm 12mm 0 auto;
  text-align: center;
  break-inside: avoid;
  page-break-inside: avoid;
}
.echo-report-document-signature span,
.echo-report-document-signature b {
  display: block;
}
.echo-report-document-signature span {
  margin-bottom: 14mm;
  color: #244b9b;
  font-size: 9pt;
}
.echo-report-document-signature b {
  padding-top: 2mm;
  border-top: 0.25mm solid #111;
  font-weight: 600;
}
#pa .echo-report-print {
  background: #fff;
  color: #111;
  font-family: Arial, sans-serif;
  font-size: 10pt;
  print-color-adjust: exact;
  -webkit-print-color-adjust: exact;
}
#pa .echo-report-document {
  background: #fff;
  color: #111;
  print-color-adjust: exact;
  -webkit-print-color-adjust: exact;
}
.echo-report-document-preview {
  padding: 10px;
  background: #fff;
  font-size: 8px;
}
.echo-report-document-preview .echo-report-clinic-header {
  min-height: 52px;
  margin-bottom: 8px;
  gap: 3px;
}
.echo-report-document-preview .echo-report-clinic-header span {
  font-size: 7px;
}
.echo-report-document-preview .echo-report-clinic-banner {
  max-height: 56px;
}
.echo-report-document-preview .echo-report-clinic-logo {
  max-height: 42px;
}
.echo-report-document-preview .echo-report-patient-meta {
  padding: 7px 8px;
  gap: 4px 8px;
  border-radius: 5px;
}
.echo-report-document-preview .echo-report-patient-meta > div {
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 3px;
}
.echo-report-document-preview .echo-report-document-title {
  margin: 9px 0 10px !important;
  font-size: 10px;
}
.echo-report-document-preview .echo-report-document-columns {
  gap: 8px;
}
.echo-report-document-preview .echo-report-document-result > h3 {
  font-size: 9px;
}
.echo-report-document-preview .echo-report-document-content {
  line-height: 1.4;
}
.echo-report-document-preview .echo-report-document-image {
  min-height: 54px;
}
.echo-report-document-preview .echo-report-document-image img {
  max-height: 88px;
}
.echo-report-document-preview .echo-report-document-signature {
  width: 110px;
  margin: 12px 8px 0 auto;
  padding-top: 3px;
}
.echo-report-document-preview .echo-report-document-signature span {
  margin-bottom: 24px;
  font-size: 7px;
}
.lab-print-image {
  max-width: 140px;
  max-height: 100px;
  object-fit: contain;
}
#pa .lab-report {
  display: flex;
  min-height: 0;
  flex-direction: column;
  color: #111;
  font-family: Arial, sans-serif;
  font-size: 10pt;
}
#pa .lab-report-patient {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1mm 10mm;
  padding: 2mm 0 3mm;
}
#pa .lab-report-patient p {
  margin: 1.4mm 0;
}
#pa .lab-report-divider {
  margin: 0 0 4mm;
  border-top: 0.5mm solid #111;
}
#pa .lab-report-vitals {
  margin: 0 0 4mm;
  padding-top: 1mm;
}
#pa .lab-report-vitals h3 {
  margin: 2mm 0;
  text-align: center;
  text-decoration: underline;
}
#pa .lab-report-vitals-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1mm 4mm;
  font-size: 8pt;
}
#pa .lab-report-vitals-grid > div {
  overflow-wrap: anywhere;
}
#pa .lab-report-sections > section {
  break-inside: avoid;
  page-break-inside: avoid;
}
#pa .lab-report-sections h3 {
  margin: 4mm 0 3mm;
  text-align: center;
  text-decoration: underline;
  text-transform: uppercase;
}
#pa .lab-report-sections h4 {
  margin: 3mm 0 1mm;
  font-size: 10pt;
}
#pa .lab-report-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  margin: 0;
}
#pa .lab-report-test-col {
  width: 38%;
}
#pa .lab-report-result-col {
  width: 17%;
}
#pa .lab-report-unit-col {
  width: 16%;
}
#pa .lab-report-range-col {
  width: 29%;
}
#pa .lab-report-table td {
  padding: 1.8mm 1mm;
  vertical-align: middle;
  overflow-wrap: anywhere;
}
#pa .lab-report-table .lab-report-result {
  color: #b42318;
  font-weight: 700;
  text-align: center;
}
#pa .lab-report-table .lab-report-result.in-range {
  color: #033993;
}
#pa .lab-report-table .lab-report-result.out-of-range {
  color: #b42318;
}
#pa .lab-report-signature {
  width: 38mm;
  margin: 8mm 15mm 0 auto;
  padding-top: 0;
  text-align: center;
  break-inside: avoid;
  page-break-inside: avoid;
}
#pa .lab-report-signature div {
  margin-bottom: 20mm;
}
#pa .lab-report-signature span {
  display: block;
  border-top: 0.25mm solid #111;
}
#pa .lab-report-signature small {
  display: block;
  margin-top: 3mm;
  font-size: 9pt;
  letter-spacing: 0.4mm;
}
@media (max-width: 560px) {
  .echo-workspace {
    padding: 14px;
  }
  .echo-workspace-header,
  .echo-report-card {
    align-items: stretch;
    flex-direction: column;
  }
  .echo-workspace-actions {
    flex-wrap: wrap;
  }
  .echo-workspace-actions .btn {
    flex: 1 1 calc(50% - 8px);
  }
  .echo-report-card-actions {
    justify-content: flex-start;
  }
  .echo-report-card-actions .btn {
    flex: 1 1 auto;
  }
  .echo-report-meta {
    grid-template-columns: 1fr;
  }
  .lab-result-summary {
    align-items: stretch;
    flex-direction: column;
  }
  .lab-result-actions.ra {
    justify-content: flex-start;
  }
  .lab-result-actions .btn {
    flex: 1 1 auto;
  }
  #mf.lab-result-form {
    height: 94vh;
    padding: 14px;
  }
  .lab-result-header-fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .lab-entry-columns,
  .lab-entry-row {
    grid-template-columns:
      minmax(80px, 1fr) minmax(85px, 110px) minmax(65px, 0.8fr)
      minmax(45px, 0.5fr);
    gap: 6px;
  }
  .lab-entry-row {
    font-size: 11px;
  }
  #mf.lab-result-form > .fb {
    flex-wrap: wrap;
  }
  .lab-workspace {
    padding: 14px;
  }
  .lab-workspace-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }
  .lab-workspace-actions {
    width: 100%;
    justify-content: flex-start;
  }
  .lab-workspace-actions .btn {
    flex: 1 1 calc(50% - 8px);
  }
  .lab-result-picker {
    padding: 12px;
  }
  .lab-picker-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding: 0 4px;
  }
  .lab-picker-card {
    padding: 8px 5px;
  }
  .lab-result-fields {
    grid-template-columns: 1fr;
  }
  .lab-result-template-meta {
    gap: 8px;
  }
}
.investigation-record-items {
  margin-top: 8px;
}
.investigation-record-items > div,
.investigation-record-total {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 0;
}
.investigation-record-total {
  margin-top: 4px;
  border-top: 1px solid var(--bd);
}
.rh {
  margin: 0;
  font-size: 18px;
}
.rc {
  position: relative;
  border: 1px solid var(--bd);
  border-radius: 10px;
  padding: 12px 14px;
  margin: 10px 0;
  background: var(--cd);
}
.ra {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  gap: 4px;
}
.ra2 {
  margin-top: 6px;
}
.vs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin-top: 4px;
  font-size: 13px;
}
.rimg {
  display: block;
  max-width: 100%;
  max-height: 180px;
  border-radius: 8px;
  margin-top: 8px;
  object-fit: cover;
}
.sws {
  display: flex;
  gap: 8px;
  margin-top: 6px;
}
.sw input {
  display: none;
}
.sw span {
  display: block;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid transparent;
}
.sw input:checked + span {
  outline: 2px solid var(--tx);
  outline-offset: 2px;
}
.cal {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  border-top: 1px solid var(--bd);
  border-left: 1px solid var(--bd);
}
.cal > div {
  border-right: 1px solid var(--bd);
  border-bottom: 1px solid var(--bd);
  padding: 4px;
  min-width: 0;
}
.cal .dh {
  background: var(--hv);
  text-align: center;
  font-weight: 600;
  font-size: 12px;
  padding: 6px;
}
.dc2 {
  min-height: 104px;
  cursor: pointer;
}
.dc2:hover {
  background: var(--hv);
}
.dc2.o {
  opacity: 0.45;
}
.dc2.t {
  background: #fef9c3;
  color: #1f2937;
}
.dn {
  display: block;
  text-align: right;
  font-size: 12px;
}
.cal.wk .dc2 {
  min-height: 300px;
}
.ev {
  font-size: 11px;
  border-radius: 4px;
  padding: 2px 5px;
  margin: 2px 0;
  background: #dbeafe;
  color: #1e3a8a;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}
.ev.w {
  background: #fef3c7;
  color: #92400e;
}
.ev.x {
  background: #fee2e2;
  color: #991b1b;
  text-decoration: line-through;
}
.btn.dk {
  background: #1e293b;
  color: #fff;
  border-color: #1e293b;
}
.dkt button {
  background: #1e293b;
  color: #fff;
}
.dkt .on {
  background: #334155 !important;
}
#pa {
  display: none;
}
.ph-head {
  text-align: center;
  margin-bottom: 10px;
}
.ph-banner {
  max-width: 100%;
  max-height: 90px;
  object-fit: contain;
}
.ph-logo {
  width: 18mm;
  height: 18mm;
  margin: 0 auto 2mm;
  object-fit: contain;
}
.print-document {
  min-height: 100%;
  color: #000;
}
.print-document-content {
  min-width: 0;
}
.print-config-header {
  margin: 2mm 0 4mm;
  color: #111;
  font-size: 10pt;
  font-weight: 600;
  text-align: center;
  white-space: pre-wrap;
}
.print-config-footer {
  margin-top: 12mm;
  padding-top: 3mm;
  border-top: 0.25mm solid #9ca3af;
  color: #374151;
  font-size: 8pt;
  text-align: center;
  white-space: pre-wrap;
  break-inside: avoid;
}
.print-footer-banner {
  margin: 6mm auto 0;
  text-align: center;
  break-inside: avoid;
  page-break-inside: avoid;
}
.print-footer-banner img {
  display: block;
  width: 100%;
  max-width: 190mm;
  max-height: 28mm;
  margin: 0 auto;
  object-fit: contain;
}
.print-footer-text {
  margin: 6mm auto 0;
  text-align: center;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  break-inside: avoid;
  page-break-inside: avoid;
}
#pa .tf-print {
  color: #000;
}
#pa .tf-print-title {
  margin: 5mm 0 6mm;
  text-align: center;
  text-decoration: underline;
}
#pa .tf-print-title span,
#pa .tf-print-title small,
#pa .tf-print-table th span,
#pa .tf-print-table th small {
  display: block;
}
#pa .tf-print-title small {
  margin-top: 2mm;
  color: #555;
  font-size: 9pt;
  text-decoration: none;
}
#pa .tf-print-patient {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2mm 8mm;
  margin-bottom: 4mm;
  padding: 0 2mm 3mm;
  border-bottom: 0.4mm solid #000;
}
#pa .tf-print-patient > div:nth-child(even) {
  text-align: right;
}
#pa .tf-print-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  color: #000;
}
#pa .tf-print-table thead {
  display: table-header-group;
}
#pa .tf-print-table th,
#pa .tf-print-table td {
  border: 0.3mm solid #000;
}
#pa .tf-print-table th {
  padding: 2mm 1mm;
  background: #033993;
  color: #fff;
  text-align: center;
  vertical-align: middle;
  print-color-adjust: exact;
}
#pa .tf-print-table th small {
  margin-top: 1mm;
  font-size: 8pt;
  font-weight: 400;
}
#pa .tf-print-table td {
  height: 18mm;
  padding: 2mm;
  vertical-align: top;
  overflow-wrap: anywhere;
}
#pa .tf-print-table tr {
  break-inside: avoid;
  page-break-inside: avoid;
}
#pa .tf-print-date {
  margin-bottom: 2mm;
  font-weight: 700;
}
#pa .tf-print-text {
  white-space: pre-wrap;
}
#pa .tf-print-signature {
  width: 38mm;
  margin: 7mm 18mm 0 auto;
  text-align: center;
  break-inside: avoid;
  page-break-inside: avoid;
}
#pa .tf-print-signature span {
  display: block;
  margin-bottom: 10mm;
  font-weight: 600;
}
#pa .tf-print-signature div {
  border-top: 0.25mm solid #000;
}
#pa .tf-print-signature small {
  display: block;
  margin-top: 1mm;
  font-size: 8pt;
}
table.pk {
  border-collapse: collapse;
  margin: 6px 0;
}
table.pk th,
table.pk td {
  border: 1px solid #999;
  padding: 3px 8px;
  text-align: left;
  font-size: 12px;
  background: none;
  color: #000;
}
table.pk th {
  width: 190px;
  font-weight: 600;
}
table.pk.full {
  width: 100%;
}
#pa .income-print-period {
  margin: 0 0 4mm;
  text-align: center;
  font-size: 9pt;
}
#pa .income-print-totals {
  display: flex;
  justify-content: space-between;
  gap: 8mm;
  margin-bottom: 3mm;
  font-size: 10pt;
  font-weight: 600;
}
#pa .income-print-table {
  width: 100%;
  border-collapse: collapse;
  color: #000;
  font-size: 9pt;
}
#pa .income-print-table thead {
  display: table-header-group;
}
#pa .income-print-table tr {
  break-inside: avoid;
  page-break-inside: avoid;
}
#pa .income-print-table th:first-child,
#pa .income-print-table td:first-child {
  width: 24mm;
  white-space: nowrap;
}
#pa .income-print-table th:nth-child(4),
#pa .income-print-table td:nth-child(4) {
  width: 18mm;
  white-space: nowrap;
}
#pa .income-print-table th,
#pa .income-print-table td {
  border: 0.25mm solid #555;
  padding: 1.5mm 1mm;
}
#pa .income-print-table th {
  background: #f0f3f8;
  color: #000 !important;
  font-weight: 700;
  text-align: left;
  print-color-adjust: exact;
}
#pa .income-print-table .income-print-money {
  text-align: right;
  white-space: nowrap;
}
@media print {
  body > *:not(#pa) {
    display: none !important;
  }
  #pa {
    display: block;
    color: #000;
    background: #fff;
    padding: 10mm;
    font-size: 12px;
  }
  #pa .print-template-elements {
    position: relative;
    height: 28mm;
    margin: 2mm 0;
    overflow: hidden;
    break-inside: avoid;
    page-break-inside: avoid;
  }
  #pa .print-template-elements-footer {
    height: 22mm;
    margin: 3mm 0 0;
  }
  #pa .print-template-element {
    position: absolute;
    box-sizing: border-box;
    overflow: hidden;
    padding: 1mm;
    line-height: 1.2;
  }
  #pa .print-template-element.has-border {
    border: 0.25mm solid #64748b;
  }
  #pa .print-template-element > img {
    width: 100%;
    height: 100%;
    object-fit: contain;
  }
  #pa .print-template-line {
    display: block;
    width: 100%;
    border-top: 0.25mm solid currentColor;
  }
  #pa .print-template-line.vertical {
    width: 0;
    height: 100%;
    margin: 0 auto;
    border-top: 0;
    border-left: 0.25mm solid currentColor;
  }
  #pa .print-template-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
  }
  #pa .print-template-table th,
  #pa .print-template-table td {
    border: 0.2mm solid #64748b;
    padding: 1mm;
    text-align: left;
  }
  #pa .print-template-summary {
    display: grid;
    gap: 1mm;
  }
  #pa .print-template-summary span,
  #pa .print-template-summary strong {
    display: flex;
    justify-content: space-between;
  }
  #pa .print-template-summary i {
    font-style: normal;
  }
  #pa h3,
  #pa h4 {
    margin: 10px 0 4px;
  }
  #pa .lab-report-cl .lab-report-table .lab-report-result,
  #pa .lab-report-cl .lab-report-table .lab-report-result.in-range {
    color: #000;
    font-weight: 400;
  }
  #pa .lab-report-cl .lab-report-table .lab-report-result.out-of-range {
    color: #000;
    font-weight: 700;
  }
}
@media (max-width: 820px) {
  .g2,
  .g3 {
    grid-template-columns: 1fr;
  }
  .pdw {
    grid-template-columns: 1fr;
  }
  .dc2 {
    min-height: 64px;
  }
  .cal.wk {
    font-size: 11px;
  }
  .investigation-service-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .investigation-request-head {
    align-items: stretch;
    flex-direction: column;
  }
  .investigation-request-head .tools {
    justify-content: stretch;
  }
  .investigation-request-head .in {
    width: 100%;
  }
}

.g4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px 12px;
}
.cnb {
  background: #ecfdf5;
  color: #1f2937;
}
.cnH {
  color: #15803d;
  text-decoration: underline;
  margin: 22px 0 4px;
}
.cnT {
  text-align: center;
  margin: 24px 0 8px;
}
.cnh {
  margin: 12px 0 2px;
  font-size: 13px;
}
.cno {
  margin: 6px 0;
}
.cno .in {
  width: 100%;
}
.sig .sl {
  border-bottom: 1px dotted var(--mu);
  min-height: 26px;
  margin-top: 6px;
}
.cnfw {
  display: grid;
  grid-template-columns: 1fr 250px;
  gap: 16px;
}
.cnfl {
  min-width: 0;
}
.cnfh {
  border-left: 1px solid var(--bd);
  padding-left: 12px;
  max-height: 70vh;
  overflow: auto;
}
.cnft {
  width: 100%;
  margin-bottom: 10px;
}
.cnft button {
  flex: 1;
}
.rc.sel {
  border-color: var(--p);
}
#mf.cnf {
  width: min(1480px, 98vw);
  height: min(94vh, 900px);
  max-height: 94vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
#mf.cnf > .operation-form-heading,
#mf.cnf > .fb {
  flex: 0 0 auto;
}
#mf.cnf > .consultation-form-scroll {
  width: 100%;
}
#mf.cnf .cnfw {
  min-height: 0;
}
#mf.cnf .cnfl {
  padding-right: 6px;
}
#mf.cnf textarea.in {
  font-size: 13px;
}
#cn-plan {
  padding: 12px;
  border: 1px solid var(--bd);
  border-radius: 8px;
}
#cn-plan .cn-plan-heading {
  color: #15803d;
  margin: 4px 0 8px;
  font-size: 14px;
}
#cn-plan .cn-plan-field {
  color: #15803d;
  font-size: 11px;
  font-weight: 600;
  margin: 8px 0 12px;
}
#cn-plan .cn-plan-field textarea.in {
  display: block;
  margin-top: 4px;
  color: var(--tx);
  font-weight: 400;
}
.cn-plan-question {
  margin: 8px 0;
  font-size: 12px;
}
.cn-plan-question > b {
  display: block;
  margin-bottom: 4px;
  color: var(--tx);
}
.cn-plan-options {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 24px;
}
.cn-plan-options .cb {
  margin: 0;
  font-size: 11px;
}
.cn-plan-options .cb input {
  width: auto;
  min-width: 0;
}
@media (max-width: 820px) {
  .cnfw {
    grid-template-columns: 1fr;
  }
  .cnfh {
    border: 0;
    padding: 0;
  }
  .g4 {
    grid-template-columns: 1fr 1fr;
  }
}

.st.lnk {
  cursor: pointer;
  transition:
    transform 0.12s,
    box-shadow 0.12s;
}
.st.lnk:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px #0002;
}
.st.lnk:focus-visible {
  outline: 2px solid var(--p);
  outline-offset: 2px;
}

.btn.on2 {
  background: var(--hv);
  border-color: var(--p);
}
.pdc {
  padding: 14px 16px;
  margin-bottom: 14px;
  overflow: visible;
}
.pdcg {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  margin: 6px 0 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--bd);
}
.pdcg:last-child {
  border: 0;
  margin-bottom: 0;
}
.pdt {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 8px;
  padding: 10px;
  margin-bottom: 16px;
}
.tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 6px;
  border-radius: 10px;
  font-size: 12px;
  text-align: center;
  cursor: pointer;
  color: var(--mu);
  background: var(--hv);
}
.tile span {
  font-size: 18px;
}
.tile:hover {
  background: var(--bd);
}
.tile.on {
  background: linear-gradient(90deg, #033993, #06b6d4);
  color: #fff;
  font-weight: 600;
}

table.ptb th {
  background: #033993;
  font-size: 12px;
  padding: 12px 10px;
}
table.ptb td {
  padding: 10px;
  font-size: 12.5px;
  vertical-align: middle;
}
.pn {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 130px;
}
.pn a:first-child {
  font-weight: 600;
  text-transform: uppercase;
  font-size: 12px;
}
.ic {
  display: flex;
  gap: 5px;
  font-size: 13px;
  opacity: 0.75;
}
.ic a:hover,
.ed:hover {
  text-decoration: none;
  opacity: 1;
}
.pill {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 600;
}
.pill.opd {
  background: #033993;
  color: #fff;
  border-radius: 6px;
}
.pill.ipd {
  background: #7c3aed;
  color: #fff;
  border-radius: 6px;
}
.pill.f {
  background: #fce7f3;
  color: #be185d;
}
.pill.m {
  background: #dbeafe;
  color: #1e40af;
}
.due {
  display: inline-block;
  background: #dc2626;
  color: #fff;
  border-radius: 6px;
  padding: 5px 9px;
  font-size: 11px;
  line-height: 1.4;
  text-align: center;
  cursor: pointer;
  text-decoration: none;
}
.patient-unpaid-cell {
  display: grid;
  justify-items: center;
  gap: 3px;
}
.patient-unpaid-remark {
  display: flex;
  align-items: flex-start;
  gap: 4px;
  max-width: 180px;
  font-size: 11px;
  text-align: left;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.patient-unpaid-remark-edit {
  flex: 0 0 auto;
  border: 0;
  padding: 0 2px;
  background: transparent;
  color: #033993;
  cursor: pointer;
}
.paid {
  color: #16a34a;
  font-weight: 600;
}
.mrb,
.sq {
  border: 0;
  border-radius: 8px;
  color: #fff;
  cursor: pointer;
  width: 34px;
  height: 30px;
}
.mrb,
.sq.b {
  background: #033993;
}
.sq.r {
  background: #ef4444;
}
.patient-more-action {
  background: #dcfce7;
  color: #15803d;
  font-size: 20px;
  line-height: 1;
  transform: translateY(4px);
}
.ed {
  opacity: 0.6;
}
.btn:disabled {
  opacity: 0.45;
  cursor: default;
}
.pg .btn.p {
  color: #fff;
}
.top .bg {
  display: block;
}
body.sbc aside {
  display: none;
}
.w {
  max-width: 1800px;
  margin: 0 auto;
}
#v.tight {
  padding: 14px 24px;
}
.patient-table-wrap {
  width: 100%;
  min-width: 0;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
}
.patient-list-primary-tools {
  display: contents;
}
.patient-list-actions {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 8px;
  margin-left: auto;
}
.appointment-list-table-wrap {
  overflow-x: auto;
}
.appointment-date-filter {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.appointment-date-filter .in {
  width: 150px;
  min-width: 0;
}
.appointment-list-table {
  min-width: 1040px;
}
.appointment-list-table th,
.appointment-list-table td {
  white-space: nowrap;
}
.appointment-list-table th:nth-child(7),
.appointment-list-table td:nth-child(7),
.appointment-list-table th:nth-child(8),
.appointment-list-table td:nth-child(8) {
  width: 120px;
}
.appointment-list-table th:nth-child(5),
.appointment-list-table td:nth-child(5),
.appointment-list-table th:nth-child(10),
.appointment-list-table td:nth-child(10) {
  width: 160px;
}
.appointment-list-name {
  color: #033993;
  font-weight: 600;
  text-decoration: none;
}
.appointment-note-edit {
  margin-left: 6px;
  vertical-align: middle;
}
.appointment-list-phone {
  margin-left: 8px;
  color: var(--mu);
  text-decoration: none;
}
.appointment-list-phone:hover {
  color: #033993;
}
.appointment-list-status {
  background: #fef3c7;
  color: #92400e;
}
.appointment-list-status.x {
  background: #fee2e2;
  color: #991b1b;
}
.appointment-list-actions {
  white-space: nowrap;
}
.appointment-confirm {
  min-width: 34px;
  padding: 4px 8px;
}
table.ptb {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
  font-size: 11px;
}
table.ptb th {
  white-space: normal;
  line-height: 1.25;
  padding: 7px 4px;
  font-size: 10px;
  overflow-wrap: anywhere;
}
table.ptb td {
  padding: 6px 4px;
  font-size: 10.5px;
  white-space: normal;
  word-break: break-word;
  line-height: 1.3;
  overflow: hidden;
}
table.ptb .pt-col-id {
  width: 4%;
}
table.ptb .pt-col-date {
  width: 6%;
}
table.ptb .pt-col-name {
  width: 9%;
}
table.ptb .pt-col-latin {
  width: 6%;
}
table.ptb .pt-col-nssf,
table.ptb .pt-col-nat {
  width: 5%;
}
table.ptb .pt-col-type,
table.ptb .pt-col-roomBed,
table.ptb .pt-col-age,
table.ptb .pt-col-sex,
table.ptb .pt-col-mr {
  width: 4%;
}
table.ptb .pt-col-treat,
table.ptb .pt-col-dx,
table.ptb .pt-col-addr {
  width: 6%;
}
table.ptb .pt-col-followup {
  width: 9%;
}
table.ptb .pt-col-pay,
table.ptb .pt-col-phone {
  width: 7%;
}
table.ptb .pt-col-act {
  width: 6%;
}
table.ptb .pt-col-comp,
table.ptb .pt-col-hist {
  width: 16%;
}
table.ptb .pt-col-regd {
  width: 10%;
}
table.ptb .pt-col-name .pn {
  min-width: 0;
  flex-direction: column;
  align-items: flex-start;
}
table.ptb .pt-col-name .pn > div {
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
}
table.ptb .pt-col-name .ic {
  flex-wrap: wrap;
}
table.ptb .pt-col-followup .patient-follow-up {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
}
table.ptb .pt-col-followup .patient-follow-up .bd {
  padding: 2px 5px;
  font-size: 9px;
}
table.ptb .pt-col-followup .btn {
  padding: 3px 5px;
  font-size: 9px;
}
table.ptb .pt-col-act {
  white-space: normal !important;
}
table.ptb .pt-col-act .sq {
  margin: 1px 0;
}
table.ptb td:nth-child(2) {
  white-space: normal;
}
table.ptb .pn {
  min-width: 0;
  gap: 4px;
  flex-wrap: wrap;
}
table.ptb .pn > div {
  min-width: 70px;
}
@media (max-width: 820px) {
  .patient-list-primary-tools,
  .patient-list-actions {
    display: flex;
    flex: 1 0 100%;
    min-width: 0;
    gap: 8px;
  }
  .patient-list-primary-tools {
    align-items: stretch;
  }
  .patient-list-primary-tools #q {
    flex: 1 1 auto;
    min-width: 0;
  }
  .patient-list-primary-tools > .btn {
    flex: 0 0 auto;
    white-space: nowrap;
  }
  .patient-list-toolbar > .tabs {
    flex: 1 0 100%;
    min-width: 0;
    justify-content: flex-start;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: thin;
  }
  .patient-list-toolbar > .tabs button {
    flex: 0 0 auto;
    white-space: nowrap;
  }
  .patient-list-actions {
    flex-wrap: nowrap;
    justify-content: flex-end;
    margin-left: 0;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: thin;
  }
  .patient-list-actions > .btn {
    flex: 0 0 auto;
    min-height: 40px;
    white-space: nowrap;
  }
  .patient-table-wrap {
    max-width: 100%;
  }
  table.ptb {
    width: 1320px;
    min-width: 1320px;
    table-layout: fixed;
  }
  table.ptb th {
    min-width: 64px;
    overflow-wrap: normal;
    white-space: nowrap;
  }
  table.ptb td {
    min-width: 64px;
    overflow-wrap: anywhere;
    word-break: normal;
  }
  table.ptb .pt-col-date {
    min-width: 78px;
  }
  table.ptb .pt-col-name {
    min-width: 145px;
  }
  table.ptb .pt-col-type,
  table.ptb .pt-col-mr {
    min-width: 82px;
  }
  table.ptb .pt-col-followup {
    min-width: 130px;
  }
  table.ptb .pt-col-pay {
    min-width: 132px;
  }
  table.ptb .pt-col-phone {
    min-width: 104px;
  }
  table.ptb .pt-col-act {
    min-width: 110px;
  }
}
.pl {
  display: none;
  color: var(--mu);
  font-size: 11px;
  text-transform: none;
}
table.ptb .ic {
  font-size: 12px;
  gap: 3px;
}
table.ptb .pill {
  padding: 2px 7px;
}
table.ptb .due {
  padding: 4px 6px;
  font-size: 10.5px;
}
table.ptb .mrb,
table.ptb .sq {
  width: 28px;
  height: 26px;
}
table.ptb td:last-child .sq {
  margin: 1px;
}
@media (max-width: 1500px) {
  body:not(.sbc) .c-latin {
    display: none;
  }
  body:not(.sbc) .pl {
    display: block;
  }
}
@media (max-width: 1250px) {
  body.sbc .c-latin {
    display: none;
  }
  body.sbc .pl {
    display: block;
  }
}

table.ptb tr.frow th {
  background: #eff6ff;
  padding: 4px 3px;
  border-bottom: 1px solid var(--bd);
}
table.ptb .fr .in {
  width: 100%;
  min-width: 0;
  font-size: 11px;
  padding: 3px 4px;
  border-radius: 5px;
  background: #fff;
  color: #0f172a;
}
table.ptb .fr select.in {
  padding: 3px 1px;
}
table.ptb .fr .btn.s {
  padding: 2px 6px;
  font-size: 11px;
  background: #fff;
  color: #0f172a;
}

.pill.clk {
  cursor: pointer;
}
.pill.clk:hover {
  filter: brightness(1.12);
  box-shadow: 0 0 0 2px #03399344;
}

.ibox {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: #dbeafe;
  display: grid;
  place-items: center;
  font-size: 22px;
}
table.ipdt th {
  background: linear-gradient(90deg, #033993, #7c3aed);
  font-size: 12px;
  white-space: normal;
}
table.ipdt td {
  padding: 10px;
  font-size: 12.5px;
  vertical-align: middle;
}
.paidb {
  display: inline-block;
  border: 1px solid #bbf7d0;
  color: #16a34a;
  border-radius: 8px;
  padding: 5px 10px;
  font-weight: 600;
  font-size: 12px;
}
.paidb:hover {
  background: #f0fdf4;
}
.billing-title,
.billing-toolbar,
.bill-payment-head,
.bill-payment-total,
.bill-item,
.bill-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.billing-title {
  font-size: 16px;
  margin-bottom: 18px;
}
.billing-title .btn {
  font-size: 20px;
  line-height: 1;
}
.billing-toolbar {
  margin-bottom: 12px;
}
.billing-page {
  padding: 8px 10px 10px;
}
.billing-page .billing-toolbar {
  margin: 0 10px 18px;
}
.billing-page .billing-toolbar h2 {
  display: flex;
  align-items: center;
  gap: 8px;
}
.billing-payall {
  background: #16a34a !important;
  border-color: #16a34a !important;
  color: #fff !important;
  min-height: 42px;
}
.billing-toolbar h3 {
  margin: 0;
}
.billing-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.billing-panel {
  min-width: 0;
  min-height: 300px;
  padding: 14px;
  border: 1px solid var(--bd);
  border-radius: 10px;
  box-shadow: 0 4px 12px #00000012;
}
.billing-panel h4 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 0 0 10px;
  padding: 16px;
  border-bottom: 1px solid var(--bd);
  color: #16803c;
  background: #f0fdf4;
}
.billing-panel:first-child h4 {
  color: #dc2626;
  background: #fef2f2;
}
.billing-panel .emp {
  margin: 52px 0;
  text-align: center;
}
.bill-item,
.bill-payment,
.bill-total {
  margin: 8px 0;
  padding: 10px;
  border: 1px solid var(--bd);
  border-radius: 8px;
}
.billing-page .billing-panel {
  min-height: 340px;
  padding: 16px 26px;
  border-color: #dbeafe;
}
.billing-page .billing-panel h4 {
  margin: 8px 0 16px;
  padding: 18px;
  border: 0;
  border-radius: 8px 8px 0 0;
  font-size: 18px;
}
.billing-page .billing-panel:first-child h4 {
  color: #dc2626;
  background: #fef2f2;
  border-bottom: 1px solid #fee2e2;
}
.billing-page .billing-panel:last-child h4 {
  color: #16803c;
  background: #f0fdf4;
  border-bottom: 1px solid #dcfce7;
}
.billing-total-badge {
  padding: 4px 12px;
  border: 1px solid #fecaca;
  border-radius: 99px;
  background: #fff;
  color: #dc2626;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}
.paid-total-badge {
  border-color: #bbf7d0;
  color: #16803c;
}
.paid-history-controls {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.paid-view-toggle {
  width: 30px;
  min-width: 30px;
  height: 30px;
  padding: 0;
  color: #16803c;
  font-size: 16px;
}
.bill-payment-table-wrap {
  overflow-x: auto;
}
.bill-payment-table {
  width: 100%;
  min-width: 600px;
  border-collapse: collapse;
  color: var(--tx);
  font-size: 13px;
}
.bill-payment-table th,
.bill-payment-table td {
  padding: 11px 10px;
  border-bottom: 1px solid #edf0f5;
  text-align: left;
  white-space: nowrap;
}
.bill-payment-table thead th {
  background: #f0fdf4;
  color: #16803c;
  font-weight: 600;
}
.bill-payment-table th:nth-child(5),
.bill-payment-table td:nth-child(5) {
  text-align: right;
}
.bill-payment-table td:last-child {
  text-align: right;
}
.bill-payment-date {
  display: inline-flex;
  flex-direction: column;
  gap: 3px;
}
.bill-payment-date small {
  color: var(--mu);
  font-size: 11px;
}
.bill-payment-table tfoot th {
  border-top: 2px solid #bbf7d0;
  border-bottom: 0;
  background: #f0fdf4;
  color: #16803c;
  font-size: 14px;
}
.bill-payment-table tfoot th:nth-child(2) {
  text-align: right;
}
.bill-payment-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}
.bill-payment-card {
  min-width: 0;
  padding: 12px;
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  background: #fff;
}
.bill-payment-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.bill-payment-card-details {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 12px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid #dcfce7;
  font-size: 13px;
}
.bill-payment-card-details b {
  text-align: right;
}
.bill-payment-card-details b:last-child {
  color: #16803c;
}
.bill-charge-group {
  margin: 8px 0 26px;
  border: 1px solid #dbeafe;
  border-radius: 7px;
  overflow: hidden;
  box-shadow: 0 2px 4px #0000000a;
}
.bill-charge-heading {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  background: #f5f9ff;
  border-bottom: 1px solid #dbeafe;
  color: #1d4ed8;
  font-size: 13px;
}
.bill-charge-item {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 14px;
  border-bottom: 1px solid #edf0f5;
  color: var(--tx);
  font-size: 13px;
}
.bill-charge-item:last-child {
  border-bottom: 0;
}
.bill-charge-item small {
  display: block;
  margin-top: 3px;
  color: var(--mu);
  font-size: 11px;
}
.bill-charge-right {
  display: flex;
  align-items: center;
  gap: 12px;
}
.bill-quantity {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px;
  border: 1px solid var(--bd);
  border-radius: 7px;
  background: var(--cd);
}
.bill-quantity .btn {
  min-width: 26px;
  height: 26px;
  padding: 0 6px;
  line-height: 1;
  font-size: 16px;
}
.bill-quantity span {
  min-width: 18px;
  text-align: center;
  font-size: 12px;
  font-weight: 600;
}
.billing-page .bill-total {
  margin: 0;
  padding: 18px 0 4px;
  border: 0;
  border-top: 1px solid #fee2e2;
  border-radius: 0;
  color: #374151;
  font-size: 15px;
}
.billing-page .bill-total b:last-child {
  color: #dc2626;
  font-size: 20px;
}
.bill-payment {
  border-color: #bbf7d0;
}
.bill-payment-head .bd {
  margin-right: auto;
}
.bill-payment-total {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px dashed var(--bd);
  color: #16803c;
}
.bill-payment-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 8px;
  padding: 8px 0;
  border-bottom: 1px dashed var(--bd);
  color: var(--mu);
  font-size: 12px;
}
.billing-page .bill-payment {
  margin: 8px 0 14px;
  padding: 12px 14px;
  border-color: #dcfce7;
}
.bill-total {
  border-color: #fecaca;
  color: #b91c1c;
}
#mf.treatment-followup {
  width: min(1100px, 98vw);
}
#mf.treatment-followup > h3 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--p);
}
.tf-patient {
  margin-bottom: 12px;
  color: var(--mu);
  font-size: 12px;
}
.follow-up-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 12px 0;
}
.follow-up-summary .card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
}
.follow-up-summary span {
  color: var(--mu);
}
.follow-up-summary b {
  color: var(--p);
  font-size: 20px;
}
.follow-up-table-wrap {
  overflow-x: auto;
}
.follow-up-table {
  min-width: 920px;
}
.follow-up-patient {
  padding: 0;
  border: 0;
  background: none;
  color: var(--p);
  cursor: pointer;
  font: inherit;
  font-weight: 600;
}
.follow-up-actions {
  white-space: nowrap;
}
#mf.follow-up-form {
  width: min(760px, 98vw);
}
.patient-followup-schedule-dialog {
  width: min(560px, 96vw);
}
.patient-followup-schedule-intro {
  margin: 0 0 18px;
  color: var(--mu);
}
.patient-followup-schedule-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.patient-followup-schedule-fields label {
  display: grid;
  gap: 6px;
}
.patient-followup-intervals {
  display: flex;
  gap: 8px;
  margin: 12px 0 16px;
}
.patient-followup-intervals .btn {
  min-width: 42px;
  min-height: 42px;
}
.patient-followup-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 0;
  padding: 10px 0;
  border: 0;
}
.patient-followup-categories legend {
  margin-bottom: 6px;
  font-weight: 600;
}
.patient-followup-preview {
  margin-top: 12px;
}
.patient-followup-preview h3 {
  margin: 0 0 8px;
  font-size: 16px;
}
.patient-followup-preview ol {
  display: grid;
  gap: 6px;
  margin: 0;
  padding-left: 22px;
}
@media (max-width: 560px) {
  .patient-followup-schedule-fields {
    grid-template-columns: 1fr;
  }
}
.follow-up-form > h3 {
  margin: 0 0 14px;
  color: var(--p);
}
.follow-up-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.follow-up-form-grid > label {
  min-width: 0;
}
.follow-up-form-grid .follow-up-notes {
  grid-column: 1 / -1;
}
.follow-up-form-grid .in {
  width: 100%;
  min-width: 0;
}
#mf.patient-appointment-form-dialog {
  display: flex;
  width: min(475px, 96vw);
  max-height: 92vh;
  flex-direction: column;
  overflow: auto;
  padding: 18px 24px 0 !important;
}
.patient-appointment-form-dialog > .operation-form-heading {
  position: sticky;
  z-index: 3;
  top: -19px;
  margin: -18px -24px 12px;
  padding: 14px 24px 10px;
  border-bottom: 1px solid var(--bd);
  background: var(--cd);
}
.patient-appointment-form-dialog > .operation-form-heading h3 {
  font-size: 17px;
}
.patient-appointment-form {
  display: grid;
  gap: 12px;
}
.patient-appointment-form > .fl {
  min-width: 0;
  margin: 0;
}
.patient-appointment-form > .fl .in {
  width: 100%;
  min-width: 0;
  height: 42px;
  margin-top: 4px;
}
.patient-appointment-form > .fl textarea.in {
  height: 84px;
  resize: vertical;
}
.patient-appointment-form-dialog > .fb {
  position: sticky;
  bottom: 0;
  z-index: 3;
  margin: 12px -24px 0;
  padding: 10px 24px 14px;
  background: var(--cd);
}
@media (max-width: 600px) {
  .follow-up-summary {
    grid-template-columns: 1fr;
  }
  .follow-up-form-grid {
    grid-template-columns: 1fr;
  }
  .follow-up-form-grid .follow-up-notes {
    grid-column: auto;
  }
  #mf.patient-appointment-form-dialog {
    width: min(96vw, 475px);
    padding-right: 16px !important;
    padding-left: 16px !important;
  }
  .patient-appointment-form-dialog > .operation-form-heading,
  .patient-appointment-form-dialog > .fb {
    margin-right: -16px;
    margin-left: -16px;
    padding-right: 16px;
    padding-left: 16px;
  }
}
.tf-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  margin: 8px 0;
}
.tf-print-date-picker {
  display: grid;
  gap: 3px;
  color: var(--mu);
  font-size: 11px;
}
.tf-print-date-picker .in {
  min-width: 150px;
}
.tf-grid {
  max-height: 58vh;
  overflow: auto;
  border: 1px solid var(--bd);
  border-radius: 8px;
}
.tf-columns,
.tf-row {
  display: grid;
  grid-template-columns: 1.05fr 1fr 1fr 58px;
}
.tf-columns {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--hv);
}
.tf-columns > *,
.tf-row > * {
  min-width: 0;
  padding: 10px;
  border-right: 1px solid var(--bd);
}
.tf-columns b {
  font-size: 12px;
}
.tf-row {
  border-top: 1px solid var(--bd);
}
.tf-row textarea.in {
  height: 150px;
  margin-top: 8px;
  resize: vertical;
}
.tf-row .tf-actions {
  display: flex;
  justify-content: center;
  align-items: flex-start;
}
.tf-history {
  margin-top: 14px;
}
.tf-history h4 {
  margin: 8px 0;
}
.tf-history-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px;
  border: 1px solid var(--bd);
  border-radius: 8px;
  margin: 8px 0;
}
.dcb {
  border: 1px solid #16a34a;
  color: #16a34a;
  background: none;
  border-radius: 8px;
  padding: 5px 10px;
  font-size: 12px;
  cursor: pointer;
}
.dcb:hover {
  background: #16a34a;
  color: #fff;
}
.iac a {
  display: inline-block;
  margin: 0 5px;
  font-size: 15px;
  opacity: 0.8;
}
.iac a:hover {
  opacity: 1;
  text-decoration: none;
}
.iac .rd {
  color: #dc2626;
}
.lab-template-table-wrap {
  margin-top: 12px;
  overflow-x: auto;
}
.lab-template-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}
.lab-template-table th,
.lab-template-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--bd);
}
.lab-template-table th {
  color: var(--cd);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
}
.lab-template-table tbody tr:last-child td {
  border-bottom: 0;
}
.lab-template-actions {
  white-space: nowrap;
  text-align: right;
}
#mf.lab-template-form {
  display: grid;
  gap: 14px;
  width: min(760px, 94vw);
  max-height: 88vh;
  overflow-y: auto;
}
.lab-form-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.lab-form-heading h3,
.lab-fields-editor h4 {
  margin: 0;
}
.lab-template-form-fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(130px, 0.55fr);
  gap: 4px 14px;
}
.lab-template-form-fields label:first-child,
.lab-template-form-fields label:nth-child(3) {
  grid-column: 1 / -1;
}
.lab-template-form-fields label {
  margin: 0;
  font-weight: 600;
}
.lab-template-form .in {
  width: 100%;
}
.lab-fields-editor {
  display: grid;
  min-width: 0;
  gap: 8px;
  padding: 13px;
  border: 1px solid var(--bd);
  border-radius: 9px;
  background: var(--hv);
}
.lab-field-row {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, 0.7fr) auto;
  gap: 8px;
  align-items: center;
  min-width: 0;
}
.lab-field-row .in {
  box-sizing: border-box;
  min-width: 0;
  margin: 0;
}
.lab-add-field {
  justify-self: start;
}
.lab-form-actions {
  justify-content: flex-end;
  margin-top: 0;
  padding-top: 12px;
  border-top: 1px solid var(--bd);
}
.echo-template-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 12px;
}
.echo-template-card {
  position: relative;
  min-height: 132px;
  padding: 16px;
}
.echo-template-summary {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.echo-template-summary h3 {
  min-width: 0;
  margin: 0;
  font-size: 16px;
  overflow-wrap: anywhere;
}
.echo-template-price {
  flex: none;
  padding: 4px 8px;
  border-radius: 5px;
  background: #dcfce7;
  color: #15803d;
  font-size: 12px;
  font-weight: 700;
}
.echo-template-card > .mu {
  margin-top: 7px;
  font-size: 12px;
}
.echo-template-actions {
  display: flex;
  justify-content: flex-end;
  gap: 7px;
  margin-top: 14px;
}
.echo-template-actions .btn.r {
  background: #ef4444;
  color: #fff;
}
.rx-template-list-wrap {
  margin-top: 4px;
}
.rx-template-list th:last-child,
.rx-template-list td:last-child {
  width: 120px;
  text-align: right;
  white-space: nowrap;
}
#mf.rx-template-form {
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr) auto;
  gap: 11px;
  width: min(690px, 96vw);
  max-height: 92vh;
  overflow: hidden;
  padding: 18px;
  border-radius: 8px;
}
.rx-template-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.rx-template-heading h3 {
  margin: 0;
  font-size: 15px;
}
.rx-bilingual {
  display: inline-flex;
  flex-direction: column;
  align-items: inherit;
  gap: 1px;
}
.rx-bilingual small {
  color: var(--mu);
  font-size: 0.85em;
  font-weight: 400;
}
.rx-template-heading .rx-bilingual {
  align-items: flex-start;
}
.rx-prescription-table th .rx-bilingual {
  align-items: center;
}
.rx-disease-field,
.rx-medicines-field {
  display: grid !important;
  gap: 5px;
  margin: 0 !important;
  font-size: 12px !important;
}
.rx-disease-field .rx-required {
  display: inline;
  color: #ef4444;
}
.rx-template-form .in {
  width: 100%;
  min-width: 0;
  margin: 0;
}
.rx-disease-field .in {
  height: 38px;
}
.rx-search-wrap {
  position: relative;
}
.rx-search-wrap > span {
  position: absolute;
  top: 50%;
  left: 11px;
  transform: translateY(-50%);
  color: #94a3b8;
  font-size: 17px;
}
.rx-search-wrap .in {
  height: 34px;
  padding-left: 32px;
}
.rx-medicine-list {
  display: grid;
  gap: 5px;
  max-height: 228px;
  overflow-y: auto;
  padding: 4px 2px 2px 0;
}
.rx-medicine-option {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 52px;
  width: 100%;
  padding: 7px 10px;
  border: 1px solid var(--bd);
  border-radius: 7px;
  background: var(--cd);
  color: var(--tx);
  cursor: pointer;
  text-align: left;
}
.rx-medicine-option:hover,
.rx-medicine-option.selected {
  background: var(--hv);
  border-color: #cbd5e1;
}
.rx-medicine-check {
  display: grid;
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  place-items: center;
  border: 1px solid #3b82f6;
  border-radius: 3px;
  color: #033993;
  font-size: 11px;
}
.rx-medicine-description {
  display: grid;
  flex: 1;
  min-width: 0;
  gap: 3px;
}
.rx-medicine-description b {
  overflow: hidden;
  font-size: 12px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rx-medicine-description small {
  overflow: hidden;
  color: var(--mu);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rx-medicine-price {
  color: #16803c;
  font-size: 12px;
  white-space: nowrap;
}
.rx-empty {
  margin: 0;
  padding: 18px;
  color: var(--mu);
  text-align: center;
}
.rx-prescription-table-wrap {
  min-height: 90px;
  overflow: auto;
  border-top: 1px solid var(--bd);
}
.rx-prescription-table {
  min-width: 760px;
  font-size: 11px;
}
.rx-prescription-table th {
  padding: 10px 6px;
  background: var(--hv);
  color: var(--tx);
  text-align: center;
}
.rx-prescription-table td {
  padding: 4px;
}
.rx-prescription-table .rx-template-medicine {
  min-width: 115px;
  padding-left: 8px;
  font-weight: 600;
}
.rx-prescription-table .rx-dose-input {
  min-width: 0;
  min-height: 30px;
  padding: 5px;
  border-radius: 5px;
  font-size: 11px;
}
.rx-prescription-table .rx-table-empty {
  padding: 18px;
  color: var(--mu);
  text-align: center;
}
.rx-template-actions {
  display: flex;
  justify-content: flex-end;
  gap: 7px;
  padding-top: 8px;
  border-top: 1px solid var(--bd);
}
#mf.rx-entry-dialog {
  display: grid;
  gap: 12px;
  width: min(1260px, 96vw);
  max-height: 94vh;
  overflow: auto;
  padding: 20px;
}
#mf.rx-entry-dialog .operation-form-heading {
  margin-bottom: clamp(24px, 7vh, 68px);
}
#mf.rx-entry-dialog .operation-form-heading h3 {
  font-size: 21px;
}
.rx-entry-form {
  display: grid;
  gap: 10px;
  min-width: 0;
  font-size: 15px;
}
.rx-entry-bilingual {
  display: inline-flex;
  flex-direction: column;
  gap: 1px;
  font-size: 15px;
  font-weight: 600;
}
.rx-entry-bilingual small {
  color: var(--mu);
  font-size: 10px;
  font-weight: 400;
}
.rx-entry-header-row {
  display: grid;
  grid-template-columns: max-content minmax(180px, 200px) minmax(220px, 1fr);
  gap: 12px;
  align-items: end;
}
.rx-entry-header-row > label,
.rx-entry-doctor,
.rx-entry-notes {
  display: grid;
  gap: 5px;
  min-width: 0;
  margin: 0;
  font-size: 15px;
}
#mf.rx-entry-dialog .rx-entry-header-row > label,
#mf.rx-entry-dialog .rx-entry-doctor,
#mf.rx-entry-dialog .rx-entry-notes {
  display: grid;
  width: 100%;
  min-width: 0;
  margin: 0;
  box-sizing: border-box;
}
#mf.rx-entry-dialog .rx-entry-header-row input,
#mf.rx-entry-dialog .rx-entry-doctor .in,
#mf.rx-entry-dialog .rx-entry-notes .in,
#mf.rx-entry-dialog .rx-entry-medicine-query,
#mf.rx-entry-dialog .rx-entry-input-action,
#mf.rx-entry-dialog .rx-entry-input-action .in {
  box-sizing: border-box;
  min-width: 0;
}
#mf.rx-entry-dialog .rx-entry-header-row input,
#mf.rx-entry-dialog .rx-entry-doctor .in,
#mf.rx-entry-dialog .rx-entry-disease-row > .in,
#mf.rx-entry-dialog .rx-entry-notes .in,
#mf.rx-entry-dialog .rx-entry-medicine-query .in {
  min-height: 40px;
  padding: 9px 12px;
  font-size: 15px;
}
.rx-entry-input-action {
  display: flex;
  gap: 4px;
  min-width: 0;
}
.rx-entry-input-action .in {
  width: auto;
  flex: 1;
}
.rx-entry-date {
  min-width: 0;
}
#mf.rx-entry-dialog .rx-entry-date input {
  width: 100%;
  min-width: 0;
  padding-left: 9px;
  padding-right: 9px;
  font-variant-numeric: tabular-nums;
}
.rx-entry-icon-button {
  width: 42px;
  padding: 8px;
}
.rx-entry-icon-button svg,
.rx-entry-search-button svg,
.rx-entry-book-icon svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.rx-entry-diagnosis,
.rx-entry-medicine-picker,
.rx-entry-disease-row {
  position: relative;
}
.rx-entry-prescriber-row {
  display: grid;
  grid-template-columns: minmax(180px, 330px) minmax(150px, 1fr);
  gap: 10px;
  align-items: end;
}
.rx-entry-doctor {
  max-width: 100%;
}
.rx-entry-doctor .in {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}
.rx-entry-medicine-picker {
  min-width: 0;
  padding-bottom: 1px;
}
.rx-entry-search-button {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  gap: 7px;
  min-height: 40px;
  padding: 8px 12px;
  font-size: 14px;
}
.rx-entry-search-button svg {
  width: 15px;
  height: 15px;
}
.rx-entry-medicine-search {
  position: absolute;
  z-index: 5;
  top: calc(100% + 5px);
  left: 0;
  width: min(560px, 90vw);
  padding: 10px;
  border: 1px solid var(--bd);
  border-radius: 9px;
  background: var(--cd);
  box-shadow: 0 8px 24px #0002;
}
#mf.rx-entry-dialog .rx-entry-medicine-query {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-width: 0;
  margin: 0;
  padding: 0 10px;
  border: 1px solid var(--bd);
  border-radius: 7px;
  background: var(--cd);
  color: var(--mu);
}
#mf.rx-entry-dialog .rx-entry-medicine-query svg {
  flex: 0 0 16px;
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
}
#mf.rx-entry-dialog .rx-entry-medicine-query .in {
  flex: 1;
  border: 0;
  background: transparent;
  box-shadow: none;
}
.rx-entry-medicine-search[hidden],
.rx-entry-choice-list[hidden] {
  display: none;
}
.rx-entry-disease-row {
  display: grid;
  grid-template-columns: 34px auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--bd);
  border-radius: 8px;
  background: var(--hv);
}
.rx-entry-book-icon {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 50%;
  background: var(--cd);
  color: var(--p);
}
.rx-entry-disease-row > b {
  display: grid;
  color: var(--mu);
  font-size: 13px;
  white-space: nowrap;
}
.rx-entry-disease-row > b small {
  font-size: 11px;
  text-transform: uppercase;
}
.rx-entry-disease-row > .in {
  min-width: 0;
}
.rx-entry-choice-list {
  position: absolute;
  z-index: 6;
  top: calc(100% + 4px);
  right: 0;
  display: grid;
  min-width: 220px;
  max-height: 210px;
  overflow: auto;
  padding: 5px;
  border: 1px solid var(--bd);
  border-radius: 7px;
  background: var(--cd);
  box-shadow: 0 8px 24px #0002;
}
.rx-entry-diagnosis .rx-entry-choice-list {
  left: 0;
  right: auto;
}
.rx-entry-choice-list button {
  padding: 9px 11px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--tx);
  text-align: left;
  cursor: pointer;
  font-size: 14px;
}
.rx-entry-choice-list button:hover {
  background: var(--hv);
}
.rx-entry-choice-list > span {
  padding: 10px;
  color: var(--mu);
  font-size: 14px;
}
.rx-entry-medicine-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 290px;
  overflow: auto;
  margin-top: 8px;
  padding-right: 2px;
}
.rx-entry-medicine {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) auto;
  grid-template-rows: auto auto;
  align-items: center;
  gap: 4px 8px;
  width: 100%;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--bd);
  border-radius: 9px;
  background: var(--cd);
  color: var(--tx);
  cursor: pointer;
  text-align: left;
  font-size: 14px;
}
.rx-entry-medicine > input[type="checkbox"] {
  grid-column: 1;
  grid-row: 1 / span 2;
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: #033993;
}
.rx-entry-medicine-details {
  display: grid;
  grid-column: 2;
  grid-row: 1 / span 2;
  gap: 5px;
  min-width: 0;
}
.rx-entry-medicine-details > b {
  overflow: hidden;
  font-size: 14px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rx-entry-medicine-details small {
  color: var(--mu);
  font-size: 11px;
}
.rx-entry-medicine-price {
  grid-column: 3;
  grid-row: 1;
  color: #15803d;
  font-size: 13px;
  white-space: nowrap;
}
.rx-entry-medicine-unit {
  grid-column: 3;
  grid-row: 2;
  justify-self: end;
  padding: 3px 8px;
  border: 1px solid var(--bd);
  border-radius: 999px;
  color: var(--mu);
  font-size: 10px;
  white-space: nowrap;
}
.rx-entry-medicine.selected {
  border-color: #033993;
  background: color-mix(in srgb, #033993 5%, var(--cd));
}
.rx-entry-medicine > span {
  display: grid;
  gap: 2px;
}
.rx-entry-medicine:hover {
  border-color: var(--p);
}
.rx-entry-table-wrap {
  min-height: 70px;
  max-height: 36vh;
  overflow: auto;
}
.rx-entry-table {
  width: 100%;
  min-width: 0;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 14px;
}
.rx-entry-table .rx-col-medicine {
  width: 20%;
}
.rx-entry-table .rx-col-dose {
  width: 7%;
}
.rx-entry-table .rx-col-duration {
  width: 10%;
}
.rx-entry-table .rx-col-quantity {
  width: 8%;
}
.rx-entry-table .rx-col-instructions {
  width: 24%;
}
.rx-entry-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 9px 6px;
  background: var(--hv);
  color: #000;
  font-size: 15px;
  font-weight: 700;
  text-align: left;
  overflow-wrap: anywhere;
}
.rx-entry-table td {
  padding: 5px;
  border-top: 1px solid var(--bd);
  text-align: left;
  overflow: hidden;
}
.rx-entry-table .in {
  width: 100%;
  min-width: 0;
  min-height: 38px;
  padding: 6px;
  font-size: 14px;
}
.rx-entry-medicine-name {
  overflow-wrap: anywhere;
  font-size: 14px;
}
.rx-entry-remove {
  margin-right: 5px;
  padding: 0 4px;
  border: 0;
  background: transparent;
  color: #dc2626;
  font-size: 19px;
  cursor: pointer;
}
.rx-entry-empty {
  padding: 16px !important;
  color: #000;
  font-size: 16px;
  font-weight: 500;
  text-align: center;
}
.rx-entry-actions {
  display: grid;
  grid-template-columns: auto minmax(180px, 1fr) auto auto;
  align-items: end;
  gap: 7px;
}
.rx-print-format {
  position: relative;
  display: block;
  grid-column: 2;
  grid-row: 1;
  height: 40px;
  min-width: 0;
  margin: 0;
  font-size: 12px;
}
.rx-print-format > span {
  position: absolute;
  bottom: calc(100% + 4px);
  left: 0;
  white-space: nowrap;
}
.rx-entry-actions > .btn[data-a="rxprintdraft"] {
  grid-column: 3;
  grid-row: 1;
}
.rx-entry-actions > .btn[data-a="rxsavebill"] {
  grid-column: 4;
  grid-row: 1;
}
.rx-print-format .in {
  position: relative;
  top: 10px;
  width: 100%;
  height: 40px;
  min-height: 40px;
  padding: 8px 10px;
}
#mf.rx-print-picker {
  width: min(420px, 94vw);
}
#mf.rx-print-picker .rx-print-format {
  height: auto;
  margin: 14px 0 4px;
}
#mf.rx-print-picker .rx-print-format > span {
  position: static;
  display: block;
  margin-bottom: 6px;
}
#mf.rx-print-picker .rx-print-format .in {
  position: static;
  top: auto;
  height: 44px;
  min-height: 44px;
}
.rx-entry-actions .btn.p {
  border-color: transparent;
  background: var(--g);
  color: #fff;
}
#mf.rx-entry-dialog .rx-entry-actions .btn,
#mf.rx-entry-dialog .rx-entry-footer-close {
  min-height: 40px;
  padding: 8px 12px;
  font-size: 14px;
}
#mf.rx-entry-dialog .tools.fb {
  justify-content: flex-start !important;
  align-items: center;
  padding-top: 10px;
  border-top: 1px solid var(--bd);
}
#mf.rx-entry-dialog .tools.fb > .btn.p {
  display: none;
}
.rx-entry-footer-close {
  margin-left: auto;
}
@media (max-width: 980px) {
  .rx-entry-header-row {
    grid-template-columns: minmax(0, 1fr) minmax(180px, 220px);
  }
  .rx-entry-diagnosis {
    grid-column: 1 / -1;
  }
  .rx-entry-disease-row {
    grid-template-columns: 34px minmax(0, 1fr) auto;
  }
  .rx-entry-disease-row > .in {
    grid-column: 2 / -1;
  }
  .rx-entry-disease-row > .btn {
    grid-column: 3;
    grid-row: 1;
  }
}
@media (max-width: 560px) {
  #mf.rx-template-form {
    width: 96vw;
    max-height: 94vh;
    padding: 13px;
  }
  #mf.rx-entry-dialog {
    padding: 13px;
  }
  #mf.rx-entry-dialog .operation-form-heading {
    margin-bottom: 12px;
  }
  .rx-entry-header-row {
    grid-template-columns: 1fr;
  }

  .rx-entry-diagnosis,
  .rx-entry-disease-row > .in {
    grid-column: 1 / -1;
  }
  .rx-entry-doctor {
    max-width: none;
  }
  .rx-entry-prescriber-row {
    grid-template-columns: minmax(150px, 1fr) minmax(145px, 1fr);
    gap: 7px;
  }
  .rx-entry-search-button {
    max-width: 100%;
    padding: 6px;
    font-size: 13px;
  }
  .rx-entry-disease-row {
    grid-template-columns: 30px minmax(0, 1fr);
  }
  .rx-entry-disease-row > .btn {
    grid-column: 2;
    grid-row: auto;
    justify-self: start;
  }
  .rx-entry-actions {
    width: 100%;
    grid-template-columns: auto minmax(120px, 1fr) auto;
  }
  .rx-entry-actions > .btn[data-a="rxsavebill"] {
    grid-column: 1 / -1;
    grid-row: 2;
  }
  .rx-entry-table {
    min-width: 700px;
  }
  .rx-entry-footer-close {
    margin-left: 0;
  }
  .rx-medicine-list {
    max-height: 190px;
  }
  .rx-template-list {
    min-width: 520px;
  }
}
@media (max-width: 380px) {
  .rx-entry-prescriber-row {
    grid-template-columns: 1fr;
  }
}
.echo-template-empty {
  grid-column: 1 / -1;
  padding: 24px;
  text-align: center;
}
#mf.echo-template-form {
  display: grid;
  gap: 13px;
  width: min(900px, 96vw);
  max-height: 92vh;
  overflow-y: auto;
}
.echo-form-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.echo-form-heading h3 {
  margin: 0;
}
.echo-template-basic {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(130px, 0.75fr);
  gap: 8px 14px;
}
.echo-template-basic label {
  display: grid !important;
  gap: 5px;
  margin: 0 !important;
  font-size: 12px !important;
}
.echo-template-basic label:first-child {
  grid-column: 1;
}
.echo-template-basic label:nth-child(2) {
  grid-column: 2;
  grid-row: 1;
}
.echo-template-basic label:nth-child(3) {
  grid-column: 1 / -1;
}
.echo-template-basic .in {
  width: 100%;
}
.echo-section-card {
  display: grid;
  gap: 9px;
  padding: 13px;
  border: 1px solid var(--bd);
  border-radius: 9px;
  background: var(--hv);
}
.echo-section-card + .echo-section-card {
  margin-top: 12px;
}
.echo-section-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--mu);
}
.echo-section-grip {
  font-size: 19px;
  cursor: grab;
}
.echo-section-card > label,
.echo-extra-fields > label {
  display: grid !important;
  gap: 5px;
  margin: 0 !important;
  font-size: 12px !important;
  color: var(--mu);
}
.echo-section-card > label .in {
  width: 100%;
}
.echo-editor-label {
  color: var(--mu);
  font-size: 12px;
}
.echo-rich-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
  padding: 6px;
  border: 1px solid var(--bd);
  border-bottom: 0;
  border-radius: 7px 7px 0 0;
  background: var(--cd);
}
.echo-tool {
  min-width: 32px;
  padding: 4px 7px;
}
.echo-tool-bold {
  font-weight: 700;
}
.echo-tool-italic {
  font-style: italic;
}
.echo-tool-underline {
  text-decoration: underline;
}
.echo-tool svg {
  display: block;
  width: 16px;
  height: 16px;
}
.echo-color-tool {
  position: relative;
  display: inline-grid;
  width: 32px;
  height: 30px;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--bd);
  border-radius: 6px;
  background: var(--cd);
  color: var(--tx);
  cursor: pointer;
}
.echo-color-tool .echo-tool {
  display: grid;
  width: 100%;
  height: 100%;
  min-width: 0;
  place-items: center;
  font-size: 15px;
}
.echo-tool-foreColor {
  border-bottom: 2px solid var(--tx);
}
.echo-tool-hiliteColor {
  color: #475569;
  background: linear-gradient(transparent 52%, #fde047 52%);
}
.echo-color-tool input[type="color"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}
.echo-font-select,
.echo-size-select {
  width: auto;
  min-width: 120px;
  margin: 0;
  padding: 5px 7px;
}
.echo-rich-toolbar > .echo-tool {
  display: grid;
  place-items: center;
  height: 30px;
  padding: 4px 7px;
  border-color: transparent;
  background: transparent;
}
.echo-rich-toolbar > .echo-tool:hover {
  border-color: var(--bd);
  background: var(--hv);
}
.echo-rich-editor {
  min-height: 170px;
  max-height: 45vh;
  overflow-y: auto;
  padding: 12px;
  border: 1px solid var(--bd);
  background: var(--cd);
  color: var(--tx);
  outline-color: var(--p);
}
.echo-rich-editor:focus {
  border-color: var(--p);
  box-shadow: 0 0 0 2px #03399322;
}
.echo-rich-editor img {
  max-width: 100%;
  height: auto;
}
.echo-rich-editor table {
  width: 100%;
  border-collapse: collapse;
}
.echo-rich-editor th,
.echo-rich-editor td {
  min-width: 70px;
  height: 30px;
  padding: 5px;
  border: 1px solid var(--bd);
}
.echo-report-composer-form {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  gap: 18px;
  width: min(1500px, 98vw) !important;
  height: min(94vh, 1050px);
  max-height: 94vh !important;
  overflow: hidden !important;
  padding: 22px !important;
  border-radius: 18px;
}
.echo-report-composer-heading,
.echo-report-composer-heading > div,
.echo-report-pane-heading,
.echo-report-doctor-row,
.echo-service-search-row {
  display: flex;
  align-items: center;
}
.echo-report-composer-heading,
.echo-report-pane-heading {
  justify-content: space-between;
  gap: 12px;
}
.echo-report-composer-heading > div {
  gap: 11px;
}
.echo-report-composer-heading-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.echo-report-composer-heading-actions .btn {
  white-space: nowrap;
}
.echo-report-composer-heading h3,
.echo-report-pane-heading h4 {
  margin: 0;
}
.echo-report-heading-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 12px;
  background: #e9f1ff;
  color: #033993;
  font-size: 24px;
}
.echo-report-composer-meta {
  display: grid;
  grid-template-columns:
    minmax(180px, 0.85fr) minmax(230px, 1.2fr) minmax(190px, 0.9fr)
    minmax(170px, 0.8fr);
  gap: 14px;
  align-items: start;
}
.echo-report-composer-form .echo-report-label {
  display: block;
  margin: 0 0 7px !important;
  color: var(--mu);
  font-size: 12px;
  font-weight: 700;
}
.echo-report-composer-form .echo-report-composer-meta .in {
  width: 100%;
  min-width: 0;
  margin: 0;
}
.echo-date-parts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin-top: 7px;
}
.echo-date-parts label {
  margin: 0 !important;
  color: var(--mu);
  font-size: 11px;
}
.echo-date-parts select {
  display: block;
  margin-top: 3px !important;
}
.echo-service-search-row {
  gap: 7px;
}
.echo-report-service-group {
  position: relative;
}
.echo-service-search-row .btn {
  flex: 0 0 42px;
  height: 40px;
  font-size: 22px;
}
.echo-service-results {
  position: absolute;
  z-index: 2;
  right: 0;
  left: 0;
  width: 100%;
  max-height: 190px;
  overflow: auto;
  margin-top: 3px;
  border: 1px solid var(--bd);
  border-radius: 8px;
  background: var(--cd);
  box-shadow: 0 8px 20px #0f172a1a;
}
.echo-service-result {
  display: block;
  width: 100%;
  padding: 9px 11px;
  border: 0;
  border-bottom: 1px solid var(--bd);
  background: transparent;
  color: var(--tx);
  text-align: left;
  cursor: pointer;
}
.echo-service-result:hover {
  background: var(--hv);
}
.echo-service-empty {
  display: block;
  padding: 10px;
  color: var(--mu);
}
.echo-selected-service {
  min-height: 17px;
  margin-top: 5px;
  color: var(--p);
  font-size: 12px;
}
.echo-report-doctor-row {
  gap: 7px;
}
.echo-report-doctor-row select {
  flex: 1;
}
.echo-report-composer-form .echo-add-person {
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 9px;
  color: var(--p);
  font-size: 22px;
}
.echo-report-composer-form .echo-report-doctor-new {
  margin-top: 7px !important;
}
.echo-report-patient {
  min-height: 70px;
  padding: 10px 12px;
  border: 1px solid var(--bd);
  border-radius: 10px;
  background: var(--hv);
}
.echo-report-patient .echo-report-label {
  margin-bottom: 4px !important;
}
.echo-report-patient strong,
.echo-report-patient > span:last-child {
  display: block;
  overflow-wrap: anywhere;
}
.echo-report-patient > span:last-child {
  margin-top: 3px;
  color: var(--mu);
  font-size: 12px;
}
.echo-report-workspace {
  display: grid;
  min-height: 0;
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.85fr);
  gap: 18px;
}
.echo-report-editor-pane,
.echo-report-preview-pane {
  display: flex;
  min-width: 0;
  min-height: 0;
  flex-direction: column;
}
.echo-report-pane-heading {
  min-height: 34px;
  margin-bottom: 7px;
}
.echo-report-notes-grid {
  display: grid;
  min-height: 0;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr));
  gap: 12px;
}
.echo-report-note-panel {
  display: flex;
  min-width: 0;
  min-height: 0;
  flex-direction: column;
}
.echo-report-note-panel .echo-report-pane-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.echo-report-note-panel .echo-report-pane-heading h4 {
  margin: 0;
}
.echo-report-note-panel .echo-report-heading-tools {
  min-width: 0;
}
.echo-report-note-panel .echo-report-quick-actions {
  gap: 4px;
}
.echo-report-note-panel .echo-report-quick-actions .btn {
  gap: 4px;
  padding-inline: 7px;
}
.echo-report-note-panel .echo-rich-toolbar {
  flex-wrap: wrap;
}
.echo-report-pane-heading span {
  color: var(--mu);
  font-size: 12px;
}
.echo-report-composer-form .echo-rich-toolbar {
  flex: 0 0 auto;
  gap: 3px;
  padding: 5px;
}
.echo-report-quick-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 7px;
  padding: 0;
}
.echo-report-heading-tools {
  margin-left: auto;
}
.echo-report-quick-actions .btn {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 5px 10px;
  border-color: var(--bd);
  background: var(--cd);
  color: var(--tx);
  font-size: 12px;
  white-space: nowrap;
}
.echo-report-quick-actions .btn:hover {
  background: var(--hv);
}
.echo-report-quick-actions svg {
  width: 15px;
  height: 15px;
  flex: 0 0 15px;
}
.echo-report-composer-form .echo-font-select {
  min-width: 100px;
}
.echo-report-composer-form .echo-size-select {
  min-width: 78px;
}
.echo-report-editor-section {
  display: flex;
  min-height: 0;
  flex: 1;
  flex-direction: column;
}
.echo-report-composer-form .echo-report-editor {
  min-height: 200px;
  max-height: none;
  flex: 1;
  border-radius: 0 0 8px 8px;
}
.echo-report-template-fields {
  flex: 0 0 auto;
  max-height: 145px;
  overflow: auto;
  border: 1px solid var(--bd);
  border-radius: 8px;
  background: var(--cd);
}
.echo-report-template-fields summary {
  padding: 8px 10px;
  color: var(--mu);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.echo-report-template-field-group {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 9px;
  padding: 0 10px 9px;
}
.echo-report-template-field-group h5 {
  grid-column: 1 / -1;
  margin: 0;
}
.echo-report-template-fields label {
  display: grid !important;
  gap: 4px;
  margin: 0 !important;
  color: var(--mu);
  font-size: 11px !important;
}
.echo-report-template-fields textarea {
  width: 100%;
  min-height: 38px;
  margin: 0 !important;
}
.echo-report-preview {
  min-height: 150px;
  flex: 1;
  overflow: auto;
  padding: 16px;
  border: 1px solid var(--bd);
  border-radius: 9px;
  background: #fff;
  color: #172033;
  box-shadow: 0 3px 12px #0f172a0b;
}
.echo-report-preview header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid #e2e8f0;
  font-size: 12px;
}
.echo-report-preview-content {
  padding-top: 10px;
  overflow-wrap: anywhere;
}
.echo-report-preview-content img {
  max-width: 100%;
}
.echo-report-attachments {
  display: grid;
  min-height: 0;
  grid-template-rows: auto minmax(110px, 1fr) auto auto;
  gap: 6px;
  margin-top: 9px;
}
.echo-report-attachments .echo-report-label {
  margin: 0 !important;
  color: var(--tx);
  font-weight: 500;
}
.echo-report-image-list {
  min-height: 150px;
  max-height: 230px;
  overflow: auto;
  padding: 5px 9px;
  border: 1px solid var(--bd);
  border-radius: 9px;
  background: var(--cd);
}
.echo-report-image-row {
  display: flex;
  min-height: 29px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 2px 0;
}
.echo-report-image-name {
  min-width: 0;
  overflow: hidden;
  color: var(--tx);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.echo-report-image-remove {
  display: grid;
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  place-items: center;
  padding: 3px;
  border: 0;
  border-radius: 6px;
  background: #ef4444;
  color: #fff;
  cursor: pointer;
}
.echo-report-image-remove:hover {
  background: #dc2626;
}
.echo-report-image-remove svg {
  width: 16px;
  height: 16px;
}
.echo-report-upload {
  display: flex !important;
  min-height: 37px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 0 !important;
  padding: 7px 10px;
  border: 1px solid var(--bd);
  border-radius: 6px;
  background: var(--cd);
  color: var(--tx);
  font-size: 12px;
  cursor: pointer;
}
.echo-report-upload:hover {
  background: var(--hv);
}
.echo-report-upload > span:first-child {
  color: var(--tx);
  font-size: 17px;
  font-weight: 700;
}
.echo-report-attachment-hint {
  display: block;
  color: var(--mu);
  font-size: 11px;
  text-align: center;
}
.echo-report-print-attachment {
  margin: 10px auto;
  text-align: center;
}
.echo-report-print-attachment figcaption {
  color: var(--mu);
  font-size: 12px;
}
.echo-report-composer-footer {
  padding-top: 10px;
  border-top: 1px solid var(--bd);
}
.echo-report-save {
  width: 100%;
  min-height: 48px;
  border: 0;
  border-radius: 10px;
  background: linear-gradient(100deg, #2463eb, #0ea5e9);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}
.echo-report-save:hover {
  filter: brightness(1.04);
}
.echo-report-print-image {
  display: block;
  max-width: 100%;
  max-height: 180px;
  margin: 10px auto;
  object-fit: contain;
}
@media (max-width: 850px) {
  .echo-report-preview-dialog {
    width: 98vw !important;
    height: 95vh;
    max-height: 95vh !important;
  }
  .echo-preview-toolbar {
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
    gap: 5px;
    padding: 5px 8px;
  }
  .echo-preview-controls {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-content: center;
  }
  .echo-preview-title {
    grid-row: 1;
  }
  .echo-preview-actions {
    grid-column: 2;
    grid-row: 1;
  }
  .echo-preview-paper {
    width: min(210mm, 92vw);
    min-height: 270mm;
  }
  .echo-report-composer-form {
    width: min(700px, 98vw) !important;
    height: 96vh;
    padding: 15px !important;
  }
  .echo-report-composer-meta {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .echo-report-workspace {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(300px, 1fr) minmax(220px, 0.8fr);
    overflow: auto;
  }
  .echo-report-preview-pane {
    min-height: 240px;
  }
}
@media (max-width: 520px) {
  .echo-report-composer-form {
    width: 100% !important;
    height: 100dvh;
    max-height: 100dvh !important;
    border-radius: 0;
  }
  .echo-report-composer-meta {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .echo-report-patient {
    min-height: auto;
  }
  .echo-report-composer-form .echo-font-select {
    min-width: 80px;
  }
  .echo-report-quick-actions {
    flex-wrap: wrap;
  }
}
.echo-table-dialog {
  position: fixed;
  inset: 0;
  z-index: 12;
  display: grid;
  place-items: center;
  padding: 16px;
  background: #000a;
}
.echo-table-dialog-card {
  display: grid;
  width: min(360px, 94vw);
  gap: 11px;
  padding: 19px;
  border: 1px solid var(--bd);
  border-radius: 9px;
  background: var(--cd);
  box-shadow: 0 16px 48px #0003;
}
.echo-table-dialog-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2px;
}
.echo-table-dialog-heading h3 {
  margin: 0;
  font-size: 16px;
}
.echo-table-dialog-card > label {
  display: grid !important;
  grid-template-columns: 72px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  margin: 0 !important;
  font-size: 12px !important;
  text-align: right;
}
.echo-table-dialog-card .in {
  width: 100%;
  min-width: 0;
  margin: 0;
}
.echo-color-control {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 7px;
}
.echo-color-control input[type="color"] {
  width: 42px;
  height: 36px;
  padding: 3px;
  border: 1px solid var(--bd);
  border-radius: 6px;
  background: var(--cd);
}
.echo-table-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 4px;
  padding-top: 5px;
}
.echo-extra-fields {
  display: grid;
  gap: 9px;
  padding-top: 10px;
  border-top: 1px solid var(--bd);
}
.echo-fields-list {
  display: grid;
  gap: 7px;
}
.echo-field-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}
.echo-field-row .in {
  width: 100%;
  margin: 0;
}
.echo-add-section {
  width: 100%;
  border-style: dashed;
}
.echo-form-actions {
  justify-content: flex-end;
  margin: 0;
  padding-top: 12px;
  border-top: 1px solid var(--bd);
}
@media (max-width: 820px) {
  .tf-columns,
  .tf-row {
    grid-template-columns: minmax(180px, 1fr) minmax(180px, 1fr);
  }
  .tf-columns b:nth-child(n + 3) {
    display: none;
  }
  .tf-row > :nth-child(n + 3) {
    grid-column: span 1;
  }
  .billing-columns {
    grid-template-columns: 1fr;
  }
  .billing-panel {
    min-height: 180px;
  }
  .echo-template-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 700px) {
  .lab-field-row {
    grid-template-columns: 1fr;
  }
  .lab-field-row .btn {
    justify-self: start;
  }
}
@media (max-width: 560px) {
  .lab-template-form-fields {
    grid-template-columns: 1fr;
  }
  .lab-template-form-fields label {
    grid-column: 1 / -1;
  }
  .lab-template-table th,
  .lab-template-table td {
    padding: 10px 8px;
  }
  .echo-template-grid {
    grid-template-columns: 1fr;
  }
  .echo-template-basic {
    grid-template-columns: 1fr;
  }
  .echo-template-basic label:first-child,
  .echo-template-basic label:nth-child(2),
  .echo-template-basic label:nth-child(3) {
    grid-column: 1;
    grid-row: auto;
  }
}
.medicine-form-card {
  margin: 12px 0;
  overflow: hidden;
}
.medicine-pos-add .medicine-form-card {
  margin: 0;
}
.medicine-form-toggle {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  padding: 15px;
  border: 0;
  border-bottom: 1px solid var(--bd);
  background: var(--cd);
  color: var(--tx);
  cursor: pointer;
  text-align: left;
}
.medicine-form {
  display: grid;
  gap: 18px;
  padding: 16px;
}
.medicine-image-field,
.medicine-basic-grid > label,
.medicine-dates-grid > label,
.medicine-unit-row > label {
  display: grid;
  gap: 7px;
  color: var(--tx);
  font-size: 12px;
}
.medicine-image-control {
  display: flex;
  align-items: center;
  gap: 12px;
}
.medicine-image-preview,
.medicine-thumb {
  display: grid;
  width: 64px;
  height: 64px;
  flex: 0 0 auto;
  place-items: center;
  overflow: hidden;
  border: 1px dashed var(--bd);
  border-radius: 8px;
  background: var(--hv);
}
.medicine-image-preview img,
.medicine-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.medicine-image-preview span {
  color: var(--mu);
  font-size: 26px;
}
.medicine-basic-grid,
.medicine-dates-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.medicine-stock-field {
  grid-column: 1 / -1;
}
.medicine-form .in {
  width: 100%;
  min-width: 0;
}
.medicine-units {
  display: grid;
  gap: 12px;
  padding: 13px;
  border: 1px solid var(--bd);
  border-radius: 8px;
  background: var(--hv);
}
.medicine-default-dosage {
  display: grid;
  gap: 12px;
  padding: 13px;
  border: 1px solid var(--bd);
  border-radius: 8px;
}
.medicine-dosage-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.medicine-dosage-grid > label {
  display: grid;
  gap: 7px;
  color: var(--tx);
  font-size: 12px;
}
.medicine-units-heading {
  display: grid;
  gap: 4px;
}
.medicine-unit-add {
  width: 100%;
}
.medicine-unit-row {
  display: grid;
  grid-template-columns: 1.2fr 0.85fr 1.1fr auto;
  align-items: end;
  gap: 10px;
}
.medicine-unit-row .btn {
  min-width: 36px;
  min-height: 38px;
}
.medicine-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--bd);
}
.medicine-table-wrap {
  margin-top: 12px;
}
.medicine-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
  margin-top: 12px;
}
.medicine-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  overflow: hidden;
  padding: 0;
}
.medicine-card-photo {
  width: calc(100% - 12px);
  height: auto;
  min-height: 0;
  aspect-ratio: 1;
  margin: 12px 0 12px 12px;
  object-fit: cover;
  background: var(--bg);
  display: grid;
  place-items: center;
  border-radius: 8px;
}
.medicine-card-body {
  min-width: 0;
  padding: 12px;
}
.medicine-card-body h3,
.medicine-card-body p {
  margin: 0 0 8px;
}
.medicine-card-stock,
.medicine-detail-units > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.medicine-card-dates {
  display: grid;
  gap: 3px;
  margin: 8px 0;
  color: var(--mu);
  font-size: 12px;
}
.medicine-card .medicine-actions {
  margin-top: 10px;
}
.medicine-detail {
  margin-top: 12px;
  padding: 18px;
}
.medicine-detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.medicine-detail-hero {
  display: flex;
  align-items: center;
  gap: 18px;
  margin: 18px 0;
}
.medicine-detail-hero h2,
.medicine-detail-hero p {
  margin: 0 0 8px;
}
.medicine-detail-photo {
  width: 132px;
  height: 132px;
  flex: 0 0 132px;
  object-fit: cover;
  border: 1px solid var(--bd);
  border-radius: 12px;
  background: var(--bg);
}
.medicine-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}
.medicine-detail-grid > section {
  padding: 14px;
  border: 1px solid var(--bd);
  border-radius: 10px;
}
.medicine-detail-grid h3 {
  margin: 0 0 10px;
  font-size: 15px;
}
.medicine-detail-grid p {
  margin: 6px 0;
  white-space: pre-wrap;
}
.medicine-detail-units {
  display: grid;
  gap: 8px;
}
.medicine-detail-units > div {
  padding-bottom: 7px;
  border-bottom: 1px solid var(--bd);
}
.medicine-table {
  min-width: 720px;
}
.medicine-table td {
  vertical-align: middle;
}
.medicine-name {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 190px;
}
.medicine-name > div {
  display: grid;
  gap: 3px;
}
.medicine-name small,
.medicine-notify {
  display: block;
  color: var(--mu);
  font-size: 11px;
}
.medicine-thumb {
  width: 44px;
  height: 44px;
  border-style: solid;
}
.medicine-thumb-empty {
  font-size: 20px;
}
.medicine-unit-list {
  display: grid;
  gap: 4px;
  font-size: 12px;
}
.medicine-unit-list small {
  color: var(--mu);
}
.medicine-notify {
  margin-top: 4px;
}
.medicine-expired {
  color: #dc2626;
  font-weight: 700;
}
.medicine-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.medicine-actions .btn {
  min-width: 32px;
  padding: 5px 7px;
}
.medicine-composition-view {
  min-height: 48px;
  padding: 12px;
  border: 1px solid var(--bd);
  border-radius: 8px;
  white-space: pre-wrap;
}
.medicine-code-label {
  display: grid;
  justify-items: center;
  gap: 8px;
  max-width: 320px;
  margin: 24px auto;
  text-align: center;
}
.medicine-code-label h2,
.medicine-code-label p {
  margin: 0;
}
.medicine-code-label svg {
  display: block;
  max-width: 100%;
  height: auto;
}
@media (max-width: 680px) {
  .medicine-detail-hero {
    align-items: flex-start;
  }
  .medicine-detail-photo {
    width: 88px;
    height: 88px;
    flex-basis: 88px;
  }
  .medicine-basic-grid,
  .medicine-dates-grid,
  .medicine-unit-row {
    grid-template-columns: 1fr;
  }
  .medicine-stock-field {
    grid-column: auto;
  }
}
.report-toolbar {
  margin-bottom: 16px;
  padding: 12px;
  overflow: visible;
}
.report-filter-line,
.report-action-line {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}
.report-action-line {
  align-items: center;
  margin-top: 10px;
  padding-top: 9px;
  border-top: 1px solid var(--bd);
}
.report-search-field,
.report-date-field {
  display: grid;
  gap: 3px;
  color: var(--mu);
  font-size: 11px;
}
.report-search-field {
  flex: 1 1 260px;
}
.report-date-field {
  flex: 0 1 138px;
}
.report-search-field .in,
.report-date-field .in {
  width: 100%;
  min-width: 0;
  padding: 7px 9px;
  font-size: 11px;
}
.report-toolbar .btn {
  min-height: 36px;
  padding: 7px 10px;
  font-size: 11px;
  white-space: nowrap;
}
.report-quick {
  background: var(--cd);
}
.report-quick.active {
  border-color: var(--p);
  color: var(--p);
  box-shadow: 0 0 0 1px var(--p) inset;
}
.report-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.report-stat {
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 16px;
}
.report-stat b {
  font-size: 14px;
}
.report-stat strong {
  overflow-wrap: anywhere;
  font-size: 18px;
}
.report-stat strong.income {
  color: #16a34a;
}
.report-stat strong.expense {
  color: #ef4444;
}
.report-ledgers {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.report-ledger {
  min-width: 0;
  min-height: 420px;
  padding: 14px;
}
.report-ledger h3 {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0 0 10px;
  font-size: 16px;
}
.report-ledger h3 span {
  font-size: 20px;
}
.income-ledger h3 {
  color: #16a34a;
}
.expense-ledger h3 {
  color: #ef4444;
}
.report-ledger-scroll {
  max-height: 350px;
  overflow: auto;
}
.report-ledger table {
  min-width: 480px;
  font-size: 10px;
}
.report-ledger th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 8px 6px;
  background: var(--hv);
  color: var(--tx);
  font-size: 10px;
}
.report-ledger td {
  padding: 7px 6px;
  font-size: 10px;
  vertical-align: middle;
}
.report-ledger th:first-child,
.report-ledger td:first-child {
  white-space: nowrap;
}
.report-ledger .report-amount {
  text-align: right;
  white-space: nowrap;
  font-weight: 600;
}
.income-ledger th:nth-child(5),
.income-ledger td:nth-child(5) {
  text-align: center;
}
.income-ledger th:nth-child(4),
.income-ledger td:nth-child(4) {
  text-align: center;
}
.report-delete {
  min-width: 28px;
  padding: 4px 6px;
  border-color: #ef4444;
  background: #ef4444;
  color: #fff;
}
.report-ledger .report-empty {
  padding: 28px 8px;
  color: var(--mu);
  text-align: center;
}
#mf.report-expense-form {
  display: grid;
  gap: 12px;
  width: min(340px, 94vw);
  padding: 16px;
  border: 1px solid var(--bd);
  border-radius: 7px;
}
.report-form-heading,
.report-form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.report-form-heading h3 {
  margin: 0;
  font-size: 16px;
}
.report-expense-close {
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border: 0;
  background: transparent;
  color: var(--mu);
  font-size: 20px;
  cursor: pointer;
}
.report-expense-form .report-expense-row {
  display: grid !important;
  grid-template-columns: 76px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  margin: 0 !important;
  font-size: 12px;
}
.report-expense-form .report-expense-row > span {
  text-align: right;
}
.report-expense-form .in {
  width: 100%;
  min-width: 0;
  height: 42px;
  margin: 0;
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 12px;
}
.report-expense-form .report-expense-total {
  background: var(--bg);
  color: var(--mu);
}
.report-expense-form .report-expense-notes {
  align-items: start;
}
.report-expense-form .report-expense-notes > span {
  padding-top: 10px;
}
.report-expense-form textarea.in {
  height: 64px;
  resize: vertical;
}
.report-form-actions {
  justify-content: flex-end;
  margin-top: 0;
}
.medicine-report-heading {
  margin: 18px 0 20px;
  text-align: center;
}
.medicine-report-heading h2 {
  margin: 0 0 6px;
  color: var(--tx);
  font-size: 22px;
}
.medicine-report-heading p {
  margin: 0;
  color: var(--mu);
  font-size: 12px;
}
.medicine-report-filters {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  width: 100%;
  max-width: none;
  margin: 0 0 16px;
  padding: 16px;
}
.medicine-report-date {
  display: grid;
  flex: 0 1 150px;
  gap: 5px;
  color: var(--mu);
  font-size: 11px;
}
.medicine-report-date .in {
  width: 100%;
  min-width: 0;
  height: 36px;
  padding: 6px 8px;
  font-size: 11px;
}
.medicine-report-filters .btn {
  min-height: 36px;
  white-space: nowrap;
  font-size: 11px;
}
.medicine-report-export {
  border-color: #7c3aed;
  background: linear-gradient(110deg, #033993, #9333ea);
  color: #fff;
}
.medicine-report-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  width: 100%;
  max-width: none;
  margin: 0 0 16px;
}
.medicine-report-summary article {
  position: relative;
  display: grid;
  gap: 5px;
  min-height: 72px;
  padding: 14px 16px;
}
.medicine-report-summary article span {
  color: var(--mu);
  font-size: 11px;
}
.medicine-report-summary article strong {
  color: #033993;
  font-size: 20px;
}
.medicine-report-summary article:nth-child(2) strong {
  color: #16a34a;
}
.medicine-report-summary article i {
  position: absolute;
  top: 18px;
  right: 18px;
  color: #3b82f6;
  font-size: 24px;
  font-style: normal;
}
.medicine-report-summary article:nth-child(2) i {
  color: #22c55e;
}
.medicine-report-table-wrap {
  width: 100%;
  max-width: none;
  margin: 0;
  overflow: auto;
}
.medicine-report-table {
  width: 100%;
  min-width: 620px;
  border-collapse: collapse;
  font-size: 11px;
}
.medicine-report-table thead {
  background: linear-gradient(110deg, #033993, #9333ea);
  color: #fff;
}
.medicine-report-table th {
  padding: 12px 14px;
  text-align: left;
  white-space: nowrap;
}
.medicine-report-table td {
  height: 46px;
  padding: 8px 14px;
  border-bottom: 1px solid var(--bd);
}
.medicine-report-total {
  font-weight: 700;
  text-align: right;
  white-space: nowrap;
}
.medicine-report-delete {
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 5px;
  background: #ef4444;
  color: #fff;
}
.medicine-report-empty {
  padding: 24px !important;
  color: var(--mu);
  text-align: center;
}
.sample-file-list {
  overflow: auto;
}
.sample-file-preview {
  max-width: 520px;
  color: var(--mu);
}
#mf.sample-file-form {
  display: grid;
  grid-template-rows: auto auto minmax(260px, 1fr) auto;
  gap: 10px;
  width: min(700px, 96vw);
  height: min(806px, 94vh);
  max-height: 94vh;
  padding: 16px 18px;
}
.sample-file-heading,
.sample-file-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.sample-file-heading {
  justify-content: space-between;
}
.sample-file-heading h3 {
  margin: 0;
  font-size: 14px;
}
.sample-file-close {
  border: 0;
  background: transparent;
  color: var(--mu);
  font-size: 20px;
  cursor: pointer;
}
.sample-file-title {
  width: 100%;
  min-height: 38px;
  border-color: var(--p);
}
.sample-file-editor {
  display: flex;
  min-height: 0;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--bd);
  border-radius: 6px;
}
.sample-file-toolbar {
  display: flex;
  min-height: 40px;
  align-items: center;
  gap: 3px;
  padding: 4px 8px;
  overflow-x: auto;
  border-bottom: 1px solid var(--bd);
  background: var(--cd);
}
.sample-file-toolbar select.in {
  width: auto;
  max-width: 110px;
  height: 30px;
  padding: 3px 5px;
  border: 0;
  font-size: 11px;
}
.sample-file-tool {
  display: grid;
  min-width: 26px;
  height: 28px;
  place-items: center;
  padding: 3px 6px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--tx);
  font-size: 13px;
  cursor: pointer;
}
.sample-file-tool:hover {
  background: var(--hv);
}
.sample-file-tool-bold {
  font-weight: 700;
}
.sample-file-tool-italic {
  font-style: italic;
}
.sample-file-tool-underline {
  text-decoration: underline;
}
.sample-file-tool-strikeThrough {
  text-decoration: line-through;
}
.sample-file-editor-body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 12px;
  outline: 0;
  background: var(--cd);
  font-size: 13px;
}
.sample-file-editor-body:focus {
  box-shadow: inset 0 0 0 1px #3b82f6;
}
.sample-file-editor-body img {
  max-width: 100%;
}
.sample-file-actions {
  justify-content: flex-end;
}
.sample-file-actions [data-a="samplefileimage"] {
  margin-right: auto;
}
@media (max-width: 560px) {
  #mf.sample-file-form {
    width: 96vw;
    height: 92vh;
    padding: 12px;
  }
  .sample-file-actions {
    flex-wrap: wrap;
  }
}
@media (max-width: 560px) {
  .medicine-report-filters {
    align-items: stretch;
    flex-wrap: wrap;
  }
  .medicine-report-date {
    flex: 1 1 100%;
  }
  .medicine-report-summary {
    gap: 8px;
  }
  .medicine-report-summary article {
    padding: 12px;
  }
  .medicine-report-summary article strong {
    font-size: 16px;
  }
}
@media (max-width: 900px) {
  .report-filter-line {
    align-items: stretch;
  }
  .report-search-field {
    flex-basis: 100%;
  }
  .report-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .report-ledgers {
    grid-template-columns: 1fr;
  }
  .report-ledger {
    min-height: 250px;
  }
}
@media (max-width: 560px) {
  .report-summary {
    gap: 8px;
  }
  .report-stat {
    padding: 12px;
  }
  .report-stat strong {
    font-size: 15px;
  }
}
.analytics-dashboard {
  width: 100%;
  margin: 10px 0 32px;
}
.analytics-heading {
  margin-bottom: 14px;
}
.analytics-heading h1 {
  font-size: 20px;
}
.analytics-heading p {
  color: var(--mu);
  font-size: 12px;
}
.analytics-dashboard .card {
  border-radius: 6px;
}
.analytics-filters {
  padding: 14px;
  margin-bottom: 14px;
}
.analytics-filters h2,
.analytics-financial h2,
.analytics-chart-card h2 {
  font-size: 14px;
  margin: 0 0 12px;
}
.analytics-filters h2 span {
  margin-right: 5px;
}
.analytics-filter-controls {
  display: flex;
  align-items: flex-end;
  gap: 9px;
  flex-wrap: wrap;
}
.analytics-filter-controls > label,
.analytics-period-field {
  display: grid;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
}
.analytics-filter-controls .in {
  min-width: 0;
  width: 148px;
  height: 34px;
  border-radius: 5px;
  padding: 6px 8px;
  font-size: 11px;
}
.analytics-period-switch {
  display: flex;
  gap: 0;
  background: var(--hv);
  padding: 3px;
  border-radius: 5px;
}
.analytics-period-switch button {
  border: 0;
  border-radius: 4px;
  background: transparent;
  padding: 6px 9px;
  cursor: pointer;
  font-size: 10px;
}
.analytics-period-switch button.active {
  background: var(--p);
  color: #fff;
}
.btn.analytics-clear {
  height: 34px;
  border-radius: 5px;
  padding: 6px 12px;
  font-size: 10px;
}
.analytics-financial {
  padding: 14px;
  margin-bottom: 14px;
}
.analytics-chart-scroll {
  overflow-x: auto;
}
.analytics-financial-svg {
  display: block;
  width: 100%;
  min-width: 600px;
  height: auto;
}
.analytics-axis-label {
  fill: var(--mu);
  font-size: 10px;
}
.analytics-legend {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 2px;
  font-size: 10px;
}
.analytics-legend span,
.analytics-service-legend span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.analytics-legend i,
.analytics-service-legend i {
  width: 8px;
  height: 8px;
  flex: none;
}
.analytics-chart-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.analytics-chart-card {
  min-height: 224px;
  padding: 14px;
}
.analytics-bars {
  display: grid;
  gap: 13px;
  padding: 8px 0 4px;
}
.analytics-bar-row {
  display: grid;
  grid-template-columns: minmax(70px, 1fr) minmax(45px, 1.8fr) 32px;
  align-items: center;
  gap: 8px;
  font-size: 10px;
}
.analytics-bar-row > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.analytics-bar-row > div {
  height: 10px;
  overflow: hidden;
  border-radius: 5px;
  background: var(--hv);
}
.analytics-bar-row > div i {
  display: block;
  height: 100%;
  border-radius: inherit;
}
.analytics-bar-row > b {
  text-align: right;
  font-weight: 500;
}
.analytics-pie-svg {
  display: block;
  width: min(100%, 240px);
  max-height: 150px;
  margin: 0 auto 4px;
  overflow: visible;
}
.analytics-pie-label {
  fill: #033993;
  font-size: 10px;
}
.analytics-service-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 5px 8px;
  font-size: 9px;
}
.analytics-service-legend span {
  max-width: 100%;
}
.analytics-service-legend span:not(:hover) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.analytics-chart-empty {
  display: grid;
  min-height: 145px;
  place-items: center;
  padding: 12px;
  color: var(--mu);
  font-size: 12px;
  text-align: center;
}
@media (max-width: 680px) {
  .analytics-dashboard {
    margin-top: 0;
  }
  .analytics-filter-controls {
    align-items: stretch;
  }
  .analytics-filter-controls > label,
  .analytics-period-field {
    flex: 1 1 135px;
  }
  .analytics-filter-controls .in {
    width: 100%;
  }
  .analytics-filter-controls .analytics-clear {
    flex: 1 1 100%;
  }
  .analytics-chart-grid {
    grid-template-columns: 1fr;
  }
  .analytics-chart-card {
    min-height: 210px;
  }
}
.doctor-analytics-dashboard {
  width: 100%;
  margin: 22px 0 32px;
}
.doctor-analytics-heading {
  margin-bottom: 20px;
}
.doctor-analytics-heading h1 {
  font-size: 24px;
}
.doctor-analytics-heading p {
  margin-top: 2px;
  color: var(--mu);
}
.doctor-analytics-dashboard .card {
  border-radius: 7px;
}
.doctor-analytics-filters {
  padding: 18px 20px;
  margin-bottom: 20px;
}
.doctor-analytics-filters h2,
.doctor-analytics-chart-card h2 {
  margin: 0 0 16px;
  font-size: 18px;
}
.doctor-analytics-filter-controls {
  display: flex;
  align-items: flex-end;
  gap: 14px;
  flex-wrap: wrap;
}
.doctor-analytics-filter-controls label {
  display: grid;
  gap: 6px;
  min-width: 0;
  color: var(--tx);
  font-size: 12px;
  font-weight: 600;
}
.doctor-analytics-filter-controls .in {
  width: 160px;
  min-width: 0;
  height: 38px;
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 13px;
}
.doctor-analytics-filter-controls select.in {
  width: 185px;
}
.btn.doctor-analytics-clear {
  height: 38px;
  border-radius: 6px;
  padding: 8px 16px;
  font-size: 12px;
}
.doctor-analytics-chart-card {
  padding: 18px 20px 14px;
}
.doctor-analytics-chart-card h2 span {
  margin-right: 5px;
}
.doctor-analytics-chart-scroll {
  overflow-x: auto;
}
.doctor-analytics-svg {
  display: block;
  width: 100%;
  min-width: 680px;
  height: auto;
}
.doctor-analytics-axis-label {
  fill: var(--mu);
  font-size: 12px;
}
.doctor-analytics-bar {
  cursor: pointer;
}
.doctor-analytics-hover-target {
  pointer-events: all;
}
.doctor-analytics-tooltip {
  display: none;
  pointer-events: none;
}
.doctor-analytics-bar:hover .doctor-analytics-tooltip,
.doctor-analytics-bar:focus .doctor-analytics-tooltip,
.doctor-analytics-bar:focus-visible .doctor-analytics-tooltip {
  display: block;
}
.doctor-analytics-tooltip rect {
  fill: var(--cd);
  stroke: #cbd5e1;
}
.doctor-analytics-tooltip-name {
  fill: var(--tx);
  font-size: 14px;
}
.doctor-analytics-tooltip-count {
  fill: #8884d8;
  font-size: 13px;
}
.doctor-analytics-legend {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 3px 0 6px;
  color: #8884d8;
  font-size: 13px;
}
.doctor-analytics-legend i {
  width: 12px;
  height: 12px;
  background: #8884d8;
}
.doctor-analytics-empty {
  display: grid;
  min-height: 280px;
  place-items: center;
  color: var(--mu);
  font-size: 13px;
}
@media (max-width: 680px) {
  .doctor-analytics-dashboard {
    margin-top: 0;
  }
  .doctor-analytics-filter-controls {
    align-items: stretch;
  }
  .doctor-analytics-filter-controls label {
    flex: 1 1 145px;
  }
  .doctor-analytics-filter-controls .in,
  .doctor-analytics-filter-controls select.in {
    width: 100%;
  }
  .doctor-analytics-filter-controls .doctor-analytics-clear {
    flex: 1 1 100%;
  }
  .doctor-analytics-chart-card {
    padding: 14px 12px 10px;
  }
}
.user-management-section {
  margin-top: 24px;
}
.user-management-section > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 12px;
}
.user-management-section > header h2,
.user-management-form h3 {
  margin: 0 0 6px;
}
.user-management-section > header p {
  margin: 0;
  color: var(--mu, #64748b);
}
.user-management-table {
  width: 100%;
  border-collapse: collapse;
}
.user-management-table th,
.user-management-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line, #e2e8f0);
  text-align: left;
}
.user-management-form {
  padding: 16px;
  margin: 12px 0;
}
.user-role-note {
  margin: 0 0 12px;
  color: var(--mu, #64748b);
}
.user-form-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin: 14px 0;
}
.user-form-fields label {
  display: grid;
  gap: 6px;
}
.user-management-form h4 {
  margin: 16px 0 8px;
}
.user-permission-grid {
  display: grid;
  grid-template-columns: minmax(180px, 2fr) repeat(5, minmax(58px, 1fr));
  align-items: center;
  gap: 0 8px;
  overflow-x: auto;
}
.user-permission-heading {
  padding: 8px 4px;
  font-weight: 700;
  font-size: 12px;
}
.user-permission-area,
.user-permission-check {
  min-height: 38px;
  padding: 8px 4px;
  border-top: 1px solid var(--line, #e2e8f0);
}
.user-permission-check {
  text-align: center;
}
.user-permission-check input {
  width: 16px;
  height: 16px;
}
.user-management-form > .tools {
  justify-content: flex-end;
  margin-top: 14px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
@media (max-width: 700px) {
  .user-management-section > header {
    align-items: flex-start;
    flex-direction: column;
  }
  .user-permission-grid {
    min-width: 620px;
  }
}
#mf.medlist-dialog {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 0;
  width: min(960px, 96vw);
  height: min(660px, 92vh);
  max-height: min(660px, 92vh);
  overflow: hidden;
  padding: 0;
}
#mf.medlist-dialog .operation-form-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0;
  padding: 16px 22px;
  border-bottom: 1px solid var(--bd);
}
#mf.medlist-dialog .operation-form-heading h3 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-width: 0;
  margin: 0;
  font-size: 19px;
}
.medlist-total-badge {
  flex: 0 0 auto;
  padding: 7px 12px;
  border-radius: 20px;
  background: #dcfce7;
  color: #16733a;
  font-size: 15px;
  white-space: nowrap;
}
.medlist-picker {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(260px, 1fr);
  min-height: 0;
}
.medlist-picker-catalog {
  display: grid;
  grid-template-rows: 44px 42px minmax(0, 1fr);
  gap: 12px;
  min-width: 0;
  min-height: 0;
  padding: 16px 18px;
}
.medlist-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
  padding: 4px;
  border-radius: 8px;
  background: #f1f5f9;
}
.medlist-tab {
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #64748b;
  cursor: pointer;
  font: inherit;
}
.medlist-tab.on {
  background: #fff;
  color: #1e293b;
  box-shadow: 0 1px 3px #0f172a18;
}
.medlist-search {
  display: flex !important;
  align-items: center;
  gap: 9px;
  min-width: 0;
  margin: 0 !important;
  padding: 0 11px;
  border: 1px solid var(--bd);
  border-radius: 7px;
  color: #94a3b8;
}
#md .medlist-search input {
  width: 100%;
  min-width: 0;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  font: inherit;
}
.medlist-catalog {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-height: 0;
  overflow-y: auto;
  padding-right: 2px;
}
.medlist-option {
  display: grid !important;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  grid-template-rows: auto auto;
  align-items: center;
  gap: 2px 10px;
  min-height: 68px;
  margin: 0 !important;
  padding: 10px 12px;
  border: 1px solid var(--bd);
  border-radius: 9px;
  background: var(--cd);
  cursor: pointer;
}
.medlist-option.selected {
  border-color: #93c5fd;
  background: #eff6ff;
}
#md .medlist-option > input {
  grid-column: 1;
  grid-row: 1 / 3;
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: #3b82f6;
}
.medlist-option-details {
  display: grid;
  min-width: 0;
  gap: 4px;
}
.medlist-option-details b {
  overflow: hidden;
  font-size: 15px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.medlist-option-details small,
.medlist-option-unit {
  color: var(--mu);
  font-size: 11px;
}
.medlist-option-price {
  grid-column: 3;
  grid-row: 1;
  color: #16803c;
  font-size: 15px;
  white-space: nowrap;
}
.medlist-option-unit {
  grid-column: 3;
  grid-row: 2;
  justify-self: end;
  padding: 3px 8px;
  border: 1px solid var(--bd);
  border-radius: 12px;
  white-space: nowrap;
}
.medlist-empty,
.medlist-no-selection {
  margin: 0;
  padding: 24px 12px;
  color: var(--mu);
  text-align: center;
}
.medlist-selection {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-width: 0;
  min-height: 0;
  border-left: 1px solid var(--bd);
}
.medlist-selection h4 {
  margin: 0;
  padding: 18px 16px;
  border-bottom: 1px solid var(--bd);
  font-size: 16px;
}
.medlist-selected {
  display: flex;
  flex-direction: column;
  gap: 7px;
  overflow-y: auto;
  padding: 12px;
  background: #f8fafc;
}
.medlist-selected-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 8px;
  padding: 9px;
  border: 1px solid var(--bd);
  border-radius: 8px;
  background: var(--cd);
}
.medlist-selected-item > span {
  display: grid;
  min-width: 0;
  gap: 4px;
}
.medlist-selected-item > span b {
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.medlist-selected-item small {
  color: var(--mu);
  font-size: 11px;
}
.medlist-selected-item > b {
  color: #16803c;
  font-size: 12px;
  white-space: nowrap;
}
.medlist-remove {
  min-width: 26px;
  padding: 3px 6px;
}
#mf.medlist-dialog > .tools.fb {
  margin: 0;
  padding: 14px 22px;
  border-top: 1px solid var(--bd);
  background: #f8fafc;
}
.medlist-record-items {
  display: grid;
  gap: 7px;
  margin-top: 10px;
}
.medlist-record-items > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}
.medlist-record-items span {
  display: grid;
  gap: 3px;
}
.medlist-record-items small {
  color: var(--mu);
}
.medlist-record-total {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--bd);
  text-align: right;
}
@media (max-width: 680px) {
  #mf.medlist-dialog {
    max-height: 94vh;
  }
  #mf.medlist-dialog .operation-form-heading {
    padding: 12px;
  }
  #mf.medlist-dialog .operation-form-heading h3 {
    flex-wrap: wrap;
    gap: 6px;
    font-size: 16px;
  }
  .medlist-total-badge {
    padding: 5px 9px;
    font-size: 13px;
  }
  .medlist-picker {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(230px, 1fr) minmax(110px, 0.7fr);
    overflow-y: auto;
  }
  .medlist-picker-catalog {
    padding: 12px;
  }
  .medlist-selection {
    border-top: 1px solid var(--bd);
    border-left: 0;
  }
  .medlist-selection h4 {
    padding: 10px 12px;
  }
  .medlist-selected {
    max-height: 150px;
  }
  #mf.medlist-dialog > .tools.fb {
    padding: 12px;
  }
}
.medlist-dispense {
  display: grid;
  gap: 20px;
  padding: 28px;
  border-radius: 16px;
  background: var(--cd);
  box-shadow: 0 3px 8px #0f172a18;
}
.medlist-dispense-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.medlist-dispense-header h2 {
  margin: 0;
  font-size: 22px;
}
.medlist-md-order {
  min-height: 48px;
  padding: 10px 18px;
  background: #ef4444;
  color: #fff;
}
.medlist-dispense-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 28px;
  height: min(390px, 52vh);
  min-height: min(240px, 52vh);
}
.medlist-dispense-catalog,
.medlist-dispense-selection {
  display: grid;
  grid-template-rows: auto 50px minmax(0, 1fr);
  gap: 10px;
  min-width: 0;
  min-height: 0;
}
.medlist-dispense-selection {
  grid-template-rows: auto minmax(0, 1fr);
}
.medlist-dispense-catalog h3,
.medlist-dispense-selection h3,
.medlist-dispense-history h3 {
  margin: 0;
  font-size: 18px;
}
.medlist-dispense-search {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 0 12px;
  border: 1px solid var(--bd);
  border-radius: 8px;
  color: #64748b;
}
#rp .medlist-dispense-search input {
  width: 100%;
  min-width: 0;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}
.medlist-dispense-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
  overflow: auto;
  padding: 8px 10px;
  border: 1px solid var(--bd);
  border-radius: 8px;
}
.medlist-dispense-medicine {
  display: grid;
  justify-items: start;
  gap: 6px;
  padding: 4px 2px 8px;
}
.medlist-dispense-medicine-heading {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.medlist-dispense-stock {
  padding: 4px 9px;
  border: 1px solid var(--bd);
  border-radius: 7px;
  color: var(--tx);
  font-size: 13px;
  white-space: nowrap;
}
.medlist-dispense-medicine-heading > b {
  font-size: 16px;
  font-weight: 500;
}
.medlist-dispense-units {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.medlist-dispense-units .btn {
  min-height: 40px;
  padding: 7px 14px;
}
.medlist-dispense-selected {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
  overflow: auto;
}
.medlist-dispense-empty {
  margin: 0;
  padding: 12px 0;
  color: var(--mu);
}
.medlist-dispense-selected > article {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) 100px auto auto auto 28px;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 6px 0;
}
.medlist-dispense-item-name {
  min-width: 0;
}
.medlist-dispense-item-name b {
  overflow: hidden;
  font-size: 15px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.medlist-dispense-item-name span {
  font-weight: 400;
}
.medlist-dispense-quantity {
  width: 100px;
  min-width: 0;
  height: 50px;
  margin: 0;
  padding: 8px 12px;
  font-variant-numeric: tabular-nums;
}
.medlist-dispense-flag {
  display: flex;
  align-items: center;
  gap: 5px;
  margin: 0;
  font-size: 14px;
  white-space: nowrap;
}
.medlist-dispense-flag input {
  width: 20px;
  height: 20px;
  margin: 0;
  accent-color: var(--p);
}
.medlist-dispense-remove {
  display: grid;
  width: 28px;
  height: 34px;
  place-items: center;
  padding: 4px;
  border: 0;
  background: transparent;
  color: #ef4444;
  cursor: pointer;
}
.medlist-dispense-remove svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.medlist-dispense-actions {
  display: flex;
  justify-content: flex-end;
  padding: 2px 0;
}
.medlist-dispense-actions .btn {
  min-height: 48px;
  padding: 10px 20px;
}
.medlist-dispense-history {
  display: grid;
  gap: 10px;
  padding-top: 20px;
  border-top: 1px solid var(--bd);
}
.medlist-dispense-history-list {
  display: grid;
  gap: 12px;
}
.medlist-history-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 16px;
  padding: 18px 22px;
  border: 1px solid #dbeafe;
  border-radius: 16px;
  background: var(--cd);
  box-shadow: 0 8px 18px #0f172a12;
}
.medlist-history-card-content {
  min-width: 0;
}
.medlist-history-date {
  font-size: 16px;
}
.medlist-history-card ul {
  display: grid;
  gap: 4px;
  margin: 8px 0 0;
  padding-left: 24px;
}
.medlist-history-card li {
  padding-left: 2px;
  font-size: 16px;
}
.medlist-history-card li::marker {
  color: var(--tx);
}
.medlist-history-edit,
.medlist-history-delete {
  display: inline-grid;
  place-items: center;
  border: 0;
  background: transparent;
  cursor: pointer;
}
.medlist-history-edit {
  width: 28px;
  height: 28px;
  margin-left: 8px;
  color: #033993;
  vertical-align: middle;
}
.medlist-history-edit svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.medlist-history-delete {
  width: 50px;
  height: 46px;
  border-radius: 9px;
  background: #ef4444;
  color: #fff;
}
.medlist-history-delete svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.medlist-history-delete:hover {
  background: #dc2626;
}
.medlist-history-edit-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: center;
  gap: 10px;
}
.medlist-history-edit-form > .fl {
  grid-column: 1 / -1;
}
@media (max-width: 520px) {
  .medlist-history-card {
    gap: 8px;
    padding: 14px;
  }
  .medlist-history-card li {
    font-size: 14px;
  }
}
@media (max-width: 760px) {
  .medlist-dispense {
    gap: 16px;
    padding: 16px;
  }
  .medlist-dispense-workspace {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(180px, 1fr) minmax(120px, 0.7fr);
    gap: 18px;
    height: min(520px, 68vh);
    min-height: min(300px, 68vh);
  }
  .medlist-dispense-catalog {
    grid-template-rows: auto 46px minmax(180px, 1fr);
  }
}
@media (max-width: 480px) {
  .medlist-dispense-header {
    align-items: flex-start;
    flex-direction: column;
  }
  .medlist-dispense-header h2 {
    font-size: 19px;
  }
  .medlist-dispense-selected > article {
    grid-template-columns: minmax(0, 1fr) 82px 28px;
    row-gap: 10px;
  }
  .medlist-dispense-quantity {
    grid-column: 2;
    grid-row: 1;
    width: 82px;
  }
  .medlist-dispense-flag {
    grid-row: 2;
  }
  .medlist-dispense-flag:first-of-type {
    grid-column: 1;
  }
  .medlist-dispense-remove {
    grid-column: 3;
    grid-row: 1;
  }
}
#capture-protection-curtain {
  position: fixed;
  z-index: 10000;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgb(15 23 42 / 96%);
  color: #fff;
  text-align: center;
}
#capture-protection-curtain strong {
  font-size: 22px;
}
#capture-protection-curtain span {
  color: #cbd5e1;
}
#capture-protection-curtain[hidden] {
  display: none !important;
}
body.capture-protection-obscured #app,
body.capture-protection-obscured #md,
body.capture-protection-obscured #ts {
  filter: blur(12px);
}
@media print {
  #capture-protection-curtain {
    display: none !important;
  }
}
