:root {
    --sidebar-bg: #ffffff;
    --border-color: #f0f0f0;
    --text-main: #333333;
    --text-muted: #8c8c8c;
    --primary-blue: #1890ff;
    --active-bg: #e6f7ff;
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial; }
body { background-color: #f5f5f5; overflow-x: hidden; }
.dashboard-container { display: flex; height: 100vh; position: relative; }

/* 1. Mini Sidebar (Icons only) */
.mini-sidebar {
    width: 60px;
    background: #fff;
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 15px 0;
    z-index: 1000;
}
.mini-icons { flex-grow: 1; display: flex; flex-direction: column; gap: 20px; margin-top: 20px; }
.mini-icons span { color: var(--text-muted); cursor: pointer; font-size: 20px; position: relative; display: inline-block; }
.mini-icons span::after { content: attr(data-tooltip); position: absolute; left: 120%; top: 50%; transform: translateY(-50%); background: #333; color: #fff; padding: 5px 10px; border-radius: 4px; font-size: 12px; white-space: nowrap; opacity: 0; visibility: hidden; transition: opacity 0.2s; z-index: 1000; pointer-events: none; }
.mini-icons span:hover::after { opacity: 1; visibility: visible; }
.user-avatar img { width: 35px; height: 35px; border-radius: 50%; margin-bottom: 10px; }

/* 2. Main Sidebar */
.main-sidebar {
    width: 240px;
    background: #fff;
    border-right: 1px solid var(--border-color);
    padding: 20px 0;
    overflow-y: auto;
    z-index: 999;
}
.dropdown-wrapper { padding: 0 15px; margin-bottom: 25px; }
.dropdown-btn { display: flex; justify-content: space-between; align-items: center; padding: 8px 12px; border: 1px solid #d9d9d9; border-radius: 6px; cursor: pointer; background: #fff; }
.btn-content { display: flex; align-items: center; gap: 8px; }
.btn-text { font-size: 14px; font-weight: 500; }
.dropdown-menu { display: none; margin-top: 5px; border: 1px solid #f0f0f0; box-shadow: 0 4px 12px rgba(0,0,0,0.08); border-radius: 8px; background: #fff; }
.dropdown-menu.show { display: block; }
.menu-item { display: flex; align-items: center; gap: 10px; padding: 10px 15px; font-size: 14px; color: var(--text-main); cursor: pointer; }
.menu-item:hover { background-color: var(--active-bg); color: var(--primary-blue); }
.active-dropdown { background: var(--active-bg); color: var(--primary-blue); }
.nav-section { margin-bottom: 25px; }
.section-title { font-size: 11px; font-weight: 600; color: var(--text-muted); padding: 0 20px 10px; margin-top: 10px; }
.nav-section a { display: block; padding: 10px 20px; text-decoration: none; color: var(--text-main); font-size: 14px; }
.nav-section a:hover { color: var(--primary-blue); background: var(--active-bg); border-radius: 0 20px 20px 0; margin-right: 15px; }
.active-link { background: var(--active-bg); color: var(--primary-blue) !important; border-radius: 0 20px 20px 0; margin-right: 15px; }

/* 3. Content Area */
.content-area {
    flex-grow: 1;
    padding: 24px;
    background: #fafafa;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow-y: auto;
}
.top-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 20px; }
.title-wrapper { display: flex; align-items: center; gap: 15px; }
.page-title { font-size: 20px; font-weight: 600; margin-bottom: 4px; }
.breadcrumb { font-size: 12px; color: var(--text-muted); }
.top-actions { display: flex; align-items: center; gap: 15px; flex-wrap: wrap; }
.top-actions span { color: var(--text-muted); cursor: pointer; }
.export-btn { display: flex; align-items: center; gap: 5px; background: #fff; border: 1px solid #d9d9d9; padding: 6px 12px; border-radius: 4px; cursor: pointer; font-size: 14px; }

.blank-canvas {
    background: #fff;
    border-radius: 12px;
    flex-grow: 1;
    min-height: calc(100vh - 160px);
    border: 1px solid var(--border-color);
    margin-bottom: 20px;
}

/* Footer Styling */
.main-footer { display: flex; justify-content: space-between; align-items: center; padding: 10px 5px; font-size: 13px; color: #7e8299; margin-top: auto; }
.brand-name { color: #3f4254; font-weight: 500; }
.footer-right { display: flex; gap: 15px; }
.footer-right a { text-decoration: none; color: #7e8299; transition: color 0.2s; }
.footer-right a:hover { color: var(--primary-blue); }

/* Overlay */
/* --- Overlay Fix --- */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1500; /* Higher than sidebars */
}

.overlay.active {
    opacity: 1;
    visibility: visible;
}

/* --- Responsive Sidebar Logic --- */
@media (max-width: 900px) {
    .mobile-menu-btn {
        display: block; /* Hamburger icon becomes visible */
        margin-right: 10px;
    }

    /* Hide sidebars off-screen to the left */
    .mini-sidebar {
        position: fixed;
        left: -60px; 
        height: 100vh;
        z-index: 2000;
        transition: transform 0.3s ease;
    }

    .main-sidebar {
        position: fixed;
        left: -300px; /* Hidden deeper to the left */
        height: 100vh;
        z-index: 1999;
        transition: transform 0.3s ease;
        width: 260px;
    }

    /* When active, slide them in */
    .mini-sidebar.active {
        transform: translateX(60px);
    }

    .main-sidebar.active {
        transform: translateX(300px);
    }

    /* Adjust main content so it doesn't move when sidebar pops over it */
    .content-area {
        width: 100%;
        padding: 15px;
    }
}

@media (max-width: 480px) {
    /* On tiny screens, skip the mini-sidebar and just show the main one */
    .mini-sidebar {
        display: none;
    }
    .main-sidebar {
        left: -280px;
        width: 280px;
    }
    .main-sidebar.active {
        transform: translateX(280px);
    }
}