:root {
    --bg-color: #0f172a;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --glass-bg: rgba(30, 41, 59, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    --accent: #3b82f6;
    --accent-hover: #2563eb;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
}

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

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

.background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.4;
}

.blob-1 {
    top: -10%;
    left: -10%;
    width: 50vw;
    height: 50vw;
    background: #3b82f6;
    animation: float 20s infinite ease-in-out alternate;
}

.blob-2 {
    bottom: -10%;
    right: -10%;
    width: 40vw;
    height: 40vw;
    background: #8b5cf6;
    animation: float 15s infinite ease-in-out alternate-reverse;
}

@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(50px, 50px) scale(1.1); }
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

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

.header-actions {
    display: flex;
    align-items: center;
}

header h1 {
    font-weight: 600;
    font-size: 1.5rem;
}

.badge {
    padding: 0.4rem 1rem;
    border-radius: 9999px;
    font-size: 0.8rem;
    font-weight: 600;
    background: var(--glass-border);
    display: inline-block;
}

.badge.connected { background: rgba(16, 185, 129, 0.2); color: var(--success); }
.badge.disconnected { background: rgba(239, 68, 68, 0.2); color: var(--danger); }
.badge.qr_ready { background: rgba(245, 158, 11, 0.2); color: var(--warning); }

.hidden { display: none !important; }

#qr-section {
    text-align: center;
    margin-bottom: 2rem;
}

#qr-container {
    margin-top: 1rem;
    padding: 1rem;
    background: white;
    display: inline-block;
    border-radius: 8px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    transition: transform 0.2s;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-card h3 {
    color: var(--text-muted);
    font-size: 1rem;
    font-weight: 400;
    margin-bottom: 0.5rem;
}

.stat-card p {
    font-size: 3rem;
    font-weight: 600;
}

.content-tabs {
    padding: 0;
    overflow: hidden;
}

.tab-buttons {
    display: flex;
    border-bottom: 1px solid var(--glass-border);
}

.tab-btn {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 1rem;
    font-family: inherit;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s;
}

.tab-btn:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.05);
}

.tab-btn.active {
    color: var(--text-main);
    border-bottom: 2px solid var(--accent);
    background: rgba(59, 130, 246, 0.1);
}

.tab-content {
    display: none;
    padding: 1.5rem;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

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

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

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

th, td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--glass-border);
}

th {
    color: var(--text-muted);
    font-weight: 400;
}

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

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-muted);
}

textarea {
    width: 100%;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: var(--text-main);
    padding: 1rem;
    font-family: inherit;
    font-size: 1rem;
    resize: vertical;
    transition: all 0.3s ease;
}

input[type="text"],
input[type="number"],
input[type="date"],
select {
    transition: all 0.3s ease;
}

input[type="text"]:focus,
input[type="number"]:focus,
input[type="date"]:focus,
select:focus,
textarea:focus {
    outline: none !important;
    border-color: var(--accent) !important;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25) !important;
}

.btn-primary {
    background: var(--accent);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-family: inherit;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-primary:hover {
    background: var(--accent-hover);
}

.alert {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 8px;
    background: rgba(16, 185, 129, 0.2);
    color: var(--success);
    border: 1px solid var(--success);
}

/* ===================================================
   Mobile Responsiveness & Responsive Layout Layer
   =================================================== */

@media (max-width: 768px) {
    /* 1. Container & Padding Adjustments */
    .container {
        padding: 0.75rem !important;
    }
    
    header {
        flex-direction: column !important;
        align-items: stretch !important;
        text-align: center !important;
        gap: 1rem !important;
    }
    
    header h1 {
        font-size: 1.3rem !important;
    }
    
    .header-actions {
        justify-content: center !important;
        flex-wrap: wrap !important;
        gap: 0.5rem !important;
    }
    
    #btn-disconnect {
        margin-left: 0 !important;
        width: 100% !important;
    }
    
    /* 2. Compact 2-Column Stats Grid */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.75rem !important;
        margin-bottom: 1.5rem !important;
    }
    
    .stat-card {
        padding: 1rem !important;
    }
    
    .stat-card h3 {
        font-size: 0.85rem !important;
    }
    
    .stat-card p {
        font-size: 1.75rem !important;
    }
    
    /* 3. Horizontal Swipeable Tab Navigation */
    .tab-buttons {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        display: flex !important;
        flex-wrap: nowrap !important;
        border-bottom: 1px solid var(--glass-border) !important;
        scrollbar-width: thin !important; /* Elegant thin scrollbar on Firefox */
        scrollbar-color: var(--accent) rgba(255, 255, 255, 0.03) !important;
        padding-bottom: 4px !important; /* Space for scrollbar */
    }
    
    .tab-buttons::-webkit-scrollbar {
        display: block !important;
        height: 4px !important; /* Thin 4px scrollbar */
    }
    
    .tab-buttons::-webkit-scrollbar-track {
        background: rgba(255, 255, 255, 0.03) !important;
        border-radius: 9999px !important;
    }
    
    .tab-buttons::-webkit-scrollbar-thumb {
        background: var(--accent) !important;
        border-radius: 9999px !important;
    }
    
    .tab-btn {
        flex: 0 0 auto !important;
        padding: 0.85rem 1.25rem !important;
        font-size: 0.9rem !important;
        white-space: nowrap !important;
    }
    
    .tab-content {
        padding: 1rem 0.5rem !important;
    }
    
    /* 4. Form Auto-Stacking (Flex Row to Column) */
    form div[style*="display: flex"],
    #repair-form div[style*="display: flex"],
    #payment-form div[style*="display: flex"],
    #bulk-settings-form div[style*="display: flex"] {
        flex-direction: column !important;
        gap: 1rem !important;
    }
    
    form div[style*="flex:"],
    form div[style*="flex-grow:"],
    .form-group[style*="flex:"] {
        flex: none !important;
        width: 100% !important;
    }
    
    /* 5. Grid Split Stacking (e.g. Salary & Payouts split) */
    div[style*="display: grid"][style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
        gap: 1.5rem !important;
    }
    
    /* 6. Touch Friendly Buttons */
    .btn-primary {
        width: 100% !important;
        padding: 0.85rem 1.5rem !important;
        text-align: center !important;
    }
    
    .status-filters {
        width: 100% !important;
        justify-content: space-between !important;
    }
    
    .status-filters button {
        flex: 1 1 auto !important;
        font-size: 0.8rem !important;
        padding: 0.5rem 0.25rem !important;
    }
    
    #repair-search {
        width: 100% !important;
        margin-top: 0.5rem !important;
    }
    
    #btn-toggle-bulk, #btn-reset-bulk {
        width: 100% !important;
    }
    
    #bulk-settings-form span.badge {
        margin-left: 0 !important;
        width: 100% !important;
        text-align: center !important;
        padding: 0.6rem !important;
    }
    
    /* Crypto tab tweaks */
    #crypto-form div[style*="display: flex"] {
        flex-direction: column !important;
        gap: 0.5rem !important;
    }

    /* 7. Flex Header Containers Stacking */
    div[style*="display: flex"][style*="justify-content: space-between"] {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 0.75rem !important;
        text-align: center !important;
    }
}

@media (max-width: 480px) {
    /* For extra tight screens */
    .stat-card p {
        font-size: 1.5rem !important;
    }
    th, td {
        padding: 0.6rem !important;
        font-size: 0.8rem !important;
    }
}

/* ===================================================
   Local Network File Share Section
   =================================================== */
#drop-zone.dragover {
    border-color: var(--success) !important;
    background: rgba(16, 185, 129, 0.1) !important;
    transform: scale(1.02);
}

.copy-link-btn {
    background: rgba(59, 130, 246, 0.2);
    color: #93c5fd;
    border: 1px solid rgba(59, 130, 246, 0.4);
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
    margin-right: 0.4rem;
}

.copy-link-btn:hover {
    background: var(--accent);
    color: white;
}

.delete-file-btn {
    background: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.4);
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
}

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


/* ===================================================
   Collapsible Left Sidebar Dashboard Layout
   =================================================== */
.dashboard-container {
    display: flex;
    max-width: 1600px;
    margin: 0 auto;
    padding: 2rem;
    gap: 2rem;
    min-height: 100vh;
}

/* Sidebar styling (Slide-out drawer on all screen sizes) */
.sidebar {
    width: 290px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    padding: 2rem 1.5rem !important;
    height: 100vh;
    position: fixed;
    top: 0;
    left: -330px; /* Off-screen by default */
    z-index: 9999;
    overflow-y: auto;
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 15px 0 35px rgba(0, 0, 0, 0.6);
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 0;
    scrollbar-width: none; /* Hide scrollbar in Firefox */
}

.sidebar.active {
    left: 0; /* Slide in when toggled */
}

.sidebar::-webkit-scrollbar {
    display: none; /* Hide scrollbar in Chrome/Safari */
}

.sidebar-header {
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 1.5rem;
}

.sidebar-header h2 {
    font-size: 1.6rem;
    font-weight: 600;
    color: var(--text-main);
    background: linear-gradient(135deg, var(--text-main) 30%, #a78bfa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.sidebar-sub {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.nav-section {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.nav-section-title {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: 0.4rem;
    padding-left: 0.75rem;
    opacity: 0.7;
}

/* Reset tab button style for Sidebar placement */
.sidebar-nav .tab-btn {
    text-align: left;
    padding: 0.75rem 1rem !important;
    border-radius: 10px;
    font-size: 0.95rem;
    color: var(--text-muted);
    background: transparent;
    border: 1px solid transparent !important;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    width: 100%;
    display: block;
    margin: 0 !important;
}

.sidebar-nav .tab-btn:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.05);
    transform: translateX(3px);
}

.sidebar-nav .tab-btn.active {
    color: var(--text-main);
    background: rgba(59, 130, 246, 0.15);
    border: 1px solid rgba(59, 130, 246, 0.25) !important;
    font-weight: 600;
}

.main-content {
    flex: 1;
    min-width: 0;
    width: 100%;
}

/* Toggle Menu Button styles */
.btn-sidebar-toggle {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--glass-border);
    color: white;
    font-size: 1.4rem;
    padding: 0.4rem 0.8rem;
    border-radius: 8px;
    cursor: pointer;
    margin-right: 0.5rem;
    transition: all 0.2s;
}

.btn-sidebar-toggle:hover {
    background: rgba(255, 255, 255, 0.12);
}

/* ===================================================
   Tablet & Mobile Adaptations for Sidebar
   =================================================== */
@media (max-width: 992px) {
    .dashboard-container {
        flex-direction: column;
        padding: 1rem;
        gap: 1rem;
    }
    
    .sidebar {
        position: fixed;
        top: 0;
        left: -320px; /* Hidden initially */
        width: 290px;
        height: 100vh;
        z-index: 9999;
        transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        border-radius: 0;
        box-shadow: 15px 0 35px rgba(0, 0, 0, 0.6);
        background: rgba(15, 23, 42, 0.95);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
    }
    
    .sidebar.active {
        left: 0; /* Slide in! */
    }
    
    .main-content {
        width: 100%;
    }
    
    .btn-sidebar-toggle {
        display: block; /* Show hamburger button */
    }
}

/* ===================================================
   Premium Glassmorphic Toggle Switch Styling
   =================================================== */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 32px;
    flex-shrink: 0;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-switch .slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: .4s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 34px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

.toggle-switch .slider:before {
    position: absolute;
    content: "";
    height: 24px;
    width: 24px;
    left: 3px;
    bottom: 3px;
    background-color: #94a3b8;
    transition: .4s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 50%;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
}

.toggle-switch input:checked + .slider {
    background-color: rgba(16, 185, 129, 0.25);
    border-color: rgba(16, 185, 129, 0.5);
}

.toggle-switch input:checked + .slider:before {
    transform: translateX(28px);
    background-color: #10b981;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.6);
}

/* ===================================================
   AI Learned Rules UI Premium Aesthetics & Transitions
   =================================================== */
.rule-table-row {
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.rule-table-row:hover {
    background: rgba(255, 255, 255, 0.02) !important;
    box-shadow: inset 4px 0 0 var(--accent);
}

.delete-rule-btn {
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.delete-rule-btn:hover {
    background: var(--danger) !important;
    color: white !important;
    border-color: var(--danger) !important;
    transform: scale(1.08);
    box-shadow: 0 0 12px rgba(239, 68, 68, 0.5);
}

.context-preview {
    transition: all 0.2s ease;
}

.context-preview:hover {
    transform: translateY(-1px);
}

.empty-state-card {
    transition: all 0.3s ease;
}

.empty-state-card:hover {
    border-color: rgba(59, 130, 246, 0.4) !important;
    background: rgba(255, 255, 255, 0.02) !important;
}

@keyframes slideIn {
    from {
        transform: translateY(20px) scale(0.95);
        opacity: 0;
    }
    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ===================================================
   POS System Custom Premium Aesthetics & Layouts
   =================================================== */
.pos-billing-layout {
    display: grid;
    grid-template-columns: 1fr 1.4fr;
    gap: 1.5rem;
    align-items: start;
}

@media (max-width: 1200px) {
    .pos-billing-layout {
        grid-template-columns: 1fr;
    }
}

.pos-cart-panel {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-height: 600px;
}

.pos-cart-header {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.pos-select, .pos-input, .pos-summary-input, .pos-input-date {
    padding: 0.75rem;
    border-radius: 8px;
    border: 1px solid var(--glass-border);
    background: rgba(0, 0, 0, 0.3);
    color: white;
    font-family: inherit;
    font-size: 0.95rem;
    outline: none;
    transition: all 0.2s;
}

.pos-select:focus, .pos-input:focus, .pos-summary-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 8px rgba(59, 130, 246, 0.4);
}

.pos-select {
    cursor: pointer;
    background-image: linear-gradient(45deg, transparent 50%, #fff 50%), linear-gradient(135deg, #fff 50%, transparent 50%);
    background-position: calc(100% - 20px) calc(1em + 2px), calc(100% - 15px) calc(1em + 2px);
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
    appearance: none;
    padding-right: 2.5rem;
}

.pos-btn-icon {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    color: var(--text-muted);
    border-radius: 8px;
    padding: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pos-btn-icon:hover {
    background: rgba(255, 59, 48, 0.2);
    color: var(--danger);
    border-color: rgba(255, 59, 48, 0.4);
}

.pos-cart-table-container {
    max-height: 350px;
    overflow-y: auto;
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.15);
}

.pos-cart-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    text-align: left;
}

.pos-cart-table th, .pos-cart-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    vertical-align: middle;
}

.pos-cart-table th {
    background: rgba(255, 255, 255, 0.02);
    color: var(--text-muted);
    font-weight: 600;
}

.pos-cart-qty-input, .pos-cart-disc-input {
    width: 60px;
    padding: 0.4rem;
    border-radius: 6px;
    border: 1px solid var(--glass-border);
    background: rgba(0,0,0,0.4);
    color: white;
    text-align: center;
    outline: none;
}

.pos-cart-qty-input:focus, .pos-cart-disc-input:focus {
    border-color: var(--accent);
}

.pos-cart-summary {
    border-top: 1px solid var(--glass-border);
    padding-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.pos-summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.95rem;
    color: var(--text-muted);
}

.pos-summary-row strong {
    color: white;
}

.pos-summary-input {
    width: 80px;
    padding: 0.4rem;
    text-align: right;
    margin-left: 0.5rem;
}

.pos-payable-banner {
    background: linear-gradient(135deg, rgba(147, 51, 234, 0.15), rgba(79, 70, 229, 0.15));
    border: 1px solid rgba(147, 51, 234, 0.3);
    padding: 1.25rem;
    border-radius: 12px;
    text-align: center;
    font-size: 1.3rem;
    font-weight: 600;
    color: white;
    margin: 0.5rem 0;
    letter-spacing: 0.5px;
}

.pos-payable-amount {
    color: #e9d5ff;
    font-size: 1.8rem;
    font-weight: 700;
    margin-left: 0.5rem;
    text-shadow: 0 0 10px rgba(168, 85, 247, 0.4);
}

.pos-cart-actions {
    display: grid;
    grid-template-columns: 1fr 1fr 1.5fr;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.pos-btn {
    padding: 0.85rem;
    border-radius: 8px;
    border: none;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
}

.pos-btn-danger { background: rgba(239, 68, 68, 0.2); color: #fca5a5; border: 1px solid rgba(239, 68, 68, 0.4); }
.pos-btn-danger:hover { background: #ef4444; color: white; }

.pos-btn-warning { background: rgba(245, 158, 11, 0.2); color: #fde047; border: 1px solid rgba(245, 158, 11, 0.4); }
.pos-btn-warning:hover { background: #f59e0b; color: black; }

.pos-btn-success { background: rgba(16, 185, 129, 0.2); color: #a7f3d0; border: 1px solid rgba(16, 185, 129, 0.4); }
.pos-btn-success:hover { background: #10b981; color: white; }

.pos-products-panel {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.pos-filter-bar {
    display: flex;
    gap: 0.5rem;
}

.pos-catalogue-container {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 1rem;
    min-height: 500px;
}

@media (max-width: 768px) {
    .pos-catalogue-container {
        grid-template-columns: 1fr;
    }
}

.pos-categories-sidebar {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    max-height: 500px;
    overflow-y: auto;
    padding-right: 0.25rem;
}

.pos-category-btn {
    padding: 0.8rem;
    border-radius: 8px;
    border: 1px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.02);
    color: var(--text-muted);
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s;
}

.pos-category-btn:hover {
    color: white;
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.2);
}

.pos-category-btn.active {
    color: white;
    background: #6366f1;
    border-color: #818cf8;
    box-shadow: 0 0 12px rgba(99, 102, 241, 0.4);
}

.pos-products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 0.75rem;
    max-height: 500px;
    overflow-y: auto;
    padding-right: 0.25rem;
    align-content: start;
}

.pos-product-card {
    background: rgba(30, 41, 59, 0.45);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 0.85rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.pos-product-card:hover {
    transform: translateY(-4px);
    background: rgba(30, 41, 59, 0.7);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 16px rgba(0,0,0,0.3);
}

.pos-prod-icon-wrapper {
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    color: var(--accent);
}

.pos-prod-title {
    font-size: 0.85rem;
    font-weight: 600;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pos-prod-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    margin-top: auto;
}

.pos-prod-stock {
    color: var(--text-muted);
}

.pos-prod-stock.low-stock {
    color: var(--danger);
    font-weight: 600;
}

.pos-prod-price {
    font-weight: 700;
    color: white;
}

/* MODALS */
.pos-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    transition: opacity 0.2s ease-in-out;
}

.pos-modal.hidden {
    display: none !important;
}

.pos-modal-content {
    animation: slideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
}

.pos-input-date {
    background: rgba(0,0,0,0.4);
}

/* Scrollbar Styles */
.pos-cart-table-container::-webkit-scrollbar,
.pos-categories-sidebar::-webkit-scrollbar,
.pos-products-grid::-webkit-scrollbar {
    width: 5px;
}

.pos-cart-table-container::-webkit-scrollbar-thumb,
.pos-categories-sidebar::-webkit-scrollbar-thumb,
.pos-products-grid::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

/* Sleek Glassmorphic Login Form UI */
.login-container {
    background: rgba(30, 41, 59, 0.65) !important;
    backdrop-filter: blur(25px) !important;
    -webkit-backdrop-filter: blur(25px) !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    position: relative;
    z-index: 100;
}
.login-container::before {
    content: '';
    position: absolute;
    top: -50px;
    right: -50px;
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--accent) 0%, transparent 70%);
    opacity: 0.35;
    filter: blur(10px);
    z-index: -1;
}
.login-container::after {
    content: '';
    position: absolute;
    bottom: -50px;
}

/* Responsive Grid Layout for Login & Public Portal */
.portal-container {
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
    padding: 2.5rem 1rem;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

.portal-grid {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 2rem;
    width: 100%;
    align-items: stretch;
}

/* Authentication Card styling */
.auth-card {
    padding: 2.5rem !important;
    border-radius: 20px !important;
    background: rgba(30, 41, 59, 0.65) !important;
    backdrop-filter: blur(25px) !important;
    -webkit-backdrop-filter: blur(25px) !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    box-shadow: 0 20px 50px rgba(0,0,0,0.4) !important;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.auth-card::before {
    content: '';
    position: absolute;
    top: -50px;
    right: -50px;
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--accent) 0%, transparent 70%);
    opacity: 0.35;
    filter: blur(10px);
    z-index: -1;
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.portal-title {
    font-size: 2rem;
    font-weight: 600;
    background: linear-gradient(135deg, #fff 30%, #a78bfa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.25rem;
}

.portal-subtitle {
    color: var(--text-muted);
    margin-top: 0.5rem;
    font-size: 0.95rem;
}

.auth-btn {
    width: 100%;
    padding: 0.85rem !important;
    margin-top: 1rem;
    font-weight: 600;
    font-size: 1.05rem;
    border-radius: 8px !important;
    transition: all 0.3s ease !important;
}

/* Public Files Card Styling */
.public-files-card {
    padding: 2.5rem !important;
    border-radius: 20px !important;
    background: rgba(30, 41, 59, 0.55) !important;
    backdrop-filter: blur(25px) !important;
    -webkit-backdrop-filter: blur(25px) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    box-shadow: 0 20px 50px rgba(0,0,0,0.4) !important;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

.public-files-card::before {
    content: '';
    position: absolute;
    bottom: -50px;
    left: -50px;
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: radial-gradient(circle, #8b5cf6 0%, transparent 70%);
    opacity: 0.3;
    filter: blur(10px);
    z-index: -1;
}

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

.files-header .section-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-main);
    margin: 0;
}

.btn-refresh {
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--accent);
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.2);
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    transition: all 0.3s ease;
    user-select: none;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.btn-refresh:hover {
    background: rgba(59, 130, 246, 0.2);
}

/* Search bar styling */
.search-container {
    margin-bottom: 1.25rem;
}

.search-container input {
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    border: 1px solid var(--glass-border);
    background: rgba(0, 0, 0, 0.3);
    color: white;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.search-container input:focus {
    border-color: var(--accent);
    outline: none;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
}

/* Files List Container */
.files-list-wrapper {
    flex: 1;
    overflow-y: auto;
    max-height: 250px;
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.2);
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.1) transparent;
}

.files-list-wrapper::-webkit-scrollbar {
    width: 6px;
}

.files-list-wrapper::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

#public-files-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

#public-files-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem !important;
    border-bottom: 1px solid var(--glass-border) !important;
    transition: background 0.2s ease;
    gap: 1rem;
}

#public-files-list li:last-child {
    border-bottom: none !important;
}

#public-files-list li:hover {
    background: rgba(255, 255, 255, 0.04);
}

#public-no-files {
    text-align: center;
    padding: 2.5rem 1.5rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Mobile Responsive Adjustments */
@media (max-width: 768px) {
    .portal-container {
        padding: 2rem 1rem;
        align-items: flex-start;
        min-height: auto;
    }
    
    .portal-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .auth-card, .public-files-card {
        padding: 1.75rem !important;
        border-radius: 16px !important;
    }
    
    .portal-title {
        font-size: 1.75rem;
    }
    
    .files-list-wrapper {
        max-height: 350px; /* Give more height on mobile since it is stacked */
    }

    #public-files-list li {
        padding: 0.75rem 0.85rem !important;
    }
}

/* ========================================================
   BUS DELIVERY MANAGER STYLES
   ======================================================== */
.bus-layout-grid {
    display: grid;
    grid-template-columns: 1.15fr 1fr;
    gap: 2rem;
}

@media (max-width: 960px) {
    .bus-layout-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

.bus-customer-chip:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(124, 77, 255, 0.25);
    background: rgba(124, 77, 255, 0.25) !important;
    border-color: rgba(124, 77, 255, 0.5) !important;
}

.bus-customer-chip.selected {
    box-shadow: 0 4px 15px rgba(124, 77, 255, 0.4);
}

.btn-quick-eta:hover {
    background: rgba(255, 255, 255, 0.15) !important;
    border-color: rgba(255, 255, 255, 0.3) !important;
    transform: translateY(-1px);
}

/* ========================================================
   MOBILE-FIRST APP TILES GRID DASHBOARD
   ======================================================== */
.app-tiles-view {
    margin-bottom: 2rem;
    animation: fadeIn 0.3s ease;
}

.tiles-header {
    margin-bottom: 1.5rem;
}

.tiles-greeting {
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    margin: 0;
}

.tiles-sub {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.app-tiles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1.25rem;
}

.app-tile-card {
    background: rgba(30, 41, 59, 0.65);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 1.25rem;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    position: relative;
    overflow: hidden;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.app-tile-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--tile-accent, #3b82f6);
    opacity: 0.8;
    transition: height 0.25s ease;
}

.app-tile-card:hover {
    transform: translateY(-4px);
    background: rgba(30, 41, 59, 0.85);
    border-color: rgba(255, 255, 255, 0.25);
    box-shadow: 0 12px 25px -5px rgba(0, 0, 0, 0.5), 0 0 15px -3px var(--tile-glow, rgba(59, 130, 246, 0.3));
}

.app-tile-card:hover::before {
    height: 6px;
}

.app-tile-card:active {
    transform: scale(0.97);
}

.tile-icon-box {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: var(--tile-bg, rgba(255, 255, 255, 0.08));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.tile-info h3 {
    font-size: 1.15rem;
    font-weight: 700;
    color: #fff;
    margin: 0;
}

.tile-info p {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin: 0.25rem 0 0.5rem 0;
    line-height: 1.3;
}

.tile-badge {
    display: inline-block;
    padding: 0.2rem 0.55rem;
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 600;
    background: var(--tile-badge-bg, rgba(255, 255, 255, 0.08));
    color: var(--tile-badge-color, #94a3b8);
    border: 1px solid var(--tile-badge-border, rgba(255, 255, 255, 0.1));
}

/* Individual Tile Themes */
.tile-bus {
    --tile-accent: #7c4dff;
    --tile-glow: rgba(124, 77, 255, 0.4);
    --tile-bg: rgba(124, 77, 255, 0.2);
    --tile-badge-bg: rgba(124, 77, 255, 0.15);
    --tile-badge-color: #b388ff;
    --tile-badge-border: rgba(124, 77, 255, 0.3);
}

.tile-salary {
    --tile-accent: #10b981;
    --tile-glow: rgba(16, 185, 129, 0.4);
    --tile-bg: rgba(16, 185, 129, 0.2);
    --tile-badge-bg: rgba(16, 185, 129, 0.15);
    --tile-badge-color: #6ee7b7;
    --tile-badge-border: rgba(16, 185, 129, 0.3);
}

.tile-repairs {
    --tile-accent: #f59e0b;
    --tile-glow: rgba(245, 158, 11, 0.4);
    --tile-bg: rgba(245, 158, 11, 0.2);
    --tile-badge-bg: rgba(245, 158, 11, 0.15);
    --tile-badge-color: #fcd34d;
    --tile-badge-border: rgba(245, 158, 11, 0.3);
}

.tile-kirama {
    --tile-accent: #0284c7;
    --tile-glow: rgba(2, 132, 199, 0.4);
    --tile-bg: rgba(2, 132, 199, 0.2);
    --tile-badge-bg: rgba(2, 132, 199, 0.15);
    --tile-badge-color: #7dd3fc;
    --tile-badge-border: rgba(2, 132, 199, 0.3);
}

.tile-walasmulla {
    --tile-accent: #3b82f6;
    --tile-glow: rgba(59, 130, 246, 0.4);
    --tile-bg: rgba(59, 130, 246, 0.2);
    --tile-badge-bg: rgba(59, 130, 246, 0.15);
    --tile-badge-color: #93c5fd;
    --tile-badge-border: rgba(59, 130, 246, 0.3);
}

.tile-homespend {
    --tile-accent: #f43f5e;
    --tile-glow: rgba(244, 63, 94, 0.4);
    --tile-bg: rgba(244, 63, 94, 0.2);
    --tile-badge-bg: rgba(244, 63, 94, 0.15);
    --tile-badge-color: #fda4af;
    --tile-badge-border: rgba(244, 63, 94, 0.3);
}

.tile-invoice {
    --tile-accent: #a855f7;
    --tile-glow: rgba(168, 85, 247, 0.4);
    --tile-bg: rgba(168, 85, 247, 0.2);
    --tile-badge-bg: rgba(168, 85, 247, 0.15);
    --tile-badge-color: #d8b4fe;
    --tile-badge-border: rgba(168, 85, 247, 0.3);
}

.tile-store {
    --tile-accent: #0d9488;
    --tile-glow: rgba(13, 148, 136, 0.4);
    --tile-bg: rgba(13, 148, 136, 0.2);
    --tile-badge-bg: rgba(13, 148, 136, 0.15);
    --tile-badge-color: #5eead4;
    --tile-badge-border: rgba(13, 148, 136, 0.3);
}

.tile-bulk {
    --tile-accent: #ea580c;
    --tile-glow: rgba(234, 88, 12, 0.4);
    --tile-bg: rgba(234, 88, 12, 0.2);
    --tile-badge-bg: rgba(234, 88, 12, 0.15);
    --tile-badge-color: #fdba74;
    --tile-badge-border: rgba(234, 88, 12, 0.3);
}

.tile-trading {
    --tile-accent: #eab308;
    --tile-glow: rgba(234, 179, 8, 0.4);
    --tile-bg: rgba(234, 179, 8, 0.2);
    --tile-badge-bg: rgba(234, 179, 8, 0.15);
    --tile-badge-color: #fde047;
    --tile-badge-border: rgba(234, 179, 8, 0.3);
}

.tile-followups {
    --tile-accent: #059669;
    --tile-glow: rgba(5, 150, 105, 0.4);
    --tile-bg: rgba(5, 150, 105, 0.2);
    --tile-badge-bg: rgba(5, 150, 105, 0.15);
    --tile-badge-color: #6ee7b7;
    --tile-badge-border: rgba(5, 150, 105, 0.3);
}

.tile-settings {
    --tile-accent: #64748b;
    --tile-glow: rgba(100, 116, 139, 0.4);
    --tile-bg: rgba(100, 116, 139, 0.2);
    --tile-badge-bg: rgba(100, 116, 139, 0.15);
    --tile-badge-color: #cbd5e1;
    --tile-badge-border: rgba(100, 116, 139, 0.3);
}

/* Mobile responsive app grid */
@media (max-width: 680px) {
    .app-tiles-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
    .app-tile-card {
        padding: 0.9rem;
        border-radius: 12px;
    }
    .tile-icon-box {
        width: 38px;
        height: 38px;
        font-size: 1.3rem;
    }
    .tile-info h3 {
        font-size: 0.95rem;
    }
    .tile-info p {
        font-size: 0.75rem;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
    .tile-badge {
        font-size: 0.65rem;
        padding: 0.15rem 0.4rem;
    }
}
