:root {
  color-scheme: light;
  --bg: #f5f7fa;
  --panel: #ffffff;
  --line: #dbe3ea;
  --text: #1e2a32;
  --muted: #657582;
  --brand: #0b7f79;
  --brand-strong: #075f5b;
  --nav-bg: #ffffff;
  --nav-surface: #f7fafb;
  --nav-hover: #eef7f6;
  --nav-active: #e3f1f0;
  --nav-text: #33424c;
  --nav-muted: #667681;
  --amber: #c47b1e;
  --red: #bd3d35;
  --green: #277a46;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body.auth-gate-pending {
  background: #f4f8f6;
  overflow: hidden;
}

body.auth-gate-pending > .sidebar,
body.auth-gate-pending > .app-shell {
  visibility: hidden;
}

.login-landing {
  min-height: 100vh;
  padding: 36px clamp(28px, 7vw, 120px) 26px;
  background: linear-gradient(145deg, #eef7f3 0%, #f8faf9 72%);
  color: #203a31;
}

.login-landing-header,
.login-landing-layout,
.login-landing-footer {
  max-width: 1160px;
  margin-left: auto;
  margin-right: auto;
}

.login-landing-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.login-landing-brand { display: flex; align-items: center; gap: 14px; }
.login-landing-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 13px;
  background: #356f5d;
  color: #fff;
  font-size: 18px;
  font-weight: 800;
  box-shadow: 0 10px 22px rgba(53, 111, 93, .16);
}
.login-landing-brand strong { display: block; font-size: 18px; letter-spacing: .5px; }
.login-landing-brand small { display: block; margin-top: 3px; color: #82948b; font-size: 11px; letter-spacing: 1px; }
.login-landing-context { color: #80948a; font-size: 12px; }

.login-landing-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 440px);
  gap: clamp(64px, 9vw, 132px);
  align-items: center;
  min-height: calc(100vh - 160px);
  padding: 48px 0 64px;
}

.login-landing-eyebrow { display: flex; align-items: center; gap: 12px; color: #648477; font-size: 13px; letter-spacing: .2px; }
.login-landing-eyebrow span { width: 28px; height: 2px; background: #6e9b89; }
.login-landing-intro h1 { margin-top: 28px; color: #203a31; font-size: clamp(38px, 3.4vw, 54px); line-height: 1.24; letter-spacing: -1.2px; }
.login-landing-description { margin-top: 24px; color: #71847b; font-size: 15px; line-height: 1.9; }
.login-landing-features { display: flex; gap: 34px; margin-top: 42px; }
.login-landing-features > div { display: flex; align-items: center; gap: 11px; }
.login-landing-features > div > span { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border: 1px solid #d3e4dc; border-radius: 11px; background: rgba(255,255,255,.5); color: #477b68; font-size: 20px; }
.login-landing-features p strong, .login-landing-features p small { display: block; }
.login-landing-features p strong { color: #294b3e; font-size: 13px; }
.login-landing-features p small { margin-top: 4px; color: #91a19a; font-size: 11px; }
.login-landing-motto { margin-top: 48px; color: #91a19a; font-size: 12px; letter-spacing: 1.2px; }

.login-landing-card { padding: 38px 34px 32px; border: 1px solid #d9e5df; border-radius: 22px; background: rgba(255,255,255,.96); box-shadow: 0 20px 48px rgba(43,74,61,.07); }
.login-landing-icon { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 12px; background: #eff7f3; color: #477b68; font-size: 20px; font-weight: 800; }
.login-landing-welcome { margin-top: 26px; color: #82948b; font-size: 13px; }
.login-landing-card h2 { margin-top: 9px; color: #203a31; font-size: 29px; line-height: 1.35; }
.login-landing-copy { margin-top: 12px; color: #71847b; font-size: 13px; line-height: 1.8; }
.login-landing-account { display: flex; align-items: center; gap: 9px; margin-top: 24px; padding: 14px 13px; border: 1px solid #e0ebe5; border-radius: 10px; background: #f7faf8; color: #607c6f; font-size: 12px; }
.login-landing-account span { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; border-radius: 50%; background: #deefe8; color: #477b68; font-weight: 800; }
.login-landing-button { position: relative; width: 100%; margin-top: 16px; padding: 14px 42px 14px 16px; border-radius: 10px; background: #356f5d; color: #fff; font-size: 14px; box-shadow: 0 10px 20px rgba(53,111,93,.15); }
.login-landing-button span { position: absolute; right: 18px; font-size: 21px; font-weight: 400; }
.login-landing-button:disabled { cursor: wait; opacity: .7; }
.login-landing-note { margin-top: 12px; text-align: center; color: #95a39c; font-size: 11px; }
.login-landing-permission-button { display: block; margin: 14px auto 0; padding: 5px 10px; background: transparent; color: #477b68; font-size: 12px; font-weight: 700; }
.login-landing-permission-button:hover { color: #245d4b; text-decoration: underline; }
.login-landing-support { margin-top: 24px; padding-top: 18px; border-top: 1px solid #edf1ef; color: #8a9a92; font-size: 11px; line-height: 1.8; }
.login-landing-support strong, .login-landing-support span { display: block; }
.login-landing-support strong { color: #526e61; font-size: 12px; }
.login-landing-footer { padding-top: 18px; border-top: 1px solid rgba(167,190,179,.38); color: #91a19a; font-size: 11px; }

@media (max-width: 760px) {
  .login-landing { padding: 28px 20px 22px; }
  .login-landing-context { display: none; }
  .login-landing-layout { display: flex; flex-direction: column; align-items: stretch; gap: 38px; min-height: auto; padding: 64px 0 54px; }
  .login-landing-intro h1 { font-size: clamp(32px, 9vw, 42px); letter-spacing: -0.8px; }
  .login-landing-description br { display: none; }
  .login-landing-features { gap: 18px; }
  .login-landing-card { padding: 30px 24px 26px; }
}

button {
  border: 0;
  border-radius: 6px;
  background: var(--brand);
  color: #fff;
  cursor: pointer;
  font-weight: 700;
  padding: 10px 14px;
}

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

input,
select,
textarea {
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  font: inherit;
  padding: 10px 12px;
  width: 100%;
}

textarea {
  resize: vertical;
}

button.ghost,
.ghost {
  background: #e8f3f2;
  color: var(--brand-strong);
}

body.form-library-modal-open {
  overflow: hidden;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 248px;
  border-right: 1px solid var(--line);
  background: var(--nav-bg);
  box-shadow: 10px 0 30px rgba(20, 45, 63, 0.06);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: 18px 12px 20px;
  scrollbar-width: thin;
  scrollbar-color: #c9d8df transparent;
}

.brand {
  align-items: center;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbfc 100%);
  border: 1px solid #edf2f6;
  border-radius: 10px;
  display: flex;
  gap: 12px;
  margin: 0 2px 14px;
  min-height: 68px;
  padding: 12px;
}

.brand-mark {
  align-items: center;
  background: linear-gradient(135deg, var(--brand), var(--brand-strong));
  border-radius: 8px;
  box-shadow: 0 8px 18px rgba(11, 127, 121, 0.18);
  color: #fff;
  display: inline-flex;
  font-weight: 800;
  height: 42px;
  justify-content: center;
  width: 42px;
}

.brand small {
  color: var(--muted);
  display: block;
  font-size: 12px;
  line-height: 1.35;
  margin-top: 3px;
}

nav {
  display: grid;
  gap: 6px;
}

nav a {
  align-items: center;
  border-radius: 8px;
  color: var(--nav-text);
  display: flex;
  font-size: 14px;
  font-weight: 600;
  min-height: 40px;
  line-height: 1.25;
  padding: 10px 12px 10px 14px;
  position: relative;
  text-decoration: none;
  transition: background 0.16s ease, color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

nav > a {
  min-height: 42px;
}

nav > a::before,
.nav-group a::before {
  background: transparent;
  border-radius: 99px;
  content: "";
  height: 18px;
  left: 0;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
}

.nav-group {
  background: var(--nav-surface);
  border: 1px solid #edf2f6;
  border-radius: 10px;
  display: grid;
  gap: 2px;
  margin: 2px 0;
  padding: 8px 7px;
}

.nav-group > span {
  align-items: center;
  color: var(--nav-muted);
  display: flex;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  min-height: 32px;
  padding: 4px 8px 7px;
}

.nav-group > span:first-child::before {
  background: var(--brand);
  border-radius: 99px;
  content: "";
  display: inline-block;
  height: 14px;
  margin-right: 8px;
  width: 3px;
}

.nav-group a {
  border-radius: 7px;
  color: #41505b;
  font-size: 13px;
  font-weight: 600;
  min-height: 34px;
  padding: 8px 10px 8px 24px;
}

.nav-divider {
  border-top: 1px solid #e1e9ef;
  display: block;
  height: 1px;
  margin: 7px 5px;
  min-height: 0;
  padding: 0;
}

nav a.active,
nav a:hover {
  background: var(--nav-hover);
  color: var(--brand-strong);
  font-weight: 700;
}

nav a:hover {
  transform: translateX(1px);
}

nav a.active {
  background: var(--nav-active);
  box-shadow: inset 0 0 0 1px rgba(11, 127, 121, 0.12);
}

nav a.active::before {
  background: var(--brand);
}

nav a:focus-visible {
  outline: 2px solid rgba(11, 127, 121, 0.28);
  outline-offset: 2px;
}

.app-shell {
  margin-left: 248px;
  padding: 28px;
}

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

.dashboard-hero {
  background: #ffffff;
  border: 1px solid #dde8ee;
  border-radius: 12px;
  box-shadow: 0 10px 26px rgba(24, 52, 67, 0.055);
  margin-bottom: 16px;
  padding: 18px 22px;
}

h1,
h2,
p {
  margin: 0;
}

.topbar h1 {
  font-size: 28px;
}

.topbar p {
  color: var(--muted);
  margin-top: 8px;
}

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

.identity-label {
  max-width: 180px;
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tenant-switcher {
  align-items: center;
  background: rgba(11, 127, 121, 0.08);
  border: 1px solid rgba(11, 127, 121, 0.18);
  border-radius: 9px;
  display: inline-flex;
  gap: 8px;
  min-height: 38px;
  padding: 4px 6px 4px 10px;
}

.tenant-switcher[hidden] {
  display: none;
}

.tenant-switcher span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.tenant-switcher select {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  max-width: 180px;
  min-height: 28px;
  padding: 2px 24px 2px 8px;
}

.identity-admin-link {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: inherit;
  text-decoration: none;
}

.identity-admin-link[hidden] {
  display: none;
}

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

.metric-grid article,
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.metric-grid article {
  cursor: pointer;
  min-height: 116px;
  overflow: hidden;
  padding: 16px 18px 14px;
  position: relative;
}

.metric-grid article::before {
  background: var(--brand);
  border-radius: 999px;
  content: "";
  height: 4px;
  left: 18px;
  position: absolute;
  right: 18px;
  top: 0;
}

.metric-card.danger::before {
  background: var(--red);
}

.metric-card.success::before {
  background: var(--green);
}

.metric-card.learning::before {
  background: #2f6faa;
}

.metric-card.notice::before {
  background: var(--amber);
}

.metric-card.is-overdue {
  border-color: color-mix(in srgb, var(--red) 55%, var(--line));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--red) 12%, transparent);
}

.metric-card.is-overdue::before {
  background: var(--red);
}

.metric-grid article:hover,
.metric-grid article:focus-visible {
  border-color: var(--brand);
  box-shadow: 0 12px 30px rgba(18, 58, 72, 0.1);
  outline: none;
  transform: translateY(-1px);
}

.metric-grid span,
.metric-grid em {
  color: var(--muted);
  display: block;
  font-style: normal;
}

.metric-grid strong {
  display: block;
  font-size: 30px;
  letter-spacing: 0;
  line-height: 1.05;
  margin: 12px 0 8px;
}

.workspace {
  display: grid;
  align-items: start;
  gap: 16px;
  grid-auto-flow: row dense;
  grid-template-columns: minmax(700px, 1fr) minmax(330px, 380px);
}

.dashboard-panel {
  box-shadow: 0 10px 28px rgba(24, 52, 67, 0.045);
}

.dashboard-main {
  grid-column: 1;
}

.dashboard-aside {
  grid-column: 2;
}

.dashboard-full-panel {
  grid-column: 1 / -1;
}

.dashboard-drawer {
  grid-column: 1 / -1;
}

.dashboard-task-panel { order: 10; }
.dashboard-notifications { order: 20; }
.dashboard-progress-panel { order: 30; }
.dashboard-problem-panel { order: 40; }
.dashboard-escalation-panel { order: 45; }
.dashboard-review-panel { order: 50; }
.dashboard-rectification-review-panel { order: 60; }
.dashboard-rectification-panel { order: 70; }
.dashboard-indicator-panel { order: 80; }
.dashboard-pdca-panel { order: 90; }
.dashboard-report-panel { order: 100; }
.dashboard-training-panel { order: 110; }
.dashboard-score-panel { order: 120; }
.dashboard-template-drawer { order: 130; }
.dashboard-config-drawer { order: 140; }
.dashboard-statistics-drawer { order: 150; }
.dashboard-audit-drawer { order: 160; }

.cockpit-hidden {
  display: none !important;
}

body.cockpit-nursing .dashboard-hero {
  border-top: 4px solid var(--brand);
}

body.cockpit-area .dashboard-hero {
  border-top: 4px solid #2f6faa;
}

body.cockpit-department .dashboard-hero {
  border-top: 4px solid var(--green);
}

body.cockpit-qc .dashboard-hero {
  border-top: 4px solid var(--amber);
}

body.cockpit-area .dashboard-task-panel { order: 10; }
body.cockpit-area .dashboard-progress-panel { order: 20; }
body.cockpit-area .dashboard-review-panel { order: 30; }
body.cockpit-area .dashboard-rectification-review-panel { order: 40; }
body.cockpit-area .dashboard-pdca-panel { order: 50; }
body.cockpit-area .dashboard-score-panel { order: 60; }
body.cockpit-area .dashboard-notifications { order: 70; }
body.cockpit-area .dashboard-problem-panel { order: 80; }

body.cockpit-department .dashboard-rectification-panel { order: 10; }
body.cockpit-department .dashboard-task-panel { order: 20; }
body.cockpit-department .dashboard-review-panel { order: 30; }
body.cockpit-department .dashboard-training-panel { order: 40; }
body.cockpit-department .dashboard-report-panel { order: 50; }
body.cockpit-department .dashboard-notifications { order: 60; }
body.cockpit-department .dashboard-problem-panel { order: 70; }

body.cockpit-qc .dashboard-task-panel { order: 10; }
body.cockpit-qc .dashboard-rectification-panel { order: 20; }
body.cockpit-qc .dashboard-review-panel { order: 30; }
body.cockpit-qc .dashboard-rectification-review-panel { order: 40; }
body.cockpit-qc .dashboard-notifications { order: 50; }
body.cockpit-qc .dashboard-problem-panel { order: 60; }

body.cockpit-area nav a[href="#templates"],
body.cockpit-area nav a[href="#quality-config"],
body.cockpit-department nav a[href="#templates"],
body.cockpit-department nav a[href="#quality-config"],
body.cockpit-qc nav a[href="#templates"],
body.cockpit-qc nav a[href="#quality-level-1"],
body.cockpit-qc nav a[href="#quality-level-2"],
body.cockpit-qc nav a[href="#form-library"],
body.cockpit-qc nav a[href="#quality-config"],
body.cockpit-qc nav a[href="#reports"],
body.cockpit-qc nav a[href="#training"] {
  display: none;
}

.dashboard-notifications,
.dashboard-problem-panel,
.dashboard-indicator-panel,
.dashboard-score-panel,
.dashboard-report-panel,
.dashboard-rectification-review-panel {
  position: relative;
}

.dashboard-table-wrap {
  border: 1px solid #e5edf2;
  border-radius: 8px;
  overflow-x: auto;
}

.dashboard-table-wrap table {
  border: 0;
  min-width: 760px;
}

.dashboard-table-wrap th {
  background: #f7fafb;
}

.dashboard-table-wrap td:first-child,
.dashboard-table-wrap th:first-child {
  padding-left: 14px;
}

.dashboard-drawer {
  box-shadow: 0 8px 20px rgba(24, 52, 67, 0.035);
  padding: 0;
}

.dashboard-drawer-summary {
  align-items: center;
  cursor: pointer;
  display: flex;
  gap: 14px;
  justify-content: space-between;
  list-style: none;
  min-height: 68px;
  padding: 16px 18px;
}

.dashboard-drawer-summary::-webkit-details-marker {
  display: none;
}

.dashboard-drawer-summary span {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.dashboard-drawer-summary strong {
  font-size: 16px;
}

.dashboard-drawer-summary em {
  color: var(--muted);
  font-style: normal;
  line-height: 1.45;
}

.dashboard-drawer-summary b {
  background: #e8f3f2;
  border-radius: 6px;
  color: var(--brand-strong);
  flex: 0 0 auto;
  font-size: 13px;
  padding: 8px 12px;
}

.dashboard-drawer[open] {
  padding: 0 16px 16px;
}

.dashboard-drawer[open] .dashboard-drawer-summary {
  border-bottom: 1px solid var(--line);
  margin: 0 -16px 16px;
}

.dashboard-drawer[open] .dashboard-drawer-summary b {
  background: #f0f5f7;
  color: var(--muted);
}

body.quality-level-route .topbar,
body.quality-level-route .metric-grid,
body.quality-level-route .workspace > .panel:not(.quality-group-page) {
  display: none;
}

body.form-library-route .topbar,
body.form-library-route .metric-grid,
body.form-library-route .workspace > .panel:not(.form-library-page) {
  display: none;
}

body.settings-route .topbar,
body.settings-route .metric-grid,
body.settings-route .workspace > .panel:not(.settings-page) {
  display: none;
}

body.quality-level-route .workspace {
  grid-template-columns: 1fr;
}

body.form-library-route .workspace {
  grid-template-columns: 1fr;
}

body.settings-route .workspace {
  grid-template-columns: 1fr;
}

body:not(.quality-level-route) .quality-group-page {
  display: none;
}

body:not(.form-library-route) .form-library-page {
  display: none;
}

body:not(.settings-route) .settings-page,
body.settings-route .settings-page:not(.active) {
  display: none;
}

@media (max-width: 1280px) {
  .metric-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

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

  .dashboard-main,
  .dashboard-aside,
  .dashboard-drawer {
    grid-column: 1;
  }

}

.panel {
  padding: 18px;
}

.dashboard-panel {
  padding: 20px;
}

.dashboard-drawer {
  padding: 0;
}

.dashboard-drawer[open] {
  padding: 0 16px 16px;
}

.panel.wide:not(.dashboard-panel) {
  grid-column: span 1;
}

.workspace > .dashboard-drawer {
  grid-column: 1 / -1;
}

.quality-group-page {
  grid-column: 1 / -1;
  min-width: 0;
  scroll-margin-top: 18px;
}

.form-library-page {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: none;
  grid-column: 1 / -1;
  min-height: calc(100vh - 48px);
  padding: 24px;
  scroll-margin-top: 18px;
}

.form-library-breadcrumb {
  background: #f7fafb;
  border: 1px solid #edf2f6;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 18px;
  padding: 12px 14px;
}

.form-library-tabs {
  background: var(--panel);
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
  display: flex;
  margin-bottom: 0;
  padding: 0 14px;
}

.form-library-tabs button {
  background: transparent;
  border: 0;
  border-radius: 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
  margin-right: 18px;
  min-width: auto;
  padding: 16px 2px 13px;
  position: relative;
}

.form-library-tabs button.active {
  background: transparent;
  color: var(--brand-strong);
}

.form-library-tabs button.active::after {
  background: var(--brand);
  border-radius: 999px 999px 0 0;
  bottom: 0;
  content: "";
  height: 3px;
  left: 0;
  position: absolute;
  right: 0;
}

.form-library-filter {
  background: #fbfdfd;
  border: 1px solid var(--line);
  border-top: 0;
  border-radius: 0 0 8px 8px;
  display: grid;
  gap: 12px;
  margin-bottom: 24px;
  padding: 18px;
}

.form-library-filter label,
.form-filter-row {
  align-items: center;
  border-bottom: 0;
  display: grid;
  gap: 14px;
  grid-template-columns: 76px 1fr;
  min-height: auto;
  padding: 0;
  position: relative;
}

.form-library-filter label {
  color: var(--text);
  font-size: 14px;
  font-weight: 800;
}

.form-library-filter input {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  height: 40px;
  max-width: 640px;
  padding: 9px 12px;
}

.form-library-filter input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(11, 127, 121, 0.12);
  outline: none;
}

.form-filter-row:last-child {
  border-bottom: 0;
}

.form-filter-row strong {
  color: var(--text);
  font-size: 14px;
  font-weight: 800;
}

.form-filter-row .filter-chip {
  background: #eef7f6;
  border: 1px solid #d8e9e7;
  border-radius: 6px;
  color: var(--brand-strong);
  font-size: 13px;
  font-weight: 800;
  margin: 4px 8px 4px 0;
  min-height: 32px;
  padding: 7px 12px;
}

.form-hot-search-row {
  align-items: start;
  display: flex;
  flex-wrap: nowrap;
  gap: 14px;
  margin-top: -2px;
  overflow-x: auto;
  white-space: nowrap;
}

.form-hot-search-row strong {
  flex: 0 0 auto;
  padding-top: 7px;
}

.form-hot-search-row .filter-chip {
  background: transparent;
  border-color: transparent;
  color: var(--brand-strong);
  font-size: 13px;
  flex: 0 0 auto;
  margin: 0;
  padding: 6px 0;
}

.form-hot-search-row .filter-chip:hover {
  text-decoration: underline;
}

.form-hot-search-row .filter-chip.active {
  background: transparent;
  border-color: transparent;
  color: var(--brand);
  font-weight: 800;
  text-decoration: underline;
}

.form-filter-row .filter-chip.active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.form-hot-search-row .filter-chip.active {
  background: transparent;
  border-color: transparent;
  color: var(--brand);
  font-weight: 800;
  text-decoration: underline;
}

.form-library-applied-filter {
  background: #e8f3f2;
  border: 1px solid #d8e9e7;
  border-radius: 6px;
  color: var(--brand-strong);
  display: inline-block;
  font-size: 13px;
  font-weight: 700;
  margin: 0 0 14px;
  padding: 7px 12px;
}

.form-library-table-head {
  align-items: center;
  background: #f7fafb;
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
  display: flex;
  justify-content: space-between;
  margin-bottom: 0;
  padding: 16px 18px;
}

.form-library-table-head span {
  color: var(--text);
  font-size: 15px;
  font-weight: 800;
}

.form-library-table-head button {
  background: var(--brand);
  border-radius: 6px;
  box-shadow: none;
  color: #fff;
  font-size: 14px;
  min-width: 140px;
  padding: 10px 18px;
}

.form-library-table-head button:hover {
  background: var(--brand-strong);
  box-shadow: none;
}

.form-library-table {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 0 0 8px 8px;
  box-shadow: none;
  overflow: hidden;
  table-layout: fixed;
}

.form-library-table th {
  background: #f4f7f8;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 13px 12px;
}

.form-library-table td {
  border-bottom: 1px solid #eef2f4;
  color: var(--text);
  font-size: 14px;
  height: 64px;
  padding: 12px;
}

.form-library-table tbody tr:hover {
  background: #f4faf9;
}

.form-library-table td,
.form-library-table th {
  vertical-align: middle;
}

.form-library-table th:nth-child(1),
.form-library-table td:nth-child(1) {
  text-align: center;
  width: 62px;
}

.form-library-table th:nth-child(2),
.form-library-table td:nth-child(2) {
  text-align: center;
  width: 62px;
}

.form-library-table th:nth-child(3),
.form-library-table td:nth-child(3) {
  width: 34%;
}

.form-library-table th:nth-child(4),
.form-library-table td:nth-child(4) {
  width: 9%;
}

.form-library-table th:nth-child(8),
.form-library-table td:nth-child(8) {
  text-align: center;
  width: 118px;
}

.form-library-table input[type="checkbox"] {
  accent-color: var(--brand);
  height: 16px;
  width: auto;
}

.form-document-icon {
  color: var(--muted);
  font-size: 14px;
  margin-right: 9px;
}

.form-library-table a {
  color: var(--brand-strong);
  font-weight: 700;
  text-decoration: none;
}

.form-library-name-link {
  background: transparent;
  border: 0;
  color: var(--brand-strong);
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  padding: 0;
  text-align: left;
}

.form-library-name-link:hover {
  color: var(--brand);
  text-decoration: underline;
}

.form-library-table .table-action {
  background: #e8f3f2;
  border: 1px solid #d8e9e7;
  border-radius: 6px;
  color: var(--brand-strong);
  font-size: 14px;
  padding: 8px 14px;
}

.form-library-table .table-action:hover {
  background: #dff0ee;
}

.form-library-actions {
  display: none;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
  margin-top: 8px;
}

.form-library-actions.open {
  display: flex;
}

.form-library-actions button {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--brand-strong);
  cursor: pointer;
  font-size: 12px;
  line-height: 1;
  padding: 7px 10px;
  white-space: nowrap;
}

.form-library-actions button:hover {
  background: #eef7f6;
  border-color: #cfe7e4;
}

.form-import-backdrop {
  align-items: flex-start;
  background: rgba(28, 39, 46, 0.38);
  inset: 0 0 0 248px;
  justify-content: center;
  overflow: hidden;
  padding: 72px 24px 24px;
}

.form-import-modal {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 18px 44px rgba(20, 45, 63, 0.16);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  margin: 0;
  max-height: calc(100vh - 96px);
  min-height: auto;
  overflow: hidden;
  width: min(860px, calc(100vw - 320px));
}

.form-import-modal.preview-mode {
  width: min(1280px, calc(100vw - 300px));
}

.form-import-modal.edit-mode {
  width: min(1320px, calc(100vw - 300px));
}

.form-import-titlebar {
  align-items: center;
  background: #f7fafb;
  border-bottom: 1px solid var(--line);
  display: flex;
  height: 49px;
  justify-content: space-between;
  padding: 0 6px 0 28px;
}

.form-import-titlebar h2 {
  color: var(--text);
  font-size: 16px;
  font-weight: 800;
  margin: 0;
}

.form-import-titlebar button {
  background: transparent;
  color: var(--brand-strong);
  font-size: 16px;
  font-weight: 500;
  padding: 4px 6px;
}

.form-import-body {
  display: grid;
  gap: 16px;
  grid-template-rows: minmax(0, 1fr) auto;
  min-height: 0;
  overflow: hidden;
  padding: 32px;
}

.form-import-upload-box {
  border: 1px dashed #cfdde1;
  border-radius: 6px;
  display: grid;
  gap: 22px;
  justify-self: center;
  min-height: 230px;
  padding: 54px 22px 28px;
  width: 100%;
}

.form-import-upload-box[hidden],
.form-import-preview[hidden],
.form-import-editor[hidden],
.form-import-actions [hidden] {
  display: none;
}

.form-import-file-row {
  align-items: center;
  border-bottom: 1px solid #eef2f4;
  display: flex;
  gap: 10px;
  justify-content: space-between;
  padding-bottom: 22px;
}

.form-import-name-field,
.form-editor-name-field {
  display: grid;
  gap: 7px;
}

.form-import-name-field span,
.form-editor-name-field span {
  color: var(--text);
  font-size: 14px;
  font-weight: 800;
}

.form-import-name-field em,
.form-editor-name-field em {
  color: var(--red);
  font-style: normal;
}

.form-import-name-field input,
.form-editor-name-field input {
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  min-height: 42px;
  padding: 9px 12px;
  width: 100%;
}

.form-import-name-field input:focus,
.form-editor-name-field input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(0, 143, 132, 0.1);
  outline: 0;
}

.form-import-name-field small {
  color: var(--muted);
  font-size: 12px;
}

.form-import-file-row input {
  border: 0;
  color: var(--text);
  font-size: 14px;
  padding: 0;
}

.form-template-link {
  background: transparent;
  color: var(--brand-strong);
  font-weight: 800;
  padding: 0;
}

.form-import-note {
  color: var(--muted);
  display: grid;
  gap: 13px;
  font-size: 14px;
}

.form-import-note p {
  border: 1px solid var(--line);
  color: var(--text);
  margin: 0;
  padding: 12px 18px;
}

.form-import-note code {
  color: var(--red);
  font-family: inherit;
  font-weight: 900;
}

.form-import-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  padding-top: 4px;
}

.form-import-actions button {
  border-radius: 6px;
  min-width: 96px;
  padding: 10px 18px;
}

.form-import-actions #submitFormLibraryImportButton {
  background: var(--brand);
}

.template-action-backdrop,
.template-changes-backdrop {
  background: rgba(28, 39, 46, 0.38);
}

.template-action-modal {
  position: relative;
  width: min(560px, 100%);
}

.template-changes-modal {
  position: relative;
  width: min(920px, 100%);
}

.template-action-form {
  display: grid;
  gap: 14px;
  margin-bottom: 18px;
}

.template-action-form label {
  color: var(--muted);
  display: grid;
  font-size: 13px;
  font-weight: 800;
  gap: 8px;
}

.template-action-form input,
.template-action-form textarea {
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  font: inherit;
  font-size: 15px;
  padding: 11px 12px;
}

.template-action-form textarea {
  min-height: 94px;
  resize: vertical;
}

.rectification-review-form {
  display: grid;
  gap: 10px;
  padding: 4px 0 14px;
}

.rectification-review-form label {
  color: var(--muted);
  display: grid;
  font-weight: 700;
  gap: 8px;
}

.rectification-review-form textarea {
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  font: inherit;
  min-height: 120px;
  padding: 12px;
  resize: vertical;
}

.rectification-review-form select {
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  font: inherit;
  min-height: 44px;
  padding: 10px 12px;
}

.rectification-handoff-fields {
  display: grid;
  gap: 10px;
}

.rectification-handoff-fields[hidden],
.rectification-handoff-fields [hidden] {
  display: none;
}

.rectification-review-form textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(12, 131, 122, 0.12);
  outline: none;
}

.rectification-workflow-detail-modal {
  width: min(1180px, 100%);
}

.rectification-workflow-detail-body {
  display: grid;
  gap: 22px;
}

.workflow-detail-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-block: 1px solid var(--line);
}

.workflow-detail-summary div {
  min-width: 0;
  padding: 14px 12px;
  border-right: 1px solid var(--line);
}

.workflow-detail-summary div:last-child {
  border-right: 0;
}

.workflow-detail-summary span,
.workflow-detail-summary strong {
  display: block;
  overflow-wrap: anywhere;
}

.workflow-detail-summary span {
  color: var(--muted);
  font-size: 13px;
}

.workflow-detail-summary strong {
  margin-top: 5px;
}

.workflow-detail-section h4 {
  margin: 0 0 12px;
}

.workflow-score-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 12px;
  border: 1px solid var(--line);
}

.workflow-score-row span {
  padding: 12px;
  border-right: 1px solid var(--line);
  color: var(--muted);
  text-align: center;
}

.workflow-score-row span:last-child {
  border-right: 0;
}

.workflow-score-row strong {
  display: block;
  margin-top: 4px;
  color: var(--text);
  font-size: 20px;
}

.workflow-table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
}

.workflow-detail-table {
  min-width: 840px;
}

.workflow-rectification-record {
  margin: 0;
  border-block: 1px solid var(--line);
}

.workflow-rectification-record div {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  border-bottom: 1px solid var(--line);
}

.workflow-rectification-record div:last-child {
  border-bottom: 0;
}

.workflow-rectification-record dt,
.workflow-rectification-record dd {
  margin: 0;
  padding: 12px;
  white-space: pre-wrap;
}

.workflow-rectification-record dt {
  color: var(--muted);
  font-weight: 700;
}

.workflow-timeline {
  border-top: 1px solid var(--line);
}

.workflow-timeline article {
  padding: 14px 4px;
  border-bottom: 1px solid var(--line);
}

.workflow-timeline article > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.workflow-timeline article p,
.workflow-timeline article small {
  margin: 6px 0 0;
  white-space: pre-wrap;
}

.workflow-timeline article small {
  color: var(--muted);
}

.workflow-attachment-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

@media (max-width: 760px) {
  .workflow-detail-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .workflow-detail-summary div:nth-child(2) {
    border-right: 0;
  }

  .workflow-detail-summary div:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }

  .workflow-rectification-record div {
    grid-template-columns: 1fr;
  }
}

.template-action-form [hidden] {
  display: none;
}

.template-changes-table-wrap {
  border: 1px solid var(--line);
  border-radius: 8px;
  max-height: 440px;
  overflow: auto;
}

.template-changes-table {
  border-collapse: collapse;
  min-width: 760px;
  width: 100%;
}

.template-changes-table th,
.template-changes-table td {
  border-bottom: 1px solid var(--line);
  color: var(--text);
  padding: 12px 14px;
  text-align: left;
  vertical-align: top;
}

.template-changes-table th {
  background: #f4f7f8;
  color: var(--muted);
  font-weight: 800;
  position: sticky;
  top: 0;
}

.template-changes-table .empty-cell {
  color: var(--muted);
  padding: 28px;
  text-align: center;
}

.form-import-preview {
  background: var(--panel);
  border-radius: 4px;
  display: grid;
  gap: 18px;
  grid-template-rows: auto auto auto minmax(0, 1fr);
  min-height: 0;
  overflow: hidden;
}

.form-preview-warning {
  color: var(--red);
  font-size: 14px;
  font-weight: 700;
  margin: 0;
}

.form-import-preview h3 {
  color: var(--text);
  font-size: 30px;
  font-weight: 800;
  margin: 0;
}

.form-preview-score {
  color: var(--muted);
  display: flex;
  font-size: 14px;
  gap: 180px;
  justify-content: flex-start;
  padding-left: 150px;
}

.form-preview-table-wrap {
  border: 1px solid var(--line);
  min-height: 240px;
  overflow: auto;
}

.form-preview-table {
  border-collapse: collapse;
  min-width: 980px;
  width: 100%;
}

.form-preview-table th {
  background: #f4f7f8;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
  padding: 13px 10px;
  text-align: left;
}

.form-preview-table td {
  border: 1px solid #eef2f4;
  color: var(--text);
  font-size: 14px;
  line-height: 1.55;
  min-height: 54px;
  padding: 10px 12px;
  vertical-align: top;
}

.form-preview-table .preview-category {
  color: var(--muted);
  text-align: center;
  vertical-align: middle;
  width: 170px;
  writing-mode: vertical-rl;
}

.form-preview-table .preview-item {
  width: 300px;
}

.form-preview-table .preview-score-cell,
.form-preview-table .preview-input-score {
  width: 130px;
}

.form-preview-table .preview-remark {
  width: 160px;
}

.form-import-editor {
  display: grid;
  gap: 16px;
  grid-template-rows: auto auto auto minmax(0, 1fr);
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  padding-right: 2px;
}

.form-editor-scope {
  border: 1px solid var(--line);
  border-radius: 6px;
  display: grid;
  gap: 8px;
  padding: 8px 12px;
}

.form-editor-scope-head {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  min-height: 30px;
}

.form-editor-scope-head strong {
  color: var(--text);
  font-size: 15px;
}

.form-editor-scope-head label {
  align-items: center;
  color: var(--muted);
  display: inline-flex;
  gap: 6px;
}

.form-editor-scope-head input {
  accent-color: var(--brand);
  width: auto;
}

.form-editor-scope-toggle {
  align-items: center;
  background: transparent;
  border: 0;
  color: var(--text);
  cursor: pointer;
  display: inline-flex;
  gap: 6px;
  min-height: 28px;
  padding: 0;
}

.form-editor-scope-toggle:hover strong {
  color: var(--brand);
}

.form-editor-scope-caret {
  color: var(--brand);
  display: inline-block;
  font-size: 20px;
  line-height: 1;
  transform: rotate(0deg);
  transition: transform 0.15s ease;
}

.form-editor-scope.expanded .form-editor-scope-caret {
  transform: rotate(90deg);
}

#formLibraryApplicableSummary,
#formLibraryRoleAuthorizationSummary {
  color: var(--brand-strong);
  font-size: 13px;
}

.form-editor-scope-body[hidden] {
  display: none;
}

.form-editor-departments,
.form-editor-role-options {
  border-top: 1px solid #eef2f4;
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  max-height: 180px;
  overflow: auto;
  padding-top: 10px;
}

.form-editor-department-option,
.form-editor-role-option {
  align-items: center;
  background: #f7fafb;
  border: 1px solid var(--line);
  border-radius: 6px;
  display: grid;
  gap: 3px 7px;
  grid-template-columns: max-content 1fr;
  min-height: 44px;
  padding: 7px 8px;
}

.form-editor-department-option input,
.form-editor-role-option input {
  accent-color: var(--brand);
  grid-row: span 2;
  width: auto;
}

.form-editor-department-option span,
.form-editor-role-option span {
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.form-editor-department-option small,
.form-editor-role-option small {
  color: var(--muted);
  font-size: 12px;
}

.form-editor-head {
  align-items: end;
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(260px, 1fr) minmax(280px, 420px) auto;
}

.form-editor-head h3 {
  color: var(--text);
  font-size: 24px;
  font-weight: 800;
  margin: 0 0 8px;
}

.form-editor-head p {
  color: var(--muted);
  font-size: 13px;
  margin: 0;
}

.form-editor-name-field {
  min-width: 0;
}

.form-editor-add-group,
.form-editor-group-row button {
  background: var(--brand);
  border: 1px solid var(--brand);
  border-radius: 6px;
  color: #fff;
  font-weight: 900;
  min-width: 118px;
  padding: 9px 14px;
}

.form-editor-table-wrap {
  border: 1px solid var(--line);
  border-radius: 6px;
  min-height: 260px;
  overflow: auto;
}

.form-editor-table {
  border-collapse: collapse;
  min-width: 1120px;
  width: 100%;
}

.form-editor-table th {
  background: #f4f7f8;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  padding: 10px;
  text-align: left;
}

.form-editor-table td {
  border-bottom: 1px solid #eef2f4;
  color: var(--text);
  font-size: 14px;
  padding: 9px 10px;
  vertical-align: top;
}

.form-editor-table input,
.form-editor-table textarea {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  font: inherit;
  line-height: 1.5;
  padding: 7px 8px;
  width: 100%;
}

.form-editor-table textarea {
  min-height: 54px;
  resize: vertical;
}

.form-editor-table th:nth-child(1),
.form-editor-table td:nth-child(1) {
  width: 145px;
}

.form-editor-table th:nth-child(4),
.form-editor-table td:nth-child(4) {
  width: 90px;
}

.form-editor-table th:nth-child(7),
.form-editor-table td:nth-child(7) {
  width: 150px;
}

.form-editor-group-row {
  background: #eef7f6;
}

.form-editor-group-row td {
  border-bottom: 1px solid #d8e9e7;
  font-weight: 800;
  vertical-align: middle;
}

.form-editor-group-row input {
  background: transparent;
  border-color: transparent;
  font-weight: 800;
}

.form-editor-item-row td:first-child {
  color: var(--muted);
}

.form-editor-item-row td:first-child span {
  display: block;
  margin-top: 6px;
}

.form-editor-actions-cell {
  white-space: nowrap;
}

.form-editor-actions-cell button {
  background: #e8f3f2;
  border: 1px solid #d8e9e7;
  border-radius: 6px;
  color: var(--brand-strong);
  font-weight: 800;
  margin-right: 4px;
  min-width: 34px;
  padding: 7px 8px;
}

.form-template-preview {
  border: 1px solid #cdd6d8;
  justify-self: center;
  overflow: auto;
  width: min(1328px, calc(100vw - 384px));
}

.form-template-instructions {
  color: #b26565;
  font-family: "Times New Roman", serif;
  font-size: 20px;
  line-height: 1.45;
  padding: 10px 12px 18px;
}

.form-template-instructions strong {
  color: #c16b6b;
  display: block;
  font-size: 22px;
  margin-bottom: 6px;
}

.form-template-instructions p {
  margin: 0 0 16px;
}

.form-template-sheet {
  border-collapse: collapse;
  min-width: 980px;
  width: 100%;
}

.form-template-sheet th,
.form-template-sheet td {
  border: 1px solid #222;
  color: #465b5f;
  font-family: "Songti SC", SimSun, serif;
  font-size: 18px;
  line-height: 1.5;
  padding: 8px 10px;
  text-align: center;
  vertical-align: middle;
}

.form-template-sheet th {
  color: #222;
  font-size: 20px;
  font-weight: 800;
}

.form-template-sheet .row-index {
  background: #edf5f6;
  border-color: #d5dee0;
  color: #5b7f88;
  font-size: 14px;
  padding: 2px 8px;
  width: 34px;
}

.form-template-sheet .sheet-note {
  color: #b26565;
  text-align: left;
}

.breadcrumb-line {
  background: #f8fafb;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 16px;
  padding: 12px 14px;
}

.quality-workflow-board {
  border: 1px solid var(--line);
  margin-bottom: 18px;
  padding: 14px;
}

.quality-workflow-title {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin-bottom: 12px;
}

.quality-workflow-title strong {
  color: var(--text);
  display: block;
  font-size: 16px;
  line-height: 1.45;
}

.quality-workflow-title span {
  color: var(--muted);
  display: inline-block;
  font-size: 13px;
  margin-top: 4px;
}

.quality-workflow-period {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.quality-workflow-period input {
  min-width: 150px;
}

.quality-workflow-metrics {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  margin-bottom: 14px;
}

.quality-workflow-metric {
  background: #f8fafb;
  border: 1px solid var(--line);
  min-height: 82px;
  padding: 10px;
}

.quality-workflow-metric span {
  color: var(--muted);
  display: block;
  font-size: 12px;
  font-weight: 800;
}

.quality-workflow-metric strong {
  color: var(--text);
  display: block;
  font-size: 24px;
  line-height: 1.2;
  margin-top: 6px;
}

.quality-workflow-metric em {
  color: var(--muted);
  display: block;
  font-size: 12px;
  font-style: normal;
  margin-top: 4px;
}

.quality-workflow-metric.success strong {
  color: var(--green);
}

.quality-workflow-metric.warn strong {
  color: var(--amber);
}

.quality-workflow-metric.danger strong {
  color: var(--red);
}

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

.quality-workflow-columns h3,
.quality-workflow-reports h3 {
  font-size: 14px;
  margin: 0 0 8px;
}

.quality-workflow-list,
.quality-workflow-report-list {
  display: grid;
  gap: 8px;
}

.quality-workflow-item {
  border: 1px solid var(--line);
  padding: 10px;
}

.quality-workflow-item strong {
  color: var(--text);
  display: block;
  font-size: 14px;
  line-height: 1.45;
}

.quality-workflow-item p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  margin: 4px 0 0;
}

.quality-workflow-item .tag {
  margin-top: 8px;
}

.quality-workflow-reports {
  border-top: 1px solid var(--line);
  margin-top: 14px;
  padding-top: 12px;
}

.department-quality-workbench {
  border-bottom: 1px solid var(--line);
  border-top: 1px solid var(--line);
  margin: 4px 0 14px;
  padding: 14px 0;
}

.department-quality-head {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin-bottom: 12px;
}

.department-quality-head h3,
.department-quality-columns h4 {
  color: var(--text);
  margin: 0;
}

.department-quality-head h3 {
  font-size: 15px;
}

.department-quality-head p {
  color: var(--muted);
  font-size: 12px;
  margin: 4px 0 0;
}

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

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

.hospital-quality-columns {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.department-quality-columns > section {
  min-width: 0;
}

.department-quality-columns h4 {
  font-size: 13px;
  margin-bottom: 8px;
}

.department-quality-list {
  display: grid;
  gap: 8px;
}

.department-quality-item {
  border-left: 3px solid #46727a;
  min-height: 92px;
  padding: 8px 10px;
}

.department-quality-item.warn {
  border-left-color: var(--amber);
}

.department-quality-item.danger {
  border-left-color: var(--red);
}

.department-quality-item strong,
.department-quality-item span,
.department-quality-item p {
  display: block;
}

.department-quality-item strong {
  color: var(--text);
  font-size: 13px;
  line-height: 1.45;
}

.department-quality-item span,
.department-quality-item p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  margin: 3px 0 0;
  overflow-wrap: anywhere;
}

.department-quality-item-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.department-quality-item-actions button,
.quality-workflow-item button {
  min-height: 32px;
  padding: 6px 10px;
}

.button-link {
  background: #315e66;
  border-radius: 6px;
  color: #fff;
  display: inline-flex;
  font-size: 12px;
  font-weight: 700;
  min-height: 32px;
  padding: 7px 10px;
  text-decoration: none;
}

.department-meeting-form {
  display: grid;
  gap: 14px;
}

.area-recheck-candidates {
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 8px;
  max-height: 260px;
  overflow: auto;
  padding-bottom: 12px;
}

.area-recheck-candidate {
  align-items: start;
  border-left: 3px solid #46727a;
  display: grid;
  gap: 3px 10px;
  grid-template-columns: 20px minmax(0, 1fr);
  padding: 8px 10px;
}

.area-recheck-candidate input {
  margin-top: 3px;
}

.area-recheck-candidate strong,
.area-recheck-candidate span {
  grid-column: 2;
}

.area-recheck-candidate strong {
  color: var(--text);
  font-size: 13px;
}

.area-recheck-candidate span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.department-meeting-form label {
  color: var(--muted);
  display: grid;
  font-size: 13px;
  font-weight: 700;
  gap: 7px;
}

.quality-level-filter {
  align-items: end;
  border: 1px solid var(--line);
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(240px, 1fr) minmax(160px, 220px) auto;
  margin-bottom: 14px;
  padding: 12px;
}

.quality-level-filter label {
  color: var(--muted);
  display: grid;
  font-size: 13px;
  font-weight: 700;
  gap: 7px;
}

.quality-level-filter span {
  color: var(--muted);
  font-weight: 800;
  padding: 10px 0;
}

.quality-level-project-table-wrap {
  overflow-x: auto;
  width: 100%;
}

.quality-level-project-table {
  --quality-project-action-width: 132px;
  min-width: 1460px;
}

.quality-level-project-table th:nth-child(2) {
  min-width: 250px;
}

.quality-level-project-table th:nth-child(4) {
  min-width: 220px;
}

.quality-level-project-table th:nth-child(7) {
  min-width: 270px;
}

.quality-level-project-table th:nth-child(8) {
  min-width: 208px;
}

.quality-level-project-table th:last-child {
  min-width: var(--quality-project-action-width);
}

.quality-level-project-table th:nth-child(8),
.quality-level-project-table td:nth-child(8) {
  background: var(--panel);
  box-shadow: -1px 0 0 var(--line);
  position: sticky;
  right: var(--quality-project-action-width);
  z-index: 2;
}

.quality-level-project-table th:last-child,
.quality-level-project-table td:last-child {
  background: var(--panel);
  box-shadow: -1px 0 0 var(--line);
  min-width: var(--quality-project-action-width);
  position: sticky;
  right: 0;
  width: var(--quality-project-action-width);
  z-index: 2;
}

.quality-level-project-table th:nth-child(8),
.quality-level-project-table th:last-child {
  z-index: 3;
}

.quality-level-project-table td:last-child .table-action {
  display: block;
  margin-bottom: 6px;
  width: 100%;
}

.quality-level-project-table td:last-child .table-action:last-child {
  margin-bottom: 0;
}

.quality-level-pdca-entry {
  border: 1px solid var(--line);
  display: grid;
  grid-template-columns: repeat(2, minmax(86px, 1fr));
  width: 190px;
}

.quality-level-pdca-button {
  align-items: center;
  background: var(--panel);
  border: 0;
  border-radius: 0;
  color: var(--text);
  display: grid;
  font-size: 12px;
  gap: 5px;
  grid-template-columns: 24px 1fr auto;
  min-height: 38px;
  padding: 5px 7px;
  text-align: left;
}

.quality-level-pdca-button:nth-child(odd) {
  border-right: 1px solid var(--line);
}

.quality-level-pdca-button:nth-child(-n + 2) {
  border-bottom: 1px solid var(--line);
}

.quality-level-pdca-button:hover,
.quality-level-pdca-button:focus-visible {
  background: #f2f7f6;
  color: var(--brand-strong);
}

.quality-level-pdca-button b {
  align-items: center;
  background: #2f817a;
  border-radius: 4px;
  color: #fff;
  display: inline-flex;
  height: 24px;
  justify-content: center;
  width: 24px;
}

.quality-level-pdca-button.stage-do b {
  background: #477b98;
}

.quality-level-pdca-button.stage-check b {
  background: #a87326;
}

.quality-level-pdca-button.stage-act b {
  background: #a84f59;
}

.quality-level-pdca-button span {
  font-weight: 800;
}

.quality-level-pdca-button small {
  color: var(--muted);
  font-size: 10px;
  white-space: nowrap;
}

.quality-project-filter {
  grid-template-columns:
    minmax(220px, 1.5fr)
    minmax(128px, 0.7fr)
    minmax(128px, 0.7fr)
    minmax(150px, 0.8fr)
    auto;
}

.quality-project-overview {
  border-block: 1px solid var(--line);
  display: grid;
  grid-template-columns: repeat(6, minmax(110px, 1fr));
  margin-bottom: 16px;
}

.quality-project-overview > div {
  border-right: 1px solid var(--line);
  display: grid;
  gap: 6px;
  padding: 13px 16px;
}

.quality-project-overview > div:last-child {
  border-right: 0;
}

.quality-project-overview span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.quality-project-overview strong {
  color: var(--text);
  font-size: 20px;
}

.quality-project-tabs {
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 24px;
  margin-bottom: 16px;
}

.quality-project-tabs button {
  background: transparent;
  border-bottom: 3px solid transparent;
  border-radius: 0;
  color: var(--muted);
  padding: 10px 2px;
}

.quality-project-tabs button.active {
  border-bottom-color: var(--brand);
  color: var(--brand-strong);
}

.quality-project-tabs span {
  background: #edf4f3;
  border-radius: 999px;
  display: inline-flex;
  font-size: 11px;
  justify-content: center;
  margin-left: 4px;
  min-width: 20px;
  padding: 2px 5px;
}

.quality-project-table-wrap {
  overflow-x: auto;
  width: 100%;
}

.quality-project-plan-table {
  min-width: 1180px;
}

.quality-project-plan-table th:nth-child(2) {
  min-width: 230px;
}

.quality-project-plan-table th:nth-child(5) {
  min-width: 260px;
}

.quality-project-plan-table th:last-child {
  min-width: 150px;
}

.quality-project-load-state {
  background: #f5f8f8;
  border-left: 3px solid var(--brand);
  color: var(--muted);
  margin: 0 0 12px;
  padding: 10px 12px;
}

.quality-project-load-state.error {
  background: #fff5f4;
  border-left-color: var(--red);
  color: var(--red);
}

.quality-level-table small {
  color: var(--muted);
}

.quality-plan-name-cell {
  display: grid;
  gap: 5px;
}

.quality-plan-name-cell strong {
  line-height: 1.45;
}

.quality-plan-name-cell small {
  line-height: 1.5;
}

.quality-plan-progress {
  display: grid;
  gap: 7px;
  margin-top: 7px;
}

.quality-plan-progress-row {
  align-items: center;
  display: grid;
  gap: 7px;
  grid-template-columns: 34px minmax(74px, 1fr) 42px;
}

.quality-plan-progress-row span,
.quality-plan-progress-row b {
  color: var(--muted);
  font-size: 11px;
}

.quality-plan-progress-row b {
  text-align: right;
}

.quality-plan-progress-track {
  background: #e7edec;
  height: 6px;
  overflow: hidden;
}

.quality-plan-progress-track i {
  background: var(--brand);
  display: block;
  height: 100%;
  max-width: 100%;
}

.quality-plan-progress-row.rectification .quality-plan-progress-track i {
  background: #c38424;
}

.quality-plan-progress-row.review .quality-plan-progress-track i {
  background: #537d91;
}

.quality-plan-status {
  display: grid;
  gap: 7px;
  justify-items: start;
}

.quality-plan-status small {
  line-height: 1.4;
}

.quality-plan-actions {
  align-items: flex-start;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.quality-plan-actions .ghost {
  padding: 7px 10px;
}

.quality-plan-action-wrap {
  display: grid;
  gap: 6px;
  min-width: 124px;
}

.quality-plan-action-toggle {
  width: 100%;
}

.quality-plan-row-actions {
  border: 1px solid var(--line);
  display: none;
  min-width: 154px;
}

.quality-plan-row-actions.open {
  display: grid;
}

.quality-plan-row-actions button {
  background: var(--panel);
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  color: var(--brand-strong);
  font-size: 12px;
  padding: 9px 10px;
  text-align: left;
  white-space: nowrap;
}

.quality-plan-row-actions button:last-child {
  border-bottom: 0;
}

.quality-plan-row-actions button:hover {
  background: #eef7f6;
}

.quality-project-section-head {
  align-items: flex-start;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  margin-bottom: 12px;
}

.quality-project-section-head h4 {
  font-size: 16px;
  margin: 0;
}

.quality-project-section-head p {
  color: var(--muted);
  font-size: 13px;
  margin: 5px 0 0;
}

.quality-project-pdca-actions {
  align-items: end;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.quality-project-pdca-actions label {
  color: var(--muted);
  display: grid;
  font-size: 12px;
  font-weight: 700;
  gap: 5px;
}

.quality-project-pdca-actions input {
  border: 1px solid var(--line);
  border-radius: 6px;
  min-height: 38px;
  padding: 7px 10px;
}

.quality-project-pdca-cycle {
  border-block: 1px solid var(--line);
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  margin-bottom: 18px;
  overflow-x: auto;
}

.quality-project-pdca-cycle button {
  align-items: center;
  background: var(--panel);
  border: 0;
  border-bottom: 3px solid transparent;
  border-radius: 0;
  color: var(--muted);
  display: grid;
  gap: 2px 10px;
  grid-template-columns: 34px minmax(0, 1fr);
  min-height: 72px;
  padding: 10px 16px;
  text-align: left;
}

.quality-project-pdca-cycle button + button {
  border-left: 1px solid var(--line);
}

.quality-project-pdca-cycle button b {
  align-items: center;
  background: #2f817a;
  border-radius: 4px;
  color: #fff;
  display: inline-flex;
  font-size: 18px;
  grid-row: 1 / span 2;
  height: 34px;
  justify-content: center;
  width: 34px;
}

.quality-project-pdca-cycle button:nth-child(2) b {
  background: #477b98;
}

.quality-project-pdca-cycle button:nth-child(3) b {
  background: #a87326;
}

.quality-project-pdca-cycle button:nth-child(4) b {
  background: #a84f59;
}

.quality-project-pdca-cycle button span {
  color: var(--text);
  font-size: 14px;
  font-weight: 800;
}

.quality-project-pdca-cycle button small {
  color: var(--muted);
  font-size: 11px;
}

.quality-project-pdca-cycle button.active {
  background: #f4f9f8;
  border-bottom-color: var(--brand);
}

.quality-project-pdca-table {
  min-width: 880px;
}

.quality-project-pdca-table th:nth-child(2),
.quality-project-pdca-problem-table th:nth-child(2) {
  min-width: 240px;
}

.quality-project-pdca-problem-table {
  min-width: 1160px;
}

.quality-project-pdca-problem-table th:nth-child(7) {
  min-width: 300px;
}

.quality-project-pdca-problem-list {
  display: grid;
  gap: 5px;
  line-height: 1.5;
  list-style: none;
  margin: 0;
  padding: 0;
}

.quality-project-pdca-problem-list li {
  border-left: 2px solid #d9a85f;
  padding-left: 8px;
}

.quality-project-pdca-list {
  border-top: 1px solid var(--line);
  display: grid;
}

.quality-project-pdca-item {
  align-items: start;
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 8px 18px;
  grid-template-columns: minmax(220px, 1.2fr) minmax(180px, 0.8fr) minmax(220px, 1.2fr);
  padding: 14px 4px;
}

.quality-project-pdca-item > div {
  display: grid;
  gap: 5px;
}

.quality-project-pdca-item strong {
  line-height: 1.45;
}

.quality-project-pdca-item span,
.quality-project-pdca-item p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
  margin: 0;
}

.quality-project-pdca-cause-item {
  grid-template-columns: minmax(180px, 0.7fr) minmax(260px, 1.3fr) minmax(260px, 1.2fr);
}

.quality-project-pdca-cause-item .tag {
  justify-self: start;
}

.quality-project-pdca-cause-item .quality-project-pdca-field-label {
  color: var(--text);
  font-weight: 800;
  margin-top: 5px;
}

.quality-project-pdca-list.compact .quality-project-pdca-item {
  grid-template-columns: minmax(220px, 1fr) minmax(220px, 1fr);
}

.quality-plan-execution-modal {
  display: grid;
  gap: 18px;
  max-height: calc(100vh - 44px);
}

.quality-plan-execution-summary {
  border-block: 1px solid var(--line);
  display: grid;
  grid-template-columns: repeat(6, minmax(100px, 1fr));
}

.quality-plan-execution-summary > div {
  border-right: 1px solid var(--line);
  display: grid;
  gap: 6px;
  padding: 12px;
}

.quality-plan-execution-summary > div:last-child {
  border-right: 0;
}

.quality-plan-execution-summary span {
  color: var(--muted);
  font-size: 12px;
}

.quality-plan-execution-summary strong {
  font-size: 18px;
}

.quality-plan-execution-section {
  display: grid;
}

.quality-plan-results-summary {
  border-block: 1px solid var(--line);
  display: grid;
  grid-template-columns: repeat(7, minmax(105px, 1fr));
  margin-bottom: 16px;
  overflow-x: auto;
}

.quality-plan-results-summary > div {
  border-right: 1px solid var(--line);
  display: grid;
  gap: 6px;
  min-width: 105px;
  padding: 13px 14px;
}

.quality-plan-results-summary > div:last-child {
  border-right: 0;
}

.quality-plan-results-summary span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.quality-plan-results-summary strong {
  color: var(--text);
  font-size: 20px;
}

.quality-project-inspection-summary-metrics {
  border-block: 1px solid var(--line);
  display: grid;
  grid-template-columns: repeat(6, minmax(110px, 1fr));
  margin-bottom: 16px;
  overflow-x: auto;
}

.quality-project-inspection-summary-metrics > div {
  border-right: 1px solid var(--line);
  display: grid;
  gap: 6px;
  min-width: 110px;
  padding: 13px 14px;
}

.quality-project-inspection-summary-metrics > div:last-child {
  border-right: 0;
}

.quality-project-inspection-summary-metrics span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.quality-project-inspection-summary-metrics strong {
  color: var(--text);
  font-size: 20px;
}

.quality-project-inspection-summary-filter {
  margin-bottom: 14px;
}

.quality-project-inspection-summary-tabs {
  flex-wrap: wrap;
  gap: 18px;
}

.quality-report-heading {
  align-items: end;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 18px;
  justify-content: space-between;
  margin-bottom: 12px;
  padding: 2px 0 12px;
}

.quality-report-heading h4 {
  font-size: 18px;
  margin: 0;
}

.quality-report-heading p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
  margin: 0;
  max-width: 720px;
  text-align: right;
}

.quality-project-inspection-overview-table {
  min-width: 1320px;
}

.quality-project-inspection-overview-table th:nth-child(2),
.quality-project-inspection-deduction-table th:nth-child(2) {
  min-width: 230px;
}

.quality-project-inspection-deduction-table {
  min-width: 1180px;
}

.quality-project-inspection-deduction-table th:nth-child(5),
.quality-project-inspection-deduction-table th:last-child {
  min-width: 190px;
}

.quality-project-score-matrix-wrap {
  border-bottom: 1px solid var(--line);
  max-height: 620px;
  max-width: 100%;
  min-width: 0;
  overflow: auto;
  width: 100%;
}

.quality-project-score-matrix-table {
  table-layout: fixed;
}

.quality-project-inspection-summary-view,
#qualityProjectInspectionOverviewPanel,
#qualityProjectInspectionDeductionPanel,
#qualityProjectDepartmentScorePanel {
  max-width: 100%;
  min-width: 0;
}

.quality-project-score-matrix-table th,
.quality-project-score-matrix-table td {
  min-width: 96px;
  text-align: center;
  vertical-align: middle;
}

.quality-project-score-matrix-table th:first-child,
.quality-project-score-matrix-table td:first-child {
  min-width: 62px;
  width: 62px;
}

.quality-project-score-matrix-table th:nth-child(2),
.quality-project-score-matrix-table td:nth-child(2) {
  min-width: 150px;
  text-align: left;
  width: 150px;
}

.quality-project-score-matrix-table thead {
  position: sticky;
  top: 0;
  z-index: 2;
}

.quality-project-score-matrix-table thead th {
  background: #f5f8f8;
}

.quality-project-score-matrix-table thead strong,
.quality-project-score-matrix-table thead small {
  display: block;
  line-height: 1.45;
}

.quality-project-score-matrix-table thead small {
  margin-top: 4px;
}

.quality-plan-results-filter {
  grid-template-columns: minmax(240px, 1fr) minmax(150px, 220px) auto;
}

.quality-plan-department-results-table {
  min-width: 1120px;
}

.quality-plan-department-results-table th:first-child {
  min-width: 180px;
}

.quality-plan-department-results-table th:nth-child(2) {
  min-width: 190px;
}

.quality-plan-department-results-table td {
  vertical-align: top;
}

.quality-plan-analysis-filter {
  align-items: end;
  background: #f5f8f8;
  border-block: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 12px 14px;
}

.quality-plan-analysis-filter label {
  color: var(--muted);
  display: grid;
  font-size: 12px;
  font-weight: 700;
  gap: 6px;
}

.quality-plan-analysis-filter input {
  min-width: 180px;
}

.quality-plan-analysis-tabs {
  display: inline-flex;
  gap: 4px;
  margin: 16px 0;
}

.quality-plan-analysis-tabs button {
  background: #f2f6f5;
  color: var(--muted);
}

.quality-plan-analysis-tabs button.active {
  background: var(--brand);
  color: #fff;
}

.quality-analysis-grid {
  display: grid;
  gap: 22px;
}

.quality-analysis-section {
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.quality-analysis-content {
  align-items: start;
  display: grid;
  gap: 24px;
  grid-template-columns: minmax(420px, 0.95fr) minmax(420px, 1.05fr);
}

.quality-analysis-table-wrap {
  overflow-x: auto;
}

.quality-analysis-table-wrap table {
  min-width: 0;
  width: 100%;
}

.quality-horizontal-chart {
  border-left: 1px solid var(--line);
  display: grid;
  gap: 12px;
  min-height: 180px;
  padding: 8px 0 8px 24px;
}

.quality-chart-row {
  align-items: center;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(105px, 150px) minmax(180px, 1fr) 58px;
}

.quality-chart-label {
  color: var(--text);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.quality-chart-track {
  background: #e8efee;
  height: 22px;
  overflow: hidden;
}

.quality-chart-track i {
  background: #2d9f9a;
  display: block;
  height: 100%;
  min-width: 2px;
}

.issue-chart .quality-chart-track i {
  background: #ca7b24;
}

.qualified-chart .quality-chart-track i {
  background: #367a94;
}

.quality-chart-value {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-align: right;
}

.quality-plan-inspection-modal {
  display: grid;
  gap: 18px;
  max-height: calc(100vh - 44px);
}

.quality-plan-inspection-item-table {
  min-width: 1050px;
}

.quality-plan-inspection-item-table th:nth-child(2) {
  min-width: 180px;
}

.quality-plan-inspection-item-table th:nth-child(3),
.quality-plan-inspection-item-table th:last-child {
  min-width: 230px;
}

.quality-inspection-history-active {
  background: #eef7f6;
}

.quality-score-danger {
  color: var(--red);
  font-weight: 800;
}

.quality-score-ok {
  color: var(--brand-strong);
  font-weight: 800;
}

.quality-stat-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.stat-pill {
  background: #eef7f6;
  border: 1px solid #d8e9e7;
  color: var(--brand-strong);
  display: inline-flex;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
  padding: 5px 8px;
}

.stat-pill.warn {
  background: #fff2dd;
  border-color: #f6deb3;
  color: var(--amber);
}

.stat-pill.danger {
  background: #fae8e6;
  border-color: #f1c8c3;
  color: var(--red);
}

.muted-inline {
  color: var(--muted);
  display: inline-block;
  margin-top: 8px;
}

.quality-level-create-view[hidden],
.quality-level-list-view[hidden],
.quality-workflow-board[hidden],
.quality-plan-list-view[hidden],
.quality-plan-results-view[hidden],
.quality-project-inspection-summary-view[hidden],
.quality-plan-create-view[hidden] {
  display: none;
}

.panel-head {
  align-items: center;
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.panel-head p {
  color: var(--muted);
  line-height: 1.55;
  margin-top: 6px;
}

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

.dashboard-panel .panel-actions {
  align-items: center;
  flex-wrap: nowrap;
}

.dashboard-panel .panel-actions select {
  min-width: 104px;
  width: auto;
}

.panel h2 {
  font-size: 18px;
}

.dashboard-panel .panel-head h2 {
  align-items: center;
  display: inline-flex;
  gap: 8px;
}

.dashboard-panel .panel-head h2::before {
  background: var(--brand);
  border-radius: 99px;
  content: "";
  height: 16px;
  width: 4px;
}

.icon-button {
  align-items: center;
  display: inline-flex;
  height: 36px;
  justify-content: center;
  padding: 0;
  width: 36px;
}

.table-action {
  background: #e8f3f2;
  color: var(--brand-strong);
  padding: 7px 10px;
  white-space: nowrap;
}

.task-score {
  color: var(--muted);
  display: block;
  margin-top: 6px;
}

.empty-table-cell {
  color: var(--muted);
  padding: 22px 8px;
  text-align: center;
}

.plan-page-head {
  align-items: flex-start;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  margin-bottom: 16px;
}

.plan-page-head h3 {
  font-size: 18px;
  margin: 0;
}

.plan-page-head p {
  color: var(--muted);
  line-height: 1.55;
  margin-top: 6px;
}

.plan-wizard-steps {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.plan-wizard-steps strong {
  padding-inline: 12px;
  text-align: center;
}

.quality-plan-step {
  display: none;
}

.quality-plan-step.active {
  display: grid;
  gap: 16px;
}

.plan-placeholder-box,
.plan-form-box,
.approval-flow-box,
.notification-settings-box {
  border: 1px solid var(--line);
  display: grid;
  gap: 14px;
  padding: 18px;
}

.plan-placeholder-box h4 {
  border-bottom: 1px solid var(--line);
  font-size: 22px;
  font-weight: 500;
  margin: 0;
  padding-bottom: 12px;
}

.plan-placeholder-box p,
.plan-template-summary {
  color: var(--muted);
  line-height: 1.6;
}

.plan-form-box label,
.notification-settings-box label {
  color: var(--muted);
  display: grid;
  font-size: 13px;
  font-weight: 800;
  gap: 8px;
}

.notification-settings-box > label:not(:last-child) {
  align-items: center;
  color: var(--text);
  display: flex;
  gap: 8px;
}

.notification-settings-box input[type="checkbox"] {
  width: auto;
}

.plan-form-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.approval-flow-list {
  display: grid;
  gap: 8px;
}

.approval-node {
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  display: grid;
  gap: 10px;
  grid-template-columns: 72px minmax(260px, 1.4fr) minmax(220px, 1fr) auto;
  padding: 14px;
}

.approval-node strong {
  text-align: center;
}

.approval-node-main {
  display: grid;
  gap: 6px;
}

.approval-node-meta {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.approval-node-delete {
  min-width: 44px;
}

.approval-node-delete:disabled {
  color: var(--muted);
}

.approval-flow-connector {
  color: var(--muted);
  font-size: 18px;
  line-height: 1;
  text-align: center;
}

.plan-empty-state {
  background: #fff;
  box-shadow: 0 10px 22px rgba(30, 42, 50, 0.08);
  font-size: 16px;
  padding: 34px 16px;
}

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

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 12px 8px;
  text-align: left;
}

th {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.tag {
  border-radius: 999px;
  display: inline-flex;
  font-size: 12px;
  font-weight: 700;
  padding: 5px 9px;
}

.tag.ok {
  background: #e8f3f2;
  color: var(--brand-strong);
}

.tag.done {
  background: #e8f2ec;
  color: var(--green);
}

.tag.warn {
  background: #fff2dd;
  color: var(--amber);
}

.tag.danger {
  background: #fae8e6;
  color: var(--red);
}

.rank-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 0;
  list-style-position: inside;
}

.rank-list li {
  align-items: center;
  background: #fbfdfd;
  border: 1px solid #e4edf2;
  border-radius: 8px;
  display: flex;
  justify-content: space-between;
  min-height: 48px;
  padding: 10px 12px;
}

.today-workbench-panel {
  display: grid;
  gap: 14px;
  margin-bottom: 18px;
}

.today-workbench-panel[hidden] {
  display: none;
}

.today-workbench-panel .panel-head p {
  align-items: center;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 4px 0 0;
}

.today-workbench-panel .panel-head p strong {
  color: var(--brand-strong);
}

.today-workbench-counts {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.today-workbench-count {
  background: #f7fbfb;
  border: 1px solid #dcebea;
  border-radius: 8px;
  display: grid;
  gap: 4px;
  min-height: 68px;
  padding: 10px 12px;
}

.today-workbench-count span {
  color: var(--muted);
  font-size: 12px;
}

.today-workbench-count strong {
  color: var(--brand-strong);
  font-size: 24px;
  line-height: 1;
}

.today-workbench-count.danger strong {
  color: var(--red);
}

.today-workbench-count.warning strong {
  color: var(--amber);
}

.today-workbench-count.notice strong {
  color: #526d9e;
}

.today-workbench-priority {
  border-top: 1px solid var(--line);
  display: grid;
  gap: 8px;
  padding-top: 12px;
}

.today-workbench-priority-head {
  align-items: baseline;
  display: flex;
  gap: 9px;
}

.today-workbench-priority-head span {
  color: var(--muted);
  font-size: 12px;
}

.today-workbench-priority-list {
  display: grid;
  gap: 7px;
}

.today-workbench-priority-item {
  align-items: start;
  background: #fbfdfd;
  border: 1px solid #e4edf2;
  border-radius: 8px;
  display: grid;
  gap: 8px;
  grid-template-columns: 88px minmax(0, 1fr);
  padding: 9px 11px;
}

.today-workbench-priority-type {
  color: var(--brand-strong);
  font-size: 12px;
  font-weight: 800;
}

.today-workbench-priority-item > div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.today-workbench-priority-item span:last-child {
  color: var(--muted);
  font-size: 12px;
}

.progress-dimension-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.progress-dimension-card {
  background: #fbfdfd;
  border: 1px solid #e4edf2;
  border-radius: 8px;
  display: grid;
  gap: 9px;
  padding: 13px;
}

.dashboard-panel .empty-state,
.dashboard-panel .empty-table-cell {
  background: #f8fbfc;
  border-radius: 8px;
  color: #7a8993;
  padding: 18px;
  text-align: center;
}

.dashboard-panel .review-list .empty-state,
.dashboard-panel .notification-list .empty-state {
  border: 1px dashed #d8e4ea;
}

.progress-dimension-card span,
.progress-dimension-card small {
  color: var(--muted);
  font-size: 13px;
}

.task-calendar-toolbar {
  align-items: end;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}

.task-calendar-toolbar label {
  color: var(--muted);
  display: grid;
  font-size: 12px;
  gap: 5px;
}

.task-calendar-toolbar input,
.task-calendar-toolbar select {
  min-height: 34px;
  min-width: 132px;
}

.task-lifecycle-calendar-list {
  display: grid;
  gap: 8px;
}

.task-lifecycle-event {
  align-items: start;
  background: #fbfdfd;
  border: 1px solid #e4edf2;
  border-radius: 8px;
  display: grid;
  gap: 12px;
  grid-template-columns: 100px minmax(0, 1fr);
  padding: 10px 12px;
}

.task-lifecycle-event time {
  color: var(--brand-strong);
  font-weight: 700;
}

.task-lifecycle-event > div {
  display: grid;
  gap: 4px;
}

.task-lifecycle-event span {
  color: var(--muted);
  font-size: 12px;
}

.task-lifecycle-event .tag {
  justify-self: start;
}

.progress-track {
  background: #edf2f4;
  border-radius: 999px;
  height: 9px;
  overflow: hidden;
}

.progress-track i {
  background: var(--brand);
  display: block;
  height: 100%;
}

.signal-list {
  display: grid;
  gap: 12px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.dashboard-indicator-panel .panel-head > div:first-child p {
  color: var(--muted);
  font-size: 12px;
  margin: 4px 0 0;
}

.indicator-report-state {
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  display: inline-flex;
  font-size: 12px;
  font-weight: 800;
  min-height: 32px;
  padding: 6px 11px;
  white-space: nowrap;
}

.indicator-report-state.is-normal {
  background: #edf8f1;
  border-color: #c8e4d2;
  color: var(--green);
}

.indicator-report-state.is-warning {
  background: #fff0ee;
  border-color: #f2c6c0;
  color: var(--red);
}

.indicator-report-state.is-pending {
  background: #fff8ec;
  border-color: #ebd7ae;
  color: var(--amber);
}

.indicator-report-meta {
  background: #f7fbfa;
  border: 1px solid #d7e9e7;
  border-radius: 10px;
  display: grid;
  grid-template-columns: 0.8fr 1fr 1.5fr;
  margin-bottom: 14px;
}

.indicator-report-meta > div {
  border-right: 1px solid #dfecea;
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 12px 14px;
}

.indicator-report-meta > div:last-child {
  border-right: 0;
}

.indicator-report-meta span,
.indicator-report-summary span {
  color: var(--muted);
  font-size: 12px;
}

.indicator-report-meta strong {
  font-size: 14px;
  overflow-wrap: anywhere;
}

.indicator-report-summary {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 16px;
}

.indicator-report-summary article {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 9px;
  display: grid;
  gap: 4px;
  min-height: 96px;
  padding: 13px 14px;
  position: relative;
}

.indicator-report-summary article::before {
  background: var(--brand);
  border-radius: 0 9px 9px 0;
  content: "";
  inset: 13px auto 13px 0;
  position: absolute;
  width: 3px;
}

.indicator-report-summary article.is-normal::before {
  background: var(--green);
}

.indicator-report-summary article.is-warning::before {
  background: var(--red);
}

.indicator-report-summary article.is-pending::before {
  background: var(--amber);
}

.indicator-report-summary strong {
  font-size: 26px;
  line-height: 1;
}

.indicator-report-summary article.is-normal strong {
  color: var(--green);
}

.indicator-report-summary article.is-warning strong {
  color: var(--red);
}

.indicator-report-summary article.is-pending strong {
  color: var(--amber);
}

.indicator-report-summary small {
  color: var(--muted);
  font-size: 12px;
}

.indicator-report-layout {
  align-items: start;
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(0, 1.8fr) minmax(280px, 0.8fr);
}

.indicator-report-detail,
.indicator-report-conclusion {
  border: 1px solid var(--line);
  border-radius: 10px;
}

.indicator-report-detail {
  background: #fbfcfd;
  padding: 14px;
}

.indicator-report-section-head {
  align-items: flex-start;
  display: flex;
  justify-content: space-between;
  margin-bottom: 12px;
}

.indicator-report-section-head h3,
.indicator-report-section-head p,
.indicator-report-conclusion h3,
.indicator-report-conclusion p,
.indicator-report-warning-section h4 {
  margin: 0;
}

.indicator-report-section-head h3,
.indicator-report-conclusion h3 {
  font-size: 16px;
}

.indicator-report-section-head p {
  color: var(--muted);
  font-size: 12px;
  margin-top: 4px;
}

.indicator-report-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.indicator-report-grid > .empty-state {
  grid-column: 1 / -1;
}

.indicator-report-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 9px;
  min-width: 0;
  padding: 13px;
  position: relative;
}

.indicator-report-card.is-normal {
  border-top: 3px solid var(--green);
}

.indicator-report-card.is-warning {
  background: #fffafa;
  border-color: #e9b9b3;
  border-top: 3px solid var(--red);
}

.indicator-report-card.is-pending {
  border-top: 3px solid var(--amber);
}

.indicator-report-card-head {
  align-items: center;
  display: flex;
  gap: 8px;
  justify-content: space-between;
}

.indicator-report-card-head span {
  color: var(--muted);
  font-size: 11px;
}

.indicator-report-card-head b {
  background: #f0f4f6;
  border-radius: 999px;
  color: var(--muted);
  font-size: 11px;
  padding: 4px 7px;
}

.indicator-report-card.is-normal .indicator-report-card-head b {
  background: #edf8f1;
  color: var(--green);
}

.indicator-report-card.is-warning .indicator-report-card-head b {
  background: #fff0ee;
  color: var(--red);
}

.indicator-report-card.is-pending .indicator-report-card-head b {
  background: #fff8ec;
  color: var(--amber);
}

.indicator-report-card h4 {
  font-size: 14px;
  margin: 12px 0 4px;
}

.indicator-report-card-value {
  align-items: baseline;
  display: flex;
  gap: 4px;
  margin: 0 0 12px;
}

.indicator-report-card-value strong {
  font-size: 27px;
  line-height: 1.1;
}

.indicator-report-card.is-normal .indicator-report-card-value strong {
  color: var(--green);
}

.indicator-report-card.is-warning .indicator-report-card-value strong {
  color: var(--red);
}

.indicator-report-card.is-pending .indicator-report-card-value strong {
  color: var(--amber);
}

.indicator-report-card-value span {
  color: var(--muted);
  font-size: 12px;
}

.indicator-report-card dl {
  border-top: 1px solid #edf1f3;
  display: grid;
  gap: 7px;
  margin: 0;
  padding-top: 10px;
}

.indicator-report-card dl > div {
  display: grid;
  gap: 7px;
  grid-template-columns: auto minmax(0, 1fr);
}

.indicator-report-card dt,
.indicator-report-card dd {
  font-size: 11px;
  margin: 0;
}

.indicator-report-card dt {
  color: var(--muted);
}

.indicator-report-card dd {
  overflow-wrap: anywhere;
  text-align: right;
}

.indicator-report-conclusion {
  background: #f7fbfa;
  border-color: #d7e9e7;
  padding: 15px;
}

.indicator-report-eyebrow {
  color: var(--brand-strong);
  display: block;
  font-size: 11px;
  font-weight: 800;
  margin-bottom: 5px;
}

.indicator-report-conclusion > strong {
  color: var(--brand-strong);
  display: block;
  font-size: 15px;
  margin: 14px 0 7px;
}

.indicator-report-conclusion > p {
  color: #40535d;
  font-size: 13px;
  line-height: 1.7;
}

.indicator-report-focus {
  display: grid;
  gap: 7px;
  margin-top: 12px;
}

.indicator-report-focus span {
  background: #fff;
  border: 1px solid #dfe9e7;
  border-left: 3px solid var(--amber);
  border-radius: 7px;
  color: #42545c;
  font-size: 12px;
  line-height: 1.5;
  padding: 8px 9px;
}

.indicator-report-focus span.is-warning {
  border-left-color: var(--red);
  color: var(--red);
}

.indicator-report-focus span.is-normal {
  border-left-color: var(--green);
  color: var(--green);
}

.indicator-report-warning-section {
  border-top: 1px solid #dfecea;
  margin-top: 14px;
  padding-top: 13px;
}

.indicator-report-warning-section h4 {
  font-size: 13px;
}

.indicator-report-warning-section .risk-list {
  margin-top: 8px;
}

.indicator-report-warning-section .risk-item {
  align-items: center;
  display: flex;
  gap: 8px;
  justify-content: space-between;
}

.indicator-report-warning-section .risk-item button {
  flex: 0 0 auto;
  font-size: 11px;
  padding: 6px 8px;
}

.indicator-entry-panel {
  border: 1px solid var(--line);
  border-radius: 9px;
  margin-top: 14px;
  overflow: hidden;
}

.indicator-entry-panel > summary {
  align-items: center;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  list-style: none;
  padding: 12px 14px;
}

.indicator-entry-panel > summary::-webkit-details-marker {
  display: none;
}

.indicator-entry-panel > summary span {
  display: grid;
  gap: 3px;
}

.indicator-entry-panel > summary small {
  color: var(--muted);
  font-size: 12px;
}

.indicator-entry-panel > summary b {
  color: var(--brand-strong);
  font-size: 12px;
}

.indicator-entry-panel[open] > summary {
  background: #f7fbfa;
  border-bottom: 1px solid var(--line);
}

.indicator-entry-panel[open] > summary b {
  font-size: 0;
}

.indicator-entry-panel[open] > summary b::after {
  content: "收起填报";
  font-size: 12px;
}

.indicator-entry-body {
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 12px 14px;
}

.indicator-entry-body .signal-list {
  gap: 4px;
}

.indicator-entry-body .signal-list li {
  gap: 18px;
  padding: 6px 0;
}

.indicator-entry-actions {
  align-content: end;
  display: grid;
  gap: 8px;
  min-width: 170px;
}

.indicator-entry-actions small {
  color: var(--muted);
  font-size: 11px;
  text-align: right;
}

.signal-list li {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
}

.signal-list li:last-child {
  border-bottom: 0;
}

.signal-list strong {
  color: var(--green);
}

.signal-list .risk {
  color: var(--red);
}

.risk-list,
.score-detail-list,
.audit-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.risk-item {
  background: #fff0ee;
  border: 1px solid #f2c6c0;
  border-radius: 8px;
  color: var(--red);
  font-size: 13px;
  font-weight: 800;
  padding: 10px 12px;
}

.score-detail,
.audit-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 8px;
  padding: 10px 12px;
}

.score-detail span,
.score-detail small,
.audit-item p,
.audit-item small {
  color: var(--muted);
}

.level1-statistics-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-bottom: 14px;
  padding: 14px;
}

.level1-statistics-panel .section-head {
  align-items: start;
  display: flex;
  justify-content: space-between;
  margin-bottom: 12px;
}

.level1-statistics-panel h3 {
  margin: 0;
}

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

.stats-metric-card {
  background: #f6faf9;
  border: 1px solid #dcebe8;
  border-radius: 8px;
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 10px;
}

.stats-metric-card strong {
  color: var(--brand-strong);
  font-size: 20px;
}

.stats-metric-card small,
.stats-metric-card span {
  color: var(--muted);
  font-size: 12px;
}

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

.statistics-grid section {
  border: 1px solid var(--line);
  border-radius: 8px;
  min-width: 0;
  padding: 12px;
}

.statistics-grid h3 {
  font-size: 14px;
  margin: 0 0 12px;
}

.bar-chart,
.stats-table {
  display: grid;
  gap: 10px;
}

.bar-row {
  align-items: center;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(96px, 1fr) 2fr auto;
}

.bar-row span,
.stats-row span,
.trend-column small {
  color: var(--muted);
  font-size: 12px;
}

.bar-track {
  background: #edf2f4;
  border-radius: 6px;
  height: 10px;
  overflow: hidden;
}

.bar-track i {
  background: var(--brand);
  display: block;
  height: 100%;
}

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

.stats-row {
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 5px;
  grid-template-columns: minmax(0, 1fr) auto;
  padding-bottom: 9px;
}

.stats-row span {
  grid-column: 1 / -1;
}

.stats-row b {
  color: var(--red);
}

.line-chart {
  align-items: end;
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  min-height: 180px;
  padding-top: 10px;
}

.trend-column {
  align-items: center;
  display: grid;
  gap: 6px;
  height: 160px;
}

.trend-column i {
  align-self: end;
  background: var(--green);
  border-radius: 6px 6px 0 0;
  display: block;
  min-height: 8px;
  width: 100%;
}

.trend-column span {
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.scatter-chart {
  background: linear-gradient(to top, #eef4f2, transparent), linear-gradient(to right, #eef4f2, transparent);
  border: 1px solid var(--line);
  border-radius: 8px;
  height: 180px;
  position: relative;
}

.scatter-dot {
  align-items: center;
  background: var(--amber);
  border-radius: 999px;
  bottom: 0;
  color: #fff;
  display: inline-flex;
  font-size: 11px;
  height: 28px;
  justify-content: center;
  padding: 0;
  position: absolute;
  transform: translate(-50%, 50%);
  width: 28px;
}

.audit-toolbar {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(4, minmax(0, 180px));
  margin-bottom: 12px;
}

.audit-summary {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 12px;
}

.audit-summary span {
  background: #f6faf9;
  border: 1px solid #d3e8e6;
  border-radius: 8px;
  color: var(--muted);
  display: grid;
  gap: 4px;
  padding: 10px 12px;
}

.audit-summary strong {
  color: var(--text);
  font-size: 20px;
}

.audit-toolbar label {
  color: var(--muted);
  display: grid;
  font-size: 13px;
  font-weight: 700;
  gap: 7px;
}

.audit-item {
  align-items: center;
  grid-template-columns: 1fr auto auto;
}

.business-audit-item {
  align-items: start;
  grid-template-columns: minmax(0, 1fr) auto;
}

.audit-item-details {
  margin-top: 10px;
}

.audit-item-details summary {
  color: var(--brand-strong);
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
}

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

.audit-snapshot-grid section {
  background: #f7faf9;
  border: 1px solid var(--line);
  border-radius: 8px;
  min-width: 0;
  padding: 10px;
}

.audit-snapshot-grid pre {
  color: var(--text);
  font-size: 11px;
  line-height: 1.55;
  margin: 8px 0 0;
  max-height: 240px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

.inline-input {
  align-items: center;
  color: var(--muted);
  display: inline-flex;
  gap: 5px;
  justify-content: flex-end;
  margin: 0;
}

.inline-input input {
  padding: 7px 8px;
  text-align: right;
  width: 86px;
}

.progress-block {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
}

.progress-block label {
  font-weight: 700;
}

.progress-block small {
  color: var(--muted);
}

.bar {
  background: #e8edf1;
  border-radius: 999px;
  height: 10px;
  overflow: hidden;
}

.bar span {
  background: var(--brand);
  display: block;
  height: 100%;
}

.bar.amber span {
  background: var(--amber);
}

.report-preview {
  background: #f6faf9;
  border: 1px solid #d3e8e6;
  border-radius: 8px;
  color: #26413f;
  line-height: 1.7;
  padding: 16px;
}

.dashboard-report-panel .panel-head > div:first-child p {
  color: var(--muted);
  font-size: 12px;
  margin: 4px 0 0;
}

.quality-report-rule-panel {
  background: #f7fbfa;
  border: 1px solid #d7e9e7;
  border-radius: 10px;
  display: grid;
  gap: 13px;
  margin-bottom: 14px;
  padding: 14px;
}

@media (min-width: 1281px) {
  .dashboard-report-panel .quality-report-rule-panel {
    align-items: start;
    grid-template-columns: minmax(280px, 0.72fr) minmax(0, 1.28fr);
  }

  .dashboard-report-panel .quality-report-level-tabs {
    grid-column: 1;
  }

  .dashboard-report-panel .quality-report-type-options {
    align-content: start;
    grid-column: 2;
    min-height: 42px;
  }

  .dashboard-report-panel .quality-report-period-row {
    grid-column: 1 / -1;
    grid-template-columns: minmax(180px, 230px) minmax(0, 1fr);
  }

  .dashboard-report-panel .report-toolbar {
    grid-template-columns: minmax(180px, 260px) minmax(180px, 220px);
  }
}

.quality-report-level-tabs {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.quality-report-level-tabs button,
.quality-report-type-options button {
  background: #fff;
  border: 1px solid var(--line);
  color: var(--muted);
}

.quality-report-level-tabs button {
  border-radius: 8px;
  padding: 10px 12px;
}

.quality-report-level-tabs button[aria-pressed="true"] {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.quality-report-type-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.quality-report-type-options button {
  border-radius: 999px;
  font-size: 13px;
  padding: 8px 13px;
}

.quality-report-type-options button[aria-pressed="true"] {
  background: #e4f2f0;
  border-color: var(--brand);
  color: var(--brand-strong);
}

.quality-report-type-options button[aria-pressed="true"]::before {
  content: "✓";
  margin-right: 5px;
}

.quality-report-level-tabs button:focus-visible,
.quality-report-type-options button:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--brand) 26%, transparent);
  outline-offset: 2px;
}

.quality-report-period-row {
  align-items: stretch;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(170px, 220px) minmax(0, 1fr);
}

.quality-report-period-row > label {
  color: var(--muted);
  display: grid;
  font-size: 12px;
  font-weight: 700;
  gap: 6px;
}

.quality-report-current-rule {
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 3px 10px;
  grid-template-columns: auto minmax(0, 1fr);
  padding: 10px 12px;
}

.quality-report-current-rule > span {
  background: #e5f2f0;
  border-radius: 999px;
  color: var(--brand-strong);
  font-size: 12px;
  font-weight: 800;
  grid-row: 1 / 3;
  padding: 5px 9px;
}

.quality-report-current-rule > strong {
  color: var(--text);
  font-size: 14px;
}

.quality-report-current-rule > small {
  color: var(--muted);
}

.report-content {
  display: grid;
  gap: 12px;
  white-space: normal;
}

.report-content-error {
  background: #fff8f7;
  border: 1px solid #efc7c3;
  border-radius: 8px;
  color: #8c2e27;
  padding: 14px;
}

.report-error {
  display: grid;
  gap: 6px;
}

.report-error h3,
.report-error p,
.report-error small {
  margin: 0;
}

.report-error h3 {
  color: #8c2e27;
  font-size: 15px;
}

.report-error small {
  color: #9b625d;
  overflow-wrap: anywhere;
}

.report-content > p,
.report-section p {
  margin: 0;
}

.report-section {
  background: #ffffff;
  border: 1px solid #e0ecea;
  border-radius: 8px;
  display: grid;
  gap: 8px;
  padding: 14px;
}

.report-section h3,
.report-section h4 {
  color: var(--brand-strong);
  font-size: 16px;
  margin: 0;
}

.report-section h3 {
  font-size: 18px;
}

.report-toolbar {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 220px));
  margin: 0 0 12px;
}

.report-toolbar label {
  color: var(--muted);
  display: grid;
  font-size: 13px;
  gap: 6px;
}

.report-history {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.report-lifecycle-notice {
  color: var(--muted);
  font-size: 0.86rem;
  margin: 10px 0 0;
}

.report-history-item {
  align-items: center;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  cursor: pointer;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 12px;
  text-align: left;
}

.report-history-item:hover {
  border-color: var(--brand);
}

.report-history-item span:first-child {
  display: grid;
  gap: 4px;
}

.report-history-item small {
  color: var(--muted);
}

.report-lifecycle-meta {
  color: var(--muted);
  grid-column: 1 / -1;
  overflow-wrap: anywhere;
}

.report-lifecycle-actions {
  display: flex;
  gap: 8px;
  grid-column: 1 / -1;
  justify-content: flex-end;
}

.template-reference-impact {
  color: var(--muted);
  display: block;
  margin-top: 6px;
}

.review-summary {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 16px;
}

.review-summary span {
  background: #f8fbfc;
  border: 1px solid #e0e9ee;
  border-radius: 8px;
  color: var(--muted);
  display: grid;
  gap: 4px;
  min-height: 78px;
  padding: 13px 14px;
}

.review-summary strong {
  color: var(--brand-strong);
  font-size: 24px;
  line-height: 1;
}

.review-list {
  display: grid;
  gap: 10px;
}

.notification-list {
  display: grid;
  gap: 9px;
  max-height: 390px;
  overflow-y: auto;
  padding-right: 2px;
}

.notification-level-rules {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 10px;
}

.notification-level-rules > div {
  background: #f7fafb;
  border: 1px solid #e1e9ee;
  border-radius: 8px;
  display: grid;
  gap: 3px;
  padding: 9px 10px;
}

.notification-level-rules span {
  color: var(--brand-strong);
  font-size: 12px;
  font-weight: 800;
}

.notification-level-rules strong {
  color: var(--text);
  font-size: 13px;
}

.notification-risk-legend {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 12px;
}

.notification-risk-legend span,
.notification-reminder-badge {
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  padding: 4px 8px;
}

.notification-risk-legend .normal,
.notification-reminder-badge.normal {
  background: #eef4f6;
  color: #586b77;
}

.notification-risk-legend .overdue,
.notification-reminder-badge.overdue {
  background: #fff4e5;
  border-color: #f0d3a7;
  color: #9b5e12;
}

.notification-risk-legend .repeated,
.notification-reminder-badge.repeated {
  background: #fff0e8;
  border-color: #edc4ae;
  color: #a64d21;
}

.notification-risk-legend .critical,
.notification-reminder-badge.critical {
  background: #fcebea;
  border-color: #e8bbb7;
  color: var(--red);
}

.notification-item {
  align-items: center;
  background: #fbfdfd;
  border: 1px solid #e4edf2;
  border-radius: 8px;
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr auto;
  padding: 12px 13px;
}

.notification-item.reminder-overdue {
  border-left: 4px solid var(--amber);
}

.notification-item.reminder-repeated {
  border-left: 4px solid #d2612d;
}

.notification-item.reminder-critical {
  border-left: 4px solid var(--red);
}

.notification-item.is-read {
  background: #f8fafc;
}

.notification-title-row {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.notification-title-row .notification-reminder-badge {
  display: inline-flex;
  margin: 0;
}

.notification-item p {
  color: var(--muted);
  line-height: 1.5;
  margin-top: 6px;
}

.notification-item span {
  color: var(--muted);
  display: block;
  font-size: 12px;
  margin-top: 8px;
}

.notification-delivery-monitor {
  border-top: 1px solid #e4edf2;
  display: grid;
  gap: 12px;
  margin-top: 18px;
  padding-top: 18px;
}

.notification-monitor-head {
  align-items: flex-start;
  display: flex;
  gap: 16px;
  justify-content: space-between;
}

.notification-monitor-head h3 {
  font-size: 16px;
  margin: 0;
}

.notification-monitor-status {
  color: var(--muted);
  font-size: 12px;
  margin: 5px 0 0;
}

.notification-monitor-status.is-ready {
  color: var(--brand-strong);
}

.notification-monitor-status.is-error {
  color: var(--red);
}

.notification-monitor-status.is-disabled {
  color: var(--muted);
}

.notification-monitor-summary {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.notification-monitor-summary span {
  background: #f7fafb;
  border: 1px solid #e1e9ee;
  border-radius: 8px;
  color: var(--muted);
  display: grid;
  gap: 4px;
  padding: 9px 10px;
}

.notification-monitor-summary strong {
  color: var(--brand-strong);
  font-size: 20px;
  line-height: 1;
}

.notification-monitor-channels,
.notification-monitor-failures {
  display: grid;
  gap: 8px;
}

.notification-monitor-channel,
.notification-monitor-failure {
  background: #fbfdfd;
  border: 1px solid #e1e9ee;
  border-radius: 8px;
  padding: 10px 12px;
}

.notification-monitor-channel.is-ready {
  border-left: 4px solid var(--brand);
}

.notification-monitor-channel.is-error {
  border-left: 4px solid var(--red);
}

.notification-monitor-channel.is-disabled {
  border-left: 4px solid #b8c5cc;
}

.notification-monitor-channel-head,
.notification-monitor-failure-meta {
  align-items: center;
  display: flex;
  gap: 8px;
  justify-content: space-between;
}

.notification-monitor-channel-head span,
.notification-monitor-failure-meta span,
.notification-monitor-failure small {
  color: var(--muted);
  font-size: 12px;
}

.notification-monitor-channel p,
.notification-monitor-failure p {
  color: var(--muted);
  font-size: 12px;
  margin: 6px 0 0;
}

.notification-monitor-failure small {
  display: block;
  margin-top: 6px;
}

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

.review-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 10px;
  padding: 12px;
}

.review-item.is-overdue {
  background: color-mix(in srgb, var(--red) 7%, var(--panel));
  border-color: color-mix(in srgb, var(--red) 55%, var(--line));
}

.review-item-head {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-content: space-between;
}

.review-item h3 {
  font-size: 15px;
  margin: 0;
}

.review-item p {
  color: var(--muted);
  line-height: 1.55;
}

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

.evidence-summary {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.evidence-summary small {
  color: var(--muted);
}

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

.training-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 10px;
  padding: 12px;
}

.training-card h3 {
  font-size: 15px;
  margin: 0;
}

.training-card p {
  color: var(--muted);
  line-height: 1.55;
}

.training-meta {
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  font-size: 13px;
  gap: 8px;
}

.training-error {
  margin: 8px 0 0;
  color: #b42318;
  font-size: 13px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

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

.template-toolbar {
  display: grid;
  gap: 12px;
  grid-template-columns: 1.2fr 1.4fr 0.6fr 0.6fr 0.8fr 0.7fr;
  margin-bottom: 12px;
}

.template-toolbar label {
  color: var(--muted);
  display: grid;
  font-size: 13px;
  font-weight: 700;
  gap: 7px;
}

.template-toolbar select[multiple] {
  min-height: 104px;
  overflow: auto;
}

.check-group-state-field {
  display: none !important;
}

.check-group-builder {
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 16px;
  margin-bottom: 14px;
  padding: 14px;
}

.quality-level-create-view {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(31, 57, 72, 0.06);
  gap: 20px;
  padding: 20px;
}

.builder-head {
  align-items: center;
  display: flex;
  gap: 16px;
  justify-content: space-between;
}

.quality-level-create-view > .builder-head {
  border-bottom: 1px solid #edf1f3;
  padding: 0 2px 15px;
}

.builder-head h3,
.completion-panel h4,
.type-binding-panel h4 {
  font-size: 16px;
  margin: 0;
}

.builder-head p,
.completion-panel p,
.type-binding-panel p {
  color: var(--muted);
  line-height: 1.55;
  margin-top: 5px;
}

.level-launcher,
.wizard-actions,
.completion-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.quality-level-create-view > .wizard-actions {
  backdrop-filter: blur(10px);
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid #dce8e6;
  border-radius: 10px;
  bottom: 12px;
  box-shadow: 0 10px 26px rgba(31, 57, 72, 0.12);
  justify-self: end;
  padding: 10px 12px;
  position: sticky;
  width: fit-content;
  z-index: 20;
}

.quality-level-create-view > .wizard-actions button {
  min-width: 82px;
}

.wizard-steps {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  list-style: none;
  margin: 0;
  padding: 0 0 14px;
}

.quality-level-create-view > .wizard-steps {
  background: #f7faf9;
  border: 1px solid #e2eceb;
  border-radius: 10px;
  padding: 11px 14px;
}

.wizard-steps li {
  align-items: center;
  color: #a3adb5;
  display: flex;
  gap: 8px;
  justify-content: center;
  min-width: 0;
}

.wizard-steps span {
  align-items: center;
  background: #d6dade;
  border-radius: 999px;
  color: #fff;
  display: inline-flex;
  font-weight: 900;
  height: 38px;
  justify-content: center;
  width: 38px;
}

.wizard-steps strong {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 18px;
}

.wizard-steps li.active,
.wizard-steps li.done {
  color: var(--brand-strong);
}

.wizard-steps li.active span,
.wizard-steps li.done span,
.wizard-steps li.active strong {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.check-group-wizard-panel {
  display: none;
}

.check-group-wizard-panel.active {
  display: grid;
  gap: 14px;
}

.basic-settings-form {
  display: grid;
  gap: 16px;
}

.quality-level-rule-card {
  align-items: flex-start;
  background: #f2f8f7;
  border: 1px solid #d7e9e7;
  border-radius: 10px;
  display: grid;
  gap: 14px;
  grid-template-columns: auto minmax(0, 1fr);
  margin-left: 102px;
  padding: 14px 16px;
}

.quality-project-guidance-layout {
  align-items: start;
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(310px, 0.72fr) minmax(560px, 1.28fr);
  margin-left: 102px;
}

.quality-level-rule-card strong {
  color: var(--text);
  display: block;
  margin-bottom: 4px;
}

.quality-level-rule-card p,
.quality-level-rule-card small {
  color: var(--muted);
  line-height: 1.55;
  margin: 0;
}

.quality-level-rule-badge {
  background: var(--brand);
  border-radius: 999px;
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  padding: 6px 10px;
  white-space: nowrap;
}

.quality-level-process-guide {
  align-self: start;
  background: #fff;
  border: 1px dashed color-mix(in srgb, var(--brand) 40%, var(--line));
  border-radius: 9px;
  display: grid;
  gap: 10px;
  margin: 0;
  min-width: 0;
  padding: 13px 16px;
}

.quality-level-process-heading {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-content: space-between;
}

.quality-level-process-heading strong {
  color: var(--text);
  font-size: 14px;
}

.quality-level-process-heading span {
  background: color-mix(in srgb, var(--brand) 9%, #fff);
  border: 1px solid color-mix(in srgb, var(--brand) 22%, var(--line));
  border-radius: 999px;
  color: var(--brand);
  font-size: 12px;
  font-weight: 800;
  padding: 3px 9px;
  white-space: nowrap;
}

.quality-level-process-steps {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.quality-level-process-steps li {
  background: #f7faf9;
  border: 1px solid color-mix(in srgb, var(--brand) 18%, var(--line));
  border-radius: 7px;
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
  padding: 7px 11px;
  position: relative;
}

.quality-level-process-steps li:not(:last-child)::after {
  color: var(--brand);
  content: "→";
  font-weight: 900;
  position: absolute;
  right: -17px;
}

.quality-level-process-guide p,
.quality-level-process-guide small {
  margin: 0;
}

.quality-level-process-guide p {
  color: var(--brand-strong);
  font-size: 13px;
  font-weight: 800;
}

.quality-level-metric-strip {
  align-items: center;
  border-top: 1px solid color-mix(in srgb, var(--brand) 12%, var(--line));
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  padding-top: 10px;
}

.quality-level-metric-strip > strong {
  color: var(--text);
  font-size: 13px;
}

.quality-level-metric-strip ul {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.quality-level-metric-strip li {
  background: color-mix(in srgb, var(--brand) 8%, #fff);
  border: 1px solid color-mix(in srgb, var(--brand) 20%, var(--line));
  border-radius: 999px;
  color: var(--brand-strong);
  font-size: 12px;
  font-weight: 800;
  padding: 4px 9px;
}

.quality-level-process-guide small {
  color: var(--muted);
  line-height: 1.55;
}

.basic-form-row {
  align-items: start;
  display: grid;
  gap: 12px;
  grid-template-columns: 90px minmax(0, 1fr);
}

.basic-form-row > label {
  color: var(--text);
  font-weight: 800;
  padding-top: 10px;
}

.basic-form-row > label span {
  color: var(--red);
}

.hidden-field,
.basic-form-row.hidden-field {
  display: none;
}

.inline-field span,
.time-duration-editor span {
  align-items: center;
  background: #f8fafb;
  border: 1px solid var(--line);
  color: var(--muted);
  display: flex;
  font-weight: 700;
  padding: 0 12px;
}

.time-period-panel {
  display: grid;
  gap: 12px;
}

.quality-level-create-view .time-row {
  background: #fbfdfd;
  border: 1px solid #e1ecea;
  border-radius: 11px;
  padding: 14px 16px;
}

.quality-level-create-view .time-row > label {
  padding-top: 9px;
}

.quality-level-create-view .time-period-panel {
  align-items: center;
  grid-template-columns: minmax(500px, auto) 174px minmax(230px, 1fr);
}

.quality-level-create-view .time-period-panel > .field-hint {
  grid-column: 1 / -1;
}

.date-range-picker {
  align-items: center;
  display: grid;
  gap: 10px;
  grid-template-columns: 260px auto 260px 32px;
  justify-content: start;
}

.quality-level-create-view .date-range-picker {
  grid-template-columns: 225px auto 225px 30px;
}

.date-range-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 50px;
}

.date-range-control input {
  border: 1px solid var(--line);
  border-radius: 8px 0 0 8px;
  border-right: 0;
  font-size: 16px;
  min-height: 42px;
  min-width: 0;
  padding: 8px 12px;
}

.date-range-control input::-webkit-calendar-picker-indicator {
  opacity: 0;
  width: 0;
}

.date-picker-trigger {
  align-items: center;
  background: #f8fafb;
  border: 1px solid var(--line);
  border-radius: 0 8px 8px 0;
  color: var(--brand);
  cursor: pointer;
  display: flex;
  justify-content: center;
  padding: 0;
}

.date-picker-trigger:hover {
  background: #edf6f5;
  border-color: var(--brand);
}

.date-picker-trigger svg {
  fill: none;
  height: 24px;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
  width: 24px;
}

.date-range-separator {
  color: var(--text);
  font-size: 19px;
}

.date-range-help {
  align-items: center;
  background: #fff;
  border: 2px solid var(--muted);
  border-radius: 50%;
  color: var(--muted);
  cursor: help;
  display: flex;
  font-size: 17px;
  font-weight: 800;
  height: 26px;
  justify-content: center;
  padding: 0;
  width: 26px;
}

.time-duration-editor {
  display: grid;
  grid-template-columns: 80px minmax(0, 1fr);
}

.quality-level-create-view .time-duration-editor {
  grid-template-columns: 68px 106px;
}

.quality-level-create-view .time-duration-editor span {
  justify-content: center;
  padding: 0 8px;
}

.time-duration-editor input {
  min-width: 0;
}

.duration-unit-options {
  border: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
}

.duration-unit-options button {
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  cursor: pointer;
  display: inline-flex;
  font-weight: 800;
  justify-content: center;
  min-width: 84px;
  padding: 9px 14px;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.quality-level-create-view .duration-unit-options button {
  min-width: 72px;
  padding: 9px 12px;
}

.duration-unit-options button[hidden] {
  display: none;
}

.duration-unit-options button[aria-pressed="true"] {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.duration-unit-options button[aria-pressed="true"]::before {
  content: "✓";
  margin-right: 6px;
}

.duration-unit-options button:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--brand) 28%, transparent);
  outline-offset: 2px;
}

.duration-unit-options:disabled button {
  cursor: not-allowed;
  opacity: 0.55;
}

.quality-project-scope-editor {
  display: grid;
  gap: 10px;
  max-width: 760px;
}

.quality-project-scope-editor [hidden],
.quality-project-sampling-panel[hidden],
.quality-project-sampling-fields[hidden] {
  display: none !important;
}

.quality-project-multi-department-field {
  color: var(--text);
  display: grid;
  font-weight: 800;
  gap: 7px;
}

.quality-project-search-select {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.quality-project-search-select > input,
.quality-project-multi-department-field > input {
  min-height: 40px;
}

.quality-project-search-select > select {
  min-height: 42px;
}

.quality-project-search-status {
  color: var(--brand-strong);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
  min-height: 17px;
}

.quality-project-multi-department-field select {
  min-height: 132px;
}

.quality-project-multi-department-field small {
  color: var(--muted);
  font-weight: 400;
}

.quality-project-sampling-panel {
  background: #f8fafb;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 10px;
  padding: 12px;
}

.quality-project-sampling-toggle {
  align-items: center;
  display: flex;
  font-weight: 800;
  gap: 8px;
}

.quality-project-sampling-fields {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.quality-project-sampling-fields label {
  color: var(--muted);
  display: grid;
  font-size: 13px;
  gap: 6px;
}

.time-period-panel .field-hint {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.split-row {
  grid-template-columns: 90px minmax(0, 1fr) minmax(0, 1fr);
}

.inline-field {
  display: grid;
  grid-template-columns: 80px minmax(0, 1fr);
}

.quality-project-access-card {
  background: #fbfdfd;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 8px 22px rgba(31, 57, 72, 0.05);
  margin-left: 102px;
  overflow: hidden;
}

.quality-project-access-head {
  align-items: center;
  background: #f2f8f7;
  border-bottom: 1px solid #d7e9e7;
  display: flex;
  gap: 11px;
  padding: 13px 18px;
}

.quality-project-access-head > span {
  align-items: center;
  background: var(--brand);
  border-radius: 8px;
  color: #fff;
  display: inline-flex;
  flex: 0 0 auto;
  font-size: 13px;
  font-weight: 900;
  height: 32px;
  justify-content: center;
  width: 32px;
}

.quality-project-access-head strong,
.quality-project-access-head small {
  display: block;
}

.quality-project-access-head strong {
  color: var(--text);
  font-size: 15px;
  margin-bottom: 2px;
}

.quality-project-access-head small {
  color: var(--muted);
  font-size: 12px;
}

.quality-project-access-body {
  display: grid;
  padding: 4px 18px 8px;
}

.quality-project-access-body > .basic-form-row {
  border-bottom: 1px solid #edf1f4;
  gap: 16px;
  grid-template-columns: 96px minmax(0, 1fr);
  padding: 14px 0;
}

.quality-project-access-body > .basic-form-row:last-child {
  border-bottom: 0;
}

.quality-project-access-body > .basic-form-row > label {
  color: #40515d;
  font-size: 14px;
  padding-top: 9px;
}

.quality-project-access-body input,
.quality-project-access-body select,
.quality-project-access-body textarea {
  background: #fff;
}

.quality-project-access-body input:focus,
.quality-project-access-body select:focus,
.quality-project-access-body textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(11, 127, 121, 0.12);
  outline: 0;
}

.quality-project-access-body .inline-field {
  grid-template-columns: 96px minmax(0, 1fr);
}

.quality-project-access-body .inline-field > span {
  border-radius: 7px 0 0 7px;
  border-right: 0;
  justify-content: center;
}

.quality-project-access-body .inline-field > select {
  border-radius: 0 7px 7px 0;
  min-height: 42px;
}

.quality-project-access-body .inline-field > .quality-project-search-select {
  border-left: 1px solid var(--line);
  padding-left: 10px;
}

.quality-project-scope-summary {
  align-items: center;
  background: #f3f8f7;
  border-radius: 7px;
  color: var(--muted);
  display: flex;
  font-size: 13px;
  gap: 9px;
  justify-self: start;
  padding: 7px 11px;
}

.quality-project-scope-summary strong {
  color: var(--brand-strong);
}

.quality-project-creator-field {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-width: 760px;
}

.quality-project-creator-item {
  display: grid;
  gap: 6px;
  margin: 0;
}

.quality-project-creator-item > span,
.quality-project-creator-item > label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.quality-project-creator-item > strong {
  align-items: center;
  background: #f8fafb;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: #536570;
  display: flex;
  font-size: 14px;
  font-weight: 600;
  min-height: 42px;
  padding: 9px 12px;
}

.share-options {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-width: 760px;
}

.share-option-card {
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  gap: 10px;
  min-height: 62px;
  padding: 10px 12px;
  transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.share-option-card:hover {
  border-color: color-mix(in srgb, var(--brand) 50%, var(--line));
}

.share-option-card:has(input:checked) {
  background: #f0f8f7;
  border-color: var(--brand);
  box-shadow: 0 0 0 2px rgba(11, 127, 121, 0.08);
}

.share-option-card input {
  accent-color: var(--brand);
  flex: 0 0 auto;
  height: 18px;
  margin: 0;
  width: 18px;
}

.share-option-card span,
.share-option-card strong,
.share-option-card small {
  display: block;
}

.share-option-card strong {
  color: var(--text);
  font-size: 14px;
  margin-bottom: 3px;
}

.share-option-card small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.4;
}

.quality-project-description-row textarea {
  max-width: 760px;
  min-height: 96px;
}

.quality-project-description-row textarea::placeholder {
  color: #9aa8b2;
}

.permission-block {
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 10px;
  padding: 12px;
}

.permission-block strong {
  color: var(--brand-strong);
}

.permission-block label {
  align-items: center;
  color: var(--muted);
  display: flex;
  font-size: 13px;
  gap: 8px;
}

.permission-block input {
  width: auto;
}

.quality-project-governance-card {
  align-self: start;
  background: #f8fbfa;
  border: 1px solid #d7e9e7;
  border-radius: 10px;
  display: grid;
  gap: 14px;
  margin: 0;
  min-width: 0;
  padding: 15px 16px 16px;
}

.quality-project-governance-card > summary {
  cursor: pointer;
  list-style: none;
}

.quality-project-governance-card > summary::-webkit-details-marker {
  display: none;
}

.quality-project-governance-card > summary::after {
  background: color-mix(in srgb, var(--brand) 9%, #fff);
  border: 1px solid color-mix(in srgb, var(--brand) 22%, var(--line));
  border-radius: 999px;
  color: var(--brand);
  content: "展开设置";
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 800;
  padding: 3px 9px;
  white-space: nowrap;
}

.quality-project-governance-card[open] > summary::after {
  content: "收起设置";
}

.quality-project-governance-card > summary:focus-visible {
  border-radius: 7px;
  outline: 2px solid color-mix(in srgb, var(--brand) 55%, #fff);
  outline-offset: 3px;
}

.quality-project-governance-head,
.quality-project-governance-head > div,
.quality-project-performance-toggle {
  align-items: center;
  display: flex;
}

.quality-project-governance-head {
  gap: 16px;
  justify-content: space-between;
}

.quality-project-governance-head > div {
  gap: 10px;
  min-width: 0;
}

.quality-project-governance-head > div > span {
  align-items: center;
  background: var(--brand);
  border-radius: 8px;
  color: #fff;
  display: inline-flex;
  flex: 0 0 34px;
  font-size: 12px;
  font-weight: 800;
  height: 34px;
  justify-content: center;
}

.quality-project-governance-head strong,
.quality-project-governance-head small,
.quality-project-performance-toggle span,
.quality-project-performance-toggle strong,
.quality-project-performance-toggle small {
  display: block;
}

.quality-project-governance-head small,
.quality-project-performance-toggle small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  margin-top: 2px;
}

.quality-project-performance-toggle {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  flex: 0 0 auto;
  gap: 9px;
  padding: 8px 10px;
}

.quality-project-performance-toggle:has(input:checked) {
  background: #f0f8f7;
  border-color: var(--brand);
}

.quality-project-performance-toggle input {
  accent-color: var(--brand);
  height: 18px;
  margin: 0;
  width: 18px;
}

.quality-project-performance-toggle strong {
  font-size: 13px;
}

.quality-project-governance-grid {
  border-top: 1px solid #e2edeb;
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding-top: 14px;
}

.quality-project-governance-grid > label {
  color: var(--text);
  display: grid;
  font-size: 13px;
  font-weight: 800;
  gap: 7px;
  min-width: 0;
}

.quality-project-governance-grid input[readonly] {
  background: #f4f7f7;
  color: #43525a;
  cursor: default;
}

.quality-project-governance-grid textarea {
  line-height: 1.55;
  min-height: 64px;
  resize: vertical;
}

.quality-project-governance-wide {
  grid-column: 1 / -1;
}

.quality-project-governance-grid [hidden] {
  display: none !important;
}

@media (max-width: 1240px) {
  .quality-project-guidance-layout {
    grid-template-columns: 1fr;
  }

  .quality-level-create-view .time-period-panel {
    grid-template-columns: 174px minmax(0, 1fr);
  }

  .quality-level-create-view .date-range-picker {
    grid-column: 1 / -1;
  }
}

.quality-project-personnel-business-summary {
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 8px;
  grid-template-columns: auto auto minmax(0, 1fr);
  padding: 10px 12px;
}

.quality-project-personnel-business-summary > span,
.quality-project-personnel-business-summary > small {
  color: var(--muted);
  font-size: 12px;
}

.quality-project-personnel-business-summary > strong {
  color: var(--brand-strong);
  font-size: 13px;
}

.quality-project-personnel-model {
  background: #f8fbfa;
  border: 1px solid #d7e9e7;
  border-radius: 10px;
  display: grid;
  gap: 13px;
  padding: 14px 16px;
}

.quality-project-personnel-head,
.quality-project-personnel-head > div,
.quality-project-role-config > div:first-child,
.quality-project-data-access {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-content: space-between;
}

.quality-project-personnel-head span {
  background: var(--brand);
  border-radius: 999px;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  padding: 5px 9px;
}

.quality-project-personnel-head small,
.quality-project-role-config small,
.quality-project-data-access small {
  color: var(--muted);
  line-height: 1.5;
}

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

.quality-project-personnel-grid label,
.quality-project-role-name-field {
  color: var(--text);
  display: grid;
  font-size: 13px;
  font-weight: 800;
  gap: 7px;
}

.quality-project-personnel-grid [hidden] {
  display: none !important;
}

.quality-project-role-config {
  border-top: 1px solid #e2edeb;
  display: grid;
  gap: 10px;
  padding-top: 12px;
}

#qualityProjectRoleNamesInput {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.quality-project-data-access {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 12px;
}

.quality-project-data-access > div {
  display: grid;
  gap: 4px;
}

.quality-project-data-access > div > span {
  color: var(--muted);
  font-size: 12px;
}

.quality-project-sensitive-access {
  align-items: center;
  color: var(--text);
  display: flex;
  font-size: 13px;
  font-weight: 800;
  gap: 7px;
  white-space: nowrap;
}

.quality-project-sensitive-access input {
  accent-color: var(--brand);
  width: auto;
}

.check-group-picker {
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 12px;
  grid-column: 1 / -1;
  grid-template-columns: minmax(0, 1fr);
  padding: 12px;
}

.check-group-source-status {
  background: #f4faf8;
  border: 1px solid #c9e4db;
  border-radius: 8px;
  color: var(--brand-strong);
  font-size: 13px;
  font-weight: 800;
  grid-column: 1 / -1;
  padding: 9px 10px;
}

.picker-column,
.person-result-list,
.selected-person-panel,
.selected-person-section {
  display: grid;
  gap: 8px;
}

.type-binding-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 10px;
  padding: 12px;
}

.binding-condition-box,
.person-filter-box {
  border: 1px solid var(--line);
  display: grid;
}

.condition-row,
.filter-row {
  align-items: center;
  border-bottom: 1px solid #eef2f4;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 12px;
}

.condition-row:last-child,
.filter-row:last-child {
  border-bottom: 0;
}

.condition-row strong,
.filter-row strong {
  border-right: 1px solid var(--line);
  min-width: 112px;
  padding-right: 16px;
}

.condition-row span,
.filter-row span {
  color: var(--brand-strong);
  font-size: 12px;
  font-weight: 800;
  padding: 6px 9px;
}

.filter-chip {
  background: transparent;
  border-radius: 2px;
  color: var(--brand-strong);
  padding: 5px 8px;
}

.filter-chip.active {
  background: var(--brand);
  color: #fff;
}

.form-filter-row[data-form-filter-row="owner"] {
  align-items: center;
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  gap: 10px;
  overflow-x: auto;
  white-space: nowrap;
}

.form-filter-row[data-form-filter-row="owner"] strong {
  flex: 0 0 76px;
}

.form-filter-row[data-form-filter-row="owner"] .filter-chip {
  align-items: center;
  border: 1px solid #d8e9e7;
  border-radius: 6px;
  box-sizing: border-box;
  display: inline-flex;
  flex: 0 0 54px;
  height: 34px;
  justify-content: center;
  line-height: 1;
  margin: 0;
  min-width: 54px;
  padding: 0;
  width: 54px;
}

.form-filter-row[data-form-filter-row="owner"] .filter-chip.active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.person-binding-panel,
.selected-binding-panel {
  display: grid;
  gap: 10px;
}

.project-check-group-field {
  background: #f8fbfc;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

.project-check-group-picker {
  align-items: center;
  display: flex;
  gap: 10px;
  margin-top: 8px;
}

.project-check-group-picker.inline-picker {
  background: #f8fbfc;
  border: 1px solid var(--line);
  border-radius: 6px;
  flex: 1 1 480px;
  margin-top: 0;
  min-width: 360px;
  padding: 6px 8px;
}

.project-check-group-picker.inline-picker > span {
  color: var(--muted);
  flex: 0 0 auto;
  font-weight: 700;
  white-space: nowrap;
}

.project-check-group-picker select {
  flex: 1 1 auto;
  min-width: 280px;
}

.project-check-group-picker.inline-picker select {
  min-width: 180px;
}

.project-check-group-picker button {
  flex: 0 0 auto;
}

.person-binding-panel h4 {
  border-bottom: 1px solid var(--line);
  font-size: 20px;
  margin: 12px 0 0;
  padding-bottom: 10px;
}

.person-binding-panel h4 span {
  color: var(--muted);
  margin-left: 4px;
}

.binding-tabs {
  display: flex;
  gap: 0;
}

.binding-tab {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px 6px 0 0;
  color: var(--text);
}

.binding-tab.active {
  background: #eef2f4;
}

.person-filter-box label {
  align-items: center;
  border-bottom: 1px solid #eef2f4;
  display: grid;
  gap: 10px;
  grid-template-columns: 112px minmax(0, 1fr);
  padding: 10px 12px;
}

.person-filter-box label:last-of-type {
  border-bottom: 1px solid #eef2f4;
}

.person-filter-box > .ghost {
  justify-self: start;
  margin: 10px 12px;
}

.person-filter-box select[multiple] {
  min-height: 132px;
  min-width: min(420px, 100%);
}

.compact-search {
  color: var(--muted);
  display: grid;
  font-size: 13px;
  font-weight: 700;
  gap: 7px;
}

.picker-column > strong,
.selected-person-section > strong {
  font-size: 13px;
}

.person-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 5px;
  padding: 10px;
}

.person-card span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

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

.person-card-actions button {
  padding: 7px 10px;
}

.completion-panel {
  display: grid;
  gap: 26px;
}

.quality-plan-completion-hero {
  display: grid;
  gap: 8px;
  justify-items: center;
  padding: 18px 0 0;
  text-align: center;
}

.quality-plan-completion-hero h4 {
  color: #40484f;
  font-size: 30px;
  font-weight: 500;
  margin: 0;
}

.quality-plan-completion-hero p {
  color: #4f5962;
  font-size: 18px;
  margin: 0;
}

.quality-plan-completion-card {
  background: #fff;
  box-shadow: 0 4px 18px rgb(36 48 60 / 12%);
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 30px 52px;
}

.quality-plan-completion-card div {
  align-items: baseline;
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
}

.quality-plan-completion-card dt {
  color: #1f2d36;
  font-weight: 700;
  text-align: right;
}

.quality-plan-completion-card dd {
  color: #8a939b;
  margin: 0;
}

.quality-plan-completion-settings {
  border-top: 1px solid var(--line);
  display: grid;
  gap: 22px;
  padding-top: 22px;
}

.quality-plan-completion-settings h4 {
  color: #29343d;
  font-size: 26px;
  font-weight: 500;
  margin: 0;
}

.completion-rule-line {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 12px;
  padding-left: 90px;
}

.completion-rule-line span {
  color: #1f2d36;
  font-weight: 700;
}

.completion-rule-line input {
  max-width: 360px;
  min-width: 220px;
}

.completion-rule-line select {
  max-width: 360px;
  min-width: 260px;
}

.completion-rule-line .completion-unit {
  background: #f1f3f5;
  border: 1px solid #d6dce1;
  font-weight: 500;
  padding: 10px 18px;
}

.quality-plan-completion-settings p {
  color: var(--muted);
  margin: -6px 0 0 90px;
}

.template-list {
  display: grid;
  gap: 8px;
}

.template-import-preview {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.import-error {
  border-color: #f1b8b0;
}

.import-message {
  color: var(--muted);
  font-size: 13px;
}

.import-message.error {
  color: var(--red);
}

.template-total {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.template-wide-field {
  grid-column: span 3;
}

.quality-content-manager {
  border: 1px solid var(--line);
  border-radius: 8px;
  margin: 16px 0;
  padding: 14px;
}

.quality-content-form {
  grid-template-columns: 1fr 1fr 0.7fr 0.6fr 1.1fr 0.7fr;
}

.quality-content-form button {
  align-self: end;
  min-height: 40px;
}

.quality-content-rule-list {
  display: grid;
  gap: 10px;
}

.quality-content-rule {
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 8px;
  padding: 12px;
}

.quality-content-rule > div:first-child {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.quality-content-rule strong {
  color: var(--text);
}

.quality-content-rule span,
.quality-content-rule p,
.quality-content-rule dd {
  color: var(--muted);
}

.quality-content-rule dl {
  display: grid;
  gap: 6px 12px;
  grid-template-columns: auto 1fr auto 1fr auto 1fr;
  margin: 0;
}

.quality-content-rule dt {
  color: var(--text);
  font-weight: 800;
}

.quality-content-rule dd {
  margin: 0;
}

.quality-content-rule-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.template-item {
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr auto auto auto;
  padding: 10px 12px;
}

.template-item p {
  color: var(--muted);
  line-height: 1.45;
}

.template-item-meta {
  color: var(--muted);
  font-size: 12px;
  margin-top: 6px;
}

.template-remove {
  background: #fff0ee;
  color: var(--red);
  padding: 7px 10px;
}

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

.config-list {
  display: grid;
  gap: 10px;
}

.config-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 6px;
  padding: 12px;
}

.config-card span,
.config-card p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

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

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

.org-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 6px;
  padding: 12px;
}

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

.org-card span {
  color: var(--muted);
  font-size: 13px;
}

.org-card strong {
  color: var(--text);
}

.user-switcher {
  color: var(--muted);
  display: grid;
  font-size: 13px;
  font-weight: 700;
  gap: 7px;
  margin-bottom: 12px;
}

.identity-source-note {
  background: #f1f8fb;
  border: 1px solid #cae2ea;
  border-radius: 8px;
  color: #336978;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.5;
  margin: 0 0 12px;
  padding: 10px 12px;
}

.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.chip-list.compact {
  margin-bottom: 0;
}

.chip {
  background: #e8f3f2;
  border-radius: 999px;
  color: var(--brand-strong);
  font-size: 12px;
  font-weight: 800;
  padding: 6px 9px;
}

.chip.muted-chip {
  background: #eef2f4;
  color: var(--muted);
}

.danger-action {
  background: #fae8e6;
  color: var(--red);
}

.settings-page {
  background: #f8fbfc;
  border: 0;
  box-shadow: none;
  grid-column: 1 / -1;
  padding: 24px;
}

.settings-title {
  align-items: center;
  color: var(--text);
  display: flex;
  gap: 10px;
  margin-bottom: 22px;
}

.settings-title h2 {
  font-size: 22px;
  font-weight: 700;
}

.settings-icon {
  color: var(--brand);
  font-size: 25px;
  line-height: 1;
}

.settings-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(20, 45, 63, 0.05);
  padding: 34px 36px 44px;
}

.settings-tabs {
  align-items: center;
  display: flex;
  gap: 24px;
  margin-bottom: 28px;
}

.settings-tabs button {
  background: transparent;
  border: 0;
  border-radius: 0;
  color: #59636b;
  font-size: 20px;
  font-weight: 800;
  padding: 0 0 10px;
}

.settings-tabs button.active {
  border-bottom: 3px solid var(--brand);
  color: var(--brand-strong);
}

.settings-toolbar {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 18px;
}

.settings-toolbar.compact {
  justify-content: flex-end;
}

.settings-toolbar button,
.responsible-section-head button {
  border-radius: 4px;
  font-size: 16px;
  min-height: 42px;
}

.settings-toolbar > button:first-child,
.responsible-section-head .responsible-section-actions > button:first-child {
  background: var(--brand);
  color: #fff;
}

.responsible-section-actions {
  align-items: center;
  display: flex;
  gap: 10px;
}

.responsible-section-actions .danger-outline {
  background: #fff;
  border: 1px solid var(--brand);
  color: var(--brand-strong);
}

.responsible-section-actions .danger-outline:disabled {
  border-color: #d9dee2;
  color: #aab2bd;
  cursor: not-allowed;
}

.settings-toolbar .ghost {
  background: #fff;
  border: 1px solid #d9dee2;
  color: var(--brand-strong);
}

.settings-unified-note {
  background: #eef8f7;
  border: 1px solid #d7eeeb;
  border-radius: 6px;
  color: #49636a;
  font-size: 14px;
  line-height: 1.6;
  margin-bottom: 16px;
  padding: 12px 14px;
}

.settings-group-tabs {
  align-items: flex-start;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 6px 0 28px;
}

.settings-group-tab {
  background: #eef7f6;
  border: 1px solid #d5e7e5;
  border-radius: 8px;
  color: var(--brand-strong);
  font-size: 15px;
  font-weight: 800;
  padding: 12px 26px;
  position: relative;
  width: max-content;
}

.settings-group-tab.active::after {
  border-left: 12px solid transparent;
  border-right: 12px solid transparent;
  border-top: 12px solid #eef7f6;
  bottom: -12px;
  content: "";
  left: 50%;
  position: absolute;
  transform: translateX(-50%);
}

.settings-group-tab:not(.active) {
  background: #fff;
  color: #59636b;
}

.settings-table {
  border: 1px solid #dfe4e8;
  border-collapse: separate;
  border-spacing: 0;
  border-radius: 8px;
  overflow: hidden;
  table-layout: fixed;
  width: 100%;
}

.settings-table th {
  background: #f4f8f8;
  color: #646c73;
  font-size: 16px;
  font-weight: 800;
  padding: 14px 12px;
}

.settings-table td {
  border-top: 1px solid #e2e6e9;
  color: #2f3337;
  font-size: 16px;
  padding: 14px 12px;
  text-align: center;
}

.settings-table th:nth-child(1),
.settings-table td:nth-child(1) {
  width: 54px;
}

.settings-table th:nth-child(2),
.settings-table td:nth-child(2) {
  width: 82px;
}

.settings-table th:nth-child(6),
.settings-table td:nth-child(6) {
  width: 190px;
}

.permission-settings-panel {
  display: none;
}

.permission-settings-panel.active {
  display: block;
}

.user-account-toolbar {
  align-items: end;
}

.user-account-toolbar > label:first-child {
  display: grid;
  flex: 1 1 320px;
  gap: 6px;
}

.user-account-toolbar input[type="text"],
.user-account-toolbar input:not([type]),
.user-account-form-grid input,
.user-account-form-grid select {
  background: #fff;
  border: 1px solid #d9dee2;
  border-radius: 6px;
  min-height: 42px;
  padding: 8px 10px;
  width: 100%;
}

.user-account-check {
  align-items: center;
  display: inline-flex;
  gap: 7px;
  min-height: 42px;
}

.user-account-add-btn {
  background: linear-gradient(135deg, #0b7f79 0%, #065e59 100%) !important;
  border: 0 !important;
  border-radius: 6px !important;
  box-shadow: 0 4px 12px rgba(11, 127, 121, 0.2) !important;
  color: #ffffff !important;
  font-weight: 700 !important;
  min-height: 42px !important;
  padding: 0 16px !important;
  transition: all 0.15s ease !important;
  white-space: nowrap !important;
}

.user-account-add-btn:hover {
  background: linear-gradient(135deg, #09726d 0%, #05504c 100%) !important;
  box-shadow: 0 6px 16px rgba(11, 127, 121, 0.3) !important;
  transform: translateY(-1px) !important;
}

.user-account-import-btn {
  background: #f0f7f7 !important;
  border: 1px solid #0b7f79 !important;
  border-radius: 6px !important;
  color: #0b7f79 !important;
  font-weight: 600 !important;
  min-height: 42px !important;
  padding: 0 16px !important;
  transition: all 0.15s ease !important;
  white-space: nowrap !important;
}

.user-account-import-btn:hover {
  background: #e1f1f0 !important;
  border-color: #065e59 !important;
  color: #065e59 !important;
}

.user-account-import-card {
  max-width: 720px;
  width: 90%;
}

.import-step-box {
  background: #f8fafc;
  border: 1px solid #eaecf0;
  border-radius: 8px;
  margin-bottom: 14px;
  padding: 14px 16px;
}

.import-step-box strong {
  color: #101828;
  display: block;
  font-size: 14px;
  margin-bottom: 6px;
}

.import-step-box p {
  color: #475467;
  font-size: 13px;
  margin-bottom: 10px;
}

.file-drop-area {
  align-items: center;
  background: #ffffff;
  border: 2px dashed #0b7f79;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  justify-content: center;
  min-height: 80px;
  padding: 16px;
  text-align: center;
  transition: background 0.15s ease;
}

.file-drop-area:hover,
.file-drop-area.dragover {
  background: #eaf5f4;
}

.preview-title-bar {
  color: #101828;
  font-size: 14px;
  margin: 16px 0 8px;
}

.user-account-table-wrap {
  overflow-x: auto;
}

.user-account-table {
  min-width: 920px;
  table-layout: auto;
}

.user-account-table th:nth-child(n),
.user-account-table td:nth-child(n) {
  width: auto;
}

.user-account-table td:first-child {
  text-align: left;
}

.user-account-table td:first-child strong,
.user-account-table td:first-child small {
  display: block;
}

.user-account-table td:first-child small {
  color: var(--muted);
  font-size: 12px;
  margin-top: 4px;
}

.user-status {
  border-radius: 999px;
  display: inline-block;
  font-size: 12px;
  font-weight: 800;
  padding: 4px 9px;
}

.user-status.enabled {
  background: #e8f7ef;
  color: #1f7a4d;
}

.user-status.disabled {
  background: #f3f4f5;
  color: #747b81;
}

.user-status.warning {
  background: #fff3d8;
  color: #8a6212;
}

.user-sync-message {
  color: var(--muted);
  display: block;
  font-size: 12px;
  line-height: 1.45;
  margin-top: 6px;
  max-width: 260px;
}

.user-account-editor {
  background: #f8fbfb;
  border: 1px solid #d8e8e6;
  border-radius: 8px;
  margin-top: 24px;
  padding: 22px;
}

.user-account-editor-head,
.user-account-editor-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: space-between;
}

.user-account-editor-head h3,
.user-account-editor-head p {
  margin: 0;
}

.user-account-editor-head p {
  color: var(--muted);
  font-size: 13px;
  margin-top: 5px;
}

.user-account-form-grid {
  display: grid;
  gap: 14px 18px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 22px 0;
}

.user-account-form-grid label {
  display: grid;
  gap: 6px;
}

.user-account-form-grid label > span {
  color: #4f5b62;
  font-size: 13px;
  font-weight: 700;
}

.user-account-form-grid .user-account-reason {
  grid-column: span 2;
}

.user-account-editor-actions {
  justify-content: flex-start;
}

.user-account-editor-actions .danger-outline {
  background: #fff;
  border-color: #c95050;
  color: #aa3030;
}

@media (max-width: 1000px) {
  .user-account-form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .user-account-form-grid {
    grid-template-columns: 1fr;
  }

  .user-account-form-grid .user-account-reason {
    grid-column: auto;
  }
}

.permission-user-role-table th:nth-child(1),
.permission-user-role-table td:nth-child(1),
.permission-user-role-table th:nth-child(2),
.permission-user-role-table td:nth-child(2) {
  width: auto;
}

.nursing-role-badge {
  background: #e6f4f2;
  border: 1px solid #b9ddd8;
  border-radius: 999px;
  color: var(--brand-strong);
  display: inline-block;
  font-size: 12px;
  font-weight: 800;
  margin-left: 5px;
  padding: 2px 7px;
  white-space: nowrap;
}

.check-group-person-line + .check-group-person-line {
  margin-top: 5px;
}

.check-group-person-line .plain-link {
  font-size: 12px;
  margin-left: 4px;
}

.permission-user-role-dialog {
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 24px 70px rgba(30, 42, 50, 0.22);
  display: grid;
  grid-template-rows: auto 1fr auto;
  width: min(560px, calc(100vw - 32px));
}

.permission-user-role-form {
  display: grid;
  gap: 16px;
  padding: 22px 24px;
}

.permission-user-role-form > p {
  background: #f2f7f7;
  border-radius: 6px;
  color: #34464a;
  font-weight: 800;
  margin: 0;
  padding: 12px;
}

.permission-user-role-form label {
  display: grid;
  gap: 7px;
}

.permission-user-role-form label > span {
  font-size: 14px;
  font-weight: 800;
}

.permission-user-role-form select,
.permission-user-role-form textarea {
  border: 1px solid #d9dee3;
  border-radius: 5px;
  box-sizing: border-box;
  font: inherit;
  min-width: 0;
  padding: 10px 11px;
  width: 100%;
}

.permission-user-role-form small {
  color: #727b82;
}

.settings-picker-actions.permission-user-role-actions {
  display: flex;
  flex-wrap: wrap;
  grid-template-columns: none;
  justify-content: space-between;
  padding: 16px 24px;
}

.permission-user-role-actions > .danger-outline {
  flex: 0 1 auto;
}

.permission-user-role-actions .settings-picker-confirm-actions {
  flex: 0 0 auto;
}

.permission-user-role-feedback,
.settings-picker-feedback {
  border-radius: 5px;
  box-sizing: border-box;
  color: #526068;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.45;
  margin: 0;
}

.permission-user-role-feedback {
  background: #f2f7f7;
  border: 1px solid #d5e7e4;
  padding: 9px 11px;
}

.permission-user-role-feedback[data-state="changed"],
.settings-picker-feedback[data-state="success"] {
  background: #eaf7f3;
  border-color: #b9ddd3;
  color: #176d62;
}

.permission-user-role-feedback[data-state="loading"],
.settings-picker-feedback[data-state="loading"] {
  color: var(--brand-strong);
}

.permission-user-role-feedback[data-state="error"],
.settings-picker-feedback[data-state="error"] {
  background: #fff2f0;
  border-color: #efc2bc;
  color: #a63b2e;
}

.permission-matrix-toolbar {
  align-items: end;
}

.permission-change-reason {
  display: grid;
  flex: 1 1 360px;
  gap: 6px;
  margin: 0;
}

.permission-change-reason span {
  color: #646c73;
  font-size: 13px;
  font-weight: 800;
}

.permission-change-reason input {
  border: 1px solid #d9dee3;
  border-radius: 4px;
  min-height: 42px;
  padding: 8px 11px;
}

.permission-matrix-summary {
  color: #59636b;
  font-size: 14px;
  margin: 4px 0 12px;
}

.permission-matrix-scroll {
  overflow-x: auto;
  width: 100%;
}

.settings-table.permission-matrix-table {
  min-width: 920px;
  table-layout: auto;
}

.permission-matrix-table th,
.permission-matrix-table td,
.permission-matrix-table th:nth-child(n),
.permission-matrix-table td:nth-child(n) {
  min-width: 126px;
  width: auto;
}

.permission-matrix-table th:first-child,
.permission-matrix-table td:first-child {
  left: 0;
  min-width: 260px;
  position: sticky;
  text-align: left;
  z-index: 1;
}

.permission-matrix-table th:first-child {
  z-index: 2;
}

.permission-matrix-table td:first-child {
  background: #fff;
}

.permission-matrix-table th strong,
.permission-matrix-table th small,
.permission-matrix-table td:first-child strong,
.permission-matrix-table td:first-child small {
  display: block;
}

.permission-matrix-table th small,
.permission-matrix-table td:first-child small {
  color: #7a858c;
  font-size: 11px;
  margin-top: 4px;
  word-break: break-all;
}

.permission-matrix-table input[type="checkbox"] {
  height: 18px;
  width: 18px;
}

.permission-matrix-table .permission-category-row td {
  background: #eaf3f3;
  color: var(--brand-strong);
  font-size: 14px;
  font-weight: 800;
  left: auto;
  padding: 9px 12px;
  position: static;
  text-align: left;
}

.permission-audit-list {
  display: grid;
  gap: 12px;
}

.permission-audit-item {
  border: 1px solid #dfe4e8;
  border-radius: 8px;
  padding: 14px;
}

.permission-audit-head {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.permission-audit-head time,
.permission-audit-item > p {
  color: #6d787f;
  font-size: 13px;
}

.permission-audit-item > p {
  margin: 7px 0 12px;
}

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

.permission-audit-diff > div {
  background: #f6f9f9;
  border: 1px solid #e2e7e9;
  border-radius: 6px;
  min-width: 0;
  padding: 10px;
}

.permission-audit-diff span {
  color: #667279;
  font-size: 12px;
  font-weight: 800;
}

.permission-audit-diff p {
  line-height: 1.5;
  margin: 6px 0 0;
  overflow-wrap: anywhere;
}

@media (max-width: 720px) {
  .permission-audit-diff {
    grid-template-columns: 1fr;
  }

  .permission-audit-head {
    align-items: flex-start;
    flex-direction: column;
  }
}

.responsible-section {
  margin-bottom: 34px;
}

.responsible-section-head {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin-bottom: 14px;
}

.responsible-section-head h3 {
  border-left: 3px solid var(--brand);
  color: #2f3337;
  font-size: 21px;
  padding-left: 10px;
}

.responsible-title-editor {
  align-items: center;
  border-left: 3px solid var(--brand);
  display: flex;
  gap: 10px;
  min-width: min(520px, 100%);
  padding-left: 10px;
}

.responsible-title-editor input {
  border: 1px solid #d9dee3;
  border-radius: 4px;
  color: #2f3337;
  flex: 0 1 260px;
  font-size: 18px;
  font-weight: 800;
  height: 40px;
  padding: 0 12px;
}

.responsible-title-editor input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(11, 127, 121, 0.14);
  outline: none;
}

.link-action,
.plain-link,
.danger-link {
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 0;
}

.link-action {
  color: var(--brand-strong);
  font-size: 16px;
  margin-left: 6px;
}

.plain-link {
  color: #2f3337;
  font-weight: 800;
}

.muted-link {
  color: #7b858f;
}

.danger-link {
  color: var(--red);
  font-weight: 800;
}

.settings-action-divider {
  color: #b7bec4;
  margin: 0 8px;
}

.check-group-create-card {
  padding: 36px 34px;
}

.create-check-group-form {
  align-items: center;
  column-gap: 12px;
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  row-gap: 24px;
}

.create-check-group-form label {
  color: #2f3337;
  font-size: 17px;
  font-weight: 800;
  justify-self: end;
}

.create-check-group-form .required-label span {
  color: var(--brand);
  margin-right: 2px;
}

.create-check-group-form input {
  border: 1px solid #cfd5d9;
  border-radius: 4px;
  color: #2f3337;
  font-size: 16px;
  height: 40px;
  padding: 0 14px;
  width: 100%;
}

.add-person-link {
  justify-self: start;
  margin-left: 0;
}

.settings-person-table-wrap,
.settings-create-actions {
  grid-column: 2;
}

.settings-person-table-wrap {
  border-bottom: 1px solid #e2e6e9;
  padding-bottom: 26px;
}

.settings-person-table {
  border: 0;
}

.settings-person-table th,
.settings-person-table td {
  font-size: 16px;
  height: 38px;
}

.settings-person-table th:nth-child(1),
.settings-person-table td:nth-child(1),
.settings-person-table th:nth-child(2),
.settings-person-table td:nth-child(2),
.settings-person-table th:nth-child(3),
.settings-person-table td:nth-child(3),
.settings-person-table th:nth-child(4),
.settings-person-table td:nth-child(4) {
  width: auto;
}

.settings-person-table td.empty-table-cell {
  color: #2f3337;
  font-weight: 800;
  text-align: center;
}

.settings-create-actions {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: center;
  padding-top: 6px;
}

.settings-create-actions button {
  border-radius: 5px;
  font-size: 17px;
  font-weight: 800;
  min-height: 42px;
  padding: 0 20px;
}

.settings-create-actions button:first-child {
  background: var(--brand);
  color: #fff;
}

.settings-create-actions .ghost {
  background: #e8f3f2;
  color: var(--brand-strong);
}

.settings-person-picker-backdrop {
  align-items: center;
  background: rgba(30, 42, 50, 0.38);
  display: flex;
  inset: 0;
  justify-content: center;
  padding: 0;
  position: fixed;
  z-index: 45;
}

.settings-person-picker-backdrop[hidden] {
  display: none;
}

.settings-person-picker {
  background: #f4f6f8;
  border-radius: 10px;
  box-shadow: 0 24px 70px rgba(30, 42, 50, 0.22);
  color: #2f3337;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  height: min(880px, calc(100vh - 24px));
  width: min(1280px, calc(100vw - 24px));
}

.settings-person-picker-titlebar {
  align-items: center;
  background: #fff;
  border-bottom: 1px solid #dfe4e8;
  display: flex;
  justify-content: center;
  min-height: 56px;
  position: relative;
}

.settings-person-picker-titlebar h2 {
  color: var(--brand-strong);
  font-size: 20px;
  font-weight: 700;
}

.settings-person-picker-titlebar button {
  background: transparent;
  color: var(--brand);
  font-size: 32px;
  font-weight: 300;
  padding: 4px 18px;
  position: absolute;
  right: 8px;
  top: 4px;
}

.settings-person-picker-body {
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(520px, 1fr) minmax(430px, 0.66fr);
  min-height: 0;
  padding: 18px;
}

.settings-picker-left,
.settings-picker-right {
  min-height: 0;
}

.settings-picker-left {
  background: #fff;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(30, 42, 50, 0.12);
  display: grid;
  gap: 0;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
}

.settings-picker-tabs {
  align-items: center;
  display: flex;
  gap: 8px;
  padding: 14px 14px 8px;
}

.settings-picker-tabs button,
.settings-picker-pending-head button,
.settings-picker-search button,
.settings-picker-range-actions button,
.settings-picker-actions button {
  border-radius: 5px;
  font-size: 17px;
  font-weight: 800;
  min-height: 42px;
}

.settings-picker-tabs button,
.settings-picker-pending-head button,
.settings-picker-range-actions button,
.settings-picker-actions button:first-child {
  background: var(--brand);
  color: #fff;
}

.settings-picker-tabs button:not(.active) {
  background: #fff;
  border: 1px solid #c8ced3;
  color: #2f3337;
}

.settings-picker-result-card {
  background: #fff;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(30, 42, 50, 0.12);
  overflow: hidden;
}

.settings-picker-filter-box {
  background: #fff;
  display: grid;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
}

.settings-picker-row {
  border-bottom: 1px solid #e3ebef;
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  min-height: 48px;
}

.settings-picker-row > strong {
  align-self: start;
  color: #2f3337;
  font-size: 18px;
  padding: 12px 14px;
}

.settings-picker-department-row {
  min-height: 210px;
}

.settings-picker-departments,
.settings-picker-options {
  align-content: start;
  align-items: start;
  gap: 10px 16px;
  padding: 10px 12px;
}

.settings-picker-options {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(154px, 1fr));
}

.settings-picker-departments {
  align-content: start;
  display: grid;
  gap: 8px;
  max-height: 230px;
  overflow: auto;
}

.settings-picker-checkbox,
.settings-picker-department {
  color: #2f3337;
  font-size: 17px;
  line-height: 1.35;
  min-height: 30px;
  min-width: 0;
}

.settings-picker-department {
  align-items: center;
  display: inline-flex;
  gap: 7px;
}

.settings-picker-checkbox {
  align-items: start;
  display: grid;
  gap: 8px;
  grid-template-columns: 20px minmax(0, 1fr);
  min-width: 0;
  overflow-wrap: anywhere;
  padding: 2px 4px;
  white-space: normal;
  word-break: break-word;
}

.settings-picker-checkbox input,
.settings-picker-department input {
  border-color: var(--brand);
  accent-color: var(--brand);
  flex: 0 0 auto;
  height: 18px;
  width: 18px;
}

.settings-picker-checkbox input {
  margin-top: 2px;
}

.settings-picker-checkbox:hover,
.settings-picker-department:hover {
  color: var(--brand-strong);
}

.settings-picker-caret {
  color: #59636b;
  display: inline-block;
  font-size: 24px;
  line-height: 1;
  width: 18px;
}

.settings-picker-folder {
  color: var(--brand);
  font-size: 18px;
}

.settings-picker-range-actions {
  display: flex;
  justify-content: center;
  min-width: 0;
}

.settings-picker-range-actions button {
  align-self: center;
  min-width: 220px;
}

.settings-picker-right {
  display: grid;
  gap: 10px;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
}

.settings-picker-pending-head {
  align-items: center;
  display: flex;
  justify-content: space-between;
  min-height: 54px;
}

.settings-picker-pending-head strong {
  color: #2f3337;
  font-size: 20px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.settings-picker-pending-head button {
  min-width: 94px;
}

.settings-picker-result-card {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 0;
}

.settings-picker-search {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 92px;
  padding: 14px 34px 12px;
}

.settings-picker-feedback {
  grid-column: 1 / -1;
  min-height: 19px;
  padding-top: 7px;
}

.settings-picker-search input {
  border: 1px solid #c8ced3;
  border-radius: 5px 0 0 5px;
  font-size: 17px;
  height: 40px;
  padding: 0 14px;
}

.settings-picker-search button {
  background: #fff;
  border: 1px solid #c8ced3;
  border-left: 0;
  border-radius: 0 5px 5px 0;
  color: #2f3337;
}

.settings-picker-search button:disabled {
  background: #eef2f3;
  color: #7b858b;
  cursor: wait;
}

@media (max-width: 600px) {
  .settings-picker-actions.permission-user-role-actions {
    align-items: stretch;
    flex-direction: column-reverse;
  }

  .permission-user-role-actions > .danger-outline,
  .permission-user-role-actions .settings-picker-confirm-actions {
    width: 100%;
  }

  .permission-user-role-actions .settings-picker-confirm-actions button {
    flex: 1 1 0;
  }
}

.settings-picker-table-wrap {
  max-height: 100%;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
}

.settings-picker-table {
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
  width: 100%;
}

.settings-picker-table thead {
  position: sticky;
  top: 0;
  z-index: 1;
}

.settings-picker-table th {
  background: #fff;
  border-bottom: 1px solid #dfe4e8;
  color: #59636b;
  font-size: 17px;
  font-weight: 800;
  padding: 12px 10px;
}

.settings-picker-table td {
  border-bottom: 1px solid #eef2f4;
  color: #2f3337;
  font-size: 15px;
  padding: 11px 10px;
  text-align: center;
}

.settings-picker-table th:nth-child(1),
.settings-picker-table td:nth-child(1) {
  width: 62px;
}

.settings-picker-table th:nth-child(5),
.settings-picker-table td:nth-child(5) {
  width: 74px;
}

.settings-picker-pending-row td {
  background: #f0faf8;
}

.settings-picker-actions {
  align-items: center;
  background: rgba(244, 246, 248, 0.98);
  border-top: 1px solid #dfe4e8;
  box-shadow: 0 -10px 24px rgba(30, 42, 50, 0.12);
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(520px, 1fr) minmax(430px, 0.66fr);
  padding: 18px;
  position: relative;
  z-index: 8;
}

.settings-picker-actions button {
  min-width: 78px;
}

.settings-picker-actions button:last-child {
  background: #fff;
  border: 1px solid #c8ced3;
  color: #2f3337;
}

.settings-picker-confirm-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  min-width: 0;
}

.empty-state {
  color: var(--muted);
  line-height: 1.6;
}

.toast {
  background: rgba(30, 42, 50, 0.94);
  border-radius: 6px;
  bottom: 24px;
  color: #fff;
  font-weight: 700;
  left: 50%;
  padding: 12px 16px;
  position: fixed;
  transform: translateX(-50%);
  z-index: 20;
}

.modal-backdrop {
  align-items: center;
  background: rgba(30, 42, 50, 0.42);
  display: flex;
  inset: 0;
  justify-content: center;
  padding: 22px;
  position: fixed;
  z-index: 30;
}

.modal-backdrop[hidden] {
  display: none;
}

.modal {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 18px 54px rgba(30, 42, 50, 0.22);
  max-height: calc(100vh - 44px);
  overflow: auto;
  padding: 22px;
  width: min(680px, 100%);
}

.modal.wide-modal {
  border-radius: 2px;
  padding: 18px;
  position: relative;
  width: min(1180px, 100%);
}

.modal.compact-modal {
  position: relative;
  width: min(620px, 100%);
}

.risk-escalation-rule-hint {
  background: #f2f8f7;
  border: 1px solid #d7e9e7;
  border-left: 3px solid var(--brand);
  border-radius: 7px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
  margin: 10px 0 12px;
  padding: 10px 12px;
}

.mini-program-launch-modal {
  width: min(720px, 100%);
}

.mini-program-launch-content {
  align-items: center;
  display: grid;
  gap: 28px;
  grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
}

.mini-program-launch-code {
  align-items: center;
  aspect-ratio: 1;
  background: #f6f8f7;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  justify-content: center;
  overflow: hidden;
}

.mini-program-launch-code img {
  display: block;
  height: 100%;
  object-fit: contain;
  width: 100%;
}

.mini-program-launch-placeholder {
  color: var(--muted);
  line-height: 1.7;
  padding: 24px;
  text-align: center;
}

.mini-program-launch-actions {
  align-items: stretch;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.mini-program-launch-actions strong {
  color: var(--text);
  font-size: 18px;
}

.mini-program-launch-actions p,
.mini-program-launch-actions small {
  color: var(--muted);
  line-height: 1.7;
  margin: 0;
}

.mini-program-launch-actions .button-link {
  background: var(--primary);
  border-radius: 6px;
  color: #fff;
  display: block;
  font-weight: 700;
  padding: 12px 16px;
  text-align: center;
  text-decoration: none;
}

.mini-program-launch-path {
  display: block;
  max-width: min(560px, 100%);
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f5f9f9;
  color: #245d5b;
  overflow-wrap: anywhere;
  user-select: all;
}

.mini-program-devtools-instructions {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid #cfe5e3;
  border-radius: 12px;
  background: #f6fbfa;
}

.mini-program-devtools-instructions[hidden] {
  display: none;
}

.mini-program-launch-field {
  display: grid;
  gap: 8px;
}

.mini-program-launch-field > span {
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}

.mini-program-launch-field .ghost {
  justify-self: start;
}

@media (max-width: 640px) {
  .mini-program-launch-content {
    grid-template-columns: 1fr;
  }

  .mini-program-launch-code {
    margin: 0 auto;
    width: min(260px, 100%);
  }
}

.quality-plan-template-modal {
  display: grid;
  gap: 14px;
  grid-template-rows: auto auto minmax(0, 1fr) auto auto;
  max-height: calc(100vh - 72px);
  overflow: hidden;
  padding: 24px;
  position: relative;
  width: min(1120px, 100%);
}

.settings-folder-modal {
  position: relative;
  width: min(560px, 100%);
}

.settings-folder-form {
  display: grid;
  gap: 10px;
  padding: 8px 0 4px;
}

.settings-folder-form label {
  color: var(--muted);
  font-weight: 700;
}

.settings-folder-form input,
.settings-folder-form select {
  border: 1px solid var(--line);
  border-radius: 6px;
  box-sizing: border-box;
  font-size: 16px;
  padding: 12px 14px;
  width: 100%;
}

.settings-remove-warning {
  background: #fff5f4;
  border: 1px solid rgba(255, 94, 108, 0.24);
  border-radius: 6px;
  color: #7a2b33;
  font-weight: 700;
  line-height: 1.7;
  margin: 0;
  padding: 12px 14px;
}

.modal-close {
  background: transparent;
  color: var(--muted);
  font-size: 22px;
  padding: 0 8px;
  position: absolute;
  right: 8px;
  top: 6px;
}

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

.modal-head p {
  color: var(--muted);
  margin-top: 6px;
}

.template-library-search {
  align-items: center;
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(220px, 320px) auto;
}

.quality-plan-template-tools {
  align-items: end;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: space-between;
}

.quality-plan-template-tools .template-library-search input {
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 15px;
  padding: 10px 12px;
}

.quality-plan-template-table-wrap {
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 260px;
  overflow: auto;
}

.quality-plan-template-table {
  margin: 0;
  min-width: 860px;
}

.quality-plan-template-table tr {
  cursor: pointer;
}

.quality-plan-template-table tbody tr.selected {
  background: #e8f4f2;
  outline: 2px solid rgba(12, 131, 122, 0.2);
}

.quality-plan-template-table input[type="radio"] {
  accent-color: var(--brand);
}

.quality-plan-template-selected {
  background: #f4faf9;
  border: 1px solid #d9eeeb;
  border-radius: 6px;
  color: var(--brand-strong);
  font-weight: 800;
  padding: 11px 14px;
}

.library-tabs {
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 0;
  margin-bottom: 12px;
}

.library-tab {
  background: #fff;
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 6px 6px 0 0;
  color: var(--text);
}

.library-tab.active {
  background: #eef2f4;
}

.task-form {
  display: grid;
  gap: 16px;
}

.task-form label,
.task-form fieldset {
  display: grid;
  gap: 8px;
}

.task-form label,
.task-form legend {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.task-form label input,
.task-form label select,
.task-form label textarea {
  color: var(--text);
  font-weight: 400;
}

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

.task-form fieldset {
  border: 1px solid var(--line);
  border-radius: 8px;
  margin: 0;
  padding: 14px;
}

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

.department-options label {
  align-items: center;
  background: #f6faf9;
  border: 1px solid #d3e8e6;
  border-radius: 6px;
  color: var(--text);
  display: flex;
  font-size: 14px;
  gap: 8px;
  padding: 9px 10px;
}

.department-options input {
  width: auto;
}

.muted-inline {
  color: var(--muted);
  font-size: 12px;
  margin-left: auto;
  white-space: nowrap;
}

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

@media (max-width: 920px) {
  .sidebar {
    display: none;
  }

  .app-shell {
    margin-left: 0;
    padding: 18px;
  }

  .topbar,
  .topbar-actions,
  .department-quality-head,
  .builder-head,
  .wizard-actions,
  .completion-actions,
  .notification-monitor-head {
    align-items: stretch;
    flex-direction: column;
  }

  .metric-grid,
  .workspace {
    grid-template-columns: 1fr;
  }

  .today-workbench-counts {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .approval-node {
    align-items: stretch;
    grid-template-columns: 1fr;
  }

  .approval-node strong {
    text-align: left;
  }

  .approval-node-delete {
    justify-self: end;
  }

  .form-grid,
  .department-options,
  .report-toolbar,
  .statistics-grid,
  .stats-metric-grid,
  .bar-row,
  .progress-dimension-grid,
  .report-history-item,
  .review-summary,
  .training-grid,
  .template-toolbar,
  .template-item,
  .notification-item,
    .notification-monitor-summary,
    .audit-toolbar,
    .audit-summary,
    .audit-item,
    .org-list,
    .config-grid,
    .wizard-steps,
    .check-group-picker,
    .quality-level-filter,
    .quality-project-overview,
    .quality-plan-results-summary,
    .quality-plan-execution-summary,
    .quality-project-pdca-item,
    .quality-project-pdca-cause-item,
    .quality-project-pdca-list.compact .quality-project-pdca-item,
    .quality-project-personnel-grid,
    .quality-project-governance-grid,
    .quality-project-personnel-business-summary,
    .basic-form-row,
    .split-row,
    .time-period-panel,
    .inline-field,
    .person-filter-box label,
    .form-library-filter label,
    .form-filter-row,
    .form-library-table-head {
    grid-template-columns: 1fr;
  }

  .quality-project-personnel-head,
  .quality-project-data-access {
    align-items: flex-start;
    flex-direction: column;
  }

  .quality-level-rule-card {
    margin-left: 0;
  }

  .quality-project-guidance-layout {
    grid-template-columns: 1fr;
    margin-left: 0;
  }

  .quality-level-process-guide {
    margin-left: 0;
  }

  .quality-project-governance-card {
    margin-left: 0;
  }

  .quality-project-access-card {
    margin-left: 0;
  }

  .quality-level-create-view {
    padding: 14px;
  }

  .quality-level-create-view > .wizard-actions {
    justify-self: stretch;
    width: auto;
  }

  .quality-level-create-view .time-row {
    grid-template-columns: 1fr;
    padding: 12px;
  }

  .quality-level-create-view .time-row > label {
    padding-top: 0;
  }

  .quality-level-create-view .time-period-panel {
    grid-template-columns: 1fr;
  }

  .quality-level-create-view .date-range-picker {
    grid-column: auto;
    grid-template-columns: 1fr;
  }

  .quality-level-create-view .time-duration-editor {
    grid-template-columns: 68px minmax(0, 140px);
  }

  .quality-level-create-view .time-period-panel > .field-hint {
    grid-column: auto;
  }

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

  .date-range-separator {
    justify-self: center;
  }

  .date-range-help {
    justify-self: end;
  }

  .quality-project-sampling-fields,
  .quality-project-creator-field {
    grid-template-columns: 1fr;
  }

  .quality-report-level-tabs,
  .quality-report-period-row,
  .notification-level-rules,
  .indicator-report-meta,
  .indicator-report-layout,
  .indicator-entry-body {
    grid-template-columns: 1fr;
  }

  .indicator-report-meta > div {
    border-bottom: 1px solid #dfecea;
    border-right: 0;
  }

  .indicator-report-meta > div:last-child {
    border-bottom: 0;
  }

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

  .indicator-entry-actions {
    min-width: 0;
  }

  .indicator-entry-actions small {
    text-align: left;
  }

  .quality-report-current-rule {
    grid-template-columns: 1fr;
  }

  .quality-report-current-rule > span {
    grid-row: auto;
    justify-self: start;
  }

  .quality-project-access-body {
    padding: 4px 14px 8px;
  }

  .quality-project-access-body > .basic-form-row,
  .quality-project-access-body .inline-field,
  .share-options {
    grid-template-columns: 1fr;
  }

  .quality-project-access-body > .basic-form-row > label {
    padding-top: 0;
  }

  .quality-project-access-body .inline-field > span,
  .quality-project-access-body .inline-field > select {
    border: 1px solid var(--line);
    border-radius: 7px;
    min-height: 40px;
  }

  .quality-analysis-content {
    grid-template-columns: 1fr;
  }

  .quality-plan-analysis-filter {
    align-items: stretch;
    flex-direction: column;
  }

  .quality-plan-analysis-filter input {
    width: 100%;
  }

  .department-quality-columns,
  .area-quality-columns,
  .hospital-quality-columns,
  .quality-workflow-columns {
    grid-template-columns: 1fr;
  }

  .quality-project-overview > div,
  .quality-plan-results-summary > div,
  .quality-plan-execution-summary > div {
    border-bottom: 1px solid var(--line);
    border-right: 0;
  }

  .quality-project-section-head,
  .plan-page-head {
    align-items: stretch;
    flex-direction: column;
  }

  .quality-project-pdca-actions {
    align-items: stretch;
    display: grid;
    grid-template-columns: 1fr;
  }

  .quality-project-pdca-cycle {
    grid-template-columns: repeat(4, minmax(150px, 1fr));
  }

  .quality-level-project-table th:nth-child(8),
  .quality-level-project-table td:nth-child(8),
  .quality-level-project-table th:last-child,
  .quality-level-project-table td:last-child {
    position: static;
  }
}

@media (max-width: 600px) {
  .today-workbench-counts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .today-workbench-priority-item {
    grid-template-columns: 1fr;
  }

  .indicator-report-summary,
  .indicator-report-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-indicator-panel .panel-head,
  .dashboard-indicator-panel .panel-actions {
    align-items: stretch;
    flex-direction: column;
  }
}

.forbidden-screen {
  margin-top: 24px;
  padding: 48px 24px;
  text-align: center;
  background: linear-gradient(180deg, #ffffff 0%, #fcfbf9 100%);
  border: 1px solid #f2cfc9;
  box-shadow: 0 10px 30px rgba(224, 76, 52, 0.06);
}

.forbidden-card {
  max-width: 580px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.forbidden-icon {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: #fdf2f0;
  color: #d9381e;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  box-shadow: 0 4px 14px rgba(217, 56, 30, 0.12);
}

.forbidden-badge {
  display: inline-block;
  font-size: 13px;
  font-weight: 600;
  color: #b91c1c;
  background: #fee2e2;
  border: 1px solid #fca5a5;
  padding: 4px 12px;
  border-radius: 999px;
  margin-bottom: 12px;
  letter-spacing: 0.5px;
}

.forbidden-card h2 {
  font-size: 24px;
  font-weight: 700;
  color: #1f2937;
  margin: 0 0 12px 0;
}

.forbidden-description {
  font-size: 15px;
  line-height: 1.6;
  color: #4b5563;
  margin: 0 0 20px 0;
}

.forbidden-meta {
  background: #f3f4f6;
  border-radius: 6px;
  padding: 8px 14px;
  font-size: 12px;
  color: #6b7280;
  font-family: monospace;
  margin-bottom: 24px;
  word-break: break-all;
}

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


.forbidden-actions a.ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  font-size: 14px;
  border-radius: 6px;
  text-decoration: none;
}
.forbidden-actions #forbiddenPermissionButton {
  background: var(--brand);
  color: #fff;
}
.forbidden-actions #forbiddenPermissionButton:hover {
  background: var(--brand-strong);
}
.nursing-area-form:not([hidden]) { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin: 20px 0; padding: 20px; border: 1px solid #d6e1e5; border-radius: 10px; }
.nursing-area-form label { display: flex; flex-direction: column; gap: 8px; }
.nursing-area-form select[multiple] { min-height: 160px; }
.nursing-area-form p, .nursing-area-form > div { grid-column: 1 / -1; }
.nursing-area-diagnostic { white-space: pre-line; }
.hospital-wizard-nav { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
[id^="hospitalPane"][hidden] { display: none !important; }
#hospitalPane4 fieldset { margin: 12px 0; border: 1px solid #d4dee5; border-radius: 8px; padding: 16px; }

/* Dashboard layout: preserve direct-child role gates and existing route panels. */
.dashboard-hero > div,
.dashboard-panel,
.today-workbench-priority-list > * {
  min-width: 0;
}

.dashboard-hero .topbar-actions {
  flex-direction: column;
  align-items: flex-end;
  flex-shrink: 0;
  max-width: 55%;
}

.dashboard-account-actions,
.dashboard-primary-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.dashboard-account-actions .tenant-switcher select { min-width: 0; }
.dashboard-primary-actions button { min-height: 40px; }
.dashboard-hero h1 { font-size: clamp(22px, 2vw, 28px); line-height: 1.3; }
.dashboard-hero p { font-size: 13px; line-height: 1.6; }

.today-workbench-panel .panel-head { margin-bottom: 0; }
.today-workbench-panel .panel-head p { column-gap: 12px; }
.today-workbench-priority-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.today-workbench-priority-list > .empty-state { grid-column: 1 / -1; }
.today-workbench-priority-item { overflow-wrap: anywhere; }
.today-workbench-priority-head { flex-wrap: wrap; }

.dashboard-monitor-summary {
  cursor: pointer;
  color: var(--brand-strong);
  font-size: 13px;
  font-weight: 700;
  padding: 10px 0;
}
.dashboard-monitor-hint {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
  margin-top: 4px;
}
.dashboard-monitor-drawer[open] > summary { margin-bottom: 12px; }
.dashboard-monitor-summary:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; }
.dashboard-monitor-drawer[hidden] { display: none; }

@media (min-width: 1281px) {
  .workspace { grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr); }
  .dashboard-panel .panel-head { flex-wrap: wrap; gap: 12px; }
}

@media (max-width: 920px) {
  .dashboard-hero .topbar-actions { max-width: none; align-items: stretch; }
  .dashboard-account-actions { justify-content: flex-start; }
  .dashboard-primary-actions { justify-content: flex-start; }
  .app-shell > .metric-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .today-workbench-priority-list { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .dashboard-hero { padding: 16px; }
  .dashboard-primary-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .app-shell > .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .app-shell > .metric-grid article { padding: 14px 12px; min-height: 108px; }
  .app-shell > .metric-grid strong { font-size: 26px; }
  .app-shell > .metric-grid em { font-size: 12px; overflow-wrap: anywhere; }
  .today-workbench-panel > .panel-head { align-items: stretch; flex-direction: column; gap: 10px; }
}
