﻿:root {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface-soft: #f7f9fb;
  --surface-blue: #f0f6ff;
  --text: #1f2933;
  --muted: #66727d;
  --line: #dfe5eb;
  --primary: #1677ff;
  --primary-dark: #0f5ed7;
  --accent: #18a058;
  --amber: #c47a11;
  --danger: #c0362c;
  --nav: #1d2633;
  --shadow: 0 8px 24px rgba(31, 41, 51, 0.06);
}

* {
  box-sizing: border-box;
}

html {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  width: 100%;
  max-width: 100%;
  min-height: 100vh;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--text);
  font-family:
    "Microsoft YaHei",
    "PingFang SC",
    Arial,
    sans-serif;
  letter-spacing: 0;
}

body.modal-open {
  overflow: hidden;
}

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

button {
  cursor: pointer;
}

.hidden {
  display: none !important;
}

body:not(.test-env) .test-accounting-only {
  display: none !important;
}

.full-width {
  width: 100%;
}

.login-screen {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(135deg, rgba(22, 119, 255, 0.10), rgba(24, 160, 88, 0.08)),
    #f8fafc;
}

.login-card {
  display: grid;
  width: min(440px, 100%);
  gap: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 28px;
  box-shadow: var(--shadow);
}

.login-brand,
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.login-brand {
  display: grid;
  width: min(240px, 100%);
  justify-items: center;
  gap: 4px;
  margin: 0 auto 14px;
  text-align: center;
}

.login-brand-text {
  width: 100%;
  display: grid;
  justify-items: center;
  text-align: center;
}

.login-brand strong,
.login-brand span,
.brand strong,
.brand span {
  display: block;
}

.login-brand span {
  margin-top: 4px;
}

.login-help {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.app-shell {
  position: relative;
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  width: 100%;
  max-width: 100vw;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: clip;
}

.app-shell::before {
  content: "";
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 0;
  width: 220px;
  background: var(--nav);
  pointer-events: none;
}

@supports not (overflow: clip) {
  .app-shell,
  .main-panel {
    overflow-x: hidden;
  }
}

.sidebar {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  min-height: 100vh;
  min-height: 100dvh;
  height: auto;
  flex-direction: column;
  gap: 26px;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 22px 16px;
  background: var(--nav);
  color: #eef3f8;
  scrollbar-color: rgba(255, 255, 255, 0.34) transparent;
}

.brand-logo {
  display: block;
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  border-radius: 12px;
  object-fit: contain;
}

.login-brand .brand-logo {
  width: 178px;
  height: 136px;
  flex-basis: auto;
  border-radius: 0;
  object-fit: contain;
  object-position: center bottom;
  transform: translateX(4px);
}

.login-brand-name {
  margin-top: 0;
  width: 100%;
  color: var(--text);
  font-size: 25px;
  line-height: 1.2;
  font-weight: 900;
  letter-spacing: 0;
  text-align: center;
}

.login-system-title {
  width: 100%;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.35;
  font-weight: 700;
  letter-spacing: 0;
  text-align: center;
}

.brand span {
  margin-top: 8px;
  color: #c7d3df;
  font-size: 15px;
  font-weight: 800;
}

.brand {
  justify-content: center;
  min-height: 78px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  padding: 16px 10px;
  text-align: center;
}

.brand strong {
  color: #fff;
  font-size: 24px;
  font-weight: 900;
  line-height: 1.15;
}

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

.nav-item,
.ghost-button,
.primary-button,
.secondary-button,
.danger-button,
.scope-tab,
.type-option {
  min-height: 40px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 9px 12px;
  font-weight: 700;
}

.nav-item {
  background: transparent;
  color: #d8e1eb;
  text-align: left;
}

.nav-item:hover,
.nav-item.active {
  background: rgba(255, 255, 255, 0.10);
  color: #fff;
}

.menu-group {
  display: grid;
  gap: 6px;
}

.menu-group:not([open]) > :not(summary),
.menu-subgroup:not([open]) > :not(summary) {
  display: none;
}

details[data-default-collapsed="true"]:not([open]) > :not(summary) {
  display: none !important;
}

.menu-group > summary {
  min-height: 36px;
  border-radius: 8px;
  color: #ffffff;
  cursor: pointer;
  font-size: 15px;
  font-weight: 800;
  list-style: none;
  padding: 8px 10px;
}

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

.menu-group > summary::before {
  content: "›";
  display: inline-block;
  margin-right: 8px;
  transition: transform 0.16s ease;
}

.menu-group[open] > summary::before {
  transform: rotate(90deg);
}

.menu-group > summary:hover {
  background: rgba(255, 255, 255, 0.08);
}

.menu-group .nav-item {
  display: block;
  width: calc(100% - 16px);
  margin-left: 16px;
  min-height: 36px;
  padding: 8px 10px;
  font-size: 15px;
  font-weight: 800;
}

.menu-subgroup {
  display: grid;
  gap: 4px;
  margin-left: 8px;
}

.menu-subgroup summary {
  min-height: 36px;
  color: #d8e1eb;
  font-size: 15px;
  font-weight: 800;
  list-style: none;
  padding: 8px 10px;
}

.menu-subgroup summary::-webkit-details-marker {
  display: none;
}

.menu-subgroup summary::before {
  content: "›";
  display: inline-block;
  margin-right: 8px;
  transition: transform 0.16s ease;
}

.menu-subgroup[open] summary::before {
  transform: rotate(90deg);
}

.menu-subgroup .nav-item {
  width: calc(100% - 24px);
  margin-left: 24px;
  min-height: 36px;
  padding: 8px 10px;
  font-size: 15px;
  font-weight: 800;
}

.favorite-menu-block {
  display: grid;
  gap: 4px;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
}

#accountingSystemMenu .favorite-menu-block {
  width: calc(100% - 16px);
  margin-left: 16px;
}

.favorite-menu-title {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 36px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: #d8e1eb;
  cursor: pointer;
  padding: 8px 10px;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.2;
  text-align: left;
}

.favorite-menu-title::before {
  content: "›";
  display: inline-block;
  margin-right: 8px;
  transition: transform 0.16s ease;
}

.favorite-menu-block:not(.favorite-collapsed) .favorite-menu-title::before {
  transform: rotate(90deg);
}

.favorite-menu-title:hover {
  background: rgba(255, 255, 255, 0.10);
  color: #fff;
}

.favorite-nav-rows {
  display: grid;
  gap: 4px;
  padding-left: 8px;
}

.favorite-shortcut-row {
  display: block;
}

.favorite-shortcut-button.nav-item {
  display: block;
  width: calc(100% - 8px);
  min-height: 36px;
  margin-left: 8px;
  padding: 8px 10px;
  font-size: 15px;
  font-weight: 800;
}

.favorite-shortcut-button span {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.favorite-shortcut-button small,
.favorite-manage-panel {
  display: none;
}

.favorite-empty {
  min-height: 32px;
  border-radius: 6px;
  color: #aebdca;
  padding: 8px 4px;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.45;
}

.favorite-menu-block.favorite-collapsed .favorite-nav-rows,
.favorite-menu-block.favorite-collapsed .favorite-manage-panel {
  display: none;
}

.favorite-manage-option {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: center;
  gap: 3px 7px;
  min-height: 32px;
  border-radius: 6px;
  color: #d8e1eb;
  cursor: pointer;
  padding: 4px 6px;
  font-size: 13px;
  font-weight: 800;
}

.favorite-manage-option:hover {
  background: rgba(255, 255, 255, 0.08);
}

.favorite-manage-option input {
  grid-row: 1 / span 2;
  width: 15px;
  height: 15px;
}

.favorite-context-menu {
  position: fixed;
  z-index: 1200;
  min-width: 176px;
  max-width: 260px;
  border: 1px solid rgba(15, 23, 42, 0.16);
  border-radius: 8px;
  background: #ffffff;
  padding: 6px;
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.18);
}

.favorite-context-menu button {
  display: block;
  width: 100%;
  min-height: 34px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  padding: 7px 9px;
  font-size: 13px;
  font-weight: 900;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.favorite-context-menu button:hover {
  background: #eef5ff;
  color: var(--primary);
}

.request-type-section {
  display: none;
}

.main-panel {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: clip;
  padding: 20px 22px 28px;
}

.topbar {
  display: grid;
  grid-template-columns: minmax(170px, 220px) minmax(220px, 1fr) max-content 64px;
  align-items: center;
  gap: 12px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 14px 16px;
  box-shadow: var(--shadow);
}

.topbar-title {
  min-width: 0;
}

.global-search {
  position: relative;
  display: flex;
  width: 100%;
  min-width: 0;
  max-width: none;
  align-items: center;
  gap: 8px;
}

.global-search input {
  min-width: 0;
  flex: 1 1 auto;
}

.global-search button {
  flex: 0 0 auto;
  min-width: 72px;
  white-space: nowrap;
}

.search-scope-menu {
  position: relative;
  flex: 0 0 auto;
}

.search-scope-menu summary {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
  list-style: none;
  padding: 9px 12px;
  white-space: nowrap;
}

.search-scope-menu summary::-webkit-details-marker {
  display: none;
}

.search-scope-popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 20;
  display: grid;
  min-width: 170px;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
  padding: 10px;
}

.search-scope-popover label,
.search-field-row label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #39434c;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.search-scope-popover input,
.search-field-row input {
  width: auto;
  min-height: auto;
  padding: 0;
}

.topbar-koala {
  width: 64px;
  height: 64px;
  object-fit: contain;
  margin-left: 0;
  justify-self: end;
}

.topbar h1,
.panel h2,
.section-head h2,
.section-head h3,
.report-block h3,
.item-section h3,
.approval-preview h3,
.advance-offset-head h3 {
  margin: 0;
}

.topbar h1 {
  font-size: 24px;
  line-height: 1.2;
}

.topbar p,
.panel-head span,
.section-head span,
#claimCountText {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.topbar-actions,
.filter-row,
.form-actions,
.item-section-head,
.tool-strip {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.topbar > .topbar-actions {
  min-width: 0;
  flex-wrap: nowrap;
  justify-self: end;
}

.user-badge {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  border: 1px solid #cbdff8;
  border-radius: 999px;
  background: #f5f9ff;
  color: #245087;
  padding: 6px 10px;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.filter-stack {
  display: grid;
  gap: 8px;
  min-width: 0;
  max-width: 100%;
  justify-items: end;
}

.search-field-row {
  display: flex;
  max-width: 640px;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 0;
  color: var(--muted);
}

.search-field-row > span {
  font-size: 12px;
  font-weight: 800;
}

.ledger-filter-row {
  display: grid;
  grid-template-columns: 210px 210px 190px auto auto;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex: 0 0 auto;
  white-space: nowrap;
}

.ledger-filter-row label {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  min-width: 0;
  gap: 8px;
  color: var(--text);
  font-size: 14px;
  font-weight: 800;
}

.ledger-filter-row input,
.ledger-filter-row select {
  min-height: 36px;
  padding: 7px 9px;
  font-size: 14px;
  font-weight: 800;
}

.ledger-filter-row button {
  min-height: 36px;
  align-self: center;
  padding: 7px 14px;
  font-size: 14px;
  font-weight: 800;
  white-space: nowrap;
}

.primary-button {
  background: var(--primary);
  color: #fff;
}

.primary-button:hover {
  background: var(--primary-dark);
}

.secondary-button,
.ghost-button,
.scope-tab {
  background: var(--surface);
  border-color: var(--line);
  color: var(--text);
}

.secondary-button:hover,
.ghost-button:hover,
.scope-tab:hover {
  border-color: #b7c3ce;
  background: #f8fafc;
}

.danger-button {
  border-color: #efb7b1;
  background: #fff5f4;
  color: var(--danger);
}

.danger-button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.file-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

#importJsonInput,
#importInvoiceFileInput,
#openingBalanceFileInput,
#paymentVoucherFileInput,
.native-type-fields {
  display: none;
}

.readonly-date,
.readonly-select {
  cursor: not-allowed;
  background: #f3f6f9;
  color: #5f6d7a;
  opacity: 1;
}

.view {
  display: none;
  min-width: 0;
  max-width: 100%;
}

.view.active {
  display: block;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  min-width: 0;
  max-width: 100%;
  gap: 12px;
  margin-bottom: 14px;
}

.metric-card {
  min-width: 0;
  min-height: 86px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 14px;
  box-shadow: var(--shadow);
}

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

.metric-card strong {
  display: block;
  margin-top: 8px;
  overflow: hidden;
  font-size: 22px;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.metric-card small {
  display: block;
  margin-top: 7px;
  color: var(--muted);
}

.quick-start-panel,
.pending-flow-panel {
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
}

.section-head h2 {
  font-size: 18px;
}

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

.quick-type-grid,
.form-type-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  padding: 0 16px 14px;
}

.pending-flow-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 0 16px 16px;
}

.pending-flow-card {
  display: grid;
  min-height: 116px;
  align-content: start;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--text);
  padding: 12px;
  text-align: left;
  cursor: pointer;
}

.pending-flow-card:hover,
.pending-flow-card.todo {
  border-color: #9cc7ff;
  background: var(--surface-blue);
}

.pending-flow-card.todo {
  box-shadow: inset 4px 0 0 var(--primary);
}

.pending-flow-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.pending-flow-card b,
.pending-flow-card span,
.pending-flow-card em {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pending-flow-card b {
  font-size: 14px;
}

.pending-flow-card > span,
.pending-flow-card em {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.pending-flow-card em {
  color: #124782;
  font-style: normal;
}

.pending-flow-empty {
  grid-column: 1 / -1;
  border: 1px dashed #cbd5df;
  border-radius: 8px;
  background: #fbfdff;
  padding: 16px;
}

.pending-flow-empty strong,
.pending-flow-empty span {
  display: block;
}

.pending-flow-empty span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.type-option {
  display: grid;
  min-height: 54px;
  align-content: center;
  background: var(--surface-soft);
  border-color: var(--line);
  color: var(--text);
  text-align: left;
}

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

.type-option span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.45;
}

.type-option:hover,
.type-option.active {
  border-color: #9cc7ff;
  background: var(--surface-blue);
  color: #124782;
}

.content-grid {
  display: grid;
  grid-template-columns: 1fr;
  min-width: 0;
  max-width: 100%;
  gap: 14px;
}

.guide-panel {
  overflow: hidden;
}

.guide-head {
  align-items: center;
}

.guide-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.guide-actions a {
  text-decoration: none;
}

.invoice-month-filter {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  padding: 0 10px;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.invoice-month-filter input {
  min-height: 30px;
  border: 0;
  background: transparent;
  padding: 0;
  color: var(--text);
  font: inherit;
}

.guide-frame {
  display: block;
  width: 100%;
  min-height: calc(100vh - 210px);
  border: 0;
  background: #fff;
}

.panel {
  min-width: 0;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  min-width: 0;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.ledger-panel .panel-head > div:first-child {
  min-width: 0;
  flex: 1 1 auto;
}

.panel h2 {
  font-size: 18px;
}

select,
input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  outline: none;
}

select.select-placeholder {
  border-color: #efc06d;
  background: #fff9ea;
  color: #9a5b00;
  font-weight: 900;
  box-shadow: inset 0 0 0 1px rgba(239, 192, 109, 0.36);
}

select.select-placeholder:focus {
  border-color: #d98a00;
  box-shadow: 0 0 0 3px rgba(217, 138, 0, 0.16);
}

input,
select {
  min-height: 38px;
  padding: 8px 10px;
}

textarea {
  padding: 10px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(22, 119, 255, 0.14);
}

.chinese-date-input {
  cursor: pointer;
  background-color: #fff;
}

.chinese-date-input[readonly] {
  background-color: #fff;
}

.chinese-date-picker {
  position: absolute;
  z-index: 10000;
  width: min(320px, calc(100vw - 24px));
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 10px;
  box-shadow: 0 14px 36px rgba(31, 41, 51, 0.16);
  color: var(--text);
  font-size: 13px;
}

.chinese-date-picker button {
  min-height: 0;
  border: 1px solid transparent;
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
}

.chinese-date-picker button:hover:not(:disabled) {
  border-color: #9cc7ff;
  background: var(--surface-blue);
}

.chinese-date-picker button:disabled {
  cursor: default;
}

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

.month-picker .chinese-picker-head {
  grid-template-columns: 34px minmax(0, 1fr) 34px;
}

.chinese-picker-head strong {
  overflow: hidden;
  color: var(--text);
  font-size: 14px;
  font-weight: 900;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chinese-picker-head button {
  width: 34px;
  height: 32px;
  padding: 0;
}

.chinese-picker-weekdays,
.chinese-picker-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.chinese-picker-weekdays {
  margin-bottom: 5px;
}

.chinese-picker-weekdays span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-align: center;
}

.chinese-picker-days button {
  aspect-ratio: 1 / 1;
  padding: 0;
}

.chinese-picker-days button.muted {
  color: #a5afb8;
  background: #f7f9fb;
}

.chinese-picker-days button.today {
  border-color: var(--primary);
  color: var(--primary);
}

.chinese-picker-days button.selected,
.chinese-picker-months button.selected,
.chinese-picker-days button.selected.today {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}

.chinese-picker-months {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.chinese-picker-months button {
  min-height: 36px;
  padding: 0 8px;
}

.chinese-picker-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.chinese-picker-footer button {
  min-width: 58px;
  min-height: 30px;
  padding: 0 10px;
}

label {
  display: grid;
  gap: 7px;
  color: #39434c;
  font-size: 13px;
  font-weight: 800;
}

.filter-row select {
  width: 128px;
}

.filter-row input {
  width: 240px;
}

.scope-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}

.scope-tab {
  min-height: 34px;
  white-space: nowrap;
}

.scope-tab.active {
  border-color: #9cc7ff;
  background: var(--surface-blue);
  color: #124782;
}

.table-wrap,
.item-table-wrap {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  overscroll-behavior-x: contain;
}

.frozen-table-wrap {
  position: relative;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  max-height: max(300px, calc(100vh - 390px));
  overflow: auto;
  background: #fff;
  scrollbar-gutter: stable;
}

.workspace-table-wrap {
  max-height: max(320px, calc(100vh - 420px));
}

.workspace-table-wrap table {
  min-width: 1120px;
}

.ledger-data-table-wrap,
.invoice-table-wrap {
  max-height: max(320px, calc(100vh - 360px));
}

.ledger-data-table-wrap table {
  min-width: 1160px;
}

.invoice-table-wrap table {
  min-width: 1240px;
}

.maintenance-table-wrap {
  max-height: max(260px, calc(100vh - 430px));
}

.maintenance-table-wrap table {
  min-width: 760px;
}

.frozen-table-wrap table {
  border-collapse: separate;
  border-spacing: 0;
}

.frozen-table-wrap thead th {
  position: sticky;
  top: 0;
  z-index: 3;
  background: #f8fafc;
  box-shadow: inset 0 -1px 0 var(--line);
}

.frozen-table-wrap tbody td {
  background: #fff;
}

.frozen-table-wrap tbody tr:hover td {
  background: var(--surface-blue);
}

.frozen-table-wrap tbody tr.selected-ledger-row td {
  background: #f5f9ff;
}

table {
  width: 100%;
  border-collapse: collapse;
}

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

th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.claim-row {
  cursor: pointer;
}

.claim-row:hover,
.claim-row.selected {
  background: var(--surface-blue);
}

.claim-actions {
  display: flex;
  min-width: 260px;
  flex-wrap: wrap;
  gap: 6px;
}

.amount-cell {
  font-weight: 800;
}

.negative-amount {
  color: #e23b3b;
}

.link-button {
  border: 0;
  background: transparent;
  color: var(--primary);
  padding: 0;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.link-button:hover {
  color: var(--primary-dark);
  text-decoration: underline;
}

.ledger-table th,
.ledger-table td {
  vertical-align: top;
}

.ledger-select-cell {
  width: 42px;
  min-width: 42px;
  text-align: center;
}

.ledger-select-cell input[type="checkbox"] {
  width: 16px;
  min-height: 16px;
  height: 16px;
  margin: 2px auto 0;
  padding: 0;
  cursor: pointer;
}

.selected-ledger-row {
  background: #f5f9ff;
}

.selected-ledger-row td:first-child {
  box-shadow: inset 3px 0 0 var(--primary);
}

.ledger-balance {
  color: #0f6b3d;
}

.muted-ledger-row {
  color: var(--muted);
  background: #fbfdff;
}

.ledger-link-list {
  display: grid;
  gap: 5px;
}

.external-attachment-line {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.voucher-source-list,
.accounting-archive-table .voucher-attachment-list {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.voucher-attachment-block {
  display: grid;
  grid-template-columns: minmax(92px, auto) minmax(0, 1fr);
  gap: 6px;
  align-items: start;
  min-width: 0;
}

.voucher-source-tag,
.accounting-archive-table .attachment-ledger-link {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: top;
}

.voucher-source-tag {
  color: var(--text);
  font-size: 13px;
}

.accounting-archive-table .muted-text {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.accounting-voucher-group-head td {
  height: 44px;
  background: #fbfdff;
  border-top: 3px solid #b8c8d8;
  border-bottom: 1px solid var(--line);
}

.accounting-voucher-group-head.selected-ledger-row td {
  background: #f5f9ff;
}

.accounting-voucher-head-line {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 12px;
  min-width: 0;
  color: var(--text);
}

.accounting-voucher-head-line strong,
.accounting-voucher-head-line span,
.accounting-voucher-head-source,
.accounting-voucher-attachment-count {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

.accounting-voucher-attachment-count {
  color: var(--primary);
}

.accounting-voucher-entry-row td {
  height: 40px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.accounting-voucher-total-row td {
  height: 40px;
  background: #fbfdff;
  border-bottom: 2px solid #c8d6e3;
}

.accounting-voucher-entry-text,
.accounting-voucher-group-head .attachment-ledger-link,
.accounting-voucher-group-head .voucher-source-tag {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.accounting-voucher-entry-text {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}

.accounting-voucher-group-head .accounting-row-actions {
  flex-wrap: nowrap;
}

.accounting-voucher-modal-body {
  min-width: 0;
  overflow: auto;
  background: #f8fafc;
  padding: 16px;
}

.single-voucher-sheet {
  display: grid;
  gap: 12px;
  max-width: 1060px;
  min-width: 900px;
  margin: 0 auto;
  border: 1px solid #cfd8e3;
  background: #fff;
  padding: 16px;
  color: var(--text);
  font-size: 13px;
}

.single-voucher-toolbar {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.single-voucher-toolbar .small-button,
.single-voucher-source .link-button,
.single-voucher-source .voucher-source-tag {
  font-size: 13px;
}

.single-voucher-head {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(320px, auto);
  align-items: center;
  gap: 18px;
  border-bottom: 2px solid #d7e0ea;
  padding: 6px 0 10px;
}

.single-voucher-word {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: var(--text);
  font-weight: 900;
}

.single-voucher-word span {
  font-size: 13px;
  line-height: 32px;
}

.single-voucher-word strong {
  min-width: 86px;
  border: 1px solid #d7e0ea;
  background: #f8fafc;
  padding: 5px 14px;
  text-align: center;
  font-size: 16px;
  line-height: 20px;
}

.single-voucher-meta {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) 112px;
  justify-self: end;
  min-width: 320px;
  border: 1px solid #d7e0ea;
  background: #fbfdff;
}

.single-voucher-meta label {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  min-height: 32px;
  margin: 0;
  border-right: 1px solid #d7e0ea;
  padding: 0 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
}

.single-voucher-meta label:last-child {
  border-right: 0;
}

.single-voucher-meta label span {
  color: var(--muted);
}

.single-voucher-meta label strong {
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 13px;
  text-align: left;
}

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

.single-voucher-table th,
.single-voucher-table td {
  border: 1px solid #cfd8e3;
  padding: 9px 10px;
  vertical-align: top;
}

.single-voucher-table th {
  background: #f3f7fb;
  color: var(--text);
  font-weight: 900;
  text-align: center;
}

.single-voucher-table th:nth-child(1),
.single-voucher-table td:nth-child(1) {
  width: 56px;
  text-align: center;
}

.single-voucher-table th:nth-child(2) {
  width: 28%;
}

.single-voucher-table th:nth-child(3) {
  width: 26%;
}

.single-voucher-table th:nth-child(4) {
  width: 16%;
}

.single-voucher-table th:nth-child(5),
.single-voucher-table th:nth-child(6) {
  width: 120px;
}

.single-voucher-table tbody tr {
  height: 62px;
}

.single-voucher-table td span {
  display: -webkit-box;
  max-height: 42px;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-height: 1.55;
  font-weight: 800;
}

.single-voucher-empty-line td {
  color: var(--muted);
}

.single-voucher-table tfoot td {
  background: #fffaf5;
  font-weight: 900;
}

.single-voucher-table tfoot td:first-child {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.single-voucher-table tfoot span {
  min-width: 0;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.single-voucher-source {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  border-top: 1px solid #d7e0ea;
  padding-top: 10px;
  font-size: 13px;
}

.single-voucher-source > strong {
  color: var(--muted);
}

.single-voucher-source > div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

.tiny-button {
  min-height: 22px;
  padding: 2px 6px;
  font-size: 12px;
  line-height: 1.2;
}

.accounting-archive-table {
  width: max-content;
  min-width: 1980px;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
}

.accounting-table-wrap {
  position: relative;
  width: 100%;
  max-width: 100%;
  max-height: calc(100vh - 355px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  scrollbar-gutter: stable;
}

.accounting-control-grid.archive-layout .accounting-table-wrap {
  max-height: calc(100vh - 420px);
}

.accounting-control-grid:not(.archive-layout) .accounting-table-wrap {
  max-height: calc(100vh - 315px);
}

.accounting-archive-table th,
.accounting-archive-table td {
  padding: 8px 10px;
  font-size: 13px;
  vertical-align: middle;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.accounting-archive-table[data-accounting-section="archive"] tbody tr {
  height: 48px;
}

.accounting-archive-table[data-accounting-section="archive"] td {
  height: 48px;
}

.accounting-archive-table[data-accounting-section="archive"] .attachment-ledger-link,
.accounting-archive-table[data-accounting-section="archive"] .voucher-source-tag,
.accounting-archive-table[data-accounting-section="archive"] .claim-list-summary {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.accounting-archive-table thead th {
  position: sticky;
  top: 0;
  z-index: 5;
  background: #f8fafc;
  box-shadow: inset 0 -1px 0 var(--line);
  padding-right: 18px;
  user-select: none;
}

.accounting-archive-table .sticky-accounting-cell {
  z-index: 4;
  background: #fff;
}

.accounting-archive-table thead .sticky-accounting-cell {
  z-index: 7;
  background: #f8fafc;
}

.accounting-sort-button {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px;
  align-items: center;
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--text);
  padding: 0;
  font: inherit;
  font-weight: 900;
  text-align: left;
  cursor: pointer;
}

.accounting-sort-button span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.accounting-sort-button em {
  color: var(--primary);
  font-size: 11px;
  font-style: normal;
  line-height: 1;
}

.accounting-sort-button:hover span {
  color: var(--primary);
}

.accounting-voucher-no-link {
  display: inline-block;
  max-width: 100%;
  font-weight: 900;
  vertical-align: middle;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.accounting-focus-row td {
  background: #eaf3ff !important;
  box-shadow: inset 0 1px 0 rgba(37, 99, 235, 0.18), inset 0 -1px 0 rgba(37, 99, 235, 0.18);
}

.column-resize-handle {
  position: absolute;
  top: 0;
  right: 0;
  width: 8px;
  height: 100%;
  cursor: col-resize;
  touch-action: none;
}

.column-resize-handle::after {
  content: "";
  position: absolute;
  top: 8px;
  bottom: 8px;
  left: 3px;
  width: 1px;
  background: transparent;
}

.column-resize-handle:hover::after,
body.column-resizing .column-resize-handle::after {
  background: var(--primary);
}

body.column-resizing {
  cursor: col-resize;
  user-select: none;
}

.accounting-archive-table .sticky-edge-cell {
  box-shadow: 6px 0 10px rgba(15, 23, 42, 0.08);
}

.accounting-archive-table tbody tr.selected-ledger-row td {
  background: #f5f9ff;
}

.accounting-archive-table tbody tr:hover td {
  background: var(--surface-blue);
}

.accounting-archive-table .accounting-report-total-row td {
  background: #f3f8ff;
  font-weight: 900;
}

.accounting-archive-table .accounting-report-warning-row td {
  background: #fff7ed;
  color: #9a3412;
  font-weight: 900;
}

.accounting-archive-table .accounting-report-section-row td {
  background: #fbfdff;
  font-weight: 800;
}

.accounting-archive-table .accounting-subject-parent-row td {
  background: #fbfdff;
  font-weight: 800;
}

.accounting-archive-table .accounting-subject-auxiliary-row td {
  background: #fff;
}

.accounting-archive-table .accounting-book-opening-row td {
  background: #f8fafc;
  color: var(--muted);
  font-weight: 800;
}

.accounting-archive-table .accounting-balance-section-row td {
  background: #f8fafc;
  color: var(--muted);
  font-weight: 900;
}

.accounting-archive-table .amount-cell {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.accounting-archive-table .profit-report-item {
  color: var(--text);
}

.accounting-archive-table .profit-report-detail-item strong {
  padding-left: 18px;
  font-weight: 700;
}

.accounting-subject-code-cell,
.accounting-subject-name-cell {
  --subject-indent: 0px;
  display: inline-grid;
  grid-template-columns: var(--subject-indent) auto minmax(0, 1fr);
  align-items: center;
  width: 100%;
  min-width: 0;
}

.accounting-subject-code-cell::before,
.accounting-subject-name-cell::before {
  content: "";
  width: var(--subject-indent);
}

.accounting-subject-code-cell {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  font-weight: 800;
}

.accounting-subject-code-cell.has-children {
  color: var(--text);
}

.accounting-subject-name-cell em {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  margin-right: 3px;
  border-radius: 4px;
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
}

.accounting-subject-name-cell.has-children em {
  background: #eef6ff;
  color: var(--primary);
}

.accounting-subject-name-cell.is-auxiliary em {
  background: #f8fafc;
  color: var(--muted);
}

.accounting-subject-name-cell strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.accounting-archive-table .accounting-report-total-row .profit-report-item strong,
.accounting-archive-table .accounting-report-section-row .profit-report-item strong {
  font-weight: 900;
}

.accounting-archive-table .status-pill,
.accounting-archive-table .link-button,
.accounting-archive-table .small-button,
.accounting-archive-table .claim-list-summary,
.accounting-archive-table .amount-cell {
  font-size: 13px;
}

.accounting-archive-head {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
}

.accounting-title-block {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  align-items: start;
  gap: 12px;
  min-width: 0;
}

.accounting-title-block h2 {
  margin: 0;
  font-size: 20px;
  line-height: 1.4;
  white-space: nowrap;
}

.accounting-title-block span {
  min-width: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  overflow: hidden;
  line-height: 1.55;
}

.accounting-archive-panel .accounting-title-block {
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
}

.accounting-archive-panel .accounting-title-block h2 {
  display: none;
}

.accounting-archive-panel .accounting-title-block span {
  display: block;
  padding: 2px 0;
}

.accounting-control-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  width: 100%;
  align-items: start;
}

.accounting-control-grid.archive-layout {
  grid-template-columns: 250px minmax(0, 1fr);
  align-items: stretch;
}

.accounting-control-main {
  display: grid;
  gap: 6px;
  min-width: 0;
  align-content: start;
}

.accounting-filter-line,
.accounting-action-line {
  display: grid;
  gap: 8px;
  width: 100%;
  min-width: 0;
}

.accounting-filter-line {
  grid-template-columns: minmax(126px, 0.8fr) repeat(2, minmax(142px, 1fr)) repeat(2, minmax(122px, 0.8fr)) auto;
  align-items: end;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

#accountingAuxiliaryTypeLabel {
  min-width: 190px;
}

#accountingAuxiliaryItemLabel {
  min-width: 230px;
}

#accountingAuxiliaryTypeFilter,
#accountingAuxiliaryItemFilter {
  font-variant-numeric: tabular-nums;
}

#accountingAuxiliaryTypeFilter {
  min-width: 150px;
}

#accountingAuxiliaryItemFilter {
  min-width: 230px;
}

.accounting-subject-filter-line {
  display: grid;
  grid-template-columns: minmax(190px, 1.1fr) minmax(190px, 1.1fr) minmax(210px, 0.9fr) repeat(3, max-content);
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.accounting-subject-filter-line.hidden {
  display: none;
}

.accounting-level-range > span {
  display: grid;
  grid-template-columns: minmax(58px, 1fr) auto minmax(58px, 1fr);
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.accounting-level-range em {
  color: var(--muted);
  font-style: normal;
  font-size: 13px;
  font-weight: 900;
}

.accounting-check-option {
  display: inline-flex !important;
  grid-template-columns: none !important;
  align-items: center !important;
  gap: 6px !important;
  min-height: 34px;
  padding: 0 4px;
}

.accounting-check-option input {
  width: 16px !important;
  min-width: 16px;
  min-height: 16px !important;
  height: 16px;
  padding: 0 !important;
}

.accounting-check-option span {
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
}

.accounting-filter-apply {
  align-self: center;
  min-width: 72px;
}

.accounting-action-line {
  grid-template-columns: minmax(235px, 320px) minmax(0, 1fr);
  align-items: center;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.accounting-control-grid:not(.archive-layout) .accounting-action-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
}

.accounting-control-grid:not(.archive-layout) .accounting-search-field {
  flex: 0 1 360px;
}

.accounting-control-grid:not(.archive-layout) .accounting-button-group {
  flex: 1 1 420px;
}

.accounting-control-grid:not(.archive-layout) .accounting-button-line {
  flex-wrap: wrap;
  width: 100%;
}

.accounting-control-grid:not(.archive-layout) .accounting-button-line .secondary-button {
  flex: 0 0 auto;
}

.accounting-control-grid.draft-layout .accounting-action-line,
.accounting-control-grid.sync-layout .accounting-action-line,
.accounting-control-grid.manual-voucher-layout .accounting-action-line,
.accounting-control-grid.voucher-layout .accounting-action-line,
.accounting-control-grid.opening-layout .accounting-action-line,
.accounting-control-grid.period-close-layout .accounting-action-line,
.accounting-control-grid.report-layout .accounting-action-line {
  display: grid;
  grid-template-columns: minmax(300px, 420px) minmax(0, 1fr);
  align-items: center;
}

.accounting-control-grid.voucher-layout .accounting-filter-line {
  grid-template-columns: minmax(136px, 0.78fr) minmax(136px, 0.78fr) minmax(136px, 0.78fr) minmax(260px, 1.25fr) auto;
}

.accounting-control-grid.report-layout .accounting-filter-line {
  grid-template-columns: repeat(auto-fit, minmax(136px, 1fr));
  align-items: end;
}

.accounting-control-grid.formal-report-layout .accounting-filter-line {
  grid-template-columns: minmax(132px, 0.85fr) minmax(132px, 0.85fr) minmax(132px, 0.85fr) minmax(132px, 0.85fr) minmax(240px, 1.35fr) auto auto;
}

.accounting-filter-line .accounting-search-field.in-filter-line {
  min-width: 220px;
}

.accounting-filter-line .accounting-button-line.in-filter-line {
  align-self: end;
  justify-content: flex-end;
  gap: 6px;
  min-height: 36px;
  margin: 0;
}

.accounting-filter-line .accounting-button-line.in-filter-line .accounting-line-label {
  display: none;
}

.accounting-control-grid.voucher-layout .accounting-action-line {
  grid-template-columns: minmax(0, 1fr);
  justify-items: start;
}

.accounting-control-grid.draft-layout .accounting-search-field,
.accounting-control-grid.sync-layout .accounting-search-field,
.accounting-control-grid.manual-voucher-layout .accounting-search-field,
.accounting-control-grid.voucher-layout .accounting-search-field,
.accounting-control-grid.opening-layout .accounting-search-field,
.accounting-control-grid.period-close-layout .accounting-search-field,
.accounting-control-grid.report-layout .accounting-search-field {
  align-self: center;
  width: 100%;
  max-width: none;
}

.accounting-control-grid.voucher-layout .accounting-search-field.in-filter-line {
  width: 100%;
  min-width: 0;
}

.accounting-control-grid.draft-layout .accounting-button-group,
.accounting-control-grid.sync-layout .accounting-button-group,
.accounting-control-grid.manual-voucher-layout .accounting-button-group,
.accounting-control-grid.voucher-layout .accounting-button-group,
.accounting-control-grid.opening-layout .accounting-button-group,
.accounting-control-grid.period-close-layout .accounting-button-group,
.accounting-control-grid.report-layout .accounting-button-group {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  min-width: 0;
}

.accounting-control-grid.voucher-layout .accounting-button-group {
  flex: 0 1 auto;
  width: auto;
}

.accounting-control-grid.draft-layout .accounting-button-line,
.accounting-control-grid.sync-layout .accounting-button-line,
.accounting-control-grid.manual-voucher-layout .accounting-button-line,
.accounting-control-grid.voucher-layout .accounting-button-line,
.accounting-control-grid.opening-layout .accounting-button-line,
.accounting-control-grid.period-close-layout .accounting-button-line,
.accounting-control-grid.report-layout .accounting-button-line {
  width: auto;
  flex-wrap: nowrap;
}

.accounting-control-grid.draft-layout .accounting-line-label,
.accounting-control-grid.sync-layout .accounting-line-label,
.accounting-control-grid.manual-voucher-layout .accounting-line-label,
.accounting-control-grid.voucher-layout .accounting-line-label,
.accounting-control-grid.opening-layout .accounting-line-label,
.accounting-control-grid.period-close-layout .accounting-line-label,
.accounting-control-grid.report-layout .accounting-line-label {
  flex: 0 0 auto;
}

.accounting-action-line.search-only {
  grid-template-columns: minmax(0, 1fr);
}

.accounting-action-line.search-only .accounting-search-field {
  max-width: 520px;
}

.accounting-button-group {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.accounting-button-line {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  min-width: 0;
  padding: 0;
}

.period-close-check-row td {
  vertical-align: middle;
}

.period-close-check-row.blocked {
  background: #fff7f7;
}

.period-close-check-row.warning {
  background: #fffaf0;
}

.period-close-step-cell {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.period-close-step-cell span {
  color: #66788a;
  font-size: 12px;
  font-weight: 800;
}

.period-close-step-cell strong {
  color: #102033;
  font-size: 14px;
  font-weight: 900;
}

.accounting-opening-category-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.accounting-opening-category-bar.hidden {
  display: none;
}

.accounting-opening-category-bar button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  padding: 0 10px;
  font-size: 13px;
  font-weight: 900;
}

.accounting-opening-category-bar button:hover {
  background: #f6fbff;
}

.accounting-opening-category-bar button.active {
  border-color: rgba(22, 119, 255, 0.45);
  background: #eaf4ff;
  color: var(--primary);
}

.accounting-opening-category-bar button span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.accounting-opening-empty-row td {
  color: var(--muted);
}

.accounting-report-title-bar {
  display: grid;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 10px 12px;
  text-align: center;
}

.accounting-report-title-bar h3 {
  margin: 0;
  color: var(--text);
  font-size: 20px;
  font-weight: 900;
  line-height: 1.25;
}

.accounting-report-title-bar div {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 18px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.report-amount-link {
  width: 100%;
  min-height: 26px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--primary);
  font-size: 13px;
  font-weight: 900;
  text-align: right;
  padding: 2px 0;
}

.report-amount-link:hover {
  text-decoration: underline;
}

.report-detail-sheet {
  display: grid;
  gap: 12px;
}

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

.report-detail-summary.balance-composition-summary {
  border-color: #c9d9eb;
  background: #fbfdff;
}

.report-detail-summary strong,
.report-detail-summary span {
  font-size: 13px;
  line-height: 1.5;
}

.report-detail-summary span {
  color: var(--muted);
  font-weight: 800;
}

.report-detail-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(138px, 1fr));
  gap: 8px;
  margin: 6px 0;
}

.report-detail-metrics > div {
  display: grid;
  gap: 3px;
  min-height: 54px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  padding: 8px 10px;
}

.report-detail-metrics span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.report-detail-metrics strong {
  color: var(--text);
  font-size: 14px;
  font-weight: 900;
}

.report-detail-metrics .primary-metric {
  border-color: #b8d5ff;
  background: #f3f8ff;
}

.report-detail-metrics .primary-metric strong {
  color: var(--primary);
}

.report-detail-table-wrap {
  max-height: min(66vh, 680px);
}

.report-detail-table th,
.report-detail-table td {
  height: 38px;
  font-size: 13px;
  vertical-align: middle;
}

.report-detail-table td span {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.report-detail-table tfoot td {
  position: sticky;
  bottom: 0;
  z-index: 2;
  background: #f5f9ff;
  font-weight: 900;
}

.accounting-settings-panel {
  min-height: calc(100vh - 108px);
}

.accounting-settings-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  min-height: calc(100vh - 124px);
}

.accounting-settings-menu {
  display: grid;
  align-content: start;
  gap: 4px;
  padding: 10px;
  border-right: 1px solid var(--line);
  background: #f8fafc;
}

.accounting-settings-tab {
  width: 100%;
  min-height: 34px;
  border: 0;
  border-left: 3px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  font-size: 14px;
  font-weight: 800;
  text-align: left;
  padding: 0 10px;
}

.accounting-settings-tab:hover {
  background: #eef5ff;
}

.accounting-settings-tab.active {
  border-left-color: var(--primary);
  background: #eaf4ff;
  color: #124782;
}

.accounting-settings-content {
  display: grid;
  align-content: start;
  gap: 10px;
  min-width: 0;
  padding: 14px;
}

.accounting-settings-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.accounting-settings-toolbar h3 {
  margin: 0;
  font-size: 16px;
  line-height: 1.35;
}

.accounting-settings-toolbar span,
.accounting-settings-summary-line,
.accounting-settings-note {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.5;
}

.accounting-settings-actions,
.accounting-settings-inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.accounting-settings-inline-actions {
  margin-bottom: 8px;
}

.accounting-settings-definition {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.accounting-settings-definition > div {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 8px 10px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.accounting-settings-definition > div:nth-child(3n) {
  border-right: 0;
}

.accounting-settings-definition span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.accounting-settings-definition strong {
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  font-size: 13px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.accounting-suite-tabs {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 34px;
  min-height: 46px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.accounting-suite-tabs button {
  height: 46px;
  border: 0;
  border-bottom: 3px solid transparent;
  background: transparent;
  color: var(--text);
  padding: 0 4px;
  font-size: 14px;
  font-weight: 900;
}

.accounting-suite-tabs button.active {
  border-bottom-color: var(--primary);
  color: var(--primary);
}

.accounting-suite-card {
  display: grid;
  justify-content: center;
  gap: 12px;
  min-height: 390px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 42px 24px 30px;
}

.accounting-suite-form {
  display: grid;
  gap: 16px;
  width: min(560px, 100%);
}

.accounting-suite-form label {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  margin: 0;
  color: var(--text);
  font-size: 14px;
  font-weight: 800;
}

.accounting-suite-form label.required > span::before {
  content: "* ";
  color: var(--danger);
}

.accounting-suite-form input,
.accounting-suite-form select {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
  color: var(--text);
  padding: 7px 10px;
  font-size: 14px;
  font-weight: 700;
}

.accounting-suite-form input[readonly],
.accounting-suite-form select:disabled {
  background: #f8fafc;
  color: var(--text);
  opacity: 1;
}

.accounting-suite-date-row,
.accounting-suite-readonly-line,
.accounting-suite-radio-line {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.accounting-suite-date-row select {
  width: 118px;
}

.accounting-suite-date-row strong,
.accounting-suite-readonly-line strong {
  font-size: 14px;
  font-weight: 900;
  white-space: nowrap;
}

.accounting-suite-radio-line span {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
  white-space: nowrap;
}

.accounting-suite-radio-line span::before {
  content: "";
  width: 14px;
  height: 14px;
  border: 1px solid #c8d6e3;
  border-radius: 50%;
  background: #fff;
}

.accounting-suite-radio-line span.active {
  color: var(--text);
}

.accounting-suite-radio-line span.active::before {
  border-color: var(--primary);
  box-shadow: inset 0 0 0 4px #fff;
  background: var(--primary);
}

.accounting-suite-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
}

.accounting-suite-hint-line {
  width: min(680px, 100%);
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.6;
}

.accounting-subject-tabs {
  display: flex;
  align-items: center;
  gap: 24px;
  min-height: 42px;
  border-bottom: 1px solid var(--line);
  background: #fff;
  padding: 0 8px;
}

.accounting-subject-tabs button {
  height: 42px;
  border: 0;
  border-bottom: 3px solid transparent;
  background: transparent;
  color: var(--text);
  padding: 0 6px;
  font-size: 14px;
  font-weight: 900;
}

.accounting-subject-tabs button.active {
  border-bottom-color: var(--primary);
  color: var(--primary);
}

.accounting-subject-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
  background: #fff;
  padding: 10px 8px;
}

.accounting-subject-search {
  flex: 1 1 340px;
  min-width: 260px;
  margin: 0;
}

.accounting-subject-search input {
  width: 100%;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 6px 10px;
  font-size: 13px;
  font-weight: 800;
}

.accounting-subject-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  color: var(--text);
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
}

.accounting-subject-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.accounting-subject-actions .link-button {
  font-size: 13px;
  font-weight: 900;
}

.danger-link {
  color: var(--danger) !important;
}

.link-button:disabled,
.danger-link:disabled {
  cursor: not-allowed;
  color: var(--muted) !important;
  opacity: 0.58;
}

.accounting-settings-note {
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
}

.accounting-settings-table-wrap {
  max-height: max(360px, calc(100vh - 318px));
}

.accounting-settings-table {
  min-width: 1180px;
}

.accounting-settings-table th,
.accounting-settings-table td {
  height: 38px;
  padding: 8px 10px;
  font-size: 13px;
  vertical-align: middle;
}

.accounting-settings-name-cell {
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.accounting-auxiliary-layout {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 10px;
  min-width: 0;
}

.accounting-auxiliary-category-bar {
  display: flex;
  align-items: stretch;
  gap: 0;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px 8px 0 0;
  background: #fff;
}

.accounting-auxiliary-category-bar > strong {
  display: inline-flex;
  align-items: center;
  flex: 0 0 132px;
  padding: 0 12px;
  border-right: 1px solid var(--line);
  color: var(--text);
  font-size: 14px;
  font-weight: 900;
  white-space: nowrap;
}

.accounting-auxiliary-tabs {
  display: flex;
  flex: 1 1 auto;
  min-width: 0;
  overflow-x: auto;
}

.accounting-auxiliary-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 96px;
  min-height: 44px;
  border: 0;
  border-bottom: 3px solid transparent;
  border-radius: 0;
  background: #fff;
  color: var(--text);
  font-size: 14px;
  font-weight: 900;
  white-space: nowrap;
}

.accounting-auxiliary-tab:hover {
  background: #f6fbff;
}

.accounting-auxiliary-tab.active {
  border-bottom-color: var(--primary);
  color: var(--primary);
}

.accounting-auxiliary-tab span {
  color: var(--muted);
  font-size: 12px;
}

.accounting-auxiliary-purpose-line {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  align-items: center;
  min-height: 36px;
  padding: 8px 10px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  border-left: 1px solid var(--line);
  background: #fbfdff;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.4;
}

.accounting-auxiliary-query-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 10px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  border-left: 1px solid var(--line);
  background: #fff;
}

.accounting-auxiliary-query-bar label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.accounting-auxiliary-query-bar input[type="search"] {
  width: min(340px, 32vw);
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 10px;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}

.accounting-auxiliary-query-bar .compact-check {
  gap: 6px;
}

.accounting-auxiliary-query-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-left: auto;
}

.accounting-auxiliary-usage {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
}

.accounting-auxiliary-usage > strong {
  color: var(--text);
  font-size: 13px;
  font-weight: 900;
}

.accounting-auxiliary-usage-table-wrap {
  overflow-x: auto;
}

.accounting-auxiliary-usage-table {
  width: 100%;
  min-width: 860px;
  border-collapse: collapse;
}

.accounting-auxiliary-usage-table th,
.accounting-auxiliary-usage-table td {
  border-top: 1px solid var(--line);
  padding: 7px 8px;
  color: var(--text);
  font-size: 13px;
  line-height: 1.45;
  text-align: left;
  vertical-align: top;
}

.accounting-auxiliary-usage-table th {
  background: #f4f7fb;
  color: var(--muted);
  font-weight: 900;
  white-space: nowrap;
}

.accounting-auxiliary-usage-table tbody tr.active {
  background: #eef6ff;
}

.accounting-auxiliary-usage-table td:first-child {
  width: 72px;
  font-weight: 900;
  white-space: nowrap;
}

.accounting-auxiliary-types {
  display: grid;
  align-content: start;
  gap: 6px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.accounting-auxiliary-type {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 34px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  font-size: 13px;
  font-weight: 900;
  padding: 0 10px;
  text-align: left;
}

.accounting-auxiliary-type:hover {
  background: #eef5ff;
}

.accounting-auxiliary-type.active {
  background: #eaf4ff;
  color: #124782;
}

.accounting-auxiliary-type strong {
  color: var(--muted);
  font-size: 12px;
}

.accounting-auxiliary-list {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.accounting-line-label {
  flex: 0 0 72px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
  line-height: 30px;
  white-space: nowrap;
}

.accounting-button-line .secondary-button {
  min-height: 32px;
  padding: 6px 10px;
  font-size: 13px;
  line-height: 1.25;
}

.accounting-archive-table .primary-button,
.accounting-archive-table .secondary-button,
.accounting-archive-table .small-button,
.accounting-action-line .primary-button,
.accounting-action-line .secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  min-width: 76px;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.2;
  white-space: nowrap;
}

.accounting-archive-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  align-items: start;
  min-width: 0;
}

.accounting-archive-workspace.prod-archive {
  grid-template-columns: minmax(0, 1fr);
}

.accounting-period-strip {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-content: start;
  align-items: stretch;
  gap: 7px;
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.accounting-control-grid.archive-layout .accounting-period-strip {
  align-self: stretch;
  height: 100%;
  min-height: calc(100vh - 255px);
  max-height: calc(100vh - 210px);
  overflow: auto;
}

.accounting-period-strip > strong,
.accounting-period-strip > span {
  font-size: 13px;
}

.accounting-period-strip > span {
  color: var(--muted);
  font-weight: 800;
  white-space: nowrap;
}

.accounting-period-strip #accountingArchiveTree {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.accounting-tree-year {
  display: grid;
  gap: 6px;
}

.accounting-tree-year summary {
  display: block;
  color: var(--text);
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
  list-style: none;
}

.accounting-tree-year summary::-webkit-details-marker {
  display: none;
}

.accounting-tree-months {
  display: grid;
  gap: 5px;
  padding: 0;
}

.accounting-tree-month {
  display: grid;
  gap: 4px;
}

.accounting-tree-month-summary,
.accounting-tree-vouchers button {
  display: inline-grid;
  grid-template-columns: auto minmax(0, 1fr);
  justify-content: start;
  gap: 6px;
  align-items: center;
  width: 100%;
  min-height: 30px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  padding: 5px 9px;
  text-align: left;
  cursor: pointer;
}

.accounting-period-strip .accounting-tree-month-summary {
  width: 100%;
}

.accounting-tree-month-summary.active {
  border-color: #b9d2f5;
  background: #eef6ff;
}

.accounting-tree-vouchers {
  display: grid;
  gap: 4px;
  padding: 0 0 2px 12px;
  border-left: 1px solid #dbe5ef;
}

.accounting-tree-voucher {
  min-height: 28px;
  padding: 4px 7px;
  background: #ffffff;
}

.accounting-tree-voucher strong {
  max-width: 68px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.accounting-tree-months strong,
.accounting-tree-months span,
.accounting-tree-empty {
  font-size: 13px;
}

.accounting-tree-months span,
.accounting-tree-vouchers span {
  color: var(--muted);
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.accounting-tree-vouchers strong,
.accounting-tree-vouchers span {
  font-size: 12px;
}

.accounting-tree-empty {
  padding: 12px;
  color: var(--muted);
  font-weight: 800;
}

.accounting-control-grid label {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  min-width: 0;
  gap: 7px;
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.accounting-control-grid input,
.accounting-control-grid select {
  width: 100%;
  min-height: 34px;
  padding: 6px 8px;
  font-size: 13px;
  font-weight: 800;
}

.accounting-control-grid button {
  width: auto;
  min-height: 34px;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.accounting-control-grid .accounting-button-line .secondary-button {
  min-height: 32px;
  padding: 6px 10px;
}

.accounting-search-field {
  min-width: 0;
  align-self: start;
}

.accounting-row-actions {
  min-width: 170px;
  gap: 5px;
}

.accounting-row-actions.compact {
  min-width: 0;
  flex-wrap: nowrap;
  align-items: center;
}

.accounting-inline-input {
  min-height: 32px;
  border-radius: 6px;
  padding: 5px 7px;
  font-size: 13px;
  font-weight: 700;
}

.accounting-inline-input.period {
  width: 118px;
}

.accounting-inline-input.date {
  width: 136px;
}

.accounting-inline-input.word {
  width: 70px;
}

.accounting-inline-input.number {
  width: 160px;
}

.accounting-inline-input.summary {
  width: 230px;
}

.claim-summary {
  display: block;
  max-width: 260px;
  overflow: hidden;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.claim-list-summary {
  display: block;
  max-width: 300px;
  overflow: hidden;
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.45;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.status-pill {
  display: inline-flex;
  min-width: 64px;
  border: 0;
  justify-content: center;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 800;
}

.status-action {
  cursor: pointer;
}

.status-action:hover {
  box-shadow: 0 0 0 3px rgba(22, 119, 255, 0.14);
}

.status-draft {
  background: #eef1f4;
  color: #52606d;
}

.status-finance,
.status-pending {
  background: #fff4d6;
  color: var(--amber);
}

.status-gm,
.status-approved {
  background: #e8f7ef;
  color: var(--accent);
}

.status-voucher,
.status-paid {
  background: #e8f1ff;
  color: var(--primary-dark);
}

.status-completed {
  background: #e4f5e9;
  color: #11643c;
}

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

.detail-panel {
  display: none;
  min-height: 0;
}

.detail-body {
  padding: 16px;
}

.empty-state {
  display: grid;
  min-height: 380px;
  place-items: center;
  padding: 28px;
  color: var(--muted);
  text-align: center;
}

.empty-state h2 {
  margin: 0 0 8px;
}

.detail-title {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.detail-title h2 {
  margin: 0;
  font-size: 20px;
}

.detail-title p {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.detail-meta,
.detail-list,
.timeline {
  display: grid;
  gap: 10px;
}

.detail-meta {
  grid-template-columns: 1fr 1fr;
  margin-bottom: 16px;
}

.claim-meta-grid {
  grid-template-columns: 1fr;
}

.meta-row {
  display: grid;
  gap: 10px;
}

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

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

.meta-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  padding: 11px;
}

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

.meta-card strong {
  display: block;
  margin-top: 4px;
  overflow-wrap: anywhere;
}

.detail-list {
  margin: 12px 0 16px;
}

.expense-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

.expense-line span {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.expense-line-meta {
  width: fit-content;
  max-width: 100%;
  border-radius: 7px;
  padding: 4px 6px;
}

.attachment-meta-clickable {
  border: 1px solid #cbdff8;
  background: #f7fbff;
  cursor: pointer;
}

.attachment-meta-clickable:hover {
  border-color: var(--primary);
  color: #124782;
  background: #eef6ff;
}

.attachment-meta-clickable.missing {
  border-color: #ead6aa;
  background: #fffaf0;
}

.expense-line strong {
  overflow-wrap: anywhere;
}

.detail-total {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 16px 0;
}

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

.accounting-voucher-panel {
  display: grid;
  gap: 12px;
  margin: 14px 0;
  border: 1px solid #cfe0ff;
  border-radius: 8px;
  background: #f7fbff;
  padding: 12px;
}

.accounting-voucher-panel.accounting-focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(22, 119, 255, 0.16);
}

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

.accounting-voucher-head h3 {
  margin: 0;
  font-size: 15px;
}

.accounting-voucher-head span:not(.status-pill) {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

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

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

.accounting-voucher-actions {
  display: flex;
  grid-column: 1 / -1;
  gap: 8px;
  flex-wrap: wrap;
}

.accounting-voucher-readonly {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.accounting-attachment-strip {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
}

.accounting-attachment-strip strong {
  color: var(--text);
}

.accounting-draft-mini {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  margin-left: 6px;
  border: 1px solid #b9d2ff;
  border-radius: 999px;
  background: #f0f6ff;
  color: #1254a3;
  font-size: 12px;
  font-weight: 900;
  padding: 0 7px;
  white-space: nowrap;
}

.accounting-draft-panel {
  display: grid;
  gap: 10px;
  border: 1px solid #dbe8ff;
  border-radius: 8px;
  background: #fff;
  padding: 10px;
}

.accounting-draft-panel.empty {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.accounting-draft-panel.empty strong,
.accounting-draft-head strong {
  display: block;
  color: var(--text);
  font-size: 14px;
  font-weight: 900;
}

.accounting-draft-panel.empty span,
.accounting-draft-head span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.accounting-draft-head,
.accounting-draft-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.accounting-draft-summary {
  justify-content: flex-start;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
  padding: 8px 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.accounting-draft-summary strong {
  color: var(--text);
}

.accounting-draft-warnings {
  display: grid;
  gap: 6px;
}

.accounting-draft-warnings span {
  border: 1px solid #f2d4a8;
  border-radius: 6px;
  background: #fff9ea;
  color: #8a5200;
  font-size: 12px;
  font-weight: 800;
  padding: 7px 8px;
}

.accounting-draft-table-wrap {
  max-height: 260px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: auto;
}

.accounting-draft-table {
  width: 100%;
  min-width: 1280px;
  border-collapse: collapse;
}

.accounting-draft-table th,
.accounting-draft-table td {
  border-bottom: 1px solid var(--line);
  padding: 7px 8px;
  font-size: 12px;
  vertical-align: middle;
}

.accounting-draft-table th {
  position: sticky;
  top: 0;
  background: #f8fafc;
  color: #405365;
  font-weight: 900;
  z-index: 1;
}

.accounting-draft-table input,
.accounting-draft-table select {
  width: 100%;
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  padding: 5px 7px;
  font: inherit;
  font-size: 12px;
}

.accounting-draft-table .amount-input {
  text-align: right;
  font-weight: 800;
}

.accounting-draft-table th:nth-child(1),
.accounting-draft-table td:nth-child(1) {
  width: 48px;
  min-width: 48px;
  text-align: center;
}

.accounting-draft-table th:nth-child(2),
.accounting-draft-table td:nth-child(2) {
  width: 72px;
  min-width: 72px;
}

.accounting-draft-table th:nth-child(3),
.accounting-draft-table td:nth-child(3) {
  width: 220px;
  min-width: 220px;
}

.accounting-draft-table th:nth-child(4),
.accounting-draft-table td:nth-child(4) {
  width: 120px;
  min-width: 120px;
}

.accounting-draft-table th:nth-child(5),
.accounting-draft-table td:nth-child(5) {
  width: 210px;
  min-width: 210px;
}

.accounting-draft-table th:nth-child(6),
.accounting-draft-table td:nth-child(6) {
  width: 120px;
  min-width: 120px;
}

.payment-voucher-panel {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 12px;
}

.payment-voucher-panel h3 {
  margin: 0;
  font-size: 15px;
}

.payment-voucher-view {
  display: grid;
  width: 100%;
  gap: 4px;
  border: 1px solid #b9d2ff;
  border-radius: 8px;
  background: #f7fbff;
  color: var(--text);
  cursor: pointer;
  font: inherit;
  padding: 10px 12px;
  text-align: left;
}

.payment-voucher-meta .payment-voucher-view {
  margin-top: 6px;
}

.payment-voucher-view:hover {
  border-color: var(--primary);
  background: #eef6ff;
}

.payment-voucher-view span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.payment-voucher-view strong {
  color: var(--primary-strong);
  font-size: 14px;
}

.payment-voucher-view small {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.payment-voucher-view.missing {
  border-color: var(--line);
  background: var(--surface-soft);
}

.payment-voucher-view.missing strong {
  color: var(--text);
}

.workflow-panel {
  margin: 0 0 14px;
  border: 1px solid #cfe0ff;
  border-radius: 8px;
  background: #f6faff;
  padding: 12px;
}

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

.workflow-panel-head h3 {
  font-size: 16px;
}

.workflow-panel-head span {
  color: #124782;
  font-size: 13px;
  font-weight: 800;
}

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

.workflow-step {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  padding: 10px;
  font-size: 12px;
  font-weight: 800;
}

.workflow-step strong,
.workflow-step small,
.workflow-step em,
.workflow-step i,
.workflow-step b {
  display: block;
}

.workflow-step strong {
  color: var(--text);
  font-size: 13px;
}

.workflow-step small {
  margin-top: 5px;
  color: var(--muted);
}

.workflow-step em {
  margin-top: 5px;
  color: var(--muted);
  font-style: normal;
}

.workflow-step i {
  margin-top: 5px;
  color: #315a85;
  font-size: 12px;
  font-style: normal;
  font-weight: 700;
  line-height: 1.35;
}

.workflow-step b {
  margin-top: 7px;
  color: #8a5a00;
  font-size: 13px;
}

.workflow-step.done {
  border-color: #b9dcc8;
  background: #eef9f2;
  color: var(--accent);
}

.workflow-step.done em {
  color: var(--accent);
}

.workflow-step.current {
  border-color: #f0c579;
  background: #fff8e8;
  color: var(--amber);
}

.workflow-step.current em {
  color: var(--amber);
}

.paperless-status {
  display: grid;
  grid-template-columns: 100px repeat(3, minmax(0, 1fr));
  gap: 8px;
  align-items: center;
  margin: 0 0 14px;
  border: 1px solid #cfe0ff;
  border-radius: 8px;
  background: #f6faff;
  padding: 10px;
}

.paperless-status span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.paperless-status strong {
  border-radius: 6px;
  background: #fff;
  color: #245087;
  padding: 8px;
  font-size: 12px;
}

.timeline {
  position: relative;
  margin-top: 10px;
  padding-left: 18px;
}

.timeline::before {
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 4px;
  width: 2px;
  background: var(--line);
  content: "";
}

.timeline-item {
  position: relative;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.timeline-item::before {
  position: absolute;
  top: 4px;
  left: -18px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--primary);
  content: "";
}

.detail-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  position: sticky;
  bottom: 0;
  z-index: 2;
  margin: 4px -14px 0;
  border-top: 1px solid var(--line);
  background: rgba(251, 253, 255, 0.96);
  padding: 10px 14px 12px;
  backdrop-filter: blur(8px);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.42);
  padding: 24px;
}

#attachmentPreviewModal {
  z-index: 60;
}

.claim-modal-panel,
.accounting-voucher-modal-panel,
.attachment-preview-panel,
.attachment-export-panel,
.external-voucher-panel,
.fixed-asset-modal-panel,
.fixed-asset-category-modal-panel,
.password-modal-panel {
  display: grid;
  width: min(1120px, calc(100vw - 48px));
  max-height: min(780px, calc(100vh - 48px));
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 20px 60px rgba(15, 23, 42, 0.22);
}

.attachment-preview-panel {
  width: min(1280px, calc(100vw - 36px));
}

.accounting-voucher-modal-panel {
  width: min(1180px, calc(100vw - 42px));
}

.attachment-export-panel {
  width: min(980px, calc(100vw - 48px));
}

.external-voucher-panel {
  width: min(1180px, calc(100vw - 42px));
}

.fixed-asset-modal-panel {
  width: min(1180px, calc(100vw - 42px));
}

.fixed-asset-category-modal-panel {
  width: min(920px, calc(100vw - 42px));
}

.password-modal-panel {
  width: min(460px, calc(100vw - 48px));
  grid-template-rows: auto minmax(0, 1fr);
}

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

.modal-head h2 {
  margin: 0;
  font-size: 18px;
}

.modal-head span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.attachment-preview-current {
  color: var(--text) !important;
}

.attachment-preview-file-strip {
  display: flex !important;
  max-width: min(1160px, calc(100vw - 180px));
  gap: 6px;
  overflow-x: auto;
  padding: 2px 0 3px;
  scrollbar-color: rgba(102, 114, 125, 0.36) transparent;
}

.attachment-preview-file-tab {
  flex: 0 0 auto;
  max-width: 280px;
  min-height: 28px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attachment-preview-file-tab.active {
  border-color: rgba(22, 119, 255, 0.55);
  background: #eaf3ff;
  color: var(--primary);
}

.attachment-preview-file-tab:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.claim-modal-body,
.attachment-preview-body,
.attachment-export-body,
.external-voucher-body,
.fixed-asset-modal-body {
  min-height: 0;
  overflow: auto;
  padding: 14px 16px;
  scrollbar-color: rgba(102, 114, 125, 0.42) transparent;
}

.claim-modal-body {
  display: grid;
  gap: 12px;
}

.password-change-form {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.password-change-form .claim-modal-actions {
  margin: 2px -16px -16px;
}

.external-voucher-body {
  display: grid;
  gap: 10px;
  background: #fbfdff;
}

.fixed-asset-modal-body {
  background: #fbfdff;
}

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

.fixed-asset-form-grid label {
  display: grid;
  min-width: 0;
  gap: 5px;
  color: var(--text);
  font-size: 13px;
  font-weight: 900;
}

.fixed-asset-form-grid input,
.fixed-asset-form-grid select,
.fixed-asset-form-grid textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  padding: 0 9px;
  font-size: 13px;
  font-weight: 800;
}

.fixed-asset-form-grid input,
.fixed-asset-form-grid select {
  height: 34px;
}

.fixed-asset-form-grid textarea {
  min-height: 76px;
  padding: 8px 9px;
  resize: vertical;
}

.fixed-asset-form-grid input[readonly] {
  background: #f3f6f9;
  color: var(--muted);
}

.fixed-asset-form-grid .span-4 {
  grid-column: 1 / -1;
}

.external-voucher-toolbar {
  display: grid;
  grid-template-columns: minmax(118px, 0.8fr) minmax(132px, 0.9fr) minmax(82px, 0.55fr) minmax(102px, 0.65fr) minmax(180px, 1.2fr) minmax(180px, 1.2fr) max-content max-content;
  gap: 8px;
  align-items: end;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.external-voucher-toolbar label,
.external-voucher-table-actions label {
  min-width: 0;
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
}

.external-voucher-toolbar input,
.external-voucher-toolbar select {
  width: 100%;
  min-width: 0;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  padding: 0 9px;
  font-size: 13px;
  font-weight: 800;
}

.external-voucher-check-field {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  white-space: nowrap;
}

.external-voucher-check-field input {
  width: 16px;
  height: 16px;
}

.external-voucher-table-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.external-voucher-table-wrap {
  max-height: min(430px, calc(100vh - 330px));
  border-radius: 8px;
}

.external-voucher-table {
  width: 100%;
  min-width: 980px;
  border-collapse: separate;
  border-spacing: 0;
}

.external-voucher-table th,
.external-voucher-table td {
  height: 40px;
  padding: 7px 8px;
  font-size: 13px;
  vertical-align: middle;
}

.external-voucher-table th {
  position: sticky;
  top: 0;
  z-index: 3;
  background: #f8fafc;
  box-shadow: inset 0 -1px 0 var(--line);
  text-align: left;
}

.external-voucher-table th:first-child,
.external-voucher-table td:first-child {
  width: 56px;
  text-align: center;
}

.external-voucher-table th:nth-child(2),
.external-voucher-table td:nth-child(2) {
  width: 260px;
}

.external-voucher-table th:nth-child(3),
.external-voucher-table td:nth-child(3) {
  width: 260px;
}

.external-voucher-table th:nth-child(4),
.external-voucher-table td:nth-child(4) {
  width: 180px;
}

.external-voucher-table th:nth-child(5),
.external-voucher-table th:nth-child(6),
.external-voucher-table td:nth-child(5),
.external-voucher-table td:nth-child(6) {
  width: 132px;
}

.external-voucher-table input {
  width: 100%;
  min-width: 0;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  padding: 0 8px;
  font-size: 13px;
  font-weight: 800;
}

.external-voucher-table .amount-input {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.external-voucher-total-line {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 12px;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 7px 10px;
  color: var(--text);
  font-size: 13px;
  font-weight: 900;
}

.external-voucher-total-line strong {
  font-variant-numeric: tabular-nums;
}

.external-voucher-total-line .balanced {
  color: #047857;
}

.external-voucher-total-line .unbalanced {
  color: #b45309;
}

.claim-modal-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  padding: 12px;
}

.claim-modal-summary strong,
.claim-modal-summary span {
  display: block;
}

.claim-modal-summary span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.approval-sheet {
  display: grid;
  gap: 12px;
}

.approval-sheet-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 14px;
}

.approval-sheet-head span:not(.status-pill),
.approval-sheet-head small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.approval-sheet-head h3 {
  margin: 4px 0;
  font-size: 18px;
  line-height: 1.35;
}

.approval-sheet-section {
  display: grid;
  gap: 10px;
}

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

.approval-section-title h3 {
  margin: 0;
}

.approval-section-title span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.approval-form-snapshot {
  display: grid;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.approval-form-row {
  display: grid;
  border-bottom: 1px solid var(--line);
}

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

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

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

.approval-form-row.emphasis-row {
  background: #f8fbff;
}

.approval-form-row:last-child {
  border-bottom: 0;
}

.approval-form-cell,
.approval-purpose-row {
  min-width: 0;
  border-right: 1px solid var(--line);
  padding: 10px 12px;
}

.approval-form-cell:last-child {
  border-right: 0;
}

.approval-form-cell span,
.approval-purpose-row span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.approval-form-cell strong,
.approval-form-value,
.approval-purpose-row strong {
  display: block;
  margin-top: 5px;
  min-height: 20px;
  overflow-wrap: anywhere;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.45;
}

.approval-form-value {
  color: var(--text);
}

.approval-category-edit {
  display: grid;
  gap: 6px;
}

.approval-category-edit label {
  display: grid;
  grid-template-columns: minmax(0, auto) minmax(140px, 1fr);
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.approval-category-edit label:only-child {
  grid-template-columns: minmax(0, 1fr);
}

.approval-category-edit select {
  min-height: 32px;
  border-radius: 6px;
  padding: 5px 8px;
  font-size: 13px;
  font-weight: 800;
}

.approval-purpose-row {
  border-right: 0;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.approval-purpose-row strong {
  font-size: 14px;
  line-height: 1.55;
}

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

.approval-record {
  display: grid;
  grid-template-columns: 110px minmax(110px, 0.4fr) 120px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 10px 12px;
}

.approval-record.done {
  border-color: #b8dfc6;
  background: #f3fbf6;
}

.approval-record.current {
  border-color: #9cc7ff;
  background: #f3f8ff;
}

.approval-record strong,
.approval-record span,
.approval-record em,
.approval-record p {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
}

.approval-record span,
.approval-record em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

.approval-record p {
  line-height: 1.5;
}

.approval-record-file {
  justify-content: flex-start;
  max-width: 100%;
  padding: 0;
  text-align: left;
  white-space: normal;
  word-break: break-all;
}

.approval-history-lines {
  display: grid;
  gap: 6px;
  border-left: 3px solid var(--line);
  margin-left: 8px;
  padding-left: 10px;
}

.approval-history-lines div {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.approval-history-lines strong {
  color: #46525e;
}

.voucher-success-banner {
  border: 1px solid #a9d9b9;
  border-radius: 8px;
  background: #edf9f1;
  color: #0f6b3d;
  padding: 12px 14px;
}

.voucher-success-banner strong,
.voucher-success-banner span {
  display: block;
}

.voucher-success-banner span {
  margin-top: 4px;
  color: #245b39;
  font-size: 13px;
  font-weight: 700;
}

.modal-detail-meta,
.modal-detail-total {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0;
}

.modal-detail-meta.claim-meta-grid {
  grid-template-columns: 1fr;
}

.modal-detail-total.advance-total-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.modal-section h3 {
  margin: 0 0 10px;
  font-size: 15px;
}

.finance-category-panel {
  display: grid;
  gap: 10px;
}

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

.finance-category-head h3 {
  margin: 0;
}

.finance-category-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.5;
}

.finance-category-table-wrap {
  max-height: min(300px, calc(100vh - 360px));
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  scrollbar-gutter: stable;
}

.finance-category-table {
  min-width: 680px;
  table-layout: fixed;
}

.finance-category-table th,
.finance-category-table td {
  padding: 9px 10px;
  vertical-align: middle;
}

.finance-category-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--surface-soft);
  color: #46525e;
  font-size: 12px;
}

.finance-category-table td {
  font-size: 13px;
}

.finance-category-table th:nth-child(1),
.finance-category-table td:nth-child(1) {
  width: 34%;
}

.finance-category-table th:nth-child(2),
.finance-category-table td:nth-child(2) {
  width: 22%;
}

.finance-category-table th:nth-child(3),
.finance-category-table td:nth-child(3) {
  width: 16%;
}

.finance-category-table th:nth-child(4),
.finance-category-table td:nth-child(4) {
  width: 28%;
}

.finance-category-placeholder {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  justify-content: center;
  width: 100%;
  border: 1px dashed #efc06d;
  border-radius: 8px;
  background: #fff9ea;
  color: #9a5b00;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.modal-detail-list {
  margin: 0;
}

.modal-timeline {
  margin-bottom: 0;
}

.claim-modal-actions {
  display: flex;
  min-height: 56px;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
  border-top: 1px solid var(--line);
  background: #fbfdff;
  padding: 10px 16px;
}

.claim-modal-actions.review-focus {
  box-shadow: inset 0 0 0 4px rgba(22, 119, 255, 0.12);
}

.attachment-preview-body {
  display: grid;
  min-height: 420px;
  place-items: center;
  background: #f8fafc;
}

.attachment-preview-body.structured-preview {
  display: block;
  place-items: initial;
  padding: 10px;
}

.attachment-preview-image {
  display: block;
  max-width: 100%;
  max-height: calc(100vh - 210px);
  border-radius: 6px;
  object-fit: contain;
}

.attachment-preview-image.hidden {
  display: none;
}

.attachment-preview-loading {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  padding: 14px 18px;
  font-size: 14px;
  font-weight: 800;
}

.attachment-preview-frame {
  width: 100%;
  height: min(620px, calc(100vh - 210px));
  border: 0;
  border-radius: 6px;
  background: #fff;
}

.attachment-preview-empty {
  max-width: 420px;
  color: var(--muted);
  line-height: 1.7;
  text-align: center;
}

.attachment-preview-empty h3 {
  margin: 0 0 8px;
  color: var(--text);
}

.office-preview {
  display: grid;
  gap: 8px;
  width: 100%;
}

.office-preview-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  padding: 8px 10px;
}

.office-preview-title strong {
  color: var(--text);
  font-size: 14px;
}

.office-preview-title span,
.office-preview-note {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

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

.office-preview-section h4 {
  margin: 0;
  color: var(--text);
  font-size: 14px;
}

.office-preview-table-wrap {
  max-height: min(520px, calc(100vh - 260px));
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.office-preview-table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
  font-size: 13px;
}

.office-preview-table th,
.office-preview-table td {
  max-width: 260px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 7px 9px;
  color: var(--text);
  text-align: left;
  vertical-align: top;
  white-space: nowrap;
}

.office-preview-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #eef4fb;
  font-weight: 900;
}

.office-preview-table td {
  background: #fff;
  font-weight: 700;
}

.spreadsheet-preview {
  display: grid;
  min-height: min(610px, calc(100vh - 220px));
  grid-template-rows: minmax(0, 1fr) auto;
  overflow: hidden;
  border: 1px solid #cfd8e3;
  border-radius: 6px;
  background: #fff;
}

.spreadsheet-stage {
  min-height: 0;
  overflow: hidden;
}

.spreadsheet-sheet {
  display: none;
  height: 100%;
  min-height: 0;
}

.spreadsheet-sheet.active {
  display: block;
}

.spreadsheet-grid-wrap {
  width: 100%;
  height: 100%;
  max-height: min(590px, calc(100vh - 250px));
  overflow: auto;
  background: #fff;
}

.spreadsheet-grid {
  width: max-content;
  min-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  color: #111827;
  font-size: 13px;
  line-height: 1.35;
}

.spreadsheet-grid th,
.spreadsheet-grid td {
  height: 30px;
  min-width: 92px;
  max-width: 240px;
  border-right: 1px solid #d9e1ea;
  border-bottom: 1px solid #d9e1ea;
  padding: 5px 8px;
  overflow: hidden;
  background: #fff;
  color: #111827;
  font-weight: 400;
  text-align: left;
  text-overflow: ellipsis;
  vertical-align: middle;
  white-space: nowrap;
}

.spreadsheet-grid .spreadsheet-corner,
.spreadsheet-grid .spreadsheet-col-head,
.spreadsheet-grid .spreadsheet-row-head {
  background: #f3f6fa;
  color: #526170;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}

.spreadsheet-grid .spreadsheet-corner {
  position: sticky;
  top: 0;
  left: 0;
  z-index: 4;
  min-width: 46px;
  width: 46px;
}

.spreadsheet-grid .spreadsheet-col-head {
  position: sticky;
  top: 0;
  z-index: 3;
}

.spreadsheet-grid .spreadsheet-row-head {
  position: sticky;
  left: 0;
  z-index: 2;
  min-width: 46px;
  width: 46px;
}

.spreadsheet-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  overflow-x: auto;
  border-top: 1px solid #cfd8e3;
  background: #f6f8fb;
  padding: 6px 8px;
}

.spreadsheet-tab {
  min-height: 30px;
  border: 1px solid transparent;
  border-radius: 5px 5px 0 0;
  background: transparent;
  color: #526170;
  padding: 5px 14px;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.spreadsheet-tab:hover,
.spreadsheet-tab.active {
  border-color: #cfd8e3;
  border-bottom-color: #fff;
  background: #fff;
  color: var(--primary-dark);
}

.office-preview-text {
  max-height: min(540px, calc(100vh - 250px));
  overflow: auto;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  padding: 12px;
  font-family: "Consolas", "Menlo", monospace;
  font-size: 13px;
  line-height: 1.65;
  white-space: pre-wrap;
  word-break: break-word;
}

.attachment-export-body {
  display: grid;
  gap: 12px;
  background: #f8fafc;
}

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

.attachment-export-group h3 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0;
  font-size: 15px;
}

.attachment-export-group h3 span {
  color: var(--muted);
  font-size: 12px;
}

.attachment-export-list {
  display: grid;
  gap: 6px;
}

.attachment-export-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  border: 1px solid #e3e9ef;
  border-radius: 8px;
  background: #fbfdff;
  padding: 8px 10px;
}

.attachment-export-row input {
  width: auto;
  min-height: auto;
}

.attachment-export-row strong,
.attachment-export-row small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attachment-export-row small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.action-note {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--muted);
  padding: 7px 10px;
  font-size: 13px;
  font-weight: 800;
}

.form-panel {
  overflow: hidden;
}

#claimForm {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.form-section {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  padding: 0 16px 16px;
}

.form-section > .form-grid:first-of-type {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.finance-category-basic-field {
  display: grid;
}

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

.form-section > .form-grid:first-of-type {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.finance-category-basic-field input {
  border-color: #efc06d;
  background: #fff9ea;
  color: #9a5b00;
  font-weight: 900;
}

#claimForm {
  gap: 10px;
  padding: 12px;
}

.claim-modal-panel {
  width: min(1200px, calc(100vw - 40px));
  max-height: min(820px, calc(100vh - 40px));
}

.modal-head {
  min-height: 54px;
  padding: 10px 16px;
}

.modal-head h2 {
  font-size: 17px;
  line-height: 1.25;
}

.modal-head span {
  margin-top: 2px;
  font-size: 12px;
}

.claim-modal-body {
  gap: 8px;
  padding: 10px 14px;
}

.claim-modal-actions {
  min-height: 48px;
  padding: 8px 14px;
}

.form-section,
.item-section,
.advance-offset-panel,
.approval-workflow-bottom {
  border-radius: 8px;
}

.section-head {
  min-height: 44px;
  padding: 9px 14px;
}

.section-head h2,
.section-head h3,
.item-section-head h3,
.advance-offset-head h3 {
  margin: 0;
  font-size: 16px;
  line-height: 1.25;
}

.section-head span,
.approval-section-note,
.advance-offset-head span {
  margin-top: 2px;
  font-size: 12px;
  line-height: 1.35;
}

.form-grid,
.dynamic-fields,
.advance-offset-grid {
  gap: 10px;
  padding: 0 14px 12px;
}

.dynamic-fields.travel-fields::before {
  font-size: 13px;
  margin-bottom: -5px;
}

label {
  gap: 5px;
  font-size: 13px;
}

input,
select {
  min-height: 34px;
  height: 36px;
  border-radius: 8px;
  padding: 6px 9px;
  font-size: 14px;
}

textarea {
  min-height: 72px;
  padding: 8px 9px;
  font-size: 14px;
  line-height: 1.45;
}

.wide-field {
  padding: 0 14px 12px;
}

.item-section-head {
  min-height: 44px;
  padding: 8px 12px;
}

.item-table th,
.item-table td {
  padding: 5px 7px;
  font-size: 13px;
}

.item-table:not(.advance-item-table) {
  display: block;
  table-layout: fixed;
  width: 100%;
  min-width: 1334px;
}

.item-table:not(.advance-item-table) thead,
.item-table:not(.advance-item-table) tbody,
.item-table:not(.advance-item-table) tfoot {
  display: block;
  width: 100%;
}

.item-table:not(.advance-item-table) thead tr,
.item-table:not(.advance-item-table) tbody tr.item-main-row,
.item-table:not(.advance-item-table) tfoot tr.item-total-row {
  display: grid;
  grid-template-columns: 150px 150px 170px 120px 120px 120px minmax(300px, 1fr) 160px 44px;
  width: 100%;
  align-items: center;
}

.item-table:not(.advance-item-table) th,
.item-table:not(.advance-item-table) td {
  width: auto !important;
  min-width: 0;
}

.item-table:not(.advance-item-table) th:nth-child(1),
.item-table:not(.advance-item-table) td:nth-child(1) {
  width: 130px;
}

.item-table:not(.advance-item-table) th:nth-child(2),
.item-table:not(.advance-item-table) td:nth-child(2) {
  width: 130px;
}

.item-table:not(.advance-item-table) th:nth-child(3),
.item-table:not(.advance-item-table) td:nth-child(3) {
  width: 120px;
}

.item-table:not(.advance-item-table) th:nth-child(4),
.item-table:not(.advance-item-table) td:nth-child(4),
.item-table:not(.advance-item-table) th:nth-child(5),
.item-table:not(.advance-item-table) td:nth-child(5),
.item-table:not(.advance-item-table) th:nth-child(6),
.item-table:not(.advance-item-table) td:nth-child(6) {
  width: 100px;
}

.item-table:not(.advance-item-table) th:nth-child(7),
.item-table:not(.advance-item-table) td:nth-child(7) {
  width: auto;
}

.item-table:not(.advance-item-table) th:nth-child(8),
.item-table:not(.advance-item-table) td:nth-child(8) {
  width: 150px;
}

.item-table:not(.advance-item-table) th:nth-child(9),
.item-table:not(.advance-item-table) td:nth-child(9) {
  width: 40px;
  text-align: center;
}

.item-table:not(.advance-item-table) tfoot tr.item-total-row td:nth-child(1) {
  grid-column: 1 / 4;
}

.item-table:not(.advance-item-table) tfoot tr.item-total-row td:nth-child(2) {
  grid-column: 4;
}

.item-table:not(.advance-item-table) tfoot tr.item-total-row td:nth-child(3) {
  grid-column: 5;
}

.item-table:not(.advance-item-table) tfoot tr.item-total-row td:nth-child(4) {
  grid-column: 6;
}

.item-table:not(.advance-item-table) tfoot tr.item-total-row td:nth-child(5) {
  grid-column: 7 / 9;
}

.item-table:not(.advance-item-table) tfoot tr.item-total-row td:nth-child(6) {
  grid-column: 9;
}

.item-table input,
.item-table select {
  height: 34px;
  min-height: 32px;
  padding: 5px 8px;
  font-size: 13px;
  width: 100%;
  min-width: 0;
}

.item-table .description-input {
  min-width: 0;
}

.item-table .invoice-input {
  text-align: right;
  direction: ltr;
  font-variant-numeric: tabular-nums;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
}

.item-table .invoice-input:placeholder-shown {
  text-align: left;
}

.item-table .finance-category-placeholder {
  width: 100%;
}

.approval-form-like {
  display: grid;
  gap: 10px;
}

.approval-readonly-section {
  margin: 0;
}

.approval-readonly-grid {
  gap: 10px;
  padding: 0 14px 12px;
}

.approval-classification-strip {
  padding-top: 0;
  padding-bottom: 12px;
}

.approval-readonly-field {
  gap: 5px;
  font-size: 13px;
}

.approval-readonly-field > div,
.approval-readonly-textarea > div {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  padding: 7px 9px;
  color: var(--text);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.approval-readonly-textarea > div {
  min-height: 44px;
  font-weight: 700;
}

.approval-category-edit select {
  height: 32px;
  min-height: 32px;
  padding: 4px 8px;
}

.approval-readonly-field .approval-category-edit {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
}

.approval-readonly-field .approval-category-edit label {
  flex: 1 1 calc(50% - 4px);
  grid-template-columns: auto minmax(88px, 1fr);
  min-width: 0;
  gap: 6px;
  font-size: 12px;
}

.approval-readonly-field .approval-category-edit label:only-child {
  grid-template-columns: minmax(0, 1fr);
}

.approval-item-table-wrap {
  margin: 0;
}

.approval-item-table {
  display: table !important;
  table-layout: fixed;
  width: 100%;
  min-width: 1240px;
  border-collapse: collapse;
}

.item-table.approval-item-table:not(.advance-item-table) thead {
  display: table-header-group;
}

.item-table.approval-item-table:not(.advance-item-table) tbody {
  display: table-row-group;
}

.item-table.approval-item-table:not(.advance-item-table) tr {
  display: table-row;
}

.item-table.approval-item-table:not(.advance-item-table) th,
.item-table.approval-item-table:not(.advance-item-table) td {
  display: table-cell;
  width: auto !important;
  min-width: 0;
}

.approval-item-table th,
.approval-item-table td {
  padding: 6px 8px;
  font-size: 13px;
  line-height: 1.35;
  vertical-align: middle;
}

.approval-item-table:not(.advance-item-table) th:nth-child(1),
.approval-item-table:not(.advance-item-table) td:nth-child(1) {
  width: 120px !important;
}

.approval-item-table:not(.advance-item-table) th:nth-child(2),
.approval-item-table:not(.advance-item-table) td:nth-child(2) {
  width: 110px !important;
}

.approval-item-table:not(.advance-item-table) th:nth-child(3),
.approval-item-table:not(.advance-item-table) td:nth-child(3) {
  width: 220px !important;
}

.approval-item-table:not(.advance-item-table) th:nth-child(4),
.approval-item-table:not(.advance-item-table) td:nth-child(4),
.approval-item-table:not(.advance-item-table) th:nth-child(5),
.approval-item-table:not(.advance-item-table) td:nth-child(5),
.approval-item-table:not(.advance-item-table) th:nth-child(6),
.approval-item-table:not(.advance-item-table) td:nth-child(6) {
  width: 110px !important;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.approval-item-table:not(.advance-item-table) th:nth-child(7),
.approval-item-table:not(.advance-item-table) td:nth-child(7) {
  width: auto !important;
  min-width: 300px;
}

.approval-item-table:not(.advance-item-table) th:nth-child(8),
.approval-item-table:not(.advance-item-table) td:nth-child(8) {
  width: 160px !important;
}

.approval-item-table:not(.advance-item-table) td:nth-child(3) {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.approval-item-table:not(.advance-item-table) td:nth-child(7) {
  white-space: normal;
  word-break: break-word;
}

.approval-line-category-select {
  width: 100%;
  min-height: 32px;
  padding: 5px 8px;
  font-size: 13px;
}

.approval-item-table:not(.advance-item-table) .item-total-row td {
  text-align: right;
}

.approval-item-table:not(.advance-item-table) .item-total-row td:first-child {
  text-align: left;
}

.approval-attachment-section .section-head {
  border-bottom: 1px solid var(--line);
}

.approval-attachment-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 10px 12px 12px;
}

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

.approval-attachment-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 8px;
}

.approval-attachment-card h4 {
  margin: 0 0 6px;
  font-size: 13px;
  line-height: 1.3;
}

.approval-attachment-card .voucher-attachment-chip {
  grid-template-columns: auto 42px minmax(90px, 1fr) auto auto;
  min-height: 38px;
  padding: 5px 6px;
  gap: 5px;
}

.approval-attachment-card .attachment-badge {
  padding: 2px 6px;
  font-size: 10px;
}

.approval-attachment-card .attachment-row-preview {
  min-width: 38px;
  min-height: 26px;
  font-size: 11px;
}

.approval-attachment-card .attachment-file-name {
  max-width: 100%;
  font-size: 12px;
}

.approval-attachment-card .recognition-status,
.approval-attachment-card .attachment-action {
  font-size: 11px;
}

.approval-record-wrap {
  padding: 0 12px 12px;
}

.approval-record {
  grid-template-columns: 92px minmax(90px, 0.34fr) 108px minmax(0, 1fr);
  gap: 8px;
  padding: 7px 9px;
  border-radius: 8px;
}

.approval-history-lines {
  gap: 4px;
}

.approval-history-lines div {
  grid-template-columns: 126px minmax(0, 1fr);
  gap: 8px;
}

.approval-workflow-bottom .workflow-panel {
  margin: 0;
}

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

.dynamic-fields {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  padding: 0 16px 16px;
}

.dynamic-fields.travel-fields::before {
  content: "差旅信息";
  grid-column: 1 / -1;
  color: var(--text);
  font-size: 14px;
  font-weight: 900;
  line-height: 1.2;
  margin-bottom: -4px;
}

.wide-field {
  padding: 0 16px 16px;
}

.approval-preview {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  border: 1px solid #cfe0ff;
  border-radius: 8px;
  background: #f6faff;
  padding: 14px;
}

.approval-preview h3 {
  font-size: 16px;
}

.approval-preview span {
  color: var(--muted);
  font-size: 13px;
}

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

.approval-chain span {
  display: flex;
  min-height: 34px;
  align-items: center;
  flex-direction: column;
  justify-content: center;
  border: 1px solid #cfe0ff;
  border-radius: 8px;
  background: #fff;
  color: #245087;
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

.approval-chain strong,
.approval-chain small {
  display: block;
}

.approval-chain small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.advance-offset-panel {
  margin: 0;
  border: 1px solid #cfe0ff;
  border-radius: 8px;
  background: #f6faff;
  padding: 14px;
}

.advance-offset-panel.warning {
  border-color: #efc06d;
  background: #fff9ea;
}

.advance-offset-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.advance-offset-head span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.advance-offset-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  align-items: end;
}

.money-preview-input {
  background: #f8fbff;
  color: var(--text);
  font-weight: 800;
}

.money-preview-input.emphasis {
  color: var(--primary-dark);
}

.advance-flow-list {
  margin-top: 10px;
}

.advance-offset-list {
  display: grid;
  gap: 6px;
  border: 1px solid #cfe0ff;
  border-radius: 8px;
  background: #fff;
  padding: 8px;
}

.advance-offset-list-head,
.advance-offset-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 180px auto;
  gap: 10px;
  align-items: center;
}

.advance-offset-list-head {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  padding: 0 4px 4px;
}

.advance-offset-list-head strong {
  color: var(--text);
}

.advance-offset-row {
  min-height: 44px;
  border-radius: 7px;
  background: #f8fbff;
  padding: 6px 8px;
}

.advance-offset-row strong,
.advance-offset-row span {
  display: block;
}

.advance-offset-row span {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.advance-offset-row label {
  display: grid;
  gap: 3px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.advance-offset-row input {
  width: 100%;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 5px 8px;
  font-size: 13px;
  font-weight: 800;
}

.advance-flow-empty,
.advance-flow-card {
  border: 1px solid #cfe0ff;
  border-radius: 8px;
  background: #fff;
  padding: 12px;
}

.advance-flow-empty {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.advance-flow-card {
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.advance-flow-card:hover,
.advance-flow-card.selected {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(22, 119, 255, 0.12);
}

.advance-flow-card.unavailable {
  background: #f8fafc;
  color: var(--text);
  cursor: not-allowed;
  opacity: 0.76;
}

.advance-flow-card.unavailable:hover {
  border-color: #cfe0ff;
  box-shadow: none;
}

.advance-flow-card.unavailable .advance-flow-card-head span {
  color: var(--amber);
}

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

.advance-flow-card-head span {
  color: var(--primary-dark);
  font-size: 12px;
  font-weight: 800;
}

.advance-flow-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 10px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.advance-mini-workflow {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 5px;
  margin-top: 10px;
}

.advance-mini-workflow span {
  border-radius: 6px;
  background: var(--surface-soft);
  color: var(--muted);
  padding: 5px;
  font-size: 11px;
  font-weight: 800;
  text-align: center;
}

.advance-mini-workflow span.done {
  background: #eef9f2;
  color: var(--accent);
}

.advance-flow-card p {
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.finance-ledger-table {
  width: max-content;
  min-width: 1510px;
  border-collapse: separate;
  border-spacing: 0;
}

.finance-ledger-table-wrap {
  position: relative;
  width: 100%;
  max-width: 100%;
  max-height: max(320px, calc(100vh - 390px));
  overflow: auto;
  background: #fff;
  scrollbar-gutter: stable;
}

.finance-ledger-table thead th {
  position: sticky;
  top: 0;
  z-index: 4;
  background: #f8fafc;
  box-shadow: inset 0 -1px 0 var(--line);
}

.finance-ledger-table tbody td {
  background: #fff;
}

.finance-ledger-table tbody tr.selected-ledger-row td {
  background: #f5f9ff;
}

.finance-ledger-table tbody tr:hover td {
  background: var(--surface-blue);
}

.item-section {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.item-section-head {
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--surface-soft);
  border-bottom: 1px solid var(--line);
}

.item-table th,
.item-table td {
  padding: 6px 8px;
}

.item-table th {
  font-size: 12px;
  line-height: 1.2;
}

.item-table input,
.item-table select {
  min-width: 104px;
  min-height: 34px;
  height: 36px;
  padding: 5px 9px;
  border-radius: 8px;
  font-size: 14px;
}

.item-table .description-input {
  min-width: 150px;
}

.item-table .total-amount-input {
  min-width: 104px;
  font-weight: 800;
}

.item-table .invoice-input {
  min-width: 126px;
  direction: ltr;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.item-table .icon-button {
  width: 30px;
  height: 30px;
}

.item-table.advance-item-table {
  table-layout: fixed;
  min-width: 0;
}

.advance-item-table th,
.advance-item-table td {
  padding: 8px 7px;
}

.advance-item-table input,
.advance-item-table select {
  width: 100%;
  min-width: 0;
  height: 42px;
  padding: 6px 9px;
  font-size: 14px;
}

.advance-item-table .description-input {
  min-width: 0;
}

.advance-item-table th:nth-child(1),
.advance-item-table td:nth-child(1),
.advance-item-table th:nth-child(4),
.advance-item-table td:nth-child(4) {
  width: 16%;
}

.advance-item-table th:nth-child(2),
.advance-item-table td:nth-child(2),
.advance-item-table th:nth-child(5),
.advance-item-table td:nth-child(5) {
  width: 14%;
}

.advance-item-table th:nth-child(3),
.advance-item-table td:nth-child(3),
.advance-item-table th:nth-child(6),
.advance-item-table td:nth-child(6) {
  width: 18%;
}

.advance-item-table th:nth-child(7),
.advance-item-table td:nth-child(7) {
  width: 4%;
  text-align: center;
}

.advance-detail-line span {
  color: #526170;
}

.attachment-control {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 260px;
}

.upload-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  border: 1px solid #9cc7ff;
  border-radius: 8px;
  background: #f0f6ff;
  color: #124782;
  padding: 7px 12px;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
  cursor: pointer;
}

.upload-button input {
  display: none;
}

.attachment-name {
  max-width: 260px;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attachment-action {
  min-height: 28px;
  padding: 4px 8px;
  font-size: 12px;
}

.field-invalid {
  outline: 2px solid #ef4444;
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.12);
}

tr.field-invalid > td {
  background: #fff1f2;
}

.recognition-status {
  display: inline-flex;
  width: fit-content;
  max-width: 72px;
  min-height: 22px;
  align-items: center;
  border-radius: 999px;
  background: #ecfdf3;
  color: #0f6b3d;
  padding: 2px 7px;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.voucher-upload-panel {
  border-top: 1px solid var(--line);
  background: #fbfcfe;
  padding: 10px 16px;
}

.voucher-upload-panel.hidden {
  display: none;
}

.voucher-upload-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

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

.voucher-upload-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.voucher-upload-grid.support-only-grid {
  grid-template-columns: 1fr;
}

.voucher-upload-card {
  display: grid;
  align-content: start;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 10px;
}

.voucher-upload-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.voucher-upload-head h4 {
  margin: 0;
  font-size: 14px;
}

.compact-voucher-card h4 {
  margin: 0;
  font-size: 13px;
}

.compact-voucher-card {
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: 6px;
}

.compact-voucher-card h4 {
  grid-column: 1;
  color: var(--muted);
  white-space: nowrap;
}

.compact-voucher-card .voucher-attachment-list,
.compact-voucher-card .upload-empty {
  grid-column: 1;
}

.inline-duplicate-panel {
  grid-column: 1 / -1;
  margin-top: 2px;
  padding: 8px 10px;
  font-size: 12px;
  line-height: 1.4;
}

.inline-duplicate-panel:empty {
  display: none;
}

.inline-duplicate-panel ul {
  margin-top: 5px;
}

.voucher-upload-head span,
.upload-empty {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.upload-empty {
  border: 1px dashed #cbd6e2;
  border-radius: 8px;
  background: #f8fafc;
  padding: 8px 10px;
}

.compact-voucher-card .upload-empty {
  display: flex;
  min-height: 42px;
  align-items: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.voucher-upload-summary {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  border: 1px solid #d8e6f4;
  border-radius: 8px;
  background: #f5f9fd;
  padding: 8px 10px;
}

.voucher-upload-summary span,
.voucher-upload-summary strong {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 6px;
  background: #fff;
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 800;
}

.voucher-upload-summary strong {
  margin-left: auto;
  color: var(--primary);
}

.voucher-upload-toolbar .voucher-upload-summary {
  margin-left: auto;
  padding: 6px 8px;
}

.attachment-list {
  display: flex;
  align-items: stretch;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
}

.attachment-chip {
  display: grid;
  width: 178px;
  align-content: start;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 8px;
}

.voucher-attachment-list {
  display: grid;
  gap: 6px;
  margin-top: 0;
}

.voucher-attachment-chip {
  display: grid;
  grid-template-columns: auto 44px minmax(96px, 1fr) auto auto;
  width: 100%;
  min-height: 48px;
  align-items: center;
  gap: 6px;
  border-radius: 8px;
  padding: 6px 8px;
}

.attachment-badge {
  display: inline-flex;
  width: fit-content;
  border-radius: 999px;
  background: #eef5ff;
  color: #245087;
  padding: 3px 8px;
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
  white-space: nowrap;
}

.attachment-thumb {
  display: inline-grid;
  width: 100%;
  min-height: 102px;
  margin-top: 0;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  cursor: pointer;
  gap: 5px;
  justify-items: center;
  text-align: center;
}

.attachment-thumb:hover {
  border-color: #8bbdff;
  box-shadow: 0 8px 18px rgba(18, 71, 130, 0.12);
}

.attachment-thumb img {
  display: block;
  width: 100%;
  height: 76px;
  border-radius: 6px;
  background: #f6f8fb;
  object-fit: contain;
}

.attachment-thumb span {
  overflow: hidden;
  max-width: 100%;
  font-size: 12px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attachment-file-tile {
  display: grid;
  min-height: 102px;
  width: 100%;
  place-items: center;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  color: var(--text);
  cursor: pointer;
  padding: 10px;
  text-align: center;
}

.attachment-file-tile:hover {
  border-color: #8bbdff;
  box-shadow: 0 8px 18px rgba(18, 71, 130, 0.12);
}

.attachment-file-tile strong {
  font-size: 18px;
}

.attachment-file-tile span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.attachment-file-tile.missing {
  cursor: default;
  opacity: 0.75;
}

.attachment-file-tile.missing:hover {
  border-color: var(--line);
  box-shadow: none;
}

.attachment-row-preview {
  display: inline-flex;
  min-width: 46px;
  min-height: 30px;
  align-items: center;
  justify-content: center;
  border: 1px solid #cbdff8;
  border-radius: 7px;
  background: #f3f8ff;
  color: #124782;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.attachment-row-preview:hover {
  border-color: #8bbdff;
  background: #edf5ff;
}

.attachment-row-preview.missing {
  cursor: not-allowed;
  opacity: 0.7;
}

.attachment-row-main {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 6px;
}

.attachment-chip-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 5px;
}

.attachment-chip-actions > * {
  flex: 0 0 auto;
}

.item-upload-row td {
  background: #fbfdff;
  padding-top: 0;
}

.attachment-link {
  color: var(--primary);
  font-weight: 800;
  text-decoration: none;
}

.attachment-view {
  display: inline-flex;
  max-width: 100%;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.attachment-inline-preview {
  display: inline-flex;
  max-width: 100%;
  min-height: 28px;
  align-items: center;
  gap: 6px;
  border: 1px solid #cbdff8;
  border-radius: 7px;
  background: #f3f8ff;
  color: #124782;
  padding: 3px 8px;
  font-size: 12px;
  font-weight: 900;
  vertical-align: middle;
}

.attachment-inline-preview:hover {
  border-color: var(--primary);
  background: #edf5ff;
}

.attachment-inline-preview span {
  overflow: hidden;
  max-width: 220px;
  margin: 0;
  color: inherit;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attachment-inline-preview em {
  color: var(--primary);
  font-size: 11px;
  font-style: normal;
  white-space: nowrap;
}

.attachment-inline-preview.missing {
  border-color: #ead6aa;
  background: #fffaf0;
  color: #85621a;
}

.attachment-inline-preview.missing em {
  color: #9a5b00;
}

.attachment-file-name {
  max-width: 240px;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.voucher-attachment-chip .attachment-file-name {
  max-width: 100%;
  color: var(--text);
  font-size: 12px;
}

.recognition-status.muted {
  color: var(--muted);
}

.attachment-note {
  display: inline-block;
  margin-left: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.item-total-row td {
  border-top: 2px solid var(--line);
  background: #f8fafc;
  color: var(--text);
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
}

.payment-attachments-panel {
  display: grid;
  gap: 10px;
  margin: 14px 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 12px;
}

.payment-attachments-panel h3 {
  margin: 0;
  font-size: 15px;
}

.icon-button {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--danger);
  font-weight: 900;
}

.duplicate-panel {
  border: 1px solid #b9dcc8;
  border-radius: 8px;
  background: #f3fbf6;
  color: #0f513e;
  padding: 12px 14px;
  font-weight: 800;
}

.duplicate-panel.warning {
  border-color: #efb7b1;
  background: #fff5f4;
  color: var(--danger);
}

.duplicate-panel ul {
  margin: 8px 0 0;
  padding-left: 18px;
  font-weight: 600;
}

.form-summary {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 18px;
  border-radius: 8px;
  background: var(--surface-soft);
  padding: 16px;
}

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

.form-summary strong {
  display: block;
  margin-top: 4px;
  font-size: 24px;
}

.invoice-tools {
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.invoice-pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 10px 16px 14px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.invoice-pagination label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text);
  white-space: nowrap;
}

.invoice-pagination select {
  min-height: 32px;
  padding: 5px 8px;
  font-size: 13px;
  font-weight: 800;
}

.tool-strip {
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.report-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  padding: 16px;
}

.backup-status-panel {
  display: grid;
  gap: 10px;
  margin: 0 16px 16px;
  border: 1px solid #cbdff8;
  border-radius: 8px;
  background: #f5f9ff;
  padding: 12px;
}

.backup-status-panel strong,
.backup-status-panel span,
.backup-status-panel small {
  display: block;
}

.backup-status-panel span,
.backup-status-panel small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.55;
}

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

.backup-status-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 10px;
}

.report-block {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  padding: 16px;
}

.bar-row {
  display: grid;
  grid-template-columns: minmax(90px, 160px) 1fr auto;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
}

.bar-track {
  height: 12px;
  border-radius: 999px;
  background: #e4e9ed;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: inherit;
  background: var(--primary);
}

.bar-row:nth-child(3n) .bar-fill {
  background: var(--accent);
}

.bar-row:nth-child(4n) .bar-fill {
  background: #6d7f95;
}

.empty-report {
  margin: 12px 0 0;
  color: var(--muted);
}

.account-form {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr)) auto;
  gap: 14px;
  align-items: end;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  padding: 16px;
}

.info-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--surface-soft);
}

.info-block {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  overflow: hidden;
}

.wide-info-block {
  grid-column: 1 / -1;
}

.maintenance-split {
  display: grid;
  grid-template-columns: minmax(260px, 0.8fr) minmax(0, 1.2fr);
  gap: 14px;
  padding: 0 16px 16px;
}

.maintenance-pane {
  min-width: 0;
}

.maintenance-pane h4 {
  margin: 0 0 10px;
  font-size: 15px;
}

.history-import-pane {
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.import-template-status {
  margin: 0 16px 16px;
  border: 1px solid #b9dcc8;
  border-radius: 8px;
  background: #f3fbf6;
  color: #0f513e;
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.5;
  outline: none;
}

.import-template-status:empty {
  display: none;
}

.invoice-panel > .import-template-status {
  margin-top: 12px;
}

.import-template-status.template-status-pulse {
  box-shadow: 0 0 0 3px rgba(24, 160, 88, 0.14);
}

.compact-head {
  padding-top: 0;
}

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

.compact-form {
  padding: 0 0 12px;
}

.employee-form,
.category-form {
  display: grid;
  gap: 12px;
  align-items: end;
  padding: 0 16px 16px;
}

.employee-form {
  grid-template-columns: repeat(5, minmax(0, 1fr)) auto;
  padding: 0 0 12px;
}

.category-form {
  grid-template-columns: minmax(180px, 0.6fr) minmax(220px, 1fr) auto;
}

.info-actions {
  padding: 0 16px 16px;
}

.small-button {
  min-height: 32px;
  padding: 5px 9px;
  font-size: 12px;
}

.table-actions {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  align-items: center;
  white-space: nowrap;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 20;
  max-width: min(360px, calc(100vw - 44px));
  border: 1px solid #b9dcc8;
  border-radius: 8px;
  background: #f3fbf6;
  color: #0f513e;
  padding: 12px 14px;
  box-shadow: var(--shadow);
  font-weight: 800;
}

@media (max-width: 1360px) {
  .app-shell {
    grid-template-columns: 200px minmax(0, 1fr);
  }

  .app-shell::before {
    width: 200px;
  }

  .main-panel {
    padding: 18px 18px 26px;
  }

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

  .topbar-title {
    grid-column: 1;
    grid-row: 1;
  }

  .topbar-koala {
    grid-column: 2;
    grid-row: 1;
    align-self: center;
  }

  .global-search,
  .topbar > .topbar-actions {
    grid-column: 1 / -1;
    width: 100%;
  }

  .topbar > .topbar-actions {
    flex-wrap: wrap;
    justify-content: flex-start;
    justify-self: stretch;
  }

  .panel-head {
    flex-wrap: wrap;
  }

  .filter-stack {
    width: 100%;
    justify-items: stretch;
  }

  .filter-row {
    width: 100%;
    justify-content: flex-start;
  }

  .filter-row select {
    flex: 0 1 150px;
    width: auto;
  }

  .filter-row input {
    flex: 1 1 240px;
    width: auto;
    min-width: 0;
  }

  .search-field-row {
    max-width: none;
    justify-content: flex-start;
  }

  .metrics-grid {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  }

  .pending-flow-grid {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  }

  .ledger-filter-row {
    width: 100%;
    grid-template-columns: repeat(auto-fit, minmax(176px, 1fr));
    justify-content: stretch;
    white-space: normal;
  }

  .accounting-filter-line,
  .accounting-action-line,
  .accounting-subject-filter-line,
  .accounting-control-grid.draft-layout .accounting-action-line,
  .accounting-control-grid.sync-layout .accounting-action-line,
  .accounting-control-grid.manual-voucher-layout .accounting-action-line,
  .accounting-control-grid.voucher-layout .accounting-action-line,
  .accounting-control-grid.opening-layout .accounting-action-line,
  .accounting-control-grid.period-close-layout .accounting-action-line,
  .accounting-control-grid.report-layout .accounting-action-line,
  .accounting-control-grid.voucher-layout .accounting-filter-line,
  .accounting-control-grid.formal-report-layout .accounting-filter-line {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  }

  .accounting-filter-line .accounting-search-field.in-filter-line,
  #accountingAuxiliaryTypeLabel,
  #accountingAuxiliaryItemLabel,
  #accountingAuxiliaryTypeFilter,
  #accountingAuxiliaryItemFilter {
    min-width: 0;
  }
}

@media (max-width: 1180px) {
  .content-grid {
    grid-template-columns: 1fr;
  }

  .quick-type-grid,
  .form-type-grid {
    grid-template-columns: 1fr;
  }

  .pending-flow-grid,
  .metrics-grid {
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  }

  .detail-panel {
    min-height: auto;
  }
}

@media (max-width: 860px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .app-shell::before {
    display: none;
  }

  .sidebar {
    position: static;
    height: auto;
    min-height: auto;
    gap: 14px;
    overflow-y: visible;
    padding: 14px;
  }

  .nav-list {
    grid-template-columns: 1fr;
  }

  .nav-group-title {
    grid-column: 1 / -1;
    margin-top: 6px;
  }

  .nav-item {
    text-align: left;
  }

  .main-panel {
    padding: 14px;
  }

  .topbar,
  .panel-head,
  .form-summary,
  .section-head {
    align-items: stretch;
    flex-direction: column;
  }

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

  .topbar-title {
    grid-column: 1;
    grid-row: 1;
  }

  .topbar-koala {
    grid-column: 2;
    grid-row: 1;
    align-self: center;
    justify-self: end;
    margin-left: 0;
  }

  .global-search,
  .filter-stack {
    width: 100%;
    max-width: none;
  }

  .global-search {
    grid-column: 1 / -1;
    flex-wrap: wrap;
  }

  .global-search input {
    min-width: 180px;
  }

  .search-field-row {
    justify-content: flex-start;
  }

  .topbar-actions,
  .form-actions,
  .guide-actions,
  .filter-row,
  .tool-strip {
    width: 100%;
  }

  .topbar > .topbar-actions {
    grid-column: 1 / -1;
    justify-self: stretch;
  }

  .topbar-actions > *,
  .form-actions > *,
  .guide-actions > *,
  .filter-row > *,
  .tool-strip > * {
    flex: 1 1 150px;
  }

  .ledger-filter-row {
    width: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    justify-content: stretch;
  }

  .ledger-filter-row button {
    width: 100%;
  }

  .accounting-control-grid {
    width: 100%;
    max-width: none;
    grid-template-columns: 1fr;
  }

  .accounting-subject-filter-line {
    grid-template-columns: 1fr;
  }

  .accounting-check-option {
    justify-content: flex-start;
  }

  .accounting-period-strip {
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
  }

  .accounting-period-strip #accountingArchiveTree,
  .accounting-tree-year {
    display: grid;
    gap: 6px;
    align-items: stretch;
  }

  .accounting-tree-year summary {
    display: block;
  }

  .accounting-tree-months {
    display: grid;
  }

  .accounting-tree-month-summary,
  .accounting-tree-vouchers button {
    width: 100%;
  }

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

  .accounting-action-line .accounting-search-field {
    grid-column: 1 / -1;
  }

  .accounting-control-grid.archive-layout button {
    width: 100%;
  }

  .accounting-control-grid .accounting-tree-month-summary,
  .accounting-control-grid .accounting-tree-vouchers button {
    width: 100%;
  }

  .form-grid,
  .dynamic-fields,
  .advance-offset-grid,
  .advance-flow-list,
  .advance-flow-meta,
  .backup-status-grid,
  .approval-preview,
  .approval-chain,
  .account-form,
  .employee-form,
  .category-form,
  .maintenance-split,
  .info-grid,
  .inline-form,
  .report-grid,
  .detail-meta,
  .detail-total,
  .meta-row,
  .workflow-bar,
  .paperless-status,
  .voucher-upload-grid {
    grid-template-columns: 1fr;
  }

  .voucher-upload-head,
  .voucher-upload-summary {
    align-items: stretch;
    flex-direction: column;
  }

  .voucher-upload-summary strong {
    margin-left: 0;
  }

  .quick-type-grid,
  .form-type-grid,
  .metrics-grid {
    grid-template-columns: 1fr;
  }

  .workflow-panel-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .modal-backdrop {
    padding: 10px;
  }

  .claim-modal-panel,
  .attachment-preview-panel {
    width: calc(100vw - 20px);
    max-height: calc(100vh - 20px);
  }

  .modal-head,
  .claim-modal-summary {
    align-items: stretch;
    flex-direction: column;
  }

  .modal-detail-meta,
  .modal-detail-total {
    grid-template-columns: 1fr;
  }

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

  .claim-modal-actions > * {
    flex: 1 1 140px;
  }

  .attachment-preview-body {
    min-height: 320px;
  }
}

