:root {
  --invoice-width: 210mm;
  --invoice-height: 296mm;
}

@page {
  size: A4;
  margin: 0;
}

body {
  background: #2774ae; /* fallback for old browsers */
  background: -webkit-linear-gradient(
    to right,
    #002e5d,
    #002e5d,
    #2774ae
  ); /* Chrome 10-25, Safari 5.1-6 */
  background: linear-gradient(
    to right,
    #002e5d,
    #002e5d,
    #2774ae
  ); /* W3C, IE 10+/ Edge, Firefox 16+, Chrome 26+, Opera 12+, Safari 7+ */

  font-family: "Segoe UI", Tahoma, sans-serif;
  margin: 0;
  padding: 20px 0;
}

.invoice-card {
  background: #fff;
  padding: 15mm 20mm;
  width: var(--invoice-width);
  height: var(--invoice-height);
  margin: 0 auto;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-sizing: border-box;
  overflow: hidden;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

/* --- STAMP LAYER (PALING BAWAH) - FIX UTK DASHBOARD & OKE --- */
.stamp-background-layer {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-15deg);
  z-index: 0;
  pointer-events: none;
  user-select: none;
}

.big-stamp {
  border: 10px double;
  padding: 20px 50px;
  font-size: 85px;
  font-weight: 900;
  text-transform: uppercase;
  border-radius: 20px;
  white-space: nowrap;
  letter-spacing: 5px;
  display: none; /* Kita sembunyikan default-nya, nanti dimunculkan lewat JS */
}

/* Warna stempel LUNAS (Hijau Pekat tapi dibuat Transparan lewat Opacity) */
.stamp-lunas {
  display: block !important; /* Memaksa stempel muncul */
  color: #03ac0e !important;
  border-color: #03ac0e !important;
  opacity: 0.15 !important; /* Mengatur kepekatan tembus pandang stempel di sini */
}

/* Warna stempel PENDING (Merah Pekat tapi dibuat Transparan lewat Opacity) */
.stamp-pending {
  display: block !important; /* Memaksa stempel muncul */
  color: #dc3545 !important;
  border-color: #dc3545 !important;
  opacity: 0.15 !important; /* Mengatur kepekatan tembus pandang stempel di sini */
}

/* --- CONTENT LAYER (DI ATAS STAMP) --- */
.invoice-content {
  position: relative;
  z-index: 1;
  background: transparent !important;
}

/* Transparansi Tabel agar Stamp Terlihat */
.table,
.table tr,
.table td,
.table th,
.table-light {
  background: transparent !important;
  background-color: transparent !important;
}

.text-brand {
  color: #03ac0e;
  font-weight: 800;
  font-size: 24px;
  margin: 0;
}
#brand-logo {
  display: none;
  max-height: 32px;
  width: auto;
}

.section-title {
  color: #6c727c;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  border-bottom: 1px solid #eee;
  margin-bottom: 8px;
}
.info-row {
  display: flex;
  font-size: 12px;
  margin-bottom: 2px;
}
.info-label {
  min-width: 70px;
  color: #6c727c;
}
.info-value {
  font-weight: 700;
  flex: 1;
}

.table {
  margin-top: 15px;
  border-top: 2px solid #31353b;
  font-size: 13px;
}
.item-name {
  color: #03ac0e;
  font-weight: 700;
  margin-bottom: 0;
}
.total-tagihan {
  font-size: 18px;
  font-weight: 800;
  border-top: 2px solid #31353b;
  padding-top: 8px;
  margin-top: 8px;
}

/* Detail Pembayaran (Tetap di Posisi Semula) */
.summary-container {
  display: flex;
  justify-content: flex-end;
  align-items: flex-start;
  margin-top: 20px;
}

@media (max-width: 992px) {
  .invoice-card {
    width: 100%;
    height: auto;
    min-height: 297mm;
    padding: 10mm;
    margin-bottom: 150px;
  }
  .no-print {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background: white;
    padding: 15px;
    box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.1);
    max-height: 400px;
    overflow-y: auto;
  }
}

.pdf-mode {
  box-shadow: none !important;
  margin: 0 !important;
}
.pdf-mode .hide-in-pdf {
  display: none !important;
}
/* Menyelaraskan baris variasi bertingkat di dalam tabel invoice */
.table td {
  padding-top: 8px !important;
  padding-bottom: 8px !important;
}
.table td div {
  line-height: 1.4;
}
