@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
    --primary: #0056b3; --secondary: #20c997; --dark: #1a1e21; 
    --light: #f8f9fa; --danger: #dc3545; --warning: #ffc107; 
    --text-main: #334155; --border: #dee2e6;
}

* { 
    box-sizing: border-box; 
    margin: 0; padding: 0; 
    font-family: 'Inter', system-ui, sans-serif; 
}
    
body { 
    background-color: #f0f3f8; 
    color: var(--text-main); 
    height: 100vh; 
    display: flex; 
    overflow: hidden; 
    margin: 0;
}

/* ========================================================
   NEW VANILLA AUTHENTICATION SCREEN
======================================================== */

.auth-screen-wrapper { width: 100%; height: 100%; display: flex; justify-content: center; align-items: center; background-color: #f0f3f8; position: absolute; inset: 0; z-index: 50; }
.login-wrapper { display: flex; width: 1000px; max-width: 95%; background-color: #ffffff; border-radius: 16px; box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05); overflow: hidden; height: 760px; max-height: 92vh; margin: auto; }
.brand-panel { width: 50%; background-color: #f0f6ff; padding: 48px; display: flex; flex-direction: column; justify-content: center; }
.brand-logo { font-size: 1.5rem; font-weight: bold; color: #0f172a; margin-bottom: 15px; display: flex; align-items: center; gap: 12px; }
.brand-logo-icon { width: 40px; height: 40px; background-color: #2563eb; border-radius: 10px; display: flex; align-items: center; justify-content: center; color: white; box-shadow: 0 4px 6px rgba(37,99,235,0.2); }
.badge-system { display: inline-flex; align-items: center; gap: 8px; background: #ffffff; color: #1d4ed8; padding: 6px 14px; border-radius: 20px; font-size: 0.75rem; font-weight: 600; margin-bottom: 40px; width: fit-content; border: 1px solid #bfdbfe; box-shadow: 0 1px 2px rgba(0,0,0,0.05); }
.badge-dot { width: 6px; height: 6px; background-color: #2563eb; border-radius: 50%; }
.brand-panel h1 { font-size: 2rem; font-weight: 700; color: #0f172a; line-height: 1.2; margin-bottom: 15px; letter-spacing: -0.02em; }
.brand-panel p.subtitle { color: #475569; margin-bottom: 40px; font-size: 0.9rem; }
.feature { display: flex; align-items: flex-start; gap: 15px; margin-bottom: 25px; }
.feature-icon { width: 38px; height: 38px; background: #ffffff; border-radius: 8px; border: 1px solid #e2e8f0; display: flex; justify-content: center; align-items: center; color: #2563eb; font-size: 1rem; flex-shrink: 0; }

.form-panel { width: 50%; padding: 48px; display: flex; flex-direction: column; position: relative; }
.toggle-btns { display: flex; background: #f1f5f9; border-radius: 8px; margin-bottom: 30px; padding: 4px; }
.toggle-btns button { flex: 1; padding: 10px; border: none; border-radius: 6px; font-size: 0.9rem; font-weight: 600; cursor: pointer; transition: all 0.2s; background: transparent; color: #64748b; }
.toggle-btns button:hover:not(.active) { color: #334155; }
.toggle-btns button.active { background: #2563eb !important; color: white !important; box-shadow: 0 1px 3px rgba(0,0,0,0.1); }
.form-section { display: flex; flex-direction: column; flex: 1; justify-content: center;}
.form-section.hidden { display: none !important; }
.form-section h2 { font-size: 1.8rem; font-weight: 700; color: #0f172a; margin-bottom: 5px; }
.form-section p.auth-sub { font-size: 0.9rem; color: #475569; margin-bottom: 25px; }

/* Password Checklist Styles */
.req-unmet { color: #94a3b8; transition: color 0.2s; }
.req-unmet i { color: #dc2626; }
.req-met { color: #16a34a; transition: color 0.2s; }
.req-met i { color: #16a34a; }

/* ========================================================
   RESTORED ORIGINAL RIGHT PANEL (Auth Forms)
======================================================== */

.right-panel { width: 50%; padding: 48px; background-color: #ffffff; display: flex; flex-direction: column; justify-content: center; overflow-y: auto; }
.right-panel::-webkit-scrollbar { width: 6px; }
.right-panel::-webkit-scrollbar-thumb { background-color: #cbd5e1; border-radius: 10px; }

.auth-tabs { display: flex; background-color: #f1f5f9; border-radius: 10px; padding: 4px; margin-bottom: 40px; }
.tab-btn { flex: 1; padding: 12px; border: none; border-radius: 8px; font-size: 14px; font-weight: 600; cursor: pointer; transition: all 0.3s ease; background-color: transparent; color: #64748b; }
#tab-login.active { background-color: #2563eb; color: white; box-shadow: 0 2px 10px rgba(37, 99, 235, 0.2); }
#tab-signup.active { background-color: #0f766e; color: white; box-shadow: 0 2px 10px rgba(15, 118, 110, 0.2); }

.form-heading { font-size: 28px; font-weight: 700; color: #0f172a; margin-bottom: 8px; }
.form-subheading { font-size: 14px; color: #64748b; margin-bottom: 30px; }

.form-group-auth { margin-bottom: 20px; }
.form-group-auth label { display: block; font-size: 11px; font-weight: 700; color: #475569; margin-bottom: 8px; letter-spacing: 0.5px; }

.input-wrapper { position: relative; display: flex; align-items: center; }
.input-icon { position: absolute; left: 15px; color: #94a3b8; font-size: 14px; }
.toggle-password { position: absolute; right: 15px; color: #94a3b8; cursor: pointer; font-size: 14px; }

.input-wrapper input { width: 100%; padding: 12px 15px 12px 40px !important; border: 1px solid #cbd5e1; border-radius: 8px; font-size: 14px; color: #334155; outline: none; transition: border-color 0.2s; box-sizing: border-box; }
.input-wrapper input[type="password"] { padding-right: 40px !important; }
.input-wrapper input:focus { border-color: #3b82f6; }

.form-row { display: flex; gap: 15px; margin-bottom: 20px;}
.form-row input { padding: 12px 15px; width: 100%; border: 1px solid #cbd5e1; border-radius: 8px; font-size: 14px; color: #334155; outline: none; transition: border-color 0.2s; box-sizing: border-box;}
.form-row input:focus { border-color: #3b82f6; }
.flex-1 { flex: 1; } .flex-2 { flex: 2; }

.forgot-password { text-align: right; margin-top: -10px; margin-bottom: 25px; }
.forgot-password a { font-size: 13px; color: #2563eb; text-decoration: none; font-weight: 500; }

.submit-btn { width: 100%; padding: 14px; border: none; border-radius: 8px; font-size: 15px; font-weight: 600; color: white; cursor: pointer; transition: background-color 0.3s; display: flex; justify-content: center; align-items: center; }
.btn-blue { background-color: #2563eb; }
.btn-blue:hover { background-color: #1d4ed8; }
.btn-green { background-color: #0f766e; }
.btn-green:hover { background-color: #0d9488; }

/* Error States */
#login-error { display: none; align-items: flex-start; gap: 10px; margin-bottom: 20px; border-radius: 8px; border: 1px solid #fecaca; background-color: #fef2f2; padding: 12px; font-size: 0.85rem; color: #b91c1c; }
#login-error.flex { display: flex; }

/* ========================================================
   NEW DARK COLLAPSIBLE SIDEBAR & AVATAR MENU
======================================================== */

#app-sidebar { background-color: #0b1120 !important; border-right: 1px solid #1e293b !important; transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1); overflow-x: hidden; display: flex; flex-direction: column; width: 270px; flex-shrink: 0; z-index: 10; }
#app-sidebar.collapsed { width: 84px !important; }
#app-sidebar.collapsed .brand-name, #app-sidebar.collapsed .nav-text { opacity: 0; display: none; }
#app-sidebar.collapsed .sidebar-header { justify-content: center; padding: 0; }
#sidebar-toggle { cursor: pointer; border: none; background: #2563eb; color: white; width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center; transition: all 0.2s ease; box-shadow: 0 4px 6px rgba(37,99,235,0.2); }
#sidebar-toggle:hover { background-color: #1d4ed8; transform: scale(1.05); }
#app-sidebar.collapsed .brand-container { gap: 0; justify-content: center; }

.side-link { display: flex !important; align-items: center; gap: 14px; padding: 12px 16px !important; margin: 6px 16px !important; border-radius: 12px !important; font-size: 0.95rem !important; font-weight: 600 !important; color: #cbd5e1 !important; border: 1px solid transparent !important; transition: all 0.2s ease; background: transparent; text-align: left; width: calc(100% - 32px) !important; cursor: pointer; }
#app-sidebar.collapsed .side-link { width: calc(100% - 16px) !important; margin: 6px 8px !important; padding: 12px 0 !important; justify-content: center; }
.side-link i { width: 20px; text-align: center; font-size: 1.15rem; opacity: 0.85; margin: 0; }
#app-sidebar.collapsed .side-link i { width: auto; }
.side-link:hover { border-color: rgba(255,255,255,0.6) !important; color: #ffffff !important; }
.side-link.active { background-color: rgba(30, 64, 175, 0.4) !important; color: #60a5fa !important; border-color: transparent !important; position: relative; }
.side-link.active::before { content: ''; position: absolute; left: -1px; top: 15%; bottom: 15%; width: 4px; background-color: #3b82f6; border-radius: 0 4px 4px 0; }
.side-link.active i { color: #60a5fa !important; opacity: 1; }
.side-group { font-size: 0.65rem; letter-spacing: 0.12em; text-transform: uppercase; color: #64748b; font-weight: 600; margin: 16px 28px 4px; }
#app-sidebar.collapsed .side-group { font-size: 0; height: 1px; background: #1e293b; margin: 10px 20px; padding: 0; }

.sidebar-footer { padding: 12px; border-top: 1px solid #1e293b; }
.user-chip-btn { width: 100%; display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: 12px; background: transparent; border: none; cursor: pointer; text-align: left; transition: background 0.2s; }
.user-chip-btn:hover { background: #1e293b; }
.user-avatar { width: 36px; height: 36px; border-radius: 50%; background: #2563eb; color: #fff; display: flex; align-items: center; justify-content: center; font-size: 0.85rem; font-weight: 700; flex-shrink: 0; }
.user-info { flex: 1; overflow: hidden; }
.user-info p { margin: 0; font-size: 0.85rem; font-weight: 600; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-info span { font-size: 0.75rem; color: #94a3b8; display: block; text-transform: uppercase; }

#app-sidebar.collapsed .sidebar-footer { padding: 12px 8px; }
#app-sidebar.collapsed .user-info { display: none; }
#app-sidebar.collapsed .user-chip-btn { justify-content: center; padding: 8px 0; }

.user-menu { position: fixed; z-index: 1000; width: 220px; padding: 8px; background: #1e293b; border: 1px solid #334155; border-radius: 12px; box-shadow: 0 10px 25px rgba(0,0,0,0.5); }
.user-menu.hidden { display: none; }
.user-menu-email { padding: 8px 10px 10px; font-size: 0.8rem; color: #94a3b8; border-bottom: 1px solid #334155; margin-bottom: 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-menu-email:empty { display: none; }
.user-menu-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px; border: none; border-radius: 8px; background: transparent; color: #f8fafc; font-size: 0.9rem; text-align: left; cursor: pointer; transition: background 0.2s; }
.user-menu-item i { width: 18px; text-align: center; color: #94a3b8; }
.user-menu-item:hover { background: #334155; }

/* --- 3. TOPBAR --- */
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 0 25px; background: #fff; border-bottom: 1px solid #e2e8f0; height: 75px !important; box-sizing: border-box; flex-shrink: 0; }
.live-clock { display: flex; align-items: center; gap: 8px; background: #fff; border: 1px solid #e2e8f0; border-radius: 10px; padding: 6px 12px; font-size: 0.85rem; color: #475569; font-weight: 600;}
/* .live-dot { width: 8px; height: 8px; border-radius: 50%; background: #16a34a; animation: live-pulse 1.6s infinite; } */
@keyframes live-pulse { 0% { box-shadow: 0 0 0 0 rgba(22,163,74,.5); } 100% { box-shadow: 0 0 0 7px rgba(22,163,74,0); } }

/* ========================================================
   MODALS, OVERLAYS & FORMS
======================================================== */

.overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.7); display: flex; align-items: center; justify-content: center; z-index: 1000; }
.hidden { display: none !important; }
.modal-box { background: white; padding: 30px; border-radius: 8px; width: 600px; max-width: 90vw; box-shadow: 0 10px 25px rgba(0,0,0,0.2); max-height: 90vh; overflow-y: auto; }
.modal-box h2 { color: var(--primary); margin-bottom: 20px; border-bottom: 2px solid var(--secondary); padding-bottom: 10px; }
.form-group, .form-group-auth { margin-bottom: 20px; }
.form-group label, .form-group-expiryalert label, .form-group-userpassword label { display: block; font-size: 0.9rem; font-weight: 700; color: #475569; margin-bottom: 8px; letter-spacing: 0.5px; }
/* 1. Base styling for text inputs and selects (NO arrow or appearance strip here) */
.form-group input:not([type="checkbox"]):not([type="radio"]),
.form-group-userpassword input,
.form-group-expiryalert input,
.form-group select {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 0.95rem;
    color: #334155;
    background-color: #ffffff;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

/* 2. Restore normal checkbox sizing & native checkmark appearance */
.form-group input[type="checkbox"] {
    width: 18px !important;
    height: 18px !important;
    padding: 0 !important;
    margin: 0 !important;
    appearance: auto !important;
    -webkit-appearance: checkbox !important;
    background-image: none !important;
    cursor: pointer;
    accent-color: var(--primary);
}

/* 3. Apply the custom dropdown arrow ONLY to <select> elements across the app */
.form-group select,
.filter-bar select,
#pos-discount-type {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    padding-right: 38px !important;
    background-color: #ffffff;
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%2364748b%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 11px auto;
    cursor: pointer;
}

/* 4. Smooth focus ring for all inputs and dropdowns */
.form-group input:not([type="checkbox"]):focus,
.form-group-userpassword input:focus,
.form-group-expiryalert input:focus,
.form-group select:focus,
.filter-bar select:focus,
.filter-bar input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}

.form-group select:disabled,
.form-group input:disabled {
    background-color: #f1f5f9;
    color: #94a3b8;
    cursor: not-allowed;
}

.otp-wrapper { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 25px; }
.otp-box { width: 100%; height: 55px; text-align: center; font-size: 24px; font-weight: 700; color: #0f172a; border: 2px solid #cbd5e1 !important; border-radius: 8px; background: #f8fafc; outline: none; transition: all 0.2s ease; padding: 0 !important; }
.otp-box:focus { border-color: #2563eb !important; background: #ffffff; box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1); }
    
#toast-container { position: fixed; top: 25px; right: 25px; z-index: 9999; display: flex; flex-direction: column; gap: 15px; }
.toast { min-width: 300px; background: white; color: var(--dark); padding: 16px 20px; border-radius: 8px; box-shadow: 0 10px 25px rgba(0,0,0,0.15); display: flex; align-items: center; gap: 12px; font-size: 0.95rem; font-weight: 600; border-left: 5px solid var(--primary); transform: translateX(120%); animation: slideInRight 0.4s cubic-bezier(0.25, 0.8, 0.25, 1) forwards, fadeOut 0.4s ease forwards 3.5s; }
.toast.success { border-left-color: var(--secondary); }
.toast.error { border-left-color: var(--danger); }
.toast.warning { border-left-color: var(--warning); }
.toast i { font-size: 1.4rem; }
.toast.success i { color: var(--secondary); }
.toast.error i { color: var(--danger); }
.toast.warning i { color: var(--warning); }

@keyframes slideInRight { to { transform: translateX(0); } }
@keyframes fadeOut { to { opacity: 0; transform: translateY(-15px); } }

/* Autocomplete Live Search Dropdown */
.autocomplete-dropdown { position: absolute; top: calc(100% + 4px); left: 0; right: 0; background: white; border: 1px solid #cbd5e1; border-radius: 8px; box-shadow: 0 10px 25px rgba(0,0,0,0.1); max-height: 250px; overflow-y: auto; z-index: 1000; }
.autocomplete-item { padding: 12px 16px; cursor: pointer; border-bottom: 1px solid #f1f5f9; transition: background 0.15s ease, color 0.15s ease; color: #334155; font-size: 0.95rem; }
.autocomplete-item:last-child { border-bottom: none; }
.autocomplete-item:hover { background: #f8fafc; color: var(--primary); }

/* Filter Bar Styles */
.filter-bar { display: flex; gap: 15px; margin-bottom: 20px; background: white; padding: 15px; border-radius: 8px; box-shadow: 0 2px 4px rgba(0,0,0,0.02); border: 1px solid var(--border); align-items: center; }
.filter-bar .form-group { margin-bottom: 0; flex: 1; }
.filter-bar select, .filter-bar input { border: 1px solid #ced4da; width: 100%; padding: 12px 15px; border-radius: 8px; font-size: 14px; color: #334155; outline: none; background-color: #fff; height: 45px; transition: border-color 0.2s; }
.filter-bar select:focus, .filter-bar input:focus { border-color: #3b82f6; }

/* ========================================================
   MAIN CONTENT & MODULES
======================================================== */

.main-content { flex: 1; min-width: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; }
.content-body { padding: 30px; max-width: 1400px; margin: 0 auto; width: 100%; flex: 1;}

.module { display: none; animation: fadeIn 0.4s ease forwards; opacity: 0; transform: translateY(10px); }
.module.active { display: block; }
@keyframes fadeIn { to { opacity: 1; transform: translateY(0); } }
    
.header-title { border-bottom: 2px solid var(--secondary); padding-bottom: 10px; margin-bottom: 25px; color: var(--primary); display: flex; justify-content: space-between; align-items: center; }

/* Buttons */
.btn { padding: 10px 18px; border: none; border-radius: 4px; cursor: pointer; font-weight: bold; transition: 0.2s; }
.btn:hover { filter: brightness(1.1); transform: translateY(-1px); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--primary); color: white; }
.btn-secondary { background: var(--secondary); color: white; }
.btn-danger { background: var(--danger); color: white; }
.btn-outline { background: transparent; border: 2px solid var(--primary); color: var(--primary); }
.btn-outline:hover { background: var(--primary); color: white; }

/* Tables & Cards */  
table { width: 100%; border-collapse: collapse; background: white; border-radius: 8px; overflow: hidden; margin-bottom: 20px; }
th, td { padding: 15px; text-align: left; border-bottom: 1px solid var(--border); }
th { font-size: 0.75rem !important; text-transform: uppercase; letter-spacing: 0.05em; color: #64748b !important; font-weight: 600 !important; background: #f1f3f5; }
tbody tr:hover td { background-color: #f8fafc; }
    
.grid-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 25px; margin-bottom: 25px; }
.card { background: white; padding: 25px; border-radius: 14px !important; border: 1px solid #e2e8f0 !important; border-top: 4px solid var(--primary) !important; box-shadow: 0 1px 2px rgba(15,23,42,.04) !important; transition: 0.3s; }
.card:hover { box-shadow: 0 6px 12px rgba(0,0,0,0.1) !important; }
.card h3 { color: #6c757d; font-size: 1rem; margin-bottom: 10px; }
.card h2 { font-size: 2.2rem; color: var(--dark); }

/* POS Layout */ 
.pos-layout { display: flex; gap: 25px; height: 100%; min-height: 65vh; }
.pos-items { flex: 7; display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 15px; align-content: start; padding-right: 10px; max-height: 75vh; overflow-y: auto;}
.pos-item-btn { background: white; border: 1px solid var(--border); padding: 20px 15px; border-radius: 8px; cursor: pointer; text-align: center; transition: 0.2s; display: flex; flex-direction: column; justify-content: space-between; min-height: 195px; height: 100%; }
.pos-item-btn:hover { border-color: var(--secondary); transform: translateY(-3px); box-shadow: 0 6px 12px rgba(0,0,0,0.08); }
.pos-cart { flex: 3; background: white; border-radius: 8px; display: flex; flex-direction: column; padding: 20px; box-shadow: 0 4px 6px rgba(0,0,0,0.05); max-height: 75vh;}
    
.badge { padding: 5px 10px; border-radius: 20px; font-size: 0.75rem; font-weight: bold; text-transform: uppercase; }
.badge-warning { background: #fff3cd; color: #856404; } 
.badge-danger { background: #f8d7da; color: #721c24; }
.badge-success { background: #d4edda; color: #155724; }
.badge-info { background: #cce5ff; color: #004085; }
   
.chart-container { background: white; padding: 25px; border-radius: 14px !important; border: 1px solid #e2e8f0 !important; box-shadow: 0 1px 2px rgba(15,23,42,.04) !important; margin-top: 25px; }

/* =========================================
   POS VIEW MODES: CATALOG-STYLE TILES & CONTENT
========================================= */

/* Mode 1: Catalog-Style Large Icons Grid View */
#pos-grid.pos-view-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); grid-auto-rows: minmax(350px, auto); gap: 18px; align-content: start; padding-bottom: 24px; }
#pos-grid.pos-view-grid .pos-item-btn { padding: 0 !important; min-height: 350px !important; height: 100% !important; border-radius: 14px !important; border: 1px solid #e2e8f0 !important; border-top: 4px solid var(--primary) !important; box-shadow: 0 2px 6px rgba(15, 23, 42, 0.04) !important; overflow: visible !important; display: flex; flex-direction: column; justify-content: space-between; align-items: stretch; text-align: center; background: #ffffff; transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease !important; }
#pos-grid.pos-view-grid .pos-item-btn:hover { transform: translateY(-4px); box-shadow: 0 10px 20px rgba(15, 23, 42, 0.1) !important; border-color: var(--primary) !important; }
.pos-card-thumb { width: 100%; height: 145px; background: #f8f9fa; border-bottom: 1px solid var(--border); border-radius: 10px 10px 0 0; display: flex; align-items: center; justify-content: center; padding: 16px; overflow: hidden; flex-shrink: 0; }
.pos-card-thumb img { max-width: 100%; max-height: 100%; object-fit: contain; }
.pos-card-body { padding: 16px 16px 18px; display: flex; flex-direction: column; justify-content: space-between; flex: 1 0 auto; width: 100%; }

/* Mode 2: File-Manager "Content" Horizontal View */
#pos-grid.pos-view-content { display: flex; flex-direction: column; gap: 10px; padding-bottom: 20px; }
.pos-item-content-row { background: #ffffff; border: 1px solid #e2e8f0; border-left: 4px solid var(--primary); border-radius: 12px; padding: 12px 18px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 16px; cursor: pointer; transition: all 0.2s ease; min-height: 82px; height: auto !important; width: 100%; box-sizing: border-box; box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04); }
.pos-item-content-row:hover { border-color: var(--primary); transform: translateX(4px); box-shadow: 0 6px 14px rgba(15, 23, 42, 0.08); }
.pos-content-thumb { width: 62px; height: 62px; background: #f8f9fa; border: 1px solid #e2e8f0; border-radius: 10px; display: flex; align-items: center; justify-content: center; padding: 6px; flex-shrink: 0; overflow: hidden; }
.pos-content-thumb img { max-width: 100%; max-height: 100%; object-fit: contain; }
.pos-content-main { flex: 2 1 180px; min-width: 150px; text-align: left; }
.pos-content-title { font-weight: 700; color: var(--dark); font-size: 0.95rem; line-height: 1.3; word-break: break-word; }
.pos-content-sub { font-size: 0.8rem; color: #64748b; margin-top: 3px; line-height: 1.35; }
.pos-content-meta { flex: 1 1 135px; min-width: 130px; font-size: 0.78rem; color: #475569; line-height: 1.45; text-align: left; }
.pos-content-price { flex: 0 0 auto; text-align: right; min-width: 95px; margin-left: auto; }

/* Responsive Tablet & Mobile Layout for POS */
@media (max-width: 1100px) {
    #pos .filter-bar { flex-wrap: wrap; }
    #pos .filter-bar > div { min-width: 160px; }
    .pos-layout { flex-direction: column; height: auto; }
    .pos-items { flex: none; width: 100%; max-height: 62vh; padding-right: 4px; }
    .pos-cart { flex: none; width: 100%; max-height: none; }
}

@media (max-width: 640px) {
    #pos-grid.pos-view-grid { grid-template-columns: repeat(auto-fill, minmax(155px, 1fr)); grid-auto-rows: minmax(310px, auto); gap: 12px; }
    #pos-grid.pos-view-grid .pos-item-btn { min-height: 310px !important; }
    .pos-card-thumb { height: 115px; }
    .pos-item-content-row { padding: 12px; }
}
 
/* Custom Toggle Switch */ 
.switch { position: relative; display: inline-block; width: 40px; height: 20px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #ccc; transition: .4s; border-radius: 34px; }
.slider:before { position: absolute; content: ""; height: 14px; width: 14px; left: 3px; bottom: 3px; background-color: white; transition: .4s; border-radius: 50%; }
input:checked + .slider { background-color: var(--secondary); }
input:checked + .slider:before { transform: translateX(20px); }
    
/* Recommendation Widget Styles */  
.recommendation-widget { background: #e8f4f8; border-left: 4px solid #17a2b8; padding: 15px; border-radius: 6px; margin-bottom: 15px; }
.recommendation-item { display: flex; justify-content: space-between; align-items: center; background: white; padding: 10px; margin-top: 8px; border-radius: 4px; box-shadow: 0 2px 4px rgba(0,0,0,0.05); }

/* =========================================
   SUPER ADMIN (GOD MODE) VISUAL THEME 
========================================= */

body.super-admin-mode #app-sidebar { background: linear-gradient(180deg, #111416 0%, #2b1216 100%) !important; }
body.super-admin-mode .sidebar-header { border-bottom: 3px solid #e11d48 !important; }
body.super-admin-mode .topbar { border-bottom: 2px solid #e11d48; }
body.super-admin-mode #user-role-display { color: #e11d48 !important; text-shadow: 0 0 10px rgba(225, 29, 72, 0.4); }
body.super-admin-mode .side-link.active { background: rgba(225, 29, 72, 0.1) !important; color: #fb7185 !important; }
body.super-admin-mode .side-link.active::before { background-color: #e11d48; }
body.super-admin-mode .side-link.active i { color: #fb7185 !important; }

/* Batch Scanner Table Inputs */
.scan-inp { width: 100%; padding: 10px 12px; border: 1px solid #cbd5e1; border-radius: 4px; font-size: 1.05rem; color: #334155; outline: none; box-sizing: border-box; }
.scan-inp:focus { border-color: #3b82f6; }

/* =========================================
   LARGE SCREEN MODAL ACCESSIBILITY 
========================================= */

/* Make all modal helper instructions larger */
.modal-box p { font-size: 1.05rem !important; line-height: 1.5; }
.modal-box h2 { font-size: 1.8rem; }

/* Screen-Only Receipt Magnification (Ignored by Thermal Printer) */
#receipt-content { zoom: 1.35; }
/* Firefox fallback (Firefox uses transform instead of zoom) */
@-moz-document url-prefix() { #receipt-content { transform: scale(1.35); transform-origin: top center; margin-bottom: 80px !important; }}

/* =========================================
   USER MANAGEMENT ICON BUTTONS & PERMISSIONS
========================================= */

.icon-action-btn { width: 34px; height: 34px; padding: 0 !important; display: inline-flex; align-items: center; justify-content: center; border-radius: 6px; font-size: 0.9rem; transition: all 0.2s ease; }
.perm-check-label { display: flex !important; align-items: center; gap: 10px; font-size: 0.9rem !important; font-weight: 500 !important; color: #334155 !important; cursor: pointer; margin: 0 !important; padding: 4px 6px; border-radius: 4px; }
.perm-check-label:hover { background: #eef2ff; }
.perm-check-label input[type="checkbox"] { width: 18px !important; height: 18px !important; padding: 0 !important; margin: 0 !important; cursor: pointer; }

/* =========================================
   INVENTORY QUICK-FILTER TAB PILLS
========================================= */
.inv-tab-pill { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 20px; border: 1px solid #cbd5e1; background: #ffffff; color: #475569; font-size: 0.82rem; font-weight: 600; cursor: pointer; transition: all 0.2s ease; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03); }
.inv-tab-pill:hover { border-color: var(--primary); color: var(--primary); background: #f8fafc; }
.inv-tab-pill.active { background: var(--primary); color: #ffffff !important; border-color: var(--primary); box-shadow: 0 4px 10px rgba(0, 86, 179, 0.2); }
.inv-tab-pill.active i { color: #ffffff !important; }

/* =========================================
   MEDICINE CATALOG INTERACTIVE PREVIEW
========================================= */

.catalog-item-card { cursor: pointer; transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease !important; }
.catalog-item-card:hover { transform: translateY(-4px); box-shadow: 0 10px 20px rgba(15, 23, 42, 0.1) !important; border-color: var(--primary) !important; }

.catalog-preview-card { background: #ffffff; width: min(640px, 92vw); max-height: 90vh; border-radius: 16px; border: 1px solid #e2e8f0; border-top: 5px solid var(--primary); box-shadow: 0 20px 45px rgba(0, 0, 0, 0.35); display: flex; flex-direction: column; overflow: hidden; animation: catalogZoomIn 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards; }

@keyframes catalogZoomIn {
from { opacity: 0; transform: scale(0.94); }
to { opacity: 1; transform: scale(1); }
}

.catalog-preview-image-area { position: relative; width: 100%; height: clamp(260px, 54vh, 480px); background: #f8f9fa; border-bottom: 2px solid var(--border); display: flex; align-items: center; justify-content: center; padding: 28px; }
.catalog-preview-media-wrap { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }
.catalog-preview-media-wrap img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 8px; user-select: none; }
.catalog-preview-close-btn { position: absolute; top: 14px; right: 14px; width: 40px; height: 40px; border-radius: 10px; border: 2px solid var(--border); background: rgba(255, 255, 255, 0.95); color: #334155; font-size: 1.25rem; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: all 0.2s ease; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08); z-index: 2; }
.catalog-preview-close-btn:hover { background: var(--danger); border-color: var(--danger); color: #ffffff; transform: scale(1.05); }
.catalog-preview-actions { position: absolute; bottom: 14px; right: 14px; display: flex; gap: 10px; z-index: 2; }
.catalog-action-btn { width: 42px; height: 42px; padding: 0 !important; border-radius: 10px !important; background: rgba(255, 255, 255, 0.95) !important; display: inline-flex; align-items: center; justify-content: center; font-size: 1.05rem; box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08); }
.catalog-action-btn:hover { background: var(--primary) !important; color: #ffffff !important; }
.catalog-trash-btn { border-color: var(--danger) !important; color: var(--danger) !important; }
.catalog-trash-btn:hover { background: var(--danger) !important; border-color: var(--danger) !important; color: #ffffff !important; }
.catalog-preview-info-area { padding: clamp(18px, 3vh, 28px) 24px; background: #ffffff; text-align: center; display: flex; flex-direction: column; justify-content: center; align-items: center; }

/* =========================================
   DASHBOARD FILTER PILLS & CLICKABLE CARDS
========================================= */

.dash-filter-group { display: inline-flex; background: #ffffff; border: 1px solid #cbd5e1; border-radius: 10px; padding: 4px; gap: 4px; box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04); }
.dash-filter-btn { border: none; background: transparent; color: #475569; font-size: 0.82rem; font-weight: 600; padding: 6px 14px; border-radius: 7px; cursor: pointer; transition: all 0.2s ease; }
.dash-filter-btn:hover:not(.active) { color: var(--primary); background: #f1f5f9; }
.dash-filter-btn.active { background: #2563eb; color: #ffffff; box-shadow: 0 2px 6px rgba(37, 99, 235, 0.25); }
.dash-clickable-card { cursor: pointer; user-select: none; transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease !important; }
.dash-clickable-card:hover { transform: translateY(-4px); box-shadow: 0 10px 20px rgba(15, 23, 42, 0.08) !important; }
.dash-clickable-card:active { transform: translateY(-1px); }

/* Compact single-row KPI strip for Dashboard */
#dashboard .grid-cards { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-bottom: 20px; }
#dashboard .dash-clickable-card { padding: 16px 18px !important; min-width: 0; }
#dashboard .dash-clickable-card > div { min-width: 0; flex: 1; }
#dashboard .dash-clickable-card h3 { font-size: 0.72rem !important; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; color: #64748b !important; margin-bottom: 6px !important; line-height: 1.25; }
#dashboard .dash-clickable-card h2 { font-size: clamp(1.15rem, 1.35vw, 1.45rem) !important; font-weight: 800; margin-top: 2px !important; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#dashboard .dash-clickable-card i { font-size: 1.45rem !important; margin-left: 10px; flex-shrink: 0; }
@media (max-width: 1150px) { #dashboard .grid-cards { grid-template-columns: repeat(3, 1fr); } }

/* ========================================= 
  HEADER HEIGHT ALIGNMENT & SINGLE-ROW KPIS 
========================================= */
/* Force exact height matching between sidebar header and top bar */
.sidebar-header { height: 75px !important; box-sizing: border-box; }
/* Hover effect for the new minimize button */
#sidebar-minimize-btn:hover { color: #ffffff !important; background: rgba(255, 255, 255, 0.05); }
/* Compact single-row KPI strip for Dashboard */
#dashboard .grid-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-bottom: 20px; }
#dashboard .dash-clickable-card { padding: 14px 16px !important; min-width: 0; }
#dashboard .dash-clickable-card > div { min-width: 0; flex: 1; }
#dashboard .dash-clickable-card h3 { font-size: 0.7rem !important; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; color: #64748b !important; margin-bottom: 4px !important; line-height: 1.2; }
#dashboard .dash-clickable-card h2 { font-size: clamp(1.1rem, 1.25vw, 1.35rem) !important; font-weight: 800; margin-top: 2px !important; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#dashboard .dash-clickable-card i { font-size: 1.35rem !important; margin-left: 8px; flex-shrink: 0; }
/* Responsive fallback for smaller screens */
@media (max-width: 1200px) { #dashboard .grid-cards { grid-template-columns: repeat(3, 1fr); } }

/* =========================================
   MULTI-SELECT CHECKBOX DROPDOWN (SALES FILTER)
========================================= */
.multiselect-trigger-btn { width: 100%; height: 45px; padding: 0 14px; border: 1px solid #ced4da; border-radius: 8px; background-color: #ffffff; color: #334155; font-size: 14px; text-align: left; display: flex; align-items: center; justify-content: space-between; cursor: pointer; outline: none; transition: border-color 0.2s, box-shadow 0.2s; }
.multiselect-trigger-btn:focus,
.multiselect-trigger-btn.open { border-color: #3b82f6; box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12); }
.multiselect-dropdown-menu { position: absolute; top: calc(100% + 6px); left: 0; right: 0; min-width: 230px; background: #ffffff; border: 1px solid #cbd5e1; border-radius: 10px; box-shadow: 0 10px 25px rgba(15, 23, 42, 0.14); z-index: 1050; padding: 6px 0; }
.multiselect-option-item { display: flex !important; align-items: center; gap: 10px; padding: 9px 14px; font-size: 0.88rem !important; font-weight: 500; color: #334155; cursor: pointer; margin: 0 !important; transition: background 0.15s ease; user-select: none; }
.multiselect-option-item:hover { background: #f1f5f9; }
.multiselect-option-item input[type="checkbox"] { width: 16px !important; height: 16px !important; margin: 0 !important; padding: 0 !important; accent-color: var(--primary); cursor: pointer; flex-shrink: 0; }

/* =========================================
   DASHBOARD 5-WIDGET INSIGHTS GRID (2 + 2 + 1)
========================================= */
.dash-insights-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; width: 100%; }
.dash-insight-full { grid-column: 1 / -1; }
.dash-insight-header { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; padding-bottom: 10px; border-bottom: 1px solid #f1f5f9; }
.dash-insight-icon { width: 36px; height: 36px; border-radius: 9px; display: flex; align-items: center; justify-content: center; font-size: 1rem; flex-shrink: 0; }
.dash-bar-row { display: grid; grid-template-columns: 165px 1fr 58px; align-items: center; gap: 12px; padding: 8px 0; }
.dash-bar-label { font-size: 0.84rem; font-weight: 600; color: #334155; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dash-bar-track { width: 100%; height: 22px; background: #f1f5f9; border-radius: 6px; overflow: hidden; }
.dash-bar-fill { height: 100%; background: linear-gradient(90deg, #38bdf8, #0284c7); border-radius: 6px; transition: width 0.4s ease; }
.dash-mini-table { width: 100%; border-collapse: collapse; margin-bottom: 0; }
.dash-mini-table th { background: #f8fafc !important; padding: 9px 12px !important; font-size: 0.72rem !important; color: #64748b !important; border-bottom: 1px solid #e2e8f0; }
.dash-mini-table td { padding: 10px 12px !important; font-size: 0.85rem; color: #334155; border-bottom: 1px solid #f1f5f9; }
.dash-mini-table tr:last-child td { border-bottom: none; }
.dash-count-pill { display: inline-flex; align-items: center; justify-content: center; min-width: 32px; padding: 3px 10px; border-radius: 999px; font-size: 0.76rem; font-weight: 700; }
@media (max-width: 980px) { .dash-insights-grid { grid-template-columns: 1fr; } }

/* =========================================
   CLICKABLE DASHBOARD INSIGHT ROWS & ICONS
========================================= */
.dash-card-link-icon { font-size: 0.85rem; color: #94a3b8; opacity: 0; transform: translate(-3px, 3px); transition: opacity 0.2s ease, transform 0.2s ease, color 0.2s ease; }
.dash-insight-card:hover .dash-card-link-icon { opacity: 1; transform: translate(0, 0); color: var(--primary); }
.dash-bar-row.dash-clickable-row { padding: 8px 8px; margin: 0 -8px; border-radius: 8px; cursor: pointer; transition: background 0.15s ease, transform 0.15s ease; }
.dash-bar-row.dash-clickable-row:hover { background: #f0f9ff; transform: translateX(3px); }
.dash-bar-row.dash-clickable-row:hover .dash-bar-label { color: var(--primary); }
.dash-mini-table tbody tr.dash-clickable-row { cursor: pointer; transition: background 0.15s ease; }
.dash-mini-table tbody tr.dash-clickable-row:hover td { background-color: #eef2ff !important; color: var(--primary); }