:root {
  color-scheme: light;
  --bg: #f5f5f7;
  --panel: #ffffff;
  --panel-soft: #fafafc;
  --line: #e5e5ea;
  --line-strong: #d2d2d7;
  --text: #1d1d1f;
  --muted: #86868b;
  --accent: #0071e3;
  --accent-strong: #0077ed;
  --accent-soft: rgba(0, 113, 227, 0.08);
  --success: #34c759;
  --warning: #f59e0b;
  --danger: #ff3b30;
  --shadow: 0 10px 28px rgba(15, 23, 42, 0.035), 0 2px 8px rgba(15, 23, 42, 0.02);
  --card-shadow: 0 8px 22px rgba(15, 23, 42, 0.028), 0 2px 6px rgba(15, 23, 42, 0.018);
  --shadow-hover: 0 16px 40px rgba(15, 23, 42, 0.05), 0 6px 16px rgba(15, 23, 42, 0.03);
  --radius-xl: 24px;
  --radius-lg: 20px;
  --radius-md: 16px;
  --radius-sm: 8px;
}

/* Hide default scrollbars for webkit */
::-webkit-scrollbar {
  display: none;
}

/* Hide scrollbars for Firefox/IE */
* {
  box-sizing: border-box;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

html,
body {
  margin: 0;
  height: 100%;
  font-family: "SF Pro Display", -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

body {
  overflow: hidden;
}

button,
input,
table {
  font: inherit;
}

button {
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
}

.shell {
  display: flex;
  height: 100vh;
  padding: 24px;
  overflow: hidden;
  background: var(--bg);
  box-sizing: border-box;
}

.shell > * {
  height: 100%;
}

.sidebar,
.topbar,
.toolbar,
.panel,
.kpi-card,
.summary-card,
.detail-header {
  background: var(--panel);
  border-radius: var(--radius-xl);
  border: 1px solid var(--line);
  position: relative;
  overflow: visible;
}

.sidebar {
  box-shadow: var(--shadow);
}

.topbar,
.toolbar,
.panel,
.kpi-card,
.summary-card,
.detail-header {
  box-shadow: var(--card-shadow);
}

.sidebar {
  flex: 0 0 260px;
  width: 260px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 24px 16px;
  margin-right: 24px;
  z-index: 10;
  overflow-y: hidden;
  overflow-x: hidden;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, rgba(252, 252, 255, 0.94) 100%);
  transition: all 0.3s cubic-bezier(0.2, 0, 0, 1);
}

.sidebar-scroll-area {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  gap: 24px;
  scrollbar-width: none;
}
.sidebar-scroll-area::-webkit-scrollbar {
  display: none;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 10px 12px;
}

.brand-logo-wrap {
  width: 196px;
  overflow: hidden;
  transition: width 0.3s cubic-bezier(0.2, 0, 0, 1);
  flex-shrink: 0;
}

.brand-logo {
  display: block;
  height: 48px;
  width: auto;
  object-fit: cover;
  object-position: left;
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.sidebar-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  color: var(--muted);
  transition: all 0.2s ease;
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
}

.sidebar-toggle:hover {
  background: rgba(0, 0, 0, 0.04);
  color: var(--text);
}

.sidebar-toggle svg {
  flex-shrink: 0;
}

.nav-title {
  margin: 0 0 8px 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.nav-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.menu {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.shortcut-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  text-align: left;
  background: transparent;
  color: var(--text);
  font-weight: 500;
  font-size: 15px;
  border: 1px solid transparent;
  transition: all 0.22s ease;
}

.menu-item svg {
  opacity: 0.6;
  transition: opacity 0.2s ease;
}

.menu-item:hover svg {
  opacity: 0.8;
}

.menu-item.is-active svg {
  opacity: 1;
}

.menu-item span {
  display: block;
}

.menu-item:hover {
  background: rgba(0, 113, 227, 0.05);
  border-color: rgba(0, 113, 227, 0.08);
}

.menu-item.is-active {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
}

.menu-item.is-active svg {
  opacity: 1;
  color: #ffffff;
}

.shortcut-card {
  position: relative;
  width: 100%;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  text-align: left;
  background: linear-gradient(180deg, #ffffff 0%, #fbfbfd 100%);
  color: var(--text);
  border: 1px solid var(--line);
  transition: all 0.22s ease;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  overflow: hidden;
}

.shortcut-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(0, 113, 227, 0.08);
  color: var(--accent);
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.shortcut-card:hover .shortcut-icon {
  background: var(--accent);
  color: #ffffff;
}

.shortcut-content {
  flex: 1;
  min-width: 0;
}

.sidebar.is-collapsed {
  flex: 0 0 80px;
  width: 80px;
  padding: 24px 12px;
}

.sidebar.is-collapsed .brand {
  flex-direction: column;
  padding: 4px 0 12px;
}

.sidebar.is-collapsed .brand-logo-wrap {
  width: 48px;
  height: 48px;
  display: flex;
  justify-content: flex-start;
  margin-bottom: 12px;
}

.sidebar.is-collapsed .brand-logo {
  height: 48px;
}

.sidebar.is-collapsed .sidebar-toggle-text {
  display: none;
}

.sidebar.is-collapsed .sidebar-toggle {
  justify-content: center;
  padding: 12px;
}

.sidebar.is-collapsed .sidebar-toggle svg {
  transform: rotate(180deg);
}

.sidebar.is-collapsed .nav-title,
.sidebar.is-collapsed .menu-text,
.sidebar.is-collapsed .shortcut-content {
  display: none;
}

.sidebar.is-collapsed .menu-item {
  justify-content: center;
  padding: 12px;
}

.sidebar.is-collapsed .menu-item svg {
  margin: 0;
}

.sidebar.is-collapsed .shortcut-card {
  padding: 12px;
  display: flex;
  justify-content: center;
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}

.sidebar.is-collapsed .shortcut-icon {
  margin: 0;
  width: 40px;
  height: 40px;
}

.sidebar.is-collapsed .shortcut-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
}

.shortcut-card::after {
  content: "";
  position: absolute;
  inset: -26px -10px auto auto;
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 113, 227, 0.12) 0%, rgba(0, 113, 227, 0) 72%);
  pointer-events: none;
}

.shortcut-card:hover {
  background: var(--panel);
  border-color: var(--accent);
  box-shadow: 0 10px 24px rgba(0, 113, 227, 0.1);
  transform: translateY(-1px);
}

.shortcut-card:hover strong {
  color: var(--accent);
}

.shortcut-card strong {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 4px;
}

.shortcut-card p {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}

.workspace {
  flex: 1;
  min-width: 0;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 0 24px 0 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  scrollbar-width: thin;
  scrollbar-color: rgba(134, 134, 139, 0.45) transparent;
  position: relative;
  isolation: isolate;
}

.workspace::-webkit-scrollbar {
  display: block;
  width: 10px;
}

.workspace::-webkit-scrollbar-track {
  background: transparent;
}

.workspace::-webkit-scrollbar-thumb {
  background: rgba(134, 134, 139, 0.32);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

.workspace::-webkit-scrollbar-thumb:hover {
  background: rgba(134, 134, 139, 0.48);
}

.workspace::before,
.workspace::after {
  content: "";
  position: absolute;
  right: 24px;
  z-index: 0;
  pointer-events: none;
  border-radius: 50%;
  filter: blur(10px);
  opacity: 0.45;
}

.workspace::before {
  top: 32px;
  width: 220px;
  height: 220px;
  background: radial-gradient(circle, rgba(0, 113, 227, 0.08) 0%, rgba(0, 113, 227, 0) 72%);
}

.workspace::after {
  top: 220px;
  width: 180px;
  height: 180px;
  background: radial-gradient(circle, rgba(90, 200, 250, 0.08) 0%, rgba(90, 200, 250, 0) 72%);
}

.workspace > * {
  position: relative;
  z-index: 1;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  min-height: 112px;
  padding: 32px 28px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(250, 251, 255, 0.96) 100%);
  flex-wrap: nowrap;
  overflow: visible;
}

.page-meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 0 0 auto;
  min-width: max-content;
}

.page-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  padding: 6px 10px;
  background: linear-gradient(180deg, rgba(0, 113, 227, 0.12) 0%, rgba(0, 113, 227, 0.08) 100%);
  color: var(--accent);
  border-radius: 999px;
  border: 1px solid rgba(0, 113, 227, 0.1);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 2px;
}

.page-heading {
  margin: 0;
  font-size: 28px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.page-subheading {
  margin: 0;
  max-width: 620px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.topbar-actions,
.toolbar-filters,
.badge-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.topbar-actions {
  min-width: 0;
  flex: 1 1 auto;
  justify-content: flex-end;
  flex-wrap: nowrap;
  overflow: hidden;
}

.search {
  flex: 0 1 320px;
  width: 320px;
  min-width: 0;
  max-width: 320px;
  height: 40px;
  gap: 10px;
  border-radius: 999px;
  background: linear-gradient(180deg, #fbfbfd 0%, #f3f4f6 100%);
  border: 1px solid rgba(0, 0, 0, 0.04);
  color: var(--muted);
  font-size: 14px;
  display: flex;
  align-items: center;
  padding: 0 16px;
  transition: all 0.2s ease;
  cursor: text;
}

.search-icon {
  color: var(--accent);
  opacity: 0.82;
  flex-shrink: 0;
}

.search-input {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  outline: none;
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  padding: 0;
}

.search-input::placeholder {
  color: var(--muted);
}

.search:focus-within {
  background: #ffffff;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.1);
  color: var(--text);
}

.ghost-button,
.primary-button,
.tab-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.2s ease;
}

.primary-button {
  background: linear-gradient(180deg, #1485ff 0%, var(--accent) 100%);
  color: #ffffff;
  box-shadow: 0 8px 18px rgba(0, 113, 227, 0.22);
}

.primary-button:hover {
  background: var(--accent-strong);
  transform: translateY(-1px);
  box-shadow: 0 12px 22px rgba(0, 113, 227, 0.28);
}

.primary-button:active {
  transform: translateY(0);
}

.ghost-button {
  background: linear-gradient(180deg, #ffffff 0%, #fafafc 100%);
  color: var(--text);
  border: 1px solid var(--line);
}

.ghost-button:hover {
  background: var(--panel-soft);
  border-color: var(--line-strong);
}

.ghost-button:active {
  transform: translateY(0);
}

.tab-chip {
  position: relative;
  min-height: 36px;
  padding: 8px 16px;
  background: transparent;
  color: var(--muted);
  font-weight: 500;
  font-size: 14px;
  border-radius: 999px;
  transition: all 0.2s ease;
  flex: 0 0 auto;
  white-space: nowrap;
}

.tab-chip.is-active {
  color: var(--accent);
  background: linear-gradient(180deg, rgba(0, 113, 227, 0.12) 0%, rgba(0, 113, 227, 0.08) 100%);
  font-weight: 600;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

.tab-chip:hover:not(.is-active) {
  background: rgba(255, 255, 255, 0.7);
  color: var(--text);
}

.profile-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px 6px 6px;
  border-radius: 999px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfbfd 100%);
  border: 1px solid rgba(0, 0, 0, 0.04);
  transition: all 0.2s ease;
  cursor: pointer;
  flex: 0 0 auto;
  min-width: 0;
}

.profile-pill:hover {
  border-color: rgba(0, 113, 227, 0.12);
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.06);
}

.profile-pill strong {
  display: block;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-pill small {
  display: block;
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-pill > div:last-child {
  min-width: 0;
  overflow: hidden;
}

.avatar {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2d8cff 0%, #63b3ff 100%);
  color: #ffffff;
  font-size: 14px;
  font-weight: 600;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.avatar.large {
  width: 72px;
  height: 72px;
  font-size: 28px;
}

.avatar.tiny {
  width: 28px;
  height: 28px;
  font-size: 11px;
  background: linear-gradient(135deg, var(--accent), #5ac8fa);
  color: white;
  border: 2px solid white;
  box-shadow: 0 2px 8px rgba(0, 113, 227, 0.2);
}

.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  min-height: 76px;
  padding: 20px 28px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.97) 0%, rgba(250, 251, 255, 0.94) 100%);
  flex-wrap: nowrap;
  overflow: visible;
}

.toolbar-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  background: linear-gradient(180deg, #f8f8fa 0%, #f2f3f5 100%);
  padding: 4px;
  border-radius: 999px;
  border: 1px solid rgba(0, 0, 0, 0.04);
  flex: 0 0 auto;
  min-width: max-content;
  white-space: nowrap;
}

.toolbar-filters {
  min-width: 0;
  flex: 1 1 auto;
  justify-content: flex-end;
  flex-wrap: nowrap;
  overflow: visible;
}

.toolbar-filters > * {
  flex: 0 0 auto;
}

.filter-pill,
.soft-badge,
.status-pill,
.priority {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.filter-pill,
.soft-badge {
  background: linear-gradient(180deg, #f7f9fc 0%, #f0f4f8 100%);
  color: #50657a;
  border: 1px solid rgba(80, 101, 122, 0.08);
}

.page {
  display: none;
  flex-direction: column;
  gap: 24px;
  padding: 0;
  min-width: 0;
}

.page.is-visible {
  display: flex;
  flex: 1;
}

.page > *:last-child {
  flex: 1;
}

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

.dashboard-focus {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(300px, 0.95fr);
  gap: 20px;
  min-height: 236px;
  padding: 28px;
  border-radius: 30px;
  border: 1px solid rgba(0, 113, 227, 0.08);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.94) 0%, rgba(246, 250, 255, 0.94) 44%, rgba(241, 247, 255, 0.98) 100%);
  box-shadow: 0 18px 44px rgba(15, 23, 42, 0.05), inset 0 1px 0 rgba(255, 255, 255, 0.78);
  position: relative;
  overflow: hidden;
}

.dashboard-focus::before {
  content: "";
  position: absolute;
  right: -90px;
  top: -90px;
  width: 240px;
  height: 240px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 113, 227, 0.16) 0%, rgba(0, 113, 227, 0) 72%);
  pointer-events: none;
}

.dashboard-focus-copy,
.dashboard-focus-metrics {
  position: relative;
  z-index: 1;
}

.dashboard-focus-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 14px;
}

.focus-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(0, 113, 227, 0.1);
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.focus-kicker::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 6px rgba(0, 113, 227, 0.08);
}

.dashboard-focus h2 {
  margin: 0;
  max-width: 720px;
  font-size: 34px;
  line-height: 1.15;
  letter-spacing: -0.04em;
}

.dashboard-focus p {
  margin: 0;
  max-width: 720px;
  color: #4f5664;
  font-size: 15px;
  line-height: 1.7;
}

.focus-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.focus-badge {
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(0, 113, 227, 0.08);
  color: #445468;
  font-size: 12px;
  font-weight: 600;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

.dashboard-focus-metrics {
  display: grid;
  gap: 14px;
}

.focus-metric-card {
  padding: 20px 20px 18px;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.84);
  border: 1px solid rgba(0, 113, 227, 0.08);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.04);
}

.focus-metric-card span {
  display: inline-block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.focus-metric-card strong {
  display: block;
  margin: 10px 0 8px;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text);
}

.focus-metric-card small {
  display: block;
  color: #5f6673;
  font-size: 12px;
  line-height: 1.55;
}

.employee-summary-grid .summary-card {
  padding: 18px 20px;
  background: linear-gradient(180deg, #ffffff 0%, #f9fafc 100%);
}

.employee-summary-grid .summary-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.employee-summary-grid .summary-card strong {
  margin: 10px 0 0;
  font-size: 22px;
  font-weight: 650;
  line-height: 1.25;
  letter-spacing: -0.02em;
  word-break: break-word;
}

.kpi-card,
.summary-card {
  padding: 16px 20px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, #ffffff 0%, #fbfbfd 100%);
}

.summary-card::before {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, rgba(0, 113, 227, 0.82) 0%, rgba(90, 200, 250, 0.42) 100%);
  opacity: 0.82;
}

.kpi-card {
  border-color: rgba(0, 113, 227, 0.08);
  background:
    radial-gradient(circle at 85% 18%, rgba(0, 113, 227, 0.08) 0%, rgba(0, 113, 227, 0.02) 22%, rgba(0, 113, 227, 0) 48%),
    radial-gradient(circle at 12% 100%, rgba(90, 200, 250, 0.05) 0%, rgba(90, 200, 250, 0) 40%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.99) 0%, rgba(249, 251, 255, 0.98) 44%, rgba(244, 248, 255, 0.99) 100%);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.035), inset 0 1px 0 rgba(255, 255, 255, 0.92);
}

.kpi-card::before,
.summary-card::before {
  content: "";
  position: absolute;
  pointer-events: none;
}

.kpi-card::before {
  top: -36px;
  right: -28px;
  width: 168px;
  height: 168px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.78) 0%, rgba(255, 255, 255, 0.05) 42%, rgba(255, 255, 255, 0) 72%);
  opacity: 0.9;
}

.kpi-card::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.94);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.32) 0%, rgba(255, 255, 255, 0) 34%);
}

.kpi-card:hover,
.summary-card:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-hover);
}

.kpi-card:hover h3 {
  color: var(--accent);
}

.kpi-card:hover {
  border-color: rgba(0, 113, 227, 0.14);
  box-shadow: 0 16px 34px rgba(15, 23, 42, 0.045), 0 6px 16px rgba(0, 113, 227, 0.05);
}

#kpi-visible-count,
#org-kpi-top-count {
  color: var(--accent);
}

.kpi-card p,
.summary-card span,
.employee-title,
.event-item p,
.task-item p,
.stack-item p,
.timeline-card p {
  margin-top: 0;
  margin-bottom: 0;
  color: var(--muted);
}

.tree-node p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 14px;
}

.job-lane p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.kpi-card p,
.summary-card span,
.info-grid span,
.summary-strip span {
  font-size: 13px;
  font-weight: 500;
}

.kpi-card p,
.kpi-card small {
  color: #6b7888;
}

.kpi-card h3 {
  color: #24364d;
}

.kpi-card h3,
.summary-card strong {
  display: block;
  margin: 12px 0 4px;
  font-size: 34px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.04em;
  color: var(--text);
}

.kpi-card h3 {
  margin: 8px 0 0;
}

.kpi-card small,
.summary-card small {
  color: var(--muted);
  font-size: 12px;
}

.dashboard-grid,
.double-grid,
.org-layout,
.employee-layout {
  display: grid;
  gap: 20px;
  align-items: start;
}

.dashboard-grid {
  grid-template-columns: minmax(0, 1.7fr) 320px;
}

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

.org-layout {
  grid-template-columns: minmax(0, 1.45fr) 340px;
}

.employee-layout {
  grid-template-columns: 420px minmax(0, 1fr);
  grid-template-areas:
    "current timeline"
    "compliance timeline"
    "history archive";
}

.side-stack {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.employee-panel-current {
  grid-area: current;
}

.employee-panel-timeline {
  grid-area: timeline;
}

.employee-panel-compliance {
  grid-area: compliance;
}

.employee-panel-history {
  grid-area: history;
}

.employee-panel-archive {
  grid-area: archive;
}

.panel,
.detail-header {
  padding: 22px 24px;
  border-radius: var(--radius-xl);
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.94) 0%, rgba(250, 250, 252, 0.98) 100%);
}

.panel,
.double-grid > .panel,
.org-layout > .panel,
.employee-layout > .panel,
.dashboard-grid > .panel,
.dashboard-grid > .side-stack > .panel {
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

.emphasis-panel {
  background: var(--panel);
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
  min-height: 38px;
}

.panel-head h4 {
  position: relative;
  padding-left: 12px;
}

.panel-head h4::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 4px;
  height: 18px;
  border-radius: 999px;
  transform: translateY(-50%);
  background: var(--accent);
}

.panel-head.white-accent-line h4::before {
  background: #ffffff;
}

.panel h4,
.detail-header h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
}

.chart-area {
  display: block;
}

.chart-bars {
  --chart-height: 240px;
  position: relative;
  min-height: calc(var(--chart-height) + 36px);
  padding: 12px 16px 16px;
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, #fcfcfe 0%, #f6f8fb 100%);
  border: 1px solid var(--line);
}

.line-chart-svg {
  display: block;
  width: 100%;
  height: var(--chart-height);
}

.line-chart-area {
  fill: url(#lineAreaGradient);
}

.line-chart-stroke {
  fill: none;
  stroke: var(--accent);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.line-chart-dot {
  fill: #ffffff;
  stroke: var(--accent);
  stroke-width: 3;
}

.line-chart-value {
  fill: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.line-chart-name {
  fill: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

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

.summary-strip div {
  padding: 16px;
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, #fbfbfd 0%, #f7f7fa 100%);
  border: 1px solid var(--line);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.78);
}

.summary-strip strong {
  display: block;
  margin-top: 8px;
  font-size: 24px;
  font-weight: 700;
}

.task-list,
.stack-list,
.event-feed {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.job-lanes {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.task-item,
.stack-item,
.event-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  border-top: 1px solid var(--line);
}

.task-item:first-child,
.stack-item:first-child,
.event-item:first-child {
  border-top: 0;
  padding-top: 0;
}

[data-employee-select] {
  cursor: pointer;
  transition: background 0.2s ease;
}

tr[data-employee-select] {
  cursor: pointer;
}

div[data-employee-select] {
  padding: 12px 16px;
  margin: 0 -16px;
  border-radius: var(--radius-md);
  border-top: none;
}

div[data-employee-select]:hover {
  background: var(--bg);
}

.task-item strong,
.stack-item strong,
.event-item strong,
.timeline-card strong,
.tree-node strong {
  display: block;
  margin-bottom: 4px;
  font-size: 15px;
  font-weight: 600;
}

.priority.high,
.status-pill.danger {
  background: rgba(255, 59, 48, 0.1);
  color: var(--danger);
}

.priority.medium,
.status-pill.warning {
  background: rgba(245, 158, 11, 0.1);
  color: var(--warning);
}

.status-pill.success {
  background: rgba(52, 199, 89, 0.1);
  color: var(--success);
}

.status-pill.info {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.status-pill.pending {
  background: var(--line);
  color: var(--muted);
}

.table-wrap {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
}

.event-panel-body {
  flex: 1;
  display: flex;
}

.event-feed {
  flex: 1;
  justify-content: space-between;
}

.event-time {
  flex: 0 0 60px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}

.event-item > div {
  min-width: 0;
  flex: 1;
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  align-items: center;
  column-gap: 16px;
}

.event-item strong,
.event-item p {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

.data-table th,
.data-table td {
  padding: 16px 12px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
  height: 64px;
  vertical-align: middle;
}

.data-table thead th {
  color: var(--muted);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.01em;
  border-bottom: 2px solid var(--line);
}

.data-table tbody tr {
  transition: background 0.2s ease;
}

.data-table tbody tr:hover {
  background: rgba(0, 113, 227, 0.04);
}

.data-table tbody tr:hover td {
  color: var(--text);
}

.data-table tbody tr.is-selected {
  background: var(--accent-soft);
}

.compact-table {
  min-width: 0;
}

.text-button {
  padding: 8px 12px;
  border-radius: 999px;
  color: var(--accent);
  font-weight: 600;
  font-size: 13px;
  background: rgba(0, 113, 227, 0.06);
  transition: all 0.2s ease;
}

.text-button:hover {
  background: rgba(0, 113, 227, 0.1);
}

.panel-footer-action {
  display: flex;
  justify-content: center;
  padding-top: 18px;
}

.detail-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
}

.detail-header h2 {
  margin: 0 0 8px;
  font-size: 24px;
  letter-spacing: -0.02em;
}

.panel-subtitle,
.modal-subtitle {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.report-header {
  align-items: center;
}

.report-header-actions {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.report-date-select-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.report-select {
  min-width: 188px;
  height: 42px;
  padding: 0 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, #ffffff 0%, #f7f8fb 100%);
  color: var(--text);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.report-date-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}

.report-date-chip {
  position: relative;
  min-height: 36px;
  padding: 8px 16px;
  background: transparent;
  color: var(--muted);
  font-weight: 500;
  font-size: 14px;
  border-radius: 999px;
  transition: all 0.2s ease;
  flex: 0 0 auto;
  white-space: nowrap;
  border: 1px solid transparent;
}

.report-date-chip:hover:not(.is-active) {
  background: rgba(255, 255, 255, 0.7);
  color: var(--text);
}

.report-date-chip.is-active {
  color: var(--text);
  background: #ffffff;
  border-color: rgba(0,0,0,0.08);
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.report-top-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 640px);
  gap: 20px;
}

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

.report-summary-card {
  background: linear-gradient(180deg, #ffffff 0%, #f9fafd 100%);
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.report-summary-card strong {
  font-size: 28px;
  font-weight: 700;
  margin: 10px 0 6px;
  color: var(--text);
  letter-spacing: -0.01em;
}

.text-accent {
  color: var(--accent) !important;
}

.report-progress-panel {
  min-height: 100%;
}

.report-progress-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.report-progress-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  border-radius: 0;
  border-left: none;
  border-right: none;
  border-top: none;
}

.report-progress-item:last-child {
  border-bottom: none;
}

.report-progress-item strong {
  display: block;
  font-size: 14px;
  margin-bottom: 2px;
}

.report-progress-item p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.report-table-panel {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: auto;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
}

.report-table-panel .panel-head {
  margin-bottom: 0;
  padding: 20px 24px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}

.report-table-panel .panel-head h4 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}

.report-table-panel .panel-subtitle {
  color: var(--muted);
}

.report-table-wrap {
  flex: 1;
  overflow-y: auto;
  overflow-x: auto;
  background: var(--panel);
  padding: 16px 24px 24px;
}

.report-table {
  width: 100%;
  min-width: 1180px;
  background: transparent;
  border-collapse: separate;
  border-spacing: 0;
}

.report-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: linear-gradient(180deg, #1485ff 0%, var(--accent) 100%);
  color: #ffffff;
  font-size: 13px;
  font-weight: 600;
  padding: 14px 16px;
  border-bottom: none;
  border-right: none;
  white-space: nowrap;
  letter-spacing: 0.02em;
}

.report-table thead th:first-child {
  border-top-left-radius: 12px;
  border-bottom-left-radius: 12px;
  padding-left: 20px;
}

.report-table thead th:last-child {
  border-right: none;
  border-top-right-radius: 12px;
  border-bottom-right-radius: 12px;
  padding-right: 20px;
}

.report-table th,
.report-table td {
  height: auto;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  border-right: none;
  background: transparent;
  transition: background 0.2s ease;
}

.report-table td:last-child {
  border-right: none;
}

.report-table tbody tr:hover {
  background: transparent;
}

/* 1. 独立单元格悬停：鼠标放在“序号”或“单位”时，仅自身高亮 */
.report-table tbody td.report-seq-cell:hover,
.report-table tbody td.report-unit-cell:hover {
  background: var(--accent-soft);
  color: #000000;
  font-weight: 600;
}

.report-table tbody td.report-unit-cell:hover .report-unit-name,
.report-table tbody td.report-unit-cell:hover .report-unit-note {
  color: #000000;
  font-weight: 600;
}

/* 2. 数据行悬停：通过 JS 动态添加 .is-hovered 类来实现精准高亮，兼容所有浏览器 */
.report-table tbody tr.is-hovered td:not(.report-seq-cell):not(.report-unit-cell) {
  background: var(--accent-soft);
  color: #000000;
  font-weight: 600;
}

.report-seq-cell {
  width: 60px;
  text-align: center;
  color: var(--muted);
  font-weight: 500;
  font-size: 13px;
  background: transparent;
  white-space: nowrap;
}

.report-unit-cell {
  min-width: 160px;
  vertical-align: top;
  background: transparent;
}

.report-row-emphasis .report-unit-cell {
  background: transparent;
}

.report-unit-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  line-height: 1.4;
}

.report-unit-note {
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
}

.report-category-cell {
  min-width: 120px;
  color: var(--text);
  font-weight: 400;
  font-size: 14px;
  background: transparent;
}

.report-project-cell {
  min-width: 180px;
  font-weight: 400;
  color: var(--text);
  font-size: 14px;
}

.report-value-cell {
  min-width: 110px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  font-weight: 400;
  color: var(--text);
  font-size: 14px;
  text-align: right;
}

.report-note-cell {
  min-width: 180px;
  max-width: 240px;
  line-height: 1.5;
  color: var(--muted);
  font-size: 13px;
}

.report-row-emphasis td {
  background: var(--panel-soft);
}

.report-row-emphasis .report-project-cell {
  color: var(--text);
  font-weight: 500;
}

.report-row-emphasis .report-value-cell {
  color: var(--text);
  font-weight: 500;
}

.report-table tbody tr.report-total-row td {
  padding: 18px 20px;
  background: linear-gradient(180deg, #1485ff 0%, var(--accent) 100%);
  border-top: none;
  border-bottom: none;
  color: #ffffff;
}

.report-table tbody tr.report-total-row td:first-child {
  border-top-left-radius: 12px;
  border-bottom-left-radius: 12px;
}

.report-table tbody tr.report-total-row td:last-child {
  border-top-right-radius: 12px;
  border-bottom-right-radius: 12px;
}

.report-table tbody tr.report-total-row:hover td {
  background: var(--accent-strong);
}

.report-total-row .report-seq-cell {
  background: transparent;
  color: rgba(255, 255, 255, 0.9);
}

.report-total-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.report-total-title strong {
  font-size: 14px;
  font-weight: 600;
  color: #ffffff;
}

.report-total-title span {
  color: rgba(255, 255, 255, 0.8);
  font-size: 13px;
  padding-left: 8px;
  border-left: 1px solid rgba(255, 255, 255, 0.3);
}

.report-total-value {
  font-size: 15px;
  font-weight: 600;
  color: #ffffff;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.report-total-row .report-note-cell {
  color: rgba(255, 255, 255, 0.8);
}

.employee-core,
.employee-actions,
.panel-actions,
.status-inline {
  display: flex;
  align-items: center;
  gap: 16px;
}

.badge-row {
  margin-top: 10px;
}

.timeline {
  position: relative;
  padding-left: 28px;
}

.timeline::before {
  content: "";
  position: absolute;
  top: 12px;
  left: 39px;
  width: 2px;
  height: calc(100% - 24px);
  background: var(--line);
  border-radius: 999px;
}

.timeline-item {
  position: relative;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 20px;
  margin-bottom: 24px;
}

.timeline-dot {
  position: relative;
  z-index: 1;
  width: 12px;
  height: 12px;
  margin-top: 18px;
  margin-left: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--panel);
}

.timeline-card,
.tree-node {
  padding: 16px 20px;
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, #fcfcfe 0%, #f7f8fb 100%);
  border: 1px solid var(--line);
}

.tree-node.level-1 {
  padding: 20px;
  background: linear-gradient(180deg, #ffffff 0%, #fafbfe 100%);
}

.job-lane {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, #fcfcfe 0%, #f7f8fb 100%);
  border: 1px solid var(--line);
}

.insight-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--accent);
}

.insight-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.08);
}

.insight-value {
  font-weight: 600;
  color: var(--text);
}

.org-stat-card {
  position: relative;
  padding: 18px;
  border-radius: 18px;
  background: linear-gradient(180deg, #ffffff 0%, #f7f9fc 100%);
  border: 1px solid rgba(210, 210, 215, 0.9);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
}

.org-stat-card::after {
  content: "";
  position: absolute;
  top: 14px;
  right: 14px;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 113, 227, 0.12) 0%, rgba(0, 113, 227, 0) 72%);
  pointer-events: none;
}

.org-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.org-card-badge {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(0, 113, 227, 0.08);
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.org-card-count {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.org-card-name {
  display: block;
  margin: 0 0 8px;
  font-size: 17px;
  font-weight: 650;
  line-height: 1.3;
  letter-spacing: -0.01em;
  color: var(--text);
}

.org-card-note {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

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

.cell-secondary {
  color: var(--muted);
}

.cell-nowrap {
  white-space: nowrap;
}

.cell-truncate {
  color: var(--muted);
  max-width: 220px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mono-text {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

/* Modals */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.modal-overlay.is-visible {
  opacity: 1;
  visibility: visible;
}

.modal-container {
  background: rgba(255, 255, 255, 0.92);
  width: 90%;
  max-width: 480px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: 0 24px 64px rgba(15, 23, 42, 0.18);
  backdrop-filter: blur(24px) saturate(160%);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  display: none;
  flex-direction: column;
  transform: scale(0.95) translateY(10px);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

.modal-container.modal-wide {
  max-width: 980px;
}

.modal-container.modal-form {
  max-width: 760px;
}

.modal-overlay.is-visible .modal-container.is-active {
  display: flex;
  transform: scale(1) translateY(0);
}

.modal-header {
  padding: 22px 24px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-form .modal-header {
  align-items: flex-start;
}

.modal-header h3 {
  font-size: 21px;
  font-weight: 600;
  margin: 0;
  letter-spacing: -0.02em;
}

.modal-title-accent {
  color: var(--accent);
}

.modal-title-danger {
  color: var(--danger);
}

.close-btn {
  background: var(--panel-soft);
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--muted);
  transition: all 0.2s ease;
}

.close-btn:hover {
  background: var(--line);
  color: var(--text);
}

.modal-body {
  padding: 0 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.modal-form .modal-body {
  max-height: min(68vh, 820px);
  overflow: auto;
  padding-bottom: 2px;
}

.modal-body-rich {
  gap: 18px;
}

.modal-table-wrap {
  max-height: 60vh;
  overflow: auto;
}

.modal-hero {
  padding: 18px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(0, 113, 227, 0.12) 0%, rgba(0, 113, 227, 0.05) 100%);
  border: 1px solid rgba(0, 113, 227, 0.12);
}

.modal-hero.modal-hero-accent {
  background: linear-gradient(180deg, rgba(0, 113, 227, 0.14) 0%, rgba(90, 200, 250, 0.05) 100%);
}

.modal-hero.modal-hero-danger {
  background: linear-gradient(180deg, rgba(255, 59, 48, 0.12) 0%, rgba(255, 149, 0, 0.04) 100%);
  border-color: rgba(255, 59, 48, 0.14);
}

.modal-kicker {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

.modal-step-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.modal-step {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.modal-step.is-active {
  background: rgba(255, 255, 255, 0.92);
  color: var(--text);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
}

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

.modal-metric,
.modal-mini-card {
  padding: 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.72);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

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

.modal-metric strong {
  display: block;
  margin-top: 8px;
  color: var(--text);
  font-size: 15px;
  font-weight: 650;
  line-height: 1.35;
}

.modal-section-title {
  margin: 0 0 14px;
  font-size: 15px;
  font-weight: 650;
  color: var(--text);
  letter-spacing: -0.01em;
}

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

.modal-mini-card strong {
  display: block;
  color: var(--text);
  font-size: 14px;
  font-weight: 650;
}

.modal-mini-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.modal-mini-card p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.modal-section {
  padding: 14px;
  background: linear-gradient(180deg, #f7f8fb 0%, #f2f4f7 100%);
  border-radius: 14px;
  border: 1px dashed rgba(134, 134, 139, 0.25);
}

.modal-section.compact {
  padding: 12px 14px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.modal-form .modal-section .form-group {
  gap: 14px;
}

.modal-form .modal-section .form-row + .form-row {
  margin-top: 12px;
}

.offboard-info-section .form-group {
  gap: 16px;
}

.offboard-info-section > .form-group {
  margin-top: 0;
}

.offboard-info-section > .offboard-remark-group {
  margin-top: 28px;
}

.form-group label {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}

.form-row {
  display: flex;
  gap: 16px;
}

.form-row .form-group {
  flex: 1;
}

.form-input,
.form-select {
  width: 100%;
  height: 44px;
  padding: 0 16px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  font-size: 15px;
  font-family: inherit;
  transition: all 0.2s ease;
  box-sizing: border-box;
}

.form-input:disabled {
  color: var(--muted);
  cursor: not-allowed;
  -webkit-text-fill-color: var(--muted);
  opacity: 1;
}

.form-input.form-readonly {
  height: 36px;
  background: transparent;
  border-color: transparent;
  padding-left: 0;
  font-weight: 600;
  -webkit-text-fill-color: var(--text);
}

.form-input.form-compact,
.form-select.form-compact {
  height: 40px;
}

.form-label-subtle {
  color: var(--muted);
  font-size: 12px;
}

.transfer-current-summary {
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.76);
  border: 1px solid rgba(210, 210, 215, 0.9);
}

.transfer-current-summary strong {
  display: block;
  margin-top: 10px;
  font-size: 16px;
  font-weight: 650;
  color: var(--text);
}

.transfer-current-summary p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.transfer-current-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(134, 134, 139, 0.1);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.transfer-compare-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(0, 113, 227, 0.08);
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.transfer-target-card {
  margin-top: 14px;
  padding: 18px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(0, 113, 227, 0.1) 0%, rgba(255, 255, 255, 0.96) 100%);
  border: 1px solid rgba(0, 113, 227, 0.16);
  box-shadow: 0 12px 28px rgba(0, 113, 227, 0.08);
}

.transfer-target-head {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
}

.transfer-target-head strong {
  font-size: 16px;
  font-weight: 650;
  color: var(--text);
}

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

.form-input:focus,
.form-select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.1);
  background: var(--bg);
}

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2386868b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  padding-right: 40px;
}

.warning-box {
  background: rgba(255, 59, 48, 0.08);
  border: 1px solid rgba(255, 59, 48, 0.2);
  padding: 12px 16px;
  border-radius: 12px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  color: var(--danger);
  font-size: 13px;
  line-height: 1.5;
}

.warning-box svg {
  flex-shrink: 0;
  margin-top: 2px;
}

.modal-footer {
  padding: 24px;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  border-top: 1px solid rgba(229, 229, 234, 0.85);
  background: rgba(255, 255, 255, 0.6);
}

.btn-secondary,
.btn-primary,
.btn-danger {
  height: 44px;
  padding: 0 20px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-secondary {
  background: var(--panel-soft);
  color: var(--text);
}

.btn-secondary:hover {
  background: var(--line);
}

.btn-primary {
  background: var(--accent);
  color: white;
}

.btn-primary:hover {
  background: #0062c3;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 113, 227, 0.3);
}

.btn-danger {
  background: var(--danger);
  color: white;
}

.btn-danger:hover {
  background: #e0332a;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(255, 59, 48, 0.3);
}

.is-processing {
  opacity: 0.72;
}

.is-success {
  background: var(--success) !important;
  color: #ffffff !important;
  box-shadow: 0 8px 18px rgba(52, 199, 89, 0.24) !important;
}


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

.info-grid span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 13px;
}

.info-grid strong {
  font-size: 15px;
  font-weight: 500;
}

.job-number-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
}

.truncate-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 140px;
}

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  border-radius: 50%;
  background: var(--bg);
  color: var(--muted);
  transition: all 0.2s ease;
}

.icon-button:hover {
  background: var(--line);
  color: var(--text);
  transform: translateY(-1px);
}

.icon-button:active {
  transform: translateY(0);
}

.org-tree {
  padding-top: 8px;
}

.tree-children {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.org-kpi-grid {
  margin-bottom: 12px;
}

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

.stack-list.compact .stack-item {
  padding: 12px 16px;
  margin: 0 -16px;
  border-top: none;
  border-bottom: 1px solid var(--line);
}
.stack-list.compact .stack-item:last-child {
  border-bottom: none;
}

@media (max-width: 1560px) {
  .dashboard-focus {
    grid-template-columns: 1fr;
  }

  .kpi-grid,
  .employee-summary-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .kpi-grid > :nth-child(n + 4),
  .employee-summary-grid > :nth-child(n + 4) {
    display: none;
  }

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

  .care-kpi-grid > :nth-child(n + 4) {
    display: block;
  }

  .toolbar-filters {
    display: none;
  }
}

@media (max-width: 1440px) {
  .profile-pill > div:last-child {
    display: none;
  }

  .profile-pill {
    padding-right: 6px;
  }
}

@media (max-width: 1200px) {
  .search {
    display: none;
  }
}

@media (max-width: 1280px) {
  .dashboard-focus {
    padding: 24px;
  }

  .dashboard-focus h2 {
    font-size: 30px;
  }

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

  .kpi-grid > :nth-child(n + 3),
  .employee-summary-grid > :nth-child(n + 3) {
    display: none;
  }

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

  .care-kpi-grid > :nth-child(n + 3) {
    display: block;
  }
}

@media (max-width: 980px) {
  .care-kpi-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1380px) {
  .dashboard-grid,
  .double-grid,
  .org-layout {
    grid-template-columns: 1fr;
  }

  .employee-layout {
    grid-template-columns: 1fr;
    grid-template-areas:
      "current"
      "timeline"
      "compliance"
      "history"
      "archive";
  }
}

@media (max-width: 760px) {
  .modal-container.modal-form,
  .modal-container.modal-wide {
    width: calc(100vw - 24px);
  }

  .transfer-target-fields {
    grid-template-columns: 1fr;
  }

  .modal-metrics,
  .modal-card-grid,
  .form-row {
    grid-template-columns: 1fr;
    flex-direction: column;
  }
}

@media (hover: none) and (pointer: coarse) {
  body {
    overflow: auto;
  }

  .shell {
    display: flex;
    flex-direction: column;
    height: auto;
    min-height: 100vh;
    padding: 16px;
    gap: 16px;
  }

  .sidebar {
    width: 100%;
    padding: 20px;
    overflow: visible;
  }

  .workspace {
    padding-right: 0;
    overflow: visible;
  }

  .kpi-grid,
  .employee-summary-grid,
  .summary-strip,
  .org-kpi-grid,
  .care-kpi-grid,
  .dashboard-focus-metrics {
    grid-template-columns: 1fr;
  }

  .kpi-grid > *,
  .employee-summary-grid > * {
    display: block;
  }

  .topbar,
  .toolbar,
  .detail-header {
    flex-direction: column;
    align-items: flex-start;
    border-radius: var(--radius-lg);
  }

  .topbar-actions {
    width: 100%;
  }

  .search {
    width: 100%;
    min-width: 0;
  }

  .summary-strip,
  .tree-children,
  .dashboard-focus,
  .info-grid {
    grid-template-columns: 1fr;
  }

  .chart-bars {
    padding: 10px 12px 14px;
  }

  .line-chart-value,
  .line-chart-name {
    font-size: 11px;
  }

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

  .dashboard-focus {
    padding: 22px;
  }

  .dashboard-focus h2 {
    font-size: 28px;
  }
}
