/* ===========================================================================
   THE OLD ERP'S FINANCE LOOK, for Money owed, Profit & Loss, Customer Card and
   Collection Desk (owner, 07-11-2026: "junya erp cha finance cha design jasa ahe
   tasa mala navin erp madhe pahije").

   Every rule here is a rule of the old crm.html stylesheet (.filters, .tile,
   .card, .card h3, .card .hint, .sheet, thead th, tr.filterrow, .warnbar),
   re-stated under `.fin-old` so it reaches ONLY the four screens that wrap
   themselves in it (finOldPage() in app.js). styles.css re-skins the whole
   ERP; this file must never do that, which is why nothing here is unscoped.

   Colours are the ERP's own tokens (--card, --line, --paper, --gold-*,
   --amber*, --muted*), so a theme that redefines the tokens redefines these
   screens with it. The two hairline tones the old file wrote as hex are
   tokens of this scope (--fo-*) for the same reason.
   =========================================================================== */
.fin-old{--fo-amber-line:#F5E3C0;--fo-gold-line:#F1E3C1}

/* ---- the filter card: a small grey caps label, the selects, the rest pushed right */
.fin-old .fo-filters{display:flex;gap:9px;align-items:center;flex-wrap:wrap;padding:12px 16px;
  margin-bottom:var(--gap);background:var(--card);border:1px solid var(--line);
  border-radius:var(--r-card);box-shadow:var(--sh-1)}
.fin-old .fo-filters .lbl{font-size:9.5px;font-weight:600;letter-spacing:.15em;text-transform:uppercase;
  color:var(--muted-2)}
.fin-old .fo-filters .spacer{flex:1}
.fin-old .fo-row{display:flex;gap:8px;flex-wrap:wrap;align-items:center;margin-top:10px}
.fin-old .fo-row + .fo-row{margin-top:8px}
.fin-old .fo-row label,.fin-old .fo-filters label{display:flex;gap:6px;align-items:center;font-size:12.5px;color:var(--ink-500)}
/* A field built without a type attribute is a text field; the ERP-wide rule names only typed ones. */
.fin-old input:not([type]){padding:9px 12px;border-radius:var(--r-sm);border:1px solid var(--line);
  background:var(--card);color:var(--ink);outline:none;max-width:100%;font-size:13.5px;
  transition:border-color .14s,box-shadow .14s}
.fin-old input:not([type]):focus{border-color:var(--gold);box-shadow:0 0 0 3px var(--gold-50)}

/* ---- KPI tiles: the corner wash, the BIG value first, then the label, then the grey line */
.fin-old .tiles{grid-template-columns:repeat(auto-fit,minmax(212px,1fr));gap:16px;margin:0 0 var(--gap)}
.fin-old .tile{padding:18px;background:var(--card)}
.fin-old .tile .v{margin-top:0;font-size:29px;font-weight:700;line-height:1.05;letter-spacing:-.03em;color:var(--ink)}
.fin-old .tile .l{font-size:12.5px;font-weight:500;letter-spacing:0;text-transform:none;color:var(--muted);margin-top:7px}
.fin-old .tile .s{font-size:11.5px;color:var(--muted-2);margin-top:4px}

/* ---- note bars (old .warnbar). Amber for a fault, the gold wash for the old noteBar that
   opens its list, and the paper bar for a plain fact such as "Data as at". */
.fin-old .warnbar{background:var(--amber-soft);color:var(--amber);font-size:12.5px;font-weight:500;
  padding:11px 15px;border-radius:var(--r);margin:0 0 var(--gap);border:1px solid var(--fo-amber-line);
  line-height:1.5}
/* Bars that follow one another sit closer than a bar and the card under it. */
.fin-old .warnbar:has(+ .warnbar){margin-bottom:10px}
.fin-old .warnbar.brass{background:var(--gold-50);color:var(--gold-700);border-color:var(--fo-gold-line)}
.fin-old .warnbar.plain{background:var(--paper);color:var(--ink-700);border-color:var(--line)}
.fin-old .warnbar.link{cursor:pointer;display:flex;gap:9px;align-items:flex-start}
.fin-old .warnbar.link:hover{border-color:var(--gold)}

/* ---- cards (old .card): padded white rounded box; the heading is a flex row whose controls sit
   on the right; the hint is a left-aligned grey paragraph. `.panel` is what these screens draw,
   so `.panel` is what is re-dressed. */
.fin-old .panel{padding:var(--pad) 18px 18px;overflow:visible;margin-bottom:var(--gap)}
.fin-old .panel-head{padding:0;border:0;background:none;margin-bottom:3px;gap:12px;
  justify-content:space-between;min-height:30px}
.fin-old .panel-head>b,.fin-old .panel-head>h3{font-size:14.5px;font-weight:700;color:var(--ink)}
.fin-old .panel-head .muted{font-size:12px;font-weight:400}
.fin-old .fo-ctrls{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.fin-old .fo-ctrls label{font-size:12px;color:var(--muted);font-weight:400;display:flex;gap:5px;align-items:center}
.fin-old .panel .hint{text-align:left;font-size:12px;color:var(--muted);margin:0 0 14px;line-height:1.45;padding:0}
.fin-old .panel .hint b{color:var(--ink-700);font-weight:600}
.fin-old .panel > .note,.fin-old .panel > div:not([class]) > .note{padding-left:0;padding-right:0}
.fin-old .panel > .empty{padding:24px 12px}

/* ---- tables (old .sheet + thead th + tr.filterrow): every table in a card sits in its own
   rounded, bordered box; the headings are small spaced capitals on the paper tone. */
.fin-old .panel .tbl-scroll{border:1px solid var(--line);border-radius:14px;background-color:var(--card)}
.fin-old thead th{font-size:10px;font-weight:600;letter-spacing:.11em;text-transform:uppercase;
  color:var(--muted);padding:11px 13px;background:var(--paper);border-bottom:1px solid var(--line)}
.fin-old tbody td{padding:11px 13px}
.fin-old th.sortable{cursor:pointer;user-select:none;transition:color .12s,background .12s}
.fin-old th.sortable:hover{color:var(--gold-700);background:var(--gold-50)}
.fin-old tr.filterrow th{padding-top:0;padding-bottom:7px;font-weight:400;background:var(--paper);
  text-transform:none;letter-spacing:0}
.fin-old tr.filterrow select{width:100%;max-width:190px;padding:4px 22px 4px 7px;font-size:11.5px;
  border-radius:6px;background-color:var(--card);color:var(--ink-500);background-position:right 6px center}
/* Two header rows both sticky would land on top of each other; the filter row stays put. */
.fin-old thead tr.filterrow th{position:static}

/* ---- buttons: the old plain bordered button, ink on white, for everything but the one action */
.fin-old .btn.ghost{color:var(--ink);font-weight:600}
.fin-old .btn.small.ghost,.fin-old .btn.sm.ghost{font-weight:500}
