:root {
    --bg-dark: #1e1e1e;
    --bg-darker: #161616;
    --bg-card: #252525;
    --text-primary: #e0e0e0;
    --text-secondary: #a0a0a0;
    --accent: #4a9eff;
    --accent-hover: #3a8eef;
    --border-color: #333;
    --sidebar-width: 250px;
    --sidebar-collapsed: 70px;
    --topnav-height: 60px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-primary);
    overflow-x: hidden;
}

/* Top Navigation */
.top-navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--topnav-height);
    background-color: var(--bg-darker);
    border-bottom: 1px solid var(--border-color);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 1.25rem;
    font-weight: 600;
}

.brand i {
    color: var(--accent);
    font-size: 1.5rem;
}

.top-nav-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.nav-icon-btn {
    text-decoration: none;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.25rem;
    padding: 0.5rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
}

.nav-icon-btn:hover {
    background-color: var(--bg-card);
    color: var(--accent);
}

.nav-icon-btn .badge {
    position: absolute;
    top: 0;
    right: 0;
    font-size: 0.65rem;
}

.hamburger {
    display: none;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
}

/* Sidebar */
.sidebar {
    position: fixed;
    top: var(--topnav-height);
    left: 0;
    width: var(--sidebar-collapsed);
    height: calc(100vh - var(--topnav-height));
    background-color: var(--bg-darker);
    border-right: 1px solid var(--border-color);
    transition: width 0.3s ease;
    overflow: hidden;
    z-index: 999;
}

.sidebar:hover {
    width: var(--sidebar-width);
}

.sidebar-menu {
    list-style: none;
    padding: 1rem 0;
}

.sidebar-item {
    margin: 0.25rem 0;
}

.sidebar-link {
    display: flex;
    align-items: center;
    padding: 0.875rem 1.25rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.3s;
    white-space: nowrap;
}

.sidebar-link:hover {
    background-color: var(--bg-card);
    color: var(--accent);
}

.sidebar-link.active {
    background-color: var(--bg-card);
    color: var(--accent);
    border-right: 3px solid var(--accent);
}

.sidebar-link i {
    font-size: 1.25rem;
    min-width: 24px;
    margin-right: 1rem;
}

.sidebar-link span {
    opacity: 0;
    transition: opacity 0.3s;
}

.sidebar:hover .sidebar-link span {
    opacity: 1;
}

/* Main Content */
.main-content {
    margin-left: var(--sidebar-collapsed);
    margin-top: var(--topnav-height);
    padding: 2rem;
    transition: margin-left 0.3s ease;
    min-height: calc(100vh - var(--topnav-height));
}

/* Cards */
.card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    margin-bottom: 1.5rem;
}

.card-header {
    background-color: transparent;
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

.card-body {
    padding: 1.25rem;
}

/* Table */
.table {
    color: var(--text-primary);
}

.table thead th {
    border-bottom: 2px solid var(--border-color);
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    padding: 0.75rem;
}

.table tbody td {
    border-bottom: 1px solid var(--border-color);
    padding: 0.60rem 0.75rem;
}

.table tbody tr:hover {
    background-color: rgba(74, 158, 255, 0.05);
}

.badge {
    padding: 0.375rem 0.625rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
}

/* Chart Container */
.chart-container {
    position: relative;
    height: 300px;
    margin-top: 1rem;
}

/* Custom CSS (e.g., in styles.css) */
.nav-aware-center {
    /* 1. Calculate height of the space below the navbar */
    min-height: calc(100vh - 200px); 
    
    /* 2. Push the content down by the navbar's height */
    /* margin-top: 56px;  */
    
    /* 3. Keep Flexbox for centering */
    display: flex;
    justify-content: center;
    align-items: center;
}


/* Mobile Styles */
@media (max-width: 768px) {
    .hamburger {
        display: block;
    }

    .brand-text {
        display: none;
    }

    .sidebar {
        width: 0;
        border: none;
    }

    .sidebar.show {
        width: var(--sidebar-width);
    }

    .sidebar.show .sidebar-link span {
        opacity: 1;
    }

    .main-content {
        margin-left: 0;
    }

    .top-nav-actions .nav-icon-btn span {
        display: none;
    }

    .overlay {
        display: none;
        position: fixed;
        top: var(--topnav-height);
        left: 0;
        right: 0;
        bottom: 0;
        background-color: rgba(0, 0, 0, 0.5);
        z-index: 998;
    }

    .overlay.show {
        display: block;
    }
}

@media (min-width: 769px) {
    .sidebar:hover ~ .main-content {
        margin-left: var(--sidebar-width);
    }
}