/* NEW-83: màn Tài chính (views/finance_list.js) — tiền tố fl-; chỉ biến màu của app.css (sáng / tối). Lớp rc-* (nút đầu trang, thu thừa) của receipts.css. */
.fl-intro { max-width: 900px; }
.fl-rule { margin: 0 0 12px; font-size: 13px; }
.fl-rule summary { cursor: pointer; color: var(--brand-dark); font-weight: 600; }
.fl-rule ul { margin: 6px 0 0; padding-left: 18px; }
.fl-rule p { margin: 6px 0 0; }
.fl-cards { margin: 0 0 12px; }
.fl-sum, .fl-aging { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; margin: 0 0 8px; }
.fl-tile { display: flex; flex-direction: column; gap: 2px; text-align: left; font: inherit; color: var(--ink); background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 9px 12px; min-width: 0; }
button.fl-tile { cursor: pointer; }
button.fl-tile:hover { background: var(--hover); }
.fl-tile.on { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); background: var(--brand-soft); }
.fl-tile .fl-l { font-size: 12px; color: var(--muted); }
.fl-tile .fl-v { font-size: 17px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.fl-tile .fl-h { font-size: 11px; color: var(--muted); }
.fl-tile.fl-bad { border-left: 3px solid var(--err); }
.fl-tile.fl-warn { border-left: 3px solid var(--warn, var(--accent)); }
.fl-tile.fl-mute .fl-v { color: var(--muted); }
.fl-filters { display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: flex-end; margin: 0 0 12px; }
.fl-f { display: flex; flex-direction: column; gap: 2px; font-size: 12px; color: var(--muted); min-width: 0; }
.fl-f select { max-width: 240px; }
.fl-q { flex: 1 1 260px; }
.fl-q input { width: 100%; }
.fl-checks { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: center; font-size: 13px; }
.fl-chk { display: inline-flex; gap: 6px; align-items: center; white-space: nowrap; }
.fl-ferr { flex: 1 1 100%; margin: 0; }
.fl-table td { vertical-align: top; }
.fl-table td.num, .fl-table th.num { white-space: nowrap; }
.fl-table tr.fl-row { cursor: pointer; }
.fl-table tr.fl-row:hover > td, .fl-table tr.fl-on > td { background: var(--surface-2); }
.fl-table tr.fl-row:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }
.fl-sort { background: none; border: 0; padding: 0; font: inherit; color: inherit; cursor: pointer; text-align: inherit; }
.fl-sort:hover { text-decoration: underline; }
.fl-code { font-weight: 600; overflow-wrap: anywhere; }
.fl-table td:first-child { min-width: 190px; }
.fl-client { overflow-wrap: anywhere; }
.fl-s { font-size: 12px; }
.fl-neg, .fl-bad-t { color: var(--err); }
.fl-acts { width: 1%; }
.fl-acts .btn { white-space: nowrap; }
.fl-total > td { font-weight: 600; background: var(--surface-2); border-top: 2px solid var(--line); }
.fl-foot { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; margin-top: 8px; }
.fl-exp > td { background: var(--surface-2); padding: 0 !important; cursor: default; }
.fl-drawer { padding: 12px 14px; border-left: 3px solid var(--brand); }
.fl-dr-head { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; margin-bottom: 8px; }
.fl-dr-links { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; }
.fl-dr-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 12px; }
.fl-dr-grid h4 { margin: 0 0 6px; }
/* Màn điện thoại: bảng thành THẺ (nhãn cột trên từng ô) như Pool NEW-90 ⇒ không cuộn ngang; ô tóm tắt hai cột. */
@media (max-width: 760px) {
  .fl-sum, .fl-aging { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fl-filters > .fl-f { flex: 1 1 calc(50% - 10px); }
  .fl-filters > .fl-q { flex-basis: 100%; }
  .fl-f select, .fl-f input { width: 100%; max-width: none; }
  .fl-dr-grid { grid-template-columns: minmax(0, 1fr); }
  table.data.fl-table, table.data.fl-table tbody, table.data.fl-table tfoot, table.data.fl-table tr, table.data.fl-table td,
  table.data.fl-sub, table.data.fl-sub tbody, table.data.fl-sub tr, table.data.fl-sub td { display: block; width: 100%; min-width: 0; max-width: none; }
  table.data.fl-table thead, table.data.fl-sub thead { display: none; }
  table.data.fl-table tr, table.data.fl-sub tr { padding: 10px 12px; border-bottom: 1px solid var(--line); }
  table.data.fl-table td, table.data.fl-sub td { border: 0; padding: 3px 0; text-align: left; white-space: normal; }
  table.data.fl-table td:empty { display: none; }
  table.data.fl-table td[data-label]:not([data-label=""])::before, table.data.fl-sub td[data-label]::before { content: attr(data-label); display: block;
    font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
  table.data.fl-table tr.fl-exp { padding: 0; }
  /* thẻ gọn: hai cột số cạnh nhau, ô phụ lục + nút trải hết chiều ngang */
  table.data.fl-table tr.fl-row, table.data.fl-table tr.fl-total { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 2px 12px; }
  table.data.fl-table tr.fl-row > td:first-child, table.data.fl-table tr.fl-total > td:first-child, table.data.fl-table .fl-acts { grid-column: 1 / -1; }
  table.data.fl-table td:first-child { min-width: 0; }
  .fl-acts { width: auto; }
  .fl-acts .btn { min-height: 36px; }
  .fl-drawer { padding: 10px; }
  .fl-drawer .table-wrap { box-shadow: none; }
}
