/* =====================================================
   صفحه‌های سندی (صورتحساب و لیست قیمت) - روی invoice.css
===================================================== */

.doc-toolbar {
    flex-wrap: wrap;
    align-items: center;
}

.doc-toolbar a.invoice-back-btn {
    text-decoration: none;
    display: inline-flex;
    align-items: center;
}

.doc-period {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 700;
    color: #374151;
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    padding: 4px 10px;
}

.doc-period select {
    border: 0;
    font-family: inherit;
    font-size: 13px;
    background: transparent;
    outline: 0;
}

.doc-check {
    cursor: pointer;
    padding: 8px 12px;
}

.doc-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.doc-summary > div {
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 8px 12px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    background: #fafafa;
}

.doc-summary span {
    font-size: 11.5px;
    color: #6b7280;
}

.doc-summary b {
    font-size: 15px;
    color: #172018;
}

.doc-summary .is-due b {
    color: #c2410c;
}

.doc-summary .is-ok b {
    color: #15803d;
}

.invoice-items tfoot th {
    background: #f8fafc;
    font-weight: 800;
    border: 1px solid #e5e7eb;
    padding: 8px 6px;
}

.invoice-items tr.is-cancelled td {
    color: #9ca3af;
}

.invoice-items td.is-due {
    color: #c2410c;
    font-weight: 700;
}

.invoice-items td.is-credit {
    color: #15803d;
    font-weight: 700;
}

.invoice-items td.is-debit {
    color: #b91c1c;
    font-weight: 700;
}

.doc-note {
    font-size: 11.5px;
    color: #6b7280;
    margin-top: 12px;
    line-height: 1.9;
}

.price-group-title th {
    background: #16a34a !important;
    color: #fff !important;
    text-align: right !important;
    font-size: 13px;
    padding: 7px 10px !important;
}

.price-table td strong {
    display: block;
}

.price-table tr {
    page-break-inside: avoid;
    break-inside: avoid;
}

/* هنگام ساخت PDF، کادر و سایه حذف می‌شه */
body.pdf-exporting .invoice {
    box-shadow: none;
    border-radius: 0;
}

@media (max-width: 640px) {

    .doc-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media print {

    .doc-toolbar {
        display: none !important;
    }

    .price-group-title th,
    .doc-summary > div {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}
