/* public/css/main.css */
:root {
    /* Colores Principales extraídos de los requerimientos */
    --bg-body: #e2e8f0;
    --bg-card: #ffffff;
    --text-main: #334155;
    --text-muted: #64748b;
    --brand-primary: #2563eb;
    --brand-primary-hover: #1d4ed8;
    --brand-success: #10b981;
    --brand-success-hover: #059669;
    --brand-accent: #1e293b;
    --brand-danger: #ef4444;
    --border-color: #cbd5e1;
    --header-bg: #f8fafc;
    
    /* Layout Variables */
    --sidebar-width: 250px;
    --header-height: 70px;
    --font-family-base: 'Inter', sans-serif;
}

body {
    font-family: var(--font-family-base);
    background-color: var(--bg-body);
    color: var(--text-main);
    margin: 0;
    padding: 0;
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
}

/* Base Layout Wrapper */
.app-wrapper {
    display: flex;
    min-height: 100vh;
}

/* Header */
.app-header {
    background-color: var(--bg-card);
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 25px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

.app-header-brand {
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--brand-accent);
    letter-spacing: -0.5px;
    margin: 0;
}

/* Sidebar Placeholder */
.app-sidebar {
    width: var(--sidebar-width);
    background-color: var(--brand-accent);
    color: #fff;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    font-weight: 700;
    font-size: 1.2rem;
    letter-spacing: 1px;
}

.sidebar-menu {
    list-style: none;
    padding: 10px 0;
    margin: 0;
    overflow-y: auto;
    flex-grow: 1;
}

.sidebar-menu li {
    position: relative;
    width: 100%;
}

.sidebar-menu .nav-link {
    display: flex;
    align-items: center;
    padding: 8px 20px; /* Reducido para compactar */
    color: #94a3b8;
    text-decoration: none;
    font-weight: 500;
    font-size: 13.5px;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.sidebar-menu .nav-link:hover, .sidebar-menu .nav-link.active {
    background-color: rgba(255, 255, 255, 0.05);
    color: #fff;
    border-left-color: var(--brand-primary);
}

.nav-icon {
    width: 24px;
    display: inline-block;
    text-align: center;
    margin-right: 10px;
    font-size: 16px;
}

/* Submenús */
.has-submenu .nav-link {
    justify-content: space-between;
}

.submenu-arrow {
    font-size: 10px;
    transition: transform 0.3s;
    opacity: 0.5;
    margin-left: auto;
}

.has-submenu.open > .nav-link .submenu-arrow {
    transform: rotate(180deg);
}

.submenu-list {
    list-style: none;
    padding: 0;
    margin: 0;
    background: rgba(0, 0, 0, 0.15);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s cubic-bezier(0, 1, 0, 1);
}

.has-submenu.open > .submenu-list {
    max-height: 1000px;
    transition: max-height 0.3s ease-in-out;
}

.submenu-link {
    display: flex;
    align-items: center;
    padding: 6px 20px 6px 45px;
    color: #94a3b8;
    text-decoration: none;
    font-size: 12.5px;
    transition: all 0.2s;
}

.submenu-link:hover {
    background-color: rgba(255, 255, 255, 0.03);
    color: #fff;
}

/* Main Content Area */
.app-main {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.app-content {
    padding: 24px;
}

/* Typography Helpers */
.page-title {
    margin: 0 0 20px 0;
    font-size: 1.5rem;
    color: var(--brand-accent);
    font-weight: 700;
    letter-spacing: -0.5px;
}

/* Common Utilities */
.text-muted { color: var(--text-muted); }
.text-primary { color: var(--brand-primary); }
/* --- Responsive Design (Mobile First adjustments) --- */
@media (max-width: 991px) {
    :root {
        --sidebar-width: 280px;
    }

    .app-sidebar {
        position: fixed;
        left: calc(-1 * var(--sidebar-width));
        top: 0;
        bottom: 0;
        z-index: 1000;
        transition: transform 0.3s ease-in-out;
        box-shadow: 10px 0 15px rgba(0,0,0,0.1);
    }

    .app-wrapper.sidebar-open .app-sidebar {
        transform: translateX(var(--sidebar-width));
    }

    /* Overlay para cerrar el menú al hacer clic fuera */
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0; left: 0; right: 0; bottom: 0;
        background: rgba(0,0,0,0.5);
        z-index: 999;
        backdrop-filter: blur(2px);
    }

    .app-wrapper.sidebar-open .sidebar-overlay {
        display: block;
    }

    .app-header {
        padding: 0 15px;
    }

    .app-header-brand {
        font-size: 1.1rem;
    }

    .user-status-container {
        display: none; /* Ocultar en móviles para ganar espacio, o mover a menú lateral */
    }

    .app-content {
        padding: 15px;
    }
}
