/* custom.css - Pharmacy ERP Style Sheet (Green Theme & Dark Mode) */

:root {
    --primary-color: #198754;
    --primary-hover: #146c43;
    --primary-soft: rgba(25, 135, 84, 0.1);
    --bg-light: #f8f9fa;
    --bg-sidebar: #ffffff;
    --text-dark: #212529;
    --text-muted: #6c757d;
    --border-color: #dee2e6;
    --card-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --transition-speed: 0.3s;
}

[data-bs-theme="dark"] {
    --bg-light: #121212;
    --bg-sidebar: #1e1e1e;
    --text-dark: #f8f9fa;
    --text-muted: #a0a0a0;
    --border-color: #383838;
    --card-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
}

body {
    font-family: 'Outfit', 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-light);
    color: var(--text-dark);
    transition: background-color var(--transition-speed), color var(--transition-speed);
    overflow-x: hidden;
}

/* Page Loader */
#page-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(255, 255, 255, 0.85);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}
[data-bs-theme="dark"] #page-loader {
    background: rgba(18, 18, 18, 0.85);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}
[data-bs-theme="dark"] ::-webkit-scrollbar-thumb {
    background: #475569;
}

/* Dashboard Sidebar Styling */
#wrapper {
    display: flex;
    width: 100%;
    align-items: stretch;
}

#sidebar {
    min-width: 260px;
    max-width: 260px;
    background: var(--bg-sidebar);
    color: var(--text-dark);
    transition: all var(--transition-speed) cubic-bezier(0.4, 0, 0.2, 1);
    border-right: 1px solid var(--border-color);
    z-index: 1000;
}

#sidebar.active {
    margin-left: -260px;
}

#sidebar .sidebar-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
}

#sidebar ul.components {
    padding: 15px 0;
}

#sidebar ul p {
    color: var(--text-muted);
    padding: 10px 20px;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 700;
    margin-bottom: 5px;
}

#sidebar ul li a {
    padding: 12px 20px;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    color: var(--text-dark);
    text-decoration: none;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

#sidebar ul li a i {
    margin-right: 12px;
    width: 20px;
    text-align: center;
    font-size: 1.1rem;
    color: var(--text-muted);
    transition: color 0.2s ease;
}

#sidebar ul li a:hover {
    background: var(--primary-soft);
    color: var(--primary-color);
    border-left-color: var(--primary-color);
}

#sidebar ul li a:hover i {
    color: var(--primary-color);
}

#sidebar ul li.active > a {
    color: var(--primary-color);
    background: var(--primary-soft);
    border-left-color: var(--primary-color);
    font-weight: 600;
}

#sidebar ul li.active > a i {
    color: var(--primary-color);
}

/* Content Area */
#content {
    width: 100%;
    min-height: 100vh;
    transition: all var(--transition-speed);
    display: flex;
    flex-direction: column;
}

.navbar {
    background: var(--bg-sidebar);
    border-bottom: 1px solid var(--border-color);
    padding: 15px 20px;
}

.navbar-btn {
    box-shadow: none;
    outline: none !important;
    border: none;
}

/* Cards & Widgets */
.card {
    border: 1px solid var(--border-color);
    background-color: var(--bg-sidebar);
    box-shadow: var(--card-shadow);
    border-radius: 12px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card-hover:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.08);
}

.widget-icon {
    width: 50px;
    height: 50px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

/* Theme Button Toggles */
.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}
.btn-primary:hover, .btn-primary:focus, .btn-primary:active {
    background-color: var(--primary-hover) !important;
    border-color: var(--primary-hover) !important;
}

/* Badge colors matching Green Branding */
.bg-success-soft {
    background-color: rgba(25, 135, 84, 0.1);
    color: #198754;
}

/* POS styling helper */
.pos-table-container {
    max-height: calc(100vh - 350px);
    overflow-y: auto;
}

/* Auth Cards */
.auth-container {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: var(--bg-light);
}

.auth-card {
    width: 100%;
    max-width: 420px;
    border: none;
    border-radius: 16px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.05);
    background-color: var(--bg-sidebar);
}

/* Responsiveness overrides */
@media (max-width: 768px) {
    #sidebar {
        margin-left: -260px;
    }
    #sidebar.active {
        margin-left: 0;
    }
    #sidebarCollapse span {
        display: none;
    }
}
