:root {
  --bg: #f6f8fb;
  --surface: #ffffff;
  --surface-strong: #eef3f8;
  --text: #17202a;
  --muted: #667586;
  --line: #dde5ee;
  --primary: #146c94;
  --primary-dark: #0d4f72;
  --primary-soft: #e9f1ff;
  --primary-muted: #eef7fb;
  --accent: #c77d2d;
  --brand-start: #e6a548;
  --brand-end: #62a9c7;
  --success: #16845b;
  --danger: #b42318;
  --shadow: 0 14px 32px rgba(36, 48, 66, 0.08);
  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;
}

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 {
  min-height: 42px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #536273;
  text-align: center;
  padding: 0 12px;
}

.nav-item:hover,
.nav-item.active {
  background: var(--primary-soft);
  color: var(--primary);
}

.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-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);
}

.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-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 {
  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-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-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-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-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;
}

.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-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-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);
}

#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-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;
}

.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);
}

.special-form {
  display: grid;
  gap: 0;
  max-width: 820px;
}

.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;
}

.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;
}

.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-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;
}

.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;
}

.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;
}

.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;
}

.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;
  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;
}

.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;
}

.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-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;
  margin-bottom: 14px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f6f8fb;
}

.system-tabs button {
  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;
}

.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: calc(100vh - 290px);
  overflow: auto;
  padding-right: 4px;
}

.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;
}

.workflow-management-panel {
  margin-top: 0;
}

.workflow-toolbar {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

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

.workflow-template-list {
  display: grid;
  gap: 8px;
  max-height: calc(100vh - 280px);
  overflow: auto;
  padding-right: 4px;
}

.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 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.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"] {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 10px;
  color: var(--text);
}

.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;
}

.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 label {
  display: flex;
  gap: 5px;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
}

.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-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.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-messages {
  display: grid;
  gap: 10px;
  min-height: 340px;
  max-height: 440px;
  overflow: auto;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f9fbfd;
}

.message {
  max-width: 82%;
  padding: 11px 12px;
  border-radius: 8px;
  line-height: 1.55;
}

.message.user {
  justify-self: end;
  background: var(--primary);
  color: #fff;
}

.message.ai {
  justify-self: start;
  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;
}

.message-text {
  white-space: pre-wrap;
}

.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 {
  margin-top: 12px;
}

.ai-form input {
  flex: 1;
}

.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,
.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: hidden;
  }

  .brand,
  .sidebar-footer {
    display: none;
  }

  .nav {
    display: flex;
    overflow-x: auto;
    width: 100%;
    min-width: 0;
  }

  .nav-item {
    flex: 0 0 auto;
    min-width: 86px;
    text-align: center;
  }

  .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;
  }

  .asset-overview-grid,
  .asset-inventory-summary,
  .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));
  }

  .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;
  }

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

  .employee-overview-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .main {
    padding: 16px;
  }

  .topbar,
  .panel-header {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar-actions,
  .segmented,
  .ai-form,
  .item {
    align-items: stretch;
    flex-direction: column;
    display: flex;
  }

  .asset-overview-grid,
  .asset-inventory-summary,
  .asset-filters,
  .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,
  .approval-app-grid,
  .profile-fields,
  .template-grid,
  .form-grid,
  .system-layout,
  .account-permission-list,
  .account-role-grid,
  .automation-grid {
    grid-template-columns: 1fr;
  }

  .account-card-head {
    grid-template-columns: 1fr;
  }

  .role-catalog-panel {
    position: static;
    max-height: none;
  }

  .account-picker {
    max-height: 260px;
  }

  .account-detail-card {
    max-height: none;
  }

  .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,
  .checkbox-grid,
  .radio-grid {
    grid-template-columns: 1fr;
  }

  .request-ai-helper {
    align-items: stretch;
    flex-direction: column;
  }

  .request-ai-helper .ghost-btn {
    width: 100%;
  }

  .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 {
    grid-template-columns: 1fr;
  }

  .org-editor-head,
  .org-editor-actions {
    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 {
    grid-template-columns: 1fr;
  }

  .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; }
.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-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%; }
}

/* ===== 审计日志 ===== */
.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-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-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.ignored {
  color: #4b5563;
  background: #e5e7eb;
}
.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;
  }
}

.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) {
  .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;
  }
}
