/* =====================================================================================
   FILE BARU (5 Des 2026): gaya TOOL "Pembuat Invoice & Kwitansi" (alat/invoice-kwitansi.php)
   Formulir, pratinjau, dan aturan cetak (#cvPrint) DIPINJAM dari alat-pembuat-cv.css.
   File ini: penyesuaian formulir + lembar invoice (A4, 794 x 1123 px) & kwitansi (A5 mendatar, 794 x 559 px).
===================================================================================== */
.tl-page:has(#ivApp) { max-width: 1280px; }
.iv-mode { margin-bottom: 1.25rem; }
.iv-mode button { display: inline-flex; align-items: center; gap: .4rem; font-size: 1rem; padding-left: 1.4rem; padding-right: 1.4rem; }
.iv-tpls { grid-template-columns: repeat(3, minmax(0, 1fr)); max-width: 420px; }
@media (max-width: 575.98px) { .iv-tpls .cv-tpl small { display: block; } }
.cv-thumb.iv-th-bersih i:nth-child(1) { background: var(--k); }
.cv-thumb.iv-th-bersih i:nth-child(2) { height: 2%; background: var(--k); }
.cv-thumb.iv-th-tegas::before { content: ""; position: absolute; inset: 0 0 78% 0; background: var(--k); }
.cv-thumb.iv-th-tegas i:nth-child(1) { background: #fff; z-index: 1; top: 8%; }
.cv-thumb.iv-th-tegas i:nth-child(2) { background: var(--k); }
.cv-thumb.iv-th-klasik i { outline: 1px solid #666; background: #fff; }
.cv-thumb.iv-th-klasik i:nth-child(1) { outline: 0; background: #333; }
.iv-sum-hint { font-weight: 400; font-size: .74rem; color: var(--sol-text-muted); }
.iv-logo-img { flex-basis: 96px; width: 96px; height: 64px; background: #fff; }
.iv-logo-img img { object-fit: contain; }
[data-show][hidden] { display: none !important; }
.is-full-btn { grid-column: 1 / -1; justify-self: start; }
.is-full { grid-column: 1 / -1; }
.iv-big { font-size: 1.25rem !important; font-weight: 800; }
#ivKwWords:not(:empty) { font-style: italic; color: var(--sol-text-main); }

.iv-row { display: grid; grid-template-columns: 76px minmax(0, 1fr) 42px; grid-template-areas: "d d d" "q p x" "s s s"; gap: .4rem; padding: .55rem; margin-bottom: .45rem; border: 1px solid var(--sol-border-soft); border-radius: .75rem; background: var(--sol-bg-card); }
.iv-row .tl-input { min-height: 42px; padding: .45rem .65rem; font-size: .95rem; }
.iv-row .iv-desc { grid-area: d; }
.iv-row [data-f="q"] { grid-area: q; }
.iv-row [data-f="p"] { grid-area: p; }
.iv-row .pf-btn { grid-area: x; width: 42px; height: 42px; border-radius: .6rem; }
.iv-row .iv-sum { grid-area: s; font-size: .82rem; color: var(--sol-text-muted); text-align: right; }
.iv-row .iv-sum b { color: var(--sol-text-bright); }

.iv-total { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .25rem .75rem; margin-bottom: .75rem; padding: .7rem 1rem; border-radius: .9rem; background: var(--sol-accent-soft); color: var(--sol-text-main); font-size: .88rem; }
.iv-total b { color: var(--sol-text-bright); font-size: 1.15rem; }
.iv-total:empty { display: none; }

/* ---------- Lembar bersama ---------- */
.iv-page, .kw-page {
    --cv-acc: #1e3a5f; --iv-tint: color-mix(in srgb, var(--cv-acc) 8%, #fff);
    position: relative; width: 794px; background: #fff; color: #1f2328; box-sizing: border-box; text-align: left; letter-spacing: 0;
    font-family: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; font-size: 13.5px; line-height: 1.5; overflow-wrap: anywhere;
    -webkit-print-color-adjust: exact; print-color-adjust: exact;
}
.iv-page *, .kw-page * { box-sizing: border-box; }
.iv-page p, .kw-page p { margin: 0; }
.iv-page .cv-credit, .kw-page .cv-credit { position: absolute; right: 24px; bottom: 12px; font: 400 9px/1.2 "Segoe UI", Roboto, Arial, sans-serif; color: #a3a8ae; text-decoration: none; }
.iv-ph { color: #b45309; background: #fef3c7; border-radius: 3px; padding: 0 .2em; }

/* ---------- Invoice ---------- */
.iv-page { min-height: 1123px; padding: 56px 60px 70px; }
.iv-top { display: flex; justify-content: space-between; gap: 2em; align-items: flex-start; }
.iv-biz { display: flex; gap: 1em; align-items: flex-start; min-width: 0; }
.iv-biz img { max-width: 120px; max-height: 70px; object-fit: contain; display: block; }
.iv-biz-name { font-size: 1.35em; font-weight: 700; color: #111; line-height: 1.2; }
.iv-biz-info { color: #555; font-size: .92em; white-space: pre-line; margin-top: .2em; }
.iv-title { text-align: right; flex: 0 0 auto; }
.iv-title h1 { font-family: inherit; font-size: 2.3em; font-weight: 800; letter-spacing: .06em; color: var(--cv-acc); margin: 0 0 .25em; line-height: 1; }
.iv-meta td { padding: .05em 0 .05em 1em; text-align: right; }
.iv-meta td:first-child { color: #666; }
.iv-meta td:last-child { font-weight: 600; color: #111; }
.iv-to { margin-top: 2.2em; display: flex; justify-content: space-between; gap: 2em; }
.iv-label { font-size: .78em; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--cv-acc); margin-bottom: .3em; }
.iv-to-name { font-weight: 700; font-size: 1.08em; color: #111; }
.iv-to-addr { color: #555; white-space: pre-line; }
.iv-table { width: 100%; border-collapse: collapse; margin-top: 1.6em; }
.iv-table th { font-size: .82em; text-transform: uppercase; letter-spacing: .06em; text-align: left; padding: .65em .6em; color: var(--cv-acc); border-bottom: 2px solid var(--cv-acc); }
.iv-table td { padding: .6em; border-bottom: 1px solid #e5e7eb; vertical-align: top; }
.iv-table .r { text-align: right; white-space: nowrap; }
.iv-table .c { text-align: center; width: 2.5em; color: #777; }
.iv-table tr { break-inside: avoid; }
.iv-bottom { display: flex; justify-content: space-between; gap: 2em; margin-top: 1.2em; align-items: flex-start; }
.iv-pay { flex: 1 1 auto; min-width: 0; padding-top: .4em; }
.iv-pay-box { white-space: pre-line; padding: .7em .9em; border-radius: 6px; background: var(--iv-tint); margin-bottom: 1em; }
.iv-note { color: #555; font-size: .92em; white-space: pre-line; }
.iv-sums { flex: 0 0 300px; border-collapse: collapse; }
.iv-sums td { padding: .35em .6em; }
.iv-sums td:last-child { text-align: right; white-space: nowrap; font-weight: 600; }
.iv-sums .iv-grand td { background: var(--cv-acc); color: #fff; font-size: 1.12em; font-weight: 700; padding: .6em; }
.iv-sums .iv-due td { font-weight: 700; color: var(--cv-acc); border-top: 1px solid #ddd; }
.iv-words { margin-top: 1em; padding: .6em .9em; border-left: 3px solid var(--cv-acc); background: var(--iv-tint); font-style: italic; }
.iv-sign { margin-top: 2.2em; display: flex; justify-content: flex-end; }
.iv-sign > div { text-align: center; min-width: 200px; }
.iv-sign img { display: block; height: 80px; max-width: 220px; margin: .3em auto; object-fit: contain; }
.iv-sign .iv-gap { height: 80px; }
.iv-sign strong { display: block; border-top: 1px solid #333; padding-top: .3em; }
.iv-sign { position: relative; }
.iv-stamp { position: absolute; top: 18px; left: 40px; transform: rotate(-14deg); border: 5px double #c62828; color: #c62828; font: 900 46px/1 "Segoe UI", Arial, sans-serif; letter-spacing: .12em; padding: .15em .45em; border-radius: 10px; opacity: .78; }

.iv-t-tegas { padding-top: 0; }
.iv-t-tegas .iv-top { margin: 0 -60px; padding: 40px 60px 34px; background: var(--cv-acc); color: #fff; }
.iv-t-tegas .iv-biz-name, .iv-t-tegas .iv-title h1, .iv-t-tegas .iv-meta td:last-child { color: #fff; }
.iv-t-tegas .iv-biz-info, .iv-t-tegas .iv-meta td:first-child { color: rgba(255, 255, 255, .82); }
.iv-t-tegas .iv-biz img { background: #fff; padding: 4px; border-radius: 6px; }
.iv-t-tegas .iv-table th { background: var(--cv-acc); color: #fff; border: 0; }
.iv-t-tegas .iv-table tbody tr:nth-child(even) td { background: var(--iv-tint); }

.iv-t-klasik { --cv-acc: #141414; font-family: "Times New Roman", Times, Georgia, serif; font-size: 14.5px; font-variant-numeric: lining-nums tabular-nums; }
.iv-t-klasik .iv-table th, .iv-t-klasik .iv-table td { border: 1px solid #333; }
.iv-t-klasik .iv-table th { background: #eee; color: #111; }
.iv-t-klasik .iv-sums td { border: 1px solid #333; }
.iv-t-klasik .iv-sums .iv-grand td { background: #eee; color: #111; }
.iv-t-klasik .iv-pay-box, .iv-t-klasik .iv-words { background: #f5f5f5; }

/* ---------- Kwitansi (A5 mendatar) ---------- */
.kw-page { height: 559px; padding: 26px 30px 30px; }
.kw-box { position: relative; height: 100%; border: 2px solid var(--cv-acc); border-radius: 10px; padding: 18px 24px 18px 78px; display: flex; flex-direction: column; overflow: hidden; }
.kw-box::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 54px; background: var(--cv-acc); }
.kw-side { position: absolute; left: 0; top: 0; bottom: 0; width: 54px; display: flex; align-items: center; justify-content: center; }
.kw-side span { transform: rotate(-90deg); color: #fff; font-weight: 800; letter-spacing: .5em; font-size: 20px; white-space: nowrap; }
.kw-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1em; padding-bottom: .7em; border-bottom: 1px solid #ddd; }
.kw-biz { display: flex; gap: .7em; align-items: center; min-width: 0; }
.kw-biz img { max-width: 80px; max-height: 44px; object-fit: contain; }
.kw-biz-name { font-weight: 700; font-size: 1.1em; color: #111; line-height: 1.2; }
.kw-biz-info { font-size: .82em; color: #666; }
.kw-no { text-align: right; font-size: .92em; color: #555; white-space: nowrap; }
.kw-no b { color: #111; }
.kw-rows { margin-top: .9em; display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: .65em .8em; align-items: baseline; }
.kw-rows dt { color: #555; font-weight: 400; }
.kw-rows dd { margin: 0; border-bottom: 1px dotted #999; padding-bottom: .15em; min-height: 1.6em; font-weight: 600; color: #111; }
.kw-rows dd.kw-words { font-style: italic; background: var(--iv-tint); border: 0; border-radius: 4px; padding: .3em .6em; font-weight: 600; }
.kw-foot { margin-top: auto; display: flex; justify-content: space-between; align-items: flex-end; gap: 1em; }
.kw-amount { font-size: 1.55em; font-weight: 800; color: #111; padding: .3em .8em; border: 2px solid var(--cv-acc); border-radius: 6px; background: var(--iv-tint); white-space: nowrap; }
.kw-sign { text-align: center; min-width: 190px; font-size: .95em; }
.kw-sign img { display: block; height: 64px; max-width: 200px; margin: .2em auto; object-fit: contain; }
.kw-sign .iv-gap { height: 64px; }
.kw-sign strong { display: block; border-top: 1px solid #333; padding-top: .2em; }
