/**
 * Admin Plus — POS terminal (distinct retail shell)
 */
body.ap-pos-skin {
    --pos-bg: #07080c;
    --pos-bg-2: #0e1118;
    --pos-ink: #f4f6fb;
    --pos-muted: rgba(244, 246, 251, 0.55);
    --pos-line: rgba(255, 255, 255, 0.08);
    --pos-accent: #00aeef;
    --pos-accent-2: #7c5cff;
    --pos-warm: #ff8a4c;
    --pos-glow: rgba(0, 174, 239, 0.45);
    --pos-ticket-bg: #f6f3ee;
    --pos-ticket-ink: #1a1c22;
    --pos-ticket-muted: #6b7280;
    --pos-ticket-line: rgba(26, 28, 34, 0.1);
    --pos-radius: 1.125rem;
    --pos-radius-sm: 0.75rem;
    --pos-font: "Tajawal", "Inter", system-ui, sans-serif;
    --pos-mono: "IBM Plex Mono", "Cascadia Mono", ui-monospace, monospace;

    margin: 0;
    min-height: 100dvh;
    font-family: var(--pos-font);
    background: var(--pos-bg);
    color: var(--pos-ink);
    overflow: hidden;
}

body.ap-pos-skin::before,
body.ap-pos-skin::after {
    content: "";
    position: fixed;
    border-radius: 50%;
    filter: blur(90px);
    opacity: 0.35;
    pointer-events: none;
    z-index: 0;
}

body.ap-pos-skin::before {
    width: min(52vw, 520px);
    height: min(52vw, 520px);
    background: radial-gradient(circle, var(--pos-accent) 0%, transparent 70%);
    inset-inline-start: -12%;
    top: -18%;
}

body.ap-pos-skin::after {
    width: min(44vw, 440px);
    height: min(44vw, 440px);
    background: radial-gradient(circle, var(--pos-warm) 0%, transparent 72%);
    inset-inline-end: -8%;
    bottom: -12%;
    opacity: 0.22;
}

.pos-app {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    min-height: 100dvh;
    max-height: 100dvh;
}

/* ——— Header ——— */
.pos-header {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.65rem;
    padding: 0.75rem 1rem;
    padding-top: max(0.75rem, env(safe-area-inset-top));
    border-bottom: 1px solid var(--pos-line);
    background: linear-gradient(180deg, rgba(14, 17, 24, 0.92) 0%, rgba(7, 8, 12, 0.75) 100%);
    backdrop-filter: blur(12px);
    position: relative;
    z-index: 30;
    flex-shrink: 0;
}

@media (min-width: 768px) {
    .pos-header {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        justify-content: space-between;
        gap: 0.75rem 1.25rem;
        padding: 0.85rem 1.25rem;
        padding-top: max(0.85rem, env(safe-area-inset-top));
    }
}

.pos-header__primary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    min-width: 0;
}

.pos-header__toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    min-width: 0;
}

.pos-header__status {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 0.4rem;
    flex-shrink: 0;
}

.pos-brand {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    min-width: 0;
}

.pos-brand-mark {
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 0.85rem;
    background: linear-gradient(135deg, var(--pos-accent) 0%, var(--pos-accent-2) 100%);
    display: grid;
    place-items: center;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12), 0 8px 24px var(--pos-glow);
    flex-shrink: 0;
}

.pos-brand-mark i {
    font-size: 1.25rem;
    color: #041018;
}

.pos-brand-text h1 {
    font-size: 1.05rem;
    font-weight: 700;
    margin: 0;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.pos-brand-text p {
    margin: 0;
    font-size: 0.72rem;
    color: var(--pos-muted);
}

.pos-header-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 1rem;
    overflow: visible;
}

.pos-clock {
    font-family: var(--pos-mono);
    font-size: 0.8rem;
    letter-spacing: 0.06em;
    color: var(--pos-muted);
    padding: 0.35rem 0.65rem;
    border-radius: 999px;
    border: 1px solid var(--pos-line);
    background: rgba(255, 255, 255, 0.03);
}

.pos-pill-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    align-items: center;
    overflow: visible;
}

.pos-pill {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.55rem 0.35rem 0.65rem;
    border-radius: 999px;
    border: 1px solid var(--pos-line);
    background: rgba(255, 255, 255, 0.04);
    font-size: 0.72rem;
    color: var(--pos-muted);
}

.pos-pill label {
    margin: 0;
    white-space: nowrap;
}

.pos-pill select {
    border: 0;
    background: transparent;
    color: var(--pos-ink);
    font-size: 0.8rem;
    font-weight: 600;
    max-width: 11rem;
    padding: 0;
    outline: none;
    cursor: pointer;
}

.pos-pill select option {
    background: var(--pos-bg-2);
    color: var(--pos-ink);
}

.pos-header-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
}

.pos-lang-switch {
    display: inline-flex;
    align-items: stretch;
    border-radius: 999px;
    border: 1px solid var(--pos-line);
    background: rgba(255, 255, 255, 0.03);
    overflow: hidden;
}

.pos-lang-switch__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.38rem 0.7rem;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--pos-muted);
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
    white-space: nowrap;
}

.pos-lang-switch__btn + .pos-lang-switch__btn {
    border-inline-start: 1px solid var(--pos-line);
}

.pos-lang-switch__btn:hover {
    color: var(--pos-ink);
    background: rgba(0, 174, 239, 0.1);
}

.pos-lang-switch__btn.is-active {
    color: #041018;
    background: linear-gradient(135deg, var(--pos-accent), #00c4ff);
}

.pos-btn-ghost {
    border: 1px solid var(--pos-line);
    background: rgba(255, 255, 255, 0.04);
    color: var(--pos-ink);
    border-radius: 999px;
    padding: 0.4rem 0.85rem;
    font-size: 0.78rem;
    font-weight: 500;
    text-decoration: none;
    transition: border-color 0.15s, background 0.15s, transform 0.1s;
}

.pos-btn-ghost:hover {
    border-color: rgba(0, 174, 239, 0.45);
    background: rgba(0, 174, 239, 0.1);
    color: #fff;
}

/* ——— Workspace & main layout ——— */
.pos-workspace {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

.pos-main {
    flex: 1;
    display: grid;
    grid-template-columns: minmax(0, 1fr) min(420px, 38vw);
    gap: 0;
    min-height: 0;
    overflow: hidden;
}

.pos-main > .pos-catalog,
.pos-main > .pos-ticket {
    min-width: 0;
    min-height: 0;
}

@media (max-width: 991.98px) {
    .pos-workspace {
        overflow: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: calc(4.75rem + env(safe-area-inset-bottom));
    }

    .pos-main {
        grid-template-columns: 1fr;
        grid-template-rows: 1fr;
        overflow: visible;
        min-height: min(100%, 100%);
    }

    body.ap-pos-skin {
        overflow: hidden;
    }

    .pos-app {
        max-height: 100dvh;
        min-height: 100dvh;
    }
}

.pos-catalog {
    display: flex;
    flex-direction: column;
    min-height: 0;
    min-width: 0;
    overflow: hidden;
    padding: 0.85rem 0.85rem 1rem;
}

@media (min-width: 768px) {
    .pos-catalog {
        padding: 1rem 1.15rem 1.25rem;
    }
}

.pos-catalog-toolbar {
    flex-shrink: 0;
}

.pos-search-wrap {
    position: relative;
    margin-bottom: 0.65rem;
    flex-shrink: 0;
}

.pos-search-wrap i {
    position: absolute;
    inset-inline-start: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--pos-muted);
    pointer-events: none;
}

.pos-search {
    width: 100%;
    border: 1px solid rgba(0, 174, 239, 0.22);
    background: rgba(255, 255, 255, 0.05);
    color: var(--pos-ink);
    border-radius: 999px;
    padding: 0.85rem 1rem 0.85rem 2.65rem;
    font-size: 0.95rem;
    outline: none;
    transition: box-shadow 0.2s, border-color 0.2s, background 0.2s;
}

.pos-search::placeholder {
    color: var(--pos-muted);
}

.pos-search:focus {
    border-color: var(--pos-accent);
    background: rgba(255, 255, 255, 0.07);
    box-shadow: 0 0 0 4px rgba(0, 174, 239, 0.15), 0 12px 40px rgba(0, 0, 0, 0.35);
}

.pos-search-hint {
    position: absolute;
    inset-inline-end: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.65rem;
    font-family: var(--pos-mono);
    color: var(--pos-muted);
    border: 1px solid var(--pos-line);
    border-radius: 0.35rem;
    padding: 0.15rem 0.4rem;
    pointer-events: none;
}

.pos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
    gap: 0.55rem;
    overflow: auto;
    padding-bottom: 0.5rem;
    align-content: start;
    flex: 1;
    min-height: 0;
}

@media (min-width: 480px) {
    .pos-grid {
        grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
        gap: 0.65rem;
    }
}

@media (min-width: 1200px) {
    .pos-grid {
        grid-template-columns: repeat(auto-fill, minmax(156px, 1fr));
    }
}

.pos-grid:empty::after {
    content: attr(data-empty);
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem 1rem;
    color: var(--pos-muted);
    font-size: 0.9rem;
}

.pos-product {
    cursor: pointer;
    border: 1px solid var(--pos-line);
    border-radius: var(--pos-radius-sm);
    background: linear-gradient(165deg, rgba(255, 255, 255, 0.07) 0%, rgba(255, 255, 255, 0.02) 100%);
    padding: 0.75rem;
    min-height: 118px;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    transition: transform 0.12s ease, border-color 0.15s, box-shadow 0.15s;
    text-align: start;
}

.pos-product:hover {
    transform: translateY(-3px);
    border-color: rgba(0, 174, 239, 0.5);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(0, 174, 239, 0.25);
}

.pos-product:active {
    transform: scale(0.98);
}

.pos-product-avatar {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 0.65rem;
    display: grid;
    place-items: center;
    font-size: 0.85rem;
    font-weight: 700;
    color: #0a0c10;
    flex-shrink: 0;
}

.pos-product-name {
    font-size: 0.82rem;
    font-weight: 600;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}

.pos-product-code {
    font-family: var(--pos-mono);
    font-size: 0.65rem;
    color: var(--pos-muted);
}

.pos-product-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.35rem;
    margin-top: auto;
}

.pos-product-price {
    font-family: var(--pos-mono);
    font-size: 0.88rem;
    font-weight: 600;
    color: #7fddff;
}

.pos-product-stock {
    font-size: 0.62rem;
    padding: 0.12rem 0.4rem;
    border-radius: 999px;
    background: rgba(0, 174, 239, 0.15);
    color: #9ee8ff;
}

.pos-product-stock.low {
    background: rgba(255, 138, 76, 0.18);
    color: #ffc9a8;
}

/* ——— Ticket panel ——— */
.pos-ticket {
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
    background: var(--pos-ticket-bg);
    color: var(--pos-ticket-ink);
    box-shadow: -12px 0 48px rgba(0, 0, 0, 0.45);
    position: relative;
}

.pos-ticket-head,
.pos-ticket-totals,
.pos-ticket-actions {
    flex-shrink: 0;
}

@media (min-width: 992px) {
    .pos-ticket {
        visibility: visible;
        transform: none;
        position: relative;
        grid-column: 2;
        grid-row: 1;
    }

    .pos-catalog {
        grid-column: 1;
        grid-row: 1;
    }
}

@media (max-width: 991.98px) {
    .pos-ticket {
        position: fixed;
        inset-inline: 0;
        bottom: 0;
        z-index: 60;
        max-height: min(88dvh, calc(100dvh - 3.5rem));
        border-radius: 1.25rem 1.25rem 0 0;
        box-shadow: 0 -16px 48px rgba(0, 0, 0, 0.55);
        transform: translateY(calc(100% + 5rem));
        transition: transform 0.32s cubic-bezier(0.32, 0.72, 0, 1);
        visibility: hidden;
    }

    .pos-ticket.is-open {
        transform: translateY(0);
        visibility: visible;
    }
}

html[dir="rtl"] .pos-ticket {
    box-shadow: 12px 0 48px rgba(0, 0, 0, 0.45);
}

@media (max-width: 991.98px) {
    html[dir="rtl"] .pos-ticket,
    html[dir="ltr"] .pos-ticket {
        box-shadow: 0 -16px 48px rgba(0, 0, 0, 0.55);
    }
}

.pos-ticket-collapse {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    border: 0;
    background: transparent;
    color: var(--pos-ticket-muted);
    padding: 0.65rem 0 0.35rem;
    cursor: pointer;
}

.pos-ticket-collapse i {
    font-size: 1.35rem;
    line-height: 1;
}

.pos-ticket-collapse::before {
    content: "";
    position: absolute;
    top: 0.45rem;
    left: 50%;
    transform: translateX(-50%);
    width: 2.5rem;
    height: 0.25rem;
    border-radius: 999px;
    background: rgba(26, 28, 34, 0.15);
}

.pos-cart-backdrop {
    position: fixed;
    inset: 0;
    z-index: 55;
    background: rgba(4, 6, 10, 0.62);
    backdrop-filter: blur(4px);
    animation: pos-backdrop-in 0.25s ease;
}

@keyframes pos-backdrop-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

body.pos-cart-sheet-open {
    overflow: hidden;
}

/* Mobile bottom dock */
.pos-mobile-dock {
    position: fixed;
    inset-inline: 0;
    bottom: 0;
    z-index: 45;
    display: flex;
    align-items: stretch;
    gap: 0.5rem;
    padding: 0.55rem 0.75rem;
    padding-bottom: max(0.55rem, env(safe-area-inset-bottom));
    background: linear-gradient(180deg, rgba(14, 17, 24, 0.82) 0%, rgba(7, 8, 12, 0.96) 100%);
    border-top: 1px solid var(--pos-line);
    backdrop-filter: blur(14px);
    box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.45);
}

.pos-mobile-dock__cart {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.55rem;
    min-width: 0;
    border: 1px solid var(--pos-line);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--pos-ink);
    padding: 0.65rem 0.85rem;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}

.pos-mobile-dock__cart:hover {
    border-color: rgba(0, 174, 239, 0.4);
    background: rgba(0, 174, 239, 0.08);
}

.pos-mobile-dock__badge {
    font-family: var(--pos-mono);
    font-size: 0.72rem;
    font-weight: 700;
    min-width: 1.45rem;
    height: 1.45rem;
    display: grid;
    place-items: center;
    border-radius: 999px;
    background: var(--pos-accent);
    color: #041018;
    flex-shrink: 0;
}

.pos-mobile-dock__label {
    font-size: 0.82rem;
    font-weight: 600;
    flex-shrink: 0;
}

.pos-mobile-dock__total {
    margin-inline-start: auto;
    font-size: 0.95rem;
    font-weight: 700;
    color: #9ee8ff;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pos-mobile-dock__pay {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    border: 0;
    border-radius: 999px;
    padding: 0.65rem 1.15rem;
    font-size: 0.92rem;
    font-weight: 700;
    color: #041018;
    background: linear-gradient(135deg, #00aeef 0%, #33c4ff 45%, #7c5cff 100%);
    box-shadow: 0 8px 24px rgba(0, 174, 239, 0.35);
    transition: transform 0.12s, filter 0.15s;
}

.pos-mobile-dock__pay:hover:not(:disabled) {
    filter: brightness(1.06);
    transform: translateY(-1px);
}

.pos-mobile-dock__pay:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.pos-ticket::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 10px;
    background:
        radial-gradient(circle at 10px 0, transparent 6px, var(--pos-ticket-bg) 6.5px) 0 0 / 20px 10px repeat-x;
    transform: translateY(-100%);
}

.pos-ticket-head {
    padding: 1.1rem 1.15rem 0.75rem;
    border-bottom: 1px dashed var(--pos-ticket-line);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.pos-ticket-head h2 {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.pos-cart-badge {
    font-family: var(--pos-mono);
    font-size: 0.72rem;
    background: var(--pos-ticket-ink);
    color: var(--pos-ticket-bg);
    border-radius: 999px;
    padding: 0.2rem 0.55rem;
    min-width: 1.5rem;
    text-align: center;
}

.pos-ticket-body {
    flex: 1;
    overflow: auto;
    padding: 0.5rem 1rem;
    min-height: 120px;
}

.pos-ticket-empty {
    text-align: center;
    padding: 2.5rem 1rem;
    color: var(--pos-ticket-muted);
}

.pos-ticket-empty i {
    font-size: 2rem;
    opacity: 0.35;
    display: block;
    margin-bottom: 0.5rem;
}

.pos-cart-line {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.35rem 0.65rem;
    padding: 0.65rem 0;
    border-bottom: 1px dotted var(--pos-ticket-line);
}

.pos-cart-line:last-child {
    border-bottom: 0;
}

.pos-cart-line-name {
    font-weight: 600;
    font-size: 0.85rem;
    grid-column: 1 / -1;
}

.pos-cart-line-meta {
    font-family: var(--pos-mono);
    font-size: 0.72rem;
    color: var(--pos-ticket-muted);
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-wrap: wrap;
}

.pos-cart-line-meta input {
    width: 4.2rem;
    border: 1px solid var(--pos-ticket-line);
    border-radius: 0.4rem;
    padding: 0.15rem 0.35rem;
    font-family: var(--pos-mono);
    font-size: 0.72rem;
    background: #fff;
}

.pos-cart-line-actions {
    display: flex;
    gap: 0.2rem;
    align-items: center;
}

.pos-cart-btn {
    width: 1.75rem;
    height: 1.75rem;
    border: 1px solid var(--pos-ticket-line);
    border-radius: 0.45rem;
    background: #fff;
    color: var(--pos-ticket-ink);
    display: grid;
    place-items: center;
    padding: 0;
    font-size: 0.9rem;
    line-height: 1;
    cursor: pointer;
    transition: background 0.12s;
}

.pos-cart-btn:hover {
    background: #ebe6de;
}

.pos-cart-btn.danger:hover {
    background: #fee2e2;
    border-color: #fecaca;
    color: #b91c1c;
}

.pos-cart-line-total {
    font-family: var(--pos-mono);
    font-weight: 600;
    font-size: 0.85rem;
    text-align: end;
    align-self: center;
}

.pos-ticket-totals {
    padding: 0.85rem 1.15rem;
    border-top: 1px dashed var(--pos-ticket-line);
    font-size: 0.82rem;
}

.pos-total-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.35rem;
    color: var(--pos-ticket-muted);
}

.pos-total-row.grand {
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 2px solid var(--pos-ticket-ink);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--pos-ticket-ink);
}

.pos-total-row.grand span:last-child {
    font-family: var(--pos-mono);
    color: #0d7ab8;
}

.pos-ticket-actions {
    padding: 0 1rem 1rem;
    padding-bottom: max(1rem, env(safe-area-inset-bottom));
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    margin-top: auto;
}

.pos-pay {
    border: 0;
    border-radius: 999px;
    padding: 0.95rem 1.25rem;
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: #041018;
    background: linear-gradient(135deg, #00aeef 0%, #33c4ff 45%, #7c5cff 100%);
    box-shadow: 0 10px 32px rgba(0, 174, 239, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.35);
    transition: transform 0.12s, box-shadow 0.15s, filter 0.15s;
    width: 100%;
}

.pos-pay:hover:not(:disabled) {
    filter: brightness(1.06);
    transform: translateY(-1px);
    box-shadow: 0 14px 40px rgba(0, 174, 239, 0.45);
}

.pos-pay:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

@keyframes pos-pay-glow {
    0%, 100% { box-shadow: 0 10px 32px rgba(0, 174, 239, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.35); }
    50% { box-shadow: 0 14px 42px rgba(124, 92, 255, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.4); }
}

.pos-pay:not(:disabled) {
    animation: pos-pay-glow 3.5s ease-in-out infinite;
}

.pos-secondary-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.4rem;
}

.pos-btn-secondary {
    border: 1px solid var(--pos-ticket-line);
    background: #fff;
    color: var(--pos-ticket-ink);
    border-radius: var(--pos-radius-sm);
    padding: 0.5rem 0.65rem;
    font-size: 0.75rem;
    font-weight: 600;
}

.pos-btn-secondary:hover {
    background: #ebe6de;
}

.pos-btn-clear {
    border: 0;
    background: transparent;
    color: var(--pos-ticket-muted);
    font-size: 0.75rem;
    text-decoration: underline;
    text-underline-offset: 2px;
    padding: 0;
}

.pos-btn-clear:hover {
    color: #b91c1c;
}

/* Activity strip */
.pos-activity {
    border-top: 1px solid var(--pos-line);
    background: rgba(0, 0, 0, 0.35);
    padding: 0.65rem 1.15rem;
    flex-shrink: 0;
}

.pos-activity--collapsible > summary {
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--pos-muted);
    padding: 0.15rem 0;
    user-select: none;
}

.pos-activity--collapsible > summary::-webkit-details-marker {
    display: none;
}

.pos-activity--collapsible > summary i {
    transition: transform 0.2s ease;
}

.pos-activity--collapsible[open] > summary i {
    transform: rotate(180deg);
}

@media (max-width: 991.98px) {
    .pos-activity--collapsible:not([open]) {
        padding-block: 0.45rem;
    }
}

@media (min-width: 992px) {
    .pos-activity--collapsible > summary {
        display: none;
    }

    .pos-activity--collapsible .pos-activity-grid {
        display: grid;
    }
}

.pos-activity-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem 1.25rem;
}

@media (max-width: 575.98px) {
    .pos-activity-grid {
        grid-template-columns: 1fr;
    }
}

.pos-activity h3 {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--pos-muted);
    margin: 0 0 0.4rem;
    font-weight: 600;
}

.pos-activity-list {
    max-height: 5.5rem;
    overflow: auto;
    font-size: 0.75rem;
}

.pos-activity-row {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.28rem 0;
    border-bottom: 1px solid var(--pos-line);
}

.pos-activity-row span:first-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pos-activity-row span:last-child {
    font-family: var(--pos-mono);
    color: #9ee8ff;
    flex-shrink: 0;
}

/* Modals */
.pos-modal .modal-content {
    background: var(--pos-bg-2);
    border: 1px solid var(--pos-line);
    border-radius: var(--pos-radius);
    color: var(--pos-ink);
}

.pos-modal .modal-header {
    border-color: var(--pos-line);
}

.pos-modal .form-control,
.pos-modal .form-select {
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--pos-line);
    color: var(--pos-ink);
}

.pos-modal .form-control:focus {
    border-color: var(--pos-accent);
    box-shadow: 0 0 0 3px rgba(0, 174, 239, 0.2);
}

.pos-modal .modal-footer {
    border-color: var(--pos-line);
    flex-wrap: wrap;
    gap: 0.5rem;
}

.pos-modal .modal-footer .btn-success {
    font-weight: 700;
    min-width: 8rem;
}

/* Toast */
.pos-toast {
    background: var(--pos-bg-2) !important;
    border: 1px solid rgba(0, 174, 239, 0.35) !important;
    border-radius: var(--pos-radius-sm) !important;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
}

.pos-toast.success {
    border-color: rgba(52, 211, 153, 0.45) !important;
}

/* Legacy class hooks */
.ap-pos-skin .pos-input-dark {
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--pos-line);
    color: var(--pos-ink);
}

.ap-pos-skin .pos-surface {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--pos-line);
    border-radius: var(--pos-radius-sm);
}

/* Checkout / payment */
.pos-checkout-total {
    text-align: center;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--pos-radius-sm);
    border: 1px solid var(--pos-line);
}

.pos-checkout-total-amt {
    font-family: var(--pos-mono);
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--pos-accent);
    margin-top: 0.25rem;
}

.pos-pay-methods {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
}

.pos-pay-method {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    padding: 0.85rem 0.5rem;
    border: 2px solid var(--pos-line);
    border-radius: var(--pos-radius-sm);
    background: rgba(255, 255, 255, 0.04);
    color: var(--pos-ink);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}

.pos-pay-method i {
    font-size: 1.35rem;
    opacity: 0.85;
}

.pos-pay-method.is-active {
    border-color: var(--pos-accent);
    background: rgba(0, 174, 239, 0.12);
    box-shadow: 0 0 0 1px rgba(0, 174, 239, 0.35);
}

.pos-pay-method:hover {
    border-color: rgba(0, 174, 239, 0.5);
}

.pos-activity-row.is-clickable {
    cursor: pointer;
}

.pos-activity-row.is-clickable:hover {
    background: rgba(255, 255, 255, 0.06);
}

.pos-activity-pm {
    display: block;
    font-size: 0.65rem;
    opacity: 0.65;
    font-weight: 500;
}

/* ——— Customer search picker ——— */
.pos-customer-picker {
    position: relative;
}

.pos-customer-wrap {
    position: relative;
    display: flex;
    align-items: center;
    min-width: 12rem;
}

.pos-customer-input {
    border: 0;
    background: transparent;
    color: var(--pos-ink);
    font-size: 0.8rem;
    font-weight: 600;
    width: 100%;
    min-width: 10rem;
    padding: 0;
    outline: none;
}

.pos-customer-input::placeholder {
    color: var(--pos-muted);
    font-weight: 500;
}

.pos-customer-clear {
    border: 0;
    background: transparent;
    color: var(--pos-muted);
    padding: 0 0.15rem;
    line-height: 1;
    cursor: pointer;
}

.pos-customer-clear:hover {
    color: var(--pos-ink);
}

.pos-customer-dropdown {
    position: absolute;
    top: calc(100% + 0.45rem);
    inset-inline-start: 0;
    min-width: 18rem;
    max-width: 22rem;
    max-height: 14rem;
    overflow-y: auto;
    z-index: 120;
    border-radius: 0.65rem;
    border: 1px solid var(--pos-line);
    background: var(--pos-bg-2);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
    padding: 0.35rem;
}

.pos-customer-option {
    display: block;
    width: 100%;
    text-align: start;
    border: 0;
    background: transparent;
    color: var(--pos-ink);
    font-size: 0.78rem;
    padding: 0.45rem 0.55rem;
    border-radius: 0.45rem;
    cursor: pointer;
}

.pos-customer-option:hover,
.pos-customer-option:focus-visible {
    background: rgba(0, 174, 239, 0.12);
    outline: none;
}

.pos-customer-option.is-walk-in {
    color: var(--pos-accent);
    font-weight: 600;
    border-bottom: 1px solid var(--pos-line);
    border-radius: 0.45rem 0.45rem 0 0;
    margin-bottom: 0.2rem;
}

.pos-customer-empty {
    padding: 0.55rem;
    font-size: 0.75rem;
    color: var(--pos-muted);
}

/* ——— Customers panel (catalog) ——— */
.pos-customers-panel {
    flex-shrink: 0;
    min-width: 0;
    max-width: 100%;
    margin-bottom: 0.65rem;
    border: 1px solid var(--pos-line);
    border-radius: var(--pos-radius-sm);
    background: rgba(255, 255, 255, 0.02);
    overflow: hidden;
}

.pos-customers-panel > summary {
    list-style: none;
    cursor: pointer;
    padding: 0.55rem 0.85rem;
    user-select: none;
}

.pos-customers-panel > summary::-webkit-details-marker {
    display: none;
}

.pos-customers-panel__head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.35rem 0.75rem;
}

.pos-customers-panel__head::after {
    content: "\F282";
    font-family: "bootstrap-icons";
    font-size: 0.75rem;
    color: var(--pos-muted);
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.pos-customers-panel[open] > summary .pos-customers-panel__head::after {
    transform: rotate(180deg);
}

.pos-customers-panel #pos-customers-list {
    padding: 0 0.85rem 0.75rem;
}

@media (max-width: 575.98px) {
    .pos-customers-panel:not([open]) {
        margin-bottom: 0.45rem;
    }
}

@media (min-width: 992px) {
    .pos-customers-panel > summary {
        cursor: default;
        pointer-events: none;
    }

    .pos-customers-panel__head::after {
        display: none;
    }
}

.pos-customers-panel__title {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--pos-muted);
}

.pos-customers-panel__selected {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--pos-accent);
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pos-customers-list {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.45rem;
    overflow-x: auto;
    overflow-y: hidden;
    min-width: 0;
    max-width: 100%;
    padding-bottom: 0.15rem;
    scrollbar-width: thin;
}

.pos-customers-list::-webkit-scrollbar {
    height: 5px;
}

.pos-customers-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 999px;
}

.pos-customer-chip {
    flex: 0 0 auto;
    border: 1px solid var(--pos-line);
    background: rgba(255, 255, 255, 0.04);
    color: var(--pos-ink);
    border-radius: 999px;
    padding: 0.35rem 0.75rem;
    font-size: 0.74rem;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: border-color 0.15s, background 0.15s, transform 0.1s;
}

.pos-customer-chip:hover,
.pos-customer-chip:focus-visible {
    border-color: rgba(0, 174, 239, 0.45);
    background: rgba(0, 174, 239, 0.12);
    outline: none;
}

.pos-customer-chip.is-active {
    border-color: var(--pos-accent);
    background: rgba(0, 174, 239, 0.18);
    color: #fff;
}

.pos-customer-chip.is-walk-in {
    border-style: dashed;
    color: var(--pos-muted);
}

.pos-customers-list-empty {
    font-size: 0.75rem;
    color: var(--pos-muted);
    padding: 0.25rem 0;
}

.pos-cashier-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.65rem;
    border-radius: 999px;
    border: 1px solid var(--pos-line);
    background: rgba(0, 174, 239, 0.08);
    color: var(--pos-ink);
    font-size: 0.75rem;
    font-weight: 600;
    max-width: min(42vw, 11rem);
}

.pos-cashier-badge__name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (max-width: 575.98px) {
    .pos-brand-text h1 {
        font-size: 0.95rem;
    }

    .pos-brand-mark {
        width: 2.35rem;
        height: 2.35rem;
    }

    .pos-pill {
        font-size: 0.68rem;
        padding: 0.3rem 0.45rem 0.3rem 0.55rem;
    }

    .pos-pill select {
        max-width: 8.5rem;
        font-size: 0.75rem;
    }

    .pos-secondary-actions {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 767.98px) {
    .pos-customer-picker--header {
        display: none !important;
    }
}

.pos-btn-logout {
    cursor: pointer;
}

/* ——— POS login page ——— */
.pos-login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.pos-login-shell {
    width: min(420px, 100%);
}

.pos-login-card {
    border-radius: 1rem;
    border: 1px solid var(--pos-line);
    background: linear-gradient(165deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.01));
    padding: 1.75rem;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}

.pos-login-brand {
    display: flex;
    gap: 0.85rem;
    align-items: flex-start;
    margin-bottom: 1.25rem;
}

.pos-login-brand h1 {
    font-size: 1.15rem;
    margin: 0 0 0.25rem;
    color: var(--pos-ink);
}

.pos-login-brand p {
    margin: 0;
    font-size: 0.8rem;
    color: var(--pos-muted);
    line-height: 1.45;
}

.pos-login-input {
    background: rgba(255, 255, 255, 0.04);
    border-color: var(--pos-line);
    color: var(--pos-ink);
}

.pos-login-input:focus {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(0, 174, 239, 0.5);
    color: var(--pos-ink);
    box-shadow: 0 0 0 0.2rem rgba(0, 174, 239, 0.15);
}

.pos-login-footer {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    justify-content: center;
    align-items: center;
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--pos-line);
}

.pos-login-footer .pos-lang-switch {
    flex: 0 0 100%;
    justify-content: center;
    margin-bottom: 0.15rem;
}
