:root {
  --surface: #f5f7fa;
  --surface-soft: #eef2f7;
  --surface-strong: #d9e1ec;
  --card: #ffffff;
  --primary: #22313f;
  --primary-soft: #d3d7db;
  --text: #1f2933;
  --muted: #667381;
  --line: #c7d0dc;
  --line-soft: #f4f7fa;
  --blue: #2563eb;
  --blue-soft: #e8f1ff;
  --green: #008c61;
  --green-soft: #ddf8ee;
  --red: #bd1e1e;
  --red-soft: #ffebe8;
  --shadow: 0 16px 32px rgba(4, 22, 39, 0.06);
  --card-border: 1px solid var(--line);
  --card-shadow: 0 6px 16px rgba(var(--primary-rgb), 0.035);
  --card-inner-border: 1px solid var(--line-soft);
  --card-inner-bg: var(--surface);
  --card-inner-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.56);
  --sidebar-bg: #ffffff;
  --nav-text: #334155;
  --nav-active-bg: #e8f0ff;
  --topbar-bg: rgba(245, 247, 250, 0.94);
  --search-bg: #f6f8fb;
  --control-bg: #ffffff;
  --secondary-bg: #eef2f7;
  --secondary-hover-bg: #d9e1ec;
  --secondary-hover-border: #acb8c7;
  --table-header-bg: #f5f8fb;
  --table-row-hover-bg: #f9fbff;
  --modal-backdrop: rgba(34, 49, 63, 0.32);
  --primary-rgb: 34, 49, 63;
  --accent-rgb: 37, 99, 235;
  --app-font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Microsoft YaHei", sans-serif;
  --radius-sm: 5px;
  --radius-md: 7px;
  --radius-lg: 10px;
  --topbar-height: 60px;
  --nav-height: 38px;
  --control-height: 38px;
  --base-font-size: 14px;
  --page-padding: 20px;
  --content-gap: 14px;
  --panel-padding: 16px;
  --table-cell-y: 10px;
  --table-cell-x: 14px;
  --layout-sidebar-width: 280px;
  --layout-sidebar-offset: 280px;
  --collapsed-sidebar-width: 88px;
  --collapsed-sidebar-offset: 88px;
  --content-max-width: none;
  --motion-duration: 280ms;
  --motion-duration-fast: 180ms;
  --motion-easing: cubic-bezier(0.22, 1, 0.36, 1);
  color: var(--text);
  background: var(--surface);
  font-family: var(--app-font-family);
}

* {
  box-sizing: border-box;
}

html,
body,
#app {
  max-width: 100%;
  min-height: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  overflow-x: hidden;
  background: var(--surface);
  color: var(--text);
  font-size: var(--base-font-size);
  -webkit-font-smoothing: antialiased;
}

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

button {
  cursor: pointer;
}

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

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

.app-shell {
  min-height: 100vh;
  background: var(--surface);
}

.main-shell {
  min-height: 100vh;
  margin-left: var(--layout-sidebar-offset);
  transition: margin-left var(--motion-duration) var(--motion-easing);
  will-change: margin-left;
}

:root[data-sidebar="floating"] .app-shell {
  --collapsed-sidebar-offset: calc(var(--collapsed-sidebar-width) + 24px);
}

.app-shell.is-sidebar-collapsed .main-shell {
  margin-left: var(--collapsed-sidebar-offset);
}

.page-shell {
  padding: var(--page-padding);
}

.page-shell > .view-stack {
  max-width: var(--content-max-width);
  margin-inline: auto;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 30;
  display: flex;
  width: var(--layout-sidebar-width);
  flex-direction: column;
  overflow: hidden;
  border-right: 1px solid var(--line);
  background: var(--sidebar-bg);
  transition:
    width var(--motion-duration) var(--motion-easing),
    background var(--motion-duration-fast) ease,
    border-color var(--motion-duration-fast) ease,
    box-shadow var(--motion-duration-fast) ease,
    transform var(--motion-duration) var(--motion-easing);
  will-change: width, transform;
}

.app-shell.is-sidebar-collapsed .sidebar {
  width: var(--collapsed-sidebar-width);
}

:root[data-sidebar="floating"] .sidebar {
  inset: 16px auto 16px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

:root[data-sidebar="edge"] .sidebar {
  border-right: 0;
  background: var(--primary);
}

:root[data-sidebar="edge"] .brand-title,
:root[data-sidebar="edge"] .brand-subtitle,
:root[data-sidebar="edge"] .nav-section-title,
:root[data-sidebar="edge"] .nav-link {
  color: white;
}

:root[data-sidebar="edge"] .brand-mark {
  background: rgba(255, 255, 255, 0.16);
}

:root[data-sidebar="edge"] .nav-link:hover,
:root[data-sidebar="edge"] .nav-link.is-active {
  background: rgba(255, 255, 255, 0.16);
  color: white;
}

:root[data-layout="fullscreen"] .main-shell {
  margin-left: 0;
}

:root[data-layout="fullscreen"] .sidebar {
  transform: translateX(-110%);
}

:root[data-layout="fullscreen"] .sidebar.is-open {
  transform: translateX(0);
}

:root[data-layout="fullscreen"] .mobile-menu {
  display: grid;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: calc(var(--panel-padding) + 6px) var(--panel-padding) calc(var(--panel-padding) - 2px);
  transition:
    gap var(--motion-duration) var(--motion-easing),
    padding var(--motion-duration) var(--motion-easing);
}

.brand-main {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand-copy {
  min-width: 0;
  max-width: 160px;
  overflow: hidden;
  opacity: 1;
  transform: translateX(0);
  white-space: nowrap;
  transition:
    max-width var(--motion-duration) var(--motion-easing),
    opacity var(--motion-duration-fast) ease,
    transform var(--motion-duration) var(--motion-easing);
}

.brand-mark {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  flex: 0 0 auto;
  border-radius: var(--radius-md);
  background: var(--primary);
  color: white;
  box-shadow: 0 8px 18px rgba(var(--primary-rgb), 0.2);
  transition:
    width var(--motion-duration) var(--motion-easing),
    height var(--motion-duration) var(--motion-easing),
    border-radius var(--motion-duration-fast) ease,
    box-shadow var(--motion-duration-fast) ease;
}

.brand-mark.large {
  width: 52px;
  height: 52px;
}

.brand-title {
  margin: 0;
  color: var(--primary);
  font-size: 16px;
  font-weight: 800;
}

.brand-subtitle {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.sidebar-nav {
  display: grid;
  flex: 1;
  align-content: start;
  gap: 6px;
  min-height: 0;
  overflow-y: auto;
  padding: 12px;
  transition:
    gap var(--motion-duration) var(--motion-easing),
    padding var(--motion-duration) var(--motion-easing);
}

.sidebar-nav::-webkit-scrollbar {
  width: 8px;
}

.sidebar-nav::-webkit-scrollbar-thumb {
  border: 2px solid var(--sidebar-bg);
  border-radius: 999px;
  background: var(--surface-strong);
}

.app-shell.is-sidebar-collapsed .brand {
  justify-content: center;
  gap: 4px;
  padding-inline: 8px;
}

.app-shell.is-sidebar-collapsed .brand-main {
  justify-content: center;
}

.app-shell.is-sidebar-collapsed .brand-copy,
.app-shell.is-sidebar-collapsed .nav-link span,
.app-shell.is-sidebar-collapsed .nav-section-title {
  max-width: 0;
  opacity: 0;
  pointer-events: none;
  transform: translateX(-8px);
}

.app-shell.is-sidebar-collapsed .brand-mark {
  width: 36px;
  height: 36px;
}

.app-shell.is-sidebar-collapsed .sidebar-nav,
.app-shell.is-sidebar-collapsed .sidebar-footer {
  padding-inline: 14px;
}

.app-shell.is-sidebar-collapsed .nav-link {
  justify-content: center;
  gap: 0;
  padding-inline: 0;
}

.app-shell.is-sidebar-collapsed .nav-section-title {
  margin: 0;
}

.nav-section {
  display: grid;
  gap: 4px;
}

.nav-section + .nav-section {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid var(--line-soft);
}

.nav-section-title {
  max-width: 180px;
  margin: 0 8px 2px;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.4;
  opacity: 0.78;
  transform: translateX(0);
  white-space: nowrap;
  transition:
    max-width var(--motion-duration) var(--motion-easing),
    margin var(--motion-duration) var(--motion-easing),
    opacity var(--motion-duration-fast) ease,
    transform var(--motion-duration) var(--motion-easing);
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: var(--nav-height);
  width: 100%;
  border: 0;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--nav-text);
  padding: 0 12px;
  text-align: left;
  transition:
    background var(--motion-duration-fast) ease,
    color var(--motion-duration-fast) ease,
    gap var(--motion-duration) var(--motion-easing),
    padding var(--motion-duration) var(--motion-easing),
    transform var(--motion-duration-fast) ease;
}

.nav-link span {
  max-width: 120px;
  overflow: hidden;
  opacity: 1;
  transform: translateX(0);
  white-space: nowrap;
  transition:
    max-width var(--motion-duration) var(--motion-easing),
    opacity var(--motion-duration-fast) ease,
    transform var(--motion-duration) var(--motion-easing);
}

.nav-link:hover,
.nav-link.is-active {
  background: var(--nav-active-bg);
  color: var(--blue);
}

.nav-link.is-active {
  font-weight: 700;
}

.nav-button {
  appearance: none;
}

.nav-link.danger {
  color: var(--red);
}

.sidebar-footer {
  display: grid;
  flex: 0 0 auto;
  gap: 5px;
  border-top: 1px solid var(--line);
  padding: 12px;
  transition:
    gap var(--motion-duration) var(--motion-easing),
    padding var(--motion-duration) var(--motion-easing);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  min-height: var(--topbar-height);
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line-soft);
  background: var(--topbar-bg);
  padding: 0 var(--page-padding);
  backdrop-filter: blur(14px);
}

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

.global-search {
  display: flex;
  width: min(460px, 38vw);
  min-width: 240px;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--search-bg);
  padding: 0 16px;
  color: var(--muted);
}

.global-search input {
  min-height: var(--control-height);
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--text);
  outline: 0;
}

.icon-button {
  position: relative;
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--nav-text);
}

.icon-button:hover {
  background: var(--surface-strong);
  color: var(--blue);
}

.mobile-menu {
  display: none;
}

.notice-dot {
  position: absolute;
  top: 9px;
  right: 10px;
  width: 8px;
  height: 8px;
  border: 2px solid var(--surface);
  border-radius: 999px;
  background: var(--red);
}

.user-summary {
  display: flex;
  align-items: center;
  gap: 10px;
  border-left: 1px solid var(--line);
  padding-left: 16px;
}

.profile-trigger {
  border-top: 0;
  border-right: 0;
  border-bottom: 0;
  background: transparent;
  color: inherit;
  text-align: left;
}

.profile-trigger:hover .avatar {
  border-color: var(--blue);
}

.user-text {
  display: grid;
  gap: 2px;
  text-align: right;
}

.user-text strong {
  color: var(--primary);
  font-size: 14px;
}

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

.avatar {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 2px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  color: var(--primary);
  font-size: 13px;
  font-weight: 800;
  overflow: hidden;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar.large {
  width: 76px;
  height: 76px;
  font-size: 20px;
}

.appearance-panel-layer {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  align-items: start;
  justify-items: end;
  pointer-events: auto;
}

.appearance-panel {
  width: min(480px, calc(100vw - 20px));
  max-height: 100vh;
  margin: 0;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 0 0 0 var(--radius-lg);
  background: var(--card);
  box-shadow: 0 28px 70px rgba(var(--primary-rgb), 0.26);
  color: var(--text);
  padding: 14px;
  transform: translateX(0);
  transition:
    opacity var(--motion-duration-fast) ease,
    transform var(--motion-duration) var(--motion-easing);
  will-change: transform, opacity;
}

.drawer-slide-enter-active,
.drawer-slide-leave-active {
  transition: opacity var(--motion-duration) ease;
}

.drawer-slide-enter-from,
.drawer-slide-leave-to {
  opacity: 0;
}

.drawer-slide-enter-from .appearance-panel,
.drawer-slide-leave-to .appearance-panel {
  opacity: 0;
  transform: translateX(28px);
}

.drawer-slide-enter-to .appearance-panel,
.drawer-slide-leave-from .appearance-panel {
  opacity: 1;
  transform: translateX(0);
}

.fade-enter-active,
.fade-leave-active {
  transition: opacity var(--motion-duration-fast) ease;
}

.fade-enter-from,
.fade-leave-to {
  opacity: 0;
}

:root[data-theme-mode="dark"] .appearance-panel {
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.45);
}

.appearance-panel::-webkit-scrollbar {
  width: 10px;
}

.appearance-panel::-webkit-scrollbar-thumb {
  border: 3px solid var(--card);
  border-radius: 999px;
  background: var(--surface-strong);
}

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

.appearance-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.appearance-recommend {
  min-height: 30px;
  padding-inline: 9px;
}

.appearance-panel-header .icon-button {
  width: 32px;
  height: 32px;
}

.appearance-panel-header .icon-button svg {
  width: 18px;
  height: 18px;
}

.appearance-panel-header h2,
.appearance-section-head h3 {
  margin: 0;
  color: var(--primary);
}

.appearance-panel-header h2 {
  font-size: 17px;
}

.appearance-panel-header p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

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

.appearance-section + .appearance-section {
  margin-top: 14px;
}

.appearance-section-head {
  display: flex;
  align-items: center;
  gap: 8px;
}

.appearance-section-head h3 {
  font-size: 14px;
}

.appearance-reset {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
}

.appearance-reset svg {
  width: 14px;
  height: 14px;
}

.appearance-reset:hover {
  border-color: var(--line);
  background: var(--surface-soft);
  color: var(--blue);
}

.appearance-grid {
  display: grid;
  gap: 8px;
}

.mode-grid,
.font-grid,
.sidebar-grid,
.layout-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.color-preset-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

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

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

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

.appearance-choice,
.color-preset-choice {
  position: relative;
  display: grid;
  gap: 6px;
  min-width: 0;
  border: var(--card-inner-border);
  border-radius: var(--radius-md);
  background: var(--card-inner-bg);
  box-shadow: var(--card-inner-shadow);
  color: var(--text);
  padding: 6px;
  text-align: center;
  transition:
    background 0.18s ease,
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.18s ease;
}

.appearance-choice:hover,
.color-preset-choice:hover,
.appearance-choice.is-active,
.color-preset-choice.is-active {
  border-color: var(--blue);
  box-shadow: none;
}

.appearance-choice strong,
.color-preset-choice strong {
  color: var(--primary);
  font-size: 12px;
  line-height: 1.25;
}

.choice-check {
  position: absolute;
  top: -7px;
  right: -7px;
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border: 2px solid var(--card);
  border-radius: 999px;
  background: var(--blue);
  color: white;
  box-shadow: 0 8px 18px rgba(var(--accent-rgb), 0.24);
}

.choice-check svg {
  width: 14px;
  height: 14px;
}

.theme-mode-choice {
  align-content: start;
  padding: 0;
}

.mode-preview,
.layout-preview,
.dashboard-preview,
.content-width-preview,
.density-preview,
.radius-preview {
  position: relative;
  display: block;
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: var(--surface-soft);
}

.mode-preview {
  height: 66px;
  border: 1px solid var(--line);
}

.theme-mode-choice strong {
  padding-bottom: 6px;
  text-align: left;
}

.theme-mode-choice strong,
.layout-choice strong,
.content-width-choice strong,
.density-choice strong,
.font-choice strong,
.radius-choice strong {
  padding-inline: 2px;
}

.theme-mode-choice .preview-sidebar {
  position: absolute;
  inset: 0 auto 0 0;
  display: grid;
  width: 30%;
  align-content: start;
  gap: 5px;
  background: rgba(var(--primary-rgb), 0.08);
  padding: 11px 8px;
}

.preview-sidebar i,
.density-preview i,
.content-width-preview i {
  display: block;
  height: 4px;
  border-radius: 999px;
  background: currentColor;
  opacity: 0.55;
}

.preview-sidebar i:first-child {
  width: 17px;
}

.preview-sidebar i:nth-child(2) {
  width: 27px;
}

.preview-sidebar i:nth-child(3) {
  width: 23px;
}

.preview-chart {
  position: absolute;
  left: 40%;
  top: 29px;
  display: flex;
  align-items: end;
  gap: 4px;
  color: var(--blue);
}

.preview-chart i {
  display: block;
  width: 5px;
  border-radius: 3px 3px 0 0;
  background: currentColor;
}

.preview-chart i:first-child {
  height: 11px;
}

.preview-chart i:nth-child(2) {
  height: 16px;
}

.preview-chart i:nth-child(3) {
  height: 24px;
}

.preview-pie {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: conic-gradient(var(--blue) 0 32%, var(--surface-strong) 32% 100%);
}

.preview-card {
  position: absolute;
  left: 38%;
  right: 12px;
  bottom: 9px;
  height: 28px;
  border-radius: var(--radius-md);
  background: rgba(var(--primary-rgb), 0.1);
}

.theme-mode-choice.is-system .mode-preview {
  background: linear-gradient(90deg, #252320 0 50%, #f4f2ef 50% 100%);
  color: #d8d3ca;
}

.theme-mode-choice.is-light .mode-preview {
  background: #f5f6f8;
  color: #a9a9a9;
}

.theme-mode-choice.is-dark .mode-preview {
  background: #12213a;
  color: #6b94c6;
}

.color-preset-choice {
  min-height: 74px;
  align-content: start;
  padding: 6px;
}

.color-preset-swatch {
  position: relative;
  display: block;
  height: 44px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--preset-surface);
}

.color-preset-choice strong {
  text-align: center;
}

.preset-sidebar {
  position: absolute;
  inset: 0 auto 0 0;
  display: grid;
  width: 34%;
  align-content: start;
  gap: 4px;
  background: var(--preset-sidebar);
  padding: 7px 6px;
}

.preset-sidebar b,
.preset-main b {
  display: block;
  height: 4px;
  border-radius: 999px;
}

.preset-sidebar b {
  background: var(--preset-primary);
  opacity: 0.7;
}

.preset-sidebar b:first-child {
  width: 18px;
}

.preset-sidebar b:nth-child(2) {
  width: 30px;
  background: var(--preset-active);
  opacity: 1;
}

.preset-sidebar b:nth-child(3) {
  width: 22px;
}

.preset-main {
  position: absolute;
  inset: 6px 6px 6px 42%;
  display: grid;
  align-content: start;
  gap: 5px;
  border-radius: var(--radius-sm);
  background: var(--preset-card);
  padding: 7px;
}

.preset-main b {
  background: var(--preset-primary);
  opacity: 0.22;
}

.preset-main b:first-child {
  width: 68%;
}

.preset-main b:nth-child(2) {
  width: 88%;
}

.preset-main b:nth-child(3) {
  width: 52%;
}

.preset-accent {
  position: absolute;
  right: 10px;
  bottom: 10px;
  width: 22px;
  height: 5px;
  border-radius: 999px;
  background: var(--preset-accent);
}

.font-choice {
  min-height: 54px;
  place-items: center;
}

.font-choice span:first-child {
  color: var(--primary);
  font-size: 20px;
  font-weight: 800;
  line-height: 1;
}

.font-auto span:first-child {
  font-family: var(--app-font-family);
}

.font-sans span:first-child {
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Microsoft YaHei", sans-serif;
}

.font-serif span:first-child {
  font-family: Georgia, "Times New Roman", "Songti SC", "SimSun", serif;
}

.radius-choice {
  min-height: 52px;
  place-items: center;
}

.radius-preview {
  width: 100%;
  height: 24px;
  border: 1px solid currentColor;
  border-radius: var(--preview-radius);
  color: var(--muted);
}

.radius-preview::before {
  content: "";
  position: absolute;
  top: 7px;
  left: 10px;
  width: 16px;
  height: 12px;
  border-top: 2px solid currentColor;
  border-left: 2px solid currentColor;
  border-top-left-radius: var(--preview-radius);
}

.density-choice {
  min-height: 54px;
}

.density-preview {
  display: grid;
  height: 27px;
  align-content: center;
  gap: 4px;
  color: var(--muted);
}

.density-preview i:first-child {
  width: 72%;
}

.density-preview i:nth-child(2) {
  width: 64%;
}

.density-preview i:nth-child(3) {
  width: 56%;
}

.density-preview i:nth-child(4) {
  width: 48%;
}

.density-preview i:nth-child(5) {
  width: 42%;
}

.layout-choice {
  min-height: 86px;
}

.layout-preview {
  height: 58px;
  border: 1px solid var(--line);
}

.layout-side {
  position: absolute;
  top: 9px;
  bottom: 9px;
  left: 9px;
  display: grid;
  width: 30px;
  align-content: start;
  gap: 5px;
  border-radius: var(--radius-md);
  background: rgba(var(--accent-rgb), 0.26);
  padding: 8px 6px;
}

.layout-side i {
  display: block;
  height: 5px;
  border-radius: 999px;
  background: var(--primary);
  opacity: 0.62;
}

.layout-side i:first-child {
  width: 15px;
}

.layout-side i:nth-child(2) {
  width: 21px;
}

.layout-side i:nth-child(3) {
  width: 18px;
}

.layout-main {
  position: absolute;
  inset: 9px 9px 9px 46px;
  border-radius: var(--radius-md);
  background: rgba(var(--primary-rgb), 0.12);
}

.sidebar-choice.is-embedded .layout-side {
  top: 0;
  bottom: 0;
  left: 0;
  border-radius: 0;
}

.sidebar-choice.is-edge .layout-side {
  top: 0;
  bottom: 0;
  left: 0;
  width: 40px;
  border-radius: 0;
  background: var(--primary);
}

.sidebar-choice.is-edge .layout-main {
  left: 40px;
}

.dashboard-preview {
  height: 58px;
  border: 1px solid var(--line);
}

.dashboard-preview i {
  position: absolute;
  display: block;
  border-radius: var(--radius-md);
  background: rgba(var(--primary-rgb), 0.24);
}

.dashboard-preview i:first-child {
  inset: 8px auto auto 8px;
  width: 24px;
  height: 42px;
  background: rgba(var(--accent-rgb), 0.46);
}

.dashboard-preview i:nth-child(2) {
  top: 8px;
  left: 40px;
  right: 9px;
  height: 6px;
}

.dashboard-preview i:nth-child(3) {
  top: 23px;
  left: 40px;
  width: 23px;
  height: 6px;
}

.dashboard-preview i:nth-child(4) {
  left: 40px;
  bottom: 9px;
  width: 42px;
  height: 21px;
}

.dashboard-preview i:nth-child(5) {
  right: 10px;
  bottom: 12px;
  width: 22px;
  height: 22px;
  border-radius: 999px;
}

.dashboard-layout-choice.is-compact .dashboard-preview i:first-child {
  width: 6px;
}

.dashboard-layout-choice.is-compact .dashboard-preview i:nth-child(n + 2) {
  left: 24px;
}

.dashboard-layout-choice.is-fullscreen .dashboard-preview i:first-child {
  display: none;
}

.dashboard-layout-choice.is-fullscreen .dashboard-preview i:nth-child(n + 2) {
  left: 9px;
}

.content-width-choice {
  min-height: 54px;
}

.content-width-preview {
  display: grid;
  height: 27px;
  align-content: center;
  gap: 5px;
  color: var(--muted);
}

.content-width-preview i {
  height: 4px;
}

.content-width-choice.is-full .content-width-preview i {
  width: 100%;
}

.content-width-choice.is-full .content-width-preview i:nth-child(2) {
  width: 92%;
}

.content-width-choice.is-full .content-width-preview i:nth-child(3) {
  width: 74%;
}

.content-width-choice.is-centered .content-width-preview {
  justify-items: center;
}

.content-width-choice.is-centered .content-width-preview i:first-child {
  width: 100%;
}

.content-width-choice.is-centered .content-width-preview i:nth-child(2) {
  width: 55%;
}

.content-width-choice.is-centered .content-width-preview i:nth-child(3) {
  width: 38%;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  align-items: start;
  justify-items: center;
  background: var(--modal-backdrop);
  backdrop-filter: blur(8px);
  overflow-y: auto;
  padding: 36px 20px;
}

.profile-modal {
  width: min(720px, 100%);
  max-height: min(760px, calc(100vh - 48px));
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--card);
  box-shadow: 0 22px 54px rgba(var(--primary-rgb), 0.2);
}

.employee-modal {
  width: min(980px, 100%);
  max-height: min(780px, calc(100vh - 48px));
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid var(--line-soft);
  padding: 18px var(--panel-padding);
}

.modal-header h2 {
  margin: 0;
  color: var(--primary);
  font-size: 20px;
}

.modal-header p,
.profile-avatar-row p {
  margin: 6px 0 0;
  color: var(--muted);
}

.profile-avatar-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: var(--panel-padding);
}

.profile-avatar-row strong {
  display: block;
  color: var(--primary);
  font-size: 18px;
}

.avatar-upload {
  position: relative;
  margin-top: 14px;
  overflow: hidden;
}

.avatar-upload input {
  position: absolute;
  inset: 0;
  opacity: 0;
}

.profile-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  border-top: 1px solid var(--line-soft);
  padding: var(--panel-padding);
}

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

.password-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  border-top: 1px solid var(--line-soft);
  padding: var(--panel-padding);
}

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

.form-section-head h3 {
  margin: 0;
  color: var(--primary);
  font-size: 18px;
}

.form-section-head p {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.view-stack {
  display: grid;
  gap: var(--content-gap);
}

.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  min-height: 52px;
  padding-bottom: 2px;
}

.page-header h1 {
  margin: 0;
  color: var(--primary);
  font-size: 26px;
  line-height: 1.2;
}

.page-header p,
.panel-header p,
.action-card p {
  margin: 5px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.header-actions,
.form-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.realtime-page-header {
  align-items: flex-end;
}

.realtime-header-actions {
  display: grid;
  grid-template-columns: minmax(210px, 242px) 140px;
  align-items: end;
  justify-content: end;
  gap: 10px;
  flex-wrap: nowrap;
}

.realtime-date-field {
  min-width: 0;
  margin: 0;
}

.realtime-date-field input {
  width: 100%;
}

.realtime-header-actions .primary-button,
.realtime-header-actions .secondary-button {
  min-height: 38px;
  padding: 0 14px;
  white-space: nowrap;
}

.align-right {
  justify-content: flex-end;
}

.primary-button,
.secondary-button,
.link-button,
.file-button {
  display: inline-flex;
  min-height: var(--control-height);
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  padding: 0 14px;
  font-weight: 700;
  transition:
    background 0.18s ease,
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.18s ease;
}

.primary-button {
  background: var(--blue);
  color: white;
  box-shadow: 0 8px 18px rgba(var(--accent-rgb), 0.14);
}

.primary-button:hover {
  background: var(--blue);
  filter: brightness(0.94);
}

.primary-button:focus-visible {
  outline: 0;
  box-shadow: 0 0 0 4px rgba(var(--accent-rgb), 0.16);
}

.secondary-button {
  border-color: var(--line);
  background: var(--secondary-bg);
  color: var(--primary);
}

.secondary-button:hover {
  border-color: var(--secondary-hover-border);
  background: var(--secondary-hover-bg);
}

.secondary-button:focus-visible,
.link-button:focus-visible,
.file-button:focus-visible {
  outline: 0;
  box-shadow: 0 0 0 4px rgba(var(--accent-rgb), 0.12);
}

.link-button {
  min-height: auto;
  border: 0;
  background: transparent;
  color: var(--blue);
  padding: 0;
  font-weight: 800;
}

.full {
  width: 100%;
}

.panel,
.action-card,
.salary-profile-summary-strip,
.organization-summary-strip {
  border: var(--card-border);
  border-radius: var(--radius-lg);
  background: var(--card);
  box-shadow: var(--card-shadow);
}

.summary-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  border: var(--card-border);
  border-radius: var(--radius-lg);
  background: var(--card);
  box-shadow: var(--card-shadow);
  padding: 6px 8px;
}

.summary-metric {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  min-height: 42px;
  min-width: 180px;
  flex: 1 1 220px;
  align-items: center;
  gap: 7px;
  border: var(--card-inner-border);
  border-radius: var(--radius-md);
  background: var(--card-inner-bg);
  box-shadow: var(--card-inner-shadow);
  padding: 5px 8px;
}

.summary-icon,
.action-icon {
  display: grid;
  place-items: center;
  border-radius: var(--radius-md);
}

.summary-icon {
  width: 26px;
  height: 26px;
  background: var(--surface-soft);
  color: var(--primary);
}

.tone-blue .summary-icon {
  background: var(--blue-soft);
  color: var(--blue);
}

.tone-green .summary-icon {
  background: var(--green-soft);
  color: var(--green);
}

.tone-red .summary-icon {
  background: var(--red-soft);
  color: var(--red);
}

.summary-copy {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.summary-copy span {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.summary-copy strong {
  overflow: hidden;
  color: var(--primary);
  font-size: 16px;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.summary-meta,
.status-chip {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  border-radius: var(--radius-sm);
  padding: 0 7px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.summary-meta {
  max-width: 132px;
  overflow: hidden;
  font-style: normal;
  text-overflow: ellipsis;
}

.summary-meta,
.status-chip.neutral {
  background: var(--surface-soft);
  color: var(--muted);
}

.commissions-page {
  gap: 14px;
}

.commission-summary-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 8px;
}

.commission-summary-strip .summary-metric {
  min-height: 58px;
  min-width: 0;
  flex: unset;
  padding: 8px 12px;
}

.commission-summary-strip .summary-icon {
  width: 32px;
  height: 32px;
}

.commission-summary-strip .summary-copy strong {
  font-size: 20px;
}

.commission-summary-strip .summary-meta {
  justify-self: end;
}

.commission-list-panel {
  overflow: hidden;
}

.commission-list-header {
  align-items: center;
}

.commission-filter-bar {
  grid-template-columns: minmax(220px, 420px) 180px 104px minmax(0, 1fr);
  align-items: end;
}

.commission-keyword-field {
  min-width: 0;
}

.commission-month-field {
  width: 180px;
}

.commission-search-button {
  width: 104px;
  min-height: 36px;
  justify-self: start;
  padding: 0 14px;
}

.commission-action-cell {
  text-align: right;
  white-space: nowrap;
}

.commission-row-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.table-action-icon {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-md);
  background: var(--card);
  color: var(--blue);
}

.table-action-icon:hover {
  border-color: rgba(var(--accent-rgb), 0.28);
  background: var(--nav-active-bg);
  color: var(--blue);
}

.table-action-icon.danger {
  color: var(--red);
}

.table-action-icon.danger:hover {
  border-color: var(--red-soft);
  background: var(--red-soft);
  color: var(--red);
}

.commission-modal-backdrop {
  align-items: start;
}

.commission-modal {
  width: min(900px, 100%);
  max-height: min(720px, calc(100vh - 48px));
}

.commission-form {
  padding: 14px var(--panel-padding) var(--panel-padding);
}

.commission-form-grid {
  display: grid;
  grid-template-columns: minmax(220px, 1.2fr) minmax(160px, 0.75fr) minmax(190px, 1fr) minmax(150px, 0.7fr);
  align-items: end;
  gap: 10px 14px;
}

.commission-business-field {
  grid-column: 1 / 2;
}

.commission-remark-field {
  grid-column: 2 / 4;
}

.commission-form-actions {
  grid-column: 3 / 5;
  align-self: end;
  justify-content: flex-end;
  margin: 0;
}

.commission-modal-message {
  grid-column: 1 / -1;
  margin: 0;
}

.commission-form-actions .primary-button {
  min-width: 138px;
}

.status-chip.green {
  background: var(--green-soft);
  color: var(--green);
}

.status-chip.warning {
  background: var(--red-soft);
  color: var(--red);
}

.status-chip.red {
  background: var(--red-soft);
  color: var(--red);
}

.employees-page {
  gap: 14px;
}

.employee-list-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.employee-list-title {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.employee-inline-metric {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  background: var(--surface);
  box-shadow: none;
  color: var(--primary);
  padding: 0 10px;
  white-space: nowrap;
}

.employee-inline-metric svg {
  color: var(--muted);
}

.employee-inline-metric span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.employee-inline-metric strong {
  color: var(--primary);
  font-size: 17px;
  line-height: 1;
}

.employee-inline-metric em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

.employee-filter-bar {
  grid-template-columns: minmax(180px, 260px) minmax(180px, 260px) minmax(130px, 160px) 104px minmax(0, 1fr);
}

.employee-search-button {
  width: 104px;
  min-height: 36px;
  justify-self: start;
  padding: 0 14px;
}

.employee-status-pill {
  display: inline-flex;
  min-height: 22px;
  min-width: 0;
  align-items: center;
  gap: 7px;
  background: transparent;
  color: var(--muted);
  padding: 0 2px;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.2;
  white-space: nowrap;
}

.employee-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: currentColor;
}

.employee-status-pill.is-active {
  color: var(--green);
}

.employee-status-pill.is-inactive {
  color: var(--red);
}

.dashboard-grid,
.action-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.6fr);
  gap: var(--content-gap);
}

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

.panel {
  overflow: hidden;
}

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

.realtime-overview-panel {
  overflow: hidden;
}

.realtime-overview-header {
  align-items: center;
  padding: 12px var(--panel-padding) 10px;
}

.realtime-overview-title {
  display: flex;
  min-width: 0;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}

.realtime-overview-title h2,
.realtime-overview-title p {
  margin: 0;
}

.realtime-overview-title p {
  font-size: 14px;
}

.realtime-sync-chip {
  min-width: 96px;
  justify-content: center;
}

.panel-header h2,
.action-card h2 {
  margin: 0;
  color: var(--primary);
  font-size: 18px;
  line-height: 1.3;
}

.sync-panel,
.trend-panel {
  min-height: 300px;
}

.compact-list,
.detail-grid {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: var(--panel-padding);
}

.compact-list div,
.detail-grid div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid var(--line-soft);
  padding-bottom: 12px;
}

.compact-list dt,
.detail-grid dt {
  color: var(--muted);
  font-size: 13px;
}

.compact-list dd,
.detail-grid dd {
  margin: 0;
  color: var(--primary);
  font-weight: 800;
  text-align: right;
}

.monthly-technical-panel {
  border-style: dashed;
  background: var(--surface);
}

.monthly-technical-panel summary {
  cursor: pointer;
  list-style: none;
  padding: 12px var(--panel-padding);
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.monthly-technical-panel summary::-webkit-details-marker {
  display: none;
}

.monthly-technical-panel summary::after {
  content: "+";
  float: right;
  color: var(--primary);
  font-size: 16px;
}

.monthly-technical-panel[open] summary::after {
  content: "-";
}

.technical-note {
  margin: 0;
  border-top: 1px solid var(--line-soft);
  padding: 0 var(--panel-padding) 4px;
  color: var(--muted);
  font-size: 12px;
}

.sync-panel .primary-button {
  margin: 0 var(--panel-padding) var(--panel-padding);
  width: calc(100% - (var(--panel-padding) * 2));
}

.legend-line {
  display: flex;
  gap: 16px;
  color: var(--muted);
  font-size: 13px;
}

.legend-line span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.legend-line i {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: var(--surface-strong);
}

.legend-line .legend-blue {
  background: var(--blue);
}

.bar-chart {
  display: grid;
  height: 210px;
  grid-template-columns: repeat(6, minmax(36px, 1fr));
  align-items: end;
  gap: 12px;
  padding: 20px 28px 22px;
}

.bar-item {
  position: relative;
  display: grid;
  height: 100%;
  align-items: end;
  justify-items: center;
  gap: 10px;
}

.bar-item strong,
.bonus-bar {
  display: block;
  width: 42px;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}

.bar-item strong {
  background: var(--blue);
}

.bonus-bar {
  position: absolute;
  bottom: 22px;
  background: var(--surface-strong);
}

.bar-item em {
  font-style: normal;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.action-card {
  position: relative;
  display: grid;
  align-content: start;
  gap: 14px;
  min-height: 210px;
  padding: calc(var(--panel-padding) + 4px);
}

.source-workflow {
  display: grid;
  gap: 10px;
}

.section-title-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
}

.section-title-row h2 {
  margin: 0;
  color: var(--primary);
  font-size: 18px;
  line-height: 1.25;
}

.section-title-row p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.source-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--content-gap);
}

.source-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 106px;
  border: var(--card-border);
  border-radius: var(--radius-lg);
  background: var(--card);
  box-shadow: var(--card-shadow);
  padding: 14px var(--panel-padding);
}

.source-option-main {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.source-option h2 {
  margin: 0;
  color: var(--primary);
  font-size: 17px;
  line-height: 1.25;
}

.source-option p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.source-note {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
}

.source-note.warning {
  color: var(--red);
}

.source-option .primary-button,
.source-option .secondary-button,
.source-option .file-button {
  flex: 0 0 auto;
  white-space: nowrap;
}

.source-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.monthly-command-panel {
  overflow: hidden;
}

.monthly-command-header {
  align-items: center;
  padding-bottom: 12px;
}

.monthly-settings-grid {
  grid-template-columns: minmax(150px, 0.75fr) minmax(190px, 1fr) minmax(260px, 1.4fr) minmax(170px, 0.75fr);
  border-top: 1px solid var(--line-soft);
  padding-block: 12px;
}

.monthly-source-strip {
  gap: 10px;
  padding: 0 var(--panel-padding) 12px;
}

.monthly-source-option {
  min-height: 88px;
  border-color: var(--line-soft);
  background: var(--surface);
  box-shadow: none;
  padding: 12px;
}

.monthly-source-option .action-icon {
  width: 42px;
  height: 42px;
}

.monthly-source-option h2 {
  font-size: 15px;
}

.monthly-source-option p {
  margin-top: 3px;
  font-size: 12px;
}

.monthly-source-option .source-note {
  margin-top: 4px;
  font-size: 11px;
}

.monthly-stats-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  padding-top: 0;
  padding-bottom: 12px;
}

.monthly-final-actions {
  justify-content: flex-end;
  border-top: 1px solid var(--line-soft);
  padding: 12px var(--panel-padding) var(--panel-padding);
}

.payroll-compact-toolbar {
  display: grid;
  grid-template-columns: minmax(190px, 240px) minmax(0, 1fr) auto;
  align-items: stretch;
  gap: 14px;
  min-width: 0;
  padding: 12px var(--panel-padding);
}

.payroll-toolbar-month {
  display: grid;
  align-content: start;
  gap: 8px;
  min-width: 0;
}

.payroll-toolbar-month > span,
.payroll-toolbar-summary span,
.payroll-toolbar-summary small,
.payroll-detail-summary span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.payroll-toolbar-month .field {
  margin: 0;
}

.payroll-toolbar-summary {
  display: grid;
  grid-template-columns: minmax(110px, 0.7fr) minmax(110px, 0.7fr) minmax(110px, 0.7fr) minmax(270px, 1.45fr);
  gap: 0;
  min-width: 0;
  border-inline: 1px solid var(--line-soft);
}

.payroll-toolbar-summary div,
.payroll-detail-summary div {
  display: grid;
  align-content: center;
  gap: 4px;
  min-width: 0;
  border-right: 1px solid var(--line-soft);
  padding: 0 14px;
}

.payroll-toolbar-summary div:last-child,
.payroll-detail-summary div:last-child {
  border-right: 0;
}

.payroll-toolbar-summary strong,
.payroll-detail-summary strong {
  min-width: 0;
  overflow: hidden;
  color: var(--primary);
  font-size: 16px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.payroll-toolbar-summary small {
  min-width: 0;
  overflow: hidden;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.payroll-toolbar-range strong,
.payroll-toolbar-range small {
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
}

.payroll-toolbar-range strong {
  font-size: 15px;
}

.payroll-toolbar-actions {
  display: grid;
  grid-template-columns: repeat(2, 138px);
  align-content: start;
  justify-content: end;
  gap: 8px;
  min-width: 0;
}

.payroll-toolbar-actions .primary-button,
.payroll-toolbar-actions .secondary-button {
  min-height: 34px;
  padding: 0 10px;
  font-size: 13px;
  white-space: nowrap;
}

.payroll-toolbar-actions svg {
  width: 16px;
  height: 16px;
}

.payroll-toolbar-actions .link-button {
  grid-column: 1 / -1;
  justify-self: end;
  min-height: 30px;
}

.payroll-toolbar-export {
  display: inline-flex;
  grid-column: 1 / -1;
  align-items: center;
  justify-self: start;
  gap: 8px;
  min-height: 30px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--muted);
  padding: 0 10px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.payroll-toolbar-export input {
  width: 15px;
  height: 15px;
  accent-color: var(--blue);
}

.payroll-detail-panel {
  overflow: hidden;
  border-color: rgba(var(--accent-rgb), 0.2);
}

.payroll-detail-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  border-bottom: 1px solid var(--line-soft);
  padding: var(--panel-padding);
}

.payroll-detail-header h2 {
  margin: 0;
  color: var(--primary);
  font-size: 22px;
  line-height: 1.25;
}

.payroll-detail-header p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.payroll-detail-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(110px, auto));
  align-items: stretch;
  min-width: 0;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-md);
  background: var(--surface);
  padding: 10px 0;
}

.salary-detail-table-shell {
  min-width: 0;
}

.salary-summary-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) repeat(3, minmax(140px, 180px));
  gap: 10px;
  border-bottom: 1px solid var(--line-soft);
  padding: 12px var(--panel-padding);
}

.salary-summary-toolbar .field {
  margin: 0;
}

.salary-summary-layout {
  display: grid;
  min-width: 0;
}

.salary-summary-table {
  min-width: 860px;
  font-size: 13px;
}

.salary-summary-table th,
.salary-summary-table td {
  padding: 12px 14px;
  vertical-align: middle;
}

.salary-summary-table tbody tr {
  cursor: pointer;
}

.salary-summary-table tbody tr.has-warning td {
  background: rgba(var(--red-rgb), 0.035);
}

.salary-name-button {
  min-height: auto;
  padding: 0;
}

.salary-anomaly-note {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.salary-detail-drawer {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  border-top: 1px solid var(--line-soft);
  background: var(--surface);
  padding: 14px var(--panel-padding);
}

.salary-detail-drawer-header {
  display: flex;
  grid-column: 1 / -1;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line-soft);
  padding-bottom: 10px;
}

.salary-detail-drawer-header span,
.salary-detail-drawer > div:not(.salary-detail-drawer-header) span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.salary-detail-drawer-header h3 {
  margin: 3px 0 0;
  color: var(--primary);
  font-size: 18px;
  line-height: 1.25;
}

.salary-detail-drawer-header p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.salary-detail-drawer > div:not(.salary-detail-drawer-header) {
  display: grid;
  gap: 4px;
  min-width: 0;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-md);
  background: var(--card);
  padding: 10px 12px;
}

.salary-detail-drawer > div:not(.salary-detail-drawer-header) strong {
  min-width: 0;
  overflow: hidden;
  color: var(--primary);
  font-size: 14px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.salary-detail-note {
  grid-column: 1 / -1;
  margin: 0;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-md);
  background: var(--card);
  color: var(--muted);
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.45;
}

.salary-detail-table {
  font-size: 13px;
  min-width: 1560px;
}

.salary-detail-table th,
.salary-detail-table td {
  padding: 10px 12px;
  vertical-align: middle;
}

.salary-detail-table td {
  height: 54px;
}

.salary-detail-table td strong {
  font-size: 14px;
}

.salary-detail-table th,
.salary-detail-table td:not(.note-cell) {
  white-space: nowrap;
}

.salary-detail-table .note-cell {
  min-width: 150px;
  max-width: 180px;
  line-height: 1.45;
}

.payroll-secondary-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  align-items: start;
  gap: var(--content-gap);
  min-width: 0;
}

.monthly-history-panel,
.payroll-exception-panel {
  min-width: 0;
}

.action-icon {
  width: 50px;
  height: 50px;
}

.action-icon.blue {
  background: var(--blue-soft);
  color: var(--blue);
}

.action-icon.green {
  background: var(--green-soft);
  color: var(--green);
}

.file-button {
  position: relative;
  width: fit-content;
  background: var(--blue);
  color: white;
}

.file-button input {
  position: absolute;
  inset: 0;
  opacity: 0;
}

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

.settings-grid {
  display: grid;
  grid-template-columns: minmax(180px, 0.85fr) minmax(220px, 1fr) minmax(280px, 1.35fr) minmax(190px, 0.9fr);
  gap: 12px;
  padding: var(--panel-padding);
}

.readonly-field {
  display: grid;
  align-content: center;
  gap: 6px;
  min-height: var(--control-height);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--card-inner-bg);
  box-shadow: var(--card-inner-shadow);
  padding: 8px 12px;
}

.readonly-field span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.readonly-field strong {
  min-width: 0;
  overflow: hidden;
  color: var(--primary);
  font-size: 14px;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.secondary-file-button {
  border: 1px solid var(--line);
  background: var(--control-bg);
  color: var(--blue);
}

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

.compact-field {
  min-width: 170px;
}

.compact-field span {
  font-size: 12px;
}

.compact-stats-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
  padding: 0 var(--panel-padding) var(--panel-padding);
}

.summary-metric,
.compact-stat,
.salary-profile-summary-item,
.organization-summary-strip div,
.organization-node-summary div,
.workflow-steps span,
.recent-item,
.salary-profile-modal-section,
.report-total-item,
.report-inline-metrics span,
.report-attendance-card {
  border: var(--card-inner-border);
  background: var(--card-inner-bg);
  box-shadow: var(--card-inner-shadow);
}

.compact-stat {
  min-width: 0;
  border: var(--card-inner-border);
  border-radius: var(--radius-md);
  background: var(--card-inner-bg);
  box-shadow: var(--card-inner-shadow);
  padding: 10px 12px;
}

.compact-stat span,
.workflow-steps span {
  color: var(--muted);
  font-size: 12px;
}

.compact-stat strong {
  display: block;
  margin-top: 5px;
  color: var(--primary);
  font-size: 18px;
  line-height: 1.2;
}

.realtime-overview-stats {
  padding-top: 0;
}

.realtime-overview-stats .compact-stat {
  padding: 12px 16px;
}

.realtime-overview-stats .compact-stat strong {
  margin-top: 6px;
  font-size: 24px;
  line-height: 1.05;
}

.realtime-table-filter-bar {
  display: grid;
  grid-template-columns: minmax(180px, 220px) minmax(240px, 1fr) 78px auto;
  align-items: end;
  gap: 10px;
  border-bottom: 1px solid var(--line-soft);
  background: var(--surface);
  padding: 10px var(--panel-padding);
}

.realtime-table-filter-bar .field {
  margin: 0;
}

.realtime-clear-filter {
  min-height: var(--control-height);
  width: 78px;
  justify-self: start;
  padding: 0 12px;
  white-space: nowrap;
}

.realtime-filter-result {
  justify-self: end;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.salary-profile-page {
  gap: 14px;
}

.salary-profile-summary-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding: 10px;
}

.salary-profile-summary-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-areas:
    "icon label"
    "icon value"
    "icon meta";
  align-items: center;
  column-gap: 10px;
  min-width: 0;
  border: var(--card-inner-border);
  border-radius: var(--radius-md);
  background: var(--card-inner-bg);
  box-shadow: var(--card-inner-shadow);
  padding: 10px 12px;
}

.salary-profile-summary-item svg {
  grid-area: icon;
  color: var(--blue);
}

.salary-profile-summary-item span,
.salary-profile-summary-item small {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.salary-profile-summary-item span {
  grid-area: label;
}

.salary-profile-summary-item strong {
  grid-area: value;
  min-width: 0;
  overflow: hidden;
  color: var(--primary);
  font-size: 19px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.salary-profile-summary-item small {
  grid-area: meta;
}

.salary-profile-list-panel .empty-state {
  min-height: 180px;
}

.salary-profile-list-header {
  align-items: center;
  gap: 18px;
}

.salary-profile-list-tools {
  flex: 1 1 520px;
  min-width: min(620px, 100%);
}

.salary-profile-toolbar {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) auto auto;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.salary-profile-list-tools input {
  min-height: 36px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--control-bg);
  color: var(--text);
  outline: 0;
  padding: 0 12px;
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease;
}

.salary-profile-list-tools input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(var(--accent-rgb), 0.12);
}

.salary-profile-table {
  min-width: 1120px;
}

.salary-profile-table th:nth-child(1),
.salary-profile-table th:nth-child(2) {
  width: 16%;
}

.salary-profile-table th:nth-child(3),
.salary-profile-table th:nth-child(7),
.salary-profile-table th:nth-child(8) {
  width: 9%;
}

.salary-profile-table .link-button {
  white-space: nowrap;
}

.salary-profile-pay-cell {
  display: grid;
  gap: 4px;
}

.salary-profile-pay-cell strong {
  color: var(--primary);
}

.salary-profile-pay-cell span {
  margin: 0;
}

.salary-profile-rate-stack {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.salary-profile-rate-stack span {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  border-radius: var(--radius-sm);
  background: var(--green-soft);
  color: var(--green);
  padding: 0 8px;
  font-size: 12px;
  font-weight: 800;
}

.salary-profile-edit-modal {
  align-items: start;
  padding: 24px;
  padding-top: 28px;
}

.salary-profile-edit-card {
  width: min(980px, 100%);
  max-height: min(780px, calc(100vh - 48px));
  overflow: auto;
}

.salary-profile-modal-form {
  display: grid;
  gap: 12px;
  border-top: 1px solid var(--line-soft);
  padding: 16px;
}

.salary-profile-modal-section {
  display: grid;
  gap: 12px;
  border: var(--card-inner-border);
  border-radius: var(--radius-md);
  background: var(--card-inner-bg);
  box-shadow: var(--card-inner-shadow);
  padding: 14px;
}

.salary-profile-modal-section-muted {
  background: var(--card);
}

.salary-profile-modal-section-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line-soft);
  padding-bottom: 10px;
}

.salary-profile-modal-section-title strong {
  color: var(--primary);
  font-size: 15px;
}

.salary-profile-modal-section-title span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

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

.salary-profile-modal-section .field {
  gap: 6px;
}

.salary-profile-modal-section .field span {
  font-size: 12px;
}

.salary-profile-modal-section .field input,
.salary-profile-modal-section .field select,
.salary-profile-modal-section .field textarea {
  min-height: 38px;
}

.salary-profile-modal-section .field textarea {
  min-height: 74px;
}

.salary-profile-modal-message {
  justify-self: center;
}

.salary-profile-modal-actions {
  justify-content: flex-end;
  border-top: 0;
  padding: 2px 0 0;
}

.report-page {
  gap: 12px;
}

.report-ledger-workspace {
  min-height: 460px;
}

.report-ledger-toolbar {
  display: grid;
  grid-template-columns: minmax(280px, 0.72fr) minmax(420px, 1.28fr);
  align-items: stretch;
  gap: 10px;
  border-bottom: 1px solid var(--line-soft);
  padding: 10px var(--panel-padding) 8px;
}

.report-ledger-title {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 12px;
}

.report-ledger-title h2 {
  margin: 2px 0 4px;
  color: var(--primary);
  font-size: 18px;
  line-height: 1.25;
}

.report-ledger-eyebrow {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

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

.report-total-item {
  display: grid;
  min-width: 0;
  min-height: 52px;
  align-content: center;
  gap: 3px;
  border-radius: var(--radius-md);
  padding: 7px 10px;
}

.report-total-item.is-primary {
  border-color: rgba(var(--accent-rgb), 0.24);
  background: var(--blue-soft);
}

.report-total-item span,
.report-attendance-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.report-total-item strong {
  overflow: hidden;
  color: var(--primary);
  font-size: 17px;
  line-height: 1.18;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.report-total-item small {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.report-inline-metrics {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--line-soft);
  background: var(--surface);
  padding: 7px var(--panel-padding);
}

.report-inline-metrics span {
  display: inline-flex;
  min-height: 28px;
  min-width: 0;
  align-items: center;
  gap: 6px;
  border-radius: var(--radius-md);
  color: var(--muted);
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
}

.report-inline-metrics svg {
  flex: 0 0 auto;
  color: var(--blue);
}

.report-inline-metrics strong {
  color: var(--primary);
  font-size: 13px;
  line-height: 1.2;
  white-space: nowrap;
}

.report-table-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  padding: 9px var(--panel-padding) 6px;
}

.report-table-heading h3 {
  margin: 0;
  color: var(--primary);
  font-size: 15px;
  line-height: 1.3;
}

.report-table-heading p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.report-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
  gap: var(--content-gap);
  align-items: start;
}

.report-attendance-list {
  display: grid;
  gap: 10px;
  padding: var(--panel-padding);
}

.report-attendance-card {
  display: flex;
  min-width: 0;
  min-height: 54px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-radius: var(--radius-md);
  padding: 12px;
}

.report-attendance-card strong {
  color: var(--primary);
  font-size: 20px;
  line-height: 1.1;
}

.report-record-panel {
  min-height: 460px;
}

.report-record-table {
  min-width: 1180px;
}

.report-net-cell {
  color: var(--green);
}

.organization-summary-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 10px;
}

.organization-summary-strip div {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 50px;
  border: var(--card-inner-border);
  border-radius: var(--radius-md);
  background: var(--card-inner-bg);
  box-shadow: var(--card-inner-shadow);
  padding: 10px 12px;
}

.organization-summary-strip svg {
  color: var(--blue);
}

.organization-summary-strip span,
.organization-summary-strip small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.organization-summary-strip strong {
  min-width: 0;
  overflow: hidden;
  color: var(--primary);
  font-size: 18px;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.organization-tree-layout {
  display: grid;
  grid-template-columns: minmax(340px, 0.9fr) minmax(520px, 1.45fr);
  gap: var(--content-gap);
  align-items: start;
}

.organization-tree-panel,
.organization-detail-panel {
  min-height: 620px;
}

.organization-tree-tools,
.organization-detail-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.link-button.muted {
  color: var(--muted);
}

.compact-button {
  min-height: 36px;
  padding: 0 12px;
  font-size: 13px;
}

.organization-tree {
  display: grid;
  align-content: start;
  gap: 4px;
  max-height: calc(100vh - 330px);
  min-height: 520px;
  overflow: auto;
  padding: 12px;
}

.organization-tree-empty {
  display: flex;
  min-height: 240px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--muted);
  font-weight: 800;
}

.tree-node {
  display: grid;
  grid-template-columns: 22px 32px minmax(0, 1fr) auto;
  width: 100%;
  min-height: 50px;
  align-items: center;
  gap: 8px;
  border: 0;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--text);
  padding: 7px 10px 7px calc(10px + (var(--tree-depth) * 20px));
  text-align: left;
  transition:
    background 0.18s ease,
    box-shadow 0.18s ease,
    color 0.18s ease,
    opacity 0.18s ease;
}

.tree-node:hover {
  background: var(--surface);
}

.tree-node.is-selected {
  background: var(--blue-soft);
  box-shadow: inset 3px 0 0 var(--blue);
}

.tree-node.is-inactive {
  opacity: 0.66;
}

.tree-toggle {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border-radius: var(--radius-sm);
  color: var(--muted);
}

.tree-toggle:not(.is-placeholder):hover {
  background: rgba(var(--accent-rgb), 0.1);
  color: var(--blue);
}

.tree-toggle.is-placeholder {
  visibility: hidden;
}

.tree-node-icon {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
  color: var(--primary);
}

.tree-node-position .tree-node-icon {
  background: var(--green-soft);
  color: var(--green);
}

.tree-node-main {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.tree-node-main strong,
.tree-node-main small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tree-node-main strong {
  color: var(--primary);
  font-size: 14px;
  line-height: 1.2;
}

.tree-node-main small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.tree-node .status-chip {
  min-height: 22px;
  padding: 0 8px;
  font-size: 11px;
}

.organization-detail-header {
  align-items: flex-start;
}

.organization-node-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  border-bottom: 1px solid var(--line-soft);
  background: var(--surface);
  padding: 12px var(--panel-padding);
}

.organization-node-summary div {
  min-width: 0;
  border: var(--card-inner-border);
  border-radius: var(--radius-md);
  background: var(--card-inner-bg);
  box-shadow: var(--card-inner-shadow);
  padding: 10px 12px;
}

.organization-node-summary span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.organization-node-summary strong {
  display: block;
  min-width: 0;
  overflow: hidden;
  margin-top: 5px;
  color: var(--primary);
  font-size: 14px;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.organization-editor-form {
  padding-top: 18px;
}

.workflow-steps {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  padding: 0 var(--panel-padding) var(--panel-padding);
}

.workflow-steps span {
  border: var(--card-inner-border);
  border-radius: var(--radius-md);
  background: var(--card-inner-bg);
  box-shadow: var(--card-inner-shadow);
  padding: 8px 10px;
  text-align: center;
}

.users-page {
  gap: 14px;
}

.user-list-panel {
  overflow: hidden;
}

.user-list-header {
  align-items: center;
}

.user-modal-backdrop {
  align-items: start;
}

.user-modal {
  width: min(920px, 100%);
  max-height: min(760px, calc(100vh - 48px));
}

.user-modal-form {
  padding: 14px var(--panel-padding) var(--panel-padding);
}

.user-modal-fields {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: end;
  gap: 10px 14px;
}

.user-modal-message {
  grid-column: 1 / -1;
  margin: 0;
}

.user-modal-actions {
  grid-column: 1 / -1;
  justify-content: flex-end;
  margin: 0;
}

.user-modal-actions .primary-button {
  min-width: 132px;
}

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

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

.field {
  display: grid;
  gap: 6px;
}

.field span,
.checkbox-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.field input,
.field select,
.field textarea,
.input-with-icon {
  min-height: var(--control-height);
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--control-bg);
  color: var(--text);
  outline: none;
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease;
}

.field input,
.field select,
.field textarea {
  padding: 0 12px;
}

.date-picker {
  position: relative;
  width: 100%;
  min-width: 0;
}

.date-picker-trigger {
  display: flex;
  min-height: var(--control-height);
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--control-bg);
  color: var(--text);
  padding: 0 12px;
  text-align: left;
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    background-color 0.18s ease;
}

.date-picker-trigger span {
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.date-picker-trigger span.muted {
  color: var(--muted);
  font-weight: 600;
}

.date-picker-trigger svg {
  flex: 0 0 auto;
  color: var(--muted);
}

.date-picker-trigger:hover,
.date-picker.is-open .date-picker-trigger {
  border-color: rgba(var(--accent-rgb), 0.42);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.1);
}

.date-picker.is-disabled {
  opacity: 0.66;
}

.date-picker-panel {
  position: fixed;
  z-index: 1100;
  width: min(292px, calc(100vw - 32px));
  max-height: min(420px, calc(100vh - 24px));
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--card);
  box-shadow: var(--shadow);
  padding: 12px;
  overscroll-behavior: contain;
}

.date-picker-panel-head {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 34px;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.date-picker-panel-head strong {
  color: var(--primary);
  font-size: 15px;
  text-align: center;
}

.date-picker-nav {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--muted);
}

.date-picker-nav:hover {
  border-color: rgba(var(--accent-rgb), 0.32);
  background: var(--nav-active-bg);
  color: var(--blue);
}

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

.calendar-shell {
  display: grid;
  gap: 8px;
}

.calendar-week-row,
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
}

.calendar-week-row span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

.date-picker-cell {
  min-height: 34px;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
}

.date-picker-cell:hover {
  border-color: rgba(var(--accent-rgb), 0.28);
  background: var(--nav-active-bg);
  color: var(--blue);
}

.date-picker-cell.active {
  border-color: var(--blue);
  background: var(--blue);
  color: white;
  box-shadow: 0 8px 16px rgba(var(--accent-rgb), 0.18);
}

.date-picker-cell.today:not(.active) {
  color: var(--blue);
}

.date-picker-cell.muted:not(.active) {
  color: var(--muted);
  opacity: 0.62;
}

.calendar-day {
  min-height: 32px;
  padding: 0;
}

.date-picker-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border-top: 1px solid var(--line-soft);
  margin-top: 12px;
  padding-top: 10px;
}

.date-picker-text-button {
  min-height: 30px;
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 0 6px;
  font-size: 13px;
  font-weight: 800;
}

.date-picker-text-button:hover,
.date-picker-text-button.primary {
  color: var(--blue);
}

.field textarea {
  min-height: 96px;
  resize: vertical;
  padding: 10px 12px;
}

.commission-remark-field textarea {
  min-height: 44px;
  max-height: 76px;
  resize: vertical;
  padding: 8px 12px;
}

.field input:focus,
.field select:focus,
.field textarea:focus,
.input-with-icon:focus-within {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(var(--accent-rgb), 0.12);
}

.checkbox-card,
.checkbox-line {
  display: flex;
  align-items: center;
  gap: 10px;
}

.checkbox-card {
  min-height: var(--control-height);
  align-self: end;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--control-bg);
  padding: 0 12px;
}

.form-actions {
  border-top: 1px solid var(--line-soft);
  background: var(--surface);
  padding: 12px var(--panel-padding) var(--panel-padding);
}

.search-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 12px;
  padding: var(--panel-padding);
}

.table-filter-bar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(150px, 190px) auto;
  align-items: end;
  gap: 12px;
  border-bottom: 1px solid var(--line-soft);
  background: var(--surface);
  padding: 10px var(--panel-padding);
}

.table-filter-bar .field {
  gap: 6px;
}

.table-filter-bar .field input,
.table-filter-bar .field select {
  min-height: 36px;
}

.commission-filter-bar {
  grid-template-columns: minmax(220px, 420px) 180px 104px minmax(0, 1fr);
  align-items: end;
}

.commission-keyword-field {
  min-width: 0;
}

.commission-month-field {
  width: 180px;
}

.commission-search-button {
  width: 104px;
  min-height: 36px;
  justify-self: start;
  padding: 0 14px;
}

.table-filter-bar.employee-filter-bar {
  grid-template-columns: minmax(180px, 260px) minmax(180px, 260px) minmax(130px, 160px) 104px minmax(0, 1fr);
}

.table-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--line-soft);
  background: var(--surface);
  padding: 12px var(--panel-padding) var(--panel-padding);
}

.table-pagination p {
  margin: 0;
  color: var(--muted);
  font-weight: 700;
}

.table-pagination .form-actions {
  justify-content: flex-end;
  border-top: 0;
  background: transparent;
  padding: 0;
}

.compact-select,
.table-input,
.table-textarea {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--control-bg);
  color: var(--text);
  outline: 0;
}

.compact-select {
  min-height: 36px;
  padding: 0 12px;
}

.table-input {
  min-height: 34px;
  width: min(180px, 100%);
  padding: 0 10px;
}

.table-textarea {
  min-height: 48px;
  width: min(320px, 100%);
  resize: vertical;
  padding: 8px 10px;
}

.table-wrap {
  max-width: 100%;
  min-width: 0;
  width: 100%;
  contain: inline-size;
  overflow-x: auto;
}

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

.data-table th,
.data-table td {
  border-bottom: 1px solid var(--line-soft);
  padding: var(--table-cell-y) var(--table-cell-x);
  line-height: 1.35;
  text-align: left;
  vertical-align: middle;
}

.data-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--table-header-bg);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

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

.data-table tbody tr {
  transition: background var(--motion-duration-fast) ease;
}

.data-table tr:hover td {
  background: var(--table-row-hover-bg);
}

.data-table tbody tr.is-selected td {
  background: rgba(var(--accent-rgb), 0.08);
}

.data-table td strong {
  display: block;
  color: var(--primary);
}

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

.rules-panel .panel-header {
  align-items: flex-start;
}

.rules-table {
  min-width: 920px;
}

.rules-table th:nth-child(1) {
  width: 22%;
}

.rules-table th:nth-child(2) {
  width: 30%;
}

.rules-table th:nth-child(3) {
  width: 12%;
}

.rules-table th:nth-child(4) {
  width: 26%;
}

.rules-table th:nth-child(5) {
  width: 10%;
}

.rule-name-cell strong {
  font-size: 14px;
}

.rule-group-chip {
  display: inline-flex !important;
  width: fit-content;
  margin-top: 8px !important;
  border: 1px solid rgba(var(--accent-rgb), 0.18);
  border-radius: 999px;
  background: rgba(var(--accent-rgb), 0.08);
  padding: 3px 8px;
  color: var(--primary) !important;
  font-size: 12px;
  font-weight: 800;
}

.rule-value-cell {
  min-width: 240px;
}

.rule-value-preview {
  display: block;
  margin: 0 0 8px !important;
  color: var(--primary) !important;
  font-size: 13px !important;
  font-weight: 800;
}

.rule-value-input {
  width: min(360px, 100%);
}

.rule-value-cell .table-textarea {
  min-height: 42px;
}

.weekday-toggle-group {
  display: flex;
  max-width: 380px;
  gap: 6px;
  flex-wrap: wrap;
}

.weekday-toggle {
  position: relative;
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--control-bg);
  color: var(--muted);
  padding: 0 10px;
  font-size: 12px;
  font-weight: 800;
  transition:
    border-color var(--motion-duration-fast) ease,
    background var(--motion-duration-fast) ease,
    color var(--motion-duration-fast) ease;
}

.weekday-toggle input {
  position: absolute;
  inset: 0;
  margin: 0;
  cursor: pointer;
  opacity: 0;
}

.weekday-toggle span {
  margin: 0 !important;
  color: inherit !important;
}

.weekday-toggle:hover,
.weekday-toggle.is-selected {
  border-color: rgba(var(--accent-rgb), 0.36);
  background: rgba(var(--accent-rgb), 0.1);
  color: var(--primary);
}

.rule-purpose p {
  max-width: 360px;
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.mono {
  font-family: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;
}

.strong {
  font-weight: 800;
}

.note-cell {
  max-width: 260px;
  color: var(--muted);
}

.link-button.danger {
  color: var(--red);
}

.operation-log-table {
  min-width: 1080px;
}

.operation-log-table td span {
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.empty-state {
  display: grid;
  min-height: 120px;
  place-items: center;
  color: var(--muted);
  padding: var(--panel-padding);
}

.inline-alert {
  margin: 12px var(--panel-padding) 0;
  border: 1px solid var(--red-soft);
  border-radius: var(--radius-md);
  background: var(--red-soft);
  color: var(--red);
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 700;
}

.recent-list {
  display: grid;
  gap: 10px;
  padding: 14px var(--panel-padding) 8px;
}

.recent-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  border: var(--card-inner-border);
  border-radius: var(--radius-md);
  background: var(--card-inner-bg);
  box-shadow: var(--card-inner-shadow);
  color: var(--text);
  padding: 12px;
  text-align: left;
}

.recent-item:hover {
  border-color: var(--blue);
}

.recent-item span,
.recent-item em {
  display: block;
}

.recent-item strong {
  color: var(--primary);
}

.recent-item em,
.recent-item small {
  color: var(--muted);
  font-style: normal;
}

.form-error,
.form-success {
  position: fixed;
  top: calc(var(--topbar-height) + 18px);
  right: auto;
  left: 50%;
  z-index: 120;
  width: min(380px, calc(100vw - 32px));
  margin: 0;
  border-radius: var(--radius-md);
  padding: 12px 14px;
  box-shadow: 0 18px 42px rgba(var(--primary-rgb), 0.16);
  font-weight: 700;
  pointer-events: none;
  animation: toast-autohide 4.2s ease forwards;
}

.form-error {
  background: var(--red-soft);
  color: var(--red);
}

.form-success {
  background: var(--green-soft);
  color: var(--green);
}

.spin {
  animation: spin 0.9s linear infinite;
}

@keyframes toast-autohide {
  0% {
    opacity: 0;
    transform: translate(-50%, -8px);
    visibility: visible;
  }

  10%,
  78% {
    opacity: 1;
    transform: translate(-50%, 0);
    visibility: visible;
  }

  100% {
    opacity: 0;
    transform: translate(-50%, -8px);
    visibility: hidden;
  }
}

.login-screen {
  position: relative;
  display: grid;
  min-height: 100vh;
  grid-template-columns: minmax(340px, 34vw) minmax(0, 1fr);
  overflow: hidden;
  background: var(--surface);
  isolation: isolate;
}

.login-form-side {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  padding: 42px clamp(36px, 5vw, 84px);
  background: linear-gradient(180deg, #f8fafc 0%, #f3f6fa 100%);
  box-shadow: inset -1px 0 0 rgba(var(--primary-rgb), 0.08);
}

.login-card {
  width: min(360px, 100%);
}

.login-brand {
  margin-bottom: 24px;
}

.login-brand h1 {
  margin: 18px 0 7px;
  color: var(--primary);
  font-size: 24px;
  line-height: 1.2;
}

.login-brand p {
  margin: 0;
  color: var(--muted);
}

.form-stack {
  display: grid;
  gap: 16px;
}

.input-with-icon {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 13px;
}

.input-with-icon input {
  min-height: var(--control-height);
  flex: 1;
  border: 0;
  background: transparent;
  outline: 0;
}

.input-action {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
}

.input-action:hover {
  background: var(--surface-soft);
}

.login-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 22px;
  margin-top: 34px;
  border-top: 1px solid var(--line);
  padding-top: 20px;
  color: var(--muted);
}

.login-footer p {
  flex-basis: 100%;
  margin: 0;
}

.login-footer span {
  color: var(--primary);
  font-weight: 700;
}

.login-visual {
  position: relative;
  display: grid;
  align-items: center;
  justify-items: start;
  overflow: hidden;
  background: var(--surface-soft);
  color: var(--text);
  padding: clamp(32px, 4.5vw, 58px);
  isolation: isolate;
}

.login-background-layer {
  position: absolute;
  inset: 0;
  z-index: 0;
  background-image: url("./login-background.png");
  background-position: 70% center;
  background-size: cover;
  filter: saturate(1.04) contrast(1.04);
  transform: scale(1.02);
}

.login-visual::before,
.login-visual::after {
  position: absolute;
  inset: 0;
  content: "";
  pointer-events: none;
}

.login-visual::before {
  z-index: 1;
  background:
    linear-gradient(90deg, rgba(245, 247, 250, 0.9) 0%, rgba(245, 247, 250, 0.5) 40%, rgba(245, 247, 250, 0.14) 100%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.34) 0%, rgba(236, 243, 251, 0.16) 100%);
}

.login-visual::after {
  z-index: 2;
  background:
    radial-gradient(circle at 18% 18%, rgba(var(--accent-rgb), 0.14), transparent 30%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.28), transparent 52%);
}

.ledger-visual {
  position: relative;
  z-index: 3;
  width: min(360px, 100%);
  margin-left: clamp(18px, 5vw, 78px);
  transform: translateY(-8px);
  border: 1px solid rgba(var(--primary-rgb), 0.12);
  border-radius: var(--radius-lg);
  background: var(--card);
  background: rgba(255, 255, 255, 0.68);
  backdrop-filter: blur(10px);
  padding: 22px;
  box-shadow: 0 14px 30px rgba(var(--primary-rgb), 0.08);
}

.ledger-visual h2 {
  margin: 16px 0 10px;
  color: var(--primary);
  font-size: 23px;
  line-height: 1.25;
}

.ledger-visual p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.visual-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.visual-metrics strong,
.visual-metrics span {
  display: block;
}

.visual-metrics strong {
  color: var(--primary);
  font-size: 19px;
}

.visual-metrics span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.security-line {
  position: absolute;
  right: 30px;
  bottom: 24px;
  z-index: 4;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-family: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;
  font-size: 12px;
  opacity: 0.82;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 1320px) {
  .realtime-header-actions {
    grid-template-columns: 1fr;
  }

  .payroll-compact-toolbar {
    grid-template-columns: 1fr;
  }

  .payroll-toolbar-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    border-inline: 0;
    border-block: 1px solid var(--line-soft);
    padding-block: 8px;
  }

  .payroll-toolbar-actions {
    justify-content: start;
  }

  .payroll-secondary-grid {
    grid-template-columns: 1fr;
  }

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

  .commission-business-field,
  .commission-remark-field,
  .commission-form-actions {
    grid-column: auto;
  }
}

@media (max-width: 1120px) {
  .appearance-panel {
    width: min(480px, calc(100vw - 16px));
    padding: 14px;
  }

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

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

  .salary-profile-summary-strip,
  .dashboard-grid,
  .action-grid,
  .compact-stats-grid,
  .form-grid,
  .settings-grid,
  .salary-profile-modal-fields,
  .workflow-steps,
  .password-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .report-ledger-toolbar {
    grid-template-columns: 1fr;
  }

  .organization-tree-layout {
    grid-template-columns: 1fr;
  }

  .report-detail-grid {
    grid-template-columns: 1fr;
  }

  .payroll-detail-header {
    grid-template-columns: 1fr;
  }

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

  .login-screen {
    grid-template-columns: 1fr;
  }

  .login-screen::before {
    position: absolute;
    inset: 0;
    z-index: 0;
    background:
      linear-gradient(180deg, rgba(245, 247, 250, 0.9) 0%, rgba(245, 247, 250, 0.84) 100%),
      url("./login-background.png") center / cover no-repeat;
    content: "";
    pointer-events: none;
  }

  .login-form-side {
    background: rgba(245, 247, 250, 0.74);
    backdrop-filter: blur(2px);
  }

  .login-visual {
    display: none;
  }
}

@media (max-width: 820px) {
  .main-shell {
    margin-left: 0;
  }

  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.is-open {
    transform: translateX(0);
  }

  .sidebar-scrim {
    position: fixed;
    inset: 0;
    z-index: 25;
    background: var(--modal-backdrop);
  }

  .mobile-menu {
    display: grid;
  }

  .source-strip {
    grid-template-columns: 1fr;
  }

  .source-option {
    align-items: stretch;
    flex-direction: column;
  }

  .source-actions {
    justify-content: flex-start;
  }

  .payroll-toolbar-summary,
  .payroll-toolbar-actions,
  .payroll-detail-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .payroll-toolbar-summary div,
  .payroll-detail-summary div {
    border-top: 1px solid var(--line-soft);
    border-right: 0;
    padding: 8px 10px;
  }

  .payroll-toolbar-summary div:first-child,
  .payroll-toolbar-summary div:nth-child(2),
  .payroll-detail-summary div:first-child,
  .payroll-detail-summary div:nth-child(2) {
    border-top: 0;
  }

  .payroll-toolbar-summary div:nth-child(odd),
  .payroll-detail-summary div:nth-child(odd) {
    border-right: 1px solid var(--line-soft);
  }

  .payroll-toolbar-actions .primary-button,
  .payroll-toolbar-actions .secondary-button,
  .payroll-toolbar-actions .link-button {
    width: 100%;
  }

  .payroll-toolbar-export,
  .payroll-toolbar-actions .link-button {
    grid-column: 1 / -1;
  }

  .topbar {
    padding: 0 18px;
  }

  .global-search {
    width: min(100%, 420px);
    min-width: 0;
  }

  .user-text {
    display: none;
  }

  .page-shell {
    padding: 22px;
  }

  .page-header {
    align-items: stretch;
    flex-direction: column;
  }

  .realtime-overview-title {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .realtime-table-filter-bar {
    grid-template-columns: 1fr;
  }

  .realtime-filter-result {
    justify-self: start;
  }

  .commission-summary-strip,
  .commission-form-grid,
  .commission-filter-bar {
    grid-template-columns: 1fr;
  }

  .table-filter-bar.employee-filter-bar {
    grid-template-columns: 1fr;
  }

  .commission-month-field,
  .commission-search-button {
    width: 100%;
  }

  .employee-search-button {
    width: 100%;
  }

  .commission-search-button {
    justify-self: stretch;
  }

  .employee-search-button {
    justify-self: stretch;
  }

  .commission-form-actions .primary-button {
    width: 100%;
  }

  .user-modal-fields {
    grid-template-columns: 1fr;
  }

  .user-modal-actions {
    justify-content: stretch;
  }

  .user-modal-actions .primary-button,
  .user-modal-actions .secondary-button {
    width: 100%;
  }

  .mode-grid,
  .font-grid,
  .sidebar-grid,
  .layout-grid,
  .content-width-grid {
    grid-template-columns: 1fr;
  }

  .header-actions,
  .form-actions {
    width: 100%;
  }

  .employee-inline-metric {
    flex: 0 1 auto;
  }

  .table-pagination {
    align-items: stretch;
    flex-direction: column;
  }

  .header-actions > *,
  .form-actions > * {
    flex: 1 1 auto;
  }
}

@media (max-width: 640px) {
  .appearance-panel {
    width: 100vw;
    max-height: 100vh;
    border-radius: 0;
    padding: 16px;
  }

  .appearance-panel-header h2 {
    font-size: 17px;
  }

  .appearance-section-head h3 {
    font-size: 15px;
  }

  .color-preset-grid,
  .radius-grid,
  .density-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .salary-profile-summary-strip,
  .organization-summary-strip,
  .report-ledger-toolbar,
  .report-ledger-totals,
  .dashboard-grid,
  .action-grid,
  .compact-stats-grid,
  .form-grid,
  .settings-grid,
  .salary-profile-modal-fields,
  .user-form,
  .password-form,
  .search-form,
  .table-filter-bar,
  .visual-metrics,
  .workflow-steps {
    grid-template-columns: 1fr;
  }

  .employee-inline-metric {
    justify-content: flex-start;
  }

  .login-form-side {
    padding: 28px 20px;
  }

  .topbar-actions {
    gap: 8px;
  }

  .global-search {
    display: none;
  }

  .page-header h1 {
    font-size: 27px;
  }

  .form-error,
  .form-success {
    top: 18px;
    right: auto;
    left: 50%;
    width: min(360px, calc(100vw - 32px));
  }

  .organization-tree {
    max-height: none;
    min-height: 360px;
  }

  .organization-tree-panel,
  .organization-detail-panel {
    min-height: auto;
  }

  .organization-detail-actions {
    justify-content: flex-start;
  }

  .summary-strip {
    padding: 6px;
  }

  .summary-metric {
    min-width: 0;
    flex-basis: 100%;
  }

  .report-ledger-toolbar {
    padding: 12px;
  }

  .payroll-compact-toolbar,
  .payroll-detail-header {
    padding: 12px;
  }

  .report-ledger-title {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .report-total-item strong {
    font-size: 16px;
  }

  .report-inline-metrics {
    align-items: stretch;
    flex-direction: column;
  }

  .report-inline-metrics span {
    justify-content: space-between;
    width: 100%;
  }

  .salary-profile-list-tools {
    width: 100%;
    justify-content: flex-start;
  }

  .salary-profile-toolbar {
    grid-template-columns: 1fr;
  }

  .salary-profile-toolbar .compact-button {
    width: 100%;
  }

  .salary-profile-list-tools input {
    width: 100%;
  }

  .salary-profile-edit-modal {
    padding: 14px;
  }

  .salary-profile-modal-form {
    padding: 12px;
  }

  .salary-profile-modal-section-title {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

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

@media (prefers-reduced-motion: reduce) {
  :root {
    --motion-duration: 1ms;
    --motion-duration-fast: 1ms;
  }
}
