/**
 * Main stylesheet for 
 */

/* Import Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&family=Inter:wght@300;400;500;600;700&display=swap');

/* ================================
 * THEME SYSTEM - CSS CUSTOM PROPERTIES
 * ================================ */
:root {
    /* Background Colors */
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    --bg-light: #f8fafc;
    --bg-white: #ffffff;
    --background-color: #ffffff;
    --secondary-bg: #f8fafc;
    --card-bg: #ffffff;

    /* Text Colors */
    --text-primary: #1f2937;
    --text-secondary: #64748b;
    --text-tertiary: #94a3b8;
    --text-color: #1f2937;
    --text-light: #64748b;
    --text-dark: #1f2937;
    --text-muted: #64748b;

    /* Border Colors */
    --border-primary: rgba(241, 245, 249, 0.8);
    --border-secondary: #e5e7eb;
    --border-color: #e5e7eb;
    --border-light: rgba(241, 245, 249, 0.8);

    /* Shadow Colors */
    --shadow-light: rgba(0, 0, 0, 0.08);
    --shadow-medium: rgba(0, 0, 0, 0.12);
    --shadow-heavy: rgba(0, 0, 0, 0.15);
    --shadow-color: rgba(0, 0, 0, 0.12);

    /* Overlay Colors */
    --overlay-light: rgba(255, 255, 255, 0.8);
    --overlay-medium: rgba(255, 255, 255, 0.95);

    /* Gradient Colors */
    --gradient-start: rgba(253, 126, 20, 0.03);
    --gradient-end: rgba(255, 159, 67, 0.02);
    --gradient-mid: rgba(255, 255, 255, 0.05);

    /* Primary Brand Colors */
    --primary-color: #fd7e14;
    --primary-dark: #e8590c;
    --primary-light: #ff9f43;
    --accent-color: #FFA07A;
    --primary-orange: #fd7e14;
    --primary-orange-light: #ff9f43;
    --primary-orange-dark: #e8590c;

    /* Status Colors */
    --danger-color: #EF4444;
    --success-color: #10B981;
    --warning-color: #F59E0B;
    --info-color: #3B82F6;

    /* Typography */
    --font-primary: 'Poppins', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    --font-secondary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    --font-size-xs: 12px;
    --font-size-sm: 12px;
    --font-size-base: 14px;
    --font-size-md: 16px;
    --font-size-lg: 18px;
    --font-size-xl: 24px;
    --font-size-2xl: 32px;

    /* Spacing */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
    --spacing-2xl: 48px;

    /* Border Radius */
    --border-radius-xs: 2px;
    --border-radius-sm: 4px;
    --border-radius-md: 8px;
    --border-radius-lg: 12px;
    --border-radius-xl: 16px;
    --border-radius-2xl: 20px;
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;

    /* Shadows */
    --shadow-xs: 0 1px 2px var(--shadow-light);
    --shadow-sm: 0 2px 4px var(--shadow-light);
    --shadow-md: 0 4px 12px var(--shadow-medium);
    --shadow-lg: 0 8px 25px var(--shadow-heavy);
    --shadow-xl: 0 10px 25px var(--shadow-heavy);
    --shadow-2xl: 0 20px 60px var(--shadow-heavy);

    /* Z-Index */
    --z-dropdown: 1000;
    --z-sticky: 1020;
    --z-fixed: 1030;
    --z-modal-backdrop: 1040;
    --z-modal: 1050;
    --z-popover: 1060;
    --z-tooltip: 1070;
    --z-toast: 1080;
    --z-topbar: 9999;
    --z-topbar-dropdown: 10000;
    --z-notification-system: 99998;

    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-base: 0.3s ease;
    --transition-slow: 0.5s ease;
    --transition-all: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dark Theme */
:root.theme-dark {
    --bg-primary: #1f2937;
    --bg-secondary: #374151;
    --bg-tertiary: #4b5563;
    --bg-light: #374151;
    --bg-white: #1f2937;
    --background-color: #1f2937;
    --secondary-bg: #374151;
    --card-bg: #1f2937;

    --text-primary: #f9fafb;
    --text-secondary: #d1d5db;
    --text-tertiary: #9ca3af;
    --text-color: #f9fafb;
    --text-light: #d1d5db;
    --text-dark: #f9fafb;
    --text-muted: #d1d5db;

    --border-primary: rgba(75, 85, 99, 0.8);
    --border-secondary: #6b7280;
    --border-color: #6b7280;
    --border-light: rgba(75, 85, 99, 0.8);

    --shadow-light: rgba(0, 0, 0, 0.25);
    --shadow-medium: rgba(0, 0, 0, 0.35);
    --shadow-heavy: rgba(0, 0, 0, 0.45);
    --shadow-color: rgba(0, 0, 0, 0.35);

    --overlay-light: rgba(31, 41, 55, 0.8);
    --overlay-medium: rgba(31, 41, 55, 0.95);

    --gradient-start: rgba(253, 126, 20, 0.05);
    --gradient-end: rgba(255, 159, 67, 0.03);
    --gradient-mid: rgba(31, 41, 55, 0.05);
}

/* Base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-primary);
    font-size: var(--font-size-base);
    color: var(--text-primary);
    background-color: var(--bg-secondary);
    line-height: 1.5;
    transition: background-color 0.3s ease, color 0.3s ease;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-primary);
    font-weight: 600;
    margin-bottom: var(--spacing-md);
    color: var(--text-primary);
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--primary-dark);
}

/* Layout */
.app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    position: relative;
}

.content-wrapper {
    flex: 1;
    padding-bottom: 74px;
    /* Adjusted for new mobile nav height (64px + 10px buffer) */
}

@media (min-width: 992px) {
    .app-container {
        flex-direction: row;
    }

    .content-wrapper {
        margin-left: 250px;
        padding-bottom: 0;
        /* Reset for desktop */
    }
}

/* Header */
.app-header {
    background-color: var(--bg-primary);
    border-bottom: 1px solid var(--border-secondary);
    padding: var(--spacing-md) 0;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.header-title h1 {
    margin-bottom: 0;
    color: var(--text-primary);
}

/* Mobile Menu Toggle Button */
.mobile-menu-toggle {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 24px;
    cursor: pointer;
    padding: var(--spacing-xs);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.3s ease;
}

.mobile-menu-toggle:focus {
    outline: none;
}

/* Main content */
.app-main {
    padding: var(--spacing-lg) 0;
}

/* === START OF REDESIGNED MOBILE NAVIGATION === */
.mobile-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 64px;
    /* Standard height for better touch and visual balance */
    background-color: var(--bg-primary);
    border-top: 1px solid var(--border-secondary);
    box-shadow: 0 -2px 10px var(--shadow-light);
    z-index: 1000;
    display: flex;
    padding: 0 var(--spacing-xs);
    /* Small horizontal padding for the bar itself */
    transition: background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.mobile-nav .nav-list {
    display: flex;
    list-style: none;
    padding: 5px 0 0 0;
    margin: 0;
    width: 100%;
    justify-content: space-around;
    /* Evenly distribute items */
}

.mobile-nav .nav-item {
    flex: 1;
    /* Each item takes equal width */
    display: flex;
    justify-content: center;
    align-items: center;
}

.mobile-nav .nav-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    /* Updated padding: More top, less bottom */
    padding: 6px 0 0px;
    text-decoration: none;
    text-align: center;
    border-radius: var(--border-radius-md);
    transition: background-color 0.15s ease-out;
    -webkit-tap-highlight-color: transparent;
    position: relative;
    overflow: hidden;
}


/* Indicator for mobile navigation items */
.mobile-nav .nav-link .nav-icon::before {
    content: '';
    position: absolute;
    top: -5px;
    /* Adjust for spacing above the icon (e.g., -4px to -6px) */
    left: 50%;
    width: 18px;
    /* Width of the indicator pill */
    height: 3.5px;
    /* Thickness of the indicator pill */
    background-color: var(--primary-color);
    border-radius: 2px;
    /* For rounded pill ends */

    /* Initial state: hidden and slightly scaled down */
    opacity: 0;
    transform: translateX(-50%) scaleX(0.3);
    transform-origin: center;
    /* Smooth transition with a slight "elastic" feel */
    transition: opacity 0.25s ease-out, transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}


.mobile-nav .nav-icon {
    line-height: 1;
    /* Ensure icon is not pushed by line height */
    margin-bottom: 3px;
    /* Space between icon and text */
    display: flex;
    align-items: center;
    justify-content: center;
    height: 24px;
    /* Consistent icon area height */
    width: 24px;
    /* Consistent icon area width */
    position: relative;
    /* Crucial for positioning the ::before indicator */
}

.mobile-nav .nav-icon i {
    font-size: 22px;
    /* Icon visual size */
    color: var(--text-primary);
    opacity: 0.65;
    /* Muted color for inactive icons */
    transition: color 0.2s ease-in-out, opacity 0.2s ease-in-out, transform 0.2s ease-in-out;
}

.mobile-nav .nav-text {
    font-size: 11px;
    /* Clear, legible text size for bottom nav */
    font-weight: 500;
    /* Slightly more emphasis than 400 */
    color: var(--text-primary);
    opacity: 0.7;
    /* Muted color for inactive text */
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: calc(100% - 8px);
    /* Prevent text from touching edges of its container */
    letter-spacing: 0.1px;
    transition: font-weight 0.2s ease-in-out, color 0.2s ease-in-out, opacity 0.2s ease-in-out, transform 0.2s ease-in-out;
    /* Added transform here */
}

/* Active State */
.mobile-nav .nav-link.active .nav-icon::before {
    opacity: 1;
    transform: translateX(-50%) scaleX(1);
    /* Indicator grows to full specified width */
}

.mobile-nav .nav-link.active .nav-icon i {
    color: var(--primary-color);
    opacity: 1;
    transform: translateY(-2px) scale(1.03);
    /* Subtle lift and scale for the active icon */
}

.mobile-nav .nav-link.active .nav-text {
    color: var(--primary-color);
    opacity: 1;
    font-weight: 600;
    /* Bolder text for active state */
    /* Optional: transform: translateY(-1px); to subtly lift text with icon */
}

/* Hover State (for non-touch devices, or to preview active state) */
.mobile-nav .nav-link:hover:not(.active) .nav-icon i,
.mobile-nav .nav-link:hover:not(.active) .nav-text {
    opacity: 0.9;
    /* Slightly more prominent on hover */
}

/* Ripple Effect */
.mobile-nav .nav-link::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    /* Start with full width to calculate diagonal */
    padding-top: 100%;
    /* Create a square for the circle to fit in */
    min-width: 80px;
    /* Ensure ripple is large enough on wider items */
    min-height: 80px;
    background-color: var(--primary-color);
    border-radius: 50%;
    transform: translate(-50%, -50%) scale(0);
    opacity: 0;
    transition: transform 0.3s cubic-bezier(0, 0, 0.2, 1), opacity 0.4s cubic-bezier(0, 0, 0.2, 1);
    pointer-events: none;
    /* So it doesn't interfere with clicks */
}

.mobile-nav .nav-link:active::before {
    transform: translate(-50%, -50%) scale(1);
    opacity: 0.12;
    /* Standard ripple opacity */
    transition-duration: 0.15s, 0.1s;
    /* Faster activation */
}

/* Responsive Adjustments for Mobile Navigation */
@media (max-width: 360px) {

    /* For very small screens */
    .mobile-nav {
        height: 60px;
    }

    .content-wrapper {
        /* Adjust padding for smaller nav bar */
        padding-bottom: 70px;
        /* 60px + 10px buffer */
    }

    .mobile-nav .nav-icon i {
        font-size: 20px;
    }

    .mobile-nav .nav-text {
        font-size: 10px;
    }

    .mobile-nav .nav-icon {
        height: 22px;
        width: 22px;
        margin-bottom: 2px;
    }
}

@media (min-width: 992px) {
    .mobile-nav {
        display: none;
        /* Hide on desktop */
    }

    .content-wrapper {
        /* Reset padding for desktop */
        padding-bottom: 0;
    }
}

/* === END OF REDESIGNED MOBILE NAVIGATION === */

/* Sidebar */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 250px;
    height: 100vh;
    background-color: var(--bg-primary);
    border-right: 1px solid var(--border-secondary);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.sidebar-header {
    padding: var(--spacing-lg);
    border-bottom: 1px solid var(--border-secondary);
    transition: border-color 0.3s ease;
}

.app-name {
    font-size: var(--font-size-lg);
    font-weight: 700;
    margin: 0;
    color: var(--primary-color);
}

.sidebar-user {
    padding: var(--spacing-lg);
    border-bottom: 1px solid var(--border-secondary);
    transition: border-color 0.3s ease;
}

.user-info {
    display: flex;
    align-items: center;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: var(--spacing-md);
}

.user-avatar i {
    font-size: 24px;
    color: var(--bg-primary);
}

.user-name {
    font-size: var(--font-size-md);
    font-weight: 600;
    margin: 0;
    color: var(--text-primary);
}

.user-role {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    opacity: 0.7;
    margin: 0;
}

.sidebar-nav {
    flex: 1;
    padding: var(--spacing-md) 0;
    overflow-y: auto;
}

.nav-list {
    /* This class is used in sidebar AND mobile-nav, ensure specificity or commonality */
    list-style: none;
    padding: 0;
    margin: 0;
}

/* Sidebar specific nav-item and nav-link styles */
.sidebar-nav .nav-item {
    margin-bottom: var(--spacing-xs);
    position: relative;
}

.sidebar-nav .nav-item.has-submenu>.nav-link {
    display: flex;
    justify-content: space-between;
}

.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    padding: var(--spacing-md) var(--spacing-lg);
    color: var(--text-primary);
    transition: all 0.3s ease;
    /* Resetting mobile-nav specific styles if any conflict */
    flex-direction: row;
    justify-content: flex-start;
    text-align: left;
    overflow: visible;
    /* Reset overflow for sidebar links */
    border-radius: var(--border-radius-md);
    /* Apply consistent border-radius */
}

.sidebar-nav .nav-link i {
    font-size: 20px;
    margin-right: var(--spacing-md);
    opacity: 1;
    /* Reset opacity for sidebar icons */
    color: inherit;
    /* Inherit color from .nav-link */
}

.sidebar-nav .nav-link:hover {
    background-color: var(--bg-secondary);
}

.sidebar-nav .nav-link.active {
    background-color: var(--primary-color);
    color: white;
    font-weight: 500;
    box-shadow: 0 2px 5px rgba(253, 126, 20, 0.3);
    transition: all 0.3s ease;
}

.sidebar-nav .nav-link.active i {
    color: white;
    /* Ensure active icon color is white in sidebar */
}

/* Submenu Toggle Icon */
.submenu-toggle {
    margin-left: auto !important;
    margin-right: 0 !important;
    transition: transform 0.3s ease;
    font-size: 16px !important;
}

.nav-item.has-submenu.expanded .submenu-toggle {
    transform: rotate(180deg);
}

/* Submenu Styles */
.submenu {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    opacity: 0;
    visibility: hidden;
}

.submenu.show,
.nav-item.has-submenu.expanded .submenu {
    max-height: 200px;
    /* Adjust based on expected content height */
    opacity: 1;
    visibility: visible;
    transition: max-height 0.3s ease, opacity 0.2s ease 0.1s, visibility 0s 0s;
}

.submenu-item {
    margin: 0;
}

.submenu-link {
    display: flex;
    align-items: center;
    padding: var(--spacing-sm) var(--spacing-lg) var(--spacing-sm) calc(var(--spacing-lg) + 20px);
    color: var(--text-primary);
    font-size: var(--font-size-sm);
    text-decoration: none;
    transition: all 0.2s ease;
    border-radius: var(--border-radius-md);
}

.submenu-link i {
    font-size: 18px;
    margin-right: 8px;
    color: inherit;
}

.submenu-link:hover {
    background-color: var(--secondary-bg);
    color: var(--primary-color);
}

.submenu-link.active {
    color: var(--primary-color);
    font-weight: 500;
    background-color: rgba(78, 205, 196, 0.1);
}


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

.logout-btn {
    display: flex;
    align-items: center;
    color: var(--danger-color);
}

.logout-btn i {
    margin-right: var(--spacing-md);
}

/* Cards */
.card {
    background-color: var(--bg-primary);
    border-radius: var(--border-radius-lg);
    border: 1px solid var(--border-secondary);
    box-shadow: var(--shadow-md);
    margin-bottom: var(--spacing-lg);
    overflow: hidden;
    transition: background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.card-header {
    background-color: var(--bg-primary);
    border-bottom: 1px solid var(--border-secondary);
    padding: var(--spacing-md) var(--spacing-lg);
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.card-header h5 {
    color: var(--text-primary);
    margin-bottom: 0;
}

.card-body {
    padding: var(--spacing-lg);
    color: var(--text-primary);
}

/* Stats Card */
.stats-card {
    border-radius: var(--border-radius-lg);
    padding: var(--spacing-md);
    background-color: var(--background-color);
    box-shadow: var(--shadow-md);
    margin-bottom: var(--spacing-md);
    height: 100%;
}

.stats-card .icon {
    width: 40px;
    height: 40px;
    border-radius: var(--border-radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stats-card .icon i {
    font-size: 20px;
    color: var(--background-color);
}

.stats-card .title {
    font-size: var(--font-size-sm);
    color: var(--text-color);
    opacity: 0.7;
    margin-bottom: var(--spacing-xs);
}

.stats-card .value {
    font-size: var(--font-size-lg);
    font-weight: 700;
    margin-bottom: var(--spacing-xs);
    line-height: 1.2;
}

.stats-card .subtitle {
    font-size: var(--font-size-sm);
    color: var(--text-color);
    opacity: 0.7;
}

/* Dashboard specific styles */
.dashboard-stats .stats-card {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Quick Actions */
.quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-md);
    margin-bottom: 0;
    justify-content: space-between;
}

.action-card {
    flex: 1;
    min-width: 70px;
    max-width: 90px;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-secondary);
    border-radius: var(--border-radius-md);
    padding: var(--spacing-xs) var(--spacing-sm);
    text-align: center;
    transition: all 0.3s ease;
    text-decoration: none;
    box-shadow: 0 2px 4px var(--shadow-light);
}

.action-card:hover {
    transform: translateY(-3px);
    background-color: var(--bg-tertiary);
    box-shadow: 0 4px 8px var(--shadow-medium);
    border-color: var(--primary-color);
}

.action-card i {
    font-size: 18px;
    color: var(--primary-color);
    margin-bottom: var(--spacing-xs);
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

.action-card .action-name {
    font-size: 11px;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    color: var(--text-primary);
}

/* Desktop Quick Actions */
@media (min-width: 992px) {
    .quick-actions {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: var(--spacing-md);
    }

    .action-card {
        max-width: none;
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: flex-start;
        text-align: left;
        padding: var(--spacing-md);
    }

    .action-card i {
        font-size: 24px;
        margin-bottom: 0;
        margin-right: var(--spacing-md);
        width: auto;
    }

    .action-card .action-name {
        font-size: var(--font-size-sm);
        font-weight: 500;
    }
}

/* Forms */
.form-control,
.form-select {
    border-radius: var(--border-radius-md);
    border: 1px solid var(--border-secondary);
    padding: var(--spacing-md);
    font-size: var(--font-size-base);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    transition: all 0.3s ease;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.25rem rgba(253, 126, 20, 0.25);
    background-color: var(--bg-primary);
}

.form-label {
    font-weight: 500;
    margin-bottom: var(--spacing-sm);
    color: var(--text-primary);
}

/* Buttons */
.btn {
    border-radius: var(--border-radius-md);
    padding: var(--spacing-sm) var(--spacing-lg);
    font-weight: 500;
    transition: all 0.3s ease;
}

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

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

.btn-danger {
    background-color: var(--danger-color);
    border-color: var(--danger-color);
}

/* Modern View All Button */
.btn-view-all {
    color: var(--primary-color);
    background-color: transparent;
    border: none;
    font-size: var(--font-size-sm);
    font-weight: 500;
    padding: var(--spacing-xs) var(--spacing-md);
    border-radius: var(--border-radius-md);
    display: inline-flex;
    align-items: center;
    transition: all 0.2s ease;
}

.btn-view-all:hover {
    background-color: rgba(253, 126, 20, 0.1);
    color: var(--primary-dark);
    transform: translateY(-1px);
}

.btn-view-all i {
    margin-left: var(--spacing-xs);
    font-size: 14px;
}

/* Expandable Stats Cards */
.stats-card {
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    height: 100%;
}

.stats-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.stats-card.expanded {
    height: auto;
    z-index: 10;
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.stats-card .card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-sm) var(--spacing-md);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background-color: rgba(0, 0, 0, 0.1);
    border-top-left-radius: var(--border-radius-lg);
    border-top-right-radius: var(--border-radius-lg);
}

.stats-card .card-header h6 {
    margin: 0;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.8;
}

.stats-card .card-header .toggle-btn {
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 16px;
    cursor: pointer;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    padding: 0;
}

.stats-card .card-header .toggle-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.stats-card .card-header .toggle-btn i {
    transition: transform 0.3s ease;
}

.stats-card.expanded .card-header .toggle-btn i {
    transform: rotate(180deg);
}

.stats-card .expanded-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s cubic-bezier(0, 1, 0, 1);
    padding: 0 var(--spacing-md);
}

.stats-card.expanded .expanded-content {
    max-height: 1000px;
    transition: max-height 1s ease-in-out;
    padding: var(--spacing-md);
    border-top: 1px solid var(--border-color);
}

/* Modern Card Styles */
.modern-stats-card {
    background: linear-gradient(145deg, rgba(30, 41, 59, 0.7), rgba(15, 23, 42, 0.9));
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius-lg);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    backdrop-filter: blur(10px);
    overflow: hidden;
}

.modern-stats-card .card-body {
    padding: var(--spacing-md);
}

.modern-stats-card .card-title {
    font-size: 14px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: var(--spacing-xs);
}

.modern-stats-card .card-value {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: var(--spacing-xs);
    background: linear-gradient(90deg, #4ECDC4, #56CCF2);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.modern-stats-card .card-subtitle {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
    display: flex;
    align-items: center;
}

.modern-stats-card .card-subtitle i {
    margin-right: 4px;
}

.modern-stats-card .card-subtitle.positive {
    color: #4ADE80;
}

.modern-stats-card .card-subtitle.negative {
    color: #F87171;
}

.modern-stats-card .progress-container {
    margin-top: var(--spacing-sm);
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    height: 6px;
    overflow: hidden;
}

.modern-stats-card .progress-bar {
    height: 100%;
    border-radius: 10px;
    background: linear-gradient(90deg, #4ECDC4, #56CCF2);
    transition: width 0.5s ease;
}

/* Chart Containers */
.chart-container {
    width: 100%;
    height: 200px;
    margin-top: var(--spacing-md);
}

.mini-chart {
    height: 50px;
    margin-top: var(--spacing-xs);
}

/* Data Grid */
.data-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-sm);
    margin-top: var(--spacing-md);
}

.data-item {
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: var(--border-radius-md);
    padding: var(--spacing-sm);
}

.data-item .data-label {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 2px;
}

.data-item .data-value {
    font-size: 16px;
    font-weight: 600;
}

/* Responsive adjustments */
@media (min-width: 768px) {
    .data-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .chart-container {
        height: 250px;
    }
}

/* Tables */
.table {
    margin-bottom: 0;
    color: var(--text-primary);
}

.table th {
    font-weight: 600;
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    border-color: var(--border-secondary);
}

.table td {
    color: var(--text-primary);
    border-color: var(--border-secondary);
}

.table-hover tbody tr:hover {
    background-color: var(--bg-secondary);
}

/* Login Page */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--secondary-bg);
}

.login-card {
    width: 100%;
    max-width: 400px;
    background-color: var(--background-color);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-lg);
    padding: var(--spacing-xl);
}

.login-logo {
    text-align: center;
    margin-bottom: var(--spacing-xl);
}

.login-logo h1 {
    color: var(--primary-color);
    font-weight: 700;
}

/* Mobile Menu Overlay */
.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-color: var(--background-color);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    overflow-y: auto;
}

.mobile-menu-overlay.show {
    transform: translateX(0);
}

.mobile-menu-header {
    padding: var(--spacing-lg);
    border-bottom: 1px solid var(--border-color);
}

.mobile-menu-close {
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 24px;
    cursor: pointer;
    padding: var(--spacing-xs);
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-menu-close:focus {
    outline: none;
}

.mobile-menu-user {
    padding: var(--spacing-lg);
    border-bottom: 1px solid var(--border-color);
}

/* Mobile Menu Overlay Navigation List */
.mobile-menu-nav {
    flex: 1;
    padding: var(--spacing-md) 0;
    overflow-y: auto;
}

.mobile-menu-nav .nav-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.mobile-menu-nav .nav-item {
    margin-bottom: 2px;
}

.mobile-menu-nav .nav-link {
    display: flex;
    align-items: center;
    padding: var(--spacing-md) var(--spacing-lg);
    color: var(--text-color);
    /* Resetting mobile-nav specific styles */
    flex-direction: row;
    justify-content: flex-start;
    text-align: left;
    overflow: visible;
}

.mobile-menu-nav .nav-link i {
    font-size: 20px;
    margin-right: var(--spacing-md);
    opacity: 1;
    color: inherit;
}

.mobile-menu-nav .nav-link:hover {
    background-color: var(--secondary-bg);
}

.mobile-menu-nav .nav-link.active {
    color: var(--primary-color);
    font-weight: 600;
    background-color: rgba(78, 205, 196, 0.1);
    box-shadow: none;
}

.mobile-menu-nav .nav-link.active i {
    color: var(--primary-color);
}

/* Inventory Submenu Popup */
.inventory-submenu-popup {
    position: fixed;
    bottom: 70px;
    left: 50%;
    transform: translateX(-50%) translateY(100%);
    width: 90%;
    max-width: 300px;
    background-color: var(--background-color);
    border-radius: var(--border-radius-lg);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
    z-index: 999;
    transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    opacity: 0;
    pointer-events: none;
    overflow: hidden;
}

.inventory-submenu-popup.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
    pointer-events: auto;
}

.inventory-submenu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-md) var(--spacing-lg);
    border-bottom: 1px solid var(--border-color);
}

.inventory-submenu-header h5 {
    margin: 0;
    font-size: var(--font-size-md);
    color: var(--primary-color);
}

.close-inventory-submenu {
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 20px;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.inventory-submenu-content {
    padding: var(--spacing-md);
}

.inventory-submenu-item {
    display: flex;
    align-items: center;
    padding: var(--spacing-md);
    color: var(--text-color);
    text-decoration: none;
    border-radius: var(--border-radius-md);
    margin-bottom: var(--spacing-sm);
    transition: all 0.2s ease;
}

.inventory-submenu-item:last-child {
    margin-bottom: 0;
}

.inventory-submenu-item i {
    font-size: 18px;
    margin-right: var(--spacing-md);
    color: inherit;
}

.inventory-submenu-item:hover {
    background-color: var(--secondary-bg);
}

.inventory-submenu-item.active {
    background-color: rgba(78, 205, 196, 0.1);
    color: var(--primary-color);
    font-weight: 500;
}


.mobile-menu-footer {
    padding: var(--spacing-lg);
    border-top: 1px solid var(--border-color);
}

/* Responsive adjustments */
@media (max-width: 576px) {
    .app-main {
        padding: var(--spacing-md) 0;
    }

    .stats-card .value {
        font-size: var(--font-size-md);
    }

    .card-body {
        padding: var(--spacing-sm);
    }

    .card-header {
        padding: var(--spacing-sm) var(--spacing-md);
    }

    .card-header h5 {
        font-size: var(--font-size-md);
        margin-bottom: 0;
    }

    .table th,
    .table td {
        padding: 0.5rem;
        font-size: var(--font-size-sm);
    }
}


/**
 * =================================================================
 * ADD THIS TO YOUR MAIN CSS FILE OR A <style> TAG
 * =================================================================
 *
 * These styles will make the toast notifications look modern and clean.
 * They include animations, proper alignment, and color themes.
 */

/* Container for all toasts */
#toast-container-modern {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 100%;
  max-width: 400px;
}

/* Base style for a single toast */
.toast-modern {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  width: 100%;
  padding: 1rem;
  border-radius: 0.75rem;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.07), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
  background-color: #fff;
  opacity: 0;
  transform: translateX(calc(100% + 1.5rem));
  transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1);
  position: relative;
  overflow: hidden;
}

/* Animation states */
.toast-modern.toast-enter {
  opacity: 1;
  transform: translateX(0);
}

.toast-modern.toast-exit {
  opacity: 0;
  transform: scale(0.9);
  transition: all 0.3s ease-in-out;
}

/* Icon container */
.toast-icon-container {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  margin-top: 2px;
}

.toast-icon-container svg {
  width: 100%;
  height: 100%;
}

/* Text content container */
.toast-text-container {
  flex-grow: 1;
  padding-right: 0.5rem;
}

.toast-title {
  font-weight: 700;
  font-size: 1rem;
  margin: 0 0 0.25rem 0;
}

.toast-message {
  font-size: 0.9rem;
  margin: 0;
  line-height: 1.5;
}

/* Close button */
.toast-close-btn {
  flex-shrink: 0;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  opacity: 0.6;
  transition: all 0.2s ease;
}

.toast-close-btn:hover {
  opacity: 1;
  transform: scale(1.1);
}

/* Progress Bar */
.toast-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 4px;
  width: 100%;
  background-color: rgba(0, 0, 0, 0.1);
}

.toast-progress-bar {
  height: 100%;
  width: 100%;
  background-color: var(--toast-color, #4299e1);
  animation: progress-animation linear forwards;
  transform-origin: left;
}

@keyframes progress-animation {
  from { transform: scaleX(1); }
  to { transform: scaleX(0); }
}

/* --- Color Variants --- */
/* Success */
.toast-success {
  --toast-color: #2f855a;
  background-color: #f0fff4;
}
.toast-success .toast-title { color: #2f855a; }
.toast-success .toast-message { color: #2c7a7b; }
.toast-success .toast-icon-container { color: #38a169; }
.toast-success .toast-close-btn { color: #38a169; }

/* Error */
.toast-error {
  --toast-color: #c53030;
  background-color: #fff5f5;
}
.toast-error .toast-title { color: #c53030; }
.toast-error .toast-message { color: #9b2c2c; }
.toast-error .toast-icon-container { color: #e53e3e; }
.toast-error .toast-close-btn { color: #e53e3e; }

/* Warning */
.toast-warning {
  --toast-color: #dd6b20;
  background-color: #fffaf0;
}
.toast-warning .toast-title { color: #dd6b20; }
.toast-warning .toast-message { color: #b7791f; }
.toast-warning .toast-icon-container { color: #ed8936; }
.toast-warning .toast-close-btn { color: #ed8936; }

/* Info */
.toast-info {
  --toast-color: #3182ce;
  background-color: #ebf8ff;
}
.toast-info .toast-title { color: #3182ce; }
.toast-info .toast-message { color: #2c5282; }
.toast-info .toast-icon-container { color: #4299e1; }
.toast-info .toast-close-btn { color: #4299e1; }


/* Note: The .content-wrapper padding-bottom for mobile view is now handled
   within the main .content-wrapper rule and its @media (max-width: 360px)
   override near the new .mobile-nav styles. The previous adjustment here is removed. */