/* NexPOS - modern tech-retail theme */

:root {
    --nexpos-accent: #4f46e5;
    --nexpos-accent-dark: #4338ca;
    --nexpos-accent-light: #eef2ff;
    --nexpos-sidebar-bg: #14162b;
    --nexpos-sidebar-bg-hover: #1f2242;
    --nexpos-sidebar-width: 260px;
    --nexpos-sidebar-width-collapsed: 78px;
    --nexpos-navbar-height: 64px;
    --nexpos-body-bg: #f4f5fa;
    --nexpos-card-radius: 1rem;
    --nexpos-shadow-sm: 0 2px 8px rgba(20, 22, 43, 0.06);
    --nexpos-shadow-md: 0 8px 24px rgba(20, 22, 43, 0.10);
}

body {
    background-color: var(--nexpos-body-bg);
    font-family: "Segoe UI", Roboto, -apple-system, BlinkMacSystemFont, sans-serif;
    color: #1f2233;
}

/* ---------- Layout shell ---------- */
.nexpos-topbar {
    height: var(--nexpos-navbar-height);
    background-color: #ffffff;
    box-shadow: var(--nexpos-shadow-sm);
    position: sticky;
    top: 0;
    z-index: 1030;
    padding: 0 1rem 0 0;
}

.nexpos-topbar .brand-mark {
    width: var(--nexpos-sidebar-width);
    transition: width 0.25s ease;
}

body.sidebar-collapsed .nexpos-topbar .brand-mark {
    width: var(--nexpos-sidebar-width-collapsed);
}

.nexpos-topbar .brand-mark img {
    width: 36px;
    height: 36px;
}

.nexpos-topbar .brand-text {
    font-weight: 700;
    font-size: 1.1rem;
    letter-spacing: 0.2px;
    color: #1f2233;
}

.nexpos-topbar .brand-text span {
    color: var(--nexpos-accent);
}

.sidebar-toggle-btn {
    border: none;
    background: transparent;
    color: #4b4f6b;
    font-size: 1.25rem;
    width: 40px;
    height: 40px;
    border-radius: 0.6rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.15s ease;
}

.sidebar-toggle-btn:hover {
    background-color: var(--nexpos-accent-light);
    color: var(--nexpos-accent);
}

.nexpos-user-chip {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.35rem 0.6rem 0.35rem 0.35rem;
    border-radius: 2rem;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.nexpos-user-chip:hover {
    background-color: var(--nexpos-body-bg);
}

.nexpos-user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--nexpos-accent), #8b5cf6);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.85rem;
}

/* ---------- Sidebar ---------- */
.nexpos-sidebar {
    width: var(--nexpos-sidebar-width);
    background-color: var(--nexpos-sidebar-bg);
    position: fixed;
    top: var(--nexpos-navbar-height);
    left: 0;
    bottom: 0;
    overflow-x: hidden;
    overflow-y: auto;
    transition: width 0.25s ease;
    z-index: 1020;
    padding-top: 0.75rem;
}

body.sidebar-collapsed .nexpos-sidebar {
    width: var(--nexpos-sidebar-width-collapsed);
}

.nexpos-sidebar .nav-section-label {
    color: #6b6f95;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 0.75rem 1.25rem 0.35rem;
    white-space: nowrap;
}

body.sidebar-collapsed .nexpos-sidebar .nav-section-label {
    opacity: 0;
    height: 0;
    padding-top: 0;
    padding-bottom: 0;
    overflow: hidden;
}

.nexpos-sidebar .nav-link {
    color: #c6c8e0;
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.65rem 1.25rem;
    font-size: 0.92rem;
    border-radius: 0;
    white-space: nowrap;
    position: relative;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.nexpos-sidebar .nav-link i {
    font-size: 1.1rem;
    width: 22px;
    text-align: center;
    flex-shrink: 0;
}

.nexpos-sidebar .nav-link:hover {
    background-color: var(--nexpos-sidebar-bg-hover);
    color: #ffffff;
}

.nexpos-sidebar .nav-link.active {
    background-color: var(--nexpos-sidebar-bg-hover);
    color: #ffffff;
}

.nexpos-sidebar .nav-link.active::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background-color: var(--nexpos-accent);
}

body.sidebar-collapsed .nexpos-sidebar .nav-link span {
    display: none;
}

body.sidebar-collapsed .nexpos-sidebar .nav-link {
    justify-content: center;
    padding: 0.7rem 0;
}

/* ---------- Collapsible nav groups ---------- */
.nexpos-sidebar .nav-group-toggle {
    color: #c6c8e0;
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.65rem 1.25rem;
    font-size: 0.92rem;
    width: 100%;
    background: none;
    border: none;
    text-align: left;
    white-space: nowrap;
    position: relative;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.nexpos-sidebar .nav-group-toggle .nav-group-icon {
    font-size: 1.1rem;
    width: 22px;
    text-align: center;
    flex-shrink: 0;
}

.nexpos-sidebar .nav-group-toggle:hover {
    background-color: var(--nexpos-sidebar-bg-hover);
    color: #ffffff;
}

.nexpos-sidebar .nav-group-toggle.has-active {
    color: #ffffff;
}

.nexpos-sidebar .nav-group-toggle.has-active::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background-color: var(--nexpos-accent);
}

.nexpos-sidebar .nav-group-chevron {
    margin-left: auto;
    font-size: 0.75rem;
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.nexpos-sidebar .nav-group-toggle[aria-expanded="true"] .nav-group-chevron {
    transform: rotate(180deg);
}

.nexpos-sidebar .nav-group-items {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.28s ease;
}

.nexpos-sidebar .nav-group-items.show {
    max-height: 640px;
}

.nexpos-sidebar .nav-group-items .nav-link {
    padding-left: 2.75rem;
    font-size: 0.87rem;
}

body.sidebar-collapsed .nexpos-sidebar .nav-group-toggle span,
body.sidebar-collapsed .nexpos-sidebar .nav-group-chevron {
    display: none;
}

body.sidebar-collapsed .nexpos-sidebar .nav-group-toggle {
    justify-content: center;
    padding: 0.7rem 0;
}

body.sidebar-collapsed .nexpos-sidebar .nav-group-items {
    display: none;
}

/* ---------- Content area ---------- */
.nexpos-content {
    margin-left: var(--nexpos-sidebar-width);
    padding: 1.75rem;
    transition: margin-left 0.25s ease;
    min-height: calc(100vh - var(--nexpos-navbar-height));
}

body.sidebar-collapsed .nexpos-content {
    margin-left: var(--nexpos-sidebar-width-collapsed);
}

/* ---------- Mobile: sidebar becomes an off-canvas drawer, hidden until toggled ---------- */
@media (max-width: 991.98px) {
    .nexpos-sidebar {
        width: min(var(--nexpos-sidebar-width), 82vw);
        transform: translateX(-100%);
        transition: transform 0.25s ease;
        box-shadow: var(--nexpos-shadow-md);
    }

    body.sidebar-mobile-open .nexpos-sidebar {
        transform: translateX(0);
    }

    /* Full labels always shown when the drawer is open - no icon-only rail mode on mobile */
    .nexpos-sidebar .nav-link span,
    .nexpos-sidebar .nav-section-label,
    .nexpos-sidebar .nav-group-toggle span,
    .nexpos-sidebar .nav-group-chevron {
        display: block;
    }

    /* Content is always full-width on mobile; the drawer floats above it, it never pushes it */
    .nexpos-content,
    body.sidebar-collapsed .nexpos-content {
        margin-left: 0;
    }

    .nexpos-topbar .brand-mark {
        width: auto;
    }

    .nexpos-sidebar-backdrop {
        display: none;
        position: fixed;
        top: var(--nexpos-navbar-height);
        left: 0;
        right: 0;
        bottom: 0;
        background-color: rgba(15, 16, 33, 0.45);
        z-index: 1015;
    }

    body.sidebar-mobile-open .nexpos-sidebar-backdrop {
        display: block;
    }

    body.sidebar-mobile-open {
        overflow: hidden;
    }
}

/* ---------- Cards / components ---------- */
.nexpos-card {
    background-color: #ffffff;
    border: none;
    border-radius: var(--nexpos-card-radius);
    box-shadow: var(--nexpos-shadow-sm);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.nexpos-card:hover {
    box-shadow: var(--nexpos-shadow-md);
    transform: translateY(-2px);
}

.btn-accent {
    background-color: var(--nexpos-accent);
    border-color: var(--nexpos-accent);
    color: #fff;
}

.btn-accent:hover {
    background-color: var(--nexpos-accent-dark);
    border-color: var(--nexpos-accent-dark);
    color: #fff;
}

.btn-touch {
    min-height: 52px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 0.85rem;
}

/* ---------- Load animation ---------- */
@keyframes nexpos-fade-up {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.nexpos-fade-up {
    animation: nexpos-fade-up 0.35s ease both;
}

.nexpos-fade-up-1 { animation-delay: 0.05s; }
.nexpos-fade-up-2 { animation-delay: 0.10s; }
.nexpos-fade-up-3 { animation-delay: 0.15s; }
.nexpos-fade-up-4 { animation-delay: 0.20s; }

/* Select2 / DataTables minor alignment fixes with Bootstrap 5 */
.select2-container .select2-selection--single {
    height: calc(2.4rem + 2px) !important;
    display: flex;
    align-items: center;
    border-radius: 0.5rem !important;
}

.dataTables_wrapper .dataTables_filter input,
.dataTables_wrapper .dataTables_length select {
    border-radius: 0.5rem;
    border: 1px solid #dcdfec;
    padding: 0.3rem 0.6rem;
}

.table-nexpos thead th {
    border-bottom: 2px solid #eceefa;
    color: #6b6f95;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ---------- Auth pages ---------- */
.text-accent {
    color: var(--nexpos-accent);
}

.nexpos-auth-body {
    background-color: var(--nexpos-body-bg);
    min-height: 100vh;
}

.nexpos-auth-wrapper {
    min-height: 100vh;
    display: flex;
}

.nexpos-auth-brand {
    flex: 1 1 45%;
    background:
        radial-gradient(circle at 15% 20%, rgba(255, 255, 255, 0.10) 0, transparent 45%),
        radial-gradient(circle at 85% 80%, rgba(255, 255, 255, 0.08) 0, transparent 40%),
        linear-gradient(135deg, var(--nexpos-accent) 0%, #312e81 100%);
    background-image:
        radial-gradient(circle at 15% 20%, rgba(255, 255, 255, 0.10) 0, transparent 45%),
        radial-gradient(circle at 85% 80%, rgba(255, 255, 255, 0.08) 0, transparent 40%),
        linear-gradient(135deg, var(--nexpos-accent) 0%, #312e81 100%),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40' viewBox='0 0 40 40'%3E%3Ccircle cx='2' cy='2' r='1.4' fill='%23ffffff' fill-opacity='0.08'/%3E%3C/svg%3E");
    background-repeat: no-repeat, no-repeat, no-repeat, repeat;
    align-items: center;
    justify-content: center;
    padding: 4rem;
    position: relative;
    overflow: hidden;
}

.nexpos-auth-brand p {
    max-width: 360px;
}

.nexpos-auth-logo {
    width: 56px;
    height: 56px;
}

.nexpos-auth-brand h2 span {
    color: #c7d2fe;
}

.nexpos-auth-panel {
    flex: 1 1 55%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.nexpos-auth-card {
    width: 100%;
    max-width: 380px;
    background-color: #ffffff;
    border-radius: var(--nexpos-card-radius);
    box-shadow: var(--nexpos-shadow-md);
    padding: 2.25rem 2rem;
}

/* ---------- Onboarding / business type selection ---------- */
.nexpos-onboarding-body {
    background-color: var(--nexpos-body-bg);
    min-height: 100vh;
}

.nexpos-onboarding-topbar {
    height: var(--nexpos-navbar-height);
    background-color: #ffffff;
    box-shadow: var(--nexpos-shadow-sm);
}

.nexpos-onboarding-wrapper {
    max-width: 1100px;
    margin: 0 auto;
    padding: 3rem 1.5rem 4rem;
}

.nexpos-biztype-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1.1rem;
}

.nexpos-biztype-card {
    background-color: #ffffff;
    border: none;
    border-radius: var(--nexpos-card-radius);
    box-shadow: var(--nexpos-shadow-sm);
    padding: 2rem 1rem;
    text-align: center;
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

.nexpos-biztype-card:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: var(--nexpos-shadow-md);
}

.nexpos-biztype-card:active {
    transform: translateY(-1px) scale(0.98);
}

.nexpos-biztype-card.selecting {
    opacity: 0.55;
    pointer-events: none;
}

.nexpos-biztype-card i {
    font-size: 2.4rem;
    color: var(--nexpos-accent);
    display: block;
    margin-bottom: 0.75rem;
}

.nexpos-biztype-card .biztype-name {
    font-weight: 600;
    font-size: 0.95rem;
}

.nexpos-biztype-badge {
    width: 56px;
    height: 56px;
    border-radius: 1rem;
    background-color: var(--nexpos-accent-light);
    color: var(--nexpos-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    flex-shrink: 0;
}

.nexpos-logo-preview {
    width: 64px;
    height: 64px;
    object-fit: contain;
    border-radius: 0.75rem;
    border: 1px solid #e5e7ee;
    background-color: #fff;
    padding: 4px;
}

.nexpos-image-preview {
    width: 80px;
    height: 80px;
    object-fit: contain;
    border-radius: 0.75rem;
    border: 1px solid #e5e7ee;
    background-color: #fff;
    padding: 4px;
    flex-shrink: 0;
}

.nexpos-thumb {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 0.5rem;
    border: 1px solid #e5e7ee;
}

.nexpos-thumb-placeholder {
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.5rem;
    border: 1px solid #e5e7ee;
    background-color: #f4f5fa;
    color: #9ca3af;
}

/* ---------- Ledger (chat-style timeline) ---------- */
.nexpos-ledger-pinned {
    position: sticky;
    top: calc(var(--nexpos-navbar-height) + 1rem);
    z-index: 10;
}

.nexpos-ledger-timeline {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    max-width: 900px;
    margin: 0 auto;
    padding-bottom: 2rem;
}

.nexpos-ledger-row {
    display: flex;
}

.nexpos-ledger-row.nexpos-ledger-left {
    justify-content: flex-start;
}

.nexpos-ledger-row.nexpos-ledger-right {
    justify-content: flex-end;
}

.nexpos-ledger-bubble {
    max-width: 72%;
    min-width: 260px;
    border-radius: 1rem;
    padding: 0.85rem 1.1rem;
    box-shadow: var(--nexpos-shadow-sm);
    background-color: #ffffff;
}

.nexpos-ledger-bubble-credit {
    background-color: #ecfdf5;
    border: 1px solid #a7f3d0;
    border-bottom-left-radius: 0.3rem;
}

.nexpos-ledger-bubble-debit {
    background-color: var(--nexpos-accent-light);
    border: 1px solid #c7d2fe;
    border-bottom-right-radius: 0.3rem;
}

@media (max-width: 767.98px) {
    .nexpos-ledger-bubble {
        max-width: 92%;
    }
}

/* ---------- POS screen ---------- */
.nexpos-pos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 0.85rem;
    max-height: calc(100vh - var(--nexpos-navbar-height) - 230px);
    min-height: 200px;
    overflow-y: auto;
    padding: 0.25rem 0.25rem 1rem;
}

.nexpos-pos-product-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    background-color: #fff;
    border: 1px solid #e5e7ee;
    border-radius: 1rem;
    padding: 0.75rem;
    cursor: pointer;
    user-select: none;
    transition: box-shadow 0.15s ease, transform 0.1s ease, border-color 0.15s ease;
}

.nexpos-pos-product-card:hover {
    box-shadow: var(--nexpos-shadow-md);
    transform: translateY(-2px);
    border-color: var(--nexpos-accent);
}

.nexpos-pos-product-card:active {
    transform: scale(0.96);
    background-color: var(--nexpos-accent-light);
}

.nexpos-pos-product-img {
    width: 140px;
    height: 140px;
    object-fit: cover;
    border-radius: 0.75rem;
    border: 1px solid #e5e7ee;
    margin-bottom: 0.5rem;
}

.nexpos-pos-product-img-placeholder {
    width: 140px;
    height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.75rem;
    border: 1px solid #e5e7ee;
    background-color: #f4f5fa;
    color: #9ca3af;
    font-size: 2.75rem;
    margin-bottom: 0.5rem;
}

.nexpos-pos-product-name {
    font-weight: 600;
    font-size: 0.85rem;
    line-height: 1.25;
    margin-bottom: 0.15rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.nexpos-pos-product-code {
    font-size: 0.72rem;
    color: #9ca3af;
    margin-bottom: 0.2rem;
}

.nexpos-pos-product-price {
    font-weight: 700;
    color: var(--nexpos-accent);
    font-size: 0.95rem;
}

.nexpos-pos-quick-row {
    display: flex;
    gap: 0.6rem;
    overflow-x: auto;
    padding: 0.25rem 0.25rem 0.6rem;
    scrollbar-width: thin;
}

.nexpos-pos-quick-card {
    flex: 0 0 auto;
    width: 92px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    background-color: #fff;
    border: 1px solid #e5e7ee;
    border-radius: 0.75rem;
    padding: 0.5rem;
    cursor: pointer;
    user-select: none;
    transition: box-shadow 0.15s ease, transform 0.1s ease, border-color 0.15s ease;
}

.nexpos-pos-quick-card:hover {
    box-shadow: var(--nexpos-shadow-md);
    transform: translateY(-2px);
    border-color: var(--nexpos-accent);
}

.nexpos-pos-quick-card:active {
    transform: scale(0.96);
    background-color: var(--nexpos-accent-light);
}

.nexpos-pos-quick-img,
.nexpos-pos-quick-img-placeholder {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 0.6rem;
    border: 1px solid #e5e7ee;
    margin-bottom: 0.35rem;
}

.nexpos-pos-quick-img-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f4f5fa;
    color: #9ca3af;
    font-size: 1.35rem;
}

.nexpos-pos-quick-name {
    font-weight: 600;
    font-size: 0.72rem;
    line-height: 1.2;
    margin-bottom: 0.15rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.nexpos-pos-quick-price {
    font-weight: 700;
    color: var(--nexpos-accent);
    font-size: 0.75rem;
}

.nexpos-pos-cart-list {
    max-height: calc(100vh - var(--nexpos-navbar-height) - 460px);
    min-height: 100px;
    overflow-y: auto;
}

.nexpos-pos-cart-item {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    padding: 0.6rem 0;
    border-bottom: 1px solid #eef0f6;
}

.nexpos-qty-stepper {
    display: flex;
    align-items: center;
    border: 1px solid #dcdfec;
    border-radius: 0.6rem;
    overflow: hidden;
    flex-shrink: 0;
}

.nexpos-qty-stepper button {
    width: 34px;
    height: 34px;
    border: none;
    background-color: #f4f5fa;
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--nexpos-accent);
    line-height: 1;
}

.nexpos-qty-stepper button:active {
    background-color: var(--nexpos-accent-light);
}

.nexpos-qty-stepper input {
    width: 42px;
    text-align: center;
    border: none;
    border-left: 1px solid #dcdfec;
    border-right: 1px solid #dcdfec;
    height: 34px;
    padding: 0;
}

.nexpos-cart-price-input {
    width: 90px;
}

.nexpos-toggle-group {
    display: inline-flex;
    border: 1px solid #dcdfec;
    border-radius: 0.6rem;
    overflow: hidden;
    flex-shrink: 0;
}

.nexpos-toggle-group button {
    border: none;
    background-color: #fff;
    padding: 0.4rem 0.75rem;
    font-size: 0.82rem;
    font-weight: 600;
    color: #6b7280;
}

.nexpos-toggle-group button.active {
    background-color: var(--nexpos-accent);
    color: #fff;
}

.nexpos-toggle-group.nexpos-toggle-sm button {
    padding: 0.2rem 0.5rem;
    font-size: 0.72rem;
}

.nexpos-charge-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

/* ---------- Quick Bill: big, icon-led, low-literacy-friendly single screen ---------- */

.nexpos-qb-label {
    font-size: 1.02rem;
}

.nexpos-qb-input {
    font-size: 1.75rem;
    font-weight: 700;
    text-align: center;
    min-height: 64px;
    border-radius: 0.85rem;
}

.nexpos-qb-netbill {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: var(--nexpos-accent-light);
    border-radius: 0.85rem;
    padding: 0.9rem 1.1rem;
}

.nexpos-qb-netbill-label {
    font-weight: 700;
    color: var(--nexpos-accent-dark);
    font-size: 1.05rem;
}

.nexpos-qb-netbill-value {
    font-weight: 800;
    font-size: 1.7rem;
    color: var(--nexpos-accent-dark);
}

.nexpos-qb-status-toggle {
    display: flex;
    gap: 0.75rem;
}

.nexpos-qb-status-toggle button {
    flex: 1;
    min-height: 64px;
    border: 2px solid #dcdfec;
    border-radius: 0.85rem;
    background-color: #fff;
    color: #6b7280;
    font-weight: 700;
    font-size: 1.05rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.2rem;
}

.nexpos-qb-status-toggle button i {
    font-size: 1.6rem;
}

.nexpos-qb-status-toggle button[data-status="Paid"].active {
    background-color: #ecfdf3;
    border-color: #16a34a;
    color: #16a34a;
}

.nexpos-qb-status-toggle button[data-status="Unpaid"].active {
    background-color: #fef2f2;
    border-color: #dc2626;
    color: #dc2626;
}

/* Compact variants - keep the whole Quick Bill form on one mobile screen */

.nexpos-qb-input-sm {
    font-size: 1.25rem;
    font-weight: 700;
    text-align: center;
    min-height: 48px;
    border-radius: 0.7rem;
}

.nexpos-qb-netbill-sm {
    padding: 0.6rem 0.9rem;
    border-radius: 0.7rem;
}

.nexpos-qb-netbill-sm .nexpos-qb-netbill-label {
    font-size: 0.92rem;
}

.nexpos-qb-netbill-sm .nexpos-qb-netbill-value {
    font-size: 1.3rem;
}

.nexpos-qb-status-toggle-sm {
    gap: 0.5rem;
}

.nexpos-qb-status-toggle-sm button {
    min-height: 44px;
    flex-direction: row;
    gap: 0.4rem;
    font-size: 0.92rem;
    border-radius: 0.7rem;
}

.nexpos-qb-status-toggle-sm button i {
    font-size: 1.05rem;
}

.nexpos-qb-success-icon {
    font-size: 2.5rem;
}

.nexpos-qb-desc-wrap {
    position: relative;
}

.nexpos-qb-desc-wrap textarea {
    padding-right: 3.5rem;
    resize: none;
    overflow-y: auto;
}

.nexpos-qb-mic-btn {
    position: absolute;
    right: 0.6rem;
    bottom: 0.6rem;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    border: none;
    background-color: var(--nexpos-accent);
    color: #fff;
    font-size: 1.15rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.nexpos-qb-mic-btn.listening {
    background-color: #dc2626;
}

.nexpos-qb-mic-pulse {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 50%;
    background-color: #dc2626;
    opacity: 0;
}

.nexpos-qb-mic-btn.listening .nexpos-qb-mic-pulse {
    animation: nexpos-qb-pulse 1.3s ease-out infinite;
}

@keyframes nexpos-qb-pulse {
    0% {
        opacity: 0.55;
        transform: scale(1);
    }
    100% {
        opacity: 0;
        transform: scale(2.1);
    }
}

.nexpos-qb-save-btn {
    min-height: 64px;
    font-size: 1.15rem;
}

.nexpos-qb-calc-btn {
    width: 44px;
    height: 44px;
    border-radius: 0.7rem;
    border: none;
    background-color: var(--nexpos-accent-light);
    color: var(--nexpos-accent);
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.nexpos-qb-calc-btn:active {
    background-color: var(--nexpos-accent);
    color: #fff;
}

/* Same footprint as .nexpos-qb-calc-btn but invisible - keeps the Discount
   label row exactly as tall as the Total Bill label row (which carries the
   calculator button) so both inputs below line up. */
.nexpos-qb-calc-btn-spacer {
    display: block;
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    visibility: hidden;
}

.nexpos-qb-calc-header {
    display: grid;
    grid-template-columns: 70px 20px 1fr 100px 36px;
    gap: 0.5rem;
    padding: 0 0.1rem 0.35rem;
    font-size: 0.78rem;
    font-weight: 700;
    color: #9095ab;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.nexpos-qb-calc-row {
    display: grid;
    grid-template-columns: 70px 20px 1fr 100px 36px;
    gap: 0.5rem;
    align-items: center;
    margin-bottom: 0.6rem;
}

.nexpos-qb-calc-row input {
    min-height: 48px;
    font-weight: 600;
    text-align: center;
}

.nexpos-qb-calc-row .nexpos-qb-calc-x {
    text-align: center;
    color: #9095ab;
    font-weight: 700;
}

.nexpos-qb-calc-row .nexpos-qb-calc-line-total {
    font-weight: 700;
    text-align: right;
    color: var(--nexpos-accent-dark);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nexpos-qb-calc-remove {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 0.6rem;
    background-color: #fef2f2;
    color: #dc2626;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

@media (max-width: 480px) {
    .nexpos-qb-calc-header,
    .nexpos-qb-calc-row {
        grid-template-columns: 55px 16px 1fr 80px 32px;
        gap: 0.35rem;
    }
}

/* ---------- Mobile: tighter spacing + POS grid/cart tuned for small screens ---------- */
@media (max-width: 991.98px) {
    .nexpos-content {
        padding: 1rem;
    }
}

@media (max-width: 767.98px) {
    .nexpos-pos-grid {
        grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
        gap: 0.6rem;
        max-height: none;
        overflow-y: visible;
    }

    .nexpos-pos-product-card {
        padding: 0.5rem;
    }

    .nexpos-pos-product-img,
    .nexpos-pos-product-img-placeholder {
        width: 100%;
        height: 96px;
    }

    .nexpos-pos-product-name {
        font-size: 0.78rem;
    }

    .nexpos-pos-cart-list {
        max-height: none;
        overflow-y: visible;
    }

    .nexpos-qty-stepper button {
        width: 40px;
        height: 40px;
    }

    .nexpos-qty-stepper input {
        height: 40px;
    }

    .nexpos-toggle-group button {
        padding: 0.55rem 0.6rem;
        font-size: 0.8rem;
    }

    /* Manual Sale Invoice line-items: stacked labeled cards instead of a horizontally-scrolling table */
    #manualLinesTable thead {
        display: none;
    }

    #manualLinesTable,
    #manualLinesTable tbody,
    #manualLinesTable tr,
    #manualLinesTable td {
        display: block;
        width: 100%;
    }

    #manualLinesTable tr {
        border: 1px solid #e5e7ee;
        border-radius: 0.75rem;
        margin-bottom: 0.75rem;
        padding: 0.75rem 2.5rem 0.75rem 0.75rem;
        position: relative;
    }

    #manualLinesTable td {
        border: none;
        padding: 0.35rem 0;
        text-align: left !important;
    }

    #manualLinesTable td[data-label]::before {
        content: attr(data-label);
        display: block;
        font-size: 0.7rem;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.04em;
        color: #9ca3af;
        margin-bottom: 0.2rem;
    }

    #manualLinesTable .manual-line-remove-cell {
        position: absolute;
        top: 0.5rem;
        right: 0.5rem;
        width: auto;
        padding: 0;
    }
}
