/* ==========================================================================
   POPIPU STUDIO INVOICE - 100% PIXEL-PERFECT STYLING
   Matching the original reference image precisely
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Dancing+Script:wght@600;700&family=Great+Vibes&family=Fredoka:wght@500;600;700&family=Outfit:wght@400;500;600;700&family=Quicksand:wght@500;600;700&display=swap');

:root {
  --invoice-pink-main: #f87ea9;
  --invoice-pink-header: #f770a3;
  --invoice-pink-table: #f99abf;
  --invoice-pink-pill: #f87ea9;
  --invoice-text-pink: #d8357a;
  --invoice-text-darkpink: #b82563;
  --invoice-text-berry: #53253b;
  --invoice-border-pink: #f8a3c5;
}

/* Invoice Container - Spacious, elegant receipt/A4 proportion */
.invoice-sheet {
  background: #ffffff;
  width: 100%;
  max-width: 680px;
  min-height: 860px;
  margin: 0 auto;
  box-shadow: 0 12px 36px rgba(248, 126, 169, 0.2), 0 3px 10px rgba(0, 0, 0, 0.05);
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  box-sizing: border-box;
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--invoice-text-pink);
}

/* 1. TOP SCALLOPED FLOWER HEADER */
.invoice-top-strip {
  background-color: var(--invoice-pink-header);
  height: 36px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.invoice-flower-pattern {
  width: 100%;
  height: 100%;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='36' height='36' viewBox='0 0 36 36'%3E%3Cg fill='%23ffffff'%3E%3Ccircle cx='18' cy='12' r='4.2'/%3E%3Ccircle cx='23.7' cy='15.5' r='4.2'/%3E%3Ccircle cx='21.5' cy='22' r='4.2'/%3E%3Ccircle cx='14.5' cy='22' r='4.2'/%3E%3Ccircle cx='12.3' cy='15.5' r='4.2'/%3E%3Ccircle cx='18' cy='17.5' r='2.2' fill='%23f770a3'/%3E%3C/g%3E%3C/svg%3E");
  background-repeat: repeat-x;
  background-position: center center;
  background-size: 34px 34px;
}

/* INVOICE BODY CONTENT */
.invoice-body {
  padding: 24px 38px 22px 38px;
  flex: 1;
  display: flex;
  flex-direction: column;
  background: #ffffff;
}

/* 2. TOP BRANDING ROW */
.invoice-brand-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 22px;
  min-height: 75px;
}

/* Popipu Studio Logo */
.invoice-logo-wrap {
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.invoice-logo-img {
  width: 135px;
  height: auto;
  max-height: 80px;
  object-fit: contain;
  display: block;
}

.invoice-logo-popipu {
  font-family: 'Fredoka', 'Quicksand', cursive, sans-serif;
  font-size: 36px;
  font-weight: 700;
  line-height: 0.9;
  letter-spacing: -0.5px;
  color: #fad6e4;
  -webkit-text-stroke: 4.5px #5e283d;
  paint-order: stroke fill;
  text-shadow: 1px 2px 0px rgba(94, 40, 61, 0.25);
  user-select: none;
}

.invoice-logo-studio {
  font-family: 'Fredoka', 'Quicksand', sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: #5e283d;
  letter-spacing: 2.2px;
  margin-top: 4px;
  margin-left: 14px;
  line-height: 1;
}

/* Top Right Title */
.invoice-title-wrap {
  text-align: right;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
}

.invoice-script-title {
  font-family: 'Great Vibes', 'Dancing Script', cursive;
  font-size: 34px;
  color: #ea3d80;
  line-height: 1.15;
  margin: 0;
  font-weight: 500;
  letter-spacing: 0.5px;
}

.invoice-top-email {
  font-size: 13.5px;
  color: #ea3d80;
  margin-top: 3px;
  font-weight: 500;
  letter-spacing: 0.2px;
}

/* 3. META INFO ROW (INVOICE NO & CUSTOMER/DATE) */
.invoice-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 22px;
  font-size: 14px;
  line-height: 1.4;
}

.invoice-meta-left {
  text-align: left;
}

.invoice-num-primary {
  font-weight: 700;
  color: #d63384;
  letter-spacing: 0.5px;
  font-size: 14.5px;
}

.invoice-num-tag {
  color: #d63384;
  font-weight: 500;
  font-size: 14px;
}

.invoice-meta-right {
  text-align: right;
  color: #d63384;
}

.invoice-customer-for {
  font-weight: 600;
  font-size: 14.5px;
  color: #d63384;
}

.invoice-date-text {
  font-size: 14px;
  color: #d63384;
  font-weight: 500;
}

/* 4. ITEMS TABLE */
.invoice-table-wrap {
  margin-bottom: 32px;
  width: 100%;
}

.invoice-items-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: auto;
}

.invoice-items-table thead tr {
  background-color: var(--invoice-pink-table);
  height: 32px;
}

.invoice-items-table th {
  background-color: #f99abf;
  color: #4a1830;
  font-weight: 700;
  font-size: 14px;
  padding: 7px 14px;
  letter-spacing: 0.3px;
  border: none;
  white-space: nowrap;
}

.invoice-items-table th:first-child {
  border-top-left-radius: 4px;
  border-bottom-left-radius: 4px;
  text-align: center;
  width: 10%;
}

.invoice-items-table th:nth-child(2) {
  text-align: center;
  width: 46%;
}

.invoice-items-table th:nth-child(3) {
  text-align: center;
  width: 22%;
  white-space: nowrap;
}

.invoice-items-table th:last-child {
  border-top-right-radius: 4px;
  border-bottom-right-radius: 4px;
  text-align: center;
  width: 22%;
  white-space: nowrap;
}

.invoice-items-table tbody tr {
  border-bottom: 1px solid transparent;
}

.invoice-items-table tbody tr.tinted-row {
  background-color: rgba(249, 154, 191, 0.08);
}

.invoice-items-table td {
  padding: 10px 14px;
  font-size: 14px;
  color: #55273b;
  font-weight: 500;
}

.invoice-items-table td.col-qty {
  text-align: center;
  font-weight: 600;
  color: #55273b;
  white-space: nowrap;
}

.invoice-items-table td.col-desc {
  text-align: left;
  padding-left: 20px;
  white-space: nowrap;
  font-weight: 500;
}

.invoice-items-table td.col-price {
  padding: 10px 14px;
  white-space: nowrap;
}

.invoice-items-table td.col-total {
  padding: 10px 14px;
  font-weight: 600;
  white-space: nowrap;
}

.invoice-items-table .currency-cell {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  gap: 6px;
  font-family: inherit;
}

.invoice-items-table .curr-prefix,
.invoice-items-table .curr-num {
  font-family: inherit;
  font-size: inherit;
  font-weight: 600;
  color: #55273b;
  line-height: 1.2;
}

.invoice-items-table .curr-prefix {
  text-align: left;
  flex-shrink: 0;
}

.invoice-items-table .curr-num {
  text-align: right;
  flex-grow: 1;
  font-variant-numeric: tabular-nums;
}

.invoice-items-table td.col-total .curr-prefix,
.invoice-items-table td.col-total .curr-num {
  font-weight: 700;
  color: #d8357a;
}

/* 5. PAYMENT & TOTAL SUMMARY SECTION */
.invoice-calc-section {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 28px;
  gap: 24px;
}

/* Left: Payment Method & QR Code */
.invoice-payment-box {
  width: 50%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.invoice-pay-title {
  font-size: 13.5px;
  font-weight: 700;
  color: #d63384;
  margin-bottom: 3px;
}

.invoice-pay-detail {
  font-size: 13.5px;
  font-weight: 500;
  color: #d63384;
  margin-bottom: 8px;
}

.invoice-qr-wrap {
  margin: 4px 0 6px 0;
  background: #ffffff;
  padding: 4px;
  border-radius: 4px;
  display: inline-block;
}

.invoice-qr-img {
  width: 110px;
  height: 110px;
  object-fit: contain;
  display: block;
}

.invoice-qr-caption {
  font-size: 12px;
  color: #d63384;
  line-height: 1.35;
  font-weight: 500;
}

/* Right: Subtotal, Shipping Fee, TOTAL Pill */
.invoice-totals-box {
  width: 44%;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.invoice-summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14.5px;
  color: #d63384;
  font-weight: 600;
  padding: 0 4px;
}

.invoice-summary-label {
  font-weight: 600;
}

.invoice-summary-val {
  font-weight: 600;
}

/* Pill for TOTAL / SISA */
.invoice-total-pill {
  background-color: var(--invoice-pink-pill);
  color: #ffffff;
  border-radius: 24px;
  padding: 9px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
  box-shadow: 0 3px 8px rgba(248, 126, 169, 0.35);
}

.invoice-total-pill.pill-unpaid {
  background: linear-gradient(135deg, #f43f85, #e11d48);
  box-shadow: 0 3px 8px rgba(225, 29, 72, 0.35);
}

.invoice-total-pill.pill-dp {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  box-shadow: 0 3px 8px rgba(217, 119, 6, 0.35);
}

.invoice-total-label {
  font-weight: 800;
  font-size: 14px;
  letter-spacing: 1.2px;
}

.invoice-total-amount {
  font-weight: 800;
  font-size: 16px;
  letter-spacing: 0.5px;
}

.invoice-status-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  padding: 3px 8px;
  border-radius: 4px;
  margin-bottom: 6px;
  font-weight: 600;
}

.invoice-status-tag.tag-paid {
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #bbf7d0;
}

.invoice-status-tag.tag-dp {
  background: #fef3c7;
  color: #b45309;
  border: 1px solid #fde68a;
}

.invoice-status-tag.tag-unpaid {
  background: #ffe4e6;
  color: #e11d48;
  border: 1px solid #fecdd3;
}

/* 6. SIGN-OFF / BEST REGARDS */
.invoice-signoff-wrap {
  margin-top: auto;
  padding-top: 24px;
  align-self: flex-end;
  margin-left: auto;
  margin-right: 12px;
  width: fit-content;
  min-width: 175px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.invoice-signoff-title {
  font-size: 13.5px;
  color: #d63384;
  font-weight: 600;
  margin-bottom: 2px;
  text-align: center;
}

/* Popipu Studio Dotted Outline Font / Script */
.invoice-signoff-studio {
  font-family: 'Dancing Script', cursive;
  font-size: 28px;
  font-weight: 700;
  color: #f472b6;
  letter-spacing: 1px;
  line-height: 1.1;
  margin: 2px 0;
  text-shadow: 0 0 1px #f472b6;
  /* Dotted effect simulation */
  filter: drop-shadow(0px 0px 0.5px #f472b6);
  text-align: center;
}

.invoice-signoff-name {
  font-size: 13px;
  color: #d63384;
  font-weight: 500;
  margin-top: 2px;
  text-align: center;
}

/* 7. BOTTOM FOOTER */
.invoice-footer-line {
  height: 1.5px;
  background-color: var(--invoice-border-pink);
  width: 100%;
  margin-top: 20px;
  margin-bottom: 8px;
}

.invoice-footer-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: #d63384;
  font-weight: 500;
}

.invoice-footer-left {
  letter-spacing: 0.2px;
}

.invoice-footer-right {
  letter-spacing: 0.5px;
}

/* PRINT SPECIFIC STYLES - Ensures exact print output */
@media print {
  body * {
    visibility: hidden;
  }
  
  .invoice-preview-container,
  .invoice-preview-container * {
    visibility: visible;
  }

  .invoice-preview-container {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    margin: 0;
    padding: 0;
    box-shadow: none;
  }

  .invoice-sheet {
    box-shadow: none !important;
    border-radius: 0 !important;
    max-width: 100% !important;
    width: 100% !important;
    min-height: 100vh !important;
    margin: 0 !important;
  }

  .app-header,
  .app-sidebar,
  .app-form-panel,
  .action-buttons-bar,
  .nav-tabs,
  .modal-overlay,
  .toast-container {
    display: none !important;
  }
}
