/* Invoices - vendor invoice approvals (list, KPIs, editor). Shares the
   register/table/modal styles from projects.css + change-orders.css. */

/* ---- ledger strip ---- */
.inv-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 4px 0 18px; }
.inv-kpi { border: 1px solid var(--hair); border-radius: 12px; background: var(--panel); padding: 14px 16px; cursor: pointer; transition: border-color .12s ease; }
.inv-kpi:hover, .inv-kpi.on { border-color: var(--gold-line); }
.inv-kpi .k-num { font-family: "Cormorant Garamond", Georgia, serif; font-size: 30px; line-height: 1; color: var(--gold-bright); }
.inv-kpi[data-kpi="approved"] .k-num { color: #8fd8a2; }
.inv-kpi[data-kpi="overdue"] .k-num { color: #e88b86; }
.inv-kpi[data-kpi="posted"] .k-num { color: var(--text-mid); }
.inv-kpi .k-lab { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-mid); font-weight: 700; margin-top: 6px; }
.inv-kpi .k-sub { font-size: 12px; color: var(--text-dim); margin-top: 3px; min-height: 1em; }
@media (max-width: 900px) { .inv-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---- toolbar extras ---- */
.inv-tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.inv-tab { font: inherit; font-size: 12.5px; font-weight: 600; padding: 8px 12px; border-radius: 10px; border: 1px solid transparent; background: none; color: var(--text-mid); cursor: pointer; }
.inv-tab:hover { color: var(--text-hi); }
.inv-tab.on { color: var(--gold-bright); border-color: var(--gold-faint); background: rgba(212,175,95,0.08); }
.inv-tab b { font-weight: 700; margin-left: 5px; color: var(--text-dim); }
.inv-tab.on b { color: var(--gold-bright); }
.inv-search { min-width: 200px; }
.inv-csv { text-decoration: none; margin-left: auto; color: var(--text-mid); }
.inv-csv:hover { color: var(--gold-bright); border-color: var(--gold-faint); }
.inv-foot { font-size: 12px; color: var(--text-dim); margin: 14px 2px 0; line-height: 1.5; }

/* ---- register ---- */
.pj-table-inv { min-width: 980px; }
.pj-table-inv td.amt, .pj-table-inv th.amt { text-align: right; font-variant-numeric: tabular-nums; }
.pj-table-inv .inv-vend { color: var(--text-hi); font-weight: 600; }
.pj-table-inv .inv-desc { display: block; font-size: 11.5px; color: var(--text-dim); font-weight: 400; margin-top: 2px; max-width: 260px; overflow: hidden; text-overflow: ellipsis; }
.co-pill.co-pending_approval { color: #e0a84a; border-color: rgba(224,168,74,0.5); background: rgba(224,168,74,0.10); }
.co-pill.co-posted { color: #a9c8e3; border-color: rgba(142,167,194,0.45); background: rgba(142,167,194,0.10); }
.inv-due-late { color: #e88b86; font-weight: 600; }
.inv-due-soon { color: #e0a84a; }
.inv-files-n { font-size: 11px; color: var(--text-dim); margin-left: 6px; }
@media screen and (max-width: 700px) {
  table.pj-table.pj-table-inv { min-width: 0; width: 100%; }
  .pj-table-inv th:nth-child(3), .pj-table-inv td:nth-child(3),
  .pj-table-inv th:nth-child(4), .pj-table-inv td:nth-child(4),
  .pj-table-inv th:nth-child(5), .pj-table-inv td:nth-child(5),
  .pj-table-inv th:nth-child(8), .pj-table-inv td:nth-child(8) { display: none; }
}

/* ---- editor ---- */
#invOverlay .nc-modal-lg { max-width: 820px; }
.inv-head-right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.inv-banner { margin: 6px 0 10px; padding: 10px 12px; border-radius: 10px; font-size: 12.5px; line-height: 1.5; border: 1px solid; }
.inv-banner.back { color: #f0b1ad; border-color: rgba(191,54,54,0.5); background: rgba(191,54,54,0.10); }
.inv-banner.ok { color: #a9e3b8; border-color: rgba(92,138,73,0.55); background: rgba(92,138,73,0.10); }
.inv-banner.info { color: #e0c274; border-color: rgba(212,175,95,0.45); background: rgba(212,175,95,0.08); }
.inv-banner b { font-weight: 700; }
.nc-modal .inv-vendor-other { margin-top: 6px; }
.nc-modal textarea { width: 100%; font: inherit; font-size: 13.5px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--hair); background: rgba(18,20,24,0.6); color: var(--text-hi); outline: none; min-height: 64px; resize: vertical; }
.nc-modal textarea:focus { border-color: var(--gold-line); }
.inv-ro input, .inv-ro select, .inv-ro textarea { opacity: .75; pointer-events: none; }
.inv-ro .inv-line-del, .inv-ro #invAddLine, .inv-ro #invFill, .inv-ro .co-att-del, .inv-ro .fdz-zone { display: none !important; }

/* cost code lines */
.inv-lines { margin-top: 6px; }
.inv-line { display: grid; grid-template-columns: minmax(0, 2fr) 130px minmax(0, 1.4fr) 28px; gap: 6px; align-items: center; margin-bottom: 6px; }
.inv-line select, .inv-line input { margin: 0; min-width: 0; font-size: 13px !important; padding: 8px 10px !important; }
.inv-line input.amt { text-align: right; font-variant-numeric: tabular-nums; }
.inv-line-del { border: 0; background: none; color: var(--text-dim); cursor: pointer; font-size: 17px; line-height: 1; padding: 0; }
.inv-line-del:hover { color: #e88b86; }
.inv-line-tools { display: flex; gap: 8px; align-items: center; margin-top: 4px; flex-wrap: wrap; }
.inv-line-tools .nc-btn { padding: 6px 12px; font-size: 12px; }
.inv-coded { font-size: 12.5px; margin-left: auto; font-variant-numeric: tabular-nums; }
.inv-coded.ok { color: #8fd8a2; }
.inv-coded.off { color: #e0a84a; }
@media (max-width: 640px) { .inv-line { grid-template-columns: minmax(0, 1fr) 110px 28px; } .inv-line input.note { grid-column: 1 / -1; } }

/* approval panel + history */
.inv-decide { margin-top: 14px; padding: 12px 14px; border: 1px solid var(--gold-faint); border-radius: 12px; background: rgba(212,175,95,0.05); }
.inv-decide .nc-sec-h { border-top: 0; padding-top: 0; }
.inv-decide-btns { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.nc-btn.danger { border-color: rgba(191,54,54,0.5); background: rgba(191,54,54,0.14); color: #f0b1ad; }
.nc-btn.danger:hover { background: rgba(191,54,54,0.24); }
.nc-btn.good { border-color: rgba(92,138,73,0.6); background: rgba(92,138,73,0.22); color: #a9e3b8; }
.nc-btn.good:hover { background: rgba(92,138,73,0.34); }
.inv-hist { margin-top: 12px; }
.inv-hist-row { display: grid; grid-template-columns: 150px 1fr; gap: 10px; font-size: 12.5px; padding: 6px 0; border-bottom: 1px dashed rgba(255,255,255,0.07); }
.inv-hist-row:last-child { border-bottom: 0; }
.inv-hist-when { color: var(--text-dim); white-space: nowrap; }
.inv-hist-what b { color: var(--text-hi); font-weight: 600; }
.inv-hist-what i { color: var(--text-mid); font-style: normal; display: block; }
.inv-foot-btns { display: flex; gap: 8px; align-items: center; margin-top: 16px; flex-wrap: wrap; }
.inv-foot-btns .spacer { flex: 1; }
.inv-dup { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-mid); margin-top: 8px; }
.inv-dup input { width: 16px; height: 16px; accent-color: #d4af5f; }
