/* ── POS & Cash Sales ── */



.pos-mobile-only { display: none; }

.pos-desktop-only { display: block; }



/* ── POS page shell ── */

.pos-sales-shell {

    min-height: 0;

}



.pos-page-body {

    flex: 1 1 0;

    min-height: 0;

    overflow-y: auto;

    overflow-x: hidden;

    -webkit-overflow-scrolling: touch;

    overscroll-behavior: contain;

    padding: 12px 14px;

    padding-bottom: 16px;

}



.pos-segmented {

    display: none;

    gap: 6px;

    padding: 3px;

    margin-bottom: 10px;

    border-radius: 12px;

    background: #f1f5f9;

    border: 1px solid #e2e8f0;

    flex-shrink: 0;

}



.pos-segmented__btn {

    flex: 1 1 0;

    display: inline-flex;

    align-items: center;

    justify-content: center;

    gap: 6px;

    min-height: 40px;

    padding: 8px 12px;

    border: none;

    border-radius: 10px;

    background: transparent;

    color: #64748b;

    font-family: inherit;

    font-size: 13px;

    font-weight: 700;

    cursor: pointer;

    touch-action: manipulation;

    -webkit-tap-highlight-color: transparent;

    transition: background 0.15s, color 0.15s, box-shadow 0.15s;

}



.pos-segmented__btn.is-active {

    background: #fff;

    color: #0f766e;

    box-shadow: 0 2px 10px rgba(15, 118, 110, 0.12);

}



.pos-segmented__badge {

    min-width: 20px;

    height: 20px;

    padding: 0 5px;

    border-radius: 999px;

    background: #0f766e;

    color: #fff;

    font-size: 10px;

    font-weight: 800;

    display: inline-flex;

    align-items: center;

    justify-content: center;

}



.pos-page-layout {

    display: grid;

    grid-template-columns: minmax(0, 1fr) minmax(300px, 380px);

    gap: 14px;

    align-items: start;

}



.pos-zone {

    display: flex;

    flex-direction: column;

    min-height: 0;

    border: 1px solid var(--border);

    border-radius: 18px;

    background: linear-gradient(180deg, #fff 0%, #f8fafc 100%);

    box-shadow: 0 4px 18px rgba(15, 23, 42, 0.06);

    overflow: hidden;

}



.pos-zone__head {

    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 10px;

    padding: 14px 16px 12px;

    border-bottom: 1px solid rgba(226, 232, 240, 0.9);

    background: rgba(255, 255, 255, 0.95);

    flex-shrink: 0;

}



.pos-zone__head strong {

    display: block;

    font-size: 14px;

    font-weight: 800;

    color: #0f172a;

}



.pos-zone__head span {

    display: block;

    margin-top: 2px;

    font-size: 11px;

    color: var(--text-muted);

}



.pos-zone__step {

    width: 28px;

    height: 28px;

    border-radius: 9px;

    display: inline-flex;

    align-items: center;

    justify-content: center;

    font-size: 12px;

    font-weight: 800;

    color: #fff;

    background: linear-gradient(135deg, #16a34a, #0f766e);

    flex-shrink: 0;

}



.pos-zone__step--finance {

    background: linear-gradient(135deg, #0284c7, #0f766e);

}



.pos-zone__body {

    display: flex;

    flex-direction: column;

    gap: 12px;

    padding: 14px 16px 16px;

    min-height: 0;

}



.pos-filters {

    display: grid;

    gap: 10px;

    flex-shrink: 0;

}



.pos-search {

    position: relative;

}



.pos-search .input {

    padding-inline-start: 38px;

}



.pos-search__icon {

    position: absolute;

    inset-inline-start: 12px;

    top: 50%;

    transform: translateY(-50%);

    color: #94a3b8;

    pointer-events: none;

}



.pos-tiles-area {

    min-height: 200px;

}



.pos-tiles-grid {

    display: grid;

    grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));

    gap: 10px;

}



.pos-tile {

    position: relative;

    display: flex;

    flex-direction: column;

    align-items: stretch;

    gap: 8px;

    padding: 14px 12px 12px;

    border: 1px solid #e2e8f0;

    border-radius: 16px;

    background: #fff;

    cursor: pointer;

    text-align: right;

    touch-action: manipulation;

    -webkit-tap-highlight-color: transparent;

    transition: transform 0.12s, border-color 0.15s, box-shadow 0.15s;

    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);

    min-height: 118px;

}



@media (hover: hover) and (pointer: fine) {

    .pos-tile:hover,

    .pos-tile:focus-visible {

        border-color: rgba(13, 148, 136, 0.45);

        box-shadow: 0 8px 22px rgba(15, 118, 110, 0.12);

    }

}



.pos-tile.is-in-cart {

    border-color: rgba(13, 148, 136, 0.45);

    box-shadow: 0 8px 22px rgba(15, 118, 110, 0.12);

    background: linear-gradient(180deg, #f0fdfa 0%, #fff 100%);

}



.pos-tile:active {

    transform: scale(0.985);

}



.pos-tile__cart-qty {

    position: absolute;

    top: 10px;

    inset-inline-start: 10px;

    min-width: 26px;

    height: 26px;

    padding: 0 6px;

    border-radius: 999px;

    background: #0f766e;

    color: #fff;

    font-size: 11px;

    font-weight: 800;

    display: inline-flex;

    align-items: center;

    justify-content: center;

}



.pos-tile__badge {

    align-self: flex-start;

    font-size: 10px;

    font-weight: 700;

    padding: 3px 8px;

    border-radius: 999px;

    background: #ecfdf5;

    color: #0f766e;

}



.pos-tile__badge.is-low {

    background: #fef3c7;

    color: #b45309;

}



.pos-tile__name {

    font-size: 13px;

    font-weight: 800;

    color: #0f172a;

    line-height: 1.45;

    flex: 1;

    padding-top: 4px;

}



.pos-tile__price {

    font-size: 14px;

    font-weight: 800;

    color: #0f766e;

    padding-top: 6px;

    border-top: 1px dashed #e2e8f0;

}



.pos-cart-area {

    min-height: 80px;

    flex: 1 1 auto;

    min-height: 0;

    overflow-y: auto;

    -webkit-overflow-scrolling: touch;

}



.pos-cart-lines {

    display: flex;

    flex-direction: column;

    gap: 10px;

}



.pos-cart-line {

    padding: 14px;

    border-radius: 16px;

    border: 1px solid #e2e8f0;

    background: #fff;

    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);

}



.pos-cart-line__name {

    font-size: 14px;

    font-weight: 800;

    color: #0f172a;

    line-height: 1.4;

}



.pos-cart-line__unit {

    margin-top: 4px;

    font-size: 11px;

    color: var(--text-muted);

}



.pos-cart-line__actions {

    display: flex;

    flex-wrap: wrap;

    align-items: center;

    gap: 10px;

    margin-top: 12px;

    padding-top: 12px;

    border-top: 1px solid #f1f5f9;

}



.pos-cart-line__total {

    margin-inline-start: auto;

    font-size: 14px;

    font-weight: 800;

    color: #0f766e;

}



.pos-qty-stepper {

    display: inline-flex;

    align-items: center;

    gap: 4px;

    padding: 4px;

    border-radius: 12px;

    background: #f8fafc;

    border: 1px solid #e2e8f0;

}



.pos-qty-stepper__btn {

    width: 36px;

    height: 36px;

    border: none;

    border-radius: 10px;

    background: #fff;

    color: #0f766e;

    font-size: 18px;

    font-weight: 700;

    cursor: pointer;

    touch-action: manipulation;

    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);

}



.pos-qty-stepper .qty-input {

    width: 56px;

    text-align: center;

    border: none;

    background: transparent;

    min-height: 36px;

    padding: 4px;

}



.pos-cart-empty {

    display: flex;

    flex-direction: column;

    align-items: center;

    justify-content: center;

    gap: 10px;

    padding: 32px 16px;

    border-radius: 16px;

    border: 1px dashed #cbd5e1;

    background: #f8fafc;

    color: var(--text-muted);

    text-align: center;

    font-size: 13px;

}



.pos-cart-empty__icon {

    width: 48px;

    height: 48px;

    border-radius: 16px;

    display: flex;

    align-items: center;

    justify-content: center;

    background: #ecfdf5;

    color: #0f766e;

    font-size: 22px;

}



.pos-pay-grid {

    display: grid;

    gap: 10px;

    flex-shrink: 0;

}



.pos-checkout-inline {

    margin-top: 4px;

    padding-top: 14px;

    border-top: 1px solid #e2e8f0;

    display: flex;

    flex-direction: column;

    gap: 12px;

    flex-shrink: 0;

}



.pos-checkout-summary {

    display: grid;

    grid-template-columns: repeat(2, minmax(0, 1fr));

    gap: 10px;

}



.pos-checkout-metric {

    padding: 12px 14px;

    border-radius: 12px;

    background: #f8fafc;

    border: 1px solid #e2e8f0;

}



.pos-checkout-metric.is-total {

    background: linear-gradient(135deg, #ecfdf5, #f0fdfa);

    border-color: rgba(13, 148, 136, 0.25);

}



.pos-checkout-metric__label {

    display: block;

    font-size: 11px;

    font-weight: 600;

    color: var(--text-muted);

    margin-bottom: 4px;

}



.pos-checkout-metric__value {

    font-size: 18px;

    font-weight: 800;

    color: #0f172a;

}



.pos-checkout-metric.is-total .pos-checkout-metric__value {

    color: #0f766e;

}



.pos-checkout-btn {

    width: 100%;

    min-height: 48px;

    font-size: 15px;

    font-weight: 800;

}



.pos-checkout-hint {

    margin: 0;

    font-size: 12px;

    color: var(--text-muted);

    text-align: center;

}



.pos-checkout-dock {

    flex-shrink: 0;

    padding: 8px 12px calc(8px + var(--safe-bottom, 0px));

    background: rgba(255, 255, 255, 0.98);

    border-top: 1px solid var(--border);

    box-shadow: 0 -4px 20px rgba(15, 23, 42, 0.08);

    backdrop-filter: blur(10px);

    -webkit-backdrop-filter: blur(10px);

}



.pos-checkout-dock__alert {

    grid-column: 1 / -1;

    margin-bottom: 0;

    font-size: 12px;

    padding: 8px 10px;

}



.btn-toolbar--compact {

    min-height: 34px !important;

    padding: 5px 10px !important;

    font-size: 12px !important;

}



/* ── History ── */

.cash-sales-history-shell {

    min-height: 0;

}



.cash-sales-scroll-body {

    display: flex;

    flex-direction: column;

    gap: 12px;

    padding: 12px 14px;

    padding-bottom: calc(20px + var(--safe-bottom, 0px));

}



.cash-sales-scroll-body .cash-sales-filter-card,

.cash-sales-scroll-body .cash-sales-stats-strip {

    margin-bottom: 0;

}



.cash-sales-scroll-body .responsive-data-list__mobile {

    display: flex;

    flex-direction: column;

    gap: 10px;

    padding-bottom: 8px;

}



.cash-sales-filter-card {

    display: grid;

    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));

    gap: 10px;

    padding: 14px 16px;

    border-radius: 16px;

    border: 1px solid var(--border);

    background: linear-gradient(180deg, #fff 0%, #f8fafc 100%);

    box-shadow: var(--shadow);

}



.cash-sales-stats-strip {

    display: grid;

    grid-template-columns: repeat(2, minmax(0, 1fr));

    gap: 10px;

}



.cash-sales-stat-card {

    padding: 14px 16px;

    border-radius: 14px;

    border: 1px solid #e2e8f0;

    background: #fff;

    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);

}



.cash-sales-stat-card__label {

    display: block;

    font-size: 11px;

    font-weight: 600;

    color: var(--text-muted);

    margin-bottom: 4px;

}



.cash-sales-stat-card__value {

    font-size: 20px;

    font-weight: 800;

    color: #0f766e;

}



.cash-sale-card--returned {

    opacity: 0.92;

}



/* إخفاء FAB على صفحة POS — يتداخل مع زر الإتمام */

.app-shell:has(.pos-sales-shell) .quick-fab-trigger,

.app-shell:has(.pos-sales-shell) .quick-fab-backdrop,

.app-shell:has(.pos-sales-shell) .quick-fab-sheet {

    display: none !important;

}



/* ── Tablet & Mobile POS ── */

@media (max-width: 1024px) {

    .pos-mobile-only { display: grid; }

    .pos-desktop-only { display: none !important; }



    .page-content:has(> .pos-sales-shell) {

        overflow: hidden;

        display: flex;

        flex-direction: column;

        min-height: 0;

        padding-bottom: 0;

    }



    .pos-sales-shell {

        flex: 1 1 0;

        min-height: 0;

        display: flex;

        flex-direction: column;

        overflow: hidden;

    }



    .pos-sales-shell > .page-toolbar {

        flex-shrink: 0;

        padding: 8px 12px 6px;

    }



    .pos-sales-shell .page-breadcrumbs {

        display: none;

    }



    .pos-sales-shell .page-toolbar-row {

        gap: 8px;

        align-items: center;

    }



    .pos-sales-shell .page-toolbar-title {

        font-size: 15px;

    }



    .pos-sales-shell .page-toolbar-badge {

        width: 32px;

        height: 32px;

    }



    .pos-sales-shell .page-toolbar-tools {

        flex-shrink: 0;

    }



    .pos-page-body {

        flex: 1 1 0;

        min-height: 0;

        display: flex;

        flex-direction: column;

        overflow: hidden;

        padding: 8px 10px 0;

        padding-bottom: calc(var(--pos-dock-h, 64px) + var(--mobile-bottom-nav-h, 62px) + var(--safe-bottom, 0px));

    }



    .pos-segmented {

        display: flex;

        flex-shrink: 0;

        position: sticky;

        top: 0;

        z-index: 4;

        margin-bottom: 8px;

    }



    .pos-page-layout {

        grid-template-columns: 1fr;

        flex: 1 1 0;

        min-height: 0;

        align-items: stretch;

    }



    .pos-zone--hidden-mobile {

        display: none !important;

    }



    .pos-zone {

        border-radius: 14px;

        flex: 1 1 0;

        min-height: 0;

        display: flex;

        flex-direction: column;

    }



    .pos-zone__head {

        padding: 8px 12px;

    }



    .pos-zone__head span,

    .pos-zone__step {

        display: none;

    }



    .pos-zone__head strong {

        font-size: 13px;

    }



    .pos-zone__body {

        flex: 1 1 0;

        min-height: 0;

        padding: 10px 12px 12px;

        gap: 8px;

        overflow: hidden;

    }



    .pos-filters {

        grid-template-columns: 1fr 1fr;

        gap: 8px;

    }



    .pos-filters .form-field:first-child {

        grid-column: 1 / -1;

    }



    .pos-search .input,

    .pos-filters .input {

        min-height: 40px;

        font-size: 14px;

    }



    .pos-tiles-area {

        flex: 1 1 0;

        min-height: 0;

        overflow-y: auto;

        -webkit-overflow-scrolling: touch;

        overscroll-behavior: contain;

        margin-inline: -2px;

        padding-inline: 2px;

    }



    .pos-tiles-grid {

        grid-template-columns: repeat(2, minmax(0, 1fr));

        gap: 8px;

    }



    .pos-tile {

        min-height: 96px;

        padding: 10px 10px 8px;

        border-radius: 12px;

    }



    .pos-tile__name {

        font-size: 12px;

    }



    .pos-tile__price {

        font-size: 13px;

        padding-top: 4px;

    }



    /* شريط إتمام مضغوط — صف واحد */

    .pos-checkout-dock {

        --pos-dock-h: 58px;

        position: fixed;

        inset-inline: 0;

        bottom: calc(var(--mobile-bottom-nav-h, 62px) + var(--safe-bottom, 0px));

        z-index: 750;

        display: grid;

        grid-template-columns: minmax(64px, 0.7fr) minmax(0, 1.3fr) auto;

        gap: 8px;

        align-items: center;

    }



    .pos-checkout-dock:has(.pos-checkout-dock__alert) {

        --pos-dock-h: 96px;

        grid-template-rows: auto auto;

    }



    .pos-checkout-summary--dock {

        display: contents;

    }



    .pos-checkout-metric {

        padding: 6px 10px;

        border-radius: 10px;

        min-width: 0;

    }



    .pos-checkout-metric__label {

        font-size: 9px;

        margin-bottom: 2px;

        white-space: nowrap;

    }



    .pos-checkout-metric__value {

        font-size: 14px;

        line-height: 1.2;

        white-space: nowrap;

        overflow: hidden;

        text-overflow: ellipsis;

    }



    .pos-checkout-metric.is-total .pos-checkout-metric__value {

        font-size: 15px;

    }



    .pos-checkout-btn--dock {

        width: auto;

        min-width: 88px;

        max-width: 120px;

        min-height: 44px;

        padding: 0 14px;

        font-size: 14px;

        font-weight: 800;

        border-radius: 12px;

        white-space: nowrap;

    }



    .cash-sales-history-shell > .list-page-body.cash-sales-scroll-body {

        flex: 1 1 0;

        min-height: 0;

        overflow-y: auto;

        scrollbar-gutter: stable;

        scrollbar-width: thin;

        scrollbar-color: #0f766e #ecfdf5;

        padding-bottom: calc(var(--mobile-bottom-nav-h, 62px) + 80px + var(--safe-bottom, 0px));

    }



    .cash-sales-history-shell > .list-page-body.cash-sales-scroll-body::-webkit-scrollbar {

        width: 10px;

    }



    .cash-sales-history-shell > .list-page-body.cash-sales-scroll-body::-webkit-scrollbar-track {

        background: #ecfdf5;

        border-radius: 10px;

        margin: 6px 0;

    }



    .cash-sales-history-shell > .list-page-body.cash-sales-scroll-body::-webkit-scrollbar-thumb {

        background: linear-gradient(180deg, #5eead4, #0f766e);

        border-radius: 10px;

        border: 2px solid #ecfdf5;

    }



    .cash-sales-filter-card {

        grid-template-columns: 1fr 1fr;

    }



    .cash-sales-filter-card .btn-secondary,

    .cash-sales-filter-card .btn-primary {

        grid-column: span 1;

    }



    .cash-sales-filter-card .btn-secondary:last-child {

        grid-column: 1 / -1;

    }

}



/* تابلت أفقي — 3 أعمدة للمنتجات */

@media (min-width: 600px) and (max-width: 1024px) {

    .pos-tiles-grid {

        grid-template-columns: repeat(3, minmax(0, 1fr));

    }



    .pos-page-body {

        padding-inline: 12px;

    }



    .pos-checkout-dock {

        inset-inline: 12px;

        border-radius: 14px 14px 0 0;

    }



    .pos-checkout-btn--dock {

        min-width: 100px;

        max-width: 140px;

    }

}



@media (max-width: 480px) {

    .pos-page-body {

        padding-inline: 8px;

    }



    .pos-filters {

        grid-template-columns: 1fr;

    }



    .cash-sales-stats-strip {

        grid-template-columns: 1fr;

    }

}



@media (max-width: 360px) {

    .pos-checkout-dock {

        grid-template-columns: 1fr 1fr;

    }



    .pos-checkout-btn--dock {

        grid-column: 1 / -1;

        max-width: none;

        width: 100%;

    }

}

