/* --- Core Theme Variables (Consistent with your main site) --- */
:root {
    --primary: #8e44ad;
    --secondary: #3498db;
    --success: #2ecc71;
    --warning: #f1c40f;
    --danger: #e74c3c;
    --light: #fdfdfd;
    --text: #ecf0f1;
    --bg: #2c3e50;
    --card-bg: #34495e;
    --sidebar-bg: #1a2530; /* A darker shade for the sidebar */
    --shadow: rgba(0, 0, 0, 0.3);
    --transition: all 0.3s ease;
}

/* --- Base Layout --- */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg);
    color: var(--text);
    display: flex;
    min-height: 100vh;
    overflow-x: hidden; /* Prevent horizontal scroll */
}

a {
    text-decoration: none;
}

/* --- Sidebar --- */
.sidebar {
    width: 260px;
    background-color: var(--sidebar-bg);
    padding: 20px;
    position: fixed;
    top: 0;
    left: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
    transition: var(--transition);
    z-index: 1000;
}

.sidebar-header {
    text-align: center;
    margin-bottom: 30px;
}

.sidebar-header a {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--light);
}
.sidebar-header i {
    color: var(--secondary);
}

.sidebar-nav {
    list-style: none;
    padding: 0;
    flex-grow: 1; /* Pushes the footer to the bottom */
}

.sidebar-nav .nav-item {
    margin-bottom: 10px;
}

.sidebar-nav .nav-link {
    color: var(--text);
    padding: 12px 15px;
    display: flex;
    align-items: center;
    border-radius: 5px;
    transition: var(--transition);
    font-weight: 500;
}

.sidebar-nav .nav-link i {
    margin-right: 15px;
    width: 20px;
    text-align: center;
    font-size: 1.1rem;
}

.sidebar-nav .nav-link:hover,
.sidebar-nav .nav-link.active {
    background-color: var(--secondary);
    color: white;
}

.sidebar-footer {
    padding-top: 20px;
    border-top: 1px solid var(--card-bg);
}

/* --- Main Content --- */
.main-content {
    margin-left: 260px;
    flex-grow: 1;
    padding: 30px;
    overflow-y: auto;
}

/* --- Dashboard Components --- */
.stat-card {
    background-color: var(--card-bg);
    padding: 25px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: var(--transition);
    box-shadow: 0 5px 15px var(--shadow);
}
.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px var(--shadow);
}
.stat-card-info h5 {
    font-size: 2rem;
    font-weight: 700;
    margin: 0;
}
.stat-card-info p {
    margin: 0;
    color: #bdc3c7; /* A lighter gray for subtext */
}
.stat-card-icon {
    font-size: 2.5rem;
}

.chart-container {
    background-color: var(--card-bg);
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 5px 15px var(--shadow);
}

.table {
    --bs-table-bg: var(--card-bg);
    --bs-table-border-color: #4a627a;
    --bs-table-hover-bg: #3b536b;
    --bs-table-striped-bg: #3b536b;
    --bs-table-color: var(--text);
}
.table th {
    color: var(--light);
}

/* --- Responsive Design for Mobile --- */
.sidebar-toggle {
    display: none; /* Hidden by default on desktop */
    position: fixed;
    top: 15px;
    left: 15px;
    z-index: 1001;
    background: var(--card-bg);
    border: none;
    color: var(--light);
    font-size: 1.2rem;
    padding: 5px 12px;
    border-radius: 5px;
}

@media (max-width: 992px) {
    .sidebar {
        transform: translateX(-100%); /* Hide sidebar off-screen */
    }
    .sidebar.active {
        transform: translateX(0); /* Show sidebar */
    }
    .main-content {
        margin-left: 0; /* Main content takes full width */
    }
    .sidebar-toggle {
        display: block; /* Show the toggle button */
    }
}

/* This makes the link wrapper a block element */
.stat-card-link {
    display: block;
    text-decoration: none;
    color: inherit;
}
.stat-card-link:hover {
    color: inherit;
}

/* Base style for the card */
.stat-card {
    background-color: var(--card-bg);
    padding: 25px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 5px 15px var(--shadow);
    transition: all 0.2s ease-in-out; /* A slightly faster transition for a button feel */
    cursor: pointer; /* Ensures the cursor changes to a hand */
}

/* Hover state: Lifts and brightens the card */
.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px var(--shadow);
    filter: brightness(110%); /* Makes the card slightly brighter */
}

/* Active state: Simulates the card being pressed down */
.stat-card:active {
    transform: translateY(-2px) scale(0.98); /* Moves it down slightly and shrinks it */
    box-shadow: 0 5px 10px var(--shadow);
    filter: brightness(100%); /* Returns to normal brightness during the click */
}

