:root {
    --bg-dark: #020617;
    /* slate-950 */
    --bg-card: rgba(255, 255, 255, 0.05);
    /* white/5 */
    --border-color: rgba(255, 255, 255, 0.1);
    /* border-white/10 */
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --accent: #f59e0b;
    /* Amber */
    --accent-hover: #fbbf24;
    --accent-glow: rgba(245, 158, 11, 0.3);
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --sidebar-width: 280px;
    --transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    --glass-blur: blur(16px);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.5;
    overflow: hidden;
    height: 100vh;
}

/* Background Decoration */
.bg-decoration {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.1;
}

.blob-1 {
    width: 600px;
    height: 600px;
    background: var(--accent);
    top: -200px;
    left: -200px;
}

.blob-2 {
    width: 500px;
    height: 500px;
    background: var(--success);
    bottom: -200px;
    right: -200px;
}

/* App Layout */
.app-container {
    display: flex;
    height: 100vh;
    width: 100vw;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-card);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    transition: transform 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    z-index: 100;
}

.sidebar.hidden {
    transform: translateX(-100%);
    position: absolute;
}

.sidebar-header {
    padding: 40px 25px 30px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -1px;
}

.logo-icon {
    color: var(--accent);
    filter: drop-shadow(0 0 10px var(--accent-glow));
}

.sidebar-nav {
    flex: 1;
    padding: 0 15px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    text-decoration: none;
    color: var(--text-secondary);
    border-radius: 99px;
    /* PILL */
    transition: var(--transition);
    font-size: 0.95rem;
    font-weight: 500;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.nav-item.active {
    background: var(--bg-card);
    color: var(--accent);
    border: 1px solid rgba(245, 158, 11, 0.2);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.sidebar-footer {
    padding: 25px;
    border-top: 1px solid var(--border-color);
}

.logout-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px;
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    border-radius: 99px;
    /* PILL */
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition);
}

.logout-btn:hover {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    border-color: rgba(239, 68, 68, 0.2);
}

/* Main Content */
.main-content {
    flex: 1;
    overflow-y: auto;
    padding: 40px;
    transition: var(--transition);
    background: radial-gradient(circle at 50% 50%, rgba(245, 158, 11, 0.02) 0%, transparent 100%);
}

.main-content.full-width {
    width: 100%;
}

.view-container {
    max-width: 1400px;
    margin: 0 auto;
}

/* Auth Screens */
.auth-container {
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.auth-card {
    background: var(--bg-card);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-color);
    padding: 50px 40px;
    border-radius: 40px;
    width: 100%;
    max-width: 440px;
    box-shadow: 0 30px 60px -12px rgba(0, 0, 0, 0.6);
}

.auth-header {
    margin-bottom: 40px;
    text-align: center;
}

.auth-header h2 {
    font-size: 2.2rem;
    font-weight: 800;
    margin-bottom: 10px;
    letter-spacing: -1px;
}

.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    margin-bottom: 10px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.form-group input,
select {
    width: 100%;
    padding: 14px 20px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    color: #ffffff;
    font-family: inherit;
    transition: var(--transition);
}

.form-group input:focus {
    outline: none;
    border-color: var(--accent);
    background: rgba(0, 0, 0, 0.4);
    box-shadow: 0 0 15px rgba(245, 158, 11, 0.1);
}

.primary-btn {
    width: 100%;
    padding: 16px;
    background: var(--accent);
    border: none;
    border-radius: 99px;
    /* PILL */
    color: var(--bg-dark);
    font-weight: 800;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 10px 20px -5px var(--accent-glow);
}

.primary-btn:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 15px 30px -5px var(--accent-glow);
}

.primary-btn:disabled {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Table styling */
.table-container {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 32px;
    overflow: hidden;
}

table th {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* POS specific overrides for Pill look */
.add-purchase-item,
.product-item {
    border-radius: 24px !important;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
}

/* Notifications */
.notification {
    border-radius: 99px !important;
    /* PILL */
    padding: 12px 30px !important;
    backdrop-filter: blur(20px) !important;
    border: 1px solid var(--border-color) !important;
}

/* Mobile Menu Button */
.mobile-menu-btn {
    display: none;
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--accent);
    color: var(--bg-dark);
    border: none;
    box-shadow: 0 10px 25px var(--accent-glow);
    z-index: 1000;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.mobile-menu-btn:hover {
    transform: scale(1.1);
}

/* Overlay for mobile sidebar */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 90;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
    display: block;
    opacity: 1;
}

/* Responsiveness */
@media (max-width: 1024px) {

    .pos-view,
    .purchases-view {
        grid-template-columns: 1fr 350px !important;
    }
}

@media (max-width: 768px) {
    .mobile-menu-btn {
        display: flex;
    }

    .sidebar {
        position: fixed;
        height: 100vh;
        z-index: 100;
        box-shadow: 20px 0 50px rgba(0, 0, 0, 0.5);
    }

    .sidebar.mobile-open {
        transform: translateX(0);
    }

    .main-content {
        padding: 20px;
        width: 100%;
    }

    .pos-view,
    .purchases-view {
        grid-template-columns: 1fr !important;
        height: auto !important;
        gap: 20px !important;
    }

    .pos-cart {
        min-height: 500px;
    }

    .finances-view>div {
        grid-template-columns: 1fr !important;
    }

    .table-container {
        overflow-x: auto;
    }

    .auth-card {
        padding: 30px 20px;
        border-radius: 20px;
    }
}

/* Sidebar Global Styles (Gabanto Platform) */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    /* Added to separate left and right items */
    padding: 0 20px;
    z-index: 1000;
    background: transparent;
    transition: all 0.3s ease;
}

.navbar.scrolled {
    background: rgba(2, 6, 23, 0.82);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
}

.menu-toggle {
    width: 35px;
    /* Further reduced from 40px */
    height: 35px;
    /* Further reduced from 40px */
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.sidebar {
    position: fixed;
    top: 0;
    left: -320px;
    width: 320px;
    height: 100vh;
    background: rgba(2, 6, 23, 0.96);
    backdrop-filter: blur(40px);
    z-index: 2000;
    transition: cubic-bezier(0.4, 0, 0.2, 1) 0.5s;
    border-right: 1px solid var(--border-color);
    padding: 30px;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.sidebar.active {
    left: 0;
}

.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 1999;
    opacity: 0;
    visibility: hidden;
    transition: 0.5s;
}

.sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}

.sidebar-header {
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-header h3 {
    font-weight: 950;
    color: var(--accent);
    font-size: 1.1rem;
    letter-spacing: -0.5px;
}

.close-sidebar {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 5px;
}

.sidebar-section-title {
    padding: 15px 10px 8px;
    font-size: 0.65rem;
    font-weight: 800;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    opacity: 0.6;
}

.sidebar-item {
    padding: 8px 15px;
    border-radius: 12px;
    color: var(--text-primary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.8rem;
    font-weight: 600;
    transition: all 0.3s ease;
    margin-bottom: 2px;
    border: 1px solid transparent;
}

.sidebar-item i {
    width: 16px;
    height: 16px;
    color: var(--accent);
}

.sidebar-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--accent);
    border-color: rgba(245, 158, 11, 0.2);
    transform: translateX(5px);
}

.sidebar-footer {
    margin-top: auto;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.sidebar-btn {
    width: 100%;
    padding: 12px;
    background: var(--accent);
    color: var(--bg-dark);
    border-radius: 12px;
    text-align: center;
    text-decoration: none;
    font-weight: 800;
    font-size: 0.85rem;
    display: block;
    transition: all 0.3s ease;
}