@charset "utf-8";

/* ==========================================================
   STRICT A4 PDF STRUCTURE
   ========================================================== */
@page {
    size: A4;
    margin: 0;
}
/* 1. FIX FONT DECLARATIONS - Ensure paths are absolute for Dompdf */
@font-face {
    font-family: 'Poppins';
    src: url("assets/Poppins/Poppins-LightItalic.ttf") format("truetype");
    font-weight: 300;
    font-style: italic;
}
/* REGULAR */
@font-face {
    font-family: 'Poppins';
    src: url("assets/Poppins/Poppins-Regular.ttf") format("truetype");
    font-weight: normal;
    font-style: normal;
}
/* Inside your invoice-a4.css or style block */
@font-face {
    font-family: 'Poppins';
    src: url('<?php echo $_SERVER['DOCUMENT_ROOT']; ?>/assets/Poppins/Poppins-Regular.ttf') format('truetype');
    font-weight: normal;
}
/* SEMIBOLD */
@font-face {
    font-family: 'Poppins';
    src: url("assets/Poppins/Poppins-SemiBold.ttf") format("truetype");
    font-weight: 600;
    font-style: normal;
}

/* BOLD */
@font-face {
    font-family: 'Poppins';
    src: url("assets/Poppins/Poppins-Bold.ttf") format("truetype");
    font-weight: bold;
    font-style: normal;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Poppins', Arial, sans-serif;
    font-size: 4.5mm;
    line-height: 0.9; /* Slightly relaxed from 1.0 for better legibility */
	overflow: hidden; /* Prevents stray pixels creating page 2 */
    background: #fff;
    -webkit-print-color-adjust: exact;
}
/* Forces the very first row to stay at the top of the box */
.invoice-box > *:first-child {
    margin-top: 0 !important;
}

/* 2. PREVENT EMPTY PAGE - Tighten the box */
.invoice-box {
    width: 210mm;
    /* Change height to auto or slightly less than full A4 */
    height: 265mm; /* Exactly 1mm shorter than A4 (297mm) */
    margin: 0;
    padding: 15.7mm 0 0 0; /* RECTIFIED: Reduced top margin from 19.05mm */
    box-sizing: border-box;
    position: relative;
    background: #fff;
    overflow: hidden;
}

/* ==========================================================
   HEADER SECTION
   ========================================================== */
.ibox-invoice-row, .iboxbilling, .bankcontainer {
    display: table !important;
    width: 100% !important;
    border-collapse: collapse;
	margin-top: 6mm;
    margin-bottom: 6mm; /* Reduced margin */
	table-layout: fixed; /* Crucial for Cellmap stability */
}
/* Ensure the bank container is the reference point if needed */
.bankcontainer {
    position: relative; /* This allows us to anchor the stamp if moved inside here */
}
.iboxtop {
    display: table !important;
    width: 100% !important;
    border-collapse: collapse;
    margin-top: 3mm; /* Changed from 1px to 0 */
    margin-bottom: 2mm; /* Reduced from 5mm */
    table-layout: fixed;
    height: 12mm; /* Forced height */
    line-height: 1; /* Prevents text leading from adding height */
}

.invoice-title {
    font-family: 'Poppins', sans-serif;
    display: table-cell !important;
    width: 60% !important; 
    background-color: #F1E902 !important;
    color: #111;
    font-size: 18mm;
    font-weight: bold;
    letter-spacing: 2mm;
    padding: 0mm 4mm 0mm 15.7mm;  /* Aligned left margin */
    vertical-align: middle;
}

.company-details {
    display: table-cell;
    width: 40%;
    text-align: right;
    vertical-align: middle;
    padding-right: 15.7mm; 
    font-size: 3.5mm; /* Slightly reduced from 4.5mm */
    line-height: 0.8; /* Tight line height */

}

.company-details strong {
    color:#04196A !important;
    font-size: 22px;
    display: block;
    margin-bottom: -10px;
}
/*====================================
Invoice Number and Date
================================*/


/* LEFT SIDE: Invoice Number */
.iboxinvoice-number {
    display: table-cell !important;
    width: 65%;
    text-align: left;
    vertical-align: middle !important;
    font-size: 18px;           /* Adjust as needed */
    padding-left: 15.7mm;    /* Matches your standard 0.75in margin */
    font-weight: 600;
}

/* RIGHT SIDE: Date */
.iboxdate {
    display: table-cell !important;
    width: 35%;
    text-align: right;
    vertical-align: middle !important;
    font-size: 18px;           /* Adjust as needed */
    padding-right: 15.7mm;   /* Matches your standard 0.75in margin */
}
/* ==========================================================
   LOGO & BILLING
   ========================================================== */
/*  .iboxbilling - is in Header section */

.bill-left { 
    display: table-cell; 
    width: 65%; 
    vertical-align: top; 
    font-size: 16px;
    padding-left: 15.7mm; /* Standardized Left */
	line-height: 1.2;
}
.bill-left strong { 
	font-size: 20px;}
.bill-right {
	display: table-cell;
    width: 35%;
    vertical-align: middle; /* Aligns logo to bottom of this row */
    text-align: right;
    padding-right: 15.7mm;
}
/* Ensure Logo inside bill-right is sized correctly */
.bill-right img {
    max-width: 150px;
    height: auto;
}

/* ==========================================================
   DSC & NAME STYLING (Rectified)
   ========================================================== */
.iboxDSC-Name {
    font-family: 'Poppins', sans-serif;
	display: table !important;
    width: 100% !important;
    border-collapse: collapse;	
    font-size: 18px !important; /* INCREASED from 20px */
    padding-left: 15.7mm;
    vertical-align: middle;
	margin-top: 10px;
 /*  margin: 10px 0 10px 19.05mm !important;  Strict Left Align */
  /*  font-size: 22px; /* Increased as requested */
 /*   display: block !important;*/
}

/* Styling for "dsc in name of" specifically */
.dsc-individual-name {
    color: #dc2626 !important;
    font-style: italic !important;
    font-weight: 300 !important;
/*	font-size: 18px !important; /* INCREASED from 20px */
	font-family: 'Poppins', sans-serif !important;
}
/* Rupee Symbol container */
.rupee {
    font-family: 'DejaVu Sans', sans-serif !important; /* Dompdf fallback for symbols */
	
}
/* ==========================================================
   TABLE (Rectified Fonts)
   ========================================================== */
/* Ensure the descriptions stack vertically */
#rowClassPreview, 
#rowTokenPreview {
    display: block !important;
    width: 100%;
    clear: both;
    font-family: 'Poppins', sans-serif !important;
}
/* Styling for the Class Name (e.g., Class 3 - Individual) */
#rowClassPreview {
    font-size: 12px;
    color: #555555;
    font-weight: normal;
    line-height: 1.2;
}
/* Styling for the Token Info (e.g., HyperSecu Token) */
#rowTokenPreview {
    margin-top: 5px !important; 
    font-style: italic; /* Optional: distinguishes it from the class */
    font-size: 12px;
    color: #555555 !important;
}

.ibox-table {
	page-break-inside: avoid; /* Ensure the table doesn't break internally */
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
	table-layout: fixed; /* Crucial: Forces columns to respect the widths below */
    font-family: 'Poppins', sans-serif !important; /* Force Poppins */
}

/* Define Column Widths via the Header */
/* Distribute columns: 60% / 8% / 16% / 16% */
.ibox-table thead th:nth-child(1) { width: 60%; text-align: left; padding-left: 15.7mm;border-right: 2px solid #fff; /* Vertical White Border */ }
.ibox-table thead th:nth-child(2) { width: 8%; text-align: center; border-right: 2px solid #fff; /* Vertical White Border */ }
.ibox-table thead th:nth-child(3) { width: 16%; text-align: center; border-right: 2px solid #fff; /* Vertical White Border */}
.ibox-table thead th:nth-child(4) { width: 16%; text-align: right; padding-right: 15.7mm;  border-right: none !important; /* Remove border from the last column */}

/* Align contents correctly */
.ibox-table tbody td:nth-child(1) { text-align: left; padding-left: 15.7mm; }
.ibox-table tbody td:nth-child(2) { text-align: center; }
.ibox-table tbody td:nth-child(3) { text-align: center; }
.ibox-table tbody td:nth-child(4) { text-align: right; padding-right: 15.7mm; }

.ibox-table thead tr {
    background-color: #3a3a3a !important;
}


.ibox-table thead th {
    font-family: 'Poppins', sans-serif !important;
    color: #fff !important;
    padding: 12px 0;
    text-align: center;
    font-size: 16px;
    font-weight: 600; /* SemiBold headers */
}

.ibox-table tbody td {
    font-family: 'Poppins', sans-serif !important;
    padding: 12px 0;
    border-bottom: 2px solid #000F7F;
    font-size: 16px;
	text-align: center; /* Default all body cells to center */
    vertical-align: middle;
}

.ibox-table td, .ibox-table th {
    border-bottom: 1px solid #000F7F;
    padding: 10px 5px;
    word-wrap: break-word; /* Prevents long text from breaking the cellmap */
}


/* Right Margin Correction for Table */
.ibox-table th:last-child, .ibox-table td:last-child { 
    padding-right: 15.7mm !important; 
	font-family: 'Poppins', sans-serif !important;
   /* text-align: right;  */
}
 .ibox-table th:first-child, .ibox-table td:first-child { 
    padding-left: 15.7mm !important; 
}

/* SPECIFIC ALIGNMENTS (Left aligned items) */
/* Product titles and descriptions inside the first column */
.ibox-table td:first-child {
    text-align: left !important; 
}

/* If you have a specific class for the "Total" row at the bottom */
.ibox-table tr.total-row td {
    text-align: left !important;
    padding-left: 15.7mm;
    font-weight: bold;
}
/* ==========================================================
   AMOUNT & BANK SECTION (Rectified)
   ========================================================== */
.amount-words {
    font-family: 'Poppins', sans-serif !important;
    margin: 15px 0 0 15.7mm !important; /* Strict Left Align */
  /*  font-size: 20px;*/
	display: table !important;
    width: 100% !important;
    border-collapse: collapse;	
    font-size: 18px; /* INCREASED from 20px */
    vertical-align: middle;
}


.bankleft-details{
	display: table-cell !important; /* Must be table-cell to stay side-by-side */
    width: 55%;
    padding: 0 0 0 15.7mm !important; /* Zero top/bottom, strict 19.05 left */
    vertical-align: middle;
    text-align: left;
} 
.bankleft-details a, 
.bankleft-details strong {
    font-family: 'Poppins', sans-serif !important; /* Strictly Poppins */
	text-decoration: none !important;
	color: #000 !important;
	margin: 0 !important;
    padding: 0 !important;
    display: inline; /* Keep as inline to avoid block-level margins */
	font-size: 3.5mm;
}


.bankright-box {
    display: table-cell;
    width: 45%; 
    background-color: #F1E902 !important;
    height: 16mm;
    vertical-align: middle;
    position: relative;
	text-align: center;
	overflow: visible;
}

.bankright-box img {
    /* Ensures the image never exceeds 70% of the yellow box area */
    max-width: 70% !important; 
    max-height: 70% !important;
    width: auto;
    height: auto;
    display: inline-block; /* Works best with text-align: center */
    margin: 0 auto;
}

.bankright-box::after {
    content: "Elan Elite, TUP-6";
    font-family: "Times New Roman", serif !important;
    font-style: italic;
    display: block;
    position: absolute;
    top: 24.8mm;
    right: 32.0mm; /* Aligned with company details right margin */
    font-size: 11px;
    padding-top: 5px;
}

.styled-word {
    display: inline-block;
    white-space: nowrap;
	font-size: 18px !important;
}

.styled-first {
    color: #dc2626 !important;
    font-size: 22px;
    font-weight: 600;
}
.footer {
    margin-top: 30px;
    text-align: center;
    font-style: italic;
    font-family: "Times New Roman", serif !important;
}

/* Crucial: Watermark must be Absolute and contained */
/* ==========================================================
   STAMPS & WATERMARK (Strictly Layered)
   ========================================================== */
.watermark {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 800px;
    margin-left: -400px;
    text-align: center;
    font-size: 80px;
    font-weight: 900;
    color: #f2f2f2; /* Light hex is safer than RGBA */
    transform: rotate(-35deg);
    z-index: -1; 
}

.stamp {
    /* Absolute keeps the stamp from pushing the table */
    position: absolute !important; 
    /* Reset fixed width to allow padding to work */
    width: auto !important; 
    white-space: nowrap !important;
	
    /* Positioned specifically to overlap the left side of the yellow bankright-box */
    top: 670px !important; 
    left: 430px !important; 
    
    /* Ensure it's treated as a stamp (layered over) */
    /*display: block !important;*/
    display: none;
	
    width: 200px;
    height: auto;
    font-size: 48px;
    font-weight: bold;
    text-transform: uppercase;
	
    /* Fix: Use border-box and explicit padding */
    padding: 8px 15px !important; 
    border: 8px solid !important;
    border-radius: 15px;
	
    transform: rotate(-20deg);
    opacity: 0.15;
    
    /* Z-index ensures it sits ON TOP of the table, not under it */
    z-index: 9999 !important; 
    pointer-events: none;
}
/* ==========================================================
   STAMP COLOR LOGIC (Uncommented and simplified)
   ========================================================== */
.paid { 
    color: #22c55e !important; 
    border-color: #22c55e !important; 
}
.unpaid { 
    color: #ef4444 !important; 
    border-color: #ef4444 !important; 
}

