/* Invoice / tax-bill aesthetic */
:root {
  --paper: #fbf7ee;
  --paper-edge: #efe7d2;
  --ink: #1f2a44;
  --ink-soft: #4a5573;
  --rule: #d9c9a3;
  --rule-strong: #8a7a4f;
  --gold: #b8860b;
  --gold-soft: #d8b462;
  --accent: #6e0d25;     /* deep municipal red */
  --bar: #2c4267;
  --bar-soft: #c9d2e3;
  --paid: #2d7a3a;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background:
    radial-gradient(circle at 20% 0%, #efe6cf 0%, transparent 60%),
    radial-gradient(circle at 100% 100%, #ece2c4 0%, transparent 55%),
    #e8dec0;
  color: var(--ink);
  font-family: "Iowan Old Style", "Charter", "Georgia", "Cambria", serif;
  font-size: 14px;
  line-height: 1.45;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* Page / paper */
.page {
  max-width: 920px;
  margin: 32px auto;
  background: var(--paper);
  border: 1px solid var(--paper-edge);
  box-shadow:
    0 1px 0 #fff inset,
    0 0 0 1px var(--rule) inset,
    0 30px 60px -20px rgba(40, 30, 0, 0.25),
    0 8px 18px -10px rgba(40, 30, 0, 0.2);
  padding: 40px 48px 32px;
  position: relative;
  background-image:
    linear-gradient(transparent 95%, rgba(184, 134, 11, 0.08) 95%),
    linear-gradient(90deg, transparent 95%, rgba(184, 134, 11, 0.06) 95%);
  background-size: 24px 24px, 24px 24px;
}
.page::before,
.page::after {
  content: "";
  position: absolute; left: 16px; right: 16px; height: 4px;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}
.page::before { top: 14px; }
.page::after  { bottom: 14px; }

/* Letterhead */
.letterhead {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 20px;
  align-items: flex-start;
  padding-bottom: 16px;
  border-bottom: 2px double var(--rule-strong);
}
.crest svg { display: block; }
.masthead .city {
  font-variant: small-caps;
  letter-spacing: 0.15em;
  font-size: 12px;
  color: var(--ink-soft);
  margin-bottom: 4px;
}
.masthead .title {
  font-family: "Didot", "Bodoni 72", "Playfair Display", "Iowan Old Style", serif;
  font-size: 32px;
  font-weight: 700;
  letter-spacing: 0.02em;
  margin: 0 0 4px 0;
  color: var(--ink);
}
.masthead .subtitle {
  font-style: italic;
  color: var(--ink-soft);
  font-size: 13px;
}
.meta {
  text-align: right;
  font-size: 12px;
  color: var(--ink-soft);
  display: grid;
  gap: 4px;
  min-width: 180px;
}
.meta > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px dotted var(--rule);
  padding-bottom: 2px;
}
.meta-label {
  font-variant: small-caps;
  letter-spacing: 0.08em;
}
.meta-year {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  border-bottom: 1px dotted var(--rule);
  padding-bottom: 2px;
}
.meta-year-select {
  font-family: inherit;
  font-size: 12px;
  padding: 2px 6px;
  border: 1px solid var(--rule-strong);
  background: #fffdf6;
  color: var(--ink);
  border-radius: 2px;
  cursor: pointer;
}
.meta-value {
  font-family: "SF Mono", "Menlo", "Consolas", monospace;
  color: var(--ink);
}

/* Bill-to / input row */
.billto {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 24px;
  padding: 18px 0 22px;
  border-bottom: 1px solid var(--rule);
}
.billto-block .block-label {
  font-variant: small-caps;
  letter-spacing: 0.12em;
  font-size: 11px;
  color: var(--ink-soft);
  margin-bottom: 4px;
}
.billto-block .block-value {
  font-size: 16px;
  color: var(--ink);
}
.billto-block .block-sub {
  font-size: 12px;
  color: var(--ink-soft);
  font-style: italic;
}

.input-block {
  border-left: 1px dashed var(--rule-strong);
  padding-left: 20px;
}
.amount-input {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  background: #fffdf6;
  border: 1px solid var(--rule-strong);
  border-radius: 2px;
  padding: 8px 12px;
  box-shadow: inset 0 0 0 1px #fff, inset 0 1px 2px rgba(0, 0, 0, 0.04);
  margin: 4px 0 6px;
}
.amount-input .currency {
  font-family: "Didot", "Bodoni 72", serif;
  font-size: 22px;
  color: var(--accent);
  font-weight: 700;
}
.amount-input input {
  font-family: "SF Mono", "Menlo", "Consolas", monospace;
  font-size: 22px;
  border: none;
  outline: none;
  background: transparent;
  width: 180px;
  color: var(--ink);
  letter-spacing: 0.02em;
}
.amount-input input:focus { color: var(--accent); }
.amount-input input::-webkit-outer-spin-button,
.amount-input input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.amount-input input[type=number] { -moz-appearance: textfield; }

/* Table */
.invoice-table {
  margin-top: 18px;
}
.col {
  padding: 6px 8px;
}
.col-num  { width: 36px; text-align: right; font-family: "SF Mono","Menlo",monospace; color: var(--ink-soft); }
.col-desc { flex: 1 1 auto; }
.col-auth { width: 170px; text-align: left; }
.col-pct  { width: 92px;  text-align: right; font-family: "SF Mono","Menlo",monospace; color: var(--ink-soft); }
.col-amt  { width: 120px; text-align: right; font-family: "SF Mono","Menlo",monospace; }

.table-head {
  display: flex;
  align-items: center;
  background: linear-gradient(#f3ead0, #ece1bd);
  border-top: 1px solid var(--rule-strong);
  border-bottom: 1px solid var(--rule-strong);
  font-variant: small-caps;
  letter-spacing: 0.12em;
  color: var(--ink);
  font-size: 11px;
}

.show-sm { display: none; }

.row, .grand-total {
  display: flex;
  align-items: center;
  border-bottom: 1px dotted var(--rule);
}
.row:nth-child(even) { background: rgba(255, 253, 246, 0.55); }
.row .desc-name { color: var(--ink); }
.row .desc-bar {
  margin-top: 4px;
  height: 4px;
  background: var(--bar-soft);
  border-radius: 2px;
  overflow: hidden;
  position: relative;
}
.row .desc-bar > span {
  display: block;
  height: 100%;
  max-width: 100%;
}
.bar-Peel        { background: linear-gradient(90deg, #6e0d25, #a8324a); }
.bar-Mississauga { background: linear-gradient(90deg, #2c4267, #4663a0); }
.bar-Other       { background: linear-gradient(90deg, #6b5a1d, #b8860b); }
.bar-Education   { background: linear-gradient(90deg, #2f5d3a, #58a06a); }

/* Education row sits beneath the municipal services with a subtle break. */
.row.row-education {
  border-top: 1px solid var(--rule-strong);
  background: rgba(244, 252, 246, 0.65);
}
.row.row-education .desc-name { font-weight: 600; }

/* Authority column — plain colored text (no pill) */
.col-auth {
  font-variant: small-caps;
  letter-spacing: 0.08em;
  font-size: 11.5px;
  font-weight: 600;
}
.auth-Peel        { color: #6e0d25; }
.auth-Mississauga { color: #2c4267; }
.auth-Other       { color: #6b5a1d; }
.auth-Education   { color: #2f5d3a; }

/* Summary cards above the line items — compact one row */
.summary {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 10px;
  margin: 12px 0 10px;
}
.summary-card {
  background: #fffdf6;
  border: 1px solid var(--rule);
  border-top: 3px solid currentColor;
  padding: 8px 12px;
  border-radius: 2px;
  box-shadow: inset 0 0 0 1px #fff;
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}
.summary-card[data-section="Peel"]        { color: #6e0d25; }
.summary-card[data-section="Mississauga"] { color: #2c4267; }
.summary-card[data-section="Other"]       { color: #6b5a1d; }
.summary-card[data-section="Education"]   { color: #2f5d3a; }
.summary-label {
  font-variant: small-caps;
  letter-spacing: 0.12em;
  font-size: 10.5px;
  color: var(--ink-soft);
  flex: 1 1 100%;
}
.summary-amt {
  font-family: "Didot", "Bodoni 72", "Iowan Old Style", serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--ink);
}
.summary-pct {
  font-family: "SF Mono", "Menlo", monospace;
  font-size: 11px;
  color: var(--ink-soft);
}

.grand-total {
  margin-top: 18px;
  background: linear-gradient(#1f2a44, #28365a);
  color: #fbf7ee;
  border: none;
  border-top: 4px double var(--gold);
  border-bottom: 4px double var(--gold);
  font-size: 16px;
}
.grand-total .col-desc {
  font-variant: small-caps;
  letter-spacing: 0.18em;
  color: var(--gold-soft);
}
.grand-total .col-pct,
.grand-total .col-amt { color: #fbf7ee; }
.grand-total .col-amt { font-weight: 700; font-size: 18px; }

/* Footnote / paid stamp */
.footnote {
  margin-top: 22px;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 22px;
  align-items: center;
}
.stamp {
  border: 3px double var(--paid);
  color: var(--paid);
  padding: 10px 16px;
  font-family: "Didot", "Bodoni 72", serif;
  letter-spacing: 0.18em;
  font-weight: 700;
  font-size: 18px;
  transform: rotate(-6deg);
  opacity: 0.85;
  border-radius: 4px;
  text-align: center;
  white-space: nowrap;
}
.notes p { margin: 0 0 6px; color: var(--ink-soft); font-size: 12px; }
.notes .fineprint { font-size: 11px; opacity: 0.85; }

.actions {
  grid-column: 1 / -1;
  text-align: right;
  margin-top: 8px;
}
.btn {
  font: inherit;
  background: var(--ink);
  color: var(--paper);
  border: 1px solid var(--ink);
  padding: 8px 16px;
  border-radius: 2px;
  cursor: pointer;
  letter-spacing: 0.06em;
}
.btn:hover { background: var(--accent); border-color: var(--accent); }

@media (max-width: 820px) {
  .col-auth { width: 130px; }
}

@media (max-width: 720px) {
  body { font-size: 13px; }
  .page { margin: 0; padding: 16px 12px 16px; box-shadow: none; border: none; }
  .page::before, .page::after { display: none; }

  .letterhead {
    grid-template-columns: auto 1fr;
    gap: 12px;
    padding-bottom: 10px;
  }
  .crest svg { width: 40px; height: 40px; }
  .masthead .city { font-size: 10.5px; }
  .masthead .title { font-size: 22px; }
  .masthead .subtitle { font-size: 12px; }
  .meta {
    grid-column: 1 / -1;
    text-align: left;
    min-width: 0;
    font-size: 11px;
  }
  .meta > div { justify-content: flex-start; }
  .meta .meta-for.show-sm {
    display: flex;
    gap: 12px;
    border-bottom: 1px dotted var(--rule);
    padding-bottom: 2px;
  }

  /* On mobile the "For" info has moved up into the meta column */
  .billto {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 12px 0 14px;
  }
  .billto > .billto-block:not(.input-block) { display: none; }
  .input-block {
    border-top: none;
    padding-top: 0;
  }
  .input-block {
    border-left: none;
    padding-left: 0;
    border-top: 1px dashed var(--rule-strong);
    padding-top: 12px;
  }
  .amount-input { padding: 6px 10px; }
  .amount-input .currency { font-size: 18px; }
  .amount-input input { font-size: 18px; width: 140px; }

  /* Quick row of summary chips (count varies per view) */
  .summary {
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
    gap: 6px;
    margin: 10px 0;
  }
  .summary-card {
    padding: 6px 8px;
    border-top-width: 2px;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
  }
  .summary-label {
    font-size: 9.5px;
    letter-spacing: 0.08em;
    flex: none;
    line-height: 1.1;
  }
  .summary-amt { font-size: 14px; line-height: 1.1; }
  .summary-pct { font-size: 10px; }

  /* Table — compact, two-row layout per item */
  .invoice-table { margin-top: 6px; }
  .hide-sm { display: none; }
  .show-sm { display: inline; }

  .table-head {
    font-size: 10px;
    letter-spacing: 0.06em;
    padding: 2px 0;
  }
  .table-head .col-auth { display: none; }

  .col { padding: 4px 6px; }
  .row { flex-wrap: wrap; padding: 2px 0; }
  .col-num   { width: 22px; padding-left: 2px; padding-right: 2px; }
  .col-desc  { flex: 1 1 0; min-width: 0; }
  .col-auth  {
    order: 5;
    width: 100%;
    padding: 0 6px 6px 28px;
    font-size: 10.5px;
  }
  .col-pct   { width: 48px; font-size: 11px; padding-left: 2px; padding-right: 4px; }
  .col-amt   { width: 84px; font-size: 12.5px; padding-left: 4px; padding-right: 6px; }
  .row .desc-name { font-size: 13px; line-height: 1.25; }
  .row .desc-bar { margin-top: 2px; height: 3px; }

  .grand-total { font-size: 14px; flex-wrap: nowrap; }
  .grand-total .col-auth { display: none; }
  .grand-total .col-amt { font-size: 15px; }

  .footnote {
    grid-template-columns: 1fr;
    gap: 12px;
    margin-top: 14px;
  }
  .stamp { justify-self: center; transform: rotate(-4deg) scale(0.85); }
}

/* View nav (Detailed / Summary) */
.view-nav {
  margin-top: 8px;
  display: inline-flex;
  gap: 0;
  border: 1px solid var(--rule-strong);
  border-radius: 999px;
  overflow: hidden;
  background: #fffdf6;
  font-size: 11px;
  font-variant: small-caps;
  letter-spacing: 0.1em;
}
.view-nav .view-link {
  padding: 4px 14px;
  color: var(--ink-soft);
  text-decoration: none;
  border-right: 1px solid var(--rule);
}
.view-nav .view-link:last-child { border-right: none; }
.view-nav .view-link:hover { color: var(--accent); background: rgba(110, 13, 37, 0.04); }
.view-nav .view-link.is-active {
  background: var(--ink);
  color: var(--paper);
  cursor: default;
}

/* Info icon (popovers powered by Tippy.js — see .tippy-box theming below). */
.info-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  margin-left: 6px;
  padding: 0;
  font: 700 10px/1 "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-style: italic;
  color: var(--ink-soft, #555);
  background: transparent;
  border: 1px solid currentColor;
  border-radius: 999px;
  cursor: pointer;
  vertical-align: 2px;
  user-select: none;
  transition: background 0.12s ease, color 0.12s ease;
}
.info-icon:hover,
.info-icon[aria-describedby] {
  background: #1f2a44;
  color: #fff;
  border-color: #1f2a44;
}

/* Tippy.js navy theme — matches the muni-blue ink we use elsewhere. */
.tippy-box[data-theme~="navy"] {
  background-color: #1f2a44;
  color: #fff;
  font: 400 12px/1.45 "Helvetica Neue", Helvetica, Arial, sans-serif;
  letter-spacing: 0.01em;
  border-radius: 6px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.22);
}
.tippy-box[data-theme~="navy"] .tippy-content { padding: 10px 14px; }
.tippy-box[data-theme~="navy"][data-placement^="top"] > .tippy-arrow::before {
  border-top-color: #1f2a44;
}
.tippy-box[data-theme~="navy"][data-placement^="bottom"] > .tippy-arrow::before {
  border-bottom-color: #1f2a44;
}
.tippy-box[data-theme~="navy"][data-placement^="left"] > .tippy-arrow::before {
  border-left-color: #1f2a44;
}
.tippy-box[data-theme~="navy"][data-placement^="right"] > .tippy-arrow::before {
  border-right-color: #1f2a44;
}

/* Print */
@media print {
  body { background: #fff; }
  .page { margin: 0; box-shadow: none; border: none; }
  .no-print { display: none !important; }
  .stamp { opacity: 1; }
}

/* =====================================================================
   INVOICE VIEW (/invoice.html) — clean Word/Excel-template aesthetic.
   Scoped to body[data-view="invoice"] so it doesn't affect Detailed/Summary.
   ===================================================================== */

html:has(body[data-view="invoice"]),
body[data-view="invoice"] {
  --inv-yellow: #f8da5b;
}

body[data-view="invoice"] {
  --inv-ink: #111;
  --inv-ink-soft: #555;
  --inv-strip: var(--inv-yellow);
  --inv-strip-soft: var(--inv-yellow);
  --inv-line: #1a1a1a;
  --inv-line-soft: #1a1a1a;
  background: #fff;
  font-family: "Helvetica Neue", Helvetica, Arial, "Segoe UI", system-ui, sans-serif;
  color: var(--inv-ink);
}

html:has(body[data-view="invoice"]) {
  background: #fff;
}

body[data-view="invoice"] .page.invoice-page {
  background: #fff;
  border: 1px solid var(--inv-line);
  box-shadow: 0 30px 60px rgba(15, 23, 42, 0.18);
  padding: 28px 64px 56px;
  max-width: 920px;
  margin: 36px auto;
  position: relative;
  border-radius: 2px;
  overflow: visible; /* tooltips may extend past the card edge */
}

/* Kill all the warm-paper decorations from the default skin. */
body[data-view="invoice"] .page.invoice-page::before,
body[data-view="invoice"] .page.invoice-page::after { content: none; display: none; }

/* Header row: hamburger on the left, centered title + subtitle. */
body[data-view="invoice"] .inv-header {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 0 16px;
  min-height: 48px;
}

body[data-view="invoice"] .inv-heading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 0;
}

/* Main title + subheader, centered. */
body[data-view="invoice"] .inv-title {
  text-align: center;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-weight: 900;
  font-size: clamp(22px, 5.5vw, 42px);
  letter-spacing: 0.03em;
  margin: 0;
  padding: 0;
  line-height: 1.12;
  color: var(--inv-ink);
}

body[data-view="invoice"] .inv-subtitle {
  margin: 8px 0 0;
  padding: 0;
  text-align: center;
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--inv-ink-soft);
}
body[data-view="invoice"] .inv-subtitle-link {
  color: var(--inv-ink);
  text-decoration: none;
  border-bottom: 1px solid var(--inv-line-soft);
  font-weight: 600;
  letter-spacing: 0.04em;
}
body[data-view="invoice"] .inv-subtitle-link:hover {
  border-bottom-color: var(--inv-ink);
  color: #000;
}

/* TOTAL PAID / PAID BY blocks — grid + display:contents so label headers share one row height. */
body[data-view="invoice"] .inv-parties {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto 1fr;
  grid-auto-flow: column;
  column-gap: 18px;
  row-gap: 0;
  margin: 8px 0 14px;
  align-items: stretch;
}
body[data-view="invoice"] .inv-party {
  display: contents;
}
body[data-view="invoice"] .inv-party-header {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--inv-strip);
  text-align: center;
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0.18em;
  padding: 10px 8px;
  line-height: 1.25;
  text-transform: uppercase;
  border: 1px solid var(--inv-line-soft);
  border-bottom: 0;
}
body[data-view="invoice"] .inv-party-body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  font-size: 12px;
  letter-spacing: 0.06em;
  padding: 10px 12px 8px;
  text-transform: uppercase;
  color: var(--inv-ink-soft);
  line-height: 1.6;
  background: #fff;
  border: 1px solid var(--inv-line-soft);
  border-top: 0;
}
body[data-view="invoice"] .inv-party-name {
  font-weight: 800;
  color: var(--inv-ink);
  letter-spacing: 0.06em;
}
body[data-view="invoice"] .inv-party-body--input {
  gap: 6px;
  padding: 12px;
}
body[data-view="invoice"] .inv-year-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  width: 100%;
  margin-top: 4px;
  text-transform: none;
}
body[data-view="invoice"] .inv-year-row label {
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--inv-ink-soft);
}
body[data-view="invoice"] .inv-year-select {
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 4px 8px;
  border: 1px solid var(--inv-line);
  background: #fff;
  color: var(--inv-ink);
  border-radius: 0;
  cursor: pointer;
}
body[data-view="invoice"] .inv-input-hint {
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--inv-ink-soft);
}

body[data-view="invoice"] .amount-input {
  display: inline-flex;
  align-items: center;
  border: 1.5px solid var(--inv-line);
  background: #fff;
  border-radius: 0;
  padding: 8px 12px;
  font-family: inherit;
  font-size: 18px;
  font-weight: 700;
  color: var(--inv-ink);
}
body[data-view="invoice"] .amount-input .currency {
  margin-right: 6px;
  color: var(--inv-ink-soft);
}
body[data-view="invoice"] .amount-input input {
  border: 0;
  outline: 0;
  background: transparent;
  font: inherit;
  color: inherit;
  width: 140px;
  text-align: right;
}

/* The line-items table. */
body[data-view="invoice"] .inv-table {
  border: 1.5px solid var(--inv-line);
  border-radius: 0;
  background: #fff;
  overflow: visible; /* allow tooltips to extend past the border box */
}
body[data-view="invoice"] .inv-table-wrap {
  overflow: visible;
}
body[data-view="invoice"] #rows {
  overflow: visible;
}
body[data-view="invoice"] .row {
  overflow: visible;
}
body[data-view="invoice"] .col-desc {
  overflow: visible;
}
body[data-view="invoice"] .inv-thead {
  display: grid;
  grid-template-columns: 1fr 200px;
  background: var(--inv-strip-soft);
  border-bottom: 1.5px solid var(--inv-line);
}
body[data-view="invoice"] .inv-th {
  padding: 12px 16px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  text-align: center;
  color: var(--inv-ink);
}
body[data-view="invoice"] .inv-th-amt {
  border-left: 1px solid var(--inv-line-soft);
}

/* Reuse app.js .row/.col-* but restyle inside the invoice. */
body[data-view="invoice"] #rows { display: block; }
body[data-view="invoice"] .row {
  display: grid;
  grid-template-columns: 1fr 200px;
  align-items: center;
  border-bottom: 1px solid var(--inv-line-soft);
  background: #fff;
  padding: 0;
}
body[data-view="invoice"] .row:last-child { border-bottom: 0; }

/* Education tax row in the invoice — heavier separator above. */
body[data-view="invoice"] .row.row-education {
  border-top: 1.5px solid var(--inv-line);
  background: #f6fbf8;
}
body[data-view="invoice"] .row.row-education .desc-name { font-weight: 700; }

/* Hide chrome we don't want in the invoice. */
body[data-view="invoice"] .col-num,
body[data-view="invoice"] .col-auth,
body[data-view="invoice"] .desc-bar { display: none !important; }

/* Description column: left-aligned name; right-aligned amount. */
body[data-view="invoice"] .col-desc {
  padding: 12px 18px;
  border-right: 1px solid var(--inv-line-soft);
}
body[data-view="invoice"] .desc-name {
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--inv-ink);
  white-space: normal;
}
body[data-view="invoice"] .col-amt {
  padding: 12px 18px;
  text-align: right;
  font-size: 13.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--inv-ink);
  background: #fff;
}

/* TOTAL row sits inside the same bordered block, like the screenshot. */
body[data-view="invoice"] .inv-table-wrap { position: relative; }
body[data-view="invoice"] .inv-total {
  display: grid;
  grid-template-columns: 1fr 200px;
  border: 1.5px solid var(--inv-line);
  border-top: 0;
  background: #fff;
}
body[data-view="invoice"] .inv-total-label {
  text-align: right;
  padding: 14px 18px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--inv-ink);
  border-right: 1px solid var(--inv-line-soft);
}
body[data-view="invoice"] .inv-total-amt {
  padding: 14px 18px;
  text-align: right;
  font-weight: 800;
  font-size: 16px;
  font-variant-numeric: tabular-nums;
  color: var(--inv-ink);
}

/* Footer fineprint + actions. */
body[data-view="invoice"] .inv-footer {
  margin-top: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
body[data-view="invoice"] .inv-fineprint {
  font-size: 11.5px;
  letter-spacing: 0.02em;
  color: var(--inv-ink-soft);
  margin: 0;
  max-width: 64ch;
  line-height: 1.5;
}
body[data-view="invoice"] .actions { margin: 0; }
body[data-view="invoice"] .btn {
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  background: #001865;
  color: #ffc700;
  border: 1px solid #001865;
  border-radius: 0;
  padding: 10px 16px;
  cursor: pointer;
}
body[data-view="invoice"] .btn:hover { background: #00124d; border-color: #00124d; }

/* Mobile tuning. */
@media (max-width: 720px) {
  body[data-view="invoice"] .page.invoice-page {
    padding: 28px 18px 32px;
    margin: 12px;
  }
  body[data-view="invoice"] .inv-subtitle { font-size: 11px; letter-spacing: 0.05em; }
  body[data-view="invoice"] .inv-parties {
    grid-template-columns: 1fr 1fr;
    column-gap: 8px;
  }
  body[data-view="invoice"] .inv-party-header {
    font-size: 10px;
    letter-spacing: 0.12em;
    padding: 8px 4px;
    line-height: 1.2;
  }
  body[data-view="invoice"] .inv-party-body {
    font-size: 10.5px;
    letter-spacing: 0.04em;
    padding: 8px 6px;
    line-height: 1.5;
  }
  body[data-view="invoice"] .amount-input {
    font-size: 15px;
    padding: 6px 8px;
  }
  body[data-view="invoice"] .amount-input input { width: 88px; }
  body[data-view="invoice"] .inv-thead,
  body[data-view="invoice"] .row,
  body[data-view="invoice"] .inv-total {
    grid-template-columns: 1fr 120px;
  }
  body[data-view="invoice"] .desc-name { font-size: 12.5px; }
  body[data-view="invoice"] .col-amt,
  body[data-view="invoice"] .inv-total-amt { font-size: 12.5px; }
  body[data-view="invoice"] .inv-footer {
    flex-direction: column;
    align-items: stretch;
  }
}

/* Print: hide the gradient background and nav. */
@media print {
  body[data-view="invoice"] { background: #fff; }
  body[data-view="invoice"] .page.invoice-page {
    margin: 0;
    box-shadow: none;
    border: 0;
    padding: 24px;
  }
}
