/* =========================================================
   استایل‌های استخراج‌شده از صفحات Razor
   ========================================================= */

/* منبع: Components\Pages\Formulas\Create.razor */


    /* =========================================================
           صفحه
           ========================================================= */

    .formula-create-page {
        direction: rtl;
        padding: 18px 24px 35px;
        font-family: Tahoma, "Segoe UI", Arial, sans-serif;
        color: #202428;
   
    }


    /* =========================================================
           Header
           ========================================================= */

    .page-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 15px;
        margin-bottom: 14px;
        padding: 13px 17px;
        background: #fff;
        border: 1px solid #dee2e6;
        border-radius: 10px;
        box-shadow: 0 3px 12px rgba(0,0,0,.05);
    }


    .page-header-title {
        display: flex;
        align-items: center;
        gap: 11px;
    }


    .page-title-icon {
        width: 42px;
        height: 42px;
        display: flex;
        align-items: center;
        justify-content: center;
        background: var(--theme-primary);
        color: #fff;
        border-radius: 8px;
        font-size: 19px;
    }


    .page-header h3 {
        margin: 0;
        font-size: 19px;
        font-weight: 700;
    }


    .page-subtitle {
        margin-top: 3px;
        color: #777;
        font-size: 10px;
    }


    .formula-code-box {
        min-width: 145px;
        padding: 7px 14px;
        text-align: center;
        background: #f8f9fa;
        border: 1px solid #dee2e6;
        border-radius: 7px;
    }


        .formula-code-box span {
            display: block;
            color: #777;
            font-size: 9px;
            margin-bottom: 2px;
        }


        .formula-code-box strong {
            color: var(--theme-primary);
            font-size: 14px;
        }


    /* =========================================================
           Section
           ========================================================= */

    .section-card {
        margin-bottom: 14px;
        overflow: hidden;
        background: #fff;
        border: 1px solid #dee2e6;
        border-radius: 9px;
        box-shadow: 0 2px 9px rgba(0,0,0,.035);
    }


    .section-header {
        min-height: 42px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 7px 14px;
        color: #fff;
        font-size: 12px;
        font-weight: 700;
    }


        .section-header > div {
            display: flex;
            align-items: center;
            gap: 7px;
        }


    .section-header-primary {
        background: var(--theme-primary);
    }


    .section-header-secondary {
        background: #6c757d;
    }


    .section-header-dark {
        background: #212529;
    }


    .section-body {
        padding: 11px;
    }


    /* =========================================================
           سفارش
           ========================================================= */

    .order-grid {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 7px;
    }


    .order-item {
        min-height: 48px;
        padding: 7px 10px;
        background: #f8f9fa;
        border: 1px solid #e1e5e9;
        border-radius: 7px;
    }


        .order-item span {
            display: block;
            margin-bottom: 3px;
            color: #777;
            font-size: 9px;
        }


        .order-item strong {
            display: block;
            color: #222;
            font-size: 12px;
        }


    .status-text {
        color: var(--theme-primary) !important;
    }


    /* =========================================================
           اطلاعات فرمول
           ========================================================= */

    .formula-info-grid {
        display: grid;
        grid-template-columns: repeat(6, 1fr);
        gap: 9px;
    }


    /* شامل ورودی عدد + انتخاب واحد است، به همین دلیل دو
       ستون از گرید را می‌گیرد تا فشرده و به‌هم‌ریخته نمایش
       داده نشود. */
    .weight-field {
        grid-column: span 2;
    }


    .form-field {
        min-width: 0;
    }


        .form-field label {
            display: block;
            margin-bottom: 4px;
            color: #495057;
            font-size: 10px;
            font-weight: 700;
        }


    .compact-input {
        height: 34px !important;
        min-height: 34px !important;
        padding: 4px 8px !important;
        border-radius: 6px !important;
        font-size: 12px !important;
       
    }


    .form-field small {
        display: block;
        margin-top: 3px;
        color: #777;
        font-size: 8px;
    }


    .readonly-field {
        height: 34px;
        display: flex;
        align-items: center;
        padding: 4px 9px;
        background: #f8f9fa;
        border: 1px solid #dee2e6;
        border-radius: 6px;
        font-size: 12px;
        font-weight: 700;
    }


    .primary-field {
        color: var(--theme-primary);
        background: #eef5ff;
        border-color: #cfe2ff;
    }


    .description-field {
        grid-column: 1 / -1;
    }


        .description-field textarea {
            min-height: 58px;
            resize: vertical;
        }


    /* =========================================================
           جدول مواد
           ========================================================= */

    .materials-card {
        margin-top: 3px;
    }


    .add-material-btn {
        padding: 5px 9px;
        font-size: 10px;
    }


    .formula-table {
        width: 100%;
        margin: 0;
        border-collapse: separate;
        border-spacing: 0;
        overflow: hidden;
        border: 1px solid #dee2e6;
        border-radius: 7px;
        font-size: 11px;
    }


        .formula-table th,
        .formula-table td {
            padding: 6px 7px;
            border-bottom: 1px solid #e5e7eb;
            vertical-align: middle;
        }


        .formula-table thead th {
            background: #f1f3f5;
            color: #343a40;
            font-size: 10px;
            font-weight: 700;
            white-space: nowrap;
            text-align: center;
        }


        .formula-table tbody tr {
            transition: background .15s ease;
        }


            .formula-table tbody tr:hover td {
                background: #f8fbff;
            }


            .formula-table tbody tr:last-child td {
                border-bottom: 0;
            }


        .formula-table tfoot th {
            background: #e9ecef;
            border-bottom: 0;
            font-size: 11px;
        }


    .row-number {
        width: 55px;
    }


    .row-number-cell {
        color: #6c757d;
        font-weight: 700;
    }


    .percentage-column {
        width: 125px;
    }


    .weight-column {
        width: 145px;
    }


    .move-column {
        width: 100px;
    }


    .delete-column {
        width: 60px;
    }


    .percentage-input {
        text-align: center;
    }


    .percentage-readonly {
        justify-content: center;
        color: var(--theme-primary);
        background: #eef5ff;
        border-color: #cfe2ff;
    }


    .auto-label {
        display: block;
        margin-top: 2px;
        text-align: center;
        color: #888;
        font-size: 8px;
    }


    .base-label {
        margin-top: 3px;
        color: var(--theme-primary);
        font-size: 9px;
        font-weight: 700;
    }


        .base-label i {
            font-size: 8px;
        }


    .weight-value {
        color: #198754;
        font-size: 12px;
    }


    .weight-unit {
        margin-right: 3px;
        color: #777;
        font-size: 9px;
    }


    .move-buttons {
        display: flex;
        justify-content: center;
        gap: 3px;
    }


    .move-btn {
        width: 28px;
        height: 27px;
        padding: 0;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border: 1px solid #b7c9df;
        border-radius: 5px;
        background: #f4f8fd;
        color: var(--theme-primary);
        cursor: pointer;
    }


        .move-btn:hover:not(:disabled) {
            background: var(--theme-primary);
            color: #fff;
        }


        .move-btn:disabled {
            opacity: .35;
            cursor: not-allowed;
        }


    .delete-btn {
        width: 29px;
        height: 27px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        padding: 0;
        border: 0;
        border-radius: 5px;
        background: #fff0f1;
        color: #dc3545;
    }


        .delete-btn:hover {
            background: #dc3545;
            color: #fff;
        }


    .total-label {
        text-align: right !important;
    }


    /* =========================================================
           وضعیت درصد
           ========================================================= */

    .percentage-message {
        display: flex;
        align-items: center;
        gap: 8px;
        margin-top: 9px;
        padding: 7px 10px;
        border-radius: 6px;
        font-size: 10px;
    }


        .percentage-message i {
            font-size: 14px;
        }


    .percentage-success {
        background: #ecfdf3;
        border: 1px solid #b7e4c7;
        color: #146c43;
    }


    .percentage-danger {
        background: #fff1f2;
        border: 1px solid #f1aeb5;
        color: #b02a37;
    }


    /* =========================================================
           پیام ها
           ========================================================= */

    .message-box {
        display: flex;
        align-items: center;
        gap: 8px;
        margin-bottom: 10px;
        padding: 8px 11px;
        border-radius: 7px;
        font-size: 11px;
    }


    .message-error {
        background: #fff1f2;
        border: 1px solid #f1aeb5;
        color: #842029;
    }


    .message-success {
        background: #ecfdf3;
        border: 1px solid #a7e3bd;
        color: #146c43;
    }


    /* =========================================================
           دکمه های پایین
           ========================================================= */

    .bottom-actions {
        display: flex;
        align-items: center;
        gap: 7px;
        margin-top: 12px;
        padding-top: 12px;
        border-top: 1px solid #dee2e6;
    }


        .bottom-actions .btn {
            font-family: inherit;
            font-size: 11px;
            padding: 6px 12px;
        }


    .save-btn {
        min-width: 130px;
    }


    /* =========================================================
           Empty
           ========================================================= */

    .empty-materials {
        min-height: 90px;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        color: #777;
        font-size: 11px;
        background: #fafafa;
        border: 1px dashed #ced4da;
        border-radius: 7px;
    }


        .empty-materials i {
            color: #adb5bd;
            font-size: 22px;
        }


    /* =========================================================
           Loading
           ========================================================= */

    .loading-box {
        min-height: 450px;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
    }


    .loading-text {
        margin-top: 12px;
        color: #666;
        font-size: 12px;
    }


    /* =========================================================
           Error
           ========================================================= */

    .error-box {
        display: flex;
        align-items: center;
        gap: 10px;
        margin-top: 25px;
        padding: 14px;
        background: #fff1f2;
        border: 1px solid #f1aeb5;
        border-radius: 9px;
        color: #842029;
    }


        .error-box > i {
            font-size: 22px;
        }


        .error-box strong {
            display: block;
            margin-bottom: 3px;
            font-size: 12px;
        }


        .error-box span {
            display: block;
            font-size: 10px;
        }


    /* =========================================================
           Responsive
           ========================================================= */

    @media (max-width: 1200px) {

        .formula-info-grid {
            grid-template-columns: repeat(4, 1fr);
        }

        .order-grid {
            grid-template-columns: repeat(2, 1fr);
        }
    }


    @media (max-width: 992px) {

        .formula-create-page {
            padding: 14px;
        }

        .formula-info-grid {
            grid-template-columns: repeat(3, 1fr);
        }

        .page-header {
            flex-direction: column;
            align-items: stretch;
        }

        .formula-code-box {
            width: 100%;
        }
    }


    @media (max-width: 768px) {

        .formula-create-page {
            padding: 10px;
        }

        .formula-info-grid {
            grid-template-columns: repeat(2, 1fr);
        }

        .order-grid {
            grid-template-columns: 1fr;
        }

        .formula-table {
            min-width: 850px;
        }

        .bottom-actions {
            flex-wrap: wrap;
        }

            .bottom-actions .btn {
                flex: 1;
            }
    }


    @media (max-width: 576px) {

        .formula-info-grid {
            grid-template-columns: 1fr;
        }

        .page-header-title {
            align-items: flex-start;
        }

        .bottom-actions {
            flex-direction: column;
        }

            .bottom-actions .btn {
                width: 100%;
            }

        .save-btn {
            width: 100%;
        }
    }


/* منبع: Components\Pages\Formulas\Details.razor */


    /* =========================================================
       کلی
       ========================================================= */

    .formula-details-page {
        direction: rtl;
        padding: 20px 25px 40px;
        font-family: Tahoma, "Segoe UI", Arial, sans-serif;
        color: #202428;
    }


    /* =========================================================
       Header
       ========================================================= */

    .page-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 20px;
        margin-bottom: 15px;
        padding: 15px 20px;
        background: #ffffff;
        border: 1px solid #dee2e6;
        border-radius: 10px;
        box-shadow: 0 3px 12px rgba(0,0,0,.06);
    }


    .page-header-title {
        display: flex;
        align-items: center;
        gap: 12px;
    }


    .page-title-icon {
        width: 44px;
        height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 9px;
        background: var(--theme-primary);
        color: white;
        font-size: 20px;
    }


    .page-header h3 {
        margin: 0;
        font-size: 20px;
        font-weight: 700;
    }


    .page-subtitle {
        margin-top: 4px;
        color: #777;
        font-size: 11px;
    }


    .page-header-code {
        min-width: 160px;
        padding: 8px 16px;
        text-align: center;
        background: #f8f9fa;
        border: 1px solid #dee2e6;
        border-radius: 8px;
    }


        .page-header-code span {
            display: block;
            margin-bottom: 2px;
            color: #777;
            font-size: 10px;
        }


        .page-header-code strong {
            display: block;
            color: var(--theme-primary);
            font-size: 18px;
            font-weight: 700;
        }


    /* =========================================================
       Actions
       ========================================================= */

    .action-panel {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        margin-bottom: 15px;
        padding: 10px 13px;
        background: #ffffff;
        border: 1px solid #dee2e6;
        border-radius: 9px;
        box-shadow: 0 2px 8px rgba(0,0,0,.04);
    }


    .action-panel-title {
        display: flex;
        align-items: center;
        gap: 7px;
        color: #555;
        font-size: 12px;
        font-weight: 700;
        white-space: nowrap;
    }


    .action-buttons {
        display: flex;
        flex-wrap: wrap;
        justify-content: flex-start;
        gap: 6px;
    }


        .action-buttons .btn {
            margin: 0 !important;
            font-family: inherit;
            font-size: 11px;
            padding: 6px 9px;
            white-space: nowrap;
        }


    /* =========================================================
       Status
       ========================================================= */

    .formula-status {
        display: flex;
        align-items: center;
        gap: 10px;
        margin-bottom: 15px;
        padding: 10px 14px;
        border-radius: 8px;
        border: 1px solid;
    }


    .status-approved {
        background: #ecfdf3;
        border-color: #a7e3bd;
        color: #146c43;
    }


    .status-rejected {
        background: #fff1f2;
        border-color: #f1aeb5;
        color: #b02a37;
    }


    .status-submitted {
        background: #eef7ff;
        border-color: #b6d8f5;
        color: #0a58ca;
    }


    .status-draft {
        background: #f5f5f5;
        border-color: #d6d6d6;
        color: #555;
    }


    .status-icon {
        width: 30px;
        height: 30px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 18px;
    }


    .status-content {
        display: flex;
        flex-direction: column;
        gap: 2px;
    }


        .status-content strong {
            font-size: 13px;
        }


        .status-content span {
            font-size: 11px;
        }


    /* =========================================================
       Section Card
       ========================================================= */

    .section-card {
        margin-bottom: 15px;
        overflow: hidden;
        background: #ffffff;
        border: 1px solid #dee2e6;
        border-radius: 10px;
        box-shadow: 0 3px 12px rgba(0,0,0,.05);
    }


    .section-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        min-height: 43px;
        padding: 8px 15px;
        color: white;
        font-size: 13px;
        font-weight: 700;
    }


        .section-header > div {
            display: flex;
            align-items: center;
            gap: 7px;
        }


    .section-header-primary {
        background: var(--theme-primary);
    }


    .section-header-secondary {
        background: #6c757d;
    }


    .section-header-dark {
        background: #212529;
    }


    .section-header-light {
        background: #f5f6f8;
        color: #333;
        border-bottom: 1px solid #dee2e6;
    }


    .section-body {
        padding: 14px;
    }


    /* =========================================================
       Order
       ========================================================= */

    .info-grid {
        display: grid;
        gap: 9px;
    }


    .order-grid {
        grid-template-columns: repeat(3, 1fr);
    }


    .info-box {
        padding: 9px 12px;
        background: #f8f9fa;
        border: 1px solid #e1e5e9;
        border-radius: 7px;
    }


    .info-label {
        display: block;
        margin-bottom: 4px;
       
        font-size: 10px;
    }


    .info-box strong {
        display: block;
        font-size: 13px;
        color: #222;
    }


    .info-box small {
        margin-right: 4px;
        color: #777;
        font-size: 10px;
        font-weight: normal;
    }


    /* =========================================================
       Formula Information - Compact
       ========================================================= */

    .formula-main-body {
        padding: 10px;
    }


    .formula-info-grid {
        display: grid;
        grid-template-columns: repeat(7, 1fr);
        gap: 7px;
    }


    .formula-info-item {
        min-height: 55px;
        padding: 7px 10px;
        background: #f8f9fa;
        border: 1px solid #e0e4e8;
        border-radius: 7px;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }


        .formula-info-item.highlight {
            background: #eef5ff;
            border-color: #b7d2fa;
        }


        .formula-info-item > span {
            display: block;
            margin-bottom: 3px;
            color: #777;
            font-size: 10px;
            line-height: 1.2;
        }


        .formula-info-item > strong {
            display: block;
            color: #222;
            font-size: 13px;
            line-height: 1.3;
            font-weight: 700;
            word-break: break-word;
        }


        .formula-info-item.highlight > strong {
            color: var(--theme-primary);
            font-size: 15px;
        }


        .formula-info-item small {
            margin-right: 3px;
            color: #777;
            font-size: 9px;
            font-weight: normal;
        }


    .weight-main-value {
        color: #198754 !important;
    }


    .percentage-ok {
        color: #198754 !important;
    }


    .percentage-error {
        color: #dc3545 !important;
    }


    /* =========================================================
       Description
       ========================================================= */

    .description-box {
        margin-top: 9px;
        padding: 9px 12px;
        background: #fffdf5;
        border: 1px solid #e8dfb5;
        border-radius: 7px;
    }


    .description-title {
        display: flex;
        align-items: center;
        gap: 6px;
        margin-bottom: 5px;
        color: #76651d;
        font-size: 11px;
        font-weight: 700;
    }


    .description-text {
        color: #444;
        font-size: 12px;
        line-height: 1.7;
        white-space: pre-wrap;
    }


    /* =========================================================
       Percentage Message
       ========================================================= */

    .percentage-success,
    .percentage-warning {
        display: flex;
        align-items: center;
        gap: 10px;
        margin-bottom: 15px;
        padding: 10px 14px;
        border-radius: 8px;
    }


    .percentage-success {
        background: #ecfdf3;
        border: 1px solid #a7e3bd;
        color: #146c43;
    }


    .percentage-warning {
        background: #fff8e6;
        border: 1px solid #f1d28a;
        color: #856404;
    }


        .percentage-success > i,
        .percentage-warning > i {
            font-size: 18px;
        }


        .percentage-success div,
        .percentage-warning div {
            display: flex;
            flex-direction: column;
            gap: 2px;
        }


        .percentage-success strong,
        .percentage-warning strong {
            font-size: 12px;
        }


        .percentage-success span,
        .percentage-warning span {
            font-size: 11px;
        }


    /* =========================================================
       Materials
       ========================================================= */

    .materials-container {
        padding: 0;
    }


    .material-count {
        padding: 3px 9px;
        color: #212529;
        background: #ffffff;
        border-radius: 20px;
        font-size: 10px;
    }


    .materials-table {
        width: 100%;
        margin: 0;
        border-collapse: collapse;
        font-family: Tahoma, "Segoe UI", sans-serif;
        font-size: 12px;
    }


        .materials-table th,
        .materials-table td {
            padding: 8px 10px;
            border: 1px solid #dee2e6;
            vertical-align: middle;
        }


        .materials-table thead th {
            background: #f1f3f5;
            color: #333;
            font-size: 11px;
            font-weight: 700;
            text-align: center;
            white-space: nowrap;
        }


        .materials-table tbody tr {
            transition: background .15s ease;
        }


            .materials-table tbody tr:hover td {
                background: #f8fbff;
            }


            .materials-table tbody tr:nth-child(even) td {
                background: #fcfcfc;
            }


            .materials-table tbody tr:nth-child(even):hover td {
                background: #f8fbff;
            }


        .materials-table tfoot th {
            background: #e9ecef;
            color: #222;
            font-weight: 700;
        }


    .col-number {
        width: 7%;
    }


    .col-type {
        width: 20%;
    }


    .col-specification {
        width: 38%;
    }


    .col-percent {
        width: 15%;
    }


    .col-weight {
        width: 20%;
    }


    .row-number {
        color: #6c757d;
        font-weight: 700;
    }


    .material-type {
        font-weight: 600;
    }


    .percentage-value {
        color: var(--theme-primary);
        font-size: 13px;
    }


    .weight-value {
        color: #198754;
        font-size: 13px;
    }


    .unit {
        margin-right: 3px;
        color: #777;
        font-size: 10px;
    }


    .empty-value {
        color: #aaa;
    }


    .total-label {
        text-align: right !important;
    }


    .empty-materials {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        min-height: 100px;
        color: #777;
        font-size: 12px;
    }


        .empty-materials i {
            font-size: 22px;
            color: #adb5bd;
        }


    /* =========================================================
       Audit
       ========================================================= */

    .audit-grid {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 9px;
    }


    .audit-item {
        display: flex;
        align-items: center;
        gap: 8px;
        min-height: 58px;
        padding: 8px 10px;
        background: #f8f9fa;
        border: 1px solid #e0e4e8;
        border-radius: 7px;
    }


    .audit-icon {
        width: 32px;
        height: 32px;
        flex-shrink: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 7px;
        font-size: 15px;
    }


        .audit-icon.created {
            background: #e8f3ff;
            color: var(--theme-primary);
        }


        .audit-icon.approved {
            background: #e9f8ef;
            color: #198754;
        }


        .audit-icon.modified {
            background: #fff3cd;
            color: #997404;
        }


        .audit-icon.date {
            background: #f0e8ff;
            color: #6f42c1;
        }


    .audit-item span {
        display: block;
        margin-bottom: 3px;
        color: #777;
        font-size: 9px;
    }


    .audit-item strong {
        display: block;
        color: #333;
        font-size: 11px;
        word-break: break-word;
    }


    /* =========================================================
       Bottom
       ========================================================= */

    .bottom-actions {
        display: flex;
        justify-content: space-between;
        gap: 10px;
        margin-top: 8px;
        padding-top: 15px;
        border-top: 1px solid #dee2e6;
    }


    /* =========================================================
       Loading
       ========================================================= */

    .loading-box {
        min-height: 450px;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
    }


    .loading-text {
        margin-top: 15px;
        color: #666;
        font-size: 13px;
    }


    /* =========================================================
       Error
       ========================================================= */

    .error-box {
        display: flex;
        align-items: center;
        gap: 15px;
        margin-top: 30px;
        padding: 18px;
        background: #fff1f2;
        border: 1px solid #f1aeb5;
        border-radius: 10px;
        color: #842029;
    }


    .error-icon {
        font-size: 27px;
    }


    .error-box h5 {
        margin: 0 0 5px;
        font-weight: 700;
    }


    .page-actions {
        margin-top: 15px;
    }


    /* =========================================================
       Not Found
       ========================================================= */

    .not-found-box {
        min-height: 400px;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        text-align: center;
    }


    .not-found-icon {
        margin-bottom: 15px;
        color: #adb5bd;
        font-size: 55px;
    }


    .not-found-box h4 {
        margin-bottom: 8px;
    }


    .not-found-box p {
        color: #777;
        font-size: 13px;
    }


    /* =========================================================
       Responsive
       ========================================================= */

    @media (max-width: 1200px) {

        .formula-info-grid {
            grid-template-columns: repeat(4, 1fr);
        }

        .audit-grid {
            grid-template-columns: repeat(2, 1fr);
        }
    }


    @media (max-width: 992px) {

        .formula-details-page {
            padding: 15px;
        }

        .page-header {
            flex-direction: column;
            align-items: stretch;
        }

        .page-header-code {
            width: 100%;
        }

        .action-panel {
            flex-direction: column;
            align-items: stretch;
        }

        .action-panel-title {
            padding-bottom: 5px;
        }

        .action-buttons {
            justify-content: flex-start;
        }

        .formula-info-grid {
            grid-template-columns: repeat(3, 1fr);
        }

        .order-grid {
            grid-template-columns: 1fr;
        }
    }


    @media (max-width: 768px) {

        .formula-details-page {
            padding: 10px;
        }

        .page-header {
            padding: 13px;
        }

            .page-header h3 {
                font-size: 18px;
            }

        .formula-info-grid {
            grid-template-columns: repeat(2, 1fr);
        }

        .audit-grid {
            grid-template-columns: 1fr;
        }

        .bottom-actions {
            flex-direction: column;
        }

            .bottom-actions .btn {
                width: 100%;
            }
    }


    @media (max-width: 576px) {

        .formula-info-grid {
            grid-template-columns: 1fr;
        }

        .action-buttons {
            flex-direction: column;
            align-items: stretch;
        }

            .action-buttons .btn {
                width: 100%;
            }

        .page-header-title {
            align-items: flex-start;
        }

        .page-title-icon {
            width: 40px;
            height: 40px;
            font-size: 18px;
        }
    }



/* منبع: Components\Pages\Formulas\Edit.razor */




    /* =========================================================
           صفحه
           ========================================================= */

    .formula-edit-page {
        direction: rtl;
        padding: 18px 24px 35px;
        font-family: Tahoma, "Segoe UI", Arial, sans-serif;
        color: #202428;
    }


    /* =========================================================
           Header
           ========================================================= */

    .page-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 15px;
        margin-bottom: 14px;
        padding: 13px 17px;
        background: #fff;
        border: 1px solid #dee2e6;
        border-radius: 10px;
        box-shadow: 0 3px 12px rgba(0,0,0,.05);
    }


    .page-header-title {
        display: flex;
        align-items: center;
        gap: 11px;
    }


    .page-title-icon {
        width: 42px;
        height: 42px;
        display: flex;
        align-items: center;
        justify-content: center;
        background: var(--theme-primary);
        color: #fff;
        border-radius: 8px;
        font-size: 19px;
    }


        .page-title-icon.locked {
            background: #ffc107;
            color: #212529;
        }


    .page-header h3 {
        margin: 0;
        font-size: 19px;
        font-weight: 700;
       
    }


    .page-subtitle {
        margin-top: 3px;
        color: #777;
        font-size: 10px;
    }


    .formula-code-box {
        min-width: 145px;
        padding: 7px 14px;
        text-align: center;
        background: #f8f9fa;
        border: 1px solid #dee2e6;
        border-radius: 7px;
    }


        .formula-code-box span {
            display: block;
            color: #777;
            font-size: 9px;
            margin-bottom: 2px;
        }


        .formula-code-box strong {
            color: var(--theme-primary);
            font-size: 17px;
        }


    /* =========================================================
           Section
           ========================================================= */

    .section-card {
        margin-bottom: 14px;
        overflow: hidden;
        background: #fff;
        border: 1px solid #dee2e6;
        border-radius: 9px;
        box-shadow: 0 2px 9px rgba(0,0,0,.035);
    }


    .section-header {
        min-height: 42px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 7px 14px;
        color: #fff;
        font-size: 12px;
        font-weight: 700;
    }


        .section-header > div {
            display: flex;
            align-items: center;
            gap: 7px;
        }


    .section-header-primary {
        background: var(--theme-primary);
    }


    .section-header-secondary {
        background: #6c757d;
    }


    .section-header-dark {
        background: #212529;
    }


    .section-body {
        padding: 11px;
    }


    /* =========================================================
           سفارش
           ========================================================= */

    .order-grid {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 7px;
    }


    .order-item {
        min-height: 48px;
        padding: 7px 10px;
        background: #f8f9fa;
        border: 1px solid #e1e5e9;
        border-radius: 7px;
    }


        .order-item span {
            display: block;
            margin-bottom: 3px;
            color: #777;
            font-size: 9px;
        }


        .order-item strong {
            display: block;
            color: #222;
            font-size: 12px;
        }


    .status-text {
        color: var(--theme-primary) !important;
    }


    /* =========================================================
           عنوان فرمول
           ========================================================= */

    .formula-title-box {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 15px;
        margin-bottom: 14px;
        padding: 10px 14px;
        background: linear-gradient( 135deg, #eef5ff, #f8f9fa );
        border: 1px solid #cfe2ff;
        border-radius: 9px;
    }


    .formula-name-area span {
        display: block;
        margin-bottom: 2px;
        color: #777;
        font-size: 9px;
    }


    .formula-name-area strong {
        color: var(--theme-primary);
        font-size: 17px;
    }


    .production-display {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 6px 12px;
        background: #fff;
        border: 1px solid #d9e2ef;
        border-radius: 7px;
    }


        .production-display span {
            color: #777;
            font-size: 9px;
        }


        .production-display strong {
            color: var(--theme-primary);
            font-size: 15px;
        }


    /* =========================================================
           اطلاعات فرمول
           ========================================================= */

    .formula-info-grid {
        display: grid;
        grid-template-columns: repeat(6, 1fr);
        gap: 9px;
    }


    .form-field {
        min-width: 0;
    }


        .form-field label {
            display: block;
            margin-bottom: 4px;
            color: #495057;
            font-size: 10px;
            font-weight: 700;
        }


    .compact-input {
        height: 34px !important;
        min-height: 34px !important;
        padding: 4px 8px !important;
        border-radius: 6px !important;
        font-size: 12px !important;
        padding-right: 2.5rem !important;
        padding-left: 0.75rem !important;
        background: #f8f9fa;
    }


    .form-field small {
        display: block;
        margin-top: 3px;
        color: #777;
        font-size: 8px;
    }


    .readonly-field {
        height: 34px;
        display: flex;
        align-items: center;
        padding: 4px 9px;
        background: #f8f9fa;
        border: 1px solid #dee2e6;
        border-radius: 6px;
        font-size: 12px;
        font-weight: 700;
    }


    .primary-field {
        color: var(--theme-primary);
        background: #eef5ff;
        border-color: #cfe2ff;
    }


    .description-field {
        grid-column: 1 / -1;
    }


        .description-field textarea {
            min-height: 58px;
            resize: vertical;
        }


    /* =========================================================
           وزن
           ========================================================= */

    .weight-input-group {
        display: flex;
        width: 100%;
    }


    .weight-number-input {
        border-top-left-radius: 0 !important;
        border-bottom-left-radius: 0 !important;
    }


    .weight-unit-select {
        width: 69px;
        height: 34px;
        border: 1px solid #ced4da;
        border-right: 0;
        border-radius: 6px 0 0 6px;
        background: #f8f9fa;
        padding: 2px 5px;
        text-align: center;
        font-size: 11px;
        font-weight: 700;
        color: #495057;
        cursor: pointer;
    }


        .weight-unit-select:focus {
            outline: none;
            border-color: #86b7fe;
            box-shadow: 0 0 0 .15rem rgba(13,110,253,.12);
        }


    /* =========================================================
           جدول مواد
           ========================================================= */

    .materials-card {
        margin-top: 3px;
    }


    .add-material-btn {
        padding: 5px 9px;
        font-size: 10px;
    }


    .formula-table {
        width: 100%;
        margin: 0;
        border-collapse: separate;
        border-spacing: 0;
        overflow: hidden;
        border: 1px solid #dee2e6;
        border-radius: 7px;
        font-size: 11px;
    }


        .formula-table th,
        .formula-table td {
            padding: 6px 7px;
            border-bottom: 1px solid #e5e7eb;
            vertical-align: middle;
        }


        .formula-table thead th {
            background: #f1f3f5;
            color: #343a40;
            font-size: 10px;
            font-weight: 700;
            white-space: nowrap;
            text-align: center;
        }


        .formula-table tbody tr {
            transition: background .15s ease;
        }


            .formula-table tbody tr:hover td {
                background: #f8fbff;
            }


            .formula-table tbody tr:last-child td {
                border-bottom: 0;
            }


        .formula-table tfoot th {
            background: #e9ecef;
            border-bottom: 0;
            font-size: 11px;
        }


    .row-number {
        width: 55px;
    }


    .row-number-cell {
        color: #6c757d;
        font-weight: 700;
    }


    .percentage-column {
        width: 125px;
    }


    .weight-column {
        width: 145px;
    }


    .move-column {
        width: 100px;
    }


    .delete-column {
        width: 60px;
    }


    .percentage-input {
        text-align: center;
    }


    .percentage-readonly {
        justify-content: center;
        color: var(--theme-primary);
        background: #eef5ff;
        border-color: #cfe2ff;
    }


    .auto-label {
        display: block;
        margin-top: 2px;
        text-align: center;
        color: #888;
        font-size: 8px;
    }


    .base-label {
        margin-top: 3px;
        color: var(--theme-primary);
        font-size: 9px;
        font-weight: 700;
    }


        .base-label i {
            font-size: 8px;
        }


    .weight-value {
        color: #198754;
        font-size: 12px;
    }


    .weight-unit {
        margin-right: 3px;
        color: #777;
        font-size: 9px;
    }


    .move-buttons {
        display: flex;
        justify-content: center;
        gap: 3px;
    }


    .move-btn {
        width: 28px;
        height: 27px;
        padding: 0;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border: 1px solid #b7c9df;
        border-radius: 5px;
        background: #f4f8fd;
        color: var(--theme-primary);
        cursor: pointer;
    }


        .move-btn:hover:not(:disabled) {
            background: var(--theme-primary);
            color: #fff;
        }


        .move-btn:disabled {
            opacity: .35;
            cursor: not-allowed;
        }


    .delete-btn {
        width: 29px;
        height: 27px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        padding: 0;
        border: 0;
        border-radius: 5px;
        background: #fff0f1;
        color: #dc3545;
    }


        .delete-btn:hover {
            background: #dc3545;
            color: #fff;
        }


    .total-label {
        text-align: right !important;
    }


    /* =========================================================
           وضعیت درصد
           ========================================================= */

    .percentage-message {
        display: flex;
        align-items: center;
        gap: 8px;
        margin-top: 9px;
        padding: 7px 10px;
        border-radius: 6px;
        font-size: 10px;
    }


        .percentage-message i {
            font-size: 14px;
        }


    .percentage-success {
        background: #ecfdf3;
        border: 1px solid #b7e4c7;
        color: #146c43;
    }


    .percentage-warning {
        background: #fff8e1;
        border: 1px solid #f1d28a;
        color: #856404;
    }


    .percentage-danger {
        background: #fff1f2;
        border: 1px solid #f1aeb5;
        color: #b02a37;
    }


    /* =========================================================
           پیام ها
           ========================================================= */

    .message-box {
        display: flex;
        align-items: center;
        gap: 8px;
        margin-bottom: 10px;
        padding: 8px 11px;
        border-radius: 7px;
        font-size: 11px;
    }


    .message-error {
        background: #fff1f2;
        border: 1px solid #f1aeb5;
        color: #842029;
    }


    .message-success {
        background: #ecfdf3;
        border: 1px solid #a7e3bd;
        color: #146c43;
    }


    /* =========================================================
           دکمه های پایین
           ========================================================= */

    .bottom-actions {
        display: flex;
        align-items: center;
        gap: 7px;
        margin-top: 12px;
        padding-top: 12px;
        border-top: 1px solid #dee2e6;
    }


        .bottom-actions .btn {
            font-family: inherit;
            font-size: 11px;
            padding: 6px 12px;
        }


    .save-btn {
        min-width: 130px;
    }


    /* =========================================================
           قفل
           ========================================================= */

    .locked-box {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 14px;
        margin-bottom: 12px;
        background: #fff8e1;
        border: 1px solid #f1d28a;
        border-radius: 9px;
        color: #856404;
    }


    .locked-icon {
        width: 36px;
        height: 36px;
        display: flex;
        align-items: center;
        justify-content: center;
        background: #fff3cd;
        border-radius: 8px;
        font-size: 18px;
    }


    .locked-box strong {
        display: block;
        margin-bottom: 3px;
        font-size: 12px;
    }


    .locked-box span {
        display: block;
        font-size: 10px;
    }


    /* =========================================================
           Empty
           ========================================================= */

    .empty-materials {
        min-height: 90px;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        color: #777;
        font-size: 11px;
        background: #fafafa;
        border: 1px dashed #ced4da;
        border-radius: 7px;
    }


        .empty-materials i {
            color: #adb5bd;
            font-size: 22px;
        }


    /* =========================================================
           Loading
           ========================================================= */

    .loading-box {
        min-height: 450px;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
    }


    .loading-text {
        margin-top: 12px;
        color: #666;
        font-size: 12px;
    }


    /* =========================================================
           Error
           ========================================================= */

    .error-box {
        display: flex;
        align-items: center;
        gap: 10px;
        margin-top: 25px;
        padding: 14px;
        background: #fff1f2;
        border: 1px solid #f1aeb5;
        border-radius: 9px;
        color: #842029;
    }


        .error-box > i {
            font-size: 22px;
        }


        .error-box strong {
            display: block;
            margin-bottom: 3px;
            font-size: 12px;
        }


        .error-box span {
            display: block;
            font-size: 10px;
        }


    /* =========================================================
           Not Found
           ========================================================= */

    .not-found-box {
        min-height: 400px;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 10px;
        color: #777;
    }


        .not-found-box > i {
            color: #adb5bd;
            font-size: 50px;
        }


        .not-found-box strong {
            font-size: 13px;
        }


    /* =========================================================
           Validation
           ========================================================= */

    .validation-message {
        display: block;
        margin-top: 2px;
        color: #dc3545;
        font-size: 9px;
    }


    .validation-errors {
        margin-bottom: 10px;
        padding: 8px 10px;
        border: 1px solid #f1aeb5;
        border-radius: 6px;
        background: #fff1f2;
        color: #842029;
        font-size: 10px;
    }


    /* =========================================================
           Responsive
           ========================================================= */

    @media (max-width: 1200px) {

        .formula-info-grid {
            grid-template-columns: repeat(4, 1fr);
        }

        .order-grid {
            grid-template-columns: repeat(2, 1fr);
        }
    }


    @media (max-width: 992px) {

        .formula-edit-page {
            padding: 14px;
        }

        .formula-info-grid {
            grid-template-columns: repeat(3, 1fr);
        }

        .page-header {
            flex-direction: column;
            align-items: stretch;
        }

        .formula-code-box {
            width: 100%;
        }

        .formula-title-box {
            flex-direction: column;
            align-items: stretch;
        }

        .production-display {
            justify-content: space-between;
        }
    }


    @media (max-width: 768px) {

        .formula-edit-page {
            padding: 10px;
        }

        .formula-info-grid {
            grid-template-columns: repeat(2, 1fr);
        }

        .order-grid {
            grid-template-columns: 1fr;
        }

        .formula-table {
            min-width: 850px;
        }

        .bottom-actions {
            flex-wrap: wrap;
        }

            .bottom-actions .btn {
                flex: 1;
            }
    }


    @media (max-width: 576px) {

        .formula-info-grid {
            grid-template-columns: 1fr;
        }

        .page-header-title {
            align-items: flex-start;
        }

        .formula-title-box {
            gap: 8px;
        }

        .bottom-actions {
            flex-direction: column;
        }

            .bottom-actions .btn {
                width: 100%;
            }

        .save-btn {
            width: 100%;
        }
    }



/* منبع: Components\Pages\Formulas\Print.razor */


    /* =========================================================
           صفحه چاپ
           ========================================================= */

    .print-page {
        direction: rtl;
        width: 100%;
        max-width: 1100px;
        margin: 25px auto;
        padding: 100px;
        box-sizing: border-box;
        background: #ffffff;
        color: #111111;
        font-family: Tahoma, Arial, sans-serif;
        font-size: 13px;
        line-height: 1.7;
        border: 3px double green;
        border-radius: 10px;
        box-shadow: 0 5px 25px rgba(0, 0, 0, .08);
        /* عرض ستون‌ها */

        --col-weight: 15%;
        --col-type: 30%;
        --col-spec: 40%;
        --col-percent: 15%;
    }


    /* =========================================================
           اطلاعات فرمول
           ========================================================= */

    .info-grid {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        column-gap: 0;
        row-gap: 0;
        
   
        
      
        overflow: hidden;
       
        margin-bottom: 0;
    }


    .info-item {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 4px;
        min-height: 58px;
        padding: 8px 12px;
        background: #ffffff;
        box-sizing: border-box;
        text-align: center;
    }


        .info-item.date-cell {
            grid-column: 2 / span 2;
        }


    .info-label {
        display: inline;
        font-size: 11px;
       
        white-space: nowrap;
    }


    .info-value {
        display: inline;
        font-size: 13px;
        font-weight: bold;
        color: #111111;
        overflow-wrap: anywhere;
    }

    .print-formula-code-main,
    .print-formula-code-last {
        white-space: nowrap;
    }

    .print-formula-code-last {
        font-weight: 900;
    }


    /* =========================================================
           لیست مواد
           ========================================================= */

    .materials-list {
        margin-top: 0;
      
        border-top: none;
        overflow: auto;
        background: #ffffff;
        position: relative;
       
        min-height: 160px;
    }


    /* =========================================================
           هدر مواد
           ========================================================= */

    .materials-header {
        display: grid;
        grid-template-columns: var(--col-weight) var(--col-type) var(--col-spec) var(--col-percent);
        min-height: 42px;
        background: #ffffff;
        border-bottom: 2px solid #000000;
        font-weight: bold;
        border: 5px double green;
        position: relative;
    }


        .materials-header .material-cell {
            justify-content: center;
            font-size: 12px;
            font-weight: bold;
            background: #ffffff;
        }


    /* =========================================================
           ردیف ماده
           ========================================================= */

    .material-row {
        display: grid;
        grid-template-columns: var(--col-weight) var(--col-type) var(--col-spec) var(--col-percent);
        min-height: 50px;
        border-bottom: 1px solid #000000;
        background: #ffffff;
        break-inside: avoid;
        page-break-inside: avoid;
        position: relative;
    }


        .material-row:last-child {
            border-bottom: none;
        }


    /* =========================================================
           سلول
           ========================================================= */

    .material-cell {
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 8px 10px;
        overflow-wrap: anywhere;
        box-sizing: border-box;
        text-align: center;
    }


    .weight-cell {
        font-size: 13px;
        font-weight: bold;
        white-space: nowrap;
    }


    .material-type {
        font-size: 13px;
        font-weight: bold;
    }


    .material-specification {
        font-size: 12px;
    }


    .percentage-cell {
        font-size: 13px;
        font-weight: bold;
        white-space: nowrap;
    }


    /* =========================================================
           دستگیره تغییر اندازه ستون
           ========================================================= */

    .col-resize-handle {
        position: absolute;
        top: 0;
        width: 10px;
        height: 100%;
        cursor: col-resize;
        z-index: 6;
        background: transparent;
        transform: translateX(50%);
    }


        .col-resize-handle:hover,
        .col-resize-handle.resizing {
            background: rgba(0, 128, 0, .3);
        }


    /* =========================================================
           دستگیره تغییر ارتفاع سطر
           ========================================================= */

    .row-resize-handle {
        position: absolute;
        left: 0;
        right: 0;
        bottom: -3px;
        height: 6px;
        cursor: row-resize;
        z-index: 6;
        background: transparent;
    }

    .col-resize-handle-weight {
        right: var(--col-weight);
    }

    .col-resize-handle-type {
        right: calc(var(--col-weight) + var(--col-type));
    }

    .col-resize-handle-spec {
        right: calc(var(--col-weight) + var(--col-type) + var(--col-spec));
    }


        .row-resize-handle:hover,
        .row-resize-handle.resizing {
            background: rgba(0, 128, 0, .3);
        }


    /* =========================================================
           جمع کل
           ========================================================= */

    .materials-total {
        display: grid;
        grid-template-columns: var(--col-weight) var(--col-type) var(--col-spec) var(--col-percent);
        min-height: 45px;
        background: #ffffff;
        border-top: 2px solid #000000;
        border-bottom: 2px solid #000000;
        font-weight: bold;
        break-inside: avoid;
        page-break-inside: avoid;
    }


    .total-label {
        font-size: 13px;
        font-weight: bold;
    }


    /* =========================================================
           توضیحات
           ========================================================= */

    .product-title-box {
        margin-top: 18px;
        border: 1px solid #000000;
        border-radius: 4px;
        padding: 14px;
        text-align: center;
        font-size: 15px;
        font-weight: bold;
        background: #ffffff;
        overflow-wrap: anywhere;
        word-break: break-word;
    }


    .description-label {
        margin-left: 6px;
        color: #444444;
        font-size: 12px;
        font-weight: normal;
    }


    /* =========================================================
           امضاها
           ========================================================= */

    .signature-section {
        margin-top: 45px;
    }


    .signature-row {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 20px;
        margin-bottom: 35px;
    }


        .signature-row.single {
            grid-template-columns: 1fr;
        }


    .signature-item {
        font-size: 13px;
        text-align: right;
    }


    .signature-line {
        display: inline-block;
        min-width: 160px;
        border-bottom: 1px dotted #555555;
        margin-right: 5px;
    }


    /* =========================================================
           پنل کنترل
           ========================================================= */

    .print-controls {
        direction: rtl;
        max-width: 1100px;
        margin: 15px auto 0;
        padding: 12px 18px;
        border: 1px dashed #999999;
        border-radius: 8px;
       
        display: flex;
        flex-wrap: wrap;
        gap: 18px;
        font-family: Tahoma, Arial, sans-serif;
        font-size: 13px;
    }


        .print-controls label {
            display: flex;
            align-items: center;
            gap: 6px;
            cursor: pointer;
            user-select: none;
        }


        .print-controls input[type="checkbox"] {
            width: 16px;
            height: 16px;
            cursor: pointer;
        }

    .print-toolbar {
        direction: rtl;
        max-width: 1100px;
        margin: 15px auto 0;
        padding: 12px 18px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 16px;
        flex-wrap: wrap;
        border: 1px solid var(--theme-border);
        border-radius: 10px;
        background: var(--theme-surface);
        color: var(--theme-text);
        box-shadow: var(--theme-shadow);
    }

    .paper-size-selector {
        display: flex;
        align-items: center;
        gap: 12px;
        flex-wrap: wrap;
    }

    .paper-size-label {
        font-weight: 700;
    }

    .paper-size-option {
        display: inline-flex;
        align-items: center;
        gap: 5px;
        cursor: pointer;
        user-select: none;
    }

    .paper-size-option input {
        accent-color: var(--theme-primary);
    }

    .print-action-button {
        min-width: 100px;
    }

    .paper-a4,
    .paper-a5 {
        margin-left: auto;
        margin-right: auto;
        width: 100%;
        box-sizing: border-box;
    }

    .paper-a4 {
        max-width: 210mm;
    }

    .paper-a5 {
        max-width: 148mm;
    }


    /* =========================================================
           Loading
           ========================================================= */

    .print-loading {
        margin-top: 100px;
        text-align: center;
        color: #555555;
    }


    /* =========================================================
           Error
           ========================================================= */

    .print-error {
        margin: 30px;
        padding: 20px;
        border: 1px solid #dc3545;
        border-radius: 8px;
        background: #fff5f5;
        color: #842029;
        text-align: center;
    }


    /* =========================================================
           صفحه نمایش
           ========================================================= */

    @media (max-width: 900px) {

        .print-page {
            margin: 10px;
            padding: 12px;
        }


        .info-grid {
            grid-template-columns: repeat(4, 1fr);
        }


        .materials-list {
            overflow-x: auto;
        }


        .materials-header,
        .material-row,
        .materials-total {
            min-width: 650px;
        }


        .signature-row {
            grid-template-columns: 1fr;
        }


        .print-controls {
            margin-left: 10px;
            margin-right: 10px;
        }

        .print-toolbar {
            margin-left: 10px;
            margin-right: 10px;
        }
    }


    /* =========================================================
           چاپ
           ========================================================= */

    @media print {
        html,
        body {
            margin: 0 !important;
            padding: 0 !important;
            background: #ffffff !important;
        }

        .app-topbar,
        .app-sidebar,
        .app-sidebar-backdrop,
        .app-sidebar-toggle,
        .print-toolbar,
        .print-controls,
        .no-print,
        .col-resize-handle,
        .row-resize-handle {
            display: none !important;
        }

        .app-shell {
            display: block !important;
            min-height: 0 !important;
        }

        .app-content {
            margin: 0 !important;
            min-height: 0 !important;
        }

        .print-page {
            width: 100%;
            max-width: none;
            margin: 0;
            padding: 5mm;
            border: none;
            border-radius: 0;
            box-shadow: none;
            font-size: 10pt;
            line-height: 1.25;
        }

        .info-grid {
            grid-template-columns: repeat(4, 1fr) !important;
        }

        .info-item {
            min-height: 11mm;
            padding: 2mm 1.5mm;
        }

        .info-label {
            font-size: 8pt;
            margin-bottom: 0;
        }

        .info-value {
            font-size: 9pt;
        }

        .materials-list {
            overflow: visible !important;
            resize: none !important;
            width: 100% !important;
            height: auto !important;
        }

        .materials-header {
            min-height: 8mm;
        }

        .material-row {
            min-height: 9mm;
        }

        .materials-total {
            min-height: 9mm;
        }

        .materials-header,
        .material-row,
        .materials-total {
            min-width: 0 !important;
            width: 100%;
            break-inside: avoid;
            page-break-inside: avoid;
        }

        .material-cell {
            padding: 1.2mm 1mm;
            font-size: 9pt;
        }

        .material-specification {
            font-size: 8pt;
        }

        .product-title-box {
            margin-top: 3mm;
            padding: 2mm;
            font-size: 9pt;
            break-inside: avoid;
            page-break-inside: avoid;
        }

        .description-label {
            font-size: 8pt;
        }

        .signature-section {
            margin-top: 7mm;
        }

        .signature-row {
            margin-bottom: 5mm;
        }

        .signature-item {
            font-size: 9pt;
        }
    }

    @page a4 {
        size: A4;
        margin: 6mm;
    }

    @page a5 {
        size: A5;
        margin: 5mm;
    }

    .paper-a4 {
        page: a4;
    }

    .paper-a5 {
        page: a5;
    }



/* منبع: Components\Pages\orders\Create.razor */


    :root {
        --ink-900: #263238;
        --ink-800: #37474f;
        --ink-700: #455a64;
        --ink-600: #546e7a;
        --ink-500: #607d8b;
        --ink-400: #78909c;
        --ink-300: #90a4ae;
        --ink-100: #cfd8dc;
        --ink-50: #eceff1;
        --surface: #ffffff;
        --surface-muted: #f8f9fa;
        --border: #e2e6ea;
        --danger: #d32f2f;
        --danger-bg: #ffebee;
        --danger-border: #ffcdd2;
        --success: #1b5e20;
        --success-bg: #e8f5e9;
        --success-border: #c8e6c9;
        --radius-lg: 12px;
        --radius-md: 8px;
        --radius-sm: 6px;
    }

    .order-create-page {
        direction: rtl;
        max-width: 1180px;
        margin: 0 auto;
        padding: 0 14px 22px;
        font-family: Tahoma, Arial, sans-serif;
        color: var(--ink-900);
    }

    .order-header {
      
        color: white;
        border-radius: var(--radius-lg);
        padding: 14px 18px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin-bottom: 14px;
        box-shadow: 0 4px 14px rgba(0,0,0,.12);
    }

        .order-header h2 {
            margin: 0;
            font-size: 17px;
            font-weight: 700;
        }

    .btn-back {
        border: 1px solid rgba(255,255,255,.3);
        background: rgba(255,255,255,.08);
        color: white;
        border-radius: var(--radius-sm);
        padding: 6px 12px;
        font-size: 12px;
        cursor: pointer;
        transition: background .15s;
    }

        .btn-back:hover {
            background: rgba(255,255,255,.18);
        }

    .message {
        padding: 9px 13px;
        border-radius: var(--radius-md);
        margin-bottom: 12px;
        font-size: 13px;
    }

    .message-error {
        background: var(--danger-bg);
        color: var(--danger);
        border: 1px solid var(--danger-border);
    }

    .message-success {
        background: var(--success-bg);
        color: var(--success);
        border: 1px solid var(--success-border);
    }

    .order-section {
        background: var(--surface);
        border: 1px solid var(--border);
        border-radius: var(--radius-lg);
        padding: 16px;
        margin-bottom: 14px;
        box-shadow: 0 2px 8px rgba(0,0,0,.04);
    }

    .section-title {
        font-size: 14px;
        font-weight: 700;
        color: var(--ink-800);
        border-right: 3px solid var(--ink-600);
        padding-right: 8px;
        margin-bottom: 14px;
    }

    .section-title-row {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        margin-bottom: 14px;
    }

    .section-title-row .section-title {
        margin-bottom: 0;
    }

    .form-grid {
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 12px;
    }

    .form-group {
        position: relative;
    }

    .form-label {
        display: block;
        font-size: 12px;
        font-weight: 600;
        color: var(--ink-700);
        margin-bottom: 5px;
    }

    .required {
        color: var(--danger);
        margin-right: 2px;
    }

.compact-input,
.compact-select,
.customer-search {
    width: 100%;
    height: 36px;
    border: 1px solid var(--ink-100);
    border-radius: var(--radius-sm);
    padding: 6px 9px;
    font-size: 12.5px;
    font-family: inherit;
 
   
    outline: none;
    transition: border-color .15s, box-shadow .15s;
    box-sizing: border-box;
}

        .compact-input:focus,
        .compact-select:focus,
        .customer-search:focus {
           
            box-shadow: 0 0 0 3px rgba(96,125,139,.12);
        }

        .compact-input::placeholder,
        .customer-search::placeholder {
           
        }

    .select-container,
    .number-container,
    .date-picker-container,
    .customer-combo {
        position: relative;
    }

    .compact-select {
        appearance: auto;
        cursor: pointer;
    }

    /* ================= مشتری ================= */

    .customer-combo {
        position: relative;
    }

    .customer-search-wrapper {
        position: relative;
    }

    .customer-search {
        padding-left: 32px;
    }

    .customer-clear {
        position: absolute;
        left: 6px;
        top: 50%;
        transform: translateY(-50%);
        border: none;
        background: transparent;
        color: var(--ink-400);
        font-size: 16px;
        cursor: pointer;
        line-height: 1;
        padding: 2px 5px;
    }

        .customer-clear:hover {
            color: var(--danger);
        }

    .customer-list {
        position: absolute;
        z-index: 1300;
        top: calc(100% + 4px);
        right: 0;
        left: 0;
        max-height: 220px;
        overflow-y: auto;
        background: var(--surface);
        border: 1px solid var(--ink-100);
        border-radius: var(--radius-md);
        box-shadow: 0 8px 22px rgba(0,0,0,.14);
    }

    .customer-item {
        width: 100%;
        border: none;
        background: var(--surface);
        text-align: right;
        padding: 9px 11px;
        cursor: pointer;
        border-bottom: 1px solid #f0f2f3;
        display: block;
    }

        .customer-item:last-child {
            border-bottom: none;
        }

    .customer-item:hover {
        background: var(--surface-muted);
    }

    .customer-item-neutral {
        color: var(--ink-600);
        background: var(--surface-muted);
    }

    .customer-name {
        font-size: 12.5px;
        font-weight: 700;
        color: var(--ink-900);
    }

    .customer-details {
        font-size: 10.5px;
        color: var(--ink-400);
        margin-top: 2px;
    }

    .customer-empty {
        padding: 12px;
        color: var(--ink-400);
        text-align: center;
        font-size: 12px;
    }

    /* ================= تاریخ ================= */

    .date-input {
        direction: ltr;
        text-align: center;
        padding-left: 38px;
    }

    .date-calendar-button {
        position: absolute;
        left: 4px;
        bottom: 3px;
        width: 30px;
        height: 30px;
        border: none;
        border-radius: var(--radius-sm);
        background: var(--ink-50);
        cursor: pointer;
        font-size: 14px;
        line-height: 30px;
        padding: 0;
    }

        .date-calendar-button:hover {
            background: var(--ink-100);
        }

    .date-invalid {
        border-color: var(--danger) !important;
        background: #fff8f8;
    }

    /* ================= تقویم شمسی ================= */

    .persian-calendar {
        position: absolute;
        z-index: 1200;
        top: calc(100% + 5px);
        right: 0;
        width: 264px;
        background: var(--surface);
        border: 1px solid var(--border);
        border-radius: var(--radius-lg);
        box-shadow: 0 10px 26px rgba(0,0,0,.16);
        padding: 9px;
    }

    .calendar-header {
        display: grid;
        grid-template-columns: 32px 1fr 32px;
        align-items: center;
        gap: 4px;
        margin-bottom: 7px;
    }

    .calendar-nav {
        width: 30px;
        height: 30px;
        border: none;
        border-radius: var(--radius-sm);
        background: var(--ink-50);
        color: var(--ink-800);
        cursor: pointer;
        font-size: 18px;
        line-height: 28px;
        padding: 0;
    }

        .calendar-nav:hover {
            background: var(--ink-100);
        }

    .calendar-month {
        text-align: center;
        font-size: 12.5px;
        font-weight: 700;
        color: var(--ink-800);
    }

    .calendar-weekdays,
    .calendar-days {
        display: grid;
        grid-template-columns: repeat(7, 1fr);
        gap: 3px;
    }

    .calendar-weekdays {
        margin-bottom: 4px;
    }

    .calendar-weekday {
        text-align: center;
        font-size: 10.5px;
        color: var(--ink-400);
        font-weight: 700;
        padding: 3px 0;
    }

    .calendar-day,
    .calendar-empty {
        height: 30px;
        width: 100%;
        box-sizing: border-box;
    }

    .calendar-day {
        border: none;
        border-radius: var(--radius-sm);
        background: transparent;
        cursor: pointer;
        color: var(--ink-800);
        font-size: 11.5px;
        padding: 0;
    }

        .calendar-day:hover {
            background: var(--ink-50);
        }

        .calendar-day.today {
            border: 1px solid var(--ink-300);
        }

        .calendar-day.selected {
            background: var(--ink-600);
            color: white;
            font-weight: 700;
        }

            .calendar-day.selected:hover {
                background: var(--ink-700);
            }

    /* ================= محصول ================= */

    .product-card {
        border: 1px solid var(--border);
        border-radius: var(--radius-lg);
        background: var(--surface-muted);
        padding: 14px;
    }

        .product-card + .product-card {
            margin-top: 12px;
        }

    .product-card-title {
        font-size: 13.5px;
        font-weight: 700;
        color: var(--ink-800);
        margin-bottom: 13px;
        display: flex;
        align-items: center;
        gap: 7px;
    }

        .product-card-title span {
            width: 24px;
            height: 24px;
            border-radius: var(--radius-sm);
            display: inline-flex;
            align-items: center;
            justify-content: center;
            font-size: 12px;
            background: var(--ink-50);
        }

    .product-grid {
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 12px;
    }

    .field-wide {
        grid-column: span 2;
    }

    .field-full {
        grid-column: 1 / -1;
    }

    .field-hint {
        font-size: 10px;
        color: var(--ink-300);
        margin-top: 3px;
    }

    .textarea-input {
        min-height: 100px;
       
        font-family: inherit;
    }

    /* ================= دکمه ها ================= */

    .form-actions {
        display: flex;
        justify-content: flex-start;
        gap: 9px;
        margin-top: 16px;
    }

    .btn-save,
    .btn-cancel {
        min-width: 120px;
        height: 38px;
        border: none;
        border-radius: var(--radius-md);
        padding: 0 16px;
        cursor: pointer;
        font-family: inherit;
        font-size: 12.5px;
        font-weight: 700;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 6px;
        transition: background .15s, opacity .15s;
    }

    .btn-save {
        background: var(--ink-700);
        color: white;
    }

        .btn-save:hover:not(:disabled) {
            background: var(--ink-800);
        }

        .btn-save:disabled {
            opacity: .65;
            cursor: not-allowed;
        }

    .btn-cancel {
        background: var(--ink-50);
        color: var(--ink-700);
    }

        .btn-cancel:hover {
            background: var(--ink-100);
        }

    .spinner {
        width: 13px;
        height: 13px;
        border: 2px solid rgba(255,255,255,.4);
        border-top-color: white;
        border-radius: 50%;
        animation: spin .7s linear infinite;
    }

    @keyframes spin {
        to {
            transform: rotate(360deg);
        }
    }

    @media (max-width: 1000px) {

        .form-grid,
        .product-grid {
            grid-template-columns: repeat(2, minmax(0, 1fr));
        }
    }

    @media (max-width: 650px) {

        .order-create-page {
            margin: 10px auto;
            padding: 0 10px 20px;
        }

        .order-header {
            padding: 12px;
        }

            .order-header h2 {
                font-size: 15px;
            }

        .form-grid,
        .product-grid {
            grid-template-columns: 1fr;
        }

        .field-wide,
        .field-full {
            grid-column: auto;
        }

        .form-actions {
            flex-direction: column;
        }

        .btn-save,
        .btn-cancel {
            width: 100%;
        }
    }


/* منبع: Components\Pages\orders\Edit.razor */

    .order-edit-page {
        direction: rtl;
        font-family: Tahoma, Arial, sans-serif;
        color: #263238;
    }

    .order-edit-page .p-4 {
        padding: 16px !important;
    }

    .order-edit-form .row.order-edit-fields {
        --bs-gutter-x: 12px;
        --bs-gutter-y: 12px;
    }

    .order-edit-form .form-label {
        display: block;
        margin-bottom: 5px;
        color: #455a64;
        font-size: 12px;
        font-weight: 600;
    }

.order-edit-form .form-control,
.order-edit-form .form-select,
.order-edit-form .compact-input,
.order-edit-form .compact-select
.order-edit-form.customer-search {
    width: 100%;
    height: 36px;
    min-height: 36px;
    box-sizing: border-box;
    border: 1px solid #cfd8dc;
    border-radius: 6px;
    padding: 6px 9px;
    
   
    font-family: inherit;
    font-size: 12.5px;
    outline: none;
    box-shadow: none;
    transition: border-color .15s, box-shadow .15s;
}

    .order-edit-form .form-control:focus,
    .order-edit-form .form-select:focus,
    .order-edit-form .compact-input:focus,
    .order-edit-form .compact-select:focus {
        border-color: #607d8b;
        box-shadow: 0 0 0 3px rgba(96, 125, 139, .12);
    }

    .order-edit-form .form-control::placeholder {
        color: #90a4ae;
    }

    .order-edit-form textarea.form-control,
    .order-edit-form textarea.compact-input {
        height: auto;
        min-height: 92px;
        line-height: 1.8;
        resize: vertical;
    }

    .order-edit-form .persian-date-picker .input-group {
        position: relative;
        display: block;
        direction: rtl;
        width: 100%;
    }

    .order-edit-form .persian-date-picker .shamsi-input {
        display: block;
        width: 100%;
        min-height: 36px;
        height: 36px;
        box-sizing: border-box;
        border: 1px solid #cfd8dc;
        border-radius: 6px !important;
        padding: 6px 38px 6px 9px;
        color: #263238;
        background: #fff;
        font-family: Tahoma, Arial, sans-serif;
        font-size: 12.5px;
        box-shadow: none;
    }

    .order-edit-form .persian-date-picker .shamsi-input:focus {
        border-color: #607d8b;
        box-shadow: 0 0 0 3px rgba(96, 125, 139, .12);
    }

    .order-edit-form .persian-date-picker .calendar-button {
        position: absolute !important;
        left: 4px;
        bottom: 3px;
        z-index: 2;
        min-width: 30px;
        width: 30px;
        height: 30px;
        padding: 0;
        border: 0;
        border-radius: 6px !important;
        color: #455a64;
        background: #eceff1;
        font-size: 13px;
        line-height: 30px;
    }

    .order-edit-form .persian-date-picker .calendar-button:hover {
        background: #cfd8dc;
    }

    .order-edit-form .persian-date-picker .calendar-popup {
        top: calc(100% + 5px);
        right: 0;
        width: 264px;
        border-color: #e2e6ea;
        border-radius: 12px;
        padding: 9px;
    }

    .order-edit-form .persian-date-picker .calendar-header {
        display: grid;
        grid-template-columns: 30px 1fr 30px;
        gap: 4px;
        margin-bottom: 7px;
    }

    .order-edit-form .persian-date-picker .calendar-nav {
        width: 30px;
        height: 30px;
        border: 0;
        border-radius: 6px;
        color: #37474f;
        background: #eceff1;
        font-size: 16px;
    }

    .order-edit-form .persian-date-picker .calendar-nav:hover {
        background: #cfd8dc;
    }

    .order-edit-form .persian-date-picker .calendar-title {
        color: #37474f;
        font-size: 12.5px;
    }

    .order-edit-form .persian-date-picker .calendar-weekdays,
    .order-edit-form .persian-date-picker .calendar-days {
        gap: 3px;
    }

    .order-edit-form .persian-date-picker .calendar-days button {
        height: 30px;
        border-radius: 6px;
        color: #37474f;
        font-size: 11.5px;
    }

    .order-edit-form .persian-date-picker .calendar-days button:hover {
        background: #eceff1;
        color: #37474f;
    }

    .order-edit-form .persian-date-picker .calendar-days button.today {
        border-color: #90a4ae;
        color: #455a64;
    }

    .order-edit-form .persian-date-picker .calendar-days button.selected {
        background: #607d8b;
        color: #fff;
    }

    .order-edit-form .persian-date-picker .calendar-footer {
        margin-top: 9px;
        padding-top: 9px;
    }


/* منبع: Components\Shared\PersianDatePicker.razor */


    .persian-date-picker {
        position: relative;
        width: 100%;
    }


    .shamsi-input {
        
        direction: ltr;
        text-align: center;
        min-height: 40px;
        border-radius: 0 8px 8px 0  !important;
        font-family: Tahoma, Arial, sans-serif;
    }


    .calendar-button {
        min-width: 45px;
        border-radius:8px 0 0 8px !important;
    }


    .calendar-popup {
        position: absolute;
        top: calc(100% + 6px);
        right: 0;
        width: 290px;
        background: white;
        border: 1px solid #ddd;
        border-radius: 12px;
        box-shadow: 0 10px 30px rgba(0,0,0,.18);
        z-index: 10000;
        padding: 12px;
    }


    .calendar-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 12px;
    }


    .calendar-title {
        font-weight: 700;
        font-size: 14px;
        color: #343a40;
    }


    .calendar-nav {
        width: 34px;
        height: 34px;
        border: 1px solid #ddd;
        background: white;
        border-radius: 7px;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
    }


        .calendar-nav:hover {
            background: #f1f3f5;
        }


    .calendar-weekdays,
    .calendar-days {
        display: grid;
        grid-template-columns: repeat(7, 1fr);
        gap: 4px;
    }


    .calendar-weekdays {
        margin-bottom: 5px;
    }


        .calendar-weekdays div {
            text-align: center;
            font-size: 11px;
            font-weight: 700;
            color: #777;
            padding: 5px 0;
        }


    .calendar-days button {
        height: 34px;
        border: 0;
        background: white;
        border-radius: 7px;
        cursor: pointer;
        font-size: 12px;
    }


        .calendar-days button:hover {
            background: #e9f3ff;
            color: var(--theme-primary);
        }


        .calendar-days button.today {
            border: 1px solid var(--theme-primary);
            color: var(--theme-primary);
            font-weight: 700;
        }


        .calendar-days button.selected {
            background: var(--theme-primary);
            color: white;
            font-weight: 700;
        }


    .calendar-day.empty {
        height: 34px;
    }


    .calendar-footer {
        display: flex;
        justify-content: space-between;
        border-top: 1px solid #eee;
        margin-top: 10px;
        padding-top: 10px;
    }


        .calendar-footer button {
            font-size: 11px;
            border-radius: 6px;
        }

