/* Expenses: list, drawer, report, and the pieces added to the invoice editor.
   Colours come from the tokens in app.css, so dark mode follows automatically. */
.exp-tabs, .exp-company { overflow-x: auto; }
.exp-company { margin-bottom: 0; }
.exp-company button { font-size: 15px; }
.exp-company-sel { display: flex; align-items: center; gap: 8px; margin: 8px 0; }
.exp-company-sel select { width: auto; min-width: 200px; }
.exp-tot-sum { grid-template-columns: auto repeat(2, minmax(90px, auto)); }
.exp-tabs button { white-space: nowrap; }
.exp-count { display: inline-grid; place-items: center; min-width: 20px; height: 18px; padding: 0 6px; margin-left: 6px; border-radius: 999px; background: var(--crimson-solid); color: #fff; font-size: 11px; font-weight: 700; }
.exp-filters .exp-date { display: inline-flex; align-items: center; gap: 6px; }
.exp-filters .exp-date .input { min-width: 140px; }

.exp-totals { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 16px; }
.exp-tot { display: grid; grid-template-columns: auto repeat(4, minmax(90px, auto)); align-items: center; gap: 4px 20px; padding: 10px 16px; }
.exp-cur { font-weight: 700; font-size: 14px; color: var(--navy); }
.exp-tcell .k { font-size: 12px; color: var(--text-2); line-height: 16px; }
.exp-tcell .v { font-size: 16px; font-weight: 600; line-height: 22px; font-variant-numeric: tabular-nums; }
.exp-tcell.warn .v { color: var(--st-wt-fg); }

.exp-tbl tr.static { cursor: default; }
.exp-tbl tbody tr.static:hover td { background: none; }
.exp-tbl tbody tr:focus-visible { outline: none; box-shadow: inset 0 0 0 2px #1E4FBF; border-radius: 0; }
.exp-tbl th.num, .exp-tbl td.num { text-align: right; }
.exp-main { font-weight: 600; font-size: 14px; }
.exp-desc { max-width: 340px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.exp-status { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.exp-bill { display: inline-flex; align-items: center; gap: 6px; }
.exp-c-date, .exp-c-amt { white-space: nowrap; }
.exp-c-act .row { flex-wrap: nowrap; gap: 6px; }
.exp-rep { margin-bottom: 24px; }
.exp-rep h3 { margin: 0 0 8px; font-size: 16px; font-weight: 600; }
.exp-none { margin: 0; padding: 16px; }

/* drawer */
.exp-title { margin: 6px 0 0; font-size: 20px; line-height: 28px; font-weight: 600; overflow-wrap: anywhere; }
.exp-amt { font-size: 22px; line-height: 30px; font-weight: 600; font-variant-numeric: tabular-nums; }
.exp-gap { margin-bottom: 16px; }
.exp-dl { margin: 0 0 20px; display: flex; flex-direction: column; }
.exp-kv { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--border); font-size: 14px; line-height: 20px; }
.exp-kv:last-child { border-bottom: 0; }
.exp-kv dt { color: var(--text-2); font-size: 13px; }
.exp-kv dd { margin: 0; overflow-wrap: anywhere; }
.exp-sec { margin-top: 24px; }
.exp-sech h4 { margin: 0 0 8px; font-size: 14px; font-weight: 600; }
.exp-prev { margin-bottom: 10px; }
.exp-img { display: block; max-width: 100%; max-height: 420px; object-fit: contain; border: 1px solid var(--border); border-radius: 8px; background: #fff; }
.exp-viewer { min-height: 0; max-height: 440px; overflow: auto; padding: 24px 8px 8px; }
.exp-pages { display: flex; flex-direction: column; align-items: center; gap: 24px; }
.exp-vtext { overflow-wrap: anywhere; font-size: 13px; }
.exp-actions { justify-content: flex-start; }
.exp-file { height: auto; padding: 6px 8px; }

/* the form */
.exp-form .hint:empty { display: none; }

/* the invoice editor */
.inv-addrow { gap: 8px; }
.exp-tag { height: 18px; font-size: 11px; padding: 0 7px; flex: none; }
.inv-desc-exp { display: flex; align-items: center; gap: 8px; min-width: 0; }
.inv-desc-exp .input { min-width: 0; }
.inv-line-exp input[readonly] { background: var(--surface-2); color: var(--text-2); }
.exp-pickrow { display: grid; grid-template-columns: 16px minmax(0, 1fr) auto; align-items: start; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.exp-pickrow:last-child { border-bottom: 0; }
.exp-pickrow input { margin-top: 3px; }
.exp-pickmain { display: flex; flex-direction: column; min-width: 0; font-size: 14px; }
.exp-pickmain .faint { overflow-wrap: anywhere; }
.exp-pickamt { display: flex; flex-direction: column; align-items: flex-end; font-weight: 600; font-size: 14px; }
.exp-client { margin-bottom: 16px; gap: 8px; }
.exp-client-row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 20px; }
.exp-client-co { font-weight: 600; min-width: 120px; }
.exp-client-tot { display: flex; flex-wrap: wrap; gap: 4px 16px; font-weight: 600; font-size: 16px; }

@media (max-width: 1100px) {
  .exp-desc { max-width: 220px; }
}
@media (max-width: 767px) {
  .exp-filters .input, .exp-filters select.input { flex: 1 1 140px; min-width: 0; }
  .exp-filters .exp-date { flex: 1 1 140px; }
  .exp-filters .exp-date .input { flex: 1; min-width: 0; }
  .exp-tot { grid-template-columns: 1fr 1fr; width: 100%; gap: 6px 16px; }
  .exp-cur { grid-column: 1 / -1; }
  .exp-totals { gap: 8px; }
  /* Stacked cards: every cell names its column, nothing scrolls sideways. */
  .exp-wrap { background: none; border: 0; box-shadow: none; }
  .exp-tbl tbody { display: flex; flex-direction: column; gap: 10px; padding: 10px; }
  .exp-tbl tr { border: 1px solid var(--border); border-radius: 10px; background: var(--surface); padding: 10px 12px; }
  .exp-tbl tr:last-child { border-bottom: 1px solid var(--border); }
  .exp-tbl td { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 4px 0; text-align: right; min-width: 0; }
  .exp-tbl td::before { content: attr(data-label); flex: none; color: var(--text-3); font-size: 12px; font-weight: 600; text-align: left; padding-top: 1px; }
  .exp-tbl td > * { min-width: 0; text-align: right; }
  .exp-tbl td.num { text-align: right; }
  .exp-desc { max-width: 60vw; }
  .exp-status { justify-content: flex-end; }
  .exp-c-act .row { width: 100%; justify-content: flex-end; }
  .exp-kv { grid-template-columns: 96px minmax(0, 1fr); }
  .exp-pickrow { grid-template-columns: 16px minmax(0, 1fr); }
  .exp-pickamt { grid-column: 2; align-items: flex-start; }
  .inv-desc-exp { flex-direction: column; align-items: flex-start; }
  .inv-desc-exp .input { width: 100%; }
}
