/* Q40: compact, always-visible finance forms; no global form/table rule changes. */
#financeDesk { width:100%; min-width:0; color:#213547; }
#financeDesk [hidden] { display:none !important; }
#financeDesk .fd-summary { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); border:1px solid #ccd6de; background:#f7f9fb; margin:0 0 12px; }
#financeDesk .fd-summary>div { padding:12px 16px; border-right:1px solid #dce3e8; display:flex; align-items:baseline; flex-wrap:wrap; gap:6px 14px; }
#financeDesk .fd-summary>div:last-child { border-right:0; }
#financeDesk .fd-summary span { font-size:16px; white-space:nowrap; }
#financeDesk .fd-summary strong { font-size:23px; line-height:1.25; font-variant-numeric:tabular-nums; white-space:nowrap; }
#financeDesk .fd-tabs { display:flex; flex-wrap:wrap; gap:6px; padding:0 0 12px; margin:0; border:0; width:auto; position:static; background:transparent; }
#financeDesk .fd-tabs button { min-height:40px; padding:8px 14px; background:#fff; border:1px solid #c7d2dc; color:#31506a; font-size:16px; width:auto; display:block; border-radius:3px; white-space:nowrap; }
#financeDesk .fd-tabs button.active { background:#196fa5; border-color:#196fa5; color:white; }
#financeDesk #fd-refresh { margin-left:auto; }
#financeDesk .fd-pane { border:1px solid #cbd6df; padding:14px; background:white; margin:0 0 14px; scroll-margin-top:16px; }
#financeDesk .fd-pane h2 { margin:0 0 12px; font-size:20px; line-height:1.4; }
#financeDesk .form-error:empty { display:none; }
#financeDesk .fd-search { display:flex; gap:8px; align-items:center; flex-wrap:wrap; margin:0 0 10px; }
#financeDesk .fd-search label { margin:0; display:block; flex:0 1 300px; min-width:140px; }
#financeDesk .fd-search label:nth-child(2) { flex-basis:180px; }
#financeDesk :is(input,select,textarea) { box-sizing:border-box; font-size:17px; padding:8px 10px; min-height:40px; border-radius:3px; min-width:0; max-width:100%; }
#financeDesk button { min-height:40px; font-size:16px; border-radius:3px; }
#financeDesk .fd-scroll { overflow:auto; width:100%; border:1px solid #cdd7df; }
#financeDesk .fd-grid { display:table; border-collapse:collapse; width:100%; min-width:950px; table-layout:auto; margin:0; font-size:16px; }
#financeDesk .fd-grid tr { display:table-row; }
#financeDesk .fd-grid thead { display:table-header-group; position:static; width:auto; height:auto; clip-path:none; overflow:visible; }
#financeDesk .fd-grid tbody { display:table-row-group; }
#financeDesk .fd-grid td::before { display:none; content:none; }
#financeDesk .fd-grid :is(th,td) { display:table-cell; border:1px solid #d9e0e6; padding:9px 10px; vertical-align:middle; text-align:left; line-height:1.4; }
#financeDesk .fd-grid th { background:#eff3f6; font-weight:600; white-space:nowrap; color:#304b60; }
#financeDesk .fd-grid tbody tr:nth-child(even) { background:#f8fafb; }
#financeDesk .fd-grid td:nth-child(2) { overflow-wrap:anywhere; max-width:220px; }
#financeDesk .fd-grid td.fd-number { text-align:right; white-space:nowrap; font-variant-numeric:tabular-nums; }
#financeDesk .fd-grid button { white-space:nowrap; min-height:34px; padding:4px 9px; }
#financeDesk .fd-table-footer { display:flex; justify-content:space-between; gap:12px; align-items:center; margin-top:10px; font-size:15px; }
#financeDesk .panel { border:0; padding:0; margin:0; box-shadow:none; border-radius:0; }
#financeDesk .section-head { margin:0 0 10px; }
#financeDesk .stack-form { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:10px 12px; max-width:none; margin:0; align-items:start; }
#financeDesk .stack-form label { display:flex; flex-direction:column; justify-content:flex-start; gap:6px; margin:0; }
#financeDesk #cashForm>label:has(#cashDocument) { grid-column:2 / 4; grid-row:1; }
#financeDesk #cashForm>label:has(#cashType) { grid-column:1; grid-row:1; }
#financeDesk #cashForm>label:has(#cashAmount) { grid-column:4; grid-row:1; }
#financeDesk #cashForm>label:has(#cashRemarks) { grid-column:3 / 5; }
#financeDesk .stack-form>.form-error { grid-column:1 / -1; }
#financeDesk #cashForm>.form-grid { grid-column:1 / 3; display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; margin:0; }
#financeDesk :is(#cashRemarks,#chargeRemarks) { height:40px; min-height:40px; max-height:160px; resize:vertical; }
#financeDesk #cashForm small { font-size:14px; line-height:1.4; }
#financeDesk .fd-entry .section-head { margin-bottom:8px; }
#financeDesk .fd-entry .section-head p { margin:4px 0; font-size:15px; }
#financeDesk .stack-form>button { width:max-content; min-width:140px; }
#financeDesk #cashDocumentSearchHint { font-size:14px; line-height:1.4; }
#financeDesk .fd-pane .section-intro { padding:12px; margin:0 0 12px; min-height:0; }
#financeDesk .fd-pane .metric-grid { margin:0 0 12px; gap:8px; }
#financeDesk .fd-pane .metric-card { padding:12px; min-height:0; }
#financeDesk .fd-pane>.panel+.panel { margin-top:18px; padding-top:16px; border-top:1px solid #d9e0e6; }
#financeDesk .finance-export { gap:16px; }
.ledger-shell #app #financeDesk .editable-choice,.ledger-shell #app #financeDesk .editable-choice input{height:40px;min-height:40px;font-size:17px}
@media(min-width:701px) and (max-width:1000px) {
  #financeDesk .stack-form { grid-template-columns:repeat(2,minmax(0,1fr)); }
  #financeDesk #cashForm>label:has(#cashDocument) { grid-column:1 / -1; grid-row:2; }
  #financeDesk #cashForm>label:has(#cashAmount) { grid-column:2; }
  #financeDesk #cashForm>label:has(#cashRemarks),#financeDesk #cashForm>.form-grid { grid-column:1 / -1; }
}
@media(max-width:700px) {
  #financeDesk .fd-summary { grid-template-columns:repeat(2,minmax(0,1fr)); }
  #financeDesk .fd-summary>div { padding:10px; border-bottom:1px solid #dce3e8; }
  #financeDesk .fd-summary strong { font-size:21px; }
  #financeDesk .fd-pane { padding:10px; }
  #financeDesk .fd-tabs { gap:6px; }
  #financeDesk .fd-tabs button { min-height:44px; padding:8px 10px; flex:1 0 auto; }
  #financeDesk .fd-search label { flex:1 1 100%; }
  #financeDesk .fd-search button { min-height:44px; }
  #financeDesk .stack-form { display:flex; flex-direction:column; gap:12px; }
  #financeDesk .stack-form>*,#financeDesk .stack-form>.form-grid { width:100%; }
  #financeDesk .stack-form>button { width:100%; min-height:46px; }
  #financeDesk :is(input,select,textarea) { min-height:44px; }
  .ledger-shell #app #financeDesk .editable-choice,.ledger-shell #app #financeDesk .editable-choice input{height:44px;min-height:44px}
  #financeDesk .fd-table-footer { flex-wrap:wrap; }
  #financeDesk .fd-table-footer button { margin-left:auto; }
  #financeDesk .fd-grid td:first-child,#financeDesk .fd-grid th:first-child { position:sticky; left:0; background:#f4f7f9; }
}
