/* ═══════════════════════════════════════════════════════════════════
   NOVA GESTION - APP SHELL LAYOUT v2.0
   Sidebar, Header, and Main Wrapper
   ═══════════════════════════════════════════════════════════════════ */

/* ═══ HEADER ═══ */
.header-fixed {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    z-index: 1020;
    background: var(--header-bg);
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: center;
    padding: 0 35px;
    color: var(--header-text);
    transition: all 0.3s ease;
    gap: 40px;
}

/* Header Logo */
.header-logo-container {
    display: flex;
    align-items: center;
    gap: 15px;
}

.header-logo {
    height: 56px;
    object-fit: contain;
}

.system-name {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: var(--header-text);
}

.system-name small {
    display: block;
    font-size: 0.75rem;
    font-weight: 400;
    opacity: 0.8;
    margin-top: -2px;
}

/* Header Meta (Right Side) */
.header-right-meta {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 40px;
}

.header-location {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.1);
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: white;
}

.header-location i {
    color: #ff4b5c;
    /* Exception for location icon */
    font-size: 1rem;
}

.header-clock {
    background: rgba(0, 0, 0, 0.2);
    color: #00f2fe;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 1rem;
    font-family: var(--font-mono);
    font-weight: 600;
    min-width: 100px;
    text-align: center;
    border: 1px solid rgba(0, 242, 254, 0.3);
    box-shadow: 0 0 10px rgba(0, 242, 254, 0.1);
}

/* Header Actions */
.header-actions {
    display: flex;
    align-items: center;
    gap: 40px;
}

.header-action-btn {
    background: rgba(255, 255, 255, 0.1);
    color: var(--header-text);
    border: 1px solid rgba(255, 255, 255, 0.2);
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all 0.2s;
    cursor: pointer;
}

.header-action-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
    color: white;
}

/* ═══ SIDEBAR ═══ */
.sidebar {
    position: fixed !important;
    top: 0 !important;
    left: calc(var(--sidebar-width) * -1);
    width: var(--sidebar-width);
    height: 100vh !important;
    background: var(--bg-surface);
    z-index: 9999 !important;
    transition: left 0.3s ease;
    box-shadow: 2px 0 15px rgba(0, 0, 0, 0.4);
    border-right: 1px solid var(--border-subtle);
    overflow-y: auto;
    color: var(--text-primary);
}

.sidebar.open {
    left: 0;
}

.sidebar-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9998 !important;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.sidebar-overlay.show {
    display: block;
    opacity: 1;
    pointer-events: auto;
}

.sidebar-toggle-btn {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 10px;
    margin-right: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.sidebar-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
}

/* ═══ SIDEBAR NAV ITEMS ═══ */
.sidebar-header {
    padding: 1.25rem 1rem 1rem 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    border-bottom: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.1));
    margin-bottom: 0.5rem;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    padding: 0.5rem 0;
    gap: 2px;
}

.sidebar-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0.7rem 1.1rem;
    color: var(--text-secondary, rgba(255, 255, 255, 0.7));
    text-decoration: none;
    border-radius: 0.5rem;
    margin: 0 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.15s ease;
    cursor: pointer;
    line-height: 1.3;
}

.sidebar-nav-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary, #fff);
    text-decoration: none;
}

.sidebar-nav-item.active,
.sidebar-nav-item[aria-current="page"] {
    background: var(--primary, #2563eb);
    color: #fff;
    font-weight: 600;
}

.sidebar-nav-item svg,
.sidebar-nav-item i {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    font-size: 1rem;
    opacity: 0.85;
}

.sidebar-nav-item:hover svg,
.sidebar-nav-item:hover i,
.sidebar-nav-item.active svg,
.sidebar-nav-item.active i {
    opacity: 1;
}

/* ═══ Sidebar Scrollbar ═══ */
.sidebar::-webkit-scrollbar {
    width: 4px;
}

.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
}

/* Sidebar Theme Specifics */
[data-theme="corporate"] .sidebar {
    background: var(--primary);
    /* Corporate Blue */
    border-right: 1px solid rgba(255, 255, 255, 0.1);
}

[data-theme="corporate"] .sidebar-nav-item {
    color: rgba(255, 255, 255, 0.7);
}

[data-theme="corporate"] .sidebar-nav-item:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
}

[data-theme="corporate"] .sidebar-section-header {
    color: rgba(255, 255, 255, 0.5);
}

/* ═══ MAIN WRAPPER ═══ */
.main-wrapper {
    padding-top: 0;
    padding-bottom: 40px;
    min-height: 100vh;
    background-color: var(--bg-app);
}

/* ═══ DROPDOWNS ═══ */
.user-dropdown .dropdown-toggle {
    background: white;
    color: var(--primary);
    border: none;
    padding: 5px 15px 5px 5px;
    border-radius: 30px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.2s;
    cursor: pointer;
}

.user-initial {
    width: 32px;
    height: 32px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.theme-menu-container {
    position: relative;
}

.theme-dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: #FFFFFF;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-sm);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    min-width: 180px;
    display: none;
    z-index: 9000;
    overflow: hidden;
}

.theme-dropdown-menu.show {
    display: block;
}

.theme-dropdown-menu button {
    width: 100%;
    padding: 12px 16px;
    border: none;
    background: none;
    cursor: pointer;
    text-align: left;
    color: #1E293B;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
}

[data-theme="dark"] .theme-dropdown-menu {
    background: #1E293B;
    border-color: #334155;
}

[data-theme="dark"] .theme-dropdown-menu button {
    color: #F8FAFC;
}

.theme-dropdown-menu button:hover {
    background: #3B82F6;
    color: #FFFFFF;
}

[data-theme="dark"] .theme-dropdown-menu button:hover {
    background: #3B82F6;
    color: #FFFFFF;
}