/* expenses-layout.css — the Expenses page laid out as the portal's other table pages (2026-11-11). Layout only.
   Loaded after the theme files. Every rule is scoped to the Expenses card (#view-expenses .xp-card) or its pop-up (.modal.mv.xp-modal).

   WHAT WAS WRONG: the card kept `overflow:hidden` (the Dashboard and Drivers & Brokers cards are `overflow:clip`; the theme's rule looks for
   a table directly inside the card, and here the table sits one level deeper, in #expBody). `hidden` makes the card the thing the sticky
   column header measures from, so the header sat 17 px too low — on top of the first row — at all times. The card also had no header row:
   the filters touched its top-left corner with an empty band under them. */

/* ── the list ── */
#view-expenses .card.xp-card { overflow:clip; padding:0; }
#view-expenses .xp-hdr { display:flex; align-items:center; flex-wrap:wrap; gap:10px 12px; }
#view-expenses .xp-hdr .sec-count { margin-left:0; }
#view-expenses .xp-filters { display:flex; align-items:center; flex-wrap:wrap; gap:8px; margin-left:auto; }
#view-expenses .xp-filters .chip { margin:0; white-space:nowrap; }
#view-expenses #expBody > .tw { margin:0; }
/* columns: the short ones keep a fixed width, the name and the type share the rest; nothing is cut off */
#view-expenses .xp-table { width:100%; }
#view-expenses .xp-table th:nth-child(1) { width:132px; }
#view-expenses .xp-table th:nth-child(4) { width:130px; }
#view-expenses .xp-table th:nth-child(5) { width:120px; }
#view-expenses .xp-table th:nth-child(6) { width:150px; }
#view-expenses .xp-table th:nth-child(3) { width:22%; }
#view-expenses .xp-table th:first-child, #view-expenses .xp-table td:first-child { padding-left:18px; }
#view-expenses .xp-table th:last-child, #view-expenses .xp-table td:last-child { padding-right:18px; }
#view-expenses .xp-table th:nth-child(5), #view-expenses .xp-table td:nth-child(5) { padding-left:22px; }   /* air between the right-aligned Amount and Unit */
#view-expenses .xp-table td { vertical-align:middle; }
#view-expenses .xp-table td:nth-child(2), #view-expenses .xp-table td:nth-child(3) { overflow-wrap:anywhere; }
#view-expenses #expBody > .xp-empty { padding:34px 22px; }
@media (max-width:760px) {
  #view-expenses .xp-filters { margin-left:0; width:100%; gap:6px; }   /* the five filters wrap onto a second line; none is cut off */
  #view-expenses .xp-table th:first-child, #view-expenses .xp-table td:first-child, #view-expenses .xp-table th:last-child, #view-expenses .xp-table td:last-child,
  #view-expenses .xp-table th:nth-child(5), #view-expenses .xp-table td:nth-child(5) { padding-left:0; padding-right:0; }
}

/* ── the detail pop-up ── */
.modal.mv.xp-modal { max-width:760px; }
.modal.mv.xp-modal .mv-hdr { flex-wrap:nowrap; align-items:center; }
.modal.mv.xp-modal .mv-id { min-width:0; flex:1 1 auto; }
.modal.mv.xp-modal .mv-name { display:flex; align-items:center; flex-wrap:wrap; gap:6px 10px; }
.modal.mv.xp-modal .mv-actions { flex-wrap:wrap; justify-content:flex-end; }
.modal.mv.xp-modal .m-close { flex:none; }
.modal.mv.xp-modal .xp-body { display:flex; flex-direction:column; gap:18px; padding:18px 22px 22px; }
.modal.mv.xp-modal .xp-sec { min-width:0; }
.modal.mv.xp-modal .xp-sec-t { margin:0 0 8px; font-size:11px; font-weight:600; letter-spacing:.08em; text-transform:uppercase; color:var(--accent,#e8590c); }
.modal.mv.xp-modal .xp-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; margin:0; }
.modal.mv.xp-modal .xp-cell { min-width:0; padding:10px 12px; border-radius:12px; border:1px solid var(--line,#e2e8f0); background:var(--sheet,#f8fafc); }
.modal.mv.xp-modal .xp-cell.xp-wide { grid-column:1 / -1; }
.modal.mv.xp-modal .xp-cell .v { margin-top:3px; overflow-wrap:anywhere; }
.modal.mv.xp-modal .xp-sec > .xp-empty { padding:22px; border-radius:12px; border:1px dashed var(--line,#e2e8f0); }
.modal.mv.xp-modal .xp-receipt { max-height:min(440px,52vh); }
@media (max-width:620px) {
  .modal.mv.xp-modal .mv-hdr { flex-wrap:wrap; padding-right:56px; }
  .modal.mv.xp-modal .m-close { position:absolute !important; top:14px; right:14px; }
  .modal.mv.xp-modal .mv-actions { width:100%; margin-left:0; justify-content:flex-start; }
  .modal.mv.xp-modal .xp-body { padding:14px 16px 18px; }
  .modal.mv.xp-modal .xp-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
