/* CRM v6.87.3 — final visual consistency layer */

.crm-market-ui,
.crm-market-ui * {
    box-sizing: border-box;
}

.crm-market-ui {
    max-width: 100%;
    overflow-x: hidden;
}

.crm-market-ui .crm-main,
.crm-market-ui .crm-page-shell,
.crm-market-ui .crm-page-shell > *,
.crm-market-ui .crm-panel,
.crm-market-ui .row > [class*="col-"] {
    min-width: 0;
}

.crm-market-ui .crm-page-shell {
    row-gap: 24px;
}

.crm-market-ui .crm-page-shell h1,
.crm-market-ui .crm-page-shell h2,
.crm-market-ui .crm-page-shell h3,
.crm-market-ui .crm-page-shell h4 {
    overflow-wrap: anywhere;
}

.crm-market-ui .crm-page-shell h1 + p,
.crm-market-ui .crm-page-shell h2 + p,
.crm-market-ui .crm-page-shell h3 + p,
.crm-market-ui .crm-page-shell h4 + p {
    margin-top: 6px !important;
    color: var(--crm-muted, #667085) !important;
    line-height: 1.9;
}

.crm-market-ui .crm-panel > h2 + .table-responsive,
.crm-market-ui .crm-panel > h3 + .table-responsive,
.crm-market-ui .crm-panel > h2 + form,
.crm-market-ui .crm-panel > h3 + form,
.crm-market-ui .crm-panel > .crm-page-head + .table-responsive {
    margin-top: 16px !important;
}

.crm-market-ui .crm-actions,
.crm-market-ui .crm-form-action,
.crm-market-ui .tools-stage1-transition-actions,
.crm-market-ui .tools-stage2-transition-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.crm-market-ui .crm-btn,
.crm-market-ui button.crm-btn,
.crm-market-ui a.crm-btn {
    min-height: 40px;
    border-radius: 11px;
    padding-inline: 16px;
    line-height: 1.5;
    white-space: nowrap;
}

.crm-market-ui .crm-btn-sm,
.crm-market-ui button.crm-btn-sm,
.crm-market-ui a.crm-btn-sm {
    min-height: 34px;
    padding-inline: 12px;
    border-radius: 9px;
}

.crm-market-ui .table-responsive,
.crm-market-ui .crm-responsive-table {
    max-width: 100%;
    border-radius: 14px;
}

.crm-market-ui table th,
.crm-market-ui table td {
    vertical-align: middle;
}

.crm-market-ui table td[dir="ltr"],
.crm-market-ui table th[dir="ltr"],
.crm-market-ui table .crm-id-cell,
.crm-market-ui table .crm-money-cell {
    direction: ltr;
    text-align: left;
    white-space: nowrap;
}

/* Keep action controls reachable when a wide RTL table scrolls horizontally. */
.crm-market-ui .table-responsive table tbody td.crm-actions,
.crm-market-ui .table-responsive table tbody td[data-label="عملیات"],
.crm-market-ui .table-responsive table tbody td:has(.crm-actions),
.crm-market-ui .table-responsive table tbody td:has(> .crm-btn),
.crm-market-ui .table-responsive table tbody td:has(> form .crm-btn) {
    position: sticky;
    left: 0;
    z-index: 3;
    min-width: 132px;
    background: var(--crm-surface, #fff) !important;
    box-shadow: 8px 0 14px rgba(31, 41, 55, .08);
    white-space: nowrap;
}

.crm-market-ui .table-responsive table tbody tr:hover td.crm-actions,
.crm-market-ui .table-responsive table tbody tr:hover td[data-label="عملیات"],
.crm-market-ui .table-responsive table tbody tr:hover td:has(.crm-actions),
.crm-market-ui .table-responsive table tbody tr:hover td:has(> .crm-btn),
.crm-market-ui .table-responsive table tbody tr:hover td:has(> form .crm-btn) {
    background: #fbfcff !important;
}

.crm-market-ui .table-responsive table tbody td:has(> .crm-btn),
.crm-market-ui .table-responsive table tbody td:has(> form .crm-btn) {
    padding-inline: 12px !important;
}

/* Datepicker: keep the grid and navigation controls visible at every width. */
.crm-market-ui .crm-jalali-popup {
    box-sizing: border-box;
    direction: rtl;
    overflow-x: hidden !important;
}

.crm-market-ui .crm-jalali-head {
    gap: 10px;
}

.crm-market-ui .crm-jalali-head button {
    flex: 0 0 38px;
    width: 38px;
    min-width: 38px;
    padding: 0 !important;
    border: 1px solid color-mix(in srgb, var(--crm-primary) 15%, #fff) !important;
    color: var(--crm-primary) !important;
    font-size: 28px !important;
    line-height: 30px !important;
}

.crm-market-ui .crm-jalali-head button span {
    display: inline-block;
    min-width: 12px;
    line-height: 1;
}

.crm-market-ui .crm-jalali-week,
.crm-market-ui .crm-jalali-days {
    width: 100%;
    padding-inline: 1px;
}

@media (max-width: 767.98px) {
    .crm-market-ui .crm-page-shell {
        row-gap: 18px;
    }

    .crm-market-ui .crm-panel {
        padding: 16px !important;
    }

    .crm-market-ui .crm-page-head {
        gap: 12px !important;
    }

    .crm-market-ui .crm-btn,
    .crm-market-ui button.crm-btn,
    .crm-market-ui a.crm-btn {
        min-height: 38px;
    }
}
