body.app-shell--pos .content {
    padding-top: 18px;
}

.app-pos-content {
    padding-bottom: 18px;
}

.app-pos-layout {
    display: block;
}

.app-pos-stage {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
}

.app-pos-stage__main,
.app-pos-stage__sidebar {
    min-width: 0;
}

.app-pos-stage__main {
    flex: 1 1 60%;
}

.app-pos-stage__sidebar {
    flex: 1 1 40%;
}

@media (min-width: 1200px) {
    .app-pos-stage {
        flex-wrap: nowrap;
        gap: 14px;
    }

    .app-pos-stage__sidebar {
        order: 1;
        flex: 0 0 40%;
        width: 40% !important;
        max-width: 40%;
    }

    .app-pos-stage__main {
        order: 2;
        flex: 1 1 0;
        width: auto !important;
        max-width: none;
    }

    .app-pos-stage__sidebar .product_list {
        margin-bottom: 10px;
    }

    .app-pos-stage__sidebar .product_box {
        border-radius: 14px;
    }

    .app-pos-stage__sidebar .product_box .image-container {
        height: 92px;
        margin: 8px 8px 0;
        border-radius: 12px;
    }

    .app-pos-stage__sidebar .product_box .text_div {
        padding: 8px 10px 10px;
    }

    .app-pos-stage__sidebar .product_box .text {
        font-size: 12px;
        line-height: 1.3;
    }
}

.app-pos-stage__surface {
    border: 1px solid rgba(203, 213, 225, 0.84);
    border-radius: 28px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: var(--app-shadow-sm);
    overflow: hidden;
}

.app-pos-header .app-pos-header__panel,
.app-pos-header > div > div {
    border: 1px solid rgba(203, 213, 225, 0.84);
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.95) !important;
    box-shadow: var(--app-shadow-xs) !important;
}

.app-pos-header .app-pos-header__location {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.app-pos-header .app-pos-header__location-select {
    min-width: 180px;
    flex: 0 0 180px;
}

.app-pos-header .curr_datetime {
    font-family: var(--app-font-sans);
    letter-spacing: 0;
}

.app-pos-header #select_location_id,
.app-pos-header .app-pos-header__actions select {
    min-width: 180px;
}

.app-pos-header .app-pos-header__actions > a,
.app-pos-header .app-pos-header__actions > button,
.app-pos-header .app-pos-header__actions > span > i,
.app-pos-header .app-pos-header__actions > div > a,
.app-pos-header .app-pos-header__actions > div > button {
    min-height: 42px;
    border-radius: 14px !important;
}

.app-pos-header .app-pos-header__actions > a,
.app-pos-header .app-pos-header__actions > button {
    border: 1px solid rgba(203, 213, 225, 0.88) !important;
    background: rgba(255, 255, 255, 0.98) !important;
    box-shadow: none !important;
}

.app-pos-header .app-pos-header__actions > a:hover,
.app-pos-header .app-pos-header__actions > button:hover {
    transform: translateY(-1px);
    box-shadow: var(--app-shadow-xs) !important;
}

.app-pos-content .input-group,
.app-pos-content .select2-container--default .select2-selection--single,
.app-pos-content .form-control {
    font-size: 14px;
}

.app-pos-content #search_product {
    color: #0f172a;
    -webkit-text-fill-color: #0f172a;
    caret-color: #0f172a;
    background-color: #ffffff;
    font-size: 15px;
    font-weight: 700;
}

.app-pos-content #search_product::placeholder {
    color: #64748b;
    opacity: 1;
}

.app-pos-content .pos_product_div {
    padding-bottom: 4px;
}

.app-pos-content #pos_table {
    border: 1px solid rgba(203, 213, 225, 0.84);
    border-radius: 20px;
    overflow: hidden;
}

.app-pos-content #pos_table > thead > tr > th {
    padding-top: 16px;
    padding-bottom: 16px;
}

.app-pos-content #pos_table > tbody > tr > td {
    padding-top: 16px;
    padding-bottom: 16px;
}

.app-pos-content .pos_form_totals {
    margin-top: 18px;
    padding: 14px 16px;
    border: 1px solid rgba(203, 213, 225, 0.82);
    border-radius: 22px;
    background: linear-gradient(180deg, rgba(248, 250, 252, 0.88), rgba(255, 255, 255, 0.96));
}

.app-pos-content .pos_form_totals table td {
    padding: 10px 12px;
    border-color: rgba(203, 213, 225, 0.62);
}

.pos-form-actions {
    margin-top: 18px;
    border: 1px solid rgba(203, 213, 225, 0.84);
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.96) !important;
    box-shadow: var(--app-shadow-xs) !important;
}

.pos-form-actions button,
.pos-form-actions a {
    border-radius: 16px !important;
    box-shadow: none !important;
}

.pos-form-actions button:hover,
.pos-form-actions a:hover {
    transform: translateY(-1px);
}

.pos-total {
    padding: 10px 14px;
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(22, 163, 74, 0.1), rgba(37, 99, 235, 0.08));
}

.product_list {
    margin-bottom: 14px;
}

.product_box {
    height: 100%;
    border: 1px solid rgba(203, 213, 225, 0.84);
    border-radius: 22px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 250, 252, 0.94));
    box-shadow: var(--app-shadow-xs);
    overflow: hidden;
}

.product_box:hover {
    transform: translateY(-2px);
    box-shadow: var(--app-shadow-sm);
}

.product_box .image-container {
    height: 136px;
    margin: 12px 12px 0;
    border-radius: 18px;
    background-color: rgba(248, 250, 252, 0.94);
    background-size: cover !important;
}

.product_box .text_div {
    padding: 14px 14px 16px;
}

.product_box .text {
    display: block;
    color: var(--app-text) !important;
    font-size: 13px;
    font-weight: 800;
    line-height: 1.45;
}

.product_box small.text-muted {
    color: var(--app-text-soft) !important;
}

#product_category_div .tw-dw-drawer-content > label,
#product_brand_div .tw-dw-drawer-content > label,
.pos-filter-trigger {
    min-height: 36px;
    border-radius: 18px;
    box-shadow: var(--app-shadow-xs);
}

@media (min-width: 768px) {
    #product_category_div .tw-dw-drawer-content > label,
    #product_brand_div .tw-dw-drawer-content > label,
    .pos-filter-trigger {
        min-height: 48px;
    }
}

.pos-filter-drawer-panel {
    max-width: 100vw;
}

#product_list_body {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    padding-top: 8px;
}

.app-pos-stage__sidebar .box-widget,
.app-pos-stage__sidebar .tw-dw-menu,
.app-pos-stage__sidebar .tw-dw-card,
.app-pos-stage__sidebar .recent-transactions-box,
.app-pos-stage__sidebar .box {
    border-radius: 22px;
}

.app-pos-stage__sidebar .box-widget,
.app-pos-stage__sidebar .box {
    border: 1px solid rgba(203, 213, 225, 0.84);
    box-shadow: var(--app-shadow-xs);
}

.app-pos-stage__sidebar .box-header {
    background: transparent;
}

#mobile_product_suggestion_modal .modal-content {
    border-radius: 24px;
}

@media (max-width: 1199px) {
    .app-pos-stage {
        display: block;
    }

    .app-pos-stage__main,
    .app-pos-stage__sidebar {
        flex: 1 1 100%;
    }
}

@media (max-width: 767px) {
    .product_box .image-container {
        height: 110px;
    }

    .pos-form-actions {
        border-radius: 20px;
    }
}

#product_category_div .tw-dw-drawer-content > label,
#product_brand_div .tw-dw-drawer-content > label {
    min-height: 36px;
    border-radius: 18px;
}

body.app-shell--pos .pos-currency-row {
    display: block;
}

body.app-shell--pos .pos-currency-row > .js-currency-section {
    float: none;
    display: block;
    width: 100%;
    max-width: 360px;
    min-width: 220px;
    padding-left: 0;
    padding-right: 0;
}

body.app-shell--pos .pos-currency-row .js-currency-section .form-group {
    min-width: 220px;
}

body.app-shell--pos .pos-currency-row .select2-container {
    min-width: 220px !important;
    min-height: 38px;
}

body.app-shell--pos .pos-currency-row .select2-container--default .select2-selection--single {
    min-height: 38px;
    height: 38px;
}

body.app-shell--pos .pos-currency-row .select2-container--default .select2-selection--single .select2-selection__rendered {
    color: #0f172a !important;
    -webkit-text-fill-color: #0f172a !important;
    line-height: 36px !important;
}


body.app-shell--pos .pos-form-actions {
    padding-inline-end: 88px;
}

.pos-empty-cart-row td {
    text-align: center;
    padding: 28px 16px !important;
    color: #64748b;
    font-weight: 600;
    background: linear-gradient(180deg, rgba(248, 250, 252, 0.92), rgba(255, 255, 255, 0.96));
}

@media (max-width: 767px) {
    body.app-shell--pos {
        padding-bottom: 24px;
    }

    body.app-shell--pos .pos-form-actions {
        padding-inline-end: 72px;
    }

    .app-pos-content #pos_table {
        font-size: 12px;
    }

    .app-pos-content #pos_table .pos-col-unit-price {
        display: none;
    }

    .app-pos-content #pos_table > thead > tr > th:nth-child(1),
    .app-pos-content #pos_table > tbody > tr.product_row > td:nth-child(1) {
        min-width: 110px;
    }

    .app-pos-content #pos_table > thead > tr > th:nth-child(2),
    .app-pos-content #pos_table > tbody > tr.product_row > td:nth-child(2) {
        min-width: 72px;
    }

    .pos-filter-drawer-panel {
        width: 100% !important;
        max-width: 100vw;
    }
}

/* ============================================================
   تنسيقات أزرار التبديل بين النقد والآجل (Invoice Payment Type Toggle)
   ============================================================ */
.invoice-payment-type-wrapper {
    margin: 8px 0 20px 0;
    width: 100%;
}
.invoice-payment-type-toggle {
    display: flex;
    gap: 16px;
    width: 100%;
}
.payment-type-card {
    flex: 1;
    margin: 0;
    cursor: pointer;
    position: relative;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    display: block;
}
.payment-type-card input[type="radio"].payment-type-radio {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    margin: 0;
    pointer-events: none;
}
.payment-type-content {
    display: flex;
    align-items: center;
    position: relative;
    padding: 16px 20px;
    background: #ffffff;
    border: 2px solid #e2e8f0;
    border-radius: 14px;
    transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}
.payment-type-card:hover .payment-type-content {
    border-color: #cbd5e1;
    background: #f8fafc;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.07);
}

.payment-type-indicator {
    position: absolute;
    top: 12px;
    font-size: 19px;
    color: #cbd5e1;
    transition: all 0.2s ease;
    line-height: 1;
}
.payment-type-indicator .indicator-active { display: none; }
.payment-type-indicator .indicator-inactive { display: inline-block; }

[dir="rtl"] .payment-type-indicator,
html[lang="ar"] .payment-type-indicator {
    left: 14px;
    right: auto;
}
[dir="ltr"] .payment-type-indicator,
html[lang="en"] .payment-type-indicator {
    right: 14px;
    left: auto;
}

.payment-type-icon-box {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    background: #f1f5f9;
    color: #64748b;
    transition: all 0.22s ease;
    flex-shrink: 0;
}
[dir="rtl"] .payment-type-icon-box,
html[lang="ar"] .payment-type-icon-box {
    margin-left: 16px;
    margin-right: 0;
}
[dir="ltr"] .payment-type-icon-box,
html[lang="en"] .payment-type-icon-box {
    margin-right: 16px;
    margin-left: 0;
}

.payment-type-text {
    display: flex;
    flex-direction: column;
}
[dir="rtl"] .payment-type-text,
html[lang="ar"] .payment-type-text {
    text-align: right;
}
[dir="ltr"] .payment-type-text,
html[lang="en"] .payment-type-text {
    text-align: left;
}
.payment-type-title {
    font-size: 17px;
    font-weight: 700;
    color: #334155;
    line-height: 1.3;
    transition: color 0.2s ease;
}
.payment-type-subtitle {
    font-size: 12.5px;
    font-weight: 500;
    color: #94a3b8;
    margin-top: 3px;
    transition: color 0.2s ease;
}

/* 🟢 Active Cash */
.payment-type-card.payment-type-cash.is-active .payment-type-content,
.payment-type-card.payment-type-cash .payment-type-radio:checked + .payment-type-content {
    border-color: #059669;
    background: linear-gradient(135deg, #ecfdf5 0%, #f0fdf4 100%);
    box-shadow: 0 4px 16px -2px rgba(16, 185, 129, 0.35), 0 0 0 1.5px #059669;
    transform: translateY(-1px);
}
.payment-type-card.payment-type-cash.is-active .payment-type-icon-box,
.payment-type-card.payment-type-cash .payment-type-radio:checked + .payment-type-content .payment-type-icon-box {
    background: #059669;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.35);
    transform: scale(1.06);
}
.payment-type-card.payment-type-cash.is-active .payment-type-title,
.payment-type-card.payment-type-cash .payment-type-radio:checked + .payment-type-content .payment-type-title {
    color: #065f46;
}
.payment-type-card.payment-type-cash.is-active .payment-type-subtitle,
.payment-type-card.payment-type-cash .payment-type-radio:checked + .payment-type-content .payment-type-subtitle {
    color: #047857;
    font-weight: 600;
}
.payment-type-card.payment-type-cash.is-active .payment-type-indicator,
.payment-type-card.payment-type-cash .payment-type-radio:checked + .payment-type-content .payment-type-indicator {
    color: #059669;
}
.payment-type-card.payment-type-cash.is-active .payment-type-indicator .indicator-active,
.payment-type-card.payment-type-cash .payment-type-radio:checked + .payment-type-content .payment-type-indicator .indicator-active {
    display: inline-block;
}
.payment-type-card.payment-type-cash.is-active .payment-type-indicator .indicator-inactive,
.payment-type-card.payment-type-cash .payment-type-radio:checked + .payment-type-content .payment-type-indicator .indicator-inactive {
    display: none;
}

/* 🔵 Active Credit */
.payment-type-card.payment-type-credit.is-active .payment-type-content,
.payment-type-card.payment-type-credit .payment-type-radio:checked + .payment-type-content {
    border-color: #2563eb;
    background: linear-gradient(135deg, #eff6ff 0%, #f8faff 100%);
    box-shadow: 0 4px 16px -2px rgba(37, 99, 235, 0.35), 0 0 0 1.5px #2563eb;
    transform: translateY(-1px);
}
.payment-type-card.payment-type-credit.is-active .payment-type-icon-box,
.payment-type-card.payment-type-credit .payment-type-radio:checked + .payment-type-content .payment-type-icon-box {
    background: #2563eb;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
    transform: scale(1.06);
}
.payment-type-card.payment-type-credit.is-active .payment-type-title,
.payment-type-card.payment-type-credit .payment-type-radio:checked + .payment-type-content .payment-type-title {
    color: #1e3a8a;
}
.payment-type-card.payment-type-credit.is-active .payment-type-subtitle,
.payment-type-card.payment-type-credit .payment-type-radio:checked + .payment-type-content .payment-type-subtitle {
    color: #1d4ed8;
    font-weight: 600;
}
.payment-type-card.payment-type-credit.is-active .payment-type-indicator,
.payment-type-card.payment-type-credit .payment-type-radio:checked + .payment-type-content .payment-type-indicator {
    color: #2563eb;
}
.payment-type-card.payment-type-credit.is-active .payment-type-indicator .indicator-active,
.payment-type-card.payment-type-credit .payment-type-radio:checked + .payment-type-content .payment-type-indicator .indicator-active {
    display: inline-block;
}
.payment-type-card.payment-type-credit.is-active .payment-type-indicator .indicator-inactive,
.payment-type-card.payment-type-credit .payment-type-radio:checked + .payment-type-content .payment-type-indicator .indicator-inactive {
    display: none;
}

@media (max-width: 767px) {
    .invoice-payment-type-toggle {
        flex-direction: column;
        gap: 10px;
    }
    .payment-type-content {
        padding: 12px 14px;
        border-radius: 12px;
    }
    .payment-type-icon-box {
        width: 44px;
        height: 44px;
        font-size: 20px;
    }
    .payment-type-title {
        font-size: 15.5px;
    }
    .payment-type-subtitle {
        font-size: 12px;
    }
}
