﻿:root {
    --primary-color: #2c3e50;
    --accent-color: #3498db;
    --text-main: #333;
    --text-light: #7f8c8d;
    --border-color: #ecf0f1;
}


@page {
    size: A4 portrait;
    margin: 0;
}

/* A4 Page Setup */
.page_a4 {
    width: 210mm;
    min-height: 297mm;
    padding: 20mm;
    margin: 10mm auto;
    background: white;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
    position: relative;
}

@media print {
    body {
        background: none;
    }

    .page_a4 {
        margin: 0;
        box-shadow: none;
    }

    .no-print {
        display: none;
    }
}


/* Header Section */
header {
    display: flex;
    display: grid;
    /*grid-template-columns: auto auto 1fr;*/
    grid-template-columns: auto 1fr auto;
    column-gap: 0;
    /*justify-content: space-between;*/
    align-items: flex-start;
    border-bottom: 2px solid var(--accent-color);
    padding-bottom: 20px;
    margin-bottom: 30px;
}



.logo-container {
    width: 100px;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #1d3557;
    border-radius: 8px;
    padding: 8px;
    background: white;
}

.logo-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1d3557 0%, #457b9d 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 14px;
    text-align: center;
    line-height: 1.2;
    border-radius: 4px;
}

.logo-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: none;
}
.clinic-info  {
   padding-left:5px;
}

.clinic-info h1 {
    margin: 0;
    color: var(--primary-color);
    font-size: 24px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.clinic-info p {
    margin: 2px 0;
    font-size: 13px;
    color: var(--text-light);
}

.invoice-label {
    text-align: right;
}

    .invoice-label h2 {
        margin: 0;
        color: var(--accent-color);
        font-size: 32px;
    }

/* Patient & Metadata Section */
.details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
}

.section-title {
    font-size: 12px;
    font-weight: bold;
    color: var(--accent-color);
    text-transform: uppercase;
    margin-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 5px;
}

.info-block p {
    margin: 4px 0;
    font-size: 14px;
}

.info-block span {
    font-weight: bold;
    color: var(--primary-color);
}

/* Table Section */
table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 30px;
}

th {
    background-color: #f8f9fa;
    color: var(--primary-color);
    text-align: left;
    padding: 12px;
    font-size: 14px;
    border-bottom: 2px solid var(--border-color);
}

td {
    padding: 12px;
    border-bottom: 1px solid var(--border-color);
    font-size: 14px;
    color: var(--text-main);
}

.text-right {
    text-align: right;
}

/* Summary Section */
.summary-container {
    display: flex;
    justify-content: flex-end;
}

.summary-table {
    width: 300px;
}

/*.summary-table div {
        display: flex;
        justify-content: space-between;
        padding: 8px 0;
        font-size: 14px;

}*/

    .summary-table div {
        display: grid;
        grid-template-columns: 1fr auto auto;
        gap: 10px;
        font-size: 14px;
    }


.total-row {
    margin-top: 10px;
    font-weight: bold;
    font-size: 18px !important;
    color: var(--accent-color);
}

.total-row-border {
    border-top: 2px solid var(--primary-color);
}

.text-usd-color {
    color: var(--accent-color);
}
.text-iqd-color {
    color: var(--accent-color);
}

/* Footer */
footer {
    position: absolute;
    bottom: 20mm;
    left: 20mm;
    right: 20mm;
    border-top: 1px solid var(--border-color);
    padding-top: 15px;
    text-align: center;
}

    footer p {
        font-size: 11px;
        color: var(--text-light);
        margin: 3px 0;
    }

.status-badge {
    display: inline-block;
    padding: 5px 15px;
    background: #27ae60;
    color: white;
    border-radius: 4px;
    font-weight: bold;
    margin-top: 10px;
}



/* RTL Support */
html[dir="rtl"] body {
    direction: rtl;
}

/* Header layout */

html[dir="rtl"] header {
/*    grid-template-columns: 1fr auto auto;
*/    grid-template-columns: auto 1fr auto;
}


/* Clinic info spacing */
html[dir="rtl"] .clinic-info {
    padding-right: 5px;
    padding-left: 0;
}


html[dir="rtl"] .clinic-info {
    padding-right: 5px;
    padding-left: 0;
}
/* Invoice label alignment */
html[dir="rtl"] .invoice-label {
    text-align: left;
}

/* Table alignment */
html[dir="rtl"] th {
    text-align: right;
}

html[dir="rtl"] td {
    text-align: right;
}

/* Utility classes */
html[dir="rtl"] .text-right {
    text-align: left;
}

/* Summary section alignment */
html[dir="rtl"] .summary-container {
    justify-content: flex-start;
}

/* Summary rows */
/*html[dir="rtl"] .summary-table div {
    flex-direction: row-reverse;
}*/

html[dir="rtl"] .summary-table div {
    grid-template-columns: auto auto 1fr;
}

/* Footer alignment */
html[dir="rtl"] footer {
    text-align: center;
}

/* Details grid spacing (optional for RTL balance) */
html[dir="rtl"] .details-grid {
    direction: rtl;
}