:root {
    /* Light Mode */
    --bg-color: #eef5fa;
    --sidebar-bg: #ffffff;
    --main-content-bg: #ffffff;
    --text-color: #231c4a;
    --icon-color: #231c4a;
    --active-color: #6c37ff;
    --hover-bg: #f3f4f6;
    --highlight-bg: #dbeafe;
    --highlight-text: #1e3a8a;
    --toggle-bg: #dbeafe;
    --border-color: #e0e0e0;

    --sidebar-height: 95vh;
    --sidebar-width-expanded: 260px;
    --sidebar-width-collapsed: 70px;
    --transition-speed: 0.3s;
}

/* Dark Mode */
body.dark-mode {
    --bg-color: #111827;
    --sidebar-bg: #1f2937;
    --main-content-bg: #1f2937;
    --text-color: #f9fafb;
    --icon-color: #f9fafb;
    --active-color: #818cf8;
    --hover-bg: #374151;
    --highlight-bg: #374151;
    --highlight-text: #ffffff;
    --toggle-bg: #4b5563;
    --border-color: #374151;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: var(--bg-color);
    display: flex;
    height: 100vh;
    align-items: center;
    padding-left: 20px;
    transition: background-color var(--transition-speed);
}

/* --- Sidebar Styles (No Changes) --- */
.sidebar-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: fit-content;
    height: var(--sidebar-height);
}

.sidebar {
    background-color: var(--sidebar-bg);
    height: 100%;
    width: var(--sidebar-width-collapsed);
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    padding: 10px 10px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    transition: width var(--transition-speed) ease, background-color var(--transition-speed);
    position: relative;
    overflow: hidden;
    z-index: 10;
}

.sidebar.expanded {
    width: var(--sidebar-width-expanded);
}

.sidebar-header {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    padding: 0 10px;
    height: 40px;
    white-space: nowrap;
}

.logo-icon {
    font-size: 1.5rem;
    color: var(--text-color);
    min-width: 30px;
    text-align: center;
}

.logo-text {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--text-color);
    margin-left: 15px;
    opacity: 0;
    transition: opacity 0.2s;
}

.sidebar.expanded .logo-text {
    opacity: 1;
    transition-delay: 0.1s;
}

.menu {
    list-style: none;
    flex-grow: 1;
    overflow-y: auto;
    scrollbar-width: none;
}

.menu::-webkit-scrollbar { display: none; }

.menu-item {
    display: flex;
    align-items: center;
    padding: 12px 10px;
    margin-bottom: 4px;
    border-radius: 12px;
    cursor: pointer;
    color: var(--text-color);
    text-decoration: none;
    white-space: nowrap;
    transition: background-color 0.2s;
    position: relative;
}

.menu-item:hover {
    background-color: var(--hover-bg);
}

.menu-item.active {
    border: 1.5px solid var(--active-color);
    font-weight: 600;
}

.menu-item.highlighted {
    background-color: var(--highlight-bg);
    color: var(--highlight-text);
}

.menu-icon {
    font-size: 1.2rem;
    min-width: 30px;
    text-align: center;
    color: var(--icon-color);
}

.active .menu-icon { color: var(--active-color); }

.red-icon { color: #d32f2f; }

.menu-text {
    margin-left: 10px;
    font-size: 0.95rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.1s;
}

.sidebar.expanded .menu-text {
    opacity: 1;
    pointer-events: auto;
    transition-delay: 0.15s;
}

.separator {
    height: 1px;
    background-color: #e0e0e0;
    margin: 10px 10px;
    opacity: 0.5;
}

.sidebar-footer {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    padding-top: 10px;
}

.internal-theme-row {
    display: none;
    align-items: center;
    justify-content: space-between;
    padding: 10px;
    margin-bottom: 10px;
    cursor: pointer;
}

.sidebar.expanded .internal-theme-row {
    display: flex;
    animation: fadeIn 0.3s forwards;
}

.theme-label {
    font-weight: 600;
    color: var(--active-color);
}

.switch-container {
    position: relative;
    width: 50px;
    height: 26px;
    background-color: var(--toggle-bg);
    border-radius: 20px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.switch-knob {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    background-color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    font-size: 0.8rem;
    color: #333;
}

body.dark-mode .switch-knob {
    transform: translateX(24px);
    background-color: #1f2937;
    color: white;
}

.toggle-btn-row {
    display: flex;
    justify-content: center;
    padding: 8px;
}

.sidebar.expanded .toggle-btn-row {
    justify-content: flex-end;
}

.sidebar-toggle-btn {
    width: 30px;
    height: 30px;
    background-color: var(--active-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: none;
    font-size: 0.8rem;
    transition: all 0.3s;
}

.sidebar:not(.expanded) .sidebar-toggle-btn {
     background-color: transparent;
     color: #aaa;
     border: 1px solid #ddd;
}

.sidebar:not(.expanded) .sidebar-toggle-btn:hover {
     background-color: var(--active-color);
     color: white;
}

.external-toggle-wrapper {
    margin-top: 15px;
    display: flex;
    justify-content: center;
    width: 100%;
    opacity: 1;
    transition: opacity 0.2s;
}

.sidebar.expanded + .external-toggle-wrapper {
    opacity: 0;
    pointer-events: none;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* --- NEW: Dashboard Styles --- */
.main-content {
    flex-grow: 1;
    height: var(--sidebar-height);
    margin-left: 20px;
    padding: 25px;
    background-color: var(--main-content-bg);
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    color: var(--text-color);
    overflow-y: auto;
    transition: background-color var(--transition-speed), color var(--transition-speed);
}

.main-content h1 {
    font-size: 1.8rem;
    margin-bottom: 25px;
}

.stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background-color: var(--bg-color);
    padding: 20px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.stat-icon {
    font-size: 2rem;
    padding: 15px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-card:nth-child(1) .stat-icon { background-color: #cce5ff; color: #007bff; }
.stat-card:nth-child(2) .stat-icon { background-color: #d4edda; color: #28a745; }
.stat-card:nth-child(3) .stat-icon { background-color: #fff3cd; color: #ffc107; }

.stat-info h3 {
    font-size: 1rem;
    font-weight: normal;
    margin-bottom: 5px;
}

.stat-info p {
    font-size: 1.5rem;
    font-weight: bold;
}

.charts-container {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

.chart, .activity {
    background-color: var(--bg-color);
    padding: 20px;
    border-radius: 12px;
}

.chart h2, .activity h2 {
    font-size: 1.2rem;
    margin-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
}

.placeholder-img {
    width: 100%;
    height: 200px;
    background-color: var(--hover-bg);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #aaa;
    font-style: italic;
}

.activity-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-icon {
    font-size: 1.2rem;
    color: var(--active-color);
}

.activity-text span {
    font-weight: bold;
}