/* FCMS Module 7 — Accounting pages. Builds on /design-system/tokens.css + /journey/static/journey.css;
   colours only through their variables. Laptop (1366 px) and 10-inch tablet (portrait 800 px / landscape 1280 px). */

/* sub-navigation between the four accounting pages */
.acc-subnav { display: flex; gap: 6px; flex-wrap: wrap; margin: -6px 0 18px; }
.acc-subnav a { border: 1.5px solid var(--border-strong); background: var(--white); color: var(--dept-deep); border-radius: 999px;
  padding: 8px 16px; font-weight: 700; font-size: 14.5px; }
.acc-subnav a.on { background: var(--dept-deep); border-color: var(--dept-deep); color: var(--white); }
.acc-subnav a:hover { border-color: var(--sapphire); }

/* wide tables scroll inside their card on a tablet instead of pushing the page sideways */
.acc-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.acc-scroll table.t { min-width: 720px; }
table.t td.num, table.t th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.t .pill { white-space: nowrap; }
table.t td > b { white-space: nowrap; }
table.t tr.void td { color: var(--ink-soft); text-decoration: line-through; }
table.t tr.clickable { cursor: pointer; }
table.t tfoot td { font-weight: 700; border-top: 2px solid var(--border-strong); border-bottom: 0; }
.acc-filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 14px; }
.acc-filters > label.f { min-width: 150px; }
.acc-filters > label.f.grow { flex: 1; min-width: 200px; }
.acc-filters .check { display: flex; gap: 6px; align-items: center; font-weight: 700; font-size: 14px; color: var(--ink); padding-bottom: 10px; }

/* patient / vendor pickers */
.acc-field { display: flex; flex-direction: column; gap: 5px; font-size: 13.5px; color: var(--ink); font-weight: 700; }
.acc-picker { position: relative; }
.acc-dd { position: absolute; z-index: 30; left: 0; right: 0; top: 100%; margin-top: 4px; background: var(--white);
  border: 1px solid var(--border-strong); border-radius: 6px; box-shadow: var(--shadow-lg); max-height: 300px; overflow-y: auto; }
.acc-dd button { display: block; width: 100%; text-align: left; border: 0; background: var(--white); padding: 9px 12px; cursor: pointer;
  border-bottom: 1px solid var(--border-soft); color: var(--ink-body); font-size: 14.5px; }
.acc-dd button:hover, .acc-dd button:focus { background: var(--sapphire-muted); outline: none; }
.acc-chosen { display: flex; gap: 10px; align-items: center; padding: 9px 12px; border: 1.5px solid var(--emerald); border-radius: 6px;
  background: var(--emerald-muted); }

/* invoice lines editor */
.acc-lines input { width: 100%; min-width: 64px; border: 1.5px solid var(--border-strong); border-radius: 6px; padding: 7px 8px;
  font-size: 14.5px; background: var(--white); color: var(--ink-body); }
.acc-lines input:disabled { background: var(--gray-100); color: var(--ink-soft); }
.acc-lines td { padding: 6px 6px; }
.acc-catalog { max-height: 260px; overflow-y: auto; border: 1px solid var(--border-soft); border-radius: 6px; }
.acc-catalog button { display: flex; width: 100%; gap: 10px; align-items: center; border: 0; border-bottom: 1px solid var(--border-soft);
  background: var(--white); padding: 9px 12px; cursor: pointer; text-align: left; font-size: 14.5px; color: var(--ink-body); }
.acc-catalog button:hover { background: var(--sapphire-muted); }
.acc-catalog .price { margin-left: auto; font-weight: 700; color: var(--dept-deep); white-space: nowrap; }
.acc-totals { display: grid; grid-template-columns: max-content max-content; gap: 4px 22px; justify-content: end; font-size: 15px; }
.acc-totals div:nth-child(odd) { color: var(--ink-soft); font-weight: 600; text-align: right; }
.acc-totals div:nth-child(even) { text-align: right; font-variant-numeric: tabular-nums; }
.acc-totals .grand { color: var(--dept-deep); font-weight: 700; font-size: 18px; }

/* notices */
.acc-note { border-left: 4px solid var(--sapphire); background: var(--sapphire-muted); padding: 10px 14px; border-radius: 6px; font-size: 14px;
  color: var(--ink-body); margin-bottom: 12px; }
.acc-note.warn { border-left-color: var(--color-warning); background: var(--warning-muted); }
.acc-note.danger { border-left-color: var(--ruby); background: var(--ruby-muted); }
.acc-note.ok { border-left-color: var(--emerald); background: var(--emerald-muted); }

/* cash count */
.acc-count { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.acc-count label { display: flex; flex-direction: column; gap: 4px; font-weight: 700; font-size: 13.5px; color: var(--ink); }
.acc-count label small { color: var(--ink-soft); font-weight: 600; }
.acc-count input { border: 1.5px solid var(--border-strong); border-radius: 6px; padding: 9px 10px; font-size: 16px; text-align: right; }
.acc-variance { font-size: 22px; font-weight: 700; }
.acc-variance.zero { color: var(--emerald-dark); }
.acc-variance.off { color: var(--ruby); }

/* P&L chart */
.acc-chart { width: 100%; height: 220px; }
.acc-chart .rev { fill: var(--emerald); }
.acc-chart .exp { fill: var(--ruby-light); }
.acc-chart .axis { stroke: var(--border-strong); stroke-width: 1; }
.acc-chart text { fill: var(--ink-soft); font-size: 11px; font-family: inherit; }
.acc-legend { display: flex; gap: 16px; font-size: 13.5px; font-weight: 600; color: var(--ink-soft); }
.acc-legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.acc-legend i.rev { background: var(--emerald); }
.acc-legend i.exp { background: var(--ruby-light); }

.acc-pager { display: flex; gap: 10px; align-items: center; justify-content: flex-end; margin-top: 12px; }
.acc-empty { padding: 28px; text-align: center; color: var(--ink-soft); font-weight: 600; }
.acc-stack > * + * { margin-top: 14px; }
.nowrap { white-space: nowrap; }
.ruby-text { color: var(--ruby); }
.emerald-text { color: var(--emerald-dark); }

@media (max-width: 1100px) {
  .main { padding: 20px 18px 50px; }
  .topbar h1 { font-size: 23px; }
}
@media (max-width: 900px) {
  .acc-filters > label.f { min-width: 130px; flex: 1; }
  .modal { padding: 16px; }
}
.acc-span2 { grid-column: span 2; }
@media (max-width: 760px) { .acc-span2 { grid-column: auto; } }
/* the patient banner (journey-shared PatientBanner) inside a dialog stays at the dialog's top; inside a form box it does not stick */
.modal .ptb { top: 0; margin: 0 0 14px; }
.acc-field .ptb { position: static; margin: 0; font-weight: 400; }
