/* Root and Body Styles */
:root {
    --sidebar-width: 250px;
    --sidebar-bg: #1a1a2e;
    --primary-color: #0066cc;
    --secondary-color: #667eea;
    --text-color: #333;
    --light-bg: #f8f9fa;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--light-bg);
    color: var(--text-color);
}

/* Mobile Menu Toggle Button */
.mobile-menu-toggle {
    position: fixed;
    top: 15px;
    left: 15px;
    background-color: var(--sidebar-bg);
    border: none;
    color: white;
    width: 45px;
    height: 45px;
    border-radius: 5px;
    font-size: 20px;
    z-index: 1010;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.mobile-menu-toggle:hover {
    background-color: var(--primary-color);
}

.close-menu-btn {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    margin-left: auto;
    display: none;
}

.close-menu-btn:hover {
    color: var(--primary-color);
}

/* Sidebar Navigation */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--sidebar-bg);
    padding: 20px;
    position: fixed;
    height: 100%;
    overflow-y: auto;
    z-index: 1000;
    transition: transform 0.3s ease;
}

.sidebar-header {
    margin-bottom: 30px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sidebar-menu {
    margin-top: 20px;
}

.sidebar-menu .nav-link {
    color: rgba(255, 255, 255, 0.7);
    padding: 12px 15px;
    margin-bottom: 8px;
    border-radius: 5px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-menu .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: #fff;
    transform: translateX(5px);
}

.sidebar-menu .nav-link.active {
    background-color: var(--primary-color);
    color: #fff;
    font-weight: 600;
}

/* Main Content Area */
.main-content {
    margin-left: var(--sidebar-width);
    transition: margin-left 0.3s ease;
    padding-top: 20px;
}

/* Charts Container */
.chart-container {
    position: relative;
    width: 100%;
    max-height: 800px;
    margin: 20px 0;
}

canvas {
    max-height: 800px !important;
}

/* Cards */
.card {
    border: none;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.3s ease;
}

.card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.card-body {
    padding: 30px;
}

/* Tables */
.table {
    background-color: #fff;
    border-collapse: collapse;
}

.table thead th {
    font-weight: 600;
    border-top: none;
    padding: 15px;
}

.table tbody td {
    padding: 12px 15px;
    vertical-align: middle;
}

.table tbody tr {
    border-bottom: 1px solid #e0e0e0;
    transition: background-color 0.2s ease;
}

.table tbody tr:hover {
    background-color: #f0f0f0;
}

/* Badges */
.badge {
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
}

/* Headings */
h1 {
    color: var(--text-color);
    font-weight: 700;
    margin-bottom: 20px;
}

h1 i {
    margin-right: 10px;
}

/* Responsive Styles */

/* Tablet: 768px to 1023px */
@media (max-width: 1023px) {
    .sidebar {
        width: 200px;
    }

    .main-content {
        margin-left: 200px;
    }

    .card-body {
        padding: 20px;
    }

    .table {
        font-size: 14px;
    }

    .table thead th {
        padding: 12px 8px;
    }

    .table tbody td {
        padding: 10px 8px;
    }
}

/* Mobile: Less than 768px */
@media (max-width: 767px) {
    .mobile-menu-toggle {
        display: flex;
    }

    .close-menu-btn {
        display: block;
    }

    .sidebar {
        position: fixed;
        width: 100%;
        max-width: 280px;
        height: 100%;
        left: 0;
        top: 0;
        transform: translateX(-100%);
        z-index: 1005;
        padding-top: 20px;
        overflow-y: auto;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.3);
    }

    .sidebar.show {
        transform: translateX(0);
    }

    /* Overlay when menu is open */
    .sidebar.show::after {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0, 0, 0, 0.5);
        z-index: -1;
    }

    .main-content {
        margin-left: 0;
        padding-top: 70px;
    }

    .sidebar-header {
        margin-bottom: 30px;
        padding-bottom: 15px;
        display: flex;
        align-items: center;
        justify-content: space-between;
    }

    .sidebar-header h3 {
        margin: 0;
        font-size: 18px;
        flex: 1;
    }

    .sidebar-menu {
        margin-top: 0;
    }

    .card {
        margin-bottom: 20px;
    }

    .card-body {
        padding: 15px;
    }

    h1 {
        font-size: 22px;
        margin-bottom: 15px;
    }

    h1 i {
        margin-right: 8px;
    }

    .chart-container {
        max-height: 400px;
    }

    canvas {
        max-height: 400px !important;
    }

    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .table {
        font-size: 12px;
        margin-bottom: 0;
    }

    .table thead th {
        padding: 10px 6px;
        font-size: 11px;
    }

    .table tbody td {
        padding: 8px 6px;
        font-size: 12px;
    }

    .table .text-center {
        text-align: center;
    }

    .badge {
        padding: 4px 8px;
        font-size: 10px;
    }
}

/* Extra small devices: Less than 576px */
@media (max-width: 575px) {
    .container-fluid {
        padding: 10px;
    }

    .card-body {
        padding: 12px;
    }

    h1 {
        font-size: 18px;
        margin-bottom: 12px;
    }

    .chart-container {
        max-height: 300px;
    }

    canvas {
        max-height: 300px !important;
    }

    .table {
        font-size: 11px;
    }

    .table thead th {
        padding: 8px 4px;
        font-size: 10px;
    }

    .table tbody td {
        padding: 6px 4px;
        font-size: 11px;
    }
}

/* Loading spinner */
.spinner-border-sm {
    width: 1rem;
    height: 1rem;
    border-width: 0.2em;
}

/* Utility classes */
.min-vh-100 {
    min-height: 100vh;
}

.flex-grow-1 {
    flex-grow: 1;
}

.d-flex {
    display: flex;
}
