/* ============================================
   WHOLESALE POS SYSTEM - FRONTEND STYLES
   Mobile First Design
   ============================================ */

:root {
    --wpos-primary: #1976d2;
    --wpos-primary-dark: #1565c0;
    --wpos-secondary: #ff9800;
    --wpos-success: #4caf50;
    --wpos-danger: #f44336;
    --wpos-warning: #ff9800;
    --wpos-info: #2196f3;
    --wpos-bg: #f5f5f5;
    --wpos-surface: #ffffff;
    --wpos-text: #212121;
    --wpos-text-secondary: #757575;
    --wpos-border: #e0e0e0;
    --wpos-shadow: 0 2px 8px rgba(0,0,0,0.1);
    --wpos-radius: 12px;
    --wpos-radius-sm: 8px;
    --wpos-header-height: 56px;
    --wpos-bottom-nav-height: 64px;
    --wpos-safe-bottom: env(safe-area-inset-bottom, 0px);
}

[data-theme="dark"] {
    --wpos-bg: #121212;
    --wpos-surface: #1e1e1e;
    --wpos-text: #ffffff;
    --wpos-text-secondary: #b0b0b0;
    --wpos-border: #333333;
    --wpos-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    background: var(--wpos-bg);
    color: var(--wpos-text);
    height: 100%;
    overflow: hidden;
}

body.wpos-body {
    overscroll-behavior-y: none;
}

/* ============================================
   APP CONTAINER
   ============================================ */
.wpos-app {
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
    max-width: 600px;
    margin: 0 auto;
    background: var(--wpos-bg);
    position: relative;
}

/* ============================================
   LOGIN SCREEN
   ============================================ */
.wpos-login-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
    background: linear-gradient(135deg, var(--wpos-primary) 0%, var(--wpos-primary-dark) 100%);
}

.wpos-login-container {
    width: 100%;
    max-width: 360px;
    background: var(--wpos-surface);
    border-radius: var(--wpos-radius);
    padding: 32px 24px;
    box-shadow: var(--wpos-shadow);
}

.wpos-login-logo {
    text-align: center;
    margin-bottom: 28px;
}

.wpos-logo-icon {
    font-size: 56px;
    margin-bottom: 8px;
}

.wpos-login-logo h1 {
    font-size: 24px;
    font-weight: 700;
    color: var(--wpos-primary);
}

.wpos-login-logo p {
    font-size: 14px;
    color: var(--wpos-text-secondary);
}

.wpos-login-form .wpos-form-group {
    margin-bottom: 16px;
}

.wpos-login-form label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--wpos-text-secondary);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.wpos-login-form input {
    width: 100%;
    padding: 14px 16px;
    font-size: 16px;
    border: 2px solid var(--wpos-border);
    border-radius: var(--wpos-radius-sm);
    background: var(--wpos-surface);
    color: var(--wpos-text);
    transition: border-color 0.2s;
}

.wpos-login-form input:focus {
    outline: none;
    border-color: var(--wpos-primary);
}

.wpos-remember-me {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 4px 0 16px;
    cursor: pointer;
    font-size: 13px;
    color: var(--wpos-text-secondary);
    user-select: none;
}

.wpos-remember-me input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--wpos-primary);
    margin: 0;
    cursor: pointer;
}

.wpos-remember-me span {
    line-height: 1.3;
}

.wpos-login-debug {
    margin-top: 14px;
    text-align: center;
    font-size: 12px;
}

.wpos-login-debug a {
    color: #6b7280;
    text-decoration: none;
}

.wpos-login-debug a:hover {
    color: #5b5cd6;
    text-decoration: underline;
}

.wpos-login-debug pre {
    text-align: left;
    background: #f9fafc;
    color: #1f2937;
    padding: 10px;
    border-radius: 8px;
    font-size: 10px;
    max-height: 300px;
    overflow: auto;
    margin-top: 8px;
    line-height: 1.4;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.wpos-error-message {
    color: #ef4444;
    font-size: 13px;
    text-align: center;
    margin-top: 10px;
    padding: 8px;
    background: #fef2f2;
    border-radius: 6px;
    display: none;
}

.wpos-error-message:not(:empty) {
    display: block;
}

/* ============================================
   HEADER
   ============================================ */
.wpos-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--wpos-header-height);
    padding: 0 16px;
    background: var(--wpos-surface);
    border-bottom: 1px solid var(--wpos-border);
    position: sticky;
    top: 0;
    z-index: 100;
    flex-shrink: 0;
}

.wpos-header-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--wpos-primary);
}

.wpos-header-actions {
    display: flex;
    gap: 8px;
}

.wpos-icon-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    color: var(--wpos-text);
    font-size: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
}

.wpos-icon-btn:active {
    background: var(--wpos-border);
}

/* ============================================
   MAIN CONTENT
   ============================================ */
.wpos-main {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 12px;
    padding-bottom: calc(var(--wpos-bottom-nav-height) + var(--wpos-safe-bottom) + 12px);
    -webkit-overflow-scrolling: touch;
}

/* ============================================
   BOTTOM NAVIGATION
   ============================================ */
.wpos-bottom-nav {
    display: flex;
    align-items: center;
    justify-content: space-around;
    height: var(--wpos-bottom-nav-height);
    padding-bottom: var(--wpos-safe-bottom);
    background: var(--wpos-surface);
    border-top: 1px solid var(--wpos-border);
    position: sticky;
    bottom: 0;
    z-index: 100;
    flex-shrink: 0;
}

.wpos-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    height: 100%;
    border: none;
    background: transparent;
    color: var(--wpos-text-secondary);
    cursor: pointer;
    transition: color 0.2s;
}

.wpos-nav-item.active {
    color: var(--wpos-primary);
}

.wpos-nav-icon {
    font-size: 22px;
    line-height: 1;
}

.wpos-nav-label {
    font-size: 11px;
    font-weight: 500;
}

/* ============================================
   BUTTONS
   ============================================ */
.wpos-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 20px;
    font-size: 15px;
    font-weight: 600;
    border: none;
    border-radius: var(--wpos-radius-sm);
    cursor: pointer;
    transition: all 0.2s;
    min-height: 48px;
}

.wpos-btn-block {
    width: 100%;
}

.wpos-btn-primary {
    background: var(--wpos-primary);
    color: #fff;
}

.wpos-btn-primary:active {
    background: var(--wpos-primary-dark);
    transform: scale(0.98);
}

.wpos-btn-secondary {
    background: var(--wpos-secondary);
    color: #fff;
}

.wpos-btn-success {
    background: var(--wpos-success);
    color: #fff;
}

.wpos-btn-danger {
    background: var(--wpos-danger);
    color: #fff;
}

.wpos-btn-outline {
    background: transparent;
    border: 2px solid var(--wpos-primary);
    color: var(--wpos-primary);
}

.wpos-btn-sm {
    padding: 8px 14px;
    font-size: 13px;
    min-height: 36px;
}

.wpos-btn-lg {
    padding: 18px 24px;
    font-size: 17px;
    min-height: 56px;
}

/* ============================================
   CARDS
   ============================================ */
.wpos-card {
    background: var(--wpos-surface);
    border-radius: var(--wpos-radius);
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: var(--wpos-shadow);
}

.wpos-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.wpos-card-title {
    font-size: 16px;
    font-weight: 700;
}

/* ============================================
   STATS GRID
   ============================================ */
.wpos-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}

.wpos-stat-card {
    background: var(--wpos-surface);
    border-radius: var(--wpos-radius);
    padding: 16px;
    text-align: center;
    box-shadow: var(--wpos-shadow);
}

.wpos-stat-value {
    font-size: 22px;
    font-weight: 700;
    color: var(--wpos-primary);
    margin-bottom: 4px;
}

.wpos-stat-label {
    font-size: 12px;
    color: var(--wpos-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ============================================
   FORMS
   ============================================ */
.wpos-form-group {
    margin-bottom: 16px;
}

.wpos-form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--wpos-text-secondary);
    margin-bottom: 6px;
}

.wpos-form-group input,
.wpos-form-group select,
.wpos-form-group textarea {
    width: 100%;
    padding: 14px 16px;
    font-size: 16px;
    border: 2px solid var(--wpos-border);
    border-radius: var(--wpos-radius-sm);
    background: var(--wpos-surface);
    color: var(--wpos-text);
    transition: border-color 0.2s;
}

.wpos-form-group input:focus,
.wpos-form-group select:focus,
.wpos-form-group textarea:focus {
    outline: none;
    border-color: var(--wpos-primary);
}

.wpos-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

/* ============================================
   SEARCH
   ============================================ */
.wpos-search-box {
    position: relative;
    margin-bottom: 12px;
}

.wpos-search-box input {
    width: 100%;
    padding: 14px 16px 14px 44px;
    font-size: 16px;
    border: 2px solid var(--wpos-border);
    border-radius: var(--wpos-radius-sm);
    background: var(--wpos-surface);
    color: var(--wpos-text);
}

.wpos-search-box::before {
    content: "🔍";
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 18px;
}

/* ============================================
   LISTS
   ============================================ */
.wpos-list {
    list-style: none;
}

.wpos-list-item {
    background: var(--wpos-surface);
    border-radius: var(--wpos-radius-sm);
    padding: 14px 16px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    transition: background 0.2s;
}

.wpos-list-item:active {
    background: var(--wpos-border);
}

.wpos-list-item-info h4 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 2px;
}

.wpos-list-item-info p {
    font-size: 13px;
    color: var(--wpos-text-secondary);
}

.wpos-list-item-action {
    font-size: 18px;
    color: var(--wpos-text-secondary);
}

/* ============================================
   TABLES
   ============================================ */
.wpos-table-container {
    overflow-x: auto;
    margin-bottom: 16px;
}

.wpos-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.wpos-table th,
.wpos-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--wpos-border);
}

.wpos-table th {
    font-weight: 600;
    color: var(--wpos-text-secondary);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: var(--wpos-bg);
}

/* ============================================
   BILLING
   ============================================ */
.wpos-bill-header {
    background: var(--wpos-surface);
    border-radius: var(--wpos-radius);
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: var(--wpos-shadow);
}

.wpos-bill-items {
    background: var(--wpos-surface);
    border-radius: var(--wpos-radius);
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: var(--wpos-shadow);
}

.wpos-bill-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--wpos-border);
}

.wpos-bill-item:last-child {
    border-bottom: none;
}

.wpos-bill-item-info {
    flex: 1;
}

.wpos-bill-item-name {
    font-weight: 600;
    font-size: 14px;
}

.wpos-bill-item-meta {
    font-size: 12px;
    color: var(--wpos-text-secondary);
}

.wpos-bill-item-qty {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 12px;
}

.wpos-qty-btn {
    width: 32px;
    height: 32px;
    border: 1px solid var(--wpos-border);
    background: var(--wpos-bg);
    border-radius: 50%;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.wpos-bill-item-total {
    font-weight: 700;
    font-size: 15px;
    min-width: 80px;
    text-align: right;
}

.wpos-bill-summary {
    background: var(--wpos-surface);
    border-radius: var(--wpos-radius);
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: var(--wpos-shadow);
}

.wpos-summary-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 14px;
}

.wpos-summary-row.total {
    font-size: 18px;
    font-weight: 700;
    border-top: 2px solid var(--wpos-border);
    padding-top: 12px;
    margin-top: 8px;
}

/* ============================================
   MODALS
   ============================================ */
.wpos-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.2s ease;
}

.wpos-modal {
    background: var(--wpos-surface);
    border-radius: var(--wpos-radius) var(--wpos-radius) 0 0;
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease;
}

.wpos-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    border-bottom: 1px solid var(--wpos-border);
    position: sticky;
    top: 0;
    background: var(--wpos-surface);
    z-index: 10;
}

.wpos-modal-title {
    font-size: 18px;
    font-weight: 700;
}

.wpos-modal-close {
    width: 36px;
    height: 36px;
    border: none;
    background: var(--wpos-bg);
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
}

.wpos-modal-body {
    padding: 16px;
}

.wpos-modal-footer {
    display: flex;
    gap: 12px;
    padding: 16px;
    border-top: 1px solid var(--wpos-border);
    position: sticky;
    bottom: 0;
    background: var(--wpos-surface);
}

.wpos-modal-footer .wpos-btn {
    flex: 1;
}

/* ============================================
   PAYMENT MODAL
   ============================================ */
.wpos-payment-modes {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 16px;
}

.wpos-payment-mode-btn {
    padding: 16px;
    border: 2px solid var(--wpos-border);
    background: var(--wpos-surface);
    border-radius: var(--wpos-radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.wpos-payment-mode-btn.active {
    border-color: var(--wpos-primary);
    background: rgba(25, 118, 210, 0.1);
    color: var(--wpos-primary);
}

.wpos-payment-split {
    margin-top: 16px;
}

.wpos-split-row {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 10px;
}

.wpos-split-row select {
    flex: 1;
    padding: 12px;
    border: 2px solid var(--wpos-border);
    border-radius: var(--wpos-radius-sm);
    background: var(--wpos-surface);
    color: var(--wpos-text);
}

.wpos-split-row input {
    flex: 1;
    padding: 12px;
    border: 2px solid var(--wpos-border);
    border-radius: var(--wpos-radius-sm);
    background: var(--wpos-surface);
    color: var(--wpos-text);
}

/* ============================================
   TOASTS
   ============================================ */
.wpos-toast {
    position: fixed;
    bottom: calc(var(--wpos-bottom-nav-height) + 20px);
    left: 50%;
    transform: translateX(-50%);
    background: #323232;
    color: #fff;
    padding: 14px 24px;
    border-radius: var(--wpos-radius-sm);
    font-size: 14px;
    font-weight: 500;
    z-index: 2000;
    animation: toastIn 0.3s ease;
    max-width: 90%;
    text-align: center;
}

.wpos-toast.success {
    background: var(--wpos-success);
}

.wpos-toast.error {
    background: var(--wpos-danger);
}

/* ============================================
   INVOICE PRINT
   ============================================ */
.wpos-invoice-print {
    font-family: 'Courier New', monospace;
    font-size: 12px;
    line-height: 1.4;
    max-width: 80mm;
    margin: 0 auto;
    padding: 8px;
}

.wpos-invoice-print h2 {
    text-align: center;
    font-size: 16px;
    margin-bottom: 8px;
}

.wpos-invoice-print .center {
    text-align: center;
}

.wpos-invoice-print .divider {
    border-top: 1px dashed #000;
    margin: 8px 0;
}

.wpos-invoice-print table {
    width: 100%;
    font-size: 11px;
}

.wpos-invoice-print td {
    padding: 2px 0;
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

@keyframes toastIn {
    from { opacity: 0; transform: translateX(-50%) translateY(20px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ============================================
   UTILITIES
   ============================================ */
.wpos-text-right { text-align: right; }
.wpos-text-center { text-align: center; }
.wpos-text-primary { color: var(--wpos-primary); }
.wpos-text-success { color: var(--wpos-success); }
.wpos-text-danger { color: var(--wpos-danger); }
.wpos-text-secondary { color: var(--wpos-text-secondary); }
.wpos-mb-0 { margin-bottom: 0; }
.wpos-mb-1 { margin-bottom: 8px; }
.wpos-mb-2 { margin-bottom: 16px; }
.wpos-mt-1 { margin-top: 8px; }
.wpos-mt-2 { margin-top: 16px; }
.wpos-flex { display: flex; }
.wpos-flex-between { display: flex; justify-content: space-between; align-items: center; }
.wpos-gap-1 { gap: 8px; }
.wpos-gap-2 { gap: 16px; }
.wpos-hidden { display: none !important; }

/* ============================================
   SCROLLBAR
   ============================================ */
.wpos-main::-webkit-scrollbar {
    width: 4px;
}

.wpos-main::-webkit-scrollbar-track {
    background: transparent;
}

.wpos-main::-webkit-scrollbar-thumb {
    background: var(--wpos-border);
    border-radius: 4px;
}

/* ============================================
   PRODUCT SELECTOR
   ============================================ */
.wpos-product-search-results {
    max-height: 300px;
    overflow-y: auto;
    background: var(--wpos-surface);
    border: 1px solid var(--wpos-border);
    border-radius: var(--wpos-radius-sm);
    margin-top: 4px;
}

.wpos-product-result {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    border-bottom: 1px solid var(--wpos-border);
    cursor: pointer;
}

.wpos-product-result:last-child {
    border-bottom: none;
}

.wpos-product-result:active {
    background: var(--wpos-bg);
}

.wpos-product-result-name {
    font-weight: 600;
    font-size: 14px;
}

.wpos-product-result-price {
    font-weight: 700;
    color: var(--wpos-primary);
}

/* ============================================
   QUICK ACTIONS
   ============================================ */
.wpos-quick-actions {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 16px;
}

.wpos-quick-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 20px 12px;
    background: var(--wpos-surface);
    border: 1px solid var(--wpos-border);
    border-radius: var(--wpos-radius);
    color: var(--wpos-text);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: var(--wpos-shadow);
}

.wpos-quick-btn:active {
    transform: scale(0.97);
    background: var(--wpos-bg);
}

.wpos-quick-btn .icon {
    font-size: 28px;
}

/* ============================================
   REPORTS
   ============================================ */
.wpos-report-filters {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.wpos-report-filters button {
    padding: 8px 14px;
    border: 1px solid var(--wpos-border);
    background: var(--wpos-surface);
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
    color: var(--wpos-text);
}

.wpos-report-filters button.active {
    background: var(--wpos-primary);
    color: #fff;
    border-color: var(--wpos-primary);
}

/* ============================================
   EMPTY STATE
   ============================================ */
.wpos-empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--wpos-text-secondary);
}

.wpos-empty-state .icon {
    font-size: 48px;
    margin-bottom: 12px;
    opacity: 0.5;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (min-width: 768px) {
    .wpos-app {
        max-width: 480px;
        border-left: 1px solid var(--wpos-border);
        border-right: 1px solid var(--wpos-border);
    }
    
    .wpos-stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .wpos-quick-actions {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ============================================
   BUSY STYLE CREATE BILL SCREEN
   ============================================ */
.wpos-app.wpos-busy-mode {
    max-width: none;
    width: 100vw;
    border: none;
    background: #cfeeee;
}

.wpos-app.wpos-busy-mode .wpos-header,
.wpos-app.wpos-busy-mode .wpos-bottom-nav {
    display: none;
}

.wpos-app.wpos-busy-mode .wpos-main {
    padding: 0;
    overflow: auto;
    background: #cfeeee;
    font-family: Arial, Helvetica, sans-serif;
}

.wpos-busy-shell {
    min-width: 1080px;
    min-height: 100vh;
    background: #cfeeee;
    color: #000;
    font-size: 12px;
    line-height: 1.15;
}

.wpos-busy-titlebar {
    height: 24px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 4px;
    background: #ededed;
    color: #777;
    border-bottom: 1px solid #bdbdbd;
    white-space: nowrap;
}

.wpos-busy-windowbar {
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #2d7771;
    padding: 0 2px;
}

.wpos-busy-firstbar {
    margin-top: 0;
}

.wpos-busy-windowbar button,
.wpos-busy-action-row button {
    height: 18px;
    padding: 0 8px;
    border: 1px solid #7b7b7b;
    background: #f3f3f3;
    color: #000;
    font-size: 12px;
    line-height: 16px;
    box-shadow: inset 1px 1px 0 #fff;
    cursor: pointer;
}

.wpos-busy-windowbar > button,
.wpos-busy-window-actions button {
    background: #2d7771;
    color: #fff;
    border-color: #e8ffff;
    font-weight: 700;
}

.wpos-busy-sale-strip {
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-size: 13px;
}

.wpos-busy-sale-strip span {
    background: #d85252;
    color: #fff;
    padding: 2px 16px;
    font-weight: 700;
}

.wpos-busy-sale-strip strong {
    color: #0000ff;
}

.wpos-busy-workspace {
    display: block;
    gap: 0;
    height: calc(100vh - 93px);
}

.wpos-busy-voucher {
    padding: 7px 4px 0;
    overflow: auto;
    width: 100%;
}

.wpos-busy-meta-grid {
    display: grid;
    grid-template-columns: 62px 96px 68px 78px 150px 70px 205px 54px 230px;
    align-items: center;
    column-gap: 6px;
    row-gap: 4px;
    max-width: 1048px;
}

.wpos-busy-meta-grid label {
    font-size: 12px;
    color: #000;
}

.wpos-busy-meta-grid input,
.wpos-busy-entry-row input,
.wpos-busy-sundry input {
    height: 18px;
    padding: 0 3px;
    border: none;
    border-bottom: 1px solid #777;
    background: transparent;
    color: #000;
    font-size: 12px;
    font-weight: 700;
    outline: none;
}

.wpos-busy-meta-grid input:focus,
.wpos-busy-entry-row input:focus,
.wpos-busy-sundry input:focus {
    background: #fffbd2;
    border-bottom-color: #0000ff;
}

.wpos-busy-party-cell {
    position: relative;
    grid-column: span 2;
}

.wpos-busy-party-cell input {
    width: 100%;
    background: #333;
    color: #fff;
    padding-left: 4px;
}

.wpos-busy-party-cell small {
    display: block;
    color: #8000ff;
    margin-top: 2px;
    font-size: 11px;
}

.wpos-busy-day {
    color: #8000ff;
    font-size: 12px;
}

.wpos-busy-entry-row {
    display: grid;
    grid-template-columns: 82px 82px minmax(360px, 1fr) 92px;
    gap: 6px;
    align-items: end;
    max-width: 850px;
    margin: 6px 0 2px;
}

.wpos-busy-product-entry {
    position: relative;
}

.wpos-busy-product-entry label {
    display: none;
}

.wpos-busy-entry-row input {
    width: 100%;
    height: 22px;
    background: #fffbd2;
    border: 1px solid #777;
}

.wpos-busy-entry-row button {
    height: 22px;
    border: 1px solid #777;
    background: #e9e9e9;
    color: #000;
    font-size: 12px;
    cursor: pointer;
}

.wpos-busy-entry-row button.active {
    background: #2d7771;
    color: #fff;
    font-weight: 700;
}

.wpos-busy-search-results {
    position: absolute;
    z-index: 500;
    left: 0;
    top: 100%;
    min-width: 320px;
    max-width: 520px;
    max-height: 260px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid #2d7771;
    box-shadow: 2px 3px 8px rgba(0,0,0,0.25);
}

.wpos-busy-search-results .wpos-product-result {
    border-radius: 0;
    padding: 6px 8px;
    color: #000;
    background: #fff;
    border-bottom: 1px solid #ddd;
}

.wpos-busy-search-results .wpos-product-result:hover {
    background: #cfeeee;
}

.wpos-busy-grid-wrap {
    width: 100%;
    max-width: 1138px;
    background: #f8f8f8;
    border-left: 1px solid #c5c5c5;
    border-right: 1px solid #c5c5c5;
}

.wpos-busy-item-grid {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    background: #fafafa;
    font-size: 16px;
}

.wpos-busy-item-grid th {
    height: 22px;
    text-align: left;
    font-size: 16px;
    font-weight: 700;
    background: #eeeeee;
    border-right: 1px solid #c9c9c9;
    border-bottom: 1px solid #c9c9c9;
    padding: 0 4px;
}

.wpos-busy-item-grid th:nth-child(3),
.wpos-busy-item-grid th:nth-child(5),
.wpos-busy-item-grid th:nth-child(8) {
    text-align: right;
}

.wpos-busy-item-grid td {
    height: 21px;
    border-right: 1px solid #d1d1d1;
    border-bottom: 1px solid #d1d1d1;
    padding: 0 4px;
    vertical-align: middle;
    color: #000;
}

.wpos-busy-blank-row td:first-child,
.wpos-busy-filled-row td:first-child {
    width: 34px;
    font-weight: 700;
    font-size: 18px;
}

.wpos-busy-filled-row {
    background: #fff;
}

.wpos-busy-filled-row small {
    display: block;
    font-size: 10px;
    color: #6a6a6a;
    line-height: 1;
}

.wpos-busy-cell-input {
    width: 100%;
    height: 19px;
    border: none;
    background: transparent;
    color: #000;
    font-size: 13px;
    outline: none;
}

.wpos-busy-cell-input.item {
    font-weight: 700;
}

.wpos-busy-cell-input.num {
    text-align: right;
}

.wpos-busy-cell-input:focus {
    background: #fffbd2;
    outline: 1px solid #4e8cff;
}

.wpos-busy-amount-cell {
    text-align: right;
    font-weight: 700;
    font-size: 13px;
}

.wpos-busy-del {
    width: 24px;
    height: 18px;
    border: 1px solid #a0a0a0;
    background: #f7d8d8;
    color: #8b0000;
    font-weight: 700;
    cursor: pointer;
}

.wpos-busy-item-grid tfoot td {
    background: #cfeeee;
    border: none;
    font-weight: 700;
    font-size: 16px;
    height: 36px;
}

#wpos-busy-total-qty,
#wpos-busy-grid-amount {
    text-align: right;
}

.wpos-busy-sundry {
    max-width: 1158px;
    height: 86px;
    border: 1px solid #aaa;
    border-left-color: #cfcfcf;
    background: #cfeeee;
    position: relative;
    margin-top: 0;
}

.wpos-busy-section-title {
    position: absolute;
    top: -8px;
    left: 8px;
    background: #cfeeee;
    color: #9000cc;
    padding: 0 4px;
    font-size: 11px;
}

.wpos-busy-sundry-row {
    display: grid;
    grid-template-columns: 28px 34px 1fr 96px 96px 28px 34px 86px 120px 120px;
    gap: 6px;
    align-items: center;
    padding: 12px 8px;
}

.wpos-busy-sundry-row input {
    width: 100%;
    text-align: right;
}

.wpos-busy-checkbox {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
}

.wpos-busy-checkbox input {
    width: auto;
    height: auto;
}

.wpos-busy-bottom-panel {
    display: grid;
    grid-template-columns: 36% 32% 32%;
    max-width: 1158px;
    height: 120px;
    border-left: 1px solid #b7b7b7;
    border-bottom: 1px solid #b7b7b7;
}

.wpos-busy-na,
.wpos-busy-settlement,
.wpos-busy-total-box {
    border-right: 1px solid #b7b7b7;
    padding: 8px;
    background: #cfeeee;
}

.wpos-busy-settlement {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-content: start;
    gap: 14px;
}

.wpos-busy-settlement strong {
    text-align: right;
}

.wpos-busy-total-box {
    padding: 0;
}

.wpos-busy-total-box .wpos-summary-row {
    padding: 4px 8px;
    font-size: 12px;
}

.wpos-busy-total-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 46px;
    padding: 0 10px;
    border-top: 1px solid #b7b7b7;
    background: #cfeeee;
    font-size: 19px;
    font-family: Georgia, 'Times New Roman', serif;
    font-weight: 700;
}

.wpos-busy-action-row {
    max-width: 1158px;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    background: #cfeeee;
}

.wpos-busy-action-row button:nth-last-child(-n+5) {
    margin-left: auto;
}

.wpos-busy-action-row button + button:nth-last-child(-n+4) {
    margin-left: 4px;
}

.wpos-busy-mini-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 24px;
    background: #d5d5d5;
    color: #000;
    font-size: 8px;
    text-align: center;
    line-height: 1;
}

.wpos-busy-sidebar {
    background: #efefef;
    border-left: 1px solid #c5c5c5;
    padding: 8px 6px;
    color: #000;
    font-size: 10px;
    overflow-y: auto;
}

.wpos-busy-sidebar div {
    margin-bottom: 9px;
    white-space: nowrap;
}

.wpos-busy-sidebar b {
    color: #7d0000;
    text-decoration: underline;
    display: inline-block;
    min-width: 18px;
    font-size: 12px;
}

.wpos-busy-sidebar hr {
    border: none;
    border-top: 1px solid #d0d0d0;
    margin: 16px 0;
}

.wpos-busy-shortcutbar {
    height: 19px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 22px;
    background: #2d7771;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
}

.wpos-busy-statusbar {
    height: 54px;
    display: grid;
    grid-template-columns: 120px 1fr 1fr 1fr 1fr 1fr;
    align-items: center;
    gap: 8px;
    padding: 0 6px;
    background: #efefef;
    border-top: 1px solid #c8c8c8;
    color: #000;
    font-size: 12px;
}

.wpos-busy-statusbar strong {
    color: #1462a4;
    font-size: 20px;
}

/* ============================================
   MODERN BILL UI (Purple)
   ============================================ */
.wpos-app.wpos-busy-mode {
    max-width: none !important;
    width: 100vw !important;
    background: #f4f5fb !important;
    border: 0 !important;
}

.wpos-app.wpos-busy-mode .wpos-main {
    background: #f4f5fb;
    padding: 0;
}

.wpos-mbill {
    display: flex;
    flex-direction: column;
    min-height: 100dvh;
    max-width: 900px;
    margin: 0 auto;
    background: #f4f5fb;
}

.wpos-mbill-header {
    display: grid;
    grid-template-columns: 44px 1fr 44px;
    align-items: center;
    padding: 0 12px;
    height: 90px;
    background: linear-gradient(135deg, #5b5cd6 0%, #4746c7 100%);
    color: #fff;
    box-shadow: 0 2px 8px rgba(75, 70, 199, 0.25);
}

.wpos-mbill-back,
.wpos-mbill-icon {
    width: 40px;
    height: 40px;
    background: transparent;
    border: 0;
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    border-radius: 8px;
}

.wpos-mbill-back:hover,
.wpos-mbill-icon:hover {
    background: rgba(255, 255, 255, 0.15);
}

.wpos-mbill-title {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 0.3px;
}

.wpos-mbill-scroll {
    flex: 1;
    padding: 14px 14px 130px;
    overflow-y: auto;
}

.wpos-mbill-card {
    background: #fff;
    border: 1px solid #eceef5;
    border-radius: 14px;
    padding: 14px;
    margin-bottom: 12px;
}

.wpos-mbill-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.wpos-field {
    padding: 4px 0;
    cursor: pointer;
}

.wpos-field label {
    display: block;
    font-size: 12px;
    color: #6b7280;
    margin-bottom: 6px;
    font-weight: 500;
}

.wpos-field-value {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: #fff;
    border: 1px solid #e2e6ea;
    border-radius: 10px;
    min-height: 44px;
}

.wpos-field-input {
    padding: 0;
}

.wpos-field-input .wpos-field-icon {
    padding-left: 12px;
    background: #f0f1f8;
    align-self: stretch;
    display: flex;
    align-items: center;
    padding-right: 12px;
    border-radius: 10px 0 0 10px;
    font-weight: 600;
    color: #6b7280;
}

.wpos-field-input input {
    flex: 1;
    border: 0;
    outline: 0;
    padding: 10px 12px;
    font-size: 15px;
    font-weight: 500;
    color: #1f2937;
    background: transparent;
    height: 44px;
    box-sizing: border-box;
}

.wpos-field-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    background: #eef0ff;
    color: #5b5cd6;
    border-radius: 8px;
    font-size: 14px;
    flex-shrink: 0;
}

.wpos-field-text {
    flex: 1;
    font-size: 15px;
    font-weight: 500;
    color: #1f2937;
}

.wpos-muted {
    color: #9ca3af !important;
    font-weight: 400 !important;
}

.wpos-field-caret {
    color: #9ca3af;
    font-size: 12px;
}

/* Search bar */
.wpos-mbill-search {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 14px;
    background: #fff;
    border: 1px solid #eceef5;
    border-radius: 14px;
    margin-bottom: 12px;
}

.wpos-search-icon {
    color: #9ca3af;
    font-size: 18px;
}

.wpos-mbill-search input {
    flex: 1;
    border: 0;
    outline: 0;
    font-size: 15px;
    color: #1f2937;
    background: transparent;
    height: 32px;
}

.wpos-mbill-search input::placeholder {
    color: #9ca3af;
}

.wpos-scan-btn {
    background: #f0f1f8;
    border: 0;
    color: #5b5cd6;
    padding: 6px 10px;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
}

.wpos-search-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 40;
    background: #fff;
    border: 1px solid #d0d5dd;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
    margin-top: 4px;
    max-height: 300px;
    overflow-y: auto;
}

.wpos-search-result {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    border-bottom: 1px solid #f1f3f9;
    cursor: pointer;
}

.wpos-search-result:hover {
    background: #f9fafc;
}

.wpos-search-name {
    font-size: 15px;
    font-weight: 600;
    color: #1f2937;
}

.wpos-search-meta {
    font-size: 12px;
    color: #6b7280;
    margin-top: 2px;
}

.wpos-search-add {
    background: #5b5cd6;
    color: #fff;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 700;
}

.wpos-search-empty {
    padding: 14px;
    text-align: center;
    color: #9ca3af;
}

/* Items table */
.wpos-items-card {
    padding: 0;
    overflow: hidden;
}

.wpos-items-head {
    display: grid;
    grid-template-columns: 40px 1fr 130px 90px 90px 30px;
    align-items: center;
    padding: 12px 14px;
    background: #f0f1f8;
    font-size: 13px;
    font-weight: 600;
    color: #4b5563;
    border-bottom: 1px solid #eceef5;
}

.wpos-items-head .c-price,
.wpos-items-head .c-amount {
    text-align: right;
}

.wpos-items-head .c-qty {
    text-align: center;
}

.wpos-item-row {
    display: grid;
    grid-template-columns: 40px 1fr 130px 90px 90px 30px;
    align-items: center;
    padding: 14px;
    border-bottom: 1px solid #f1f3f9;
    font-size: 15px;
    color: #1f2937;
}

.wpos-item-row:last-child {
    border-bottom: 0;
}

.wpos-item-row .c-sn {
    color: #6b7280;
    font-weight: 500;
}

.wpos-item-row .c-name {
    font-weight: 500;
    padding-right: 10px;
}

.wpos-item-row .c-price,
.wpos-item-row .c-amount {
    text-align: right;
    font-weight: 500;
}

.wpos-qty-stepper {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    border: 1px solid #e2e6ea;
    border-radius: 8px;
    overflow: hidden;
    height: 34px;
    background: #fff;
}

.wpos-qty-stepper button {
    width: 34px;
    height: 34px;
    border: 0;
    background: #fff;
    color: #4b5563;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
}

.wpos-qty-stepper button:hover {
    background: #f0f1f8;
    color: #5b5cd6;
}

.wpos-qty-stepper span {
    min-width: 36px;
    text-align: center;
    font-weight: 600;
    font-size: 14px;
    color: #1f2937;
    border-left: 1px solid #e2e6ea;
    border-right: 1px solid #e2e6ea;
    line-height: 34px;
}

.wpos-item-del {
    background: transparent;
    border: 0;
    color: #ef4444;
    font-size: 18px;
    cursor: pointer;
}

.wpos-items-empty {
    text-align: center;
    padding: 40px 20px;
    color: #9ca3af;
    font-size: 14px;
}

.wpos-items-empty .icon {
    font-size: 48px;
    margin-bottom: 8px;
    opacity: 0.5;
}

/* ============================================
   NEW CART CARDS (each item = card with big buttons)
   ============================================ */
.wpos-cart-card {
    background: #fff;
    border: 1px solid #e2e6ea;
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.wpos-cart-card-top {
    display: grid;
    grid-template-columns: 28px 1fr 36px;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.wpos-cart-sn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: #eef0ff;
    color: #5b5cd6;
    border-radius: 50%;
    font-weight: 700;
    font-size: 13px;
}

.wpos-cart-name {
    font-size: 15px;
    font-weight: 600;
    color: #1f2937;
    line-height: 1.3;
    word-break: break-word;
}

.wpos-cart-remove {
    width: 36px;
    height: 36px;
    padding: 0;
    border: 1.5px solid #fca5a5;
    background: #fef2f2;
    color: #dc2626;
    border-radius: 10px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    line-height: 1;
    transition: all 0.15s;
}

.wpos-cart-remove:active {
    background: #dc2626;
    color: #fff;
    transform: scale(0.92);
}

.wpos-cart-card-bottom {
    display: grid;
    grid-template-columns: 1.3fr 1fr 1fr;
    gap: 8px;
    align-items: end;
}

.wpos-cart-card-bottom label {
    display: block;
    font-size: 10px;
    font-weight: 700;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.wpos-cart-card-bottom input {
    width: 100%;
    height: 40px;
    padding: 0 8px;
    border: 1px solid #d0d5dd;
    border-radius: 8px;
    background: #fff;
    font-size: 14px;
    font-weight: 600;
    color: #1f2937;
    text-align: center;
    box-sizing: border-box;
    outline: none;
}

.wpos-cart-card-bottom input:focus {
    border-color: #5b5cd6;
    box-shadow: 0 0 0 3px rgba(91, 92, 214, 0.15);
}

.wpos-qty-stepper {
    display: grid;
    grid-template-columns: 34px 1fr 34px;
    height: 40px;
    border: 1px solid #d0d5dd;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
}

.wpos-qty-stepper button {
    border: 0;
    background: #f4f5fb;
    color: #5b5cd6;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    padding: 0;
}

.wpos-qty-stepper button:active {
    background: #5b5cd6;
    color: #fff;
}

.wpos-qty-stepper input {
    border: 0 !important;
    border-radius: 0 !important;
    border-left: 1px solid #d0d5dd !important;
    border-right: 1px solid #d0d5dd !important;
    text-align: center;
    height: 100% !important;
}

.wpos-cart-amount-val {
    height: 40px;
    line-height: 40px;
    padding: 0 8px;
    background: #ecfaf9;
    color: #2c7771;
    border-radius: 8px;
    text-align: center;
    font-weight: 700;
    font-size: 15px;
}

/* ============================================
   PRODUCT LIST CARDS
   ============================================ */
.wpos-prod-card {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 12px;
    padding: 14px;
    background: #fff;
    border: 1px solid #eceef5;
    border-radius: 12px;
    margin-bottom: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.wpos-prod-info {
    min-width: 0;
}

.wpos-prod-name {
    font-size: 15px;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 6px;
    word-break: break-word;
}

.wpos-prod-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    font-size: 11px;
    color: #6b7280;
}

.wpos-prod-meta span {
    background: #f4f5fb;
    padding: 3px 8px;
    border-radius: 6px;
    white-space: nowrap;
}

.wpos-prod-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.wpos-btn-icon-edit,
.wpos-btn-icon-del {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: 1.5px solid #d0d5dd;
    background: #fff;
    font-size: 16px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: all 0.15s;
}

.wpos-btn-icon-edit {
    color: #5b5cd6;
}

.wpos-btn-icon-edit:hover {
    background: #eef0ff;
    border-color: #5b5cd6;
}

.wpos-btn-icon-del {
    color: #dc2626;
    border-color: #fca5a5;
}

.wpos-btn-icon-del:hover {
    background: #fef2f2;
    border-color: #dc2626;
}

.wpos-btn-icon-edit:active,
.wpos-btn-icon-del:active {
    transform: scale(0.92);
}

.wpos-add-item-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px;
    background: #eef0ff;
    border: 0;
    color: #5b5cd6;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    border-radius: 0 0 14px 14px;
}

.wpos-add-item-btn:hover {
    background: #e2e5ff;
}

.wpos-add-item-btn span {
    font-size: 18px;
}

/* Totals */
.wpos-total-card {
    padding: 16px 18px;
}

.wpos-total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    font-size: 15px;
    color: #4b5563;
}

.wpos-total-row .wpos-total-input {
    width: 100px;
    height: 32px;
    border: 1px solid #e2e6ea;
    border-radius: 8px;
    padding: 0 10px;
    text-align: right;
    font-size: 15px;
    font-weight: 500;
    color: #10b981;
    background: #fff;
}

.wpos-total-discount {
    color: #10b981 !important;
    font-weight: 600 !important;
}

.wpos-tax-toggle {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    font-size: 13px;
    color: #6b7280;
}

.wpos-tax-toggle input {
    width: 14px;
    height: 14px;
    margin: 0;
}

.wpos-total-grand {
    border-top: 2px dashed #e2e6ea;
    padding-top: 14px !important;
    margin-top: 8px;
    font-size: 17px;
    font-weight: 700;
    color: #1f2937;
}

.wpos-total-grand strong {
    color: #5b5cd6;
    font-size: 22px;
    font-weight: 700;
}

/* Notes */
.wpos-notes-label {
    display: block;
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 8px;
    font-weight: 500;
}

.wpos-notes-area {
    width: 100%;
    min-height: 80px;
    padding: 10px 12px;
    border: 1px solid #e2e6ea;
    border-radius: 10px;
    resize: vertical;
    font-family: inherit;
    font-size: 14px;
    color: #1f2937;
    box-sizing: border-box;
    background: #fff;
    outline: 0;
}

.wpos-notes-area:focus {
    border-color: #5b5cd6;
    box-shadow: 0 0 0 3px rgba(91, 92, 214, 0.1);
}

.wpos-notes-count {
    text-align: right;
    font-size: 12px;
    color: #9ca3af;
    margin-top: 4px;
}

/* Footer */
.wpos-mbill-footer {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 70;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding: 12px 14px calc(env(safe-area-inset-bottom, 0px) + 12px);
    background: #fff;
    border-top: 1px solid #eceef5;
    box-shadow: 0 -6px 12px rgba(0, 0, 0, 0.04);
    max-width: 900px;
    margin: 0 auto;
}

.wpos-btn-draft,
.wpos-btn-generate {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 52px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    border: 0;
}

.wpos-btn-draft {
    background: #fff;
    border: 1.5px solid #5b5cd6;
    color: #5b5cd6;
}

.wpos-btn-draft:hover {
    background: #f0f1f8;
}

.wpos-btn-generate {
    background: linear-gradient(135deg, #5b5cd6 0%, #4746c7 100%);
    color: #fff;
    box-shadow: 0 4px 12px rgba(91, 92, 214, 0.3);
}

.wpos-btn-generate:hover {
    filter: brightness(1.05);
}

/* Picker modal list */
.wpos-picker-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.wpos-picker-item {
    padding: 14px 16px;
    background: #f9fafc;
    border: 1.5px solid #e2e6ea;
    border-radius: 10px;
    color: #1f2937;
    font-size: 15px;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
}

.wpos-picker-item.active {
    background: #eef0ff;
    border-color: #5b5cd6;
    color: #5b5cd6;
    font-weight: 700;
}

/* ============================================
   BRANDING - Logo / Header / Footer
   ============================================ */
.wpos-header-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.wpos-header-logo {
    width: 34px;
    height: 34px;
    object-fit: contain;
    background: #000;
    border-radius: 6px;
    padding: 2px;
    flex-shrink: 0;
}

.wpos-login-img {
    width: 110px;
    height: 110px;
    object-fit: contain;
    background: #000;
    padding: 6px;
    border-radius: 12px;
    margin: 0 auto 10px;
    display: block;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.wpos-poweredby {
    text-align: center;
    padding: 10px 12px calc(env(safe-area-inset-bottom, 0px) + 10px);
    background: linear-gradient(135deg, #1f2937, #0f172a);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 5;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.1);
}

.wpos-poweredby-login {
    position: fixed;
    bottom: 0;
}

/* Add space so bottom nav sits above footer */
.wpos-app .wpos-bottom-nav {
    bottom: 32px;
}

.wpos-app .wpos-main {
    padding-bottom: calc(var(--wpos-bottom-nav-height) + 60px);
}

/* When busy-mode (create bill full screen) the footer is hidden */
.wpos-app.wpos-busy-mode ~ .wpos-poweredby {
    display: none;
}

/* ============================================
   ADVANCED DASHBOARD (Admin)
   ============================================ */
.wpos-adv-dash-btn {
    margin-bottom: 14px;
    background: linear-gradient(135deg, #5b5cd6 0%, #4746c7 100%);
    color: #fff;
    border: 0;
    height: 48px;
    font-weight: 700;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(91, 92, 214, 0.25);
}

.wpos-adv-header {
    display: grid;
    grid-template-columns: 44px 1fr 44px;
    align-items: center;
    padding: 12px 4px;
    margin-bottom: 12px;
}

.wpos-adv-header h2 {
    text-align: center;
    font-size: 18px;
    margin: 0;
    color: #1f2937;
}

.wpos-adv-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 14px;
}

.wpos-adv-stat {
    background: #fff;
    border: 1px solid #eceef5;
    border-radius: 12px;
    padding: 14px;
}

.wpos-adv-stat .lbl {
    font-size: 11px;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    font-weight: 600;
    margin-bottom: 6px;
}

.wpos-adv-stat .val {
    font-size: 20px;
    font-weight: 800;
    color: #1f2937;
    line-height: 1.1;
}

.wpos-adv-stat .val.red { color: #ef4444; }
.wpos-adv-stat .val.green { color: #10b981; }

.wpos-adv-stat .sub {
    font-size: 11px;
    color: #6b7280;
    margin-top: 4px;
}

.wpos-adv-stat .sub.green { color: #10b981; font-weight: 600; }

.wpos-adv-card {
    background: #fff;
    border: 1px solid #eceef5;
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 14px;
}

.wpos-adv-title {
    font-size: 14px;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 12px;
}

.wpos-chart-wrap {
    position: relative;
    height: 180px;
    background: linear-gradient(to top, #f9fafc, #fff);
    border-radius: 8px;
    padding: 8px 4px 24px;
    overflow: hidden;
}

.wpos-chart-svg {
    width: 100%;
    height: 100%;
    display: block;
}

.wpos-chart-labels {
    position: absolute;
    left: 4px;
    right: 4px;
    bottom: 2px;
    display: flex;
    justify-content: space-between;
    font-size: 9px;
    color: #6b7280;
    overflow: hidden;
    white-space: nowrap;
}

.wpos-chart-labels-line span {
    flex: 1;
    text-align: center;
}

.wpos-chart-labels span {
    display: inline-block;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wpos-chart-empty {
    text-align: center;
    padding: 40px 0;
    color: #9ca3af;
    font-size: 13px;
}

.wpos-chart-legend {
    display: flex;
    gap: 16px;
    justify-content: center;
    margin-top: 10px;
    font-size: 12px;
    color: #4b5563;
}

.wpos-chart-legend span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.wpos-chart-legend i {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.wpos-adv-grid-2 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    margin-bottom: 14px;
}

@media (min-width: 768px) {
    .wpos-adv-grid-2 {
        grid-template-columns: 1fr 1fr;
    }
    .wpos-adv-stats {
        grid-template-columns: repeat(4, 1fr);
    }
}

.wpos-adv-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.wpos-adv-row {
    display: grid;
    grid-template-columns: 32px 1fr auto;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: #f9fafc;
    border-radius: 10px;
}

.wpos-adv-row.low-stock-row {
    grid-template-columns: 1fr auto;
    background: #fef3f3;
    border-left: 3px solid #ef4444;
}

.wpos-adv-row .rank {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: #eef0ff;
    color: #5b5cd6;
    font-weight: 700;
    font-size: 12px;
    border-radius: 50%;
}

.wpos-adv-row-info .name {
    font-size: 14px;
    font-weight: 600;
    color: #1f2937;
}

.wpos-adv-row-info .meta {
    font-size: 11px;
    color: #6b7280;
    margin-top: 2px;
}

.wpos-adv-row .amt {
    font-weight: 700;
    color: #1f2937;
    font-size: 14px;
    text-align: right;
}

.wpos-adv-row .amt.red {
    color: #ef4444;
}

/* Heatmap */
.wpos-heatmap {
    display: flex;
    flex-direction: column;
    gap: 3px;
    overflow-x: auto;
}

.wpos-heatmap-hours,
.wpos-heatmap-row {
    display: grid;
    grid-template-columns: 40px repeat(14, 1fr);
    gap: 3px;
    align-items: center;
    min-width: 480px;
}

.wpos-heatmap-hours span {
    font-size: 10px;
    color: #6b7280;
    text-align: center;
}

.wpos-heatmap-day {
    font-size: 11px;
    font-weight: 600;
    color: #4b5563;
    text-align: right;
    padding-right: 6px;
}

.wpos-heatmap-cell {
    height: 22px;
    border-radius: 4px;
    background: #f4f5fb;
    cursor: pointer;
}

/* Delete bill warning */
.wpos-delete-warn {
    text-align: center;
    padding: 8px 4px;
}

.wpos-delete-icon {
    font-size: 48px;
    margin-bottom: 8px;
}

.wpos-delete-warn p {
    margin: 6px 0;
    color: #4b5563;
    font-size: 14px;
    line-height: 1.5;
}

.wpos-delete-warn strong {
    color: #ef4444;
}

/* Partial payment rows */
.wpos-partial-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 12px;
}

.wpos-partial-row {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 10px;
    align-items: center;
    padding: 10px 12px;
    background: #f9fafc;
    border: 1px solid #e2e6ea;
    border-radius: 10px;
}

.wpos-partial-mode {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: #1f2937;
    font-size: 14px;
}

.wpos-partial-mode span {
    font-size: 18px;
}

.wpos-partial-input {
    display: flex;
    align-items: center;
    background: #fff;
    border: 1px solid #d0d5dd;
    border-radius: 8px;
    overflow: hidden;
    height: 40px;
}

.wpos-partial-input span {
    padding: 0 10px;
    background: #f0f1f8;
    color: #6b7280;
    font-weight: 700;
    align-self: stretch;
    display: flex;
    align-items: center;
}

.wpos-partial-input input {
    flex: 1;
    border: 0;
    outline: 0;
    height: 100%;
    padding: 0 10px;
    font-size: 15px;
    font-weight: 600;
    color: #1f2937;
    text-align: right;
    background: transparent;
    width: 100%;
    min-width: 0;
}

.wpos-partial-summary {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 12px 14px;
    background: #eef0ff;
    border-radius: 10px;
    font-size: 14px;
}

.wpos-partial-summary div {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.wpos-partial-summary strong {
    font-size: 16px;
    color: #5b5cd6;
    font-weight: 700;
}

/* Bill saved modal enhancements */
.wpos-invoice-done {
    text-align: center;
    padding: 8px 0 16px;
}

.wpos-done-icon {
    font-size: 56px;
    line-height: 1;
    margin-bottom: 8px;
}

.wpos-done-msg {
    font-size: 15px;
    color: #10b981;
    font-weight: 600;
    margin-bottom: 8px;
}

.wpos-done-invoice {
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 4px;
}

.wpos-done-invoice strong {
    color: #1f2937;
    font-weight: 700;
}

.wpos-done-party {
    font-size: 13px;
    color: #6b7280;
}

.wpos-done-amount {
    font-size: 32px;
    font-weight: 800;
    color: #5b5cd6;
    margin: 10px 0 4px;
}

.wpos-done-modes {
    font-size: 12px;
    color: #6b7280;
}

.wpos-done-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 12px;
}

.wpos-done-actions .wpos-btn {
    height: 48px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* Payment mode grid */
.wpos-pay-mode-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 12px;
}

.wpos-pay-mode-btn {
    height: 46px;
    border: 1.5px solid #e2e6ea;
    background: #fff;
    border-radius: 10px;
    color: #1f2937;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.wpos-pay-mode-btn.active {
    background: #eef0ff;
    border-color: #5b5cd6;
    color: #5b5cd6;
    font-weight: 700;
}

.wpos-pay-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 14px;
}

.wpos-pay-tab {
    height: 44px;
    border: 1.5px solid #e2e6ea;
    background: #fff;
    color: #1f2937;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
}

.wpos-pay-tab.active {
    background: #5b5cd6;
    color: #fff;
    border-color: #5b5cd6;
}

.wpos-pay-total {
    text-align: center;
    padding: 14px;
    background: #f0f1f8;
    border-radius: 12px;
    margin-bottom: 14px;
}

.wpos-pay-total-label {
    font-size: 12px;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.wpos-pay-total-value {
    font-size: 30px;
    font-weight: 800;
    color: #5b5cd6;
    margin: 4px 0;
}

.wpos-pay-party {
    font-size: 13px;
    color: #6b7280;
}

.wpos-hint {
    font-size: 12px;
    color: #6b7280;
}

/* ============================================
   OLD BUSY UI (kept for compatibility, hidden)
   ============================================ */
.wpos-busy-shell,
.wpos-busy-item-grid,
.wpos-busy-grid-wrap,
.wpos-busy-mode-only,
.wpos-busy-sundry,
.wpos-busy-bottom-panel,
.wpos-busy-action-row,
.wpos-busy-shortcutbar,
.wpos-busy-statusbar,
.wpos-busy-windowbar,
.wpos-busy-sale-strip {
    display: none !important;
}

/* ============================================
   RESPONSIVE — MOBILE
   ============================================ */
@media (max-width: 767px) {
    .wpos-mbill-header {
        height: 72px;
    }

    .wpos-mbill-title {
        font-size: 20px;
    }

    .wpos-mbill-grid-2 {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .wpos-items-head {
        grid-template-columns: 30px 1fr 110px 70px 80px 26px;
        padding: 10px 12px;
        font-size: 12px;
    }

    .wpos-item-row {
        grid-template-columns: 30px 1fr 110px 70px 80px 26px;
        padding: 12px;
        font-size: 14px;
    }

    .wpos-item-row .c-name {
        font-size: 14px;
        padding-right: 8px;
    }

    .wpos-qty-stepper {
        height: 32px;
    }

    .wpos-qty-stepper button {
        width: 30px;
        height: 32px;
        font-size: 16px;
    }

    .wpos-qty-stepper span {
        min-width: 30px;
        line-height: 32px;
        font-size: 13px;
    }

    .wpos-item-row .c-price,
    .wpos-item-row .c-amount {
        font-size: 13px;
    }
}

/* ============================================
   NEW MOBILE BILL APP (legacy, hidden)
   ============================================ */
.wpos-app.wpos-busy-mode .wpos-main {
    background: #f4f7fa;
    padding: 0;
}

.wpos-bill-app {
    display: flex;
    flex-direction: column;
    min-height: 100dvh;
    max-width: 640px;
    margin: 0 auto;
    background: #f4f7fa;
}

.wpos-bill-header {
    position: sticky;
    top: 0;
    z-index: 60;
    display: grid;
    grid-template-columns: 44px 1fr 44px;
    align-items: center;
    height: 52px;
    padding: 0 8px;
    background: #2c7771;
    color: #fff;
}

.wpos-bill-back {
    width: 40px;
    height: 40px;
    background: transparent;
    border: 0;
    color: #fff;
    font-size: 22px;
    cursor: pointer;
}

.wpos-bill-title {
    text-align: center;
    font-size: 17px;
    font-weight: 700;
    letter-spacing: 0.3px;
}

.wpos-bill-scroll {
    flex: 1;
    padding: 12px 12px 96px;
    overflow-y: auto;
}

.wpos-bill-card {
    background: #fff;
    border-radius: 14px;
    padding: 14px;
    margin-bottom: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    border: 1px solid #eef0f3;
}

.wpos-step-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 10px;
}

.wpos-step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    background: #2c7771;
    color: #fff;
    border-radius: 50%;
    font-size: 12px;
}

.wpos-cust-chip {
    margin-left: auto;
    font-size: 12px;
    color: #475569;
    background: #ecfaf9;
    padding: 4px 10px;
    border-radius: 999px;
    font-weight: 600;
}

.wpos-bill-app .wpos-form-group {
    margin-bottom: 10px;
}

.wpos-bill-app .wpos-form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 12px;
    font-weight: 700;
    color: #667085;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.wpos-bill-app .wpos-form-group input,
.wpos-bill-app .wpos-form-group select,
.wpos-bill-app .wpos-form-group textarea {
    width: 100%;
    height: 48px;
    padding: 0 12px;
    border: 1px solid #d0d5dd;
    background: #fff;
    color: #0f172a;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    outline: none;
    box-sizing: border-box;
}

.wpos-bill-app .wpos-form-group input:focus {
    border-color: #2c7771;
    box-shadow: 0 0 0 3px rgba(44, 119, 113, 0.15);
}

.wpos-bill-mode {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin: 6px 0 12px;
}

.wpos-mode-opt {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 46px;
    border: 1px solid #d0d5dd;
    background: #fff;
    color: #0f172a;
    border-radius: 10px;
    font-weight: 700;
    cursor: pointer;
    user-select: none;
}

.wpos-mode-opt input {
    display: none;
}

.wpos-mode-opt.active {
    background: #2c7771;
    color: #fff;
    border-color: #2c7771;
}

.wpos-row {
    background: #fff;
    border: 1px solid #e2e6ea;
    border-radius: 12px;
    padding: 10px 10px 8px;
    margin-bottom: 10px;
}

.wpos-row-new {
    background: #fffbe6;
    border-color: #e0c76b;
}

.wpos-row-head {
    display: grid;
    grid-template-columns: 26px 1fr 34px;
    gap: 8px;
    align-items: start;
}

.wpos-row-sn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    background: #2c7771;
    color: #fff;
    border-radius: 50%;
    font-size: 12px;
    font-weight: 700;
}

.wpos-row-name {
    position: relative;
}

.wpos-row-input {
    width: 100%;
    height: 44px;
    padding: 0 12px;
    border: 1px solid #d0d5dd;
    border-radius: 10px;
    background: #fff;
    color: #0f172a;
    font-size: 15px;
    font-weight: 600;
    outline: none;
    box-sizing: border-box;
}

.wpos-row-input.num {
    text-align: right;
    font-weight: 700;
}

.wpos-row-input:focus {
    border-color: #2c7771;
    box-shadow: 0 0 0 3px rgba(44, 119, 113, 0.15);
}

.wpos-row-hint {
    display: block;
    margin-top: 4px;
    color: #8a6a20;
    font-size: 11px;
}

.wpos-row-del {
    width: 34px;
    height: 34px;
    border: 1px solid #ffb3b3;
    background: #ffecec;
    color: #b40000;
    border-radius: 10px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
}

.wpos-row-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 10px;
    margin-top: 10px;
}

.wpos-row-body label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 10px;
    font-weight: 700;
    color: #667085;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.wpos-row-body label input {
    height: 40px;
    padding: 0 10px;
    border: 1px solid #d0d5dd;
    border-radius: 10px;
    background: #fff;
    font-size: 14px;
    color: #0f172a;
    box-sizing: border-box;
}

.wpos-row-amount {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    height: 40px;
    padding: 0 10px;
    background: #ecfaf9;
    border-radius: 10px;
    color: #2c7771;
    font-weight: 700;
    font-size: 15px;
}

.wpos-total-card .wpos-summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 4px;
    border-bottom: 1px solid #eef0f3;
    color: #344054;
    font-size: 14px;
}

.wpos-total-card .wpos-summary-row:last-child {
    border-bottom: 0;
}

.wpos-inline-num {
    width: 120px;
    height: 36px;
    padding: 0 10px;
    border: 1px solid #d0d5dd;
    border-radius: 8px;
    text-align: right;
    font-weight: 700;
    color: #0f172a;
    background: #fff;
    box-sizing: border-box;
}

.wpos-summary-grand {
    font-size: 18px;
    font-weight: 800;
    color: #0f172a;
    padding-top: 12px !important;
    border-top: 2px solid #2c7771 !important;
    border-bottom: 0 !important;
}

.wpos-bill-footer {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 70;
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 8px;
    padding: 10px 12px calc(env(safe-area-inset-bottom, 0px) + 12px);
    background: #fff;
    border-top: 1px solid #e2e6ea;
    box-shadow: 0 -6px 12px rgba(0, 0, 0, 0.06);
    max-width: 640px;
    margin: 0 auto;
}

.wpos-bill-footer .wpos-btn {
    height: 50px;
    border-radius: 12px;
    font-size: 16px;
}

/* ============================================
   PARTY MODAL / PAYMENT / INVOICE ACTIONS
   ============================================ */
.wpos-party-modal .wpos-form-group input {
    height: 44px;
    padding: 0 12px;
    border: 1px solid #d0d5dd;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    width: 100%;
}

.wpos-hint {
    font-size: 12px;
    color: #667085;
    margin-top: 4px;
}

.wpos-pay-total {
    text-align: center;
    padding: 16px 12px 8px;
    background: #ecfaf9;
    border-radius: 12px;
    margin-bottom: 12px;
}

.wpos-pay-total-label {
    font-size: 12px;
    color: #667085;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 700;
}

.wpos-pay-total-value {
    font-size: 32px;
    font-weight: 800;
    color: #2c7771;
    line-height: 1.1;
    margin-top: 4px;
}

.wpos-pay-party {
    font-size: 13px;
    color: #0f172a;
    margin-top: 4px;
}

.wpos-pay-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    margin-bottom: 12px;
}

.wpos-pay-tab {
    height: 42px;
    border: 1px solid #d0d5dd;
    background: #fff;
    color: #0f172a;
    border-radius: 10px;
    font-weight: 700;
    cursor: pointer;
}

.wpos-pay-tab.active {
    background: #2c7771;
    color: #fff;
    border-color: #2c7771;
}

.wpos-pay-mode-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.wpos-pay-mode-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 48px;
    border: 1px solid #d0d5dd;
    background: #fff;
    color: #0f172a;
    border-radius: 10px;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
}

.wpos-pay-mode-btn.active {
    background: #ecfaf9;
    border-color: #2c7771;
    color: #2c7771;
}

.wpos-split-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.wpos-split-row-m {
    display: grid;
    grid-template-columns: 1.2fr 1fr 40px;
    gap: 8px;
    align-items: center;
}

.wpos-split-row-m select,
.wpos-split-row-m input {
    height: 42px;
    padding: 0 10px;
    border: 1px solid #d0d5dd;
    border-radius: 10px;
    background: #fff;
    font-size: 14px;
}

.wpos-split-del {
    width: 40px;
    height: 42px;
    border: 1px solid #ffb3b3;
    background: #ffecec;
    color: #b40000;
    border-radius: 10px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
}

.wpos-pay-remaining {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background: #f4f7fa;
    border-radius: 10px;
    font-weight: 700;
}

.wpos-invoice-done {
    text-align: center;
    padding: 8px 4px 12px;
}

.wpos-done-icon {
    font-size: 48px;
    line-height: 1;
    margin-bottom: 6px;
}

.wpos-done-invoice {
    font-size: 14px;
    color: #667085;
}

.wpos-done-party {
    font-size: 14px;
    color: #0f172a;
    margin-top: 2px;
}

.wpos-done-amount {
    font-size: 32px;
    font-weight: 800;
    color: #2c7771;
    margin: 8px 0 4px;
}

.wpos-done-modes {
    font-size: 12px;
    color: #667085;
}

.wpos-done-actions {
    display: grid;
    gap: 8px;
    margin-top: 12px;
}

/* ============================================
   ITEM COLUMN AUTOCOMPLETE
   ============================================ */
.wpos-busy-item-cell {
    position: relative;
    padding: 0 4px;
}

.wpos-busy-item-cell .wpos-busy-cell-input.item {
    background: #fffbd2;
    font-weight: 700;
}

.wpos-busy-item-suggest {
    display: none;
    position: absolute;
    z-index: 40;
    top: 100%;
    left: 0;
    right: 0;
    max-height: 240px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid #2d7771;
    box-shadow: 0 8px 22px rgba(0,0,0,0.18);
    text-align: left;
}

.wpos-suggest-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px;
    border-bottom: 1px solid #e6e6e6;
    cursor: pointer;
    font-size: 13px;
    color: #000;
}

.wpos-suggest-item:active,
.wpos-suggest-item:hover {
    background: #d4f3f3;
}

.wpos-suggest-name {
    font-weight: 700;
}

.wpos-suggest-meta {
    color: #6a6a6a;
    font-size: 11px;
    margin-left: 8px;
    white-space: nowrap;
}

.wpos-suggest-empty {
    padding: 8px 10px;
    color: #8b0000;
    font-size: 12px;
}

.wpos-busy-hint {
    color: #7a4600;
    font-size: 10px;
}

.wpos-busy-new-row td.wpos-busy-item-cell {
    background: #fffbe6;
}

/* ============================================
   MOBILE ITEM CARDS (default hidden on desktop)
   ============================================ */
.wpos-mobile-items-wrap {
    display: none;
}

.wpos-m-card {
    background: #fff;
    border: 1px solid #cfd6d6;
    border-radius: 10px;
    padding: 10px 10px 8px;
    margin: 0 0 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.wpos-m-card-new {
    background: #fffbe6;
    border-color: #d1b76a;
}

.wpos-m-card-head {
    display: grid;
    grid-template-columns: 22px 1fr 32px;
    gap: 8px;
    align-items: start;
}

.wpos-m-sn {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 22px;
    height: 22px;
    background: #2d7771;
    color: #fff;
    border-radius: 50%;
    font-size: 12px;
    font-weight: 700;
}

.wpos-m-item-name {
    position: relative;
}

.wpos-m-item-name small {
    display: block;
    margin-top: 2px;
    color: #777;
    font-size: 11px;
}

.wpos-m-input {
    width: 100%;
    height: 40px;
    padding: 0 10px;
    border: 1px solid #b7b7b7;
    border-radius: 8px;
    background: #fff;
    color: #000;
    font-size: 15px;
    font-weight: 500;
    box-sizing: border-box;
    outline: none;
}

.wpos-m-input.num {
    text-align: right;
    font-weight: 700;
}

.wpos-m-input:focus {
    border-color: #2d7771;
    box-shadow: 0 0 0 2px rgba(45,119,113,0.15);
}

.wpos-m-del {
    width: 32px;
    height: 32px;
    border: 1px solid #d99;
    background: #fbecec;
    color: #b30000;
    border-radius: 8px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
}

.wpos-m-card-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 10px;
    margin-top: 10px;
}

.wpos-m-card-body label {
    display: flex;
    flex-direction: column;
    font-size: 11px;
    color: #555;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    gap: 4px;
}

.wpos-m-card-body label input {
    width: 100%;
    height: 38px;
    padding: 0 8px;
    border: 1px solid #b7b7b7;
    border-radius: 8px;
    background: #fff;
    font-size: 14px;
    box-sizing: border-box;
    outline: none;
}

.wpos-m-amount {
    display: block;
    height: 38px;
    line-height: 38px;
    padding: 0 8px;
    background: #eef7f7;
    border-radius: 8px;
    text-align: right;
    font-weight: 700;
    color: #2d7771;
    font-size: 15px;
}

.wpos-m-suggest {
    position: absolute;
    z-index: 60;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 4px;
    max-height: 260px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid #2d7771;
    border-radius: 8px;
    box-shadow: 0 10px 22px rgba(0,0,0,0.18);
}

.wpos-m-suggest .wpos-suggest-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 12px;
    border-bottom: 1px solid #ececec;
    font-size: 14px;
    cursor: pointer;
}

.wpos-m-suggest .wpos-suggest-item:active {
    background: #d4f3f3;
}

/* ============================================
   MOBILE FIRST BUSY BILL SCREEN
   ============================================ */
@media (max-width: 767px) {
    .wpos-app.wpos-busy-mode {
        width: 100vw;
        max-width: none;
        background: #f4f7fa;
    }

    .wpos-app.wpos-busy-mode .wpos-main {
        padding: 0;
        overflow: auto;
        background: #f4f7fa;
    }

    .wpos-busy-shell {
        min-width: 0;
        width: 100%;
        font-size: 14px;
    }

    /* Hide desktop-only Busy chrome */
    .wpos-busy-titlebar,
    .wpos-busy-windowbar,
    .wpos-busy-sale-strip,
    .wpos-busy-shortcutbar,
    .wpos-busy-statusbar,
    .wpos-busy-grid-wrap,
    .wpos-busy-na,
    .wpos-busy-mini-btn {
        display: none !important;
    }

    .wpos-busy-workspace {
        display: block;
        height: auto;
    }

    .wpos-busy-voucher {
        padding: 12px 12px 130px;
        overflow: visible;
    }

    /* Top card: Party + Vch */
    .wpos-busy-meta-grid {
        display: grid;
        grid-template-columns: 1fr;
        gap: 10px;
        padding: 12px;
        background: #fff;
        border-radius: 12px;
        box-shadow: 0 1px 3px rgba(0,0,0,0.05);
        max-width: 100%;
    }

    .wpos-busy-meta-grid label {
        font-size: 11px;
        color: #667085;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        font-weight: 700;
        padding: 0;
    }

    .wpos-busy-meta-grid input {
        width: 100%;
        height: 44px;
        padding: 0 12px;
        border: 1px solid #d0d5dd;
        background: #fff;
        border-radius: 10px;
        font-size: 15px;
        font-weight: 600;
    }

    .wpos-busy-meta-grid input:focus {
        border-color: #2d7771;
        box-shadow: 0 0 0 3px rgba(45,119,113,0.15);
        outline: none;
    }

    .wpos-busy-day {
        display: none;
    }

    .wpos-busy-party-cell {
        grid-column: span 1;
    }

    .wpos-busy-party-cell input {
        background: #0f172a;
        color: #fff;
        border-color: #0f172a;
    }

    /* GST toggle */
    .wpos-busy-mode-only {
        display: grid !important;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
        margin: 12px 0;
    }

    .wpos-busy-entry-row.wpos-busy-mode-only button {
        height: 44px;
        border-radius: 10px;
        border: 1px solid #d0d5dd;
        background: #fff;
        color: #0f172a;
        font-weight: 700;
    }

    .wpos-busy-entry-row.wpos-busy-mode-only button.active {
        background: #2d7771;
        color: #fff;
        border-color: #2d7771;
    }

    /* Show mobile card list */
    .wpos-mobile-items-wrap {
        display: block;
        margin-bottom: 12px;
    }

    /* Sundry as card */
    .wpos-busy-sundry {
        max-width: 100%;
        height: auto;
        padding: 14px 12px 10px;
        border: 1px solid #e2e6ea;
        border-radius: 12px;
        background: #fff;
    }

    .wpos-busy-sundry .wpos-busy-section-title {
        top: -10px;
        left: 12px;
        background: #fff;
        color: #2d7771;
        font-weight: 700;
    }

    .wpos-busy-sundry-row {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 10px;
        padding: 8px 0 0;
    }

    .wpos-busy-sundry-row > span,
    .wpos-busy-sundry-row > strong,
    .wpos-busy-sundry-row > .wpos-busy-checkbox {
        display: none;
    }

    .wpos-busy-sundry-row input {
        height: 42px;
        border: 1px solid #d0d5dd;
        background: #fff;
        border-radius: 10px;
        padding: 0 10px;
        font-size: 15px;
        font-weight: 600;
    }

    .wpos-busy-sundry-row input:nth-of-type(1)::before {
        content: 'Discount %';
    }

    /* Bottom panels stacked */
    .wpos-busy-bottom-panel {
        display: grid;
        grid-template-columns: 1fr;
        max-width: 100%;
        height: auto;
        margin-top: 12px;
        border: none;
    }

    .wpos-busy-settlement,
    .wpos-busy-total-box {
        border: 1px solid #e2e6ea;
        border-radius: 12px;
        background: #fff;
        margin-bottom: 10px;
        padding: 12px;
    }

    .wpos-busy-settlement {
        grid-template-columns: 1fr 1fr;
        gap: 6px;
    }

    .wpos-busy-total-box {
        padding: 0;
    }

    .wpos-busy-total-box .wpos-summary-row {
        display: flex;
        justify-content: space-between;
        padding: 10px 14px;
        font-size: 14px;
        color: #344054;
        border-bottom: 1px solid #eef0f3;
    }

    .wpos-busy-total-line {
        font-size: 22px;
        padding: 14px;
        border-top: 1px solid #2d7771;
        background: #ecfaf9;
        color: #0f172a;
    }

    /* Sticky action bar */
    .wpos-busy-action-row {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 80;
        background: #ffffff;
        border-top: 1px solid #e2e6ea;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
        padding: 10px 12px calc(env(safe-area-inset-bottom, 0px) + 12px);
        box-shadow: 0 -6px 12px rgba(0,0,0,0.06);
    }

    .wpos-busy-action-row button {
        height: 48px;
        border-radius: 10px;
        border: 1px solid #d0d5dd;
        background: #fff;
        color: #0f172a;
        font-weight: 700;
        font-size: 14px;
    }

    .wpos-busy-action-row button:nth-last-child(2) {
        background: #2d7771;
        border-color: #2d7771;
        color: #fff;
    }

    .wpos-busy-action-row button:first-child,
    .wpos-busy-action-row button:nth-child(2),
    .wpos-busy-action-row button:nth-child(3),
    .wpos-busy-action-row button:nth-child(4),
    .wpos-busy-action-row button:nth-child(5) {
        display: none;
    }

    .wpos-busy-action-row span {
        display: none;
    }
}
