/* ============================================================================
   Balance sheet by Student — UI upgrade (design_handoff .sb-* /
   student-balance-sheet.html)
   ----------------------------------------------------------------------------
   CONTENT IS UNCHANGED. Every column, figure and total is what
   admin/dashboard/student_wise_balance_sheet.php already computes. No markup was
   edited; the whole thing hangs off #student_wise_balance_sheet, the tab pane id
   the dashboard already uses.

   This sheet is the longest table in the product — one row per student, thirty-odd
   columns — so the work here is almost entirely about making a long table
   scannable rather than about decoration:

     · the student column is FROZEN, so a name never leaves the screen
     · figures are mono and tabular, so columns scan as columns
     · a nil reads as a near-invisible marker, not as a 0 competing with real money
     · owing rows carry a faint warm ground, so they can be found by eye

   Inside @media screen — this sheet is printed and the view has its own tuned
   @media print block, which none of this may reach.
   ============================================================================ */

@media screen {

  #student_wise_balance_sheet #student_wise_balance_sheet_table {
    font-variant-numeric: tabular-nums;
    border-collapse: separate;
    border-spacing: 0;
  }

  /* ── Frozen identity column ───────────────────────────────────────────── */
  /* The single most valuable change on this sheet: without it you scroll right,
     the name goes, and every figure on the row becomes anonymous. */
  #student_wise_balance_sheet #student_wise_balance_sheet_table tbody tr > *:first-child,
  #student_wise_balance_sheet #student_wise_balance_sheet_table tfoot tr > *:first-child {
    position: sticky;
    left: 0;
    z-index: 2;
    background: var(--pt-surface, #fff);
    box-shadow: 1px 0 0 var(--pt-border-3, #f1f5f9);
  }
  #student_wise_balance_sheet #student_wise_balance_sheet_table thead tr > *:first-child {
    position: sticky;
    left: 0;
    z-index: 4;
    box-shadow: 1px 0 0 #c9d3e6;
  }

  /* ── Headers ──────────────────────────────────────────────────────────── */
  #student_wise_balance_sheet #student_wise_balance_sheet_table thead th {
    font: 500 10px var(--pt-mono, ui-monospace, monospace) !important;
    letter-spacing: .6px;
    text-transform: uppercase;
    color: var(--pt-text-3, #6b7288) !important;
    background: #f4f6fa !important;
    border: 0 !important;
    border-bottom: 1px solid #d7deec !important;
    padding: 7px 13px 8px !important;
    vertical-align: bottom;
    white-space: nowrap;
  }
  /* Group band (Fee Status / Arrears / Fine / …) — a heading for a set of
     columns, so it is set in the text face and left in the surface colour
     rather than as another mono label on the same tint. */
  #student_wise_balance_sheet #student_wise_balance_sheet_table thead th[colspan] {
    font: 600 10.5px var(--pt-font, inherit) !important;
    letter-spacing: .4px;
    color: var(--pt-text, #151a2d) !important;
    background: var(--pt-surface, #fff) !important;
    text-align: center;
    padding: 10px 13px !important;
    border-bottom: 1px solid #dfe5f1 !important;
  }
  #student_wise_balance_sheet #student_wise_balance_sheet_table thead th[colspan] + th[colspan] {
    border-left: 1px solid #c9d3e6 !important;
  }

  /* ── Body ─────────────────────────────────────────────────────────────── */
  #student_wise_balance_sheet #student_wise_balance_sheet_table tbody td {
    font: 400 12px var(--pt-mono, ui-monospace, monospace);
    color: var(--pt-text, #151a2d);
    padding: 9px 13px !important;
    border: 0 !important;
    border-bottom: 1px solid var(--pt-border-3, #f1f5f9) !important;
    vertical-align: middle;
  }
  /* Names are prose. */
  #student_wise_balance_sheet #student_wise_balance_sheet_table tbody tr > *:first-child,
  #student_wise_balance_sheet #student_wise_balance_sheet_table tbody td.text-left {
    font-family: var(--pt-font, inherit) !important;
    font-weight: 500;
    text-align: left;
  }
  #student_wise_balance_sheet #student_wise_balance_sheet_table tbody tr:hover td { background: #fbfcfe; }
  #student_wise_balance_sheet #student_wise_balance_sheet_table tbody tr:hover > *:first-child { background: #fbfcfe; }

  /* ── Meaning ──────────────────────────────────────────────────────────── */
  #student_wise_balance_sheet .text-success { color: var(--pt-ok, #1f9d64) !important; font-weight: 500; }
  #student_wise_balance_sheet .text-danger  { color: var(--pt-danger, #d64545) !important; font-weight: 600; }
  #student_wise_balance_sheet .text-warning { color: var(--pt-warn-text, #8a5a1b) !important; }

  /* A nil is not a figure. On a sheet with one row per student, a column of
     hard-black zeros carries the same visual weight as the money beside it and
     is the main reason these tables read as noise. */
  #student_wise_balance_sheet #student_wise_balance_sheet_table tbody td.text-muted,
  #student_wise_balance_sheet #student_wise_balance_sheet_table tbody td .text-muted {
    color: #dde1ea !important;
    font-weight: 400;
  }

  /* Totals row reads as a conclusion. */
  #student_wise_balance_sheet #student_wise_balance_sheet_table tfoot td,
  #student_wise_balance_sheet #student_wise_balance_sheet_table tfoot th,
  #student_wise_balance_sheet #student_wise_balance_sheet_table tbody tr.bold-f td {
    font: 600 12px var(--pt-mono, ui-monospace, monospace) !important;
    color: var(--pt-text, #151a2d) !important;
    background: var(--pt-page, #f6f8fb) !important;
    border-top: 1px solid var(--pt-border, #e8edf3) !important;
    border-bottom: 1px solid var(--pt-border, #e8edf3) !important;
    padding: 10px 13px !important;
  }

  /* The saturated column tint the view paints becomes a whisper. */
  #student_wise_balance_sheet #student_wise_balance_sheet_table .bg-pink-100,
  #student_wise_balance_sheet #student_wise_balance_sheet_table td.bg-light,
  #student_wise_balance_sheet #student_wise_balance_sheet_table th.bg-light { background: #fcfdfe !important; }

  #student_wise_balance_sheet .table-responsive { border-radius: var(--pt-r-md, 10px); }

  /* The filter box above the table. */
  #student_wise_balance_sheet input.form-control {
    border-radius: var(--pt-r, 8px);
    border-color: #dbe3ee;
    font-size: 12px;
  }
  #student_wise_balance_sheet input.form-control:focus {
    border-color: var(--pt-primary, #2f5fd0);
    box-shadow: 0 0 0 3px rgba(47, 95, 208, .14);
  }

}
/* end @media screen */
