/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}

:root {
    /* Fonts */
    --font-heading: 'Outfit', sans-serif;
    
    /* Light Theme Variables */
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --bg-glass: rgba(255, 255, 255, 0.75);
    --border-color: rgba(217, 119, 6, 0.55);
    --border-glass: rgba(217, 119, 6, 0.42);
    
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    
    --primary: #d97706; /* Hardware Amber/Copper */
    --primary-hover: #b45309;
    --primary-gradient: linear-gradient(135deg, #f59e0b, #d97706);
    --primary-glass: rgba(217, 119, 6, 0.1);
    
    --success: #10b981; /* Accounting Green */
    --success-hover: #059669;
    --success-glass: rgba(16, 185, 129, 0.1);
    
    --danger: #ef4444; /* Low Stock Alert Red */
    --danger-hover: #dc2626;
    --danger-glass: rgba(239, 68, 68, 0.1);
    
    --info: #06b6d4; /* Info Cyan */
    --info-glass: rgba(6, 182, 212, 0.1);
    
    --card-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05), 0 10px 15px -3px rgba(0, 0, 0, 0.05);
    --glow-shadow: 0 0 15px rgba(217, 119, 6, 0.2);
}

[data-theme="dark"] {
    /* Dark Theme Variables */
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-glass: rgba(30, 41, 59, 0.7);
    --border-color: #334155;
    --border-glass: rgba(255, 255, 255, 0.06);
    
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #64748b;
    
    --primary: #f59e0b;
    --primary-hover: #fbbf24;
    --primary-gradient: linear-gradient(135deg, #fbbf24, #d97706);
    --primary-glass: rgba(245, 158, 11, 0.15);
    
    --success: #34d399;
    --success-hover: #6ee7b7;
    --success-glass: rgba(52, 211, 153, 0.15);
    
    --danger: #f87171;
    --danger-hover: #fca5a5;
    --danger-glass: rgba(248, 113, 113, 0.15);
    
    --info: #22d3ee;
    --info-glass: rgba(34, 211, 238, 0.15);
    
    --card-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -4px rgba(0, 0, 0, 0.3);
    --glow-shadow: 0 0 20px rgba(245, 158, 11, 0.3);
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    font-size: 13px;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes spinSlow {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Glassmorphism Styles */
.glass-card {
    background: var(--bg-glass);
    backdrop-filter: blur(16px) saturate(120%);
    -webkit-backdrop-filter: blur(16px) saturate(120%);
    border: 1px solid var(--border-glass);
    border-radius: 16px;
    box-shadow: var(--card-shadow);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.glass-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Input Fields & Forms */
.form-group {
    margin-bottom: 20px;
    position: relative;
}

.form-label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 12px;
    font-family: var(--font-heading);
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 13px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glass);
}

/* Alert Boxes */
.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: fadeIn 0.3s ease-out;
}

.alert-danger {
    background-color: var(--danger-glass);
    border: 1px solid var(--danger);
    color: var(--danger);
}

.alert-success {
    background-color: var(--success-glass);
    border: 1px solid var(--success);
    color: var(--success);
}

/* Utility buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    font-size: 13px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    border: none;
    outline: none;
    font-family: var(--font-heading);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-primary {
    background: var(--primary-gradient);
    color: #ffffff;
    box-shadow: 0 4px 12px var(--primary-glass);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--primary-glass), var(--glow-shadow);
    filter: brightness(1.05);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.btn-outline:hover {
    background: var(--border-color);
    color: var(--text-primary);
}

/* AUTHENTICATION PAGES STYLING */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: radial-gradient(circle at 10% 20%, var(--bg-primary) 0%, var(--bg-secondary) 90%);
    position: relative;
    overflow: hidden;
}

.auth-wrapper::before {
    content: '';
    position: absolute;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    background: var(--primary-gradient);
    filter: blur(100px);
    opacity: 0.15;
    top: -50px;
    right: -50px;
    z-index: 0;
}

.auth-wrapper::after {
    content: '';
    position: absolute;
    width: 400px;
    height: 400px;
    border-radius: 50%;
    background: var(--info);
    filter: blur(120px);
    opacity: 0.1;
    bottom: -100px;
    left: -100px;
    z-index: 0;
}

.auth-container {
    width: 100%;
    max-width: 450px;
    z-index: 10;
    animation: fadeIn 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.auth-card {
    padding: 40px;
    border-radius: 20px;
}

.auth-header {
    text-align: center;
    margin-bottom: 30px;
}

.auth-logo {
    font-size: 2.2rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    margin-bottom: 8px;
    font-family: var(--font-heading);
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.auth-subtitle {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.auth-footer {
    text-align: center;
    margin-top: 25px;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.auth-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

.auth-link:hover {
    text-decoration: underline;
}

/* Theme Toggle Button (Global Floating) */
.theme-toggle-floating {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 100;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    box-shadow: var(--card-shadow);
    color: var(--text-primary);
}

.theme-toggle-floating:hover {
    transform: scale(1.1) rotate(15deg);
}

/* DASHBOARD LAYOUT & DESIGN */
.dashboard-wrapper {
    display: flex;
    min-height: 100vh;
    position: relative;
}

/* Sidebar */
.sidebar {
    width: 240px;
    background-color: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    height: 100vh;
    position: sticky;
    top: 0;
    z-index: 50;
    transition: all 0.3s ease;
}

.sidebar-header {
    height: 70px;
    padding: 0 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    flex-shrink: 0;
}

.brand-icon {
    font-size: 1.5rem;
    color: var(--primary);
    animation: spinSlow 20s linear infinite;
}

.brand-name {
    font-size: 1.4rem;
    font-weight: 800;
    font-family: var(--font-heading);
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

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

.profile-avatar {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: var(--primary-gradient);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: bold;
    box-shadow: 0 4px 10px var(--primary-glass);
}

.profile-info {
    flex: 1;
    overflow: hidden;
}

.profile-name {
    font-weight: 600;
    font-size: 12px;
    color: var(--text-primary);
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}

.profile-role {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--primary);
    font-weight: 700;
}

.sidebar-menu {
    list-style: none;
    padding: 20px 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
    overflow-y: auto;
    position: relative;
}

.menu-item a, .menu-item button {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    border-radius: 10px;
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 12px;
}

.menu-item.active a, .menu-item a:hover, .menu-item button:hover {
    background-color: var(--primary-glass);
    color: var(--primary);
}

.menu-item.active a {
    font-weight: 600;
    border-left: 4px solid var(--primary);
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid var(--border-color);
}

/* Main Dashboard Panel */
.dashboard-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0; /* Prevent flex children blowout */
    background-color: var(--bg-primary);
}

.dashboard-topbar {
    height: 70px;
    background-color: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    position: sticky;
    top: 0;
    z-index: 40;
}

.topbar-title {
    font-size: 1.3rem;
    font-weight: 700;
    font-family: var(--font-heading);
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.topbar-btn {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-primary);
}

.topbar-btn:hover {
    color: var(--primary);
    border-color: var(--primary);
    transform: translateY(-2px);
}

/* Dashboard Content Area */
.dashboard-content {
    padding: 30px;
    animation: fadeIn 0.4s ease-out;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

/* Welcome Segment */
.welcome-banner {
    padding: 24px;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--bg-secondary), var(--primary-glass));
    border-left: 5px solid var(--primary);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.welcome-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 6px;
    font-family: var(--font-heading);
}

.welcome-desc {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* Metrics Grid */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
}

.metric-card {
    padding: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.metric-info {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.metric-title {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    font-weight: 600;
}

.metric-value {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text-primary);
    font-family: var(--font-heading);
}

.metric-icon-box {
    width: 54px;
    height: 54px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.metric-card.sales .metric-icon-box {
    background-color: var(--success-glass);
    color: var(--success);
}
.metric-card.value .metric-icon-box {
    background-color: var(--primary-glass);
    color: var(--primary);
}
.metric-card.alerts .metric-icon-box {
    background-color: var(--danger-glass);
    color: var(--danger);
}
.metric-card.cash .metric-icon-box {
    background-color: var(--info-glass);
    color: var(--info);
}

/* Main Content Grid (Tables & Sections) */
.main-grid {
    display: grid;
    grid-template-columns: 2fr 1.3fr;
    gap: 30px;
}

@media (max-width: 1024px) {
    .main-grid {
        grid-template-columns: 1fr;
    }
}

.section-card {
    padding: 24px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.section-title {
    font-size: 1.2rem;
    font-weight: 700;
    font-family: var(--font-heading);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Data Tables */
.table-responsive {
    width: 100%;
    overflow-x: auto;
}

.custom-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 13px;
}

.custom-table th {
    padding: 10px 12px;
    background-color: var(--bg-primary);
    color: var(--text-secondary);
    font-weight: 600;
    border-bottom: 1px solid var(--border-color);
    font-family: var(--font-heading);
    font-size: 12px;
}

.custom-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
    vertical-align: middle;
}

.custom-table tr:last-child td {
    border-bottom: none;
}

.custom-table tbody tr:hover {
    background-color: var(--border-glass);
}

/* Role Badges */
.badge {
    display: inline-flex;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.badge-admin {
    background-color: var(--primary-glass);
    color: var(--primary);
}
.badge-manager {
    background-color: var(--info-glass);
    color: var(--info);
}
.badge-user {
    background-color: var(--success-glass);
    color: var(--success);
}

/* Multi-unit list tags inside inventory list */
.unit-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.unit-tag {
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 4px 8px;
    font-size: 0.8rem;
    display: flex;
    gap: 6px;
}

.unit-name {
    font-weight: 600;
    color: var(--text-secondary);
}

.unit-stock {
    color: var(--primary);
}

.unit-price {
    font-weight: 600;
    color: var(--success);
}

/* Form selectors for permission table */
.role-select {
    padding: 6px 12px;
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 0.85rem;
    outline: none;
    font-weight: 500;
    cursor: pointer;
}

.role-select:focus {
    border-color: var(--primary);
}

/* Footer info */
.footer-text {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-top: 40px;
}

/* Dropdown Menu styling */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-menu {
    display: none;
    position: absolute;
    right: 0;
    top: 48px;
    background-color: var(--bg-secondary);
    min-width: 180px;
    box-shadow: var(--card-shadow);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 8px 0;
    z-index: 100;
    animation: fadeIn 0.2s ease-out;
}

.dropdown-menu.show {
    display: block;
}

.dropdown-item {
    display: flex !important;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.9rem;
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
}

.dropdown-item:hover {
    background-color: var(--primary-glass);
    color: var(--primary);
}

.dropdown-divider {
    height: 1px;
    background-color: var(--border-color);
    margin: 6px 0;
}

/* Sidebar Submenu styling */
.sidebar-menu .has-submenu {
    position: relative;
    display: flex;
    flex-direction: column;
}

.sidebar-menu .has-submenu > a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.submenu-arrow {
    font-size: 0.75rem;
    transition: transform 0.3s ease;
    margin-left: auto;
}

.sidebar-menu .has-submenu.open .submenu-arrow {
    transform: rotate(180deg);
}

.submenu {
    display: none;
    list-style: none;
    padding-left: 15px;
    margin-top: 5px;
    border-left: 1px solid var(--border-color);
    margin-left: 24px;
    flex-direction: column;
    gap: 4px;
}

.sidebar-menu .has-submenu.open .submenu {
    display: flex;
}

.submenu-item a {
    display: block;
    padding: 6px 10px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 12px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.submenu-item a:hover {
    color: var(--primary);
    background-color: var(--primary-glass);
}

.submenu-item.active a {
    color: var(--primary);
    font-weight: 600;
    background-color: var(--primary-glass);
}

/* Modal System Styles */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(5px);
    z-index: 200;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.2s ease-out;
}

.modal-overlay.show {
    display: flex;
}

.modal-container {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.4);
    border-radius: 16px;
    width: 100%;
    max-width: 600px;
    animation: fadeIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    overflow: hidden;
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    font-size: 1.2rem;
    font-weight: 700;
    font-family: var(--font-heading);
    color: var(--text-primary);
}

.modal-close-btn {
    background: none;
    border: none;
    font-size: 1.8rem;
    color: var(--text-muted);
    cursor: pointer;
    line-height: 1;
}

.modal-close-btn:hover {
    color: var(--danger);
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 16px 24px;
    background-color: var(--bg-primary);
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* ============================================================ */
/* THEME: BLUE PROFESSIONAL                                       */
/* ============================================================ */
[data-theme="blue"] {
    --bg-primary: #f0f4ff;
    --bg-secondary: #ffffff;
    --bg-glass: rgba(255, 255, 255, 0.8);
    --border-color: rgba(59, 130, 246, 0.4);
    --border-glass: rgba(59, 130, 246, 0.2);

    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;

    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --primary-gradient: linear-gradient(135deg, #60a5fa, #2563eb);
    --primary-glass: rgba(59, 130, 246, 0.12);

    --success: #10b981;
    --success-hover: #059669;
    --success-glass: rgba(16, 185, 129, 0.1);

    --danger: #ef4444;
    --danger-hover: #dc2626;
    --danger-glass: rgba(239, 68, 68, 0.1);

    --info: #06b6d4;
    --info-glass: rgba(6, 182, 212, 0.1);

    --card-shadow: 0 4px 6px -1px rgba(59, 130, 246, 0.08), 0 10px 15px -3px rgba(59, 130, 246, 0.06);
    --glow-shadow: 0 0 20px rgba(59, 130, 246, 0.25);
}

[data-theme="blue"] .sidebar {
    background: linear-gradient(180deg, #1e3a8a 0%, #1d4ed8 100%) !important;
    border-right: 1px solid rgba(255, 255, 255, 0.1) !important;
}
[data-theme="blue"] .dashboard-topbar {
    background: #1e3a8a !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
}
[data-theme="blue"] .sidebar-header { border-bottom: 1px solid rgba(255,255,255,0.1) !important; }
[data-theme="blue"] .sidebar .brand-name { background: none !important; -webkit-background-clip: unset !important; -webkit-text-fill-color: unset !important; color: #ffffff !important; }
[data-theme="blue"] .sidebar .brand-icon { color: #93c5fd !important; }
[data-theme="blue"] .sidebar-profile { border-bottom: 1px solid rgba(255,255,255,0.1) !important; }
[data-theme="blue"] .sidebar .profile-name { color: #ffffff !important; }
[data-theme="blue"] .sidebar .profile-role { color: #93c5fd !important; }
[data-theme="blue"] .sidebar .profile-avatar { background: rgba(255,255,255,0.15) !important; color: #fff !important; box-shadow: none !important; border: 1px solid rgba(255,255,255,0.2) !important; }
[data-theme="blue"] .sidebar-menu .menu-item a,
[data-theme="blue"] .sidebar-menu .menu-item button { color: rgba(255,255,255,0.85) !important; }
[data-theme="blue"] .sidebar-menu .menu-item.active a,
[data-theme="blue"] .sidebar-menu .menu-item a:hover,
[data-theme="blue"] .sidebar-menu .menu-item button:hover { background-color: rgba(255,255,255,0.15) !important; color: #ffffff !important; }
[data-theme="blue"] .sidebar-menu .menu-item.active a { border-left: 4px solid #93c5fd !important; }
[data-theme="blue"] .sidebar-footer { border-top: 1px solid rgba(255,255,255,0.1) !important; }
[data-theme="blue"] .sidebar-footer a { color: rgba(255,255,255,0.8) !important; }
[data-theme="blue"] .sidebar-footer a:hover { color: #ffffff !important; }
[data-theme="blue"] .dashboard-topbar .topbar-title { color: #ffffff !important; }
[data-theme="blue"] .dashboard-topbar .topbar-title i { color: #93c5fd !important; }
[data-theme="blue"] .dashboard-topbar .topbar-btn { color: #ffffff !important; background: rgba(255,255,255,0.1) !important; border: 1px solid rgba(255,255,255,0.15) !important; }
[data-theme="blue"] .dashboard-topbar .topbar-btn:hover { background: rgba(255,255,255,0.2) !important; }
[data-theme="blue"] .dashboard-topbar .dropdown-menu { background-color: #ffffff !important; }
[data-theme="blue"] .dashboard-topbar .dropdown-item { color: #0f172a !important; }
[data-theme="blue"] .dashboard-topbar .dropdown-item:hover { background-color: #eff6ff !important; }
[data-theme="blue"] .sidebar-menu .submenu { border-left: 1px solid rgba(255,255,255,0.2) !important; }
[data-theme="blue"] .sidebar-menu .submenu .submenu-item a { color: rgba(255,255,255,0.75) !important; }
[data-theme="blue"] .sidebar-menu .submenu .submenu-item a:hover,
[data-theme="blue"] .sidebar-menu .submenu .submenu-item.active a { color: #ffffff !important; background-color: rgba(255,255,255,0.15) !important; }


/* ============================================================ */
/* THEME: GREEN NATURE                                            */
/* ============================================================ */
[data-theme="green"] {
    --bg-primary: #f0fdf4;
    --bg-secondary: #ffffff;
    --bg-glass: rgba(255, 255, 255, 0.8);
    --border-color: rgba(34, 197, 94, 0.4);
    --border-glass: rgba(34, 197, 94, 0.2);

    --text-primary: #052e16;
    --text-secondary: #374151;
    --text-muted: #6b7280;

    --primary: #16a34a;
    --primary-hover: #15803d;
    --primary-gradient: linear-gradient(135deg, #4ade80, #16a34a);
    --primary-glass: rgba(22, 163, 74, 0.12);

    --success: #10b981;
    --success-hover: #059669;
    --success-glass: rgba(16, 185, 129, 0.1);

    --danger: #ef4444;
    --danger-hover: #dc2626;
    --danger-glass: rgba(239, 68, 68, 0.1);

    --info: #0891b2;
    --info-glass: rgba(8, 145, 178, 0.1);

    --card-shadow: 0 4px 6px -1px rgba(22, 163, 74, 0.08), 0 10px 15px -3px rgba(22, 163, 74, 0.06);
    --glow-shadow: 0 0 20px rgba(22, 163, 74, 0.25);
}

[data-theme="green"] .sidebar {
    background: linear-gradient(180deg, #14532d 0%, #166534 100%) !important;
    border-right: 1px solid rgba(255,255,255,0.1) !important;
}
[data-theme="green"] .dashboard-topbar {
    background: #14532d !important;
    border-bottom: 1px solid rgba(255,255,255,0.1) !important;
}
[data-theme="green"] .sidebar-header { border-bottom: 1px solid rgba(255,255,255,0.1) !important; }
[data-theme="green"] .sidebar .brand-name { background: none !important; -webkit-background-clip: unset !important; -webkit-text-fill-color: unset !important; color: #ffffff !important; }
[data-theme="green"] .sidebar .brand-icon { color: #86efac !important; }
[data-theme="green"] .sidebar-profile { border-bottom: 1px solid rgba(255,255,255,0.1) !important; }
[data-theme="green"] .sidebar .profile-name { color: #ffffff !important; }
[data-theme="green"] .sidebar .profile-role { color: #86efac !important; }
[data-theme="green"] .sidebar .profile-avatar { background: rgba(255,255,255,0.15) !important; color: #fff !important; box-shadow: none !important; border: 1px solid rgba(255,255,255,0.2) !important; }
[data-theme="green"] .sidebar-menu .menu-item a,
[data-theme="green"] .sidebar-menu .menu-item button { color: rgba(255,255,255,0.85) !important; }
[data-theme="green"] .sidebar-menu .menu-item.active a,
[data-theme="green"] .sidebar-menu .menu-item a:hover,
[data-theme="green"] .sidebar-menu .menu-item button:hover { background-color: rgba(255,255,255,0.15) !important; color: #ffffff !important; }
[data-theme="green"] .sidebar-menu .menu-item.active a { border-left: 4px solid #86efac !important; }
[data-theme="green"] .sidebar-footer { border-top: 1px solid rgba(255,255,255,0.1) !important; }
[data-theme="green"] .sidebar-footer a { color: rgba(255,255,255,0.8) !important; }
[data-theme="green"] .sidebar-footer a:hover { color: #ffffff !important; }
[data-theme="green"] .dashboard-topbar .topbar-title { color: #ffffff !important; }
[data-theme="green"] .dashboard-topbar .topbar-title i { color: #86efac !important; }
[data-theme="green"] .dashboard-topbar .topbar-btn { color: #ffffff !important; background: rgba(255,255,255,0.1) !important; border: 1px solid rgba(255,255,255,0.15) !important; }
[data-theme="green"] .dashboard-topbar .topbar-btn:hover { background: rgba(255,255,255,0.2) !important; }
[data-theme="green"] .dashboard-topbar .dropdown-menu { background-color: #ffffff !important; }
[data-theme="green"] .dashboard-topbar .dropdown-item { color: #052e16 !important; }
[data-theme="green"] .dashboard-topbar .dropdown-item:hover { background-color: #f0fdf4 !important; }
[data-theme="green"] .sidebar-menu .submenu { border-left: 1px solid rgba(255,255,255,0.2) !important; }
[data-theme="green"] .sidebar-menu .submenu .submenu-item a { color: rgba(255,255,255,0.75) !important; }
[data-theme="green"] .sidebar-menu .submenu .submenu-item a:hover,
[data-theme="green"] .sidebar-menu .submenu .submenu-item.active a { color: #ffffff !important; background-color: rgba(255,255,255,0.15) !important; }


/* ============================================================ */
/* THEME: PURPLE ROYAL                                            */
/* ============================================================ */
[data-theme="purple"] {
    --bg-primary: #faf5ff;
    --bg-secondary: #ffffff;
    --bg-glass: rgba(255, 255, 255, 0.8);
    --border-color: rgba(139, 92, 246, 0.4);
    --border-glass: rgba(139, 92, 246, 0.2);

    --text-primary: #1e1b4b;
    --text-secondary: #4b5563;
    --text-muted: #9ca3af;

    --primary: #7c3aed;
    --primary-hover: #6d28d9;
    --primary-gradient: linear-gradient(135deg, #a78bfa, #7c3aed);
    --primary-glass: rgba(124, 58, 237, 0.12);

    --success: #10b981;
    --success-hover: #059669;
    --success-glass: rgba(16, 185, 129, 0.1);

    --danger: #ef4444;
    --danger-hover: #dc2626;
    --danger-glass: rgba(239, 68, 68, 0.1);

    --info: #06b6d4;
    --info-glass: rgba(6, 182, 212, 0.1);

    --card-shadow: 0 4px 6px -1px rgba(124, 58, 237, 0.08), 0 10px 15px -3px rgba(124, 58, 237, 0.06);
    --glow-shadow: 0 0 20px rgba(124, 58, 237, 0.3);
}

[data-theme="purple"] .sidebar {
    background: linear-gradient(180deg, #2e1065 0%, #4c1d95 100%) !important;
    border-right: 1px solid rgba(255,255,255,0.1) !important;
}
[data-theme="purple"] .dashboard-topbar {
    background: #2e1065 !important;
    border-bottom: 1px solid rgba(255,255,255,0.1) !important;
}
[data-theme="purple"] .sidebar-header { border-bottom: 1px solid rgba(255,255,255,0.1) !important; }
[data-theme="purple"] .sidebar .brand-name { background: none !important; -webkit-background-clip: unset !important; -webkit-text-fill-color: unset !important; color: #ffffff !important; }
[data-theme="purple"] .sidebar .brand-icon { color: #c4b5fd !important; }
[data-theme="purple"] .sidebar-profile { border-bottom: 1px solid rgba(255,255,255,0.1) !important; }
[data-theme="purple"] .sidebar .profile-name { color: #ffffff !important; }
[data-theme="purple"] .sidebar .profile-role { color: #c4b5fd !important; }
[data-theme="purple"] .sidebar .profile-avatar { background: rgba(255,255,255,0.15) !important; color: #fff !important; box-shadow: none !important; border: 1px solid rgba(255,255,255,0.2) !important; }
[data-theme="purple"] .sidebar-menu .menu-item a,
[data-theme="purple"] .sidebar-menu .menu-item button { color: rgba(255,255,255,0.85) !important; }
[data-theme="purple"] .sidebar-menu .menu-item.active a,
[data-theme="purple"] .sidebar-menu .menu-item a:hover,
[data-theme="purple"] .sidebar-menu .menu-item button:hover { background-color: rgba(255,255,255,0.15) !important; color: #ffffff !important; }
[data-theme="purple"] .sidebar-menu .menu-item.active a { border-left: 4px solid #c4b5fd !important; }
[data-theme="purple"] .sidebar-footer { border-top: 1px solid rgba(255,255,255,0.1) !important; }
[data-theme="purple"] .sidebar-footer a { color: rgba(255,255,255,0.8) !important; }
[data-theme="purple"] .sidebar-footer a:hover { color: #ffffff !important; }
[data-theme="purple"] .dashboard-topbar .topbar-title { color: #ffffff !important; }
[data-theme="purple"] .dashboard-topbar .topbar-title i { color: #c4b5fd !important; }
[data-theme="purple"] .dashboard-topbar .topbar-btn { color: #ffffff !important; background: rgba(255,255,255,0.1) !important; border: 1px solid rgba(255,255,255,0.15) !important; }
[data-theme="purple"] .dashboard-topbar .topbar-btn:hover { background: rgba(255,255,255,0.2) !important; }
[data-theme="purple"] .dashboard-topbar .dropdown-menu { background-color: #ffffff !important; }
[data-theme="purple"] .dashboard-topbar .dropdown-item { color: #1e1b4b !important; }
[data-theme="purple"] .dashboard-topbar .dropdown-item:hover { background-color: #faf5ff !important; }
[data-theme="purple"] .sidebar-menu .submenu { border-left: 1px solid rgba(255,255,255,0.2) !important; }
[data-theme="purple"] .sidebar-menu .submenu .submenu-item a { color: rgba(255,255,255,0.75) !important; }
[data-theme="purple"] .sidebar-menu .submenu .submenu-item a:hover,
[data-theme="purple"] .sidebar-menu .submenu .submenu-item.active a { color: #ffffff !important; background-color: rgba(255,255,255,0.15) !important; }


/* ============================================================ */
/* THEME PICKER PANEL                                             */
/* ============================================================ */
.theme-picker-wrapper {
    position: relative;
    display: inline-block;
}

.theme-picker-panel {
    display: none;
    position: absolute;
    right: 0;
    top: 52px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 16px;
    z-index: 300;
    box-shadow: 0 20px 40px rgba(0,0,0,0.15);
    min-width: 240px;
    animation: fadeIn 0.2s ease-out;
}

.theme-picker-panel.show {
    display: block;
}

.theme-picker-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-muted);
    margin-bottom: 12px;
    font-family: var(--font-heading);
}

.theme-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.theme-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    cursor: pointer;
    border: 2px solid transparent;
    background: var(--bg-primary);
    transition: all 0.2s ease;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
}

.theme-option:hover {
    border-color: var(--border-color);
    transform: translateY(-1px);
}

.theme-option.active-theme {
    border-color: var(--primary);
    background: var(--primary-glass);
}

.theme-swatch {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
    border: 2px solid rgba(255,255,255,0.5);
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.theme-swatch.swatch-light   { background: linear-gradient(135deg, #0d5334, #f59e0b); }
.theme-swatch.swatch-dark    { background: linear-gradient(135deg, #0f172a, #f59e0b); }
.theme-swatch.swatch-blue    { background: linear-gradient(135deg, #1e3a8a, #60a5fa); }
.theme-swatch.swatch-green   { background: linear-gradient(135deg, #14532d, #4ade80); }
.theme-swatch.swatch-purple  { background: linear-gradient(135deg, #2e1065, #a78bfa); }


/* Light Mode (Sada Mode) Navbar & Sidebar Green Background and Styling */
[data-theme="light"] .sidebar {
    background: linear-gradient(180deg, #0d5334 0%, #157347 100%) !important;
    border-right: 1px solid rgba(255, 255, 255, 0.1) !important;
}

[data-theme="light"] .dashboard-topbar {
    background: #0d5334 !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
}

[data-theme="light"] .sidebar-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
}

[data-theme="light"] .sidebar .brand-name {
    background: none !important;
    -webkit-background-clip: unset !important;
    -webkit-text-fill-color: unset !important;
    color: #ffffff !important;
}

[data-theme="light"] .sidebar .brand-icon {
    color: #34d399 !important;
}

[data-theme="light"] .sidebar-profile {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
}

[data-theme="light"] .sidebar .profile-name {
    color: #ffffff !important;
}

[data-theme="light"] .sidebar .profile-role {
    color: #34d399 !important;
}

[data-theme="light"] .sidebar .profile-avatar {
    background: rgba(255, 255, 255, 0.15) !important;
    color: #ffffff !important;
    box-shadow: none !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
}

[data-theme="light"] .sidebar-menu .menu-item a,
[data-theme="light"] .sidebar-menu .menu-item button {
    color: rgba(255, 255, 255, 0.85) !important;
}

[data-theme="light"] .sidebar-menu .menu-item.active a,
[data-theme="light"] .sidebar-menu .menu-item a:hover,
[data-theme="light"] .sidebar-menu .menu-item button:hover {
    background-color: rgba(255, 255, 255, 0.15) !important;
    color: #ffffff !important;
}

[data-theme="light"] .sidebar-menu .menu-item.active a {
    border-left: 4px solid #34d399 !important;
}

[data-theme="light"] .sidebar-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.1) !important;
}

[data-theme="light"] .sidebar-footer a {
    color: rgba(255, 255, 255, 0.8) !important;
}

[data-theme="light"] .sidebar-footer a:hover {
    color: #ffffff !important;
}

[data-theme="light"] .dashboard-topbar .topbar-title {
    color: #ffffff !important;
}

[data-theme="light"] .dashboard-topbar .topbar-title i {
    color: #34d399 !important;
}

[data-theme="light"] .dashboard-topbar .topbar-btn {
    color: #ffffff !important;
    background: rgba(255, 255, 255, 0.1) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
}

[data-theme="light"] .dashboard-topbar .topbar-btn:hover {
    background: rgba(255, 255, 255, 0.2) !important;
}

[data-theme="light"] .dashboard-topbar .dropdown-menu {
    background-color: #ffffff !important;
}

[data-theme="light"] .dashboard-topbar .dropdown-item {
    color: #0f172a !important;
}

[data-theme="light"] .dashboard-topbar .dropdown-item:hover {
    background-color: #f1f5f9 !important;
}

[data-theme="light"] .sidebar-menu .submenu {
    border-left: 1px solid rgba(255, 255, 255, 0.2) !important;
}

/* ============================================================ */
/* TOPBAR CLOCK — colored topbar themes (সাদা টেক্সট)          */
/* ============================================================ */
[data-theme="light"] #clockTime,
[data-theme="blue"]  #clockTime,
[data-theme="green"] #clockTime,
[data-theme="purple"] #clockTime {
    color: #ffffff !important;
}

[data-theme="light"] #clockDate,
[data-theme="blue"]  #clockDate,
[data-theme="green"] #clockDate,
[data-theme="purple"] #clockDate {
    color: rgba(255, 255, 255, 0.7) !important;
}

[data-theme="light"] #topbarClock,
[data-theme="blue"]  #topbarClock,
[data-theme="green"] #topbarClock,
[data-theme="purple"] #topbarClock {
    border-left-color: rgba(255, 255, 255, 0.2) !important;
    border-right-color: rgba(255, 255, 255, 0.2) !important;
}


/* =========================================================
   Custom Pagination Styles (Bootstrap 5 HTML Structure)
   ========================================================= */
.pagination {
    display: flex;
    padding-left: 0;
    list-style: none;
    justify-content: center;
    align-items: center;
    gap: 5px;
    margin-top: 15px;
    flex-wrap: wrap;
}
.page-item .page-link {
    position: relative;
    display: block;
    padding: 0.5rem 0.85rem;
    color: var(--primary);
    text-decoration: none;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.85rem;
    transition: all 0.2s;
}
.page-item.active .page-link {
    z-index: 3;
    color: #fff;
    background-color: var(--primary);
    border-color: var(--primary);
    box-shadow: 0 4px 6px rgba(99, 102, 241, 0.2);
}
.page-item.disabled .page-link {
    color: var(--text-muted);
    pointer-events: none;
    background-color: var(--bg-primary);
    border-color: var(--border-color);
    opacity: 0.7;
}
.page-link:hover {
    z-index: 2;
    color: #fff;
    background-color: var(--primary);
    border-color: var(--primary);
}
/* Mobile Pagination structure */
.d-flex.justify-content-between.flex-fill.d-sm-none {
    display: flex;
    width: 100%;
    justify-content: space-between;
}
/* Results text structure */
nav p.small.text-muted {
    margin-bottom: 12px;
    color: var(--text-secondary);
    text-align: center;
    font-size: 0.85rem;
    width: 100%;
    display: block;
    font-weight: 500;
}

/* Mobile Responsiveness */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    z-index: 45;
}
.sidebar-overlay.show { display: block; }

.mobile-menu-toggle {
    display: none;
    border: none;
    background: transparent;
    font-size: 1.2rem;
    cursor: pointer;
    color: var(--text-primary);
}

@media (max-width: 1024px) {
    .sidebar {
        position: fixed;
        left: -240px;
        transition: left 0.3s ease;
        height: 100vh;
        z-index: 50;
    }
    .sidebar.show {
        left: 0;
        box-shadow: 4px 0 15px rgba(0,0,0,0.1);
    }
    .mobile-menu-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 36px; height: 36px;
        border-radius: 8px;
        background: var(--bg-primary);
        border: 1px solid var(--border-color);
    }
    .topbar-title {
        display: flex;
        align-items: center;
        font-size: 1.1rem;
    }
    .dashboard-topbar {
        padding: 0 15px;
    }
    .dashboard-content {
        padding: 15px;
    }
    .metrics-grid {
        grid-template-columns: 1fr;
    }
    .main-grid {
        grid-template-columns: 1fr;
    }
    .company-banner {
        flex-direction: column;
        align-items: flex-start;
        padding: 20px;
    }
    .banner-icon-wrap {
        position: absolute;
        right: 20px; top: 20px;
    }
    .kpi-strip {
        grid-template-columns: 1fr;
    }
    .metric-row {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (max-width: 600px) {
    .metric-row {
        grid-template-columns: 1fr;
    }
    .quick-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .topbar-actions {
        gap: 8px;
    }
    .dashboard-topbar {
        padding: 0 10px;
    }
    #topbarClock {
        display: none !important;
    }
}


/* Desktop Sidebar Collapse */
.desktop-menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px; height: 36px;
    border-radius: 8px;
    background: transparent;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: var(--text-primary);
    transition: all 0.2s ease;
}
.desktop-menu-toggle:hover {
    background: var(--primary-glass);
    color: var(--primary);
}

@media (min-width: 1025px) {
    body.sidebar-collapsed .sidebar {
        width: 80px;
    }
    body.sidebar-collapsed .sidebar:hover {
        width: 240px;
        box-shadow: 4px 0 15px rgba(0,0,0,0.1);
    }
    body.sidebar-collapsed .sidebar:not(:hover) .brand-name,
    body.sidebar-collapsed .sidebar:not(:hover) .profile-info,
    body.sidebar-collapsed .sidebar:not(:hover) .menu-item span,
    body.sidebar-collapsed .sidebar:not(:hover) .submenu-arrow,
    body.sidebar-collapsed .sidebar:not(:hover) .submenu,
    body.sidebar-collapsed .sidebar:not(:hover) .sidebar-footer {
        display: none !important;
    }
    body.sidebar-collapsed .sidebar:not(:hover) .menu-item a,
    body.sidebar-collapsed .sidebar:not(:hover) .menu-item button {
        justify-content: center;
        padding: 14px 0;
    }
    body.sidebar-collapsed .sidebar:not(:hover) .menu-item i {
        font-size: 1.3rem;
        margin: 0 !important;
    }
    body.sidebar-collapsed .sidebar:not(:hover) .profile-avatar {
        width: 40px; height: 40px; font-size: 1rem;
    }
    body.sidebar-collapsed .sidebar:not(:hover) .sidebar-profile {
        justify-content: center;
        padding: 15px 5px;
    }
}

