:root {
  color-scheme: light;
  --bg: #f4f7fb;
  --paper: #ffffff;
  --ink: #102a43;
  --muted: #6b7c93;
  --line: #d9e2ec;
  --brand: #176b87;
  --brand-dark: #0e4f67;
  --brand-soft: #e7f4f7;
  --orange: #e6783c;
  --orange-soft: #fff1e8;
  --purple: #6f5bd3;
  --purple-soft: #f0edff;
  --green: #2e8b72;
  --green-soft: #e8f6ef;
  --red: #c95858;
  --red-soft: #fff0f0;
  --shadow: 0 18px 50px rgba(16, 42, 67, 0.08);
  --el-color-primary: #176b87;
  --el-color-primary-light-3: #4a95a9;
  --el-color-primary-light-5: #8ec2ce;
  --el-color-primary-light-7: #c9e4e9;
  --el-color-primary-light-8: #dceff2;
  --el-color-primary-light-9: #edf8fa;
  --el-color-primary-dark-2: #0e4f67;
}

* {
  box-sizing: border-box;
  scrollbar-width: thin;
  scrollbar-color: #cbd8e4 transparent;
}

html,
body,
#app {
  min-height: 100%;
  margin: 0;
}

html,
body {
  background: var(--bg);
  color: var(--ink);
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

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

button {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

button:focus-visible,
input:focus-visible {
  outline: 3px solid rgba(23, 107, 135, 0.16);
  outline-offset: 1px;
}

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

.app-shell {
  min-height: 100dvh;
  background: var(--bg);
}

.appbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 28px;
  height: 68px;
  padding: 0 34px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(18px);
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 208px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.brand-lockup:disabled {
  cursor: default;
}

.brand-mark,
.login-mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 11px;
  color: #fff;
  background: linear-gradient(135deg, #238aa1, #14536e);
  font-size: 19px;
  font-weight: 900;
}

.brand-copy strong,
.brand-copy small {
  display: block;
}

.brand-copy strong {
  font-size: 15px;
  letter-spacing: 0.02em;
}

.brand-copy small {
  margin-top: 1px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 500;
}

.appbar-nav {
  display: flex;
  align-items: center;
  gap: 5px;
  flex: 1;
}

.appbar-nav button {
  padding: 9px 13px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
}

.appbar-nav button:hover,
.appbar-nav button.active {
  background: var(--brand-soft);
  color: var(--brand-dark);
}

.appbar-account {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
  margin-left: auto;
  min-width: 0;
}

.account-avatar,
.entity-avatar {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  color: var(--brand-dark);
  background: #d8edf2;
  font-size: 12px;
  font-weight: 900;
}

.account-copy strong,
.account-copy small {
  display: block;
}

.account-copy strong {
  font-size: 12px;
}

.account-copy small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
}

.appbar-logout {
  display: grid;
  place-items: center;
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  margin-left: 8px;
  padding: 0;
  border: 1px solid #cfe8eb;
  border-radius: 10px;
  color: var(--brand-dark);
  background: var(--brand-soft);
  cursor: pointer;
}

.appbar-logout .el-icon {
  font-size: 18px;
}

.appbar-logout:hover {
  border-color: #abd2da;
  color: var(--brand-dark);
  background: #d8eef2;
}

.mobile-page-title,
.mobile-back-row {
  display: none;
}

.app-body {
  display: flex;
  min-height: calc(100dvh - 68px);
}

.side-nav {
  position: sticky;
  top: 68px;
  align-self: flex-start;
  width: 228px;
  min-height: calc(100dvh - 68px);
  padding: 28px 15px;
  border-right: 1px solid var(--line);
  background: #fbfcfe;
}

.side-label {
  padding: 0 12px 10px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
}

.side-label-gap {
  margin-top: 28px;
}

.side-menu {
  display: grid;
  gap: 4px;
}

.side-menu button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 11px 12px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  text-align: left;
  font-size: 13px;
  font-weight: 700;
}

.side-menu button:hover,
.side-menu button.active {
  color: var(--brand-dark);
  background: var(--brand-soft);
}

.nav-icon {
  display: grid;
  place-items: center;
  width: 23px;
  height: 23px;
  border-radius: 7px;
  background: #edf2f7;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.side-menu button.active .nav-icon {
  color: #fff;
  background: var(--brand);
}

.side-data-note {
  margin: 28px 10px 0;
  padding: 14px;
  border: 1px solid #d9edf1;
  border-radius: 13px;
  background: #f2fbfc;
}

.side-data-note strong {
  display: block;
  font-size: 12px;
}

.side-data-note p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
}

.page-content {
  min-width: 0;
  flex: 1;
  overflow: auto;
  padding: 38px clamp(20px, 4vw, 64px) 56px;
}

.page-stage {
  width: min(100%, 1180px);
  min-height: 100%;
  margin: 0 auto;
}

.eyebrow {
  margin-bottom: 6px;
  color: var(--brand);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
}

.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

.page-heading h1 {
  font-size: 29px;
  line-height: 1.15;
  letter-spacing: -0.035em;
}

.page-heading > div > p:last-child {
  margin-top: 7px;
  color: var(--muted);
  font-size: 13px;
}

.heading-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.content-panel {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--paper);
}

.content-panel + .content-panel,
.auth-editor-list > .content-panel + .content-panel {
  margin-top: 16px;
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding: 17px 20px;
  border-bottom: 1px solid var(--line);
}

.panel-heading h2 {
  color: var(--ink);
  font-size: 14px;
}

.panel-heading p,
.panel-heading > span,
.updated-text {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}

.panel-heading .heading-count {
  display: inline-grid;
  place-items: center;
  min-width: 21px;
  height: 21px;
  margin-left: 3px;
  padding: 0 5px;
  border-radius: 99px;
  color: var(--brand-dark);
  background: var(--brand-soft);
  font-size: 10px;
}

.panel-body {
  padding: 20px;
}

.primary-btn,
.soft-btn,
.danger-btn {
  height: 36px;
  border-radius: 9px;
  font-weight: 700;
}

.primary-btn.el-button {
  border-color: var(--brand);
  background: var(--brand);
}

.primary-btn.el-button:hover {
  border-color: var(--brand-dark);
  background: var(--brand-dark);
}

.soft-btn.el-button {
  border-color: #cfe8eb;
  color: var(--brand-dark);
  background: var(--brand-soft);
}

.soft-btn.el-button:hover {
  border-color: #abd2da;
  color: var(--brand-dark);
  background: #dceff2;
}

.danger-btn.el-button {
  border-color: #f0caca;
  color: var(--red);
  background: #fff8f8;
}

.danger-btn.el-button:hover {
  border-color: #df9b9b;
  color: #a33d3d;
  background: var(--red-soft);
}

.full-btn,
.full-select {
  width: 100%;
}

.home-page {
  max-width: 980px;
  margin: 0 auto;
}

.welcome-panel {
  position: relative;
  overflow: hidden;
  margin-bottom: 18px;
  padding: 27px 28px 25px;
  border-radius: 17px;
  color: #fff;
  background: linear-gradient(120deg, #0f5d76, #218aa0);
}

.welcome-panel::after {
  position: absolute;
  top: -54px;
  right: -30px;
  width: 190px;
  height: 190px;
  border: 28px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  content: "";
}

.welcome-copy,
.home-search {
  position: relative;
  z-index: 1;
}

.welcome-copy > span {
  opacity: 0.76;
  font-size: 11px;
}

.welcome-copy h1 {
  margin: 7px 0 9px;
  color: #fff;
  font-size: 27px;
  letter-spacing: -0.035em;
}

.welcome-copy p {
  opacity: 0.83;
  font-size: 12px;
}

.home-search {
  display: flex;
  gap: 8px;
  margin-top: 19px;
}

.home-search .el-input {
  max-width: 520px;
}

.home-search .el-input__wrapper {
  box-shadow: none;
}

.search-btn.el-button {
  border: 0;
  color: #503612;
  background: #f6c36a;
  font-weight: 800;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.stat-card {
  padding: 17px 19px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--paper);
}

.stat-card span,
.stat-card small {
  color: var(--muted);
  font-size: 11px;
}

.stat-card strong {
  display: block;
  margin: 7px 0 3px;
  color: var(--brand-dark);
  font-size: 25px;
  letter-spacing: -0.04em;
}

.feature-panel .panel-heading {
  padding-bottom: 14px;
}

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

.feature-card {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 86px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}

.feature-card:hover {
  border-color: #abd2da;
  box-shadow: 0 6px 18px rgba(23, 107, 135, 0.08);
  transform: translateY(-1px);
}

.feature-icon {
  display: grid;
  place-items: center;
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  font-size: 17px;
}

.feature-icon.teal { color: var(--brand-dark); background: var(--brand-soft); }
.feature-icon.orange { color: #b75d2c; background: var(--orange-soft); }
.feature-icon.purple { color: #5d4bb5; background: var(--purple-soft); }
.feature-icon.green { color: #267557; background: var(--green-soft); }

.feature-card > span:nth-child(2) {
  min-width: 0;
  flex: 1;
}

.feature-card strong,
.feature-card small {
  display: block;
}

.feature-card strong {
  font-size: 13px;
}

.feature-card small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}

.row-arrow {
  flex: 0 0 auto;
  color: #a8b7c6;
}

.directory-toolbar,
.admin-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 20px 13px;
}

.directory-toolbar .el-input,
.admin-toolbar > .el-input {
  max-width: 480px;
}

.result-count {
  margin-left: auto;
  color: var(--muted);
  font-size: 11px;
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.directory-toolbar + .filter-row,
.admin-toolbar .filter-row {
  padding: 0 20px 18px;
}

.admin-toolbar .filter-row {
  padding: 0;
}

.filter-chip {
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
}

.filter-chip:hover,
.filter-chip.active {
  border-color: #b8dde4;
  color: var(--brand-dark);
  background: var(--brand-soft);
}

.region-browser {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  min-height: 430px;
  border-top: 1px solid var(--line);
}

.region-list {
  overflow-y: auto;
  padding: 12px 10px 20px;
  border-right: 1px solid var(--line);
  background: #f8fafc;
}

.region-block + .region-block {
  margin-top: 13px;
}

.region-label {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 5px 8px 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.region-label span {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 6px;
  color: var(--brand);
  background: var(--brand-soft);
  font-size: 10px;
}

.province-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 9px 9px 9px 35px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  text-align: left;
  font-size: 12px;
}

.province-btn:hover,
.province-btn.active {
  color: var(--brand-dark);
  background: #fff;
  box-shadow: 0 2px 8px rgba(16, 42, 67, 0.06);
}

.province-btn small {
  min-width: 23px;
  padding: 2px 5px;
  border-radius: 99px;
  color: var(--muted);
  background: #f0f4f8;
  text-align: center;
  font-size: 10px;
}

.place-list {
  min-width: 0;
  overflow-y: auto;
  padding-bottom: 20px;
  background: #fff;
}

.place-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 17px 20px 11px;
  color: var(--muted);
  font-size: 11px;
}

.place-heading strong {
  color: var(--ink);
  font-size: 14px;
}

.city-row,
.district-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 13px;
  width: 100%;
  min-height: 56px;
  padding: 9px 20px;
  border: 0;
  border-bottom: 1px solid #edf1f5;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}

.city-row:hover,
.district-row:hover {
  background: #f8fbfc;
}

.city-row strong,
.city-row small,
.district-row span,
.district-row small {
  display: block;
}

.city-row strong {
  font-size: 13px;
}

.city-row small,
.district-row small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
}

.district-row {
  min-height: 45px;
  padding-left: 36px;
  background: #f8fafc;
}

.district-row span {
  font-size: 12px;
}

.nested-place-list {
  border-bottom: 1px solid #edf1f5;
  background: #f8fafc;
}

.hospital-list {
  display: grid;
  gap: 9px;
}

.hospital-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  width: 100%;
  padding: 15px 17px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}

.hospital-row:hover {
  border-color: #abd2da;
  box-shadow: 0 5px 15px rgba(23, 107, 135, 0.08);
}

.hospital-row.compact {
  border: 0;
  border-radius: 0;
  border-bottom: 1px solid rgba(217, 226, 236, 0.8);
  padding: 12px 20px 12px 48px;
  background: #f8fafc;
}

.hospital-row.compact:hover {
  background: #f1f8fa;
  box-shadow: none;
}

.nested-hospital {
  padding-left: 64px !important;
}

.hospital-row-copy {
  display: block;
  min-width: 0;
  flex: 1;
}

.hospital-row-copy strong,
.hospital-row-copy > small {
  display: block;
}

.hospital-row-copy strong {
  overflow: hidden;
  font-size: 14px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hospital-row-copy > small {
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 8px;
}

.type-chip,
.status-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 22px;
  padding: 3px 8px;
  border-radius: 6px;
  color: var(--muted);
  background: #f0f4f8;
  font-size: 10px;
  font-style: normal;
  font-weight: 700;
  white-space: nowrap;
}

.type-chip.public,
.type-chip.brand,
.status-chip.agreement {
  color: #267557;
  background: var(--green-soft);
}

.type-chip.private,
.status-chip.preliminary {
  color: #b75d2c;
  background: var(--orange-soft);
}

.type-chip.none,
.status-chip.none {
  color: var(--muted);
  background: #edf1f5;
}

.status-chip.brand {
  color: var(--brand-dark);
  background: var(--brand-soft);
}

.inline-empty {
  padding: 35px 20px;
  color: var(--muted);
  text-align: center;
  font-size: 12px;
}

.detail-hero {
  display: flex;
  align-items: flex-start;
  gap: 15px;
  margin-bottom: 16px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
}

.hospital-emblem {
  display: grid;
  place-items: center;
  flex: 0 0 54px;
  width: 54px;
  height: 54px;
  border-radius: 15px;
  color: var(--brand-dark);
  background: linear-gradient(135deg, #dff4f7, #b8dfe6);
  font-size: 22px;
  font-weight: 900;
}

.detail-identity {
  min-width: 0;
  flex: 1;
}

.detail-identity h2 {
  font-size: 21px;
  line-height: 1.28;
}

.detail-identity p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
}

.detail-identity .status-chip {
  margin-top: 10px;
}

.detail-stat {
  min-width: 95px;
  color: var(--muted);
  text-align: right;
  font-size: 11px;
}

.detail-stat strong {
  display: block;
  color: var(--brand-dark);
  font-size: 21px;
}

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

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

.info-grid > div {
  padding: 15px 20px;
  border-bottom: 1px solid var(--line);
}

.info-grid > div:nth-child(odd) {
  border-right: 1px solid var(--line);
}

.info-grid > div:nth-last-child(-n + 2) {
  border-bottom: 0;
}

.info-grid span:not(.type-chip) {
  display: block;
  color: var(--muted);
  font-size: 10px;
}

.info-grid strong {
  display: block;
  margin-top: 5px;
  font-size: 13px;
  line-height: 1.45;
}

.auth-summary-list,
.auth-editor-list,
.entity-list {
  display: grid;
}

.auth-summary-row,
.auth-editor-row,
.entity-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  min-height: 55px;
  padding: 10px 20px;
  border-bottom: 1px solid #edf1f5;
}

.auth-summary-row:last-child,
.auth-editor-row:last-child,
.entity-row:last-child {
  border-bottom: 0;
}

.auth-summary-row strong,
.auth-editor-row strong,
.entity-row strong {
  font-size: 13px;
}

.auth-list-panel .panel-heading {
  padding-bottom: 13px;
}

.auth-editor-card {
  margin-bottom: 12px;
}

.auth-picker {
  display: flex;
  width: 100%;
  padding: 15px 20px 20px;
}

.auth-picker .el-radio-button {
  flex: 1;
}

.auth-picker .el-radio-button__inner {
  width: 100%;
  padding: 9px 6px;
  font-size: 11px;
}

.save-bar {
  position: sticky;
  bottom: 0;
  z-index: 3;
  padding: 15px 0 2px;
  background: linear-gradient(180deg, rgba(244, 247, 251, 0), var(--bg) 28%);
}

.admin-grid {
  display: grid;
  grid-template-columns: minmax(260px, 340px) minmax(0, 1fr);
  align-items: start;
  gap: 16px;
}

.form-panel {
  padding-bottom: 20px;
}

.form-panel > .el-form,
.wide-form > .el-form {
  padding: 20px;
}

.wide-form {
  max-width: 980px;
}

.entity-main {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

.entity-avatar {
  width: 34px;
  height: 34px;
  background: var(--brand-soft);
}

.entity-main strong,
.entity-main small,
.entity-row > div > strong,
.entity-row > div > small {
  display: block;
}

.entity-row small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
}

.entity-actions,
.admin-row-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex-wrap: wrap;
}

.entity-actions .el-select {
  width: 118px;
}

.hospital-admin-panel {
  padding-bottom: 8px;
}

.admin-toolbar {
  align-items: flex-start;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--line);
}

.admin-toolbar .filter-row {
  margin-left: auto;
  padding-top: 1px;
}

.admin-hospital-list {
  display: grid;
}

.admin-hospital-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 16px;
  padding: 15px 20px;
  border-bottom: 1px solid #edf1f5;
}

.admin-hospital-row:last-child {
  border-bottom: 0;
}

.admin-hospital-main {
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}

.admin-hospital-main strong,
.admin-hospital-main span {
  display: block;
}

.admin-hospital-main strong {
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-hospital-main span {
  margin-top: 5px;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

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

.form-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 7px;
  padding-top: 19px;
  border-top: 1px solid var(--line);
}

.form-dialog {
  border-radius: 14px;
  box-shadow: 0 18px 50px rgba(16, 42, 67, 0.18);
}

.form-dialog .el-dialog__header {
  margin-right: 0;
  padding: 16px 20px 12px;
  border-bottom: 1px solid var(--line);
}

.form-dialog .el-dialog__title {
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
  line-height: 24px;
}

.form-dialog .el-dialog__headerbtn {
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
}

.form-dialog .el-dialog__close {
  color: var(--muted);
  font-size: 16px;
}

.form-dialog .el-dialog__close:hover {
  color: var(--ink);
}

.form-dialog .el-dialog__body {
  padding: 16px 20px 8px;
}

.form-dialog .el-form-item {
  margin-bottom: 14px;
}

.form-dialog .el-form-item:last-child {
  margin-bottom: 0;
}

.form-dialog .el-form-item__label {
  display: block;
  width: 100% !important;
  height: auto;
  margin-bottom: 6px;
  padding: 0;
  justify-content: flex-start;
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
  text-align: left;
}

.form-dialog .el-dialog__footer {
  padding: 12px 20px 16px;
  border-top: 1px solid var(--line);
}

.form-dialog .el-dialog__footer .el-button {
  min-width: 88px;
  height: 36px;
}

.hospital-form-dialog {
  max-width: min(720px, calc(100vw - 32px));
}

.hospital-form-dialog .el-dialog__body {
  max-height: min(68vh, 640px);
  overflow-y: auto;
}

.required-mark {
  color: var(--orange);
}

.login-page {
  display: grid;
  place-items: center;
  min-height: calc(100dvh - 160px);
}

.login-shell {
  width: min(100%, 410px);
}

.login-intro {
  margin-bottom: 16px;
  padding: 23px 25px;
  border-radius: 17px;
  color: #fff;
  background: linear-gradient(120deg, #0f5d76, #218aa0);
}

.login-intro .login-mark {
  margin-bottom: 15px;
  color: var(--brand-dark);
  background: #d8eef2;
}

.login-intro .eyebrow {
  margin-bottom: 6px;
  color: rgba(255, 255, 255, 0.74);
}

.login-intro h1 {
  color: #fff;
  font-size: 26px;
}

.login-intro > p:last-child {
  margin-top: 8px;
  opacity: 0.82;
  font-size: 12px;
}

.login-panel {
  padding: 22px;
}

.login-panel .el-form-item {
  margin-bottom: 16px;
}

.login-note {
  margin-top: 13px;
  color: var(--muted);
  text-align: center;
  font-size: 10px;
}

.page-loading {
  padding-top: 8px;
}

.state-empty {
  padding: 70px 0;
}

.el-input__wrapper,
.el-select__wrapper {
  min-height: 38px;
  border-radius: 9px;
  box-shadow: 0 0 0 1px var(--line) inset;
}

.el-input__wrapper:hover,
.el-select__wrapper:hover {
  box-shadow: 0 0 0 1px #abd2da inset;
}

.el-input__wrapper.is-focus,
.el-select__wrapper.is-focused {
  box-shadow: 0 0 0 1px var(--brand) inset, 0 0 0 3px rgba(23, 107, 135, 0.1);
}

.el-form-item {
  margin-bottom: 16px;
}

.el-form-item__label {
  height: auto;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.2;
}

.el-button {
  font-size: 12px;
}

.el-empty {
  padding: 38px 0;
}

.el-descriptions {
  border-radius: 16px;
}

@media (max-width: 900px) {
  .appbar {
    padding: 0 22px;
  }

  .appbar-account {
    min-width: auto;
  }

  .account-copy {
    display: none;
  }

  .side-nav {
    width: 190px;
  }

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

  .form-panel {
    max-width: none;
  }
}

@media (max-width: 680px) {
  .appbar {
    position: sticky;
    gap: 12px;
    height: 60px;
    padding: 0 16px;
  }

  .brand-lockup {
    min-width: auto;
  }

  .brand-copy small,
  .appbar-nav {
    display: none;
  }

  .brand-copy strong {
    font-size: 14px;
  }

  .mobile-page-title {
    display: grid;
    min-width: 0;
    flex: 1;
    text-align: center;
  }

  .mobile-page-title span {
    overflow: hidden;
    color: var(--muted);
    font-size: 9px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-page-title strong {
    overflow: hidden;
    font-size: 14px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .appbar-account {
    flex: 0 0 auto;
  }

  .appbar-logout {
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
    margin-left: 6px;
  }

  .app-body {
    display: block;
    min-height: calc(100dvh - 60px);
  }

  .side-nav {
    display: none;
  }

  .page-content {
    padding: 20px 16px 34px;
  }

  .mobile-back-row {
    display: block;
    margin-bottom: 14px;
  }

  .back-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 0;
    border: 0;
    color: var(--brand);
    background: transparent;
    cursor: pointer;
    font-size: 12px;
    font-weight: 700;
  }

  .page-heading {
    align-items: flex-start;
    margin-bottom: 18px;
  }

  .page-heading h1 {
    font-size: 24px;
  }

  .heading-actions {
    flex: 0 0 auto;
  }

  .welcome-panel {
    padding: 21px 20px;
  }

  .welcome-copy h1 {
    font-size: 23px;
  }

  .home-search {
    display: grid;
    grid-template-columns: 1fr auto;
  }

  .home-search .el-input {
    max-width: none;
  }

  .stat-grid {
    gap: 7px;
  }

  .stat-card {
    padding: 13px 10px;
  }

  .stat-card strong {
    font-size: 19px;
  }

  .stat-card span,
  .stat-card small {
    font-size: 9px;
  }

  .feature-grid {
    grid-template-columns: 1fr;
    padding: 14px;
  }

  .directory-toolbar,
  .admin-toolbar {
    display: grid;
    align-items: stretch;
    padding: 15px 15px 11px;
  }

  .directory-toolbar .el-input,
  .admin-toolbar > .el-input {
    max-width: none;
  }

  .result-count {
    margin-left: 0;
  }

  .directory-toolbar + .filter-row {
    padding: 0 15px 15px;
  }

  .admin-toolbar .filter-row {
    padding: 0;
  }

  .region-browser {
    grid-template-columns: 102px minmax(0, 1fr);
    min-height: 500px;
  }

  .region-list {
    padding: 10px 6px 18px;
  }

  .province-btn {
    padding-left: 10px;
  }

  .region-label {
    padding-left: 5px;
    font-size: 10px;
  }

  .region-label span {
    display: none;
  }

  .place-heading,
  .city-row {
    padding-left: 13px;
    padding-right: 13px;
  }

  .hospital-row.compact {
    padding-left: 15px;
    padding-right: 13px;
  }

  .nested-hospital {
    padding-left: 27px !important;
  }

  .hospital-row-copy strong {
    font-size: 13px;
    white-space: normal;
  }

  .detail-hero {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    padding: 17px;
  }

  .detail-stat {
    grid-column: 2;
    text-align: left;
  }

  .detail-identity h2 {
    font-size: 18px;
  }

  .panel-heading {
    align-items: flex-start;
    padding: 15px;
  }

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

  .info-grid > div,
  .info-grid > div:nth-child(odd) {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .info-grid > div:last-child {
    border-bottom: 0;
  }

  .auth-summary-row,
  .auth-editor-row,
  .entity-row {
    align-items: flex-start;
    padding: 12px 15px;
  }

  .entity-row,
  .admin-hospital-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .entity-actions,
  .admin-row-actions {
    justify-content: flex-start;
  }

  .admin-hospital-row {
    padding: 14px 15px;
  }

  .desktop-tags {
    display: none;
  }

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

  .form-field-full {
    grid-column: auto;
  }

  .form-panel > .el-form,
  .wide-form > .el-form,
  .login-panel {
    padding: 15px;
  }

  .form-footer {
    justify-content: stretch;
  }

  .form-footer .el-button {
    flex: 1;
  }

  .form-dialog {
    width: calc(100vw - 32px) !important;
    margin: 0 auto;
  }

  .form-dialog .el-dialog__footer .el-button {
    min-width: 0;
  }

  .auth-picker {
    padding: 13px 15px 15px;
  }

  .auth-picker .el-radio-button__inner {
    padding-left: 3px;
    padding-right: 3px;
    font-size: 10px;
  }

  .login-page {
    min-height: calc(100dvh - 120px);
  }

  .login-shell {
    width: 100%;
  }
}

@media (max-width: 380px) {
  .home-search {
    grid-template-columns: 1fr;
  }

  .search-btn.el-button {
    width: 100%;
  }

  .stat-card small {
    display: none;
  }
}
