/* assets/css/style.css - Samuel Optical Teal Theme (Complete) */

/* --- 1. NEW COLOR PALETTE & CORE STYLES --- */
:root {
    /* Main Theme Colors - TEAL #008080 */
    --theme-primary: #008080; 
    --theme-primary-hover: #006666; /* 20% Darker for hover */
    --theme-accent: #20B2AA; /* Light Sea Green for highlights */
    --sidebar-bg: var(--theme-primary);
    
    /* Bootstrap Color Overrides */
    --bs-primary: var(--theme-primary);
    --bs-secondary: #6c757d;
    --bs-success: #198754;
    --bs-info: #0dcaf0;
    --bs-warning: #ffc107;
    --bs-danger: #dc3545;
    --bs-light: #f8f9fa;
    --bs-dark: #212529;

    /* Layout & Text Colors */
    --main-bg: #f4f6f9;
    --card-bg: #ffffff;
    --text-primary: #212529;
    --text-secondary: #6c757d;
    --text-light: #ffffff;
    --border-color: #dee2e6;
    --hover-bg: #e9ecef;

}

body {
    font-family: "Lato", sans-serif;
    background-color: var(--main-bg);
    color: var(--text-primary);
    font-size: 0.9rem;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: var(--bs-primary);
}
a:hover {
    color: var(--theme-primary-hover);
}

.text-primary { color: var(--text-primary) !important; }

/* --- 2. GLOBAL COMPONENT OVERRIDES --- */
.card, .btn, .form-control, .form-select, .alert, .modal-content, .dropdown-menu, .pagination .page-link, .input-group-text {
    border-radius: 0 !important; /* Flat Design */
}

.bg-primary {
    background-color: var(--theme-primary) !important;
    color: var(--text-light) !important;
}

.border-primary {
    border-color: var(--theme-primary) !important;
}

/* Input Groups */
.input-group-text{
    color: var(--text-light);
    background-color: var(--theme-primary);
    border: 1px solid var(--theme-primary);
}

/* Buttons */
.btn-primary { background-color: var(--bs-primary); border-color: var(--bs-primary); }
.btn-primary:hover { background-color: var(--theme-primary-hover); border-color: var(--theme-primary-hover); }
.btn-outline-primary { color: var(--bs-primary); border-color: var(--bs-primary); }
.btn-outline-primary:hover { background-color: var(--bs-primary); color: #fff; }

/* Alerts */
.alert-success { background-color: #d1e7dd; border-color: #badbcc; color: #0f5132; }
.alert-danger { background-color: #f8d7da; border-color: #f5c2c7; color: #842029; }

/* Forms */
.form-control:focus, .form-select:focus {
    border-color: var(--theme-primary);
    box-shadow: 0 0 0 0.25rem rgba(0, 128, 128, 0.25); /* Teal Glow */
}

/* Tables */
.table-striped > tbody > tr:nth-of-type(odd) > * {
    background-color: rgba(0, 0, 0, 0.02);
}
.table-hover > tbody > tr:hover > * {
    background-color: var(--hover-bg);
}

/* Table Header Theming - TEAL Headers */
.table > thead {
    background-color: var(--theme-primary);
    color: var(--text-light);
}
.table > thead th {
    border-color: var(--theme-primary-hover);
    color: var(--text-light);
    background-color: var(--theme-primary);
    font-weight: 600;
}
.table td {
    vertical-align: middle;
}

/* Pagination */
.pagination .page-item.active .page-link {
    background-color: var(--bs-primary);
    border-color: var(--bs-primary);
}
.pagination .page-link {
    color: var(--bs-primary);
}
.pagination .page-link:hover {
    background-color: var(--hover-bg);
}

/* Cards */
.card .card-header {
    background-color: var(--theme-primary);
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
    color: var(--text-light);
    border-radius: 0;
    padding: 0.75rem 1rem;
}
.card .card-header h4, .card .card-header h5 {
    margin-bottom: 0;
    font-size: 1.1rem;
}

/* --- 3. LAYOUT & SIDEBAR STRUCTURE --- */
.page-wrapper { 
    display: flex; 
    min-height: 100vh; 
    position: relative;
    width: 100%;
    overflow-x: hidden; /* Prevent horizontal scroll */
}

/* Sidebar: Desktop (Default Visible) */
.sidebar {
    width: 250px;
    min-width: 250px;
    background-color: var(--sidebar-bg);
    color: var(--text-light);
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 1000;
    transition: margin-left 0.3s ease-in-out;
    display: flex;
    flex-direction: column;
}

/* Main Content: Desktop */
.main-content {
    flex-grow: 1;
    transition: margin-left 0.3s ease-in-out;
    margin-left: 250px; /* Space for Sidebar */
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    width: calc(100% - 250px);
}

/* DESKTOP TOGGLE: When 'collapsed' class is added */
.page-wrapper.collapsed .sidebar {
    margin-left: -250px; /* Hide Sidebar */
}
.page-wrapper.collapsed .main-content {
    margin-left: 0; /* Expand Content */
    width: 100%;
}

/* --- MOBILE SPECIFIC (< 768px) --- */
@media (max-width: 768px) {
    /* Default Mobile State: Sidebar Hidden */
    .sidebar {
        margin-left: -250px; 
    }
    
    .main-content {
        margin-left: 0;
        width: 100%;
    }

    /* Active Mobile State: When 'toggled' class is added (reuse .collapsed or new class) */
    .page-wrapper.mobile-open .sidebar {
        margin-left: 0; /* Slide In */
        box-shadow: 5px 0 15px rgba(0,0,0,0.2); /* Shadow over content */
    }
    
    /* Optional: Overlay when sidebar is open on mobile */
    .page-wrapper.mobile-open::before {
        content: '';
        position: fixed;
        top: 0; left: 0; right: 0; bottom: 0;
        background: rgba(0,0,0,0.5);
        z-index: 999;
    }
}

/* Sidebar Components */
.sidebar-header {
    padding: 0.5rem 1.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.1); 
    display: flex;
    align-items: center;
    background-color: var(--theme-primary-hover);
}
.sidebar-title { color: #fff; font-size: 1.2rem; font-weight: 700; margin-left: 0.5rem; }

.sidebar-nav { 
    list-style: none; 
    padding: 0; 
    margin: 0;
    overflow-y: auto;
    flex-grow: 1;
}

.sidebar-item { margin-bottom: 0; }

.sidebar-link {
    display: flex;
    align-items: center;
    color: rgba(255,255,255,0.85);
    padding: 0.5rem 1.2rem;
    transition: all 0.2s ease;
    font-size: 0.95rem;
    border-left: 4px solid transparent;
    text-decoration: none;
}

.sidebar-link i { font-size: 1.1rem; margin-right: 0.75rem; width: 20px; text-align: center; }

.sidebar-link:hover {
    background-color: rgba(0,0,0,0.1);
    color: #ffffff;
}

.sidebar-item.active .sidebar-link {
    background-color: rgba(0,0,0,0.2);
    color: #ffffff;
    font-weight: 600;
    border-left-color: #fff; /* White accent on left */
}

.sidebar-divider {
    padding: 0.75rem 1.2rem;
    font-size: 0.7rem;
    color: var(--theme-accent); /* Accent Color Text */
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: bold;
    margin-top: 5px;
}

.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid rgba(255,255,255,0.1);
    background-color: var(--theme-primary-hover);
}
.sidebar-footer-link { color: rgba(255,255,255,0.6); font-size: 0.85rem; }
.sidebar-footer-link:hover { color: #fff; }

/* --- 4. TOP NAVBAR --- */
.top-navbar {
    background-color: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    padding: 0.5rem 1.5rem;
    position: sticky;
    top: 0;
    z-index: 999;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.content {
    background-color: var(--main-bg);
    flex-grow: 1;
    padding: 0;
}

/* --- 5. POS & CHECKOUT SPECIFIC --- */
.pos-container { height: calc(100vh - 80px); overflow: hidden; }
.product-grid { height: 100%; overflow-y: auto; padding-right: 10px; }
.cart-section { height: 100%; display: flex; flex-direction: column; background: #fff; border-left: 1px solid #ddd; }
.cart-table-container { flex-grow: 1; overflow-y: auto; }

.product-card {
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid #eee;
    height: 100%;
}
.product-card:hover {
    transform: translateY(-2px);
    border-color: var(--theme-primary);
    box-shadow: 0 4px 8px rgba(0,0,0,0.05);
}

.totals-summary { background: #f8f9fa; border-top: 2px solid var(--theme-primary); padding: 15px; }

/* --- 6. LOGIN PAGE STYLES --- */
.login-container {
    height: 100vh;
}

.brand-section {
    background-color: var(--theme-primary); /* Matches new Teal */
    color: white;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 2rem;
    height: 100%;
}

.brand-logo { font-size: 4rem; margin-bottom: 1rem; color: #ffffff; }
.brand-title { font-weight: 700; font-size: 2.5rem; margin-bottom: 0.5rem; }
.brand-subtitle { font-size: 1.5rem; opacity: 0.9; font-weight: 300; }

.form-section {
    background-color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    height: 100%;
}

.login-box { width: 100%; max-width: 400px; }
.login-header h2 { font-weight: 700; color: #333; margin-bottom: 0.5rem; }
.login-header p { color: #6c757d; margin-bottom: 2rem; }

/* Custom Login Button - Maps to Theme */
.btn-custom {
    background-color: var(--theme-primary);
    border-color: var(--theme-primary);
    color: white;
    font-weight: 600;
    padding: 0.75rem;
    font-size: 1.1rem;
    transition: all 0.3s;
}

.btn-custom:hover {
    background-color: var(--theme-primary-hover);
    border-color: var(--theme-primary-hover);
    color: white;
}

/* Mobile Adjustments for Login */
@media (max-width: 768px) {
    .brand-section {
        height: 30vh; /* Takes top 30% on mobile */
        padding: 1rem;
    }
    .brand-title { font-size: 1.8rem; }
    .brand-subtitle { font-size: 1rem; }
    .form-section { height: 70vh; }
}