/* ═══════════════════════════════════════════
   EazyGo — صفحة الفواتير (تصميم محسّن)
   ═══════════════════════════════════════════ */

.settings-panel--invoices {
    padding-top: 4px;
}

.settings-panel--invoices.active {
    animation: egInvFadeIn 0.35s ease;
}

@keyframes egInvFadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.dash-invoices-page {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* —— Hero —— */
.dash-page-hero--invoices {
    background: linear-gradient(135deg, #ecfeff 0%, #eef2ff 48%, #f0fdf4 100%);
    border-color: #a5f3fc;
    box-shadow: 0 8px 32px rgba(14, 165, 233, 0.08);
    position: relative;
    overflow: hidden;
}

.dash-page-hero--invoices::before {
    content: '';
    position: absolute;
    top: -40%;
    left: -10%;
    width: 220px;
    height: 220px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.12) 0%, transparent 70%);
    pointer-events: none;
}

.dash-page-hero--invoices::after {
    content: '';
    position: absolute;
    bottom: -30%;
    right: -5%;
    width: 180px;
    height: 180px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(14, 165, 233, 0.1) 0%, transparent 70%);
    pointer-events: none;
}

.dash-page-hero--invoices .dash-page-hero__icon {
    background: linear-gradient(135deg, #0ea5e9 0%, #6366f1 100%);
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.35);
    position: relative;
    z-index: 1;
}

.dash-page-hero--invoices .dash-page-hero__text {
    position: relative;
    z-index: 1;
}

.dash-page-hero--invoices h3 {
    margin: 0 0 4px;
    font-size: 1.15rem;
    font-weight: 800;
    color: #0f172a;
}

.dash-page-hero--invoices p {
    margin: 0;
    font-size: 0.82rem;
    color: #64748b;
    line-height: 1.55;
    max-width: 520px;
}

.eg-inv-hero-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.eg-inv-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 11px;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    border: 1px solid transparent;
}

.eg-inv-badge--zatca {
    background: rgba(99, 102, 241, 0.12);
    color: #4338ca;
    border-color: rgba(99, 102, 241, 0.2);
}

.eg-inv-badge--vat {
    background: rgba(16, 185, 129, 0.12);
    color: #047857;
    border-color: rgba(16, 185, 129, 0.2);
}

.eg-inv-badge--print {
    background: rgba(14, 165, 233, 0.12);
    color: #0369a1;
    border-color: rgba(14, 165, 233, 0.2);
}

/* —— Stats —— */
.eg-inv-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}

.eg-inv-stat {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 18px;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    background: #fff;
    box-shadow: 0 2px 12px rgba(15, 23, 42, 0.04);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.eg-inv-stat:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}

.eg-inv-stat__icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
    color: #fff;
    flex-shrink: 0;
}

.eg-inv-stat--count .eg-inv-stat__icon {
    background: linear-gradient(135deg, #6366f1, #818cf8);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.eg-inv-stat--revenue .eg-inv-stat__icon {
    background: linear-gradient(135deg, #0ea5e9, #38bdf8);
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.3);
}

.eg-inv-stat--vat .eg-inv-stat__icon {
    background: linear-gradient(135deg, #f59e0b, #fbbf24);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.eg-inv-stat--ok .eg-inv-stat__icon {
    background: linear-gradient(135deg, #10b981, #34d399);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.eg-inv-stat__body {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.eg-inv-stat__value {
    font-size: 1.05rem;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.eg-inv-stat__label {
    font-size: 0.72rem;
    font-weight: 600;
    color: #94a3b8;
}

/* —— Layout —— */
.eg-inv-layout {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.eg-inv-seller-card,
.eg-inv-list-card {
    border-radius: 18px;
    border: 1px solid #e2e8f0;
    background: #fff;
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.04);
    overflow: hidden;
}

.eg-inv-seller-card {
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

.eg-inv-card-head {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 18px 20px 0;
}

.eg-inv-card-head__icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: #fff;
    background: linear-gradient(135deg, #0284c7, #0ea5e9);
    box-shadow: 0 4px 12px rgba(2, 132, 199, 0.28);
    flex-shrink: 0;
}

.eg-inv-card-head__icon--list {
    background: linear-gradient(135deg, #6366f1, #818cf8);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.28);
}

.eg-inv-card-head h4 {
    margin: 0 0 4px;
    font-size: 0.98rem;
    font-weight: 800;
    color: #1e293b;
}

.eg-inv-card-head p {
    margin: 0;
    font-size: 0.76rem;
    color: #94a3b8;
    line-height: 1.5;
}

.eg-inv-list-head-text {
    flex: 1;
    min-width: 0;
}

/* —— Seller form —— */
.eg-inv-seller-form {
    padding: 16px 20px 20px;
}

.eg-inv-seller-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 14px;
    margin-bottom: 16px;
}

.eg-inv-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.eg-inv-field--wide {
    grid-column: 1 / -1;
}

.eg-inv-field--highlight .eg-inv-input {
    border-color: #a5b4fc;
    background: linear-gradient(180deg, #faf5ff 0%, #fff 100%);
}

.eg-inv-field--highlight .eg-inv-input:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.eg-inv-field__label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.74rem;
    font-weight: 700;
    color: #64748b;
}

.eg-inv-field__label i {
    width: 14px;
    text-align: center;
    color: #94a3b8;
    font-size: 0.7rem;
}

.eg-inv-input {
    width: 100%;
    padding: 10px 13px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    font-size: 0.86rem;
    font-family: inherit;
    color: #0f172a;
    background: #fff;
    transition: border-color 0.15s, box-shadow 0.15s;
    box-sizing: border-box;
}

.eg-inv-input:focus {
    outline: none;
    border-color: #0ea5e9;
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.12);
}

.eg-inv-input::placeholder {
    color: #cbd5e1;
}

.eg-inv-form-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-top: 4px;
    border-top: 1px dashed #e2e8f0;
}

.eg-inv-form-meta {
    font-size: 0.72rem;
    color: #94a3b8;
    display: flex;
    align-items: center;
    gap: 6px;
}

.eg-inv-save-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: 10px;
    font-size: 0.84rem;
    font-weight: 700;
    font-family: inherit;
    color: #fff;
    cursor: pointer;
    background: linear-gradient(135deg, #0ea5e9 0%, #6366f1 100%);
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
    transition: transform 0.15s, box-shadow 0.15s;
}

.eg-inv-save-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.45);
}

.eg-inv-save-btn:active {
    transform: translateY(0);
}

/* —— Search —— */
.eg-inv-list-card .eg-inv-card-head {
    flex-wrap: wrap;
    padding-bottom: 4px;
}

.eg-inv-search {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    min-width: 220px;
    flex: 1;
    max-width: 320px;
    margin-right: auto;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.eg-inv-search:focus-within {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
    background: #fff;
}

.eg-inv-search i {
    color: #94a3b8;
    font-size: 0.8rem;
}

.eg-inv-search input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 0.82rem;
    font-family: inherit;
    color: #0f172a;
    outline: none;
    min-width: 0;
}

.eg-inv-search input::placeholder {
    color: #cbd5e1;
}

/* —— Table —— */
.eg-inv-table-wrap {
    margin: 8px 12px 14px;
    border-radius: 14px;
    border: 1px solid #e2e8f0;
    overflow: auto;
    background: #fafbfc;
}

.eg-inv-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
}

.eg-inv-table thead {
    background: linear-gradient(180deg, #f1f5f9 0%, #e8edf3 100%);
}

.eg-inv-table th {
    padding: 12px 14px;
    text-align: right;
    font-size: 0.72rem;
    font-weight: 800;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    white-space: nowrap;
    border-bottom: 1px solid #e2e8f0;
}

.eg-inv-table td {
    padding: 12px 14px;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
    background: #fff;
}

.eg-inv-row {
    transition: background 0.12s;
}

.eg-inv-row:hover td {
    background: #f0f9ff;
}

.eg-inv-row:last-child td {
    border-bottom: none;
}

.eg-inv-num {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 8px;
    font-family: ui-monospace, 'Cairo', monospace;
    font-size: 0.75rem;
    font-weight: 700;
    color: #4338ca;
    background: #eef2ff;
    border: 1px solid #c7d2fe;
    direction: ltr;
}

.eg-inv-date {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    color: #64748b;
    white-space: nowrap;
}

.eg-inv-date i {
    color: #94a3b8;
    font-size: 0.7rem;
}

.eg-inv-customer {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: #1e293b;
}

.eg-inv-avatar {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    font-weight: 800;
    color: #fff;
    background: linear-gradient(135deg, #6366f1, #818cf8);
    flex-shrink: 0;
}

.eg-inv-route {
    font-size: 0.78rem;
    color: #475569;
    max-width: 180px;
    display: inline-block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.eg-inv-amount {
    font-weight: 800;
    font-size: 0.88rem;
    color: #047857;
    white-space: nowrap;
}

.eg-inv-actions {
    text-align: center;
}

.eg-inv-view-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border: none;
    border-radius: 9px;
    font-size: 0.76rem;
    font-weight: 700;
    font-family: inherit;
    color: #fff;
    cursor: pointer;
    background: linear-gradient(135deg, #6366f1, #818cf8);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
    transition: transform 0.15s, box-shadow 0.15s;
}

.eg-inv-view-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.4);
}

.eg-inv-view-btn i {
    font-size: 0.82rem;
}

/* —— Empty state —— */
.eg-inv-empty-state {
    text-align: center;
    padding: 48px 24px 56px;
}

.eg-inv-empty-state__icon {
    width: 72px;
    height: 72px;
    margin: 0 auto 16px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    color: #6366f1;
    background: linear-gradient(135deg, #eef2ff 0%, #ecfeff 100%);
    border: 1px dashed #c7d2fe;
}

.eg-inv-empty-state h5 {
    margin: 0 0 8px;
    font-size: 1rem;
    font-weight: 800;
    color: #334155;
}

.eg-inv-empty-state p {
    margin: 0 auto;
    max-width: 320px;
    font-size: 0.82rem;
    color: #94a3b8;
    line-height: 1.6;
}

/* ═══════════════════════════════════════════
   Modal — معاينة الفاتورة (A4)
   ═══════════════════════════════════════════ */

.eg-inv-modal {
    position: fixed;
    inset: 0;
    z-index: 10050;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 12px;
}

.eg-inv-modal--visible .eg-inv-modal__backdrop { opacity: 1; }
.eg-inv-modal--visible .eg-inv-modal__box { opacity: 1; transform: scale(1) translateY(0); }

.eg-inv-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.78);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    opacity: 0;
    transition: opacity 0.25s ease;
}

.eg-inv-modal__box {
    position: relative;
    width: min(720px, 100%);
    max-height: 96vh;
    display: flex;
    flex-direction: column;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 32px 64px rgba(0, 0, 0, 0.35);
    opacity: 0;
    transform: scale(0.96) translateY(10px);
    transition: opacity 0.28s ease, transform 0.28s ease;
}

.eg-inv-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 18px;
    background: #0f172a;
    color: #fff;
    flex-shrink: 0;
}

.eg-inv-modal__title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.92rem;
    font-weight: 800;
}

.eg-inv-modal__title i { color: #38bdf8; }

.eg-inv-modal__subtitle {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.6);
    margin-top: 3px;
}

.eg-inv-modal__pdf-name {
    font-size: 0.68rem;
    color: rgba(255, 255, 255, 0.55);
    margin-top: 4px;
    direction: ltr;
    text-align: right;
    unicode-bidi: plaintext;
}

.eg-inv-modal__toolbar { display: flex; gap: 8px; }

.eg-inv-modal-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 14px;
    border: none;
    border-radius: 8px;
    font-size: 0.78rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: transform 0.15s, background 0.15s;
}

.eg-inv-modal-btn--ghost {
    width: 36px;
    height: 36px;
    padding: 0;
    background: rgba(255, 255, 255, 0.1);
    color: #e2e8f0;
}

.eg-inv-modal-btn--ghost:hover { background: rgba(255, 255, 255, 0.18); color: #fff; }

.eg-inv-modal-btn--outline {
    background: #fff;
    color: #0f172a;
}

.eg-inv-modal-btn--outline:hover { transform: translateY(-1px); }

.eg-inv-modal__stage {
    flex: 1;
    overflow: auto;
    padding: 16px;
    background: #94a3b8;
    background: linear-gradient(160deg, #64748b 0%, #475569 100%);
}

.eg-inv-modal__body {
    display: flex;
    justify-content: center;
}

/* ═══════════════════════════════════════════
   ورقة الفاتورة — A4 واحدة
   ═══════════════════════════════════════════ */

.eg-inv-sheet {
    width: 100%;
    max-width: 680px;
    direction: rtl;
}

.eg-inv-sheet__page {
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    font-family: 'Segoe UI', Tahoma, 'Cairo', Arial, sans-serif;
    font-size: 11px;
    line-height: 1.45;
    color: #0f172a;
    page-break-inside: avoid;
    break-inside: avoid;
}

.eg-inv-sheet__top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 22px 14px;
    background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 100%);
    color: #fff;
    border-bottom: 4px solid #0ea5e9;
}

.eg-inv-sheet__brand-block {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    min-width: 0;
}

.eg-inv-sheet__logo {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 900;
    color: #0f172a;
    background: linear-gradient(135deg, #38bdf8, #818cf8);
    flex-shrink: 0;
}

.eg-inv-sheet__brand {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 900;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.eg-inv-sheet__brand-sub {
    margin: 2px 0 6px;
    font-size: 0.68rem;
    color: rgba(255, 255, 255, 0.65);
    font-weight: 600;
}

.eg-inv-sheet__seller-lines {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.75);
    line-height: 1.4;
}

.eg-inv-sheet__title-block {
    text-align: left;
    flex-shrink: 0;
}

.eg-inv-sheet__doc-type {
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 0.72rem;
    font-weight: 800;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    white-space: nowrap;
}

.eg-inv-sheet__doc-sub {
    margin: 4px 0 0;
    font-size: 0.6rem;
    color: rgba(255, 255, 255, 0.5);
    text-align: center;
}

.eg-inv-sheet__meta {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.eg-inv-sheet__meta-item {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 10px 14px;
    text-align: center;
    border-left: 1px solid #e2e8f0;
}

.eg-inv-sheet__meta-item:last-child { border-left: none; }

.eg-inv-sheet__meta-item span {
    font-size: 0.62rem;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.eg-inv-sheet__meta-item strong {
    font-size: 0.78rem;
    font-weight: 800;
    color: #0f172a;
    word-break: break-all;
}

.eg-inv-sheet__grid {
    display: grid;
    gap: 0;
}

.eg-inv-sheet__grid--2 {
    grid-template-columns: 1fr 1fr;
    border-bottom: 1px solid #e2e8f0;
}

.eg-inv-sheet__grid--bottom {
    grid-template-columns: 1.2fr 0.8fr;
}

.eg-inv-sheet__card {
    padding: 12px 16px 14px;
    border-left: 1px solid #e2e8f0;
}

.eg-inv-sheet__grid--2 .eg-inv-sheet__card:last-child,
.eg-inv-sheet__grid--bottom .eg-inv-sheet__card:last-child {
    border-left: none;
}

.eg-inv-sheet__card-title {
    margin: 0 0 8px;
    font-size: 0.72rem;
    font-weight: 800;
    color: #475569;
    display: flex;
    align-items: center;
    gap: 6px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.eg-inv-sheet__card-title i {
    color: #6366f1;
    font-size: 0.7rem;
}

.eg-inv-sheet__table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.72rem;
}

.eg-inv-sheet__table th,
.eg-inv-sheet__table td {
    padding: 5px 0;
    vertical-align: top;
    text-align: right;
}

.eg-inv-sheet__table th {
    width: 42%;
    font-weight: 600;
    color: #64748b;
    padding-left: 8px;
}

.eg-inv-sheet__table td {
    font-weight: 700;
    color: #1e293b;
    word-break: break-word;
}

.eg-inv-sheet__table--amounts th { width: 55%; }

.eg-inv-sheet__table .eg-inv-sheet__grand th,
.eg-inv-sheet__table .eg-inv-sheet__grand td {
    padding-top: 8px;
    font-size: 0.82rem;
    font-weight: 800;
    color: #047857;
    border-top: 2px solid #10b981;
}

.eg-inv-sheet__card--qr {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    text-align: center;
    background: #fafbfc;
}

.eg-inv-sheet__qr-box {
    padding: 8px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    line-height: 0;
}

.eg-inv-sheet__qr-box .eg-inv-receipt__qr img,
.eg-inv-sheet__qr-box .eg-inv-receipt__qr canvas {
    display: block;
    width: 115px;
    height: 115px;
}

.eg-inv-sheet__qr-note {
    margin: 8px 0 0;
    font-size: 0.62rem;
    color: #64748b;
    font-weight: 600;
    line-height: 1.4;
}

.eg-inv-sheet__foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 18px;
    background: #f1f5f9;
    border-top: 1px solid #e2e8f0;
    font-size: 0.68rem;
    color: #64748b;
}

.eg-inv-sheet__foot strong { color: #0f172a; }

.eg-inv-sheet__foot-note {
    font-size: 0.6rem;
    color: #94a3b8;
}

.eg-inv-qr-fallback {
    font-size: 10px;
    color: #b45309;
    padding: 8px;
}

body.eg-inv-modal-open { overflow: hidden; }

.eg-inv-field--readonly .eg-inv-input {
    background: #f1f5f9;
    color: #64748b;
    cursor: not-allowed;
    font-weight: 800;
}

/* —— زر الفاتورة في تتبع طلباتي —— */
#customer-order-tracking .table-invoice-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    padding: 0 8px;
    border: 1px solid #c7d2fe;
    border-radius: 8px;
    background: linear-gradient(180deg, #eef2ff 0%, #e0e7ff 100%);
    color: #4338ca;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s, background 0.15s;
    flex-shrink: 0;
}

#customer-order-tracking .table-invoice-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(99, 102, 241, 0.25);
    background: linear-gradient(180deg, #e0e7ff 0%, #c7d2fe 100%);
    color: #312e81;
}

#customer-order-tracking .table-invoice-btn i {
    font-size: 0.88rem;
}

#customer-order-tracking .tracking-actions-cell .action-buttons--with-chat {
    flex-wrap: wrap;
    gap: 6px;
}

/* —— Responsive —— */
@media (max-width: 768px) {
    .eg-inv-stats {
        grid-template-columns: 1fr;
    }

    .eg-inv-stat__value {
        font-size: 0.95rem;
    }

    .eg-inv-list-card .eg-inv-card-head {
        flex-direction: column;
    }

    .eg-inv-search {
        max-width: none;
        width: 100%;
    }

    .eg-inv-table-wrap {
        margin: 8px 8px 12px;
    }

    .eg-inv-view-btn span {
        display: none;
    }

    .eg-inv-view-btn {
        padding: 8px 10px;
    }

    .eg-inv-route {
        max-width: 100px;
    }

    .eg-inv-form-footer {
        flex-direction: column;
        align-items: stretch;
    }

    .eg-inv-save-btn {
        justify-content: center;
    }

    .eg-inv-modal {
        padding: 8px;
    }

    .eg-inv-modal__box {
        max-height: 96vh;
        border-radius: 16px;
    }

    .eg-inv-modal__header {
        flex-wrap: wrap;
        padding: 14px;
    }

    .eg-inv-modal-btn--outline span,
    .eg-inv-modal-btn--outline {
        font-size: 0.72rem;
        padding: 8px 12px;
    }

    .eg-inv-modal__stage {
        padding: 12px 8px;
    }

    .eg-inv-sheet {
        max-width: 100%;
    }

    .eg-inv-sheet__grid--2,
    .eg-inv-sheet__grid--bottom {
        grid-template-columns: 1fr;
    }

    .eg-inv-sheet__card {
        border-left: none;
        border-bottom: 1px solid #e2e8f0;
    }

    .eg-inv-sheet__meta {
        grid-template-columns: 1fr;
    }

    .eg-inv-sheet__meta-item {
        border-left: none;
        border-bottom: 1px solid #e2e8f0;
        flex-direction: row;
        justify-content: space-between;
        text-align: right;
    }

    .eg-inv-sheet__top {
        flex-direction: column;
        align-items: stretch;
    }

    .eg-inv-sheet__title-block {
        text-align: right;
    }
}

@media (max-width: 520px) {
    .eg-inv-hero-badges {
        display: none;
    }

    .dash-page-hero--invoices h3 {
        font-size: 1rem;
    }

    .eg-inv-modal__subtitle {
        display: none;
    }
}

/* ═══════════════════════════════════════════
   الطباعة — ورقة A4 واحدة فقط
   ═══════════════════════════════════════════ */

@page {
    size: A4 portrait;
    margin: 6mm;
}

@media print {
    html,
    body {
        width: auto !important;
        height: auto !important;
        min-height: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        background: #fff !important;
        overflow: hidden !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    body.eg-inv-printing > *:not(#egInvoiceReceiptPrint) {
        display: none !important;
    }

    #egInvoiceReceiptPrint {
        display: block !important;
        position: static !important;
        width: 100% !important;
        max-width: none !important;
        margin: 0 !important;
        padding: 0 !important;
        box-shadow: none !important;
        page-break-before: avoid !important;
        page-break-after: avoid !important;
        break-before: avoid !important;
        break-after: avoid !important;
    }

    #egInvoiceReceiptPrint .eg-inv-sheet {
        max-width: none !important;
        width: 100% !important;
    }

    #egInvoiceReceiptPrint .eg-inv-sheet__page {
        box-shadow: none !important;
        border-radius: 0 !important;
        font-size: 9pt !important;
        line-height: 1.35 !important;
        page-break-inside: avoid !important;
        break-inside: avoid !important;
    }

    #egInvoiceReceiptPrint .eg-inv-sheet__top {
        padding: 10px 14px 8px !important;
        background: #0f172a !important;
        color: #fff !important;
        border-bottom-width: 3px !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    #egInvoiceReceiptPrint .eg-inv-sheet__logo {
        width: 34px !important;
        height: 34px !important;
        font-size: 0.65rem !important;
    }

    #egInvoiceReceiptPrint .eg-inv-sheet__brand {
        font-size: 14pt !important;
    }

    #egInvoiceReceiptPrint .eg-inv-sheet__brand-sub {
        margin-bottom: 3px !important;
        font-size: 7pt !important;
    }

    #egInvoiceReceiptPrint .eg-inv-sheet__seller-lines {
        font-size: 7pt !important;
        gap: 1px !important;
    }

    #egInvoiceReceiptPrint .eg-inv-sheet__doc-type {
        padding: 4px 10px !important;
        font-size: 8pt !important;
    }

    #egInvoiceReceiptPrint .eg-inv-sheet__doc-sub {
        font-size: 7pt !important;
        margin-top: 2px !important;
    }

    #egInvoiceReceiptPrint .eg-inv-sheet__meta-item {
        padding: 6px 10px !important;
    }

    #egInvoiceReceiptPrint .eg-inv-sheet__meta-item span {
        font-size: 7pt !important;
    }

    #egInvoiceReceiptPrint .eg-inv-sheet__meta-item strong {
        font-size: 8.5pt !important;
    }

    #egInvoiceReceiptPrint .eg-inv-sheet__card {
        padding: 8px 12px 9px !important;
    }

    #egInvoiceReceiptPrint .eg-inv-sheet__card-title {
        margin-bottom: 5px !important;
        font-size: 7.5pt !important;
    }

    #egInvoiceReceiptPrint .eg-inv-sheet__table {
        font-size: 8pt !important;
    }

    #egInvoiceReceiptPrint .eg-inv-sheet__table th,
    #egInvoiceReceiptPrint .eg-inv-sheet__table td {
        padding: 2px 0 !important;
    }

    #egInvoiceReceiptPrint .eg-inv-sheet__table .eg-inv-sheet__grand th,
    #egInvoiceReceiptPrint .eg-inv-sheet__table .eg-inv-sheet__grand td {
        padding-top: 5px !important;
        font-size: 9pt !important;
    }

    #egInvoiceReceiptPrint .eg-inv-sheet__qr-box {
        padding: 4px !important;
    }

    #egInvoiceReceiptPrint .eg-inv-sheet__qr-box canvas,
    #egInvoiceReceiptPrint .eg-inv-sheet__qr-box img {
        width: 115px !important;
        height: 115px !important;
    }

    #egInvoiceReceiptPrint .eg-inv-sheet__qr-note {
        margin-top: 4px !important;
        font-size: 7pt !important;
    }

    #egInvoiceReceiptPrint .eg-inv-sheet__foot {
        padding: 6px 12px !important;
        font-size: 7.5pt !important;
    }

    #egInvoiceReceiptPrint .eg-inv-sheet__foot-note {
        font-size: 7pt !important;
    }
}
