/* Registration fee invoice — one A4 page, and a clean print.
   Deliberately close to challan.css: an applicant who is later a student
   should recognise the second document from the first. */

/* Scoped, not :root — this stylesheet also loads on the website's own pages,
   where the theme defines variables of the same names. */
body.invoice-page,
.invoice {
  --ink: #24303a;
  --line: #c7cdd3;
  --muted: #667380;
  --green: #567a0d;
  --wash: #f6f8f3;
}

.invoice, .invoice * { box-sizing: border-box; }

body.invoice-page {
  margin: 0;
  padding: 16px;
  background: #eef1f4;
  color: var(--ink);
  font: 13px/1.5 "Segoe UI", Arial, sans-serif;
}

.invoice-toolbar {
  max-width: 800px; margin: 0 auto 14px; display: flex; gap: .6rem;
  align-items: center; flex-wrap: wrap;
}
.invoice-toolbar button {
  background: #8fbc1f; color: #1c2a08; border: 0; border-radius: 999px;
  padding: .6rem 1.3rem; font: inherit; font-weight: 700; cursor: pointer;
}
.invoice-toolbar button:hover { background: #7ca617; }
.invoice-toolbar a { color: var(--green); font-weight: 600; }
.invoice-toolbar .invoice-download {
  background: #24303a; color: #fff; border-radius: 999px;
  padding: .6rem 1.3rem; font-weight: 700; text-decoration: none;
}
.invoice-toolbar .invoice-download:hover { background: #111a21; }

/* The document itself. Also used inside the website's success panel, so it
   carries its own background and never depends on the page around it. */
.invoice {
  max-width: 800px; margin: 0 auto; background: #fff; padding: 10mm;
  box-shadow: 0 10px 30px rgba(20, 30, 25, .12);
  page-break-inside: avoid;
  break-inside: avoid;
  text-align: left;
}

.invoice-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 1rem; flex-wrap: wrap;
  border-bottom: 2px solid var(--ink); padding-bottom: 8px; margin-bottom: 10px;
}
.invoice-head strong { display: block; font-size: 15px; }
.invoice-head span { display: block; color: var(--muted); font-size: 11px; }
.invoice-kind {
  text-align: right; font-weight: 700; text-transform: uppercase;
  letter-spacing: .04em; font-size: 11px; white-space: nowrap;
}
.invoice-kind span {
  display: block; font-weight: 400; text-transform: none; letter-spacing: 0;
  color: var(--muted);
}

/* The registration number is the one thing they must not lose. */
.invoice-reg {
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  background: var(--wash); border: 1px solid var(--line);
  padding: 8px 12px; margin-bottom: 10px;
}
.invoice-reg span { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .05em; }
.invoice-reg b { font-size: 18px; letter-spacing: .02em; }

.invoice-meta { width: 100%; border-collapse: collapse; margin-bottom: 10px; }
.invoice-meta th, .invoice-meta td {
  border: 1px solid var(--line); padding: 5px 8px; text-align: left; vertical-align: top;
}
.invoice-meta th { background: #fafbfc; font-weight: 600; width: 38%; color: var(--muted); }

.invoice-items { width: 100%; border-collapse: collapse; margin-bottom: 12px; }
.invoice-items th, .invoice-items td {
  border: 1px solid var(--line); padding: 6px 8px; text-align: left;
}
.invoice-items thead th { background: #fafbfc; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }
.invoice-items .right { text-align: right; }
.invoice-items tfoot th { background: var(--wash); font-size: 14px; }

.invoice-pay h2 {
  font-size: 13px; text-transform: uppercase; letter-spacing: .05em;
  margin: 0 0 .4rem; padding-bottom: 4px; border-bottom: 1px solid var(--line);
}
/* Explicit: the website's own reset strips list markers, and the steps
   are referred to by number in the email. */
.invoice-pay ol { margin: 0 0 .6rem; padding-left: 1.4rem; list-style: decimal outside; }
/* The marker must be set on the li itself: the website's reset is
   `li { list-style: none }`, which beats anything inherited from the ol. */
.invoice-pay ol li { display: list-item; list-style: decimal outside; }
.invoice-pay li { margin-bottom: .35rem; }
.invoice-account, .invoice-email { white-space: nowrap; }
.invoice-holder { color: var(--muted); font-size: 12px; }
.invoice-note {
  margin: 0; padding: 8px 10px; background: var(--wash);
  border-left: 3px solid var(--green); font-size: 12px;
}

@media (max-width: 560px) {
  .invoice { padding: 6mm; }
  .invoice-kind { text-align: left; }
  .invoice-meta th { width: auto; }
  .invoice-account, .invoice-email { white-space: normal; word-break: break-word; }
}

@media print {
  body.invoice-page { background: #fff; padding: 0; }
  .no-print { display: none !important; }
  .invoice { box-shadow: none; max-width: none; padding: 0; }
  @page { size: A4; margin: 12mm; }
}
