:root {
    --primary: #2563eb;
    --primary-light: #dbeafe;
    --secondary: #64748b;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --bg-main: #f8fafc;
    --bg-card: #ffffff;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --sidebar-w: 260px;
    --header-h: 80px;
    --radius: 12px;
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.5;
    overflow-x: hidden;
}

#app {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-w);
    background-color: #1e293b;
    color: white;
    display: flex;
    flex-direction: column;
    padding: 2rem 1.5rem;
    position: fixed;
    height: 100vh;
    transition: transform 0.3s ease;
    z-index: 100;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 3rem;
}

.logo i {
    color: var(--primary);
}

.nav-links {
    list-style: none;
    flex-grow: 1;
}

.nav-links li {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.875rem 1rem;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s ease;
    color: #94a3b8;
    margin-bottom: 0.5rem;
}

.nav-links li:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
}

.nav-links li.active {
    background-color: var(--primary);
    color: white;
}

.nav-links li i {
    width: 20px;
    height: 20px;
}

.badge {
    background-color: var(--danger);
    color: white;
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 10px;
    margin-left: auto;
}

.sidebar-footer {
    font-size: 0.8rem;
    color: #64748b;
    text-align: center;
}

/* Main Content */
.content {
    flex-grow: 1;
    margin-left: var(--sidebar-w);
    padding: 2rem;
    max-width: calc(100vw - var(--sidebar-w));
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2.5rem;
    height: var(--header-h);
}

.search-container {
    position: relative;
    width: 400px;
}

.search-container i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.search-container input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 3rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: white;
    outline: none;
    transition: border-color 0.2s;
}

.search-container input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.profile-menu {
    position: relative;
    display: inline-block;
    cursor: pointer;
}

.dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    top: 50px;
    background-color: white;
    min-width: 160px;
    box-shadow: var(--shadow-lg);
    border-radius: var(--radius);
    z-index: 1000;
    overflow: hidden;
    border: 1px solid var(--border);
}

.profile-menu:hover .dropdown-content {
    display: block;
}

.dropdown-content a {
    color: var(--text-main);
    padding: 12px 16px;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    transition: background 0.2s;
}

.dropdown-content a i {
    width: 16px;
    height: 16px;
}

.dropdown-content a:hover {
    background-color: var(--bg-main);
}

/* Views */
.view {
    display: none;
    animation: fadeIn 0.4s ease-out;
}

.view.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.view-header {
    margin-bottom: 2rem;
}

.view-header h1 {
    font-size: 1.875rem;
    font-weight: 700;
    color: var(--text-main);
}

.view-header p {
    color: var(--text-muted);
}

/* Dashboard Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    gap: 1.25rem;
    box-shadow: var(--shadow);
}

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-icon.blue { background-color: #eff6ff; color: #2563eb; }
.stat-icon.yellow { background-color: #fffbeb; color: #d97706; }
.stat-icon.red { background-color: #fef2f2; color: #dc2626; }
.stat-icon.green { background-color: #f0fdf4; color: #16a34a; }

.stat-info h3 {
    font-size: 0.875rem;
    color: var(--text-muted);
    font-weight: 500;
}

.stat-info p {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-main);
}

/* Cards & Tables */
.card {
    background: white;
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    margin-bottom: 1.5rem;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.card-header h2 {
    font-size: 1.125rem;
    font-weight: 600;
}

.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    text-align: left;
    padding: 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
}

td {
    padding: 1rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.875rem;
}

tr:last-child td {
    border-bottom: none;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    font-size: 0.875rem;
}

.btn-primary {
    background-color: var(--primary);
    color: white;
}

.btn-primary:hover {
    background-color: #1d4ed8;
}

.btn-secondary {
    background-color: white;
    border: 1px solid var(--border);
    color: var(--text-main);
}

.btn-danger {
    background-color: var(--danger);
    color: white;
}

.btn-text {
    background: transparent;
    color: var(--primary);
    padding: 0;
}

.btn-full {
    width: 100%;
    justify-content: center;
    padding: 1rem;
}

/* Scanner Section */
.scanner-section {
    margin-bottom: 2rem;
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    background: #000;
}

#reader {
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
}

.scanner-controls {
    padding: 1rem;
    background: white;
    display: flex;
    justify-content: center;
    gap: 1rem;
    border-top: 1px solid var(--border);
}

/* QR Modal Styles */
.qr-modal-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2rem;
    gap: 1.5rem;
}

#qrcode-display canvas, #qrcode-display img {
    margin: 0 auto;
}

.qr-details {
    text-align: center;
}

.qr-details h3 { font-size: 1.25rem; margin-bottom: 0.5rem; }
.qr-details p { color: var(--text-muted); font-size: 0.875rem; }

/* Print Styles */
@media print {
    .sidebar, .top-bar, .nav-links, .btn, .scanner-section, .pos-summary, .search-pos, .cart-items {
        display: none !important;
    }
    .content { margin: 0; padding: 0; }
    #bulk-qr-print-container {
        display: grid !important;
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
        padding: 20px;
    }
    .qr-print-label {
        border: 1px solid #eee;
        padding: 10px;
        text-align: center;
        page-break-inside: avoid;
    }
}

.hidden-print { display: none; }

/* POS UI */
.pos-container {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 1.5rem;
}

.search-pos {
    position: relative;
    margin-bottom: 1.5rem;
}

.search-pos input {
    width: 100%;
    padding: 1rem;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    font-size: 1rem;
}

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border-radius: 0 0 var(--radius) var(--radius);
    box-shadow: var(--shadow-lg);
    z-index: 10;
    max-height: 300px;
    overflow-y: auto;
    display: none;
}

.search-item {
    padding: 1rem;
    cursor: pointer;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
}

.search-item:hover {
    background: var(--bg-main);
}

.summary-details {
    margin: 1.5rem 0;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.75rem;
    color: var(--text-muted);
}

.summary-row.total {
    color: var(--text-main);
    font-weight: 700;
    font-size: 1.25rem;
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.modal {
    width: 600px;
    max-width: 90%;
    background: white;
    padding: 0;
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
}

.modal-header h2 { font-size: 1.25rem; }

.modal-header .btn-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
}

#product-form {
    padding: 1.5rem;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.form-group input, .form-group select {
    width: 100%;
    padding: 0.625rem;
    border: 1px solid var(--border);
    border-radius: 6px;
}

.modal-footer {
    padding: 1.25rem 1.5rem;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

/* Status Badges */
.status-badge {
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
}

.status-badge.expired { background: #fee2e2; color: #dc2626; }
.status-badge.warning { background: #fef3c7; color: #d97706; }
.status-badge.good { background: #dcfce7; color: #16a34a; }

/* Utilities */
.hidden { display: none; }

/* Mobile Support */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: var(--text-main);
    cursor: pointer;
}

@media (max-width: 1024px) {
    .desktop-only { display: none !important; }
    .mobile-menu-btn { display: block; margin-right: 1rem; }
    
    .sidebar { 
        transform: translateX(-100%); 
        z-index: 1000;
        box-shadow: none;
    }
    .sidebar.open { 
        transform: translateX(0); 
        box-shadow: 0 0 0 100vw rgba(0,0,0,0.5); 
    }
    
    .content { margin-left: 0; max-width: 100vw; }
    
    .pos-container { grid-template-columns: 1fr; }
    
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .form-grid { grid-template-columns: 1fr; }
    
    .top-bar { padding: 1rem; }
    .user-profile { gap: 0.5rem; }
}

@media (max-width: 768px) {
    .stats-grid { grid-template-columns: 1fr; }
    
    /* Landing page fixes */
    .hero h1 { font-size: 2.5rem; }
    .hero-btns { flex-direction: column; width: 100%; }
    .hero-btns .btn { width: 100%; text-align: center; justify-content: center; }
    
    .dashboard-mockup { height: 250px; }
    .mockup-side { display: none; }
    .mockup-stats { grid-template-columns: 1fr; gap: 0.5rem; }
    
    .nav-links-landing { display: none; }
}

.table-container {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: #1e293b;
    color: white;
    padding: 1rem 1.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    z-index: 2000;
    animation: slideUp 0.3s ease-out;
}

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

/* Landing Page & Auth Styles */
.landing-body { background: white; }
.landing-nav { display: flex; justify-content: space-between; align-items: center; padding: 1.5rem 5%; background: white; border-bottom: 1px solid var(--border); }
.nav-links-landing { display: flex; gap: 2rem; font-weight: 500; }
.nav-links-landing a { text-decoration: none; color: var(--text-muted); transition: color 0.2s; }
.nav-links-landing a:hover { color: var(--primary); }

.hero { text-align: center; padding: 6rem 5% 4rem; background: linear-gradient(135deg, #f8fafc 0%, #eff6ff 100%); }
.hero-tag { display: inline-block; padding: 0.5rem 1rem; background: #dbeafe; color: var(--primary); border-radius: 2rem; font-weight: 600; font-size: 0.875rem; margin-bottom: 1.5rem; }
.hero h1 { font-size: 3.5rem; font-weight: 800; color: #0f172a; margin-bottom: 1.5rem; line-height: 1.2; }
.hero h1 span { color: var(--primary); }
.hero p { font-size: 1.125rem; color: var(--text-muted); max-width: 600px; margin: 0 auto 2.5rem; }
.hero-btns { display: flex; gap: 1rem; justify-content: center; margin-bottom: 4rem; }
.btn-lg { padding: 1rem 2rem; font-size: 1rem; border-radius: 12px; }

.section { padding: 5rem 5%; }
.section-header { text-align: center; margin-bottom: 4rem; }
.section-title { font-size: 2.5rem; font-weight: 800; color: #0f172a; }
.section-title span { color: var(--primary); }
.features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 2rem; max-width: 1200px; margin: 0 auto; }
.feature-card { padding: 2.5rem; background: white; border-radius: 24px; border: 1px solid var(--border); box-shadow: var(--shadow-lg); text-align: center; transition: transform 0.3s; }
.feature-card:hover { transform: translateY(-5px); }
.feature-card i { width: 48px; height: 48px; color: var(--primary); margin-bottom: 1.5rem; }
.feature-card h3 { font-size: 1.25rem; font-weight: 700; margin-bottom: 1rem; }

.landing-footer { background: #0f172a; color: white; padding: 4rem 5% 2rem; }
.footer-grid { max-width: 1200px; margin: 0 auto; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 2rem; }
.footer-info .logo { color: white; margin-bottom: 1rem; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.1); width: 100%; padding-top: 2rem; color: #94a3b8; font-size: 0.875rem; }

.auth-screen { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: #f1f5f9; padding: 2rem; }
.auth-card { width: 100%; max-width: 450px; background: white; padding: 3rem; border-radius: 24px; box-shadow: var(--shadow-lg); }
.login-header { text-align: center; margin-bottom: 2rem; }
.login-header i { width: 48px; height: 48px; color: var(--primary); margin-bottom: 1rem; }
.login-header h2 { font-size: 1.5rem; font-weight: 700; margin-bottom: 0.5rem; }

.auth-divider { display: flex; align-items: center; text-align: center; margin: 1.5rem 0; color: var(--text-muted); font-size: 0.875rem; }
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; border-bottom: 1px solid var(--border); }
.auth-divider span { padding: 0 1rem; }

.google-btn { display: flex; align-items: center; justify-content: center; gap: 0.75rem; background: white; border: 1px solid var(--border); color: var(--text-main); font-weight: 600; width: 100%; padding: 0.625rem; border-radius: 8px; cursor: pointer; transition: background 0.2s; }
.google-btn:hover { background: #f8fafc; }

/* Dashboard Mockup Styling */
.dashboard-mockup { background: #ffffff; border: 12px solid #1e293b; border-radius: 30px; height: 400px; box-shadow: 0 40px 80px -15px rgba(0, 0, 0, 0.3); display: flex; overflow: hidden; max-width: 800px; margin: 0 auto; }
.mockup-side { width: 60px; background: #334155; }
.mockup-body { flex: 1; padding: 1.5rem; display: flex; flex-direction: column; gap: 1.5rem; background: #f8fafc; }
.mockup-top { height: 24px; background: #e2e8f0; width: 40%; border-radius: 6px; }
.mockup-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.m-stat { height: 60px; border-radius: 12px; }
.mockup-list { display: flex; flex-direction: column; gap: 0.75rem; }
.m-row { height: 32px; background: white; border: 1px solid #e2e8f0; border-radius: 8px; width: 100%; }

