/* ═══════════════════════════════════════════════════════════════
   ZypppyPOS — Premium Design System
   ═══════════════════════════════════════════════════════════════ */

/* ─── Design Tokens ─── */
:root {
    /* Core Palette */
    --bg-deep:        #0a0a0f;
    --bg-primary:     #111118;
    --bg-secondary:   #1a1a24;
    --bg-tertiary:    #22222f;
    --bg-hover:       #2a2a3a;
    --bg-active:      #32324a;

    /* Accent */
    --accent:         #7c3aed;
    --accent-light:   #a78bfa;
    --accent-glow:    rgba(124, 58, 237, 0.35);
    --accent-surface: rgba(124, 58, 237, 0.08);
    --accent-gradient: linear-gradient(135deg, #7c3aed 0%, #6d28d9 50%, #5b21b6 100%);

    /* Signal Colors */
    --green:          #22c55e;
    --green-surface:  rgba(34, 197, 94, 0.1);
    --red:            #ef4444;
    --red-surface:    rgba(239, 68, 68, 0.1);
    --amber:          #f59e0b;
    --amber-surface:  rgba(245, 158, 11, 0.1);
    --cyan:           #06b6d4;
    --cyan-surface:   rgba(6, 182, 212, 0.1);

    /* Text */
    --text-primary:   #f0f0f5;
    --text-secondary: #9090a8;
    --text-muted:     #606078;

    /* Borders & Shadows */
    --border:         rgba(255, 255, 255, 0.06);
    --border-light:   rgba(255, 255, 255, 0.1);
    --shadow-sm:      0 1px 3px rgba(0,0,0,0.4);
    --shadow-md:      0 4px 16px rgba(0,0,0,0.5);
    --shadow-lg:      0 12px 40px rgba(0,0,0,0.6);
    --shadow-glow:    0 0 30px var(--accent-glow);

    /* Layout */
    --sidebar-width:  72px;
    --cart-width:     340px;
    --radius-sm:      8px;
    --radius-md:      12px;
    --radius-lg:      16px;
    --radius-xl:      20px;

    /* Typography */
    --font: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
}

/* ─── Reset ─── */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    overflow: hidden;
    font-family: var(--font);
    background: var(--bg-deep);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

input, button {
    font-family: inherit;
    outline: none;
    border: none;
}

button {
    cursor: pointer;
}

.hidden { display: none !important; }

/* ═══════════════════════════════════════════════════════════════
   App Shell Layout
   ═══════════════════════════════════════════════════════════════ */
.app-shell {
    display: flex;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
}

/* ─── Sidebar ─── */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-primary);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px 0;
    gap: 8px;
    z-index: 100;
    flex-shrink: 0;
}

.brand {
    width: 44px;
    height: 44px;
    background: var(--accent-gradient);
    border-radius: var(--radius-md);
    display: grid;
    place-items: center;
    font-size: 22px;
    margin-bottom: 16px;
    box-shadow: var(--shadow-glow);
    animation: brand-pulse 3s ease-in-out infinite alternate;
}

@keyframes brand-pulse {
    0%   { box-shadow: 0 0 12px var(--accent-glow); }
    100% { box-shadow: 0 0 24px var(--accent-glow), 0 0 60px rgba(124, 58, 237, 0.15); }
}

.nav-icons {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.nav-item {
    width: 52px;
    height: 52px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    color: var(--text-muted);
    transition: all 0.2s ease;
    cursor: pointer;
    gap: 3px;
}

.nav-item svg {
    width: 20px;
    height: 20px;
}

.nav-item span {
    font-size: 9px;
    font-weight: 500;
    letter-spacing: 0.02em;
}

.nav-item:hover {
    background: var(--bg-hover);
    color: var(--text-secondary);
}

.nav-item.active {
    background: var(--accent-surface);
    color: var(--accent-light);
}

.sidebar-bottom {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin-top: auto;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    border: 2px solid var(--border-light);
    display: grid;
    place-items: center;
    font-size: 13px;
    font-weight: 700;
    color: var(--accent-light);
}

/* ═══════════════════════════════════════════════════════════════
   Cart Panel
   ═══════════════════════════════════════════════════════════════ */
.cart-panel {
    width: var(--cart-width);
    background: var(--bg-primary);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.cart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 20px 16px;
    border-bottom: 1px solid var(--border);
}

.cart-header h2 {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
}

.order-number {
    font-size: 12px;
    font-weight: 500;
    color: var(--accent-light);
    background: var(--accent-surface);
    padding: 3px 8px;
    border-radius: 20px;
    margin-left: 8px;
}

.btn-icon {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    background: transparent;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    transition: all 0.15s ease;
}

.btn-icon:hover {
    background: var(--red-surface);
    color: var(--red);
}

.btn-icon svg {
    width: 18px;
    height: 18px;
}

/* Cart Items */
.cart-items-container {
    flex: 1;
    overflow-y: auto;
    padding: 8px 12px;
    scrollbar-width: thin;
    scrollbar-color: var(--bg-tertiary) transparent;
}

.cart-items-container::-webkit-scrollbar {
    width: 4px;
}
.cart-items-container::-webkit-scrollbar-thumb {
    background: var(--bg-tertiary);
    border-radius: 10px;
}

.empty-cart {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    gap: 8px;
    color: var(--text-muted);
}

.empty-cart-icon {
    font-size: 40px;
    opacity: 0.3;
}

.empty-cart p {
    font-size: 14px;
    font-weight: 600;
}

.empty-cart span {
    font-size: 12px;
}

/* Individual Cart Item */
.cart-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px;
    border-radius: var(--radius-md);
    transition: background 0.15s ease;
    position: relative;
    animation: slideIn 0.2s ease;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(-12px); }
    to   { opacity: 1; transform: translateX(0); }
}

.cart-item:hover {
    background: var(--bg-secondary);
}

.cart-item-info {
    flex: 1;
    min-width: 0;
}

.cart-item-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cart-item-meta {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

.cart-item-qty {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
}

.qty-btn {
    width: 26px;
    height: 26px;
    border-radius: 6px;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 700;
    display: grid;
    place-items: center;
    transition: all 0.12s ease;
    border: 1px solid var(--border);
}

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

.qty-value {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
    min-width: 18px;
    text-align: center;
}

.cart-item-price {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
}

.cart-item-remove {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 22px;
    height: 22px;
    border-radius: 6px;
    background: transparent;
    color: var(--text-muted);
    font-size: 14px;
    display: grid;
    place-items: center;
    transition: all 0.12s ease;
    opacity: 0;
}

.cart-item:hover .cart-item-remove {
    opacity: 1;
}

.cart-item-remove:hover {
    background: var(--red-surface);
    color: var(--red);
}

/* Cart Footer / Summary */
.cart-footer {
    border-top: 1px solid var(--border);
    padding: 16px 16px 20px;
    background: var(--bg-secondary);
}

.summary-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: var(--text-secondary);
    padding: 5px 0;
}

.summary-line small {
    color: var(--text-muted);
}

.discount-value {
    color: var(--green) !important;
    font-weight: 600;
}

.total-line {
    font-size: 18px;
    font-weight: 800;
    color: var(--text-primary);
    padding: 10px 0 14px;
    border-top: 1px solid var(--border);
    margin-top: 4px;
}

.cart-actions {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
}

.btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 16px;
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.btn-discount, .btn-hold {
    flex: 1;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.btn-discount:hover, .btn-hold:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-color: var(--border-light);
}

.btn-charge {
    width: 100%;
    padding: 16px;
    background: var(--accent-gradient);
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    border-radius: var(--radius-md);
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-glow);
    transition: all 0.25s ease;
}

.btn-charge:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 0 32px var(--accent-glow), var(--shadow-md);
}

.btn-charge:active:not(:disabled) {
    transform: translateY(0);
}

.btn-charge:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    box-shadow: none;
}

/* ═══════════════════════════════════════════════════════════════
   Main Content / Smart Grid
   ═══════════════════════════════════════════════════════════════ */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--bg-deep);
}

.view-register {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
}

/* Toolbar */
.grid-toolbar {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 24px;
    flex-shrink: 0;
}

.search-wrapper {
    position: relative;
    flex: 1;
    max-width: 400px;
}

.search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: var(--text-muted);
}

.search-input {
    width: 100%;
    height: 44px;
    padding: 0 16px 0 44px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    color: var(--text-primary);
    font-size: 14px;
    transition: all 0.2s ease;
}

.search-input::placeholder {
    color: var(--text-muted);
}

.search-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
    background: var(--bg-tertiary);
}

.toolbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: auto;
}

.connection-status {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: var(--bg-secondary);
    border-radius: 20px;
    border: 1px solid var(--border);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.status-dot.online {
    background: var(--green);
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.5);
    animation: dot-blink 2s ease-in-out infinite;
}

.status-dot.offline {
    background: var(--amber);
    box-shadow: 0 0 8px rgba(245, 158, 11, 0.5);
}

@keyframes dot-blink {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.5; }
}

.status-text {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
}

/* Category Tabs */
.category-tabs {
    display: flex;
    gap: 8px;
    padding: 0 24px 12px;
    overflow-x: auto;
    scrollbar-width: none;
    flex-shrink: 0;
}

.category-tabs::-webkit-scrollbar { display: none; }

.cat-tab {
    padding: 8px 20px;
    border-radius: 50px;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border: 1px solid var(--border);
    transition: all 0.2s ease;
}

.cat-tab:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.cat-tab.active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
    box-shadow: 0 0 16px var(--accent-glow);
}

/* Product Grid */
.products-grid {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 14px;
    padding: 8px 24px 24px;
    overflow-y: auto;
    align-content: start;
    scrollbar-width: thin;
    scrollbar-color: var(--bg-tertiary) transparent;
}

.products-grid::-webkit-scrollbar {
    width: 5px;
}
.products-grid::-webkit-scrollbar-thumb {
    background: var(--bg-tertiary);
    border-radius: 10px;
}

/* Product Card */
.product-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    cursor: pointer;
    transition: all 0.22s ease;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-3px);
    border-color: var(--accent);
    box-shadow: 0 8px 24px rgba(0,0,0,0.3), 0 0 0 1px var(--accent-glow);
}

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

.product-card-img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    color: var(--text-muted);
}

.product-card-body {
    padding: 12px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.product-card-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-card-price {
    font-size: 15px;
    font-weight: 800;
    color: var(--accent-light);
    margin-top: auto;
}

.product-card-stock {
    font-size: 10px;
    font-weight: 500;
    color: var(--text-muted);
}

.product-card-stock.low {
    color: var(--amber);
}

.product-card-stock.out {
    color: var(--red);
}

/* Add-to-cart ripple */
.product-card.added {
    animation: addPulse 0.35s ease;
}

@keyframes addPulse {
    0%   { box-shadow: 0 0 0 0 var(--accent-glow); }
    50%  { box-shadow: 0 0 0 10px transparent; }
    100% { box-shadow: none; }
}

/* ═══════════════════════════════════════════════════════════════
   Modals
   ═══════════════════════════════════════════════════════════════ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: grid;
    place-items: center;
    z-index: 1000;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.modal-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    width: 90%;
    max-width: 520px;
    animation: modalSlide 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
}

@keyframes modalSlide {
    from { opacity: 0; transform: translateY(30px) scale(0.96); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
}

.modal-topbar h3 {
    font-size: 18px;
    font-weight: 700;
}

.btn-close-modal {
    color: var(--text-muted);
}

.btn-close-modal:hover {
    background: var(--bg-hover) !important;
    color: var(--text-primary) !important;
}

.modal-body {
    padding: 24px;
}

/* Payment Modal */
.payment-amount-display {
    text-align: center;
    margin-bottom: 28px;
}

.payment-amount-display .label {
    display: block;
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.payment-amount-display .amount {
    font-size: 42px;
    font-weight: 800;
    background: linear-gradient(135deg, var(--accent-light), var(--cyan));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.payment-methods-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 28px;
}

.payment-method-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 20px;
    background: var(--bg-secondary);
    border: 2px solid var(--border);
    border-radius: var(--radius-lg);
    color: var(--text-primary);
    transition: all 0.2s ease;
}

.payment-method-btn:hover {
    border-color: var(--accent);
    background: var(--accent-surface);
}

.payment-method-btn .pm-icon {
    font-size: 28px;
}

.payment-method-btn span {
    font-size: 14px;
    font-weight: 700;
}

.payment-method-btn small {
    font-size: 11px;
    color: var(--text-muted);
}

/* Tips */
.tip-section {
    border-top: 1px solid var(--border);
    padding-top: 20px;
}

.tip-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.tip-options {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.tip-btn {
    padding: 8px 16px;
    border-radius: 50px;
    font-size: 13px;
    font-weight: 600;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border: 1px solid var(--border);
    transition: all 0.15s ease;
}

.tip-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

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

.tip-summary {
    display: flex;
    justify-content: space-between;
    margin-top: 16px;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    font-size: 14px;
    color: var(--text-secondary);
}

.tip-summary strong {
    color: var(--text-primary);
}

/* Discount Modal */
.discount-type-toggle {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    padding: 4px;
}

.disc-type-btn {
    flex: 1;
    padding: 10px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    background: transparent;
    color: var(--text-secondary);
    transition: all 0.15s ease;
}

.disc-type-btn.active {
    background: var(--accent);
    color: #fff;
}

.discount-input-area {
    position: relative;
    margin-bottom: 20px;
}

.discount-input {
    width: 100%;
    height: 64px;
    padding: 0 50px 0 24px;
    background: var(--bg-secondary);
    border: 2px solid var(--border);
    border-radius: var(--radius-lg);
    color: var(--text-primary);
    font-size: 32px;
    font-weight: 700;
    text-align: center;
    transition: border-color 0.2s ease;
}

.discount-input:focus {
    border-color: var(--accent);
}

.discount-symbol {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 24px;
    font-weight: 700;
    color: var(--text-muted);
}

.discount-presets {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}

.preset-btn {
    padding: 8px 18px;
    border-radius: 50px;
    font-size: 13px;
    font-weight: 600;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border: 1px solid var(--border);
    transition: all 0.15s ease;
}

.preset-btn:hover {
    border-color: var(--accent);
    color: var(--accent-light);
}

.btn-apply-discount {
    justify-content: center;
}

/* Success Modal */
.success-modal-card {
    text-align: center;
    padding: 48px 32px;
    max-width: 420px;
}

.success-animation {
    margin-bottom: 20px;
}

.checkmark-circle {
    width: 80px;
    height: 80px;
    display: inline-block;
    color: var(--green);
    animation: scaleIn 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes scaleIn {
    from { transform: scale(0); opacity: 0; }
    to   { transform: scale(1); opacity: 1; }
}

.checkmark-circle svg {
    width: 100%;
    height: 100%;
}

.success-title {
    font-size: 22px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.success-amount {
    font-size: 36px;
    font-weight: 800;
    background: linear-gradient(135deg, var(--green), var(--cyan));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.success-method {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 28px;
}

.receipt-actions {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-bottom: 20px;
}

.btn-receipt {
    padding: 10px 16px;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 12px;
    font-weight: 600;
}

.btn-receipt:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.btn-new-sale {
    justify-content: center;
    max-width: 260px;
    margin: 0 auto;
}

/* ═══════════════════════════════════════════════════════════════
   Toast Notification
   ═══════════════════════════════════════════════════════════════ */
.toast {
    position: fixed;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%);
    padding: 12px 28px;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-light);
    border-radius: 50px;
    font-size: 14px;
    font-weight: 600;
    box-shadow: var(--shadow-lg);
    z-index: 2000;
    animation: toastIn 0.3s ease;
}

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

/* ═══════════════════════════════════════════════════════════════
   Placeholder Views (Orders, Customers, Reports, Settings)
   ═══════════════════════════════════════════════════════════════ */
.view-panel {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}

.panel-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px 32px;
    width: 100%;
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.panel-header h2 {
    font-size: 22px;
    font-weight: 800;
    color: var(--text-primary);
}

.text-muted { color: var(--text-muted); font-size: 14px; }

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}
.empty-state p {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text-secondary);
}
.empty-state span { font-size: 13px; }

/* ═══════════════════════════════════════════════════════════════
   Auth Screen
   ═══════════════════════════════════════════════════════════════ */
.auth-screen {
    position: fixed;
    inset: 0;
    background: var(--bg-deep);
    display: grid;
    place-items: center;
    z-index: 5000;
    background: radial-gradient(ellipse at 50% 0%, rgba(124,58,237,0.15) 0%, var(--bg-deep) 60%);
}

.auth-container {
    width: 90%;
    max-width: 420px;
    text-align: center;
}

.auth-brand {
    margin-bottom: 36px;
}

.auth-logo {
    font-size: 56px;
    display: block;
    margin-bottom: 12px;
    animation: brand-pulse 3s ease-in-out infinite alternate;
    filter: drop-shadow(0 0 20px var(--accent-glow));
}

.auth-brand h1 {
    font-size: 36px;
    font-weight: 800;
    background: linear-gradient(135deg, var(--accent-light), var(--cyan));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.auth-tagline {
    font-size: 15px;
    color: var(--text-muted);
    margin-top: 4px;
}

.auth-form {
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-xl);
    padding: 32px 28px;
    box-shadow: var(--shadow-lg);
}

.auth-form h2 {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 4px;
}

.auth-subtitle {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 24px;
}

.auth-submit {
    margin-top: 8px;
    justify-content: center;
    font-size: 15px;
}

.auth-toggle {
    margin-top: 16px;
    font-size: 13px;
    color: var(--text-muted);
}

.auth-toggle a {
    color: var(--accent-light);
    text-decoration: none;
    font-weight: 600;
    margin-left: 4px;
}

.auth-toggle a:hover {
    text-decoration: underline;
}

.auth-error {
    margin-top: 12px;
    padding: 10px 16px;
    background: var(--red-surface);
    color: var(--red);
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
}

/* ═══════════════════════════════════════════════════════════════
   Form Groups
   ═══════════════════════════════════════════════════════════════ */
.form-group {
    text-align: left;
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
    letter-spacing: 0.02em;
}

.form-group input,
.form-group select {
    width: 100%;
    height: 44px;
    padding: 0 14px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 14px;
    transition: all 0.2s ease;
}

.form-group input::placeholder {
    color: var(--text-muted);
}

.form-group input:focus,
.form-group select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
    outline: none;
}

.form-group select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%239090a8' d='M2 4l4 4 4-4'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 34px;
}

/* ═══════════════════════════════════════════════════════════════
   Customer Attach (Payment Modal)
   ═══════════════════════════════════════════════════════════════ */
.customer-attach {
    margin-bottom: 20px;
}

.customer-attach label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.customer-attach select {
    width: 100%;
    height: 40px;
    padding: 0 14px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 13px;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%239090a8' d='M2 4l4 4 4-4'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 34px;
}

.customer-attach select:focus {
    border-color: var(--accent);
    outline: none;
}

/* ═══════════════════════════════════════════════════════════════
   Data Tables
   ═══════════════════════════════════════════════════════════════ */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.data-table thead th {
    text-align: left;
    padding: 10px 14px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.data-table tbody tr {
    border-bottom: 1px solid var(--border);
    transition: background 0.12s ease;
}

.data-table tbody tr:hover {
    background: var(--bg-secondary);
}

.data-table td {
    padding: 12px 14px;
    color: var(--text-secondary);
    vertical-align: middle;
}

.data-table td.amount {
    font-weight: 700;
    color: var(--text-primary);
    font-family: 'Inter', monospace;
}

.data-table td.mono {
    font-family: 'Courier New', monospace;
    font-size: 11px;
    color: var(--text-muted);
}

/* Badges */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: capitalize;
}

.badge-completed, .badge-ok, .badge-card { background: var(--green-surface); color: var(--green); }
.badge-pending, .badge-low, .badge-cash { background: var(--amber-surface); color: var(--amber); }
.badge-voided, .badge-refunded, .badge-out { background: var(--red-surface); color: var(--red); }
.badge-vip { background: rgba(124,58,237,0.15); color: var(--accent-light); }
.badge-regular { background: var(--cyan-surface); color: var(--cyan); }
.badge-new { background: var(--bg-tertiary); color: var(--text-muted); }
.badge-tap { background: var(--cyan-surface); color: var(--cyan); }

/* ═══════════════════════════════════════════════════════════════
   Stats Grid (Reports Dashboard)
   ═══════════════════════════════════════════════════════════════ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}

.stat-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    transition: all 0.2s ease;
}

.stat-card:hover {
    border-color: var(--accent);
    box-shadow: 0 0 20px var(--accent-glow);
    transform: translateY(-2px);
}

.stat-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 8px;
}

.stat-value {
    font-size: 30px;
    font-weight: 800;
    color: var(--text-primary);
    background: linear-gradient(135deg, var(--accent-light), var(--cyan));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-sub {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ═══════════════════════════════════════════════════════════════
   Loyalty Earned (Success Modal)
   ═══════════════════════════════════════════════════════════════ */
.loyalty-earned {
    font-size: 15px;
    font-weight: 700;
    color: var(--accent-light);
    background: var(--accent-surface);
    padding: 8px 16px;
    border-radius: var(--radius-md);
    display: inline-block;
    margin-bottom: 20px;
}

/* ═══════════════════════════════════════════════════════════════
   Settings
   ═══════════════════════════════════════════════════════════════ */
.settings-group {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
}

.settings-group h3 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--text-primary);
}

.settings-group code {
    font-family: 'Courier New', monospace;
    font-size: 11px;
    background: var(--bg-tertiary);
    padding: 2px 8px;
    border-radius: 4px;
    color: var(--text-muted);
}

/* ═══════════════════════════════════════════════════════════════
   Responsive — Tablets
   ═══════════════════════════════════════════════════════════════ */
@media (max-width: 1024px) {
    :root {
        --cart-width: 280px;
    }
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 10px;
        padding: 8px 16px 16px;
    }
    .stats-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    }
}

@media (max-width: 768px) {
    :root {
        --sidebar-width: 0px;
        --cart-width: 100%;
    }
    .sidebar { display: none; }
    .cart-panel {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: 60vh;
        z-index: 500;
        border-right: none;
        border-top: 1px solid var(--border-light);
        border-radius: var(--radius-xl) var(--radius-xl) 0 0;
        transform: translateY(calc(100% - 72px));
        transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    }
    .cart-panel.open {
        transform: translateY(0);
    }
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }
    .panel-content {
        padding: 16px;
    }
    .data-table {
        font-size: 12px;
    }
    .data-table td, .data-table th {
        padding: 8px 10px;
    }
}

