﻿@import url('https://cdn.jsdelivr.net/gh/rastikerdar/vazirmatn@v33.003/Vazirmatn-font-face.css');

/* 1. تنظیمات عمومی */
* {
    font-family: 'Vazirmatn', sans-serif !important;
}

body {
    background-color: #f5f5f5;
}

/* 2. دیالوگ */
.mud-dialog-title {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    direction: rtl !important;
    padding: 16px 24px !important;
}

    .mud-dialog-title .mud-typography {
        order: 1;
        margin: 0 !important;
        text-align: right !important;
        flex-grow: 1;
    }

    .mud-dialog-title .mud-button-close {
        order: 2;
        margin-right: auto !important;
        margin-left: -12px !important;
        position: static !important;
    }

/* ============================================================
   3. ایجاد شکاف واقعی روی Border (روش Legend)
   ============================================================ */

/* گام اول: هل دادن شکاف (Legend) به سمت راست */
.mud-input-control .mud-input-outlined-border {
    text-align: right !important; /* این دستور شکاف را به راست می‌برد */
}

    /* گام دوم: نمایان کردن شکاف */
    .mud-input-control .mud-input-outlined-border legend {
        display: block !important; /* شکاف را برگرداندیم */
        float: none !important;
        margin-left: auto !important; /* چسبیدن به راست */
        margin-right: 0 !important; /* شروع از لبه راست */
        width: auto !important;
        max-width: 1000px !important; /* اجازه به گسترش */
        padding: 0 !important;
        font-size: 0.75em !important; /* سایز متناسب با لیبل */
        visibility: hidden !important; /* خود متن legend دیده نشود، اما جایش بماند */
    }

/* گام سوم: تنظیم لیبل دقیقا روی شکاف */
.mud-input-label {
    /* حالت عادی */
    left: auto !important;
    right: 14px !important;
    transform-origin: top right !important;
    text-align: right !important;
    direction: rtl !important;
    z-index: 5;
    pointer-events: none;
}

    /* تنظیمات لیبل وقتی بالا می‌رود (درون شکاف قرار گیرد) */
    .mud-input-label.mud-input-label-shrink {
        top: 0 !important;
        right: 12px !important;
        left: auto !important;
        transform: translate(0, -50%) scale(0.75) !important;
        /* حذف پس‌زمینه سفید (چون الان شکاف واقعی داریم) */
        background-color: transparent !important;
        box-shadow: none !important;
        /* هماهنگی با شکاف */
        padding: 0 4px !important;
        z-index: 10 !important;
        width: auto !important;
    }

/* ============================================================
   4. سایر تنظیمات
   ============================================================ */
.mud-input-slot {
    text-align: right !important;
    direction: rtl !important;
    padding-right: 14px !important;
}

.mud-input-adornment-start {
    margin-left: 8px !important;
    margin-right: 0 !important;
}

.mud-table-cell {
    text-align: right !important;
    direction: rtl !important;
}

.mud-table-head .column-header {
    display: flex;
    justify-content: flex-start !important;
}

.mud-table-pagination-display {
    direction: ltr !important;
}



/* تنظیمات چاپ فاکتور */
@media print {
    /* مخفی کردن منو، هدر و دکمه‌های عملیاتی هنگام چاپ */
    .mud-layout .mud-appbar,
    .mud-layout .mud-drawer,
    .no-print,
    .mud-button,
    .mud-icon-button {
        display: none !important;
    }

    /* باز کردن فضای اصلی */
    .mud-main-content {
        padding: 0 !important;
        margin: 0 !important;
        height: auto !important;
    }

    /* تنظیمات بدنه فاکتور */
    body, .mud-layout {
        background-color: white !important;
    }

    .invoice-container {
        border: none !important;
        box-shadow: none !important;
        width: 100% !important;
        max-width: 100% !important;
    }
}

.invoice-header {
    border-bottom: 2px solid #000;
    margin-bottom: 20px;
    padding-bottom: 10px;
}