/* ===== Theme Variables ===== */

#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

:root {
    --bg-main: #0f111a;
    --bg-surface: rgba(25, 28, 41, 0.7);
    --bg-surface-hover: rgba(35, 40, 58, 0.8);
    --text-primary: #f0f2f8;
    --text-secondary: #94a3b8;
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --accent: #ec4899;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --border: rgba(255, 255, 255, 0.08);
    --shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    --radius: 16px;
    --radius-sm: 8px;
    --glass-bg: rgba(25, 28, 41, 0.5);
    --glass-border: 1px solid rgba(255, 255, 255, 0.05);
    --grad-start: #f0f2f8;
    --grad-end: #a5b4fc;
    --input-bg: rgba(0, 0, 0, 0.2);
    --stat-title: #fff;
    --brand-color: #fff;
    --table-hover: rgba(255, 255, 255, 0.02);
}

:root[data-theme="light"] {
    --bg-main: #f8fafc;
    --bg-surface: rgba(255, 255, 255, 0.7);
    --bg-surface-hover: rgba(255, 255, 255, 1);
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --accent: #db2777;
    --success: #059669;
    --danger: #dc2626;
    --warning: #d97706;
    --border: rgba(0, 0, 0, 0.12);
    --shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.05);
    --glass-bg: rgba(255, 255, 255, 0.6);
    --glass-border: 1px solid rgba(0, 0, 0, 0.08);
    --grad-start: #1e1b4b;
    --grad-end: #4f46e5;
    --input-bg: rgba(0, 0, 0, 0.05);
    --stat-title: #0f172a;
    --brand-color: #0f172a;
    --table-hover: rgba(0, 0, 0, 0.02);
}

/* ===== Color Schemes ===== */
:root[data-scheme="emerald"] { --primary: #10b981; --primary-hover: #059669; --accent: #14b8a6; }
:root[data-scheme="emerald"][data-theme="light"] { --primary: #059669; --primary-hover: #047857; --accent: #0d9488; }
:root[data-scheme="rose"] { --primary: #f43f5e; --primary-hover: #e11d48; --accent: #fb7185; }
:root[data-scheme="rose"][data-theme="light"] { --primary: #e11d48; --primary-hover: #be123c; --accent: #f43f5e; }
:root[data-scheme="amber"] { --primary: #f59e0b; --primary-hover: #d97706; --accent: #fbbf24; }
:root[data-scheme="amber"][data-theme="light"] { --primary: #d97706; --primary-hover: #b45309; --accent: #f59e0b; }
:root[data-scheme="cyan"] { --primary: #06b6d4; --primary-hover: #0891b2; --accent: #22d3ee; }
:root[data-scheme="cyan"][data-theme="light"] { --primary: #0891b2; --primary-hover: #0e7490; --accent: #06b6d4; }
:root[data-scheme="violet"] { --primary: #8b5cf6; --primary-hover: #7c3aed; --accent: #a78bfa; }
:root[data-scheme="violet"][data-theme="light"] { --primary: #7c3aed; --primary-hover: #6d28d9; --accent: #8b5cf6; }
:root[data-scheme="pink"] { --primary: #ec4899; --primary-hover: #db2777; --accent: #f472b6; }
:root[data-scheme="pink"][data-theme="light"] { --primary: #db2777; --primary-hover: #be185d; --accent: #ec4899; }

/* ===== Base ===== */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
    font-family: 'Outfit', -apple-system, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-primary);
    background-image:
        radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.15) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(236, 72, 153, 0.1) 0px, transparent 50%);
    background-attachment: fixed;
    min-height: 100vh;
}

/* ===== Bootstrap Theme Overrides ===== */
.btn-primary {
    --bs-btn-bg: var(--primary); --bs-btn-border-color: var(--primary);
    --bs-btn-hover-bg: var(--primary-hover); --bs-btn-hover-border-color: var(--primary-hover);
    --bs-btn-active-bg: var(--primary-hover); --bs-btn-active-border-color: var(--primary-hover);
    background: linear-gradient(135deg, var(--primary), var(--primary-hover));
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}
.btn-primary:hover { box-shadow: 0 6px 16px rgba(99, 102, 241, 0.6); filter: brightness(1.1); }

.btn-outline-secondary {
    --bs-btn-color: var(--text-primary); --bs-btn-border-color: var(--border);
    --bs-btn-hover-bg: var(--bg-surface-hover); --bs-btn-hover-color: var(--text-primary);
    --bs-btn-hover-border-color: var(--border); background: var(--bg-surface);
}
.btn-outline-danger {
    --bs-btn-color: var(--danger); --bs-btn-border-color: rgba(239, 68, 68, 0.3);
    --bs-btn-hover-bg: rgba(239, 68, 68, 0.15); --bs-btn-hover-color: var(--danger);
    background: rgba(239, 68, 68, 0.1);
}
.btn-outline-success {
    --bs-btn-color: var(--success); --bs-btn-border-color: rgba(16, 185, 129, 0.3);
    --bs-btn-hover-bg: rgba(16, 185, 129, 0.15); --bs-btn-hover-color: var(--success);
    background: rgba(16, 185, 129, 0.1);
}
.btn:active { transform: scale(0.97); }

.form-control, .form-select {
    background: var(--input-bg); border-color: var(--border); color: var(--text-primary);
    font-family: 'Outfit', sans-serif;
}
.form-control:focus, .form-select:focus {
    background: var(--input-bg); border-color: var(--primary); color: var(--text-primary);
    box-shadow: 0 0 0 0.2rem rgba(99, 102, 241, 0.25);
}

.table { --bs-table-bg: transparent; --bs-table-color: var(--text-primary); --bs-table-border-color: var(--border); }
.table th { color: var(--text-secondary); text-transform: uppercase; font-size: 0.75rem; letter-spacing: 0.05em; font-weight: 600; }
.table-hover > tbody > tr:hover > * { --bs-table-bg-state: var(--table-hover); }

.card {
    --bs-card-bg: var(--glass-bg); --bs-card-border-color: var(--border); --bs-card-color: var(--text-primary);
    border-radius: var(--radius); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); box-shadow: var(--shadow);
}

.modal-content { background: var(--bg-main); border: var(--glass-border); color: var(--text-primary); }
.modal-header, .modal-footer { border-color: var(--border); }

.offcanvas { --bs-offcanvas-bg: var(--bg-main); --bs-offcanvas-color: var(--text-primary); border-color: var(--border) !important; }
.navbar { --bs-navbar-color: var(--text-primary); --bs-navbar-hover-color: var(--primary); --bs-navbar-active-color: var(--primary); }

.badge.bg-success-subtle { background: rgba(16, 185, 129, 0.2) !important; color: var(--success) !important; }
.badge.bg-warning-subtle { background: rgba(245, 158, 11, 0.2) !important; color: var(--warning) !important; }
.badge.bg-danger-subtle { background: rgba(239, 68, 68, 0.2) !important; color: var(--danger) !important; }
.badge.bg-primary-subtle { background: rgba(99, 102, 241, 0.2) !important; color: #a5b4fc !important; }

.dropdown-menu {
    --bs-dropdown-bg: var(--bg-main); --bs-dropdown-color: var(--text-primary);
    --bs-dropdown-border-color: var(--border); --bs-dropdown-link-color: var(--text-primary);
    --bs-dropdown-link-hover-color: var(--text-primary); --bs-dropdown-link-hover-bg: var(--bg-surface-hover);
    backdrop-filter: blur(12px); box-shadow: var(--shadow);
}

.accordion {
    --bs-accordion-bg: transparent; --bs-accordion-color: var(--text-primary);
    --bs-accordion-border-color: var(--border); --bs-accordion-btn-color: var(--text-primary);
    --bs-accordion-btn-bg: transparent; --bs-accordion-active-bg: rgba(99, 102, 241, 0.05);
    --bs-accordion-active-color: var(--text-primary);
    --bs-accordion-btn-focus-box-shadow: 0 0 0 0.2rem rgba(99, 102, 241, 0.25);
}

.list-group-item {
    --bs-list-group-bg: transparent; --bs-list-group-color: var(--text-primary);
    --bs-list-group-border-color: var(--border); --bs-list-group-action-hover-bg: var(--bg-surface-hover);
}

.pagination .page-link { background: var(--bg-surface); border-color: var(--border); color: var(--text-primary); }
.pagination .page-link:hover { background: var(--bg-surface-hover); color: var(--primary); border-color: var(--primary); }
.pagination .page-item.active .page-link { background: var(--primary); border-color: var(--primary); color: #fff; }
.pagination .page-item.disabled .page-link { opacity: 0.35; background: var(--bg-surface); }

/* ===== Glassmorphism ===== */
.glass-panel {
    background: var(--glass-bg); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    border: var(--glass-border); border-radius: var(--radius); padding: 1.25rem;
    box-shadow: var(--shadow); transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.glass-panel:hover { transform: translateY(-2px); box-shadow: 0 12px 40px 0 rgba(0, 0, 0, 0.45); }

/* ===== Global Page Components ===== */
.page-header {
    display: flex; flex-direction: column; gap: 0.75rem; margin-bottom: 1.5rem;
}
.page-header h1 { margin: 0; }
.page-header p { margin: 0; }
@media (min-width: 576px) {
    .page-header { flex-direction: row; justify-content: space-between; align-items: center; }
}

.filter-bar {
    background: var(--glass-bg); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    border: var(--glass-border); border-radius: var(--radius); padding: 0.75rem 1rem;
    margin-bottom: 1rem; box-shadow: var(--shadow);
}

.pill-btn {
    padding: 0.4rem 1rem; border-radius: 2rem; border: 1px solid var(--border);
    background: var(--bg-surface); color: var(--text-secondary);
    font-size: 0.85rem; font-weight: 500; cursor: pointer;
    transition: all 0.2s ease; font-family: inherit;
}
.pill-btn:hover { border-color: var(--primary); color: var(--primary); background: rgba(99, 102, 241, 0.08); }
.pill-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ===== Typography ===== */
h1 { background: linear-gradient(to right, var(--grad-start), var(--grad-end)); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; font-weight: 600; }
.text-gradient { background: linear-gradient(135deg, var(--primary), var(--accent)); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.text-muted { color: var(--text-secondary) !important; }

/* ===== App Layout ===== */
.app-container { display: flex; flex-direction: column; min-height: 100vh; }
.top-nav {
    position: fixed; top: 0; left: 0; width: 100%; height: calc(64px + env(safe-area-inset-top, 0px));
    background: var(--glass-bg); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    border-bottom: var(--glass-border); display: flex; align-items: flex-end; justify-content: space-between;
    padding: 0 1rem 0; z-index: 1040; box-shadow: var(--shadow);
    padding-top: env(safe-area-inset-top, 0px);
    padding-left: max(1rem, env(safe-area-inset-left, 0px)); padding-right: max(1rem, env(safe-area-inset-right, 0px));
}
.top-nav > * { height: 64px; display: flex; align-items: center; }
.sidebar {
    position: fixed; top: calc(64px + env(safe-area-inset-top, 0px)); left: 0; width: 280px; height: calc(100vh - 64px - env(safe-area-inset-top, 0px));
    background: var(--glass-bg); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    border-right: var(--glass-border); padding: 1.5rem;
    display: flex; flex-direction: column; z-index: 1035;
    transform: translateX(-100%); transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1); overflow-y: auto;
}
.mobile-nav-open .sidebar { transform: translateX(0); }
.sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0, 0, 0, 0.55); backdrop-filter: blur(2px); z-index: 1030; }
.mobile-nav-open .sidebar-overlay { display: block; }
.main-content { flex: 1; margin-top: calc(64px + env(safe-area-inset-top, 0px)); padding: 1.25rem; }
@media (min-width: 768px) {
    .hamburger-btn { display: none !important; }
    .sidebar { transform: translateX(0); }
    .sidebar-overlay { display: none !important; }
    .main-content { margin-left: 280px; padding: 2rem 3rem; }
}

/* ===== Nav Menu ===== */
.nav-item {
    display: flex; align-items: center; gap: 0.5rem; padding: 0.6rem 0.8rem;
    color: var(--text-secondary); text-decoration: none; border-radius: var(--radius-sm);
    font-weight: 500; transition: all 0.2s;
}
.nav-item:hover { background: var(--bg-surface-hover); color: var(--text-primary); }
.nav-item.active { background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(236, 72, 153, 0.1)); color: var(--primary); border-left: 3px solid var(--primary); }
.nav-section-title { padding: 0 0.5rem; font-size: 0.75rem; text-transform: uppercase; color: var(--text-secondary); font-weight: 700; letter-spacing: 0.1em; margin-top: 1rem; margin-bottom: 0.25rem; }

/* ===== Stat Cards ===== */
.stat-card { display: flex; align-items: center; gap: 0.75rem; }
.stat-card:hover { transform: none; box-shadow: var(--shadow); }
.stat-icon { width: 44px; height: 44px; flex-shrink: 0; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; font-size: 1.1rem; }
.stat-primary { background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(99, 102, 241, 0.05)); color: var(--primary); border: 1px solid rgba(99, 102, 241, 0.2); }
.stat-success { background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(16, 185, 129, 0.05)); color: var(--success); border: 1px solid rgba(16, 185, 129, 0.2); }
.stat-accent { background: linear-gradient(135deg, rgba(236, 72, 153, 0.2), rgba(236, 72, 153, 0.05)); color: var(--accent); border: 1px solid rgba(236, 72, 153, 0.2); }
.stat-warning { background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(245, 158, 11, 0.05)); color: var(--warning); border: 1px solid rgba(245, 158, 11, 0.2); }
.stat-content h3 { font-size: clamp(1.2rem, 3.5vw, 1.6rem); margin: 0; color: var(--stat-title); -webkit-text-fill-color: unset; background: none; }
.stat-content p { color: var(--text-secondary); margin: 0; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; font-weight: 600; }

/* ===== Auth ===== */
.auth-brand { text-align: center; margin-bottom: 1.5rem; }
.auth-brand i { font-size: 2.5rem; background: linear-gradient(135deg, var(--primary), var(--accent)); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.login-card h2 { text-align: center; font-size: 2rem; background: linear-gradient(to right, var(--grad-start), var(--grad-end)); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }

/* ===== Dashboard Charts ===== */
.dashboard-chart { display: flex; align-items: flex-end; gap: 4px; height: 180px; padding: 0.5rem 0; }
.chart-bar-group { flex: 1; display: flex; flex-direction: column; align-items: center; height: 100%; justify-content: flex-end; }
.chart-bar { width: 100%; max-width: 40px; background: linear-gradient(180deg, var(--primary), rgba(99, 102, 241, 0.3)); border-radius: 4px 4px 0 0; min-height: 4px; transition: height 0.3s ease; }
.chart-bar-negative { background: linear-gradient(180deg, var(--danger), rgba(239, 68, 68, 0.3)); }
.chart-label { font-size: 0.65rem; color: var(--text-secondary); margin-top: 0.4rem; white-space: nowrap; }
.top-products-list { display: flex; flex-direction: column; gap: 0.6rem; }
.top-product-row { display: flex; align-items: center; gap: 0.75rem; }
.top-product-name { width: 100px; font-size: 0.85rem; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex-shrink: 0; }
.top-product-bar-track { flex: 1; height: 8px; background: var(--input-bg); border-radius: 4px; overflow: hidden; }
.top-product-bar { height: 100%; background: linear-gradient(90deg, var(--primary), var(--accent)); border-radius: 4px; transition: width 0.3s ease; }
.top-product-count { font-size: 0.78rem; color: var(--text-secondary); white-space: nowrap; flex-shrink: 0; }
.payment-breakdown { display: flex; flex-direction: column; gap: 0.75rem; }
.payment-row { display: flex; align-items: center; gap: 0.75rem; }
.payment-label { display: flex; align-items: center; gap: 0.5rem; width: 110px; flex-shrink: 0; font-size: 0.85rem; font-weight: 500; }
.payment-bar-track { flex: 1; height: 8px; background: var(--input-bg); border-radius: 4px; overflow: hidden; }
.payment-bar { height: 100%; background: linear-gradient(90deg, var(--success), var(--primary)); border-radius: 4px; }
.payment-amount { font-size: 0.78rem; color: var(--text-secondary); white-space: nowrap; flex-shrink: 0; min-width: 80px; text-align: right; }
.quick-actions-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 0.5rem; }
.quick-action-btn { display: flex; flex-direction: column; align-items: center; gap: 0.35rem; padding: 0.75rem 0.5rem; background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text-primary); cursor: pointer; transition: all 0.15s; font-family: inherit; font-size: 0.8rem; font-weight: 500; }
.quick-action-btn:hover { border-color: var(--primary); background: var(--bg-surface-hover); transform: translateY(-2px); }
.quick-action-btn i { font-size: 1.25rem; color: var(--primary); }

/* ===== POS ===== */
.pos-layout { display: grid; grid-template-columns: 1fr; gap: 1.5rem; }
@media (min-width: 992px) { .pos-layout { grid-template-columns: 1fr 400px; } }
.pos-products { display: flex; flex-direction: column; gap: 1rem; min-height: 0; }
.pos-category-btn { padding: 0.35rem 0.85rem; border-radius: 2rem; border: 1px solid var(--border); background: var(--bg-surface); color: var(--text-secondary); font-size: 0.8rem; font-weight: 500; cursor: pointer; transition: all 0.15s; font-family: inherit; }
.pos-category-btn:hover { border-color: var(--primary); color: var(--primary); background: rgba(99, 102, 241, 0.08); }
.pos-category-btn.active { background: var(--primary); border-color: var(--primary); color: white; }
.pos-product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 0.75rem; }
.pos-product-card { background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 0.75rem; cursor: pointer; transition: all 0.15s; text-align: center; position: relative; }
.pos-product-card:hover { border-color: var(--primary); transform: translateY(-2px); }
.pos-product-card.disabled { opacity: 0.5; pointer-events: none; }
.pos-product-card.in-cart { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); }
.pos-product-img { width: 100%; aspect-ratio: 1; border-radius: 6px; object-fit: cover; margin-bottom: 0.5rem; background: var(--input-bg); }
.pos-product-img-placeholder { width: 100%; aspect-ratio: 1; border-radius: 6px; background: var(--input-bg); display: flex; align-items: center; justify-content: center; margin-bottom: 0.5rem; color: var(--text-secondary); font-size: 1.5rem; }
.pos-product-info { padding: 0.25rem 0; }
.pos-product-name { font-weight: 600; font-size: 0.85rem; margin-bottom: 0.2rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pos-product-price { font-size: 0.8rem; color: var(--primary); font-weight: 600; }
.pos-product-stock { font-size: 0.7rem; color: var(--text-secondary); }
.pos-product-qty-badge { position: absolute; top: -6px; right: -6px; background: var(--primary); color: white; min-width: 22px; height: 22px; border-radius: 50%; font-size: 0.7rem; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.pos-cart-panel { display: none; flex-direction: column; gap: 0.75rem; position: sticky; top: 80px; }
@media (min-width: 992px) { .pos-cart-panel { display: flex; } }
.pos-cart-panel.glass-panel:hover { transform: none; }
.pos-cart-items { display: flex; flex-direction: column; gap: 0.5rem; flex: 1; overflow-y: auto; max-height: 35vh; }
.pos-cart-empty { text-align: center; padding: 2rem 1rem; color: var(--text-secondary); }
.pos-cart-empty i { font-size: 2.5rem; opacity: 0.25; margin-bottom: 0.5rem; display: block; }
.pos-cart-item { display: flex; align-items: center; gap: 0.75rem; padding: 0.6rem; background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.pos-cart-item-info { flex: 1; min-width: 0; }
.pos-cart-item-controls { display: flex; align-items: center; gap: 0.25rem; }
.pos-cart-item-total { font-weight: 600; font-size: 0.9rem; white-space: nowrap; min-width: 70px; text-align: right; }
.pos-cart-remove { background: none; border: none; color: var(--danger); cursor: pointer; padding: 0.25rem; font-size: 0.85rem; opacity: 0.6; }
.pos-cart-remove:hover { opacity: 1; }
.pos-qty-btn { width: 28px; height: 28px; border-radius: 6px; border: 1px solid var(--border); background: transparent; color: var(--text-primary); cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 0.8rem; }
.pos-qty-btn:hover { border-color: var(--primary); color: var(--primary); }
.pos-qty-input { width: 40px; text-align: center; border-radius: 6px; font-size: 0.85rem; background: var(--input-bg); border: 1px solid var(--border); color: var(--text-primary); padding: 0.2rem; }
.pos-discount-section { margin-bottom: 0.5rem; }
.pos-payment-section { margin-bottom: 0.5rem; }
.pos-totals { margin-bottom: 0.75rem; }
.pos-total-row { display: flex; justify-content: space-between; font-size: 0.9rem; padding: 0.15rem 0; }
.pos-grand-total { font-size: 1.1rem; font-weight: 700; border-top: 1px solid var(--border); padding-top: 0.5rem; margin-top: 0.25rem; }
.pos-mobile-cart-btn { display: flex; position: fixed; bottom: calc(70px + env(safe-area-inset-bottom, 0px)); right: 1rem; width: 60px; height: 60px; border-radius: 50%; background: linear-gradient(135deg, var(--primary), var(--primary-hover)); color: white; border: none; font-size: 1.4rem; align-items: center; justify-content: center; box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5); cursor: pointer; z-index: 100; }
@media (min-width: 992px) { .pos-mobile-cart-btn { display: none; } }
.pos-mobile-cart-badge { position: absolute; top: -4px; right: -4px; background: var(--danger); color: white; min-width: 22px; height: 22px; border-radius: 50%; font-size: 0.7rem; font-weight: 700; display: flex; align-items: center; justify-content: center; }

/* ===== Receipt ===== */
.receipt-overlay { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.6); backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center; z-index: 2000; }
.receipt-card { background: #fff; color: #111; width: 90%; max-width: 360px; border-radius: 12px; padding: 1.5rem; font-family: 'Courier New', monospace; font-size: 0.85rem; max-height: 90vh; overflow-y: auto; animation: slideUp 0.25s ease; }
.receipt-card h3 { text-align: center; margin-bottom: 0.25rem; font-size: 1.1rem; -webkit-text-fill-color: unset; background: none; }
.receipt-paper { background: #fff; color: #111; padding: 1.5rem; font-family: 'Courier New', monospace; font-size: 0.85rem; border-radius: 8px; }
.receipt-header-section { text-align: center; margin-bottom: 0.5rem; }
.receipt-business-name { font-size: 1.2rem; font-weight: bold; margin: 0; color: #111; -webkit-text-fill-color: unset; background: none; }
.receipt-date { font-size: 0.75rem; color: #666; margin: 0.25rem 0 0; }
.receipt-customer { font-size: 0.8rem; color: #444; margin: 0.25rem 0 0; }
.receipt-items { width: 100%; border-collapse: collapse; }
.receipt-items th { font-size: 0.75rem; text-transform: uppercase; color: #666; border-bottom: 1px solid #ccc; padding: 0.25rem 0; text-align: left; }
.receipt-items td { padding: 0.2rem 0; font-size: 0.8rem; }
.receipt-item-qty { text-align: center; width: 40px; }
.receipt-item-price { text-align: right; }
.receipt-items th.receipt-item-qty { text-align: center; }
.receipt-items th.receipt-item-price { text-align: right; }
.receipt-totals { margin-top: 0.25rem; }
.receipt-discount { color: #e74c3c; }
.receipt-payment { text-align: center; font-size: 0.8rem; color: #444; }
.receipt-footer p { margin: 0.25rem 0; }
.receipt-footer-sub { font-size: 0.65rem; color: #aaa; }
.receipt-meta { text-align: center; font-size: 0.75rem; color: #666; margin-bottom: 1rem; }
.receipt-divider { border: none; border-top: 1px dashed #ccc; margin: 0.75rem 0; }
.receipt-row { display: flex; justify-content: space-between; padding: 0.15rem 0; }
.receipt-total { font-weight: bold; font-size: 1rem; border-top: 2px solid #111; padding-top: 0.5rem; margin-top: 0.5rem; }
.receipt-footer { text-align: center; font-size: 0.7rem; color: #999; margin-top: 1rem; }
@media print {
    body * { visibility: hidden !important; }
    #receipt-content, #receipt-content * { visibility: visible !important; }
    #receipt-content {
        position: absolute !important;
        top: 0;
        left: 0;
        width: 100% !important;
        max-width: none !important;
        border-radius: 0 !important;
        padding: 1.5rem !important;
        background: #fff !important;
        color: #111 !important;
        font-family: 'Courier New', monospace;
        font-size: 0.85rem;
        z-index: 99999;
    }
    .app-modal-overlay, .app-modal-panel {
        position: absolute !important;
        overflow: visible !important;
        height: auto !important;
        visibility: hidden !important;
    }
    html, body { height: auto !important; overflow: visible !important; }
}

/* ===== Toast ===== */
.toast-container-custom { position: fixed; top: 4.5rem; right: 1rem; left: 1rem; display: flex; flex-direction: column; gap: 0.6rem; z-index: 9999; pointer-events: none; }
@media (min-width: 480px) { .toast-container-custom { left: auto; right: 1.5rem; width: 380px; } }
.app-toast { display: flex; align-items: center; gap: 0.75rem; padding: 0.85rem 1.1rem; border-radius: 12px; background: var(--bg-surface); backdrop-filter: blur(12px); border: 1px solid var(--border); box-shadow: 0 8px 32px rgba(0,0,0,0.35); width: 100%; pointer-events: all; animation: toast-in 0.25s ease; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-12px); } to { opacity: 1; transform: translateY(0); } }
.app-toast.toast-success { border-left: 3px solid var(--success); }
.app-toast.toast-success .toast-icon { color: var(--success); }
.app-toast.toast-error { border-left: 3px solid #f87171; }
.app-toast.toast-error .toast-icon { color: #f87171; }
.app-toast.toast-info { border-left: 3px solid var(--primary); }
.app-toast.toast-info .toast-icon { color: var(--primary); }

/* ===== Notification Panel ===== */
.notification-bell { position: relative; background: transparent; border: none; color: var(--text-secondary); font-size: 1.2rem; padding: 0.5rem; cursor: pointer; }
.notification-bell:hover { color: var(--text-primary); }
.notification-badge-icon { position: absolute; top: 2px; right: 2px; width: 18px; height: 18px; background: var(--danger); color: white; border-radius: 50%; font-size: 0.65rem; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.notification-panel { position: fixed; top: 64px; right: 0; width: 340px; max-height: calc(100vh - 64px); background: var(--bg-main); border-left: var(--glass-border); box-shadow: -8px 0 32px rgba(0, 0, 0, 0.3); z-index: 1050; overflow-y: auto; animation: slideInRight 0.25s ease; }
@keyframes slideInRight { from { transform: translateX(100%); } to { transform: translateX(0); } }
.notification-item { display: flex; gap: 0.75rem; padding: 0.85rem 1.25rem; border-bottom: 1px solid var(--border); transition: background 0.15s; cursor: pointer; }
.notification-item:hover { background: var(--bg-surface-hover); }
.notification-item.unread { background: rgba(99, 102, 241, 0.05); }
.notification-icon { width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 0.85rem; }
.notification-icon.info { background: rgba(99, 102, 241, 0.15); color: var(--primary); }
.notification-icon.warning { background: rgba(245, 158, 11, 0.15); color: var(--warning); }
.notification-icon.success { background: rgba(16, 185, 129, 0.15); color: var(--success); }
.notification-icon.danger { background: rgba(239, 68, 68, 0.15); color: var(--danger); }
.notification-content { flex: 1; min-width: 0; }
.notification-title { font-weight: 600; font-size: 0.85rem; }
.notification-message { font-size: 0.78rem; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.notification-time { font-size: 0.7rem; color: var(--text-secondary); margin-top: 0.2rem; }
@media (max-width: 480px) { .notification-panel { width: 100%; } }

/* ===== Onboarding ===== */
.onboarding-container { padding: 1.5rem; text-align: center; }
.onboarding-progress { display: flex; justify-content: center; gap: 0.5rem; margin-bottom: 1.5rem; }
.onboarding-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--border); transition: background 0.2s; }
.onboarding-dot.active { background: var(--primary); }
.onboarding-dot.completed { background: var(--success); }
.onboarding-step { animation: fadeIn 0.25s ease; }
.onboarding-step h2 { margin-bottom: 0.5rem; }
.onboarding-icon { font-size: 3rem; color: var(--primary); margin-bottom: 1rem; }
.onboarding-actions { display: flex; justify-content: center; gap: 0.75rem; margin-top: 1.5rem; flex-wrap: wrap; }
.onboarding-tips { display: flex; flex-direction: column; gap: 0.75rem; margin: 1.5rem auto; max-width: 400px; text-align: left; }
.onboarding-tip { display: flex; align-items: center; gap: 0.75rem; padding: 0.6rem 0.8rem; background: var(--bg-surface); border-radius: var(--radius-sm); font-size: 0.9rem; }

/* ===== Confirm Dialog ===== */
.confirm-dialog-overlay { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.6); backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center; z-index: 2000; animation: fadeIn 0.15s ease; }
.confirm-dialog { background: var(--bg-main); border: var(--glass-border); border-radius: var(--radius); padding: 2rem; width: 90%; max-width: 400px; text-align: center; animation: slideUp 0.25s ease; }
.confirm-dialog-icon { font-size: 2.5rem; color: var(--danger); margin-bottom: 1rem; }

/* ===== Offline Banner ===== */
.offline-banner { background: #f97316; color: white; text-align: center; padding: 0.45rem 1rem; font-size: 0.85rem; font-weight: 500; display: flex; align-items: center; justify-content: center; gap: 0.5rem; z-index: 900; }

/* ===== Landing Page ===== */
.hero-section { padding: 3rem 1.25rem; max-width: 1200px; margin: 0 auto; text-align: center; }
.hero-title { font-size: clamp(2rem, 8vw, 3.5rem); line-height: 1.1; margin-bottom: 1rem; }
.hero-subtitle { font-size: 1rem; color: var(--text-secondary); margin-bottom: 1.5rem; max-width: 600px; line-height: 1.6; }
.hero-badge { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.35rem 1rem; border-radius: 2rem; background: rgba(99, 102, 241, 0.15); color: var(--primary); font-size: 0.8rem; font-weight: 600; margin-bottom: 1rem; }
.hero-mockup { padding: 1rem; border-radius: var(--radius); }
.mockup-header { display: flex; align-items: center; gap: 6px; padding-bottom: 0.75rem; margin-bottom: 0.75rem; border-bottom: 1px solid var(--border); }
.mockup-header .dot { width: 10px; height: 10px; border-radius: 50%; }
.dot.red { background: #ef4444; } .dot.yellow { background: #f59e0b; } .dot.green { background: #10b981; }
.mockup-stats-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; margin-bottom: 1rem; }
.mockup-stat-card { background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 0.75rem; text-align: center; }
.mockup-stat-num { font-size: 1.25rem; font-weight: 700; }
.mockup-stat-label { font-size: 0.7rem; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.05em; }
.mockup-chart-bars { display: flex; align-items: flex-end; gap: 8px; height: 140px; padding-top: 1rem; }
.mockup-bar { flex: 1; border-radius: 4px 4px 0 0; background: linear-gradient(180deg, var(--primary), rgba(99, 102, 241, 0.3)); animation: growBar 1s ease forwards; transform-origin: bottom; }
@keyframes growBar { from { transform: scaleY(0); } to { transform: scaleY(1); } }
.mockup-bar:nth-child(2) { background: linear-gradient(180deg, var(--accent), rgba(236, 72, 153, 0.3)); animation-delay: 0.1s; }
.mockup-bar:nth-child(4) { background: linear-gradient(180deg, var(--success), rgba(16, 185, 129, 0.3)); animation-delay: 0.2s; }
.mockup-bar:nth-child(6) { background: linear-gradient(180deg, var(--warning), rgba(245, 158, 11, 0.3)); animation-delay: 0.3s; }
.step-number { width: 48px; height: 48px; border-radius: 50%; background: linear-gradient(135deg, var(--primary), var(--accent)); color: white; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 1.25rem; margin-bottom: 1rem; }
.feature-icon { width: 48px; height: 48px; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; font-size: 1.25rem; margin-bottom: 1rem; }
.popular-badge { position: absolute; top: -12px; left: 50%; transform: translateX(-50%); background: linear-gradient(135deg, var(--primary), var(--accent)); color: white; padding: 0.25rem 1rem; border-radius: 2rem; font-size: 0.72rem; font-weight: 700; text-transform: uppercase; }
@media (min-width: 768px) {
    .hero-section { display: flex; text-align: left; padding: 5rem 2rem; gap: 3rem; align-items: center; }
    .hero-section > :first-child { flex: 1; }
    .hero-section > :last-child { flex: 1; display: block !important; }
}

/* ===== Reports ===== */
.report-section-header {
    cursor: pointer; user-select: none; -webkit-text-fill-color: unset; background: none;
    display: flex; justify-content: space-between; align-items: center;
    padding: 0.5rem 0;
}
.report-section-header h2 {
    margin-bottom: 0; -webkit-text-fill-color: unset; background: none;
    font-size: 1.15rem; display: flex; align-items: center; gap: 0.5rem;
}
.report-section-header > i { font-size: 0.85rem; color: var(--text-secondary); flex-shrink: 0; }
.pnl-item { display: flex; justify-content: space-between; align-items: center; padding: 0.6rem 0; border-bottom: 1px solid var(--border); }
.pnl-item:last-child { border-bottom: none; }
.pnl-item.pnl-total { border-top: 2px solid var(--border); border-bottom: none; font-weight: 700; font-size: 1.1rem; padding-top: 0.75rem; }
.pnl-label { color: var(--text-secondary); }
.pnl-value { font-weight: 600; }

/* ===== Settings ===== */
.toggle-row { display: flex; align-items: center; gap: 0.75rem; padding: 0.6rem 0; border-bottom: 1px solid var(--border); cursor: pointer; font-size: 0.9rem; }
.toggle-row:last-of-type { border-bottom: none; }
.toggle-row input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--primary); cursor: pointer; flex-shrink: 0; }

/* ===== Stock/Product Mobile Cards ===== */
.stock-card { background: var(--bg-surface); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.stock-card-header { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; padding: 0.75rem 1rem; background: rgba(255,255,255,0.04); border-bottom: 1px solid var(--border); }
.stock-card-name { font-weight: 600; font-size: 0.95rem; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stock-card-body { padding: 0.6rem 1rem; display: flex; flex-direction: column; gap: 0.35rem; }
.stock-card-row { display: flex; justify-content: space-between; align-items: center; font-size: 0.875rem; }
.stock-card-label { color: var(--text-secondary); font-size: 0.8rem; }
.stock-card-actions { display: flex; gap: 0.5rem; padding: 0.6rem 1rem; border-top: 1px solid var(--border); }

/* ===== Loader ===== */
.initial-loader { display: flex; flex-direction: column; justify-content: center; align-items: center; height: 100vh; font-size: 1.5rem; font-weight: 500; color: var(--text-primary); gap: 20px; }
.loader-pulse { width: 60px; height: 60px; border-radius: 50%; background: linear-gradient(135deg, var(--primary), var(--accent)); animation: pulse 1.5s infinite; }
@keyframes pulse { 0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.7); } 70% { transform: scale(1); box-shadow: 0 0 0 20px rgba(99, 102, 241, 0); } 100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(99, 102, 241, 0); } }

/* ===== Animations ===== */
@keyframes slideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideUpSheet { from { transform: translateY(100%); } to { transform: translateY(0); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ===== Spinner ===== */
.spinner { display: inline-block; width: 16px; height: 16px; border: 2px solid rgba(255,255,255,0.3); border-radius: 50%; border-top-color: #fff; animation: spin 1s ease-in-out infinite; margin-right: 0.5rem; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== Mobile table/card toggle ===== */
.card-view { display: none; }
.table-view { display: block; }
@media (max-width: 640px) { .table-view { display: none; } .card-view { display: flex; flex-direction: column; gap: 0.75rem; } }

/* ===== Hide on mobile ===== */
@media (max-width: 640px) { .hide-mobile { display: none !important; } }

/* ===== App Modal Overlay ===== */
.app-modal-overlay {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.6); backdrop-filter: blur(4px);
    display: flex; align-items: center; justify-content: center;
    z-index: 1050; padding: 1rem; overscroll-behavior-y: contain;
}
.app-modal-panel {
    width: 90%; max-width: 600px; min-width: 320px; max-height: 90vh; overflow-y: auto;
    background: var(--bg-main); border: 1px solid var(--border);
    border-radius: var(--radius); box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    animation: slideUp 0.3s ease;
}
.app-modal-header {
    padding: 1.25rem 1.5rem; display: flex; justify-content: space-between; align-items: center;
    border-bottom: 1px solid var(--border);
}
.app-modal-header h3, .app-modal-header h5 { margin-bottom: 0; -webkit-text-fill-color: unset; background: none; }
.app-modal-body { padding: 1.25rem 1.5rem; }
.app-modal-footer { padding: 1rem 1.5rem; display: flex; justify-content: flex-end; gap: 0.75rem; border-top: 1px solid var(--border); }
.app-modal-close {
    background: transparent; border: none; color: var(--text-secondary);
    font-size: 1.5rem; cursor: pointer; padding: 0.25rem; line-height: 1;
}
.app-modal-close:hover { color: var(--text-primary); }

/* ===== Guest Banner ===== */
.guest-banner {
    background: linear-gradient(135deg, var(--primary), #8b5cf6);
    color: white; text-align: center; padding: 0.45rem 1rem;
    font-size: 0.85rem; font-weight: 500;
    display: flex; align-items: center; justify-content: center; gap: 0.5rem;
    z-index: 900;
}
.guest-banner-link {
    color: white; font-weight: 700; text-decoration: underline;
    text-underline-offset: 2px; margin-left: 0.25rem; cursor: pointer;
}
.guest-banner-link:hover { opacity: 0.85; }

/* ===== Mobile Bottom Bar ===== */
.mobile-bottom-bar {
    position: fixed; bottom: 0; left: 0; right: 0;
    height: calc(64px + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: var(--glass-bg); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--border);
    display: flex; align-items: stretch; justify-content: space-around;
    z-index: 1040;
}
.bottom-bar-item {
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 0.2rem; color: var(--text-secondary); text-decoration: none;
    font-size: 0.65rem; font-weight: 500; transition: color 0.15s;
    padding: 0.5rem 0;
}
.bottom-bar-item i { font-size: 1.15rem; }
.bottom-bar-item.active { color: var(--primary); }
.bottom-bar-item.active i { color: var(--primary); }
.bottom-bar-item.disabled { opacity: 0.4; pointer-events: auto; }
.bottom-bar-item:hover:not(.disabled) { color: var(--primary); }

/* Nav locked items (guest mode) */
.nav-item-locked {
    display: flex; align-items: center; gap: 0.5rem; padding: 0.6rem 0.8rem;
    color: var(--text-secondary); opacity: 0.5; border-radius: var(--radius-sm);
    font-weight: 500; cursor: not-allowed;
}

/* Locked dashboard widgets (guest mode) */
.locked-widget { position: relative; overflow: hidden; pointer-events: none; user-select: none; }
.locked-widget > *:not(.locked-widget-overlay) { opacity: 0.15; filter: blur(2px); }
.locked-widget-overlay {
    position: absolute; inset: 0; z-index: 2;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 0.5rem; color: var(--text-secondary); pointer-events: auto;
}
.locked-widget-overlay i { font-size: 1.75rem; color: var(--primary); opacity: 0.7; }
.locked-widget-overlay span { font-size: 0.85rem; font-weight: 600; }

/* Mobile adjustments for bottom bar */
@media (max-width: 767.98px) {
    .main-content { padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px)); }
    .quick-actions-desktop { display: none; }
    .toast-container-custom { bottom: calc(72px + env(safe-area-inset-bottom, 0px)); top: auto; }
}
.app-modal-panel.app-modal-sm { max-width: 400px; }
.app-modal-panel.app-modal-lg { max-width: 800px; min-width: min(500px, 90vw); }
.app-modal-panel.app-modal-xl { max-width: 1000px; }

/* ===== App OffCanvas ===== */
.app-offcanvas-overlay {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.5); backdrop-filter: blur(2px);
    z-index: 1050;
}
.app-offcanvas-panel {
    position: fixed; z-index: 1051;
    background: var(--glass-bg); border: 1px solid var(--border);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    display: flex; flex-direction: column;
    overflow: hidden;
}
.app-offcanvas-panel.placement-right {
    top: 0; right: 0; bottom: 0; width: 380px; max-width: 90vw;
    animation: slideInRight 0.3s ease;
}
.app-offcanvas-panel.placement-bottom {
    left: 0; right: 0; bottom: 0;
    max-height: 85vh; border-radius: var(--radius) var(--radius) 0 0;
    animation: slideUp 0.3s ease;
}
.app-offcanvas-header {
    padding: 1rem 1.25rem; display: flex; justify-content: space-between; align-items: center;
    border-bottom: 1px solid var(--border);
}
.app-offcanvas-body { padding: 1rem 1.25rem; overflow-y: auto; flex: 1; }
@keyframes slideInRight { from { transform: translateX(100%); } to { transform: translateX(0); } }

/* ===== Report Filter Bar ===== */
.report-filter-bar {
    display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 1.25rem;
}
.report-filter-btn { padding: 0.4rem 1rem; border-radius: 2rem; border: 1px solid var(--border); background: var(--bg-surface); color: var(--text-secondary); font-size: 0.85rem; font-weight: 500; cursor: pointer; transition: all 0.2s ease; font-family: inherit; }
.report-filter-btn:hover { border-color: var(--primary); color: var(--primary); background: rgba(99, 102, 241, 0.08); }
.report-filter-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ===== Touch improvements ===== */
button, .btn, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
.pos-mobile-sheet, .onboarding-overlay, .receipt-overlay { overscroll-behavior-y: contain; }