/* --- GROCERY INVENTORY MANAGEMENT - STYLESHEET --- */
:root {
    --primary-color: #8E2DE2;
    --primary-hover: #4A00E0;
    --secondary-color: #f4f5f7;
    --sidebar-bg: #1e293b;
    --sidebar-text: #e2e8f0;
    --sidebar-hover: #334155;
    --sidebar-active: #8E2DE2;
    --card-bg: #ffffff;
    --text-color: #0f172a;
    --text-light: #64748b;
    --border-color: #e2e8f0;
    --success-color: #16a34a;
    --danger-color: #dc2626;
    --warning-color: #f59e0b;
    --shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --border-radius: 12px;
}

/* --- GLOBAL & RESET STYLES --- */
* {
    padding: 0;
    margin: 0;
    box-sizing: border-box;
    list-style-type: none;
    text-decoration: none;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--secondary-color);
    color: var(--text-color);
    overflow-x: hidden;
}

/* --- LAYOUT: SIDEBAR --- */
.sidebar {
    width: 260px;
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    transition: all 0.3s ease;
    z-index: 1000;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    overflow-y: auto;
}

.sidebar-header {
    padding: 1.5rem;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.2);
}

.sidebar-header h3 {
    color: white;
    font-weight: 600;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

.sidebar-header h3 i {
    color: var(--warning-color);
    font-size: 1.5rem;
}

.sidebar-nav {
    padding: 1rem 0;
}

.sidebar-nav ul {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.sidebar-nav li {
    margin: 0;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    padding: 1rem 1.5rem;
    color: var(--sidebar-text);
    font-size: 0.95rem;
    transition: all 0.3s ease;
    border-left: 4px solid transparent;
    position: relative;
    gap: 1rem;
}

.sidebar-nav a i {
    font-size: 1.2rem;
    width: 20px;
    text-align: center;
    transition: all 0.3s ease;
}

.sidebar-nav a:hover {
    background: var(--sidebar-hover);
    border-left-color: var(--primary-color);
    color: white;
}

.sidebar-nav a:hover i {
    color: var(--primary-color);
    transform: scale(1.1);
}

.sidebar-nav li.active a {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    color: white;
    font-weight: 600;
    border-left-color: var(--warning-color);
    box-shadow: 0 4px 12px rgba(142, 45, 226, 0.3);
}

.sidebar-nav li.active a i {
    color: white;
    transform: scale(1.1);
}

.sidebar-nav li.active a::after {
    content: '';
    position: absolute;
    right: 1rem;
    width: 6px;
    height: 6px;
    background: var(--warning-color);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.2); }
    100% { opacity: 1; transform: scale(1); }
}

/* Sidebar scrollbar styling */
.sidebar::-webkit-scrollbar {
    width: 4px;
}

.sidebar::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
}

.sidebar::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 2px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: var(--primary-hover);
}

/* --- LAYOUT: MAIN CONTENT --- */
.main-content {
    margin-left: 260px;
    transition: margin-left 0.3s ease;
    min-height: 100vh;
    background: var(--secondary-color);
}

/* Header Styles */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.header-title {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header-title h2 {
    color: var(--text-color);
    font-weight: 600;
    font-size: 1.4rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.header-title .menu-toggle {
    display: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-color);
    background: none;
    border: none;
    padding: 0.5rem;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.header-title .menu-toggle:hover {
    background: var(--secondary-color);
    color: var(--primary-color);
}

.user-wrapper {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.5rem 1rem;
    background: var(--secondary-color);
    border-radius: 8px;
    transition: all 0.3s ease;
}

.user-wrapper:hover {
    background: var(--border-color);
}

.user-wrapper i {
    font-size: 2rem;
    color: var(--primary-color);
}

.user-info h4 {
    font-weight: 500;
    margin: 0;
    font-size: 0.95rem;
}

.user-info small {
    color: var(--text-light);
    display: block;
    font-size: 0.8rem;
}

/* Overlay for mobile */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 999;
    display: none;
    cursor: pointer;
}

.overlay.active {
    display: block;
}

/* --- RESPONSIVE DESIGN --- */
@media only screen and (max-width: 992px) {
    .sidebar {
        transform: translateX(-100%);
        box-shadow: none;
    }
    
    .sidebar.active {
        transform: translateX(0);
        box-shadow: 2px 0 20px rgba(0, 0, 0, 0.3);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .header-title .menu-toggle {
        display: block;
    }
    
    .overlay.active {
        display: block;
    }
}

@media only screen and (max-width: 768px) {
    .sidebar {
        width: 240px;
    }
    
    header {
        padding: 1rem;
    }
    
    .header-title h2 {
        font-size: 1.2rem;
    }
    
    .user-wrapper {
        padding: 0.5rem;
    }
    
    .user-info {
        display: none;
    }
}

@media only screen and (max-width: 480px) {
    .sidebar {
        width: 100%;
    }
    
    .sidebar-header h3 {
        font-size: 1.1rem;
    }
    
    .sidebar-nav a {
        padding: 1rem;
        font-size: 0.9rem;
    }
}

/* Animation for sidebar */
@keyframes slideInLeft {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.sidebar.active {
    animation: slideInLeft 0.3s ease-out;
}

/* Main content area styling */
main {
    padding: 2rem;
    min-height: calc(100vh - 80px);
}

/* Card Styles */
.card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.card-header {
    padding: 1.2rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #fcfdff;
}

.card-header h3 {
    font-size: 1.2rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.card-body {
    padding: 1.5rem;
}

/* POS Layout Specific Styles */
.pos-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
}

@media (max-width: 992px) {
    .pos-layout {
        grid-template-columns: 1fr;
    }
}

/* Utility Classes */
.text-danger { color: var(--danger-color) !important; font-weight: 600; }
.text-success { color: var(--success-color) !important; font-weight: 600; }
.no-results { text-align: center; padding: 2rem; color: var(--text-light); }

/* Smooth transitions */
* {
    transition: color 0.3s ease, background-color 0.3s ease, border-color 0.3s ease;
}


/* --- BILLING PAGE LAYOUT --- */
.pos-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
    padding: 2rem;
    height: calc(100vh - 80px);
}

.pos-main {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.pos-sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Customer Display */
#customer-display {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 1.1rem;
    font-weight: 500;
    margin-bottom: 1rem;
    background-color: var(--secondary-color);
    padding: 1rem;
    border-radius: var(--border-radius);
}

#customer-display i {
    font-size: 1.5rem;
    color: var(--primary-color);
}

/* Product Actions */
.product-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* Billing Items Grid */
.bill-items-grid {
    max-height: 400px;
    overflow-y: auto;
    padding: 10px;
}

.bill-item-card {
    background: var(--light);
    border-radius: 10px;
    padding: 18px;
    margin-bottom: 12px;
    border-left: 4px solid var(--primary-color);
    transition: var(--transition);
}

.bill-item-card:hover {
    background: white;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.item-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.item-name {
    font-weight: 600;
    color: var(--dark);
}

.btn-remove-item {
    background: var(--danger-color);
    color: white;
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition);
}

.btn-remove-item:hover {
    background: #c1121f;
    transform: scale(1.1);
}

.item-card-body {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 12px;
    margin-bottom: 12px;
}

.item-detail label {
    display: block;
    font-size: 0.8rem;
    color: var(--gray);
    margin-bottom: 4px;
}

.item-detail input, .item-detail select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.9rem;
}

.item-card-footer {
    text-align: right;
    font-weight: bold;
    color: var(--primary-color);
    font-size: 1.1rem;
}

/* Billing Summary */
.billing-summary {
    background: linear-gradient(135deg, #f8f9ff, #f0f2ff);
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid rgba(0,0,0,0.1);
}

.summary-row.total {
    font-size: 1.4rem;
    font-weight: bold;
    color: var(--primary-color);
    border-bottom: none;
}

.payment-section {
    background: var(--secondary-color);
    padding: 20px;
    border-radius: 10px;
}

/* Billing Responsive Design */
@media (max-width: 992px) {
    .pos-layout {
        grid-template-columns: 1fr;
        height: auto;
    }
    .pos-sidebar {
        order: -1;
    }
}

@media (max-width: 768px) {
    .pos-layout {
        padding: 1rem;
    }
    .item-card-body {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    .product-actions {
        grid-template-columns: 1fr;
    }
}





/*...........................


/* --- MODAL STYLES --- */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.6);
    animation: fadeIn 0.3s ease;
}

.modal-open {
    overflow: hidden;
}

.modal-content {
    background-color: #fefefe;
    margin: 5% auto;
    border-radius: var(--border-radius);
    width: 90%;
    max-width: 500px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.3);
    animation: slideIn 0.4s ease-out;
}

.modal-content.large {
    max-width: 700px;
}

.modal-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-size: 1.25rem;
    color: var(--text-color);
}

.close-modal {
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s;
}

.close-modal:hover,
.close-modal:focus {
    color: var(--danger-color);
}

.modal-body {
    padding: 1.5rem;
    max-height: 60vh;
    overflow-y: auto;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

/* Modal Tabs */
.modal-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
}

.tab-link {
    padding: 1rem 1.5rem;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-light);
    border-bottom: 3px solid transparent;
}

.tab-link.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.modal-tab-content {
    display: none;
}

.modal-tab-content.active {
    display: block;
}

/* Selection Lists */
.selection-list {
    list-style: none;
    max-height: 400px;
    overflow-y: auto;
}

.selection-list li {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.selection-list li:hover {
    background: var(--secondary-color);
    transform: translateX(5px);
}

.btn-add-list-item {
    background: var(--success-color);
    color: white;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition);
}

.btn-add-list-item:hover {
    background: var(--info);
    transform: scale(1.1);
}