:root {
  color-scheme: light;
  --bg: #f4f7fa;
  --bg-deep: #edf2f6;
  --panel: #ffffff;
  --line: #dfe7ee;
  --line-strong: #c5d2de;
  --text: #142033;
  --muted: #65758a;
  --brand: #3478f6;
  --brand-dark: #245edb;
  --brand-soft: #edf3ff;
  --accent: #0f766e;
  --accent-soft: #e8f6f3;
  --ok: #087f5b;
  --danger: #b42318;
  --warn: #a15c00;
  --shadow: 0 14px 36px rgba(43, 83, 113, 0.11);
  --soft-shadow: 0 8px 22px rgba(43, 83, 113, 0.08);
  --ui-font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  --sidebar-width: 192px;
  --shell-max: 1440px;
  --content-max: calc(var(--shell-max) - var(--sidebar-width));
}

* {
  box-sizing: border-box;
  scrollbar-width: thin;
  scrollbar-color: #a8b7c5 transparent;
}

[hidden] {
  display: none !important;
}

*::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

*::-webkit-scrollbar-track {
  background: transparent;
}

*::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 999px;
  background: #a8b7c5;
  background-clip: padding-box;
}

*::-webkit-scrollbar-thumb:hover {
  background: #7f93a6;
  background-clip: padding-box;
}

*::-webkit-scrollbar-corner {
  background: transparent;
}

body {
  margin: 0;
  height: 100vh;
  overflow: hidden;
  background: #f3f6f9;
  color: var(--text);
  font-family: var(--ui-font);
  font-size: 13px;
  line-height: 1.45;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

@media (min-width: 1920px) {
  :root {
    --shell-max: 1680px;
  }
}

@media (min-width: 2400px) {
  :root {
    --shell-max: 2200px;
  }
}

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

button {
  border: 0;
  border-radius: 7px;
  background: linear-gradient(135deg, var(--brand), #67b8f8);
  color: #fff;
  padding: 7px 12px;
  cursor: pointer;
  box-shadow: 0 6px 14px rgba(75, 159, 232, 0.18);
  transition: background 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

button:hover {
  background: linear-gradient(135deg, var(--brand-dark), var(--brand));
  transform: translateY(-1px);
}

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

button.secondary {
  border: 1px solid #cce3f7;
  background: rgba(231, 244, 255, 0.92);
  color: var(--brand-dark);
  box-shadow: none;
}

button.secondary:hover {
  background: #d8efff;
}

.link-button {
  border: 0;
  background: transparent;
  color: var(--brand-dark);
  padding: 0;
  text-align: left;
  font-weight: 700;
}

.link-button:hover {
  background: transparent;
  color: var(--brand);
  text-decoration: underline;
}

button.danger {
  background: linear-gradient(135deg, #c1392f, var(--danger));
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.96);
  color: var(--text);
  padding: 6px 8px;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

input:focus,
select:focus,
textarea:focus {
  outline: 0;
  border-color: #7ab9ef;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(75, 159, 232, 0.16);
}

textarea {
  min-height: 72px;
  resize: vertical;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  min-height: 54px;
  padding: 7px 18px 6px;
  background:
    linear-gradient(135deg, rgba(44, 44, 52, 0.95), rgba(44, 44, 52, 0.9) 34%, rgba(58, 128, 184, 0.92)),
    linear-gradient(135deg, #2c2c34, #89c2ff);
  color: #fff;
  border-bottom: 1px solid rgba(137, 194, 255, 0.34);
  box-shadow: none;
}

.brand-lockup {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-width: 0;
}

.brand-logo {
  display: block;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  box-shadow: 0 8px 20px rgba(15, 118, 110, 0.18);
}

.topbar h1 {
  margin: 0 0 3px;
  font-size: 21px;
  letter-spacing: 0;
  white-space: nowrap;
}

.app-version {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  margin-left: 7px;
  padding: 2px 7px;
  border: 1px solid rgba(75, 159, 232, 0.22);
  border-radius: 999px;
  background: rgba(231, 244, 255, 0.75);
  color: var(--brand-dark);
  font-size: 12px;
  font-weight: 700;
  vertical-align: middle;
}

.topbar p {
  margin: 0;
  color: rgba(230, 247, 255, 0.8);
  font-size: 13px;
  white-space: nowrap;
}

.top-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
  min-width: 0;
  flex: 1 1 auto;
}

.period-control {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  flex: 0 0 auto;
  color: rgba(255, 255, 255, 0.85);
  font-size: 13px;
  line-height: 1.1;
}

.period-stepper {
  display: grid;
  grid-template-columns: 28px 82px 66px 28px 44px;
  align-items: stretch;
  gap: 4px;
}

.period-stepper #periodYearSelect,
.period-stepper #periodMonthSelect {
  min-width: 0;
  width: 100%;
  padding-left: 7px;
  padding-right: 22px;
}

.period-stepper .period-step,
.period-stepper .period-current {
  min-width: 0;
  min-height: 34px;
  padding: 4px;
  border-color: rgba(255, 255, 255, 0.5);
  background: rgba(255, 255, 255, 0.92);
  color: #35516c;
}

.period-stepper .period-step {
  font-size: 20px;
  line-height: 1;
}

.period-stepper .period-current {
  font-size: 12px;
}

.period-stepper .period-current:disabled {
  background: #edf4fa;
  color: #8a9bad;
  cursor: default;
}

body.period-switching .view {
  cursor: progress;
}

.top-actions input,
.top-actions select {
  border-color: rgba(255, 255, 255, 0.5);
  background: rgba(255, 255, 255, 0.92);
  min-height: 34px;
  padding: 6px 9px;
}

.topbar .period-stepper button {
  border-color: #dbe6f0;
  background: #fff;
}

.top-actions > select {
  flex: 0 1 360px;
  min-width: 220px;
}

#serverStatus {
  flex: 0 0 auto;
  white-space: nowrap;
}

.login-screen {
  display: grid;
  grid-template-columns: minmax(380px, 1fr) minmax(360px, 400px);
  gap: clamp(56px, 8vw, 112px);
  align-items: center;
  justify-content: center;
  width: min(1120px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: 56px 48px;
  background: #f4f7fa;
}

body.login-mode {
  grid-template-rows: minmax(0, 1fr);
  background: #f4f7fa;
}

body.login-mode .topbar {
  display: none;
}

body.login-mode .app-shell {
  width: 100%;
  max-width: none;
  min-height: 100vh;
  background: #f4f7fa;
}

body.login-mode .app-shell.login-only .view {
  min-height: 100vh;
  padding: 0;
  background: #f4f7fa;
}

.login-brand,
.login-panel {
  min-width: 0;
}

.login-brand {
  max-width: 520px;
  padding-left: 8px;
}

.login-logo {
  display: block;
  width: 80px;
  height: 80px;
  margin-bottom: 22px;
  border-radius: 20px;
  box-shadow: 0 12px 30px rgba(31, 72, 105, 0.14);
}

.login-kicker {
  display: block;
  color: #2b6cb0;
  font-size: 12px;
  font-weight: 600;
}

.login-brand h2 {
  margin: 14px 0 12px;
  color: #0f172a;
  font-size: 54px;
  line-height: 1;
  letter-spacing: 0;
}

.login-brand p {
  margin: 0;
  color: #40536a;
  font-size: 18px;
  font-weight: 500;
}

.login-points {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  margin-top: 30px;
}

.login-points span {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 0 14px;
  border-right: 1px solid #cbd8e3;
  color: #5c6f82;
  font-size: 13px;
  font-weight: 500;
}

.login-points span:first-child {
  padding-left: 0;
}

.login-points span:last-child {
  border-right: 0;
}

.login-panel {
  width: min(400px, 100%);
  padding: 28px 30px 24px;
  border: 1px solid #dbe5ed;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 16px 40px rgba(31, 61, 86, 0.1);
}

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

.login-panel h2 {
  margin: 0;
  font-size: 22px;
}

.login-panel > .hint {
  margin: 0 0 20px;
  color: #718095;
  font-size: 12px;
  line-height: 1.6;
}

.login-panel .field {
  display: grid;
  gap: 6px;
  margin-top: 13px;
  color: #40536a;
  font-size: 12px;
  font-weight: 600;
}

.login-panel input {
  min-height: 44px;
  border-color: #cedae4;
  border-radius: 6px;
  background: #fbfcfd;
  font-size: 14px;
}

.login-panel input:focus {
  background: #fff;
}

.login-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 112px;
  gap: 8px;
  margin-top: 20px;
}

.login-actions button {
  min-height: 44px;
  border-radius: 6px;
  box-shadow: none;
  font-size: 13px;
}

.login-footnote {
  margin: 18px 0 0;
  padding-top: 13px;
  border-top: 1px solid #edf1f5;
  color: #718198;
  font-size: 11px;
  line-height: 1.45;
}

.app-shell {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  background:
    linear-gradient(180deg, rgba(226, 240, 249, 0.9), rgba(238, 246, 251, 0.72) 54px, transparent 54px);
  min-height: 0;
}

.app-shell.login-only {
  display: block;
  overflow: auto;
}

.tabs {
  padding: 10px 10px 14px;
  background:
    linear-gradient(180deg, rgba(226, 240, 249, 0.96), rgba(251, 253, 255, 0.72) 58px);
  border-right: 1px solid rgba(184, 201, 216, 0.78);
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(18px);
  overflow-y: auto;
}

.tab {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin-bottom: 5px;
  padding: 9px 11px;
  text-align: left;
  background: transparent;
  color: var(--text);
  font-size: 15px;
  border-radius: 8px;
  border: 1px solid transparent;
  box-shadow: none;
}

.tab:hover,
.tab.active {
  background: linear-gradient(135deg, rgba(231, 244, 255, 0.95), rgba(240, 235, 250, 0.9));
  color: var(--brand-dark);
  border-color: #cce3f7;
  box-shadow: var(--soft-shadow);
}

.nav-icon {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid #cfe2f2;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--brand-dark);
  font-size: 15px;
  line-height: 1;
}

.view {
  padding: 0 18px 18px;
  overflow: auto;
  min-height: 0;
}

.view > :not(.workspace-nav) {
  width: min(100%, var(--content-max));
  margin-left: auto;
  margin-right: auto;
}

.workspace-nav {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  min-height: 54px;
  margin: 0 -18px 14px;
  padding: 8px 18px;
  border-bottom: 1px solid rgba(184, 201, 216, 0.86);
  background:
    linear-gradient(180deg, rgba(226, 240, 249, 0.97), rgba(246, 251, 255, 0.94));
  box-shadow: 0 8px 18px rgba(43, 83, 113, 0.08);
  backdrop-filter: blur(18px);
}

.workspace-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 2px 0;
}

.workspace-tab {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  flex: 0 0 auto;
  max-width: 170px;
  min-height: 35px;
  padding: 6px 11px;
  border: 1px solid rgba(184, 201, 216, 0.88);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.7);
  color: var(--text);
  box-shadow: none;
}

.workspace-tab span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace-tab.active {
  border-color: rgba(75, 159, 232, 0.62);
  background: linear-gradient(180deg, rgba(231, 244, 255, 0.98), rgba(216, 239, 255, 0.92));
  color: var(--brand-dark);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.88);
}

.workspace-tab-close {
  color: var(--muted);
  font-weight: 700;
}

.workspace-actions {
  display: flex;
  gap: 7px;
  align-items: center;
}

.workspace-nav > button,
.workspace-actions > button {
  min-height: 35px;
  padding: 6px 12px;
}
.dashboard {
  display: grid;
  gap: 14px;
}

.dashboard-hero {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(360px, 1.45fr);
  gap: 14px;
  align-items: stretch;
}

.account-card {
  display: grid;
  gap: 14px;
  min-height: 220px;
  padding: 18px;
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(44, 44, 52, 0.94), rgba(44, 44, 52, 0.86) 48%, rgba(75, 159, 232, 0.86)),
    linear-gradient(135deg, #2c2c34, #89c2ff);
  color: #fff;
  box-shadow: var(--shadow);
}

.account-card h2 {
  margin: 0 0 8px;
  font-size: 23px;
}

.account-card p {
  margin: 0;
  color: rgba(255, 255, 255, 0.82);
}

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

.account-meta span,
.account-meta strong {
  display: block;
}

.account-meta span {
  margin-bottom: 4px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 13px;
}

.account-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-self: end;
}

.account-actions button {
  background: #fff;
  color: var(--brand-dark);
}

.account-actions button:hover {
  background: #eaf7fb;
}

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

.kpi-card {
  display: grid;
  gap: 6px;
  min-height: 104px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(251, 253, 255, 0.86);
  box-shadow: var(--soft-shadow);
}

.kpi-card span {
  color: var(--muted);
  font-size: 14px;
}

.kpi-card strong {
  font-size: 22px;
}

.kpi-card small {
  color: var(--muted);
  line-height: 1.35;
}

.workbench {
  display: grid;
  grid-template-columns: minmax(280px, 0.95fr) minmax(360px, 1.45fr);
  gap: 14px;
}

.quick-panel,
.health-panel {
  background: rgba(251, 253, 255, 0.86);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  box-shadow: var(--soft-shadow);
}

.quick-list,
.health-list {
  display: grid;
  gap: 8px;
}

.quick-action,
.health-item {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  width: 100%;
  padding: 10px;
  border: 1px solid #dde8f1;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--text);
  text-align: left;
  box-shadow: none;
}

.quick-action:hover {
  border-color: #aed8f6;
  background: #f2f9ff;
}

.quick-action strong,
.health-item strong {
  display: block;
  margin-bottom: 3px;
}

.quick-action small,
.health-item small {
  color: var(--muted);
}

.quick-icon,
.health-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--brand-soft), var(--accent-soft));
  color: var(--brand-dark);
  font-size: 18px;
}

.quick-arrow {
  color: var(--muted);
  font-size: 20px;
}

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

.section-title h2 {
  margin: 0;
  font-size: 21px;
}

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

.grid {
  display: grid;
  gap: 12px;
}

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

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

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

.panel {
  background: rgba(251, 253, 255, 0.9);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  box-shadow: var(--soft-shadow);
}

.panel h3 {
  margin: 0 0 12px;
  font-size: 16px;
}

.report-check-panel {
  margin-top: 14px;
}

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

.metric strong {
  font-size: 22px;
}

.module-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 12px;
  align-items: stretch;
  margin: 14px 0;
}

.module-home-title {
  margin-bottom: 4px;
}

.module-group-list {
  border-top: 1px solid #dce6ef;
}

.module-group {
  display: grid;
  grid-template-columns: 154px minmax(0, 1fr);
  gap: 22px;
  padding: 18px 0;
  border-bottom: 1px solid #dce6ef;
}

.module-group-heading {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 8px;
  align-content: start;
  padding-top: 4px;
}

.module-group-index {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid #cfe0ee;
  border-radius: 7px;
  background: #eef6fc;
  color: #2563a6;
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.module-group-heading h3 {
  margin: 1px 0 5px;
  color: #24364a;
  font-size: 14px;
}

.module-group-heading p {
  margin: 0;
  color: #7a8999;
  font-size: 12px;
  line-height: 1.45;
}

.module-group > .module-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0;
}

.module-group .module-tile {
  min-height: 82px;
  box-shadow: 0 6px 18px rgba(44, 62, 80, 0.04);
}

.module-tile {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-height: 88px;
  padding: 12px;
  border: 1px solid #dce8f1;
  border-radius: 8px;
  background: rgba(251, 253, 255, 0.86);
  color: var(--text);
  text-align: left;
  box-shadow: var(--soft-shadow);
}

.module-tile:hover {
  border-color: #afd8f7;
  background: #f3faff;
}

.module-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 1px solid #cfe3f2;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--brand-soft), var(--accent-soft));
  color: var(--brand-dark);
  font-size: 22px;
}

.module-tile strong {
  display: block;
  margin-bottom: 4px;
  font-size: 16px;
}

.module-tile small {
  max-width: 190px;
  color: var(--muted);
  line-height: 1.35;
}

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

.help-index {
  position: sticky;
  top: 12px;
  display: grid;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.help-index > strong {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}

.help-index a {
  display: grid;
  gap: 2px;
  padding: 10px 14px;
  border-bottom: 1px solid #edf2f6;
  color: var(--text);
  font-size: 13px;
  text-decoration: none;
}

.help-index a:last-child {
  border-bottom: 0;
}

.help-index a:hover {
  background: #f2f7fd;
  color: var(--brand);
}

.help-index small {
  color: var(--muted);
  font-size: 11px;
}

.help-content {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.help-content section {
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
  scroll-margin-top: 16px;
}

.help-content section:last-child {
  border-bottom: 0;
}

.help-section-heading {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.help-section-heading > span,
.help-tip-list article > span {
  color: var(--brand);
  font-size: 12px;
  font-weight: 700;
}

.help-section-heading h3,
.help-tip-list h3 {
  margin: 0;
  font-size: 16px;
}

.help-section-heading p,
.help-tip-list p {
  margin: 3px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.help-content ol {
  display: grid;
  gap: 7px;
  margin: 14px 0 0 42px;
  padding: 0;
  color: #33475b;
  line-height: 1.6;
}

.help-tips-panel {
  padding: 0;
  overflow: hidden;
}

.help-tip-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.help-tip-list article {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 10px;
  min-height: 92px;
  padding: 16px 18px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.help-tip-list article:nth-child(2n) {
  border-right: 0;
}

.help-tip-list article:nth-last-child(-n+2) {
  border-bottom: 0;
}

.release-history {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.release-entry {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 24px;
  padding: 22px 24px;
  border-bottom: 1px solid var(--line);
}

.release-entry:last-child {
  border-bottom: 0;
}

.release-entry.current {
  border-left: 3px solid var(--brand);
  background: #f8fbff;
}

.release-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-content: start;
  align-items: center;
}

.release-meta strong {
  color: #17283d;
  font-size: 20px;
}

.release-meta span {
  padding: 2px 7px;
  border-radius: 4px;
  background: #dff6ed;
  color: #08765f;
  font-size: 11px;
  font-weight: 600;
}

.release-meta time {
  flex-basis: 100%;
  color: var(--muted);
  font-size: 12px;
}

.release-body h3 {
  margin: 0 0 10px;
  font-size: 16px;
}

.release-body ul {
  display: grid;
  gap: 7px;
  margin: 0;
  padding-left: 20px;
  color: #405369;
  line-height: 1.6;
}

.report-template-switch {
  display: flex;
  gap: 4px;
  width: fit-content;
  margin: 0 0 12px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f4f7fa;
}

.report-template-switch button {
  min-height: 30px;
  padding: 5px 12px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: #5c6d7f;
  font-size: 12px;
  box-shadow: none;
}

.report-template-switch button:hover {
  background: #eaf2f9;
  color: var(--brand-dark);
}

.report-template-switch button.active {
  background: #fff;
  color: var(--brand-dark);
  box-shadow: 0 1px 4px rgba(45, 74, 101, 0.14);
}

.custom-report-result {
  display: grid;
  gap: 12px;
}

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

.query-range-controls {
  margin-bottom: 14px;
}

.cash-bank-filter-grid {
  grid-template-columns: minmax(150px, 0.9fr) minmax(170px, 1fr) minmax(170px, 1fr) minmax(220px, 1.25fr);
  margin-bottom: 10px;
}

.ledger-filter-grid {
  grid-template-columns: minmax(150px, 0.85fr) minmax(170px, 1fr) minmax(170px, 1fr) minmax(240px, 1.35fr);
  margin-bottom: 10px;
}

.multi-column-filter-grid {
  grid-template-columns: minmax(130px, 0.7fr) minmax(145px, 0.8fr) minmax(145px, 0.8fr) minmax(240px, 1.3fr) auto;
  margin-bottom: 10px;
}

.auxiliary-filter-grid {
  grid-template-columns: minmax(320px, 1.45fr) minmax(240px, 1fr);
  margin-bottom: 10px;
}

.auxiliary-balance-filter-grid {
  grid-template-columns: minmax(180px, 0.7fr) minmax(280px, 1.25fr) auto;
  margin-bottom: 10px;
}

.auxiliary-ledger-range-grid {
  grid-template-columns: minmax(135px, 0.7fr) minmax(145px, 0.8fr) minmax(145px, 0.8fr) minmax(260px, 1.45fr) minmax(200px, 1fr);
  margin-bottom: 10px;
}

.auxiliary-balance-range-grid {
  grid-template-columns: minmax(130px, 0.7fr) minmax(145px, 0.8fr) minmax(145px, 0.8fr) minmax(150px, 0.75fr) minmax(230px, 1.25fr) auto;
  margin-bottom: 10px;
}

.auxiliary-balance-filter-grid .compact-check,
.auxiliary-balance-range-grid .compact-check,
.multi-column-filter-grid .compact-check {
  display: flex;
  flex-direction: row;
  gap: 7px;
  align-items: center;
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f8fafc;
  color: #40546a;
  white-space: nowrap;
}

.auxiliary-balance-filter-grid .compact-check input,
.auxiliary-balance-range-grid .compact-check input,
.multi-column-filter-grid .compact-check input {
  width: auto;
  margin: 0;
}

.ledger-result-table {
  min-width: 0;
  margin-top: 0;
}

.ledger-result-table table {
  font-family: var(--ui-font);
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
}

.ledger-result-table th,
.ledger-result-table td {
  white-space: nowrap;
}

.ledger-summary-strip {
  display: flex;
  gap: 0;
  align-items: stretch;
  min-height: 46px;
  margin-bottom: 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f8fafc;
  overflow: hidden;
}

.ledger-summary-strip > span {
  display: flex;
  flex: 0 1 190px;
  gap: 8px;
  align-items: baseline;
  min-width: 0;
  padding: 10px 12px;
  border-right: 1px solid var(--line);
}

.ledger-summary-strip > span:last-child {
  border-right: 0;
}

.ledger-summary-strip .summary-wide {
  flex: 1 1 420px;
}

.ledger-summary-strip small {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 12px;
}

.ledger-summary-strip strong {
  min-width: 0;
  overflow: hidden;
  color: #1d2b3d;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.quantity-ledger-table table {
  min-width: 1240px;
  table-layout: fixed;
  font-size: 12.5px;
}

.quantity-ledger-table .table-wrap {
  overflow-x: auto;
}

.quantity-ledger-table th,
.quantity-ledger-table td {
  padding: 6px 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.quantity-ledger-table th:nth-child(1) {
  width: 8%;
}

.quantity-ledger-table th:nth-child(2) {
  width: 10%;
}

.quantity-ledger-table th:nth-child(3) {
  width: 10%;
}

.quantity-ledger-table th:nth-child(4),
.quantity-ledger-table th:nth-child(7),
.quantity-ledger-table th:nth-child(10) {
  width: 6.5%;
}

.quantity-ledger-table th:nth-child(5),
.quantity-ledger-table th:nth-child(8),
.quantity-ledger-table th:nth-child(11) {
  width: 7.5%;
}

.quantity-ledger-table th:nth-child(6),
.quantity-ledger-table th:nth-child(9),
.quantity-ledger-table th:nth-child(12) {
  width: 10%;
}

.quantity-ledger-table td:nth-child(n+4) {
  font-family: var(--ui-font);
  font-variant-numeric: tabular-nums;
}

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

.large-textarea {
  min-height: 190px;
  font-family: var(--ui-font);
}

.compact-list {
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
  line-height: 1.7;
}

.wide-field {
  grid-column: span 2;
}

.check-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  min-height: 39px;
  align-items: center;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.84);
}

.check-row label {
  display: inline-flex;
  grid-template-columns: none;
  gap: 5px;
  align-items: center;
  color: var(--text);
  white-space: nowrap;
}

.check-row input {
  width: auto;
}

.subnav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.subnav-item {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.84);
  color: var(--text);
  box-shadow: none;
}

.subnav-item:hover,
.subnav-item.active {
  border-color: #8fc5ee;
  background: linear-gradient(135deg, var(--brand), #79bdf4);
  color: #fff;
}

.account-code {
  display: inline-block;
  min-width: 72px;
  font-family: "Consolas", "Microsoft YaHei", monospace;
}

.account-code.level-2 {
  color: var(--brand-dark);
}

.account-code.level-3,
.account-code.level-4 {
  color: var(--muted);
}
.actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.table-wrap {
  overflow: auto;
  max-height: min(62vh, 680px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

.panel > .table-wrap:only-child {
  max-height: min(68vh, 760px);
}

.voucher-scroll-table-panel {
  padding: 0;
  overflow: hidden;
}

.voucher-scroll-table-panel > .table-wrap {
  max-height: min(66vh, 740px);
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.voucher-scroll-table-panel th {
  position: sticky;
  top: 0;
  z-index: 2;
}

.voucher-list-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 46px;
  margin-bottom: 10px;
  padding: 7px 10px;
}

.voucher-list-toolbar .actions {
  gap: 6px;
  flex-wrap: nowrap;
}

.voucher-list-toolbar button.is-active {
  border-color: rgba(24, 90, 86, 0.34);
  background: var(--brand-soft);
  color: var(--brand-dark);
}

.voucher-list-pagination {
  display: flex;
  min-height: 42px;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-top: 0;
  background: var(--surface);
}

.voucher-list-pagination .actions {
  gap: 4px;
  flex-wrap: nowrap;
}

.voucher-list-pagination .icon-button {
  width: 32px;
  min-width: 32px;
  height: 30px;
  padding: 0;
  font-size: 18px;
  line-height: 1;
}

.voucher-list-query-panel {
  margin-bottom: 10px;
  padding: 10px 12px;
}

.voucher-list-query-panel.is-collapsed {
  display: none;
}

.voucher-list-query-grid {
  grid-template-columns: minmax(132px, 0.75fr) minmax(145px, 0.8fr) minmax(145px, 0.8fr) minmax(260px, 1.7fr) auto;
}

.voucher-list-keyword {
  min-width: 0;
}

.voucher-list-query-actions {
  gap: 6px;
  align-self: end;
  flex-wrap: nowrap;
}

.voucher-list-grouped-table {
  max-height: min(68vh, 780px);
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.voucher-list-grouped-table table {
  min-width: 1720px;
  table-layout: auto;
}

.voucher-list-grouped-table th,
.voucher-list-grouped-table td {
  padding: 7px 8px;
  vertical-align: middle;
}

.voucher-list-grouped-table th:nth-child(1) { width: 36px; }
.voucher-list-grouped-table th:nth-child(2) { width: 76px; }
.voucher-list-grouped-table th:nth-child(3) { width: 100px; }
.voucher-list-grouped-table th:nth-child(4) { width: 118px; }
.voucher-list-grouped-table th:nth-child(5) { width: 86px; }
.voucher-list-grouped-table th:nth-child(6) { width: 50px; }
.voucher-list-grouped-table th:nth-child(7) { min-width: 160px; }
.voucher-list-grouped-table th:nth-child(8) { width: 92px; }
.voucher-list-grouped-table th:nth-child(9) { min-width: 160px; }
.voucher-list-grouped-table th:nth-child(10) { min-width: 210px; }

.voucher-list-grouped-table .voucher-list-meta,
.voucher-list-grouped-table .voucher-list-entry-index,
.voucher-list-grouped-table .voucher-list-select-cell {
  text-align: center;
  white-space: nowrap;
}

.voucher-list-grouped-table .voucher-list-number {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.voucher-list-grouped-table .voucher-list-entry-index {
  color: var(--muted);
}

.voucher-list-grouped-table .voucher-list-auxiliary {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.voucher-list-grouped-table .is-group-start td {
  border-top: 2px solid #cfc7bb;
}

.voucher-list-grouped-table tbody tr:first-child td {
  border-top: 0;
}

.voucher-list-grouped-table .voucher-list-group-row.is-selected td {
  background: #edf6f2;
}

.voucher-list-selector {
  width: 16px;
  height: 16px;
  accent-color: var(--brand);
}

.voucher-list-actions-cell {
  min-width: 176px;
}

.voucher-list-row-actions {
  gap: 4px;
  justify-content: center;
  flex-wrap: nowrap;
}

.voucher-list-row-actions button {
  min-height: 28px;
  padding: 4px 7px;
  white-space: nowrap;
}

.voucher-search-panel {
  margin-bottom: 10px;
  padding: 12px 14px;
}

.voucher-search-controls {
  display: grid;
  grid-template-columns:
    minmax(132px, 0.82fr)
    minmax(136px, 0.9fr)
    minmax(136px, 0.9fr)
    minmax(170px, 1.08fr)
    minmax(240px, 1.8fr)
    auto;
  gap: 8px;
  align-items: end;
}

.voucher-search-controls label {
  display: grid;
  gap: 4px;
  min-width: 0;
  color: var(--muted);
  font-size: 11px;
}

.voucher-search-controls input,
.voucher-search-controls select,
.voucher-search-controls .searchable-select-input,
.voucher-search-controls .actions button {
  min-height: 32px;
}

.voucher-search-controls input,
.voucher-search-controls select {
  padding: 6px 8px;
  font-size: 13px;
}

.voucher-search-controls .actions button {
  padding: 6px 10px;
  font-size: 13px;
}

.voucher-search-controls .voucher-search-range {
  display: contents;
}

.voucher-search-keyword {
  min-width: 0;
}

.voucher-search-controls .actions {
  gap: 6px;
  flex-wrap: nowrap;
}

.voucher-search-summary {
  margin-bottom: 10px;
}

.voucher-search-summary > span {
  flex: 0 1 145px;
}

.voucher-search-summary .summary-money {
  flex: 1 1 220px;
}

.voucher-search-result-table .table-wrap {
  overflow-x: hidden;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.voucher-search-result-table table {
  min-width: 0;
  table-layout: fixed;
}

.voucher-search-result-table th:nth-child(1) { width: 10%; }
.voucher-search-result-table th:nth-child(2) { width: 12%; }
.voucher-search-result-table th:nth-child(3) { width: 19%; }
.voucher-search-result-table th:nth-child(4) { width: 24%; }
.voucher-search-result-table th:nth-child(5) { width: 10%; }
.voucher-search-result-table th:nth-child(6) { width: 10%; }
.voucher-search-result-table th:nth-child(7) { width: 6%; }
.voucher-search-result-table th:nth-child(8) { width: 9%; }

.voucher-search-result-table td:nth-child(3),
.voucher-search-result-table td:nth-child(4) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.voucher-number-link {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--brand-dark);
  font-weight: 700;
  box-shadow: none;
}

.voucher-number-link:hover {
  background: transparent;
  color: var(--brand);
  text-decoration: underline;
}

.voucher-search-row-actions {
  display: grid;
  grid-template-columns: repeat(3, 25px);
  gap: 4px;
  min-width: 79px;
  flex-wrap: nowrap;
}

.voucher-search-row-actions button {
  display: grid;
  width: 25px;
  height: 25px;
  min-height: 25px;
  padding: 0;
  place-items: center;
  font-size: 14px;
  line-height: 1;
}

@media (max-width: 1280px) {
  .voucher-search-controls {
    grid-template-columns:
      minmax(122px, 0.78fr)
      minmax(132px, 0.86fr)
      minmax(132px, 0.86fr)
      minmax(155px, 1fr)
      minmax(210px, 1.55fr)
      auto;
  }
}

@media (max-width: 1080px) {
  .voucher-search-controls {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .voucher-search-keyword {
    grid-column: span 2;
  }
}

table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  font-size: 13px;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 7px 9px;
  text-align: left;
  vertical-align: top;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: linear-gradient(180deg, #f5f9fc, #eef5fa);
  color: #304154;
  font-weight: 600;
  white-space: nowrap;
}

td.number,
th.number {
  text-align: right;
}

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

.cash-bank-journal-table table {
  min-width: 920px;
  table-layout: fixed;
}

.cash-bank-journal-table th:nth-child(1) {
  width: 108px;
}

.cash-bank-journal-table th:nth-child(2) {
  width: 132px;
}

.cash-bank-journal-table th:nth-child(3) {
  width: 16%;
}

.cash-bank-journal-table th:nth-child(4) {
  width: 22%;
}

.cash-bank-journal-table th:nth-child(5),
.cash-bank-journal-table th:nth-child(6),
.cash-bank-journal-table th:nth-child(7) {
  width: 130px;
}

.cash-bank-journal-table td:nth-child(5),
.cash-bank-journal-table td:nth-child(6),
.cash-bank-journal-table td:nth-child(7) {
  white-space: nowrap;
}

.cash-journal-row {
  cursor: pointer;
}

.cash-journal-link {
  color: var(--brand-dark);
  font-weight: 700;
}

.cash-journal-row:hover td,
.cash-journal-row:focus td,
.cash-journal-row:focus-within td {
  background: #f1f7fd;
}

.cash-journal-row:hover .cash-journal-link,
.cash-journal-row:focus .cash-journal-link {
  color: var(--brand);
  text-decoration: underline;
}

.cash-journal-row:focus {
  outline: 2px solid #93c5fd;
  outline-offset: -2px;
}

.ledger-drilldown-row {
  cursor: pointer;
}

.ledger-voucher-link {
  color: var(--brand-dark);
  font-weight: 700;
}

.ledger-drilldown-row:hover td,
.ledger-drilldown-row:focus td,
.ledger-drilldown-row:focus-within td {
  background: #f1f7fd;
}

.ledger-drilldown-row:hover .ledger-voucher-link,
.ledger-drilldown-row:focus .ledger-voucher-link {
  color: var(--brand);
  text-decoration: underline;
}

.ledger-drilldown-row:focus {
  outline: 2px solid #93c5fd;
  outline-offset: -2px;
}

.ledger-workspace-layout {
  display: grid;
  grid-template-columns: 214px minmax(0, 1fr);
  gap: 10px;
  align-items: stretch;
}

.ledger-side-browser {
  display: flex;
  flex-direction: column;
  min-height: 0;
  max-height: calc(min(62vh, 680px) + 46px);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fffdfa;
}

.ledger-side-browser-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex: 0 0 46px;
  gap: 8px;
  min-height: 46px;
  padding: 6px 9px;
  border-bottom: 1px solid var(--line);
  background: #fbf8f2;
  color: var(--text);
  font-size: 12px;
}

.ledger-side-browser-title {
  display: flex;
  gap: 6px;
  align-items: baseline;
  min-width: 0;
}

.ledger-side-browser-title strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ledger-side-browser-title > span {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 11px;
}

.ledger-side-toggle {
  display: flex;
  flex: 0 0 auto;
  gap: 4px;
  align-items: center;
  min-height: 24px;
  padding: 2px 4px;
  color: var(--muted);
  font-size: 10px;
  white-space: nowrap;
}

.ledger-side-toggle input {
  width: auto;
  margin: 0;
}

.ledger-side-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: 0 4px 4px;
  background: #fffdfa;
}

.ledger-workspace-layout .table-wrap {
  border-radius: 7px;
}

.ledger-side-item {
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr);
  gap: 6px;
  align-items: center;
  width: 100%;
  min-height: 29px;
  padding: 5px 7px 5px calc(7px + var(--ledger-side-indent, 0px));
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--text);
  box-shadow: none;
  font-size: 12px;
  line-height: 1.35;
  text-align: left;
}

.ledger-side-item.level-2 { --ledger-side-indent: 10px; }
.ledger-side-item.level-3 { --ledger-side-indent: 20px; }
.ledger-side-item.level-4 { --ledger-side-indent: 30px; }
.ledger-side-item.level-5 { --ledger-side-indent: 40px; }
.ledger-side-item.level-6 { --ledger-side-indent: 50px; }

.ledger-side-item:hover {
  background: #f3f6f2;
  color: var(--brand-dark);
}

.ledger-side-item.is-parent {
  color: var(--text);
  font-weight: 700;
}

.ledger-side-item.is-active {
  background: #e9f2ef;
  color: var(--brand-dark);
  box-shadow: inset 3px 0 0 var(--brand);
}

.ledger-side-code,
.ledger-side-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ledger-side-code {
  color: var(--muted);
  font-family: var(--ui-font);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.ledger-side-empty {
  padding: 14px 10px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.detail-ledger-table {
  min-width: 0;
}

.detail-ledger-table table {
  min-width: 820px;
  table-layout: fixed;
}

.detail-ledger-table th:nth-child(1) { width: 100px; }
.detail-ledger-table th:nth-child(2) { width: 126px; }
.detail-ledger-table th:nth-child(3) { width: 22%; }
.detail-ledger-table th:nth-child(4) { width: 24%; }
.detail-ledger-table th:nth-child(5),
.detail-ledger-table th:nth-child(6),
.detail-ledger-table th:nth-child(8) { width: 112px; }
.detail-ledger-table th:nth-child(7) { width: 58px; }

.detail-ledger-table td:nth-child(1),
.detail-ledger-table td:nth-child(2),
.detail-ledger-table td:nth-child(5),
.detail-ledger-table td:nth-child(6),
.detail-ledger-table td:nth-child(7),
.detail-ledger-table td:nth-child(8) {
  white-space: nowrap;
}

.multi-column-ledger-table table {
  min-width: calc(820px + var(--multi-column-count, 2) * 82px);
  table-layout: fixed;
}

.multi-column-ledger-table th,
.multi-column-ledger-table td {
  padding: 7px 6px;
}

.multi-column-ledger-table th:nth-child(1) { width: 76px; }
.multi-column-ledger-table th:nth-child(2) { width: 96px; }
.multi-column-ledger-table th:nth-child(3) { width: 44px; }
.multi-column-ledger-table th:nth-child(4) { width: 88px; }
.multi-column-ledger-table th:nth-child(5) { width: 108px; }
.multi-column-ledger-table th:nth-child(6) { width: 150px; }
.multi-column-ledger-table th:nth-child(7),
.multi-column-ledger-table th:nth-child(8) { width: 78px; }
.multi-column-ledger-table th:nth-child(9) { width: 48px; }
.multi-column-ledger-table th:nth-child(10) { width: 82px; }
.multi-column-ledger-table th:nth-child(n+11) { width: 82px; }

.auxiliary-ledger-table table {
  min-width: 820px;
  table-layout: fixed;
}

.auxiliary-ledger-table th:nth-child(1) { width: 98px; }
.auxiliary-ledger-table th:nth-child(2) { width: 124px; }
.auxiliary-ledger-table th:nth-child(3) { width: 24%; }
.auxiliary-ledger-table th:nth-child(4) { width: 23%; }
.auxiliary-ledger-table th:nth-child(5),
.auxiliary-ledger-table th:nth-child(6),
.auxiliary-ledger-table th:nth-child(7) { width: 112px; }

.auxiliary-balance-table table {
  min-width: 980px;
}

.balance-table-result .balance-account-name {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.balance-table-result .balance-account-name.level-1 {
  font-weight: 700;
}

.balance-table-result .balance-account-name.level-2 { padding-left: 18px; }
.balance-table-result .balance-account-name.level-3 { padding-left: 36px; }
.balance-table-result .balance-account-name.level-4 { padding-left: 54px; }
.balance-table-result .balance-account-name.level-5 { padding-left: 72px; }
.balance-table-result .balance-account-name.level-6 { padding-left: 90px; }

.expense-detail-table table {
  min-width: 900px;
  table-layout: fixed;
}

.expense-detail-table th:nth-child(1) { width: 12%; }
.expense-detail-table th:nth-child(2) { width: 11%; }
.expense-detail-table th:nth-child(3) { width: 24%; }
.expense-detail-table th:nth-child(4),
.expense-detail-table th:nth-child(5),
.expense-detail-table th:nth-child(6) { width: 15%; }
.expense-detail-table th:nth-child(7) { width: 8%; }

.expense-detail-table td {
  white-space: nowrap;
}

.expense-detail-table td:nth-child(3) {
  overflow: hidden;
  text-overflow: ellipsis;
}

.receivable-payable-table table {
  min-width: 1106px;
  table-layout: fixed;
}

.receivable-payable-table th:nth-child(1) { width: 86px; }
.receivable-payable-table th:nth-child(2) { width: 210px; }
.receivable-payable-table th:nth-child(3) { width: 112px; }
.receivable-payable-table th:nth-child(4),
.receivable-payable-table th:nth-child(5),
.receivable-payable-table th:nth-child(6),
.receivable-payable-table th:nth-child(7),
.receivable-payable-table th:nth-child(8),
.receivable-payable-table th:nth-child(9) { width: 86px; }
.receivable-payable-table th:nth-child(10) { width: 92px; }
.receivable-payable-table th:nth-child(11) { width: 90px; }

.receivable-payable-table td {
  white-space: nowrap;
}

.receivable-payable-table td:nth-child(2),
.receivable-payable-table td:nth-child(3) {
  overflow: hidden;
  text-overflow: ellipsis;
}

.receivable-payable-table .management-auxiliary-link {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 1080px) {
  .ledger-workspace-layout {
    grid-template-columns: 188px minmax(0, 1fr);
  }
}

@media (max-width: 760px) {
  .ledger-workspace-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .ledger-side-list {
    max-height: 220px;
  }
}

.account-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 10px;
}

.account-strip span {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  min-height: 30px;
  padding: 5px 10px;
  border: 1px solid #cfe0ee;
  border-radius: 6px;
  background: #f5faff;
  color: var(--muted);
  font-size: 13px;
}

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

.account-list-panel {
  padding: 0;
  overflow: hidden;
}

.account-query-panel {
  margin-bottom: 12px;
}

.account-query-controls {
  display: flex;
  align-items: end;
  flex-wrap: wrap;
  gap: 10px 14px;
}

.account-query-controls label {
  display: grid;
  gap: 5px;
  min-width: 190px;
  color: var(--muted);
  font-size: 13px;
}

.account-query-controls input,
.account-query-controls select {
  min-height: 34px;
}

.account-query-controls .hint {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
}

.account-table-wrap {
  max-height: min(68vh, 760px);
  overflow: auto;
  background: #fff;
}

.account-table {
  min-width: 1280px;
  font-size: 13px;
}

.account-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 8px 9px;
  background: #eaf4fc;
  border-bottom: 1px solid #bfd5e8;
  color: #203348;
}

.account-table td {
  padding: 8px 9px;
  border-bottom: 1px solid #d9e7f1;
  vertical-align: middle;
  white-space: nowrap;
}

.account-table tbody tr:hover td {
  background: #f4fbff;
}

.account-parent-row td {
  background: #f8fbfe;
  font-weight: 600;
}

.account-code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  color: #14243a;
}

.account-name-cell {
  display: flex;
  align-items: center;
  gap: 6px;
}

.account-name-cell.level-2 {
  padding-left: 22px;
}

.account-name-cell.level-3 {
  padding-left: 44px;
}

.account-name-cell.level-4 {
  padding-left: 66px;
}

.tree-toggle,
.tree-spacer {
  display: inline-grid;
  place-items: center;
  width: 14px;
  color: #4f6b85;
}

.account-actions {
  min-width: 118px;
}

.account-actions button {
  padding: 5px 8px;
}

.account-form-panel {
  margin-top: 12px;
}

.account-form-panel.is-collapsed {
  display: none;
}

.fixed-asset-card-panel.is-collapsed {
  display: none;
}

.fixed-asset-fieldset {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfe;
}

.fixed-asset-fieldset legend {
  padding: 0 6px;
  color: var(--muted);
  font-size: 13px;
}

.compact-actions {
  gap: 6px;
}

.compact-actions button {
  padding: 5px 8px;
}

.fixed-asset-list-table .table-wrap {
  overflow-x: hidden;
}

.fixed-asset-list-table table {
  min-width: 0;
  table-layout: fixed;
  font-size: 12.5px;
}

.fixed-asset-list-table th,
.fixed-asset-list-table td {
  overflow: hidden;
  padding: 7px 6px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fixed-asset-list-table th:nth-child(1) { width: 5%; }
.fixed-asset-list-table th:nth-child(2) { width: 10%; }
.fixed-asset-list-table th:nth-child(3) { width: 8%; }
.fixed-asset-list-table th:nth-child(4) { width: 7%; }
.fixed-asset-list-table th:nth-child(5) { width: 6%; }
.fixed-asset-list-table th:nth-child(6) { width: 6%; }
.fixed-asset-list-table th:nth-child(7) { width: 9%; }
.fixed-asset-list-table th:nth-child(8) { width: 9%; }
.fixed-asset-list-table th:nth-child(9) { width: 8%; }
.fixed-asset-list-table th:nth-child(10) { width: 9%; }
.fixed-asset-list-table th:nth-child(11) { width: 9%; }
.fixed-asset-list-table th:nth-child(12) { width: 6%; }
.fixed-asset-list-table th:nth-child(13) { width: 8%; }

.fixed-asset-change-table table {
  min-width: 0;
  table-layout: fixed;
  font-size: 12.5px;
}

.fixed-asset-change-table th,
.fixed-asset-change-table td {
  overflow: hidden;
  padding: 8px 7px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fixed-asset-change-table th:nth-child(1) { width: 11%; }
.fixed-asset-change-table th:nth-child(2) { width: 21%; }
.fixed-asset-change-table th:nth-child(3) { width: 16%; }
.fixed-asset-change-table th:nth-child(4) { width: 25%; }
.fixed-asset-change-table th:nth-child(5) { width: 7%; }
.fixed-asset-change-table th:nth-child(6) { width: 13%; }
.fixed-asset-change-table th:nth-child(7) { width: 7%; }

.fixed-asset-change-filter-grid {
  grid-template-columns: minmax(130px, 0.72fr) minmax(145px, 0.82fr) minmax(145px, 0.82fr) minmax(220px, 1.3fr) minmax(170px, 0.9fr);
  margin-bottom: 10px;
}

.fixed-asset-change-toolbar,
.fixed-asset-depreciation-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
}

.depreciation-period-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.depreciation-period-label input[type="month"] {
  font: inherit;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
}

.fixed-asset-change-summary {
  display: flex;
  gap: 18px;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
}

.fixed-asset-change-summary strong {
  color: var(--text);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.fixed-asset-depreciation-sheet {
  padding: 0;
  overflow: hidden;
}

.fixed-asset-depreciation-toolbar {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.fixed-asset-depreciation-summary {
  display: grid;
  flex: 1;
  grid-template-columns: minmax(90px, 0.65fr) minmax(120px, 0.85fr) minmax(220px, 1.35fr) minmax(190px, 1.2fr);
  min-width: 0;
}

.fixed-asset-depreciation-summary > span {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 0 16px;
  border-right: 1px solid var(--line);
}

.fixed-asset-depreciation-summary > span:first-child {
  padding-left: 0;
}

.fixed-asset-depreciation-summary > span:last-child {
  border-right: 0;
}

.fixed-asset-depreciation-summary small {
  color: var(--muted);
  font-size: 12px;
}

.fixed-asset-depreciation-summary strong {
  overflow: hidden;
  color: var(--text);
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fixed-asset-depreciation-summary .depreciation-total strong {
  color: #176f63;
  font-size: 20px;
  font-variant-numeric: tabular-nums;
}

.fixed-asset-depreciation-table table {
  min-width: 0;
  table-layout: fixed;
}

.fixed-asset-depreciation-table th:nth-child(1) { width: 12%; }
.fixed-asset-depreciation-table th:nth-child(2) { width: 28%; }
.fixed-asset-depreciation-table th:nth-child(3) { width: 25%; }
.fixed-asset-depreciation-table th:nth-child(4) { width: 20%; }
.fixed-asset-depreciation-table th:nth-child(5) { width: 15%; }

.fixed-asset-depreciation-table th,
.fixed-asset-depreciation-table td {
  padding: 8px 10px;
}

.fixed-asset-depreciation-sheet > .status {
  margin: 10px 16px 0;
}

.fixed-asset-ledger-table table {
  min-width: 0;
  table-layout: fixed;
  font-size: 12px;
}

.fixed-asset-ledger-table th,
.fixed-asset-ledger-table td {
  overflow: hidden;
  padding: 7px 6px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fixed-asset-ledger-table th:nth-child(1) { width: 8%; }
.fixed-asset-ledger-table th:nth-child(2) { width: 9%; }
.fixed-asset-ledger-table th:nth-child(3) { width: 11%; }
.fixed-asset-ledger-table th:nth-child(4) { width: 13%; }
.fixed-asset-ledger-table th:nth-child(5) { width: 8%; }
.fixed-asset-ledger-table th:nth-child(6) { width: 9%; }
.fixed-asset-ledger-table th:nth-child(7) { width: 8%; }
.fixed-asset-ledger-table th:nth-child(8) { width: 9%; }
.fixed-asset-ledger-table th:nth-child(9) { width: 7%; }
.fixed-asset-ledger-table th:nth-child(10) { width: 8%; }
.fixed-asset-ledger-table th:nth-child(11) { width: 9%; }
.fixed-asset-ledger-table th:nth-child(12) { width: 5%; }

.fixed-asset-ledger-table td:nth-child(3),
.fixed-asset-ledger-table td:nth-child(4) {
  color: #33475b;
}

.fixed-asset-voucher-link {
  display: grid;
  width: 26px;
  height: 26px;
  min-height: 26px;
  margin: 0 auto;
  padding: 0;
  place-items: center;
}

.fixed-asset-voucher-link .ui-icon {
  width: 14px;
  height: 14px;
}

.fixed-asset-row-actions {
  display: grid;
  grid-template-columns: repeat(3, 25px);
  gap: 4px;
  min-width: 79px;
  flex-wrap: nowrap;
}

.fixed-asset-row-actions button {
  display: grid;
  width: 25px;
  height: 25px;
  min-height: 25px;
  padding: 0;
  place-items: center;
  font-size: 14px;
  line-height: 1;
}

.report-sheet {
  padding: 10px;
  box-shadow: none;
}

.financial-report-sheet {
  overflow: hidden;
  padding: 0;
  border-color: #d8e3ec;
  box-shadow: 0 8px 24px rgba(44, 62, 80, 0.045);
}

.report-heading {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto minmax(220px, 1fr);
  gap: 20px;
  align-items: center;
  min-height: 64px;
  margin: 0;
  padding: 10px 16px 9px;
  border-bottom: 1px solid #dce6ef;
  background: #fff;
  color: var(--muted);
  font-size: 11px;
}

.report-heading-company {
  overflow: hidden;
  color: #506276;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.report-heading-title {
  display: grid;
  gap: 2px;
  min-width: 180px;
  text-align: center;
}

.report-heading-title strong {
  color: var(--text);
  font-size: 18px;
  text-align: center;
}

.report-heading-title span {
  color: #7a8999;
  font-size: 11px;
}

.report-heading-meta {
  display: flex;
  gap: 14px;
  justify-content: flex-end;
  color: #718095;
  white-space: nowrap;
}

.report-note {
  margin: 0;
  padding: 7px 16px;
  border-bottom: 1px solid #e2eaf1;
  background: #f8fafc;
  color: #718095;
  font-size: 11px;
}

.report-sheet .report-table-wrap {
  max-height: calc(100vh - 192px);
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.statement-table {
  min-width: 980px;
  table-layout: fixed;
  font-size: 13px;
}

.statement-table th,
.statement-table td {
  height: 31px;
  padding: 5px 9px;
  vertical-align: middle;
}

.statement-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  height: 34px;
  border-bottom: 1px solid #c9d7e3;
  background: #eaf2f8;
  color: #41546a;
  font-weight: 600;
}

.statement-table tbody tr:hover td {
  background-color: #f7fafc;
}

.statement-table td:first-child,
.statement-table td:nth-child(5) {
  white-space: nowrap;
}

.statement-table .report-indent-1 {
  padding-left: 22px;
  color: #4e6073;
}

.statement-table .report-indent-2 {
  padding-left: 36px;
  color: #667789;
}

.statement-table .report-row-major td {
  border-top: 1px solid #d5e0e9;
  background: #f8fafc;
  font-weight: 600;
}

.statement-table .report-row-section td,
.statement-table .report-cell-section {
  border-top: 1px solid #cbd9e4;
  background: #f2f6f9;
  color: #31465c;
  font-weight: 600;
}

.statement-table .report-row-total td,
.statement-table .report-cell-total {
  border-top: 1px solid #b9ccda;
  background: #eef4f8;
  color: #243b52;
  font-weight: 600;
}

.statement-table .report-row-grand-total td {
  border-top: 2px solid #7896ad;
  background: #e6f0f7;
  color: #172f47;
  font-weight: 700;
}

.income-statement-table th:nth-child(1) { width: 55%; }
.income-statement-table th:nth-child(2) { width: 8%; }
.income-statement-table th:nth-child(3),
.income-statement-table th:nth-child(4) { width: 18.5%; }

.balance-statement-table th:nth-child(1),
.balance-statement-table th:nth-child(5) { width: 20%; }
.balance-statement-table th:nth-child(2),
.balance-statement-table th:nth-child(6) { width: 6%; }
.balance-statement-table th:nth-child(3),
.balance-statement-table th:nth-child(4),
.balance-statement-table th:nth-child(7),
.balance-statement-table th:nth-child(8) { width: 12%; }

.balance-statement-table th:nth-child(4),
.balance-statement-table td:nth-child(4) {
  border-right: 2px solid #c7d5df;
}

.cash-flow-statement-table th:first-child { width: 64%; }
.cash-flow-statement-table th:nth-child(2),
.cash-flow-statement-table th:nth-child(3) { width: 18%; }

@media (max-width: 1080px) {
  .report-heading {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .report-heading-company {
    display: none;
  }
}

.icon-btn {
  width: 30px;
  height: 30px;
  padding: 0;
  background: #eef6fb;
  color: var(--brand-dark);
  box-shadow: none;
}

.icon-btn:hover {
  background: #dde9fb;
}

.status {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 12px;
  background: #eef6fb;
  color: var(--brand-dark);
  border: 1px solid transparent;
}

.status.ok {
  background: #e8f7f1;
  color: var(--ok);
}

.status.warn {
  background: #fff5df;
  color: var(--warn);
}

.status.danger {
  background: #fdebea;
  color: var(--danger);
}

.voucher-total {
  display: flex;
  justify-content: flex-end;
  gap: 22px;
  font-weight: 700;
}

.voucher-page {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.voucher-workbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: end;
  min-width: 0;
  border-bottom: 1px solid rgba(184, 201, 216, 0.78);
}

.voucher-tabs {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  padding: 0;
  border-bottom: 0;
}

.voucher-tab {
  flex: 0 0 auto;
  min-width: 96px;
  padding: 7px 12px;
  border-radius: 8px 8px 0 0;
  border: 1px solid #d8e7f2;
  border-bottom: 0;
  background: rgba(238, 246, 251, 0.86);
  color: var(--text);
  box-shadow: none;
}

.voucher-tab.active,
.voucher-tab:hover {
  background: #fff;
  color: var(--brand-dark);
}

.voucher-toolbar {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  padding: 0 2px 6px 0;
}

.voucher-toolbar .actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.voucher-toolbar button {
  padding: 7px 11px;
}

.voucher-card {
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(31, 61, 86, 0.06);
  min-width: 0;
  overflow: hidden;
}

.voucher-head {
  display: grid;
  grid-template-columns: minmax(390px, 1fr) auto minmax(150px, 1fr);
  gap: 18px;
  align-items: center;
  min-height: 72px;
  padding: 10px 14px;
  border-bottom: 1px solid #e1ebf2;
  background: #fbfdff;
}

.voucher-title {
  text-align: center;
}

.voucher-title h2 {
  margin: 0;
  font-size: 20px;
  line-height: 1.2;
}

.voucher-title p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.voucher-field-group {
  display: flex;
  gap: 8px;
  align-items: end;
}

.voucher-field-group label {
  display: grid;
  gap: 5px;
  min-width: 92px;
  color: var(--muted);
  font-size: 13px;
}

.voucher-field-group.right {
  justify-content: flex-end;
}

.voucher-field-group.right input {
  width: 70px;
}

.voucher-table-wrap {
  overflow: auto;
  max-height: min(58vh, 620px);
  padding: 12px 14px 10px;
}

.voucher-table {
  width: 100%;
  min-width: 1180px;
  border: 1px solid #50687b;
  table-layout: fixed;
}

.col-row-no {
  width: 40px;
}

.col-summary {
  width: 16%;
}

.col-account {
  width: 21%;
}

.col-auxiliary {
  width: 16%;
}

.col-quantity,
.col-price {
  width: 68px;
}

.col-debit,
.col-credit {
  width: 140px;
}

.col-tools {
  width: 112px;
}

.voucher-table th,
.voucher-table td {
  border-right: 1px solid #c9d9e6;
  border-bottom: 1px solid #c9d9e6;
  padding: 0;
  vertical-align: middle;
}

.voucher-table th {
  height: 29px;
  background: linear-gradient(180deg, #f8fcff, #edf6fc);
  text-align: center;
}

.voucher-table tbody td {
  height: 52px;
}

.voucher-table input,
.voucher-table select {
  width: 100%;
  min-width: 0;
  height: 100%;
  min-height: 52px;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 6px 8px;
  box-shadow: none;
}

.voucher-table .money-input,
.voucher-table td.number {
  font-family: "Consolas", "Microsoft YaHei", monospace;
  font-size: 14px;
  text-align: right;
  letter-spacing: 0;
}

.voucher-table .amount-scale th,
.voucher-table .amount-scale {
  height: 22px;
  color: #32495b;
  font-size: 10px;
  letter-spacing: 1px;
}

.voucher-table tfoot td {
  height: 36px;
  padding: 6px 8px;
  background: linear-gradient(180deg, #ecf7ff, #e5f2fb);
  font-weight: 700;
}

.voucher-total-cell {
  text-align: left;
}

.voucher-total-cell .status {
  margin-left: 12px;
}

.row-no-col {
  width: 42px;
}

.tools-col,
.voucher-row-tools {
  width: 112px;
  text-align: center;
  white-space: nowrap;
}

.voucher-row-toolbox {
  display: grid;
  grid-template-columns: repeat(4, 23px);
  gap: 3px;
  align-items: center;
  justify-content: center;
  min-width: 104px;
  padding: 4px 3px;
}

.voucher-row-toolbox .icon-btn {
  display: grid;
  width: 23px;
  height: 26px;
  min-height: 26px;
  padding: 0;
  place-items: center;
  line-height: 1;
}

.voucher-row-toolbox .ui-icon {
  width: 14px;
  height: 14px;
  flex-basis: 14px;
}

.voucher-row-no {
  color: var(--muted);
  text-align: center;
}

.quantity-head,
.entry-quantity,
.entry-price {
  width: 72px;
}

.entry-auxiliary-cell {
  width: 17%;
  min-width: 0;
}

.entry-account-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 30px;
  gap: 4px;
  align-items: stretch;
}

.entry-account-field .entry-account-code {
  min-width: 0;
}

.entry-account-field .quick-add-account {
  display: grid;
  width: 30px;
  min-width: 30px;
  height: auto;
  min-height: 34px;
  padding: 0;
  place-items: center;
  border-color: #c9d8d5;
  background: #edf5f3;
  color: #176b65;
}

.entry-account-field .quick-add-account:hover {
  background: #dcece8;
}

.entry-auxiliary-list {
  display: grid;
  gap: 3px;
  padding: 4px;
}

.entry-auxiliary-list label {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 4px;
  align-items: center;
  color: var(--muted);
  font-size: 11px;
}

.entry-auxiliary-label {
  display: flex;
  gap: 3px;
  align-items: center;
  justify-content: space-between;
  white-space: nowrap;
}

.entry-auxiliary-label .icon-btn {
  width: 22px;
  height: 22px;
  min-height: 22px;
  padding: 0;
  border: 0;
  background: #edf4f3;
  color: #176b65;
  font-size: 15px;
  line-height: 1;
}

.quick-auxiliary-modal {
  width: min(640px, 94vw);
}

.quick-account-modal {
  width: min(760px, 94vw);
}

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

.quick-account-auxiliaries {
  min-height: 36px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfaf7;
}

.quick-account-auxiliaries label {
  display: inline-flex;
  grid-column: auto;
  flex-direction: row;
  gap: 5px;
  align-items: center;
  color: var(--text);
}

.renumber-query-panel {
  padding: 12px 14px;
}

.renumber-controls {
  display: grid;
  grid-template-columns: minmax(160px, 220px) minmax(120px, 180px) auto;
  gap: 10px;
  align-items: end;
}

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

.renumber-rule-note {
  margin: 10px 0 0;
}

.renumber-summary {
  margin-top: 10px;
}

.renumber-workspace {
  margin-top: 10px;
  padding: 0;
  overflow: hidden;
}

.renumber-workspace .table-wrap {
  max-height: calc(100vh - 390px);
  overflow: auto;
}

.renumber-workspace th {
  position: sticky;
  top: 0;
  z-index: 1;
}

.renumber-row-actions {
  display: grid;
  grid-template-columns: repeat(2, 30px);
  gap: 4px;
  justify-content: center;
}

.renumber-row-actions .icon-btn {
  width: 30px;
  height: 28px;
  min-height: 28px;
  padding: 0;
}

.renumber-execute-panel {
  display: flex;
  gap: 18px;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
  padding: 12px 14px;
}

.renumber-confirm {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 13px;
}

.ledger-access-modal {
  width: min(720px, 94vw);
}

.ledger-access-list {
  display: grid;
  gap: 6px;
  margin-top: 12px;
}

.ledger-access-user {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 150px;
  gap: 16px;
  align-items: center;
  min-height: 54px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
}

.ledger-access-user > span {
  display: grid;
  gap: 2px;
}

.ledger-access-user small {
  color: var(--muted);
}

.read-only-access-notice {
  max-width: 720px;
  padding: 24px;
}

@media (max-width: 760px) {
  .renumber-controls {
    grid-template-columns: 1fr;
  }

  .renumber-execute-panel,
  .ledger-access-user {
    grid-template-columns: 1fr;
  }

  .renumber-execute-panel {
    align-items: stretch;
    flex-direction: column;
  }
}

.entry-auxiliary-list select,
.entry-auxiliary-list input {
  min-height: 28px;
  border: 1px solid #d7e2eb;
  border-radius: 5px;
  background: #fff;
}

.entry-auxiliary-missing,
.auxiliary-empty {
  display: block;
  padding: 8px;
  color: var(--muted);
  font-size: 12px;
}

.entry-auxiliary-missing {
  color: var(--warn);
}

.voucher-table.hide-quantity .quantity-head,
.voucher-table.hide-quantity .col-quantity,
.voucher-table.hide-quantity .col-price,
.voucher-table.hide-quantity td:nth-child(5),
.voucher-table.hide-quantity td:nth-child(6) {
  display: none;
}

.voucher-table.hide-quantity .col-summary {
  width: 18%;
}

.voucher-table.hide-quantity .col-account {
  width: 25%;
}

.voucher-table.hide-quantity .col-auxiliary {
  width: 18%;
}

.voucher-table.hide-quantity .col-row-no {
  width: 4%;
}

.voucher-table.hide-quantity .col-debit,
.voucher-table.hide-quantity .col-credit {
  width: 13%;
}

.voucher-table.hide-quantity .col-tools {
  width: 9%;
}

.voucher-footer {
  display: flex;
  gap: 18px;
  align-items: center;
  min-height: 38px;
  padding: 8px 14px;
  border-top: 1px solid #e1ebf2;
  background: #fbfdff;
  color: #51657a;
  font-size: 13px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(15, 28, 44, 0.42);
}

.modal-backdrop.is-collapsed {
  display: none;
}

.renumber-modal {
  width: min(760px, 96vw);
}

.renumber-confirm {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 14px 0 8px;
  font-size: 13px;
  color: #51657a;
  line-height: 1.5;
}

.renumber-confirm input {
  width: auto;
}

.modal-card {
  width: min(980px, 96vw);
  max-height: 88vh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 20px 60px rgba(15, 28, 44, 0.28);
  overflow: hidden;
}

.modal-head,
.modal-actions {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}

.modal-actions {
  justify-content: flex-end;
  border-top: 1px solid var(--line);
  border-bottom: 0;
}

.modal-body {
  overflow: auto;
  padding: 16px;
}

.voucher-modal .panel {
  box-shadow: none;
}

.fixed-asset-modal {
  width: min(1060px, 96vw);
  max-height: min(880px, 92vh);
}

.fixed-asset-modal-title {
  display: grid;
  gap: 3px;
}

.fixed-asset-modal-title span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
}

.fixed-asset-modal-body {
  padding: 0 20px;
  background: #fdfcf9;
}

.fixed-asset-form-section {
  display: grid;
  grid-template-columns: 124px minmax(0, 1fr);
  gap: 20px;
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
}

.fixed-asset-form-section:last-child {
  border-bottom: 0;
}

.fixed-asset-section-heading {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  padding-top: 2px;
}

.fixed-asset-section-heading > span {
  display: grid;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  place-items: center;
  border: 1px solid #b9d0cc;
  border-radius: 50%;
  background: #eef6f4;
  color: #176b65;
  font-size: 11px;
  font-weight: 700;
}

.fixed-asset-section-heading div {
  display: grid;
  gap: 3px;
}

.fixed-asset-section-heading strong {
  color: var(--text);
  font-size: 13px;
}

.fixed-asset-section-heading small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.fixed-asset-form-grid,
.fixed-asset-account-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
}

.fixed-asset-form-grid .fixed-asset-name-field {
  grid-column: span 2;
}

.fixed-asset-account-grid {
  display: grid;
  align-items: end;
}

.fixed-asset-account-grid label,
.fixed-asset-note-section > label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

.fixed-asset-period-warning {
  grid-column: 2;
  margin: 12px 0 0;
}

.fixed-asset-note-section textarea {
  min-height: 76px;
  resize: vertical;
}

.account-modal {
  width: min(920px, 96vw);
}

.fixed-asset-change-modal {
  width: min(760px, 96vw);
}

.fixed-asset-modal .modal-body > .form-grid,
.fixed-asset-change-modal .modal-body > .form-grid,
.account-modal .modal-body > .form-grid {
  margin: 0;
}

@media (max-width: 860px) {
  .fixed-asset-form-section {
    grid-template-columns: 1fr;
    gap: 12px;
  }

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

  .fixed-asset-period-warning {
    grid-column: 1;
  }
}

@media (max-width: 620px) {
  .quick-account-grid,
  .fixed-asset-form-grid,
  .fixed-asset-account-grid {
    grid-template-columns: 1fr;
  }

  .fixed-asset-form-grid .fixed-asset-name-field {
    grid-column: auto;
  }
}

.print-area {
  display: none;
}

.print-voucher {
  box-sizing: border-box;
  width: 158mm;
  height: 132mm;
  padding: 4mm 0 8mm 0;
  margin: 0 auto;
  break-inside: avoid;
  page-break-inside: avoid;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.print-voucher *,
.print-voucher *::before,
.print-voucher *::after {
  box-sizing: border-box;
}

.print-voucher:nth-child(2n) {
  break-after: page;
  page-break-after: always;
}

.print-voucher-top,
.print-voucher-meta,
.print-voucher-sign {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.print-voucher-top {
  align-items: end;
  margin-bottom: 6px;
}

.print-voucher-top strong {
  font-size: 20px;
  letter-spacing: 0;
}

.print-voucher-meta {
  margin-bottom: 6px;
}

.print-voucher table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11.5px;
  table-layout: fixed;
}

.print-voucher th,
.print-voucher td {
  border: 1px solid #111;
  padding: 4px 6px;
  vertical-align: top;
  line-height: 1.3;
  word-break: break-word;
}

.print-voucher th {
  text-align: center;
}

.print-voucher th:nth-child(1),
.print-voucher td:nth-child(1) {
  width: 29%;
}

.print-voucher th:nth-child(2),
.print-voucher td:nth-child(2) {
  width: 39%;
}

.print-voucher th:nth-child(3),
.print-voucher td:nth-child(3),
.print-voucher th:nth-child(4),
.print-voucher td:nth-child(4) {
  width: 16%;
}

.print-voucher .number {
  text-align: right;
  font-family: "Consolas", "Microsoft YaHei", monospace;
  white-space: nowrap;
  overflow: hidden;
  font-size: 10.5px;
}

.print-aux {
  margin-top: 2px;
  color: #444;
  font-size: 10px;
}

.print-voucher-sign {
  margin-top: auto;
  padding-top: 5mm;
  font-size: 12px;
}

.empty {
  padding: 32px;
  font-size: 13px;
  text-align: center;
  color: var(--muted);
}

.report-total {
  font-weight: 700;
  background: #f7f9fc;
}

.import-box {
  display: grid;
  gap: 12px;
}

.production-cost-panel {
  margin-bottom: 8px;
}

.production-cost-panel > h3 {
  margin: 0 0 9px;
  font-size: 14px;
}

.production-account-grid,
.production-value-grid {
  margin-bottom: 10px;
}

.production-value-grid {
  grid-template-columns: repeat(4, minmax(135px, 1fr));
}

.production-note {
  margin: 2px 0 0;
}

.production-overhead-table input[type="checkbox"] {
  width: auto;
  margin: 0;
}

.production-overhead-table input[type="number"] {
  width: 120px;
  min-height: 30px;
  margin-left: auto;
  padding: 5px 7px;
  text-align: right;
}

.production-warning-list {
  display: grid;
  gap: 5px;
  margin: 0 0 8px;
}

.production-warning-list .status {
  margin: 0;
}

.production-actions {
  align-items: center;
}

.production-voucher-preview + .production-voucher-preview {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.production-voucher-preview h3 {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 0 0 7px;
  font-size: 13px;
}

.production-voucher-preview h3 small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 400;
}

@media (max-width: 980px) {
  .production-value-grid {
    grid-template-columns: repeat(2, minmax(135px, 1fr));
  }
}
/* Modern finance cockpit skin */
body {
  background: #f5f8fb;
}

button {
  background: #2563eb;
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.16);
}

button:hover {
  background: #1d4ed8;
}

button.secondary {
  border-color: #d8e4ef;
  background: #fff;
  color: #28435f;
}

button.secondary:hover {
  background: #f1f7fd;
}

.topbar {
  min-height: 56px;
  width: min(100%, var(--shell-max));
  margin: 0 auto;
  gap: 14px;
  padding: 7px 18px;
  background: rgba(255, 255, 255, 0.96);
  color: var(--text);
  border-bottom: 1px solid #e4edf5;
  box-shadow: 0 10px 30px rgba(44, 62, 80, 0.06);
}

.topbar h1 {
  margin-bottom: 1px;
  font-size: 17px;
}

.topbar p,
.period-control {
  color: #6b7b8c;
}

.brand-lockup {
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 9px;
  flex: 0 1 430px;
}

.brand-logo {
  width: 34px;
  height: 34px;
  border-radius: 10px;
}

.topbar p {
  font-size: 12px;
}

.top-actions {
  gap: 6px;
}

.period-control {
  gap: 6px;
  font-size: 12px;
}

.period-stepper {
  grid-template-columns: 26px 92px 70px 26px 40px;
  gap: 3px;
}

.top-actions input,
.top-actions select {
  border-color: #dbe6f0;
  background: #fff;
  min-height: 32px;
  padding-top: 5px;
  padding-bottom: 5px;
  color: #24364a;
  font-size: 13px;
  font-weight: 500;
}

.topbar .period-stepper button,
.topbar #logoutBtn {
  min-height: 32px;
  padding-top: 5px;
  padding-bottom: 5px;
  font-size: 13px;
  font-weight: 500;
}

.period-stepper .period-step {
  font-size: 18px;
}

.period-stepper .period-current {
  font-size: 12px;
}

.top-actions > select {
  flex: 0 1 260px;
  max-width: 280px;
  min-width: 170px;
}

.topbar .status {
  min-height: 28px;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 500;
}

.status {
  border: 1px solid #dbe6f0;
  background: #f7fbff;
  color: #35516c;
}

.app-shell {
  width: min(100%, var(--shell-max));
  margin: 0 auto;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  background: #f5f8fb;
}

.tabs {
  padding: 16px 12px;
  background: rgba(255, 255, 255, 0.94);
  border-right: 1px solid #e4edf5;
  box-shadow: 8px 0 30px rgba(44, 62, 80, 0.035);
  backdrop-filter: none;
}

.tab {
  min-height: 42px;
  margin-bottom: 7px;
  padding: 10px 12px;
  color: #34495f;
  font-size: 14px;
}

.tab:hover,
.tab.active {
  background: #eef6ff;
  color: #1763b6;
  border-color: transparent;
  box-shadow: none;
}

.nav-icon {
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #1763b6;
  font-size: 15px;
}

.view {
  padding: 14px 18px 26px;
  background: #f5f8fb;
}

.workspace-nav {
  min-height: 50px;
  margin: -22px -24px 20px;
  padding: 8px 24px;
  border-bottom: 1px solid #e4edf5;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 10px 26px rgba(44, 62, 80, 0.045);
  backdrop-filter: none;
}

.workspace-tab {
  border-color: transparent;
  background: #f7fafc;
  color: #4b5d70;
}

.workspace-tab.active {
  border-color: transparent;
  background: #eef6ff;
  color: #1763b6;
  box-shadow: none;
}

.workspace-nav {
  position: static;
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 0;
  margin: 0 0 10px;
  padding: 0 0 9px;
  border-bottom: 1px solid #dce6ef;
  background: transparent;
  box-shadow: none;
}

.workspace-heading {
  display: flex;
  min-width: 0;
  gap: 10px;
  align-items: baseline;
}

.workspace-heading > div {
  display: flex;
  min-width: 0;
  gap: 10px;
  align-items: baseline;
}

.workspace-heading h2,
.workspace-heading h3 {
  flex: 0 0 auto;
  margin: 0;
  font-size: 18px;
  line-height: 32px;
}

.workspace-heading p,
.workspace-heading .hint {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace-heading .actions {
  display: flex;
  flex: 0 0 auto;
  gap: 6px;
}

.workspace-back {
  width: 32px;
  min-width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid #dbe6f0;
  background: #fff;
  color: #34516d;
  font-size: 20px;
}

.workspace-tabs:empty {
  display: none;
}

.workspace-recent {
  grid-column: 2 / -1;
  display: flex;
  gap: 10px;
  align-items: center;
  min-width: 0;
  padding-top: 7px;
  border-top: 1px solid #edf2f6;
}

.workspace-recent-label {
  flex: 0 0 auto;
  color: #8190a0;
  font-size: 11px;
}

.workspace-tabs {
  gap: 2px;
  min-width: 0;
  padding: 0;
}

.workspace-nav > button,
.workspace-actions > button {
  min-height: 32px;
  padding: 5px 9px;
  border-color: #dbe6f0;
  background: #fff;
}

.workspace-nav > .workspace-back {
  padding: 0;
}

.workspace-tab {
  min-height: 26px;
  max-width: 150px;
  padding: 3px 7px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: #53677b;
  font-size: 12px;
}

.workspace-tab:hover {
  background: #eef5fb;
  color: #1763b6;
}

.workspace-tab-close {
  display: grid;
  width: 16px;
  height: 16px;
  place-items: center;
  border-radius: 4px;
  font-size: 11px;
}

.workspace-tab-close:hover {
  background: #dfeaf4;
  color: #23384d;
}

.workspace-actions {
  justify-content: flex-end;
  flex-wrap: nowrap;
  white-space: nowrap;
}

.panel,
.quick-panel,
.health-panel,
.kpi-card {
  border: 1px solid #e3ebf3;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 8px 24px rgba(44, 62, 80, 0.045);
}

.panel {
  padding: 16px;
}

.section-title.compact-title {
  margin-bottom: 12px;
}

.section-title.compact-title h3 {
  margin: 0;
  font-size: 16px;
}

.cockpit-dashboard {
  gap: 16px;
}

.cockpit-title {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  min-height: 56px;
}

.cockpit-title h2 {
  margin: 0 0 4px;
  font-size: 24px;
}

.cockpit-title-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.cockpit-kpis {
  display: grid;
  grid-template-columns: repeat(5, minmax(150px, 1fr));
  gap: 12px;
}

.cockpit-kpis .kpi-card {
  position: relative;
  min-height: 122px;
  padding: 15px 16px;
  overflow: hidden;
}

.cockpit-kpis .kpi-card::after {
  content: "";
  position: absolute;
  right: -22px;
  top: -26px;
  width: 82px;
  height: 82px;
  border-radius: 50%;
  background: rgba(37, 99, 235, 0.08);
}

.kpi-icon {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: #eef6ff;
}

.kpi-card .kpi-icon::before {
  content: "";
  width: 11px;
  height: 11px;
  border-radius: 3px;
  background: #2f80ed;
}

.kpi-card span:not(.kpi-icon) {
  color: #52687d;
  font-size: 13px;
}

.kpi-card strong {
  color: #172033;
  font-size: 23px;
}

.tone-橙 .kpi-icon,
.tone-orange .kpi-icon {
  background: #fff4e5;
}

.tone-橙 .kpi-icon::before,
.tone-orange .kpi-icon::before {
  background: #f59e0b;
}

.tone-绿 .kpi-icon,
.tone-green .kpi-icon {
  background: #eafaf2;
}

.tone-绿 .kpi-icon::before,
.tone-green .kpi-icon::before {
  background: #10b981;
}

.tone-黄 .kpi-icon {
  background: #fff8df;
}

.tone-黄 .kpi-icon::before {
  background: #eab308;
}

.tone-红 .kpi-icon {
  background: #fff0eb;
}

.tone-红 .kpi-icon::before {
  background: #f97316;
}

.cockpit-grid {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(240px, 1fr) minmax(260px, 0.9fr);
  gap: 14px;
  align-items: start;
}

.trend-panel,
.trend-summary-panel,
.pending-panel,
.common-actions {
  min-width: 0;
}

.cockpit-grid > .trend-summary-panel {
  grid-column: 1 / span 2;
}

.cockpit-grid > .pending-panel {
  grid-column: 3;
  grid-row: 1 / span 2;
}

.trend-row {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  margin: 10px 0;
}

.trend-row > span {
  color: #52687d;
  font-size: 13px;
  font-family: var(--ui-font);
  font-weight: 500;
}

.trend-axis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(54px, 1fr));
  gap: 8px;
  margin-left: 68px;
  color: #65758a;
  font-size: 13px;
  font-weight: 500;
  font-family: var(--ui-font);
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.trend-panel .trend-axis {
  max-height: 32px;
  overflow: hidden;
}

.line-chart {
  position: relative;
  height: 170px;
  margin: 8px 8px 10px;
  border-bottom: 1px solid #dfe8f0;
  background:
    linear-gradient(180deg, rgba(69, 163, 255, 0.12), rgba(69, 163, 255, 0.02)),
    repeating-linear-gradient(180deg, transparent 0 37px, #edf3f8 38px);
}

.line-chart svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
  font-family: var(--ui-font);
}

.line-chart text {
  font-family: var(--ui-font);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
}

.mini-line-chart {
  height: 62px;
  margin: 0;
  border-bottom: 0;
  background:
    linear-gradient(180deg, rgba(69, 163, 255, 0.08), rgba(69, 163, 255, 0.01)),
    repeating-linear-gradient(180deg, transparent 0 30px, #edf3f8 31px);
}

.multi-line-chart {
  height: 202px;
  margin: 4px 8px 8px;
  border-bottom: 0;
  background:
    linear-gradient(180deg, rgba(47, 128, 237, 0.08), rgba(47, 128, 237, 0.01)),
    repeating-linear-gradient(180deg, transparent 0 43px, #edf3f8 44px);
}

.line-chart-line,
.line-chart-zero {
  vector-effect: non-scaling-stroke;
}

.line-chart-line {
  fill: none;
  stroke: #2f80ed;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.line-chart-area {
  fill: rgba(47, 128, 237, 0.09);
  stroke: none;
}

.line-chart-zero {
  stroke: rgba(82, 104, 125, 0.22);
  stroke-width: 1;
  stroke-dasharray: 4 4;
}

.line-chart-point {
  fill: #2f80ed;
  stroke: #dcebff;
  stroke-width: 6;
  vector-effect: non-scaling-stroke;
}

.line-chart-label {
  fill: #475569;
  font-size: 13px;
  font-weight: 500;
  stroke: none;
}

.tone-orange .line-chart-line {
  stroke: #f59e0b;
}

.line-chart-line.series-blue {
  stroke: #2f80ed;
}

.line-chart-line.series-orange {
  stroke: #f59e0b;
}

.line-chart-line.series-green {
  stroke: #10b981;
}

.line-chart-point.series-blue,
.line-chart-label.series-blue {
  fill: #2f80ed;
}

.line-chart-point.series-orange,
.line-chart-label.series-orange {
  fill: #f59e0b;
}

.line-chart-point.series-green,
.line-chart-label.series-green {
  fill: #10b981;
}

.tone-orange .line-chart-area {
  fill: rgba(245, 158, 11, 0.11);
}

.tone-orange .line-chart-point {
  fill: #f59e0b;
  stroke: #fff1d6;
}

.tone-green .line-chart-line {
  stroke: #10b981;
}

.tone-green .line-chart-area {
  fill: rgba(16, 185, 129, 0.11);
}

.tone-green .line-chart-point {
  fill: #10b981;
  stroke: #dff8ec;
}

.chart-legend {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 4px;
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: center;
  color: #64748b;
  font-size: 13px;
  font-weight: 500;
}

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

.chart-legend i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #2f80ed;
}

.chart-legend .legend-orange i {
  background: #f59e0b;
}

.chart-legend .legend-green i {
  background: #10b981;
}

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

.reconcile-grid {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.dashboard-table-wrap {
  max-height: 260px;
  overflow: auto;
  border: 1px solid #e4edf5;
  border-radius: 8px;
}

.dashboard-mini-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.dashboard-mini-table th,
.dashboard-mini-table td {
  padding: 9px 11px;
  border-bottom: 1px solid #edf2f7;
  white-space: nowrap;
}

.dashboard-mini-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f8fbff;
  color: #52687d;
  font-weight: 600;
  text-align: left;
}

.dashboard-mini-table td {
  color: #24364a;
}

.dashboard-mini-table tbody tr:hover td {
  background: #f8fbff;
}

.dashboard-mini-table .number {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.dashboard-mini-table .negative {
  color: #b42318;
}

.reconcile-item {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  width: 100%;
  min-height: 56px;
  padding: 10px 12px;
  border: 1px solid #e4edf5;
  border-radius: 8px;
  background: #fbfdff;
  color: #24364a;
  text-align: left;
  box-shadow: none;
}

.reconcile-item:hover {
  border-color: #c7def3;
  background: #f7fbff;
  transform: none;
}

.reconcile-item strong,
.reconcile-item small {
  display: block;
}

.reconcile-item small {
  margin-top: 3px;
  color: #52687d;
  line-height: 1.35;
}

.pending-item {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid #e4edf5;
  border-radius: 8px;
  background: #fff;
  color: #24364a;
  text-align: left;
  box-shadow: none;
}

.pending-item:hover {
  border-color: #c7def3;
  background: #f7fbff;
}

.pending-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
}

.pending-dot.warn {
  background: #f59e0b;
}

.pending-dot.danger {
  background: #ef4444;
}

.pending-item strong {
  color: #172033;
}

.common-action-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(130px, 1fr));
  gap: 10px;
}

.common-action-grid .quick-action {
  grid-template-columns: 34px minmax(0, 1fr);
  min-height: 74px;
}

.common-action-grid .quick-arrow {
  display: none;
}

.quick-action {
  border-color: #e4edf5;
  background: #fff;
}

.quick-action:hover {
  border-color: #c7def3;
  background: #f7fbff;
  transform: none;
}

.quick-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: #eef6ff;
  color: #1763b6;
}

.module-grid .module-tile {
  border-color: #e2ddd5;
  background: #fffdfa;
  box-shadow: 0 8px 22px rgba(38, 47, 42, 0.045);
}
/* Finance cockpit v2 */
.tabs {
  width: var(--sidebar-width);
}

.tab {
  gap: 11px;
  min-height: 44px;
  color: #34495f;
  font-size: 14px;
  font-weight: 500;
}

.tab:hover,
.tab.active {
  background: #edf3ff;
  color: #245edb;
}

.tab {
  position: relative;
  transition: color 160ms ease, background-color 160ms ease, transform 160ms ease;
}

.tab:hover {
  transform: translateX(2px);
}

.tab.active {
  transform: none;
}

.tab.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 10px;
  bottom: 10px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: #3478f6;
}

.nav-icon {
  width: 22px;
  height: 22px;
  color: currentColor;
  font-size: 15px;
}

.cockpit-dashboard {
  gap: 18px;
}

.cockpit-title {
  min-height: 48px;
}

.cockpit-title h2 {
  font-size: 26px;
  font-weight: 800;
}

.cockpit-kpis {
  align-items: stretch;
}

.cockpit-kpis .kpi-card {
  min-height: 138px;
  align-content: start;
  gap: 8px;
  padding: 18px 18px 16px;
}

.cockpit-kpis .kpi-card::after {
  display: none;
}

.kpi-card .kpi-icon {
  margin-bottom: 2px;
}

.kpi-card span:not(.kpi-icon) {
  color: #607086;
  font-size: 13px;
  font-weight: 600;
}

.kpi-card strong {
  align-self: end;
  color: #0f172a;
  font-size: 28px;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
}

.kpi-card small {
  color: #718198;
  font-size: 12px;
}

.dashboard-focus-grid {
  display: grid;
  grid-template-columns: minmax(360px, 0.85fr) minmax(520px, 1.35fr);
  gap: 14px;
  align-items: stretch;
}

.risk-center-panel {
  grid-row: 1 / span 2;
}

.dashboard-focus-grid .trend-panel {
  min-width: 0;
}

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

.risk-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px 10px;
  align-items: start;
  min-height: 112px;
  padding: 16px;
  border: 1px solid #e4edf5;
  border-radius: 8px;
  background: #fff;
  color: #172033;
  text-align: left;
  box-shadow: none;
}

.risk-card:hover,
.anomaly-item:hover {
  border-color: #c7def3;
  background: #f8fbff;
  transform: none;
}

.risk-dot {
  width: 9px;
  height: 9px;
  margin-top: 5px;
  border-radius: 50%;
  background: #10b981;
}

.risk-warn .risk-dot,
.anomaly-warn .risk-dot {
  background: #f59e0b;
}

.risk-danger .risk-dot,
.anomaly-danger .risk-dot {
  background: #ef4444;
}

.risk-title {
  color: #52687d;
  font-size: 13px;
  font-weight: 600;
}

.risk-card strong {
  grid-column: 2;
  color: #0f172a;
  font-size: 30px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.risk-card small {
  grid-column: 2;
  color: #718198;
  font-size: 12px;
}

.anomaly-panel {
  min-width: 0;
}

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

.anomaly-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  gap: 12px;
  align-items: center;
  min-height: 54px;
  padding: 12px 14px;
  border: 1px solid #e4edf5;
  border-radius: 8px;
  background: #fff;
  color: #172033;
  text-align: left;
  box-shadow: none;
}

.anomaly-item strong,
.anomaly-item small {
  display: block;
}

.anomaly-item strong {
  margin-bottom: 3px;
  font-size: 14px;
}

.anomaly-item small,
.anomaly-item time {
  color: #718198;
  font-size: 12px;
}

.dashboard-focus-grid .line-chart {
  height: 210px;
}

.dashboard-focus-grid .multi-line-chart {
  height: 222px;
}

/* Dashboard Sprint 1 */
.top-actions button {
  flex: 0 0 auto;
  white-space: nowrap;
}

.cockpit-dashboard {
  display: grid;
  grid-template-rows: auto auto auto minmax(180px, 1fr);
  min-height: calc(100vh - 124px);
  gap: clamp(10px, 1.2vh, 18px);
  --dashboard-teal: #185A56;
  --dashboard-teal-light: #3B948A;
  --dashboard-orange: #FD742D;
  --dashboard-orange-light: #F8923F;
  --dashboard-warm: #E8E2D8;
  --dashboard-border: #E3DED6;
  --dashboard-shadow: 0 8px 24px rgba(24, 90, 86, 0.06);
  --dashboard-shadow-hover: 0 15px 34px rgba(24, 90, 86, 0.12);
}

.cockpit-title {
  display: block;
  min-height: 0;
  padding-top: 2px;
}

.cockpit-title h2 {
  margin: 0 0 6px;
  font-size: 24px;
  line-height: 1.2;
}

.cockpit-title .hint {
  margin: 0;
}

.cockpit-health-strip {
  display: flex;
  gap: 7px;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.cockpit-health-pill {
  display: inline-flex;
  gap: 5px;
  align-items: center;
  min-height: 28px;
  padding: 4px 9px;
  border: 1px solid #dfe8ee;
  border-radius: 6px;
  background: #fff;
  color: #516477;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.cockpit-health-pill i {
  display: grid;
  place-items: center;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: #e7f6f2;
  color: var(--dashboard-teal);
  font-size: 10px;
  font-style: normal;
}

.cockpit-health-pill.danger {
  border-color: #f3d3d0;
  color: #b33f36;
}

.cockpit-health-pill.danger i {
  background: #fce8e6;
  color: #c94b42;
}

.cockpit-kpis {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.cockpit-kpis .kpi-card {
  position: relative;
  min-height: clamp(96px, 14vh, 142px);
  padding: clamp(10px, 1.4vh, 16px) clamp(12px, 1vw, 18px);
  gap: 9px;
  border: 1px solid var(--dashboard-border);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--dashboard-shadow);
  transform: translateY(0);
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
  will-change: transform;
}

.cockpit-kpis .kpi-card:hover {
  border-color: #cbd9e5;
  box-shadow: var(--dashboard-shadow-hover);
  transform: translateY(-3px);
}

.kpi-card-label {
  display: flex;
  gap: 8px;
  align-items: center;
  min-width: 0;
}

.kpi-card .kpi-icon {
  flex: 0 0 auto;
  width: 27px;
  height: 27px;
  margin: 0;
  border-radius: 7px;
  background: #edf3ff;
  transition: transform 180ms ease, background-color 180ms ease;
}

.kpi-card .kpi-icon::before {
  width: 9px;
  height: 9px;
  border-radius: 2px;
  background: var(--dashboard-teal-light);
}

.cockpit-kpis .kpi-card:hover .kpi-icon {
  background: #e4edff;
  transform: translateY(-1px) scale(1.04);
}

.kpi-card strong {
  font-size: clamp(20px, 1.6vw, 30px);
}

.kpi-card .kpi-basis {
  margin-left: auto;
  color: #98a4b3;
  font-size: 10px;
  font-weight: 600;
}

.kpi-card .kpi-note {
  overflow: hidden;
  color: #75869a;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-trend-grid,
.dashboard-action-grid {
  display: grid;
  gap: clamp(10px, 1.2vh, 18px);
  min-width: 0;
}

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

.dashboard-action-grid {
  grid-template-columns: minmax(260px, 0.35fr) minmax(0, 0.65fr);
  align-items: stretch;
}

.dashboard-action-grid .risk-center-panel {
  grid-row: auto;
}

.dashboard-trend-grid .panel,
.dashboard-action-grid .panel {
  min-width: 0;
  border-color: var(--dashboard-border);
  box-shadow: var(--dashboard-shadow);
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.dashboard-trend-grid .panel:hover,
.dashboard-action-grid .panel:hover {
  border-color: #cfdae5;
  box-shadow: var(--dashboard-shadow-hover);
  transform: translateY(-2px);
}

.dashboard-trend-grid .trend-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  min-height: clamp(260px, 32vh, 380px);
}

.dashboard-action-grid .panel {
  padding: 14px;
}

.chart-title-legend {
  display: inline-flex;
  gap: 12px;
  align-items: center;
  justify-content: flex-end;
  color: #64748b;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.chart-title-legend span {
  display: inline-flex;
  gap: 5px;
  align-items: center;
}

.chart-title-legend i,
.chart-legend i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--dashboard-teal-light);
}

.chart-title-legend .legend-orange i,
.chart-legend .legend-orange i {
  background: var(--dashboard-orange);
}

.chart-title-legend .legend-green i,
.chart-legend .legend-green i {
  background: var(--dashboard-teal);
}

.chart-title-legend .legend-bar i {
  width: 7px;
  height: 11px;
  border-radius: 2px;
}

.chart-title-legend .legend-line i {
  position: relative;
  width: 14px;
  height: 2px;
  border-radius: 2px;
}

.chart-title-legend .legend-line i::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 5px;
  height: 5px;
  border: 1px solid #fff;
  border-radius: 50%;
  background: var(--dashboard-teal);
  transform: translate(-50%, -50%);
}

.dashboard-trend-grid .line-chart {
  height: 190px;
  margin: 2px 0 0;
  border: 0;
  background:
    linear-gradient(180deg, transparent 0 24%, rgba(226, 232, 240, 0.34) 24% 24.5%, transparent 24.5% 49%,
    rgba(226, 232, 240, 0.28) 49% 49.5%, transparent 49.5% 74%, rgba(226, 232, 240, 0.22) 74% 74.5%, transparent 74.5%);
}

.dashboard-trend-grid .multi-line-chart {
  height: 190px;
}

.dashboard-trend-grid .dashboard-profit-combo,
.dashboard-trend-grid .dashboard-cash-trend {
  height: clamp(160px, 24vh, 240px);
  background: transparent;
}

.profit-current-values {
  display: flex;
  gap: 20px;
  align-items: center;
  min-height: 28px;
  margin: -5px 0 2px;
  color: #66778b;
  font-variant-numeric: tabular-nums;
}

.profit-current-values span {
  display: inline-flex;
  gap: 5px;
  align-items: baseline;
  white-space: nowrap;
}

.profit-current-values i {
  width: 6px;
  height: 6px;
  border-radius: 2px;
  background: var(--dashboard-teal-light);
}

.profit-current-values .expense i {
  background: var(--dashboard-orange);
}

.profit-current-values .profit i {
  border-radius: 50%;
  background: var(--dashboard-teal);
}

.profit-current-values small {
  font-size: 11px;
}

.profit-current-values strong {
  color: #314256;
  font-size: 12px;
}

.dashboard-chart-baseline,
.dashboard-chart-grid,
.profit-zero-line,
.cash-current-guide,
.profit-trend-line,
.cash-trend-line,
.profit-bar,
.profit-trend-point,
.cash-trend-point {
  vector-effect: non-scaling-stroke;
}

.dashboard-chart-baseline {
  stroke: var(--dashboard-border);
  stroke-width: 1;
}

.dashboard-chart-grid {
  stroke: var(--dashboard-warm);
  stroke-width: 1;
  stroke-dasharray: 2 5;
}

.dashboard-chart-axis-label,
.profit-point-label,
.cash-point-label {
  fill: #9B958C;
  font-size: 10px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.profit-point-label {
  fill: var(--dashboard-teal);
  stroke: var(--panel);
  stroke-width: 3px;
  paint-order: stroke;
}

.cash-point-label {
  fill: #7B7771;
  stroke: var(--panel);
  stroke-width: 3px;
  paint-order: stroke;
}

.profit-zero-line,
.cash-current-guide {
  stroke: #D4CFC5;
  stroke-width: 1;
  stroke-dasharray: 3 5;
}

.profit-bar {
  stroke: none;
}

.revenue-bar {
  fill: var(--dashboard-teal-light);
}

.expense-bar {
  fill: var(--dashboard-orange);
}

.profit-trend-line,
.cash-trend-line {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.profit-trend-line {
  stroke: var(--dashboard-teal);
  stroke-width: 2.5;
}

.profit-trend-point {
  fill: var(--panel);
  stroke: var(--dashboard-teal);
  stroke-width: 2;
}

.cash-trend-line {
  stroke: var(--dashboard-teal-light);
  stroke-width: 2.5;
}

.cash-trend-point {
  fill: var(--panel);
  stroke: var(--dashboard-teal-light);
  stroke-width: 1.8;
}

.cash-trend-point.current {
  fill: var(--dashboard-orange);
  stroke: var(--panel);
  stroke-width: 3;
}

.profit-area-fill,
.cash-area-fill {
  opacity: 0.12;
}

.profit-area-fill {
  fill: var(--dashboard-teal);
}

.cash-area-fill {
  fill: var(--dashboard-teal-light);
}

.trend-headline {
  display: inline-flex;
  gap: 9px;
  align-items: baseline;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.trend-headline strong {
  color: #26364a;
  font-size: 16px;
}

.trend-headline small {
  font-size: 11px;
  font-weight: 600;
}

.trend-headline .positive {
  color: var(--dashboard-teal);
}

.cockpit-title,
.cockpit-kpis,
.dashboard-trend-grid,
.dashboard-action-grid {
  animation: cockpit-enter 320ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.cockpit-kpis {
  animation-delay: 35ms;
}

.dashboard-trend-grid {
  animation-delay: 70ms;
}

.dashboard-action-grid {
  animation-delay: 105ms;
}

.risk-card,
.anomaly-item {
  transition: transform 170ms ease, border-color 170ms ease, background-color 170ms ease, box-shadow 170ms ease;
}

.risk-card:hover,
.anomaly-item:hover {
  border-color: #d6e1ea;
  background: #fff;
  box-shadow: 0 8px 20px rgba(27, 48, 72, 0.07);
  transform: translateX(3px);
}

@keyframes cockpit-enter {
  from {
    opacity: 0;
    transform: translateY(7px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .cockpit-title,
  .cockpit-kpis,
  .dashboard-trend-grid,
  .dashboard-action-grid {
    animation: none;
  }

  .cockpit-kpis .kpi-card,
  .dashboard-trend-grid .panel,
  .dashboard-action-grid .panel,
  .risk-card,
  .anomaly-item {
    transition: none;
  }
}

.trend-headline .negative {
  color: #dc5a4f;
}

.trend-headline .neutral {
  color: #7b8999;
}

.trend-view-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0;
  margin-left: 8px;
  border: 1px solid var(--dashboard-border);
  border-radius: 6px;
  overflow: hidden;
  background: #f8f6f2;
}

.trend-view-toggle button {
  padding: 3px 10px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #8a97a6;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: none;
  transition: background-color 120ms ease, color 120ms ease;
}

.trend-view-toggle button.active {
  background: var(--dashboard-teal);
  color: #fff;
}

.trend-view-toggle button:hover:not(.active) {
  background: rgba(24, 90, 86, 0.08);
  color: var(--dashboard-teal);
}

.dashboard-table-wrap {
  overflow: auto;
  max-height: 100%;
}

.dashboard-mini-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.dashboard-mini-table th {
  padding: 6px 8px;
  text-align: right;
  border-bottom: 1px solid var(--dashboard-border);
  color: #6f7f91;
  font-weight: 600;
  white-space: nowrap;
}

.dashboard-mini-table th:first-child {
  text-align: left;
}

.dashboard-mini-table td {
  padding: 5px 8px;
  text-align: right;
  border-bottom: 1px solid #f0ebe3;
  color: #314256;
}

.dashboard-mini-table td:first-child {
  text-align: left;
  color: #6f7f91;
}

.dashboard-mini-table td.negative {
  color: #c94b42;
}

.summary-gross-margin {
  margin-top: 4px;
  color: var(--dashboard-teal-light, #3B948A);
  font-size: 11px;
  font-weight: 600;
}

.summary-gross-margin span {
  color: #7d8b9b;
  font-weight: 500;
}

/* Dashboard Sprint 2: result-led financial workspace */
.cockpit-title {
  display: flex;
  gap: 24px;
  align-items: flex-end;
  justify-content: space-between;
  padding: 0 2px;
}

.cockpit-title h2 {
  margin-bottom: 5px;
  font-size: 22px;
}

.cockpit-summary {
  display: grid;
  grid-template-columns: minmax(260px, 0.72fr) minmax(0, 1.78fr);
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--dashboard-border);
  border-radius: 10px;
  background: #fff;
  box-shadow: var(--dashboard-shadow);
  transition: border-color 180ms ease, box-shadow 180ms ease;
}

.cockpit-summary:hover {
  border-color: #cfdae5;
  box-shadow: var(--dashboard-shadow-hover);
}

.summary-primary {
  display: flex;
  min-width: 0;
  padding: 19px 22px 18px;
  flex-direction: column;
  justify-content: center;
  border-right: 1px solid var(--dashboard-border);
  background: #fbfcfe;
}

.summary-kicker,
.summary-metric > span {
  color: #6f7f91;
  font-size: 12px;
  font-weight: 650;
}

.summary-primary-value {
  display: flex;
  gap: 10px;
  min-width: 0;
  margin-top: 8px;
  align-items: baseline;
}

.summary-primary-value strong {
  min-width: 0;
  color: #172235;
  font-size: clamp(30px, 2.45vw, 38px);
  line-height: 1;
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
}

.summary-primary-value strong.positive {
  color: #087d6d;
}

.summary-primary-value strong.negative {
  color: #c94b42;
}

.summary-result {
  padding: 3px 7px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.summary-result.positive {
  background: #e7f5f1;
  color: #087d6d;
}

.summary-result.negative {
  background: #fceae8;
  color: #b73f37;
}

.summary-primary p {
  margin: 9px 0 0;
  color: #7d8b9b;
  font-size: 11px;
}

.summary-metrics {
  display: grid;
  min-width: 0;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.summary-metric {
  display: flex;
  min-width: 0;
  padding: 18px 16px;
  flex-direction: column;
  justify-content: center;
  border-right: 1px solid var(--dashboard-border);
  background: #fff;
  transition: background-color 160ms ease, transform 160ms ease;
}

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

.summary-metric:hover {
  z-index: 1;
  background: #f8fafc;
  transform: translateY(-2px);
}

.summary-metric strong {
  overflow: hidden;
  margin-top: 8px;
  color: #172235;
  font-size: clamp(19px, 1.55vw, 24px);
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.summary-metric small {
  margin-top: 8px;
  color: #8a97a6;
  font-size: 11px;
}

.dashboard-trend-grid {
  grid-template-columns: minmax(0, 1.22fr) minmax(340px, 0.78fr);
}

.dashboard-trend-grid .trend-panel {
  min-height: clamp(280px, 34vh, 400px);
  padding: 16px 18px 14px;
}

.dashboard-trend-grid .dashboard-profit-combo,
.dashboard-trend-grid .dashboard-cash-trend {
  height: clamp(170px, 26vh, 250px);
}

.cockpit-summary,
.dashboard-trend-grid,
.dashboard-action-grid {
  animation: cockpit-enter 320ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.cockpit-summary {
  animation-delay: 35ms;
}

@media (max-width: 1180px) {
  .cockpit-summary {
    grid-template-columns: 1fr;
  }

  .summary-primary {
    border-right: 0;
    border-bottom: 1px solid var(--dashboard-border);
  }

  .dashboard-trend-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .cockpit-title {
    align-items: flex-start;
    flex-direction: column;
  }

  .cockpit-health-strip {
    justify-content: flex-start;
  }

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

  .summary-metric:nth-child(2) {
    border-right: 0;
  }

  .summary-metric:nth-child(-n + 2) {
    border-bottom: 1px solid var(--dashboard-border);
  }
}

@media (prefers-reduced-motion: reduce) {
  .cockpit-summary {
    animation: none;
  }

  .cockpit-summary,
  .summary-metric {
    transition: none;
  }
}

.line-chart-line {
  stroke-width: 1.9;
}

.multi-line-chart .line-chart-line.series-green {
  stroke-width: 2.4;
}

.multi-line-chart .line-chart-line.series-orange {
  stroke-dasharray: 6 5;
}

.line-chart-area {
  fill: transparent;
}

.line-chart-zero {
  stroke: rgba(100, 116, 139, 0.18);
  stroke-width: 1;
  stroke-dasharray: 3 5;
}

.line-chart-point {
  fill: #fff;
  stroke: #2563eb;
  stroke-width: 2.2;
}

.line-chart-point.series-blue {
  fill: #fff;
  stroke: #2563eb;
}

.line-chart-point.series-orange {
  fill: #fff;
  stroke: #f59e0b;
  stroke-dasharray: none;
}

.line-chart-point.series-green {
  fill: #fff;
  stroke: #059669;
}

.line-chart-line.series-blue {
  stroke: #2563eb;
  fill: none;
}

.line-chart-label.series-blue {
  fill: #2563eb;
}

.line-chart-line.series-orange {
  stroke: #f59e0b;
  fill: none;
}

.line-chart-label.series-orange {
  fill: #f59e0b;
}

.line-chart-line.series-green {
  stroke: #059669;
  fill: none;
}

.line-chart-label.series-green {
  fill: #059669;
}

.trend-axis {
  display: flex;
  justify-content: space-between;
  gap: 0;
  margin: 2px 0 0;
  padding: 0 5%;
  color: #8a97a8;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.trend-axis span {
  flex: 0 0 auto;
  min-width: 0;
  text-align: center;
}

.trend-panel .trend-axis {
  max-height: none;
  overflow: visible;
}

.risk-list,
.anomaly-list {
  display: grid;
  gap: 8px;
}

.risk-card {
  grid-template-columns: 9px minmax(0, 1fr) auto;
  gap: 8px 10px;
  align-items: center;
  min-height: 44px;
  padding: 9px 10px;
  border-color: transparent;
  border-radius: 7px;
  background: #f8fafc;
}

.risk-card .risk-dot {
  margin-top: 0;
}

.risk-card .risk-title {
  color: #34495f;
  font-size: 13px;
}

.risk-card strong {
  grid-column: 3;
  grid-row: 1 / span 2;
  color: #0f172a;
  font-size: 24px;
  text-align: right;
}

.risk-card small {
  grid-column: 2;
  color: #8794a5;
  font-size: 12px;
}

.anomaly-item {
  min-height: 48px;
  padding: 9px 10px;
  border-color: transparent;
  border-radius: 7px;
  background: #f8fafc;
}

.anomaly-item strong {
  font-size: 13px;
}

.anomaly-item small,
.anomaly-item time {
  font-size: 12px;
}

@media (max-width: 1280px) {
  .topbar {
    gap: 12px;
    padding-left: 16px;
    padding-right: 16px;
  }

  .top-actions {
    gap: 8px;
  }

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

  .period-stepper {
    grid-template-columns: 26px 88px 66px 26px 40px;
  }

  .top-actions > select {
    flex-basis: 190px;
    min-width: 170px;
  }

  .app-shell {
    grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  }

  .view {
    padding: 12px 16px 20px;
  }

  .workspace-nav {
    grid-template-columns: 32px minmax(0, 1fr) auto;
    margin: 0 0 10px;
    padding: 0 0 8px;
  }

  .workspace-heading p,
  .workspace-heading .hint {
    display: none;
  }

  .tab {
    gap: 8px;
    padding: 12px 12px;
    font-size: 15px;
  }

  .nav-icon {
    width: 26px;
    height: 26px;
    font-size: 15px;
  }

  .voucher-head {
    grid-template-columns: minmax(360px, 1fr) auto minmax(120px, 1fr);
    gap: 12px;
  }

  .voucher-table {
    min-width: 1180px;
  }

  .voucher-table .amount-scale th,
  .voucher-table .amount-scale {
    letter-spacing: 1px;
    font-size: 10px;
  }

  .col-summary {
    width: 16%;
  }

  .col-account {
    width: 21%;
  }

  .col-auxiliary {
    width: 17%;
  }

  .col-quantity,
  .col-price {
    width: 66px;
  }

  .col-debit,
  .col-credit {
    width: 140px;
  }

  .cockpit-kpis {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

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

  .cockpit-grid > .pending-panel {
    grid-column: 1 / span 2;
    grid-row: auto;
  }

  .cockpit-grid > .trend-summary-panel {
    grid-column: 1 / span 2;
  }

  .common-action-grid {
    grid-template-columns: repeat(3, minmax(140px, 1fr));
  }

  .dashboard-focus-grid {
    grid-template-columns: 1fr;
  }

  .trend-axis {
    padding: 0 5%;
  }

  .trend-axis span:nth-child(even) {
    visibility: hidden;
  }

  .risk-center-panel {
    grid-row: auto;
  }
}

@media (min-width: 1181px) {
  .cockpit-kpis {
    grid-template-columns: repeat(5, minmax(150px, 1fr));
  }

  .cockpit-grid {
    grid-template-columns: minmax(240px, 1fr) minmax(240px, 1fr) minmax(260px, 0.9fr);
  }

  .cockpit-grid > .pending-panel {
    grid-column: 3;
    grid-row: 1 / span 2;
  }

  .cockpit-grid > .trend-summary-panel {
    grid-column: 1 / span 2;
  }

  .common-action-grid {
    grid-template-columns: repeat(6, minmax(130px, 1fr));
  }
}

@media (max-width: 960px) {
  body {
    display: block;
    height: auto;
    min-height: 100vh;
    overflow: auto;
  }

  .topbar,
  .top-actions {
    display: grid;
    min-width: 0;
  }

  .topbar h1,
  .topbar p {
    white-space: normal;
  }

  .top-actions > select {
    min-width: 0;
  }

  .app-shell {
    grid-template-columns: 1fr;
    min-height: calc(100vh - 135px);
  }

  .login-screen {
    grid-template-columns: 1fr;
    gap: 32px;
    width: min(560px, 100%);
    padding: 36px 20px;
  }

  .login-brand {
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr);
    gap: 4px 16px;
    align-items: center;
    padding-left: 0;
  }

  .login-logo {
    grid-row: 1 / 4;
    width: 64px;
    height: 64px;
    margin: 0;
  }

  .login-kicker {
    align-self: end;
  }

  .login-brand h2 {
    margin: 2px 0;
    font-size: 36px;
  }

  .login-brand p {
    align-self: start;
    font-size: 14px;
  }

  .login-points {
    display: none;
  }

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

  .tabs {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .tab {
    width: auto;
    white-space: nowrap;
    border-left: 0;
    border-bottom: 3px solid transparent;
  }

  .tab.active {
    border-bottom-color: var(--brand);
  }

  .workspace-nav {
    grid-template-columns: 32px minmax(0, 1fr) auto;
    margin: 0 0 10px;
    padding: 0 0 8px;
  }

  .cockpit-title,
  .cockpit-title-actions {
    display: grid;
    align-items: start;
  }

  .cockpit-kpis,
  .cockpit-grid,
  .dashboard-focus-grid,
  .common-action-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-trend-grid,
  .dashboard-action-grid {
    grid-template-columns: 1fr;
  }

  .trend-axis {
    padding: 0 5%;
  }

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

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

  .cockpit-grid > .pending-panel {
    grid-column: auto;
    grid-row: auto;
  }

  .cockpit-grid > .trend-summary-panel {
    grid-column: auto;
  }

  .workspace-actions {
    overflow-x: auto;
  }

  .dashboard-hero,
  .workbench,
  .kpi-board {
    grid-template-columns: 1fr;
  }

  .grid.two,
  .grid.three,
  .grid.four,
  .form-grid,
  .module-grid {
    grid-template-columns: 1fr;
  }

  .module-group {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .module-group > .module-grid {
    grid-template-columns: 1fr;
  }

  .release-entry {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 18px;
  }

  .report-template-switch {
    width: 100%;
    overflow-x: auto;
  }

  .report-template-switch button {
    flex: 0 0 auto;
  }
}

@media print {
  @page {
    size: A4;
    margin: 10mm 10mm 12mm 18mm;
  }

  html,
  body {
    width: auto;
    min-width: 0;
  }

  body {
    height: auto;
    overflow: visible;
    background: #fff;
    display: block;
    color: #111;
  }

  .topbar,
  .tabs,
  .workspace-nav,
  .view > :not(.print-area) {
    display: none !important;
  }

  .app-shell,
  .view {
    display: block;
    height: auto;
    overflow: visible;
    padding: 0;
  }

  .print-area {
    display: block;
    width: 158mm;
    margin: 0 auto;
    overflow: visible;
  }

  .print-voucher:nth-child(2n - 1) {
    border-bottom: 1px dashed #bbb;
  }

  body.print-report-view .view > :not(.print-area) {
    display: block !important;
  }

  body.print-report-view .view > .workspace-nav,
  body.print-report-view .view form,
  body.print-report-view .view button,
  body.print-report-view .view .actions,
  body.print-report-view .view .ledger-browser-panel,
  body.print-report-view .view .hint:not(.report-print-note) {
    display: none !important;
  }

  body.print-report-view .view .panel,
  body.print-report-view .view .table-wrap {
    width: 100%;
    margin: 0 0 8mm;
    padding: 0;
    overflow: visible;
    border: 0;
    box-shadow: none;
  }

  body.print-report-view .view table {
    width: 100%;
    font-size: 9pt;
  }
}
/* Product Design sidebar refresh */
.tabs {
  width: var(--sidebar-width);
  padding: 14px 14px 16px;
  background: #fff;
  border-right: 1px solid #e4eaf0;
  box-shadow: none;
  backdrop-filter: none;
}

.nav-section-label {
  padding: 8px 14px 10px;
  color: #718095;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
}

.nav-section-divider {
  height: 1px;
  margin: 10px 6px 14px;
  background: #e4eaf0;
}

.tab {
  position: relative;
  gap: 11px;
  min-height: 40px;
  margin: 0 0 2px;
  padding: 8px 14px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #40536a;
  font-size: 14px;
  font-weight: 500;
  box-shadow: none;
  transition: background-color 160ms ease, color 160ms ease;
}

.tab:hover {
  transform: none;
  background: #f4f7fb;
  color: #27364a;
}

.tab.active {
  transform: none;
  background: #eaf2ff;
  color: #2f6fec;
  font-weight: 650;
  box-shadow: none;
}

.tab.active::before {
  display: none;
}

.nav-icon {
  display: block;
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  border: 0;
  border-radius: 0;
  background: currentColor;
  -webkit-mask-image: var(--nav-icon);
  mask-image: var(--nav-icon);
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-size: 20px 20px;
  mask-size: 20px 20px;
  color: currentColor;
  font-size: 0;
}

@media (max-width: 960px) {
  .tabs {
    width: 100%;
    padding: 8px 10px;
    align-items: center;
  }

  .nav-section-label,
  .nav-section-divider {
    display: none;
  }

  .tab {
    flex: 0 0 auto;
    min-height: 40px;
    margin: 0;
    padding: 8px 12px;
    border-bottom: 0;
  }

  .nav-icon {
    flex-basis: 20px;
    width: 20px;
    height: 20px;
    -webkit-mask-size: 20px 20px;
    mask-size: 20px 20px;
  }
}
/* Excel-inspired cross-platform typography calibration */
:root {
  --ui-font: "Segoe UI Variable Text", "Segoe UI", "Microsoft YaHei UI",
    "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", Arial, sans-serif;
}

html {
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-weight: 400;
  line-height: 1.45;
}

button,
input,
select,
textarea {
  font-family: var(--ui-font);
}

button,
.secondary,
.link-button {
  font-weight: 500;
}

input,
select,
textarea {
  font-weight: 400;
}

h1,
h2,
h3,
h4,
h5,
h6,
strong,
b {
  letter-spacing: 0;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: 600;
}

strong,
b {
  font-weight: 600;
}

.topbar h1,
.login-brand h2,
.login-panel h2,
.section-title h2,
.section-title h3,
.panel h3,
.cockpit-title h2 {
  font-weight: 600;
}

.app-version,
.login-kicker,
.login-brand p,
.login-points span,
.login-panel .field,
.summary-result,
.kpi-card span:not(.kpi-icon),
.summary-kicker,
.summary-metric > span {
  font-weight: 500;
}

.summary-primary-value strong,
.summary-metric strong,
.metric strong,
.kpi-card strong {
  font-weight: 600;
}

.nav-section-label {
  font-weight: 500;
}

.tab,
.tab.active {
  font-weight: 500;
}

table th,
.dashboard-mini-table th,
.voucher-table tfoot td {
  font-weight: 500;
}

table td {
  font-weight: 400;
}

.number,
.money,
.amount,
.summary-primary-value strong,
.summary-metric strong,
.kpi-card strong {
  font-variant-numeric: tabular-nums;
}
.ai-assistant-page-title {
  min-height: 34px;
}

.ai-task-capacity {
  color: #718095;
  font-size: 11px;
}

.ai-assistant-workspace {
  height: calc(100vh - 132px);
  min-height: 560px;
  display: grid;
  grid-template-columns: 210px minmax(420px, 1fr) minmax(340px, 0.78fr);
  border: 1px solid #d9e3eb;
  border-radius: 7px;
  background: #fff;
  box-shadow: 0 8px 26px rgba(31, 51, 73, 0.06);
  overflow: hidden;
}

.ai-thread-sidebar {
  min-width: 0;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  border-right: 1px solid #dfe7ee;
  background: #f6f8fa;
}

.ai-agent-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
  padding: 9px;
  border-bottom: 1px solid #dfe7ee;
  background: #fff;
}

.ai-agent-tab {
  min-height: 30px;
  padding: 0 8px;
  border: 1px solid #d7e1ea;
  border-radius: 6px;
  background: #f7fafc;
  color: #64758a;
  box-shadow: none;
  font-size: 11px;
  font-weight: 700;
}

.ai-agent-tab.active {
  border-color: #bfd5f4;
  background: #eaf2fc;
  color: #2364b7;
}

.ai-thread-sidebar-head {
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 10px 9px 13px;
  border-bottom: 1px solid #dfe7ee;
}

.ai-thread-sidebar-head strong {
  color: #293b4f;
  font-size: 13px;
}

.ai-thread-sidebar-head button {
  display: grid;
  width: 30px;
  height: 30px;
  min-height: 30px;
  padding: 0;
  place-items: center;
  border: 1px solid #d4e0e9;
  border-radius: 6px;
  background: #fff;
  color: #2d69bd;
  box-shadow: none;
  font-size: 18px;
}

.ai-thread-list {
  min-height: 0;
  padding: 7px;
  overflow-y: auto;
}

.ai-thread-empty {
  margin: 18px 9px;
  color: #7a8999;
  font-size: 11px;
  line-height: 1.6;
}

.ai-thread-item {
  position: relative;
  width: 100%;
  display: block;
  min-height: 62px;
  margin-bottom: 4px;
  padding: 9px 10px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: #31455a;
  box-shadow: none;
  text-align: left;
}

.ai-thread-item:hover {
  border-color: #dce6ee;
  background: #fff;
  transform: none;
}

.ai-thread-item.active {
  border-color: #cbdcf1;
  background: #eaf2fc;
  color: #1f5fae;
}

.ai-thread-title,
.ai-thread-meta,
.ai-thread-state {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ai-thread-title {
  padding-right: 70px;
  font-size: 12px;
  font-weight: 600;
}

.ai-thread-mode {
  position: absolute;
  right: 8px;
  bottom: 8px;
  max-width: 36px;
  color: #6e8094;
  font-size: 9px;
}

.ai-thread-meta {
  margin-top: 5px;
  color: #758496;
  font-size: 10px;
}

.ai-thread-state {
  position: absolute;
  top: 9px;
  right: 8px;
  color: #8996a5;
  font-size: 9px;
}

.ai-thread-state.running {
  color: #c07800;
}

.ai-conversation-pane {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  background: #f8fafc;
}

.ai-conversation-head {
  min-height: 50px;
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px 8px 15px;
  border-bottom: 1px solid #dfe7ee;
  background: #fff;
}

.ai-conversation-head strong,
.ai-conversation-head span {
  display: block;
}

.ai-conversation-head strong {
  max-width: 430px;
  overflow: hidden;
  color: #26394e;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ai-conversation-head strong em {
  margin-left: 6px;
  color: #2d69bd;
  font-size: 10px;
  font-style: normal;
  font-weight: 700;
}

.ai-conversation-head > div:first-child span {
  margin-top: 2px;
  color: #788798;
  font-size: 10px;
}

.ai-conversation-actions {
  display: flex;
  gap: 5px;
  align-items: center;
}

.ai-conversation-actions .status {
  min-height: 24px;
  margin: 0 4px 0 0;
  padding: 3px 7px;
  font-size: 10px;
}

.ai-conversation-actions .icon-btn {
  width: 28px;
  min-width: 28px;
  height: 28px;
  min-height: 28px;
  padding: 0;
  border: 1px solid #d9e3eb;
  background: #fff;
  color: #64768a;
  box-shadow: none;
}

.ai-result-pane {
  min-width: 0;
  min-height: 0;
  padding: 16px;
  border-left: 1px solid #dfe7ee;
  overflow-y: auto;
  background: #fff;
}

.ai-workspace-empty {
  grid-row: 1 / -1;
  display: grid;
  align-content: center;
  justify-items: center;
  padding: 36px;
  color: #748397;
  text-align: center;
}

.ai-workspace-empty-mark {
  display: grid;
  width: 42px;
  height: 42px;
  margin-bottom: 12px;
  place-items: center;
  border-radius: 7px;
  background: #eaf2ff;
  color: #2563b9;
  font-size: 13px;
  font-weight: 700;
}

.ai-workspace-empty strong {
  color: #344b62;
  font-size: 15px;
}

.ai-workspace-empty p {
  max-width: 360px;
  margin: 7px 0 14px;
  font-size: 11px;
  line-height: 1.7;
}

.ai-message-attachments {
  display: block;
  margin-top: 7px;
  color: #708398;
  font-size: 10px;
}

.ai-use-draft {
  width: 100%;
  margin-top: 14px;
}

.ai-voucher-entry-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 76px;
}

.ai-voucher-entry-panel strong {
  display: block;
  color: #203247;
  font-size: 14px;
}

.ai-voucher-entry-panel p {
  margin: 4px 0 0;
  color: #718095;
  font-size: 12px;
}

.ai-voucher-modal {
  width: min(1180px, 96vw);
  height: min(760px, 90vh);
  max-height: 90vh;
  border: 1px solid #d9e3eb;
}

.ai-voucher-modal .modal-head {
  min-height: 62px;
  padding: 11px 16px;
  background: #fff;
}

.ai-voucher-dialog-title,
.ai-voucher-head-actions,
.ai-voucher-head-actions > div {
  display: flex;
  gap: 10px;
  align-items: center;
}

.ai-voucher-dialog-title small {
  display: block;
  margin-top: 2px;
  color: #718095;
  font-size: 11px;
}

.ai-voucher-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 7px;
  background: #eaf2ff;
  color: #1f67d8;
  font-size: 12px;
  font-weight: 700;
}

.ai-voucher-head-actions .status {
  min-height: 26px;
  margin: 0;
  padding: 4px 8px;
  font-size: 11px;
}

.ai-voucher-head-actions .icon-btn {
  display: grid;
  width: 32px;
  height: 32px;
  min-height: 32px;
  padding: 0;
  place-items: center;
  border: 0;
  background: #f1f4f7;
  color: #52657a;
  box-shadow: none;
}

.ai-voucher-body {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(390px, 0.92fr);
  min-height: 0;
  overflow: hidden;
}

.ai-chat-pane {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  background: #f7f9fb;
}

.ai-chat-messages {
  min-height: 0;
  padding: 18px;
  overflow-y: auto;
}

.ai-message {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 9px;
  align-items: start;
  margin-bottom: 14px;
}

.ai-message-role {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 6px;
  background: #e7eef8;
  color: #41617f;
  font-size: 11px;
  font-weight: 600;
}

.ai-message > div {
  max-width: 88%;
  padding: 10px 12px;
  border: 1px solid #dfe7ee;
  border-radius: 7px;
  background: #fff;
  color: #26384d;
  font-size: 13px;
  line-height: 1.65;
}

.ai-message.user {
  grid-template-columns: minmax(0, 1fr) 30px;
}

.ai-message.user .ai-message-role {
  grid-column: 2;
  background: #dfeeff;
  color: #1f67d8;
}

.ai-message.user > div {
  grid-column: 1;
  grid-row: 1;
  justify-self: end;
  border-color: #cfe0f8;
  background: #edf5ff;
}

.ai-message.is-error > div {
  border-color: #efc9c6;
  background: #fff4f3;
  color: #9f2d25;
}

.ai-message.is-thinking > div {
  display: flex;
  gap: 5px;
  align-items: center;
  color: #718095;
}

.ai-message.is-thinking div span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #4f86d9;
  animation: ai-thinking 1.1s infinite ease-in-out;
}

.ai-message.is-thinking div span:nth-child(2) {
  animation-delay: 0.14s;
}

.ai-message.is-thinking div span:nth-child(3) {
  animation-delay: 0.28s;
}

.ai-message.is-thinking em {
  margin-left: 4px;
  font-size: 11px;
  font-style: normal;
}

@keyframes ai-thinking {
  0%, 70%, 100% { opacity: 0.35; transform: translateY(0); }
  35% { opacity: 1; transform: translateY(-2px); }
}

.ai-chat-compose {
  padding: 12px 14px 14px;
  border-top: 1px solid #dfe7ee;
  background: #fff;
}

.ai-chat-compose textarea {
  width: 100%;
  min-height: 84px;
  max-height: 150px;
  resize: vertical;
  border-color: #ccd9e4;
  line-height: 1.55;
}

.ai-compose-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
}

.ai-compose-actions > div {
  display: flex;
  gap: 8px;
  align-items: center;
}

.ai-compose-actions button {
  min-height: 34px;
}

.ai-paperclip-icon,
.ai-attachment-icon,
.ai-draft-empty-icon {
  display: inline-block;
  width: 15px;
  height: 15px;
  background: currentColor;
}

.ai-paperclip-icon {
  -webkit-mask: url("assets/icons/actions/paperclip.svg") center / contain no-repeat;
  mask: url("assets/icons/actions/paperclip.svg") center / contain no-repeat;
}

.ai-attachment-icon,
.ai-draft-empty-icon {
  -webkit-mask: url("assets/icons/actions/file-image.svg") center / contain no-repeat;
  mask: url("assets/icons/actions/file-image.svg") center / contain no-repeat;
}

.ai-attach-button {
  display: inline-flex;
  gap: 6px;
  align-items: center;
}

.ai-attachment-list {
  display: flex;
  gap: 6px;
  margin-bottom: 8px;
  overflow-x: auto;
}

.ai-attachment {
  display: inline-flex;
  gap: 5px;
  align-items: center;
  max-width: 210px;
  min-height: 28px;
  padding: 3px 5px 3px 8px;
  border: 1px solid #d9e3eb;
  border-radius: 6px;
  background: #f8fafc;
  color: #52657a;
  font-size: 11px;
}

.ai-attachment > span:nth-child(2) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ai-remove-attachment {
  width: 22px;
  min-width: 22px;
  height: 22px;
  min-height: 22px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #7b8999;
  box-shadow: none;
}

.ai-remove-attachment:hover {
  background: #e8eef3;
  color: #b42318;
  transform: none;
}

.ai-config-message {
  margin: 8px 0 0;
  font-size: 11px;
}

.ai-draft-pane {
  min-width: 0;
  min-height: 0;
  padding: 18px;
  border-left: 1px solid #dfe7ee;
  overflow-y: auto;
  background: #fff;
}

.ai-draft-empty {
  height: 100%;
  display: grid;
  align-content: center;
  justify-items: center;
  padding: 32px;
  color: #718095;
  text-align: center;
}

.ai-draft-empty-icon {
  width: 36px;
  height: 36px;
  margin-bottom: 12px;
  color: #9eb5cb;
}

.ai-draft-empty strong {
  color: #40556c;
  font-size: 15px;
}

.ai-draft-empty p {
  max-width: 310px;
  margin: 8px 0 0;
  font-size: 12px;
  line-height: 1.7;
}

.ai-draft-heading {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 12px;
  border-bottom: 1px solid #e1e8ee;
}

.ai-draft-heading span:first-child {
  display: block;
  color: #718095;
  font-size: 11px;
}

.ai-draft-heading strong {
  display: block;
  margin-top: 3px;
  color: #203247;
  font-size: 16px;
}

.ai-draft-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  margin: 12px 0;
  border: 1px solid #dfe7ee;
  border-radius: 6px;
  background: #dfe7ee;
  overflow: hidden;
}

.ai-draft-summary span {
  padding: 8px;
  background: #f8fafc;
  color: #718095;
  font-size: 10px;
}

.ai-draft-summary strong {
  display: block;
  margin-top: 2px;
  color: #203247;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.ai-draft-table-wrap {
  border: 1px solid #dfe7ee;
  border-radius: 6px;
  overflow: hidden;
}

.ai-draft-table {
  width: 100%;
  min-width: 0;
}

.ai-draft-table th {
  padding: 7px 8px;
  background: #f2f6f9;
  color: #617286;
  font-size: 10px;
}

.ai-draft-table td {
  padding: 9px 8px;
  font-size: 11px;
}

.ai-draft-table td:first-child {
  min-width: 180px;
}

.ai-draft-table td strong,
.ai-draft-table td small {
  display: block;
}

.ai-draft-table td strong {
  color: #293b4f;
  font-weight: 500;
}

.ai-draft-table td small {
  margin-top: 3px;
  color: #718095;
}

.ai-draft-warnings {
  margin-top: 12px;
  padding: 10px 12px;
  border-left: 3px solid #e3a21a;
  background: #fff9ec;
  color: #6f551d;
  font-size: 11px;
}

.ai-draft-warnings ul {
  margin: 6px 0 0;
  padding-left: 17px;
}

.ai-draft-warnings li + li {
  margin-top: 4px;
}

.ai-draft-ok {
  margin: 12px 0 0;
}

.ai-draft-footnote {
  margin: 12px 0 0;
  color: #7a8999;
  font-size: 10px;
}

.ai-voucher-modal .modal-actions {
  min-height: 58px;
  padding: 10px 16px;
  background: #f8fafc;
}

.ai-voucher-footer-spacer {
  flex: 1;
}

@media (max-width: 900px) {
  .ai-voucher-modal {
    height: 94vh;
    max-height: 94vh;
  }

  .ai-voucher-body {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(360px, 1fr) minmax(260px, 0.8fr);
    overflow-y: auto;
  }

  .ai-draft-pane {
    border-top: 1px solid #dfe7ee;
    border-left: 0;
  }
}

@media (max-width: 1200px) {
  .ai-assistant-workspace {
    grid-template-columns: 180px minmax(380px, 1fr) 320px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ai-message.is-thinking div span {
    animation: none;
  }
}

/* ===== 待复核草稿：查看弹窗 ===== */
.ai-draft-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(2px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: aiDraftModalFadeIn 0.15s ease-out;
}
@keyframes aiDraftModalFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
.ai-draft-modal {
  background: #ffffff;
  border-radius: 12px;
  width: min(720px, 96vw);
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(15, 23, 42, 0.25);
  border: 1px solid #e2ddd5;
  animation: aiDraftModalSlideIn 0.2s ease-out;
}
@keyframes aiDraftModalSlideIn {
  from { transform: translateY(-12px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
.ai-draft-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid #e7e3da;
}
.ai-draft-modal-head h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: #203247;
}
.ai-draft-modal-close {
  background: transparent;
  border: 0;
  font-size: 22px;
  line-height: 1;
  color: #718095;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: background 0.15s, color 0.15s;
}
.ai-draft-modal-close:hover {
  background: #f2f6f9;
  color: #203247;
}
.ai-draft-modal-body {
  padding: 16px 18px;
  overflow-y: auto;
  flex: 1 1 auto;
}

/* ===== 批量审核进度条 ===== */
.voucher-batch-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 10px;
  padding: 10px 14px;
  background: linear-gradient(135deg, #fef5e7 0%, #fdebd3 100%);
  border: 1px solid #f3c179;
  border-radius: 8px;
  font-size: 13px;
  color: #6b4a16;
}
.voucher-batch-banner strong {
  color: #185A56;
  margin-right: 4px;
}
.voucher-batch-banner button {
  min-height: 28px;
  padding: 2px 10px;
  font-size: 12px;
}

/* ---- Toast ---- */
.ui-toast-container {
  position: fixed;
  top: 60px;
  right: 24px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  max-width: 420px;
}
.ui-toast {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 4px 16px rgba(0,0,0,.15);
  border-left: 4px solid #3B948A;
  font-size: 13px;
  line-height: 1.5;
  pointer-events: auto;
  cursor: pointer;
  opacity: 0;
  transform: translateX(20px);
  transition: opacity .25s ease, transform .25s ease;
}
.ui-toast-in { opacity: 1; transform: translateX(0); }
.ui-toast-out { opacity: 0; transform: translateX(20px); }
.ui-toast-icon {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  background: #3B948A;
}
.ui-toast-success { border-left-color: #2D7A4E; }
.ui-toast-success .ui-toast-icon { background: #2D7A4E; }
.ui-toast-error { border-left-color: #C53030; }
.ui-toast-error .ui-toast-icon { background: #C53030; }
.ui-toast-warn { border-left-color: #D69E2E; }
.ui-toast-warn .ui-toast-icon { background: #D69E2E; }
.ui-toast-info { border-left-color: #3B948A; }
.ui-toast-msg { flex: 1; min-width: 0; color: #2D3748; }

/* ---- Confirm Dialog ---- */
.ui-confirm-overlay {
  position: fixed;
  inset: 0;
  z-index: 10001;
  background: rgba(0,0,0,.35);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity .2s ease;
}
.ui-confirm-in { opacity: 1; }
.ui-confirm-dialog {
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 8px 32px rgba(0,0,0,.2);
  width: min(400px, 92vw);
  overflow: hidden;
  transform: scale(.96);
  transition: transform .2s ease;
}
.ui-confirm-in .ui-confirm-dialog { transform: scale(1); }
.ui-confirm-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px 0;
}
.ui-confirm-title {
  font-size: 15px;
  font-weight: 600;
  color: #185A56;
  margin: 0;
}
.ui-confirm-close {
  border: none;
  background: none;
  font-size: 20px;
  line-height: 1;
  color: #999;
  cursor: pointer;
  padding: 0 0 0 8px;
}
.ui-confirm-close:hover { color: #333; }
.ui-confirm-body {
  padding: 12px 18px 18px;
}
.ui-confirm-msg {
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
  color: #2D3748;
  white-space: pre-wrap;
}
.ui-confirm-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 0 18px 16px;
}
.ui-confirm-foot button {
  min-height: 32px;
  padding: 4px 16px;
  font-size: 13px;
  border-radius: 6px;
  cursor: pointer;
}
.ui-confirm-ok { background: #185A56; color: #fff; border: 1px solid #185A56; }
.ui-confirm-ok:hover { background: #144A46; }
.ui-confirm-cancel { background: #f7f7f7; color: #555; border: 1px solid #ddd; }
.ui-confirm-cancel:hover { background: #eee; }
.ui-confirm-danger .ui-confirm-title { color: #C53030; }
.ui-confirm-danger .ui-confirm-ok { background: #C53030; border-color: #C53030; }
.ui-confirm-danger .ui-confirm-ok:hover { background: #9B2C2C; }

/* ===== 2026-07 智能助手工作流重构 ===== */
.ai-assistant-page-title {
  align-items: center;
}

.ai-page-actions,
.ai-page-actions .ai-agent-switch {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ai-page-actions .ai-agent-switch {
  padding: 0;
  border: 0;
  background: transparent;
}

.ai-page-actions .ai-agent-tab {
  min-width: 92px;
  min-height: 34px;
  font-size: 12px;
}

.ai-assistant-workspace,
.ai-assistant-workspace.is-qa,
.ai-assistant-workspace.is-voucher {
  grid-template-columns: 220px minmax(0, 1fr);
  height: calc(100vh - 136px);
  min-height: 560px;
}

.ai-thread-sidebar {
  grid-template-rows: auto minmax(0, 1fr);
}

.ai-conversation-pane {
  min-width: 0;
}

.ai-voucher-workbench {
  min-height: 0;
  padding: 16px;
  overflow-y: auto;
  background: #f7f8f6;
}

.ai-upload-panel,
.ai-batch-result,
.ai-inline-draft,
.ai-voucher-activity,
.ai-voucher-empty-state {
  border: 1px solid #dfe4df;
  border-radius: 7px;
  background: #fff;
}

.ai-upload-panel {
  padding: 16px;
}

.ai-upload-heading,
.ai-batch-result-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.ai-upload-heading strong,
.ai-batch-result-head strong {
  color: #243a38;
  font-size: 14px;
}

.ai-upload-heading p,
.ai-batch-result-head p {
  margin: 4px 0 0;
  color: #718079;
  font-size: 11px;
  line-height: 1.6;
}

.ai-voucher-submit-form {
  margin-top: 14px;
}

.ai-voucher-submit-form textarea {
  min-height: 64px;
  resize: vertical;
}

.ai-batch-result,
.ai-inline-draft,
.ai-voucher-activity,
.ai-voucher-empty-state {
  margin-top: 14px;
  padding: 16px;
}

.ai-batch-table-wrap {
  margin-top: 12px;
  border: 1px solid #e2e7e2;
  border-radius: 6px;
  overflow: auto;
}

.ai-batch-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
}

.ai-batch-table th,
.ai-batch-table td {
  padding: 9px 10px;
  border-bottom: 1px solid #e8ece8;
  color: #435450;
  text-align: left;
  vertical-align: top;
}

.ai-batch-table th {
  background: #f4f6f4;
  color: #586b66;
  font-weight: 700;
}

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

.ai-batch-state,
.ai-draft-status {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 2px 7px;
  border-radius: 5px;
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}

.ai-batch-state.is-ready,
.ai-draft-status.is-ready {
  background: #e6f3ec;
  color: #24684b;
}

.ai-batch-state.is-warning,
.ai-batch-state.is-running,
.ai-draft-status.is-warning {
  background: #fff2dc;
  color: #9a6416;
}

.ai-batch-state.is-failed {
  background: #fce8e6;
  color: #b13b36;
}

.ai-voucher-empty-state {
  min-height: 140px;
  display: grid;
  align-content: center;
  justify-items: center;
  color: #75827d;
  text-align: center;
}

.ai-voucher-empty-state strong,
.ai-voucher-activity strong {
  color: #314743;
  font-size: 13px;
}

.ai-voucher-empty-state p,
.ai-voucher-activity p {
  margin: 6px 0 0;
  font-size: 11px;
  line-height: 1.7;
}

.ai-voucher-activity.is-error {
  border-color: #ebc5c1;
  background: #fffafa;
}

.draft-inbox-control-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
  padding: 10px 12px;
}

.draft-inbox-filters,
.draft-inbox-toolbar {
  display: flex;
  align-items: center;
  gap: 7px;
}

.draft-filter-button {
  min-height: 32px;
  padding: 4px 10px;
  border: 1px solid #d9e1dc;
  border-radius: 6px;
  background: #fff;
  color: #5e6e69;
  box-shadow: none;
  font-size: 11px;
}

.draft-filter-button strong {
  margin-left: 4px;
  color: inherit;
}

.draft-filter-button.active {
  border-color: #a9c9c1;
  background: #e8f1ee;
  color: #185a56;
}

@media (max-width: 980px) {
  .ai-assistant-workspace,
  .ai-assistant-workspace.is-qa,
  .ai-assistant-workspace.is-voucher {
    grid-template-columns: 190px minmax(0, 1fr);
  }

  .ai-page-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .draft-inbox-control-panel {
    align-items: flex-start;
    flex-direction: column;
  }
}
/* Voucher workspace and detail dialog polish */
.ui-icon {
  display: inline-block;
  flex: 0 0 16px;
  width: 16px;
  height: 16px;
  background: currentColor;
  -webkit-mask: var(--ui-icon) center / contain no-repeat;
  mask: var(--ui-icon) center / contain no-repeat;
}

.ui-icon-square-pen {
  --ui-icon: url("assets/icons/actions/square-pen.svg");
}

.ui-icon-copy {
  --ui-icon: url("assets/icons/actions/copy.svg");
}

.ui-icon-x {
  --ui-icon: url("assets/icons/actions/x.svg");
}

.ui-icon-book-open {
  --ui-icon: url("assets/icons/navigation/book-open.svg");
}

.voucher-page {
  gap: 12px;
  width: 100%;
}

.voucher-workbar {
  align-items: center;
  min-height: 46px;
  padding: 5px 6px;
  border: 1px solid #dfe7ee;
  border-radius: 6px;
  background: #fff;
}

.voucher-tabs {
  gap: 2px;
  padding: 3px;
  border-radius: 6px;
  background: #f1f4f7;
}

.voucher-tab {
  min-width: 88px;
  padding: 7px 13px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: #5f6f82;
}

.voucher-tab.active,
.voucher-tab:hover {
  background: #fff;
  color: #245edb;
  box-shadow: 0 1px 3px rgba(28, 48, 68, 0.1);
}

.voucher-tab.active {
  font-weight: 600;
}

.voucher-toolbar {
  padding: 0;
}

.voucher-toolbar .actions {
  gap: 6px;
}

.voucher-toolbar button {
  min-height: 34px;
  padding: 7px 12px;
}

.voucher-card {
  border-color: #d6e0e8;
  border-radius: 6px;
  box-shadow: 0 6px 18px rgba(45, 50, 44, 0.06);
}

.voucher-page .voucher-card,
.voucher-page .voucher-workbar {
  width: 100%;
  max-width: none;
}

.voucher-head {
  min-height: 86px;
  padding: 14px 18px;
  border-bottom-color: #dfe7ee;
  background: #fff;
}

.voucher-title h2 {
  position: relative;
  padding-bottom: 8px;
  color: #183130;
  font-size: 24px;
  font-weight: 700;
}

.voucher-title h2::after {
  position: absolute;
  right: 20%;
  bottom: 0;
  left: 20%;
  height: 2px;
  background: #185a56;
  content: "";
}

.voucher-title p {
  color: #758497;
}

.voucher-field-group {
  gap: 9px;
}

.voucher-field-group label {
  gap: 6px;
  color: #69798c;
  font-size: 12px;
  font-weight: 500;
}

.voucher-field-group input,
.voucher-field-group select {
  min-height: 34px;
  border-color: #dbe4ec;
  background: #f9fbfc;
}

.voucher-table-wrap {
  padding: 16px 18px 14px;
}

.voucher-table {
  border-color: #b9c8d5;
}

.voucher-table th,
.voucher-table td {
  border-right-color: #d6e1e9;
  border-bottom-color: #d6e1e9;
}

.voucher-table th {
  background: #f1eee8;
  color: #244744;
  font-weight: 600;
}

.voucher-table tbody tr:hover td {
  background: #fbf8f2;
}

.voucher-table input,
.voucher-table select {
  color: #1e2d40;
}

.voucher-table input:focus,
.voucher-table select:focus {
  background: #fff;
  box-shadow: inset 0 -2px 0 #185a56;
}

.auxiliary-suggestion-popup {
  position: fixed;
  z-index: 1200;
  max-height: 280px;
  overflow-y: auto;
  padding: 5px;
  border: 1px solid #d7e1e9;
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 14px 34px rgba(24, 43, 64, 0.18);
}

.auxiliary-suggestion-popup[hidden] {
  display: none;
}

.auxiliary-suggestion {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  align-items: center;
  width: 100%;
  min-height: 34px;
  padding: 6px 9px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #26384c;
  text-align: left;
}

.auxiliary-suggestion:hover,
.auxiliary-suggestion.active {
  background: #edf4ff;
  color: #1859c9;
}

.auxiliary-suggestion strong {
  color: #53708c;
  font-size: 12px;
  font-weight: 500;
}

.auxiliary-suggestion span {
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.voucher-table .money-input,
.voucher-table td.number {
  font-family: var(--ui-font);
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}

.voucher-table .amount-scale th,
.voucher-table .amount-scale {
  color: #718095;
  letter-spacing: 0;
}

.voucher-table tfoot td {
  background: #f2f7fb;
  color: #25374a;
  font-weight: 500;
}

.voucher-footer {
  min-height: 36px;
  padding: 8px 16px;
  border-top-color: #e3eaf0;
  background: #fff;
  color: #718095;
  font-size: 12px;
}

.modal-backdrop {
  background: rgba(21, 34, 48, 0.46);
  backdrop-filter: blur(3px);
}

.voucher-modal {
  width: min(1180px, 96vw);
  max-height: min(900px, 94vh);
  border: 1px solid rgba(215, 225, 233, 0.95);
  border-radius: 8px;
  box-shadow: 0 24px 70px rgba(15, 28, 44, 0.3);
}

.voucher-modal .modal-head {
  min-height: 48px;
  padding: 8px 14px;
  background: #f6f3ed;
}

.voucher-modal .modal-head strong {
  color: #1b2a3d;
  font-size: 16px;
  font-weight: 600;
}

.voucher-modal .modal-head .icon-btn {
  display: grid;
  width: 32px;
  height: 32px;
  min-height: 32px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 6px;
  background: #f1f4f7;
  color: #52657a;
  box-shadow: none;
}

.voucher-modal .modal-head .icon-btn:hover {
  background: #e8eef3;
  color: #1f3d5a;
  transform: none;
}

.voucher-modal .modal-head .icon-btn:focus-visible {
  outline: 2px solid #2f6fed;
  outline-offset: 2px;
}

.voucher-modal .modal-body {
  padding: 0;
  background: #fdfcf9;
}

.voucher-preview-card {
  width: 100%;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.voucher-preview-head {
  position: relative;
  grid-template-columns: minmax(430px, 1fr) auto minmax(130px, 0.7fr);
  min-height: 92px;
  padding: 14px 20px;
}

.voucher-preview-head .voucher-title {
  position: absolute;
  left: 50%;
  width: max-content;
  max-width: 34%;
  text-align: center;
  transform: translateX(-50%);
}

.voucher-preview-head .voucher-preview-fields {
  grid-column: 1;
}

.voucher-preview-head .voucher-preview-attachment {
  grid-column: 3;
  justify-self: end;
}

.voucher-preview-fields {
  align-items: center;
}

.voucher-preview-field {
  display: grid;
  gap: 5px;
  min-width: 70px;
}

.voucher-preview-field > span {
  color: #69798c;
  font-size: 12px;
  font-weight: 500;
}

.voucher-preview-field strong,
.voucher-preview-attachment strong {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid #dbe4ec;
  border-radius: 5px;
  background: #f9fbfc;
  color: #1e2d40;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.2;
}

.voucher-preview-number {
  min-width: 118px;
}

.voucher-preview-date {
  min-width: 112px;
}

.voucher-preview-attachment {
  align-items: center;
}

.voucher-preview-attachment strong {
  justify-content: flex-end;
  width: 58px;
  font-variant-numeric: tabular-nums;
}

.voucher-detail-status {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  font-weight: 500;
}

.voucher-detail-status.is-balanced {
  background: #e8f6f2;
  color: #087d6d;
}

.voucher-detail-status.is-unbalanced {
  background: #fdebea;
  color: #b42318;
}

.voucher-preview-table-wrap {
  max-height: min(58vh, 600px);
  padding: 16px 20px;
}

.voucher-preview-table {
  min-width: 940px;
}

.voucher-preview-table tbody td {
  height: 48px;
  padding: 8px 10px;
  color: #26384c;
  line-height: 1.45;
}

.voucher-preview-table tbody tr:hover td {
  background: #fffdf9;
}

.voucher-preview-table .voucher-preview-row-no {
  color: #718095;
  text-align: center;
}

.voucher-preview-table .voucher-preview-account {
  color: #183130;
  font-weight: 500;
}

.voucher-preview-table .voucher-preview-auxiliary {
  color: #65758a;
  font-size: 12px;
}

.voucher-preview-table .negative {
  color: #c2413b;
}

.voucher-preview-table .voucher-total-cell {
  padding-left: 12px;
}

.voucher-preview-footer {
  flex-wrap: wrap;
  justify-content: flex-start;
  padding-right: 20px;
  padding-left: 20px;
}

.voucher-preview-footer span:last-child {
  margin-left: auto;
}

.voucher-modal .modal-actions {
  min-height: 60px;
  padding: 12px 18px;
  background: #f8fafc;
}

.voucher-modal .modal-actions button {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  min-height: 36px;
}

@media (max-width: 1280px) {
  .voucher-workbar {
    align-items: flex-start;
  }

  .voucher-toolbar .actions {
    justify-content: flex-end;
  }

  .voucher-head {
    grid-template-columns: minmax(340px, 1fr) auto minmax(110px, 0.7fr);
    gap: 12px;
  }

  .voucher-preview-head {
    grid-template-columns: minmax(370px, 1fr) auto minmax(100px, 0.6fr);
  }
}

@media (max-width: 960px) {
  .voucher-workbar {
    align-items: stretch;
    flex-direction: column;
  }

  .voucher-toolbar .actions {
    justify-content: flex-start;
  }

  .voucher-preview-head {
    grid-template-columns: 1fr auto;
    align-items: center;
  }

  .voucher-preview-head .voucher-title {
    position: static;
    grid-column: 1 / -1;
    grid-row: 1;
    width: auto;
    max-width: none;
    transform: none;
  }

  .voucher-preview-head .voucher-preview-fields {
    grid-column: 1;
    grid-row: 2;
  }

  .voucher-preview-head .voucher-preview-attachment {
    grid-column: 2;
    grid-row: 2;
    justify-self: end;
  }
}
/* Operational pages prioritize the table; the dashboard keeps its own spacious layout. */
.view {
  padding-top: 10px;
}

.workspace-nav {
  margin-bottom: 7px;
  padding-bottom: 6px;
}

.workspace-nav.has-recent {
  grid-template-columns: 32px auto 1fr auto;
  gap: 8px;
}

.workspace-nav.has-recent .workspace-heading {
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
  overflow: hidden;
}

.workspace-nav.has-recent .workspace-recent {
  grid-column: 3;
  grid-row: 1;
  justify-self: end;
  min-width: 0;
  max-width: 100%;
  padding-left: 12px;
}

.workspace-nav.has-recent .workspace-actions {
  grid-column: 4;
  grid-row: 1;
  justify-self: end;
}

.workspace-heading {
  gap: 8px;
}

.workspace-heading h2,
.workspace-heading h3 {
  font-size: 17px;
  line-height: 30px;
}

.workspace-recent {
  display: flex;
  gap: 5px;
  align-items: center;
  min-width: 0;
  padding: 0;
  border: 0;
  overflow: hidden;
}

.workspace-recent-label {
  display: none;
}

.workspace-tabs {
  flex: 1 1 auto;
  overflow-x: auto;
  scrollbar-width: none;
}

.workspace-tabs::-webkit-scrollbar {
  display: none;
}

.workspace-tab {
  min-height: 24px;
  max-width: 132px;
  padding: 2px 6px;
  font-size: 11px;
}

.workspace-nav > button,
.workspace-actions > button {
  min-height: 30px;
  padding: 4px 8px;
}

.workspace-back {
  width: 30px;
  min-width: 30px;
  height: 30px;
}

.view .grid:has(> .metric) {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
  gap: 1px;
  margin: 0 0 8px;
  border: 1px solid #dfe7ee;
  border-radius: 7px;
  background: #dfe7ee;
  overflow: hidden;
}

.view .grid:has(> .metric) > .metric {
  display: flex;
  gap: 8px;
  align-items: baseline;
  justify-content: space-between;
  min-width: 0;
  min-height: 42px;
  padding: 8px 11px;
  background: #fff;
}

.view .grid:has(> .metric) > .metric .hint {
  flex: 0 0 auto;
  color: #718095;
  font-size: 11px;
}

.view .grid:has(> .metric) > .metric strong {
  min-width: 0;
  overflow: hidden;
  color: #213247;
  font-size: 16px;
  font-variant-numeric: tabular-nums;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.view .grid:has(> .metric) + .panel {
  margin-top: 0 !important;
}

.view .panel:has(> .query-range-controls) {
  padding: 10px 13px 11px;
}

.view .panel:has(> .query-range-controls) > .query-range-controls {
  margin-bottom: 7px;
}

.view .query-range-controls {
  gap: 8px;
}

.view .query-range-controls label {
  gap: 4px;
  font-size: 11px;
}

.view .query-range-controls input,
.view .query-range-controls select {
  min-height: 32px;
  padding: 6px 8px;
  border-radius: 6px;
}

.view .panel:has(> .query-range-controls) > .hint {
  margin: 3px 0 7px;
  font-size: 11px;
  line-height: 1.4;
}

.view .ledger-summary-strip {
  min-height: 40px;
  margin-bottom: 6px;
}

.view .ledger-summary-strip > span {
  padding: 7px 10px;
}

.searchable-select-native {
  display: none !important;
}

.searchable-select-control {
  position: relative;
  width: 100%;
  min-width: 0;
}

.top-actions > .searchable-select-control {
  flex: 0 1 260px;
  min-width: 170px;
  max-width: 280px;
}

.searchable-select-input {
  width: 100%;
  min-width: 0;
  min-height: 32px;
  padding-right: 24px !important;
  overflow: hidden;
  background-color: #fff !important;
  background-image: url("assets/icons/navigation/chevron-down.svg") !important;
  background-repeat: no-repeat !important;
  background-position: right 8px center !important;
  background-size: 14px 14px !important;
  font-family: var(--ui-font);
  font-size: 12px !important;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.searchable-select-input:focus {
  background-image: url("assets/icons/navigation/search.svg") !important;
  border-color: #79a9ee;
  box-shadow: 0 0 0 2px rgba(52, 120, 246, 0.12);
}

.searchable-select-popup {
  position: fixed;
  z-index: 1400;
  max-height: 292px;
  overflow-y: auto;
  padding: 4px;
  border: 1px solid #d6e1ea;
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 14px 32px rgba(24, 43, 64, 0.18);
}

.searchable-select-option {
  display: grid;
  grid-template-columns: minmax(58px, auto) minmax(0, 1fr);
  gap: 9px;
  align-items: center;
  width: 100%;
  min-height: 34px;
  padding: 6px 8px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #27394d;
  font-family: var(--ui-font);
  font-size: 12px;
  line-height: 1.4;
  text-align: left;
}

.searchable-select-option small {
  overflow: hidden;
  color: #698097;
  font-size: 11px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.searchable-select-option span {
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.searchable-select-option:hover,
.searchable-select-option.is-active {
  background: #edf4ff;
  color: #1859c9;
}

.searchable-select-option.is-selected {
  grid-template-columns: minmax(58px, auto) minmax(0, 1fr) 16px;
}

.searchable-select-option.is-selected::after {
  color: #3478f6;
  content: "✓";
  font-size: 12px;
}

.searchable-select-empty {
  padding: 16px 10px;
  color: #7a8999;
  font-size: 12px;
  text-align: center;
}

@media (max-width: 1280px) {
  .view {
    padding-top: 8px;
  }

  .workspace-nav.has-recent {
    grid-template-columns: 30px auto minmax(80px, 1fr) auto;
  }

  .workspace-tabs {
    max-width: 260px;
  }

  .workspace-tab {
    max-width: 110px;
  }

  .view .grid:has(> .metric) {
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  }

  .top-actions > .searchable-select-control {
    flex-basis: 190px;
  }
}

@media print {
  .view .grid:has(> .metric) {
    display: none;
  }

  body.print-report-view.print-voucher-list-full .view > * {
    display: none !important;
  }

  body.print-report-view.print-voucher-list-full .view > .voucher-list-full-print {
    display: block !important;
  }

  .voucher-list-full-print h2,
  .voucher-list-full-print p {
    text-align: center;
  }
}

.voucher-list-full-print {
  display: none;
}
/* D-011 visual theme: warm, compact, and finance-focused. */
:root {
  --bg: #f5f3ef;
  --bg-deep: #ebe8e2;
  --panel: #fffdfa;
  --topbar-bg: #f5f3ef;
  --sidebar-bg: #185a56;
  --line: #e3ded6;
  --line-strong: #cfc7bc;
  --text: #202a2c;
  --muted: #7b7771;
  --brand: #185a56;
  --brand-dark: #0f4642;
  --brand-soft: #e5f0ed;
  --accent: #fd742d;
  --accent-dark: #dc5e1f;
  --accent-soft: #fff0e7;
  --ok: #16836f;
  --danger: #c9362c;
  --warn: #b66a13;
  --shadow: 0 14px 34px rgba(38, 47, 42, 0.1);
  --soft-shadow: 0 8px 22px rgba(38, 47, 42, 0.06);
  --sidebar-width: 168px;
  --shell-max: 1440px;
  --content-max: calc(var(--shell-max) - var(--sidebar-width));
}

@media (min-width: 1920px) {
  :root {
    --shell-max: 1680px;
  }
}

@media (min-width: 2400px) {
  :root {
    --shell-max: 2200px;
  }
}

* {
  scrollbar-color: #a9a39a transparent;
}

*::-webkit-scrollbar-thumb {
  background: #a9a39a;
  background-clip: padding-box;
}

*::-webkit-scrollbar-thumb:hover {
  background: #857f76;
  background-clip: padding-box;
}

body,
body.login-mode,
body.login-mode .app-shell,
body.login-mode .app-shell.login-only .view,
.login-screen,
.app-shell,
.view {
  background: var(--bg);
}

body:not(.login-mode) {
  grid-template-rows: 52px minmax(0, 1fr);
}

body:not(.login-mode) .topbar {
  width: calc(100% - var(--sidebar-width));
  margin-left: var(--sidebar-width);
}

body:not(.login-mode) .app-shell {
  width: calc(100% - var(--sidebar-width));
  margin-left: var(--sidebar-width);
  margin-right: 0;
  grid-template-columns: minmax(0, 1fr);
}

body.login-mode .topbar,
body.login-mode .app-shell,
body.login-mode .app-shell.login-only .view {
  width: 100%;
  margin-left: 0;
}

button {
  background: var(--brand);
  box-shadow: 0 8px 18px rgba(24, 90, 86, 0.14);
}

button:hover {
  background: var(--brand-dark);
}

button.secondary {
  border-color: #d8d0c5;
  background: #fffdfa;
  color: #514d47;
}

button.secondary:hover {
  background: #f1eee8;
}

button.danger {
  background: linear-gradient(135deg, #d74a3d, var(--danger));
}

.link-button,
.voucher-number-link,
.cash-journal-link,
.ledger-voucher-link,
.voucher-detail-link,
.drilldown-link,
a {
  color: var(--brand-dark);
}

.link-button:hover,
.voucher-number-link:hover,
.cash-journal-row:hover .cash-journal-link,
.ledger-drilldown-row:hover .ledger-voucher-link,
a:hover {
  color: var(--brand);
}

input,
select,
textarea,
.top-actions input,
.top-actions select,
.login-panel input,
.searchable-select-input {
  border-color: #d8d0c5;
  background-color: #fffdfa !important;
  color: var(--text);
}

input:focus,
select:focus,
textarea:focus,
.searchable-select-input:focus {
  border-color: var(--brand);
  background-color: #fff !important;
  box-shadow: 0 0 0 3px rgba(24, 90, 86, 0.14);
}

.topbar {
  background: var(--topbar-bg);
  border-bottom-color: #e5dfd7;
  box-shadow: none;
  justify-content: flex-end;
  align-items: center;
  overflow: visible;
  padding-left: 14px;
  padding-right: 16px;
}

.topbar h1,
.workspace-heading h2,
.workspace-heading h3,
.cockpit-title h2,
.section-title h2,
.section-title h3,
.panel h3 {
  color: #183130;
}

.topbar p,
.period-control,
.workspace-heading p,
.workspace-heading .hint {
  color: var(--muted);
}

.brand-logo,
.login-logo {
  box-shadow: 0 12px 28px rgba(24, 90, 86, 0.16);
}

.app-version {
  border-color: rgba(24, 90, 86, 0.2);
  background: var(--brand-soft);
  color: var(--brand-dark);
}

.status {
  border-color: #d8d0c5;
  background: #fffdfa;
  color: #514d47;
}

.topbar .status {
  background: #eef7f3;
  color: var(--brand-dark);
}

.topbar .top-actions {
  flex-wrap: nowrap;
}

.topbar .period-control {
  flex: 0 0 auto;
  min-width: max-content;
}

.topbar .period-stepper {
  grid-template-columns: 34px minmax(120px, auto) minmax(96px, auto) 34px 50px;
  gap: 5px;
}

.topbar .period-stepper #periodYearSelect {
  min-width: 120px;
  width: auto;
}

.topbar .period-stepper #periodMonthSelect {
  min-width: 96px;
  width: auto;
}

.topbar .period-stepper #periodYearSelect,
.topbar .period-stepper #periodMonthSelect {
  padding-left: 12px;
  padding-right: 28px;
  font-size: 13px;
  line-height: 20px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tabs {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 80;
  display: flex;
  flex-direction: column;
  gap: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--sidebar-bg);
  border-right: 0;
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.08);
  padding: 0;
  overflow: hidden;
}

.sidebar-brand {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 9px;
  align-items: center;
  min-height: 52px;
  padding: 9px 12px;
  color: #fff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: transparent;
}

.sidebar-logo {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.16);
}

.sidebar-brand strong {
  display: block;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: 0;
}

.sidebar-brand span {
  display: block;
  margin-top: 3px;
  color: rgba(255, 255, 255, 0.56);
  font-size: 11px;
  line-height: 1;
}

.sidebar-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 12px 8px 10px;
}

.sidebar-scroll::-webkit-scrollbar {
  width: 0;
}

.nav-section-label {
  color: rgba(255, 255, 255, 0.5);
  margin: 12px 6px 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0;
}

.nav-section-divider {
  background: rgba(255, 255, 255, 0.12);
  margin: 12px 8px 10px;
}

.tab {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  min-height: 38px;
  margin: 1px 0;
  padding: 8px 9px 8px 10px;
  color: rgba(255, 255, 255, 0.78);
  border-radius: 7px;
  font-size: 13px;
}

.tab:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.tab.active {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.tab.active::before {
  display: block;
  content: "";
  position: absolute;
  left: 0;
  top: 7px;
  bottom: 7px;
  width: 3px;
  border-radius: 999px;
  background: var(--accent);
}

.nav-icon {
  width: 16px;
  height: 16px;
  color: currentColor;
}

.tab.active .nav-icon {
  color: var(--accent);
}

.nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  margin-left: auto;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--accent, #fd742d);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
}

.sidebar-user {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 9px;
  align-items: center;
  min-height: 86px;
  padding: 12px 10px 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  background: transparent;
}

.sidebar-avatar {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.86);
  font-size: 12px;
  font-weight: 700;
}

.sidebar-user-text {
  min-width: 0;
}

.sidebar-user .status {
  position: relative;
  display: block;
  width: auto;
  max-width: 100%;
  min-height: 0;
  padding: 0 0 0 12px;
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.9);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 600;
}

.sidebar-user .status::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: currentColor;
  transform: translateY(-50%);
}

.sidebar-user .status.ok {
  color: #d8fff3;
}

.sidebar-user .status.warn {
  color: #ffe0c8;
}

.sidebar-user small {
  display: block;
  margin-top: 2px;
  color: rgba(255, 255, 255, 0.45);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 10px;
  line-height: 1.1;
}

.sidebar-logout {
  grid-column: 1 / -1;
  min-width: 0;
  width: 100%;
  min-height: 30px;
  margin-top: 2px;
  padding: 5px 8px;
  border-color: rgba(255, 255, 255, 0.16) !important;
  background: rgba(255, 255, 255, 0.08) !important;
  color: rgba(255, 255, 255, 0.82) !important;
  font-size: 11px;
  font-weight: 600;
  box-shadow: none;
}

.sidebar-logout:hover {
  background: rgba(253, 116, 45, 0.18) !important;
  color: #fff !important;
  transform: none;
}

.workspace-nav {
  border-bottom-color: #ddd6cc;
  grid-template-columns: 36px auto minmax(0, 1fr) auto;
}

.workspace-nav.has-recent {
  grid-template-columns: 36px auto minmax(0, 1fr) auto;
  align-items: center;
}

.workspace-heading {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
}

.workspace-heading h2 {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.workspace-recent {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.workspace-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  min-width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid #d8d0c5;
  border-radius: 10px;
  background: #fffdfa;
  color: #514d47;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.workspace-back:hover:not(:disabled) {
  background: #eef7f3;
  border-color: #185a56;
  color: #185a56;
  box-shadow: 0 2px 8px rgba(24, 90, 86, 0.12);
}

.workspace-back:active:not(:disabled) {
  background: #e0f0ea;
  transform: scale(0.96);
}

.workspace-back:disabled {
  opacity: 0.35;
  cursor: default;
  border-color: #e5dfd7;
  background: #f5f3ef;
}

.workspace-back svg {
  display: block;
  pointer-events: none;
}

.workspace-nav > button,
.workspace-actions > button {
  border-color: #d8d0c5;
  background: #fffdfa;
  color: #514d47;
}

.workspace-nav > button:hover,
.workspace-actions > button:hover {
  background: #f1eee8;
  color: var(--brand-dark);
}

.workspace-tab {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 28px;
  padding: 0 8px 0 12px;
  color: #776f65;
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
  background: #f3eee5;
  border: 1px solid #e2ddd5;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.16s ease, color 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
  white-space: nowrap;
}

.workspace-tab > span:first-child {
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.workspace-tab:hover {
  background: #eaf3ee;
  border-color: #b8d4c8;
  color: #185a56;
}

.workspace-tab.active {
  background: #185a56;
  border-color: #185a56;
  color: #fffdfa;
  box-shadow: 0 2px 6px rgba(24, 90, 86, 0.18);
}

.workspace-tab-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  margin-left: 2px;
  border-radius: 4px;
  color: inherit;
  opacity: 0.6;
  font-size: 0;
  line-height: 0;
  transition: background 0.14s ease, opacity 0.14s ease;
}

.workspace-tab-close::before {
  content: "";
  width: 10px;
  height: 10px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'><path d='M2 2l6 6M8 2l-6 6' stroke='black' stroke-width='1.6' stroke-linecap='round'/></svg>") center/contain no-repeat;
  mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'><path d='M2 2l6 6M8 2l-6 6' stroke='black' stroke-width='1.6' stroke-linecap='round'/></svg>") center/contain no-repeat;
}

.workspace-tab:hover .workspace-tab-close,
.workspace-tab.active .workspace-tab-close {
  opacity: 1;
}

.workspace-tab-close:hover {
  background: rgba(24, 90, 86, 0.16);
  opacity: 1;
}

.workspace-tab.active .workspace-tab-close:hover {
  background: rgba(255, 253, 250, 0.18);
}

.workspace-recent-label {
  font-size: 11px;
  color: #a39b8f;
  letter-spacing: 0.02em;
  white-space: nowrap;
  margin-right: 2px;
}

.workspace-tabs {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  overflow: hidden;
  flex-wrap: nowrap;
}

.panel,
.quick-panel,
.health-panel,
.kpi-card,
.module-tile,
.report-sheet,
.login-panel {
  border-color: #e2ddd5;
  background: var(--panel);
  box-shadow: 0 8px 22px rgba(38, 47, 42, 0.045);
}

.table-wrap,
.dashboard-table-wrap,
.account-table-wrap {
  border-color: var(--line);
  background: #fffdfa;
}

table {
  color: #2b3334;
}

th,
.dashboard-mini-table th,
.account-table th {
  background: #f1eee8;
  border-bottom-color: var(--brand);
  color: var(--brand-dark);
  text-align: center;
  vertical-align: middle;
}

th.number,
.dashboard-mini-table th.number,
.account-table th.number {
  text-align: center;
}

td,
.dashboard-mini-table td,
.account-table td {
  border-bottom-color: var(--line);
}

tbody tr:hover td,
.dashboard-mini-table tbody tr:hover td,
.account-table tbody tr:hover td,
.cash-journal-row:hover td,
.cash-journal-row:focus td,
.cash-journal-row:focus-within td,
.ledger-drilldown-row:hover td,
.ledger-drilldown-row:focus td,
.ledger-drilldown-row:focus-within td {
  background: #fbf8f2;
}

tfoot td,
.voucher-table tfoot td,
.summary-total-row td,
.report-total-row td {
  background: #ede9e1;
  color: var(--brand-dark);
  font-weight: 600;
}

.view .grid:has(> .metric) {
  border-color: var(--line);
  background: var(--line);
}

.view .grid:has(> .metric) > .metric {
  background: var(--panel);
}

.view .grid:has(> .metric) > .metric strong,
.kpi-card strong,
.summary-primary-value strong,
.summary-metric strong {
  color: #183130;
}

.query-range-controls label,
.voucher-search-controls label,
.view .grid:has(> .metric) > .metric .hint,
.searchable-select-option small {
  color: var(--muted);
}

.searchable-select-popup {
  border-color: #d8d0c5;
  background: #fffdfa;
  box-shadow: 0 14px 32px rgba(38, 47, 42, 0.18);
}

.searchable-select-option {
  color: #2d3536;
}

.searchable-select-option:hover,
.searchable-select-option.is-active {
  background: var(--brand-soft);
  color: var(--brand-dark);
}

.searchable-select-option.is-selected::after {
  color: var(--accent);
}

.login-kicker {
  color: var(--brand-dark);
}

.login-brand h2 {
  color: #132927;
}

.login-brand p,
.login-points span,
.login-panel .field {
  color: #514d47;
}

.login-points span {
  border-right-color: #d8d0c5;
}

.login-footnote,
.login-panel > .hint {
  color: var(--muted);
}

.login-actions button:not(.secondary),
.workspace-actions button:not(.secondary),
.actions button:not(.secondary):not(.link-button):not(.icon-btn),
.voucher-toolbar button:not(.secondary),
.module-action-primary {
  background: var(--brand);
}

.login-actions button:not(.secondary):hover,
.workspace-actions button:not(.secondary):hover,
.actions button:not(.secondary):not(.link-button):not(.icon-btn):hover,
.voucher-toolbar button:not(.secondary):hover,
.module-action-primary:hover {
  background: var(--brand-dark);
}

.actions button.accent,
button.accent,
.button-accent {
  background: var(--accent);
  box-shadow: 0 8px 18px rgba(253, 116, 45, 0.18);
}

.actions button.accent:hover,
button.accent:hover,
.button-accent:hover {
  background: var(--accent-dark);
}

.quick-icon,
.kpi-icon {
  background: var(--brand-soft);
  color: var(--brand-dark);
}

.kpi-card .kpi-icon::before,
.line-chart-point.series-blue,
.chart-legend i {
  background: var(--brand);
  fill: #fff;
  stroke: var(--brand);
}

.line-chart-line,
.line-chart-line.series-blue,
.line-chart-line.series-green,
.tone-green .line-chart-line {
  stroke: var(--brand);
}

.line-chart-area {
  fill: rgba(24, 90, 86, 0.09);
}

.line-chart-point {
  fill: var(--brand);
  stroke: #e5f0ed;
}

.line-chart-label.series-blue,
.line-chart-label.series-green {
  fill: var(--brand);
}

.line-chart-line.series-orange,
.tone-orange .line-chart-line {
  stroke: var(--accent);
}

.line-chart-point.series-orange {
  fill: #fff;
  stroke: var(--accent);
}

.line-chart-label.series-orange {
  fill: var(--accent);
  stroke: none;
}

.chart-legend .legend-orange i,
.tone-orange .kpi-icon::before,
.tone-橙 .kpi-icon::before,
.pending-dot.warn {
  background: var(--accent);
}

.tone-orange .kpi-icon,
.tone-橙 .kpi-icon {
  background: var(--accent-soft);
}

.pending-dot,
.tone-green .kpi-icon::before,
.tone-绿 .kpi-icon::before {
  background: var(--ok);
}

.negative,
.dashboard-mini-table .negative,
.amount-negative,
.text-danger {
  color: var(--danger);
}

.positive,
.amount-positive,
.text-ok {
  color: var(--ok);
}

.account-strip span,
.ledger-summary-strip,
.summary-strip,
.report-meta,
.account-parent-row td,
.fixed-asset-fieldset,
.view .panel:has(> .query-range-controls) {
  background: #fbf8f2;
  border-color: var(--line);
}

.cockpit-kpis .kpi-card::after {
  background: rgba(24, 90, 86, 0.08);
}

.dashboard-mini-table tbody tr:hover td,
.quick-action:hover,
.reconcile-item:hover,
.pending-item:hover {
  border-color: #d3cabf;
  background: #fbf8f2;
}

.voucher-workbar,
.voucher-card,
.voucher-head,
.voucher-table,
.ai-assistant-workspace,
.ai-voucher-modal,
.ai-result-pane,
.ai-conversation-head,
.ai-agent-switch {
  border-color: var(--line);
  background: var(--panel);
}

.voucher-tabs {
  background: #ede9e1;
}

.voucher-tab {
  color: #746c62;
}

.voucher-tab.active,
.voucher-tab:hover {
  background: #fffdfa;
  color: var(--brand-dark);
  box-shadow: 0 1px 3px rgba(38, 47, 42, 0.1);
}

.voucher-table {
  border-color: var(--line-strong);
}

.voucher-table th,
.voucher-table td {
  border-right-color: var(--line);
  border-bottom-color: var(--line);
}

.voucher-table th {
  background: #f1eee8;
  color: var(--brand-dark);
}

.voucher-table tbody tr:hover td {
  background: #fbf8f2;
}

.voucher-table input:focus,
.voucher-table select:focus {
  outline: 2px solid rgba(24, 90, 86, 0.58);
  outline-offset: -2px;
  box-shadow: inset 0 -3px 0 var(--brand);
}

.voucher-table input {
  caret-color: #c4472f;
}

.voucher-table input:focus {
  caret-color: #c4472f;
}

.auxiliary-suggestion-popup {
  border-color: #d8d0c5;
  background: #fffdfa;
  box-shadow: 0 14px 34px rgba(38, 47, 42, 0.18);
}

.auxiliary-suggestion {
  color: #2d3536;
}

.auxiliary-suggestion:hover,
.auxiliary-suggestion.active {
  background: var(--brand-soft);
  color: var(--brand-dark);
}

.auxiliary-suggestion strong {
  color: var(--muted);
}

.ai-thread-sidebar,
.ai-conversation-pane {
  background: #f3f0ea;
}

.ai-agent-tab {
  border-color: #d8d0c5;
  background: #fbf8f2;
  color: #746c62;
}

.ai-agent-tab.active,
.ai-thread-item.active {
  border-color: rgba(24, 90, 86, 0.28);
  background: var(--brand-soft);
  color: var(--brand-dark);
}

.ai-thread-item:hover {
  border-color: #d8d0c5;
  background: #fffdfa;
}

.ai-thread-sidebar-head strong,
.ai-conversation-head strong,
.ai-workspace-empty strong,
.ai-voucher-entry-panel strong {
  color: #183130;
}

.ai-conversation-head strong em,
.ai-thread-sidebar-head button,
.ai-workspace-empty-mark,
.ai-voucher-mark {
  background: var(--brand-soft);
  color: var(--brand-dark);
}

.ai-conversation-actions .icon-btn,
.ai-voucher-head-actions .icon-btn {
  border-color: #d8d0c5;
  background: #fbf8f2;
  color: #746c62;
}

.cash-journal-row:focus,
.ledger-drilldown-row:focus {
  outline-color: rgba(24, 90, 86, 0.55);
}

@media (max-width: 960px) {
  body:not(.login-mode) {
    grid-template-rows: auto minmax(0, 1fr);
  }

  body:not(.login-mode) .topbar,
  body:not(.login-mode) .app-shell {
    width: 100%;
    margin-left: 0;
  }

  body:not(.login-mode) .app-shell {
    grid-template-columns: minmax(0, 1fr);
  }

  .tabs {
    position: static;
    width: 100%;
    height: auto;
    display: flex;
    flex-direction: row;
    background: #113f3c;
  }

  .sidebar-brand,
  .sidebar-user {
    display: none;
  }

  .sidebar-scroll {
    display: contents;
    padding: 0;
  }

  .tab {
    border-radius: 7px;
  }

  .tab.active::before {
    left: 8px;
    right: 8px;
    top: auto;
    bottom: 3px;
    width: auto;
    height: 2px;
  }
}

/* 红字凭证：负数金额以红色显示，便于识别为红字（销售退回/折让） */
.amount-negative {
  color: #c0392b;
  font-weight: 600;
}
/* 用户与权限 */
.user-permission-title {
  align-items: center;
}

.user-permission-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(120px, 180px));
  margin-bottom: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.user-permission-summary > div {
  display: grid;
  grid-template-columns: auto auto;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 11px 14px;
  border-right: 1px solid var(--line);
}

.user-permission-summary > div:last-child {
  border-right: 0;
}

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

.user-permission-summary strong {
  color: var(--brand-dark);
  font-size: 18px;
}

.user-account-panel,
.user-permission-matrix-panel {
  padding: 0;
  overflow: hidden;
}

.user-permission-matrix-panel {
  margin-top: 12px;
}

.user-permission-section-head {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0 14px;
  border-bottom: 1px solid var(--line);
  background: #f8f5ef;
}

.user-permission-section-head h3 {
  margin: 0;
  font-size: 14px;
}

.user-account-panel > .table-wrap,
.user-permission-matrix-panel > .table-wrap {
  max-height: min(48vh, 520px);
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.user-name-cell {
  display: grid;
  gap: 2px;
}

.user-name-cell small,
.fixed-account-label,
.permission-none {
  color: var(--muted);
  font-size: 12px;
}

.user-account-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
}

.user-account-actions button {
  min-height: 30px;
  padding: 5px 10px;
}

.user-status-switch {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
  cursor: pointer;
}

.user-status-switch input {
  appearance: none;
  width: 32px;
  height: 18px;
  margin: 0;
  border: 1px solid #c8c0b5;
  border-radius: 9px;
  background: #d9d4cb;
  cursor: pointer;
  transition: background 140ms ease, border-color 140ms ease;
}

.user-status-switch input::before {
  content: "";
  display: block;
  width: 14px;
  height: 14px;
  margin: 1px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(38, 47, 42, 0.25);
  transition: transform 140ms ease;
}

.user-status-switch input:checked {
  border-color: var(--brand);
  background: var(--brand);
}

.user-status-switch input:checked::before {
  transform: translateX(14px);
}

.user-status-switch input:disabled {
  cursor: wait;
  opacity: 0.55;
}

.managed-user-modal {
  width: min(480px, 94vw);
}

.managed-user-form {
  display: grid;
  gap: 14px;
  background: #fdfcf9;
}

.managed-user-error {
  margin: 0;
}

@media (max-width: 720px) {
  .user-permission-summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .user-permission-summary > div {
    grid-template-columns: 1fr;
    gap: 3px;
    padding: 9px 10px;
  }

  .user-account-actions {
    align-items: flex-start;
    flex-direction: column;
  }
}
/* v0.3.1 operating health dashboard */
.ui-icon-dashboard-revenue { --ui-icon: url("assets/icons/dashboard/revenue.svg"); }
.ui-icon-dashboard-expense { --ui-icon: url("assets/icons/dashboard/expense.svg"); }
.ui-icon-dashboard-cash { --ui-icon: url("assets/icons/dashboard/cash.svg"); }
.ui-icon-dashboard-receivable { --ui-icon: url("assets/icons/dashboard/receivable.svg"); }
.ui-icon-dashboard-payable { --ui-icon: url("assets/icons/dashboard/payable.svg"); }
.ui-icon-dashboard-vouchers { --ui-icon: url("assets/icons/dashboard/vouchers.svg"); }
.ui-icon-dashboard-tax { --ui-icon: url("assets/icons/dashboard/tax.svg"); }
.ui-icon-dashboard-coverage { --ui-icon: url("assets/icons/dashboard/coverage.svg"); }
.ui-icon-dashboard-months { --ui-icon: url("assets/icons/dashboard/months.svg"); }
.ui-icon-dashboard-alert { --ui-icon: url("assets/icons/dashboard/alert.svg"); }
.ui-icon-dashboard-check { --ui-icon: url("assets/icons/dashboard/check.svg"); }
.ui-icon-dashboard-sun { --ui-icon: url("assets/icons/dashboard/sun.svg"); }
.ui-icon-dashboard-chevron { --ui-icon: url("assets/icons/dashboard/chevron-right.svg"); }

.health-dashboard {
  --health-ink: #17242a;
  --health-muted: #76808b;
  --health-line: #ebe7e1;
  --health-coral: #f05164;
  --health-coral-soft: #fff2f4;
  --health-green: #16866e;
  --health-green-soft: #eef8f5;
  --health-orange: #ef6e3d;
  --health-blue: #3d78dd;
  --health-violet: #8c63d7;
  display: grid;
  gap: 10px;
  width: 100%;
  max-width: none;
  padding: 8px 0 4px;
  color: var(--health-ink);
  letter-spacing: 0;
}

.health-dashboard button,
.health-dashboard h2,
.health-dashboard h3,
.health-dashboard p,
.health-dashboard strong,
.health-dashboard span,
.health-dashboard small,
.health-dashboard em {
  letter-spacing: 0;
}

.health-welcome {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  min-height: 48px;
  padding: 1px 2px 0;
}

.health-welcome h2 {
  display: flex;
  gap: 8px;
  align-items: center;
  margin: 0 0 3px;
  color: var(--health-ink);
  font-size: 20px;
  line-height: 1.3;
}

.health-welcome p,
.health-period-note {
  margin: 0;
  color: var(--health-muted);
  font-size: 12px;
}

.health-welcome-icon {
  --ui-icon: url("assets/icons/dashboard/sun.svg");
  width: 18px;
  height: 18px;
  color: #f2a72f;
}

.health-accounting-state {
  display: grid;
  justify-items: end;
  gap: 6px;
  min-width: 0;
}

.health-period-note {
  max-width: 460px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.health-state-badges {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.health-accounting-badge {
  display: inline-flex;
  gap: 4px;
  align-items: center;
  min-height: 24px;
  padding: 2px 8px;
  border: 1px solid #dfe8e4;
  border-radius: 999px;
  background: #f6fbf9;
  color: #45615a;
  font-size: 11px;
  font-weight: 650;
  white-space: nowrap;
}

.health-accounting-badge .ui-icon {
  width: 13px;
  height: 13px;
  color: var(--health-green);
}

.health-accounting-badge.danger {
  border-color: #f1c9cd;
  background: #fff5f5;
  color: #a84750;
}

.health-accounting-badge.danger .ui-icon {
  color: var(--health-coral);
}

.health-hero {
  display: grid;
  grid-template-columns: minmax(360px, 0.82fr) minmax(380px, 1.18fr);
  align-items: center;
  height: 270px;
  overflow: hidden;
  background: #fbfaf8;
}

.health-hero-copy {
  z-index: 1;
  align-self: stretch;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  padding: 8px 0 12px 34px;
}

.health-eyebrow,
.health-section-kicker {
  color: #536169;
  font-size: 12px;
  font-weight: 700;
}

.health-profit-value {
  margin: 8px 0 6px;
  font-size: 60px;
  font-variant-numeric: tabular-nums;
  font-weight: 760;
  line-height: 1;
}

.health-profit-value.negative {
  color: var(--health-green);
}

.health-profit-value.positive {
  color: var(--health-coral);
}

.health-margin-pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.health-margin-pill.negative {
  background: #e8f7f2;
  color: #11745f;
}

.health-margin-pill.positive {
  background: #ffedf0;
  color: #d84457;
}

.health-hero-copy p {
  max-width: 360px;
  margin: 12px 0 0;
  color: #58646b;
  font-size: 14px;
  line-height: 1.65;
}

.health-hero-visual {
  align-self: stretch;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.health-hero-visual img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}

.health-hero-visual.negative img {
  filter: hue-rotate(105deg) saturate(0.75);
}

.health-core-metrics {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  min-height: 96px;
  overflow: hidden;
  border: 1px solid var(--health-line);
  border-radius: 8px;
  background: #fff;
}

.health-metric {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-width: 0;
  padding: 11px 13px;
  border: 0;
  border-right: 1px solid var(--health-line);
  border-radius: 0;
  background: transparent;
  color: var(--health-ink);
  text-align: left;
  box-shadow: none;
}

.health-metric:last-child {
  border-right: 0;
}

.health-metric:hover,
.health-metric:focus-visible {
  transform: none;
  background: #fbfaf8;
  box-shadow: inset 0 0 0 2px rgba(23, 107, 99, 0.18);
}

.health-metric-icon,
.health-risk-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
}

.health-metric-icon .ui-icon,
.health-risk-icon .ui-icon {
  width: 20px;
  height: 20px;
}

.metric-mint .health-metric-icon { background: #e6f6f1; color: #15856c; }
.metric-coral .health-metric-icon { background: #fff0eb; color: var(--health-orange); }
.metric-green .health-metric-icon { background: #eaf8ee; color: #3a9b64; }
.metric-blue .health-metric-icon { background: #eef4ff; color: var(--health-blue); }
.metric-violet .health-metric-icon { background: #f4edff; color: var(--health-violet); }

.health-metric-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.health-metric-copy > small {
  overflow: hidden;
  color: #68747c;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.health-metric-copy > strong,
.health-cash-amount {
  margin: 3px 0 2px;
  overflow: hidden;
  color: var(--health-ink);
  font-size: 23px;
  font-variant-numeric: tabular-nums;
  font-weight: 740;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.health-metric-copy > strong span,
.health-cash-amount span {
  margin-left: 3px;
  font-size: 12px;
  font-weight: 650;
}

.health-metric-copy em,
.health-cash-facts small {
  overflow: hidden;
  font-size: 11px;
  font-style: normal;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.health-dashboard .positive { color: #15856c; }
.health-dashboard .warning { color: #ef6e3d; }
.health-dashboard .neutral { color: #8a9298; }

.health-status-grid,
.health-bottom-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.06fr);
  gap: 10px;
}

.health-operating-band,
.health-cash-band {
  min-width: 0;
  min-height: 210px;
  overflow: hidden;
  border: 1px solid transparent;
  border-radius: 8px;
}

.health-operating-band {
  display: grid;
  grid-template-rows: 1fr auto;
  padding: 22px 24px 18px;
  border-color: #f3dcdf;
  background: var(--health-coral-soft);
}

.health-band-copy h3 {
  margin: 6px 0 8px;
  font-size: 28px;
  line-height: 1.2;
}

.health-operating-band.profit .health-band-copy h3 {
  color: var(--health-coral);
}

.health-operating-band.loss {
  border-color: #d8ebe4;
  background: var(--health-green-soft);
}

.health-operating-band.loss .health-band-copy h3 {
  color: var(--health-green);
}

.health-band-copy p {
  margin: 0;
  color: #647078;
  font-size: 12px;
  line-height: 1.6;
}

.health-months {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 7px;
  align-items: end;
}

.health-month {
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 58px;
  padding: 7px 4px;
  border: 1px solid rgba(235, 221, 221, 0.86);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.68);
  color: #7c858a;
}

.health-month span {
  font-size: 11px;
}

.health-month strong {
  max-width: 100%;
  overflow: hidden;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.health-month.profit strong { color: var(--health-coral); }
.health-month.loss strong { color: var(--health-green); }

.health-month.current {
  border-color: var(--health-coral);
  background: var(--health-coral);
  color: #fff;
}

.health-month.current strong,
.health-month.current span {
  color: #fff;
}

.health-operating-band.loss .health-month.current {
  border-color: var(--health-green);
  background: var(--health-green);
}

.health-cash-band {
  position: relative;
  padding: 22px 24px 16px;
  border-color: #d8ebe4;
  background: var(--health-green-soft);
}

.health-cash-copy {
  position: relative;
  z-index: 2;
  max-width: 50%;
}

.health-cash-copy h3 {
  color: var(--health-green);
}

.health-cash-visual {
  position: absolute;
  z-index: 1;
  top: 2px;
  right: 0;
  width: 52%;
  height: 70%;
  overflow: hidden;
  background: var(--health-green-soft);
  isolation: isolate;
}

.health-cash-visual img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: 53% 57%;
  opacity: 0.9;
}

.health-cash-band.warn .health-cash-visual img { filter: saturate(0.82) sepia(0.05); }
.health-cash-band.danger .health-cash-visual img { filter: hue-rotate(260deg) saturate(0.72); }

.health-cash-facts {
  position: absolute;
  z-index: 2;
  right: 24px;
  bottom: 16px;
  left: 24px;
  display: grid;
  grid-template-columns: 1.15fr 0.8fr 0.8fr;
  min-height: 68px;
  align-items: end;
}

.health-cash-facts > div {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-width: 0;
  padding: 0 16px;
  border-left: 1px solid rgba(43, 119, 96, 0.14);
}

.health-cash-facts > div:first-child {
  padding-left: 0;
  border-left: 0;
}

.health-cash-facts span {
  color: #60716b;
  font-size: 11px;
  font-weight: 650;
}

.health-cash-facts > div > strong:not(.health-cash-amount) {
  margin: 5px 0 2px;
  font-size: 21px;
  font-variant-numeric: tabular-nums;
}

.health-cash-facts small.warn,
.health-cash-facts small.danger { color: var(--health-orange); }
.health-cash-facts small.healthy,
.health-cash-facts small.normal { color: var(--health-green); }

.health-bottom-grid {
  grid-template-columns: 0.92fr 1.08fr;
}

.health-risk-center,
.health-anomalies {
  min-width: 0;
  min-height: 140px;
  padding: 13px 15px;
  border: 1px solid var(--health-line);
  border-radius: 8px;
  background: #fff;
}

.health-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 24px;
  margin-bottom: 9px;
}

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

.health-section-head > span,
.health-section-head .link-button {
  color: #8a9298;
  font-size: 11px;
}

.health-section-head .link-button {
  min-height: 26px;
  padding: 2px 4px;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.health-risk-items {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
}

.health-risk-item {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  min-width: 0;
  min-height: 92px;
  padding: 10px;
  border: 0;
  border-right: 1px solid var(--health-line);
  border-radius: 0;
  background: transparent;
  color: var(--health-ink);
  text-align: left;
  box-shadow: none;
}

.health-risk-item:last-child { border-right: 0; }

.health-risk-item:hover,
.health-risk-item:focus-visible {
  transform: none;
  background: #fbfaf8;
  box-shadow: inset 0 0 0 2px rgba(23, 107, 99, 0.15);
}

.health-risk-icon {
  width: 34px;
  height: 34px;
  background: #f1f5f7;
  color: #60717a;
}

.health-risk-item.risk-warn .health-risk-icon { background: #fff1e8; color: var(--health-orange); }
.health-risk-item.risk-danger .health-risk-icon { background: #ffedf0; color: var(--health-coral); }
.health-risk-item.risk-ok .health-risk-icon { background: #eaf8f3; color: var(--health-green); }

.health-risk-item > span:last-child {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.health-risk-item strong {
  overflow: hidden;
  font-size: 19px;
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.health-risk-item small {
  margin-top: 4px;
  color: #57646c;
  font-size: 10px;
  font-weight: 700;
}

.health-risk-item em {
  margin-top: 4px;
  overflow: hidden;
  color: #959ca1;
  font-size: 9px;
  font-style: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.health-anomaly-list {
  display: grid;
  gap: 4px;
}

.health-anomaly-item {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto 15px;
  gap: 9px;
  align-items: center;
  min-height: 31px;
  padding: 5px 8px;
  border: 0;
  border-radius: 6px;
  background: #fbfaf8;
  color: var(--health-ink);
  text-align: left;
  box-shadow: none;
}

.health-anomaly-item:hover,
.health-anomaly-item:focus-visible {
  transform: none;
  background: #f4f3f0;
  box-shadow: inset 0 0 0 2px rgba(23, 107, 99, 0.14);
}

.health-anomaly-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--health-green);
  box-shadow: 0 0 0 4px #e7f6f1;
}

.health-anomaly-item.anomaly-warn .health-anomaly-dot {
  background: #f1a31c;
  box-shadow: 0 0 0 4px #fff3da;
}

.health-anomaly-item.anomaly-danger .health-anomaly-dot {
  background: var(--health-coral);
  box-shadow: 0 0 0 4px #ffebee;
}

.health-anomaly-item > span:nth-child(2) {
  display: flex;
  min-width: 0;
  gap: 7px;
  align-items: baseline;
}

.health-anomaly-item strong,
.health-anomaly-item small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.health-anomaly-item strong {
  max-width: 45%;
  font-size: 11px;
}

.health-anomaly-item small,
.health-anomaly-item time {
  color: #889196;
  font-size: 10px;
}

.health-anomaly-arrow {
  width: 15px;
  height: 15px;
  color: #9ba2a6;
}

.health-dashboard-skeleton {
  pointer-events: none;
}

.health-skeleton-line,
.health-skeleton-block {
  display: block;
  border-radius: 5px;
  background: #e7ebe8;
  animation: health-skeleton-pulse 1.25s ease-in-out infinite alternate;
}

.health-skeleton-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
}

.health-skeleton-heading {
  width: 180px;
  height: 24px;
}

.health-skeleton-subtitle {
  width: 290px;
  max-width: 70vw;
  height: 12px;
  margin-top: 7px;
}

.health-skeleton-state {
  min-width: 300px;
}

.health-skeleton-period {
  width: 250px;
  height: 12px;
}

.health-skeleton-badges {
  display: flex;
  gap: 6px;
}

.health-skeleton-badges .health-skeleton-block {
  width: 72px;
  height: 24px;
  border-radius: 999px;
}

.health-skeleton-hero .health-hero-copy {
  gap: 0;
}

.health-skeleton-label {
  width: 74px;
  height: 12px;
}

.health-skeleton-profit {
  width: 270px;
  max-width: 80%;
  height: 58px;
  margin: 12px 0 8px;
}

.health-skeleton-pill {
  width: 92px;
  height: 26px;
  border-radius: 999px;
}

.health-skeleton-summary {
  width: 320px;
  max-width: 88%;
  height: 13px;
  margin-top: 14px;
}

.health-skeleton-summary.short {
  width: 230px;
  margin-top: 7px;
}

.health-skeleton-visual {
  display: grid;
  place-items: center;
  padding: 30px 42px;
}

.health-skeleton-visual .health-skeleton-block {
  width: min(100%, 520px);
  height: 100%;
  max-height: 210px;
  border-radius: 8px;
}

.health-skeleton-metric {
  cursor: default;
}

.health-skeleton-icon {
  width: 42px;
  height: 42px;
  border-radius: 8px;
}

.health-skeleton-metric .health-skeleton-copy {
  gap: 6px;
}

.health-skeleton-metric .health-skeleton-label {
  width: 62px;
  height: 10px;
}

.health-skeleton-value {
  width: 104px;
  max-width: 88%;
  height: 21px;
}

.health-skeleton-note {
  width: 72px;
  max-width: 70%;
  height: 9px;
}

.health-skeleton-band .health-skeleton-band-title {
  width: 150px;
  height: 29px;
  margin-top: 10px;
}

.health-skeleton-band .health-skeleton-summary {
  width: 210px;
  height: 11px;
  margin-top: 12px;
}

.health-skeleton-month {
  gap: 8px;
}

.health-skeleton-month .health-skeleton-line:first-child {
  width: 34px;
  height: 9px;
}

.health-skeleton-month .health-skeleton-line:last-child {
  width: 48px;
  max-width: 80%;
  height: 11px;
}

.health-skeleton-cash-facts {
  position: absolute;
  right: 24px;
  bottom: 28px;
  left: 24px;
  display: grid;
  grid-template-columns: 1.15fr 0.8fr 0.8fr;
  gap: 24px;
}

.health-skeleton-cash-facts .health-skeleton-line {
  height: 34px;
}

.health-skeleton-section-title {
  width: 82px;
  height: 17px;
  margin: 3px 0 13px;
}

.health-skeleton-risk {
  cursor: default;
}

.health-skeleton-risk-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
}

.health-skeleton-risk .health-skeleton-copy {
  gap: 8px;
}

.health-skeleton-risk .health-skeleton-value {
  width: 68px;
  height: 19px;
}

.health-skeleton-reminder {
  cursor: default;
}

.health-skeleton-reminder .health-skeleton-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.health-skeleton-reminder .health-skeleton-line:nth-child(2) {
  width: min(85%, 310px);
  height: 11px;
}

.health-skeleton-reminder .health-skeleton-line:nth-child(3) {
  width: 64px;
  height: 9px;
}

@keyframes health-skeleton-pulse {
  from { opacity: 0.56; }
  to { opacity: 1; }
}

@media (min-width: 1600px) {
  .health-dashboard { gap: 14px; }
  .health-hero { height: 340px; }
  .health-profit-value { font-size: 72px; }
  .health-operating-band,
  .health-cash-band { min-height: 232px; }
  .health-risk-center,
  .health-anomalies { min-height: 156px; }
}

@media (max-width: 1180px) {
  .health-hero { grid-template-columns: minmax(320px, 0.9fr) minmax(320px, 1.1fr); height: 248px; }
  .health-hero-copy { padding-left: 20px; }
  .health-profit-value { font-size: 50px; }
  .health-core-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .health-metric:nth-child(3) { border-right: 0; }
  .health-metric:nth-child(-n + 3) { border-bottom: 1px solid var(--health-line); }
  .health-status-grid,
  .health-bottom-grid { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .health-welcome { display: grid; gap: 8px; }
  .health-accounting-state { justify-items: start; }
  .health-state-badges { justify-content: flex-start; }
  .health-period-note { max-width: 100%; }
  .health-hero { grid-template-columns: 1fr; height: auto; }
  .health-hero-copy { min-height: 200px; padding: 18px 12px; }
  .health-hero-visual { min-height: 160px; }
  .health-core-metrics { grid-template-columns: 1fr 1fr; }
  .health-metric,
  .health-metric:nth-child(3) { border-right: 1px solid var(--health-line); border-bottom: 1px solid var(--health-line); }
  .health-metric:nth-child(even) { border-right: 0; }
  .health-metric:last-child { border-bottom: 0; }
  .health-months { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .health-operating-band { min-height: 306px; }
  .health-cash-band { min-height: 320px; }
  .health-cash-copy { max-width: 100%; }
  .health-cash-visual { top: 66px; width: 70%; height: 48%; }
  .health-cash-facts { grid-template-columns: 1fr 1fr 1fr; }
  .health-risk-items { grid-template-columns: 1fr 1fr; }
  .health-risk-item:nth-child(2) { border-right: 0; }
  .health-risk-item:nth-child(-n + 2) { border-bottom: 1px solid var(--health-line); }
  .health-anomaly-item { grid-template-columns: 10px minmax(0, 1fr) 15px; }
  .health-anomaly-item time { display: none; }
  .health-anomaly-item > span:nth-child(2) { display: grid; gap: 2px; }
  .health-anomaly-item strong { max-width: none; }
  .health-skeleton-state { min-width: 0; }
  .health-skeleton-period { width: min(250px, 80vw); }
  .health-skeleton-badges .health-skeleton-block { width: 64px; }
  .health-skeleton-visual { min-height: 160px; padding: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  .health-skeleton-line,
  .health-skeleton-block { animation: none; }
}

@media print {
  .health-hero-visual,
  .health-cash-visual { display: none; }
  .health-hero { grid-template-columns: 1fr; }
}
/* 财域进化史：真实版本截图与产品演进叙事 */
.health-meta-line {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-width: 0;
}

.health-evolution-link {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  min-height: 24px;
  padding: 2px 6px;
  border: 0;
  background: transparent;
  color: #3e6f65;
  font-size: 11px;
  font-weight: 650;
  box-shadow: none;
  white-space: nowrap;
}

.health-evolution-link .ui-icon {
  width: 12px;
  height: 12px;
}

.health-evolution-link:hover,
.health-evolution-link:focus-visible {
  transform: none;
  background: #edf6f2;
  color: #125f50;
  box-shadow: none;
}

.evolution-page {
  --evolution-ink: #17272a;
  --evolution-muted: #6f7d80;
  --evolution-line: #e7e3dc;
  --evolution-green: #116b59;
  width: 100%;
  max-width: 1320px;
  margin: 0 auto;
  padding-bottom: 24px;
  color: var(--evolution-ink);
  letter-spacing: 0;
}

.evolution-page h2,
.evolution-page h3,
.evolution-page p,
.evolution-page span,
.evolution-page strong,
.evolution-page small,
.evolution-page time,
.evolution-page button {
  letter-spacing: 0;
}

.evolution-intro {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(360px, 0.75fr);
  gap: 54px;
  align-items: end;
  min-height: 212px;
  padding: 34px 40px 36px;
  background: #edf5f1;
  border-top: 1px solid #dce9e3;
  border-bottom: 1px solid #dce9e3;
}

.evolution-kicker {
  display: block;
  margin-bottom: 12px;
  color: var(--evolution-green);
  font-size: 11px;
  font-weight: 750;
}

.evolution-intro h2 {
  max-width: 720px;
  margin: 0;
  font-size: 32px;
  line-height: 1.25;
}

.evolution-intro > div > p {
  max-width: 720px;
  margin: 14px 0 0;
  color: #58686a;
  font-size: 14px;
  line-height: 1.75;
}

.evolution-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0;
  border-top: 1px solid #cbdcd5;
  border-bottom: 1px solid #cbdcd5;
}

.evolution-summary div {
  min-width: 0;
  padding: 15px 12px 14px;
  border-right: 1px solid #cbdcd5;
}

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

.evolution-summary dt {
  margin: 0;
  color: var(--evolution-green);
  font-size: 30px;
  font-weight: 760;
  line-height: 1;
}

.evolution-summary dd {
  margin: 7px 0 0;
  color: #62716f;
  font-size: 11px;
  line-height: 1.4;
}

.evolution-index {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0 22px;
  border-bottom: 1px solid var(--evolution-line);
  background: #fbfaf8;
}

.evolution-index button {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 8px;
  min-height: 58px;
  padding: 10px 16px;
  border: 0;
  border-right: 1px solid var(--evolution-line);
  border-radius: 0;
  background: transparent;
  color: #536164;
  box-shadow: none;
}

.evolution-index button:last-child {
  border-right: 0;
}

.evolution-index button strong {
  color: var(--evolution-ink);
  font-size: 14px;
}

.evolution-index button span {
  font-size: 12px;
}

.evolution-index button:hover,
.evolution-index button:focus-visible {
  transform: none;
  background: #f0f6f3;
  color: var(--evolution-green);
  box-shadow: inset 0 -2px var(--evolution-green);
}

.evolution-story {
  padding: 0 22px;
}

.evolution-chapter {
  scroll-margin-top: 16px;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(330px, 0.8fr);
  gap: 48px;
  align-items: center;
  min-height: 470px;
  padding: 52px 8px;
  border-bottom: 1px solid var(--evolution-line);
}

.evolution-chapter.is-reverse .evolution-shot-wrap {
  order: 2;
}

.evolution-chapter.is-reverse .evolution-copy {
  order: 1;
}

.evolution-shot-wrap {
  min-width: 0;
}

.evolution-shot-wrap > small {
  display: block;
  margin-top: 8px;
  color: #8b9393;
  font-size: 11px;
  text-align: right;
}

.evolution-shot-button {
  position: relative;
  display: block;
  width: 100%;
  overflow: hidden;
  padding: 0;
  border: 1px solid #d8d4cd;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 42px rgba(29, 46, 48, 0.12);
}

.evolution-window-chrome {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 11px;
  border-bottom: 1px solid #e3e0da;
  background: #f4f2ee;
}

.evolution-window-chrome i {
  display: block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #d8a49a;
}

.evolution-window-chrome i:nth-child(2) {
  background: #dbc38a;
}

.evolution-window-chrome i:nth-child(3) {
  background: #92bea9;
}

.evolution-window-chrome em {
  flex: 1;
  padding-right: 38px;
  color: #7b8180;
  font-size: 10px;
  font-style: normal;
  text-align: center;
}

.evolution-shot-button img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  object-position: top left;
  transition: transform 180ms ease;
}

.evolution-shot-button:hover,
.evolution-shot-button:focus-visible {
  transform: translateY(-2px);
  border-color: #a8bdb5;
  box-shadow: 0 22px 48px rgba(29, 46, 48, 0.16);
}

.evolution-shot-button:hover img,
.evolution-shot-button:focus-visible img {
  transform: scale(1.012);
}

.evolution-zoom-label {
  position: absolute;
  right: 12px;
  bottom: 12px;
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 9px;
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 6px;
  background: rgba(20, 43, 43, 0.82);
  color: #fff;
  font-size: 11px;
  font-weight: 650;
  opacity: 0;
  transition: opacity 160ms ease;
}

.evolution-shot-button:hover .evolution-zoom-label,
.evolution-shot-button:focus-visible .evolution-zoom-label {
  opacity: 1;
}

.evolution-copy {
  position: relative;
  min-width: 0;
  padding: 8px 12px 8px 2px;
}

.evolution-sequence {
  display: block;
  margin-bottom: 18px;
  color: #c5cac8;
  font-size: 46px;
  font-weight: 760;
  line-height: 1;
}

.tone-blue .evolution-sequence,
.tone-blue .evolution-version-line strong {
  color: #527cc7;
}

.tone-green .evolution-sequence,
.tone-green .evolution-version-line strong {
  color: #167b68;
}

.tone-coral .evolution-sequence,
.tone-coral .evolution-version-line strong {
  color: #e95668;
}

.evolution-version-line {
  display: flex;
  align-items: center;
  gap: 10px;
}

.evolution-version-line strong {
  font-size: 13px;
}

.evolution-version-line time {
  color: #929a99;
  font-size: 11px;
}

.evolution-copy h3 {
  margin: 7px 0 0;
  font-size: 30px;
  line-height: 1.25;
}

.evolution-subtitle {
  margin: 12px 0 0;
  color: #384c4e;
  font-size: 15px;
  font-weight: 650;
  line-height: 1.6;
}

.evolution-note {
  margin: 16px 0 0;
  color: var(--evolution-muted);
  font-size: 13px;
  line-height: 1.75;
}

.evolution-copy ul {
  display: grid;
  gap: 9px;
  margin: 20px 0 0;
  padding: 17px 0 0;
  border-top: 1px solid var(--evolution-line);
  list-style: none;
}

.evolution-copy li {
  position: relative;
  padding-left: 16px;
  color: #495b5d;
  font-size: 12px;
  line-height: 1.55;
}

.evolution-copy li::before {
  content: "";
  position: absolute;
  top: 7px;
  left: 1px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #78a89a;
}

.evolution-release-section {
  padding: 46px 30px 52px;
  border-top: 1px solid var(--evolution-line);
  background: #f7f9f8;
}

.evolution-release-heading {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
  margin-bottom: 18px;
}

.evolution-release-heading > span {
  padding-top: 5px;
  color: var(--evolution-green);
  font-size: 10px;
  font-weight: 750;
}

.evolution-release-heading h3 {
  margin: 0;
  font-size: 22px;
}

.evolution-release-heading p {
  margin: 7px 0 0;
  color: var(--evolution-muted);
  font-size: 12px;
}

.evolution-release-section .release-history {
  border-color: #dfe5e2;
  border-radius: 6px;
  box-shadow: none;
}

.evolution-release-section .release-entry.current {
  background: #f0f7f4;
}

.evolution-principles {
  display: grid;
  grid-template-columns: minmax(270px, 1.25fr) repeat(3, minmax(0, 0.75fr));
  gap: 0;
  align-items: center;
  min-height: 158px;
  padding: 24px 32px;
  background: #183f3b;
  color: #fff;
}

.evolution-principles > div {
  padding-right: 28px;
}

.evolution-principles > div > span {
  color: #9bc1b6;
  font-size: 11px;
  font-weight: 700;
}

.evolution-principles h3 {
  margin: 7px 0 0;
  color: #fff;
  font-size: 20px;
}

.evolution-principles p {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-height: 72px;
  margin: 0;
  padding: 8px 20px;
  border-left: 1px solid rgba(255, 255, 255, 0.16);
}

.evolution-principles p strong {
  color: #fff;
  font-size: 14px;
}

.evolution-principles p span {
  color: #b9ccc8;
  font-size: 11px;
  line-height: 1.5;
}

.evolution-preview-dialog {
  width: min(94vw, 1500px);
  max-width: none;
  max-height: 94vh;
  margin: auto;
  padding: 0;
  overflow: hidden;
  border: 1px solid #cfd8d4;
  border-radius: 8px;
  background: #f5f4f1;
  color: var(--evolution-ink, #17272a);
  box-shadow: 0 28px 80px rgba(14, 35, 35, 0.28);
}

.evolution-preview-dialog::backdrop {
  background: rgba(14, 31, 32, 0.72);
}

.evolution-preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 48px;
  padding: 8px 10px 8px 18px;
  border-bottom: 1px solid #dcd8d1;
}

.evolution-preview-head strong {
  font-size: 14px;
}

.evolution-preview-close {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #52605f;
  font-size: 24px;
  line-height: 1;
  box-shadow: none;
}

.evolution-preview-close:hover,
.evolution-preview-close:focus-visible {
  transform: none;
  background: #e5ebe8;
  color: #173e39;
  box-shadow: none;
}

.evolution-preview-dialog > img {
  display: block;
  width: 100%;
  max-height: calc(94vh - 49px);
  object-fit: contain;
}

@media (max-width: 1100px) {
  .evolution-intro {
    grid-template-columns: 1fr;
    gap: 26px;
  }

  .evolution-summary {
    max-width: 620px;
  }

  .evolution-chapter {
    grid-template-columns: 1fr;
    gap: 28px;
    padding: 42px 4px;
  }

  .evolution-chapter.is-reverse .evolution-shot-wrap,
  .evolution-chapter.is-reverse .evolution-copy {
    order: initial;
  }

  .evolution-copy {
    max-width: 760px;
  }

  .evolution-principles {
    grid-template-columns: 1fr 1fr 1fr;
  }

  .evolution-principles > div {
    grid-column: 1 / -1;
    padding: 0 0 22px;
  }
}

@media (max-width: 760px) {
  .health-meta-line {
    align-items: flex-end;
    flex-direction: column-reverse;
    gap: 4px;
  }

  .evolution-intro {
    min-height: 0;
    padding: 28px 20px;
  }

  .evolution-intro h2 {
    font-size: 27px;
  }

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

  .evolution-summary div {
    display: flex;
    align-items: baseline;
    gap: 10px;
    border-right: 0;
    border-bottom: 1px solid #cbdcd5;
  }

  .evolution-summary div:last-child {
    border-bottom: 0;
  }

  .evolution-summary dt {
    font-size: 24px;
  }

  .evolution-index {
    margin: 0;
  }

  .evolution-index button {
    align-items: center;
    flex-direction: column;
    gap: 2px;
    min-height: 62px;
    padding: 8px 4px;
  }

  .evolution-index button span {
    font-size: 10px;
  }

  .evolution-story {
    padding: 0;
  }

  .evolution-release-section {
    padding: 34px 0 40px;
  }

  .evolution-release-heading {
    grid-template-columns: 1fr;
    gap: 6px;
    padding: 0 18px;
  }

  .evolution-chapter {
    min-height: 0;
    padding: 36px 0;
  }

  .evolution-copy h3 {
    font-size: 26px;
  }

  .evolution-sequence {
    margin-bottom: 12px;
    font-size: 38px;
  }

  .evolution-principles {
    grid-template-columns: 1fr;
    padding: 24px 20px;
  }

  .evolution-principles > div {
    grid-column: auto;
  }

  .evolution-principles p {
    min-height: 0;
    padding: 14px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.16);
    border-left: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .evolution-shot-button img {
    transition: none;
  }

  .evolution-shot-button:hover img,
  .evolution-shot-button:focus-visible img {
    transform: none;
  }
}

@media print {
  .evolution-index,
  .evolution-zoom-label,
  .evolution-preview-dialog {
    display: none;
  }

  .evolution-chapter {
    break-inside: avoid;
  }
}
