/*
 * ledger/module.css: the Books tab (overview, reports, journal, accounts),
 * the entry form and the Books settings panel. Theme tokens only; --mustard
 * is the accent (acid on Plasmodium, olive on Oat), --brick what is short.
 */

.lg-eyebrow{font-size:10.5px;font-weight:500;letter-spacing:0.12em;text-transform:uppercase;color:var(--ink-soft);margin:0 0 8px;}
.lg-num{color:var(--mustard);margin-right:8px;}
.lg-late{color:var(--brick);}
.lg-accent{color:var(--mustard);}
.lg-dim{color:var(--text-muted);}
.lg-headline{font-family:var(--font-display);font-weight:300;letter-spacing:-0.02em;}
.lg-tabs{margin:4px 0 14px;}
.lg-code{display:inline-block;min-width:44px;margin-right:8px;color:var(--text-muted);font-variant-numeric:tabular-nums;}
.lg-num-cell{text-align:right;font-variant-numeric:tabular-nums;white-space:nowrap;}

.lg-toolbar{display:flex;align-items:center;gap:12px;flex-wrap:wrap;margin:0 0 14px;}

.lg-kpis{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:14px;margin:6px 0 18px;}
@media (max-width:900px){ .lg-kpis{grid-template-columns:repeat(2,minmax(0,1fr));} }
.lg-kpi{border-top:1px solid var(--line);padding-top:10px;min-width:0;}
.lg-kpi-label{font-size:10.5px;font-weight:500;letter-spacing:0.12em;text-transform:uppercase;color:var(--ink-soft);}
.lg-kpi-value{font-family:var(--font-display);font-size:30px;font-weight:300;letter-spacing:-0.03em;line-height:1.15;margin-top:4px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.lg-kpi-value.accent{color:var(--mustard);}
.lg-kpi-value.accent.lg-late{color:var(--brick);}

.row.ledger-clients{grid-template-columns:minmax(0,1.6fr) minmax(0,0.8fr) minmax(0,0.7fr) minmax(0,0.6fr) minmax(0,0.8fr) 70px;align-items:center;}
.row.ledger-clients > div:not(:first-child){text-align:right;font-variant-numeric:tabular-nums;}
/* On a phone: client, revenue and margin; the three costs are on the desk view. */
@media (max-width:760px){
  .row.ledger-clients:not(.head){grid-template-columns:minmax(0,1fr) auto 52px !important;gap:10px;}
  .row.ledger-clients > div:nth-child(3), .row.ledger-clients > div:nth-child(4), .row.ledger-clients > div:nth-child(5){display:none;}
  .row.ledger-accounts:not(.head){grid-template-columns:minmax(0,1fr) auto !important;gap:4px 10px;}
  .row.ledger-accounts > div:nth-child(2){grid-column:1;}
  .row.ledger-accounts > .lg-row-actions{grid-column:2;}
}
.lg-zero{color:var(--text-muted);}
.lg-bar{height:3px;background:var(--subtle-bg);margin-top:6px;max-width:260px;}
.lg-bar > div{height:3px;background:var(--mustard);}
.lg-foot-note{margin-top:10px;}

.lg-grid{display:grid;grid-template-columns:minmax(0,1.2fr) minmax(0,1fr);gap:18px;}
@media (max-width:900px){ .lg-grid{grid-template-columns:1fr;} }
.lg-line{display:flex;justify-content:space-between;align-items:baseline;gap:10px;padding:7px 0;border-top:1px solid var(--line);font-size:13px;}
.lg-line > div:first-child{min-width:0;}
.lg-line > div:last-child{text-align:right;white-space:nowrap;font-variant-numeric:tabular-nums;}
.lg-line.lg-sub{color:var(--ink-soft);}
.lg-month{display:flex;justify-content:space-between;align-items:baseline;margin:14px 0 2px;font-size:10.5px;font-weight:500;letter-spacing:0.12em;text-transform:uppercase;color:var(--ink-soft);}
.lg-month:first-child{margin-top:4px;}
.lg-total{display:flex;justify-content:space-between;align-items:baseline;gap:10px;border-top:1px solid var(--line-strong);padding:10px 0 4px;margin-top:8px;font-size:15px;}
.lg-total > span:last-child{font-family:var(--font-display);font-size:22px;font-weight:300;letter-spacing:-0.02em;white-space:nowrap;}

.lg-tb{display:grid;grid-template-columns:minmax(0,1fr) 110px 110px;gap:10px;padding:7px 0;border-top:1px solid var(--line);font-size:13px;align-items:baseline;}
.lg-tb.lg-tb-head{font-size:10.5px;font-weight:500;letter-spacing:0.12em;text-transform:uppercase;color:var(--ink-soft);border-top:0;}
.lg-tb.lg-tb-head > div:not(:first-child){text-align:right;}
.lg-tb.lg-tb-total{border-top:1px solid var(--line-strong);font-weight:500;}
@media (max-width:760px){ .lg-tb{grid-template-columns:minmax(0,1fr) 88px 88px;} }

.lg-filters{display:flex;gap:10px;flex-wrap:wrap;align-items:flex-end;margin:0 0 12px;}
.lg-filters .field{margin:0;min-width:150px;}
.lg-filters .field:first-child{min-width:220px;}
.lg-filter-actions{display:flex;gap:6px;padding-bottom:2px;}

.lg-entry{padding:12px 14px;border-top:1px solid var(--line);}
.lg-entry:first-child{border-top:0;}
.lg-entry-head{display:grid;grid-template-columns:200px minmax(0,1fr) auto;gap:12px;align-items:baseline;margin-bottom:4px;}
.lg-entry-head > div:first-child{white-space:nowrap;}
.lg-entry-memo{min-width:0;font-size:13.5px;}
.lg-entry-total{display:flex;gap:8px;align-items:center;font-variant-numeric:tabular-nums;white-space:nowrap;}
.lg-entry-line{display:grid;grid-template-columns:minmax(0,1fr) 110px 110px;gap:12px;font-size:12.5px;color:var(--ink-soft);padding:2px 0 2px 212px;}
@media (max-width:760px){
  .lg-entry-head{grid-template-columns:1fr;gap:2px;}
  .lg-entry-line{padding-left:0;grid-template-columns:minmax(0,1fr) 80px 80px;}
}
.lg-pager{display:flex;justify-content:space-between;align-items:center;gap:8px;margin-top:10px;}

.row.ledger-accounts{grid-template-columns:minmax(0,1.5fr) minmax(0,1fr) 120px 170px;align-items:center;cursor:pointer;}
.row.ledger-accounts.lg-archived{opacity:0.55;}
.lg-row-actions{display:flex;gap:6px;justify-content:flex-end;}

.lg-form-line{display:grid;grid-template-columns:minmax(0,1.6fr) 96px 96px minmax(0,1fr) minmax(0,1fr) auto;gap:6px;margin-bottom:6px;align-items:center;}
.lg-form-head{font-size:10.5px;font-weight:500;letter-spacing:0.12em;text-transform:uppercase;color:var(--ink-soft);margin-top:6px;}
@media (max-width:760px){ .lg-form-line{grid-template-columns:1fr 1fr;} .lg-form-head{display:none;} }
.lg-form-foot{display:flex;justify-content:space-between;align-items:center;gap:10px;flex-wrap:wrap;margin-top:4px;}

.lg-settings-note{margin:14px 0 6px;}
.lg-tax-dates{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;max-width:620px;font-size:13px;}
@media (max-width:760px){ .lg-tax-dates{grid-template-columns:repeat(2,minmax(0,1fr));} }
.lg-tax-dates > div{border-top:1px solid var(--line);padding-top:6px;}

/* Why an entry exists: its lines with the reason each is there. */
.lg-why{width:100%;margin:4px 0 6px;}
.lg-why td{vertical-align:top;}
.lg-why td.lg-num-cell,.lg-why th{white-space:nowrap;}

/* Area 5a: the Books in the system. A journal entry is a hairline section,
   flush with the page; the bars are hairlines; the totals' figures light. */
html:is([data-theme="plasmodium"],[data-theme="oat"]) .lg-entry{padding:14px 0;}
html:is([data-theme="plasmodium"],[data-theme="oat"]) .lg-entry-memo{font-size:15.2px;}
html:is([data-theme="plasmodium"],[data-theme="oat"]) .lg-entry-line{font-size:14.4px;}
html:is([data-theme="plasmodium"],[data-theme="oat"]) :is(.lg-line, .lg-tb){font-size:14.4px;padding:9px 0;}
html:is([data-theme="plasmodium"],[data-theme="oat"]) .lg-tb.lg-tb-total{font-weight:400;}
html:is([data-theme="plasmodium"],[data-theme="oat"]) :is(.lg-bar, .lg-bar > div){height:2px;}
html:is([data-theme="plasmodium"],[data-theme="oat"]) .lg-bar{background:var(--line);}
html:is([data-theme="plasmodium"],[data-theme="oat"]) .lg-grid{gap:0 48px;}
html:is([data-theme="plasmodium"],[data-theme="oat"]) .lg-tax-dates{font-size:14.4px;}
html:is([data-theme="plasmodium"],[data-theme="oat"]) .lg-toolbar{gap:12px 24px;margin-bottom:20px;}
html:is([data-theme="plasmodium"],[data-theme="oat"]) .lg-toolbar .micro-text{font-size:14.4px;}
/* A line of the entry form never runs past the pop-up: each cell shrinks to its share. */
.lg-form-line > *{min-width:0;}
.lg-form-line :is(input, select){width:100%;}
