/* =========================================
   SISGEL ENTERPRISE THEME CORE
   ========================================= */

:root {
    --sidebar-bg: linear-gradient(180deg, #0b1120 0%, #1e293b 100%);
    --accent-color: #3b82f6;
    --accent-hover: #2563eb;
    --body-bg: #f4f6f8;
    --text-muted: #94a3b8;
    --text-active: #ffffff;
    --sidebar-width: 260px;
}

body {
    background-color: var(--body-bg);
    font-family: 'Segoe UI', system-ui, sans-serif;
    overflow-x: hidden;
}

/* --- Layout Estrutural --- */
.page {
    display: flex;
    flex-direction: row;
    min-height: 100vh;
}

.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    color: white;
    box-shadow: 4px 0 15px rgba(0,0,0,0.3);
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 1000;
    transition: transform 0.3s ease-in-out;
}

.main-content {
    margin-left: var(--sidebar-width);
    flex-grow: 1;
    padding: 2rem;
    transition: margin-left 0.3s ease-in-out;
}

/* --- Mobile Responsiveness --- */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.visible {
        transform: translateX(0);
    }
    .main-content {
        margin-left: 0;
    }
}

/* --- NavMenu Customizado (Sisgel Standard) --- */
.nav-item-custom {
    padding: 12px 20px;
    margin: 4px 10px;
    border-radius: 6px;
    color: var(--text-muted);
    text-decoration: none;
    display: flex;
    align-items: center;
    transition: all 0.2s ease;
    cursor: pointer;
}

.nav-item-custom i {
    margin-right: 12px;
    font-size: 1.2rem;
}

.nav-item-custom:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: #f1f5f9 !important;
    transform: translateX(4px);
}

.nav-item-custom.active {
    background: linear-gradient(90deg, rgba(37, 99, 235, 0.15) 0%, rgba(37, 99, 235, 0.0) 100%);
    color: #60a5fa !important;
    border-left: 3px solid var(--accent-color);
}

/* --- PWA: Installation Wall Logic --- */
/* Se o body tiver a classe .is-app (PWA instalado), esconde elementos de browser */
body.is-app .browser-only {
    display: none !important;
}

/* Se NÃO tiver a classe .is-app, esconde elementos exclusivos do App */
body:not(.is-app) .app-only {
    display: none !important;
}