/* ==========================================================================
   Plani i pagesave (PaymentPlan): kestet, transaksionet, zbritjet, rillogaritja
   dhe deftesa e printueshme. Vetem tokenet e tokens.css.
   ========================================================================== */

.pp-warning { padding: var(--s-4) var(--s-5) 0; }
.pp-warning .alert { margin-bottom: 0; }

.pp-minus { color: var(--violet-ink); font-weight: 600; }

.pp-totals {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  background: var(--surface-2);
  border-radius: 0 0 var(--r-lg) var(--r-lg);
}

.pp-totals > div { display: grid; gap: 2px; padding: var(--s-3) var(--s-5); border-right: 1px solid var(--line); min-width: 0; }
.pp-totals > div:last-child { border-right: 0; }
.pp-totals span { font-size: var(--fs-2xs); font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); }
.pp-totals strong { font-size: var(--fs-lg); font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.pp-totals .is-ok { color: var(--ok-ink); }

/* Shuma e mbyllur te "Sheno pagesen". */
.pp-lock {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-4);
  border: 1px solid var(--ok-soft);
  border-radius: var(--r-md);
  background: var(--ok-soft);
}

.pp-lock-icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: var(--r); background: var(--surface); color: var(--ok); flex: 0 0 auto; }
.pp-lock-icon svg { width: 18px; height: 18px; }
.pp-lock span { display: block; font-size: var(--fs-xs); font-weight: 600; color: var(--ok-ink); }
.pp-lock strong { display: block; font-size: var(--fs-2xl); font-weight: 800; letter-spacing: -0.03em; color: var(--ink); }

.link-btn {
  padding: 0;
  border: 0;
  background: none;
  color: var(--brand);
  font: inherit;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

/* Parapamja e rillogaritjes. */
.pp-section .form-section-title { margin-bottom: 4px; }
.pp-preview { transition: opacity var(--t) var(--ease); }
.pp-preview.is-loading { opacity: 0.55; }

.pp-preview-sum {
  display: flex;
  align-items: center;
  gap: var(--s-6);
  flex-wrap: wrap;
  padding: var(--s-4) var(--s-5);
  border-bottom: 1px solid var(--line);
}

.pp-preview-sum > div { display: grid; gap: 2px; }
.pp-preview-sum span { font-size: var(--fs-xs); color: var(--ink-3); font-weight: 600; }
.pp-preview-sum strong { font-size: var(--fs-xl); font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.pp-preview-sum .is-ok { color: var(--ok-ink); }
.pp-preview-sum .is-bad { color: var(--bad-ink); }
.pp-preview-sum .badge { margin-left: auto; }

.pp-rows td { padding-top: 6px; padding-bottom: 6px; }
.pp-rows .input { min-height: 34px; padding-top: 5px; padding-bottom: 5px; font-size: var(--fs-sm); }
.pp-rows .pp-amount { max-width: 160px; margin-left: auto; text-align: right; font-variant-numeric: tabular-nums; }

/* Pagesa per disa keste: zgjedhja e kesteve, zbritja dhe grupi te transaksionet. */
.pp-batch-tools {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  flex-wrap: wrap;
  margin-bottom: var(--s-3);
}

.pp-batch-count { margin-left: auto; font-size: var(--fs-sm); color: var(--ink-3); font-variant-numeric: tabular-nums; }

.pp-batch-list {
  display: grid;
  margin: 0;
  padding: 0;
  list-style: none;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  max-height: 320px;
  overflow-y: auto;
}

.pp-batch-list li {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-2) var(--s-4);
  border-bottom: 1px solid var(--line);
}

.pp-batch-list li:last-child { border-bottom: 0; }
.pp-batch-list li.is-on { background: var(--brand-soft); }
.pp-batch-name { font-weight: 600; }
.pp-batch-due { font-size: var(--fs-sm); color: var(--ink-3); }
.pp-batch-open { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.pp-batch-open small { font-weight: 400; color: var(--ink-3); }

.pp-batch-discount { margin-top: var(--s-4); }
.pp-batch-note { margin: 0; padding: var(--s-3) var(--s-5); font-size: var(--fs-sm); color: var(--ink-3); }

.pp-batch-split {
  display: flex;
  flex-wrap: wrap;
  gap: 2px var(--s-3);
  margin: 4px 0 0;
  padding: 0;
  list-style: none;
  font-size: var(--fs-2xs);
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}

.pp-batch-split .pp-nowrap { white-space: nowrap; }
.pp-batch-state .badge { justify-self: start; }

/* ----------------------------------------------------------------- deftesa */

.pp-receipt-root { display: none; }

@media print {
  body.print-receipt > *:not(.pp-receipt-root) { display: none !important; }
  body.print-receipt { background: #fff; }
  body.print-receipt .pp-receipt-root { display: block; }
}

.pp-receipt { max-width: 640px; margin: 0 auto; padding: 32px; color: #111; font-family: var(--font); }
.pp-receipt-head { display: flex; justify-content: space-between; gap: 24px; padding-bottom: 16px; border-bottom: 2px solid #111; }
.pp-receipt-head > div { display: grid; gap: 2px; }
.pp-receipt-brand { font-size: 22px; font-weight: 800; }
.pp-receipt-no { text-align: right; }
.pp-receipt-no strong { font-family: var(--mono); font-size: 16px; }
.pp-receipt-list { display: grid; gap: 0; margin: 16px 0; }
.pp-receipt-list > div { display: grid; grid-template-columns: 180px 1fr; gap: 12px; padding: 8px 0; border-bottom: 1px solid #ddd; }
.pp-receipt-list dt { color: #555; }
.pp-receipt-list dd { margin: 0; font-weight: 600; }
.pp-receipt-amount { display: flex; justify-content: space-between; align-items: baseline; padding: 16px; border: 2px solid #111; }
.pp-receipt-amount strong { font-size: 24px; }
.pp-receipt-table { width: 100%; margin: 0 0 16px; border-collapse: collapse; font-size: 13px; }
.pp-receipt-table th, .pp-receipt-table td { padding: 6px 8px; border-bottom: 1px solid #ddd; text-align: left; }
.pp-receipt-table th { color: #555; font-weight: 600; }
.pp-receipt-table td:nth-child(n+3), .pp-receipt-table th:nth-child(n+3) { text-align: right; }
.pp-receipt-discount { margin: 12px 0 0; font-weight: 600; }
.pp-receipt-void { margin-top: 12px; font-weight: 800; color: #b42318; }
.pp-receipt-note { margin-top: 24px; font-size: 11px; color: #555; }

@media (max-width: 720px) {
  .pp-totals { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pp-totals > div { border-bottom: 1px solid var(--line); }
  .pp-preview-sum .badge { margin-left: 0; }
  .pp-batch-list li { grid-template-columns: minmax(0, 1fr) auto; }
  .pp-batch-due { grid-column: 1; }
  .pp-batch-count { margin-left: 0; }
}
