.finance-shell {
  width: min(calc(100% - 32px), 1280px);
  margin: 20px auto 56px;
  max-width: 100%;
  overflow: visible;
}

.finance-hero {
  padding: 26px 28px 24px;
}

.finance-topbar {
  margin-bottom: 18px;
}

.finance-nav {
  margin-left: auto;
}

.finance-hero h1 {
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-weight: 100;
  letter-spacing: -0.03em;
  line-height: 0.98;
  font-size: clamp(2.4rem, 5vw, 4.4rem);
  max-width: 780px;
}

.finance-hero p {
  margin: 0 0 16px;
  color: var(--gray-600);
  font-size: 17px;
  line-height: 1.65;
  max-width: 720px;
}

.finance-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: 10px 0 4px;
  padding: 10px;
  border-radius: 22px;
  background: var(--yma-surface);
  border: 1px solid rgba(255, 255, 255, 0.84);
  box-shadow: var(--card-shadow);
  width: fit-content;
}

.finance-controls label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--gray-500);
}

.finance-controls select {
  min-height: 42px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--yma-line);
  background: var(--yma-surface-strong);
  box-shadow: 0 8px 18px rgba(17, 17, 17, 0.04);
}

.finance-layout {
  margin-top: 16px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.finance-sidebar {
  background: var(--yma-surface);
  border: 1px solid var(--yma-line-soft);
  border-radius: var(--card-radius);
  padding: 14px;
  box-shadow: var(--card-shadow);
  display: flex;
  flex-wrap: nowrap;
  gap: 10px;
  align-items: center;
  overflow: visible;
  position: relative;
  z-index: 40;
}

.side-item {
  border: 1px solid var(--yma-line-soft);
  background: var(--yma-surface);
  color: var(--black);
  border-radius: 999px;
  padding: 10px 14px;
  text-align: left;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  font-size: 13px;
  transition:
    transform 0.2s ease,
    background 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.side-item:hover {
  transform: translateY(-1px);
  box-shadow: var(--card-shadow);
}

.side-item.active {
  background: var(--black);
  color: var(--white);
  border-color: var(--black);
  box-shadow: 0 12px 24px rgba(17, 17, 17, 0.12);
}

.side-dropdown {
  position: relative;
  z-index: 45;
}

.side-dropdown-toggle {
  min-width: 132px;
}

.side-dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 180px;
  background: var(--yma-surface-strong);
  border: 1px solid var(--yma-line-soft);
  border-radius: 12px;
  box-shadow: var(--card-shadow);
  padding: 6px;
  display: none;
  z-index: 9999;
}

.side-dropdown.open .side-dropdown-menu,
.side-dropdown:hover .side-dropdown-menu {
  display: block;
}

.finance-layout,
.finance-main {
  overflow: visible;
}

.side-sub-item {
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  color: #0f172a;
  border-radius: 10px;
  padding: 8px 10px;
  text-align: left;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  font-size: 12px;
  width: 100%;
  margin: 3px 0;
}

.side-sub-item.active {
  background: #0f172a;
  color: #fff;
  border-color: #0f172a;
}

.cat-cockpit-layout {
  margin-top: 12px;
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.cat-merchant-panel {
  background: #fff;
  border-radius: 14px;
  border: 1px solid #e5e7eb;
  padding: 8px;
  max-height: 620px;
  overflow: auto;
}

.cat-rule-panel {
  min-width: 0;
}

.cat-page-controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.cat-progress {
  margin: 8px 0 10px;
  height: 10px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
}

.cat-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #0f172a 0%, #1d4ed8 100%);
  transition: width 220ms ease;
}

#catRulesTable .finance-table-wrap {
  max-height: 470px;
  overflow: auto;
}

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

.finance-main {
  display: grid;
  min-width: 0;
  max-width: 100%;
  overflow-x: hidden;
}

.view-panel {
  display: none;
  min-width: 0;
  max-width: 100%;
  overflow-x: hidden;
}

.view-panel.active {
  display: block;
  overflow-x: hidden;
}

.finance-card {
  margin-top: 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(251, 250, 246, 0.96)),
    radial-gradient(circle at top left, rgba(137, 169, 255, 0.08), transparent 50%);
  border: 1px solid var(--yma-line-soft);
  border-radius: var(--card-radius);
  padding: 20px;
  box-shadow: var(--card-shadow);
  max-width: 100%;
  min-width: 0;
  overflow-x: hidden;
}

.finance-main .finance-card {
  margin-top: 0;
}

.finance-card h2 {
  margin: 0 0 12px;
}

#summaryBox {
  background: var(--yma-rail);
  color: #dbeafe;
  border-radius: 14px;
  padding: 12px;
  overflow: auto;
}

#healthBox,
#summaryBox,
#ingestOutput {
  max-height: 200px;
  overflow-y: auto;
}

.finance-table-wrap {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow: auto;
  position: relative;
  border-radius: 10px;
}

#syncTable .finance-table-wrap,
#ingestHistoryTable .finance-table-wrap {
  max-height: 220px;
  overflow-y: auto;
}

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

.finance-table-wrap.can-scroll-x::before,
.finance-table-wrap.can-scroll-x::after {
  content: "";
  position: sticky;
  top: 0;
  width: 18px;
  height: 100%;
  display: block;
  pointer-events: none;
  z-index: 2;
}

.finance-table-wrap.can-scroll-x::before {
  left: 0;
  float: left;
  background: linear-gradient(to right, rgba(241, 245, 249, 0.95), rgba(241, 245, 249, 0));
  opacity: 0;
}

.finance-table-wrap.can-scroll-x::after {
  right: 0;
  float: right;
  background: linear-gradient(to left, rgba(241, 245, 249, 0.95), rgba(241, 245, 249, 0));
  opacity: 0;
}

.finance-table-wrap.can-scroll-x.scroll-left::before {
  opacity: 1;
}

.finance-table-wrap.can-scroll-x.scroll-right::after {
  opacity: 1;
}

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

.ledger-table {
  table-layout: auto;
  width: max-content;
  min-width: 100%;
}

#ledgerView,
#ledgerTable {
  min-width: 0;
  max-width: 100%;
}

#ledgerTable {
  display: block;
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
}

#ledgerTable > .finance-table-wrap,
#ledgerTable > .ledger-table-wrap {
  display: block;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
}

#ledgerTable .ledger-table {
  width: max-content;
  min-width: 100%;
}

.ledger-table th,
.ledger-table td,
.ledger-table .col-wrap,
.ledger-table .col-description,
.ledger-table .col-notes,
.ledger-table .col-category,
.ledger-table .col-subcategory,
.ledger-table .col-classification-source,
.ledger-table .col-category-type,
.ledger-table .col-cash-flow-bucket,
.ledger-table .col-payee {
  white-space: nowrap !important;
  word-break: normal !important;
  overflow-wrap: normal !important;
  vertical-align: middle;
}

.finance-table th,
.finance-table td {
  border: 1px solid #e5e7eb;
  text-align: left;
  padding: 8px;
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
  vertical-align: top;
}

.finance-table .col-month,
.finance-table .col-date {
  white-space: nowrap;
  width: 88px;
  min-width: 88px;
  word-break: normal;
  overflow-wrap: normal;
}

.finance-table .col-wrap {
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.finance-table .col-id {
  white-space: nowrap;
  width: 56px;
  min-width: 56px;
}

.finance-table .col-run-id {
  white-space: nowrap;
  width: 70px;
  min-width: 70px;
}

.finance-table .col-description,
.finance-table .col-notes {
  min-width: 180px;
}

.finance-table .col-category,
.finance-table .col-subcategory,
.finance-table .col-classification-source {
  min-width: 130px;
}

.finance-table .col-category-type,
.finance-table .col-cash-flow-bucket {
  min-width: 120px;
}

.finance-table .col-payee {
  white-space: normal;
  min-width: 120px;
}

.finance-table .col-amount {
  white-space: nowrap;
  min-width: 110px;
  width: 110px;
  word-break: normal;
  overflow-wrap: normal;
}

.finance-table .col-currency {
  white-space: nowrap;
  min-width: 80px;
  width: 80px;
  word-break: normal;
  overflow-wrap: normal;
}

.finance-table .col-actions {
  white-space: nowrap;
  width: 84px;
  min-width: 84px;
}

.finance-table th {
  background: #f9fafb;
}

.finance-table .row-emphasis td {
  font-weight: 700;
}

.pnl-table-wrap {
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
}

.pnl-table {
  width: max-content;
  min-width: 100%;
  table-layout: fixed;
}

.pnl-table th,
.pnl-table td {
  min-width: 160px;
  width: 160px;
  white-space: nowrap;
}

.pnl-table th:first-child,
.pnl-table td:first-child {
  position: sticky;
  left: 0;
  z-index: 2;
  min-width: 340px;
  width: 340px;
  background: #fff;
  white-space: normal;
}

.pnl-table thead th:first-child {
  z-index: 3;
  background: #f9fafb;
}

.pnl-table tr.pnl-section-row td {
  background: #e5e7eb;
  font-weight: 700;
  color: #111827;
}

.analysis-controls {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-bottom: 12px;
}

.analysis-controls label {
  display: grid;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  color: #64748b;
}

.analysis-controls input,
.analysis-controls select {
  border: 1px solid #d1d5db;
  border-radius: 10px;
  padding: 9px 10px;
  background: #fff;
  color: #0f172a;
}

.period-checklist {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  margin-bottom: 14px;
}

.analysis-controls .period-btn {
  border: 1px solid #cbd5e1;
  background: #fff;
  color: #0f172a;
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 13px;
  cursor: pointer;
}

.analysis-controls .period-btn.active {
  background: #0f172a;
  color: #fff;
  border-color: #0f172a;
}

.analysis-controls button:not(.period-btn) {
  align-self: end;
  border: none;
  border-radius: 10px;
  background: #0f172a;
  color: #fff;
  padding: 10px 14px;
  cursor: pointer;
  font-weight: 600;
}

.payroll-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.payroll-head-actions {
  display: inline-flex;
  gap: 10px;
}

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

.payroll-report-controls label {
  display: grid;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  color: #64748b;
}

.payroll-report-controls select {
  border: 1px solid #d1d5db;
  border-radius: 10px;
  padding: 9px 10px;
  background: #fff;
  color: #0f172a;
}
.payroll-report-controls input[type="text"],
.payroll-report-controls input[type="number"],
.payroll-report-controls input[type="file"] {
  border: 1px solid #d1d5db;
  border-radius: 10px;
  padding: 9px 10px;
  background: #fff;
  color: #0f172a;
}
#deelAnalyzeOutput {
  margin-top: 8px;
}
.deel-split-row {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 120px auto;
  gap: 6px;
  margin-top: 6px;
}
.deel-split-row select,
.deel-split-row input {
  border: 1px solid #d1d5db;
  border-radius: 8px;
  padding: 7px 8px;
}
.deel-attr-table-wrap {
  overflow-x: auto;
  overflow-y: hidden;
}
.deel-attr-table {
  table-layout: auto;
  width: max-content;
  min-width: 100%;
}
.deel-attr-table th,
.deel-attr-table td {
  white-space: nowrap;
  word-break: normal;
  overflow-wrap: normal;
  vertical-align: top;
}
.deel-attr-table th:nth-child(1), .deel-attr-table td:nth-child(1) { min-width: 160px; }
.deel-attr-table th:nth-child(2), .deel-attr-table td:nth-child(2) { min-width: 180px; }
.deel-attr-table th:nth-child(3), .deel-attr-table td:nth-child(3) { min-width: 120px; text-align: right; }
.deel-attr-table th:nth-child(4), .deel-attr-table td:nth-child(4) { min-width: 120px; }
.deel-attr-table th:nth-child(5), .deel-attr-table td:nth-child(5) { min-width: 160px; }
.deel-attr-table th:nth-child(6), .deel-attr-table td:nth-child(6) { min-width: 480px; }
.deel-attr-table th:nth-child(7), .deel-attr-table td:nth-child(7) { min-width: 170px; }
.deel-attr-table th:nth-child(8), .deel-attr-table td:nth-child(8) { min-width: 240px; }
.deel-attr-table th:nth-child(9), .deel-attr-table td:nth-child(9) { min-width: 90px; text-align: center; }

.payroll-report-line-wrap {
  margin-top: 8px;
  border: 1px solid #cbd5e1;
  border-radius: 14px;
  padding: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.payroll-report-meta {
  flex: 1;
}

.payroll-report-line-actions {
  display: inline-flex;
  gap: 8px;
}

.payroll-export-format {
  border: 1px solid #cbd5e1;
  background: #fff;
  color: #0f172a;
  border-radius: 8px;
  padding: 6px 10px;
  font-weight: 600;
}

.payroll-report-line-wrap.busy {
  position: relative;
  overflow: hidden;
}

.payroll-report-line-wrap.busy::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(241, 245, 249, 0.18) 25%, rgba(255, 255, 255, 0.8) 50%, rgba(241, 245, 249, 0.18) 75%);
  background-size: 220% 100%;
  animation: shimmer 1.1s linear infinite;
  pointer-events: none;
}

.payroll-edit-btn {
  border: 1px solid #cbd5e1;
  background: #fff;
  color: #0f172a;
  border-radius: 8px;
  padding: 6px 10px;
  cursor: pointer;
  font-weight: 600;
}

.payroll-row-btn {
  border: 1px solid #cbd5e1;
  background: #fff;
  color: #0f172a;
  border-radius: 8px;
  padding: 6px 10px;
  cursor: pointer;
  font-weight: 600;
}

.payroll-report-meta .payroll-report-btn {
  display: inline-block;
  margin-left: 8px;
  text-decoration: none;
}

@media (max-width: 860px) {
  .payroll-head {
    flex-direction: column;
    align-items: stretch;
  }

  .payroll-head-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .payroll-report-line-wrap {
    flex-direction: column;
    align-items: stretch;
  }

  .payroll-report-line-actions {
    justify-content: flex-end;
    flex-wrap: wrap;
  }
}

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

.payroll-table {
  table-layout: auto;
  width: max-content;
  min-width: 100%;
}

.payroll-table th,
.payroll-table td {
  white-space: nowrap;
  word-break: normal;
  overflow-wrap: normal;
  vertical-align: middle;
}

.payroll-table tr.payroll-row-retired td {
  background: #eef1f5 !important;
}

.payroll-table td.payroll-variance-overpay {
  color: #b42318 !important;
  font-weight: 700 !important;
}

.payroll-table td.payroll-status-active {
  color: #94a3b8 !important;
  font-weight: 600;
}

.payroll-table .payroll-budget-col {
  background: #f3f4f6 !important;
  color: #6b7280;
}

.deel-journal-scroll {
  max-height: 280px;
  overflow-y: auto;
  overflow-x: auto;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
}

.payroll-name-link {
  background: none;
  border: none;
  color: #1d4ed8;
  text-decoration: underline;
  cursor: pointer;
  padding: 0;
  font: inherit;
}

.payroll-table th {
  position: sticky;
  top: 0;
  z-index: 5;
  background: #f8fafc;
}

.payroll-table thead tr:first-child th {
  z-index: 7;
}

.payroll-table thead tr:nth-child(2) th {
  z-index: 5;
}

.payroll-table thead tr:first-child th:nth-child(1),
.payroll-table tbody td:nth-child(1) {
  position: sticky;
  left: 0;
  z-index: 9;
  background: #fff;
}

.payroll-table thead tr:first-child th:nth-child(3),
.payroll-table tbody td:nth-child(3) {
  position: sticky;
  left: 180px;
  z-index: 9;
  background: #fff;
}
.analysis-mode-switch {
  display: inline-flex;
  gap: 8px;
  align-items: center;
}

.balance-note {
  color: #64748b;
  margin-bottom: 10px;
}

@media (max-width: 960px) {
  .finance-shell {
    width: min(calc(100% - 12px), 980px);
    margin: 10px auto 30px;
  }

  .finance-card {
    padding: 12px;
  }

  .side-item {
    font-size: 12px;
    padding: 8px 10px;
  }

  .analysis-controls .period-btn {
    font-size: 12px;
    padding: 6px 10px;
  }
}

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

  .side-item {
    font-size: 11px;
    padding: 7px 9px;
  }

  .analysis-controls .period-btn {
    font-size: 11px;
    padding: 6px 9px;
  }
}


.group-block {
  margin: 10px 0 14px;
  padding: 10px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #fcfdff;
}

.group-block h3 {
  margin: 0 0 4px;
  font-size: 14px;
}

.group-hint {
  margin: 0 0 10px;
  color: #64748b;
  font-size: 12px;
}

.group-card {
  border: 1px solid #dbe3ee;
  border-radius: 10px;
  padding: 8px 10px;
  margin-bottom: 8px;
  cursor: pointer;
  background: #fff;
}

.group-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  font-weight: 600;
}

.group-card-total {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.group-chevron,
.row-chevron {
  display: inline-block;
  width: 0;
  height: 0;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  border-left: 8px solid #64748b;
  transition: transform 120ms ease;
}

.row-chevron {
  margin-right: 8px;
}

.group-card.expanded .group-chevron,
.group-child-row.expanded .row-chevron {
  transform: rotate(90deg);
}

.group-card-meta {
  font-size: 12px;
  color: #475569;
  margin-top: 4px;
}

.group-children {
  margin-top: 8px;
}

.group-child-row {
  cursor: pointer;
}

.group-child-row:hover td {
  background: #f8fafc;
}

.group-detail-row td {
  background: #fcfdff;
}

.group-detail {
  padding: 8px 0;
}

.budget-table .budget-col-planned {
  background: #f1f5f9;
}

.budget-month-label {
  display: inline-grid;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: #64748b;
}

.budget-month-label select {
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 6px 8px;
  background: #fff;
}

.budget-rule-hint {
  color: #94a3b8;
}

#budgetMonthManager {
  margin: 8px 0 10px;
}

.budget-month-manager {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.budget-month-pill {
  border: 1px solid #dbe3ee;
  border-radius: 10px;
  padding: 6px 8px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #fff;
}

.budget-month-pill.active {
  border-color: #0f172a;
  background: #f8fafc;
}

.budget-month-pill button {
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
  padding: 4px 8px;
  font-size: 12px;
  cursor: pointer;
}

.budget-input {
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 6px 8px;
  background: #fff;
}

.budget-input:disabled {
  background: #e2e8f0;
  color: #64748b;
}

.budget-cell-yellow {
  background: #fef9c3;
  color: #854d0e;
  font-weight: 700;
}

.budget-cell-amber {
  background: #ffedd5;
  color: #9a3412;
  font-weight: 700;
}

.budget-table th:first-child,
.budget-table td:first-child {
  position: sticky;
  left: 0;
  z-index: 1;
  background: #fff;
  width: 220px;
  min-width: 220px;
  max-width: 220px;
}

.budget-table thead th:first-child {
  z-index: 3;
  background: #f9fafb;
}

.budget-table {
  width: max-content;
  min-width: 100%;
  table-layout: fixed;
}

.budget-table th:not(:first-child),
.budget-table td:not(:first-child) {
  width: 160px;
  min-width: 160px;
  max-width: 160px;
}

.budget-total-row td {
  font-weight: 700;
  background: #f8fafc;
}

.budget-row-revenue td {
  color: #166534;
  font-weight: 600;
}

.budget-row-revenue td:first-child,
.budget-row-revenue td.budget-col-planned {
  background: #ecfdf3;
}

.budget-sub-row {
  display: inline-block;
  padding-left: 14px;
  color: #475569;
}

#budgetTable .finance-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}


.ingest-admin {
  margin-top: 16px;
  border-top: 1px solid #e5e7eb;
  padding-top: 14px;
}

.ingest-admin h3 {
  margin: 0 0 6px;
  font-size: 15px;
}

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

.ingest-grid label,
.ingest-admin > label {
  display: grid;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  color: #64748b;
}

.ingest-grid input,
.ingest-grid select,
.ingest-admin > label input,
.ingest-payload-label textarea {
  border: 1px solid #d1d5db;
  border-radius: 10px;
  padding: 9px 10px;
  background: #fff;
  color: #0f172a;
  font: inherit;
}

.ingest-payload-label {
  display: grid;
  gap: 6px;
  margin: 8px 0;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  color: #64748b;
}

.ingest-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0;
}

.ingest-actions button {
  border: none;
  border-radius: 10px;
  background: #0f172a;
  color: #fff;
  padding: 9px 12px;
  cursor: pointer;
  font-weight: 600;
}

.ingest-actions .danger-btn {
  background: #b42318;
}

#catBulkCanonicalBtn {
  width: 100%;
  margin-top: 8px;
}

.cat-merchant-pick {
  width: 18px;
  height: 18px;
}

.cat-merchant-check-col {
  width: 44px;
  text-align: center;
}

.ingest-progress {
  margin: 8px 0 12px;
}

.ingest-progress-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
  color: #334155;
  margin-bottom: 6px;
}

.ingest-progress-track {
  height: 10px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
}

.ingest-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #0f172a 0%, #2563eb 100%);
  transition: width 220ms ease;
}

.danger-btn {
  background: #b42318 !important;
  color: #fff !important;
}

#ingestOutput {
  margin-top: 10px;
  background: #0f172a;
  color: #dbeafe;
  border-radius: 12px;
  padding: 10px;
  overflow: auto;
}

.loading-shimmer {
  height: 72px;
  border-radius: 12px;
  background: linear-gradient(90deg, #e5e7eb 25%, #f8fafc 37%, #e5e7eb 63%);
  background-size: 400% 100%;
  animation: shimmer 1.2s ease-in-out infinite;
}

@keyframes shimmer {
  0% { background-position: 100% 0; }
  100% { background-position: 0 0; }
}

.eff-chart-wrap {
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 10px;
  margin-bottom: 12px;
  background: #fff;
}

.eff-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin-bottom: 8px;
  font-size: 12px;
}

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

.eff-legend-item i {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 2px;
}

.eff-chart {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  overflow-x: auto;
  overflow-y: visible;
  padding-top: 30px;
  padding-bottom: 6px;
}

.eff-col {
  min-width: 96px;
  text-align: center;
}

.eff-stack {
  min-height: 220px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 1px;
  padding-top: 28px;
  box-sizing: border-box;
}

.eff-segment {
  position: relative;
  transition: opacity 0.15s ease;
}

.eff-segment:hover,
.eff-segment:focus {
  opacity: 0.7;
  outline: none;
}

.eff-segment:hover::after,
.eff-segment:focus::after {
  content: attr(data-tip);
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  top: -24px;
  background: #111827;
  color: #fff;
  border-radius: 6px;
  padding: 4px 6px;
  font-size: 11px;
  white-space: nowrap;
  z-index: 5;
}

.eff-col-label {
  margin-top: 6px;
  font-size: 12px;
  color: #334155;
}

.eff-col-total {
  font-size: 11px;
  color: #64748b;
}

.status-modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 16px;
}

.status-modal-card {
  width: min(760px, 100%);
  background: #fff;
  border-radius: 14px;
  padding: 14px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.2);
}

.status-modal-card h3 {
  margin: 0 0 10px;
}

.status-modal-pre {
  margin: 0;
  max-height: 45vh;
  overflow: auto;
  background: #0f172a;
  color: #dbeafe;
  padding: 10px;
  border-radius: 10px;
}

#statusModalBody {
  max-height: 52vh;
  overflow: auto;
}

.status-modal-subtitle {
  margin: 10px 0 6px;
  font-size: 13px;
}

.status-modal-table-wrap {
  max-height: 36vh;
  overflow: auto;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #fff;
}

.status-modal-table-wrap .finance-table th,
.status-modal-table-wrap .finance-table td {
  white-space: nowrap;
}

.status-modal-table-wrap .modal-keep-row td {
  background: #f3f4f6;
  color: #475569;
}

.status-modal-actions {
  margin-top: 10px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

#payrollEditModal .status-modal-card {
  width: min(1000px, 100%);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 4px;
}

.payroll-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 9;
  padding-bottom: 8px;
  border-bottom: 1px solid #e5e7eb;
  margin-bottom: 8px;
}

.payroll-modal-actions-top {
  margin-top: 0;
  flex-shrink: 0;
}

#payrollEditModal .analysis-controls {
  max-height: none;
  overflow: visible;
  padding-right: 6px;
}

#payrollEditModal .status-modal-actions {
  margin-top: 12px;
  position: static;
  background: #fff;
  padding-top: 8px;
}

.auth-modal-card {
  width: min(460px, 100%);
}

.payroll-report-wrap {
  overflow-x: auto;
}

.payroll-report-table {
  width: 100%;
  min-width: 980px;
  table-layout: fixed;
}

.payroll-report-table th,
.payroll-report-table td {
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
  line-height: 1.3;
  vertical-align: top;
}

@media print {
  @page {
    size: A4 portrait;
    margin: 10mm;
  }

  .finance-shell {
    width: 100%;
    margin: 0;
  }

  .finance-sidebar,
  .finance-topbar,
  .analysis-controls,
  #finance-logout-btn {
    display: none !important;
  }

  #payrollView.view-panel {
    display: block !important;
  }

  .payroll-report-wrap {
    overflow: visible !important;
  }

  .payroll-report-table {
    min-width: 0 !important;
    width: 100% !important;
    table-layout: fixed !important;
    font-size: 10px;
  }

  .payroll-report-table th,
  .payroll-report-table td {
    padding: 4px 5px;
    white-space: normal !important;
    word-break: break-word !important;
    overflow-wrap: anywhere !important;
  }
}
