/* Fonts */
@font-face {
    font-family: "Vazirmatn";
    src: url("../fonts/Vazirmatn-Regular.woff2") format("woff2");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Vazirmatn";
    src: url("../fonts/Vazirmatn-Medium.woff2") format("woff2");
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Vazirmatn";
    src: url("../fonts/Vazirmatn-Bold.woff2") format("woff2");
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

/* --- پایه و تایپوگرافی تمیز (اگر app.css داری، می‌تونی ساده‌ترش کنی) --- */
:root {
    --card-border: #e5e7eb;
    --muted: #6b7280;
    --bg: #fff;
    --bg-soft: #fafafa;
}

/* اعداد جدولی برای ترازبندی + تلاش برای فعال‌کردن ستایلیستیک‌ست‌ها */
.fa-num {
    font-variant-numeric: tabular-nums;
    /* اگر فونت ستایلیستیک‌ستِ اعداد فارسی داشته باشد، یکی از ss01/ss02/… را روشن کن */
    font-feature-settings: "ss01" 1, "ss02" 1;
}

/* چاپ هم همین را نگه دار */
@media print {
    .fa-num {
        font-feature-settings: "ss01" 1, "ss02" 1;
    }
}

html, body {
    background: #fff;
    color: #111827;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

.wrap {
    direction: rtl;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 8px 12px;
    position: relative;
}

/* دکمه پرینت: ثابت، بدون اثر روی لِی‌اوت */
.btn-print {
    position: fixed;
    left: 16px;
    top: 16px;
    z-index: 1000;
    border: 1px solid var(--card-border);
    background: var(--bg);
    padding: 8px 12px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
    box-shadow: 0 1px 8px rgba(0, 0, 0, .06);
}

.btn-print:active {
    transform: translateY(1px);
}

.page-title {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin: 8px 0 20px;
}

.page-title h2 {
    margin: 0;
    font-weight: 800;
}

.paycard {
    border: 1px solid var(--card-border);
    border-radius: 14px;
    padding: 14px;
    background: var(--bg);
    box-shadow: 0 2px 10px rgba(0, 0, 0, .03);
}

.section-title {
    font-weight: 800;
    font-size: 18px;
    margin-bottom: 10px;
}

/* خطوط کلید/مقدار مشخصات */
.kv {
    display: flex;
    gap: 8px;
    align-items: center;
}

.kv .k {
    color: var(--muted);
    min-width: 110px;
    text-align: right;
}

.kv .v {
    font-weight: 600;
}

/* گرید سه‌ستونه ریسپانسیو برای نمایش */
.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

@media (max-width: 1199px) {
    .grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 767px) {
    .grid-3 {
        grid-template-columns: 1fr;
    }
}

/* جدول‌ها */
.tbl {
    width: 100%;
    border-collapse: collapse;
}

.tbl th, .tbl td {
    border-bottom: 1px dashed var(--card-border);
    padding: 9px 10px;
    text-align: right;
}

.tbl th {
    color: var(--muted);
    font-weight: 600;
    background: #fcfcfc;
}

.tbl td {
    font-variant-numeric: tabular-nums;
}

/* باج‌های جمع‌بندی پایین */
.summary {
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 12px 14px;
    text-align: center;
    background: var(--bg-soft);
    box-shadow: 0 1px 6px rgba(0, 0, 0, .02);
}

.summary .label {
    color: var(--muted);
    font-size: 12px;
    margin-bottom: 4px;
}

.summary .value {
    font-size: 20px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

/* --- قوانین چاپ: حفظ ۳ ستون در هر شرایطی + اندازه صفحه --- */
@media print {
    @page {
        size: A4 landscape;
        margin: 10mm;
    }

    /* برای PDF سه‌ستونه تمیز */
    body {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .btn-print {
        display: none !important;
    }

    .wrap {
        max-width: 1200px !important;
        padding: 0;
    }

    .grid-3 {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 14px !important;
    }

    .paycard, .summary, .tbl, .tbl tr {
        break-inside: avoid;
        page-break-inside: avoid;
    }
}

/* Base */
:root {
    --card-border: #e5e7eb;
    --muted: #6b7280;
    --bg: #fff;
    --bg-soft: #fafafa;
}

html {
    font-family: "Vazirmatn", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

body {
    background: #fff;
    color: #111827;
}

/* Helpers */
.container-rtl {
    direction: rtl;
    max-width: 1200px;
    margin: 0 auto;
    padding: 8px 12px;
}

/* Print button */
.btn-print {
    position: sticky;
    top: 12px;
    left: 12px;
    float: left;
    border: 1px solid var(--card-border);
    background: var(--bg);
    padding: 8px 12px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
}

.btn-print:active {
    transform: translateY(1px);
}

/* Cards & sections */
.paycard {
    border: 1px solid var(--card-border);
    border-radius: 14px;
    padding: 14px;
    background: var(--bg);
    box-shadow: 0 2px 10px rgba(0, 0, 0, .03);
}

.section-title {
    font-weight: 800;
    font-size: 18px;
    margin-bottom: 10px;
}

/* KV lines */
.kv {
    display: flex;
    gap: 8px;
    align-items: center;
}

.kv .k {
    color: var(--muted);
    min-width: 110px;
    text-align: right;
}

.kv .v {
    font-weight: 600;
}

/* Grid layout (3/2/1 columns) */
.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

@media (max-width: 1199px) {
    .grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 767px) {
    .grid-3 {
        grid-template-columns: 1fr;
    }
}

/* Table (clean, right-aligned) */
.tbl {
    width: 100%;
    border-collapse: collapse;
}

.tbl th, .tbl td {
    border-bottom: 1px dashed var(--card-border);
    padding: 9px 10px;
    text-align: right; /* عنوان و مقدار هر دو راست‌چین */
}

.tbl th {
    color: var(--muted);
    font-weight: 600;
    background: #fcfcfc;
}

.tbl td {
    font-variant-numeric: tabular-nums;
}

@font-face {
    font-family: "Vazirmatn";
    src: url("../fonts/Vazirmatn-Regular.woff2") format("woff2");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}


@font-face {
    font-family: "Vazirmatn";
    src: url("../fonts/Vazirmatn-Medium.woff2") format("woff2");
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Vazirmatn";
    src: url("../fonts/Vazirmatn-Bold.woff2") format("woff2");
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

- /* Vazir font-face */
-
@font-face {
... Vazir-Medium ...
}

-
@font-face {
... Vazir-Bold ...
}


html, body {
    font-family: "Vazirmatn", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

@media print {
    html, body {
        font-family: "Vazirmatn", Arial, sans-serif;
    }
}

/* Summary badges */
.summary {
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 12px 14px;
    text-align: center;
    background: var(--bg-soft);
    box-shadow: 0 1px 6px rgba(0, 0, 0, .02);
}

.summary .label {
    color: var(--muted);
    font-size: 12px;
    margin-bottom: 4px;
}

.summary .value {
    font-size: 20px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

/* Print */
@media print {
    .btn-print {
        display: none !important;
    }

    .container-rtl {
        max-width: none;
        padding: 0;
    }

    .paycard, .summary {
        break-inside: avoid;
        page-break-inside: avoid;
    }

    .grid-3 {
        grid-template-columns: 1fr 1fr;
    }

    /* در چاپ: ۲ ستونه شیک‌تر */
}
