.dashboard-container {
    display: flex;
    min-height: 70vh;
    background-color: var(--bg-light);
    font-family: var(--font-primary);
    background-color: var(--bg-light);
    font-family: var(--font-primary);
    /* No transition on container to avoid fixed-pos framing issues */
}

.sidebar {
    width: 240px;
    background-color: var(--bg-white);
    padding: 25px 15px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    border-radius: 0 15px 15px 0;
    box-shadow: 1px 0 8px var(--shadow);
    transition: all var(--transition-medium);
}

.sidebar ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar ul li {
    padding: 10px 18px;
    margin-bottom: 12px;
    cursor: pointer;
    border-radius: var(--btn-radius);
    color: #333;
    /* Removed !important to allow overrides */
    /* Force high contrast */
    font-weight: 500;
    transition: all var(--transition-fast);
}

.sidebar ul li:hover {
    background-color: var(--secondary-color);
    color: var(--bg-white);
}

.sidebar ul li.active {
    background-color: var(--primary-color);
    color: #fff !important;
    /* Force white text */
}

.sidebar .btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: var(--btn-radius);
    font-weight: 600;
    color: var(--bg-white);
    background-color: var(--primary-color);
    border: none;
    text-align: center;
    margin-top: 20px;
    transition: all var(--transition-fast);
    box-shadow: 0 2px 6px var(--shadow-hover);
}

.sidebar .btn:hover {
    background-color: var(--btn-hover);
}

.dashboard-content {
    flex: 1;
    padding: 25px 30px;
    background-color: var(--bg-light);
    border-left: 1px solid rgba(26, 54, 93, 0.05);
    /* más suave */
    box-shadow: inset 0 0 6px var(--shadow);
    border-radius: 0 0 0 15px;
    transition: all var(--transition-medium);
}

.card {
    background-color: var(--bg-white);
    padding: 20px;
    margin-bottom: 20px;
    border-radius: var(--btn-radius);
    box-shadow: 0 2px 8px rgba(26, 54, 93, 0.08);
    /* sombra ligera */
    transition: all var(--transition-medium);
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(26, 54, 93, 0.12);
}

@media (max-width: 768px) {
    .dashboard-container {
        flex-direction: column;
        position: relative;
        /* Context for absolute positioning if needed */
    }

    .sidebar {
        position: fixed;
        left: -100%;
        /* Hidden off-screen */
        top: 0;
        bottom: 0;
        width: 260px;
        z-index: 1050;
        /* Above everything */
        border-radius: 0 15px 15px 0;
        box-shadow: 4px 0 15px rgba(0, 0, 0, 0.1);
        padding-top: 20px;
        justify-content: flex-start !important;
        /* Fix "white spaces" */
        overflow-y: auto;
        /* Allow scrolling if menu is long */
    }

    /* Pin layout button to bottom in mobile */
    .sidebar .btn {
        margin-top: auto;
        margin-bottom: 20px;
        width: 100%;
    }

    .sidebar ul li {
        color: #1a1a1a !important;
        /* Force visible text in mobile */
    }

    .sidebar ul li.active {
        color: #fff !important;
        /* Force white text on active item */
        background-color: var(--primary-color);
        /* Ensure bg is also correct if needed */
    }

    .sidebar.active {
        left: 0;
        /* Slide in */
    }

    /* Optional Overlay when sidebar is active */
    .sidebar.active::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.3);
        z-index: -1;
    }

    .dashboard-content {
        width: 100%;
        border-left: none;
        box-shadow: none;
        /* Remove shadows causing artifacts */
        border-radius: 0;
        padding: 15px;
    }

    #sidebarToggle {
        width: fit-content;
        z-index: 1040;
        transition: opacity 0.2s;
    }

    /* Ensure DataTables are always 100% width to trigger responsive mode */
    table.dataTable {
        width: 100% !important;
    }
}