.financial-desk { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 12px; min-width: 0; color: var(--ink); }
.financial-workbench { display: grid; grid-template-rows: auto minmax(280px, 1fr); min-width: 0; min-height: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; }
.financial-desk h2 { margin: 0; font-size: 18px; line-height: 1.3; }
.financial-entry { margin: 0; padding: 12px; border-bottom: 1px solid var(--line); }
.financial-entry header, .financial-register header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.financial-entry header { margin-bottom: 12px; }
#financialBadge { color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.financial-entry fieldset { min-width: 0; padding: 0; border: 0; margin: 0; }
.financial-entry-grid { display: grid; grid-template-columns: 140px 130px minmax(130px, 1fr) minmax(130px, 1fr) 120px; gap: 10px; align-items: end; }
.financial-desk label, .financial-combo > label { display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: #334964; min-width: 0; font-weight: 500; }
.financial-desk input, .financial-desk select { width: 100%; min-width: 0; height: 36px; padding: 6px 9px; border: 1px solid var(--line-strong); border-radius: 4px; background: #fff; color: var(--ink); font: inherit; font-size: 14px; }
.financial-desk input:disabled, .financial-desk select:disabled { background: #f4f5f6; color: #72777e; }
.financial-narration { grid-column: span 3; }
.financial-actions { grid-column: span 2; display: flex; gap: 6px; justify-content: flex-end; }
.financial-desk .btn { min-height: 34px; padding: 6px 12px; font-size: 13px; }
.financial-status { margin: 8px 0 0; min-height: 18px; font-size: 12px; line-height: 1.4; color: #53667d; overflow-wrap: anywhere; }
.financial-status.success { color: #067743; }
.financial-register { min-width: 0; min-height: 0; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }
.financial-register header { padding: 12px; }
#financialCount { display: block; font-size: 12px; color: var(--muted); margin-top: 3px; }
#financialTotal { font-size: 16px; white-space: nowrap; }
.financial-grid-scroll { min-height: 0; overflow: auto; max-height: 600px; }
.financial-desk table { width: 100%; min-width: 900px; border-collapse: collapse; table-layout: fixed; font-size: 13px; }
.financial-desk th { text-align: left; position: sticky; top: 0; background: #f1f5f9; color: #425673; font-size: 11px; z-index: 1; }
.financial-desk th, .financial-desk td { padding: 9px 8px; border-bottom: 1px solid var(--line); vertical-align: top; overflow-wrap: anywhere; }
.financial-desk th:nth-child(1) { width: 110px; }
.financial-desk th:nth-child(4) { width: 114px; text-align: right; }
.financial-desk th:nth-child(6) { width: 72px; }
.financial-desk th:nth-child(7) { width: 138px; }
.financial-desk th:nth-child(8) { width: 142px; }
.financial-desk td small { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; }
.financial-desk tr.is-selected { background: #eaf3ff; }
.financial-desk tbody tr:hover { background: #f3f7fb; }
.financial-money { text-align: right; font-variant-numeric: tabular-nums; }
.financial-source { font-size: 11px; color: #18734d; }
.financial-source.is-locked { color: #6b586d; }
.financial-row-actions { display: flex; gap: 3px; }
.financial-desk .financial-icon { display: grid; place-items: center; width: 30px; height: 32px; min-height: 32px; padding: 4px; flex-shrink: 0; }
.financial-empty { text-align: center; height: 120px; vertical-align: middle !important; color: var(--muted); }
.financial-register footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--line); font-size: 12px; }
.financial-filters { display: flex; flex-direction: column; align-self: start; gap: 14px; min-width: 0; padding: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; }
.financial-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.financial-desk [hidden] { display: none !important; }
.financial-combo { position: relative; min-width: 0; }
.financial-combo > label { margin-bottom: 6px; }
.financial-combo-control { display: flex; }
.financial-combo-control input { border-radius: 4px 0 0 4px; }
.financial-combo-control button { flex: 0 0 30px; padding: 0; height: 36px; border: 1px solid var(--line-strong); border-left: 0; border-radius: 0 4px 4px 0; background: #f8fafc; color: var(--ink); }
.financial-options { position: absolute; z-index: 20; top: 100%; left: 0; right: 0; max-height: 264px; overflow: auto; background: #fff; border: 1px solid var(--line-strong); border-radius: 4px; box-shadow: 0 6px 16px #16284226; }
.financial-options > div { padding: 8px; font-size: 13px; cursor: default; overflow-wrap: anywhere; }
.financial-options strong, .financial-options small { display: block; }
.financial-options small { font-size: 11px; color: var(--muted); margin-top: 4px; }
.financial-options [aria-selected="true"], .financial-options [role="option"]:hover { background: #e9f2ff; }
.financial-dialog { width: min(640px, calc(100vw - 28px)); max-height: calc(100dvh - 32px); overflow: auto; padding: 22px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); }
.financial-dialog::backdrop { background: #17212c70; }
.financial-dialog dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.financial-dialog dt { font-size: 12px; color: var(--muted); }
.financial-dialog dd { margin: 4px 0 0; overflow-wrap: anywhere; }
.financial-dialog table { min-width: 0; margin: 16px 0; }
.financial-dialog th { position: static; }
@media (min-width: 1250px) and (min-height: 650px) {
  html:has(.financial-desk), body:has(.financial-desk) { overflow: hidden; }
  .workspace:has(.financial-desk) { height: 100dvh; display: grid; grid-template-rows: auto minmax(0, 1fr); }
  .module-host:has(.financial-desk) { min-height: 0; overflow: hidden; padding: 12px; }
  .financial-desk { height: 100%; min-height: 0; }
  .financial-grid-scroll { max-height: none; }
}
@media (max-width: 1590px) {
  .financial-desk { grid-template-columns: minmax(0, 1fr) 260px; }
  .financial-entry-grid { grid-template-columns: 130px 125px repeat(2, minmax(0, 1fr)); }
  .financial-entry-grid > label:has(#financialAmount) { grid-row: 2; grid-column: 1; }
  .financial-narration { grid-row: 2; grid-column: 2 / -1; }
  .financial-actions { grid-column: 1 / -1; }
}
@media (max-width: 1249px) {
  .financial-desk { grid-template-columns: minmax(0, 1fr); }
  .financial-filters { grid-row: 1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
  .financial-filters h2, .financial-filters > .financial-status { grid-column: 1 / -1; }
  .financial-filters .financial-pair { align-self: end; }
  .financial-grid-scroll { max-height: 480px; min-height: 240px; }
}
@media (max-width: 620px) {
  .financial-entry-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .financial-entry-grid > label:has(#financialAmount) { grid-row: auto; grid-column: 1 / -1; }
  .financial-narration { grid-row: auto; grid-column: 1 / -1; }
  .financial-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .financial-filters .financial-pair { grid-column: 1 / -1; }
  .financial-entry header { align-items: start; flex-direction: column; gap: 4px; }
  .financial-register header { flex-wrap: wrap; }
  .financial-actions { justify-content: stretch; flex-wrap: wrap; }
  .financial-actions .btn { flex: 1; }
}
