:root {
  --medical-blue: #2f6bff;
  --medical-blue-soft: #eef4ff;
  --medical-green: #2f9e8f;
  --medical-green-soft: #eaf8f5;
  --surface-panel: rgba(255, 255, 255, 0.94);
  --text-main: #16324f;
  --text-secondary: rgba(22, 50, 79, 0.68);
  --border-soft: rgba(49, 80, 111, 0.12);
  --warning-text: #b56900;
  --shadow-soft: 0 18px 48px rgba(33, 65, 99, 0.08);
}

html {
  font-size: 16px;
  min-height: 100%;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--text-main);
  background:
    radial-gradient(circle at top right, rgba(47, 107, 255, 0.14), transparent 28%),
    linear-gradient(180deg, #f4f7fb 0%, #edf4f6 100%);
}

.login-body {
  overflow: auto;
}

a {
  color: inherit;
  text-decoration: none;
}

.admin-body {
  overflow: auto;
}

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

.admin-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 280px;
  display: flex;
  flex-direction: column;
  padding: 24px 18px 20px;
  background: rgba(16, 35, 56, 0.96);
  color: rgba(255, 255, 255, 0.92);
  box-shadow: 20px 0 50px rgba(17, 34, 52, 0.14);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 8px 8px 18px;
}

.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-size: 1.125rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #2f6bff, #2f9e8f);
}

.brand-title {
  font-size: 1rem;
  font-weight: 700;
}

.brand-subtitle {
  margin-top: 4px;
  font-size: 0.8125rem;
  color: rgba(255, 255, 255, 0.62);
}

.sidebar-section-title {
  padding: 20px 12px 10px;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.5);
}

.nav-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 12px;
}

.nav-item {
  display: flex;
  align-items: center;
  width: 100%;
  gap: 12px;
  padding: 13px 14px;
  border: 0;
  background: transparent;
  border-radius: 16px;
  text-align: left;
  color: rgba(255, 255, 255, 0.76);
  cursor: pointer;
  appearance: none;
  transition: background-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.nav-item:hover,
.nav-item.active {
  color: #fff;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.08));
}

.nav-item:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.42);
  outline-offset: 2px;
}

.nav-item.active {
  box-shadow: inset 3px 0 0 #7fb0ff;
}

.nav-item > span:last-child {
  flex: 1;
  min-width: 0;
  font-size: 0.95rem;
  font-weight: 600;
}

.nav-item-icon {
  width: 10px;
  height: 10px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(47, 107, 255, 0.92), rgba(47, 158, 143, 0.92));
  box-shadow: 0 0 0 5px rgba(47, 107, 255, 0.12);
}

.sidebar-footer {
  margin-top: auto;
  padding: 18px 8px 0;
}

.status-card {
  padding: 16px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.status-card-label {
  font-size: 0.8125rem;
  color: rgba(255, 255, 255, 0.62);
}

.status-card-value {
  margin-top: 8px;
  font-size: 1rem;
  font-weight: 700;
}

.status-card-caption {
  margin-top: 8px;
  font-size: 0.875rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.72);
}

.main-shell {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 24px 28px 18px;
}

.topbar-title {
  font-size: 1.5rem;
  font-weight: 700;
}

.topbar-subtitle {
  margin-top: 6px;
  color: var(--text-secondary);
  font-size: 0.9375rem;
}

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

.toolbar-chip {
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--border-soft);
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.admin-identity {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px 8px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--border-soft);
}

.admin-avatar {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  font-size: 0.9375rem;
  font-weight: 600;
  background: linear-gradient(135deg, #2f6bff, #2f9e8f);
}

.admin-identity-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.admin-identity-name {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--text-main);
}

.admin-identity-account {
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

.logout-form {
  margin: 0;
}

.logout-button {
  min-width: 96px;
}

.content-shell {
  flex: 1;
  overflow: visible;
  padding: 0 28px 28px;
}

.admin-modal .modal-content {
  border: 0;
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 24px 64px rgba(21, 48, 77, 0.18);
}

.admin-modal .modal-header,
.admin-modal .modal-footer {
  padding: 20px 24px;
  border-color: rgba(49, 80, 111, 0.08);
}

.admin-modal .modal-body {
  padding: 24px;
}

.admin-modal .modal-title {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-main);
}

.modal-subtitle {
  margin-top: 6px;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.config-modal .modal-dialog {
  max-width: 1120px;
}

.config-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

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

.summary-card {
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid rgba(47, 107, 255, 0.12);
  background: linear-gradient(180deg, rgba(244, 248, 255, 0.9), rgba(255, 255, 255, 0.98));
}

.summary-label {
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

.summary-value {
  margin-top: 8px;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-main);
  word-break: break-word;
}

.config-description {
  margin-top: 16px;
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid rgba(49, 80, 111, 0.08);
  background: rgba(244, 247, 251, 0.9);
  color: var(--text-secondary);
  line-height: 1.7;
}

.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
}

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

.login-card {
  border-radius: 30px;
  box-shadow: var(--shadow-soft);
}

.login-card {
  padding: 34px 30px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(47, 107, 255, 0.12);
}

.login-card-header {
  margin-bottom: 24px;
}

.login-card-title {
  margin: 0;
  font-size: 1.375rem;
  font-weight: 700;
  text-align: center;
}

.login-submit {
  min-height: 48px;
}

.login-submit {
  margin-top: 4px;
}

.slider-captcha {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  border-radius: 22px;
  border: 1px solid rgba(47, 107, 255, 0.12);
  background: linear-gradient(180deg, rgba(244, 247, 251, 0.82), rgba(255, 255, 255, 0.95));
}

.slider-captcha-stage {
  position: relative;
  min-height: 88px;
  overflow: hidden;
  border-radius: 20px;
  background: rgba(227, 238, 252, 0.42);
  border: 1px solid rgba(47, 107, 255, 0.12);
}

.slider-captcha-track svg,
.slider-captcha-piece svg {
  display: block;
}

.slider-captcha-piece {
  position: absolute;
  top: 18px;
  left: 0;
  width: 52px;
  height: 52px;
  filter: drop-shadow(0 8px 14px rgba(22, 50, 79, 0.18));
  will-change: transform;
}

.slider-captcha-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.slider-captcha-tip {
  min-height: 24px;
  color: var(--text-secondary);
  font-size: 0.875rem;
  line-height: 1.7;
}

.slider-captcha-tip[data-status="success"] {
  color: #2e8b57;
}

.slider-captcha-tip[data-status="danger"] {
  color: #c0364f;
}

.slider-captcha-refresh {
  min-width: 92px;
  padding-top: 8px;
  padding-bottom: 8px;
  font-size: 0.875rem;
}

.slider-captcha-rail {
  position: relative;
  display: flex;
  align-items: center;
  height: 52px;
  padding: 0 14px;
  overflow: hidden;
  border-radius: 999px;
  border: 1px solid rgba(47, 107, 255, 0.16);
  background: rgba(234, 244, 252, 0.92);
}

.slider-captcha-progress {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(47, 107, 255, 0.16), rgba(47, 158, 143, 0.18));
  transition: width 0.12s ease;
}

.slider-captcha-rail.is-verified {
  border-color: rgba(46, 139, 87, 0.34);
  background: rgba(233, 247, 239, 0.96);
}

.slider-captcha-rail.is-failed {
  border-color: rgba(217, 72, 95, 0.3);
  background: rgba(252, 240, 243, 0.96);
}

.slider-captcha-rail-text {
  position: relative;
  z-index: 1;
  width: 100%;
  text-align: center;
  color: rgba(22, 50, 79, 0.62);
  font-size: 0.9375rem;
  user-select: none;
  pointer-events: none;
}

.slider-captcha-button {
  position: absolute;
  top: 5px;
  left: 5px;
  z-index: 2;
  width: 42px;
  height: 42px;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, #2f6bff, #2f9e8f);
  box-shadow: 0 10px 24px rgba(47, 107, 255, 0.22);
  touch-action: none;
  cursor: grab;
  transition: box-shadow 0.16s ease, transform 0.12s ease;
}

.slider-captcha-button:disabled {
  cursor: default;
}

.slider-captcha-button.is-verified {
  background: linear-gradient(135deg, #2f9e8f, #4fb687);
}

.slider-captcha-button-line {
  width: 14px;
  height: 2px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.95);
}

.error-page-card {
  margin-top: 28px;
}

.state-page-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 18px;
}

.state-page-code {
  font-size: 3.5rem;
  line-height: 1;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: rgba(47, 107, 255, 0.82);
}

.state-page-title {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
}

.state-page-copy {
  max-width: 720px;
  margin: 0;
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1.8;
}

.state-page-request {
  width: 100%;
}

.state-page-shell {
  align-items: center;
}

.state-page-standalone {
  width: min(720px, 100%);
  margin-top: 0;
  padding: 34px 30px;
}

.form-card-shell {
  max-width: 560px;
}

.dashboard-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(280px, 0.9fr);
  gap: 20px;
  padding: 28px;
  border-radius: 28px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.95), rgba(234, 244, 252, 0.92));
  border: 1px solid rgba(47, 107, 255, 0.1);
  box-shadow: var(--shadow-soft);
}

.hero-tag {
  display: inline-flex;
  padding: 8px 14px;
  border-radius: 999px;
  color: var(--medical-blue);
  background: var(--medical-blue-soft);
  font-size: 0.875rem;
  font-weight: 600;
}

.dashboard-title {
  margin: 18px 0 0;
  font-size: 2rem;
  line-height: 1.35;
  font-weight: 700;
}

.dashboard-desc {
  max-width: 760px;
  margin: 14px 0 0;
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1.8;
}

.hero-side-card {
  padding: 22px;
  border-radius: 24px;
  background: rgba(22, 50, 79, 0.92);
  color: rgba(255, 255, 255, 0.92);
}

.hero-side-label {
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.62);
}

.hero-side-value {
  margin-top: 12px;
  font-size: 1.5rem;
  line-height: 1.45;
  font-weight: 700;
}

.hero-side-note {
  margin-top: 10px;
  font-size: 0.9375rem;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.72);
}

.stats-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  margin-top: 20px;
}

.stats-row.single-row {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 0;
  margin-bottom: 20px;
}

.metric-card {
  padding: 22px;
  border-radius: 24px;
  background: var(--surface-panel);
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow-soft);
}

.metric-card.primary {
  background: linear-gradient(145deg, rgba(47, 107, 255, 0.95), rgba(58, 135, 255, 0.9));
  color: #fff;
}

.metric-card.warning {
  background: linear-gradient(145deg, #fff8ea, #fff3d6);
}

.metric-label {
  font-size: 0.875rem;
  color: inherit;
  opacity: 0.72;
}

.metric-value {
  margin-top: 14px;
  font-size: 2rem;
  line-height: 1.1;
  font-weight: 700;
}

.metric-note {
  margin-top: 12px;
  font-size: 0.9375rem;
  line-height: 1.7;
  color: inherit;
  opacity: 0.78;
}

.metric-card.warning .metric-label,
.metric-card.warning .metric-note,
.metric-card.warning .metric-value {
  color: var(--warning-text);
  opacity: 1;
}

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

.panel-card {
  padding: 24px;
  border-radius: 28px;
  background: var(--surface-panel);
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow-soft);
}

.table {
  width: 100%;
  border-collapse: collapse;
}

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

.dashboard-grid.compact-grid {
  margin-top: 20px;
}

.form-layout {
  align-items: start;
}

.nested-panel {
  box-shadow: none;
  background: rgba(255, 255, 255, 0.72);
}

.panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.panel-title {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 700;
}

.panel-subtitle {
  margin: 8px 0 0;
  color: var(--text-secondary);
  font-size: 0.9375rem;
  line-height: 1.7;
}

.panel-badge {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--medical-green-soft);
  color: var(--medical-green);
  font-size: 0.8125rem;
  font-weight: 600;
  white-space: nowrap;
}

.task-list,
.timeline-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.task-item,
.timeline-item,
.compliance-item,
.module-item {
  padding: 18px;
  border-radius: 20px;
  background: rgba(244, 247, 251, 0.82);
  border: 1px solid rgba(49, 80, 111, 0.08);
}

.task-name,
.timeline-title,
.compliance-title,
.module-name {
  font-size: 1rem;
  font-weight: 700;
}

.task-desc,
.timeline-desc,
.compliance-desc,
.module-copy {
  margin-top: 8px;
  color: var(--text-secondary);
  font-size: 0.9375rem;
  line-height: 1.7;
}

.timeline-item {
  display: flex;
  gap: 14px;
}

.timeline-dot {
  width: 12px;
  height: 12px;
  margin-top: 7px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: linear-gradient(135deg, #2f6bff, #2f9e8f);
}

.timeline-dot.danger {
  background: linear-gradient(135deg, #d9485f, #f08a5d);
}

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

.module-link {
  display: block;
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}

.module-link:hover {
  transform: translateY(-2px);
  border-color: rgba(47, 107, 255, 0.24);
  background: rgba(238, 244, 255, 0.86);
}

.dashboard-inline-alert {
  margin-bottom: 0;
}

.toolbar-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.toolbar-meta {
  color: var(--text-secondary);
  font-size: 0.9375rem;
  line-height: 1.7;
}

.action-button {
  padding: 10px 16px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, #2f6bff, #2f9e8f);
  color: #fff;
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
}

.action-button:disabled,
.secondary-button:disabled,
.danger-button:disabled {
  cursor: not-allowed;
  opacity: 0.68;
  filter: saturate(0.72);
}

.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid var(--border-soft);
  background: rgba(255, 255, 255, 0.82);
  color: var(--text-main);
  font-size: 0.9375rem;
  font-weight: 600;
}

.button-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.admin-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.admin-filter-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  align-items: end;
  margin-bottom: 18px;
  padding: 16px;
  border-radius: 22px;
  background: rgba(245, 248, 252, 0.78);
  border: 1px solid rgba(49, 80, 111, 0.08);
}

.admin-filter-form .filter-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  min-width: 0;
}

.form-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.form-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-main);
}

.form-label.required::after {
  content: " *";
  color: #c0364f;
  font-weight: 700;
}

.field-hint {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.form-help {
  color: var(--text-secondary);
  font-size: 0.8125rem;
  line-height: 1.6;
}

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

.checkbox-line {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  background: rgba(244, 247, 251, 0.72);
  color: var(--text-main);
  font-size: 0.9375rem;
}

.empty-inline-text {
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(244, 247, 251, 0.72);
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.cover-editor-shell {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cover-editor-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.upload-progress {
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(245, 248, 252, 0.86);
  border: 1px solid rgba(49, 80, 111, 0.08);
}

.upload-progress-bar {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(22, 50, 79, 0.08);
}

.upload-progress-fill {
  width: 0;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #2f6bff, #2f9e8f);
  transition: width 0.16s ease;
}

.upload-progress-text {
  margin-top: 8px;
  color: var(--text-secondary);
  font-size: 0.8125rem;
}

.media-processing-panel {
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(244, 247, 251, 0.88);
  border: 1px solid rgba(49, 80, 111, 0.08);
}

.media-processing-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--text-primary);
  font-size: 0.9375rem;
  font-weight: 700;
}

.media-processing-meta {
  margin-top: 8px;
  color: var(--text-secondary);
  font-size: 0.875rem;
  line-height: 1.6;
}

.media-processing-actions {
  margin-top: 12px;
  display: flex;
  justify-content: flex-end;
}

.cover-upload-input {
  display: none;
}

.cover-preview-shell {
  padding: 14px;
  border: 1px dashed rgba(47, 107, 255, 0.18);
  border-radius: 22px;
  background: rgba(244, 247, 251, 0.82);
}

.cover-preview-card {
  position: relative;
  min-height: 220px;
  overflow: hidden;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(47, 107, 255, 0.12), rgba(47, 158, 143, 0.14));
}

.cover-preview-image {
  display: block;
  width: 100%;
  height: 220px;
  object-fit: cover;
}

.cover-preview-placeholder {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 18px;
  color: var(--text-main);
}

.cover-preview-badge {
  display: inline-flex;
  align-self: flex-start;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--medical-blue);
  font-size: 0.8125rem;
  font-weight: 700;
}

.cover-preview-title {
  margin-top: 18px;
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1.5;
}

.cover-preview-text {
  margin-top: 8px;
  color: var(--text-secondary);
  font-size: 0.875rem;
  line-height: 1.7;
}

.admin-input,
.admin-form .form-select,
.admin-filter-form .form-select {
  width: 100%;
  border-radius: 16px;
  border: 1px solid var(--border-soft);
  background: rgba(244, 247, 251, 0.84);
  padding: 12px 14px;
  color: var(--text-main);
  font-size: 0.9375rem;
}

.admin-input:focus,
.admin-form .form-select:focus,
.admin-filter-form .form-select:focus {
  border-color: rgba(47, 107, 255, 0.45);
  box-shadow: 0 0 0 0.2rem rgba(47, 107, 255, 0.12);
}

.admin-textarea {
  min-height: 110px;
  resize: vertical;
}

.feedback-banner {
  margin-bottom: 18px;
  padding: 14px 16px;
  border-radius: 18px;
  font-size: 0.9375rem;
  line-height: 1.7;
}

.feedback-banner.success {
  background: rgba(46, 139, 87, 0.12);
  color: #2e8b57;
}

.feedback-banner.danger {
  background: rgba(217, 72, 95, 0.12);
  color: #c0364f;
}

.feedback-banner.warning {
  background: rgba(229, 146, 0, 0.12);
  color: #b56900;
}

.validation-summary-errors {
  margin-bottom: 16px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(217, 72, 95, 0.1);
  color: #c0364f;
  font-size: 0.875rem;
}

.validation-summary-errors ul {
  margin: 0;
  padding-left: 18px;
}

.field-validation-error {
  display: inline-block;
  margin-top: 6px;
  color: #c0364f;
  font-size: 0.8125rem;
  line-height: 1.5;
}

.input-validation-error {
  border-color: rgba(217, 72, 95, 0.6) !important;
  box-shadow: 0 0 0 0.2rem rgba(217, 72, 95, 0.12) !important;
}

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

.compact-form {
  margin-top: 18px;
}

.form-fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.editor-form-card,
.editor-create-card {
  padding: 18px;
  border-radius: 22px;
  border: 1px solid rgba(49, 80, 111, 0.08);
}

.editor-form-card {
  background: rgba(255, 255, 255, 0.72);
}

.editor-create-card {
  background: rgba(238, 244, 255, 0.72);
  border-color: rgba(47, 107, 255, 0.16);
}

.checkbox-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding-top: 34px;
  color: var(--text-main);
  font-size: 0.9375rem;
}

.table-shell {
  overflow-x: auto;
}

.admin-tabs {
  display: inline-flex;
  gap: 6px;
  padding: 6px;
  margin: 0 0 18px;
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
}

.admin-tab-button {
  min-width: 92px;
  padding: 9px 18px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.9375rem;
  font-weight: 700;
  cursor: pointer;
}

.admin-tab-button.active {
  color: #fff;
  background: var(--medical-blue);
  box-shadow: 0 10px 20px rgba(47, 107, 255, 0.2);
}

.detail-tabs-shell {
  margin-top: 24px;
}

.detail-tabs-shell .admin-tabs {
  display: flex;
  width: max-content;
  max-width: 100%;
}

.user-detail-tab-panel[hidden] {
  display: none;
}

.organization-workspace {
  display: grid;
  grid-template-columns: minmax(280px, 34%) minmax(0, 1fr);
  gap: 18px;
  align-items: stretch;
}

.organization-tree-card,
.organization-detail-card {
  min-height: 420px;
  padding: 18px;
  border: 1px solid var(--border-soft);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.76);
}

.organization-tree-root {
  padding: 10px 12px;
  margin-bottom: 10px;
  border-radius: 14px;
  color: var(--medical-blue);
  background: rgba(47, 107, 255, 0.1);
  font-weight: 800;
}

.organization-tree-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.organization-tree-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.organization-tree-node {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 9px 10px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--text-main);
  text-align: left;
  cursor: pointer;
}

.organization-tree-node span:nth-child(2) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.organization-tree-node small {
  color: var(--text-secondary);
  font-size: 0.75rem;
}

.organization-tree-node:hover,
.organization-tree-node.active {
  background: rgba(47, 107, 255, 0.1);
}

.organization-tree-node.active {
  color: var(--medical-blue);
  font-weight: 800;
}

.organization-tree-children {
  margin-left: 22px;
  padding-left: 10px;
  border-left: 1px dashed rgba(49, 80, 111, 0.24);
}

.organization-tree-empty {
  padding: 8px 10px;
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.organization-detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.organization-detail-header h3 {
  margin: 4px 0 0;
  font-size: 1.35rem;
  font-weight: 800;
}

.detail-kicker {
  color: var(--text-secondary);
  font-size: 0.8125rem;
  font-weight: 700;
}

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

.detail-grid div {
  padding: 14px;
  border-radius: 16px;
  background: rgba(245, 248, 252, 0.86);
}

.detail-grid span {
  display: block;
  margin-bottom: 6px;
  color: var(--text-secondary);
  font-size: 0.8125rem;
}

.detail-grid strong {
  color: var(--text-main);
  font-size: 0.95rem;
}

.organization-detail-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.admin-table {
  margin: 0;
}

.admin-table thead th {
  padding: 0 0 14px;
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 600;
  border-bottom: 1px solid var(--border-soft);
}

.admin-table tbody td {
  padding: 18px 0;
  text-align: center;
  vertical-align: middle;
  font-size: 0.9375rem;
  border-bottom: 1px solid rgba(49, 80, 111, 0.08);
}

.admin-table .table-group-row td {
  padding: 12px 14px;
  text-align: left;
  color: var(--medical-blue);
  background: rgba(47, 107, 255, 0.08);
  border-bottom: 1px solid rgba(47, 107, 255, 0.12);
  font-weight: 700;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.8125rem;
  font-weight: 600;
}

.status-pill.success {
  background: rgba(46, 139, 87, 0.12);
  color: #2e8b57;
}

.status-pill.muted {
  background: rgba(49, 80, 111, 0.12);
  color: #4a6076;
}

.status-pill.info {
  background: rgba(47, 107, 255, 0.12);
  color: #2f6bff;
}

.status-pill.danger {
  background: rgba(217, 72, 95, 0.14);
  color: #d9485f;
}

.table-badges,
.table-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.text-link {
  color: var(--medical-blue);
  font-weight: 600;
}

.text-button {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--medical-blue);
  font-weight: 600;
  cursor: pointer;
}

.text-button.danger-link,
.danger-link {
  color: #d9485f;
}

.danger-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  border-radius: 999px;
  border: 0;
  background: #d9485f;
  color: #fff;
  font-size: 0.9375rem;
  font-weight: 600;
}

.inline-form {
  display: inline-flex;
}

.table-empty-cell {
  padding: 24px 0 !important;
  text-align: center;
  color: var(--text-secondary);
}

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

.modal-confirm-text {
  margin: 0;
  color: var(--text-main);
  line-height: 1.8;
}

.section-title {
  margin: 24px 0 12px;
  font-size: 1rem;
  font-weight: 800;
  color: var(--text-main);
}

.empty-state {
    padding: 16px 0;
    color: var(--text-secondary);
    text-align: center;
  }

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

.table-title {
    font-weight: 600;
    color: var(--text-primary);
}

.table-subtitle {
    margin-top: 6px;
    color: var(--text-secondary);
    font-size: 0.875rem;
    line-height: 1.5;
}

.color-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 32px;
}

.color-chip {
    width: 14px;
    height: 14px;
    border-radius: 999px;
    border: 1px solid rgba(22, 50, 79, 0.18);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
}

.split-panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.split-panel-title-group {
  min-width: 0;
}

.split-panel-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-main);
}

.split-panel-subtitle {
  margin-top: 6px;
  color: var(--text-secondary);
  font-size: 0.875rem;
  line-height: 1.6;
}

.child-admin-table {
  min-width: 100%;
}

.question-option-editor-panel {
  padding: 18px;
  border-radius: 22px;
  border: 1px solid rgba(49, 80, 111, 0.08);
  background: rgba(248, 251, 255, 0.78);
}

.stack-panel-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 22, 37, 0.3);
  opacity: 0;
  pointer-events: none;
}

.stack-panel-overlay.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.stack-panel {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 32px 20px;
}

.stack-panel.is-open {
  display: flex;
}

.stack-panel-dialog {
  width: min(100%, 680px);
  max-height: calc(100vh - 64px);
  display: flex;
  flex-direction: column;
  outline: 0;
}

.stack-panel-small .stack-panel-dialog {
  width: min(100%, 520px);
}

.stack-panel-medium .stack-panel-dialog {
  width: min(100%, 720px);
}

.stack-panel-large .stack-panel-dialog {
  width: min(100%, 900px);
}

.stack-panel-xlarge .stack-panel-dialog {
  width: min(100%, 1120px);
}

.stack-panel-content {
  display: flex;
  flex: 1;
  min-height: 0;
  flex-direction: column;
  border: 1px solid rgba(49, 80, 111, 0.12);
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 24px 64px rgba(21, 48, 77, 0.18);
  overflow: hidden;
  transform: none;
  opacity: 1;
}

.stack-panel.is-open .stack-panel-content {
  opacity: 1;
}

.stack-panel .modal-header,
.stack-panel .modal-footer {
  padding: 20px 24px;
  border-color: rgba(49, 80, 111, 0.08);
}

.stack-panel .modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  background: linear-gradient(180deg, rgba(244, 248, 255, 0.92), rgba(255, 255, 255, 0.98));
}

.stack-panel .modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  background: rgba(255, 255, 255, 0.98);
}

.stack-panel .modal-title {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-main);
}

.btn-close {
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  border: 0;
  border-radius: 999px;
  background: rgba(22, 50, 79, 0.08);
  color: var(--text-main);
  cursor: pointer;
  position: relative;
}

.btn-close::before,
.btn-close::after {
  content: "";
  position: absolute;
  top: 19px;
  left: 11px;
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
}

.btn-close::before {
  transform: rotate(45deg);
}

.btn-close::after {
  transform: rotate(-45deg);
}

.stack-panel .modal-subtitle {
  margin-top: 6px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.stack-panel .modal-body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 24px;
  background: rgba(255, 255, 255, 0.98);
}

.stack-panel .table-shell {
  padding-bottom: 2px;
}

.stack-panel .question-option-editor-panel {
  border-color: rgba(47, 107, 255, 0.12);
  background: linear-gradient(180deg, rgba(246, 250, 255, 0.96), rgba(252, 254, 255, 0.98));
}

.stack-panel .split-panel-header {
  margin-bottom: 18px;
}

.stack-panel .admin-table thead th {
  padding-top: 0;
}

.stack-panel .admin-table tbody tr:last-child td {
  border-bottom: 0;
}

.stack-panel .validation-summary-errors {
  margin-bottom: 0;
}

body.panel-stack-open {
  overflow: hidden;
}

@media (max-width: 1200px) {
  .stats-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-grid,
  .dashboard-hero {
    grid-template-columns: 1fr;
  }

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

}

@media (max-width: 992px) {
  .admin-shell {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
  }

  .content-shell {
    padding: 0 18px 18px;
  }

  .topbar {
    padding: 18px;
    flex-direction: column;
    align-items: flex-start;
  }

  .login-page {
    padding: 24px 16px;
  }

  .login-card {
    padding: 26px 22px;
  }

  .admin-modal .modal-header,
  .admin-modal .modal-body,
  .admin-modal .modal-footer {
    padding: 18px;
  }

  .stack-panel {
    padding: 20px 14px;
  }

  .stack-panel-dialog {
    max-height: calc(100vh - 40px);
  }
}

@media (max-width: 768px) {
  .stats-row,
  .stats-row.single-row,
  .module-grid,
  .compliance-grid {
    grid-template-columns: 1fr;
  }

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

  .cover-editor-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .config-summary-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-hero,
  .metric-card,
  .panel-card {
    padding: 20px;
  }

  .dashboard-title {
    font-size: 1.6rem;
  }

  .toolbar-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .checkbox-item {
    padding-top: 0;
  }
}
