@import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@400;500;600;700;800&display=swap');

:root {
    --primary: #1769aa;
    --primary-light: #eaf4fc;
    --dark: #172b43;
    --text: #344054;
    --muted: #8491a3;
    --border: #e5eaf0;
    --bg: #f4f7fb;
    --green: #15966a;
    --red: #dc4c4c;
    --orange: #d98518;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Vazirmatn', Tahoma, sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 13px;
}

button, input, select, textarea {
    font: inherit;
}

button {
    cursor: pointer;
}

/* حذف اسپینر input number */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type="number"] {
    -moz-appearance: textfield;
    appearance: textfield;
}

.app {
    min-height: 100vh;
    display: flex;
}

/* ========================================
   Sidebar
======================================== */

.sidebar {
    width: 225px;
    background: var(--dark);
    color: #fff;
    padding: 24px 14px;
    flex-shrink: 0;
}

.brand {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 0 9px 25px;
    border-bottom: 1px solid #34445a;
}

.brand-logo {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: #fff;
    color: var(--primary);
    font-size: 22px;
    font-weight: 800;
}

.brand h2 {
    margin: 0;
    font-size: 15px;
}

.brand small {
    color: #a9bbcf;
    font-size: 11px;
}

.menu-title {
    color: #8fa2b9;
    font-size: 11px;
    margin: 27px 12px 12px;
}

.menu a {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #cbd6e3;
    text-decoration: none;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 5px;
    transition: .2s;
}

    .menu a:hover,
    .menu a.active {
        background: #254666;
        color: #fff;
    }

    .menu a.active {
        border-right: 3px solid #69b8ff;
    }

.menu-icon {
    width: 20px;
    text-align: center;
    font-size: 16px;
}

.menu-badge {
    margin-right: auto;
    background: #e05b61;
    color: #fff;
    border-radius: 20px;
    padding: 2px 7px;
    font-size: 10px;
}

/* ========================================
   Main
======================================== */

.main {
    flex: 1;
    min-width: 0;
}

.topbar {
    height: 68px;
    background: #fff;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
}

.breadcrumb {
    color: var(--muted);
    font-size: 12px;
}

    .breadcrumb strong {
        color: var(--dark);
        margin-right: 6px;
    }

.profile {
    display: flex;
    align-items: center;
    gap: 12px;
}

.profile-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    color: var(--primary);
    background: var(--primary-light);
    font-weight: 700;
}

.profile-info strong {
    display: block;
    font-size: 12px;
}

.profile-info small {
    color: var(--muted);
    font-size: 11px;
}

.content {
    padding: 6px 28px 40px;
    max-width: 1700px;
    margin: auto;
}

.page-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    margin-bottom: 14px;
}

    .page-heading h1 {
        font-size: 20px;
        color: var(--dark);
        margin: 0 0 4px;
    }

    .page-heading p {
        margin: 0;
        color: var(--muted);
        font-size: 12px;
    }

/* ========================================
   Steps
======================================== */

.steps {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
    background: #fff;
    border: 1px solid var(--border);
    padding: 10px 16px;
    border-radius: 10px;
    overflow-x: auto;
}

.step {
    display: flex;
    align-items: center;
    gap: 9px;
    white-space: nowrap;
    color: var(--muted);
    font-size: 12px;
}

.step-number {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #edf1f5;
    display: grid;
    place-items: center;
    font-weight: 700;
    font-size: 12px;
}

.step.active {
    color: var(--primary);
    font-weight: 700;
}

    .step.active .step-number {
        color: #fff;
        background: var(--primary);
    }

.step-line {
    height: 1px;
    min-width: 30px;
    flex: 1;
    background: var(--border);
}

/* ========================================
   Layout
======================================== */

.order-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 16px;
    align-items: start;
}

.panel {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 10px;
    margin-bottom: 14px;
    overflow: hidden;
}

.panel-header {
    padding: 13px 18px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

    .panel-header h3 {
        margin: 0;
        color: var(--dark);
        font-size: 14px;
    }

.panel-body {
    padding: 14px 18px;
}

.muted {
    color: var(--muted);
}

.small {
    font-size: 11px;
}

/* ========================================
   Product filters
======================================== */

.product-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-bottom: 12px;
}

.search-box {
    flex: 1;
    min-width: 180px;
    position: relative;
}

    .search-box input {
        width: 100%;
        height: 36px;
        border: 1px solid var(--border);
        border-radius: 8px;
        padding: 0 12px;
        outline: none;
        font-size: 12px;
    }

        .search-box input:focus,
        .form-control:focus {
            border-color: var(--primary);
            box-shadow: 0 0 0 3px #1769aa15;
        }

/* ========================================
   Tabs
======================================== */

.tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 10px;
}

.tab-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #fff;
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: 7px;
    padding: 7px 12px;
    font-size: 12px;
    font-weight: 600;
    transition: background-color .2s, border-color .2s, color .2s;
    position: relative;
}

    .tab-btn:hover {
        background: var(--primary-light);
        border-color: #b8d9f3;
    }

    .tab-btn.active {
        background: var(--primary);
        color: #fff;
        border-color: var(--primary);
    }

.tab-badge {
    display: inline-grid;
    place-items: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 10px;
    background: #edf1f5;
    color: var(--text);
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
}

.tab-btn.active .tab-badge {
    background: rgba(255, 255, 255, 0.25);
    color: #fff;
}

.tab-cart {
    margin-right: auto;
}

.tab-badge-cart {
    background: var(--green);
    color: #fff;
}

.tab-btn.active .tab-badge-cart {
    background: #fff;
    color: var(--green);
}

/* ========================================
   Table
======================================== */

.table-wrap {
    width: 100%;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    white-space: nowrap;
}

thead {
    background: #f7f9fc;
}

th {
    color: #67768a;
    font-weight: 600;
    font-size: 11px;
    text-align: right;
}

th, td {
    padding: 10px 12px;
    border-bottom: 1px solid #edf0f4;
    font-size: 12px;
}

tbody tr:hover {
    background: #fbfdff;
}

tbody tr:last-child td {
    border-bottom: 0;
}

.product-name {
    font-weight: 600;
    color: var(--dark);
}

.product-code {
    font-size: 10px;
    color: var(--muted);
    margin-top: 3px;
}

.unit-label {
    background: #f0f3f7;
    padding: 3px 8px;
    border-radius: 5px;
    font-size: 11px;
}

.price {
    font-weight: 600;
}

.quantity-control {
    display: flex;
    align-items: center;
    gap: 5px;
}

    .quantity-control button {
        width: 26px;
        height: 28px;
        border: 1px solid var(--border);
        border-radius: 6px;
        background: #fff;
        color: var(--primary);
        font-size: 16px;
        line-height: 1;
    }

        .quantity-control button:hover {
            background: var(--primary-light);
        }

.quantity-input {
    width: 52px;
    height: 28px;
    border: 1px solid var(--border);
    border-radius: 6px;
    text-align: center;
    outline: none;
    font-size: 12px;
}

.line-total {
    color: var(--primary);
    font-weight: 700;
}

.empty-row {
    text-align: center;
    padding: 30px;
    color: var(--muted);
}

.cart-empty {
    text-align: center;
    padding: 26px 20px;
    color: var(--muted);
}

.cart-empty-icon {
    font-size: 38px;
    margin-bottom: 10px;
    opacity: .5;
}

.cart-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 10px 16px;
    background: #f8fafc;
    border-top: 1px solid var(--border);
}

.btn-link {
    background: none;
    border: 0;
    color: var(--red);
    font-weight: 600;
    cursor: pointer;
    font-size: 12px;
    padding: 5px 10px;
    border-radius: 6px;
}

    .btn-link:hover {
        background: #fdecec;
    }

    .btn-link.primary-link {
        color: var(--primary);
    }

        .btn-link.primary-link:hover {
            background: var(--primary-light);
        }

/* ========================================
   Forms
======================================== */

.form-group {
    margin-bottom: 12px;
}

    .form-group label {
        display: block;
        font-weight: 600;
        margin-bottom: 6px;
        color: var(--text);
        font-size: 12px;
    }

.form-control {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 10px;
    outline: none;
    background: #fff;
    font-size: 12px;
    transition: border-color .2s, box-shadow .2s;
    -moz-appearance: textfield;
    appearance: textfield;
}

textarea.form-control {
    resize: vertical;
    min-height: 70px;
}

/* ========================================
   Summary Column
======================================== */

.summary-column {
    position: sticky;
    top: 15px;
    align-self: start;
}

.summary-card {
    margin-bottom: 14px;
}

    .summary-card .panel-header {
        background: #fbfdff;
    }

    .summary-card .panel-body {
        padding: 12px 16px;
    }

.summary-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 9px;
    font-size: 12px;
}

    .summary-line span:first-child {
        color: #66758a;
    }

    .summary-line strong {
        color: var(--dark);
    }

.discount-value {
    color: var(--green) !important;
}

.debt-box {
    background: #fff8eb;
    border: 1px solid #f4e3bf;
    border-radius: 8px;
    padding: 10px 12px;
    margin: 10px 0;
}

    .debt-box .summary-line {
        margin-bottom: 7px;
    }

        .debt-box .summary-line:last-child {
            margin-bottom: 0;
        }

.total-box {
    padding: 12px 14px;
    border-radius: 9px;
    background: var(--primary-light);
    margin-top: 12px;
}

    .total-box .summary-line {
        margin-bottom: 6px;
    }

        .total-box .summary-line strong {
            color: var(--primary);
        }

.total-amount {
    font-size: 17px;
    font-weight: 800;
}

.currency {
    font-size: 10px;
    color: var(--muted);
    margin-right: 3px;
}

.summary-card .form-group {
    margin-bottom: 10px;
}

    .summary-card .form-group label {
        font-size: 12px;
        margin-bottom: 5px;
    }

.summary-card .form-control {
    padding: 8px 10px;
    font-size: 12px;
}

/* ========================================
   Payment Methods - ردیف دکمه‌ای
======================================== */

.payment-methods {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    margin-bottom: 14px;
    background: #f7f9fc;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 4px;
}

    .payment-methods input {
        position: absolute;
        opacity: 0;
        pointer-events: none;
    }

    .payment-methods label {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 5px;
        padding: 8px 5px;
        border-radius: 7px;
        cursor: pointer;
        font-weight: 600;
        font-size: 11px;
        color: #67768a;
        transition: background-color .2s, color .2s, box-shadow .2s;
        user-select: none;
    }

        .payment-methods label:hover {
            color: var(--primary);
        }

    .payment-methods input:checked + label {
        background: #fff;
        color: var(--primary);
        box-shadow: 0 1px 3px rgba(23, 105, 170, .15);
    }

.payment-icon {
    font-size: 14px;
    line-height: 1;
}

.payment-details {
    background: #f8fafc;
    padding: 12px;
    border-radius: 9px;
    border: 1px solid var(--border);
}

    .payment-details[hidden] {
        display: none;
    }

/* ========================================
   Buttons
======================================== */

.btn {
    width: 100%;
    border: 0;
    padding: 11px 14px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 12px;
    transition: .2s;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
}

    .btn-primary:hover {
        background: #0e548d;
    }

    .btn-primary:disabled {
        opacity: .55;
        cursor: not-allowed;
    }

.notice {
    display: flex;
    gap: 8px;
    padding: 10px;
    margin-top: 10px;
    background: #f1f8ff;
    border-radius: 8px;
    color: #436c91;
    line-height: 1.7;
    font-size: 11px;
}

/* ========================================
   Status
======================================== */

.status {
    display: inline-block;
    padding: 4px 9px;
    border-radius: 20px;
    font-size: 10px;
    background: #fff4d9;
    color: #a76c0b;
}

    .status.approved {
        background: #e4f7ee;
        color: #13815a;
    }

    .status.shipping {
        background: #e8f2ff;
        color: #2868aa;
    }

/* ========================================
   Toast
======================================== */

.toast {
    position: fixed;
    bottom: 20px;
    left: 20px;
    max-width: calc(100% - 40px);
    background: #172b43;
    color: #fff;
    padding: 12px 18px;
    border-radius: 9px;
    box-shadow: 0 5px 25px #0002;
    display: none;
    z-index: 1000;
    font-size: 12px;
}

    .toast.show {
        display: block;
        animation: fadeIn .25s ease;
    }

    .toast.success {
        background: #13815a;
    }

    .toast.error {
        background: #b53a3a;
    }

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================
   Responsive
======================================== */

@media (max-width: 1100px) {
    .order-layout {
        grid-template-columns: minmax(0, 1fr) 300px;
    }

    .sidebar {
        width: 190px;
    }

    .content {
        padding: 20px 16px;
    }
}

@media (max-width: 850px) {
    .sidebar {
        display: none;
    }

    .order-layout {
        grid-template-columns: 1fr;
    }

    .summary-column {
        position: static;
    }

    .topbar {
        padding: 0 16px;
    }

    .steps {
        padding: 10px;
    }
}

@media (max-width: 500px) {
    .content {
        padding: 16px 10px;
    }

    .page-heading h1 {
        font-size: 18px;
    }

    .page-heading {
        align-items: flex-start;
    }

    .profile-info {
        display: none;
    }

    .panel-header,
    .panel-body {
        padding: 12px;
    }

    .payment-methods {
        gap: 4px;
    }

        .payment-methods label {
            font-size: 10px;
            padding: 7px 3px;
        }

    .tab-cart {
        margin-right: 0;
        width: 100%;
    }
}
.hidden{
    display:none !important;
}