:root {
  --ink: #243028;
  --muted: #667066;
  --pine: #243028;
  --pine-2: #314438;
  --gold: #b8893a;
  --gold-2: #d6b56a;
  --paper: #f4efe6;
  --panel: #ffffff;
  --line: #ded5c5;
  --receipt: #17643f;
  --payment: #8c3418;
  --ok: #e5f2e8;
  --ok-ink: #145233;
  --err: #f8e6df;
  --err-ink: #7a2e18;
  --sidebar-w: 250px;
  --shadow: 0 10px 28px rgba(36, 48, 40, 0.08);
  color: var(--ink);
  font-family: "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.45;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); overflow-x: hidden; }
a { color: var(--pine); }
button, input, select { font: inherit; color: inherit; }
h1 { margin: 0 0 6px; font-size: 32px; font-weight: 650; letter-spacing: -0.03em; }
h2 { margin: 0 0 14px; font-size: 18px; }
.lede { margin: 0 0 18px; color: var(--muted); max-width: 68ch; }
.muted { color: var(--muted); }
.eyebrow { margin: 0 0 8px; letter-spacing: 0.16em; text-transform: uppercase; font-size: 12px; color: var(--gold); }

.shell { display: grid; grid-template-columns: var(--sidebar-w) 1fr; height: 100vh; overflow: hidden; transition: grid-template-columns .2s ease; }
.shell.is-collapsed { --sidebar-w: 70px; }
.sidebar { background: #21352c; color: #f4efe6; padding: 8px 8px 10px; display: flex; flex-direction: column; height: 100vh; overflow: hidden; }
.brand { color: inherit; text-decoration: none; display: block; line-height: 0; }
.brand.hospital, .brand.product { background: transparent; border: 0; padding: 0; box-shadow: none; }
.brand img { display: block; width: 100%; height: auto; }
.sidebar-menu { flex: 1 1 auto; min-height: 0; overflow-y: auto; margin: 8px 4px 8px; padding-right: 2px; }
.nav-label { margin: 14px 10px 4px; font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: #c6b184; }
.nav-link { color: #f3eadc; text-decoration: none; border-radius: 8px; padding: 8px 12px; min-height: 38px; display: flex; align-items: center; gap: 10px; font-size: 14.5px; }
.nav-icon { width: 18px; height: 18px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.nav-link:hover { background: rgba(255,255,255,.06); color: white; }
.nav-link.active { background: linear-gradient(180deg, #d0aa5c, #a67c2f); color: white; box-shadow: 0 2px 6px rgba(0,0,0,.2); }
.brand.product { margin-top: auto; }
.shell.is-collapsed .nav-text,
.shell.is-collapsed .nav-label,
.shell.is-collapsed .brand.hospital,
.shell.is-collapsed .brand.product { display: none; }
.shell.is-collapsed .nav-link { justify-content: center; padding: 8px; }

.main { min-width: 0; height: 100vh; display: flex; flex-direction: column; overflow: hidden; background: var(--paper); }
.topbar { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 18px; min-height: 68px; padding: 8px 16px 8px 10px; border-bottom: 1px solid #e4d3ae; flex: 0 0 auto; background: #f6f1e6; z-index: 5; }
.topbar-start, .topbar-end { display: flex; align-items: center; gap: 4px; min-width: 0; }
.topbar-end { gap: 8px; justify-content: flex-end; }
.topbar-title { display: block; font-size: 22px; line-height: 1.1; color: #1d3328; font-weight: 700; }
.header-title { min-width: 0; padding: 0 6px; }
.title-mark { display: block; width: 7px; height: 7px; margin: 4px 0 0 2px; border-radius: 50%; background: #2f6b45; }
.crumb { margin: 2px 0 0; font-size: 12px; color: var(--muted); display: flex; gap: 6px; }
.crumb a { color: var(--muted); text-decoration: none; }
.icon-btn, .user-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 38px; height: auto; border: 0; background: transparent; color: #314438; cursor: pointer; border-radius: 10px; padding: 0 8px; }
.icon-btn { width: 38px; padding: 0; position: relative; }
.icon-btn svg, .user-btn svg, .header-search svg, .header-clock svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.home-link { color: #b8893a; }
.home-link svg { fill: #b8893a; stroke: none; }
.header-search { display: flex; flex-direction: row; align-items: center; gap: 8px; height: 38px; width: 100%; margin: 0; padding: 0 12px; background: #fff; border: 1px solid #e3d8c4; border-radius: 10px; color: #8a8174; box-shadow: 0 1px 2px rgba(36, 48, 40, .04); }
.header-search svg { flex: 0 0 auto; }
.header-search input { flex: 1 1 auto; border: 0; border-radius: 0; height: 36px; min-height: 0; padding: 0; margin: 0; background: transparent; font-size: 13px; width: auto; max-width: none; box-shadow: none; color: var(--ink); }
.header-search input::placeholder { color: #9a9184; }
.note-badge { position: absolute; top: 2px; right: 2px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 99px; background: #e23b3b; color: white; font-size: 10px; line-height: 16px; font-weight: 700; }
.user-btn { background: #fff; border: 1px solid #e3d8c4; border-radius: 22px; padding: 3px 10px 3px 3px; min-height: 36px; box-shadow: 0 1px 2px rgba(36,48,40,.04); }
.user-btn .avatar { width: 28px; height: 28px; border-radius: 50%; background: #2f6fbe; color: white; display: grid; place-items: center; }
.user-btn .avatar svg { width: 16px; height: 16px; stroke: white; fill: none; }
.header-clock { display: flex; align-items: center; gap: 6px; color: #6d675e; font-size: 13px; white-space: nowrap; }
.pop-panel a, .pop-panel button { display: block; width: 100%; text-align: left; background: transparent; color: var(--pine); border: 0; height: auto; min-height: 0; padding: 8px 4px; cursor: pointer; text-decoration: none; }
.pop-panel form { margin: 0; }
.user-name { font-size: 14px; color: var(--pine); }
.header-pop { position: relative; }
.pop-panel { display: none; position: absolute; right: 0; top: calc(100% + 8px); min-width: 190px; background: white; border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); padding: 12px; font-size: 13px; color: var(--ink); z-index: 20; }
.header-pop.open .pop-panel { display: block; }
.header-link { color: var(--pine); text-decoration: none; font-size: 14px; }
.btn-signout { height: 36px; min-height: 36px; padding: 0 14px; border-radius: 8px; border: 1px solid var(--gold-2); background: white; color: var(--pine); cursor: pointer; }
.topbar form { margin: 0; }
.content { padding: 28px; flex: 1 1 auto; min-height: 0; overflow: auto; width: 100%; background: var(--paper); max-width: none; }
.print-header { display: none; }

.stats, .menu { display: grid; gap: 14px; }
.stats { grid-template-columns: repeat(4, 1fr); margin-bottom: 18px; }
.stats article, .panel, .login-card { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); }
.stats article { padding: 16px 18px; }
.stats p, .stats span { margin: 0; color: var(--muted); font-size: 13px; }
.stats strong { display: block; margin-top: 8px; font-size: 26px; font-variant-numeric: tabular-nums; letter-spacing: -0.03em; }
.menu { grid-template-columns: repeat(3, 1fr); }
.menu a { display: flex; flex-direction: column; gap: 4px; text-decoration: none; color: inherit; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 16px 18px; min-height: 128px; }
.menu a:hover { border-color: var(--gold); }
.menu span { color: var(--gold); font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; }
.menu strong { font-size: 20px; }
.menu em { color: var(--muted); font-style: normal; font-size: 14px; }

.panel { padding: 18px; margin-bottom: 18px; }
.panel.narrow { max-width: 440px; }
.form-grid, .filters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-items: end; }
.filters { grid-template-columns: 180px 180px auto auto; margin-bottom: 16px; }
.filters .grow { min-width: 240px; }
label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
label.wide { grid-column: 1 / -1; }
label.check { flex-direction: row; align-items: center; color: var(--ink); min-height: 40px; }
input, select { width: 100%; max-width: 100%; height: 44px; border: 1px solid var(--line); border-radius: 10px; background: white; padding: 0 12px; font-size: 16px; }
input[readonly] { background: #f3eee4; }
input:focus, select:focus, button:focus-visible, a:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.actions { display: flex; align-items: center; gap: 14px; margin-top: 16px; }
button, .ghost { border: 0; border-radius: 10px; min-height: 44px; height: 44px; padding: 0 16px; background: var(--pine); color: white; cursor: pointer; }
button.ghost, a.ghost, .topbar .ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
button.link { background: none; color: var(--payment); height: auto; min-height: 0; padding: 0; border-radius: 0; }
.row-actions { display: flex; gap: 12px; align-items: center; white-space: nowrap; }
.row-actions form { margin: 0; }

.msg { border-radius: 12px; padding: 12px 14px; margin: 0 0 14px; }
.msg p { margin: 0 0 6px; }
.msg p:last-child { margin: 0; }
.msg-ok { background: var(--ok); color: var(--ok-ink); }
.msg-err, .validation-summary-errors { background: var(--err); color: var(--err-ink); }
.validation-summary-valid { display: none; }
.field-error, .field-validation-error { color: var(--payment); font-size: 12px; }

.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--line); border-radius: 16px; background: white; max-width: 100%; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); background: #f7f1e6; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; font-family: Consolas, "Cascadia Mono", monospace; font-size: 14px; }
td.desc { max-width: 280px; }
tr.current { background: #f8f1df; }
.empty { color: var(--muted); text-align: center; }
.receipt { color: var(--receipt); }
.payment { color: var(--payment); }
tfoot th { background: #f3ecdf; color: var(--ink); }

.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 0 0 16px; }
.toolbar-end { margin-left: auto; display: flex; flex-wrap: wrap; gap: 10px; }
.list-search { display: flex; flex-direction: row; align-items: center; gap: 8px; height: 40px; width: 240px; margin: 0; padding: 0 12px; background: #fff; border: 1px solid #e3d8c4; border-radius: 10px; color: #8a8174; }
.list-search svg { width: 16px; height: 16px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.list-search input { flex: 1 1 auto; border: 0; border-radius: 0; height: 36px; min-height: 0; padding: 0; margin: 0; background: transparent; font-size: 14px; width: auto; max-width: none; box-shadow: none; color: var(--ink); }
.list-search input::placeholder { color: #9a9184; }
.patient-choice { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; max-width: 860px; margin: 48px auto; }
.patient-choice button, .patient-choice a {
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  height: auto;
  min-height: 148px;
  border-radius: 22px;
  border: 1px solid rgba(255,255,255,.45);
  font-size: 30px;
  font-weight: 750;
  letter-spacing: 0.01em;
  cursor: pointer;
  text-shadow: 0 1px 0 rgba(255,255,255,.35);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.55), inset 0 -14px 22px rgba(0,0,0,.2), 0 14px 28px rgba(36,48,40,.2);
}
.patient-choice .choice-new { background: linear-gradient(180deg, #f6e2a8 0%, #e0b454 42%, #a67428 100%); color: #1c2822; }
.patient-choice .choice-old { background: linear-gradient(180deg, #4f7d62 0%, #243028 52%, #121c16 100%); color: #f7f1e4; text-shadow: 0 1px 0 rgba(0,0,0,.25); }
.patient-choice button:hover, .patient-choice a:hover { filter: brightness(1.05); }
.rop-banner { margin: 0 0 12px; text-align: center; color: #1a3f73; font-size: 22px; font-weight: 800; letter-spacing: .01em; line-height: 1.25; text-transform: uppercase; }
.rop-card .np-section > h3, .rop-infant .np-section > h3 { color: #1a3f73; }
dialog.rop-infant .np-grid,
dialog.rop-infant.patient-dialog .np-section:nth-of-type(1) .np-grid { grid-template-columns: 1fr 1fr; }
dialog.rop-infant.patient-dialog .np-section .np-grid.rop-names { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 132px !important; align-items: end; }
dialog.rop-infant .fit-gender,
dialog.rop-infant .fit-gender .np-field,
dialog.rop-infant .fit-gender select { width: 132px; min-width: 132px; max-width: 132px; field-sizing: fixed; }
dialog.rop-infant .fit-gender select { padding-left: 8px; padding-right: 4px; }
dialog.rop-infant .rop-fit { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); align-items: end; gap: 8px 12px; margin-top: 8px; }
dialog.rop-infant .rop-fit > label { width: auto; min-width: 0; }
dialog.rop-infant .rop-fit .np-field { width: auto; min-width: 0; }
dialog.rop-infant .fit-date input,
dialog.rop-infant .fit-time input,
dialog.rop-infant .fit-wt input {
  width: 100%;
  max-width: 100%;
  field-sizing: fixed;
  padding-left: 8px;
  padding-right: 8px;
  box-sizing: border-box;
}
dialog.rop-infant .fit-ga .rop-pair { gap: 6px; min-height: 0; width: 100%; }
dialog.rop-infant .fit-ga .rop-pair input {
  width: 0;
  flex: 1 1 0;
  min-width: 0;
  height: 38px;
  min-height: 38px;
  padding: 0 2px 0 6px;
  font-size: 13px;
  border: 1px solid #d8d0c3;
  border-radius: 8px;
  background: #fff;
  box-sizing: border-box;
}
dialog.rop-infant .fit-wt { display: flex; flex-direction: column; white-space: nowrap; }
dialog.rop-infant .rop-extra { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px 10px; }
dialog.rop-infant .rop-extra .span2 { grid-column: span 2; }
dialog.rop-infant .rop-extra .span3 { grid-column: 1 / -1; }
dialog.rop-infant .rop-risk { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); align-items: end; gap: 6px 8px; }
dialog.rop-infant .rop-risk > label { min-width: 0; font-size: 11px; line-height: 1.2; }
dialog.rop-infant .rop-risk select,
dialog.rop-infant .rop-risk input,
dialog.rop-infant .rop-comp input { width: 100%; height: 34px; min-height: 34px; border: 1px solid #d8d0c3; border-radius: 8px; padding: 0 6px; background: #fff; color: #243028; font-size: 13px; box-sizing: border-box; }
dialog.rop-infant .rop-comp { display: flex; margin-top: 8px; }
@media (max-width: 800px) {
  dialog.rop-infant .rop-extra { grid-template-columns: 1fr 1fr; }
  dialog.rop-infant .rop-extra .span2, dialog.rop-infant .rop-extra .span3 { grid-column: 1 / -1; }
}
.rop-choice, .rop-pair { display: flex; gap: 14px; align-items: center; min-height: 40px; }
.rop-choice label { display: inline-flex; gap: 6px; align-items: center; margin: 0; font-weight: 650; }
.rop-pair input { width: 100%; height: 40px; border: 1px solid #ded5c5; border-radius: 8px; padding: 0 10px; }
.rop-log-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.rop-exam { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: 13px; }
.rop-exam th, .rop-exam td { border: 1px solid #c5d0e0; padding: 8px; text-align: center; vertical-align: middle; }
.rop-exam th { background: #e7eef8; color: #1a3f73; font-weight: 650; font-size: 13px; letter-spacing: 0; text-transform: none; line-height: 1.35; }
.rop-exam .rop-edit { border: 0; background: transparent; color: #1a3f73; font-weight: 700; cursor: pointer; padding: 0; }
.rop-saved { display: block; margin-top: 4px; color: #667066; font-size: 11px; }
.rop-ref p { margin: 8px 0 0; color: #243028; line-height: 1.45; }
.rop-ref p strong { color: #1a3f73; }
dialog.rop-exam-pop { width: min(1100px, calc(100vw - 24px)); }
dialog.rop-exam-pop .account-dialog-body { overflow: auto; }
dialog.rop-exam-pop .rop-exam-form { table-layout: fixed; width: 100%; }
dialog.rop-exam-pop .rop-lines { display: flex; flex-direction: column; gap: 8px; }
dialog.rop-exam-pop .rop-exam-form select,
dialog.rop-exam-pop .rop-exam-form input,
dialog.rop-exam-pop .rop-exam-form textarea { width: 100%; height: 32px; min-height: 32px; margin: 0; border: 1px solid #d8d0c3; border-radius: 6px; padding: 0 4px; background: #fff; font-size: 13px; box-sizing: border-box; }
dialog.rop-exam-pop .rop-exam-form textarea { height: 76px; min-height: 76px; padding-top: 6px; resize: vertical; }
dialog.rop-exam-pop .rop-eye { width: 52px; font-weight: 750; color: #1a3f73; }
.rop-exam .rop-eye { font-weight: 750; color: #1a3f73; white-space: nowrap; }
.rop-exam { display: table !important; width: 100%; border-collapse: collapse; }
.rop-exam thead { display: table-header-group !important; }
.rop-exam tbody { display: table-row-group !important; width: auto !important; }
.rop-exam tr { display: table-row !important; margin: 0 !important; padding: 0 !important; border: 0 !important; border-radius: 0 !important; background: transparent !important; }
.rop-exam th, .rop-exam td { display: table-cell !important; text-align: center; vertical-align: middle; border: 1px solid #c5d0e0; white-space: normal; }
.rop-exam td::before, .rop-exam th::before { content: none !important; }
dialog.patient-dialog { display: none; }
dialog.patient-dialog[open] {
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  margin: 0;
  width: min(980px, calc(100vw - 24px));
  height: min(92vh, 860px);
  max-height: min(92vh, 860px);
  overflow: hidden;
}
.mr-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 58px;
  margin: 0 0 8px;
  padding: 10px 16px;
  border-radius: 10px;
  color: #243028;
  background: linear-gradient(90deg, #e4c57a 0%, #d6b56a 42%, #c49a45 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.45), 0 4px 10px rgba(36,48,40,.08);
}
.mr-box span { display: flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 650; letter-spacing: 0.08em; text-transform: uppercase; }
.mr-box span svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.mr-box strong { display: block; margin-top: 2px; font-size: 21px; font-weight: 700; }
.mr-side { display: flex; flex-direction: column; min-width: 0; }
.mr-side + .mr-side { align-items: flex-end; padding-left: 16px; border-left: 1px solid rgba(36,48,40,.18); }
.mr-box input { width: 160px; max-width: 180px; height: 28px; border: 0; background: transparent; font-size: 21px; font-weight: 700; color: #243028; text-align: right; box-shadow: none; padding: 0; }
.np-head { display: flex; align-items: center; justify-content: space-between; min-height: 56px; padding: 0 12px 0 16px; background: #243028; color: white; }
.np-head h2 { display: flex; align-items: center; gap: 8px; margin: 0; color: white; font-size: 17px; font-weight: 650; letter-spacing: 0.04em; text-transform: uppercase; }
.np-head h2 svg { width: 18px; height: 18px; fill: none; stroke: white; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.np-close { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 8px; background: #b8893a; color: #243028; }
.np-close svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
.np-close:hover { filter: brightness(1.08); }
.np-section { background: #fff; border: 1px solid #ded5c5; border-radius: 10px; padding: 8px 12px 10px; margin: 0 0 8px; }
.np-section h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; color: #243028; font-size: 13px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.np-section h3::before { content: ""; width: 16px; height: 2px; background: #b8893a; border-radius: 2px; }
.patient-dialog .np-grid { display: grid; grid-template-columns: 1.1fr 1.2fr .8fr; gap: 8px 14px; }
.patient-dialog .np-grid .np-span { grid-column: 1 / -1; }
.patient-dialog .np-grid .np-span { grid-column: 1 / -1; }
.np-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; }
.np-search .np-grid { grid-template-columns: 1fr 1fr 1fr; }
.patient-foot form { margin: 0; }
.patient-dialog .np-section:nth-of-type(1) .np-grid { grid-template-columns: 1fr 1fr 1fr; }
.patient-dialog .np-section:nth-of-type(2) .np-grid,
.patient-dialog .np-section:nth-of-type(3) .np-grid,
.patient-dialog .np-section:nth-of-type(4) .np-grid { grid-template-columns: 1fr 1fr; }
.patient-dialog label { gap: 3px; font-size: 12px; font-weight: 500; color: #566159; }
.np-cap { display: inline-flex; align-items: baseline; gap: 4px; line-height: 1.2; }
.patient-dialog label em { color: #c4503a; font-style: normal; font-weight: 700; }
.np-field { position: relative; display: block; }
.np-field > svg { position: absolute; left: 12px; top: 11px; width: 16px; height: 16px; fill: none; stroke: #314438; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; pointer-events: none; }
.patient-dialog .np-field input,
.patient-dialog .np-field select,
.patient-dialog .np-field textarea,
.patient-dialog button.np-select {
  height: 38px;
  min-height: 38px;
  border: 1px solid #d8d0c3;
  border-radius: 8px;
  background: #fff;
  color: #243028;
  font-size: 14px;
  font-weight: 400;
  padding: 0 12px 0 36px;
  box-shadow: none;
  transition: border-color .16s ease, box-shadow .16s ease;
}
.patient-dialog .np-field textarea { height: 58px; min-height: 58px; padding-top: 8px; resize: vertical; }
.cn-dialog #cnDis { padding-left: 12px; }
.patient-dialog .np-field input:focus,
.patient-dialog .np-field select:focus,
.patient-dialog .np-field textarea:focus,
.patient-dialog button.np-select:focus-visible { outline: none; border-color: #b8893a; box-shadow: 0 0 0 3px rgba(184,137,58,.12); }
.patient-dialog input::placeholder,
.patient-dialog textarea::placeholder { color: #98a09a; }
.patient-dialog button.np-select { width: 100%; display: flex; align-items: center; gap: 8px; cursor: pointer; text-align: left; }
.patient-dialog button.np-select svg { width: 16px; height: 16px; flex: 0 0 auto; fill: none; stroke: #314438; stroke-width: 1.7; }
.patient-dialog button.np-select::after { content: ""; margin-left: auto; border: 5px solid transparent; border-top-color: #314438; transform: translateY(2px); }
.patient-dialog button.np-select.is-empty { color: #98a09a; }
.patient-foot { justify-content: flex-end; gap: 10px; padding: 12px 16px; background: #fff; border-top: 1px solid #ded5c5; box-shadow: 0 -4px 15px rgba(36,48,40,.06); }
.np-cancel, .np-save { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px; min-height: 38px; padding: 0 16px; border-radius: 8px; font-size: 14px; font-weight: 650; text-decoration: none; cursor: pointer; }
.np-cancel { background: #fff; color: #243028; border: 1px solid #cfc6b7; }
.np-save { background: #243028; color: #fff; border: 0; }
.np-save:hover { box-shadow: inset 0 0 0 1px #d6b56a; }
.np-cancel svg, .np-save svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.patient-scroll { scrollbar-width: thin; scrollbar-color: #b8b0a2 transparent; }
.patient-scroll::-webkit-scrollbar { width: 7px; }
.patient-scroll::-webkit-scrollbar-thumb { background: #b8b0a2; border-radius: 8px; }
.patient-scroll::-webkit-scrollbar-thumb:hover { background: #8f887c; }
dialog.patient-dialog[open] { background: #f4efe6; border: 1px solid #ded5c5; box-shadow: 0 8px 25px rgba(36,48,40,.10); }
dialog.patient-dialog[open] .account-dialog-head { flex: 0 0 auto; }
.patient-dialog .patient-form { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; margin: 0; overflow: hidden; }
.patient-scroll { flex: 1 1 auto; min-height: 0; overflow: auto; background: #f4efe6; padding: 8px 12px 2px; }
.patient-foot { flex: 0 0 auto; margin: 0; justify-content: flex-end; gap: 10px; padding: 12px 16px; background: #fff; border-top: 1px solid #ded5c5; box-shadow: 0 -4px 15px rgba(36,48,40,.06); }
.city-row { display: grid; grid-template-columns: 1.3fr 1fr .7fr .9fr; gap: 12px; margin: 14px 0; }
.cn-screen { display: flex; flex-direction: column; gap: 10px; }
.cn-block { margin: 0; }
.cn-patient-row { display: flex; gap: 14px; align-items: stretch; }
.cn-patient-actions { display: flex; flex-direction: column; gap: 8px; min-width: 170px; }
.cn-old, .cn-change, .cn-clear { height: 40px; min-height: 40px; padding: 0 14px; border-radius: 8px; border: 1px solid #b8893a; background: #fff; color: #243028; font-weight: 650; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; }
.cn-card { flex: 1; position: relative; display: grid; grid-template-columns: 1fr auto; gap: 8px; padding: 12px 14px; border-radius: 10px; background: #f3f7f2; border: 1px solid #ded5c5; }
.cn-card-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px 16px; }
.cn-card span { display: block; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: #667066; }
.cn-card strong { font-size: 15px; color: #243028; }
.cn-wide { grid-column: 1 / -1; }
.cn-avatar { width: 42px; height: 42px; border-radius: 50%; background: #fff; border: 1px solid #ded5c5; display: grid; place-items: center; }
.cn-avatar svg, .cn-patient-actions svg, .cn-change svg, .cn-clear svg, .cn-lab svg, .np-save svg, .np-cancel svg, .cn-service-open svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.cn-patient-actions a, .cn-patient-actions button, .cn-change, .cn-clear, .np-save, .np-cancel { gap: 6px; }
.cn-card { display: flex; align-items: center; }
.mr-find { display: flex; flex-direction: row; align-items: center; gap: 8px; }
.mr-find input { flex: 1 1 auto; width: auto; min-width: 0; }
button.mr-find-btn {
  width: auto;
  height: 38px;
  min-height: 38px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid #b8893a;
  border-radius: 8px;
  background: #fffdf8;
  color: #243028;
  font-weight: 650;
  cursor: pointer;
}
button.mr-find-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
#arrivalDialog .mr-find input { height: 38px; min-height: 38px; }
#arrivalDialog .av-form { display: flex; flex-direction: column; gap: 10px; }
#arrivalDialog .av-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 14px; }
#arrivalDialog .av-row-top {
  flex-wrap: nowrap;
  align-items: flex-end;
  width: 100%;
}
#arrivalDialog .av-hint { display: block; margin: -2px 0 0; }
table.av-list tr.av-done td { background: #e7f5ea; color: #1d3d28; }
table.av-list tr.av-done:hover td { background: #d9efe0; }
.av-status {
  display: inline-block;
  min-width: 72px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}
.av-status.is-done { background: #2f6b45; color: #fff; }
.av-status.is-pending { background: #f3ecdf; color: #667066; }
#arrivalDialog .av-form label { margin: 0; min-width: 0; }
#arrivalDialog .av-mr { flex: 0 0 auto; }
#arrivalDialog .av-mr .mr-find { width: auto; flex-wrap: nowrap; }
#arrivalDialog .av-form label > .np-cap {
  display: inline-flex;
  align-items: baseline;
  gap: 3px;
  white-space: nowrap;
}
#arrivalDialog .av-form label > .np-cap em {
  color: #c4503a;
  font-style: normal;
  font-weight: 700;
}
#arrivalDialog .av-mr .mr-find input {
  flex: 0 0 auto;
  width: 14ch;
  max-width: 14ch;
  min-width: 14ch;
  padding-left: 12px;
  font-variant-numeric: tabular-nums;
  letter-spacing: .02em;
}
#arrivalDialog .av-name { flex: 1 1 220px; }
#arrivalDialog .av-address { display: block; width: 100%; }
#arrivalDialog .av-age { flex: 0 0 auto; }
#arrivalDialog .av-age input {
  width: 7ch;
  max-width: 7ch;
  min-width: 7ch;
  padding-left: 10px;
  padding-right: 6px;
  text-align: center;
}
#arrivalDialog .av-gend { flex: 0 0 auto; }
#arrivalDialog .av-gend select {
  width: 7.5rem;
  max-width: 7.5rem;
  min-width: 7.5rem;
  padding-left: 12px;
}
#arrivalDialog .av-city { flex: 1 1 140px; }
#arrivalDialog .av-phone { flex: 1 1 140px; }
#arrivalDialog .av-consult { flex: 1 1 200px; }
#arrivalDialog .av-complaint { flex: 2 1 280px; }
@media (max-width: 700px) {
  #arrivalDialog .av-row-top { flex-wrap: wrap; }
  #arrivalDialog .av-mr .mr-find input,
  #arrivalDialog .av-age input,
  #arrivalDialog .av-gend select { width: 100%; max-width: none; min-width: 0; }
  #arrivalDialog .av-mr,
  #arrivalDialog .av-name,
  #arrivalDialog .av-age,
  #arrivalDialog .av-gend,
  #arrivalDialog .av-city,
  #arrivalDialog .av-phone,
  #arrivalDialog .av-consult,
  #arrivalDialog .av-complaint { flex: 1 1 100%; }
}
.report-bar { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.report-bar .filters { margin-bottom: 0; flex: 1 1 640px; }
.patient-report-filters { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px 12px; align-items: end; }
tr.med-label td { background: #243028; color: #fff; font-weight: 650; border-bottom-color: #243028; }
.report-sums { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 16px; }
.report-sums .panel { margin-bottom: 0; }
.report-sums h2 { margin: 0 0 10px; font-size: 16px; }
@media (max-width: 900px) {
  .report-sums { grid-template-columns: 1fr; }
}
.cn-service-bar { display: flex; flex-direction: row; align-items: end; gap: 10px; margin-bottom: 12px; flex-wrap: nowrap; }
.cn-service-bar .cn-consult { flex: 0 1 280px; }
.cn-consult { min-width: 220px; margin: 0; }
.cn-consult select { height: 46px; }
.cn-complaint { margin: 8px 0 12px; width: 100%; }
.cn-complaint-line { display: flex; flex-direction: row; align-items: center; gap: 6px; }
.cn-complaint-line input { height: 46px; min-height: 0; flex: 1; }
button.cn-prompt { width: 46px; min-width: 46px; height: 46px; min-height: 46px; padding: 0; border-radius: 10px; }
button.cn-prompt svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.cn-service-open, .cn-pick { height: 42px; min-height: 42px; border-radius: 8px; border: 1px solid #d8d0c3; background: #fff; color: #243028; font-weight: 500; }
.cn-service-open { flex: 1; display: flex; align-items: center; gap: 8px; padding: 0 12px; text-align: left; cursor: pointer; }
.cn-service-open span { flex: 1; color: #667066; }
.cn-pick { display: inline-flex; align-items: center; gap: 8px; padding: 0 14px; background: #fffdf8; border-color: #b8893a; font-weight: 650; cursor: pointer; }
.cn-pick svg, .cn-service-open svg { width: 16px; height: 16px; fill: none; stroke: #243028; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.cn-service { display: grid !important; grid-template-columns: 1fr 1.3fr .9fr; gap: 12px; align-items: end; padding: 0; background: transparent; }
.cn-service label, .cn-service > div { min-width: 0; }
.cn-service strong { display: flex; align-items: center; min-height: 42px; padding: 0 12px; background: #fff; border: 1px solid #d8d0c3; border-radius: 8px; font-size: 16px; }
.cn-pay-item { display: flex; flex-direction: row; align-items: center; gap: 8px; height: 48px; margin: 0; padding: 0 8px 0 10px; background: #fff; border: 1px solid #ded5c5; border-radius: 8px; color: #243028; font-size: 12px; font-weight: 700; letter-spacing: .04em; }
.cn-pay-item svg { width: 18px; height: 18px; fill: none; stroke: #2f6b45; stroke-width: 1.7; flex: 0 0 auto; }
.cn-pay-item input { border: 0; box-shadow: none; height: 36px; width: 88px; max-width: 88px; text-align: right; padding: 0 6px; background: transparent; }
.cn-status { margin: 10px 0 0; padding: 8px 12px; border-radius: 8px; background: #fde8e6; color: #9a4034; font-size: 13px; }
dialog.cn-dialog[open] {
  width: min(1180px, calc(100vw - 40px));
  height: min(94vh, 860px);
  max-height: min(94vh, 860px);
  background: #f4efe6;
  border: 1px solid #ded5c5;
  border-radius: 14px;
  box-shadow: 0 10px 35px rgba(36,48,40,.18);
}
.cn-dialog .np-head { min-height: 64px; padding: 0 14px 0 18px; }
.cn-dialog .np-head h2 { font-size: 24px; font-weight: 700; letter-spacing: .02em; }
.cn-dialog .np-head h2 svg { width: 22px; height: 22px; stroke: #d6b56a; }
.cn-dialog .np-close { width: 42px; height: 42px; border-radius: 8px; }
.cn-dialog .cn-block h3 svg { stroke: #b8893a; }
.cn-dialog .cn-patient-actions a,
.cn-dialog .cn-patient-actions button { height: 54px; min-height: 54px; width: 100%; justify-content: center; }
.cn-dialog .cn-card { background: #f4f7f1; border: 1px solid #d6c49a; box-shadow: 0 4px 12px rgba(36,48,40,.08); }
.cn-dialog .cn-service-open { height: 46px; border-radius: 10px; }
.cn-dialog .cn-pick { height: 46px; min-width: 150px; justify-content: center; }
.cn-dialog .cn-pay input { text-align: right; height: 42px; }
.cn-dialog .cn-foot { justify-content: space-between; margin: 8px 14px 14px; padding: 0; background: transparent; border: 0; border-radius: 0; box-shadow: none; }
.cn-foot-start { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
form.cn-locked .cn-patient-actions,
form.cn-locked .cn-change,
form.cn-locked .cn-service-bar,
form.cn-locked .cn-complaint,
form.cn-locked .cn-pay,
form.cn-locked .np-area,
form.cn-locked .cn-prompt { pointer-events: none; }
form.cn-locked input, form.cn-locked select, form.cn-locked textarea { background: #f3eee4; }
form.pv-locked .pv-grid,
form.pv-locked .pv-end,
form.pv-locked .pv-text,
form.pv-locked .pv-med-add { pointer-events: none; }
form.pv-locked input, form.pv-locked select, form.pv-locked textarea { background: #f3eee4; }
button.cn-delete { color: #7a2e18; border-color: #d7b2a4; }
dialog.consult-find.account-dialog[open] { width: min(980px, calc(100vw - 24px)); max-height: calc(100vh - 24px); overflow: auto; }
.cn-find-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px; }
.cn-find-grid label input, .cn-find-grid label select { height: 40px; min-height: 40px; }
body.only-popup .sidebar,
body.only-popup .topbar { display: none !important; }
body.only-popup .shell { display: block; height: 100vh; background: #f4efe6; }
body.only-popup .main { height: 100vh; }
body.only-popup .patient-choice { display: none; }
body.only-popup .content { padding: 0; background: #f4efe6; }
/* Embedded popup pages keep a single parent sidebar visible. */
html:has(body.only-popup) .shell > .sidebar { display: none !important; }
.cn-block h3::before { display: none; }
.cn-block h3 svg { width: 16px; height: 16px; fill: none; stroke: #243028; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.cn-block h3 span { border-bottom: 2px solid #b8893a; padding-bottom: 1px; }
.cn-patient-actions { background: #fff; border: 1px solid #ded5c5; border-radius: 12px; padding: 8px; }
.cn-old { background: #fffdf8; }
.cn-card { padding-right: 130px; }
.cn-change {
  position: absolute;
  right: 12px;
  bottom: 12px;
  height: 40px;
  min-height: 40px;
  min-width: 108px;
  justify-content: center;
  background: #fff;
}
.cn-arrival { top: 12px; bottom: auto; }
.cn-service { display: grid; grid-template-columns: 1.1fr 1.4fr .9fr; gap: 12px; align-items: end; padding: 8px; background: transparent; }
.cn-service strong { display: flex; align-items: center; min-height: 40px; padding: 0 10px; background: #fff; border: 1px solid #d8d0c3; border-radius: 8px; }
.cn-service span { display: flex; align-items: center; gap: 6px; }
.cn-service span svg { width: 16px; height: 16px; fill: none; stroke: #b8893a; stroke-width: 1.7; }
.cn-lab { display: inline-flex; align-items: center; gap: 6px; }
.cn-service { display: flex; justify-content: space-between; gap: 16px; padding: 10px 12px; border-radius: 10px; background: #f7f3ea; }
.cn-service span, .cn-total span { display: block; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: #667066; }
.cn-service strong, .cn-total strong { font-size: 18px; color: #243028; }
.cn-pay { display: grid; grid-template-columns: 1fr 1fr 1fr auto; gap: 12px; align-items: end; }
.cn-pay input { max-width: 140px; }
.cn-total { min-width: 160px; padding: 8px 12px; border-radius: 10px; background: #eef6ea; }
.cn-status { margin: 10px 0 0; padding: 8px 10px; border-radius: 8px; background: #f8e6df; color: #7a2e18; }
.entry-audit {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin: 8px 0 0;
  padding: 8px 12px;
  border-radius: 8px;
  background: #eef3ef;
  color: #3a4a40;
  font-size: 12.5px;
}
.entry-audit strong { font-weight: 700; color: #243028; }
.pv-audit-top { margin: 0 0 8px; }
.mr-box + .entry-audit,
.np-head + .entry-audit { margin-top: 0; margin-bottom: 8px; }
.account-dialog-body > .entry-audit:first-child { margin-top: 0; }
#cnDis { width: 100%; min-height: 88px; border: 1px solid #d8d0c3; border-radius: 8px; padding: 10px 12px; }
.cn-count { margin: 4px 0 0; text-align: right; color: #667066; font-size: 12px; }
.cn-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0 0; }
.cn-foot-end { display: flex; gap: 10px; }
@media (max-width: 900px) {
  .cn-patient-row, .cn-pay, .cn-card-grid { grid-template-columns: 1fr; display: grid; }
  .cn-patient-row { display: grid; }
}
.pick-row:hover { background: #f8f1df; }
.old-results { flex: 1 1 auto; min-height: 0; overflow: auto; margin: 0 12px 8px; }
.old-results table { font-size: 12px; }
.old-results th, .old-results td { padding: 5px 8px; font-size: 12px; }
.old-results thead th { position: sticky; top: 0; z-index: 2; background: #1c2822; }
.np-section.is-hidden { display: none; }
#oldDialog .old-loading {
  position: absolute;
  left: 0;
  right: 0;
  top: 56px;
  bottom: 58px;
  z-index: 6;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: rgba(244, 239, 230, .9);
  color: #243028;
  font-size: 16px;
  font-weight: 650;
}
#oldDialog .old-loading[hidden] { display: none; }
.np-head-actions { display: flex; align-items: center; gap: 8px; }
.np-toggle { width: 36px; height: 36px; min-height: 36px; padding: 0; border: 0; border-radius: 8px; background: transparent; color: #f4efe6; display: grid; place-items: center; cursor: pointer; }
.np-toggle svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.np-toggle:hover { background: rgba(255,255,255,.08); }
#oldDialog .patient-form { display: flex; flex-direction: column; min-height: 0; flex: 1 1 auto; overflow: hidden; margin: 0; }
#oldDialog .patient-scroll { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; overflow: hidden; }
.appt-bar { display: flex; flex-wrap: wrap; align-items: stretch; gap: 12px; margin: 0 0 16px; }
.appt-boxes { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; flex: 1 1 560px; min-width: 0; }
.appt-box { display: flex; flex-direction: row; align-items: center; gap: 10px; min-height: 64px; margin: 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: white; }
.appt-box span, .appt-box { font-size: 13px; color: var(--muted); }
.appt-box input, .appt-box select { width: auto; max-width: none; height: 40px; flex: 1 1 120px; }
a.tool, button.tool {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid transparent;
  text-decoration: none;
  font-size: 14px;
  font-weight: 650;
  letter-spacing: 0.01em;
  background: var(--pine);
  color: white;
}
a.tool svg, button.tool svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
a.tool-print, button.tool-print { background: white; color: var(--ink); border-color: var(--line); }
a.tool-excel { background: #17643f; color: white; }
a.tool:hover, button.tool:hover { filter: brightness(1.06); }
.pro-table thead th { background: #1c2822; color: #f6f0e6; border-bottom-color: #1c2822; }
.pro-table tbody tr:hover { background: #fbf8f3; }

.msg, .lede, .login-card { overflow-wrap: anywhere; }

@media (max-width: 1099px) {
  .shell { --sidebar-w: 0px; grid-template-columns: 1fr; }
  .dash-layer { left: 0; }
  .shell.nav-open .dash-layer { left: 250px; }
  .sidebar {
    position: fixed;
    z-index: 30;
    transform: translateX(-105%);
    transition: transform .2s ease;
    width: 250px;
  }
  .shell.nav-open .sidebar { transform: none; }
  .header-search { display: none; }
  .user-name { display: none; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .menu { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .content { padding: 20px; }
  .filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filters .grow { min-width: 0; grid-column: 1 / -1; }
  .filters button { width: 100%; }
  .topbar { padding: 10px 14px; }
}

@media (max-width: 900px) {
  body.login-body { overflow: auto; }
  .gate { display: block; min-height: 100vh; }
  .gate-photo { position: relative; inset: auto; height: 220px; }
  .gate-swoosh { display: none; }
  .gate-hospital { top: 16px; left: 16px; width: min(420px, calc(100vw - 32px)); }
  .gate-panel { margin: 0; min-height: 0; padding: 22px 16px 28px; }
}

@media (max-width: 699px) {
  .topbar { gap: 8px; }
  h1 { font-size: 26px; }
  .content { padding: 16px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .menu, .form-grid, .filters, .patient-choice { grid-template-columns: 1fr; }
  .city-row { grid-template-columns: 1fr 1fr; }
  .patient-dialog .np-grid,
  .patient-dialog .np-section:nth-of-type(1) .np-grid,
  .patient-dialog .np-section:nth-of-type(2) .np-grid,
  .patient-dialog .np-section:nth-of-type(3) .np-grid,
  .patient-dialog .np-section:nth-of-type(4) .np-grid { grid-template-columns: 1fr; }
  .patient-choice button, .patient-choice a { min-height: 110px; font-size: 24px; }
  .menu a { min-height: 0; }
  .stats strong { font-size: 22px; }
  .panel { padding: 14px; }
  .actions { flex-direction: column; align-items: stretch; }
  body.login-body .login-card { padding: 20px 18px 18px; }
  body.login-body .gate-head h1 { font-size: 26px; }
}

@media print {
  .sidebar, .topbar, .no-print, .actions, .filters, .nav-button { display: none !important; }
  .print-header { display: block; text-align: center; margin: 0 0 16px; color: #1c1915; }
  .print-hospital { margin: 0; font-size: 22pt; font-weight: 700; letter-spacing: 0.01em; }
  .print-place { margin: 4px 0 0; font-size: 13pt; }
  .print-screen { margin: 8px 0 0; font-size: 16pt; font-weight: 650; }
  .print-only { display: block !important; }
  .shell, .main, .content { display: block; height: auto; overflow: visible; }
  body, .content, .table-wrap { background: white; box-shadow: none; }
  .content { padding: 0; max-width: none; }
}
.print-only { display: none; }

button.account-picker-open {
  width: 100%;
  justify-content: flex-start;
  text-align: left;
  background: white;
  color: var(--ink);
  border: 1px solid var(--line);
  font-weight: 400;
  overflow: hidden;
}
button.account-picker-open.is-empty { color: var(--muted); }
.account-picker-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-dialog {
  border: 1px solid #cfc3b0;
  padding: 0;
  width: min(720px, calc(100vw - 32px));
  max-height: min(78vh, 680px);
  border-radius: 12px;
  background: #f7f3eb;
  color: var(--ink);
  box-shadow: 0 24px 64px rgba(28, 25, 21, 0.28);
  overflow: hidden;
}
.account-dialog::backdrop { background: rgba(20, 24, 21, 0.5); }
.account-dialog-card { display: flex; flex-direction: column; max-height: min(78vh, 680px); }
.account-dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 56px;
  padding: 0 12px 0 20px;
  background: #1c2822;
}
.account-dialog-head h2 {
  margin: 0;
  color: #ffffff;
  font-size: 16px;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
button.account-dialog-close, a.account-dialog-close {
  height: 34px;
  min-height: 34px;
  padding: 0 16px;
  border: 0;
  border-radius: 6px;
  background: #d7a441;
  color: #1c2822;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}
button.account-dialog-close { width: 34px; min-width: 34px; padding: 0; justify-content: center; }
button.account-dialog-close svg, a.account-dialog-close svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
.consultant-dialog a.account-dialog-close {
  width: 34px;
  height: 34px;
  min-height: 34px;
  padding: 0;
  justify-content: center;
  letter-spacing: 0;
  text-transform: none;
}
.account-dialog-body { padding: 16px 18px 18px; }
.consultant-dialog { width: min(680px, calc(100vw - 32px)); }
.consultant-dialog form { margin: 0; }
.consultant-dialog .account-dialog-body { background: #f7f3eb; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }
.slot-form { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 28px; align-items: end; }
.slot-time { display: flex; align-items: center; gap: 8px; }
.slot-time input, .slot-time select { width: 110px; max-width: 110px; }
.slot-unit { color: var(--ink); font-size: 14px; }
textarea.notes { width: 100%; min-height: 88px; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font: inherit; resize: vertical; background: white; }
label .name-error { display: block; margin-top: 6px; color: var(--payment); font-size: 13px; font-weight: 650; }
.consultant-dialog .name-error,
.consultant-dialog .field-validation-error {
  display: block;
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  background: #f8e6df;
  color: #7a2e18;
  font-size: 14px;
  font-weight: 650;
}
.account-dialog-search { margin: 0 0 12px; background: white; }
.account-sheet {
  background: white;
  border: 1px solid #e0d3c0;
  border-radius: 8px;
  overflow: hidden;
}
.account-cols {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  gap: 0;
  align-items: stretch;
}
.account-cols-head {
  background: #efe6d4;
  color: #243028;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}
.account-cols-head span {
  display: block;
  padding: 10px 14px;
}
.account-cols-head span + span { border-left: 1px solid #e0d3c0; }
.account-dialog-list {
  overflow: auto;
  max-height: 380px;
  padding: 0;
  -webkit-overflow-scrolling: touch;
}
.account-dialog-list .empty { margin: 0; padding: 28px 14px; }
.account-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 180px;
  color: #5c6560;
  font-size: 15px;
}
.account-loading[hidden] { display: none; }
.account-spinner {
  width: 22px;
  height: 22px;
  border: 3px solid #e0d3c0;
  border-top-color: #1c2822;
  border-radius: 50%;
  animation: account-spin 0.7s linear infinite;
}
@keyframes account-spin { to { transform: rotate(360deg); } }
button.account-option {
  width: 100%;
  height: auto;
  min-height: 44px;
  margin: 0;
  padding: 0;
  display: grid;
  background: white;
  color: var(--ink);
  border: 0;
  border-top: 1px solid #eee6da;
  border-radius: 0;
  font-weight: 400;
  text-align: left;
}
button.account-option strong,
button.account-option span {
  display: block;
  padding: 12px 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 15px;
  font-weight: 650;
  color: #1c1915;
}
button.account-option span {
  border-left: 1px solid #eee6da;
  font-weight: 400;
  color: #3f4a44;
}
button.account-option:nth-child(even) { background: #fbf8f3; }
button.account-option:hover { background: #f3ecdf; }
button.account-option.selected { background: #e5f2e8; box-shadow: inset 3px 0 0 #17643f; }
button.account-option.active {
  background: #fff6df;
  box-shadow: inset 3px 0 0 #d7a441;
}
@media (max-width: 699px) {
  .account-dialog { width: calc(100vw - 16px); max-height: calc(100vh - 16px); }
  .account-dialog-card { max-height: calc(100vh - 16px); }
  .account-dialog-list { max-height: none; }
  .account-dialog-head h2 { letter-spacing: 0.04em; }
  button.account-option strong,
  button.account-option span,
  .account-cols-head span { padding: 10px 8px; }
}

.dash { display: flex; flex-direction: column; gap: 16px; width: 100%; max-width: 100%; min-width: 0; }
.dash-card { background: #fff; border: 1px solid #e6dccb; border-radius: 16px; box-shadow: 0 8px 22px rgba(36, 48, 40, 0.06); overflow: hidden; display: flex; flex-direction: column; min-width: 0; }
.dash-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 62px; padding: 10px 16px; background: #243028; color: #fff; }
.dash-title { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 18px; font-weight: 650; letter-spacing: 0; color: #fff; }
.dash-title svg { width: 22px; height: 22px; flex: 0 0 auto; fill: none; stroke: #fff; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.dash-head-actions { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
a.dash-all, a.dash-add { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 34px; min-height: 0; padding: 0 12px; border-radius: 8px; text-decoration: none; font-size: 13px; font-weight: 650; white-space: nowrap; }
a.dash-all { background: transparent; color: #fff; border: 1px solid rgba(255, 255, 255, 0.72); }
a.dash-all:hover { background: rgba(255, 255, 255, 0.08); }
a.dash-add { background: #b8893a; color: #fff; border: 0; }
a.dash-add:hover { background: #a67a32; }
a.dash-add svg { width: 14px; height: 14px; fill: none; stroke: #fff; stroke-width: 2.2; stroke-linecap: round; }
.dash-table-wrap { overflow-x: auto; max-width: 100%; }
.dash table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.dash th, .dash td { height: 50px; padding: 0 12px; border: 0; border-bottom: 1px solid #f0e8db; text-align: left; vertical-align: middle; font-size: 13.5px; font-weight: 450; color: #243028; background: #fff; text-transform: none; letter-spacing: 0; overflow: hidden; text-overflow: ellipsis; }
.dash thead th { height: 46px; background: #f6f1e8; font-size: 13px; font-weight: 650; color: #243028; border-bottom: 1px solid #eadfce; }
.dash tbody tr:hover td { background: #fbf8f3; }
.dash tbody tr:last-child td { border-bottom: 0; }
.dash td.uhid { font-weight: 650; color: #243028; }
.dash td.when { color: #314438; }
.dash td.empty { text-align: center; color: var(--muted); }
.dash th.actions, .dash td.actions { text-align: right; width: 1%; }
.dash-actions { display: inline-flex; align-items: center; gap: 6px; }
a.dash-ico { width: 32px; height: 32px; min-height: 0; padding: 0; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; background: #f4f1ea; border: 1px solid #ebe4d6; text-decoration: none; }
a.dash-ico svg { width: 16px; height: 16px; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
a.dash-ico.view svg { stroke: #2f6fbf; }
a.dash-ico.edit svg { stroke: #2c7a4b; }
a.dash-ico.more { color: #5c675f; }
a.dash-ico.more svg { stroke: #5c675f; }
a.dash-ico:hover { background: #efe8db; }
.dash-split { display: grid; grid-template-columns: minmax(0, 2.05fr) minmax(260px, 0.95fr); gap: 16px; align-items: stretch; min-width: 0; }
.dash-split > .dash-card { height: 100%; }
.dash-qa { flex: 1; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); grid-auto-rows: 1fr; gap: 12px; padding: 14px; }
.qa { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; min-height: 118px; border-radius: 14px; border: 1px solid transparent; text-decoration: none; box-shadow: 0 1px 2px rgba(36, 48, 40, 0.04); }
.qa span { color: #243028; font-size: 14.5px; font-weight: 650; text-align: center; }
.qa svg { width: 40px; height: 40px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.qa:nth-child(-n+3) { grid-column: span 2; }
.qa:nth-child(n+4) { grid-column: span 3; }
.qa-patient { background: #e7f5ec; border-color: #d2eadb; color: #218a4e; }
.qa-appoint { background: #e7f1fb; border-color: #d3e4f6; color: #2d74b8; }
.qa-consult { background: #f8f0e6; border-color: #eadcc8; color: #c47a2a; }
.qa-search { background: #f3eef8; border-color: #e3d7f1; color: #7b50a8; }
.qa-visit { background: #e8f2fb; border-color: #d4e5f5; color: #3a7eb5; }
.qa:hover { filter: brightness(0.985); }
.dash-compact .dash-head { min-height: 44px; padding: 6px 12px; }
.dash-compact .dash-title { font-size: 15px; gap: 8px; }
.dash-compact .dash-title svg { width: 18px; height: 18px; }
.dash-compact a.dash-all, .dash-compact a.dash-add { height: 28px; padding: 0 10px; font-size: 12px; }
.dash-compact th, .dash-compact td { height: 34px; padding: 0 8px; font-size: 12.5px; }
.dash-compact thead th { height: 30px; font-size: 12px; }
.dash-compact a.dash-ico { width: 26px; height: 26px; border-radius: 6px; }
.dash-compact a.dash-ico svg { width: 14px; height: 14px; }
.dash-mini .dash-head { min-height: 36px; padding: 4px 10px; }
.dash-mini .dash-title { font-size: 14px; gap: 6px; }
.dash-mini .dash-title svg { width: 16px; height: 16px; }
.dash-mini a.dash-all, .dash-mini a.dash-add { height: 26px; padding: 0 8px; font-size: 11.5px; }
.dash-mini th, .dash-mini td { height: 26px; padding: 0 6px; font-size: 12px; }
.dash-mini thead th { height: 24px; font-size: 11.5px; }
.dash-mini a.dash-ico { width: 22px; height: 22px; border-radius: 6px; }
.dash-mini a.dash-ico svg { width: 12px; height: 12px; }
.dash-mini-qa .dash-head { min-height: 36px; padding: 4px 10px; }
.dash-mini-qa .dash-title { font-size: 14px; }
.dash-mini-qa .dash-title svg { width: 16px; height: 16px; }
.dash-mini-qa .dash-qa { gap: 8px; padding: 8px; }
.dash-mini-qa .qa, .dash-mini-qa button.qa { min-height: 78px; gap: 6px; }
.dash-mini-qa .qa svg { width: 28px; height: 28px; }
.dash-mini-qa .qa span { font-size: 12.5px; }
.dash-date { display: flex; flex-direction: row; align-items: center; margin: 0; }
.dash-date input { width: 150px; max-width: 150px; height: 30px; min-height: 0; padding: 0 8px; font-size: 13px; border-radius: 8px; background: #fff; color: #243028; color-scheme: light; }
.op-filters { display: flex; align-items: center; gap: 8px; margin: 0; flex-wrap: wrap; }
.op-filters input, .op-filters select { width: auto; max-width: 220px; height: 30px; min-height: 0; padding: 0 8px; font-size: 13px; border-radius: 8px; background: #fff; color: #243028; color-scheme: light; }
.op-filters input[type="date"] { width: 150px; }
button.op-refresh { width: 30px; height: 30px; min-height: 0; padding: 0; border: 0; border-radius: 8px; background: #b8893a; color: #fff; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
button.op-refresh svg { width: 16px; height: 16px; fill: none; stroke: #fff; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
button.op-refresh:hover { background: #a67a32; }
.dash-regs .dash-head:has(.op-filters) { min-height: 44px; }
label.op-list-search { display: flex; flex-direction: row; align-items: center; gap: 8px; flex: 0 0 220px; width: 220px; height: 30px; min-height: 0; margin: 0; padding: 0 10px; border-radius: 8px; background: #fff; border: 1px solid #e3d8c4; color: #8a8174; }
label.op-list-search svg { width: 15px; height: 15px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
label.op-list-search input { flex: 1 1 auto; width: 1px; max-width: none; height: 28px; min-height: 0; margin: 0; border: 0; border-radius: 0; padding: 0; background: transparent; color: #243028; font-size: 13px; box-shadow: none; }
label.op-list-search input::placeholder { color: #9a9184; }
.op-sumbar { display: flex; align-items: stretch; gap: 8px; padding: 8px; background: #fff; border: 1px solid #e6dccb; border-radius: 14px; box-shadow: 0 8px 22px rgba(36, 48, 40, 0.06); flex-wrap: wrap; }
a.op-sum { flex: 1 1 0; min-width: 96px; min-height: 52px; padding: 4px 6px; border-radius: 10px; border: 1px solid transparent; text-decoration: none; color: var(--ink); display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; }
a.op-sum span { font-size: 11px; font-weight: 700; }
a.op-sum small { font-size: 11px; color: var(--muted); letter-spacing: .02em; margin-top: 1px; }
a.op-sum strong { font-size: 18px; line-height: 1.05; font-weight: 700; margin-top: 1px; }
a.op-sum-total { background: #f3f7f4; }
a.op-sum-total strong, a.op-sum-total span, a.op-sum-total .op-sum-ico { color: #1c3b2b; }
button.op-sum-new { flex: 0 0 176px; height: auto; min-height: 52px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 4px 10px; border: 1px solid #c6a15a; border-radius: 10px; cursor: pointer; color: #f6f0e6; background: #243028; box-shadow: inset 0 1px 0 rgba(255,255,255,.12); }
a.op-sum-pending, a.op-sum-progress, a.op-sum-done { display: flex; }
a.op-sum-pending .op-sum-ico, a.op-sum-progress .op-sum-ico, a.op-sum-done .op-sum-ico { margin-bottom: 2px; }
a.op-sum-pending strong, a.op-sum-progress strong, a.op-sum-done strong { margin-top: 0; }
a.op-sum-pending { background: #fff6ec; }
a.op-sum-pending strong, a.op-sum-pending span, a.op-sum-pending .op-sum-ico { color: #c47a12; }
a.op-sum-progress { background: #eef5fc; }
a.op-sum-progress strong, a.op-sum-progress span, a.op-sum-progress .op-sum-ico { color: #1d5fa8; }
a.op-sum-done { background: #eef8f1; }
a.op-sum-done strong, a.op-sum-done span, a.op-sum-done .op-sum-ico { color: #1d7a45; }
a.op-sum.is-on { border-color: var(--pine); box-shadow: inset 0 0 0 1px var(--pine); }
.op-sum-ico { width: 22px; height: 22px; border-radius: 7px; background: rgba(255, 255, 255, .72); display: flex; align-items: center; justify-content: center; }
.op-sum-ico svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
a.op-sum.is-on { border-color: var(--pine); box-shadow: inset 0 0 0 1px var(--pine); }
button.op-sum-new .op-sum-new-ico { width: 22px; height: 22px; border-radius: 50%; border: 1px solid #d6b56a; display: flex; align-items: center; justify-content: center; }
button.op-sum-new svg { width: 13px; height: 13px; fill: none; stroke: #d6b56a; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
button.op-sum-new span { font-size: 12px; font-weight: 700; letter-spacing: .02em; }
button.op-sum-new:hover { background: #314438; }
a.op-sum:hover { filter: brightness(.98); }

.pd-card, .pd-history { background: #fff; border: 1.5px solid #c9a46a; border-radius: 12px; overflow: hidden; margin-bottom: 14px; }
.pd-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 42px; padding: 6px 12px; background: #243028; color: #fff; }
.pd-bar h2 { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 14px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: #fff; }
.pd-bar h2 svg, .pd-facts svg, .pd-view svg, .pd-search svg, .pd-new svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
a.pd-search, button.pd-search, button.pd-new { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 30px; min-height: 0; padding: 0 12px; border-radius: 8px; border: 1px solid #d6b56a; background: #b8893a; color: #fff; text-decoration: none; font-size: 13px; font-weight: 700; cursor: pointer; }
button.pd-new:disabled { opacity: .55; cursor: default; }
.pd-facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px 14px; padding: 12px; background: #fbf8f3; }
.pd-facts .pd-wide { grid-column: span 2; }
.pd-facts span { display: flex; align-items: center; gap: 6px; color: #8d8478; font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.pd-facts svg { color: #b8893a; }
.pd-facts strong { display: block; margin-top: 2px; color: #243028; font-size: 15px; font-weight: 700; }
.pd-history { border-color: #243028; }
.pd-table table { width: 100%; border-collapse: collapse; }
.pd-table th, .pd-table td { height: 36px; padding: 0 8px; border-bottom: 1px solid #efe6d8; text-align: left; font-size: 13px; color: #243028; background: #fff; }
.pd-table thead th { background: #f6f1e8; font-size: 12px; font-weight: 700; }
.pd-table td.empty { text-align: center; color: var(--muted); }
.pd-table td.pd-actions { height: auto; padding: 4px 8px; }
button.pd-view, button.pd-print { display: inline-flex; align-items: center; gap: 4px; height: 26px; min-height: 0; margin: 2px; padding: 0 8px; border-radius: 14px; border: 1px solid #c9a46a; background: #fff; color: #8a6230; font-size: 12px; font-weight: 700; cursor: pointer; white-space: nowrap; }
button.pd-view svg, button.pd-print svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.pd-actions { white-space: normal; }
@media (max-width: 900px) {
  .pd-facts { grid-template-columns: 1fr 1fr; }
  .pd-facts .pd-wide { grid-column: 1 / -1; }
}
.dash-head-start { display: flex; align-items: center; gap: 16px; min-width: 0; }
.dash-regs .dash-head { min-height: 36px; padding: 4px 10px; }
.dash-regs .dash-title { font-size: 14px; }
.dash-regs th, .dash-regs td { height: 24px; padding: 0 6px; font-size: 11.5px; }
.dash-regs thead th { height: 24px; font-size: 11px; }
.dash-regs col.op-sno { width: 5ch; }
.dash-regs col.op-mr { width: 12ch; }
.dash-regs col.op-name { width: 24%; }
.dash-regs col.op-doctor { width: 22%; }
.dash-regs col.op-tm { width: 12ch; }
.dash-regs td.when { padding-left: 4px; padding-right: 4px; white-space: nowrap; overflow: visible; text-overflow: clip; }
.dash-regs col.op-phone { width: 12ch; }
.dash-regs th.op-sno, .dash-regs td.op-sno,
.dash-regs th.op-mr, .dash-regs td.op-mr { padding-left: 2px; padding-right: 2px; }
.dash-regs th.op-name, .dash-regs td.op-name,
.dash-regs th.op-doctor, .dash-regs td.op-doctor { white-space: normal; overflow: visible; text-overflow: clip; }
.dash-regs tr.op-pending td { color: #c62828; }
.dash-regs tr.op-visit td { color: #1565c0; }
.dash-regs tr.op-done td { color: #111; font-weight: 700; }
button.qa { height: auto; min-height: 118px; width: 100%; padding: 0; cursor: pointer; font: inherit; }
.dash-layer { position: fixed; top: 0; right: 0; bottom: 0; left: var(--sidebar-w); z-index: 40; }
.dash-layer[hidden] { display: none; }
.dash-layer iframe { width: 100%; height: 100%; border: 0; background: transparent; }
body.dash-frame .jump-nav { display: none !important; }
.jump-nav { position: fixed; right: 18px; bottom: 18px; z-index: 30; display: flex; flex-direction: column; gap: 6px; }
.jump-nav[hidden] { display: none !important; }
.jump-nav button { width: 36px; height: 36px; min-height: 0; padding: 0; border-radius: 10px; border: 1px solid #c6a15a; background: #243028; color: #d6b56a; cursor: pointer; display: flex; align-items: center; justify-content: center; box-shadow: 0 6px 16px rgba(36, 48, 40, .18); }
.jump-nav button:hover { background: #314438; }
.jump-nav svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
body.dash-frame .content > .appt-bar,
body.dash-frame .content > .table-wrap,
body.dash-frame .print-header { display: none !important; }
@media (max-width: 1180px) {
  .dash-split { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .dash-head { align-items: flex-start; flex-wrap: wrap; }
  .dash-qa { grid-template-columns: 1fr 1fr; grid-template-rows: none; }
  .qa, .qa:nth-child(-n+3), .qa:nth-child(n+4) { grid-column: span 1; }
  .qa:last-child { grid-column: span 2; }
}
.pv-dialog > .msg { margin: 8px 12px 0; flex: 0 0 auto; }
dialog.pv-dialog[open] { width: min(1240px, calc(100vw - 32px)); height: min(94vh, 900px); max-height: min(94vh, 900px); }
.pv-dialog .pv-block h3::before { display: none; }
.pv-dialog .pv-block h3 svg { width: 16px; height: 16px; fill: none; stroke: #b8893a; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.pv-dialog .pv-block h3 span { border-bottom: 2px solid #b8893a; padding-bottom: 1px; }
.pv-dialog .pv-head .pv-head-title { border-bottom: 0; padding-bottom: 0; }
.pv-dialog .pv-block { padding: 6px 10px 8px; margin-bottom: 6px; }
.pv-dialog .pv-block h3 { margin-bottom: 4px; }
.pv-dialog .pv-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.pv-head-title { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
a.pv-history { height: 22px; min-height: 0; padding: 0 8px; border-radius: 11px; border: 1px solid #c9a46a; background: #fff; color: #8a6230; font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; text-decoration: none; line-height: 20px; flex: 0 0 auto; }
a.pv-history:hover { background: #fbf6ec; }
dialog.pv-case[open] { width: min(920px, calc(100vw - 32px)); height: min(92vh, 900px); max-height: min(92vh, 900px); display: flex; flex-direction: column; padding: 0; }
dialog.pv-case iframe { flex: 1 1 auto; width: 100%; border: 0; background: #fff; }
.pv-patient { display: grid; grid-template-columns: 86px repeat(4, minmax(0, 1fr)) auto 108px; grid-template-rows: auto auto; column-gap: 0; row-gap: 8px; align-items: center; background: #fff; border: 1px solid #e4d3b0; border-radius: 14px; padding: 8px 12px 10px; margin: 0 0 8px; }
.pv-visits { grid-column: 7; grid-row: 1 / span 2; align-self: stretch; max-height: 96px; overflow: auto; border-left: 1px solid #eadfce; padding: 0 0 0 8px; display: flex; flex-direction: column; gap: 2px; }
.pv-visits a, .pv-visits span { font-size: 12px; line-height: 1.35; color: #243028; text-decoration: none; white-space: nowrap; }
.pv-visits a:hover { color: #8a6230; }
.pv-visits .is-current { font-weight: 750; color: #8a6230; }
.pv-side { grid-row: 1 / span 2; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; }
.pv-side h3 { display: flex; align-items: center; gap: 6px; margin: 0; color: #243028; font-size: 13px; font-weight: 750; letter-spacing: .06em; text-transform: uppercase; }
.pv-side h3 svg { width: 16px; height: 16px; fill: none; stroke: #b8893a; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.pv-side h3 span { border-bottom: 2px solid #b8893a; padding-bottom: 1px; }
.pv-avatar { width: 46px; height: 46px; border-radius: 50%; background: #e7f2e4; display: grid; place-items: center; }
.pv-avatar svg { width: 24px; height: 24px; fill: none; stroke: #314438; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.pv-stat { min-width: 0; padding: 0 10px; }
.pv-stat + .pv-stat { border-left: 1px solid #eadfce; }
.pv-stat span, .pv-meta span { display: flex; align-items: center; gap: 5px; font-size: 10px; letter-spacing: .07em; text-transform: uppercase; color: #8d8478; }
.pv-stat svg, .pv-meta svg { width: 13px; height: 13px; flex: 0 0 auto; fill: none; stroke: #b8893a; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.pv-stat strong, .pv-meta strong { display: block; margin-top: 1px; color: #243028; font-size: 15px; font-weight: 750; line-height: 1.25; }
.pv-dialog .pv-card-select { align-self: center; position: static; height: 32px; min-height: 32px; margin-left: 8px; padding: 0 10px; border-radius: 8px; font-size: 13px; }
.pv-meta { min-width: 0; padding: 6px 10px 0; }
.pv-name { grid-column: 2 / span 2; border-right: 1px solid #eadfce; }
.pv-addr { grid-column: 4 / span 2; }
.pv-find { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 12px; }
.pv-find input, .pv-find select { height: 40px; background: #fff; color: #243028; color-scheme: light; }
.pv-facts { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; align-items: end; }
.pv-facts span { display: block; margin-bottom: 2px; font-size: 10px; letter-spacing: .06em; text-transform: uppercase; color: #667066; }
.pv-facts strong { display: flex; align-items: center; min-height: 32px; padding: 0 8px; background: #fff; border: 1px solid #ded5c5; border-radius: 8px; color: #243028; font-size: 13px; overflow: hidden; }
.pv-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; }
.pv-span { grid-column: 1 / -1; }
.pv-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: stretch; }
.pv-pair textarea.pv-note { height: 100px; min-height: 100px; }
.pv-vision { margin-top: 4px; }
.pv-vision table { width: 100%; border-collapse: collapse; background: #fff; color: #243028; }
.pv-vision th, .pv-vision td { border: 1px solid #243028; text-align: center; font-weight: 650; padding: 0; }
.pv-vision thead th { padding: 6px 8px; font-size: 13px; background: #f7f3ea; }
.pv-vision tbody th { width: 1%; white-space: nowrap; padding: 6px 8px; text-align: left; background: #f7f3ea; font-size: 13px; }
.pv-vision input { width: 100%; height: 34px; min-height: 34px; border: 0; border-radius: 0; background: transparent; text-align: center; font-size: 14px; font-weight: 650; color: #243028; box-shadow: none; }
.pv-vision input:focus { outline: none; background: #fffdf8; box-shadow: inset 0 0 0 2px #b8893a; }
.pv-findings input { width: 100%; height: 32px; min-height: 32px; border: 0; border-radius: 0; background: transparent; text-align: left; padding: 0 26px 0 8px; font-size: 13px; font-weight: 650; color: #243028; }
.pv-dialog .cn-foot { flex-wrap: nowrap; gap: 8px; }
.pv-printbar { display: flex; flex-wrap: nowrap; align-items: center; gap: 6px; padding: 0; min-width: 0; }
.pv-printbar .cn-clear { height: 34px; min-height: 34px; padding: 0 8px; font-size: 12px; white-space: nowrap; }
.pv-printbar .cn-clear svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
dialog#waConfirm { border: 1px solid #cfc3b0; padding: 0; width: min(420px, calc(100vw - 32px)); border-radius: 12px; background: #f7f3eb; color: #243028; }
dialog#waConfirm::backdrop { background: rgba(20, 24, 21, 0.5); }
dialog#waConfirm form { display: flex; flex-direction: column; gap: 8px; padding: 16px; }
dialog#waConfirm form > p { margin: 0; }
dialog#waConfirm .wa-error { min-height: 18px; color: #c4503a; font-size: 13px; }
dialog#waConfirm .wa-actions { display: flex; justify-content: flex-end; gap: 8px; }
dialog#waPick { width: min(360px, calc(100vw - 32px)); }
dialog#waPick .wa-options { display: flex; flex-direction: column; gap: 8px; padding: 14px; }
dialog#waPick .wa-options button { height: 40px; border-radius: 8px; border: 1px solid #b8893a; background: #fff; color: #243028; font-weight: 650; cursor: pointer; text-align: left; padding: 0 14px; }
.pv-end { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: end; margin-top: 8px; }
.pv-end label.pv-box { display: flex; flex-direction: column; margin: 0; }
.pv-end input.pv-note, .pv-end select { height: 40px; min-height: 40px; flex: none; border: 1px solid #ded5c5; border-radius: 8px; background: #fff; color: #243028; padding: 0 36px 0 12px; }
.pv-end select { padding: 0 12px; }
.pv-end button.pv-text { bottom: 8px; }
.pd-field { margin: 0; }
.pd-field label { min-width: 280px; }
.pd-field select { height: 40px; }
.account-dialog textarea { width: 100%; min-height: 110px; height: 110px; border: 1px solid #ded5c5; border-radius: 8px; padding: 12px; }
.pv-dialog label.pv-box { position: relative; }
.pv-dialog label.pv-box button.pv-text,
.pv-pick button.pv-text { top: auto; bottom: 4px; right: 4px; z-index: 3; }
.pv-dialog label.pv-box textarea.pv-note { padding-right: 36px; padding-bottom: 28px; }
.pv-pick { position: relative; }
.pv-dialog button.pv-text { position: absolute; width: 22px; height: 22px; min-height: 22px; padding: 0; border-radius: 5px; background: #fffdf8; color: #243028; border: 1px solid #d6c49a; }
.pv-dialog button.pv-text svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.pv-pick textarea, .pv-pick input { padding-right: 26px; }
dialog#pvTexts { width: min(420px, calc(100vw - 32px)); border: 1px solid #ded5c5; border-radius: 12px; padding: 0; background: #f4efe6; }
dialog#pvTexts .np-head { min-height: 40px; padding: 0 8px 0 12px; }
dialog#pvTexts .np-head h2 { font-size: 14px; font-weight: 650; letter-spacing: 0; }
dialog#pvTexts .np-close { width: 28px; height: 28px; min-height: 28px; }
.pv-texts-search { display: block; margin: 0; padding: 8px 10px 0; }
.pv-texts-search input { height: 32px; font-size: 13px; }
dialog#pvTexts .account-dialog-body { max-height: 280px; overflow: auto; padding: 8px 10px 10px; }
button.pv-text-row { display: block; width: 100%; height: auto; min-height: 0; margin: 0; padding: 5px 8px; text-align: left; background: transparent; color: #243028; border: 0; border-radius: 4px; white-space: normal; font-size: 12px; font-weight: 500; line-height: 1.35; }
button.pv-text-row.is-on, button.pv-text-row:hover { background: #e7f0e4; }
.pv-dialog label { color: #243028; font-size: 13px; font-weight: 650; }
.pv-dialog textarea.pv-note { width: 100%; height: 100px; min-height: 100px; resize: vertical; background: #fff; border: 1px solid #ded5c5; border-radius: 8px; padding: 12px 14px; font: 14px/1.5 inherit; color: #243028; }
.pv-dialog textarea.pv-exam { height: 120px; min-height: 120px; }
.pv-dialog textarea.pv-tall { height: 110px; min-height: 110px; }
.pv-dialog textarea.pv-note:focus { border-color: #b8893a; box-shadow: 0 0 0 3px rgba(184, 137, 58, .10); outline: none; }
.pv-meds { margin-top: 4px; }
.pv-med-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.pv-med-head span { color: #243028; font-size: 13px; font-weight: 750; letter-spacing: .04em; text-transform: uppercase; }
.pv-meds table { width: 100%; border-collapse: collapse; background: #fff; }
.pv-meds th, .pv-meds td { border: 1px solid #ded5c5; padding: 4px 6px; text-align: left; }
.pv-meds th { background: #1c2822; color: #f6f0e6; font-size: 12px; }
.pv-meds input { height: 34px; min-height: 34px; border: 0; border-radius: 0; background: transparent; font-size: 14px; }
.pv-meds td { font-size: 13px; color: #243028; }
.pv-med-actions { width: 72px; white-space: nowrap; text-align: right; }
.pv-meds .pv-med-x { width: 28px; height: 28px; min-height: 28px; margin-left: 4px; padding: 0; background: #fff; color: #243028; border: 1px solid #ded5c5; border-radius: 6px; }
.pv-meds .pv-med-x svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
#medDialog { width: min(480px, calc(100vw - 32px)); border: 1px solid #ded5c5; border-radius: 14px; padding: 0; background: #f4efe6; }
#medDialog .account-dialog-body { display: flex; flex-direction: column; gap: 12px; padding: 14px; }
#medDialog .med-field { display: flex; flex-direction: column; gap: 6px; color: #243028; font-size: 13px; font-weight: 650; }
#medDialog .med-field select,
#medDialog .med-usage input { width: 100%; height: 44px; min-height: 44px; border: 1px solid #ded5c5; border-radius: 8px; background: #fff; color: #243028; padding: 0 12px; font-size: 14px; }
.med-usage { position: relative; display: block; }
.med-usage input { padding-right: 40px; }
.med-usage button.pv-text { position: absolute; right: 8px; bottom: 10px; top: auto; width: 26px; height: 26px; min-height: 26px; padding: 0; border-radius: 6px; background: #fffdf8; color: #243028; border: 1px solid #d6c49a; z-index: 2; }
.med-usage button.pv-text svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
#medDialog .dialog-actions { margin: 4px 0 0; }
#medDialog .np-save svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.pv-dialog .np-save:disabled { opacity: .45; cursor: not-allowed; }
a.pv-select { display: inline-flex; align-items: center; height: 30px; min-height: 30px; padding: 0 12px; border-radius: 8px; background: #243028; color: #fff; text-decoration: none; font-size: 13px; font-weight: 650; }
@media (max-width: 1100px) {
  .pv-facts { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 800px) {
  .pv-find, .pv-grid, .pv-facts { grid-template-columns: 1fr; }
  .pv-patient { grid-template-columns: 1fr; }
  .pv-side { grid-row: auto; flex-direction: row; justify-content: flex-start; }
  .pv-stat { border-left: 0; padding: 6px 0; border-top: 1px solid #eadfce; }
  .pv-name, .pv-addr { grid-column: auto; border-right: 0; }
}
dialog.user-dialog.account-dialog[open] {
  display: block;
  width: min(760px, calc(100vw - 24px));
  max-width: calc(100vw - 24px);
  height: auto;
  max-height: calc(100vh - 24px);
  overflow: auto;
}
dialog.user-dialog .account-dialog-head { position: sticky; top: 0; z-index: 2; }
dialog.user-dialog .account-dialog-body { max-height: none; overflow: visible; }
.rights-head, .rights-section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 16px 0 8px; }
.rights-head h3, .rights-section-head strong { margin: 0; color: #1c2822; font-size: 13px; letter-spacing: .06em; text-transform: uppercase; }
label.check-line { flex-direction: row; align-items: center; gap: 8px; color: #1c2822; font-size: 14px; }
.rights-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.rights-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; }
.rights-grid label.check-line { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; }
.rights-item > label.check-line { background: transparent; border: 0; padding: 0; }
.rights-edit { flex: 0 0 auto; color: #1a3f73; font-weight: 650; }
label.check-line input[type="checkbox"] { width: 16px; height: 16px; min-height: 16px; flex: 0 0 16px; padding: 0; border-radius: 3px; accent-color: #b8893a; }
.rights-note { margin: 10px 0 0; color: var(--muted); font-size: 13px; }
@media (max-width: 700px) { .rights-grid { grid-template-columns: 1fr; } }

body.login-body {
  min-height: 100vh;
  background: #f4efe6;
  overflow-x: hidden;
  overflow-y: auto;
}
.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;
}
.gate { position: relative; min-height: 100vh; background: #f4efe6; }
.gate-photo { position: absolute; inset: 0 36% 0 0; overflow: hidden; }
.gate-photo img { width: 100%; height: 100%; object-fit: cover; object-position: 30% center; filter: saturate(.94) contrast(1.02); }
.gate-photo::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255,252,247,.42) 0%, rgba(255,252,247,.05) 34%, rgba(244,239,230,.12) 100%);
  pointer-events: none;
}
.gate-swoosh { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.gate-hospital {
  position: absolute;
  z-index: 2;
  top: 4.2vh;
  left: 3.2vw;
  width: min(540px, 48vw);
  container-type: inline-size;
}
.gate-hospital img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 10px 18px rgba(36, 48, 40, .12));
}
.gate-address {
  position: absolute;
  left: 36.6%;
  top: 43.5%;
  margin: 0;
  color: #111111;
  font-family: "Segoe UI", sans-serif;
  font-weight: 700;
  font-size: 2.55cqi;
  line-height: 1.62;
  letter-spacing: 0.01em;
}
.gate-panel {
  position: relative;
  z-index: 2;
  margin-left: 57%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 22px;
  padding: 28px 48px 22px;
}
body.login-body .login-card {
  width: min(560px, 100%);
  margin: 0;
  padding: 28px 32px 26px;
  background: #fff;
  border: 2px solid #b8893a;
  border-radius: 22px;
  box-shadow: 0 18px 40px rgba(36, 48, 40, .14), inset 0 1px 0 rgba(255, 255, 255, .9);
}
.gate-head { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; }
.gate-lock {
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  display: grid;
  place-items: center;
  color: #b8893a;
}
.gate-lock svg { width: 34px; height: 34px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
body.login-body .gate-head h1 {
  margin: 0;
  color: #243028;
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
}
body.login-body .gate-head p {
  margin: 6px 0 0;
  color: #5d6b62;
  font-size: 13px;
  font-weight: 650;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
body.login-body .login-card form { display: grid; gap: 14px; margin: 0; }
body.login-body .login-card .msg { margin: 0 0 12px; }
body.login-body .validation-summary-valid { display: none; }
body.login-body .gate-field {
  position: relative;
  display: block;
  margin: 0;
  color: #243028;
}
body.login-body .gate-field input {
  width: 100%;
  height: 62px;
  min-height: 62px;
  padding: 0 52px 0 52px;
  border: 1px solid #ded5c5;
  border-radius: 12px;
  background: #fff;
  color: #243028;
  font-size: 16px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .8);
}
body.login-body .gate-field input::placeholder { color: #8d867c; }
body.login-body .gate-ico {
  position: absolute;
  left: 16px;
  top: 50%;
  width: 22px;
  height: 22px;
  margin-top: -11px;
  color: #8a8174;
  pointer-events: none;
}
body.login-body .gate-ico svg,
body.login-body .gate-eye svg,
body.login-body .gate-submit svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
body.login-body .gate-eye {
  position: absolute;
  right: 8px;
  top: 50%;
  width: 40px;
  height: 40px;
  min-height: 40px;
  margin-top: -20px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #8a8174;
  cursor: pointer;
}
body.login-body .gate-eye:hover { color: #243028; }
body.login-body .gate-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  height: 60px;
  min-height: 60px;
  margin: 4px 0 0;
  padding: 0 18px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(180deg, #314438 0%, #243028 100%);
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
  box-shadow: 0 8px 16px rgba(36, 48, 40, .18), inset 0 1px 0 rgba(255, 255, 255, .16);
}
body.login-body .gate-submit svg { width: 20px; height: 20px; }
body.login-body .gate-submit:hover { filter: brightness(1.08); transform: translateY(-1px); }
body.login-body .gate-or {
  margin: 0;
  text-align: center;
  color: #8a8174;
  font-size: 12px;
  letter-spacing: .12em;
  text-transform: uppercase;
}
body.login-body .gate-finger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 52px;
  min-height: 52px;
  border: 1px solid #b8893a;
  border-radius: 12px;
  background: #fff;
  color: #243028;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
}
body.login-body .gate-finger:hover { background: #f7f1e4; }
body.login-body .gate-offer { margin: 0 0 14px; color: #3d4a42; }
body.login-body .gate-text-link {
  display: block;
  margin-top: 12px;
  text-align: center;
  color: #5d6b62;
  font-weight: 650;
}
.finger-panel { margin-top: 16px; }
dialog#sessionFinger { border: 1px solid #cfc3b0; padding: 0; width: min(420px, calc(100vw - 32px)); border-radius: 12px; background: #f7f3eb; color: #243028; }
dialog#sessionFinger::backdrop { background: rgba(20, 24, 21, 0.5); }
dialog#sessionFinger form { display: flex; flex-direction: column; gap: 8px; padding: 16px; }
dialog#sessionFinger form > p { margin: 0; }
dialog#sessionFinger .wa-error { min-height: 18px; color: #c4503a; font-size: 13px; }
dialog#sessionFinger .wa-actions { display: flex; justify-content: flex-end; gap: 8px; }
body.login-body .gate-system {
  margin: 4px 0 0;
  text-align: center;
  color: #667066;
  font-size: 12px;
}
body.login-body .gate-system strong {
  color: #243028;
  letter-spacing: .08em;
}
.sys-rename { display: flex; align-items: center; gap: 6px; margin: 0; }
.sys-rename input {
  width: auto;
  flex: 1 1 120px;
  min-width: 0;
  height: 34px;
  min-height: 34px;
  padding: 0 8px;
}
.sys-status {
  display: inline-block;
  min-width: 72px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}
.sys-status.is-pending { background: #f8e6df; color: #7a2e18; }
.sys-status.is-approved { background: #2f6b45; color: #fff; }
.sys-status.is-rejected { background: #ece7df; color: #667066; }
.sys-status.is-revoked { background: #e8e0d4; color: #5a5348; }
table.sys-list tr.sys-pending td { background: #fff8f2; }
table.sys-list tr.sys-ok td { background: #eef6ea; }
body.login-body .gate-brand {
  width: min(240px, 62%);
  height: auto;
  object-fit: contain;
  margin-top: 2px;
  clip-path: inset(0 0 5% 0);
}

.shell, .main, .sidebar { height: 100vh; height: 100dvh; }
@media (max-width: 1099px) {
  .shell.nav-open .main::before {
    content: "";
    position: fixed;
    inset: 0;
    background: rgba(20, 24, 21, .45);
    z-index: 25;
  }
}
@media (max-width: 1024px) {
  .cn-service-bar { flex-wrap: wrap; }
  .cn-service-bar .cn-consult,
  .cn-service-open,
  .cn-pick { flex: 1 1 220px; min-width: 0; }
  .cn-service { grid-template-columns: 1fr 1fr; }
  .cn-pay { grid-template-columns: 1fr 1fr; }
  .cn-total { grid-column: 1 / -1; }
  .toolbar-end { margin-left: auto; flex-wrap: wrap; }
  .op-filters input, .op-filters select { max-width: 100%; }
}
@media (max-width: 768px) {
  .topbar { grid-template-columns: auto minmax(0, 1fr); gap: 6px; min-height: 56px; padding: 8px 10px; }
  .topbar-end { grid-column: 1 / -1; justify-content: flex-end; flex-wrap: wrap; }
  .header-clock { display: none; }
  .topbar-title { font-size: 18px; }
  .crumb { flex-wrap: wrap; }
  .content { padding: 12px; }
  .dash-head { flex-wrap: wrap; align-items: flex-start; padding: 10px 12px; }
  .dash-title { font-size: 16px; }
  .op-sumbar { justify-content: center; }
  .cn-foot, .patient-foot, .cn-dialog .cn-foot, .pv-dialog .cn-foot { flex-wrap: wrap; }
  .cn-foot-start, .cn-foot-end { width: 100%; flex-wrap: wrap; }
  .cn-patient-row, .cn-card-grid { display: grid; grid-template-columns: 1fr; }
  .cn-service { grid-template-columns: 1fr; }
  .mr-box { flex-wrap: wrap; }
  .mr-side + .mr-side { align-items: flex-start; border-left: 0; padding-left: 0; }
  .mr-box input { text-align: left; width: 100%; max-width: none; }
  dialog.patient-dialog[open],
  dialog.cn-dialog[open],
  dialog.pv-dialog[open],
  dialog.pv-case[open],
  dialog.account-dialog[open],
  dialog.consult-find.account-dialog[open],
  dialog.user-dialog.account-dialog[open] {
    width: calc(100vw - 12px);
    max-width: calc(100vw - 12px);
    height: calc(100dvh - 12px);
    max-height: calc(100dvh - 12px);
  }
  .np-head h2 { font-size: 15px; letter-spacing: 0; }
  .cn-dialog .np-head h2 { font-size: 18px; }
  .gate-panel { padding: 16px 12px 24px; }
  body.login-body .login-card { width: min(100%, 520px); padding: 22px 16px 18px; }
  body.login-body .gate-head h1 { font-size: 26px; }
  body.login-body .gate-swoosh,
  body.login-body .gate-photo { display: none; }
  body.login-body .gate { background: #f4efe6; }
  body.login-body .gate-hospital { position: relative; top: auto; left: auto; width: min(300px, 88vw); margin: 16px auto 0; }
  body.login-body .gate-panel { margin: 0; min-height: 0; padding: 8px 12px 28px; }
  .jump-nav { right: 10px; bottom: 10px; }
}
@media (max-width: 480px) {
  .stats, .menu { grid-template-columns: 1fr; }
  .cn-pay { grid-template-columns: 1fr; }
  .cn-pay-item input { width: 100%; max-width: none; }
  .toolbar .tool { flex: 1 1 auto; justify-content: center; }
  .op-filters { width: 100%; }
  .op-filters input, .op-filters select, .op-filters input[type="date"] { width: 100%; }
  .gate-photo { height: 160px; }
  .gate-hospital { width: min(280px, calc(100vw - 24px)); }
  body.login-body .gate-field input { height: 52px; min-height: 52px; }
}

html.is-narrow .sidebar { width: min(86vw, 320px); height: 100dvh; }
html.is-narrow table { min-width: 0 !important; display: block; width: 100%; }
html.is-narrow .table-wrap,
html.is-narrow .dash-table-wrap { overflow: visible; border: 0; background: transparent; box-shadow: none; }
html.is-narrow table thead { display: none; }
html.is-narrow table tbody { display: block; width: 100%; }
html.is-narrow table tbody tr {
  display: block;
  margin: 0 0 10px;
  padding: 4px 12px;
  border: 1px solid #e6dccb;
  border-radius: 12px;
  background: #fff;
}
html.is-narrow table td,
html.is-narrow .dash td {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  height: auto;
  min-height: 0;
  padding: 7px 0;
  border: 0;
  border-bottom: 1px solid #f3ecdf;
  overflow: visible;
  text-align: right;
  white-space: normal;
}
html.is-narrow table td:last-child,
html.is-narrow .dash td:last-child { border-bottom: 0; }
html.is-narrow table td::before,
html.is-narrow .dash td::before {
  content: attr(data-label);
  flex: 0 0 42%;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: #667066;
}
html.is-narrow table td.empty::before,
html.is-narrow .dash td.empty::before { content: none; }
html.is-narrow table td.empty,
html.is-narrow .dash td.empty { display: block; text-align: center; }
html.is-narrow table td.row-actions { justify-content: flex-end; flex-wrap: wrap; }
html.is-narrow table td.row-actions::before { content: none; }
html.is-phone dialog.patient-dialog[open],
html.is-phone dialog.cn-dialog[open],
html.is-phone dialog.pv-dialog[open],
html.is-phone dialog.pv-case[open],
html.is-phone dialog.account-dialog[open],
html.is-phone dialog.consult-find[open],
html.is-phone dialog.user-dialog[open] {
  top: 0;
  left: 0;
  transform: none;
  width: 100%;
  max-width: 100%;
  height: 100%;
  max-height: 100%;
  border-radius: 0;
  border: 0;
}
html.is-tablet dialog.patient-dialog[open],
html.is-tablet dialog.cn-dialog[open],
html.is-tablet dialog.pv-dialog[open],
html.is-tablet dialog.account-dialog[open] {
  width: calc(100vw - 28px);
  max-width: calc(100vw - 28px);
  height: calc(100dvh - 28px);
  max-height: calc(100dvh - 28px);
}
html.is-narrow .form-grid,
html.is-narrow .filters,
html.is-narrow .city-row,
html.is-narrow .slot-form,
html.is-narrow .patient-dialog .np-grid,
html.is-narrow .np-row2,
html.is-narrow .cn-card-grid,
html.is-narrow .cn-service,
html.is-narrow .cn-find-grid,
html.is-narrow .cn-pay,
html.is-narrow .pv-patient,
html.is-narrow .pv-grid,
html.is-narrow .pv-facts,
html.is-narrow .pv-find,
html.is-narrow .appt-boxes,
html.is-narrow .rights-grid,
html.is-narrow .report-sums { grid-template-columns: 1fr !important; }
html.is-tablet .form-grid,
html.is-tablet .cn-find-grid,
html.is-tablet .rights-grid,
html.is-tablet .patient-dialog .np-grid,
html.is-tablet .cn-card-grid { grid-template-columns: 1fr 1fr !important; }
html.is-narrow .cn-service-bar,
html.is-narrow .cn-patient-row,
html.is-narrow .toolbar,
html.is-narrow .dash-head,
html.is-narrow .cn-foot,
html.is-narrow .patient-foot { flex-wrap: wrap; }
html.is-narrow .list-search,
html.is-narrow .cn-foot-start,
html.is-narrow .cn-foot-end,
html.is-narrow .op-filters,
html.is-narrow .op-filters input,
html.is-narrow .op-filters select { width: 100%; max-width: none; }
html.is-narrow .dash-qa { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
html.is-phone .dash-qa { grid-template-columns: 1fr; }

@media (max-width: 1100px) {
  .dash-layer, .shell.nav-open .dash-layer { left: 0; }
  .main { width: 100%; min-width: 0; }
  .dash-card, .dash-table-wrap { overflow: visible; }
  table { min-width: 0 !important; display: block; width: 100%; }
  table thead { display: none; }
  table tbody { display: block; width: 100%; }
  .table-wrap, .dash-table-wrap { overflow: visible; border: 0; background: transparent; }
  table tbody tr { display: block; margin: 0 0 10px; padding: 4px 12px; border: 1px solid #e6dccb; border-radius: 12px; background: #fff; }
  table td, .dash td {
    display: flex; justify-content: space-between; align-items: flex-start; gap: 12px;
    height: auto; min-height: 0; padding: 7px 0; border: 0; border-bottom: 1px solid #f3ecdf;
    overflow: visible; text-align: right; white-space: normal;
  }
  table td:last-child { border-bottom: 0; }
  table td::before {
    content: attr(data-label);
    flex: 0 0 42%;
    text-align: left;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: #667066;
  }
  table td.empty::before { content: none; }
  table td.empty { display: block; text-align: center; }
  table td.row-actions { justify-content: flex-end; flex-wrap: wrap; }
  table td.row-actions::before { content: none; }
  .form-grid, .filters, .city-row, .slot-form, .cn-card-grid, .cn-service, .cn-find-grid,
  .pv-patient, .pv-grid, .pv-facts, .pv-find, .appt-boxes, .rights-grid, .patient-dialog .np-grid, .np-row2 {
    grid-template-columns: 1fr !important;
  }
  .cn-service-bar, .cn-patient-row, .toolbar, .dash-head, .cn-foot, .patient-foot, .op-filters { flex-wrap: wrap; }
  .list-search, .op-filters input, .op-filters select { width: 100%; max-width: none; }
}
@media (min-width: 701px) and (max-width: 1100px) {
  .form-grid, .cn-find-grid, .rights-grid, .patient-dialog .np-grid, .cn-card-grid { grid-template-columns: 1fr 1fr !important; }
  dialog.patient-dialog[open], dialog.cn-dialog[open], dialog.pv-dialog[open], dialog.account-dialog[open] {
    width: calc(100vw - 28px); max-width: calc(100vw - 28px); height: calc(100dvh - 28px); max-height: calc(100dvh - 28px);
  }
}
@media (max-width: 700px) {
  dialog.patient-dialog[open], dialog.cn-dialog[open], dialog.pv-dialog[open], dialog.pv-case[open],
  dialog.account-dialog[open], dialog.consult-find[open], dialog.user-dialog[open] {
    top: 0; left: 0; transform: none; width: 100%; max-width: 100%; height: 100%; max-height: 100%; border-radius: 0; border: 0;
  }
  .stats, .menu, .dash-qa, .cn-pay { grid-template-columns: 1fr !important; }
}
@media (min-width: 701px) {
  dialog.patient-dialog[open],
  dialog.cn-dialog[open],
  dialog.pv-dialog[open] {
    top: 12px;
    bottom: 12px;
    height: auto;
    max-height: none;
    transform: translateX(-50%);
    overflow: hidden;
  }
  dialog.patient-dialog[open] > .np-head,
  dialog.cn-dialog[open] > .np-head,
  dialog.pv-dialog[open] > .np-head,
  dialog.patient-dialog[open] > .patient-foot,
  dialog.cn-dialog[open] > .patient-foot,
  .patient-dialog .patient-foot,
  .cn-dialog .cn-foot {
    flex: 0 0 auto;
  }
  dialog#oldDialog[open] {
    width: min(1180px, calc(100vw - 24px));
    max-width: calc(100vw - 24px);
  }
  #oldDialog .np-search {
    flex: 0 1 auto;
    min-height: 0;
    max-height: 46%;
    overflow: auto;
  }
  #oldDialog .old-results {
    flex: 1 1 auto;
    min-height: 140px;
    overflow: auto;
  }
}
