:root {
    --bg-color: #F0EEE9;
    --primary-color: #08283E;
    --accent-color: #D8A622;
    --text-highlight: #406C7F;
    --white: #ffffff;
    --sidebar-width: 260px;
    --transition: all 0.3s ease;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--primary-color);
}

.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--primary-color);
    color: var(--white);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    transition: transform 0.3s ease;
    z-index: 1001;
    left: 0;
    transform: translateX(0);
}

.sidebar-header {
    padding: 1rem;
    text-align: center;
    background-color: var(--white);
    border-bottom: 1px solid #eee;
    min-height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-logo {
    max-width: 200px;
    max-height: 70px;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
}

.sidebar-nav {
    flex: 1;
    padding: 1.5rem 0;
}

.nav-item {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    /* Textos hacia la derecha */
    padding: 0.8rem 2rem;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: var(--transition);
    white-space: nowrap;
}

.nav-item:hover,
.nav-item.active {
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--accent-color);
    border-right: 4px solid var(--accent-color);
    /* Borde a la derecha */
    border-left: none;
}

/* Sidebar Collapsed State (Desktop) */
@media (min-width: 993px) {
    .sidebar.collapsed {
        width: 70px;
    }

    .sidebar.collapsed .sidebar-logo {
        max-width: 40px;
    }

    .sidebar.collapsed .nav-item {
        justify-content: center;
        padding: 0.8rem 0;
        font-size: 0;
        /* Ocultar texto */
    }

    .sidebar.collapsed .nav-item::before {
        content: attr(data-icon);
        /* Mostrar icono si existiera (placeholder por ahora) */
        font-size: 1.2rem;
    }

    .sidebar.collapsed+.main-content {
        margin-left: 70px;
    }
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-width: 0;
    transition: var(--transition);
}

.topbar {
    height: 70px;
    background-color: var(--white);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.content-wrapper {
    padding: 2rem;
}

.menu-toggle {
    display: flex;
    /* Visible por defecto */
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 8px;
    background: #f8f9fa;
    border: 1px solid #ddd;
    color: var(--primary-color);
    transition: var(--transition);
}

.menu-toggle:hover {
    background: #eee;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
}

/* Responsive */
@media (max-width: 992px) {
    .menu-toggle {
        display: flex !important;
        align-items: center;
        justify-content: center;
    }

    .sidebar {
        transform: translateX(-100%);
    }

    .main-content {
        margin-left: 0 !important;
        width: 100%;
    }

    .sidebar.open {
        transform: translateX(0);
        box-shadow: 10px 0 25px rgba(0, 0, 0, 0.3);
    }

    .sidebar.open+.main-content .sidebar-overlay {
        display: block;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

@media (max-width: 600px) {
    .stats-grid {
        grid-template-columns: 1fr !important;
    }

    .topbar {
        padding: 0 1rem;
    }

    .content-wrapper {
        padding: 1rem;
    }
}

/* Cards & Components */
.card {
    background: var(--white);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    margin-bottom: 1.5rem;
}

.btn {
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition);
}

.btn-primary {
    background-color: var(--accent-color);
    color: var(--primary-color);
}

.btn-primary:hover {
    filter: brightness(1.1);
}