/* =====================================================================
   CarLedger — تنسيق الطباعة (فواتير، سندات، تقارير)
   لا تظهر أي عناصر إدارية في المستند المطبوع
   ===================================================================== */
:root {
    --navy: #12283d;
    --line: #d5dde6;
    --soft: #f3f6f9;
    --text: #1c2733;
}
* { box-sizing: border-box; }
body.print-body {
    margin: 0;
    font-family: 'Cairo', 'Segoe UI', Tahoma, sans-serif;
    color: var(--text);
    background: #e9edf2;
    line-height: 1.7;
}
.print-toolbar {
    max-width: 800px;
    margin: 16px auto;
    display: flex;
    gap: 10px;
    justify-content: center;
}
.btn {
    display: inline-flex; align-items: center; gap: 7px;
    font-family: inherit; font-size: .92rem; font-weight: 700;
    padding: 9px 20px;
    border-radius: 9px;
    border: none; cursor: pointer;
    text-decoration: none;
}
.btn-primary { background: #1d63b8; color: #fff; }
.btn-primary:hover { background: #14508f; }
.btn-ghost { background: #fff; color: #1a3a5c; border: 1px solid var(--line); }

.print-doc {
    max-width: 800px;
    margin: 0 auto 30px;
    background: #fff;
    padding: 34px 40px;
    box-shadow: 0 4px 22px rgba(12,31,51,.12);
    border-radius: 4px;
}
.print-doc-head {
    display: flex; justify-content: space-between; gap: 20px;
    border-bottom: 3px solid var(--navy);
    padding-bottom: 16px;
    margin-bottom: 20px;
}
.print-company { display: flex; gap: 12px; align-items: center; }
.print-company-name { font-size: 1.15rem; font-weight: 700; color: var(--navy); }
.print-company-meta { font-size: .78rem; color: #5b6b7c; }
.print-doc-meta { text-align: left; }
.print-doc-title { font-size: 1.2rem; font-weight: 700; color: var(--navy); }
.print-doc-number { font-size: .84rem; color: #5b6b7c; }

.print-section-title {
    font-size: .95rem;
    font-weight: 700;
    color: var(--navy);
    background: var(--soft);
    border-radius: 7px;
    padding: 6px 12px;
    margin: 16px 0 10px;
}
.print-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.print-table th {
    background: var(--navy);
    color: #fff;
    padding: 8px 10px;
    text-align: right;
    font-weight: 700;
    font-size: .84rem;
}
.print-table td { padding: 8px 10px; border-bottom: 1px solid var(--line); }
.print-table tbody tr:nth-child(even) { background: #fafcfe; }
.print-table .num { font-weight: 700; white-space: nowrap; }
.print-table tfoot td { font-weight: 700; border-top: 2px solid var(--navy); background: var(--soft); }

.print-rows { margin: 10px 0; }
.print-row { display: flex; justify-content: space-between; gap: 14px; padding: 6px 2px; border-bottom: 1px dashed var(--line); font-size: .9rem; }
.print-row b { color: var(--navy); }
.print-total-box {
    margin-top: 14px;
    background: var(--soft);
    border: 1.5px solid var(--navy);
    border-radius: 9px;
    padding: 12px 16px;
    max-width: 320px;
    margin-inline-start: auto;
}
.print-total-line { display: flex; justify-content: space-between; padding: 3px 0; font-size: .92rem; }
.print-total-line.grand { font-size: 1.08rem; font-weight: 700; border-top: 1.5px solid var(--navy); margin-top: 6px; padding-top: 8px; color: var(--navy); }

.print-notes { background: #fffdf3; border: 1px solid #eee3b8; border-radius: 8px; padding: 10px 14px; font-size: .86rem; margin-top: 14px; }
.print-badges { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0; }
.print-badge { background: var(--soft); border: 1px solid var(--line); border-radius: 99px; font-size: .78rem; font-weight: 700; padding: 3px 14px; }

.print-doc-foot { margin-top: 34px; }
.print-signs { display: flex; justify-content: space-between; gap: 40px; margin-bottom: 26px; }
.print-sign { text-align: center; width: 220px; font-size: .84rem; color: #5b6b7c; }
.print-sign-line { border-bottom: 1.5px solid #9fb0c0; height: 42px; margin-bottom: 6px; }
.print-generated { text-align: center; font-size: .74rem; color: #8ba1b8; border-top: 1px solid var(--line); padding-top: 10px; }

/* التقرير المطبوع من لوحة الإدارة */
.report-print { max-width: 1000px; margin: 0 auto 30px; background: #fff; padding: 30px 34px; box-shadow: 0 4px 22px rgba(12,31,51,.12); border-radius: 4px; }
.report-print-head { border-bottom: 3px solid var(--navy); padding-bottom: 14px; margin-bottom: 18px; display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.report-filters-note { font-size: .82rem; color: #5b6b7c; margin-bottom: 12px; }

/* شريط «ديمو» في بيئة الديمو (شاشة فقط — لا يُطبع) */
.print-body.demo-mode .demo-bar {
    position: sticky;
    top: 0;
    z-index: 1000;
    height: 44px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 16px;
    background: repeating-linear-gradient(135deg, #b97a00, #b97a00 14px, #a86f00 14px, #a86f00 28px);
    color: #fff;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(0,0,0,.25);
}
.print-body.demo-mode .demo-bar-tag {
    background: #fff;
    color: #a86f00;
    border-radius: 8px;
    padding: 1px 14px;
    font-size: 1.05rem;
    box-shadow: inset 0 0 0 2px #a86f00;
}
.print-body.demo-mode .demo-bar-text { font-size: .88rem; font-weight: 600; opacity: .95; }

@media print {
    body.print-body { background: #fff; }
    .print-doc, .report-print { box-shadow: none; max-width: none; margin: 0; border-radius: 0; padding: 10px 0; }
    .no-print, .print-toolbar { display: none !important; }
    .print-table th { background: #eef2f6 !important; color: var(--navy) !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    @page { margin: 14mm 12mm; }
}
