/* Global Styles */
body {
    font-family: DejaVuSans, Arial, sans-serif;
    font-size: 10pt;
    color: #0f172a;
    line-height: 1.6;
    background-color: #ffffff;
    margin: 0;
    padding: 0;
}

.invoice-container {
    width: 100%;
    max-width: 794px; /* 210mm ≈ 794px at 96 DPI */
    margin: 0 auto;
    padding: 19px; /* 5mm ≈ 19px */
    box-sizing: border-box;
    background-color: #ffffff;
    border-radius: 11px; /* 3mm ≈ 11px */
}

/* Header Styles */
.invoice-header {
    background: linear-gradient(135deg, #6b21a8 0%, #22d3ee 100%);
    color: #ffffff;
    padding: 10px;
    margin-bottom: 38px; /* 10mm ≈ 38px */
    border-radius: 8px 8px 0 0; /* 2mm ≈ 8px */
    text-align: center;
}

.header-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 5px;
}

.header-table td {
    vertical-align: top;
    padding: 5px;
}

.company-details {
    width: 50%;
}

.invoice-details {
    width: 50%;
    text-align: right;
}

.company-info {
    font-size: 8pt;
    color: #e2e8f0;
    margin-top: 5px;
}

.invoice-title {
    font-size: 20pt;
    font-weight: bold;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.invoice-meta {
    font-size: 8pt;
    margin-top: 5px;
    color: #e2e8f0;
}

.invoice-meta p {
    margin: 4px 0; /* 1mm ≈ 4px */
}

/* Customer Section */
.customer-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 38px; /* 10mm ≈ 38px */
}

.customer-table td {
    width: 50%;
    vertical-align: top;
    padding: 8px;
    background-color: #ffffff;
    border: 2px solid #22d3ee;
    border-radius: 8px; /* 2mm ≈ 8px */
    margin: 0 5px;
}

.billing-box h3, .shipping-box h3 {
    font-size: 12pt;
    color: #6b21a8;
    margin: 0 0 5px 0;
    padding: 3px 5px;
    background-color: #f3e8ff;
    border-radius: 4px; /* 1mm ≈ 4px */
}

/* Items Table */
.items-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 38px; /* 10mm ≈ 38px */
}

.items-table th {
    background-color: #6b21a8;
    color: #ffffff;
    font-weight: bold;
    text-align: left;
    padding: 6px;
    border-bottom: 2px solid #22d3ee;
}

.items-table td {
    padding: 6px;
    border-bottom: 1px solid #e2e8f0;
}

.items-table tr:nth-child(even) {
    background-color: #f8fafc;
}

.items-table .product-col {
    width: 50%;
}

.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

/* Totals Section */
.totals-table {
    width: 35%;
    margin-left: 65%;
    border-collapse: collapse;
    margin-bottom: 38px; /* 10mm ≈ 38px */
}

.totals-table th {
    text-align: right;
    padding: 4px;
    font-weight: normal;
    color: #0f172a;
}

.totals-table td {
    text-align: right;
    padding: 4px;
    color: #0f172a;
}

.totals-table .total-row th,
.totals-table .total-row td {
    font-weight: bold;
    font-size: 12pt;
    color: #6b21a8;
    border-top: 3px solid #22d3ee;
    padding-top: 6px;
}

/* Notes Section */
.notes-section {
    margin-bottom: 30px; /* 8mm ≈ 30px */
    padding: 8px;
    background-color: #f8fafc;
    border: 1px solid #22d3ee;
    border-radius: 8px; /* 2mm ≈ 8px */
}

.notes-title {
    font-weight: bold;
    color: #6b21a8;
    margin-bottom: 4px;
}

/* Footer Styles */
.invoice-footer {
    text-align: center;
    font-size: 8pt;
    color: #64748b;
    padding-top: 8px;
    margin-top: 38px; /* 10mm ≈ 38px */
    border-top: 3px solid #22d3ee;
}

.thank-you {
    font-size: 11pt;
    font-weight: bold;
    color: #6b21a8;
    margin-bottom: 15px; /* 4mm ≈ 15px */
    text-transform: uppercase;
}

/* Debug Fallback */
.logo-fallback {
    font-size: 7pt;
    color: #ff0000;
    display: none;
}