.finance-workspace { min-width:0; }
.finance-heading { margin-bottom:16px; }
.finance-heading h1 { font-size:26px; margin:0; }
.finance-tabs { display:flex; gap:6px; margin-bottom:14px; }
.finance-tabs .tab { color:var(--ink); min-height:40px; }
.finance-tabs .tab.active { background:#e9f1e5; color:#315b39; }
.finance-panel { min-width:0; }
.finance-report-form { display:flex; align-items:end; flex-wrap:wrap; gap:12px; padding:20px 20px 12px; }
.finance-report-form label { display:grid; gap:4px; color:#526157; font-size:13px; }
.finance-report-form input,.finance-report-form select { height:40px; padding:7px 10px; border:1px solid var(--line); border-radius:6px; background:white; color:var(--ink); max-width:100%; }
.finance-report-form button { min-height:40px; padding:8px 14px; }
.finance-context { color:#526157; margin:0; padding:0 20px 8px; font-size:13px; line-height:1.5; max-width:105ch; }
.finance-context:last-of-type { padding-bottom:14px; }.finance-filter-hint { color:#716029; margin:0 20px 12px; font-size:13px; }
.finance-report-meta { display:flex; flex-direction:column; gap:3px; padding:16px 20px 8px; border-top:1px solid var(--line); }
.finance-report-meta span { color:#526157; font-size:13px; }
.finance-revenue { display:flex; flex-wrap:wrap; gap:16px 44px; padding:10px 20px 12px; margin:0; }
.finance-revenue dt { color:#526157; font-size:13px; }
.finance-revenue dd { margin:4px 0 0; font-size:18px; font-weight:600; font-variant-numeric:tabular-nums; }
.finance-fees { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); padding:10px 20px 16px; margin:0; gap:16px; border-bottom:1px solid var(--line); }
.finance-fees dt { color:#526157; font-size:13px; }
.finance-fees dd { margin:4px 0 0; font-size:18px; font-weight:600; font-variant-numeric:tabular-nums; overflow-wrap:anywhere; }
.finance-totals { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); padding:10px 20px 20px; margin:0; gap:16px; }
.finance-totals dt { color:#526157; font-size:13px; }
.finance-totals dd { margin:4px 0 0; font-size:21px; font-weight:600; font-variant-numeric:tabular-nums; overflow-wrap:anywhere; }
.finance-table-wrap { overflow-x:auto; overscroll-behavior-x:contain; scrollbar-color:#b8c7b1 #f4f6f0; scrollbar-width:thin; }
/* Six columns: period, quantity and one cell per order group with its metrics stacked vertically. */
.finance-report-table { --finance-period:110px; min-width:940px; }
.finance-report-table th,.finance-report-table td { padding:10px 12px; font-size:14px; font-variant-numeric:tabular-nums; vertical-align:top; }
.finance-report-table td { text-align:right; }
.finance-report-table thead th { vertical-align:bottom; line-height:1.3; }
.finance-report-table .finance-group-title { text-align:left; color:#315b39; font-weight:600; min-width:185px; border-left:1px solid #dfe6da; }
.finance-report-table .finance-group-cell { border-left:1px solid #dfe6da; min-width:185px; }
.finance-cell-metrics { margin:0; display:grid; gap:3px; }
.finance-cell-metrics div { display:flex; justify-content:space-between; align-items:baseline; gap:10px; }
.finance-cell-metrics dt { color:#526157; font-size:12px; text-align:left; white-space:nowrap; }
.finance-cell-metrics dd { margin:0; white-space:nowrap; }
.finance-cell-metrics .finance-cell-profit { border-top:1px solid #e3e9de; padding-top:4px; margin-top:2px; font-weight:600; }
.finance-report-table .finance-group-cell small { margin-top:6px; text-align:left; }
.finance-report-table .finance-quantity { width:80px; text-align:right; }
.finance-report-table thead .finance-total-cell { background:#eef4ea; }
.finance-report-table td.finance-total-cell { background:#fafcf7; }
.finance-report-table .finance-muted { color:#8f9b8b; }
/* The period stays visible while the metric groups scroll sideways. */
.finance-report-table .finance-period { position:sticky; left:0; z-index:1; width:var(--finance-period); min-width:var(--finance-period); white-space:normal; text-align:left; background:white; box-shadow:inset -1px 0 #dfe6da; }
.finance-report-table thead .finance-period { background:#f9faf6; z-index:2; }
.finance-report-table tbody tr:hover .finance-period { background:#fafbf7; }
.finance-report-table tbody th { color:var(--ink); font-weight:400; border-top:0; letter-spacing:0; }
.finance-report-table tfoot th,.finance-report-table tfoot td { font-weight:600; color:var(--ink); border-top:1px solid #dfe6da; }
.finance-report-table tfoot th { font-size:14px; letter-spacing:0; }
.finance-report-table td small { display:block; color:#526157; font-size:12px; font-weight:400; }
.finance-report-table td.finance-empty { text-align:left; }
/* Sales by product: product names stay visible while the period columns scroll sideways. */
.finance-products { padding:16px 0 6px; border-top:1px solid var(--line); }
.finance-products-head { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:10px 16px; padding:0 20px 8px; }
.finance-products-head h2 { font-size:17px; margin:0; color:var(--ink); }
.finance-products-controls { display:flex; flex-wrap:wrap; align-items:end; gap:10px 14px; min-width:0; }
.finance-survey-filter { display:grid; gap:4px; color:#526157; font-size:13px; min-width:0; }
.finance-survey-filter select { height:40px; max-width:100%; min-width:220px; padding:7px 10px; border:1px solid var(--line); border-radius:6px; background:white; color:var(--ink); font-size:14px; }
.finance-mode { display:inline-flex; gap:4px; padding:3px; border:1px solid var(--line); border-radius:8px; background:white; }
.finance-mode .tab { min-height:34px; color:var(--ink); }
.finance-mode .tab.active { background:#e9f1e5; color:#315b39; }
.finance-products-note { margin:0; padding:0 20px 10px; color:#526157; font-size:13px; line-height:1.5; }
.finance-products .finance-empty { padding-top:8px; }
.finance-product-table { --finance-sku:240px; }
.finance-product-table th,.finance-product-table td { padding:9px 12px; font-size:14px; font-variant-numeric:tabular-nums; vertical-align:top; }
.finance-product-table td { text-align:right; white-space:nowrap; min-width:92px; color:var(--ink); }
.finance-product-table thead th { vertical-align:bottom; text-align:right; white-space:normal; line-height:1.3; color:#315b39; font-weight:600; letter-spacing:0; min-width:92px; }
.finance-product-table .finance-sku { position:sticky; left:0; z-index:1; width:var(--finance-sku); min-width:var(--finance-sku); max-width:var(--finance-sku); text-align:left; white-space:normal; overflow-wrap:anywhere; background:white; color:var(--ink); font-weight:400; letter-spacing:0; border-top:0; box-shadow:inset -1px 0 #dfe6da; }
.finance-product-table thead .finance-sku { background:#f9faf6; z-index:2; color:#315b39; font-weight:600; }
.finance-product-table tbody tr:hover .finance-sku { background:#fafbf7; }
.finance-product-table thead .finance-total-cell { background:#eef4ea; }
.finance-product-table td.finance-total-cell { background:#fafcf7; }
.finance-product-table td small { display:block; color:#526157; font-size:12px; }
.finance-product-table .finance-date { white-space:nowrap; }
.finance-product-table .finance-muted { color:#8f9b8b; }
.finance-product-table tfoot th,.finance-product-table tfoot td { font-weight:600; border-top:1px solid #dfe6da; }
.finance-product-table tfoot .finance-sku { font-weight:600; }
.finance-error { color:#9a3330; background:#fff3f1; padding:12px 16px; margin:0 0 14px; border:1px solid #ebd7d2; border-radius:7px; overflow-wrap:anywhere; }
.finance-warning { margin:8px 20px 12px; padding:12px 14px; background:#fff9e9; color:#705829; font-size:13px; border-radius:6px; }
.finance-missing { padding:14px 20px 18px; color:#526157; font-size:13px; border-top:1px solid var(--line); }
.finance-missing summary { cursor:pointer; color:var(--ink); }
.finance-missing li { margin:5px 0; overflow-wrap:anywhere; }
.finance-empty { padding:24px 20px; margin:0; color:#526157; font-size:14px; white-space:normal; }
.finance-cost-toolbar { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; padding:18px 20px 12px; gap:12px; }
.finance-cost-toolbar p { margin:4px 0 0; color:#526157; font-size:13px; }
.finance-cost-actions { display:flex; flex-wrap:wrap; align-items:end; justify-content:space-between; padding:12px 20px 18px; gap:14px; }
.finance-search-label { display:grid; gap:4px; color:#526157; font-size:13px; }
.finance-save-area { display:flex; align-items:center; gap:14px; flex-wrap:wrap; }
.finance-save-area [role="status"] { color:#526157; font-size:12px; }
.finance-cost-table { min-width:620px; table-layout:fixed; }
.finance-cost-table th,.finance-cost-table td { padding:12px 18px; }
.finance-cost-table th:first-child { width:90px; }
.finance-cost-table th:nth-child(3) { width:145px; }
.finance-cost-table th:last-child { width:190px; }
.finance-cost-table .finance-product-title { white-space:normal; overflow-wrap:anywhere; color:var(--ink); font-weight:500; letter-spacing:0; background:white; border-top:0; }
.finance-product-title small { display:block; color:#526157; font-size:12px; font-weight:400; margin-top:4px; }
.finance-product-image img,.finance-image-empty { width:52px; height:52px; display:block; object-fit:contain; background:#f7f8f3; border-radius:5px; }
.finance-image-empty { border:1px solid var(--line); }
.finance-cost-input { width:140px; max-width:100%; border:1px solid var(--line); border-radius:6px; padding:8px 10px; color:var(--ink); background:white; font-variant-numeric:tabular-nums; }
.finance-cost-input::placeholder { color:#68786d; }
.finance-cost-input[aria-invalid="true"] { border-color:#9a3330; }
.finance-workspace :focus-visible { outline:2px solid #527949; outline-offset:3px; }
.finance-workspace ::selection { background:#dcebd5; color:#223932; }
.finance-sr { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0; }
@media(max-width:700px) {
  .finance-report-form { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); padding:16px; gap:12px; }
  .finance-report-form label:first-child { grid-column:1/-1; }
  .finance-report-form button { grid-column:1/-1; }
  .finance-report-form input,.finance-report-form select { min-width:0; width:100%; }
  .finance-revenue { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; padding:12px 16px; }
  .finance-revenue dd { overflow-wrap:anywhere; }
  .finance-fees { grid-template-columns:repeat(2,minmax(0,1fr)); padding-inline:16px; }
  .finance-totals { grid-template-columns:repeat(2,minmax(0,1fr)); padding:14px 16px 18px; }
  .finance-totals dd { font-size:19px; }
  .finance-report-table { --finance-period:104px; min-width:960px; }
  .finance-report-table .finance-group-title,.finance-report-table .finance-group-cell { min-width:180px; }
  .finance-report-table th,.finance-report-table td { padding:9px 10px; font-size:13px; }
  .finance-context { padding-inline:16px; }
  .finance-products-head,.finance-products-note { padding-inline:16px; }
  .finance-products-controls,.finance-survey-filter { width:100%; }
  .finance-survey-filter select { min-width:0; width:100%; }
  .finance-product-table { --finance-sku:136px; }
  .finance-product-table th,.finance-product-table td { padding:8px 10px; font-size:13px; }
  .finance-cost-toolbar,.finance-cost-actions { padding-inline:16px; }
  .finance-save-area { width:100%; gap:8px; }
  .finance-save-area button { width:100%; }
  .finance-search-label { width:100%; }
  .finance-search-label input { width:100%; }
  .finance-cost-table { min-width:0; table-layout:auto; }
  .finance-cost-table thead { display:none; }
  .finance-cost-table tbody tr { display:grid; grid-template-columns:52px minmax(0,1fr); column-gap:12px; row-gap:8px; padding:14px 16px; border-top:1px solid var(--line); }
  .finance-cost-table td,.finance-cost-table tbody th { padding:0; border:0; }
  .finance-cost-table .finance-product-image { grid-row:1/3; }
  .finance-cost-table .finance-product-title { grid-column:2; }
  .finance-cost-table .finance-product-price { grid-column:2; white-space:normal; }
  .finance-product-price::before { content:'Цена сайта: '; color:#526157; font-size:12px; }
  .finance-cost-table td:last-child { grid-column:2; }
  .finance-cost-table td:last-child::before { content:'Себестоимость, ₽'; display:block; color:#526157; font-size:12px; margin-bottom:4px; }
  .finance-cost-input { width:100%; min-height:40px; }
}
