:root {
  --bg: #d9e5f4;
  --surface: #ffffff;
  --surface-strong: #eef3f8;
  --text: #182338;
  --muted: #697789;
  --line: #dce6f2;
  --primary: #1d5fbf;
  --primary-dark: #1556ad;
  --primary-soft: #edf5ff;
  --primary-muted: #f4f8fd;
  --accent: #c3842e;
  --brand-start: #0f284c;
  --brand-end: #17345d;
  --success: #087a49;
  --danger: #e11d35;
  --shadow: 0 12px 30px rgba(24, 50, 88, 0.11);
  font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", Arial, sans-serif;
}

body[data-theme="green"] {
  --bg: #f3f8f7;
  --surface-strong: #eaf3f1;
  --line: #d7e6e2;
  --primary: #16745f;
  --primary-dark: #0d5547;
  --primary-soft: #e8f5f1;
  --primary-muted: #eff9f6;
  --accent: #2e87a5;
  --brand-start: #5eb8a6;
  --brand-end: #2e87a5;
}

body[data-theme="gold"] {
  --bg: #f8f6f1;
  --surface-strong: #f1ece2;
  --line: #e7dece;
  --primary: #a6651c;
  --primary-dark: #774512;
  --primary-soft: #fff2df;
  --primary-muted: #fff8ed;
  --accent: #276f91;
  --brand-start: #d39a3a;
  --brand-end: #276f91;
}

* {
  box-sizing: border-box;
}

.legacy-readonly-banner {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  z-index: 120;
  min-height: 36px;
  padding: 8px 16px;
  border-bottom: 1px solid #dfc27c;
  background: #fff5d9;
  color: #795000;
  font-size: 13px;
  font-weight: 700;
  text-align: center;
}

body.legacy-read-only .app-shell {
  padding-top: 36px;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.app-shell {
  display: grid;
  grid-template-columns: 196px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  padding: 22px 12px;
  background: #f7f9fc;
  color: var(--text);
  border-right: 1px solid var(--line);
}

.sidebar,
.main,
.topbar,
.topbar-actions,
.home-layout,
.home-main,
.home-documents,
.home-info-grid,
.home-document-grid,
.home-doc-list,
.home-doc-preview {
  min-width: 0;
}

.brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 106px;
  min-height: 94px;
}

.brand-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 106px;
  height: 46px;
  border-radius: 8px;
  background: linear-gradient(145deg, #0d2b42, var(--primary));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.22);
  overflow: hidden;
}

.brand-mark img {
  display: block;
  width: 92px;
  max-height: 30px;
  object-fit: contain;
}

.brand strong {
  display: block;
  width: 106px;
  color: #17202a;
  font-size: 18px;
  line-height: 1.2;
  text-align: center;
}

.brand span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.nav {
  display: grid;
  gap: 8px;
  width: 100%;
}

.nav-item {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #536273;
  text-align: center;
  padding: 0 12px;
  text-decoration: none;
}

.nav-item:hover,
.nav-item.active {
  background: var(--primary-soft);
  color: var(--primary);
}

.nav-group {
  min-width: 0;
}

.nav-group > summary {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 30px 0 12px;
  border-radius: 7px;
  color: #536273;
  cursor: pointer;
  font-weight: 700;
  list-style: none;
  user-select: none;
}

.nav-group > summary::-webkit-details-marker {
  display: none;
}

.nav-group > summary::after {
  position: absolute;
  right: 14px;
  width: 7px;
  height: 7px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  content: "";
  transform: rotate(45deg) translateY(-2px);
  transition: transform 160ms ease;
}

.nav-group[open] > summary {
  background: #eef3f7;
  color: #34495a;
}

.nav-group[open] > summary::after {
  transform: rotate(225deg) translate(-2px, -2px);
}

.nav-group-items {
  display: grid;
  gap: 5px;
  margin: 5px 0 0 12px;
  padding-left: 8px;
  border-left: 1px solid var(--line);
}

.nav-group-items .nav-item {
  min-height: 38px;
  font-size: 13px;
}

.legacy-admin-bar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 12px;
}

.sidebar-footer {
  margin-top: auto;
  display: grid;
  gap: 10px;
  width: 100%;
}

.signal-card {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.signal-card span,
.signal-card strong {
  display: block;
}

.signal-card span {
  color: var(--muted);
  font-size: 12px;
}

.signal-card strong {
  margin-top: 6px;
  color: #9fe0c4;
}

.signal-card small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.signal-card strong.offline {
  color: #ffd19a;
}

.main {
  padding: 24px;
  overflow: hidden;
}

.topbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 22px;
}

.topbar > div:first-child {
  flex: 0 0 auto;
  min-width: max-content;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 13px;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 30px;
  letter-spacing: 0;
  white-space: nowrap;
  line-height: 1.15;
}

h2 {
  margin-bottom: 0;
  font-size: 18px;
  letter-spacing: 0;
}

.topbar-actions,
.panel-header,
.segmented,
.approval-tools,
.ai-form {
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar-actions {
  flex: 1 1 520px;
  flex-wrap: wrap;
  justify-content: flex-end;
  min-width: 0;
}

.topbar-session {
  display: grid;
  grid-template-columns: minmax(118px, auto) minmax(138px, 168px) minmax(102px, auto);
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.topbar-user {
  min-width: 0;
  max-width: 168px;
  min-height: 54px;
  display: grid;
  gap: 2px;
  place-content: center;
  justify-items: center;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  text-align: center;
}

.topbar-user strong,
.topbar-user span {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-user strong {
  color: var(--text);
  font-size: 15px;
  line-height: 1.2;
}

.topbar-user span {
  color: var(--muted);
  font-size: 12px;
}

.topbar-session .ghost-btn {
  min-width: 102px;
  white-space: nowrap;
  background: #fff;
}

.pilot-identity {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: var(--muted);
}

.pilot-identity span {
  white-space: nowrap;
  font-size: 13px;
}

.pilot-identity select {
  min-width: 170px;
  min-height: 38px;
}

.theme-setting {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: var(--muted);
}

.theme-setting > span {
  white-space: nowrap;
  font-size: 13px;
}

.theme-picker {
  display: grid;
  grid-template-columns: repeat(3, 46px);
  gap: 6px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.theme-picker button {
  display: grid;
  grid-template-columns: 14px 1fr;
  align-items: center;
  gap: 5px;
  min-height: 30px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  padding: 0 7px;
  font-size: 12px;
}

.theme-picker button.active {
  border-color: color-mix(in srgb, var(--primary) 32%, transparent);
  background: var(--primary-soft);
  color: var(--primary);
}

.theme-picker i {
  display: block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--swatch);
}

.theme-picker [data-theme-choice="blue"] {
  --swatch: #146c94;
}

.theme-picker [data-theme-choice="green"] {
  --swatch: #16745f;
}

.theme-picker [data-theme-choice="gold"] {
  --swatch: #a6651c;
}

.primary-btn,
.secondary-btn,
.ghost-btn,
.text-btn,
.segmented button,
.automation-grid button {
  min-height: 38px;
  border-radius: 7px;
  border: 1px solid transparent;
  padding: 0 14px;
}

.primary-btn {
  background: var(--primary);
  color: #fff;
}

.primary-btn:hover {
  background: var(--primary-dark);
}

.secondary-btn {
  background: #fff;
  border-color: var(--line);
  color: var(--text);
  cursor: pointer;
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.secondary-btn:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.ghost-btn {
  background: var(--surface);
  border-color: var(--line);
  color: var(--text);
}

.text-btn {
  background: transparent;
  color: var(--primary);
  padding: 0 4px;
}

.view {
  display: none;
}

.active-view {
  display: block;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.metric,
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.metric {
  padding: 18px;
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.metric strong {
  display: block;
  margin-top: 10px;
  font-size: 28px;
}

.metric-ai {
  background: #f8f2ea;
  border-color: #ead8c2;
}

.home-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

#home.active-view {
  display: grid;
  gap: 18px;
}

.home-main {
  display: grid;
  gap: 18px;
  min-width: 0;
}

.home-banner-wrap {
  position: relative;
  display: grid;
}

.home-main > .home-banner-wrap {
  display: none;
}

.home-banner {
  position: relative;
  min-height: 0;
  aspect-ratio: 2048 / 430;
  border: 0;
  border-radius: 0;
  overflow: hidden;
  background: #9e0909;
  box-shadow: none;
}

.home-banner img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: cover;
  background: #9e0909;
  animation: home-banner-fade 0.35s ease;
}

@keyframes home-banner-fade {
  from {
    opacity: 0.68;
  }
  to {
    opacity: 1;
  }
}

.home-banner-dots {
  position: absolute;
  z-index: 4;
  left: 0;
  right: 0;
  bottom: 12px;
  display: flex;
  justify-content: center;
  gap: 10px;
  pointer-events: none;
}

.home-banner-dots button {
  width: 36px;
  height: 9px;
  border: 1px solid rgba(255, 255, 255, 0.82);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.62);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.22);
  padding: 0;
  pointer-events: auto;
  cursor: pointer;
  transition: width 0.18s ease, background 0.18s ease, opacity 0.18s ease, transform 0.18s ease;
}

.home-banner-dots button.active {
  width: 48px;
  background: #fff;
  transform: translateY(-1px);
}

.home-documents,
.home-summary {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.home-workbench {
  display: grid;
  grid-template-columns: minmax(280px, 1.05fr) minmax(280px, 1fr) minmax(240px, 0.9fr);
  gap: 18px;
  align-items: stretch;
}

.home-workbench .home-summary {
  min-height: 164px;
}

.home-workbench .home-section-head {
  margin-bottom: 12px;
}

.home-documents {
  padding: 18px;
}

.home-summary {
  padding: 16px;
}

.home-section-head {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 14px;
  margin-bottom: 14px;
}

.home-section-head h2 {
  margin-bottom: 4px;
}

.home-section-head span {
  color: var(--muted);
  font-size: 13px;
}

.home-document-grid {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 16px;
  min-height: 560px;
}

.home-doc-list {
  display: grid;
  align-content: start;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.home-doc-item {
  display: grid;
  gap: 12px;
  width: 100%;
  min-height: 92px;
  border: 1px solid #b6d2f0;
  border-radius: 8px;
  background: #f7fbff;
  padding: 16px;
  color: var(--text);
  text-align: left;
  text-decoration: none;
}

.home-doc-item:hover,
.home-doc-item.active {
  border-color: #9dc5e3;
  background: #eef6ff;
}

.home-doc-item strong {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: baseline;
  color: #061b32;
  font-size: 17px;
  line-height: 1.35;
}

.home-doc-item strong span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 400;
}

.home-info-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.home-info-list {
  display: grid;
  gap: 10px;
}

.home-info-list article {
  display: grid;
  gap: 5px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.home-info-list article:last-child {
  border-bottom: 0;
}

.home-info-list strong {
  font-size: 14px;
}

.home-info-list span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.home-doc-preview {
  display: grid;
  grid-template-rows: auto auto minmax(320px, 1fr) auto;
  gap: 12px;
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
}

.home-preview-head h3 {
  margin: 8px 0 4px;
  font-size: 20px;
}

.home-preview-head {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 12px;
}

.home-preview-title {
  min-width: 0;
}

.home-download-btn {
  flex: 0 0 auto;
  min-width: 74px;
  max-width: 210px;
}

.home-download-btn small {
  max-width: 132px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-preview-head small {
  color: var(--muted);
}

.home-doc-preview p {
  margin: 0;
  color: #314154;
  line-height: 1.7;
}

.document-frame {
  width: 100%;
  min-height: 340px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.document-inline-empty {
  display: grid;
  place-items: center;
  min-height: 240px;
  border: 1px dashed #aebdca;
  border-radius: 8px;
  background: #f7fbff;
  color: var(--muted);
  text-align: center;
}

.home-side {
  display: grid;
  gap: 18px;
}

.home-attendance {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) 84px;
  gap: 12px;
  align-items: center;
}

.home-attendance strong,
.home-attendance span,
.home-attendance small {
  display: block;
}

.home-attendance strong {
  font-size: 24px;
}

.home-attendance span,
.home-attendance small {
  color: var(--muted);
  font-size: 13px;
}

.home-attendance small {
  grid-column: 1 / -1;
  line-height: 1.6;
}

.attendance-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 8px;
  background: #eaf8f1;
  color: var(--success);
  font-weight: 800;
  font-size: 22px;
}

.attendance-mini-bars {
  display: flex;
  align-items: end;
  gap: 7px;
  height: 58px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfd;
  overflow: hidden;
}

.attendance-mini-bars i {
  width: 14px;
  border-radius: 5px 5px 2px 2px;
  background: #3aa0e6;
}

.attendance-mini-bars i:nth-child(2) {
  background: var(--accent);
}

.attendance-mini-bars i:nth-child(3) {
  background: var(--danger);
}

.home-todo-list {
  display: grid;
  gap: 8px;
}

.home-todo-list article {
  display: grid;
  gap: 5px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.home-todo-list article:last-child {
  border-bottom: 0;
}

.home-todo-list strong {
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.home-todo-list span {
  color: var(--muted);
  font-size: 12px;
}

.home-quick-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.home-quick-actions button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
  color: var(--text);
}

.workbench-layout {
  display: grid;
  grid-template-columns: minmax(560px, 1fr) minmax(300px, 340px);
  gap: 20px;
  align-items: start;
}

.workbench-main {
  min-width: 0;
}

.workbench-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}

.workbench-tabs button {
  min-height: 40px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #536273;
  padding: 0 15px;
}

.workbench-tabs button.active,
.workbench-tabs button:hover {
  background: #fff;
  color: #17202a;
  box-shadow: 0 8px 20px rgba(36, 48, 66, 0.08);
}

.workbench-search {
  max-width: 360px;
  margin-bottom: 18px;
}

.module-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.module-grid.erp-grouped {
  display: block;
}

.module-grid.common-personalized {
  display: block;
}

.common-flow-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.common-flow-heading {
  display: grid;
  gap: 3px;
}

.common-flow-heading > span {
  color: #6a7887;
  font-size: 13px;
}

.common-hidden-toggle {
  min-height: 34px;
  border: 1px solid #d8e1e8;
  border-radius: 6px;
  background: #fff;
  color: #526170;
  padding: 6px 10px;
  white-space: nowrap;
}

.common-hidden-workflows {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 12px;
  padding: 10px;
  border: 1px solid #e2e8ee;
  border-radius: 8px;
  background: #f8fafb;
}

.common-hidden-workflows button {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  gap: 6px;
  border: 1px solid #dce4ea;
  border-radius: 6px;
  background: #fff;
  color: #425466;
  padding: 5px 9px;
}

.common-flow-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.erp-category-segmented {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.erp-category-segmented button {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  gap: 8px;
  border: 1px solid #d9e1e8;
  border-radius: 6px;
  background: #fff;
  color: #425466;
  padding: 7px 11px;
}

.erp-category-segmented button small {
  min-width: 22px;
  border-radius: 10px;
  background: #eef3f6;
  color: #607080;
  padding: 2px 6px;
  text-align: center;
}

.erp-category-segmented button.active {
  border-color: #0e7894;
  background: #eaf6f8;
  color: #075b70;
}

.erp-category-segmented button.active small {
  background: #0e7894;
  color: #fff;
}

.erp-module-summary {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.erp-module-summary span {
  color: #6a7887;
  font-size: 13px;
}

.erp-module-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.module-card {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  min-height: 88px;
  border: 1px solid #e7edf4;
  border-radius: 8px;
  background: #fff;
  padding: 16px;
  text-align: left;
  box-shadow: 0 8px 20px rgba(36, 48, 66, 0.06);
}

.module-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 26px rgba(36, 48, 66, 0.1);
}

.common-module-card {
  position: relative;
  display: block;
  padding: 0;
  overflow: hidden;
}

.common-module-card.pinned {
  border-color: #b7d9d1;
  box-shadow: 0 8px 20px rgba(8, 122, 104, 0.1);
}

.common-module-card.hidden {
  opacity: 0.72;
}

.common-module-open {
  display: grid;
  width: 100%;
  min-height: 88px;
  grid-template-columns: 54px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  border: 0;
  background: transparent;
  padding: 16px 76px 16px 16px;
  text-align: left;
}

.workflow-card-actions {
  position: absolute;
  top: 9px;
  right: 9px;
  display: flex;
  gap: 4px;
}

.workflow-card-action {
  display: grid;
  width: 28px;
  height: 28px;
  min-height: 28px;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: #7b8793;
  padding: 0;
  font-size: 17px;
}

.workflow-card-action:hover {
  border-color: #d7e0e7;
  background: #f4f7f9;
  color: #263746;
}

.workflow-card-action.active {
  color: #087a68;
}

.module-card strong,
.module-card small {
  display: block;
  overflow-wrap: anywhere;
}

.module-card strong {
  line-height: 1.35;
}

.module-card small {
  margin-top: 5px;
  line-height: 1.45;
}

.module-recommendation {
  display: block;
  margin-top: 7px;
  color: #637485;
  font-size: 12px;
  font-style: normal;
  line-height: 1.35;
}

.module-recommendation.usage {
  color: #087a68;
}

.module-recommendation.department {
  color: #176f9a;
}

.module-recommendation.department-usage {
  color: #0e7894;
}

.module-recommendation.pinned {
  color: #087a68;
}

.module-recommendation.hidden {
  color: #6f7b86;
}

.module-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 8px;
  background: #f6b51f;
  color: #fff;
  font-weight: 700;
}

.module-icon.blue {
  background: #3aa0e6;
}

.module-icon.green {
  background: #29b764;
}

.module-icon.cyan {
  background: #40c6b7;
}

.module-icon.violet {
  background: #7b8cff;
}

.module-icon.gold {
  background: #f5b516;
}

.module-card strong,
.module-card small {
  display: block;
}

.module-card strong {
  margin-bottom: 5px;
  font-size: 16px;
}

.module-card small {
  color: var(--muted);
  line-height: 1.45;
  overflow-wrap: anywhere;
  white-space: normal;
}

.asset-management-page {
  display: grid;
  gap: 18px;
}

.asset-management-page .panel-header {
  align-items: flex-start;
}

.asset-management-content {
  display: grid;
  gap: 18px;
}

.asset-module-section {
  display: grid;
  gap: 14px;
}

.asset-module-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.asset-module-head h3 {
  margin: 0 0 4px;
  font-size: 20px;
}

.asset-module-head p {
  margin: 0;
  color: var(--muted);
}

.asset-module-head > span {
  color: var(--muted);
  font-size: 14px;
  white-space: nowrap;
}

.asset-module-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}

.asset-card {
  min-height: 116px;
}

.asset-card small {
  white-space: normal;
}

.asset-flow-status {
  display: inline-flex;
  width: fit-content;
  margin-top: 8px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #fff7ed;
  color: #9a5d16;
  font-size: 12px;
  font-style: normal;
}

.asset-flow-status.ready {
  background: #edf9f3;
  color: #1f7a4d;
}

.asset-overview-grid,
.asset-inventory-summary,
.asset-quality-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.asset-metric {
  min-height: 96px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
}

.asset-metric span,
.asset-metric small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.asset-metric strong {
  display: block;
  margin: 8px 0 4px;
  font-size: 26px;
  line-height: 1.1;
}

.asset-data-source-banner {
  display: grid;
  gap: 5px;
  padding: 12px 14px;
  border: 1px solid #f1c27d;
  border-radius: 8px;
  background: #fff8ed;
  color: #7a4a10;
}

.asset-data-source-banner strong {
  font-size: 14px;
}

.asset-data-source-banner span {
  font-size: 13px;
  line-height: 1.55;
}

.asset-data-source-banner.mixed {
  border-color: #b7d4f5;
  background: #f1f7ff;
  color: #1f5f95;
}

.asset-toolbar {
  display: grid;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfd;
}

.asset-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.asset-tabs button {
  min-height: 36px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  padding: 0 12px;
}

.asset-tabs button.active,
.asset-tabs button:hover {
  border-color: var(--line);
  background: #fff;
  color: var(--primary);
}

.asset-import-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.asset-import-actions .primary-btn,
.asset-import-actions .secondary-btn {
  min-height: 36px;
  padding: 0 12px;
  font-size: 13px;
}

.asset-import-actions span {
  color: var(--muted);
  font-size: 13px;
}

.asset-filters {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) repeat(3, minmax(120px, 170px));
  gap: 10px;
}

.asset-filters input,
.asset-filters select {
  min-height: 38px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--text);
  padding: 0 10px;
}

.asset-register-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 14px;
  align-items: start;
}

.asset-register-layout.full {
  grid-template-columns: 1fr;
}

.asset-register-main {
  min-width: 0;
}

.asset-table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.asset-table {
  width: 100%;
  min-width: 860px;
  border-collapse: collapse;
}

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

.asset-table th {
  background: #f2f6fa;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.asset-table tr:last-child td {
  border-bottom: 0;
}

.asset-table tr.active td,
.asset-table tr:hover td {
  background: var(--primary-muted);
}

.asset-table-pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-top: 1px solid var(--line);
  padding: 10px 12px;
  background: #fff;
  color: var(--muted);
  font-size: 13px;
}

.asset-table-pagination > div {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.asset-table-pagination strong {
  color: #123453;
  font-size: 13px;
}

.asset-table-pagination .mini-btn {
  min-height: 28px;
  padding: 0 10px;
  font-size: 12px;
}

.asset-table strong,
.asset-table small {
  display: block;
}

.asset-table small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.asset-status {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 0 9px;
  background: #eef6ff;
  color: var(--primary);
  font-size: 12px;
  white-space: nowrap;
}

.asset-status.idle {
  background: #edf9f3;
  color: #1f7a4d;
}

.asset-status.maintenance,
.asset-status.scrap_pending,
.asset-status.lost {
  background: #fff3ed;
  color: #a64b18;
}

.asset-status.borrowed {
  background: #f3f0ff;
  color: #5951a6;
}

.asset-detail-panel {
  display: grid;
  gap: 14px;
  position: sticky;
  top: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 14px;
}

.asset-detail-head {
  display: grid;
  gap: 6px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.asset-detail-head h3 {
  margin: 0;
  font-size: 18px;
  line-height: 1.35;
}

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

.asset-detail-grid {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  gap: 9px 12px;
  margin: 0;
}

.asset-detail-grid dt {
  color: var(--muted);
  font-size: 12px;
}

.asset-detail-grid dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.asset-edit-form {
  display: grid;
  gap: 12px;
}

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

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

.asset-edit-grid input,
.asset-edit-grid select,
.asset-edit-grid textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--text);
  padding: 8px 9px;
  font: inherit;
}

.asset-edit-grid textarea {
  resize: vertical;
}

.asset-edit-wide {
  grid-column: 1 / -1;
}

.asset-qr-card {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.asset-qr-code {
  display: grid;
  place-items: center;
  width: 112px;
  height: 112px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.asset-qr-svg {
  display: block;
  width: 96px;
  height: 96px;
}

.asset-qr-meta {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.asset-qr-meta strong {
  font-size: 14px;
}

.asset-qr-meta span,
.asset-qr-meta small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.asset-qr-meta small,
.asset-qr-fallback {
  overflow-wrap: anywhere;
}

.asset-qr-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 3px;
}

.asset-qr-actions .secondary-btn {
  min-height: 32px;
  padding: 0 10px;
  font-size: 12px;
  white-space: nowrap;
}

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

.asset-detail-actions .secondary-btn {
  padding: 0 8px;
  white-space: nowrap;
}

.asset-timeline {
  display: grid;
  gap: 9px;
}

.asset-timeline h4 {
  margin: 0;
  font-size: 15px;
}

.asset-timeline article {
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
}

.asset-timeline span,
.asset-timeline small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.asset-inventory-section {
  display: grid;
  gap: 14px;
}

.asset-inventory-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
}

.asset-inventory-actions div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.asset-inventory-actions strong,
.asset-inventory-actions span {
  overflow-wrap: anywhere;
}

.asset-inventory-actions span {
  color: var(--muted);
  font-size: 12px;
}

.asset-inventory-table {
  min-width: 1060px;
}

.asset-inventory-table input,
.asset-inventory-table select {
  min-height: 34px;
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--text);
  padding: 0 9px;
}

.asset-full-timeline {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.asset-full-timeline h4 {
  grid-column: 1 / -1;
}

.asset-quality-section {
  display: grid;
  gap: 14px;
}

.asset-quality-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
}

.asset-quality-head div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.asset-quality-head h3 {
  margin: 0;
  font-size: 16px;
}

.asset-quality-head span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.asset-quality-head .secondary-btn {
  min-height: 34px;
  padding: 0 12px;
  white-space: nowrap;
}

.asset-quality-breakdown {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.asset-quality-breakdown span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  padding: 0 10px;
  font-size: 12px;
}

.asset-quality-table {
  min-width: 980px;
}

.asset-quality-link {
  max-width: 220px;
  text-align: left;
  white-space: normal;
  overflow-wrap: anywhere;
}

.asset-quality-severity {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 0 9px;
  font-size: 12px;
  white-space: nowrap;
}

.asset-quality-severity.high {
  background: #fff0f0;
  color: #b42318;
}

.asset-quality-severity.medium {
  background: #fff7e6;
  color: #946200;
}

.asset-quality-severity.low {
  background: #eef6ff;
  color: var(--primary);
}

.workbench-side {
  display: grid;
  align-content: start;
  gap: 18px;
}

.mini-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.mini-metrics article {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
}

.mini-metrics span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.mini-metrics strong {
  display: block;
  margin-top: 6px;
  font-size: 24px;
}

.compact-list .item {
  grid-template-columns: 1fr;
}

.compact-list .approval-flow {
  display: none;
}

.approval-workspace {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  min-height: calc(100vh - 132px);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
  box-shadow: var(--shadow);
}

.approval-menu {
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 18px 14px;
  border-right: 1px solid var(--line);
  background: #f7f9fc;
}

.approval-menu span {
  margin: 18px 8px 2px;
  color: var(--muted);
  font-size: 13px;
}

.approval-menu button {
  min-height: 42px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--text);
  padding: 0 12px;
  text-align: left;
}

.approval-menu button.active,
.approval-menu button:hover {
  background: #dbeafe;
  color: #0f2f4a;
  font-weight: 700;
}

.approval-main {
  border: 0;
  border-radius: 0;
  box-shadow: none;
  min-width: 0;
}

.approval-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 16px;
  align-items: center;
  margin-bottom: 18px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.approval-tabs {
  display: flex;
  gap: 12px;
}

.approval-tabs button {
  min-height: 40px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #536273;
  padding: 0 18px;
}

.approval-tabs button.active,
.approval-tabs button:hover {
  background: #f1f3f5;
  color: var(--text);
}

.approval-launch-grid h3 {
  margin: 0 0 14px;
  color: #536273;
  font-size: 15px;
  font-weight: 500;
}

.approval-browser {
  display: grid;
  grid-template-columns: minmax(260px, 360px) minmax(0, 1fr);
  gap: 14px;
  min-height: 0;
}

.approval-delegation-page {
  display: grid;
  gap: 14px;
}

.approval-delegation-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.approval-delegation-head h3,
.approval-delegation-head p {
  margin: 0;
}

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

.approval-delegation-layout {
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  gap: 14px;
  min-height: 0;
}

.approval-delegation-list {
  display: grid;
  align-content: start;
  gap: 8px;
  max-height: calc(100vh - 260px);
  overflow: auto;
  padding-right: 4px;
}

.approval-delegation-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 78px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: #fff;
  color: var(--text);
  text-align: left;
}

.approval-delegation-row:hover,
.approval-delegation-row.active {
  border-color: #7ba9c2;
  background: #f3f8fb;
}

.approval-delegation-row span,
.approval-delegation-row strong,
.approval-delegation-row small {
  display: block;
  min-width: 0;
}

.approval-delegation-row small {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.approval-delegation-editor {
  display: grid;
  align-content: start;
  gap: 14px;
  min-width: 0;
  max-height: calc(100vh - 260px);
  overflow: auto;
  border-left: 1px solid var(--line);
  padding-left: 14px;
}

.approval-delegation-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  gap: 10px;
}

.approval-delegation-form label {
  display: grid;
  align-content: start;
  gap: 5px;
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
}

.approval-delegation-form [hidden] {
  display: none;
}

.approval-delegation-form input,
.approval-delegation-form select {
  width: 100%;
  min-width: 0;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 9px;
  background: #fff;
  color: var(--text);
}

.approval-delegation-form select[multiple] {
  min-height: 126px;
  padding: 5px;
}

.approval-delegation-reason,
.approval-delegation-form .workflow-toggle {
  grid-column: 1 / -1;
}

.approval-delegation-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.approval-delegation-empty {
  min-height: 120px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 28px 16px;
  color: var(--muted);
  text-align: center;
}

.approval-list-panel,
.approval-detail-panel {
  max-height: calc(100vh - 260px);
  overflow: auto;
}

.approval-list-panel {
  display: grid;
  align-content: start;
  gap: 8px;
  padding-right: 4px;
}

.approval-list-item {
  display: grid;
  gap: 7px;
  width: 100%;
  min-height: 92px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fff;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.approval-list-item:hover {
  border-color: rgba(20, 108, 148, 0.28);
  background: #f8fbfd;
}

.approval-list-item.active {
  border-color: rgba(20, 108, 148, 0.5);
  background: #eef7fb;
  box-shadow: inset 3px 0 0 var(--primary);
}

.approval-list-item span,
.approval-list-item strong,
.approval-list-item small,
.approval-list-item em {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.approval-list-item strong {
  margin-bottom: 5px;
  font-size: 14px;
}

.approval-list-item small {
  color: var(--muted);
  font-size: 12px;
}

.approval-list-item em {
  color: var(--primary);
  font-size: 12px;
  font-style: normal;
  font-weight: 700;
}

.approval-detail-card {
  display: grid;
  gap: 14px;
  min-height: 100%;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
}

.approval-detail-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
}

.approval-detail-head h3 {
  margin: 0 0 6px;
  font-size: 18px;
}

.approval-detail-head p,
.approval-detail-line {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.approval-detail-meta {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.approval-detail-meta span {
  display: grid;
  gap: 4px;
  min-height: 58px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font-size: 13px;
}

.approval-detail-meta b {
  color: var(--muted);
  font-size: 12px;
}

.approval-detail-section {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.approval-detail-section h4 {
  margin: 0;
  font-size: 14px;
}

.approval-detail-section p {
  margin: 0;
  color: #314154;
  line-height: 1.7;
}

.approval-field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0;
  border-top: 1px solid var(--line);
}

.approval-field-grid > div {
  display: grid;
  grid-template-columns: minmax(92px, 0.34fr) minmax(0, 1fr);
  gap: 12px;
  min-width: 0;
  padding: 10px 8px;
  border-bottom: 1px solid var(--line);
}

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

.approval-field-grid dt,
.approval-field-grid dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
  line-height: 1.55;
}

.approval-field-grid dt {
  color: var(--muted);
  font-size: 12px;
}

.approval-field-grid dd {
  color: var(--text);
  font-size: 13px;
}

.approval-more-fields summary {
  width: fit-content;
  margin-top: 2px;
  color: var(--primary);
  font-size: 13px;
  cursor: pointer;
}

.approval-more-fields[open] summary {
  margin-bottom: 8px;
}

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

.approval-file-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 40px;
  border: 1px solid #d8e1eb;
  border-radius: 7px;
  padding: 8px 10px;
  color: #123453;
  background: #f8fafc;
  text-decoration: none;
}

.approval-file-link:hover {
  border-color: var(--primary);
  background: #eef8fd;
}

.approval-file-link strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

.approval-file-link span {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 12px;
}

.approval-file-link em {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 3px 8px;
  background: #dff4ff;
  color: #075985;
  font-size: 12px;
  font-style: normal;
  font-weight: 700;
}

.approval-file-link.download em {
  background: #edf2f7;
  color: #526173;
}

.approval-file-link.disabled {
  color: var(--muted);
  cursor: not-allowed;
}

.approval-file-link.disabled:hover {
  border-color: #d8e1eb;
  background: #f8fafc;
}

.approval-file-link.disabled em {
  background: #f1f5f9;
  color: #6b7280;
}

.approval-detail-actions {
  position: sticky;
  bottom: 0;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(251, 253, 255, 0.86), #fbfdff 34%);
}

.approval-detail-actions .reject {
  border-color: rgba(180, 35, 24, 0.25);
  color: var(--danger);
}

.approval-app-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 16px 24px;
}

.approval-app-card {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  min-height: 90px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 15px 18px;
  color: var(--text);
  text-align: left;
}

.approval-app-card:hover {
  border-color: #a9cbed;
  background: #f7fbff;
}

.approval-app-card .module-icon {
  width: 34px;
  height: 34px;
  font-size: 15px;
}

.approval-app-card strong {
  font-size: 16px;
  font-weight: 500;
}

.dashboard-layout,
.ai-layout,
.split-layout {
  display: grid;
  gap: 18px;
}

.dashboard-layout {
  grid-template-columns: minmax(0, 1.1fr) minmax(360px, 0.9fr);
}

.split-layout,
.ai-layout {
  grid-template-columns: minmax(360px, 0.85fr) minmax(0, 1.15fr);
}

.ai-layout {
  grid-template-columns: minmax(0, 1fr) minmax(240px, 300px);
  align-items: stretch;
}

#processes .split-layout {
  grid-template-columns: minmax(0, 1fr) 340px;
  align-items: start;
  justify-content: stretch;
}

#processes .form-panel {
  min-width: 0;
}

.request-guide-panel {
  position: sticky;
  top: 18px;
  min-width: 0;
}

.request-guide-details {
  min-width: 0;
}

.request-guide-details > summary {
  list-style: none;
  cursor: pointer;
}

.request-guide-details > summary::-webkit-details-marker {
  display: none;
}

.request-guide-details:not([open]) > summary {
  margin-bottom: 0;
}

.request-guide-panel .panel-header {
  align-items: center;
}

.request-guide-panel .panel-header span {
  color: var(--muted);
  font-size: 12px;
}

.request-guide {
  display: grid;
  gap: 14px;
}

.request-guide-summary {
  display: grid;
  gap: 4px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.request-guide-summary strong {
  color: var(--text);
  font-size: 15px;
}

.request-guide-summary span {
  color: var(--muted);
  font-size: 12px;
}

.request-guide-meter {
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: #edf1f5;
}

.request-guide-meter i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}

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

.request-guide-kpis span {
  display: grid;
  gap: 2px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
}

.request-guide-kpis b {
  color: var(--text);
  font-size: 20px;
  line-height: 1;
}

.request-guide-kpis em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.request-guide-section {
  display: grid;
  gap: 8px;
}

.request-guide-section h3 {
  margin: 0;
  color: var(--text);
  font-size: 13px;
}

.request-guide-section p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.65;
}

.request-guide-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.request-guide-tags span {
  max-width: 100%;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f7f9fb;
  color: var(--text);
  font-size: 12px;
}

.request-guide-steps {
  display: grid;
  gap: 8px;
}

.request-guide-steps span {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 1px 8px;
  align-items: center;
  font-size: 12px;
}

.request-guide-steps b {
  display: grid;
  grid-row: span 2;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #dfe7f0;
  color: #667586;
  font-size: 11px;
}

.request-guide-steps i {
  overflow: hidden;
  color: var(--text);
  font-style: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.request-guide-steps em {
  overflow: hidden;
  color: var(--muted);
  font-style: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.panel {
  padding: 18px;
}

.panel-header {
  justify-content: space-between;
  margin-bottom: 16px;
}

.muted {
  color: var(--muted);
  font-size: 13px;
}

.list {
  display: grid;
  gap: 10px;
}

.item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-height: 72px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
}

.item h3 {
  margin: 0 0 6px;
  font-size: 15px;
}

.item p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.item-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.mini-btn {
  display: inline-grid;
  place-items: center;
  min-width: 64px;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--text);
  text-decoration: none;
}

.mini-btn.approve {
  border-color: rgba(22, 132, 91, 0.25);
  color: var(--success);
}

.mini-btn.reject {
  border-color: rgba(180, 35, 24, 0.25);
  color: var(--danger);
}

.mini-btn.open-original {
  border-color: rgba(20, 108, 148, 0.25);
  color: var(--primary);
}

.approval-tools {
  justify-content: flex-end;
}

.approval-tools select {
  min-width: 132px;
}

.pilot-banner {
  margin: -4px 0 14px;
  padding: 10px 12px;
  border: 1px solid #cfe0ff;
  border-radius: 8px;
  background: #f2f7ff;
  color: #2c5fba;
  font-size: 13px;
}

.approval-flow {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
}

.flow-summary {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
}

.flow-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.flow-step {
  display: inline-grid;
  grid-template-columns: auto auto;
  gap: 2px 6px;
  align-items: center;
  min-height: 34px;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
}

.flow-step b {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #edf4fa;
  color: var(--primary);
  font-size: 11px;
}

.flow-step small {
  grid-column: 2;
  color: var(--muted);
}

.flow-step.active {
  border-color: rgba(20, 108, 148, 0.35);
  background: #eef7fb;
  color: var(--primary);
}

.flow-step.done {
  border-color: rgba(22, 132, 91, 0.3);
  background: #effaf5;
  color: var(--success);
}

.flow-step.rejected {
  border-color: rgba(180, 35, 24, 0.28);
  background: #fff2f0;
  color: var(--danger);
}

.status {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 999px;
  background: #edf4fa;
  color: var(--primary);
  font-size: 12px;
}

.segmented {
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
}

.segmented button {
  min-height: 32px;
  background: transparent;
  color: var(--muted);
}

.segmented button.active {
  background: #fff;
  color: var(--text);
  border-color: var(--line);
}

.form-panel {
  align-self: start;
}

.request-basic-info,
.request-optional-settings {
  min-width: 0;
}

.request-basic-info > summary,
.request-optional-settings > summary {
  display: none;
}

.request-basic-info-fields,
.request-optional-settings-content {
  min-width: 0;
}

.request-basic-info:not(.erp-compact) .request-basic-info-fields,
.request-optional-settings:not(.erp-compact) .request-optional-settings-content {
  display: contents;
}

.request-basic-info.erp-compact,
.request-optional-settings.erp-compact {
  max-width: 820px;
  margin: 0 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
}

.request-basic-info.erp-compact > summary,
.request-optional-settings.erp-compact > summary {
  display: flex;
  min-height: 48px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 12px;
  list-style: none;
  cursor: pointer;
}

.request-basic-info.erp-compact > summary::-webkit-details-marker,
.request-optional-settings.erp-compact > summary::-webkit-details-marker {
  display: none;
}

.request-basic-info.erp-compact > summary > span:first-child,
.request-optional-settings.erp-compact > summary > span:first-child {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.request-basic-info.erp-compact > summary strong,
.request-optional-settings.erp-compact > summary strong {
  color: var(--text);
  font-size: 13px;
}

.request-basic-info.erp-compact > summary small,
.request-optional-settings.erp-compact > summary small {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.details-action {
  flex: 0 0 auto;
  color: var(--primary);
  font-size: 12px;
}

.request-basic-info.erp-compact[open] .details-action,
.request-optional-settings.erp-compact[open] .details-action {
  font-size: 0;
}

.request-basic-info.erp-compact[open] .details-action::after,
.request-optional-settings.erp-compact[open] .details-action::after {
  content: "收起";
  font-size: 12px;
}

.request-basic-info.erp-compact .request-basic-info-fields,
.request-optional-settings.erp-compact .request-optional-settings-content {
  padding: 2px 12px 12px;
  border-top: 1px solid var(--line);
}

.request-basic-info.erp-compact .request-basic-info-fields {
  padding-top: 12px;
}

.request-optional-settings.erp-compact .request-copy-picker,
.request-optional-settings.erp-compact .request-ai-helper {
  max-width: none;
}

.request-optional-settings.erp-compact .request-copy-picker {
  margin-top: 12px;
}

.erp-request-mode .erp-route-note {
  display: none;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.hidden-field {
  display: none !important;
}

.checklist {
  display: grid;
  gap: 7px;
  margin: -2px 0 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
}

.checklist strong {
  font-size: 13px;
}

.checklist span {
  color: var(--danger);
  font-size: 12px;
}

.checklist span.ok {
  color: var(--success);
}

.checklist.erp-request-checks {
  max-width: 820px;
  margin-top: 0;
  padding: 10px 12px;
}

.checklist.erp-request-checks strong {
  color: var(--text);
}

.checklist.erp-request-checks:empty {
  display: none;
}

.special-form {
  display: grid;
  gap: 0;
  max-width: 820px;
}

.erp-request-mode .special-form {
  max-width: 1180px;
}

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

.erp-form-grid > .flow-field-wide,
.erp-form-grid > .field-help,
.erp-form-grid > .flow-detail-table,
.erp-form-grid > .performance-summary-table,
.erp-form-grid > .performance-self-table,
.erp-form-grid > .performance-source-picker {
  grid-column: 1 / -1;
}

.flow-field {
  display: grid;
  grid-template-columns: 128px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  color: var(--text);
  font-size: 14px;
}

.flow-field > span:first-child {
  color: var(--text);
}

.flow-field input,
.flow-field select,
.flow-field textarea,
.flow-field .form-grid {
  min-width: 0;
}

.flow-field .form-grid {
  grid-template-columns: minmax(0, 1fr) 240px;
  gap: 12px;
}

.flow-money-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.flow-money-preview {
  min-width: 118px;
  color: var(--muted);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}

.checkbox-grid,
.radio-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  min-width: 0;
}

.radio-grid {
  grid-template-columns: minmax(0, 1fr);
}

.checkbox-option,
.radio-option {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
}

.checkbox-option input,
.radio-option input {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  accent-color: var(--primary);
}

.checkbox-option span,
.radio-option span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.flow-field-tall {
  align-items: start;
}

.flow-field-tall > span:first-child {
  padding-top: 10px;
}

.flow-field textarea {
  min-height: 118px;
}

.erp-form-grid .flow-field textarea {
  min-height: 92px;
}

.request-ai-helper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  max-width: 820px;
  margin: -2px 0 14px;
  padding: 10px 12px;
  border: 1px solid rgba(20, 108, 148, 0.18);
  border-radius: 8px;
  background: #f6fbff;
}

.request-ai-helper div {
  display: grid;
  gap: 3px;
}

.request-ai-helper strong {
  font-size: 13px;
}

.request-ai-helper span {
  color: var(--muted);
  font-size: 12px;
}

.request-ai-helper .ghost-btn {
  min-width: 132px;
  white-space: nowrap;
}

.request-copy-picker {
  display: grid;
  gap: 8px;
  max-width: 820px;
  margin: 0 0 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
}

.copy-picker-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.copy-picker-head span {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

.copy-picker-head small {
  color: var(--muted);
  font-size: 12px;
}

.copy-picker-selected {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 32px;
  align-items: center;
}

.copy-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 0 9px;
  border: 1px solid rgba(20, 108, 148, 0.22);
  border-radius: 999px;
  background: #eef8fb;
  color: var(--primary);
  font-weight: 700;
  cursor: pointer;
}

.copy-chip span {
  color: var(--muted);
  font-size: 14px;
  line-height: 1;
}

.copy-picker-search {
  width: 100%;
}

.copy-picker-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(168px, 1fr));
  gap: 8px;
  max-height: 176px;
  overflow-y: auto;
}

.copy-option {
  display: grid;
  gap: 2px;
  min-height: 48px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.copy-option:hover {
  border-color: rgba(20, 108, 148, 0.35);
  background: #f7fbff;
}

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

.copy-option span,
.copy-picker-empty {
  color: var(--muted);
  font-size: 12px;
}

.required-label::before {
  content: "*";
  color: var(--danger);
  margin-right: 2px;
}

.field-help {
  margin: -8px 0 14px;
  color: var(--muted);
  font-size: 12px;
}

.field-help.required-help {
  color: var(--danger);
}

.monthly-form {
  display: grid;
  gap: 10px;
  margin: 0 0 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
}

.monthly-form-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.monthly-form-head strong {
  font-size: 14px;
}

.monthly-form-head span {
  color: var(--muted);
  font-size: 12px;
}

.monthly-table {
  display: grid;
  gap: 8px;
  overflow-x: auto;
}

.monthly-row {
  display: grid;
  grid-template-columns: minmax(180px, 2fr) minmax(160px, 1.4fr) 86px 150px;
  gap: 8px;
  min-width: 650px;
  align-items: center;
}

.monthly-row-head {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.monthly-row input,
.monthly-row textarea {
  min-width: 0;
}

.monthly-row textarea {
  min-height: 42px;
  resize: vertical;
}

.plan-table-with-index .monthly-row {
  grid-template-columns: 52px minmax(180px, 1.8fr) minmax(160px, 1.4fr) 86px 150px;
  min-width: 760px;
}

.monthly-row-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: #eef4f8;
  color: var(--muted);
  font-weight: 700;
}

.assessment-table .monthly-row {
  grid-template-columns: 52px minmax(180px, 1.5fr) minmax(160px, 1.3fr) 74px 132px 132px 120px 120px 120px 100px minmax(130px, 1fr);
  min-width: 1380px;
}

.flow-detail-table {
  display: grid;
  gap: 10px;
  margin: 0 0 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
  overflow-x: auto;
}

.flow-detail-table-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.flow-detail-table-head strong {
  font-size: 14px;
}

.flow-detail-table-head span {
  color: var(--muted);
  font-size: 12px;
}

.flow-detail-grid {
  display: grid;
  grid-template-columns: var(--flow-table-columns, repeat(4, minmax(120px, 1fr)));
  gap: 8px;
  min-width: 720px;
  align-items: center;
}

.flow-detail-grid b {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.flow-detail-grid input,
.flow-detail-grid select,
.flow-detail-grid textarea {
  min-width: 0;
}

.flow-detail-grid textarea {
  min-height: 58px;
  resize: vertical;
}

.flow-detail-table-stacked {
  overflow-x: hidden;
}

.flow-detail-row-list {
  display: grid;
}

.flow-detail-row {
  display: grid;
  gap: 10px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.flow-detail-row[hidden],
.flow-detail-row-head button[hidden],
.flow-detail-row-actions button[hidden] {
  display: none;
}

.flow-detail-row-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.flow-detail-row-head strong {
  color: var(--muted);
  font-size: 13px;
}

.flow-detail-row-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(160px, 100%), 1fr));
  gap: 10px;
}

.flow-detail-row-field {
  display: grid;
  gap: 6px;
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.flow-detail-row-field input,
.flow-detail-row-field select,
.flow-detail-row-field textarea {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  color: var(--text);
  font-size: 14px;
  font-weight: 400;
}

.flow-detail-row-actions {
  display: flex;
  justify-content: flex-start;
}

@media (max-width: 640px) {
  .flow-detail-table-stacked {
    padding: 10px;
  }

  .flow-detail-table-stacked .flow-detail-table-head {
    align-items: flex-start;
    flex-direction: column;
  }
}

.flow-detail-index {
  display: grid;
  min-height: 38px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  background: #fff;
}

.performance-summary-table {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
}

.performance-source-picker {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfd;
}

.performance-source-list {
  display: grid;
  max-height: 190px;
  gap: 6px;
  overflow-y: auto;
}

.performance-source-option {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid #d5e1ea;
  border-radius: 7px;
  background: #fff;
  cursor: pointer;
}

.performance-source-option input {
  width: 16px;
  height: 16px;
  margin: 0;
}

.performance-source-option strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

.performance-source-option span,
.performance-source-empty,
.performance-source-actions > span {
  color: var(--muted);
  font-size: 12px;
}

.performance-source-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
}

.performance-source-actions button {
  flex: 0 0 auto;
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid #9db5c9;
  border-radius: 7px;
  background: #fff;
  color: #245979;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
}

.performance-source-actions button:hover:not(:disabled) {
  border-color: var(--primary);
  background: #f1f8fc;
}

.performance-source-actions button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.performance-summary-head,
.performance-summary-row {
  display: grid;
  grid-template-columns: 52px minmax(180px, 1.6fr) 92px minmax(130px, 1fr) minmax(130px, 1fr) 96px 34px;
  gap: 8px;
  align-items: center;
}

.performance-summary-head {
  color: var(--muted);
  font-size: 12px;
}

.performance-summary-rows {
  display: grid;
  gap: 8px;
}

.performance-summary-row[hidden],
.performance-row-remove[hidden],
.performance-summary-actions button[hidden] {
  display: none !important;
}

.performance-summary-actions {
  display: flex;
  justify-content: flex-end;
}

.performance-summary-actions button {
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid #9db5c9;
  border-radius: 7px;
  background: #fff;
  color: #245979;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
}

.performance-summary-actions button:hover {
  border-color: var(--primary);
  background: #f1f8fc;
}

.performance-row-remove {
  display: inline-grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--muted);
  cursor: pointer;
  font-size: 18px;
}

.performance-row-remove:hover {
  border-color: #c85f5f;
  color: #a23030;
}

.performance-cell {
  display: block;
}

.performance-cell > span {
  display: none;
}

.performance-cell input,
.performance-cell textarea {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.performance-cell textarea {
  min-height: 42px;
  resize: vertical;
}

.performance-self-table {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
}

.performance-self-head,
.performance-self-row {
  display: grid;
  grid-template-columns: 52px minmax(180px, 1.25fr) minmax(180px, 1.1fr) minmax(220px, 1.5fr) 96px;
  gap: 8px;
  align-items: center;
}

.performance-self-head {
  color: var(--muted);
  font-size: 12px;
}

.performance-self-rows {
  display: grid;
  gap: 8px;
}

.performance-self-cell {
  display: block;
}

.performance-self-cell > span {
  display: none;
}

.performance-self-cell input,
.performance-self-cell textarea {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.performance-self-cell textarea {
  min-height: 54px;
  resize: vertical;
}

.performance-self-indicator textarea[readonly] {
  background: #f3f7fa;
  color: var(--text);
  font-weight: 700;
}

@media (max-width: 640px) {
  .performance-source-picker {
    padding: 10px;
  }

  .performance-source-picker .flow-detail-table-head,
  .performance-source-actions {
    align-items: flex-start;
    flex-direction: column;
  }

  .performance-source-option {
    grid-template-columns: 18px minmax(0, 1fr);
  }

  .performance-source-option > span {
    grid-column: 2;
  }

  .performance-source-actions button {
    width: 100%;
  }

  .performance-summary-table {
    padding: 10px;
  }

  .performance-summary-table .flow-detail-table-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .performance-summary-head {
    display: none;
  }

  .performance-summary-row {
    grid-template-columns: 40px minmax(0, 1fr) 32px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
  }

  .performance-summary-row > .flow-detail-index {
    grid-row: 1 / span 5;
    align-self: stretch;
    height: auto;
  }

  .performance-cell {
    grid-column: 2 / 4;
    display: grid;
    grid-template-columns: 76px minmax(0, 1fr);
    gap: 8px;
    align-items: center;
  }

  .performance-cell > span {
    display: block;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
  }

  .performance-row-remove {
    grid-column: 3;
    grid-row: 1;
  }

  .performance-self-table {
    padding: 10px;
  }

  .performance-self-table .flow-detail-table-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .performance-self-head {
    display: none;
  }

  .performance-self-row {
    grid-template-columns: 40px minmax(0, 1fr);
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
  }

  .performance-self-row > .flow-detail-index {
    grid-row: 1 / span 4;
    align-self: stretch;
    height: auto;
  }

  .performance-self-cell {
    display: grid;
    grid-template-columns: 88px minmax(0, 1fr);
    gap: 8px;
    align-items: center;
  }

  .performance-self-cell > span {
    display: block;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
  }
}

@media (min-width: 641px) {
  .performance-self-table {
    overflow-x: auto;
  }

  .performance-self-head,
  .performance-self-row {
    min-width: 760px;
  }
}

.workflow-signature-table {
  display: grid;
  margin-top: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.workflow-signature-table > strong {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: #eef6ff;
  text-align: center;
}

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

.workflow-signature-grid > span {
  padding: 10px 12px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #f8fbff;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-align: center;
}

.workflow-signature-grid > span:last-child,
.workflow-signature-grid > textarea:last-child {
  border-right: 0;
}

.workflow-signature-grid > textarea {
  min-height: 70px;
  border: 0;
  border-right: 1px solid var(--line);
  border-radius: 0;
  padding: 12px;
  resize: vertical;
}

.required-mark {
  color: var(--danger);
  font-style: normal;
  margin-left: 2px;
}

.attach-btn {
  width: 180px;
  justify-self: start;
}

.flow-preview {
  display: grid;
  gap: 8px;
  margin: 0 0 14px;
  padding: 18px 0 4px;
  border-top: 1px solid var(--line);
}

.flow-preview-title strong {
  font-size: 15px;
}

.flow-preview-title small {
  margin-left: 6px;
  color: var(--muted);
}

.preview-flow-section {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.preview-flow-section h3 {
  margin: 0;
  font-size: 14px;
}

.preview-flow-steps {
  display: grid;
  gap: 10px;
  margin-top: 4px;
}

.preview-flow-steps span {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 2px 10px;
  align-items: center;
  color: var(--text);
  font-size: 13px;
}

.copy-people {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.copy-people span {
  display: inline-grid;
  place-items: center;
  min-width: 72px;
  min-height: 40px;
  border-radius: 7px;
  background: #f3f5f8;
  color: var(--text);
  font-size: 13px;
}

.preview-flow-steps b {
  display: grid;
  grid-row: span 2;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #dfe7f0;
  color: #667586;
  font-size: 12px;
}

.preview-flow-steps em {
  color: var(--muted);
  font-style: normal;
  font-size: 12px;
}

label {
  display: grid;
  gap: 7px;
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 13px;
}

input,
select,
textarea {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--text);
  padding: 9px 11px;
}

textarea {
  min-height: 108px;
  resize: vertical;
}

.template-grid,
.knowledge-list,
.automation-grid {
  display: grid;
  gap: 12px;
}

.template-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.template-card,
.knowledge-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fbfdff;
}

.template-action {
  display: grid;
  gap: 6px;
  width: 100%;
  min-height: 72px;
  color: var(--text);
  text-align: left;
}

.template-action:hover {
  border-color: #9dc5e3;
  background: #f4f9fd;
}

.template-card strong,
.knowledge-card strong {
  display: block;
  margin-bottom: 8px;
}

.template-card span,
.knowledge-card span {
  color: var(--muted);
  font-size: 13px;
}

.template-card span {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.knowledge-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  font-size: 13px;
}

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

.knowledge-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(120px, 160px) minmax(140px, 180px);
  gap: 10px;
  width: min(680px, 100%);
}

.knowledge-toolbar .search {
  max-width: none;
}

.unified-knowledge-card {
  display: grid;
  gap: 10px;
}

.knowledge-card-head,
.knowledge-meta,
.knowledge-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.knowledge-card-head {
  justify-content: space-between;
}

.knowledge-card-head small {
  color: var(--muted);
}

.knowledge-source {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 3px 8px;
  color: #155e75;
  background: #cffafe;
  font-size: 12px;
  font-weight: 700;
}

.knowledge-source.static {
  color: #166534;
  background: #dcfce7;
}

.knowledge-card p {
  margin: 0;
  color: #314154;
  line-height: 1.65;
}

.knowledge-meta {
  color: var(--muted);
  font-size: 13px;
}

.knowledge-actions .mini-btn {
  min-height: 30px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 700;
}

.list-pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  font-size: 13px;
}

.list-pagination div {
  display: flex;
  align-items: center;
  gap: 8px;
}

.list-pagination button {
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fbfdff;
  color: var(--text);
  padding: 0 10px;
}

.list-pagination button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.list-pagination strong {
  min-width: 58px;
  color: var(--text);
  text-align: center;
}

.search {
  max-width: 300px;
}

.employee-page {
  display: grid;
  gap: 16px;
}

.employee-page > .panel-header {
  margin-bottom: 0;
}

.employee-page > .panel-header span {
  color: var(--muted);
  font-size: 13px;
}

.employee-module-section {
  display: grid;
  gap: 12px;
  padding-top: 4px;
  border-top: 1px solid var(--line);
}

.employee-module-section[data-employee-panel] {
  display: none;
}

.employee-module-section[data-employee-panel].active {
  display: grid;
}

.employee-section-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfd;
}

.employee-section-tabs button {
  min-height: 36px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: #405168;
  padding: 0 14px;
  font-weight: 600;
}

.employee-section-tabs button.active {
  border-color: #bfd8ef;
  background: #eaf4ff;
  color: #235f90;
}

.employee-module-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.employee-module-head h3 {
  margin: 0 0 3px;
  font-size: 17px;
}

.employee-module-head span {
  color: var(--muted);
  font-size: 13px;
}

.employee-module-head .search {
  width: min(360px, 100%);
}

.employee-module-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-width: min(520px, 100%);
}

.employee-module-actions .primary-btn {
  min-width: 104px;
  white-space: nowrap;
}

.employee-overview {
  display: grid;
  gap: 12px;
}

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

.employee-overview-cards article,
.employee-overview-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.employee-overview-cards article {
  min-height: 82px;
  padding: 13px;
}

.employee-overview-cards span,
.employee-overview-cards small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.employee-overview-cards strong {
  display: block;
  margin: 6px 0 3px;
  color: #13243a;
  font-size: 24px;
  line-height: 1;
}

.employee-overview-grid {
  display: grid;
  grid-template-columns: minmax(240px, 0.75fr) minmax(320px, 1.1fr) minmax(260px, 0.9fr);
  gap: 12px;
}

.employee-overview-panel {
  min-height: 168px;
  padding: 14px;
}

.employee-overview-panel h4 {
  margin: 0 0 12px;
  color: #21324a;
  font-size: 15px;
}

.overview-status {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.overview-status div {
  min-height: 78px;
  padding: 10px;
  border: 1px solid #e2ebf4;
  border-radius: 8px;
  background: #f8fbfd;
}

.overview-status span,
.overview-departments span,
.overview-actions span {
  color: var(--muted);
  font-size: 12px;
}

.overview-status strong {
  display: block;
  margin-top: 7px;
  color: #13243a;
  font-size: 24px;
}

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

.overview-departments div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  min-height: 32px;
  border-bottom: 1px solid #edf2f7;
}

.overview-departments strong {
  color: #23405c;
  font-size: 14px;
}

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

.overview-actions button {
  display: grid;
  gap: 4px;
  min-height: 68px;
  border: 1px solid #d9e4ef;
  border-radius: 8px;
  background: #fbfdff;
  padding: 10px;
  text-align: left;
}

.overview-actions button:hover {
  border-color: var(--primary);
  background: #eef7ff;
}

.overview-actions strong {
  color: #21324a;
  font-size: 14px;
}

.org-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 0;
}

.org-summary article {
  min-height: 86px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
}

.org-summary span,
.org-summary small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.org-summary strong {
  display: block;
  margin: 6px 0 5px;
  font-size: 24px;
}

.org-chart {
  margin: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.org-chart-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.org-chart-head h3 {
  margin: 0;
  font-size: 16px;
}

.org-chart-head span {
  color: var(--muted);
  font-size: 12px;
}

.org-tree {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 10px;
}

.org-structure {
  overflow-x: auto;
  padding: 32px 2px 2px;
}

.org-canvas {
  position: relative;
  width: 1340px;
  min-width: 1340px;
}

.org-scroll-top {
  overflow-x: auto;
  overflow-y: hidden;
  height: 14px;
  margin: 0 0 6px;
}

.org-scroll-spacer {
  height: 1px;
  min-width: 1340px;
}

.org-leadership {
  position: relative;
  display: grid;
  grid-template-columns: 420px minmax(260px, 1fr) 420px;
  align-items: start;
  gap: 28px;
  width: 1340px;
  min-height: 218px;
  margin: 0 auto;
  --org-connector: #7d8a98;
}

.org-leadership::before {
  content: "";
  position: absolute;
  top: 86px;
  right: 274px;
  left: 274px;
  z-index: 0;
  height: 2px;
  background: var(--org-connector);
}

.org-leadership-main {
  display: grid;
  grid-column: 2;
  width: 100%;
  position: relative;
  z-index: 1;
  justify-content: center;
  gap: 10px;
  transform: translateY(-24px);
}

.org-leadership-main::after {
  content: "";
  position: absolute;
  left: 50%;
  top: calc(100% + 0px);
  width: 2px;
  height: 104px;
  transform: translateX(-50%);
  background: var(--org-connector);
}

.org-leader-level {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 4px;
}

.org-leader-level:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -10px;
  width: 2px;
  height: 10px;
  transform: translateX(-50%);
  background: var(--org-connector);
}

.org-leadership-main .org-person {
  width: 176px;
  min-height: 38px;
  padding: 7px 12px;
  text-align: center;
  font-size: 16px;
}

.org-leadership-main .org-person small {
  display: none;
}

.org-leader-general {
  width: 100%;
}

.org-leader-general > span {
  position: relative;
  z-index: 1;
}

.org-edit-btn {
  position: absolute;
  right: -10px;
  top: -9px;
  min-width: 44px;
  min-height: 24px;
  padding: 0 8px;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  background: #fff;
  color: #315f7a;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 5px 14px rgba(31, 45, 61, 0.12);
}

.org-edit-btn:hover {
  border-color: #8fb9d5;
  background: #f3f8fb;
}

.org-leader-level > span {
  position: relative;
  display: grid;
  place-items: center;
  min-width: 176px;
  min-height: 38px;
  box-sizing: border-box;
  padding: 0 18px;
  border-radius: 3px;
  background: #5f6872;
  color: #fff;
  font-size: 15px;
  line-height: 1.25;
  text-align: center;
}

.org-leader-level > div {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.org-leader-level em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.org-line {
  position: relative;
  width: 1080px;
  height: 30px;
  margin: 30px auto 0;
  border-top: 2px solid #7d8a98;
}

.org-line::before {
  content: "";
  display: none;
  position: absolute;
  left: 50%;
  top: -32px;
  width: 2px;
  height: 32px;
  transform: translateX(-50%);
  background: #7d8a98;
}

.org-line::after {
  content: "";
  position: absolute;
  left: calc(50% - 4px);
  top: -4px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #7d8a98;
}

.org-structure-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(150px, 1fr));
  gap: 12px;
  width: 1080px;
  min-width: 1080px;
  margin: 18px auto 0;
}

.org-structure-group {
  position: relative;
  display: grid;
  align-content: start;
  gap: 8px;
}

.org-direct-branch {
  position: relative;
  z-index: 1;
  display: grid;
  justify-content: center;
  width: min(420px, 100%);
  margin-top: 58px;
}

.org-hr-direct {
  grid-column: 1;
}

.org-audit-direct {
  grid-column: 3;
}

.org-direct-branch::before {
  content: "";
  position: absolute;
  top: 28px;
  width: 56px;
  height: 2px;
  background: #7d8a98;
}

.org-hr-direct::before {
  right: -56px;
}

.org-audit-direct::before {
  left: -56px;
}

.org-direct-branch .org-structure-group {
  width: min(420px, 100%);
}

.org-direct-branch .org-structure-group h4 {
  background: #56616d;
  box-shadow: 0 0 0 2px #fff, 0 0 0 3px #7d8a98;
}

.org-direct-branch .org-group-people {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
}

.org-direct-branch .org-person {
  width: 128px;
  min-height: 56px;
  text-align: center;
}

.org-structure-group h4 {
  position: relative;
  margin: 0 auto;
  min-width: 128px;
  padding: 7px 10px;
  border-radius: 3px;
  background: #6a737d;
  color: #fff;
  font-size: 13px;
  text-align: center;
}

.org-structure-group h4 span {
  display: block;
  margin-top: 2px;
  color: #dfe5eb;
  font-size: 11px;
  font-weight: 400;
}

.org-department-list {
  display: grid;
  gap: 5px;
}

.org-group-owner {
  margin-top: -2px;
  padding: 5px 7px;
  border: 1px solid #cfdbe8;
  border-radius: 5px;
  background: #f8fbff;
  color: #315f7a;
  font-size: 11px;
  font-weight: 700;
  text-align: center;
}

.org-department-list b {
  padding: 5px 6px;
  border: 1px solid #d4dde7;
  border-radius: 4px;
  background: #f5f8fb;
  color: #4b5563;
  font-size: 11px;
  font-weight: 600;
  text-align: center;
}

.org-group-people {
  display: grid;
  gap: 6px;
}

.org-subgroups {
  display: grid;
  gap: 7px;
}

.org-subgroup {
  display: grid;
  gap: 6px;
  padding: 6px;
  border: 1px solid #d4dde7;
  border-radius: 5px;
  background: #f7fafc;
}

.org-subgroup-head {
  position: relative;
  display: grid;
  gap: 2px;
  padding-right: 44px;
}

.org-subgroup-head strong,
.org-subgroup-head span {
  display: block;
}

.org-subgroup-head strong {
  font-size: 12px;
}

.org-subgroup-head span {
  color: #526273;
  font-size: 11px;
}

.org-subgroup-head .org-edit-btn {
  right: -2px;
  top: -3px;
}

.org-subgroup-people {
  display: grid;
  gap: 5px;
}

.org-person {
  display: block;
  width: 100%;
  padding: 7px 8px;
  border: 1px solid #dce4ee;
  border-radius: 5px;
  background: #fff;
  color: var(--text);
  text-align: left;
}

button.org-person {
  cursor: pointer;
}

button.org-person:hover {
  border-color: var(--primary);
  background: #f5faff;
}

.org-person.virtual {
  min-width: 140px;
  text-align: center;
}

.org-person.leader {
  border-color: #b9cce0;
  background: #eef6ff;
}

.org-person.leader strong::after {
  content: "（负责人）";
  display: inline-block;
  margin-left: 6px;
  color: #315f7a;
  font-size: 11px;
  font-weight: 700;
  vertical-align: 1px;
}

.org-person strong,
.org-person small {
  display: block;
}

.org-person strong {
  font-size: 13px;
}

.org-person small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.3;
}

.org-editor-panel {
  display: grid;
  gap: 12px;
  margin-top: 16px;
  padding: 14px;
  border: 1px solid #cfe0f1;
  border-radius: 8px;
  background: #f8fbff;
}

.org-editor-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.org-editor-head strong,
.org-editor-head span {
  display: block;
}

.org-editor-head strong {
  font-size: 15px;
}

.org-editor-head span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.org-editor-current {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.org-editor-current button,
.org-editor-current span {
  min-height: 38px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--text);
  font-size: 13px;
}

.org-editor-current button {
  cursor: pointer;
  text-align: left;
}

.org-editor-current button.active {
  border-color: #78add7;
  background: #edf7ff;
  color: #205c87;
}

.org-editor-current small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.org-editor-form {
  display: grid;
  grid-template-columns: repeat(5, minmax(120px, 1fr));
  gap: 10px;
  align-items: end;
}

.org-editor-form label {
  display: grid;
  gap: 5px;
  color: #4d5b6d;
  font-size: 12px;
}

.org-editor-form input,
.org-editor-form select {
  min-height: 36px;
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  padding: 0 10px;
  color: var(--text);
  font-size: 13px;
}

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

.org-editor-actions .primary-btn {
  min-width: 148px;
}

.department-lifecycle-panel {
  border-color: #b9d1e5;
  background: #f6faff;
}

.department-lifecycle-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 10px;
  align-items: end;
}

.department-lifecycle-form > label {
  display: grid;
  gap: 5px;
  color: #4d5b6d;
  font-size: 12px;
}

.department-lifecycle-form input,
.department-lifecycle-form select {
  min-height: 36px;
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  padding: 0 10px;
  color: var(--text);
  font-size: 13px;
}

.department-lifecycle-reason {
  grid-column: span 2;
}

.department-lifecycle-warning {
  min-height: 36px;
  box-sizing: border-box;
  border: 1px solid #edc777;
  border-radius: 7px;
  background: #fffaf0;
  padding: 9px 11px;
  color: #86590f;
  font-size: 12px;
}

.department-lifecycle-impact {
  grid-column: 1 / -1;
}

.department-lifecycle-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.department-lifecycle-summary span {
  border: 1px solid rgb(200 137 25 / 24%);
  border-radius: 999px;
  background: rgb(255 255 255 / 68%);
  padding: 4px 9px;
  color: #6f5a35;
  font-size: 11px;
}

.department-lifecycle-summary strong {
  margin-left: 3px;
  color: var(--text);
}

.organization-change-impact-list > div.history {
  background: #f3f7fb;
}

.department-lifecycle-confirm {
  display: flex !important;
  grid-template-columns: none;
  align-items: flex-start;
  gap: 8px !important;
  color: #5d523d !important;
  line-height: 1.55;
}

.department-lifecycle-confirm input {
  width: 16px;
  min-height: 16px;
  margin-top: 2px;
  padding: 0;
}

.department-lifecycle-form .org-editor-actions {
  grid-column: 1 / -1;
}

.organization-change-impact {
  display: grid;
  grid-column: 1 / -1;
  gap: 10px;
  padding: 12px;
  border: 1px solid #edc777;
  border-left: 4px solid #c88919;
  border-radius: 8px;
  background: #fffaf0;
}

.organization-change-impact.blocked {
  border-color: #e8aaa3;
  border-left-color: #b8463b;
  background: #fff5f4;
}

.organization-change-impact-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.organization-change-impact-head strong,
.organization-change-impact-head span {
  display: block;
}

.organization-change-impact-head span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.organization-change-impact-head em {
  color: #9a6210;
  font-size: 12px;
  font-style: normal;
  font-weight: 700;
}

.organization-change-impact.blocked .organization-change-impact-head em,
.organization-change-blocker {
  color: #a3372f;
}

.organization-change-impact-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.organization-change-impact-list > div {
  display: grid;
  grid-template-columns: 90px minmax(120px, 1fr) minmax(80px, 0.8fr);
  gap: 8px;
  align-items: center;
  padding: 7px 9px;
  border-radius: 6px;
  background: rgb(255 255 255 / 72%);
  font-size: 12px;
}

.organization-change-impact-list span,
.organization-change-impact-list small {
  color: var(--muted);
}

.organization-change-fields {
  display: grid;
  grid-template-columns: minmax(220px, 0.8fr) minmax(280px, 1.2fr);
  gap: 10px;
}

.organization-change-blocker {
  margin: 0;
  font-size: 12px;
}

.org-directory-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 14px;
}

.org-directory-head > div > span,
.org-unit-header > div > span {
  color: #315f7a;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.org-directory-head h3,
.org-unit-header h4 {
  margin: 4px 0;
  color: #1f2d3d;
}

.org-directory-head h3 {
  font-size: 20px;
}

.org-directory-head p,
.org-unit-header p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.org-directory-search {
  display: grid;
  grid-template-columns: auto minmax(190px, 260px);
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.org-directory-search input {
  width: 100%;
  min-height: 38px;
  box-sizing: border-box;
  padding: 0 12px;
  border: 1px solid #cad7e4;
  border-radius: 8px;
  outline: none;
  background: #fff;
  color: var(--text);
}

.org-directory-search input:focus {
  border-color: #6b9ec2;
  box-shadow: 0 0 0 3px rgba(64, 128, 171, 0.12);
}

.org-directory-warning {
  margin-bottom: 12px;
  padding: 9px 11px;
  border: 1px solid #ead8a2;
  border-radius: 7px;
  background: #fff9e8;
  color: #755d1f;
  font-size: 12px;
}

.org-directory-layout {
  display: grid;
  grid-template-columns: minmax(250px, 310px) minmax(0, 1fr);
  gap: 14px;
  min-width: 0;
}

.org-tree-pane,
.org-detail-pane,
.org-directory-no-result {
  min-width: 0;
  border: 1px solid #dbe5ef;
  border-radius: 9px;
  background: #fbfdff;
}

.org-tree-pane {
  max-height: 680px;
  overflow: auto;
}

.org-tree-pane-head {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 42px;
  padding: 0 12px;
  border-bottom: 1px solid #dbe5ef;
  background: rgba(248, 251, 255, 0.96);
  backdrop-filter: blur(8px);
}

.org-tree-pane-head strong {
  font-size: 13px;
}

.org-tree-pane-head span {
  color: var(--muted);
  font-size: 11px;
}

.org-tree-list,
.org-tree-list ul {
  display: grid;
  gap: 2px;
  margin: 0;
  padding: 6px;
  list-style: none;
}

.org-tree-list ul {
  margin-left: 13px;
  padding: 2px 0 2px 9px;
  border-left: 1px solid #d8e3ed;
}

.org-tree-branch > summary {
  list-style: none;
}

.org-tree-branch > summary::-webkit-details-marker {
  display: none;
}

.org-tree-node {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 40px;
  box-sizing: border-box;
  padding: 6px 8px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  text-align: left;
}

button.org-tree-node {
  font: inherit;
}

.org-tree-node:hover {
  border-color: #d5e2ec;
  background: #f2f7fb;
}

.org-tree-node.active {
  border-color: #94bad4;
  background: #eaf4fb;
  color: #1f587c;
}

.org-tree-node.matched .org-tree-node-copy strong {
  color: #a45421;
}

.org-tree-node-copy {
  display: block;
  min-width: 0;
}

.org-tree-node-copy strong,
.org-tree-node-copy small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.org-tree-node-copy strong {
  font-size: 13px;
}

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

.org-tree-node-copy small:empty {
  display: none;
}

.org-tree-count {
  min-width: 26px;
  padding: 2px 6px;
  border-radius: 999px;
  background: #e9eff5;
  color: #526273;
  font-size: 11px;
  text-align: center;
}

.org-tree-empty,
.org-detail-empty {
  padding: 22px 14px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.org-detail-pane {
  display: grid;
  align-content: start;
  gap: 14px;
  padding: 16px;
  background: #fff;
}

.org-unit-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  min-width: 0;
  padding-bottom: 13px;
  border-bottom: 1px solid #e3eaf1;
}

.org-unit-header > div {
  min-width: 0;
}

.org-unit-header h4 {
  font-size: 19px;
}

.org-unit-header p {
  overflow-wrap: anywhere;
}

.org-unit-header .org-edit-btn {
  position: static;
  flex: 0 0 auto;
  min-width: 80px;
  min-height: 32px;
  box-shadow: none;
}

.org-unit-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 7px;
}

.org-unit-header .department-governance-btn {
  border-color: #8fb9d5;
  background: #edf7ff;
  color: #205c87;
}

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

.org-unit-stats article {
  display: grid;
  gap: 3px;
  min-height: 56px;
  box-sizing: border-box;
  padding: 10px;
  border: 1px solid #e0e8f0;
  border-radius: 7px;
  background: #f8fbfe;
}

.org-unit-stats strong {
  color: #294e68;
  font-size: 18px;
}

.org-unit-stats span {
  color: var(--muted);
  font-size: 11px;
}

.org-detail-section {
  display: grid;
  gap: 8px;
}

.org-detail-section h5 {
  margin: 0;
  color: #344457;
  font-size: 13px;
}

.org-detail-section h5 span {
  margin-left: 4px;
  color: var(--muted);
  font-weight: 400;
}

.org-detail-note {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
}

.org-child-grid,
.org-member-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 8px;
}

.org-child-card,
.org-member-card {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  min-height: 54px;
  box-sizing: border-box;
  padding: 9px 10px;
  border: 1px solid #dbe5ef;
  border-radius: 7px;
  background: #fff;
  color: var(--text);
  cursor: pointer;
  text-align: left;
}

.org-child-card {
  justify-content: space-between;
  background: #f9fbfd;
}

.org-child-card:hover,
.org-member-card:hover {
  border-color: #8fb9d5;
  background: #f2f8fc;
}

.org-child-card > span,
.org-member-card > span:last-child {
  display: block;
  min-width: 0;
}

.org-child-card strong,
.org-child-card small,
.org-member-card strong,
.org-member-card small {
  display: block;
}

.org-child-card strong,
.org-member-card strong {
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.org-child-card small,
.org-member-card small {
  margin-top: 3px;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.org-child-card b {
  flex: 0 0 auto;
  color: #315f7a;
  font-size: 12px;
}

.org-member-avatar {
  display: grid;
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 8px;
  background: #e8eff5;
  color: #45637a;
  font-size: 13px;
  font-weight: 700;
}

.org-member-card.leader {
  border-color: #b7d0e1;
  background: #f2f8fc;
}

.org-member-card.leader .org-member-avatar {
  background: #dbeaf4;
  color: #245b7e;
}

.org-member-card em {
  display: inline-block;
  margin-left: 5px;
  padding: 1px 4px;
  border-radius: 4px;
  background: #dbeaf4;
  color: #245b7e;
  font-size: 9px;
  font-style: normal;
  vertical-align: 1px;
}

.org-directory-no-result {
  display: grid;
  min-height: 280px;
  place-items: center;
  background: #fff;
}

.org-directory-empty {
  padding: 18px;
}

.org-rank-tree {
  display: grid;
  gap: 12px;
}

.org-rank-level {
  border: 1px solid #dbe5f1;
  border-radius: 8px;
  background: #fbfdff;
  overflow: hidden;
}

.org-rank-title {
  display: grid;
  grid-template-columns: minmax(110px, auto) minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid #e5edf6;
  background: #f3f8ff;
}

.org-rank-title strong {
  font-size: 15px;
}

.org-rank-title span,
.org-rank-title em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.org-rank-people {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 8px;
  padding: 10px;
}

.org-rank-people button {
  min-height: 76px;
  padding: 9px 10px;
  border: 1px solid #e1e8f0;
  border-radius: 7px;
  background: #fff;
  text-align: left;
  cursor: pointer;
}

.org-rank-people button:hover {
  border-color: var(--primary);
  background: #f6fbff;
}

.org-rank-people strong,
.org-rank-people span,
.org-rank-people small {
  display: block;
}

.org-rank-people strong {
  margin-bottom: 3px;
  font-size: 14px;
}

.org-rank-people span {
  color: var(--text);
  font-size: 12px;
}

.org-rank-people small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.org-rank-people p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.org-node {
  padding: 10px;
  border: 1px solid #dbe5f1;
  border-radius: 8px;
  background: #f8fbff;
}

.org-node.depth-1 {
  background: #fff;
}

.org-node.depth-2,
.org-node.depth-3 {
  background: #fbfdff;
}

.org-node-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.org-node-head strong {
  font-size: 14px;
}

.org-node-head span {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.org-children {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.org-people {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.org-people button {
  min-width: 88px;
  padding: 7px 9px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: #eef4fb;
  text-align: left;
  cursor: pointer;
}

.org-people button:hover {
  border-color: var(--primary);
  background: #eaf3ff;
}

.org-people small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.employee-table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.contact-directory {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  background: #fff;
}

.contact-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  min-width: 720px;
  border-bottom: 1px solid var(--line);
  background: #f8fbfd;
}

.contact-summary article {
  padding: 12px 14px;
  border-right: 1px solid var(--line);
}

.contact-summary article:last-child {
  border-right: 0;
}

.contact-summary span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.contact-summary strong {
  display: block;
  margin-top: 4px;
  color: #152235;
  font-size: 20px;
}

.contact-summary small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.contact-filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.contact-filter-bar > div {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.contact-filter-bar button {
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid #d4dee8;
  border-radius: 999px;
  background: #fff;
  color: #4a596b;
  font-size: 12px;
}

.contact-filter-bar button:hover,
.contact-filter-bar button.active {
  border-color: #8fb9d5;
  background: #eaf4fb;
  color: #245b7e;
}

.contact-filter-bar > span {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 12px;
}

.contact-governance {
  display: grid;
  gap: 10px;
  padding: 12px;
  border-bottom: 1px solid var(--line);
  background: #fbfcfe;
}

.contact-governance-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
}

.contact-governance-head > div span,
.contact-governance-head > div strong {
  display: block;
}

.contact-governance-head > div span {
  margin-bottom: 3px;
  color: #315f7a;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.contact-governance-head > div strong {
  font-size: 14px;
}

.contact-governance-head p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  text-align: right;
}

.contact-governance-metrics {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 7px;
}

.contact-governance-metrics article {
  display: grid;
  gap: 2px;
  padding: 9px 10px;
  border: 1px solid #dfe7ef;
  border-radius: 7px;
  background: #fff;
}

.contact-governance-metrics article.warning {
  border-color: #e6cf98;
  background: #fffaf0;
}

.contact-governance-metrics strong {
  color: #294e68;
  font-size: 17px;
}

.contact-governance-metrics span {
  color: #334155;
  font-size: 12px;
  font-weight: 700;
}

.contact-governance-metrics small {
  color: var(--muted);
  font-size: 10px;
}

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

.contact-review-list > div {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding: 8px 9px;
  border: 1px solid #ead8a2;
  border-radius: 6px;
  background: #fff9e8;
  font-size: 11px;
}

.contact-review-list > div > span {
  padding: 2px 6px;
  border-radius: 999px;
  background: #f1dfaa;
  color: #755d1f;
  font-size: 10px;
  font-weight: 700;
}

.contact-review-list small {
  min-width: 0;
  overflow: hidden;
  color: #665b42;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.contact-review-actions {
  display: flex;
  grid-column: 1 / -1;
  gap: 6px;
  min-width: 0;
}

.contact-review-actions input {
  flex: 1 1 260px;
  min-width: 180px;
  height: 30px;
  padding: 0 8px;
  border: 1px solid #d8c68f;
  border-radius: 5px;
  background: #fff;
  color: #3f4650;
  font-size: 11px;
}

.contact-review-actions button {
  flex: 0 0 auto;
  min-height: 30px;
  padding: 0 9px;
  border: 1px solid #c9b575;
  border-radius: 5px;
  background: #fff;
  color: #6e5718;
  font-size: 11px;
  font-weight: 700;
}

.contact-review-actions button:first-of-type {
  border-color: #8eb7a0;
  color: #2b6a49;
}

.contact-review-actions button:disabled {
  opacity: 0.45;
  cursor: default;
}

.contact-review-list > div > span.identity-status-confirmed {
  background: #dcefe3;
  color: #276845;
}

.contact-review-list > div > span.identity-status-rejected {
  background: #e8edf2;
  color: #526273;
}

.contact-governance-error {
  margin: 0;
  padding: 7px 9px;
  border: 1px solid #ecc5c1;
  border-radius: 5px;
  background: #fff4f2;
  color: #92372f;
  font-size: 11px;
}

.employee-scope-note {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: #f8fbfd;
  color: var(--muted);
  font-size: 13px;
}

.employee-profile {
  margin-bottom: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.profile-head {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  background: #fbfdff;
}

.profile-avatar,
.profile-photo {
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #62a9ee;
  color: #fff;
  font-weight: 700;
}

.profile-avatar {
  width: 44px;
  height: 44px;
}

.profile-head h3 {
  margin: 0 0 4px;
  font-size: 16px;
}

.profile-head h3 span {
  margin-left: 6px;
  color: #62a9ee;
  font-size: 13px;
}

.profile-head p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.profile-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  border-bottom: 1px solid var(--line);
}

.profile-tabs button {
  min-height: 42px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: #3f4d5f;
  padding: 0 18px;
}

.profile-tabs button.active {
  border-color: #3aa0e6;
  color: #2c7bd0;
}

.profile-body {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  min-height: 340px;
}

.profile-side {
  padding: 20px;
  border-right: 1px solid var(--line);
}

.profile-photo {
  width: 150px;
  height: 150px;
  margin: 0 auto 18px;
  border-radius: 8px;
  background: #dfe5ec;
  font-size: 26px;
}

.profile-side dl {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  gap: 10px 8px;
  margin: 0;
  font-size: 13px;
}

.profile-side dt {
  color: var(--muted);
}

.profile-side dd {
  margin: 0;
}

.profile-content {
  padding: 18px 24px 26px;
}

.profile-section-title {
  margin-bottom: 14px;
  padding: 8px 10px;
  border-left: 3px solid #3aa0e6;
  background: #f2f8fd;
  color: #536273;
}

.profile-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 64px;
}

.profile-fields div {
  display: grid;
  grid-template-columns: 156px minmax(0, 1fr);
  align-items: center;
  min-height: 42px;
  border-bottom: 1px solid var(--line);
  column-gap: 10px;
}

.profile-fields span {
  color: var(--muted);
  font-size: 13px;
}

.profile-fields strong {
  font-size: 13px;
  font-weight: 500;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.profile-subsection {
  margin-top: 18px;
}

.profile-subsection h4 {
  margin: 0 0 10px;
  color: #25364c;
  font-size: 14px;
}

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

.profile-subtable {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
  font-size: 13px;
}

.profile-subtable th,
.profile-subtable td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

.profile-subtable th {
  background: #f4f7fa;
  color: var(--muted);
  font-weight: 600;
}

.profile-subtable tr:last-child td {
  border-bottom: 0;
}

.employee-table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
  background: #fff;
  font-size: 13px;
}

.employee-table th,
.employee-table td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
}

.employee-table th {
  background: #f4f7fa;
  color: var(--muted);
  font-weight: 600;
}

.employee-table tbody tr:hover {
  background: #f8fbfd;
}

.employee-table td span {
  color: var(--muted);
  font-size: 12px;
}

.contact-table {
  min-width: 1080px;
}

.contact-name {
  display: block;
  border: 0;
  background: transparent;
  color: #123453;
  padding: 0;
  font: inherit;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}

.contact-name:hover {
  color: var(--primary);
}

.contact-name-static {
  display: block;
  color: #123453;
  font-weight: 700;
}

.contact-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 5px;
}

.contact-badge {
  display: inline-flex !important;
  align-items: center;
  min-height: 18px;
  padding: 0 5px;
  border-radius: 4px;
  background: #edf2f7;
  color: #526273 !important;
  font-size: 9px !important;
  line-height: 1;
}

.contact-badge.source-employee-master,
.contact-badge.source-master-fill {
  background: #e7f3eb;
  color: #257048 !important;
}

.contact-badge.warning {
  background: #fff0c9;
  color: #7b5a08 !important;
}

.contact-badge.confirmed {
  background: #dff1e6;
  color: #256b46 !important;
}

.contact-badge.danger {
  background: #fee9e7;
  color: #9f2f27 !important;
}

.employee-status {
  background: #effaf5;
  color: var(--success);
}

.employee-status.probation {
  background: #fff6e8;
  color: #9a5b13;
}

.attendance-layout {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.attendance-layout.employee-attendance-mode {
  grid-template-columns: minmax(0, 1fr);
}

.attendance-import[hidden] {
  display: none;
}

.attendance-main {
  display: grid;
  min-width: 0;
  gap: 18px;
}

.attendance-user-map {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.attendance-map-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--primary-muted);
}

.attendance-map-head strong,
.attendance-map-head span {
  display: block;
}

.attendance-map-head strong {
  margin-bottom: 4px;
}

.attendance-map-head span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.attendance-map-head > span {
  min-width: 54px;
  align-self: start;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--surface);
  color: var(--primary);
  text-align: center;
}

.attendance-map-table {
  max-height: 220px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.attendance-map-table table {
  min-width: 780px;
  width: 100%;
  border-collapse: collapse;
}

.attendance-map-table th,
.attendance-map-table td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
  font-size: 12px;
}

.attendance-map-table th {
  background: #f4f7fa;
  color: var(--muted);
  font-weight: 600;
}

.map-status {
  display: inline-flex;
  min-width: 64px;
  min-height: 24px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 0 8px;
}

.map-status.ok {
  background: #effaf5;
  color: var(--success);
}

.map-status.warn {
  background: #fff6e8;
  color: #9a5b13;
}

.documents-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.archive-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.75fr);
  gap: 18px;
  align-items: start;
}

.archive-main-panel,
.archive-detail-panel {
  min-width: 0;
}

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

.archive-metrics article {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfd;
}

.archive-metrics span,
.archive-detail-grid strong {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.archive-metrics strong {
  display: block;
  margin-top: 4px;
  color: #123453;
  font-size: 22px;
}

.archive-filters {
  display: grid;
  grid-template-columns: minmax(220px, 1.2fr) repeat(3, minmax(140px, 0.7fr));
  gap: 10px;
  margin-bottom: 14px;
}

.archive-filters select {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  background: var(--surface);
  color: #123453;
}

.archive-table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.archive-table {
  min-width: 920px;
  width: 100%;
  border-collapse: collapse;
}

.archive-table th,
.archive-table td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  font-size: 13px;
}

.archive-table th {
  background: #f4f7fa;
  color: var(--muted);
  font-weight: 600;
}

.archive-table tr {
  cursor: pointer;
}

.archive-table tbody tr:hover,
.archive-table tbody tr.active {
  background: var(--primary-muted);
}

.archive-table td span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.archive-status {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  border-radius: 999px;
  padding: 0 8px;
  background: #fff6e8;
  color: #9a5b13;
}

.archive-status.ok {
  background: #effaf5;
  color: var(--success);
}

.archive-detail-card {
  display: grid;
  gap: 14px;
}

.archive-detail-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
}

.archive-detail-head span {
  color: var(--muted);
  font-size: 12px;
}

.archive-detail-head h3 {
  margin: 4px 0 0;
  color: #123453;
  font-size: 18px;
}

.archive-detail-head b {
  white-space: nowrap;
  border-radius: 999px;
  padding: 5px 10px;
  background: #effaf5;
  color: var(--success);
  font-size: 12px;
}

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

.archive-detail-grid p,
.archive-detail-section > p,
.archive-history article {
  margin: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
}

.archive-detail-grid span,
.archive-detail-section > p,
.archive-history span {
  color: #314154;
  font-size: 13px;
  line-height: 1.55;
}

.archive-detail-section {
  display: grid;
  gap: 8px;
}

.archive-detail-section h4 {
  margin: 0;
  color: #123453;
  font-size: 14px;
}

.archive-history {
  display: grid;
  gap: 8px;
}

.archive-history strong,
.archive-history span {
  display: block;
}

.archive-history strong {
  color: #123453;
  font-size: 13px;
}

.document-list {
  display: grid;
  gap: 12px;
}

.document-header-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.document-header-actions .search {
  min-width: min(280px, 100%);
}

.document-filterbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: -4px 0 14px;
}

.document-filterbar select {
  min-height: 38px;
  border: 1px solid #d8e1eb;
  border-radius: 7px;
  padding: 0 10px;
  color: #172033;
  background: #fff;
  font: inherit;
}

.document-read-overview {
  display: grid;
  gap: 12px;
  margin: 0 0 14px;
  padding: 12px;
  border: 1px solid #d8e1eb;
  border-radius: 8px;
  background: #f8fafc;
}

.document-read-overview[hidden] {
  display: none;
}

.document-read-overview-metrics,
.document-read-overview-list,
.document-read-report-summary,
.document-read-departments {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.document-read-overview-metrics span,
.document-read-report-summary span {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  min-height: 34px;
  border: 1px solid #e2e8f0;
  border-radius: 7px;
  padding: 6px 10px;
  background: #fff;
  color: var(--muted);
  font-size: 13px;
}

.document-read-overview-metrics strong,
.document-read-report-summary strong {
  color: #123453;
  font-size: 18px;
}

.document-read-overview-item {
  display: grid;
  gap: 4px;
  max-width: min(360px, 100%);
  border: 1px solid #d8e1eb;
  border-radius: 8px;
  padding: 8px 10px;
  background: #fff;
  color: #172033;
  text-align: left;
  cursor: pointer;
}

.document-read-overview-item:hover {
  border-color: var(--primary);
}

.document-read-overview-item span {
  color: var(--muted);
  font-size: 12px;
}

.document-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: -4px 0 14px;
}

.document-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
}

.document-card-head,
.document-meta,
.document-files {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.document-card-head {
  justify-content: space-between;
}

.document-card h3 {
  margin: 8px 0 0;
  font-size: 17px;
}

.document-status {
  display: inline-flex;
  align-items: center;
  margin-left: 6px;
  border-radius: 999px;
  padding: 3px 8px;
  color: #166534;
  background: #dcfce7;
  font-size: 12px;
  font-weight: 700;
}

.document-status.draft {
  color: #7a4b00;
  background: #fff4d6;
}

.document-status.disabled {
  color: #4b5563;
  background: #e5e7eb;
}

.document-ai-tag {
  display: inline-flex;
  align-items: center;
  margin-left: 6px;
  border-radius: 999px;
  padding: 3px 8px;
  color: #075985;
  background: #e0f2fe;
  font-size: 12px;
  font-weight: 700;
}

.document-ai-tag.off {
  color: #6b7280;
  background: #f3f4f6;
}

.document-read-tag {
  display: inline-flex;
  align-items: center;
  margin-left: 6px;
  border-radius: 999px;
  padding: 3px 8px;
  color: #7a4b00;
  background: #fff4d6;
  font-size: 12px;
  font-weight: 700;
}

.document-read-tag.done {
  color: #166534;
  background: #dcfce7;
}

.document-source-tag {
  display: inline-flex;
  align-items: center;
  margin-left: 6px;
  border-radius: 999px;
  padding: 3px 8px;
  color: #155e75;
  background: #cffafe;
  font-size: 12px;
  font-weight: 700;
}

.document-expiry-tag {
  display: inline-flex;
  align-items: center;
  margin-left: 6px;
  border-radius: 999px;
  padding: 3px 8px;
  color: #92400e;
  background: #fef3c7;
  font-size: 12px;
  font-weight: 700;
}

.document-expiry-tag.expired {
  color: #991b1b;
  background: #fee2e2;
}

.document-title-link {
  color: var(--primary);
  text-decoration: none;
}

.document-title-link:hover {
  text-decoration: underline;
}

.document-card p {
  margin: 0;
  color: #314154;
  line-height: 1.65;
}

.document-meta {
  color: var(--muted);
  font-size: 13px;
}

.document-files .mini-btn {
  grid-auto-flow: column;
  gap: 8px;
  max-width: 100%;
  padding: 0 10px;
}

.document-files .mini-btn small {
  color: var(--muted);
}

.document-manage-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.document-manage-actions .mini-btn {
  min-width: 58px;
  min-height: 30px;
  font-size: 12px;
  font-weight: 700;
}

.document-read-report-card {
  width: min(980px, 96vw);
  max-height: 92vh;
}

.document-read-report-summary {
  margin: 4px 0 2px;
}

.document-read-departments {
  align-items: stretch;
  max-height: 180px;
  overflow: auto;
  padding-right: 2px;
}

.document-read-department {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: min(280px, 100%);
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 9px 10px;
  background: #fff;
}

.document-read-department div {
  display: grid;
  gap: 3px;
}

.document-read-department strong {
  color: #123453;
  font-size: 13px;
}

.document-read-department span {
  color: var(--muted);
  font-size: 12px;
}

.document-read-report-rows {
  max-height: 320px;
  overflow: auto;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
}

.document-read-report-rows table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  font-size: 13px;
}

.document-read-report-rows th,
.document-read-report-rows td {
  border-bottom: 1px solid #e2e8f0;
  padding: 9px 10px;
  text-align: left;
  vertical-align: middle;
}

.document-read-report-rows th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f8fafc;
  color: #475569;
  font-weight: 700;
}

.document-detail-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.42);
}

.document-detail-modal[hidden] {
  display: none;
}

.document-detail-card {
  width: min(860px, 100%);
  max-height: min(860px, calc(100vh - 48px));
  display: grid;
  gap: 16px;
  overflow: auto;
  box-sizing: border-box;
  padding: 20px;
  border-radius: 8px;
  border: 1px solid #d9e3ee;
  background: #fff;
  box-shadow: 0 22px 60px rgba(15, 23, 42, 0.22);
}

.document-create-card {
  width: min(940px, 100%);
}

.document-detail-head,
.document-detail-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.document-detail-head h3 {
  margin: 0 0 4px;
  color: #172033;
  font-size: 18px;
}

.document-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(140px, 0.8fr) minmax(140px, 0.8fr) minmax(120px, 0.6fr);
  gap: 12px;
}

.document-create-grid {
  grid-template-columns: minmax(0, 1.4fr) minmax(130px, 0.8fr) minmax(150px, 0.8fr);
}

.document-detail-card label {
  display: grid;
  gap: 6px;
  min-width: 0;
  color: #4b5563;
  font-size: 13px;
  font-weight: 700;
}

.document-detail-card input,
.document-detail-card select,
.document-detail-card textarea {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  border: 1px solid #d8e1eb;
  border-radius: 7px;
  padding: 10px 11px;
  color: #172033;
  background: #fff;
  font: inherit;
  font-weight: 500;
}

.document-detail-card input:disabled,
.document-detail-card select:disabled,
.document-detail-card textarea:disabled {
  color: #273244;
  background: #f8fafc;
}

.document-detail-card textarea {
  min-height: 320px;
  resize: vertical;
  line-height: 1.6;
}

.document-detail-actions {
  justify-content: flex-end;
}

.document-create-card textarea {
  min-height: 220px;
}

.document-file-field input[type="file"] {
  padding: 9px 11px;
}

.document-create-actions {
  flex-wrap: wrap;
}

.system-tabs {
  display: inline-flex;
  gap: 6px;
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  margin-bottom: 14px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f6f8fb;
}

.system-tabs button {
  flex: 0 0 auto;
  min-height: 36px;
  border: 0;
  border-radius: 6px;
  padding: 0 16px;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
  cursor: pointer;
}

.system-tabs button.active {
  background: #fff;
  color: var(--primary);
  box-shadow: 0 3px 10px rgba(36, 50, 66, 0.08);
}

.system-tab-panel {
  display: none;
}

.system-tab-panel.active {
  display: block;
}

.system-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 18px;
  align-items: start;
}

.system-layout > * {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.account-permission-list,
.role-catalog-list {
  display: grid;
  gap: 12px;
}

.account-permission-list {
  grid-template-columns: minmax(230px, 320px) minmax(0, 1fr);
  align-items: start;
}

.account-picker {
  display: grid;
  gap: 8px;
  max-height: min(480px, calc(100vh - 360px));
  overflow: auto;
  padding-right: 4px;
}

.account-picker-column {
  display: grid;
  min-width: 0;
  gap: 10px;
}

.account-list-button {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  width: 100%;
  min-height: 72px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: #fff;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.account-list-button:hover {
  border-color: rgba(38, 89, 162, 0.28);
  background: #f7fbff;
}

.account-list-button.active {
  border-color: rgba(38, 89, 162, 0.5);
  background: #eef6ff;
  box-shadow: inset 3px 0 0 var(--primary);
}

.account-list-button span,
.account-list-button strong,
.account-list-button small,
.account-list-button em {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-list-button strong {
  margin-bottom: 4px;
  font-size: 14px;
}

.account-list-button small {
  color: var(--muted);
  font-size: 12px;
}

.account-list-button em {
  color: var(--primary);
  font-size: 12px;
  font-style: normal;
}

.account-card,
.role-catalog-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
}

.account-detail-card {
  max-height: calc(100vh - 290px);
  overflow: auto;
}

.account-card-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.account-card-head h3,
.role-catalog-card h3 {
  margin: 0 0 5px;
  font-size: 16px;
}

.account-card-head p,
.role-catalog-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.account-role-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(150px, 1fr));
  gap: 8px;
}

.account-role-grid label {
  display: flex;
  gap: 7px;
  align-items: center;
  min-height: 34px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--text);
  font-size: 13px;
}

.account-role-grid input {
  width: 15px;
  height: 15px;
}

.account-permission-tags,
.role-permission-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.account-permission-tags span,
.role-permission-tags span {
  padding: 4px 7px;
  border-radius: 999px;
  background: #edf4fa;
  color: var(--primary);
  font-size: 12px;
}

.account-card-actions {
  display: flex;
  justify-content: flex-end;
}

.role-catalog-panel {
  position: sticky;
  top: 24px;
  max-height: calc(100vh - 120px);
  overflow: auto;
}

.access-shadow-panel {
  margin-top: 0;
}

.access-shadow-toolbar {
  display: grid;
  grid-template-columns: 150px minmax(220px, 320px) auto;
}

.access-shadow-toolbar .search {
  width: 100%;
  max-width: none;
}

.access-shadow-review {
  display: grid;
  gap: 16px;
}

.access-shadow-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr));
  gap: 10px;
}

.access-shadow-metrics article {
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.access-shadow-metrics span,
.access-shadow-metrics small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.access-shadow-metrics strong {
  display: block;
  margin: 4px 0;
  color: var(--text);
  font-size: 22px;
}

.access-shadow-recommendation {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px 14px;
  align-items: center;
  min-height: 44px;
  padding: 10px 14px;
  border-left: 4px solid #b7791f;
  background: #fffaf0;
}

.access-shadow-recommendation.blocked {
  border-left-color: #c53030;
  background: #fff5f5;
}

.access-shadow-recommendation.observe {
  border-left-color: #2f855a;
  background: #f0fff4;
}

.access-shadow-recommendation span,
.access-shadow-recommendation small {
  color: var(--muted);
}

.access-shadow-review-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.8fr);
  gap: 18px;
}

.access-shadow-review-grid > section,
.access-shadow-detail-section {
  min-width: 0;
}

.access-shadow-section-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
  margin-bottom: 8px;
}

.access-shadow-section-head h3 {
  margin: 0;
  font-size: 15px;
}

.access-shadow-section-head span {
  color: var(--muted);
  font-size: 12px;
}

.access-shadow-table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.access-shadow-table-wrap.compact {
  max-height: 250px;
}

.access-shadow-table-wrap.detail {
  max-height: 330px;
}

.access-shadow-table {
  width: 100%;
  min-width: 620px;
  border-collapse: collapse;
  font-size: 13px;
}

.access-shadow-table th,
.access-shadow-table td {
  padding: 9px 10px;
  border-bottom: 1px solid #eef1f6;
  text-align: left;
  white-space: nowrap;
  vertical-align: top;
}

.access-shadow-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  color: var(--muted);
  background: #f7f9fc;
  font-weight: 700;
}

.access-shadow-table tbody tr:hover {
  background: #f8fbff;
}

.access-shadow-table td strong,
.access-shadow-table td small {
  display: block;
}

.access-shadow-table td small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.access-shadow-risk {
  display: inline-flex;
  min-width: 52px;
  justify-content: center;
  padding: 3px 7px;
  border-radius: 999px;
  color: #8a5a00;
  background: #fff4d6;
  font-size: 12px;
  font-weight: 700;
}

.access-shadow-risk.high {
  color: #9b2c2c;
  background: #fff0f0;
}

.access-shadow-risk.low {
  color: #276749;
  background: #eaf8ef;
}

.access-shadow-empty {
  padding: 24px 16px;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 960px) {
  .access-shadow-metrics {
    grid-template-columns: repeat(2, minmax(140px, 1fr));
  }

  .access-shadow-review-grid {
    grid-template-columns: 1fr;
  }

  .access-shadow-toolbar {
    width: 100%;
    grid-template-columns: 150px minmax(0, 1fr) auto;
  }
}

@media (max-width: 640px) {
  .access-shadow-toolbar,
  .access-shadow-recommendation {
    grid-template-columns: 1fr;
  }

  .access-shadow-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .access-shadow-recommendation {
    align-items: start;
  }
}

@media (max-width: 360px) {
  .access-shadow-metrics {
    grid-template-columns: 1fr;
  }
}

.list-pagination-complete {
  align-items: center;
}

.list-pagination-complete .list-pagination-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.list-pagination-complete label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.list-pagination-complete select,
.list-pagination-complete input {
  width: auto;
  min-width: 58px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 7px;
  background: #fff;
  color: var(--text);
}

.list-pagination-complete input {
  width: 58px;
}

.master-data-management {
  min-height: 440px;
}

.master-data-toolbar {
  display: grid;
  grid-template-columns: 150px minmax(220px, 300px) auto auto;
  justify-content: end;
}

.master-data-toolbar .search {
  width: 100%;
  max-width: none;
}

.master-data-layout {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.master-data-types {
  display: grid;
  gap: 7px;
  max-height: min(610px, calc(100vh - 250px));
  overflow: auto;
  padding-right: 4px;
}

.master-data-type {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 62px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 11px;
  background: #fff;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.master-data-type:hover,
.master-data-type.active {
  border-color: rgba(38, 89, 162, 0.42);
  background: #f3f8ff;
}

.master-data-type.active {
  box-shadow: inset 3px 0 0 var(--primary);
}

.master-data-type strong,
.master-data-type small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
}

.master-data-type strong {
  font-size: 14px;
}

.master-data-type small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.master-data-type em {
  color: var(--primary);
  font-size: 12px;
  font-style: normal;
}

.master-data-content {
  display: grid;
  min-width: 0;
  gap: 10px;
}

.master-data-batchbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 38px;
  color: var(--muted);
  font-size: 13px;
}

.master-data-batchbar > div {
  display: flex;
  gap: 7px;
}

.master-data-table-wrap {
  max-height: min(510px, calc(100vh - 345px));
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.master-data-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  font-size: 13px;
}

.master-data-table th,
.master-data-table td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

.master-data-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f2f6fa;
  color: var(--muted);
  font-weight: 700;
}

.master-data-table tbody tr:hover td {
  background: #f8fbfe;
}

.master-data-table .master-data-check {
  width: 34px;
  padding-right: 4px;
  text-align: center;
}

.master-data-table input[type="checkbox"] {
  width: 16px;
  height: 16px;
}

.master-data-table code {
  color: #335f87;
  font-size: 12px;
}

.master-data-status {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 0 8px;
  background: #e8f7ef;
  color: #147548;
  font-size: 12px;
  font-weight: 700;
}

.master-data-status.inactive {
  background: #f1f3f5;
  color: #6b7280;
}

.master-data-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(17, 30, 45, 0.38);
}

.master-data-modal[hidden] {
  display: none;
}

.master-data-modal-card {
  display: grid;
  width: min(620px, 100%);
  gap: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
  background: #fff;
  box-shadow: 0 18px 48px rgba(21, 35, 52, 0.2);
}

.master-data-modal-head,
.master-data-modal-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.master-data-modal-head h3 {
  margin: 0 0 4px;
  font-size: 18px;
}

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

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

.master-data-form-grid input,
.master-data-form-grid select {
  width: 100%;
  height: 40px;
  box-sizing: border-box;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 10px;
  color: var(--text);
  background: #fff;
}

.master-data-modal-actions {
  justify-content: flex-end;
}

.workflow-management-panel {
  margin-top: 0;
}

.workflow-toolbar {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.master-data-panel .panel-header {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(570px, 650px);
}

.workflow-toolbar.master-data-toolbar {
  display: grid;
  grid-template-columns: 130px minmax(220px, 1fr) auto auto;
  flex-wrap: initial;
}

.workflow-toolbar.account-toolbar {
  display: grid;
  grid-template-columns: 140px minmax(220px, 300px);
  flex-wrap: initial;
}

.account-toolbar .search {
  width: 100%;
  max-width: none;
}

.workflow-management-shell {
  display: grid;
  gap: 14px;
}

.workflow-quality-overview {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(420px, 0.9fr);
  gap: 18px;
  align-items: center;
  padding: 14px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.workflow-quality-overview > div {
  display: grid;
  gap: 5px;
}

.workflow-quality-overview > div > strong {
  font-size: 16px;
}

.workflow-quality-overview > div > span {
  color: var(--muted);
  font-size: 13px;
}

.workflow-quality-overview dl {
  display: grid;
  grid-template-columns: repeat(3, minmax(100px, 1fr));
  gap: 1px;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--line);
}

.workflow-quality-overview dl div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  min-height: 58px;
  padding: 10px 12px;
  background: #fff;
}

.workflow-quality-overview dt {
  color: var(--muted);
  font-size: 12px;
}

.workflow-quality-overview dd {
  margin: 0;
  font-size: 21px;
  font-weight: 700;
}

.workflow-quality-overview .red dd {
  color: #b42318;
}

.workflow-quality-overview .yellow dd {
  color: #8a5a00;
}

.workflow-quality-overview .green dd {
  color: #217a45;
}

.workflow-health-metrics {
  display: grid;
  grid-template-columns: repeat(6, minmax(100px, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--line);
}

.workflow-health-metrics button {
  display: grid;
  gap: 4px;
  align-content: center;
  min-height: 68px;
  border: 0;
  padding: 10px 14px;
  background: #fff;
  color: var(--muted);
  text-align: left;
  cursor: pointer;
}

.workflow-health-metrics button:hover {
  background: #f7f9fc;
}

.workflow-health-metrics button.active {
  background: #f3f8ff;
  box-shadow: inset 0 -3px 0 var(--primary);
}

.workflow-health-metrics span {
  font-size: 12px;
}

.workflow-health-metrics strong {
  color: var(--text);
  font-size: 21px;
}

.workflow-health-metrics button:nth-child(2) strong,
.workflow-health-metrics button:nth-child(5) strong,
.workflow-health-metrics button:nth-child(6) strong {
  color: #a33a2b;
}

.workflow-health-metrics button:nth-child(3) strong,
.workflow-health-metrics button:nth-child(4) strong {
  color: #8a5a00;
}

.workflow-owner-binding-queue {
  display: grid;
  gap: 10px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.workflow-owner-binding-head {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  justify-content: space-between;
}

.workflow-owner-binding-head h3,
.workflow-owner-binding-head p {
  margin: 0;
}

.workflow-owner-binding-head h3 {
  font-size: 16px;
}

.workflow-owner-binding-head p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
}

.workflow-owner-binding-head > span {
  flex: 0 0 auto;
  min-height: 28px;
  border-radius: 5px;
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 700;
}

.workflow-owner-binding-head > span.attention {
  background: #fff4d6;
  color: #8a5a00;
}

.workflow-owner-binding-head > span.resolved {
  background: #e8f6ed;
  color: #217a45;
}

.workflow-owner-binding-list {
  display: grid;
  border: 1px solid var(--line);
  border-radius: 7px;
  overflow: hidden;
}

.workflow-owner-binding-list article {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 90px auto;
  gap: 12px;
  align-items: center;
  min-height: 62px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.workflow-owner-binding-list article:last-child {
  border-bottom: 0;
}

.workflow-owner-binding-list article > div:first-child {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.workflow-owner-binding-list strong,
.workflow-owner-binding-list small {
  overflow-wrap: anywhere;
}

.workflow-owner-binding-list small,
.workflow-owner-binding-list article > span {
  color: var(--muted);
  font-size: 12px;
}

.workflow-owner-binding-list article > div:last-child {
  display: flex;
  gap: 7px;
  justify-content: flex-end;
}

.workflow-draft-review-queue {
  display: grid;
  gap: 10px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.workflow-draft-review-head {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  justify-content: space-between;
}

.workflow-draft-review-head h3,
.workflow-draft-review-head p {
  margin: 0;
}

.workflow-draft-review-head h3 {
  font-size: 16px;
}

.workflow-draft-review-head p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
}

.workflow-draft-review-head > span {
  flex: 0 0 auto;
  min-height: 28px;
  border-radius: 5px;
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 700;
}

.workflow-draft-review-head > span.attention {
  background: #fff4d6;
  color: #8a5a00;
}

.workflow-draft-review-head > span.resolved {
  background: #e8f6ed;
  color: #217a45;
}

.workflow-draft-review-list {
  display: grid;
  border: 1px solid var(--line);
  border-radius: 7px;
  overflow: hidden;
}

.workflow-draft-review-list article {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(250px, 1.15fr) minmax(170px, auto) auto;
  gap: 12px;
  align-items: center;
  min-height: 62px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.workflow-draft-review-list article:last-child {
  border-bottom: 0;
}

.workflow-draft-review-title {
  display: flex;
  gap: 8px;
  align-items: center;
  min-width: 0;
}

.workflow-draft-review-title strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.workflow-draft-review-title span {
  flex: 0 0 auto;
  border-radius: 5px;
  padding: 4px 7px;
  font-size: 11px;
  font-weight: 700;
}

.workflow-draft-review-title span.high {
  background: #fde9e6;
  color: #a33a2b;
}

.workflow-draft-review-title span.medium {
  background: #fff4d6;
  color: #8a5a00;
}

.workflow-draft-review-title span.low {
  background: #edf2f7;
  color: #52606d;
}

.workflow-draft-review-highlights {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
  min-width: 0;
}

.workflow-draft-review-highlights span {
  border-radius: 5px;
  padding: 4px 7px;
  background: #f2f4f7;
  color: #52606d;
  font-size: 11px;
  overflow-wrap: anywhere;
}

.workflow-draft-review-list small {
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.workflow-batch-governance {
  display: grid;
  gap: 12px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

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

.workflow-batch-head h3,
.workflow-batch-head p {
  margin: 0;
}

.workflow-batch-head h3 {
  font-size: 16px;
}

.workflow-batch-head p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
}

.workflow-batch-head > div:last-child,
.workflow-batch-actions,
.workflow-risk-breakdown {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.workflow-risk-breakdown span {
  min-height: 27px;
  padding: 5px 8px;
  border-radius: 5px;
  background: #f2f4f7;
  color: #52606d;
  font-size: 12px;
}

.workflow-risk-breakdown strong {
  color: #a33a2b;
}

.workflow-batch-form {
  display: grid;
  grid-template-columns: minmax(170px, 0.7fr) minmax(220px, 1fr) minmax(260px, 1.2fr);
  gap: 10px;
  align-items: end;
}

.workflow-batch-form label {
  display: grid;
  gap: 5px;
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
}

.workflow-batch-form input,
.workflow-batch-form select {
  width: 100%;
  min-width: 0;
  min-height: 38px;
  box-sizing: border-box;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 10px;
  background: #fff;
  color: var(--text);
}

.workflow-batch-reason {
  grid-column: span 2;
}

.workflow-batch-actions {
  justify-content: flex-end;
  min-height: 38px;
}

.workflow-batch-actions > span {
  margin-right: auto;
  color: var(--muted);
  font-size: 12px;
}

.workflow-batch-actions > span strong {
  color: var(--text);
}

.workflow-batch-preview {
  display: grid;
  gap: 10px;
  padding-top: 4px;
}

.workflow-batch-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(100px, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--line);
}

.workflow-batch-summary span {
  padding: 10px 12px;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
}

.workflow-batch-summary strong {
  margin-right: 4px;
  color: var(--text);
  font-size: 17px;
}

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

.workflow-batch-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.workflow-batch-table th,
.workflow-batch-table td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.workflow-batch-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f7f9fc;
  color: var(--muted);
}

.workflow-batch-table td strong,
.workflow-batch-table td small {
  display: block;
}

.workflow-batch-table td small {
  margin-top: 3px;
  color: var(--muted);
}

.workflow-batch-table tr.skipped {
  color: var(--muted);
  background: #fafbfc;
}

.workflow-batch-ready {
  color: #217a45;
  font-weight: 700;
}

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

.performance-ledger-panel {
  margin-top: 0;
}

.performance-ledger-panel .panel-header {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(700px, 820px);
}

.performance-ledger-toolbar {
  display: grid;
  grid-template-columns: 150px 140px minmax(190px, 1fr) auto auto;
}

.performance-ledger-toolbar .search {
  width: 100%;
  max-width: none;
}

.performance-ledger-content {
  min-width: 0;
}

.performance-ledger-summary {
  display: grid;
  grid-template-columns: repeat(6, minmax(90px, 1fr));
  margin-bottom: 16px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #f8fafc;
}

.performance-ledger-summary span {
  display: grid;
  gap: 5px;
  padding: 12px 14px;
  border-right: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

.performance-ledger-summary span:last-child {
  border-right: 0;
}

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

.performance-ledger-summary .danger strong {
  color: #b42318;
}

.performance-assignment-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 58px;
  margin-bottom: 14px;
  padding: 10px 14px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #f7f9fc;
}

.performance-assignment-banner.attention {
  border-color: #f0c79b;
  background: #fff9f2;
}

.performance-assignment-banner > div,
.performance-assignment-editor-head > div,
.performance-assignment-source,
.performance-assignment-item label {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.performance-assignment-banner span,
.performance-assignment-editor-head span,
.performance-assignment-source span,
.performance-assignment-source small,
.performance-assignment-item label > span {
  color: var(--muted);
  font-size: 12px;
}

.performance-assignment-editor {
  margin: -14px 0 16px;
  padding: 14px;
  border-bottom: 1px solid var(--line);
  background: #fbfcfe;
}

.performance-assignment-editor-head {
  margin-bottom: 12px;
}

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

.performance-assignment-item {
  display: grid;
  grid-template-columns: minmax(280px, 2fr) minmax(150px, 0.8fr) minmax(210px, 1fr) auto;
  gap: 12px;
  align-items: end;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.performance-assignment-source > strong {
  overflow-wrap: anywhere;
}

.performance-assignment-source .performance-ledger-links {
  margin-top: 2px;
}

.performance-assignment-item .search {
  width: 100%;
  max-width: none;
}

.performance-assignment-item .primary-btn {
  min-width: 88px;
  white-space: nowrap;
}

.performance-ledger-table-wrap {
  min-width: 0;
  overflow-x: auto;
}

.performance-ledger-table {
  width: 100%;
  min-width: 1040px;
  border-collapse: collapse;
  font-size: 13px;
}

.performance-ledger-table th,
.performance-ledger-table td {
  padding: 11px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.performance-ledger-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f7f9fc;
  color: var(--muted);
  font-weight: 700;
}

.performance-ledger-table tr.attention td {
  background: #fffaf5;
}

.performance-ledger-table td > strong,
.performance-ledger-table td > small {
  display: block;
}

.performance-ledger-table td > small {
  margin: 7px 0 3px;
  color: var(--muted);
}

.performance-ledger-status {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  border-radius: 6px;
  background: #eef2f6;
  color: #52606d;
  font-weight: 700;
  white-space: nowrap;
}

.performance-ledger-status.completed {
  background: #e8f6ed;
  color: #217a45;
}

.performance-ledger-status.summary_pending,
.performance-ledger-status.self_pending {
  background: #eaf2fb;
  color: #2659a2;
}

.performance-ledger-status.self_complete {
  background: #fff4d6;
  color: #8a5a00;
}

.performance-ledger-status.needs_assignment {
  background: #fff0e1;
  color: #9a4f14;
}

.performance-ledger-status.duplicate {
  background: #fdeceb;
  color: #b42318;
}

.performance-ledger-links {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}

.performance-ledger-links .text-btn {
  min-height: 26px;
  font-size: 12px;
}

.performance-ledger-links span,
.performance-ledger-empty {
  color: var(--muted);
  font-size: 12px;
}

.danger-text {
  color: #b42318;
}

.workflow-template-list {
  display: grid;
  gap: 8px;
  max-height: calc(100vh - 280px);
  overflow: auto;
  padding-right: 4px;
}

.workflow-template-entry {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 6px;
  align-items: stretch;
}

.workflow-template-select {
  display: grid;
  place-items: center;
  min-height: 70px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f8fafc;
  cursor: pointer;
}

.workflow-template-select input {
  width: 16px;
  height: 16px;
  margin: 0;
}

.workflow-template-button {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  width: 100%;
  min-height: 70px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: #fff;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.workflow-template-button:hover,
.workflow-template-button.active {
  border-color: rgba(38, 89, 162, 0.45);
  background: #f3f8ff;
}

.workflow-template-button.active {
  box-shadow: inset 3px 0 0 var(--primary);
}

.workflow-template-button span,
.workflow-template-button strong,
.workflow-template-button small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workflow-template-button small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.workflow-template-button .workflow-template-health {
  color: #52606d;
}

.workflow-template-button .workflow-template-health.healthy {
  color: #217a45;
}

.workflow-template-button .workflow-template-health.attention {
  color: #8a5a00;
}

.workflow-template-button .workflow-template-health.critical {
  color: #b42318;
}

.workflow-template-button .workflow-template-health.inactive {
  color: #697386;
}

.workflow-template-button em,
.workflow-template-detail .status {
  padding: 4px 7px;
  border-radius: 999px;
  background: #edf4fa;
  color: var(--primary);
  font-size: 12px;
  font-style: normal;
  white-space: nowrap;
}

.workflow-template-button em.draft,
.workflow-template-detail .status.draft {
  background: #fff7e6;
  color: #9a5d00;
}

.workflow-template-button em.testing,
.workflow-template-detail .status.testing {
  background: #e8f5ef;
  color: #187450;
}

.workflow-template-button em.archived,
.workflow-template-detail .status.archived {
  background: #f1f3f5;
  color: #697386;
}

.workflow-template-detail {
  display: grid;
  gap: 14px;
  max-height: calc(100vh - 280px);
  overflow: auto;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
}

.workflow-detail-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.workflow-detail-head h3 {
  margin: 0 0 5px;
  font-size: 17px;
}

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

.workflow-form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(160px, 1fr));
  gap: 10px;
}

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

.workflow-form-grid input[type="text"],
.workflow-form-grid input[type="date"],
.workflow-form-grid select {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 10px;
  color: var(--text);
  background: #fff;
}

.workflow-form-grid input[readonly] {
  background: #f1f4f7;
  color: var(--muted);
}

.workflow-form-span-two {
  grid-column: span 2;
}

.workflow-toggle {
  align-content: end;
  grid-auto-flow: column;
  justify-content: start;
  align-items: center;
  color: var(--text) !important;
}

.workflow-detail-section {
  display: grid;
  gap: 10px;
}

.workflow-quality-gate {
  padding: 12px 0 12px 14px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  border-left: 4px solid #b7791f;
}

.workflow-quality-gate.red {
  border-left-color: #b42318;
}

.workflow-quality-gate.green {
  border-left-color: #217a45;
}

.workflow-quality-gate-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
}

.workflow-quality-gate-head h4,
.workflow-quality-gate-head p {
  margin: 0;
}

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

.workflow-quality-score {
  display: grid;
  grid-template-columns: auto auto;
  gap: 5px;
  align-items: baseline;
}

.workflow-quality-score strong {
  font-size: 23px;
}

.workflow-quality-score span,
.workflow-quality-counts,
.workflow-quality-gate small {
  color: var(--muted);
  font-size: 12px;
}

.workflow-quality-counts {
  display: flex;
  gap: 16px;
}

.workflow-quality-counts strong {
  color: var(--text);
}

.workflow-quality-gate ul {
  display: grid;
  gap: 1px;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--line);
  list-style: none;
}

.workflow-quality-gate li {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 9px 11px;
  background: #fff;
}

.workflow-quality-gate li > span {
  color: #8a5a00;
  font-size: 12px;
  font-weight: 700;
}

.workflow-quality-gate li.blocker > span {
  color: #b42318;
}

.workflow-quality-gate li div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.workflow-quality-gate li strong,
.workflow-quality-gate li small {
  overflow-wrap: anywhere;
}

.workflow-quality-pass {
  margin: 0;
  color: #217a45;
  font-size: 13px;
}

.workflow-diff-section {
  padding: 12px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.workflow-diff-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(90px, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--line);
}

.workflow-diff-summary span {
  display: flex;
  gap: 5px;
  align-items: baseline;
  padding: 10px 12px;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
}

.workflow-diff-summary strong {
  color: var(--text);
  font-size: 17px;
}

.workflow-diff-list {
  display: grid;
  margin: 0;
  padding: 0;
  list-style: none;
}

.workflow-diff-list li {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

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

.workflow-diff-list li > div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.workflow-diff-list small {
  color: var(--muted);
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.workflow-diff-kind {
  display: inline-flex;
  justify-content: center;
  min-height: 25px;
  border-radius: 5px;
  padding: 4px 7px;
  background: #eef2f6;
  color: #52606d;
  font-size: 12px;
  font-weight: 700;
}

.workflow-diff-kind.added {
  background: #e8f6ed;
  color: #217a45;
}

.workflow-diff-kind.removed {
  background: #fdeceb;
  color: #b42318;
}

.workflow-diff-kind.changed {
  background: #fff4d6;
  color: #8a5a00;
}

.workflow-diff-empty {
  display: grid;
  gap: 5px;
  padding: 12px 14px;
  border-left: 3px solid #2f8057;
  background: #f4faf6;
}

.workflow-diff-empty span,
.workflow-diff-more {
  color: var(--muted);
  font-size: 12px;
}

.workflow-diff-more {
  margin: 0;
}

.workflow-simulation-section {
  padding-block: 4px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.workflow-scenario-toolbar {
  display: grid;
  grid-template-columns: minmax(150px, 0.8fr) minmax(180px, 1fr) auto;
  gap: 8px;
  align-items: end;
}

.workflow-scenario-toolbar label {
  display: grid;
  gap: 5px;
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
}

.workflow-scenario-toolbar input,
.workflow-scenario-toolbar select {
  width: 100%;
  min-width: 0;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 9px;
  background: #fff;
  color: var(--text);
}

.workflow-scenario-toolbar > div {
  display: flex;
  gap: 6px;
}

.workflow-simulation-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(150px, 1fr));
  gap: 8px;
}

.workflow-simulation-form label {
  display: grid;
  gap: 5px;
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
}

.workflow-simulation-form input,
.workflow-simulation-form select {
  width: 100%;
  min-width: 0;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 9px;
  background: #fff;
  color: var(--text);
}

.workflow-simulation-actions,
.workflow-simulation-summary,
.workflow-simulation-routes > li > div:first-child {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
}

.workflow-simulation-actions span,
.workflow-simulation-empty,
.workflow-simulation-summary span,
.workflow-simulation-routes > li > div:first-child span {
  color: var(--muted);
  font-size: 12px;
}

.workflow-simulation-result {
  display: grid;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.workflow-coverage-meter {
  height: 7px;
  overflow: hidden;
  border-radius: 4px;
  background: #e5ebf0;
}

.workflow-coverage-meter span {
  display: block;
  height: 100%;
  background: #247a57;
}

.workflow-simulation-result.ok .workflow-simulation-summary strong {
  color: #246b4d;
}

.workflow-simulation-result.warning .workflow-simulation-summary strong {
  color: #83520f;
}

.workflow-simulation-routes {
  display: grid;
  margin: 0;
  padding: 0;
  list-style: none;
}

.workflow-simulation-routes > li {
  display: grid;
  gap: 7px;
  padding: 9px 0;
  border-top: 1px solid var(--line);
}

.workflow-simulation-routes > li.failed > div:first-child span {
  color: #9d2f24;
}

.workflow-uncovered-branches {
  display: grid;
  gap: 5px;
  padding: 9px 10px;
  border: 1px solid rgba(172, 108, 24, 0.25);
  border-radius: 8px;
  background: #fff8e8;
  color: #694614;
  font-size: 12px;
  line-height: 1.5;
}

.workflow-uncovered-branches span {
  overflow-wrap: anywhere;
}

.workflow-scenario-recommendations {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 12px;
  align-items: center;
  padding: 10px;
  border: 1px solid rgba(20, 108, 148, 0.22);
  border-radius: 8px;
  background: #f3f9fc;
}

.workflow-scenario-recommendations > div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.workflow-scenario-recommendations > div:first-child {
  grid-column: 1 / -1;
  grid-template-columns: minmax(0, 1fr) auto;
}

.workflow-scenario-recommendations span {
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.workflow-scenario-recommendations .secondary-btn {
  white-space: nowrap;
}

.workflow-simulation-steps {
  display: flex;
  gap: 6px;
  align-items: stretch;
  overflow-x: auto;
  padding-bottom: 2px;
}

.workflow-simulation-steps > span {
  display: grid;
  grid-template-columns: 20px minmax(90px, auto);
  grid-template-rows: auto auto;
  column-gap: 5px;
  min-width: 130px;
  padding: 6px 8px;
  border-left: 2px solid #9cb5cc;
  background: #f5f8fb;
  color: var(--text);
  font-size: 12px;
}

.workflow-simulation-steps b {
  grid-row: 1 / 3;
  color: var(--primary);
}

.workflow-simulation-steps small {
  color: var(--muted);
  font-size: 11px;
}

.workflow-validation {
  display: grid;
  gap: 4px;
  padding: 9px 10px;
  border: 1px solid rgba(20, 108, 148, 0.2);
  border-radius: 8px;
  background: #f3f9fc;
  color: #35586d;
  font-size: 12px;
  line-height: 1.5;
}

.workflow-validation strong {
  color: var(--text);
}

.workflow-validation.ok {
  border-color: rgba(24, 129, 91, 0.18);
  background: #f2fbf7;
  color: #246b4d;
}

.workflow-validation.warning {
  border-color: rgba(172, 108, 24, 0.25);
  background: #fff8e8;
  color: #83520f;
}

.workflow-validation.error {
  border-color: rgba(196, 74, 62, 0.28);
  background: #fff7f6;
  color: #9d2f24;
}

.panel-header.compact {
  min-height: 0;
  padding: 0;
}

.workflow-step-grid {
  display: grid;
  gap: 6px;
}

.workflow-step-row {
  display: grid;
  grid-template-columns: 34px minmax(150px, 1fr) minmax(180px, 1.1fr) 86px;
  gap: 8px;
  align-items: center;
}

.workflow-step-row-head {
  color: var(--muted);
  font-size: 12px;
}

.workflow-step-row input[type="text"] {
  min-width: 0;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 9px;
}

.workflow-step-row.invalid input[data-workflow-step-owner] {
  border-color: rgba(196, 74, 62, 0.58);
  background: #fff8f7;
}

.workflow-step-row.warning input[data-workflow-step-owner] {
  border-color: rgba(172, 108, 24, 0.42);
  background: #fffaf0;
}

.workflow-owner-field {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.workflow-owner-field small {
  color: #9d2f24;
  font-size: 12px;
  line-height: 1.35;
}

.workflow-step-row.warning .workflow-owner-field small {
  color: #83520f;
}

.workflow-step-row label {
  display: flex;
  gap: 5px;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
}

.workflow-step-row input[type="checkbox"] {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  min-height: 16px;
  padding: 0;
  accent-color: var(--primary);
}

.workflow-step-sla {
  grid-column: 2 / -1;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 8px;
  padding: 8px 0 4px;
  border-top: 1px dashed var(--line);
}

.workflow-step-sla label {
  display: grid;
  gap: 5px;
  align-content: start;
  margin: 0;
  font-size: 12px;
}

.workflow-step-sla input[type="number"],
.workflow-step-sla input[type="text"] {
  width: 100%;
  min-width: 0;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 9px;
  background: #fff;
  color: var(--text);
}

.workflow-step-sla .workflow-step-reminder-toggle {
  display: flex;
  min-height: 34px;
  align-items: center;
}

.workflow-step-sla input:disabled {
  background: #f3f5f7;
  color: var(--muted);
  cursor: not-allowed;
}

.workflow-step-row.invalid .workflow-step-sla input:not(:disabled) {
  border-color: rgba(196, 74, 62, 0.42);
}

.workflow-field-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.workflow-field-list span {
  padding: 5px 8px;
  border-radius: 999px;
  background: #eef3f7;
  color: #435466;
  font-size: 12px;
}

.workflow-version-list {
  display: grid;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.workflow-version-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-height: 54px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
}

.workflow-version-row:last-child {
  border-bottom: 0;
}

.workflow-version-row strong,
.workflow-version-row small {
  display: block;
}

.workflow-version-row small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.workflow-current-version {
  color: #246b4d;
  font-size: 12px;
}

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

.approval-matrix-panel {
  margin-top: 0;
}

.approval-matrix-management {
  display: grid;
  grid-template-columns: minmax(300px, 380px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.approval-matrix-list {
  display: grid;
  gap: 8px;
  max-height: calc(100vh - 280px);
  overflow: auto;
  padding-right: 4px;
}

.approval-matrix-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  width: 100%;
  min-height: 68px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: #fff;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.approval-matrix-row:hover,
.approval-matrix-row.active {
  border-color: rgba(38, 89, 162, 0.45);
  background: #f3f8ff;
}

.approval-matrix-row.active {
  box-shadow: inset 3px 0 0 var(--primary);
}

.approval-matrix-row strong,
.approval-matrix-row small,
.approval-matrix-owner b {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.approval-matrix-row small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.approval-matrix-owner {
  display: grid;
  justify-items: end;
  gap: 5px;
  max-width: 110px;
}

.approval-matrix-owner em {
  padding: 3px 6px;
  border-radius: 999px;
  font-size: 11px;
  font-style: normal;
}

.approval-matrix-owner em.enabled {
  background: #e9f6ef;
  color: #246b4d;
}

.approval-matrix-owner em.disabled {
  background: #f1f3f5;
  color: #697386;
}

.approval-matrix-detail {
  display: grid;
  gap: 14px;
  max-height: calc(100vh - 280px);
  overflow: auto;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
}

.approval-matrix-form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(150px, 1fr));
  gap: 10px;
}

.approval-matrix-form-grid label,
.approval-matrix-preview-form label {
  display: grid;
  gap: 5px;
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
}

.approval-matrix-mode {
  min-width: 0;
  margin: 0;
  border: 0;
  padding: 0;
}

.approval-matrix-mode legend {
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 12px;
}

.approval-matrix-segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 36px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
}

.approval-matrix-segmented label {
  display: grid;
  place-items: center;
  cursor: pointer;
  color: var(--muted);
}

.approval-matrix-segmented label + label {
  border-left: 1px solid var(--line);
}

.approval-matrix-form-grid .approval-matrix-segmented input {
  position: absolute;
  width: 1px;
  height: 1px;
  min-height: 0;
  border: 0;
  padding: 0;
  opacity: 0;
}

.approval-matrix-segmented label:has(input:checked) {
  background: #eaf4f0;
  color: #126349;
  font-weight: 700;
}

.approval-matrix-form-grid input,
.approval-matrix-form-grid select,
.approval-matrix-preview-form input {
  width: 100%;
  min-width: 0;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 9px;
  background: #fff;
  color: var(--text);
}

.approval-matrix-notes {
  grid-column: span 2;
}

.approval-matrix-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.approval-matrix-section {
  display: grid;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.approval-matrix-preview-form {
  display: grid;
  grid-template-columns: repeat(5, minmax(120px, 1fr)) auto;
  gap: 8px;
  align-items: end;
}

.approval-matrix-preview-form .secondary-btn {
  min-height: 36px;
  white-space: nowrap;
}

.approval-matrix-placeholder,
.approval-matrix-resolution,
.approval-matrix-impact-summary {
  display: grid;
  gap: 5px;
  padding: 10px 12px;
  border-left: 3px solid #9cb5cc;
  background: #f5f8fb;
  font-size: 12px;
  line-height: 1.5;
}

.approval-matrix-placeholder,
.approval-matrix-resolution span,
.approval-matrix-resolution small,
.approval-matrix-impact-summary span,
.approval-matrix-impact-summary small {
  color: var(--muted);
}

.approval-matrix-resolution.resolved {
  border-left-color: #2f8f63;
  background: #eff8f3;
}

.approval-matrix-resolution.unresolved {
  border-left-color: #c17b1b;
  background: #fff8e8;
}

.approval-matrix-impact-summary ul {
  display: grid;
  gap: 0;
  margin: 4px 0 0;
  padding: 0;
  list-style: none;
}

.approval-matrix-impact-summary li {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 0;
  border-top: 1px solid var(--line);
}

.approval-matrix-impact-summary li span {
  white-space: nowrap;
}

.approval-instance-panel {
  margin-top: 0;
}

.approval-exception-filters {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 8px;
  margin-bottom: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.approval-exception-filters select,
.approval-batch-toolbar input,
.approval-notification-retry input {
  width: 100%;
  min-width: 0;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 10px;
  background: #fff;
  color: var(--text);
}

.approval-notification-dashboard {
  display: grid;
  gap: 14px;
  margin: 4px 0 18px;
  padding: 14px 0 16px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.approval-notification-dashboard:empty {
  display: none;
}

.approval-notification-dashboard-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.approval-notification-dashboard-head h3,
.approval-notification-dashboard-head p,
.approval-notification-dashboard-body h4 {
  margin: 0;
}

.approval-notification-dashboard-head p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.approval-notification-dashboard-head p.danger {
  color: var(--danger);
}

.approval-notification-range {
  display: inline-grid;
  grid-template-columns: repeat(3, minmax(54px, 1fr));
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
}

.approval-notification-range button {
  min-height: 32px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
}

.approval-notification-range button.active {
  border-color: var(--line);
  background: #fff;
  color: var(--text);
  font-weight: 700;
}

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

.approval-notification-metric-grid span {
  display: grid;
  gap: 4px;
  min-height: 64px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfd;
  color: var(--muted);
  font-size: 12px;
}

.approval-notification-metric-grid b {
  color: var(--text);
  font-size: 18px;
}

.approval-notification-metric-grid span.danger {
  border-color: rgba(180, 35, 24, 0.25);
  background: #fff7f6;
}

.approval-notification-metric-grid span.danger b {
  color: var(--danger);
}

.approval-notification-metric-grid span.warning {
  border-color: rgba(199, 125, 45, 0.3);
  background: #fffaf2;
}

.approval-notification-dashboard-body {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: 20px;
}

.approval-notification-dashboard-body > section {
  min-width: 0;
}

.approval-notification-event-list,
.approval-notification-failure-list {
  display: grid;
  gap: 8px;
}

.approval-notification-event-row {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) minmax(90px, 0.7fr) 42px;
  gap: 10px;
  align-items: center;
  min-width: 0;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}

.approval-notification-event-row > div:first-child {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.approval-notification-event-row strong,
.approval-notification-event-row span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.approval-notification-event-row span,
.approval-notification-event-row b {
  color: var(--muted);
  font-size: 12px;
}

.approval-notification-rate {
  height: 6px;
  overflow: hidden;
  border-radius: 6px;
  background: var(--surface-strong);
}

.approval-notification-rate i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--success);
}

.approval-notification-failure-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.approval-notification-failure-summary span {
  padding: 5px 8px;
  border: 1px solid rgba(180, 35, 24, 0.2);
  border-radius: 6px;
  background: #fff7f6;
  color: var(--danger);
  font-size: 12px;
}

.approval-notification-failure-list article {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 3px 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}

.approval-notification-failure-list article > div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.approval-notification-failure-list span,
.approval-notification-failure-list small,
.approval-notification-failure-list time {
  color: var(--muted);
  font-size: 12px;
}

.approval-notification-failure-list small {
  grid-column: 1 / -1;
  color: var(--danger);
}

.approval-instance-management {
  display: grid;
  grid-template-columns: minmax(300px, 390px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.approval-person-backfill-panel {
  margin: 12px 0 16px;
}

.approval-person-backfill-card {
  border-left: 4px solid #196c72;
  background: #f7fbfb;
}

.approval-person-backfill-summary {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.approval-person-backfill-actions {
  grid-template-columns: minmax(260px, 1fr) minmax(260px, 1fr) auto;
  margin-bottom: 12px;
}

.approval-person-backfill-actions > div {
  grid-column: auto;
}

.approval-person-backfill-actions input,
.approval-person-backfill-actions button {
  min-height: 38px;
}

.approval-instance-list {
  display: grid;
  gap: 8px;
  max-height: calc(100vh - 280px);
  overflow: auto;
  padding-right: 4px;
}

.approval-admin-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 6px;
}

.approval-admin-summary span,
.approval-admin-metrics span {
  display: grid;
  gap: 4px;
  min-height: 52px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfd;
  color: var(--muted);
  font-size: 12px;
}

.approval-admin-summary b,
.approval-admin-metrics b {
  color: var(--text);
  font-size: 16px;
}

.approval-admin-summary span.danger {
  border-color: rgba(180, 35, 24, 0.25);
  background: #fff7f6;
}

.approval-admin-summary span.danger b {
  color: #b42318;
}

.approval-batch-toolbar {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  align-items: center;
  padding: 9px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.approval-batch-toolbar > div {
  display: grid;
  grid-column: 1 / -1;
  gap: 2px;
}

.approval-batch-toolbar [data-approval-batch-select-visible] {
  grid-column: 1 / -1;
}

.approval-batch-toolbar strong {
  font-size: 13px;
}

.approval-batch-toolbar span {
  color: var(--muted);
  font-size: 11px;
}

.approval-instance-list-row {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 6px;
  align-items: stretch;
}

.approval-instance-list-row.exception.critical {
  border-left: 3px solid #b42318;
}

.approval-instance-list-row.exception.high {
  border-left: 3px solid #b45f06;
}

.approval-instance-list-row.exception.medium {
  border-left: 3px solid #196c72;
}

.approval-instance-select {
  display: grid;
  place-items: center;
  width: 24px;
  min-width: 24px;
}

.approval-instance-select input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--primary);
}

.approval-instance-button {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  width: 100%;
  min-height: 78px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: #fff;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.approval-instance-button:hover,
.approval-instance-button.active {
  border-color: rgba(38, 89, 162, 0.45);
  background: #f3f8ff;
}

.approval-instance-button.overdue {
  border-color: rgba(196, 74, 62, 0.35);
}

.approval-instance-button.due-soon {
  border-color: rgba(172, 108, 24, 0.4);
}

.approval-instance-button.stalled {
  border-color: rgba(157, 47, 36, 0.62);
  background: #fff8f7;
}

.approval-instance-button.active {
  box-shadow: inset 3px 0 0 var(--primary);
}

.approval-instance-button span,
.approval-instance-button strong,
.approval-instance-button small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.approval-instance-button .approval-exception-badges {
  display: flex;
  gap: 5px;
  margin-top: 7px;
  overflow: visible;
  white-space: normal;
}

.approval-exception-badges em,
.approval-exception-severity {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 11px;
  font-style: normal;
  font-weight: 700;
}

.approval-exception-badges em.critical,
.approval-exception-severity.critical {
  background: #feeceb;
  color: #9f1c13;
}

.approval-exception-badges em.high,
.approval-exception-severity.high {
  background: #fff2dd;
  color: #8a4b08;
}

.approval-exception-badges em.medium,
.approval-exception-severity.medium {
  background: #e9f6f5;
  color: #17676b;
}

.approval-instance-button small {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
}

.approval-instance-button .status.draft,
.approval-instance-detail .status.draft {
  background: #fff7e6;
  color: #9a5d00;
}

.approval-instance-button .status.published,
.approval-instance-detail .status.published {
  background: #effaf5;
  color: var(--success);
}

.approval-instance-button .status.archived,
.approval-instance-detail .status.archived {
  background: #f1f3f5;
  color: #697386;
}

.approval-instance-detail {
  display: grid;
  gap: 14px;
  max-height: calc(100vh - 280px);
  overflow: auto;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
}

.approval-admin-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 8px;
}

.approval-admin-metrics span.danger {
  border-color: rgba(196, 74, 62, 0.28);
  background: #fff7f6;
}

.approval-admin-metrics span.danger b {
  color: #b42318;
}

.approval-exception-diagnosis {
  display: grid;
  gap: 10px;
  padding: 12px;
  border-left: 4px solid #b45f06;
  background: #fffaf2;
}

.approval-exception-diagnosis.critical {
  border-left-color: #b42318;
  background: #fff7f6;
}

.approval-exception-diagnosis.medium {
  border-left-color: #196c72;
  background: #f2f9f8;
}

.approval-exception-issue-list {
  display: grid;
  gap: 7px;
}

.approval-exception-issue-list article {
  display: grid;
  grid-template-columns: minmax(150px, 0.8fr) minmax(180px, 1.2fr);
  gap: 12px;
  padding: 8px 0;
  border-top: 1px solid rgba(108, 79, 45, 0.14);
}

.approval-exception-issue-list div,
.approval-exception-issue-list p {
  display: grid;
  gap: 3px;
  min-width: 0;
  margin: 0;
}

.approval-exception-issue-list strong {
  font-size: 13px;
}

.approval-exception-issue-list span,
.approval-exception-issue-list p,
.approval-exception-recommendation {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.approval-exception-recommendation {
  display: flex;
  gap: 8px;
  margin: 0;
}

.approval-exception-recommendation b {
  color: var(--text);
}

.approval-instance-timeline {
  display: grid;
  gap: 8px;
}

.approval-instance-timeline article {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.approval-instance-timeline article.active {
  border-color: rgba(20, 108, 148, 0.35);
  background: #f2f9fd;
}

.approval-instance-timeline span {
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
}

.approval-instance-timeline strong {
  color: var(--text);
  font-size: 14px;
}

.approval-instance-timeline p,
.approval-instance-timeline small {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

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

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

.approval-notification-item.failed {
  border-color: rgba(196, 74, 62, 0.28);
  background: #fff8f7;
}

.approval-notification-item strong,
.approval-notification-item p,
.approval-notification-item small {
  display: block;
  min-width: 0;
  margin: 0;
}

.approval-notification-item p,
.approval-notification-item small,
.approval-notification-item span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.approval-notification-item small {
  color: #b42318;
}

.approval-notification-retry {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) auto;
  gap: 6px;
  min-width: min(260px, 100%);
}

.approval-admin-actions {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(20, 108, 148, 0.18);
  border-radius: 8px;
  background: #f6fbff;
}

.approval-admin-action-grid {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) minmax(220px, 1.4fr) auto auto auto;
  gap: 8px;
  align-items: end;
}

.approval-admin-action-grid label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
}

.approval-admin-action-grid input {
  min-width: 0;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 10px;
  color: var(--text);
}

.content-management-panel {
  margin-top: 0;
}

.content-management {
  display: grid;
  gap: 14px;
}

.content-manager-card {
  display: grid;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
}

.content-manager-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.content-manager-head > button {
  min-height: 44px;
  align-self: center;
  padding: 0 18px;
  white-space: nowrap;
}

.content-manager-head h3 {
  margin: 0 0 5px;
  font-size: 16px;
}

.content-manager-head p {
  margin: 0;
}

.content-form-row {
  display: grid;
  gap: 6px;
}

.content-field {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.content-field > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.content-controls {
  display: grid;
  gap: 12px;
  align-items: center;
  justify-content: start;
}

.board-url-controls {
  grid-template-columns: minmax(320px, 720px) 104px 136px;
}

.banner-upload-controls {
  grid-template-columns: minmax(220px, 320px) minmax(260px, 460px) 136px 136px;
}

.content-form-row input {
  width: 100%;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 11px;
  background: #fff;
  color: var(--text);
  font: inherit;
}

.content-form-row input[type="file"] {
  padding: 9px 10px;
}

.banner-upload-row {
  grid-template-columns: 1fr;
}

.content-controls > button {
  width: 100%;
  min-width: 0;
  height: 44px;
  padding: 0 14px;
  white-space: nowrap;
}

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

.banner-manager-item {
  display: grid;
  grid-template-columns: 150px minmax(180px, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.banner-manager-item.active {
  border-color: rgba(38, 89, 162, 0.42);
  background: #f4f8ff;
}

.banner-manager-item img {
  width: 150px;
  aspect-ratio: 2048 / 430;
  border-radius: 6px;
  object-fit: cover;
  background: #9e0909;
}

.banner-manager-item label {
  display: grid;
  gap: 6px;
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.banner-manager-item input {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  background: #fff;
  color: var(--text);
  font: inherit;
}

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

.compact-upload {
  min-height: 118px;
}

.attendance-import {
  position: sticky;
  top: 24px;
  max-height: calc(100vh - 48px);
  overflow: auto;
}

.attendance-rules-panel,
.attendance-results-panel {
  min-width: 0;
}

.attendance-results-panel {
  order: 1;
}

.attendance-rules-panel {
  order: 2;
}

.attendance-rule-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(120px, 1fr));
  gap: 12px;
}

.attendance-rule-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}

.attendance-rule-form input {
  min-width: 0;
}

.attendance-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(62px, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.attendance-calendar-day {
  display: grid;
  gap: 3px;
  min-height: 70px;
  align-content: center;
  justify-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  cursor: pointer;
}

.attendance-calendar-day:disabled {
  cursor: default;
  opacity: 0.86;
}

.attendance-calendar-day span {
  font-size: 16px;
  font-weight: 800;
}

.attendance-calendar-day small {
  color: var(--muted);
  font-size: 11px;
}

.attendance-calendar-day strong {
  font-size: 12px;
}

.attendance-calendar-day.workday {
  border-color: #bdd3f7;
  background: #f4f8ff;
}

.attendance-calendar-day.halfday {
  border-color: #d8b777;
  background: #fff8e8;
}

.attendance-calendar-day.rest {
  border-color: #c9d7cf;
  background: #f2faf5;
}

.dingtalk-sync {
  display: grid;
  gap: 12px;
  margin-bottom: 14px;
  padding: 12px;
  border: 1px solid #cfe0ff;
  border-radius: 8px;
  background: #f4f8ff;
}

.attendance-date-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.attendance-date-grid label {
  display: grid;
  min-width: 0;
  gap: 6px;
}

.attendance-date-grid input[type="date"] {
  width: 100%;
  min-width: 0;
}

.dingtalk-sync textarea {
  min-height: 76px;
}

.dingtalk-sync .primary-btn {
  width: 100%;
}

.upload-zone {
  min-height: 112px;
  margin: 14px 0 0;
  place-items: center;
  border: 1px dashed #9ab7cf;
  border-radius: 8px;
  background: #f7fbff;
  color: var(--text);
  padding: 18px;
  text-align: center;
}

.upload-zone strong,
.upload-zone span {
  display: block;
}

.upload-zone strong {
  font-size: 17px;
}

.upload-zone span {
  max-width: 260px;
  color: var(--muted);
  line-height: 1.6;
}

.upload-zone input {
  max-width: 280px;
  background: #fff;
}

.attendance-help {
  display: grid;
  gap: 7px;
  margin-top: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
}

.attendance-help strong {
  font-size: 13px;
}

.attendance-help span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

.attendance-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.personal-attendance {
  display: grid;
  gap: 12px;
  margin-bottom: 14px;
  padding: 12px 14px;
  border: 1px solid #cfe0ff;
  border-radius: 8px;
  background: #f2f7ff;
}

.personal-attendance strong {
  font-size: 14px;
}

.personal-attendance span {
  color: var(--muted);
  font-size: 13px;
}

.personal-attendance-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.personal-attendance-head > div {
  display: grid;
  gap: 4px;
}

.compact-btn {
  min-height: 34px;
  padding: 0 12px;
  white-space: nowrap;
}

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

.personal-punch-grid article {
  display: grid;
  grid-template-columns: minmax(88px, 1fr) minmax(74px, 0.85fr) minmax(74px, 0.85fr) auto;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.personal-punch-grid article.empty {
  background: #fbfdff;
}

.personal-punch-grid strong,
.personal-punch-grid b,
.personal-punch-grid span,
.personal-punch-grid small {
  display: block;
}

.personal-punch-grid strong {
  font-size: 14px;
}

.personal-punch-grid b {
  margin-top: 3px;
  font-size: 20px;
}

.personal-punch-grid em {
  justify-self: end;
  font-style: normal;
  color: var(--success);
  font-size: 12px;
  white-space: nowrap;
}

.personal-punch-grid article.empty em {
  color: var(--muted);
}

.personal-punch-history {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  color: var(--muted);
  font-size: 12px;
}

.personal-punch-history span {
  font-weight: 700;
  color: var(--text);
}

.personal-attendance-calendar {
  display: grid;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.personal-calendar-weekdays,
.personal-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(108px, 1fr));
  gap: 6px;
  min-width: 760px;
}

.personal-calendar-weekdays span {
  min-height: 24px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}

.personal-calendar-day {
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 6px;
  min-height: 104px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.personal-calendar-day.blank {
  border-color: transparent;
  background: transparent;
}

.personal-calendar-date {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.personal-calendar-date strong {
  font-size: 18px;
  line-height: 1;
}

.personal-calendar-date span {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 11px;
}

.personal-calendar-times {
  display: grid;
  align-content: center;
  gap: 3px;
}

.personal-calendar-times span {
  display: grid;
  gap: 2px;
  min-width: 0;
  color: var(--text);
  font-size: 12px;
}

.personal-calendar-times b,
.personal-calendar-times small {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.personal-calendar-times b {
  font-weight: 600;
}

.personal-calendar-times small {
  color: var(--muted);
  font-size: 11px;
}

.personal-calendar-day em {
  justify-self: start;
  min-height: 22px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #f4f7fa;
  color: var(--muted);
  font-style: normal;
  font-size: 12px;
  line-height: 1.35;
}

.personal-calendar-day.ok {
  border-color: #c7e6d8;
  background: #fbfffd;
}

.personal-calendar-day.ok em {
  background: #effaf5;
  color: var(--success);
}

.personal-calendar-day.warning {
  border-color: #f0c89f;
  background: #fff8ef;
}

.personal-calendar-day.warning em {
  background: #fff0da;
  color: #9a5b13;
}

.personal-calendar-day.empty {
  background: #fbfdff;
}

.personal-calendar-day.rest {
  border-color: #d7e7dc;
  background: #f6fbf8;
}

.personal-calendar-day.future {
  opacity: 0.78;
}

.personal-calendar-day.today {
  border-color: var(--primary);
  box-shadow: inset 0 0 0 1px var(--primary);
}

.attendance-summary article {
  min-height: 86px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
}

.attendance-summary span,
.attendance-summary small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.attendance-summary strong {
  display: block;
  margin: 6px 0 5px;
  font-size: 24px;
}

.attendance-result {
  min-height: 260px;
  max-height: min(560px, calc(100vh - 390px));
  overflow: auto;
}

.attendance-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
}

.attendance-table {
  min-width: 1120px;
}

.attendance-person-btn {
  display: grid;
  gap: 3px;
  min-width: 76px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.attendance-person-btn strong {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.attendance-person-btn span {
  color: var(--muted);
}

.attendance-person-btn:hover strong {
  color: var(--primary);
}

.attendance-table tr.selected-attendance-row td {
  background: var(--primary-muted);
}

.attendance-warning {
  background: #fff6e8;
  color: #9a5b13;
}

.flow-visual {
  display: grid;
  grid-template-columns: auto 1fr auto 1fr auto 1fr auto;
  align-items: center;
  gap: 8px;
  margin-bottom: 24px;
}

.flow-node {
  display: grid;
  place-items: center;
  min-width: 72px;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  font-size: 13px;
}

.flow-node.done {
  color: var(--success);
  border-color: rgba(22, 132, 91, 0.3);
  background: #effaf5;
}

.flow-node.active {
  color: var(--primary);
  border-color: rgba(20, 108, 148, 0.35);
  background: #eef7fb;
}

.flow-line {
  height: 2px;
  background: var(--line);
}

.bars {
  display: flex;
  align-items: end;
  gap: 12px;
  height: 156px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, #fbfdff, #f2f6fa);
}

.bars span {
  flex: 1;
  height: var(--h);
  border-radius: 6px 6px 2px 2px;
  background: linear-gradient(180deg, #4d9dbf, #146c94);
}

.ai-panel {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: clamp(580px, calc(100dvh - 170px), 760px);
}

.ai-panel .panel-header {
  flex: 0 0 auto;
}

.ai-messages {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 14px;
  min-height: 460px;
  max-height: none;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7f9fb;
}

.message {
  flex: 0 0 auto;
  max-width: min(78%, 760px);
  padding: 12px 14px;
  border-radius: 8px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.message.user {
  max-width: min(72%, 680px);
  justify-self: end;
  align-self: flex-end;
  background: var(--primary);
  color: #fff;
}

.message.ai {
  justify-self: start;
  align-self: flex-start;
  max-width: min(88%, 840px);
  background: #fff;
  border: 1px solid var(--line);
}

.ai-status-indicator {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border: 1px solid #d9e4ee;
  border-radius: 999px;
  padding: 3px 9px;
  color: #64748b;
  background: #f8fafc;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.ai-status-indicator.online {
  border-color: #bbf7d0;
  color: #166534;
  background: #f0fdf4;
}

.ai-header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

.ai-header-actions .secondary-btn,
.ai-header-actions .ghost-btn {
  min-height: 30px;
  padding: 0 10px;
  font-size: 12px;
}

.ai-conversation-status {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.message-text {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.ai-reply-details {
  margin-top: 8px;
  white-space: normal;
}

.ai-reply-details summary,
.ai-source-list summary,
.ai-feedback-actions summary {
  cursor: pointer;
  color: var(--primary);
  font-size: 12px;
  font-weight: 800;
  list-style: none;
  user-select: none;
}

.ai-reply-details summary::-webkit-details-marker,
.ai-source-list summary::-webkit-details-marker,
.ai-feedback-actions summary::-webkit-details-marker {
  display: none;
}

.ai-reply-details summary::after,
.ai-source-list summary::after,
.ai-feedback-actions summary::after {
  content: " +";
  color: var(--muted);
}

.ai-reply-details[open] summary::after,
.ai-source-list[open] summary::after,
.ai-feedback-actions[open] summary::after {
  content: " -";
}

.ai-reply-details > div {
  margin-top: 7px;
  max-height: 260px;
  overflow: auto;
  border: 1px solid #dce6ef;
  border-radius: 7px;
  padding: 9px;
  color: #263447;
  background: #f8fbfd;
  font-size: 13px;
  line-height: 1.55;
  white-space: pre-wrap;
}

.ai-source-list {
  display: grid;
  gap: 7px;
  margin-top: 10px;
  padding-top: 9px;
  border-top: 1px solid var(--line);
}

.ai-source-item {
  display: grid;
  gap: 2px;
  padding: 8px;
  border: 1px solid #dce6ef;
  border-radius: 7px;
  background: #f7fafc;
}

.ai-source-item span {
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}

.ai-source-item small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.ai-action-list {
  display: grid;
  gap: 7px;
  margin-top: 10px;
  padding-top: 9px;
  border-top: 1px solid var(--line);
}

.ai-action-list > strong {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.ai-action-card {
  display: grid;
  gap: 2px;
  width: 100%;
  min-height: 42px;
  border: 1px solid #cfe0ec;
  border-radius: 7px;
  padding: 8px 10px;
  color: #123453;
  background: #f5fbff;
  text-align: left;
}

.ai-action-card:hover {
  border-color: var(--primary);
  background: #eef8fd;
}

.ai-action-card span {
  font-size: 13px;
  font-weight: 800;
}

.ai-action-card small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.ai-feedback-actions {
  display: grid;
  gap: 7px;
  margin-top: 9px;
}

.ai-feedback-actions > div {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.ai-feedback-actions button {
  min-height: 28px;
  padding: 5px 8px;
  border-radius: 7px;
  border: 1px solid #d8e2ea;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
}

.ai-feedback-actions button:hover:not(:disabled) {
  border-color: #9dc5e3;
  color: var(--text);
  background: #f4f9fd;
}

.ai-feedback-actions button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.ai-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: end;
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px;
  background: #fff;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.ai-form:focus-within {
  border-color: #7eb6db;
  box-shadow: 0 0 0 3px rgba(20, 108, 148, 0.12);
}

.ai-form textarea {
  min-width: 0;
  min-height: 44px;
  max-height: 132px;
  border: 0;
  padding: 11px 10px;
  resize: none;
  overflow-y: hidden;
  line-height: 1.5;
}

.ai-form textarea:focus {
  outline: 0;
}

.ai-form .primary-btn {
  width: 82px;
  min-width: 82px;
  min-height: 44px;
}

.ai-tools-panel {
  position: sticky;
  top: 18px;
  align-self: start;
}

.ai-tools-panel .automation-grid {
  grid-template-columns: 1fr;
  gap: 8px;
}

.ai-tools-panel .automation-grid button {
  min-height: 46px;
  padding: 10px 12px;
  text-align: left;
}

.knowledge-ai-panel {
  margin-bottom: 14px;
}

.knowledge-ai-form {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.knowledge-ai-form input {
  min-width: 0;
}

.knowledge-ai-prompts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.knowledge-ai-prompts button {
  min-height: 32px;
  border: 1px solid #d8e2ea;
  border-radius: 8px;
  padding: 6px 10px;
  background: #fff;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.knowledge-ai-prompts button:hover {
  border-color: #9dc5e3;
  color: var(--primary);
  background: #f5fbff;
}

.knowledge-ai-answer {
  margin-top: 12px;
}

.knowledge-ai-loading,
.knowledge-ai-error,
.knowledge-ai-result {
  border: 1px solid #dce6ef;
  border-radius: 8px;
  padding: 12px;
  background: #f8fbfd;
}

.knowledge-ai-error {
  border-color: #f2c5bd;
  color: #9f2f24;
  background: #fff7f5;
}

.knowledge-ai-result {
  display: grid;
  gap: 10px;
}

.knowledge-ai-result-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.knowledge-ai-result-head strong {
  min-width: 0;
  color: var(--text);
}

.knowledge-ai-result-head span {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 12px;
}

.knowledge-ai-result p {
  margin: 0;
  color: #263447;
  line-height: 1.65;
  white-space: pre-wrap;
}

.knowledge-ai-sources {
  display: grid;
  gap: 7px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.knowledge-ai-source {
  display: grid;
  gap: 3px;
  border: 1px solid #dce6ef;
  border-radius: 7px;
  padding: 8px;
  background: #fff;
}

.knowledge-ai-source span {
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.knowledge-ai-source small,
.knowledge-ai-no-source {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.automation-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.automation-grid button {
  min-height: 64px;
  background: #fbfdff;
  border-color: var(--line);
  color: var(--text);
}

.toast {
  position: fixed;
  right: 22px;
  top: 22px;
  z-index: 80;
  max-width: min(520px, calc(100vw - 44px));
  transform: translateY(-14px);
  opacity: 0;
  pointer-events: none;
  padding: 12px 14px;
  border-radius: 8px;
  background: #102536;
  color: #fff;
  transition: 0.18s ease;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

/* Adaptive data wrapping: cards and text-heavy tables should flow to the next row
   before they create cramped columns or horizontal overflow. Wide operational
   tables such as salary and calendar grids keep their dedicated scroll rules. */
.metric-grid,
.home-workbench,
.home-info-grid,
.employee-overview-cards,
.org-summary,
.overview-status,
.overview-departments,
  .overview-actions,
  .asset-overview-grid,
  .asset-inventory-summary,
  .asset-quality-grid,
  .approval-detail-meta,
.approval-app-grid,
.archive-metrics,
.archive-detail-grid,
.template-grid,
.account-role-grid,
.automation-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr));
}

.home-doc-list {
  grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
}

.approval-detail-meta span,
.archive-detail-grid p,
.archive-detail-grid span,
.asset-metric,
.metric,
.home-summary,
.template-card,
.knowledge-card,
.role-catalog-card,
.account-card {
  min-width: 0;
  overflow-wrap: anywhere;
}

.employee-table td,
.profile-subtable td,
.attendance-map-table td,
.asset-table td,
.archive-table td,
.audit-table td {
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.45;
}

.approval-file-link strong,
.account-list-button span,
.account-list-button strong,
.account-list-button small,
.account-list-button em {
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
  overflow-wrap: anywhere;
}

@media (max-width: 980px) {
  .toast {
    left: 14px;
    right: 14px;
    top: 14px;
    max-width: none;
  }

  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 10;
    display: block;
    padding: 14px;
    max-width: 100vw;
    overflow: visible;
  }

  .brand,
  .sidebar-footer {
    display: none;
  }

  .nav {
    display: flex;
    align-items: flex-start;
    overflow-x: auto;
    width: 100%;
    min-width: 0;
  }

  .nav > .nav-item,
  .nav-group > summary {
    flex: 0 0 auto;
    min-width: 86px;
    text-align: center;
  }

  .nav-group {
    position: relative;
    flex: 0 0 auto;
  }

  .nav-group-items {
    position: fixed;
    left: 14px;
    right: 14px;
    top: 66px;
    z-index: 12;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin: 0;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 12px 30px rgba(34, 49, 63, 0.18);
  }

  .nav-group-items .nav-item {
    width: 100%;
    min-width: 0;
    background: #f7f9fc;
  }

  .metric-grid,
  .org-summary,
  .attendance-layout,
  .documents-layout,
  .home-workbench,
  .archive-layout,
  .home-layout,
  .home-info-grid,
  .home-document-grid,
  .workbench-layout,
  .approval-browser,
  .asset-register-layout,
  .dashboard-layout,
  .split-layout,
  .ai-layout {
    grid-template-columns: 1fr;
  }

  .workflow-management {
    grid-template-columns: 1fr;
  }

  .workflow-quality-overview {
    grid-template-columns: 1fr;
  }

  .workflow-health-metrics {
    grid-template-columns: repeat(3, minmax(100px, 1fr));
  }

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

  .workflow-batch-actions {
    grid-column: 1 / -1;
  }

  .workflow-batch-summary {
    grid-template-columns: repeat(2, minmax(100px, 1fr));
  }

  .performance-ledger-panel .panel-header {
    grid-template-columns: 1fr;
  }

  .performance-ledger-toolbar {
    grid-template-columns: 150px 140px minmax(180px, 1fr) auto auto;
  }

  .performance-ledger-summary {
    grid-template-columns: repeat(3, minmax(90px, 1fr));
  }

  .performance-assignment-item {
    grid-template-columns: minmax(260px, 1.5fr) minmax(150px, 0.8fr);
  }

  .performance-assignment-item .primary-btn {
    justify-self: start;
  }

  .performance-ledger-summary span:nth-child(3) {
    border-right: 0;
  }

  .performance-ledger-summary span:nth-child(-n + 3) {
    border-bottom: 1px solid var(--line);
  }

  .ai-tools-panel {
    position: static;
    align-self: stretch;
  }

  .ai-tools-panel .automation-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .approval-matrix-management {
    grid-template-columns: 1fr;
  }

  .master-data-layout {
    grid-template-columns: 1fr;
  }

  .master-data-types {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    max-height: none;
    overflow: visible;
  }

  .workflow-template-list {
    max-height: 280px;
  }

  .approval-matrix-list {
    max-height: 280px;
  }

  .workflow-template-detail {
    max-height: none;
  }

  .approval-matrix-detail {
    max-height: none;
  }

  .workflow-form-grid,
  .workflow-simulation-form,
  .approval-matrix-form-grid,
  .approval-matrix-preview-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .approval-matrix-preview-form .secondary-btn {
    align-self: end;
  }

  .workflow-scenario-toolbar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .workflow-scenario-toolbar > div {
    grid-column: 1 / -1;
  }

  .asset-overview-grid,
  .asset-inventory-summary,
  .asset-quality-grid,
  .asset-filters {
    grid-template-columns: 1fr 1fr;
  }

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

  .asset-detail-panel {
    position: static;
  }

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

  .common-flow-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .profile-body {
    grid-template-columns: 1fr;
  }

  .profile-side {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .attendance-import {
    position: static;
    max-height: none;
    overflow: visible;
  }

  .attendance-rules-panel,
  .attendance-results-panel {
    grid-column: auto;
  }

  .attendance-calendar-grid {
    grid-template-columns: repeat(7, minmax(42px, 1fr));
  }

  .personal-punch-grid {
    grid-template-columns: 1fr;
  }

  .personal-punch-grid article {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .personal-punch-grid em {
    justify-self: start;
  }

  .personal-calendar-weekdays,
  .personal-calendar-grid {
    grid-template-columns: repeat(7, minmax(96px, 1fr));
    min-width: 680px;
  }
}

@media (max-width: 1180px) {
  .workbench-layout {
    grid-template-columns: 1fr;
  }

  #processes .split-layout {
    grid-template-columns: 1fr;
  }

  .approval-list-panel {
    max-height: 300px;
  }

  .approval-detail-panel {
    max-height: none;
  }

  .approval-detail-meta {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .request-guide-panel {
    position: static;
  }

  #processes.erp-request-mode .request-guide-panel {
    order: -1;
  }

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

  .employee-overview-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .main {
    padding: 16px;
  }

  .system-tabs {
    display: flex;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
  }

  .system-tabs button {
    flex: 0 0 auto;
  }

  .workflow-health-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .workflow-quality-overview dl {
    grid-template-columns: 1fr;
  }

  .workflow-health-metrics button {
    min-height: 62px;
    padding: 9px 11px;
  }

  .workflow-batch-head {
    align-items: stretch;
    flex-direction: column;
  }

  .workflow-owner-binding-head {
    align-items: stretch;
    flex-direction: column;
  }

  .workflow-draft-review-head {
    align-items: stretch;
    flex-direction: column;
  }

  .workflow-owner-binding-head > span {
    align-self: flex-start;
  }

  .workflow-draft-review-head > span {
    align-self: flex-start;
  }

  .workflow-owner-binding-list article {
    grid-template-columns: minmax(0, 1fr);
  }

  .workflow-draft-review-list article {
    grid-template-columns: minmax(0, 1fr);
  }

  .workflow-owner-binding-list article > div:last-child {
    justify-content: flex-start;
  }

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

  .workflow-batch-reason,
  .workflow-batch-actions {
    grid-column: auto;
  }

  .workflow-batch-actions {
    align-items: stretch;
  }

  .workflow-batch-actions > span {
    width: 100%;
  }

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

  .performance-ledger-toolbar {
    width: 100%;
    grid-template-columns: 1fr;
  }

  .performance-assignment-banner {
    align-items: stretch;
    flex-direction: column;
  }

  .performance-assignment-banner .ghost-btn {
    align-self: flex-start;
  }

  .performance-assignment-editor {
    padding: 12px 0;
  }

  .performance-assignment-item {
    grid-template-columns: 1fr;
    border-right: 0;
    border-left: 0;
    border-radius: 0;
  }

  .performance-assignment-item .primary-btn {
    width: 100%;
  }

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

  .performance-ledger-summary span,
  .performance-ledger-summary span:nth-child(3) {
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
  }

  .performance-ledger-summary span:nth-child(even) {
    border-right: 0;
  }

  .performance-ledger-summary span:nth-last-child(-n + 2) {
    border-bottom: 0;
  }

  .performance-ledger-table {
    display: block;
    min-width: 0;
  }

  .performance-ledger-table thead {
    display: none;
  }

  .performance-ledger-table tbody {
    display: grid;
    gap: 10px;
  }

  .performance-ledger-table tr {
    display: grid;
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: hidden;
  }

  .performance-ledger-table th,
  .performance-ledger-table td {
    display: grid;
    grid-template-columns: 86px minmax(0, 1fr);
    gap: 8px;
    padding: 10px;
  }

  .performance-ledger-table td::before {
    content: attr(data-label);
    grid-column: 1;
    grid-row: 1;
    align-self: start;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
  }

  .performance-ledger-table td > * {
    grid-column: 2;
  }

  .performance-ledger-table td:last-child {
    border-bottom: 0;
  }

  .topbar,
  .panel-header {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar-actions,
  .segmented,
  .ai-form,
  .item {
    align-items: stretch;
    flex-direction: column;
    display: flex;
  }

  .ai-header-actions {
    justify-content: flex-start;
  }

  .ai-panel {
    min-height: 560px;
  }

  .ai-messages {
    min-height: 400px;
    padding: 12px;
  }

  .message,
  .message.ai {
    max-width: 94%;
  }

  .message.user {
    max-width: 88%;
  }

  .ai-panel .ai-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 72px;
    align-items: end;
    flex-direction: row;
  }

  .ai-form .primary-btn {
    width: 72px;
    min-width: 72px;
  }

  .ai-tools-panel .automation-grid {
    grid-template-columns: 1fr;
  }

  .topbar-actions {
    flex: 0 1 auto;
  }

  .asset-overview-grid,
  .asset-inventory-summary,
  .asset-quality-grid,
  .asset-filters,
  .asset-edit-grid,
  .archive-filters,
  .archive-metrics,
  .archive-detail-grid,
  .asset-detail-actions {
    grid-template-columns: 1fr;
  }

  .asset-qr-card {
    grid-template-columns: 96px minmax(0, 1fr);
  }

  .asset-qr-code {
    width: 96px;
    height: 96px;
  }

  .asset-qr-svg {
    width: 82px;
    height: 82px;
  }

  .pilot-identity,
  .theme-setting,
  .topbar-session,
  .topbar-user,
  .pilot-identity select,
  .theme-picker,
  .topbar-session > button {
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }

  .topbar-session {
    display: grid;
    grid-template-columns: 1fr;
  }

  .topbar-user {
    justify-items: start;
    place-content: center start;
    text-align: left;
  }

  .theme-picker {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .workbench-side {
    grid-template-columns: 1fr;
  }

  .main {
    max-width: 100vw;
  }

  .metric-grid,
  .org-summary,
  .employee-overview-cards,
  .overview-status,
  .overview-departments,
  .overview-actions,
  .attendance-summary,
  .attendance-rule-form,
  .approval-workspace,
  .approval-top,
  .module-grid,
  .common-flow-cards,
  .approval-app-grid,
  .profile-fields,
  .template-grid,
  .form-grid,
  .system-layout,
  .account-permission-list,
  .account-role-grid,
  .approval-instance-management,
  .approval-admin-metrics,
  .approval-admin-action-grid,
  .approval-notification-item,
  .approval-exception-filters,
  .approval-batch-toolbar,
  .approval-person-backfill-summary,
  .approval-person-backfill-actions,
  .approval-exception-issue-list article,
  .approval-notification-retry,
  .automation-grid {
    grid-template-columns: 1fr;
  }

  .approval-batch-toolbar > button,
  .approval-batch-toolbar > input {
    width: 100%;
  }

  .approval-notification-dashboard-head {
    align-items: stretch;
    flex-direction: column;
  }

  .approval-notification-range,
  .approval-notification-dashboard-body {
    grid-template-columns: 1fr;
    width: 100%;
  }

  .approval-notification-metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  .approval-notification-range {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .approval-notification-event-row {
    grid-template-columns: minmax(0, 1fr) 42px;
  }

  .approval-notification-rate {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .master-data-types,
  .master-data-form-grid,
  .workflow-toolbar.master-data-toolbar,
  .account-toolbar {
    grid-template-columns: 1fr;
  }

  .workflow-toolbar.master-data-toolbar {
    width: 100%;
  }

  .master-data-panel .panel-header {
    display: flex;
  }

  .master-data-batchbar,
  .master-data-modal-head,
  .list-pagination-complete {
    align-items: stretch;
    flex-direction: column;
  }

  .master-data-batchbar > div,
  .list-pagination-complete .list-pagination-actions {
    justify-content: flex-start;
  }

  .approval-instance-list-row {
    grid-template-columns: 22px minmax(0, 1fr);
  }

  .workflow-form-grid,
  .workflow-simulation-form,
  .workflow-scenario-toolbar,
  .workflow-version-row,
  .approval-matrix-form-grid,
  .approval-matrix-preview-form {
    grid-template-columns: 1fr;
  }

  .approval-matrix-notes {
    grid-column: auto;
  }

  .workflow-form-span-two {
    grid-column: auto;
  }

  .approval-matrix-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .approval-matrix-owner {
    grid-template-columns: minmax(0, 1fr) auto;
    justify-items: start;
    max-width: none;
  }

  .workflow-scenario-toolbar > div {
    grid-column: auto;
  }

  .workflow-scenario-recommendations {
    grid-template-columns: 1fr;
  }

  .workflow-scenario-recommendations > div:first-child {
    grid-template-columns: 1fr;
  }

  .workflow-simulation-actions,
  .workflow-simulation-summary {
    align-items: stretch;
    flex-direction: column;
  }

  .workflow-step-row {
    grid-template-columns: 28px minmax(0, 1fr);
    align-items: start;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--line);
  }

  .workflow-step-row-head {
    display: none;
  }

  .workflow-step-row > input[data-workflow-step-name],
  .workflow-step-row > .workflow-owner-field,
  .workflow-step-row > label,
  .workflow-step-row > .workflow-step-sla {
    grid-column: 2;
  }

  .workflow-step-sla {
    grid-template-columns: 1fr;
  }

  .workflow-step-row > label {
    min-height: 30px;
  }

  .workflow-version-row .ghost-btn {
    width: 100%;
  }

  .account-card-head {
    grid-template-columns: 1fr;
  }

  .knowledge-toolbar {
    grid-template-columns: 1fr;
    width: 100%;
  }

  .role-catalog-panel {
    position: static;
    max-height: 420px;
    overflow: auto;
  }

  .account-picker {
    max-height: 260px;
  }

  .account-detail-card {
    max-height: none;
  }

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

  .content-manager-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .content-manager-head > button {
    align-self: flex-start;
  }

  .content-form-row,
  .content-controls,
  .banner-upload-row,
  .banner-manager-item {
    grid-template-columns: 1fr;
  }

  .banner-manager-item img {
    width: 100%;
  }

  .banner-manager-actions {
    justify-content: stretch;
  }

  .banner-manager-actions button {
    flex: 1 1 120px;
  }

  .flow-field,
  .flow-field .form-grid,
  .flow-money-control,
  .erp-form-grid,
  .checkbox-grid,
  .radio-grid {
    grid-template-columns: 1fr;
  }

  .flow-money-preview {
    min-width: 0;
    text-align: left;
  }

  .request-ai-helper {
    align-items: stretch;
    flex-direction: column;
  }

  .request-ai-helper .ghost-btn {
    width: 100%;
  }

  .request-basic-info.erp-compact > summary,
  .request-optional-settings.erp-compact > summary {
    align-items: flex-start;
  }

  .request-basic-info.erp-compact > summary small,
  .request-optional-settings.erp-compact > summary small {
    white-space: normal;
  }

  .copy-picker-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .copy-picker-options {
    grid-template-columns: 1fr;
    max-height: 220px;
  }

  .employee-module-head {
    align-items: stretch;
    flex-direction: column;
  }

  .employee-module-actions {
    align-items: stretch;
    flex-direction: column;
    min-width: 0;
  }

  .employee-module-head .search {
    max-width: 100%;
  }

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

  .contact-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    min-width: 520px;
  }

  .home-doc-preview {
    grid-template-rows: auto;
  }

  .home-doc-list {
    grid-template-columns: 1fr;
  }

  .home-banner {
    min-height: 0;
    max-height: none;
  }

  .home-banner img {
    min-height: 0;
  }

  .home-preview-head {
    flex-direction: column;
  }

  .home-download-btn {
    width: 100%;
    max-width: 100%;
  }

  .home-download-btn small {
    max-width: 220px;
  }

  .attendance-calendar-grid {
    gap: 5px;
  }

  .attendance-calendar-day {
    min-height: 58px;
  }

  .org-leadership {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    width: 100%;
    min-height: 0;
  }

  .org-leadership::before {
    display: none;
  }

  .org-leadership-main,
  .org-hr-direct,
  .org-audit-direct {
    grid-column: 1;
  }

  .org-canvas {
    width: 100%;
    min-width: 0;
  }

  .org-direct-branch {
    position: relative;
    right: auto;
    top: auto;
    width: 100%;
    margin-top: 10px;
  }

  .org-direct-branch::before,
  .org-direct-branch::after,
  .org-leadership-main::after,
  .org-leader-general::before,
  .org-leader-general::after {
    display: none;
  }

  .org-editor-form,
  .department-lifecycle-form {
    grid-template-columns: 1fr;
  }

  .department-lifecycle-reason {
    grid-column: auto;
  }

  .organization-change-impact-list,
  .organization-change-fields {
    grid-template-columns: 1fr;
  }

  .organization-change-impact-list > div {
    grid-template-columns: 82px minmax(0, 1fr);
  }

  .organization-change-impact-list small {
    grid-column: 2;
  }

  .org-editor-head,
  .org-editor-actions,
  .organization-change-impact-head {
    align-items: stretch;
    flex-direction: column;
  }

  .home-attendance {
    grid-template-columns: 52px minmax(0, 1fr);
  }

  .attendance-mini-bars {
    grid-column: 1 / -1;
  }

  .home-quick-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .flow-field-tall > span:first-child {
    padding-top: 0;
  }

  .approval-menu {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .approval-detail-head,
  .approval-detail-meta,
  .approval-field-grid {
    grid-template-columns: 1fr;
  }

  .approval-field-grid > div:nth-child(odd) {
    border-right: 0;
  }

  .approval-detail-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .flow-visual {
    grid-template-columns: 1fr;
  }

  .flow-line {
    width: 2px;
    height: 18px;
    margin: 0 auto;
  }
}

/* ===== B1 登录遮罩 ===== */
.auth-gate {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px;
  overflow: auto;
  background:
    linear-gradient(120deg, rgba(229, 88, 40, 0.16) 0 18%, transparent 18% 100%),
    linear-gradient(145deg, #f7f3ed 0%, #eef5fb 52%, #ffffff 100%);
}
.auth-gate[hidden] { display: none; }
.auth-card {
  width: min(920px, 96vw);
  min-height: 520px;
  display: grid;
  grid-template-columns: minmax(280px, 0.88fr) minmax(360px, 1fr);
  overflow: hidden;
  background: #fff;
  border: 1px solid rgba(57, 64, 74, 0.08);
  border-radius: 18px;
  padding: 0;
  box-shadow: 0 26px 70px rgba(34, 47, 70, 0.18);
}
.auth-brand {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  min-width: 0;
  padding: 48px 34px;
  color: #2f3338;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(255, 250, 244, 0.94)),
    linear-gradient(145deg, rgba(229, 88, 40, 0.16), rgba(46, 95, 139, 0.08));
  border-right: 1px solid rgba(71, 78, 90, 0.08);
}
.auth-brand::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 6px;
  background: linear-gradient(90deg, #e55828, #a96b2d, #2f6f91);
}
.auth-brand-logo {
  width: min(285px, 100%);
  height: auto;
  object-fit: contain;
}
.auth-brand-title {
  margin-top: 30px;
  font-size: 28px;
  line-height: 1.15;
  font-weight: 800;
  color: #1f2a32;
}
.auth-brand p {
  margin: 10px 0 0;
  color: #6b5960;
  font-size: 15px;
}
.auth-step {
  padding: 42px 38px;
  align-self: center;
}
.auth-step h2 { margin: 0; font-size: 24px; color: #1f2a32; }
.auth-step-head {
  margin-bottom: 18px;
}
.auth-step-head span {
  display: block;
  margin-bottom: 5px;
  color: #8a5a32;
  font-size: 13px;
  font-weight: 700;
}
.auth-step[hidden] { display: none; }

[data-home-module][hidden],
.home-workbench[hidden],
.home-info-grid[hidden],
.home-layout[hidden] {
  display: none !important;
}
.auth-step label {
  display: block;
  font-size: 13px;
  color: #4a5568;
  margin-bottom: 12px;
}
.auth-step input {
  display: block;
  width: 100%;
  box-sizing: border-box;
  margin-top: 6px;
  padding: 11px 12px;
  border: 1px solid #d8dee8;
  border-radius: 8px;
  font-size: 14px;
  background: #fff;
}
.auth-step .primary-btn { width: 100%; margin-top: 6px; }
.dingtalk-login-btn {
  height: 44px;
  font-size: 15px;
}
.dingtalk-qr-login {
  display: grid;
  gap: 12px;
  justify-items: center;
  padding: 16px 14px 14px;
  border: 1px solid #e2e7ef;
  border-radius: 14px;
  background: #fbfcfe;
}
.dingtalk-qr-frame {
  width: min(300px, 100%);
  min-height: 300px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid #edf0f5;
  border-radius: 12px;
  background: #fff;
}
.dingtalk-qr-frame iframe {
  border: 0;
}
.qr-origin-warning {
  width: 100%;
  padding: 0 22px;
  box-sizing: border-box;
  color: #5b6675;
  font-size: 14px;
  line-height: 1.7;
  text-align: center;
}
.dingtalk-login-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
  width: 100%;
}
.dingtalk-login-actions .secondary-btn {
  min-height: 40px;
  padding: 0 14px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
}
#dingtalkReloadBtn {
  border-color: transparent;
  background: linear-gradient(135deg, #e55828, #bd6b28);
  color: #fff;
  box-shadow: 0 10px 18px rgba(229, 88, 40, 0.22);
}
#dingtalkReloadBtn:hover {
  background: linear-gradient(135deg, #d84f23, #a95f23);
  box-shadow: 0 12px 22px rgba(229, 88, 40, 0.28);
  transform: translateY(-1px);
}
#dingtalkLoginBtn {
  border-color: #d7dee8;
  background: #fff;
  color: #2f5f73;
}
#dingtalkLoginBtn:hover {
  border-color: rgba(47, 111, 145, 0.38);
  background: #f3f8fb;
  color: #1f5169;
}

/* 主看板视觉桥：登录态继续保留原品牌资产，只统一系统外壳和交互色。 */
.auth-gate {
  background:
    linear-gradient(180deg, rgba(15, 40, 76, 0.98) 0, rgba(23, 52, 93, 0.96) 164px, rgba(217, 229, 244, 0.98) 165px),
    #d9e5f4;
}

.auth-card {
  width: min(940px, 96vw);
  border: 1px solid #cadbef;
  border-top: 4px solid #1d5fbf;
  border-radius: 8px;
  box-shadow: 0 20px 48px rgba(15, 40, 76, 0.22);
}

.auth-brand {
  color: #182338;
  border-right-color: #dce6f2;
  background: linear-gradient(145deg, #ffffff 0%, #f4f8fd 58%, #e9f2fc 100%);
}

.auth-brand::after {
  height: 4px;
  background: linear-gradient(90deg, #1d5fbf, #1556ad 70%, #c3842e);
}

.auth-brand-title,
.auth-step h2 {
  color: #182338;
}

.auth-brand p,
.auth-login-help {
  color: #697789;
}

.auth-step-head span {
  color: #1d5fbf;
}

.dingtalk-qr-login {
  border-color: #dce6f2;
  border-radius: 8px;
  background: #f8fbff;
}

.dingtalk-qr-frame {
  border-color: #cddbec;
  border-radius: 8px;
}

#dingtalkReloadBtn {
  border-color: #1556ad;
  background: linear-gradient(180deg, #276fd0, #1556ad);
  box-shadow: 0 8px 18px rgba(21, 86, 173, 0.2);
}

#dingtalkReloadBtn:hover {
  background: linear-gradient(180deg, #2368c4, #124b98);
  box-shadow: 0 10px 22px rgba(21, 86, 173, 0.24);
}

#dingtalkLoginBtn {
  border-color: #cddbec;
  color: #1556ad;
  background: #ffffff;
}

#dingtalkLoginBtn:hover {
  border-color: #8fb7ea;
  color: #1556ad;
  background: #edf5ff;
}

.auth-fallback {
  border-top-color: #dce6f2;
}

.auth-step input:focus {
  border-color: #1d5fbf;
  outline: 3px solid rgba(29, 95, 191, 0.14);
}
.auth-login-help {
  margin: 8px 0 12px;
  color: #607089;
  text-align: center;
}
.auth-fallback {
  margin-top: 14px;
  border-top: 1px solid #e4e9f2;
  padding-top: 10px;
}
.auth-fallback summary {
  cursor: pointer;
  list-style: none;
  color: #6c7a8f;
  font-size: 13px;
  text-align: center;
  user-select: none;
}
.auth-fallback summary::-webkit-details-marker {
  display: none;
}
.auth-fallback summary::after {
  content: " 展开";
  color: #9aa5b5;
}
.auth-fallback[open] summary::after {
  content: " 收起";
}
.auth-fallback-fields {
  margin-top: 12px;
}
.auth-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 10px 0 12px;
  color: #8a95a6;
  font-size: 12px;
}
.auth-divider::before,
.auth-divider::after {
  content: "";
  height: 1px;
  flex: 1;
  background: #e4e9f2;
}
.auth-password-btn {
  width: 100%;
  margin-top: 4px;
  border-color: #d4dbe6;
  background: #fff;
  color: #56657a;
  font-weight: 700;
}
.auth-error { color: #b42318; font-size: 12px; min-height: 16px; margin: 4px 0 10px; }
.auth-enroll { background: #f4f7fc; border-radius: 8px; padding: 14px; margin-bottom: 12px; }
.auth-enroll p { font-size: 12px; color: #4a5568; margin: 0 0 8px; }
.auth-secret-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
}
.auth-secret-main { min-width: 0; }
.auth-secret-label {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  color: #5d6a7e;
}
.auth-secret {
  font-family: Consolas, monospace;
  font-size: 14px;
  letter-spacing: 0;
  line-height: 1.5;
  font-weight: 700;
  color: #1f3b73;
  overflow-wrap: anywhere;
  background: #fff;
  border: 1px dashed #9fb3d1;
  border-radius: 6px;
  padding: 9px 10px;
  text-align: center;
}
.auth-copy-btn {
  min-width: 64px;
  height: 40px;
  padding: 0 14px;
}
.auth-copy-tip { margin-top: 8px !important; margin-bottom: 0 !important; }
.auth-otpauth { display: none; }

@media (max-width: 820px) {
  .auth-gate {
    align-items: flex-start;
    padding: 18px;
  }
  .auth-card {
    width: min(480px, 100%);
    min-height: 0;
    grid-template-columns: 1fr;
  }
  .auth-brand {
    padding: 24px 24px 20px;
    border-right: 0;
    border-bottom: 1px solid rgba(71, 78, 90, 0.08);
  }
  .auth-brand-logo {
    width: min(240px, 100%);
  }
  .auth-brand-title {
    margin-top: 18px;
    font-size: 24px;
  }
  .auth-step {
    padding: 26px 22px 28px;
  }
}

@media (max-width: 520px) {
  .auth-card { width: 100%; }
  .dingtalk-login-actions {
    flex-direction: column;
  }
  .auth-secret-row { grid-template-columns: 1fr; }
  .auth-copy-btn { width: 100%; }
}

.auth-login-help {
  color: #697789;
}

.auth-fallback {
  border-top-color: #dce6f2;
}

.auth-fallback summary,
.auth-password-btn {
  color: #52657a;
}

.auth-password-btn:hover {
  border-color: #8fb7ea;
  color: #1556ad;
  background: #edf5ff;
}

.auth-error {
  color: #e11d35;
}

/* ===== 审计日志 ===== */
.audit-log-panel { margin-top: 0; }
.audit-log-list { overflow-x: auto; }
.audit-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.audit-table th, .audit-table td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid #eef1f6;
  white-space: nowrap;
}
.audit-table th { color: #6b7280; font-weight: 600; background: #f7f9fc; }
.audit-table tbody tr:hover { background: #f4f7fc; }

/* ===== AI 反馈管理 ===== */
.ai-admin-panel { margin-top: 0; }
.ai-admin-layout {
  display: grid;
  gap: 18px;
}
.ai-admin-section {
  min-width: 0;
}
.ai-admin-section h3 {
  margin: 0 0 10px;
  color: #1f2937;
  font-size: 16px;
}
.ai-admin-section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 16px;
  margin-bottom: 10px;
}
.ai-admin-section-head h3 {
  margin: 0;
}
.ai-monitor-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(136px, 1fr));
  gap: 10px;
}
.ai-monitor-card {
  border: 1px solid #e5ebf3;
  border-radius: 8px;
  padding: 10px 12px;
  background: #f8fafc;
  min-width: 0;
}
.ai-monitor-card.wide {
  grid-column: span 2;
}
.ai-monitor-card span,
.ai-monitor-card small {
  display: block;
  color: #64748b;
  font-size: 12px;
}
.ai-monitor-card strong {
  display: block;
  margin: 3px 0;
  color: #0f172a;
  font-size: 18px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}
.ai-admin-list {
  overflow-x: auto;
}
.ai-admin-table {
  min-width: 980px;
}
.ai-admin-table td.ai-preview {
  max-width: 320px;
  white-space: normal;
  line-height: 1.5;
}
.ai-governance-table td {
  vertical-align: top;
  white-space: normal;
}
.ai-governance-table td:first-child {
  min-width: 220px;
  max-width: 360px;
}
.ai-governance-table .ai-gap-handled {
  display: block;
  margin-top: 4px;
}
.ai-expiry-expiring {
  color: #92400e;
}
.ai-expiry-expired {
  color: #991b1b;
}
.ai-preview-text {
  display: inline-block;
  max-width: 100%;
  color: #273244;
}
.ai-gap-status {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 3px 8px;
  color: #7a4b00;
  background: #fff4d6;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
.ai-gap-status.resolved {
  color: #166534;
  background: #dcfce7;
}
.ai-gap-status.rejected {
  color: #991b1b;
  background: #fee2e2;
}
.ai-gap-status.ignored {
  color: #4b5563;
  background: #e5e7eb;
}
.ai-run-status {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 3px 8px;
  color: #166534;
  background: #dcfce7;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
.ai-run-status.failed {
  color: #991b1b;
  background: #fee2e2;
}
.ai-run-status.fallback {
  color: #92400e;
  background: #fef3c7;
}
.ai-run-status.retry,
.ai-run-status.truncated {
  color: #1d4ed8;
  background: #dbeafe;
}
.ai-gap-handled {
  display: block;
  margin-top: 5px;
  color: #6b7280;
  font-size: 12px;
  line-height: 1.4;
  white-space: normal;
}
.ai-gap-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.ai-gap-actions .mini-btn {
  min-width: 58px;
  min-height: 30px;
  font-size: 12px;
  font-weight: 700;
}
.ai-gap-actions .mini-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.ai-document-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.42);
}
.ai-document-modal[hidden] {
  display: none;
}
.ai-document-card {
  width: min(760px, 100%);
  max-height: min(820px, calc(100vh - 48px));
  display: grid;
  gap: 16px;
  overflow: auto;
  box-sizing: border-box;
  padding: 20px;
  border-radius: 8px;
  border: 1px solid #d9e3ee;
  background: #fff;
  box-shadow: 0 22px 60px rgba(15, 23, 42, 0.22);
}
.ai-document-head,
.ai-document-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.ai-document-head h3 {
  margin: 0 0 4px;
  font-size: 18px;
  color: #172033;
}
.ai-document-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(160px, 0.75fr) minmax(160px, 0.75fr);
  gap: 12px;
}
.ai-document-card label {
  display: grid;
  gap: 6px;
  min-width: 0;
  color: #4b5563;
  font-size: 13px;
  font-weight: 700;
}
.ai-document-card input,
.ai-document-card select,
.ai-document-card textarea {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  border: 1px solid #d8e1eb;
  border-radius: 7px;
  padding: 10px 11px;
  color: #172033;
  background: #fff;
  font: inherit;
  font-weight: 500;
}
.ai-document-card textarea {
  min-height: 260px;
  resize: vertical;
  line-height: 1.6;
}

.document-detail-card .document-ai-toggle,
.ai-document-card .document-ai-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  color: #273244;
}

.document-detail-card .document-ai-toggle input,
.ai-document-card .document-ai-toggle input {
  width: auto;
  min-width: 16px;
  margin: 0;
}

.document-detail-card .document-ai-toggle input:disabled,
.ai-document-card .document-ai-toggle input:disabled {
  opacity: 0.65;
}

.document-source-note {
  border: 1px solid #d8e1eb;
  border-radius: 7px;
  padding: 10px 11px;
  color: #4b5563;
  background: #f8fafc;
  font-size: 13px;
  line-height: 1.5;
}

.ai-document-actions {
  justify-content: flex-end;
}

@media (max-width: 720px) {
  .ai-document-modal {
    align-items: stretch;
    padding: 12px;
  }
  .ai-document-card {
    max-height: calc(100vh - 24px);
  }
  .ai-document-head,
  .ai-document-actions {
    align-items: stretch;
    flex-direction: column;
  }
  .ai-document-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 980px) {
  .approval-delegation-layout {
    grid-template-columns: 1fr;
  }

  .approval-delegation-editor {
    max-height: none;
    border-top: 1px solid var(--line);
    border-left: 0;
    padding-top: 14px;
    padding-left: 0;
  }

  .approval-delegation-list {
    max-height: 320px;
  }
}

@media (max-width: 640px) {
  .approval-delegation-head,
  .approval-delegation-actions {
    align-items: stretch;
    flex-direction: column;
  }

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

  .approval-delegation-reason,
  .approval-delegation-form .workflow-toggle {
    grid-column: auto;
  }
}

.salary-page {
  display: grid;
  gap: 16px;
}

.salary-content {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.salary-toolbar,
.salary-filters {
  display: grid;
  gap: 10px;
}

.salary-toolbar-main,
.salary-filters {
  display: flex;
  align-items: end;
  flex-wrap: wrap;
  gap: 10px;
}

.salary-toolbar-main > button {
  align-self: flex-end;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 38px;
  min-height: 38px;
  white-space: nowrap;
}

.salary-toolbar label,
.salary-filters label {
  display: grid;
  gap: 5px;
  margin: 0;
  min-width: 150px;
  color: #5f6b7a;
  font-size: 12px;
  font-weight: 700;
}

.salary-toolbar input,
.salary-toolbar select,
.salary-filters input,
.salary-filters select {
  height: 38px;
  min-height: 38px;
  box-sizing: border-box;
  border: 1px solid #d8e1eb;
  border-radius: 7px;
  padding: 0 10px;
  color: #172033;
  background: #fff;
  font: inherit;
}

.salary-template-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  color: #64748b;
  font-size: 12px;
}

.salary-template-line strong,
.salary-template-line span,
.salary-template-line em {
  padding: 4px 8px;
  border-radius: 999px;
  background: #f1f5f9;
  font-style: normal;
}

.salary-metrics {
  display: grid;
  grid-template-columns: repeat(5, minmax(150px, 1fr));
  gap: 10px;
}

.salary-metric {
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 12px;
  border: 1px solid #d8e1eb;
  border-radius: 8px;
  background: #f8fafc;
}

.salary-metric span,
.salary-metric small {
  color: #64748b;
  font-size: 12px;
}

.salary-metric strong {
  color: #172033;
  font-size: 18px;
}

.salary-rule-toggle {
  min-width: auto;
  grid-template-columns: auto 1fr;
  align-items: center;
  height: 38px;
  padding: 0 10px;
  border: 1px solid #d8e1eb;
  border-radius: 7px;
  background: #fff;
}

.salary-rule-toggle input {
  width: 16px;
  height: 16px;
  padding: 0;
}

.salary-rule-input {
  width: 110px;
}

.salary-table-wrap {
  overflow: auto;
  max-height: calc(100vh - 310px);
  border: 1px solid #d8e1eb;
  border-radius: 8px;
  background: #fff;
}

.salary-table {
  width: max-content;
  min-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 12px;
}

.salary-table th,
.salary-table td {
  min-width: 92px;
  max-width: 120px;
  padding: 8px;
  border-bottom: 1px solid #e5edf5;
  border-right: 1px solid #edf2f7;
  text-align: right;
  white-space: nowrap;
  vertical-align: middle;
}

.salary-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  color: #334155;
  background: #f1f5f9;
  font-weight: 800;
}

.salary-table .salary-person-col {
  position: sticky;
  left: 0;
  z-index: 3;
  min-width: 230px;
  max-width: 260px;
  text-align: left;
  background: #fff;
  box-shadow: 1px 0 0 #e5edf5;
}

.salary-table th.salary-person-col {
  background: #f1f5f9;
}

.salary-person-col strong,
.salary-person-col span,
.salary-person-col small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
}

.salary-person-col span,
.salary-person-col small {
  color: #64748b;
  line-height: 1.4;
}

.salary-cell-input {
  width: 86px;
  height: 30px;
  box-sizing: border-box;
  border: 1px solid #d8e1eb;
  border-radius: 6px;
  padding: 0 6px;
  text-align: right;
  color: #172033;
  background: #fff;
  font: inherit;
}

.salary-cell-input:disabled {
  color: #64748b;
  background: #f8fafc;
}

.salary-net {
  color: #0f766e;
  font-weight: 800;
}

@media (max-width: 980px) {
  .salary-metrics {
    grid-template-columns: repeat(2, minmax(140px, 1fr));
  }
  .salary-table-wrap {
    max-height: calc(100vh - 360px);
  }
}

@media (max-width: 640px) {
  .knowledge-ai-form {
    grid-template-columns: 1fr;
  }
  .knowledge-ai-result-head {
    align-items: flex-start;
    flex-direction: column;
  }
  .salary-toolbar-main,
  .salary-filters {
    align-items: stretch;
    flex-direction: column;
  }
  .salary-toolbar label,
  .salary-filters label,
  .salary-toolbar button,
  .salary-filters input,
  .salary-filters select {
    width: 100%;
  }
  .salary-metrics {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 780px) {
  .org-chart {
    padding: 11px;
  }

  .org-directory-head {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
  }

  .org-directory-search {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .org-directory-search input {
    max-width: none;
  }

  .org-directory-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .org-tree-pane {
    max-height: 320px;
  }

  .org-detail-pane {
    padding: 13px;
  }

  .org-unit-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .org-child-grid,
  .org-member-grid {
    grid-template-columns: minmax(0, 1fr);
  }

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

  .contact-summary article:nth-child(2) {
    border-right: 0;
  }

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

  .contact-filter-bar,
  .contact-governance-head {
    align-items: stretch;
    flex-direction: column;
  }

  .contact-filter-bar > span,
  .contact-governance-head p {
    text-align: left;
  }

  .contact-governance-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .contact-review-list > div {
    grid-template-columns: 1fr;
  }

  .contact-review-list > div > span {
    justify-self: start;
  }

  .contact-review-list small {
    white-space: normal;
  }

  .contact-review-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .contact-review-actions input {
    flex-basis: auto;
    min-width: 0;
    width: 100%;
  }
}

@media (max-width: 520px) {
  .org-unit-header {
    align-items: stretch;
    flex-direction: column;
  }

  .org-unit-header .org-edit-btn {
    align-self: flex-start;
  }

  .org-unit-actions {
    align-items: stretch;
    flex-direction: column;
  }
}

/* 招聘管理 / 绩效管理 */
.hr-management-page {
  display: grid;
  gap: 18px;
}

.hr-management-head {
  align-items: flex-start;
  gap: 16px;
}

.hr-management-head .eyebrow {
  margin: 0 0 5px;
}

.hr-management-head h2 {
  margin: 0 0 7px;
}

.hr-management-actions,
.hr-management-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.hr-management-actions {
  justify-content: flex-end;
}

.hr-management-toolbar {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f8fbfd;
}

.hr-management-toolbar .search {
  min-width: 168px;
}

.hr-management-toolbar input.search {
  flex: 1 1 320px;
}

.hr-management-content {
  display: grid;
  gap: 16px;
}

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

.hr-metric-grid article {
  display: grid;
  min-width: 0;
  gap: 5px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.hr-metric-grid article.attention {
  border-color: #e7b2ac;
  background: #fff8f7;
}

.hr-metric-grid span,
.hr-metric-grid small {
  color: var(--muted);
}

.hr-metric-grid span {
  font-size: 13px;
  font-weight: 700;
}

.hr-metric-grid strong {
  color: var(--text);
  font-size: 27px;
  line-height: 1.1;
}

.hr-metric-grid article.attention strong {
  color: #a23d36;
}

.hr-metric-grid small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}

.hr-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

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

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

.hr-table th {
  color: var(--muted);
  background: #f6f9fb;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.hr-table tbody tr:last-child td {
  border-bottom: 0;
}

.hr-table tbody tr:hover td {
  background: #fbfdff;
}

.hr-table tbody tr.attention td {
  background: #fffaf8;
}

.hr-table td > strong,
.hr-table td > span,
.hr-table td > small {
  display: block;
}

.hr-table td > strong {
  margin-bottom: 4px;
  color: var(--text);
  font-size: 14px;
}

.hr-table td > small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.hr-status {
  display: inline-flex !important;
  width: fit-content;
  min-height: 26px;
  align-items: center;
  padding: 4px 9px;
  border-radius: 999px;
  background: #eef3f7;
  color: #52616d;
  font-size: 12px;
  font-weight: 700;
}

.hr-status.pending {
  background: #fff4dc;
  color: #8a5a00;
}

.hr-status.approved {
  background: #e7f6ee;
  color: #20734a;
}

.hr-status.rejected,
.hr-status.voided {
  background: #fdecea;
  color: #9a382f;
}

.hr-approval-links {
  display: grid;
  justify-items: start;
  gap: 5px;
}

.hr-approval-links .text-btn {
  max-width: 210px;
  overflow: hidden;
  padding: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

@media (max-width: 760px) {
  .hr-management-head {
    align-items: stretch;
    flex-direction: column;
  }

  .hr-management-actions,
  .hr-management-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .hr-management-actions button,
  .hr-management-toolbar .search {
    width: 100%;
  }

  .hr-management-toolbar .search {
    min-width: 0;
    max-width: none;
  }

  .hr-management-toolbar input.search {
    flex: 0 0 auto;
  }

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

  .hr-metric-grid article:last-child {
    grid-column: 1 / -1;
  }

  .hr-table-wrap {
    overflow: visible;
    border: 0;
    background: transparent;
  }

  .hr-table {
    display: block;
    min-width: 0;
  }

  .hr-table thead {
    display: none;
  }

  .hr-table tbody {
    display: grid;
    gap: 12px;
  }

  .hr-table tr {
    display: grid;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
  }

  .hr-table th,
  .hr-table td {
    display: grid;
    grid-template-columns: 96px minmax(0, 1fr);
    gap: 10px;
    align-items: start;
    padding: 9px 0;
    border-bottom: 1px dashed var(--line);
  }

  .hr-table td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
  }

  .hr-table td:last-child {
    border-bottom: 0;
  }

  .hr-table td > * {
    grid-column: 2;
  }

  .hr-table td > strong,
  .hr-table td > span {
    margin: 0;
  }

  .hr-table td > small {
    margin-top: 3px;
  }

  .hr-approval-links {
    grid-column: 2;
  }
}

@media (max-width: 460px) {
  .hr-metric-grid {
    grid-template-columns: 1fr;
  }

  .hr-metric-grid article:last-child {
    grid-column: auto;
  }
}
