.financeToolsPage,
.financeInvoiceRenamer {
  max-width: 1240px;
  margin: 0 auto;
}

.financeToolCard,
.financeInvoicePanel {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: 0 8px 28px rgba(24, 33, 47, .055);
}

.financeToolCard {
  display: flex;
  gap: 18px;
  max-width: 620px;
  padding: 25px;
}

.financeToolCardIcon {
  display: grid;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  place-items: center;
  border-radius: 10px;
  background: #fef2f2;
  color: var(--accent);
}

.financeToolCardBody h2 { margin: 0; font-size: 18px; }
.financeToolCardBody p { max-width: 480px; margin: 9px 0 20px; color: var(--muted); font-size: 14px; line-height: 1.65; }
.financeToolOpen { display: inline-flex; align-items: center; gap: 7px; color: var(--accent); font-weight: 700; text-decoration: none; }
.financeToolOpen:hover { color: var(--accent-dark); text-decoration: underline; }

.financeInvoiceRenamer { padding-bottom: 40px; }
.financeInvoiceHeader { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.financeInvoiceBack { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 17px; color: var(--accent); font-size: 13px; font-weight: 650; text-decoration: none; }
.financeInvoiceBack:hover { text-decoration: underline; }
.financeInvoiceHeader h1 { margin: 0; font-size: clamp(26px, 2.4vw, 34px); line-height: 1.2; letter-spacing: -.02em; }
.financeInvoiceHeader p { margin: 8px 0 0; color: #5f6b7b; font-size: 14px; line-height: 1.6; }
.financeInvoiceStatus { display: inline-flex; align-items: center; gap: 8px; flex: 0 0 auto; padding: 10px 14px; border: 1px solid #edc3c3; border-radius: 999px; background: #fef2f2; color: var(--accent-dark); font-size: 12px; font-weight: 700; white-space: nowrap; }
.financeInvoiceStatus span { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.financeInvoicePanel { margin-bottom: 18px; padding: 22px 24px; }
.financeInvoiceSectionHead { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.financeInvoiceSectionHead h2 { margin: 0; font-size: 19px; line-height: 1.35; }
.financeInvoiceSectionHead > span { color: #8290a0; font-size: 12px; font-weight: 600; white-space: nowrap; }
.financeInvoiceUploadRow { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.financeInvoiceActions { display: flex; flex-wrap: wrap; gap: 9px; }
.financeInvoiceActions button,
.financeInvoiceStartRow button,
.financeInvoiceDownloads button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 9px 15px; border-radius: 8px; font-size: 13px; font-weight: 700; line-height: 1.3; transition: background-color .15s ease, border-color .15s ease, color .15s ease; }
.financeInvoicePrimary { border: 1px solid var(--accent); background: var(--accent); color: #fff; }
.financeInvoicePrimary:not(:disabled):hover { border-color: var(--accent-dark); background: var(--accent-dark); }
.financeInvoiceSecondary { border: 1px solid #edc3c3; background: #fff; color: var(--accent-dark); }
.financeInvoiceSecondary:not(:disabled):hover { border-color: var(--accent); background: #fef2f2; }
.financeInvoiceGhost { border: 1px solid var(--border); background: #fff; color: #596576; }
.financeInvoiceGhost:not(:disabled):hover { border-color: #abb7c5; background: #f8fafc; }
.financeInvoiceActions button:disabled,
.financeInvoiceStartRow button:disabled,
.financeInvoiceDownloads button:disabled { cursor: not-allowed; opacity: .6; }
.financeInvoiceFileInput { position: absolute; width: 1px; height: 1px; opacity: 0; clip-path: inset(50%); }
.financeInvoiceFileSummary { display: flex; align-items: baseline; gap: 6px; min-width: 190px; padding-left: 20px; border-left: 1px solid var(--border); color: var(--muted); font-size: 13px; white-space: nowrap; }
.financeInvoiceFileSummary strong { color: var(--text); font-size: 27px; line-height: 1; font-variant-numeric: tabular-nums; }
.financeInvoiceFileSummary span:last-child { margin-left: 6px; }
.financeInvoiceNote { margin: 18px 0 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.financeInvoiceStartRow { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 19px; }
.financeInvoiceStartRow p { margin: 0; color: var(--muted); font-size: 13px; }
.financeInvoiceError { margin: 0 0 18px; padding: 10px 12px; border: 1px solid #fecaca; border-radius: 8px; background: #fef2f2; color: #991b1b; font-size: 13px; }
.financeInvoiceProgressGroup { display: grid; gap: 9px; }
.financeInvoiceProgressLabel { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: #526071; font-size: 13px; font-weight: 600; }
.financeInvoiceProgressLabel:not(:first-child) { margin-top: 5px; }
.financeInvoiceProgressTrack { height: 8px; overflow: hidden; border-radius: 999px; background: #e8eef4; }
.financeInvoiceProgressTrack span { display: block; height: 100%; border-radius: inherit; background: var(--accent); transition: width .2s ease; }
.financeInvoiceStats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 21px; padding-top: 18px; border-top: 1px solid #e7ebf0; }
.financeInvoiceStats > div { min-height: 91px; padding: 15px 17px; border: 1px solid var(--border); border-radius: 9px; }
.financeInvoiceStats strong { display: block; font-size: 24px; line-height: 1; font-variant-numeric: tabular-nums; }
.financeInvoiceStats span { display: block; margin-top: 10px; color: var(--muted); font-size: 12px; }
.financeInvoiceDownloads { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 18px; }
.financeInvoiceTableWrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 9px; }
.financeInvoiceTableWrap table { width: 100%; min-width: 760px; border-collapse: collapse; font-size: 12px; }
.financeInvoiceTableWrap th { background: #f8fafc; color: #465366; font-weight: 700; text-align: left; }
.financeInvoiceTableWrap th,
.financeInvoiceTableWrap td { padding: 12px 13px; border-bottom: 1px solid #edf0f3; line-height: 1.5; overflow-wrap: anywhere; }
.financeInvoiceTableWrap tbody tr:last-child td { border-bottom: 0; }
.financeInvoiceTableWrap td { color: #344054; }
.financeInvoiceEmpty { padding: 36px 12px !important; color: var(--muted) !important; text-align: center; }
.financeInvoiceResultOk { color: #12704b; font-weight: 700; }
.financeInvoiceResultWarn { color: #a15c07; font-weight: 700; }

@media (max-width: 780px) {
  .financeInvoiceUploadRow { align-items: flex-start; flex-direction: column; }
  .financeInvoiceFileSummary { padding-left: 0; border-left: 0; }
  .financeInvoiceStats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 560px) {
  .financeInvoiceHeader { align-items: flex-start; flex-direction: column; gap: 14px; }
  .financeInvoicePanel { padding: 18px; }
  .financeInvoiceActions { width: 100%; }
  .financeInvoiceActions button:not(.financeInvoiceGhost) { flex: 1 1 calc(50% - 5px); }
  .financeInvoiceStartRow { align-items: stretch; flex-direction: column; }
  .financeInvoiceDownloads { flex-direction: column; }
  .financeInvoiceStats > div { min-height: 78px; padding: 13px; }
  .financeToolCard { padding: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  .financeInvoiceProgressTrack span,
  .financeInvoiceActions button,
  .financeInvoiceStartRow button,
  .financeInvoiceDownloads button { transition: none; }
}

.financeInvoiceInventoryActions { align-items: flex-end; margin: 18px 0; }
.financeInvoiceInventoryCategory { display: grid; gap: 6px; color: #465366; font-size: 13px; }
.financeInvoiceInventoryCategory select { min-height: 42px; min-width: 180px; padding: 9px 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); }
.financeInvoiceInventoryOriginal { display: block; margin-top: 5px; color: var(--muted); }
.financeInvoiceInventorySummary { margin: 16px 0; font-size: 13px; color: #465366; line-height: 1.6; }
.financeInvoiceInventoryConfirm { display: grid; gap: 14px; margin-top: 18px; font-size: 13px; line-height: 1.7; }
.financeInvoiceInventoryConfirm input { margin-right: 7px; }

.financeInvoiceInventoryTable table { min-width: 960px; table-layout: fixed; }
.financeInvoiceInventoryTable th:first-child { width: 44px; }
.financeInvoiceInventoryTable th:nth-child(2) { width: 24%; }
.financeInvoiceInventoryTable th:nth-child(3) { width: 24%; }
.financeInvoiceInventoryTable th:nth-child(4) { width: 110px; }
.financeInvoiceInventoryTable td { overflow: visible; text-overflow: clip; white-space: normal; text-align: left; vertical-align: top; }
.financeInvoiceInventoryScrollHint { display: none; }
@media (max-width: 780px) {
  .financeInvoiceInventoryScrollHint { display: block; margin: 8px 0; color: var(--muted); font-size: 12px; }
}

.financeInvoiceInventoryTable th:first-child,
.financeInvoiceInventoryTable td:first-child { padding-right: 8px; padding-left: 8px; text-overflow: clip; }
.financeInvoiceInventoryTable input[type="checkbox"] { margin: 0; }
