:root {
  --bg: #f5f7f8;
  --surface: #ffffff;
  --surface-soft: #f8fafb;
  --line: #dce3e8;
  --text: #17212b;
  --muted: #66727f;
  --blue: #246baf;
  --blue-dark: #164a7b;
  --jade: #16856f;
  --amber: #b7791f;
  --danger: #b42318;
  --shadow: 0 10px 30px rgba(21, 39, 54, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  font-size: 14px;
}

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

button {
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-columns: 232px 1fr;
  min-height: 100vh;
}

.sidebar {
  background: #102638;
  color: #edf5f7;
  padding: 18px 14px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 8px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}

.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: #e8f1f6;
  color: #102638;
  font-weight: 800;
}

.brand-title {
  font-size: 18px;
  font-weight: 800;
}

.brand-subtitle {
  font-size: 12px;
  color: #a9bac5;
  margin-top: 2px;
}

.nav-list {
  display: grid;
  gap: 4px;
  margin-top: 18px;
}

.nav-item {
  border: 0;
  width: 100%;
  height: 40px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 10px;
  color: #dce8ee;
  background: transparent;
  border-radius: 7px;
  text-align: left;
}

.nav-item span {
  display: grid;
  place-items: center;
  width: 36px;
  height: 24px;
  color: #8fb5ca;
  font-size: 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 6px;
}

.nav-item:hover,
.nav-item.active {
  background: #1c3e58;
  color: #ffffff;
}

.main {
  min-width: 0;
  padding: 18px 22px 28px;
}

.topbar {
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 14px;
}

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

h1,
h2,
h3 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: 22px;
  margin-top: 4px;
}

h2 {
  font-size: 16px;
}

h3 {
  font-size: 13px;
  color: var(--muted);
  margin: 18px 0 8px;
}

.top-actions,
.panel-head,
.mini-actions,
.summary-strip {
  display: flex;
  align-items: center;
  gap: 10px;
}

.top-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.status-pill,
.file-pill {
  display: inline-flex;
  align-items: center;
  height: 30px;
  padding: 0 10px;
  border-radius: 6px;
  background: #e8f3ef;
  color: var(--jade);
  font-size: 13px;
  white-space: nowrap;
}

.file-pill {
  background: #eef3f7;
  color: #385166;
}

.muted {
  background: #f0f3f5;
  color: var(--muted);
}

.primary-button,
.ghost-button,
.line-button,
.text-button,
.icon-button {
  border: 0;
  height: 34px;
  border-radius: 7px;
  padding: 0 12px;
  background: var(--blue);
  color: #ffffff;
}

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

.ghost-button,
.line-button {
  color: var(--blue);
  background: #eef5fb;
  border: 1px solid #c9dceb;
}

.line-button {
  height: 32px;
}

.small-button {
  height: 28px;
  padding: 0 9px;
  font-size: 12px;
}

.text-button {
  height: auto;
  padding: 0;
  color: var(--blue);
  background: transparent;
}

.link-cell {
  border: 0;
  padding: 0;
  height: auto;
  color: var(--blue);
  background: transparent;
  font-weight: 700;
  text-align: left;
}

.link-cell:hover {
  text-decoration: underline;
}

.number-link {
  min-width: 28px;
  text-align: right;
}

.reference-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 4px 0 12px;
}

.reference-chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 7px;
  background: #eef5fb;
  color: #0f4f82;
  font-weight: 700;
  font-size: 12px;
}

.reference-chip.muted {
  background: #f0f3f5;
  color: var(--muted);
}

.income-selection-sum {
  background: #e8f7ef;
  color: #11683b;
  border-color: #b9e4c9;
}

.subject-sales-subject-row {
  background: #f7fbfe;
  font-weight: 800;
}

.subject-sales-detail-row td:first-child {
  color: #55707d;
}

.detail-indent {
  display: inline-block;
  padding-left: 18px;
}

.mini-row-label {
  margin-left: 8px;
  font-size: 11px;
  font-weight: 600;
}

.selectable-sum-cell {
  cursor: crosshair;
  user-select: none;
}

.selected-sum-cell {
  background: #d7ebff !important;
  outline: 1px solid #1a7fd8;
  outline-offset: -1px;
}

.sticky-income-panel {
  overflow: visible;
}

.income-sticky-head {
  position: static;
  background: #ffffff;
  margin-bottom: 4px;
  padding-bottom: 4px;
}

.income-sticky-filter {
  position: static;
  background: #ffffff;
  padding: 4px 0 10px;
  margin-bottom: 0;
}

#view-incomeFiling .income-filing-panel {
  height: calc(100vh - 112px);
  min-height: 720px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#view-incomeFiling .income-filing-panel[hidden],
#view-incomeFiling .income-filing-entry-page[hidden] {
  display: none !important;
}

#view-incomeFiling .sticky-table-wrap {
  flex: 1;
  height: calc(100vh - 260px);
  max-height: calc(100vh - 260px);
  min-height: 560px;
}

#view-incomeFiling .rolling-sales-table-wrap {
  height: calc(100vh - 260px);
  max-height: calc(100vh - 260px);
}

#view-incomeFiling .income-filing-entry-page {
  height: calc(100vh - 190px);
  min-height: 560px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#view-incomeFiling .income-filing-entry-table-wrap {
  flex: 1;
  height: calc(100vh - 350px);
  max-height: calc(100vh - 350px);
  min-height: 380px;
}

.sticky-table-wrap {
  max-height: min(390px, calc(100vh - 330px));
  overflow: auto;
}

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

.rolling-sales-table-wrap {
  max-height: min(390px, calc(100vh - 330px));
}

.rolling-sales-table {
  min-width: 1720px;
  table-layout: fixed;
}

.rolling-sales-table th,
.rolling-sales-table td {
  white-space: nowrap;
}

.rolling-sales-table th:nth-child(1),
.rolling-sales-table td:nth-child(1) {
  left: 0;
  width: 54px;
  min-width: 54px;
  max-width: 54px;
}

.rolling-sales-table th:nth-child(2),
.rolling-sales-table td:nth-child(2) {
  left: 54px;
  width: 96px;
  min-width: 96px;
  max-width: 96px;
}

.rolling-sales-table th:nth-child(3),
.rolling-sales-table td:nth-child(3) {
  left: 150px;
  width: 120px;
  min-width: 120px;
  max-width: 120px;
}

.rolling-sales-table th:nth-child(4),
.rolling-sales-table td:nth-child(4) {
  left: 270px;
  width: 168px;
  min-width: 168px;
  max-width: 168px;
}

.rolling-sales-table th:nth-child(1),
.rolling-sales-table th:nth-child(2),
.rolling-sales-table th:nth-child(3),
.rolling-sales-table th:nth-child(4),
.rolling-sales-table td:nth-child(1),
.rolling-sales-table td:nth-child(2),
.rolling-sales-table td:nth-child(3),
.rolling-sales-table td:nth-child(4) {
  position: sticky;
  background: #ffffff;
  box-shadow: 1px 0 0 var(--line);
}

.rolling-sales-table th:nth-child(1),
.rolling-sales-table th:nth-child(2),
.rolling-sales-table th:nth-child(3),
.rolling-sales-table th:nth-child(4) {
  top: 0;
  z-index: 24;
  background: #fff5d8;
}

.rolling-sales-table td:nth-child(1),
.rolling-sales-table td:nth-child(2),
.rolling-sales-table td:nth-child(3),
.rolling-sales-table td:nth-child(4) {
  z-index: 16;
}

.rolling-sales-table .total-row td:nth-child(1),
.rolling-sales-table .total-row td:nth-child(2),
.rolling-sales-table .total-row td:nth-child(3),
.rolling-sales-table .total-row td:nth-child(4) {
  background: #fff0c2;
}

.income-filing-entry-mode .module-hero,
.income-filing-entry-mode > .panel:not(.income-filing-entry-page) {
  display: none;
}

.income-filing-entry-page {
  min-height: auto;
}

.income-filing-entry-table-wrap {
  max-height: min(420px, calc(100vh - 300px));
  overflow: auto;
}

@media (max-height: 760px) {
  .sticky-table-wrap,
  .rolling-sales-table-wrap,
  .income-filing-entry-table-wrap {
    max-height: 340px;
  }
}

.income-filing-entry-table {
  table-layout: fixed;
  width: 100%;
}

.income-filing-shop-entry-table {
  min-width: 1210px;
}

.income-filing-quarter-entry-table {
  width: auto;
  min-width: 820px;
  max-width: 900px;
}

.income-filing-rolling-entry-table {
  width: auto;
  min-width: 820px;
  max-width: 940px;
}

.income-filing-quarter-entry-table .quarter-subject-col {
  width: 170px;
}

.income-filing-quarter-entry-table .quarter-money-col {
  width: 118px;
}

.income-filing-rolling-entry-table .rolling-subject-col {
  width: 150px;
}

.income-filing-rolling-entry-table .rolling-shop-col {
  width: 140px;
}

.income-filing-rolling-entry-table .rolling-account-col {
  width: 190px;
}

.income-filing-rolling-entry-table .rolling-money-col {
  width: 112px;
}

.income-filing-entry-table th,
.income-filing-entry-table td {
  padding: 4px 6px;
}

.income-filing-quarter-entry-table th,
.income-filing-quarter-entry-table th.number,
.income-filing-rolling-entry-table th,
.income-filing-rolling-entry-table th.number {
  text-align: left;
}

.income-filing-quarter-entry-table td,
.income-filing-rolling-entry-table td {
  text-align: left;
}

.income-filing-quarter-entry-table .dense-money-input,
.income-filing-rolling-entry-table .dense-money-input {
  display: block;
  width: 96px;
  margin: 0;
  text-align: right;
}

.sticky-shop-entry-cell {
  position: sticky;
  left: 0;
  z-index: 2;
  width: 132px;
  background: #ffffff;
  font-weight: 700;
}

.income-filing-shop-entry-table th:nth-child(2),
.income-filing-shop-entry-table td:nth-child(2) {
  width: 132px;
}

.income-filing-shop-entry-table th.number,
.income-filing-shop-entry-table td:not(:nth-child(-n+2)) {
  width: 82px;
}

.income-filing-entry-table .truncate-text {
  max-width: 100%;
}

.income-filing-entry-table thead .sticky-shop-entry-cell {
  z-index: 3;
}

.dense-money-input {
  width: 86px;
  height: 28px;
  border: 1px solid #d7e1ea;
  border-radius: 4px;
  padding: 0 6px;
  text-align: right;
  font-size: 12px;
}

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

.icon-button {
  width: 32px;
  padding: 0;
  color: var(--muted);
  background: #eef2f4;
  font-size: 20px;
}

.view-tabs {
  display: flex;
  gap: 4px;
  margin: 8px 0 16px;
  border-bottom: 1px solid var(--line);
}

.tab-button {
  height: 38px;
  padding: 0 16px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--muted);
}

.tab-button.active {
  color: var(--blue);
  border-bottom-color: var(--blue);
  font-weight: 700;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(620px, 1fr) minmax(260px, 320px);
  gap: 14px;
}

.workspace,
.split-row,
.master-data-layout,
.chart-grid,
.factory-layout {
  display: grid;
  gap: 14px;
}

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

.master-data-layout {
  grid-template-columns: 1fr;
}

.master-data-layout .table-wrap table {
  table-layout: fixed;
}

.master-data-layout th:last-child,
.master-data-layout td:last-child {
  width: 150px;
}

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

.base-menu-card {
  display: grid;
  gap: 8px;
  min-height: 118px;
  padding: 16px;
  text-align: left;
  border: 1px solid #d7e3e9;
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
  cursor: pointer;
  box-shadow: inset 3px 0 0 var(--amber);
}

.base-menu-card:hover,
.base-menu-card.active {
  background: #f4fbf8;
  border-color: #8ac8a4;
  box-shadow: inset 4px 0 0 #15803d;
}

.base-menu-card strong {
  font-size: 16px;
}

.base-menu-card span {
  color: var(--muted);
  line-height: 1.5;
}

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

.compact-actions {
  gap: 6px;
  min-width: 260px;
}

.mini-select {
  width: auto;
  min-width: 118px;
  height: 30px;
  padding: 0 8px;
  font-size: 12px;
}

.transaction-filter-bar {
  display: grid;
  grid-template-columns: minmax(112px, 136px) minmax(112px, 136px) minmax(180px, 260px) 72px auto auto;
  align-items: end;
  gap: 8px;
  margin: 10px 0 12px;
  padding: 10px;
  border: 1px solid #f0dfbd;
  border-radius: 8px;
  background: #fffaf0;
  box-shadow: 0 10px 24px rgba(125, 85, 20, 0.10);
}

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

.transaction-filter-bar .search-input {
  width: 100%;
  max-width: 260px;
}

.filter-action-button {
  min-height: 32px;
  height: 32px;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 800;
}

.transaction-filter-meta {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 18px;
  padding: 0 2px;
  color: #7a5a22;
  font-size: 12px;
  font-weight: 800;
}

.transaction-filter-meta span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.transaction-pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 14px;
}

.compact-page-size {
  width: 118px;
  min-width: 118px;
  height: 36px;
  font-weight: 700;
}

.compact-page-button {
  width: 36px;
  height: 36px;
  padding: 0;
  font-size: 22px;
  line-height: 1;
}

.page-number-input {
  width: 64px;
  height: 36px;
  border: 1px solid #e3c990;
  border-radius: 7px;
  background: #fffdf7;
  color: var(--text);
  text-align: center;
  font-weight: 800;
}

.page-total-text {
  min-width: 36px;
  color: #5f4a21;
  font-weight: 800;
}

.check-issue-panel {
  margin-top: 14px;
  scroll-margin-top: 18px;
}

.check-issue-panel.issue-focus {
  animation: issueFocusPulse 2.2s ease-out;
}

@keyframes issueFocusPulse {
  0% {
    border-color: #e0a82e;
    box-shadow: 0 0 0 4px rgba(224, 168, 46, 0.18), var(--shadow);
  }
  55% {
    border-color: #e0a82e;
    box-shadow: 0 0 0 7px rgba(224, 168, 46, 0.08), var(--shadow);
  }
  100% {
    border-color: var(--line);
    box-shadow: var(--shadow);
  }
}

.chart-grid {
  grid-template-columns: 1.25fr 0.75fr;
  align-items: start;
}

.factory-layout {
  grid-template-columns: 1.25fr 0.75fr;
  align-items: start;
}

.factory-layout.single {
  grid-template-columns: 1fr;
}

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

.panel-head {
  justify-content: space-between;
  margin-bottom: 12px;
}

.master-panel,
.entry-panel {
  align-self: start;
}

.search-input,
.select-input,
.entry-form input,
.entry-form select,
.entry-form textarea {
  width: 100%;
  min-width: 0;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 10px;
  background: #ffffff;
  color: var(--text);
}

.multi-filter-row {
  display: grid;
  grid-template-columns: minmax(220px, 0.8fr) minmax(320px, 1.2fr) auto;
  align-items: end;
  gap: 12px;
  margin: 10px 0 14px;
}

.multi-filter-block {
  display: grid;
  gap: 8px;
  align-content: start;
}

.multi-filter-block strong {
  font-size: 13px;
  color: var(--muted);
}

.multi-filter-actions {
  display: flex;
  align-items: flex-end;
  min-height: 36px;
}

.multi-filter-actions .line-button {
  min-width: 92px;
  height: 36px;
  white-space: nowrap;
}

.multi-filter-options {
  position: relative;
}

.multi-select-dropdown {
  position: relative;
}

.multi-select-dropdown summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  font-size: 14px;
  color: var(--text);
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.multi-select-dropdown summary::-webkit-details-marker {
  display: none;
}

.multi-select-dropdown summary::after {
  content: "▾";
  color: var(--muted);
  font-size: 12px;
}

.multi-select-dropdown[open] summary {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(230, 161, 0, 0.12);
}

.multi-select-menu {
  position: absolute;
  z-index: 30;
  top: calc(100% + 6px);
  left: 0;
  width: min(280px, 80vw);
  max-height: 260px;
  overflow: auto;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 12px 28px rgba(58, 40, 13, 0.16);
}

.multi-select-menu label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 0 9px;
  border-radius: 6px;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
}

.multi-select-menu label:hover {
  background: #fff8e8;
}

.multi-select-menu label:has(input:checked) {
  background: #fff7e2;
  color: var(--accent-strong);
  font-weight: 700;
}

.multi-select-menu input {
  accent-color: var(--accent);
}

.search-input {
  max-width: 150px;
}

.entry-form textarea {
  min-height: 72px;
  padding-top: 8px;
  resize: vertical;
}

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

.entry-form.full {
  grid-template-columns: repeat(12, minmax(0, 1fr));
  align-items: end;
  margin-bottom: 16px;
}

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

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

.entry-form.full .summary-field {
  grid-column: 1 / span 6;
  min-width: 0;
}

.entry-form.full .short-field {
  min-width: 0;
}

.entry-form.full .year-field {
  grid-column: 1 / span 1;
}

.entry-form.full .month-field {
  grid-column: 2 / span 1;
}

.entry-form.full .day-field {
  grid-column: 3 / span 1;
}

.entry-form.full .category-field {
  grid-column: 4 / span 4;
}

.entry-form.full .account-field {
  grid-column: 8 / span 5;
}

.entry-form.full .income-field {
  grid-column: 7 / span 3;
}

.entry-form.full .expense-field {
  grid-column: 10 / span 3;
}

.entry-form.full .save-field {
  grid-column: 5 / span 4;
  justify-self: stretch;
  min-width: 220px;
}

.entry-form.full button {
  align-self: end;
}

.factory-payment-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: end;
}

.factory-payment-form .wide-field,
.factory-payment-form .primary-button {
  grid-column: 1 / -1;
}

.factory-payment-date-row {
  display: grid;
}

.factory-payment-date-row label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(120px, 1fr));
  gap: 10px;
}

.kpi-grid.wide {
  grid-template-columns: repeat(5, minmax(150px, 1fr));
  margin-bottom: 16px;
}

.kpi {
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 4px solid var(--blue);
  border-radius: 8px;
  padding: 12px;
}

.kpi:nth-child(2) {
  border-left-color: var(--amber);
}

.kpi:nth-child(3),
.kpi:nth-child(5) {
  border-left-color: var(--jade);
}

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

.kpi-value {
  margin-top: 6px;
  font-size: 20px;
  font-weight: 800;
  white-space: nowrap;
}

.safety-dashboard-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0 16px;
}

.safety-card {
  min-height: 126px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--blue);
  border-radius: 8px;
  background: #ffffff;
  padding: 13px;
  display: grid;
  align-content: start;
  gap: 8px;
}

.safety-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.safety-card strong {
  font-size: 22px;
  line-height: 1.1;
}

.safety-card small {
  color: var(--muted);
  line-height: 1.45;
}

.safety-card.good,
.safety-card.risk-green {
  border-left-color: var(--jade);
}

.safety-card.warn,
.safety-card.risk-yellow {
  border-left-color: #d89a18;
  background: #fffaf0;
}

.safety-card.bad,
.safety-card.risk-red {
  border-left-color: var(--danger);
  background: #fff5f2;
}

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

.period-comparison-panel {
  grid-column: 1 / -1;
}

.safety-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 12px;
  min-width: 0;
}

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

.safety-panel-head h3 {
  margin: 0;
  color: var(--text);
  font-size: 14px;
}

.risk-list,
.fund-trend-list,
.expense-mix-list,
.period-comparison-list {
  display: grid;
  gap: 8px;
}

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

.period-comparison-card {
  border: 1px solid var(--line);
  border-left: 5px solid var(--amber);
  border-radius: 8px;
  background: #ffffff;
  padding: 12px;
  display: grid;
  gap: 10px;
}

.period-comparison-card.good {
  border-left-color: var(--jade);
  background: #f7fbf7;
}

.period-comparison-card.warn {
  border-left-color: #d89a18;
  background: #fffaf0;
}

.period-comparison-card.bad {
  border-left-color: var(--danger);
  background: #fff5f2;
}

.period-comparison-title {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.period-comparison-title div {
  display: grid;
  gap: 3px;
}

.period-comparison-title span,
.period-comparison-card p,
.period-metric-grid small,
.period-metric-grid span {
  color: var(--muted);
}

.period-comparison-title em {
  font-style: normal;
  font-weight: 800;
  white-space: nowrap;
}

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

.period-metric-grid div {
  border: 1px solid rgba(214, 194, 142, 0.5);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.75);
  padding: 8px;
  display: grid;
  gap: 4px;
  min-width: 0;
}

.period-metric-grid strong {
  font-size: 17px;
  white-space: nowrap;
}

.period-metric-grid small {
  line-height: 1.35;
}

.risk-item {
  border: 1px solid var(--line);
  border-left: 4px solid var(--jade);
  border-radius: 7px;
  padding: 9px 10px;
  display: grid;
  gap: 4px;
}

.risk-item.red {
  border-left-color: var(--danger);
  background: #fff5f2;
}

.risk-item.yellow {
  border-left-color: #d89a18;
  background: #fffaf0;
}

.risk-item span,
.risk-item small {
  color: var(--muted);
  line-height: 1.45;
}

.fund-trend-row {
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr) 72px;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}

.fund-bars {
  display: grid;
  gap: 3px;
}

.fund-bar {
  height: 7px;
  border-radius: 999px;
}

.fund-bar.income {
  background: #1f9d63;
}

.fund-bar.expense {
  background: #e27645;
}

.fund-bar.net-positive {
  background: #246baf;
}

.fund-bar.net-negative {
  background: #b42318;
}

.expense-mix-row {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr) 54px 120px;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}

.mix-track {
  height: 12px;
  border-radius: 999px;
  background: #edf2f5;
  overflow: hidden;
}

.mix-fill {
  height: 100%;
  border-radius: inherit;
}

.mix-fill.necessary {
  background: #246baf;
}

.mix-fill.controllable {
  background: #d89a18;
}

.mix-fill.other {
  background: #8a98a6;
}

.rank-row small {
  color: var(--muted);
  text-align: right;
}

.empty-note {
  color: var(--muted);
  padding: 12px 0;
}

@media (max-width: 1280px) {
  .safety-dashboard-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .safety-dashboard-grid,
  .safety-analysis-grid,
  .period-comparison-list,
  .period-metric-grid {
    grid-template-columns: 1fr;
  }

  .expense-mix-row {
    grid-template-columns: 76px minmax(0, 1fr) 48px;
  }

  .expense-mix-row small {
    grid-column: 2 / -1;
  }
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 7px;
}

.table-wrap.compact {
  max-height: 260px;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: #ffffff;
  table-layout: auto;
}

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

th {
  position: sticky;
  top: 0;
  background: #eef3f7;
  color: #385166;
  font-weight: 800;
  z-index: 1;
}

td.number,
th.number {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.number {
  font-variant-numeric: tabular-nums;
}

td.negative {
  color: var(--danger);
}

tbody tr:hover {
  background: #f8fbfd;
}

.total-row td {
  background: #fff7df;
  font-weight: 800;
}

#view-entry,
#view-entry input,
#view-entry select,
#view-entry button,
#view-entry table {
  font-size: inherit;
  font-weight: inherit;
}

#view-entry th,
#view-entry td {
  padding: 8px 10px;
}

#view-entry .entry-form input,
#view-entry .entry-form select {
  height: 34px;
}

.tag-list,
.code-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-height: 210px;
  overflow: auto;
}

.tag-list.large {
  max-height: 520px;
}

.tag,
.code-chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-soft);
}

button.tag {
  color: var(--text);
  cursor: pointer;
}

button.tag:hover {
  border-color: #9bbbd3;
  background: #eef5fb;
}

.code-chip strong {
  color: var(--blue);
  margin-right: 6px;
}

.activity-list {
  border-top: 1px solid var(--line);
  margin-top: 14px;
}

.warning-item {
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
}

.bar-chart {
  display: grid;
  gap: 9px;
  margin-top: 10px;
}

.bar-row {
  display: grid;
  grid-template-columns: 42px 1fr 92px;
  align-items: center;
  gap: 10px;
}

.split-bar-row {
  grid-template-columns: 42px minmax(0, 1fr) 86px;
  align-items: center;
}

.bar-pair {
  display: grid;
  gap: 4px;
}

.bar-line {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 72px;
  align-items: center;
  gap: 8px;
}

.bar-line strong,
.net-value {
  font-size: 12px;
  text-align: right;
  white-space: nowrap;
}

.bar-label {
  font-size: 12px;
  font-weight: 700;
}

.income-label {
  color: #15803d;
}

.expense-label {
  color: #c2410c;
}

.bar-track {
  height: 18px;
  background: #edf2f5;
  border-radius: 999px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  background: #15803d;
  border-radius: inherit;
}

.bar-fill.income {
  background: #15803d;
}

.bar-fill.expense {
  background: #dc2626;
}

.income-track {
  background: #e7f6ed;
}

.expense-track {
  background: #fdecec;
}

.rank-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.rank-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}

.rank-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(12, 24, 34, 0.36);
  place-items: center;
  z-index: 20;
}

.modal-backdrop.open {
  display: grid;
}

.draft-inbox-button.needs-save {
  border-color: #e49b00;
  background: #fff2c2;
  color: #805000;
}

.draft-inbox-summary {
  margin-bottom: 12px;
  padding: 10px 12px;
  border: 1px solid #f0d79a;
  border-radius: 6px;
  background: #fff8e6;
  color: #6f4a00;
  font-weight: 700;
}

.draft-list {
  display: grid;
  gap: 10px;
  max-height: min(62vh, 560px);
  overflow: auto;
}

.draft-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf7;
}

.draft-card p {
  margin: 4px 0;
  color: var(--muted);
}

.draft-card span {
  color: #9a6a00;
  font-size: 12px;
  font-weight: 700;
}

.draft-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.modal {
  width: min(420px, calc(100vw - 36px));
  background: #ffffff;
  border-radius: 8px;
  padding: 16px;
  box-shadow: 0 24px 60px rgba(10, 24, 38, 0.25);
}

.wide-modal {
  width: min(1080px, calc(100vw - 48px));
}

#transactionBatchModal .wide-modal {
  width: min(1280px, calc(100vw - 24px));
  max-height: calc(100vh - 24px);
  overflow: auto;
}

.batch-draft-warning,
.batch-save-status {
  border-radius: 6px;
  padding: 10px 12px;
  font-weight: 700;
}

.batch-draft-warning {
  border: 1px solid #f2c94c;
  background: #fff7d6;
  color: #7a4b00;
}

.batch-save-status {
  border: 1px solid #b8d4ef;
  background: #eef6ff;
  color: #164a7b;
}

.batch-save-status.error {
  border-color: #f0b4a8;
  background: #fff0ed;
  color: #9d2b1f;
}

.batch-save-button.needs-save {
  box-shadow: 0 0 0 3px rgba(242, 201, 76, 0.45);
}

.modal-table {
  max-height: 70vh;
}

.ledger-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 12px;
}

.ledger-summary span {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  padding: 0 10px;
  border-radius: 6px;
  background: #eef5fb;
  color: #164a7b;
  font-weight: 700;
}

.modal-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 42px;
  margin: 0 0 12px;
  padding: 8px 10px;
  border: 1px solid #dbe8ef;
  border-radius: 8px;
  background: #f7fafc;
  color: #31546d;
  font-weight: 700;
}

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

.report-backup-modal {
  width: min(560px, calc(100vw - 36px));
}

.backup-copy {
  display: grid;
  gap: 4px;
  margin-bottom: 14px;
  padding: 12px;
  border: 1px solid #dbe8ef;
  border-radius: 8px;
  background: #f7fafc;
  color: var(--muted);
}

.backup-copy strong,
.backup-folder strong {
  color: var(--text);
}

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

.backup-grid label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-weight: 700;
}

.backup-folder {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  padding: 12px;
  border: 1px solid #cfe0eb;
  border-radius: 8px;
  background: #eef6fb;
}

.backup-folder div {
  display: grid;
  gap: 4px;
}

.backup-folder span,
.backup-folder small {
  color: var(--muted);
}

.backup-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.original-import-panel {
  margin-bottom: 14px;
}

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

.batch-form {
  display: grid;
  gap: 12px;
}

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

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

.batch-controls select,
.input-table input,
.input-table select {
  width: 100%;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 8px;
  background: #ffffff;
  color: var(--text);
  font: inherit;
}

.batch-entry-line {
  display: grid;
  grid-template-columns: 72px 150px 120px minmax(420px, 1fr) 110px 110px 112px;
  align-items: end;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7fafc;
}

.batch-entry-line label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.batch-entry-line input,
.batch-entry-line select {
  width: 100%;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 8px;
  background: #ffffff;
  color: var(--text);
  font: inherit;
}

.batch-add-button {
  justify-self: end;
  width: 100%;
}

.batch-draft-table .batch-col-day {
  width: 58px;
}

.batch-draft-table .batch-col-category {
  width: 104px;
}

.batch-draft-table .batch-col-factory {
  width: 146px;
}

.batch-draft-table .batch-col-summary {
  width: auto;
}

.batch-draft-table .batch-col-money {
  width: 116px;
}

.batch-draft-table .batch-col-action {
  width: 52px;
}

.batch-draft-table .batch-col-balance {
  width: 126px;
}

.batch-recent-table .recent-col-year,
.batch-recent-table .recent-col-month,
.batch-recent-table .recent-col-day {
  width: 58px;
}

.batch-recent-table .recent-col-summary {
  width: auto;
}

.batch-recent-table .recent-col-money,
.batch-recent-table .recent-col-balance {
  width: 112px;
}

.batch-recent-table .recent-col-operator {
  width: 130px;
}

.batch-draft-table input,
.batch-draft-table select,
.batch-recent-table input,
.batch-recent-table select {
  min-width: 0;
}

.batch-draft-table th,
.batch-draft-table td,
.batch-recent-table th,
.batch-recent-table td {
  padding-inline: 6px;
}

.batch-draft-table td.number,
.batch-recent-table td.number {
  text-align: right;
  padding-right: 16px;
}

.batch-draft-table th.number,
.batch-recent-table th.number {
  text-align: left;
  padding-left: 16px;
  padding-right: 8px;
}

.batch-draft-table td:nth-child(7) {
  text-align: center;
}

.compact-button {
  min-height: 28px;
  padding: 4px 9px;
  font-size: 12px;
}

.modal-account-detail-table .compact-button {
  min-height: 36px;
  min-width: 64px;
}

.account-review-save-status {
  margin: 0 0 10px;
}

.review-done {
  background: #e9f7ef;
  color: #157347;
  border-color: #b7e4c7;
}

.signature-review-button {
  min-width: 32px;
  min-height: 30px;
  display: inline-grid;
  place-items: center;
  padding: 2px 4px;
  border: 1px solid #f0c56c;
  border-radius: 8px;
  background: #fffaf0;
  cursor: pointer;
}

.review-signature {
  width: 24px;
  height: 24px;
  font-size: 14px;
}

.warning-row td {
  background: #fff8e1;
}

.factory-payment-mismatch {
  box-shadow: inset -4px 0 0 #e0b400;
}

.account-balance-wrap {
  max-width: 100%;
}

.account-management-head {
  display: grid;
  gap: 12px;
  margin-bottom: 14px;
}

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

.account-mode-card {
  display: grid;
  gap: 6px;
  min-height: 74px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  box-shadow: var(--shadow);
}

.account-mode-card strong {
  font-size: 16px;
}

.account-mode-card span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.account-mode-card.active {
  border-color: #e0a82e;
  background: #fff8e8;
  box-shadow: 0 0 0 3px rgba(224, 168, 46, 0.14), var(--shadow);
}

.account-period-bar {
  display: grid;
  grid-template-columns: minmax(120px, 160px) minmax(140px, 170px) auto 96px auto;
  align-items: end;
  gap: 10px;
  padding: 12px;
  border: 1px solid #f0dfbd;
  border-radius: 8px;
  background: #fffaf0;
}

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

.account-period-shortcuts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.account-period-shortcuts .line-button.active {
  background: #e0a82e;
  color: #ffffff;
  border-color: #e0a82e;
}

.account-ledger-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 18px 0 8px;
}

.account-ledger-head h3 {
  margin: 0;
}

.account-ledger-head span {
  color: #31546d;
  font-size: 13px;
  font-weight: 800;
}

.account-ledger-table {
  min-width: 1080px;
  table-layout: fixed;
}

.account-ledger-table th:nth-child(1),
.account-ledger-table td:nth-child(1) {
  width: 110px;
}

.account-ledger-table th:nth-child(2),
.account-ledger-table td:nth-child(2) {
  width: 150px;
}

.account-ledger-table th:nth-child(3),
.account-ledger-table td:nth-child(3) {
  width: 90px;
}

.account-ledger-table th:nth-child(5),
.account-ledger-table td:nth-child(5),
.account-ledger-table th:nth-child(6),
.account-ledger-table td:nth-child(6),
.account-ledger-table th:nth-child(7),
.account-ledger-table td:nth-child(7) {
  width: 130px;
}

.account-ledger-table th:nth-child(8),
.account-ledger-table td:nth-child(8) {
  width: 130px;
}

.account-balance-table {
  min-width: 1080px;
  table-layout: fixed;
}

.account-balance-table th,
.account-balance-table td {
  padding: 11px 14px;
}

.account-balance-table th:nth-child(1),
.account-balance-table td:nth-child(1) {
  width: 64px;
  text-align: center;
}

.account-balance-table th:nth-child(2),
.account-balance-table td:nth-child(2) {
  width: 190px;
}

.account-balance-table th:nth-child(n+3):nth-child(-n+7),
.account-balance-table td:nth-child(n+3):nth-child(-n+7) {
  width: 132px;
}

.account-balance-table th:nth-child(7),
.account-balance-table td:nth-child(7) {
  width: 150px;
}

.account-balance-table th:nth-child(8),
.account-balance-table td:nth-child(8) {
  width: 94px;
}

.account-balance-table th:nth-child(9),
.account-balance-table td:nth-child(9) {
  width: 82px;
  text-align: center;
}

.account-balance-table .balance-source-cell {
  text-align: center;
}

.account-balance-table .balance-record-signature {
  padding-inline: 8px;
}

.account-balance-table .compact-signature {
  width: 24px;
  height: 24px;
  font-size: 14px;
}

.account-balance-table .balance-record-text {
  display: inline-block;
  max-width: 64px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-name-cell .link-cell {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: bottom;
}

.money-cell {
  letter-spacing: 0;
}

.strong-money {
  color: #0f4f82;
  font-weight: 800;
}

.source-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 76px;
  height: 26px;
  padding: 0 8px;
  border: 1px solid #dbe8ef;
  border-radius: 6px;
  background: #f4f9fc;
  color: #31546d;
  font-size: 12px;
  font-weight: 800;
}

.form-notice {
  min-height: 34px;
  padding: 8px 10px;
  border: 1px solid #dbe8ef;
  border-radius: 8px;
  background: #f4f9fc;
  color: #31546d;
  font-weight: 700;
  line-height: 1.45;
}

.input-table table {
  table-layout: fixed;
}

.input-table th,
.input-table td {
  padding: 7px 8px;
}

.input-table th:nth-child(1),
.input-table td:nth-child(1) {
  width: 88px;
}

.input-table th:nth-child(2),
.input-table td:nth-child(2) {
  width: 120px;
}

.input-table input[type="number"] {
  text-align: right;
}

.employee-name-cell {
  font-weight: 800;
  color: #0f4f82;
}

.missing-row td {
  background: #fff8e6;
  color: #7a4b00;
  font-weight: 700;
}

.status-pill.ok {
  background: #e9f7ef;
  color: #157347;
}

.status-pill.warning {
  background: #fff3cd;
  color: #8a5a00;
}

.employee-table th:nth-child(1),
.employee-table td:nth-child(1) {
  width: 110px;
}

.employee-table th:nth-child(2),
.employee-table td:nth-child(2) {
  width: 180px;
}

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

.employee-table th:nth-child(4),
.employee-table td:nth-child(4) {
  width: auto;
}

.employee-table th:nth-child(5),
.employee-table td:nth-child(5) {
  width: 96px;
}

.modal-payroll-extra-batch-table th:nth-child(1),
.modal-payroll-extra-batch-table td:nth-child(1),
.modal-payroll-extra-batch-table th:nth-child(2),
.modal-payroll-extra-batch-table td:nth-child(2) {
  width: 130px;
}

.modal-payroll-extra-batch-table th:nth-child(3),
.modal-payroll-extra-batch-table td:nth-child(3),
.modal-employee-manage-table th:nth-child(5),
.modal-employee-manage-table td:nth-child(5),
.modal-employee-manage-table th:nth-child(6),
.modal-employee-manage-table td:nth-child(6) {
  width: auto;
}

.modal-payroll-batch-table th:nth-child(1),
.modal-payroll-batch-table td:nth-child(1),
.modal-payroll-batch-table th:nth-child(2),
.modal-payroll-batch-table td:nth-child(2),
.modal-payroll-batch-table th:nth-child(3),
.modal-payroll-batch-table td:nth-child(3),
.modal-employee-manage-table th:nth-child(1),
.modal-employee-manage-table td:nth-child(1),
.modal-employee-manage-table th:nth-child(2),
.modal-employee-manage-table td:nth-child(2),
.modal-employee-manage-table th:nth-child(4),
.modal-employee-manage-table td:nth-child(4),
.modal-employee-manage-table th:nth-child(7),
.modal-employee-manage-table td:nth-child(7) {
  width: 82px;
}

.modal-payroll-batch-table th.number,
.modal-payroll-batch-table td.number {
  width: 92px;
}

.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  min-width: 180px;
  padding: 11px 14px;
  color: #ffffff;
  background: #102638;
  border-radius: 8px;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 30;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.client-crash-notice {
  position: fixed;
  left: 50%;
  bottom: 20px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px 14px;
  width: min(720px, calc(100vw - 32px));
  padding: 14px 16px;
  color: #2d1600;
  background: #fff8e6;
  border: 1px solid #e6ad39;
  border-radius: 8px;
  box-shadow: var(--shadow);
  transform: translateX(-50%);
  z-index: 80;
}

.client-crash-notice strong {
  font-size: 15px;
}

.client-crash-notice span,
.client-crash-notice small {
  grid-column: 1;
  line-height: 1.45;
}

.client-crash-notice small {
  color: #8a5d13;
}

.client-crash-notice button {
  grid-column: 2;
  grid-row: 1 / span 3;
  align-self: center;
  padding: 9px 14px;
  color: #ffffff;
  background: var(--gold-strong);
  border: 0;
  border-radius: 8px;
  cursor: pointer;
}

.auth-screen {
  min-height: 100vh;
  display: none;
  place-items: center;
  padding: 0;
  background: #ffffff;
}

.auth-screen.active {
  display: grid;
}

body.auth-pending .auth-screen,
body.auth-pending .app-shell {
  display: none;
}

body.auth-locked .app-shell {
  display: none;
}

.auth-layout {
  width: 100%;
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(420px, 46%) minmax(520px, 54%);
  background: #ffffff;
}

.auth-brand-panel {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 100vh;
  overflow: hidden;
  background:
    linear-gradient(132deg, rgba(255, 248, 235, 0.96), rgba(255, 255, 255, 0.96)),
    url("./assets/cover-hero-soft.png") left bottom / cover no-repeat;
  border-right: 1px solid rgba(218, 183, 116, 0.48);
}

.auth-brand-panel::after {
  content: "";
  position: absolute;
  left: -16%;
  bottom: -20%;
  width: 78%;
  height: 54%;
  border-radius: 50%;
  border-top: 1px solid rgba(210, 151, 43, 0.28);
  transform: rotate(12deg);
}

.auth-brand-center {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: center;
  gap: 18px;
  text-align: center;
  transform: translateY(-2%);
}

.auth-mascot {
  width: 132px;
  height: 132px;
  object-fit: contain;
}

.auth-brand-center h1 {
  margin: 10px 0 0;
  font-size: 44px;
  line-height: 1.1;
  letter-spacing: 0;
  color: #202326;
  font-weight: 800;
}

.auth-brand-center p {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  margin: 0;
  color: #a16b12;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.24em;
}

.auth-brand-center p span {
  display: block;
  width: 42px;
  height: 1px;
  background: #d6a03b;
}

.auth-card {
  width: min(560px, calc(100% - 96px));
  align-self: center;
  justify-self: center;
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 0;
  box-shadow: none;
}

.auth-title {
  text-align: center;
  margin-bottom: 42px;
}

.auth-title h2 {
  margin: 0;
  color: #202326;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 0;
}

.auth-title p {
  margin: 14px 0 0;
  color: #8a9098;
  font-size: 16px;
}

.auth-form {
  display: none;
}

.auth-form.active {
  display: grid;
  gap: 26px;
}

.auth-form label {
  display: grid;
  gap: 12px;
  color: #202326;
  font-size: 17px;
  font-weight: 700;
}

.auth-form input {
  width: 100%;
  height: 58px;
  border: 1px solid #d4d8dd;
  border-radius: 6px;
  padding: 0 18px;
  color: #202326;
  background: #ffffff;
  font-size: 16px;
  outline: none;
}

.auth-form input:focus {
  border-color: #d99208;
  box-shadow: 0 0 0 3px rgba(217, 146, 8, 0.14);
}

.password-field {
  position: relative;
  display: block;
}

.password-field input {
  padding-right: 78px;
}

.password-toggle {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  height: 38px;
  min-width: 54px;
  border: 0;
  background: transparent;
  color: #8a9098;
  font-size: 14px;
}

.auth-submit {
  height: 64px;
  margin-top: 16px;
  border-radius: 6px;
  border: 0;
  background: #d99208;
  color: #ffffff;
  font-size: 22px;
  font-weight: 800;
}

.auth-submit:hover {
  background: #c98205;
}

.auth-cloud-note {
  margin: 0;
  color: #8a9098;
  text-align: center;
  font-size: 16px;
}

.auth-safe-note {
  margin: 34px 0 0;
  padding-top: 24px;
  border-top: 1px solid #e2e5e8;
  color: #8a9098;
  text-align: center;
  font-size: 16px;
  font-weight: 700;
}

.auth-version {
  margin: -18px 0 0;
  color: #b0a38d;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
}

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

  .auth-brand-panel {
    min-height: 34vh;
    border-right: 0;
    border-bottom: 1px solid rgba(218, 183, 116, 0.48);
  }

  .auth-brand-center {
    gap: 10px;
    transform: none;
  }

  .auth-mascot {
    width: 90px;
    height: 90px;
  }

  .auth-brand-center h1 {
    font-size: 32px;
  }

  .auth-brand-center p {
    font-size: 15px;
    letter-spacing: 0.12em;
  }

  .auth-card {
    width: min(560px, calc(100% - 32px));
    padding: 32px 0 42px;
  }

  .auth-title {
    margin-bottom: 28px;
  }
}

.audit-detail {
  display: grid;
  gap: 12px;
  font-size: 13px;
}

.audit-detail pre {
  max-height: 260px;
  overflow: auto;
  margin: 0;
  padding: 10px;
  background: #f6f8fa;
  border: 1px solid var(--line);
  border-radius: 8px;
  white-space: pre-wrap;
}

.nav-item[hidden],
[data-auth-hidden="true"] {
  display: none !important;
}

@media (max-width: 1120px) {
  .app-shell {
    grid-template-columns: 84px 1fr;
  }

  .brand div:not(.brand-mark),
  .nav-item {
    font-size: 0;
  }

  .nav-item span {
    font-size: 12px;
  }

  .dashboard-grid,
  .split-row,
  .base-menu-grid,
  .chart-grid,
  .factory-layout {
    grid-template-columns: 1fr;
  }

  .entry-form.full,
  .kpi-grid,
  .kpi-grid.wide {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .entry-form.full .summary-field,
  .entry-form.full .year-field,
  .entry-form.full .month-field,
  .entry-form.full .day-field,
  .entry-form.full .category-field,
  .entry-form.full .account-field,
  .entry-form.full .income-field,
  .entry-form.full .expense-field,
  .entry-form.full .save-field {
    grid-column: auto;
  }
}

@media (max-width: 720px) {
  .split-bar-row,
  .bar-line {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .bar-line strong,
  .net-value {
    text-align: left;
  }

  .batch-entry-line {
    grid-template-columns: 1fr;
  }

  .app-shell {
    display: block;
  }

  .sidebar {
    position: static;
    height: auto;
  }

  .nav-list {
    grid-template-columns: repeat(3, 1fr);
  }

  .topbar,
  .top-actions {
    align-items: flex-start;
    flex-direction: column;
  }

  .entry-form.full,
  .kpi-grid,
  .kpi-grid.wide {
    grid-template-columns: 1fr;
  }

  .entry-form.full .summary-field,
  .entry-form.full .year-field,
  .entry-form.full .month-field,
  .entry-form.full .day-field,
  .entry-form.full .category-field,
  .entry-form.full .account-field,
  .entry-form.full .income-field,
  .entry-form.full .expense-field,
  .entry-form.full .save-field {
    grid-column: auto;
  }
}

/* Design refresh: 数据驾驶舱 */
:root {
  --bg: #eef3f5;
  --surface: #ffffff;
  --surface-soft: #f6f8fa;
  --surface-tint: #edf7f4;
  --line: #d7e0e6;
  --text: #18232d;
  --muted: #667584;
  --blue: #1f6fb2;
  --blue-dark: #174f83;
  --jade: #16806f;
  --amber: #bd7a17;
  --danger: #b42318;
  --shadow: 0 8px 22px rgba(31, 55, 74, 0.07);
}

body {
  font-size: 14px;
  line-height: 1.45;
  background: var(--bg);
}

.app-shell {
  grid-template-columns: 184px minmax(0, 1fr);
}

.sidebar {
  background: #132d3b;
  padding: 14px 10px;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
}

.brand {
  gap: 10px;
  padding: 2px 6px 14px;
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: #e9f5f2;
  color: #0e443b;
  font-size: 17px;
}

.brand-title {
  font-size: 15px;
  line-height: 1.2;
}

.brand-subtitle {
  font-size: 11px;
  color: #a8c1c8;
}

.nav-list {
  gap: 3px;
  margin-top: 14px;
}

.sidebar-tools {
  display: grid;
  gap: 8px;
  margin-top: auto;
  padding: 14px 4px 2px;
}

.sidebar-tools .status-pill,
.sidebar-tools .file-pill,
.sidebar-tools .ghost-button,
.sidebar-tools .primary-button {
  width: 100%;
  justify-content: center;
}

.nav-item {
  height: 34px;
  gap: 8px;
  padding: 0 8px;
  border-radius: 8px;
  color: #cddbe1;
  font-size: 13px;
  font-weight: 700;
}

.nav-item span {
  width: 34px;
  height: 22px;
  border-radius: 7px;
  font-size: 11px;
  color: #9fc4c7;
}

.nav-item:hover,
.nav-item.active {
  background: #21485a;
}

.main {
  padding: 16px 20px 24px;
}

.topbar {
  display: none;
}

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

.crumb {
  font-size: 12px;
}

h1 {
  margin-top: 2px;
  font-size: 21px;
  line-height: 1.2;
}

h2 {
  font-size: 15px;
  line-height: 1.25;
}

h3 {
  margin: 12px 0 7px;
  font-size: 12px;
}

.author-line {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.top-actions,
.panel-head,
.mini-actions,
.summary-strip {
  gap: 8px;
}

.status-pill,
.file-pill {
  height: 28px;
  padding: 0 9px;
  border-radius: 8px;
  font-size: 12px;
}

.primary-button,
.ghost-button,
.line-button,
.text-button,
.icon-button {
  min-height: 32px;
  height: auto;
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
}

.primary-button {
  background: #1f6fb2;
}

.ghost-button,
.line-button {
  background: #f3f8fb;
}

.small-button {
  min-height: 26px;
  padding: 5px 9px;
  font-size: 12px;
}

.mini-actions .line-button,
.top-actions .ghost-button,
.top-actions .primary-button {
  min-width: 78px;
}

.panel-head .select-input {
  min-width: 150px;
}

.text-button,
.link-cell {
  min-height: 0;
  padding: 0;
  line-height: 1.3;
}

.view-tabs {
  gap: 2px;
  margin: 0 0 12px;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f7fafb;
}

.tab-button {
  height: 34px;
  padding: 0 14px;
  border: 0;
  border-radius: 8px;
  font-size: 13px;
}

.tab-button.active {
  background: #ffffff;
  box-shadow: 0 1px 4px rgba(31, 55, 74, 0.08);
}

.dashboard-grid {
  grid-template-columns: minmax(620px, 1fr) minmax(250px, 300px);
  gap: 12px;
}

#view-center .dashboard-grid {
  grid-template-columns: 1fr;
}

.workspace,
.split-row,
.chart-grid,
.factory-layout {
  gap: 12px;
}

.panel {
  border-color: #dbe5ea;
  border-radius: 10px;
  padding: 12px;
  box-shadow: 0 4px 14px rgba(31, 55, 74, 0.05);
}

.panel-head {
  min-height: 32px;
  margin-bottom: 10px;
}

.search-input,
.select-input,
.entry-form input,
.entry-form select,
.entry-form textarea {
  height: 34px;
  border-radius: 8px;
  padding: 0 9px;
  font-size: 13px;
  line-height: 1.3;
}

.select-input {
  min-width: 120px;
}

.entry-form {
  gap: 9px;
}

.entry-form.full {
  margin-bottom: 12px;
}

.entry-form label {
  gap: 4px;
  font-size: 12px;
  line-height: 1.25;
  font-weight: 700;
}

.entry-form.full .save-field {
  min-width: 180px;
}

.kpi-grid {
  grid-template-columns: repeat(5, minmax(112px, 1fr));
  gap: 8px;
}

.kpi-grid.wide {
  grid-template-columns: repeat(5, minmax(132px, 1fr));
  margin-bottom: 12px;
}

.kpi {
  border-left-width: 3px;
  border-radius: 10px;
  padding: 10px 11px;
  background: #ffffff;
}

.kpi-label {
  font-size: 12px;
  line-height: 1.25;
}

.kpi-value {
  margin-top: 4px;
  font-size: clamp(16px, 1.6vw, 20px);
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.table-wrap {
  border-radius: 9px;
  background: #ffffff;
  border-color: #d7e3e9;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

.table-wrap.compact {
  max-height: 236px;
}

table {
  font-size: 13px;
  color: #183044;
}

th,
td {
  padding: 7px 9px;
  line-height: 1.35;
  vertical-align: middle;
  height: 38px;
}

th {
  background: #edf5f8;
  color: #314d61;
  font-size: 12px;
  letter-spacing: 0;
  box-shadow: inset 0 -1px 0 #d9e6ec;
}

tbody tr:nth-child(even):not(.total-row):not(.selected-row) {
  background: #fbfdfe;
}

tbody tr:hover {
  background: #eef7f9;
}

.selectable-row {
  cursor: pointer;
}

.selected-row,
.selected-row:hover {
  background: #e4f2f8;
  box-shadow: inset 3px 0 0 var(--blue);
}

.total-row td {
  background: #fff8e6;
}

.truncate-text {
  display: block;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.truncate-button {
  display: block;
  width: 100%;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: left;
}

.dense-data-table {
  table-layout: fixed;
}

.dense-data-table th,
.dense-data-table td {
  height: 34px;
  padding: 6px 8px;
}

.dense-data-table th.number,
.dense-data-table td.number {
  width: 108px;
}

.dense-data-table .status-pill {
  min-width: 42px;
  padding: 3px 7px;
}

.dense-data-table .row-actions {
  gap: 5px;
  flex-wrap: nowrap;
}

.dense-data-table .compact-button {
  min-width: 54px;
  padding-inline: 8px;
}

.summary-cell {
  min-width: 0;
  max-width: 320px;
}

.account-cell,
.source-cell,
.operator-cell {
  min-width: 0;
  max-width: 220px;
}

.signature-cell {
  text-align: right;
  width: 72px;
}

.transaction-main-table th:last-child {
  text-align: right;
}

.operator-signature {
  display: inline-grid;
  place-items: center;
  position: relative;
  width: 26px;
  height: 26px;
  border: 2px solid var(--signature-main, #a93218);
  border-radius: 50%;
  color: var(--signature-main, #a93218);
  background:
    radial-gradient(circle at 42% 38%, rgba(255, 254, 246, 0.96), rgba(255, 242, 210, 0.72) 72%, rgba(255, 232, 184, 0.82)),
    var(--signature-paper, #fff6df);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.58),
    inset 0 0 0 3px rgba(255, 255, 255, 0.18),
    0 1px 3px rgba(133, 78, 20, 0.14);
  font-size: 15px;
  font-weight: 800;
  line-height: 1;
  font-family: "STKaiti", "KaiTi", "Songti SC", serif;
  transform: rotate(var(--signature-tilt, -2deg));
}

.operator-signature::before,
.operator-signature::after {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  pointer-events: none;
}

.operator-signature::before {
  border: 1px dashed color-mix(in srgb, var(--signature-main, #a93218) 78%, transparent);
  opacity: 0.72;
}

.operator-signature::after {
  inset: -2px;
  border: 1px solid color-mix(in srgb, var(--signature-main, #a93218) 46%, transparent);
  clip-path: polygon(0 0, 41% 0, 41% 18%, 50% 18%, 50% 0, 100% 0, 100% 38%, 82% 38%, 82% 49%, 100% 49%, 100% 100%, 58% 100%, 58% 83%, 48% 83%, 48% 100%, 0 100%, 0 62%, 18% 62%, 18% 51%, 0 51%);
  opacity: 0.82;
}

.signature-xiaojuan {
  --signature-main: #b53a24;
  --signature-paper: #fff1dd;
  --signature-tilt: -2deg;
}

.signature-pidan {
  --signature-main: #b57912;
  --signature-paper: #fff4d6;
  --signature-tilt: 1.5deg;
}

.signature-wuwenfa {
  --signature-main: #2e6d56;
  --signature-paper: #eff7e9;
  --signature-tilt: -1deg;
}

.signature-leven {
  --signature-main: #7b4b25;
  --signature-paper: #fff0cf;
  --signature-tilt: 2deg;
}

.modal-table table,
.compact-table table {
  table-layout: fixed;
}

.modal-table .summary-cell {
  max-width: 360px;
}

.modal-table .dense-data-table {
  min-width: 720px;
}

.modal-table .dense-data-table input,
.modal-table .dense-data-table select {
  min-width: 0;
}

.modal-bulk-shop-table,
.modal-bulk-factory-table,
.modal-reference-table,
.modal-account-detail-table,
.modal-payroll-month-table,
.modal-person-payroll-table,
.modal-transaction-import-table {
  min-width: 1040px;
}

.modal-bulk-category-table,
.modal-bulk-account-table,
.modal-bulk-subject-table,
.modal-payroll-extra-table,
.modal-payroll-extra-detail-table,
.modal-category-detail-table {
  min-width: 860px;
}

.modal-payroll-extra-batch-table,
.modal-payroll-batch-table,
.modal-employee-manage-table,
.modal-original-import-table {
  min-width: 720px;
}

.modal-bulk-shop-table th:nth-child(1),
.modal-bulk-shop-table td:nth-child(1),
.modal-bulk-account-table th:nth-child(1),
.modal-bulk-account-table td:nth-child(1),
.modal-bulk-factory-table th:nth-child(1),
.modal-bulk-factory-table td:nth-child(1),
.modal-bulk-subject-table th:nth-child(1),
.modal-bulk-subject-table td:nth-child(1) {
  width: auto;
}

.modal-bulk-shop-table th:nth-child(2),
.modal-bulk-shop-table td:nth-child(2),
.modal-bulk-shop-table th:nth-child(4),
.modal-bulk-shop-table td:nth-child(4),
.modal-bulk-category-table th:nth-child(2),
.modal-bulk-category-table td:nth-child(2),
.modal-bulk-category-table th:nth-child(5),
.modal-bulk-category-table td:nth-child(5),
.modal-bulk-category-table th:nth-child(6),
.modal-bulk-category-table td:nth-child(6),
.modal-bulk-account-table th:nth-child(2),
.modal-bulk-account-table td:nth-child(2),
.modal-bulk-account-table th:nth-child(4),
.modal-bulk-account-table td:nth-child(4),
.modal-bulk-factory-table th:nth-child(2),
.modal-bulk-factory-table td:nth-child(2),
.modal-bulk-factory-table th:nth-child(6),
.modal-bulk-factory-table td:nth-child(6),
.modal-bulk-subject-table th:nth-child(2),
.modal-bulk-subject-table td:nth-child(2),
.modal-bulk-subject-table th:nth-child(4),
.modal-bulk-subject-table td:nth-child(4) {
  width: 100px;
}

.modal-bulk-shop-table th:nth-child(3),
.modal-bulk-shop-table td:nth-child(3),
.modal-bulk-account-table th:nth-child(3),
.modal-bulk-account-table td:nth-child(3),
.modal-bulk-factory-table th:nth-child(3),
.modal-bulk-factory-table td:nth-child(3),
.modal-bulk-subject-table th:nth-child(3),
.modal-bulk-subject-table td:nth-child(3),
.modal-bulk-category-table th:nth-child(1),
.modal-bulk-category-table td:nth-child(1) {
  width: 82px;
}

.modal-bulk-category-table th:nth-child(4),
.modal-bulk-category-table td:nth-child(4) {
  width: 90px;
}

.modal-bulk-category-table th:nth-child(3),
.modal-bulk-category-table td:nth-child(3),
.modal-bulk-factory-table th:nth-child(4),
.modal-bulk-factory-table td:nth-child(4),
.modal-bulk-factory-table th:nth-child(5),
.modal-bulk-factory-table td:nth-child(5) {
  width: auto;
}

.modal-reference-table th:nth-child(1),
.modal-reference-table td:nth-child(1),
.modal-original-import-table th:nth-child(2),
.modal-original-import-table td:nth-child(2) {
  width: 64px;
}

.modal-reference-table th:nth-child(2),
.modal-reference-table td:nth-child(2),
.modal-reference-table th:nth-child(3),
.modal-reference-table td:nth-child(3),
.modal-reference-table th:nth-child(7),
.modal-reference-table td:nth-child(7) {
  width: 96px;
}

.modal-reference-table th:nth-child(6),
.modal-reference-table td:nth-child(6),
.modal-account-detail-table th.number,
.modal-account-detail-table td.number,
.modal-payroll-month-table th.number,
.modal-payroll-month-table td.number,
.modal-payroll-extra-table th.number,
.modal-payroll-extra-table td.number,
.modal-payroll-extra-detail-table th.number,
.modal-payroll-extra-detail-table td.number,
.modal-payroll-batch-table th.number,
.modal-payroll-batch-table td.number,
.modal-person-payroll-table th.number,
.modal-person-payroll-table td.number,
.modal-transaction-import-table th.number,
.modal-transaction-import-table td.number {
  width: 104px;
}

.modal-reference-table th:nth-child(4),
.modal-reference-table td:nth-child(4),
.modal-reference-table th:nth-child(5),
.modal-reference-table td:nth-child(5),
.modal-reference-table th:nth-child(8),
.modal-reference-table td:nth-child(8) {
  width: auto;
}

.modal-account-detail-table th:nth-child(1),
.modal-account-detail-table td:nth-child(1),
.modal-payroll-extra-table th:nth-child(4),
.modal-payroll-extra-table td:nth-child(4),
.modal-payroll-extra-detail-table th:nth-child(4),
.modal-payroll-extra-detail-table td:nth-child(4),
.modal-person-payroll-table th:nth-child(1),
.modal-person-payroll-table td:nth-child(1) {
  width: 118px;
}

.modal-account-detail-table th:nth-child(2),
.modal-account-detail-table td:nth-child(2),
.modal-payroll-extra-table th:nth-child(1),
.modal-payroll-extra-table td:nth-child(1),
.modal-payroll-extra-detail-table th:nth-child(1),
.modal-payroll-extra-detail-table td:nth-child(1),
.modal-payroll-month-table th:nth-child(3),
.modal-payroll-month-table td:nth-child(3),
.modal-employee-manage-table th:nth-child(3),
.modal-employee-manage-table td:nth-child(3) {
  width: 96px;
}

.modal-account-detail-table th:nth-child(3),
.modal-account-detail-table td:nth-child(3),
.modal-payroll-extra-table th:nth-child(6),
.modal-payroll-extra-table td:nth-child(6),
.modal-payroll-extra-detail-table th:nth-child(6),
.modal-payroll-extra-detail-table td:nth-child(6),
.modal-person-payroll-table th:nth-child(12),
.modal-person-payroll-table td:nth-child(12),
.modal-transaction-import-table th:nth-child(6),
.modal-transaction-import-table td:nth-child(6),
.modal-transaction-import-table th:nth-child(10),
.modal-transaction-import-table td:nth-child(10) {
  width: auto;
}

.modal-payroll-month-table th:nth-child(1),
.modal-payroll-month-table td:nth-child(1),
.modal-payroll-month-table th:nth-child(2),
.modal-payroll-month-table td:nth-child(2),
.modal-employee-manage-table th:nth-child(1),
.modal-employee-manage-table td:nth-child(1),
.modal-employee-manage-table th:nth-child(2),
.modal-employee-manage-table td:nth-child(2),
.modal-employee-manage-table th:nth-child(4),
.modal-employee-manage-table td:nth-child(4),
.modal-transaction-import-table th:nth-child(1),
.modal-transaction-import-table td:nth-child(1),
.modal-transaction-import-table th:nth-child(3),
.modal-transaction-import-table td:nth-child(3),
.modal-transaction-import-table th:nth-child(4),
.modal-transaction-import-table td:nth-child(4) {
  width: 58px;
}

.modal-payroll-month-table th:nth-child(4),
.modal-payroll-month-table td:nth-child(4),
.modal-payroll-extra-table th:nth-child(2),
.modal-payroll-extra-table td:nth-child(2),
.modal-payroll-extra-table th:nth-child(5),
.modal-payroll-extra-table td:nth-child(5),
.modal-payroll-extra-table th:nth-child(7),
.modal-payroll-extra-table td:nth-child(7),
.modal-payroll-extra-detail-table th:nth-child(2),
.modal-payroll-extra-detail-table td:nth-child(2),
.modal-payroll-extra-detail-table th:nth-child(5),
.modal-payroll-extra-detail-table td:nth-child(5),
.modal-transaction-import-table th:nth-child(5),
.modal-transaction-import-table td:nth-child(5) {
  width: 82px;
}

.modal-payroll-extra-batch-table th:nth-child(1),
.modal-payroll-extra-batch-table td:nth-child(1) {
  width: 130px;
}

.modal-payroll-extra-batch-table th:nth-child(2),
.modal-payroll-extra-batch-table td:nth-child(2) {
  width: 130px;
}

.modal-payroll-extra-batch-table th:nth-child(3),
.modal-payroll-extra-batch-table td:nth-child(3),
.modal-employee-manage-table th:nth-child(5),
.modal-employee-manage-table td:nth-child(5),
.modal-employee-manage-table th:nth-child(6),
.modal-employee-manage-table td:nth-child(6) {
  width: auto;
}

.modal-employee-manage-table th:nth-child(7),
.modal-employee-manage-table td:nth-child(7) {
  width: 92px;
}

.modal-transaction-import-table th:nth-child(2),
.modal-transaction-import-table td:nth-child(2),
.modal-transaction-import-table th:nth-child(9),
.modal-transaction-import-table td:nth-child(9) {
  width: 120px;
}

.modal-transaction-import-table th:nth-child(6),
.modal-transaction-import-table td:nth-child(6) {
  width: 190px;
}

.modal-transaction-import-table th.number,
.modal-transaction-import-table td.number {
  width: 96px;
}

.modal-transaction-import-table th:nth-child(10),
.modal-transaction-import-table td:nth-child(10) {
  width: auto;
}

.modal-original-import-table th:nth-child(1),
.modal-original-import-table td:nth-child(1),
.modal-original-import-table th:nth-child(3),
.modal-original-import-table td:nth-child(3) {
  width: auto;
}

.category-detail-table table {
  table-layout: fixed;
}

.category-detail-table th:nth-child(1),
.category-detail-table td:nth-child(1) {
  width: 80px;
}

.category-detail-table th:nth-child(2),
.category-detail-table td:nth-child(2),
.category-detail-table th:nth-child(3),
.category-detail-table td:nth-child(3) {
  width: 56px;
  text-align: center;
}

.category-detail-table th:nth-child(4),
.category-detail-table td:nth-child(4) {
  width: 150px;
}

.category-detail-table th:nth-child(5),
.category-detail-table td:nth-child(5) {
  width: auto;
}

.category-detail-table th:nth-child(6),
.category-detail-table td:nth-child(6),
.category-detail-table th:nth-child(7),
.category-detail-table td:nth-child(7) {
  width: 132px;
}

.operator-request-table th:nth-child(1),
.operator-request-table td:nth-child(1),
.operator-request-table th:nth-child(2),
.operator-request-table td:nth-child(2),
.operator-user-table th:nth-child(1),
.operator-user-table td:nth-child(1),
.operator-user-table th:nth-child(2),
.operator-user-table td:nth-child(2) {
  width: 118px;
}

.operator-request-table th:nth-child(3),
.operator-request-table td:nth-child(3),
.operator-user-table th:nth-child(3),
.operator-user-table td:nth-child(3),
.operator-user-table th:nth-child(4),
.operator-user-table td:nth-child(4) {
  width: 82px;
}

.operator-request-table th:nth-child(5),
.operator-request-table td:nth-child(5),
.operator-user-table th:nth-child(5),
.operator-user-table td:nth-child(5) {
  width: 140px;
}

.operator-request-table th:nth-child(6),
.operator-request-table td:nth-child(6),
.operator-user-table th:nth-child(6),
.operator-user-table td:nth-child(6) {
  width: 120px;
}

.category-summary-table {
  width: 720px;
  min-width: 720px;
}

.category-summary-table th:nth-child(1),
.category-summary-table td:nth-child(1),
.factory-summary-table th:nth-child(1),
.factory-summary-table td:nth-child(1) {
  width: 56px;
}

.category-summary-table th:nth-child(2),
.category-summary-table td:nth-child(2) {
  width: 72px;
}

.category-summary-table th:nth-child(3),
.category-summary-table td:nth-child(3),
.factory-summary-table th:nth-child(2),
.factory-summary-table td:nth-child(2) {
  width: auto;
}

.category-summary-table th:nth-child(4),
.category-summary-table td:nth-child(4),
.category-summary-table th:nth-child(5),
.category-summary-table td:nth-child(5) {
  width: 126px;
}

.category-summary-table th:nth-child(6),
.category-summary-table td:nth-child(6) {
  width: 90px !important;
}

.factory-summary-table {
  min-width: 780px;
}

.factory-summary-table th,
.factory-summary-table td {
  height: 30px;
  padding: 4px 8px;
}

.factory-summary-table th:nth-child(2),
.factory-summary-table td:nth-child(2) {
  width: 140px;
}

.factory-summary-table th:nth-child(n+3),
.factory-summary-table td:nth-child(n+3) {
  width: 88px;
}

.factory-summary-table th:nth-child(8),
.factory-summary-table td:nth-child(8),
.factory-summary-table th:nth-child(9),
.factory-summary-table td:nth-child(9),
.factory-summary-table th:nth-child(10),
.factory-summary-table td:nth-child(10) {
  width: 76px;
}

.factory-summary-table .factory-last-payment-signature {
  text-align: center;
}

.factory-summary-table .compact-signature {
  width: 24px;
  height: 24px;
  font-size: 14px;
}

.factory-summary-table .factory-last-payment-text {
  display: inline-block;
  max-width: 64px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-income-table {
  width: 100%;
  min-width: 760px;
  table-layout: fixed;
}

.account-income-table th:nth-child(1),
.account-income-table td:nth-child(1),
.wage-summary-table th:nth-child(1),
.wage-summary-table td:nth-child(1),
.wage-summary-table th:nth-child(2),
.wage-summary-table td:nth-child(2) {
  width: 72px;
}

.account-income-table th:nth-child(2),
.account-income-table td:nth-child(2) {
  width: auto;
}

.account-income-table th:nth-child(4),
.account-income-table td:nth-child(4) {
  width: 72px !important;
}

.account-income-table th:nth-child(3),
.account-income-table td:nth-child(3) {
  width: 132px;
}

.account-income-table th:nth-child(5),
.account-income-table td:nth-child(5) {
  width: auto;
}

.wage-summary-table {
  width: 100%;
  min-width: 440px;
  max-width: none;
}

.wage-page-panel {
  min-height: calc(100vh - 220px);
  display: flex;
  flex-direction: column;
}

.wage-table-wrap {
  flex: 1;
  min-height: 420px;
}

.wage-summary-table th:nth-child(3),
.wage-summary-table td:nth-child(3) {
  width: 132px;
}

.wage-summary-table th:nth-child(4),
.wage-summary-table td:nth-child(4),
.wage-summary-table th:nth-child(6),
.wage-summary-table td:nth-child(6),
.wage-summary-table th:nth-child(7),
.wage-summary-table td:nth-child(7) {
  width: 84px;
}

.wage-summary-table th:nth-child(5),
.wage-summary-table td:nth-child(5) {
  width: 132px;
}

.income-shop-summary-table,
.income-subject-summary-table {
  min-width: 1320px;
}

.income-shop-summary-table th:first-child,
.income-shop-summary-table td:first-child,
.income-subject-summary-table th:first-child,
.income-subject-summary-table td:first-child {
  left: 0;
  width: 54px;
  min-width: 54px;
  max-width: 54px;
}

.income-shop-summary-table th:nth-child(2),
.income-shop-summary-table td:nth-child(2),
.income-subject-summary-table th:nth-child(2),
.income-subject-summary-table td:nth-child(2) {
  left: 54px;
  width: 150px;
  min-width: 150px;
  max-width: 150px;
}

.income-shop-summary-table th:first-child,
.income-shop-summary-table th:nth-child(2),
.income-shop-summary-table td:first-child,
.income-shop-summary-table td:nth-child(2),
.income-subject-summary-table th:first-child,
.income-subject-summary-table th:nth-child(2),
.income-subject-summary-table td:first-child,
.income-subject-summary-table td:nth-child(2) {
  position: sticky;
  background: #ffffff;
  box-shadow: 1px 0 0 var(--line);
}

.income-shop-summary-table th:first-child,
.income-shop-summary-table th:nth-child(2),
.income-subject-summary-table th:first-child,
.income-subject-summary-table th:nth-child(2) {
  top: 0;
  z-index: 24;
  background: #fff5d8;
}

.income-shop-summary-table td:first-child,
.income-shop-summary-table td:nth-child(2),
.income-subject-summary-table td:first-child,
.income-subject-summary-table td:nth-child(2) {
  z-index: 16;
}

.income-shop-summary-table .total-row td:first-child,
.income-shop-summary-table .total-row td:nth-child(2),
.income-subject-summary-table .total-row td:first-child,
.income-subject-summary-table .total-row td:nth-child(2) {
  background: #fff0c2;
}

.income-shop-summary-table th.number,
.income-shop-summary-table td.number,
.income-subject-summary-table th.number,
.income-subject-summary-table td.number {
  width: 90px;
}

.income-quarter-summary-table {
  min-width: 1100px;
}

.income-quarter-summary-table th:first-child,
.income-quarter-summary-table td:first-child {
  left: 0;
  width: 54px;
  min-width: 54px;
  max-width: 54px;
}

.income-quarter-summary-table th:nth-child(2),
.income-quarter-summary-table td:nth-child(2) {
  left: 54px;
  width: 130px;
  min-width: 130px;
  max-width: 130px;
}

.income-quarter-summary-table th:first-child,
.income-quarter-summary-table th:nth-child(2),
.income-quarter-summary-table td:first-child,
.income-quarter-summary-table td:nth-child(2) {
  position: sticky;
  background: #ffffff;
  box-shadow: 1px 0 0 var(--line);
}

.income-quarter-summary-table th:first-child,
.income-quarter-summary-table th:nth-child(2) {
  top: 0;
  z-index: 24;
  background: #fff5d8;
}

.income-quarter-summary-table td:first-child,
.income-quarter-summary-table td:nth-child(2) {
  z-index: 16;
}

.income-quarter-summary-table .quarterly-subject-start td:first-child,
.income-quarter-summary-table .quarterly-subject-start td:nth-child(2) {
  background: #f7fbff;
}

.income-quarter-summary-table th:nth-child(3),
.income-quarter-summary-table td:nth-child(3) {
  width: 88px;
}

.income-quarter-summary-table th.number,
.income-quarter-summary-table td.number {
  width: 116px;
}

.rolling-sales-table {
  min-width: 1680px;
}

.rolling-sales-table th:nth-child(1),
.rolling-sales-table td:nth-child(1) {
  width: 54px;
  min-width: 54px;
  max-width: 54px;
}

.rolling-sales-table th:nth-child(2),
.rolling-sales-table td:nth-child(2) {
  left: 54px;
  width: 88px;
  min-width: 88px;
  max-width: 88px;
}

.rolling-sales-table th:nth-child(3),
.rolling-sales-table td:nth-child(3) {
  left: 142px;
  width: 110px;
  min-width: 110px;
  max-width: 110px;
}

.rolling-sales-table th:nth-child(4),
.rolling-sales-table td:nth-child(4) {
  left: 252px;
  width: 150px;
  min-width: 150px;
  max-width: 150px;
}

.rolling-sales-table th.number,
.rolling-sales-table td.number {
  width: 92px;
}

.rolling-sales-table th:nth-last-child(2),
.rolling-sales-table td:nth-last-child(2),
.rolling-sales-table th:last-child,
.rolling-sales-table td:last-child {
  width: 92px;
}

.base-factory-table,
.base-shop-table,
.base-relation-table {
  min-width: 980px;
}

.base-category-table,
.base-platform-table,
.base-account-table,
.base-subject-table,
.base-employee-table {
  min-width: 760px;
}

.operator-request-table {
  width: 720px;
}

.operator-user-table {
  width: 760px;
}

.operator-request-table th:nth-child(1),
.operator-request-table td:nth-child(1),
.operator-request-table th:nth-child(2),
.operator-request-table td:nth-child(2),
.operator-request-table th:nth-child(3),
.operator-request-table td:nth-child(3),
.operator-user-table th:nth-child(1),
.operator-user-table td:nth-child(1),
.operator-user-table th:nth-child(2),
.operator-user-table td:nth-child(2) {
  width: 120px;
}

.operator-request-table th:nth-child(4),
.operator-request-table td:nth-child(4) {
  width: 260px;
}

.operator-request-table th:nth-child(5),
.operator-request-table td:nth-child(5),
.operator-user-table th:nth-child(6),
.operator-user-table td:nth-child(6) {
  width: 120px;
}

.operator-user-table th:nth-child(3),
.operator-user-table td:nth-child(3),
.operator-user-table th:nth-child(4),
.operator-user-table td:nth-child(4),
.operator-user-table th:nth-child(5),
.operator-user-table td:nth-child(5) {
  width: 100px;
}

.operator-user-table th:nth-child(3),
.operator-user-table td:nth-child(3),
.operator-user-table th:nth-child(5),
.operator-user-table td:nth-child(5) {
  width: 132px;
}

.operator-user-table select {
  width: 100%;
  min-width: 0;
}

.base-category-table {
  width: 820px;
}

.base-platform-table {
  width: 620px;
  min-width: 620px;
  max-width: 760px;
}

.base-shop-table th:last-child,
.base-shop-table td:last-child {
  width: 112px !important;
}

.base-account-table {
  width: 700px;
}

.base-subject-table {
  width: 650px;
}

.base-employee-table {
  width: 760px;
  min-width: 760px;
}

.master-data-layout .dense-data-table th:nth-child(1),
.master-data-layout .dense-data-table td:nth-child(1) {
  width: 54px;
}

.master-data-layout .dense-data-table th:nth-child(2),
.master-data-layout .dense-data-table td:nth-child(2) {
  width: 68px;
}

.master-data-layout .dense-data-table th.number,
.master-data-layout .dense-data-table td.number {
  width: 78px;
}

.master-data-layout .dense-data-table th:last-child,
.master-data-layout .dense-data-table td:last-child,
.master-data-layout .dense-data-table th:nth-last-child(2),
.master-data-layout .dense-data-table td:nth-last-child(2) {
  width: 96px;
}

.base-factory-table th:nth-child(3),
.base-factory-table td:nth-child(3),
.base-shop-table th:nth-child(3),
.base-shop-table td:nth-child(3),
.base-account-table th:nth-child(3),
.base-account-table td:nth-child(3),
.base-subject-table th:nth-child(3),
.base-subject-table td:nth-child(3) {
  width: 170px;
}

.base-account-table th:nth-child(3),
.base-account-table td:nth-child(3) {
  width: 220px;
}

.base-subject-table th:nth-child(3),
.base-subject-table td:nth-child(3) {
  width: 160px;
}

.base-category-table th:nth-child(3),
.base-category-table td:nth-child(3),
.base-employee-table th:nth-child(4),
.base-employee-table td:nth-child(4) {
  width: 76px;
}

.base-category-table th:nth-child(4),
.base-category-table td:nth-child(4) {
  width: 260px;
}

.base-category-table th:nth-child(5),
.base-category-table td:nth-child(5) {
  width: 86px;
}

.base-category-table th:nth-child(6),
.base-category-table td:nth-child(6),
.base-platform-table th:nth-child(5),
.base-platform-table td:nth-child(5),
.base-account-table th:nth-child(4),
.base-account-table td:nth-child(4),
.base-subject-table th:nth-child(5),
.base-subject-table td:nth-child(5),
.base-relation-table th:nth-child(7),
.base-relation-table td:nth-child(7) {
  width: 86px;
}

.base-platform-table th:nth-child(3),
.base-platform-table td:nth-child(3) {
  width: 150px;
}

.base-platform-table th:nth-child(4),
.base-platform-table td:nth-child(4) {
  width: 86px;
}

.base-platform-table th:nth-child(6),
.base-platform-table td:nth-child(6),
.base-platform-table th:nth-child(7),
.base-platform-table td:nth-child(7) {
  width: 96px;
}

.base-account-table th:nth-child(5),
.base-account-table td:nth-child(5),
.base-subject-table th:nth-child(4),
.base-subject-table td:nth-child(4) {
  width: 92px;
}

.base-account-table th:nth-child(7),
.base-account-table td:nth-child(7),
.base-subject-table th:nth-child(7),
.base-subject-table td:nth-child(7) {
  width: 78px;
}

.base-employee-table th:nth-child(3),
.base-employee-table td:nth-child(3) {
  width: 110px;
}

.base-employee-table th:nth-child(5),
.base-employee-table td:nth-child(5) {
  width: 160px;
}

.base-employee-table th:nth-child(6),
.base-employee-table td:nth-child(6) {
  width: 180px;
}

.base-employee-table th:nth-child(7),
.base-employee-table td:nth-child(7) {
  width: 78px;
}

.base-relation-table th:nth-child(3),
.base-relation-table td:nth-child(3),
.base-relation-table th:nth-child(4),
.base-relation-table td:nth-child(4),
.base-relation-table th:nth-child(5),
.base-relation-table td:nth-child(5) {
  width: 150px;
}

.base-relation-table th:nth-child(6),
.base-relation-table td:nth-child(6) {
  width: 96px;
}

.check-uncategorized-table,
.check-factory-table,
.check-payroll-table,
.check-payroll-compare-table {
  width: auto;
  min-width: 980px;
}

.check-uncategorized-table {
  min-width: 1060px;
}

.check-factory-table {
  min-width: 1040px;
}

.check-payroll-table {
  min-width: 980px;
}

.check-payroll-compare-table {
  min-width: 920px;
}

.check-uncategorized-table th:nth-child(1),
.check-uncategorized-table td:nth-child(1),
.check-uncategorized-table th:nth-child(2),
.check-uncategorized-table td:nth-child(2),
.check-uncategorized-table th:nth-child(3),
.check-uncategorized-table td:nth-child(3),
.check-factory-table th:nth-child(2),
.check-factory-table td:nth-child(2),
.check-factory-table th:nth-child(3),
.check-factory-table td:nth-child(3),
.check-factory-table th:nth-child(4),
.check-factory-table td:nth-child(4),
.check-payroll-table th:nth-child(1),
.check-payroll-table td:nth-child(1),
.check-payroll-table th:nth-child(2),
.check-payroll-table td:nth-child(2),
.check-payroll-table th:nth-child(3),
.check-payroll-table td:nth-child(3) {
  width: 54px;
}

.check-uncategorized-table th:nth-child(5),
.check-uncategorized-table td:nth-child(5) {
  width: 82px;
}

.check-factory-table th:nth-child(1),
.check-factory-table td:nth-child(1),
.check-payroll-compare-table th:nth-child(1),
.check-payroll-compare-table td:nth-child(1) {
  width: 78px;
}

.check-uncategorized-table th:nth-child(4),
.check-uncategorized-table td:nth-child(4),
.check-factory-table th:nth-child(5),
.check-factory-table td:nth-child(5),
.check-payroll-table th:nth-child(4),
.check-payroll-table td:nth-child(4) {
  width: 150px;
}

.check-payroll-compare-table th:nth-child(2),
.check-payroll-compare-table td:nth-child(2),
.check-payroll-compare-table th:nth-child(3),
.check-payroll-compare-table td:nth-child(3),
.check-payroll-compare-table th:nth-child(4),
.check-payroll-compare-table td:nth-child(4) {
  width: 98px;
}

.check-uncategorized-table th:nth-child(10),
.check-uncategorized-table td:nth-child(10),
.check-factory-table th:nth-child(9),
.check-factory-table td:nth-child(9),
.check-payroll-table th:nth-child(8),
.check-payroll-table td:nth-child(8) {
  width: 168px;
}

.check-uncategorized-table th:nth-child(6),
.check-uncategorized-table td:nth-child(6),
.check-factory-table th:nth-child(6),
.check-factory-table td:nth-child(6),
.check-payroll-table th:nth-child(5),
.check-payroll-table td:nth-child(5) {
  width: 180px;
}

.check-uncategorized-table .compact-actions,
.check-factory-table .compact-actions,
.check-payroll-table .compact-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px;
}

.check-uncategorized-table .compact-actions .text-button,
.check-factory-table .compact-actions .text-button,
.check-payroll-table .compact-actions .text-button {
  max-width: 74px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.check-factory-table th:nth-child(8),
.check-factory-table td:nth-child(8),
.check-payroll-table th:nth-child(7),
.check-payroll-table td:nth-child(7) {
  width: 180px;
}

.check-payroll-compare-table th:nth-child(8),
.check-payroll-compare-table td:nth-child(8) {
  width: 220px;
}

.audit-table {
  width: 900px;
  min-width: 900px;
}

.audit-table th:nth-child(1),
.audit-table td:nth-child(1) {
  width: 155px;
}

.audit-table th:nth-child(2),
.audit-table td:nth-child(2),
.audit-table th:nth-child(3),
.audit-table td:nth-child(3) {
  width: 90px;
}

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

.audit-table th:nth-child(5),
.audit-table td:nth-child(5) {
  width: 145px;
}

.audit-table th:nth-child(6),
.audit-table td:nth-child(6) {
  width: 300px;
}

#view-category .panel,
#view-center .panel,
#view-base .panel,
#view-check .panel,
#view-audit .panel {
  width: 100%;
  max-width: none;
}

#view-entry .panel {
  width: 100%;
  max-width: none;
}

#view-category .table-wrap,
#view-center .table-wrap,
#view-base .table-wrap,
#view-check .table-wrap,
#view-audit .table-wrap {
  width: 100%;
  max-width: 100%;
}

#view-entry .table-wrap {
  width: 100%;
  max-width: 100%;
}

#view-center .import-action-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.category-summary-table,
.operator-request-table,
.operator-user-table,
.audit-table {
  width: 100%;
  max-width: none;
  table-layout: fixed;
}

.category-summary-table {
  min-width: 720px;
}

.operator-request-table,
.operator-user-table {
  min-width: 760px;
}

.audit-table {
  min-width: 900px;
}

.base-factory-table,
.base-shop-table,
.base-relation-table {
  width: 100%;
  max-width: none;
  min-width: 980px;
  table-layout: fixed;
}

.base-category-table,
.base-platform-table,
.base-account-table,
.base-subject-table,
.base-employee-table {
  width: 100%;
  max-width: none;
  min-width: 760px;
  table-layout: fixed;
}

.check-uncategorized-table,
.check-factory-table,
.check-payroll-table,
.check-payroll-compare-table {
  width: 100%;
  max-width: none;
  table-layout: fixed;
}

@media (max-width: 720px) {
  #view-category .table-wrap,
  #view-center .table-wrap,
  #view-base .table-wrap,
  #view-check .table-wrap,
  #view-audit .table-wrap,
  #view-entry .table-wrap {
    margin-inline: -10px;
    max-width: calc(100% + 20px);
    border-right: 0;
    border-left: 0;
    border-radius: 0;
  }

  #view-center .import-action-grid {
    grid-template-columns: 1fr;
  }
}

#view-entry,
#view-entry input,
#view-entry select,
#view-entry button,
#view-entry table {
  font-size: inherit;
  font-weight: inherit;
}

#view-entry th,
#view-entry td {
  padding: 7px 8px;
}

#view-entry .table-wrap {
  border-radius: 10px;
}

#view-entry table {
  table-layout: fixed;
  min-width: 980px;
}

#view-entry th:nth-child(1),
#view-entry td:nth-child(1) {
  width: 58px;
}

#view-entry th:nth-child(2),
#view-entry td:nth-child(2),
#view-entry th:nth-child(3),
#view-entry td:nth-child(3) {
  width: 44px;
}

#view-entry th:nth-child(4),
#view-entry td:nth-child(4) {
  width: 150px;
}

#view-entry th:nth-child(5),
#view-entry td:nth-child(5) {
  width: 58px;
}

#view-entry th:nth-child(6),
#view-entry td:nth-child(6) {
  width: auto;
}

#view-entry th:nth-child(7),
#view-entry td:nth-child(7),
#view-entry th:nth-child(8),
#view-entry td:nth-child(8) {
  width: 98px;
}

#view-entry th:nth-child(9),
#view-entry td:nth-child(9) {
  width: 128px;
}

#view-entry .entry-form input,
#view-entry .entry-form select {
  height: 34px;
}

#view-account .table-wrap {
  max-height: calc(100vh - 150px);
}

#view-account table {
  table-layout: fixed;
}

#view-account th:nth-child(1),
#view-account td:nth-child(1) {
  width: 58px;
}

#view-account th:nth-child(2),
#view-account td:nth-child(2) {
  width: 185px;
}

#view-account th:nth-child(3),
#view-account td:nth-child(3),
#view-account th:nth-child(4),
#view-account td:nth-child(4),
#view-account th:nth-child(5),
#view-account td:nth-child(5),
#view-account th:nth-child(6),
#view-account td:nth-child(6),
#view-account th:nth-child(7),
#view-account td:nth-child(7) {
  width: 126px;
}

#view-account th:nth-child(8),
#view-account td:nth-child(8) {
  width: 140px;
}

#view-account .account-ledger-table th:nth-child(1),
#view-account .account-ledger-table td:nth-child(1) {
  width: 92px;
}

#view-account .account-ledger-table th:nth-child(2),
#view-account .account-ledger-table td:nth-child(2) {
  width: 150px;
}

#view-account .account-ledger-table th:nth-child(3),
#view-account .account-ledger-table td:nth-child(3) {
  width: 72px;
}

#view-account .account-ledger-table th:nth-child(4),
#view-account .account-ledger-table td:nth-child(4) {
  width: 220px;
}

#view-account .account-ledger-table th:nth-child(5),
#view-account .account-ledger-table td:nth-child(5),
#view-account .account-ledger-table th:nth-child(6),
#view-account .account-ledger-table td:nth-child(6),
#view-account .account-ledger-table th:nth-child(7),
#view-account .account-ledger-table td:nth-child(7) {
  width: 112px;
}

#view-account .account-ledger-table th:nth-child(8),
#view-account .account-ledger-table td:nth-child(8) {
  width: 120px;
}

#view-income table {
  table-layout: fixed;
}

#view-income th:nth-child(1),
#view-income td:nth-child(1) {
  width: 80px;
}

#view-income th:nth-child(2),
#view-income td:nth-child(2) {
  width: 180px;
}

#view-income th:nth-child(3),
#view-income td:nth-child(3),
#view-income th:nth-child(5),
#view-income td:nth-child(5) {
  width: 130px;
}

#view-income th:nth-child(4),
#view-income td:nth-child(4) {
  width: auto;
}

.sub-panel-head {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.payroll-check-action-row {
  display: flex;
  justify-content: flex-end;
  margin: -4px 0 12px;
}

.payroll-check-button {
  min-width: 140px;
  font-weight: 700;
}

.payroll-simple-actions label {
  display: grid;
  gap: 4px;
  min-width: 140px;
  color: var(--muted);
  font-size: 12px;
}

.tag-list,
.code-list {
  gap: 5px;
  max-height: 190px;
}

.tag,
.code-chip {
  min-height: 26px;
  padding: 4px 7px;
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.25;
}

.warning-item {
  padding: 7px 0;
  font-size: 13px;
}

.bar-track {
  height: 14px;
}

.rank-row {
  padding: 7px 0;
}

.modal {
  border-radius: 12px;
  padding: 14px;
}

.modal-table {
  max-height: 68vh;
}

#factoryLedgerModal .wide-modal {
  width: min(1320px, calc(100vw - 48px));
}

.factory-ledger-table-wrap {
  overflow: auto;
}

.factory-ledger-table {
  min-width: 1080px;
  table-layout: fixed;
}

.factory-ledger-table .col-seq {
  width: 52px;
}

.factory-ledger-table .col-type {
  width: 82px;
}

.factory-ledger-table .col-year {
  width: 68px;
}

.factory-ledger-table .col-month,
.factory-ledger-table .col-day {
  width: 54px;
}

.factory-ledger-table .col-account {
  width: 132px;
}

.factory-ledger-table .col-category {
  width: 72px;
}

.factory-ledger-table .col-summary {
  width: auto;
}

.factory-ledger-table .col-money {
  width: 106px;
}

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

.factory-ledger-table .account-cell,
.factory-ledger-table .summary-cell {
  overflow: hidden;
  text-overflow: ellipsis;
}

.payroll-extra-summary-row td {
  background: #fff9e8;
  font-weight: 800;
}

.payroll-extra-summary-row .link-cell {
  color: #b06f00;
}

.ledger-summary {
  gap: 8px;
  margin-bottom: 10px;
}

.ledger-summary span {
  min-height: 28px;
  border-radius: 8px;
  font-size: 13px;
}

.toast {
  border-radius: 10px;
}

.cover-hero {
  display: grid;
  grid-template-columns: minmax(390px, 0.95fr) minmax(520px, 1.05fr);
  gap: 16px;
  align-items: stretch;
  margin-bottom: 14px;
}

.cover-copy,
.cover-board {
  min-width: 0;
  border: 1px solid #d8e5ea;
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 16px 36px rgba(24, 48, 68, 0.08);
}

.cover-copy {
  position: relative;
  overflow: hidden;
  padding: 34px;
  display: grid;
  align-content: center;
  background:
    linear-gradient(135deg, rgba(20, 74, 92, 0.05) 0%, rgba(255, 255, 255, 0) 42%),
    #ffffff;
}

.cover-copy::after {
  content: "";
  position: absolute;
  right: -72px;
  bottom: -88px;
  width: 220px;
  height: 220px;
  border: 1px solid rgba(31, 111, 139, 0.16);
  border-radius: 50%;
  pointer-events: none;
}

.cover-eyebrow {
  display: inline-flex;
  width: fit-content;
  min-height: 28px;
  align-items: center;
  padding: 0 10px;
  border-radius: 999px;
  color: #0f6f79;
  background: #e7f5f4;
  font-size: 12px;
  font-weight: 800;
}

.cover-copy h2 {
  margin-top: 16px;
  max-width: 620px;
  color: #143044;
  font-size: clamp(34px, 3.6vw, 50px);
  line-height: 1.1;
}

.cover-lede {
  margin: 10px 0 0;
  max-width: 520px;
  color: #496173;
  font-size: 16px;
  line-height: 1.65;
  font-weight: 700;
}

.cover-copyright {
  margin: 12px 0 0;
  color: #81919d;
  font-size: 12px;
  font-weight: 700;
}

.cover-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 26px;
}

.cover-board {
  padding: 18px;
  background:
    linear-gradient(180deg, #f8fbfb 0%, #ffffff 100%);
}

.cover-board-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  color: #334c5f;
  font-size: 15px;
  font-weight: 800;
}

.cover-kpis {
  grid-template-columns: repeat(2, minmax(150px, 1fr));
  gap: 10px;
}

.cover-kpis .kpi {
  min-height: 116px;
  padding: 14px;
  border-left-width: 0;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 10px 22px rgba(24, 48, 68, 0.06);
}

.cover-kpis .kpi-value {
  margin-top: 8px;
  font-size: 24px;
}

.cover-workbench {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(260px, 0.8fr);
  gap: 12px;
}

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

.quick-tile {
  min-height: 88px;
  padding: 14px;
  border: 1px solid #dce8ed;
  border-radius: 12px;
  background: linear-gradient(180deg, #ffffff 0%, #f7fbfb 100%);
  color: var(--text);
  text-align: left;
  box-shadow: 0 8px 18px rgba(24, 48, 68, 0.04);
}

.quick-tile strong,
.quick-tile span {
  display: block;
}

.quick-tile strong {
  font-size: 14px;
}

.quick-tile span {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.quick-tile:hover {
  border-color: #a8c8d7;
  background: #f2f8f9;
  transform: translateY(-1px);
}

.attention-panel .compact-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.attention-panel .warning-item {
  min-height: 56px;
  padding: 10px 12px;
  border: 1px solid #dce8ed;
  border-radius: 10px;
  background: #f8fbfb;
}

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

.status-list div {
  display: grid;
  grid-template-columns: 80px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-height: 34px;
  border-bottom: 1px solid var(--line);
}

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

.status-list strong {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 13px;
}

.entry-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 44px;
  margin: -4px 0 12px;
  padding: 9px 12px;
  border: 1px solid #d7e3e9;
  border-radius: 10px;
  background: linear-gradient(180deg, #fbfdfe 0%, #f4f8fa 100%);
}

.entry-toolbar span {
  min-width: 0;
  color: #354f63;
  font-size: 13px;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.entry-toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  justify-content: flex-end;
}

.entry-toolbar-actions .line-button,
.entry-toolbar-actions .danger-button {
  min-height: 32px;
  padding: 6px 12px;
  font-size: 13px;
}

.account-recent-box {
  margin: -2px 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f7fafc;
  overflow: hidden;
}

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

.account-recent-head h3 {
  margin: 0;
  color: var(--text);
  font-size: 14px;
}

.account-recent-head span {
  min-width: 0;
  color: #31546d;
  font-size: 13px;
  font-weight: 800;
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.compact-table {
  max-height: 240px;
}

.compact-table th,
.compact-table td {
  padding: 7px 10px;
}

.danger-button {
  color: #a33a2b;
  border-color: #edc8c2;
  background: #fff4f2;
}

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

@media (max-width: 1120px) {
  .batch-entry-line {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .cover-hero,
  .cover-workbench {
    grid-template-columns: 1fr;
  }

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

  .entry-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

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

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

  .account-recent-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .account-recent-head span {
    text-align: left;
    white-space: normal;
  }

  .entry-toolbar-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 720px) {
  .topbar {
    padding: 12px;
  }

  .view-tabs {
    overflow-x: auto;
  }

  .tab-button {
    flex: 0 0 auto;
  }

  .cover-copy {
    padding: 20px;
  }

  .quick-grid {
    grid-template-columns: 1fr;
  }

  .import-action-grid {
    grid-template-columns: 1fr;
  }

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

  .account-mode-cards,
  .account-period-bar {
    grid-template-columns: 1fr;
  }

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

/* Golden PETCIRCLE home refresh */
:root {
  --bg: #fff8ea;
  --surface: #ffffff;
  --surface-soft: #fffaf0;
  --surface-tint: #fff4d6;
  --line: #eadfce;
  --text: #2d241c;
  --muted: #746b61;
  --blue: #d99006;
  --blue-dark: #b77400;
  --jade: #13804e;
  --amber: #d99006;
  --danger: #d9482e;
  --gold: #e7a71d;
  --gold-soft: #fff3c4;
  --red: #c83d27;
  --shadow: 0 14px 34px rgba(151, 96, 14, 0.09);
}

body {
  background:
    radial-gradient(circle at 74% 3%, rgba(244, 199, 93, 0.28), transparent 28%),
    linear-gradient(180deg, #fffaf1 0%, #fff6e7 48%, #f8efe0 100%);
  color: var(--text);
}

.app-shell {
  grid-template-columns: 230px minmax(0, 1fr);
}

.sidebar {
  background: rgba(255, 255, 255, 0.78);
  color: var(--text);
  border-right: 1px solid rgba(217, 159, 62, 0.24);
  box-shadow: 8px 0 28px rgba(141, 99, 35, 0.08);
  backdrop-filter: blur(18px);
}

.brand {
  min-height: 88px;
  border-bottom: 0;
}

.brand-mark.image-mark {
  width: 58px;
  height: 58px;
  border-radius: 15px;
  object-fit: cover;
  background: #fff3c5;
  box-shadow: 0 10px 22px rgba(190, 120, 14, 0.18);
}

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

.brand-title {
  color: #241a12;
  font-size: 24px;
  letter-spacing: 0;
}

.brand-subtitle {
  margin-top: 3px;
  color: #8d7a5f;
}

.nav-list {
  gap: 9px;
  margin-top: 18px;
}

.nav-item {
  height: 46px;
  color: #51483f;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 700;
}

.nav-item span {
  width: 26px;
  height: 26px;
  color: #725116;
  border-color: #ead8af;
  background: #fff9e9;
  font-size: 13px;
}

.nav-item:hover,
.nav-item.active {
  color: #ffffff;
  background: linear-gradient(135deg, #db9508 0%, #f4c35a 100%);
  box-shadow: 0 10px 22px rgba(210, 140, 12, 0.22);
}

.nav-item:hover span,
.nav-item.active span {
  color: #8a5b00;
  border-color: rgba(255, 255, 255, 0.55);
  background: rgba(255, 255, 255, 0.76);
}

.nav-submenu {
  display: none;
  gap: 3px;
  padding: 2px 0 8px 42px;
}

.nav-item.active + .nav-submenu,
.nav-submenu.active {
  display: grid;
}

.nav-subitem {
  min-height: 28px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #8c6a24;
  text-align: left;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  padding: 5px 8px;
}

.nav-subitem:hover,
.nav-subitem.active {
  background: #fff1c9;
  color: #6e4700;
}

.sidebar-tools {
  padding-bottom: 18px;
}

.sidebar-tools .status-pill,
.sidebar-tools .file-pill {
  background: #fff6dc;
  color: #8a5b00;
  border: 1px solid #ecd59c;
}

.main {
  padding: 24px;
}

.home-topbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 18px;
  min-height: 38px;
  margin-bottom: 12px;
}

.home-search {
  width: min(280px, 32vw);
  height: 36px;
  display: flex;
  align-items: center;
  padding: 0 14px;
  color: #8c8174;
  border: 1px solid rgba(222, 181, 103, 0.55);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
}

.home-user {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 9px;
  color: #3a2b20;
}

.home-user img {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #f0c86a;
  background: #fff9e8;
}

.home-bell,
.vip-pill {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  padding: 0 8px;
  border-radius: 999px;
  color: #9a6400;
  background: #fff2c4;
  font-size: 12px;
  font-weight: 800;
}

.user-role-pill {
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-action {
  min-height: 30px;
  padding: 0 12px;
  color: #9a6400;
  border-color: #e8c477;
  background: rgba(255, 251, 239, 0.78);
}

.topbar-action:hover {
  background: #fff2c4;
}

.cover-hero {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 300px;
  gap: 0;
  margin-bottom: 18px;
  overflow: hidden;
  border: 1px solid rgba(226, 199, 154, 0.72);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(255, 251, 241, 0.98) 0%, rgba(255, 249, 232, 0.94) 34%, rgba(255, 247, 222, 0.54) 56%, rgba(255, 247, 222, 0.08) 76%),
    url("./assets/cover-hero-soft.png") right bottom / auto 108% no-repeat,
    #ffffff;
  box-shadow: var(--shadow);
}

.cover-copy,
.cover-mascot-card,
.panel,
.cover-bottom-strip {
  border: 1px solid rgba(226, 199, 154, 0.72);
  box-shadow: var(--shadow);
}

.cover-copy {
  border-radius: 8px;
  width: min(690px, 58%);
  padding: 40px 44px;
  background: transparent;
  border: 0;
  box-shadow: none;
  position: relative;
  z-index: 2;
}

.cover-copy::after {
  border-color: rgba(222, 172, 68, 0.2);
}

.cover-eyebrow {
  color: #7b5108;
  background: #fff0ba;
}

.cover-copy h2 {
  max-width: 560px;
  color: #2a2119;
  font-size: clamp(38px, 3.4vw, 52px);
  font-weight: 900;
}

.cover-lede {
  max-width: 520px;
  color: #65584c;
  font-size: 17px;
  font-weight: 700;
}

.hero-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.hero-chip {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  border: 1px solid #ead8af;
  border-radius: 8px;
  color: #73572c;
  background: rgba(255, 255, 255, 0.76);
  font-size: 13px;
  font-weight: 700;
}

.hero-chip.safe {
  color: #16804f;
  background: #eef9ef;
  border-color: #c8ebcf;
}

.cover-actions {
  gap: 14px;
  margin-top: 34px;
}

.primary-button {
  background: linear-gradient(135deg, #d98a00 0%, #efb83e 100%);
  box-shadow: 0 10px 18px rgba(202, 125, 0, 0.18);
}

.primary-button:hover {
  background: linear-gradient(135deg, #c77c00 0%, #e5aa27 100%);
}

.ghost-button,
.line-button {
  color: #b06f00;
  background: #fffaf0;
  border-color: #e8c983;
}

.text-button,
.link-cell {
  color: #c07700;
}

.cover-mascot-card {
  display: none;
}

.cover-mascot-card img {
  width: min(330px, 100%);
  height: min(278px, 100%);
  object-fit: contain;
  object-position: right bottom;
  filter: drop-shadow(0 26px 32px rgba(154, 88, 0, 0.22));
}

.cover-overview-grid {
  display: grid;
  grid-template-columns: minmax(330px, 0.82fr) minmax(650px, 1.35fr);
  gap: 16px;
  align-items: stretch;
  margin-bottom: 0;
}

.cover-todo-panel,
.cover-month-panel {
  min-height: 318px;
}

.cover-todo-panel {
  background:
    linear-gradient(145deg, rgba(255, 251, 242, 0.96) 0%, rgba(255, 244, 216, 0.9) 100%),
    #ffffff;
}

.cover-month-panel {
  padding: 18px;
  background:
    linear-gradient(135deg, rgba(255, 253, 247, 0.98) 0%, rgba(255, 244, 216, 0.94) 58%, rgba(255, 235, 179, 0.72) 100%),
    #ffffff;
  border-color: rgba(220, 176, 81, 0.78);
}

.panel-subtitle {
  margin: 4px 0 0;
  color: #8a745b;
  font-size: 13px;
  font-weight: 700;
}

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

.cover-alert,
.cover-alert-summary,
.cover-metric,
.quick-tile {
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.cover-alert-summary {
  min-height: 112px;
  grid-column: 1 / -1;
  display: grid;
  align-content: center;
  justify-items: start;
  gap: 6px;
  padding: 18px 20px;
  border: 1px solid #e3bd52;
  border-radius: 8px;
  color: #3d2b16;
  background:
    linear-gradient(135deg, rgba(216, 139, 0, 0.92) 0%, rgba(240, 184, 62, 0.92) 100%),
    #e6a31c;
  text-align: left;
  box-shadow: 0 14px 28px rgba(180, 111, 0, 0.18);
}

.cover-alert-summary span,
.cover-alert-summary small {
  color: rgba(255, 255, 255, 0.9);
  font-weight: 800;
}

.cover-alert-summary strong {
  color: #ffffff;
  font-size: clamp(32px, 3vw, 46px);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.cover-alert-summary.ok {
  background:
    linear-gradient(135deg, rgba(35, 139, 88, 0.94) 0%, rgba(85, 181, 123, 0.9) 100%),
    #2f9a64;
}

.cover-alert {
  min-height: 74px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid #ead8af;
  border-radius: 8px;
  color: #4d3b28;
  background: #fffdf8;
  text-align: left;
}

.cover-alert strong {
  color: #d2472e;
  font-size: 18px;
  font-variant-numeric: tabular-nums;
}

.cover-alert.ok strong {
  color: #188152;
}

.cover-alert small {
  grid-column: 1 / -1;
  color: #8a745b;
  font-size: 12px;
  font-weight: 700;
}

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

.cover-metric {
  min-height: 138px;
  display: grid;
  align-content: center;
  justify-items: start;
  gap: 9px;
  padding: 18px;
  border: 1px solid #ead8af;
  border-radius: 8px;
  color: #36291e;
  background: #fffdf8;
  text-align: left;
}

.cover-metric.balance {
  min-height: 172px;
  grid-column: span 2;
  background:
    linear-gradient(135deg, #fff8df 0%, #ffffff 58%, #fff0bd 100%);
  border-color: #e1b85d;
}

.cover-metric .metric-label {
  color: #4a3a2d;
  font-weight: 800;
}

.cover-metric strong {
  color: #d48500;
  font-size: clamp(28px, 2.7vw, 44px);
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.cover-metric.balance strong {
  font-size: clamp(38px, 4.2vw, 64px);
}

.cover-metric small {
  color: #817366;
  line-height: 1.35;
  font-weight: 700;
}

.cover-metric.expense strong {
  color: #d94a34;
}

.cover-metric.balance strong,
.cover-metric.wage strong {
  color: #c88300;
}

.cover-alert:hover,
.cover-alert-summary:hover,
.cover-metric:hover,
.quick-tile:hover {
  transform: translateY(-2px);
  border-color: #e1b85d;
  box-shadow: 0 12px 24px rgba(174, 111, 20, 0.12);
}

.cover-workbench.refined {
  grid-template-columns: minmax(0, 1.25fr) minmax(300px, 0.75fr);
}

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

.quick-tile {
  min-height: 96px;
  border-radius: 8px;
  border-color: #ead8af;
  background: linear-gradient(180deg, #ffffff 0%, #fff9ec 100%);
}

.quick-tile strong {
  color: #2e241b;
}

.quick-tile span {
  color: #7b6d5f;
}

.panel {
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.88);
}

.panel-head h2 {
  color: #2d241c;
  font-size: 18px;
}

.panel-head-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.treasure-toggle {
  position: relative;
  width: 44px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #e3bd52;
  border-radius: 10px;
  color: #8d5a00;
  background:
    radial-gradient(circle at 28% 22%, rgba(255, 255, 255, 0.96) 0 8%, transparent 28%),
    linear-gradient(180deg, #fff9df 0%, #ffe4a2 100%);
  box-shadow: 0 6px 14px rgba(184, 112, 0, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.85);
  cursor: pointer;
  overflow: visible;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.treasure-toggle:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 18px rgba(184, 112, 0, 0.23), inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.treasure-toggle[aria-pressed="true"] {
  background:
    radial-gradient(circle at 28% 22%, rgba(255, 255, 255, 0.96) 0 8%, transparent 28%),
    linear-gradient(135deg, #ffcf48 0%, #e99400 48%, #bc6f00 100%);
}

.treasure-toggle::before {
  content: "";
  position: absolute;
  inset: -8px;
  border-radius: 16px;
  background:
    radial-gradient(circle, rgba(255, 236, 151, 0.75), transparent 58%),
    conic-gradient(from 0deg, transparent 0 18deg, rgba(255, 238, 137, 0.9) 20deg 24deg, transparent 27deg 68deg, rgba(255, 238, 137, 0.7) 70deg 74deg, transparent 78deg 360deg);
  opacity: 0;
  pointer-events: none;
  transform: scale(0.72) rotate(0deg);
}

.treasure-toggle.is-burst::before {
  animation: treasureGlow 620ms ease-out;
}

.treasure-icon {
  position: relative;
  width: 26px;
  height: 24px;
  display: inline-block;
}

.treasure-coin,
.treasure-ingot {
  position: absolute;
  inset: 2px 3px;
  transition: opacity 160ms ease, transform 200ms ease;
}

.treasure-coin {
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 2px solid #b86d00;
  background:
    radial-gradient(circle at 35% 25%, #fff7b4 0 18%, transparent 20%),
    radial-gradient(circle at 50% 50%, #ffd94a 0 52%, #e49a0b 72%, #b96d00 100%);
  color: #8d4f00;
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
  box-shadow: inset 0 -2px 0 rgba(150, 83, 0, 0.28), 0 2px 5px rgba(159, 88, 0, 0.28);
}

.treasure-ingot {
  opacity: 0;
  transform: translateY(2px) scale(0.82);
}

.treasure-ingot::before {
  content: "";
  position: absolute;
  left: 1px;
  right: 1px;
  top: 7px;
  height: 12px;
  border-radius: 4px 4px 9px 9px;
  background: linear-gradient(180deg, #fff095 0%, #f4b620 42%, #c97800 100%);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.7), inset 0 -2px 0 rgba(137, 74, 0, 0.28), 0 3px 6px rgba(159, 88, 0, 0.3);
  transform: perspective(28px) rotateX(14deg);
}

.treasure-ingot::after {
  content: "";
  position: absolute;
  left: 7px;
  right: 7px;
  top: 3px;
  height: 8px;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 30%, #fff8b6 0 18%, #ffd24a 48%, #d98900 100%);
}

.treasure-toggle.is-open .treasure-coin {
  opacity: 0;
  transform: translateY(-2px) rotate(-18deg) scale(0.72);
}

.treasure-toggle.is-open .treasure-ingot {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.treasure-toggle.is-burst .treasure-icon {
  animation: treasurePop 520ms ease-out;
}

.treasure-spark {
  position: absolute;
  width: 5px;
  height: 5px;
  border-radius: 1px;
  background: #fff3a3;
  box-shadow: 0 0 7px #ffcf36;
  opacity: 0;
  transform: rotate(45deg) scale(0.5);
}

.treasure-spark.s1 { left: -5px; top: 1px; }
.treasure-spark.s2 { right: -5px; top: 4px; }
.treasure-spark.s3 { left: 10px; bottom: -5px; }

.treasure-toggle.is-burst .treasure-spark.s1 { animation: treasureSpark 520ms ease-out 20ms; }
.treasure-toggle.is-burst .treasure-spark.s2 { animation: treasureSpark 520ms ease-out 90ms; }
.treasure-toggle.is-burst .treasure-spark.s3 { animation: treasureSpark 520ms ease-out 150ms; }

@keyframes treasureGlow {
  0% { opacity: 0; transform: scale(0.65) rotate(0deg); }
  42% { opacity: 1; transform: scale(1.1) rotate(18deg); }
  100% { opacity: 0; transform: scale(1.35) rotate(32deg); }
}

@keyframes treasurePop {
  0% { transform: scale(0.82) rotate(-8deg); }
  45% { transform: scale(1.18) rotate(5deg); }
  100% { transform: scale(1) rotate(0deg); }
}

@keyframes treasureSpark {
  0% { opacity: 0; transform: rotate(45deg) scale(0.4); }
  35% { opacity: 1; transform: rotate(45deg) scale(1.2); }
  100% { opacity: 0; transform: rotate(45deg) scale(0.3) translateY(-8px); }
}

.masked-value {
  letter-spacing: 2px;
}

.module-hero {
  position: relative;
  min-height: 128px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 14px;
  padding: 22px 28px;
  overflow: hidden;
  border: 1px solid rgba(226, 199, 154, 0.72);
  border-radius: 8px;
  background:
    radial-gradient(circle at 92% 20%, rgba(255, 224, 135, 0.58), transparent 30%),
    linear-gradient(135deg, rgba(255, 251, 241, 0.96) 0%, rgba(255, 246, 222, 0.78) 100%);
  box-shadow: var(--shadow);
}

.module-hero.compact {
  min-height: 104px;
  padding: 18px 24px;
}

.module-hero.quiet {
  background: linear-gradient(135deg, rgba(255, 253, 248, 0.96) 0%, rgba(255, 248, 230, 0.72) 100%);
}

.module-hero.alert {
  background:
    radial-gradient(circle at 92% 15%, rgba(255, 204, 122, 0.62), transparent 30%),
    linear-gradient(135deg, rgba(255, 250, 237, 0.98) 0%, rgba(255, 239, 217, 0.78) 100%);
}

.module-hero.no-dog {
  min-height: 88px;
}

.module-hero span {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  padding: 0 10px;
  border-radius: 999px;
  color: #8b5b00;
  background: #fff0ba;
  font-size: 12px;
  font-weight: 900;
}

.module-hero h2 {
  margin: 10px 0 7px;
  color: #2a2119;
  font-size: clamp(24px, 2.4vw, 34px);
  line-height: 1.12;
}

.module-hero p {
  max-width: 620px;
  margin: 0;
  color: #6d5d4c;
  font-size: 14px;
  font-weight: 700;
}

.module-hero img {
  width: 96px;
  height: 96px;
  flex: 0 0 auto;
  object-fit: contain;
  object-position: center;
  border-radius: 0;
  background: transparent;
  filter: drop-shadow(0 12px 18px rgba(158, 91, 0, 0.16));
}

.module-hero:not(.compact) img {
  width: 96px;
  height: 96px;
}

.module-hero.quiet img {
  width: 96px;
  height: 96px;
  opacity: 1;
}

.panel-dog {
  width: 56px;
  height: 56px;
  flex: 0 0 auto;
  object-fit: contain;
  object-position: center;
  border-radius: 0;
  background: transparent;
  filter: drop-shadow(0 8px 12px rgba(158, 91, 0, 0.12));
}

.status-list div {
  grid-template-columns: 82px minmax(0, 1fr);
  border-bottom-color: #f0e3cc;
}

.status-pill,
.file-pill {
  border: 1px solid #e7d5b3;
  background: #fff6dc;
  color: #8b5b00;
}

.status-pill.ok {
  color: #16804f;
  background: #edf9ef;
  border-color: #c7e8cd;
}

.status-pill.warning {
  color: #ad6400;
  background: #fff3cd;
  border-color: #f0d890;
}

.cover-bottom-strip {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 14px;
  padding: 10px 18px;
  border-radius: 8px;
  color: #6f551f;
  background: linear-gradient(90deg, #fff8df 0%, #fffaf0 100%);
}

.cover-bottom-strip div {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.cover-bottom-strip strong {
  color: #9a6400;
  font-size: 16px;
}

.kpi {
  border-left-color: var(--gold);
}

.kpi:nth-child(2) {
  border-left-color: var(--red);
}

.kpi:nth-child(3),
.kpi:nth-child(5) {
  border-left-color: #dca63c;
}

th {
  color: #5b4521;
  background: #fff4d8;
}

tbody tr:nth-child(even):not(.total-row):not(.selected-row) {
  background: #fffdf8;
}

tbody tr:hover {
  background: #fff7df;
}

.total-row td {
  background: #fff0c2;
}

@media (max-width: 1280px) {
  .app-shell {
    grid-template-columns: 206px minmax(0, 1fr);
  }

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

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

.income-filing-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.income-filing-tabs .active {
  background: #17384d;
  color: #fff;
  border-color: #17384d;
}

.income-filing-filter,
.income-filing-entry {
  display: grid;
  grid-template-columns: repeat(5, minmax(150px, 1fr));
  gap: 12px;
  align-items: end;
  margin-bottom: 14px;
}

.income-filing-entry {
  grid-template-columns: repeat(6, minmax(130px, 1fr));
  padding: 12px;
  border: 1px solid #d9e5ea;
  border-radius: 8px;
  background: #f8fbfc;
}

.income-filing-entry label,
.income-filing-filter label {
  display: grid;
  gap: 6px;
  color: #55707d;
  font-size: 13px;
}

.income-filing-entry input,
.income-filing-entry select,
.income-filing-filter input,
.income-filing-filter select {
  width: 100%;
  min-width: 0;
}

.income-filing-filter-actions {
  grid-column: span 3;
  display: inline-flex;
  align-items: end;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.income-filing-filter-actions.compact {
  grid-column: span 2;
}

.draft-row {
  background: #fff8e8;
}

.sticky-subject-cell {
  min-width: 180px;
  font-weight: 700;
  color: #17384d;
  vertical-align: top;
}

.quarterly-summary-cell {
  background: #f2f7fa;
}

.quarterly-layout-row td {
  vertical-align: middle;
}

.quarterly-subject-start td {
  border-top: 2px solid #cfe0eb;
}

.quarterly-item-cell {
  min-width: 96px;
  color: #55707d;
  font-weight: 700;
}

.form-error {
  min-height: 20px;
  margin-top: 10px;
  color: #b42318;
  font-size: 13px;
}

@media (max-width: 1120px) {
  .app-shell {
    grid-template-columns: 86px minmax(0, 1fr);
  }

  .brand-mark.image-mark {
    width: 48px;
    height: 48px;
  }

  .cover-overview-grid,
  .cover-workbench.refined {
    grid-template-columns: 1fr;
  }

  .income-filing-filter,
  .income-filing-entry {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .income-filing-filter-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }

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

@media (max-width: 720px) {
  .sidebar {
    padding: 10px 12px;
  }

  .brand {
    min-height: 58px;
    padding: 0;
  }

  .brand-mark.image-mark {
    width: 44px;
    height: 44px;
    border-radius: 12px;
  }

  .brand-title {
    font-size: 18px;
  }

  .brand-subtitle {
    font-size: 11px;
  }

  .nav-list {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: thin;
  }

  .nav-item {
    flex: 0 0 auto;
    width: auto;
    height: 38px;
    gap: 6px;
    padding: 0 10px;
    font-size: 13px;
    white-space: nowrap;
  }

  .nav-item span {
    width: 24px;
    height: 24px;
    font-size: 12px;
  }

  .nav-submenu {
    flex: 0 0 auto;
    grid-auto-flow: column;
    grid-auto-columns: max-content;
    gap: 6px;
    padding: 0;
    overflow-x: auto;
  }

  .nav-subitem {
    min-height: 34px;
    padding: 6px 10px;
    white-space: nowrap;
  }

  .main {
    padding: 14px;
  }

  .panel-head,
  .mini-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .panel-head .select-input,
  .mini-actions .select-input,
  .mini-actions .line-button,
  .mini-actions .primary-button {
    width: 100%;
    min-width: 0;
  }

  .kpi-grid,
  .kpi-grid.wide {
    grid-template-columns: 1fr;
  }

  .home-topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .home-search {
    width: 100%;
  }

  .cover-hero {
    align-items: flex-start;
    min-height: 430px;
    background:
      linear-gradient(180deg, rgba(255, 251, 241, 0.98) 0%, rgba(255, 249, 232, 0.92) 46%, rgba(255, 247, 222, 0.28) 74%, rgba(255, 247, 222, 0.04) 100%),
      url("./assets/cover-hero-soft.png") 70% bottom / auto 70% no-repeat,
      #ffffff;
  }

  .cover-copy {
    width: 100%;
    padding: 24px;
  }

  .cover-copy h2 {
    font-size: 36px;
  }

  .cover-mascot-card img {
    width: 100%;
    max-height: 280px;
  }

  .module-hero,
  .module-hero.compact {
    min-height: auto;
    align-items: flex-start;
    padding: 18px;
  }

  .module-hero img {
    width: 72px;
    height: 72px;
  }

  .module-hero:not(.compact) img {
    width: 72px;
    height: 72px;
  }

  .cover-month-cards,
  .quick-grid {
    grid-template-columns: 1fr;
  }

  .cover-bottom-strip {
    align-items: stretch;
    flex-direction: column;
  }

  .income-filing-filter,
  .income-filing-entry {
    grid-template-columns: 1fr;
  }
}
