/* =====================================================================
   Invoice template BASE — always loaded, not selectable in the picker.
   Provides the shared layout for the .inv-paper markup. Individual
   templates (classic.css, modern.css, …) only need to re-theme via the
   CSS variables below, or override specific selectors under their own
   .tpl-<slug> class. Files whose name starts with "_" are never shown
   in the style picker.
   ===================================================================== */
.inv-paper {
  --inv-accent: #0f6e56;
  --inv-ink: #1e2022;
  --inv-soft: #55606a;
  --inv-muted: #8b95a1;
  --inv-line: #e3e6ec;
  --inv-head-bg: #f4f6f9;
  --inv-topbar-bg: transparent;
  --inv-topbar-ink: #1e2022;
  --inv-topbar-sub: #55606a;
  --inv-rule: 2px solid #1e2022;
  --inv-title-color: var(--inv-accent);

  background: #fff;
  color: var(--inv-ink);
  border: 1px solid var(--bs-border-color);
  border-radius: 10px;
  padding: 26px 28px;
  font-size: 12.5px;
  line-height: 1.5;
}
.inv-paper h1, .inv-paper h2, .inv-paper h3, .inv-paper h4 { color: var(--inv-ink); }

.inv-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; background: var(--inv-topbar-bg); border-bottom: var(--inv-rule); padding-bottom: 14px; margin-bottom: 14px; }
/* NOTE: the site theme sets a global `img { height:100%; object-fit:cover }`,
   so we must explicitly reset height/width/fit here or logos blow up. */
.inv-logo { display: block; width: auto !important; height: auto !important; max-width: 170px; max-height: 56px; object-fit: contain !important; border-radius: 0 !important; margin-bottom: 10px; }
.inv-brand .name { font-size: 19px; font-weight: 700; color: var(--inv-topbar-ink); }
.inv-brand .line { color: var(--inv-topbar-sub); white-space: pre-line; }
.inv-title { text-align: right; }
.inv-title .t { font-size: 20px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--inv-title-color); }
.inv-title .meta { margin-top: 6px; color: var(--inv-topbar-sub); }
.inv-title .meta b { color: var(--inv-topbar-ink); }

.inv-parties { display: flex; gap: 18px; margin-bottom: 14px; }
.inv-party { flex: 1; border: 1px solid var(--inv-line); border-radius: 8px; padding: 10px 12px; }
.inv-party .h { font-size: 10.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--inv-muted); margin-bottom: 4px; }
.inv-party .nm { font-weight: 700; }
.inv-party .ln { color: var(--inv-soft); white-space: pre-line; }

table.inv-lines { width: 100%; border-collapse: collapse; margin-bottom: 12px; }
table.inv-lines th { background: var(--inv-head-bg); border: 1px solid var(--inv-line); padding: 7px 8px; font-size: 10.5px; text-transform: uppercase; letter-spacing: .02em; color: var(--inv-soft); text-align: left; }
table.inv-lines th.r, table.inv-lines td.r { text-align: right; }
table.inv-lines td { border: 1px solid var(--inv-line); padding: 7px 8px; vertical-align: top; }
/* keep money columns on one line; let long descriptions wrap instead of pushing the table wide */
table.inv-lines th.r, table.inv-lines td.r { white-space: nowrap; }
table.inv-lines td.inv-desc { word-break: break-word; }
.inv-itemnote { font-size: .85em; color: var(--inv-soft); margin-top: 2px; white-space: pre-line; }

.inv-totals { display: flex; justify-content: flex-end; }
.inv-totals table { min-width: 260px; border-collapse: collapse; }
.inv-totals td { padding: 4px 8px; }
.inv-totals td.r { text-align: right; }
.inv-totals tr.grand td { border-top: 2px solid var(--inv-ink); font-weight: 700; font-size: 14px; padding-top: 7px; color: var(--inv-accent); }

.inv-words { margin: 10px 0 14px; padding: 8px 10px; background: var(--inv-head-bg); border-radius: 6px; }
.inv-words b { text-transform: capitalize; }

.inv-foot { display: flex; justify-content: space-between; gap: 18px; margin-top: 16px; }
.inv-foot .box { flex: 1; }
.inv-foot .h { font-size: 10.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--inv-muted); margin-bottom: 4px; }
.inv-foot .ln { color: var(--inv-soft); white-space: pre-line; }
.inv-sign { text-align: right; }
.inv-sign .space { height: 46px; }
