/* Styles for the ledger pages. Uses the tokens of dashboard.css and campus.css.
   The coa-*, reg-*, je-*, jl-*, tv-* and fp-* classes come from dashboard.css and the pages open in the
   FinModal shells (coa-overlay / bk-page) exactly as in AdvEntERP.Finance; the rules here only add the
   few pieces that had no class yet. Prefix: lg-. */

.lg-gap{margin:0 0 12px}
.lg-gap-top{margin-top:12px}
.lg-sub{font-weight:400;color:var(--faint);font-size:.78rem}
.lg-req{color:var(--neg);font-style:normal}
.lg-danger{color:var(--neg)}
.lg-warn{color:#8A5D0E}
.lg-dim td{opacity:.6}
.pe-modal.lg-wide{width:min(600px,100%)}
.pe-modal.tv-detail{width:min(900px,100%);max-width:none}      /* six columns of lines need the room */
.pe-modal p.lg-err{color:#A63B2E}                                /* .pe-modal p would grey the message out */
.pe-modal p.lg-ok{color:#1F6E52}
.pe-modal .tv-dtable td .bk-link{font-size:inherit}
.gl-checks.span2{grid-column:1 / -1}
.gl-check .gl-hint{font-weight:400}

/* ---- chart of accounts (pop-up: coa-main grid + coa-side panel) ---- */
.lg-coa .coa-table tr.lg-header td{font-weight:650;background:#F3F7F6}
.lg-coa .coa-table tr.lg-header td.name{font-weight:700}
.lg-coa .coa-table tr.lg-off td.name,.lg-coa .coa-table tr.lg-off td.code{color:var(--faint)}
.lg-coa .coa-table td.name .si-pill{margin-left:6px}
.lg-coa .coa-table td.ic a.i-go{text-decoration:none}
.lg-coa .coa-toolbar{flex-wrap:wrap;row-gap:8px}
.lg-export{justify-content:center}
.coa-pill.lg-totals{display:flex;flex-direction:column;gap:4px;text-align:left}
.coa-pill.lg-totals span{display:flex;justify-content:space-between;gap:10px}
@media (max-width:1000px){   /* the side panel drops under the grid on narrow screens */
  .coa-modal.lg-coa{flex-direction:column;overflow-y:auto}
  .lg-coa .coa-main{flex:none}
  .lg-coa .coa-side{width:auto;border-left:none;border-top:1px solid var(--line);overflow:visible}
  .lg-coa .coa-tablescroll{max-height:70vh}
}

/* ---- account register (pop-up: entry form, filter bar, grid, pager) ---- */
.lg-reg .reg-form-head{flex-wrap:wrap;row-gap:6px}
.lg-reg .reg-form-head .rv-back{width:30px;height:30px}
.lg-reg .reg-form-head .fm-nav{margin-left:auto}       /* takes the place of the reference's right-aligned Close */
.lg-reg .reg-balances{align-items:baseline}
.lg-reg .rf.lg-reg-acts{grid-column:1 / -1}
.lg-reg .rf.lg-reg-note{grid-column:span 3}
.lg-reg .rf .ss-input{padding:5px 26px 5px 8px;border-color:#D7D3BE;border-radius:7px;font-size:.82rem}
.lg-reg .reg-table td.lg-bal{font-weight:600}
.lg-reg .reg-table td.lg-memo{white-space:normal;min-width:180px}
.lg-reg .reg-table td.lg-memo .si-pill{margin-left:6px}
.lg-reg .reg-star.on{color:var(--warn)}
@media (max-width:1000px){ .lg-reg .reg-grid-form{grid-template-columns:1fr 1fr} .lg-reg .rf.lg-reg-note{grid-column:1 / -1} }

/* ---- journal list and editor ---- */
.jl-badge.lg-off-badge{background:var(--neg-soft);color:#A63B2E}
.je-headgrid.lg-je4{grid-template-columns:200px 1fr 1fr}
.ie-lines.lg-je-lines{overflow:visible}          /* account pickers of the last rows open over the card edge */
.lg-je-lines .je-lineshead{border-radius:12px 12px 0 0}
.lg-je-table{min-width:1080px}
.lg-je-table th i{color:#F2B8AE;font-style:normal}
.lg-je-table td .ss-input{padding:6px 26px 6px 8px;border-radius:8px;font-size:.82rem}
.lg-je-table td .att-remove{width:30px;height:30px}
.bk-act tr.lg-total td{border-top:2px solid var(--ink);font-weight:700;background:#F7FAF9}

/* ---- transaction list (sheet: bar, tv-filters, scrolling bk-body, tv-foot) ---- */
.lg-tv .tv-table td{vertical-align:middle}
.lg-tv .tv-table td .si-pill{margin-left:6px}
.lg-tv .coa-show{margin-left:0}
.coa-page.lg-pageno{min-width:54px;padding:5px 8px}
.tv-dtitle .si-pill{text-transform:none;letter-spacing:0}

/* ---- system account setup ---- */
.lg-sa-note{padding:14px 18px;margin-bottom:16px;font-size:.84rem}
.lg-sa-note ol{margin:8px 0 10px 20px;display:flex;flex-direction:column;gap:3px;color:var(--muted)}
.lg-sa-note ol b{color:var(--text)}
.lg-sa-form{display:flex;flex-direction:column;gap:8px;max-width:1040px}
.lg-sa-row{display:grid;grid-template-columns:300px minmax(260px,1fr) 190px;align-items:start;gap:16px;padding:11px 14px;
  border:1px solid var(--line);border-radius:11px;background:var(--card)}
.lg-sa-row.changed{border-color:var(--brand-2);background:var(--brand-soft)}
.lg-sa-label b{display:block;font-size:.88rem;font-weight:600}
.lg-sa-label b i{color:var(--neg);font-style:normal}
.lg-sa-label small{display:block;margin-top:2px;font-size:.73rem;color:var(--muted);line-height:1.4}
.lg-sa-field{min-width:0}
.lg-sa-meta{display:flex;flex-direction:column;gap:3px;align-items:flex-end;text-align:right}
.lg-sa-meta code{font-family:var(--mono);font-size:.68rem;color:var(--brand);background:var(--brand-soft);padding:2px 6px;border-radius:5px}
.lg-sa-row.changed .lg-sa-meta code{background:var(--card)}
.lg-sa-meta small{font-size:.7rem;color:var(--faint)}
@media (max-width:900px){ .lg-sa-row{grid-template-columns:1fr} .lg-sa-meta{align-items:flex-start;text-align:left} }

/* ---- year-end close checks ---- */
.lg-checks{list-style:none;margin:0 0 12px;display:flex;flex-direction:column;gap:6px;font-size:.85rem}
.lg-checks li{padding:7px 10px 7px 32px;border-radius:8px;position:relative}
.lg-checks li::before{position:absolute;left:11px;font-weight:700}
.lg-checks li.ok{background:var(--pos-soft);color:#1F6E52}
.lg-checks li.ok::before{content:"✓"}
.lg-checks li.bad{background:var(--neg-soft);color:#A63B2E}
.lg-checks li.bad::before{content:"✕"}

/* ---- DataGrid (column customizer) in the ledger and banking pop-ups ---- */
/* Column filters that used to sit in a second header row (coa-frow / tv-find): same inputs, now in a bar above the grid. */
.lg-colfilter{display:flex;flex-wrap:wrap;gap:6px;padding:6px 8px;background:#EEF3F2;border-bottom:1px solid var(--line)}
.lg-colfilter input{flex:1 1 150px;min-width:0;font-family:inherit;font-size:.75rem;padding:4px 8px;border:1px solid var(--line);
  border-radius:6px;background:#fff;color:var(--text)}
.lg-colfilter input.lg-cf-code{flex:0 1 150px}
.lg-colfilter input.lg-cf-wide{flex:2 1 220px}
.lg-colfilter input.r{text-align:right}
.lg-colfilter input::placeholder{color:var(--faint)}
.lg-colfilter input:focus{outline:none;border-color:var(--brand-2);box-shadow:0 0 0 2px rgba(44,110,128,.12)}
.lg-colfilter-tv{border:1px solid var(--line);border-radius:10px;margin-bottom:8px;padding-left:50px}   /* starts after the grid's clip column */
/* The pop-up already scrolls (coa-tablescroll, reg-tablescroll, bk-body): the grid wrapper must not become a second
   scroll box, or the sticky header and totals would stick to it instead of to the pop-up. */
.lg-coa .coa-tablescroll>.dg-wrap,.lg-reg .reg-tablescroll>.dg-wrap,.lg-tv .tv-body>.dg-wrap{overflow:visible;border-radius:0}
/* The header row has no coa-hrow class any more: same sticky position and colour. */
.coa-table.dg-table thead th{top:0;z-index:3;background:linear-gradient(180deg,#5F7C84 0%,#4C6870 100%)}
.coa-table.dg-table thead th.dg-gear-th{z-index:4}
.tv-table.dg-table thead th.dg-gear-th{z-index:4}
/* Row buttons of the chart of accounts, now under the gear. */
.lg-coa .coa-table td.dg-acts{padding:4px 6px!important}
.lg-coa .coa-table td.dg-acts :is(button,.i-lock,.i-go){display:inline-grid;place-items:center;vertical-align:middle;width:26px;height:24px;border-radius:6px;
  border:1px solid transparent;background:transparent;cursor:pointer;text-decoration:none}
.lg-coa .coa-table td.dg-acts .i-lock{cursor:default}
.lg-coa .coa-table td.dg-acts svg{width:15px;height:15px}
.lg-coa .coa-table tr.lg-header td.dg-acts{background:#F3F7F6}
/* Dimmed (reversed) rows: the pinned actions cell stays opaque, or a wide row would show through it. */
table tr.lg-dim td.dg-acts,table tr.jl-dim td.dg-acts{opacity:1}
.lg-foot-label{font-family:var(--sans);color:var(--muted);font-weight:600}
.reg-table .dg-foot td{font-family:var(--mono);z-index:2}   /* the sticky totals row covers the pinned actions cells scrolling under it */
.reg-table .dg-foot td .lg-foot-label{font-family:var(--sans)}
/* Journal lines: the account, party and fund pickers open below their cell, over the next rows and the card edge. */
.lg-je-lines .dg-wrap,.lg-je-table.dg-table td{overflow:visible}
.lg-je-table.dg-table th i{color:#F2B8AE;font-style:normal}
.lg-je-table.dg-table td.dg-acts{vertical-align:middle}
.lg-je-table .dg-foot td{border-top:2px solid var(--ink)!important;padding-top:9px;background:#F7FAF9}
.lg-je-diff{display:block;margin-top:3px;font-size:.76rem;font-weight:500}
.lg-je-diff.ok{color:#1F6E52}
.lg-je-diff.off{color:#A63B2E}
.jl-dtable.dg-table .dg-foot td{border-top:2px solid var(--ink)!important;background:transparent}
.jl-table td.dg-acts .jl-acts{display:flex}
/* Reconciliation worksheet: ticked rows keep their colour in the sticky actions cell too. */
.pv-two .rc-table tbody tr.rc-on td.dg-acts{background:var(--pos-soft)}

@media print{
  .jl-page>.bk-bar,.lg-tv .tv-filters,.lg-tv .tv-foot{display:none!important}   /* the list prints as a document */
  .lg-tv .bk-body,.lg-coa .coa-tablescroll,.lg-reg .reg-tablescroll{overflow:visible}
  .lg-colfilter{display:none!important}
}
