/* ============================================
   LAYOUT PRINCIPAL - LICITA.PUB
   ============================================ */

/* Reset e Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-page);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

/* ============================================
   HEADER
   ============================================ */
.header {
    background-color: var(--bg-header);
    color: var(--text-on-primary);
    padding: 1rem 0;
    border-bottom: 3px solid var(--bg-header-border);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-md);
}

.header-container {
    max-width: 100%;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo i {
    font-size: 1.8rem;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-name {
    font-size: 0.9rem;
}

.btn-logout {
    background-color: transparent;
    border: 1px solid white;
    color: white;
    padding: 6px 15px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
    gap: 5px;
}

.btn-logout:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* ============================================
   BARRA DE LIMITE
   ============================================ */
.limite-bar {
    background-color: var(--primary-light);
    border-bottom: 1px solid var(--border-color);
    padding: 12px 0;
}

.limite-container {
    max-width: 100%;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.limite-info {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.limite-count {
    font-weight: 600;
    color: var(--primary);
}

.limite-renova {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* ============================================
   CONTAINER PRINCIPAL (Sidebar + Content)
   ============================================ */
.app-container,
.layout {
    display: flex;
    min-height: calc(100vh);
    background-color: var(--bg-page);
}

/* ============================================
   SIDEBAR (Menu Lateral)
   ============================================ */
.sidebar {
    width: 260px;
    background-color: var(--bg-card);
    border-right: 1px solid var(--border-color);
    overflow-y: auto;
    transition: transform 0.3s ease;
}

/* Sidebar para páginas COM header principal (app.html) */
.app-container .sidebar {
    position: sticky;
    top: 140px;
    height: calc(100vh - 140px);
}

/* Sidebar para páginas SEM header principal (consultas, inteligencia-precos) */
.layout .sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    background-color: var(--bg-elevated);
}

.sidebar-header .logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--primary);
}

.sidebar-toggle {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-muted);
    cursor: pointer;
    padding: 5px;
    display: none;
}

.sidebar-nav {
    padding: 20px 0;
}

/* Seções do Menu */
.nav-section {
    margin-bottom: 25px;
}

.nav-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.nav-section-title {
    padding: 10px 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-items {
    list-style: none;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
    position: relative;
}

.nav-item i {
    width: 20px;
    font-size: 1.1rem;
    color: var(--text-muted);
}

.nav-item span:not(.badge) {
    flex: 1;
}

.nav-item:hover {
    background-color: var(--bg-hover);
}

.nav-item.active {
    background-color: var(--primary-light);
    color: var(--primary);
    font-weight: 500;
    border-left: 3px solid var(--primary);
}

.nav-item.active i {
    color: var(--primary);
}

.nav-item.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* Badges */
.badge {
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 500;
}

.badge-new {
    background-color: var(--success);
    color: var(--text-on-primary);
}

.badge-soon {
    background-color: var(--warning);
    color: var(--text-primary);
}

/* Botão Toggle (Mobile) */
.sidebar-toggle {
    display: none;
    position: fixed;
    bottom: 20px;
    left: 20px;
    width: 50px;
    height: 50px;
    background-color: var(--primary);
    color: var(--text-on-primary);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: var(--shadow-md);
    z-index: 1000;
    transition: all 0.3s;
}

.sidebar-toggle:hover {
    background-color: var(--primary-hover);
    transform: scale(1.05);
}

/* ============================================
   CONTEÚDO PRINCIPAL
   ============================================ */
.main-content {
    flex: 1;
    padding: 0;
    overflow-y: auto;
    background-color: var(--bg-page);
}

.content-header {
    background-color: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    padding: 20px 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.page-title {
    font-size: 1.5rem;
    color: var(--primary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.mobile-menu-toggle {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--primary);
    cursor: pointer;
    padding: 5px;
}

@media (min-width: 769px) {
    .mobile-menu-toggle {
        display: none;
    }
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.content-body {
    padding: 30px;
}

/* Loading State */
.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    color: var(--text-muted);
}

.spinner {
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--primary);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ============================================
   RESPONSIVE - MOBILE
   ============================================ */
@media (max-width: 768px) {
    /* Header Mobile */
    .header-container {
        padding: 0 15px;
    }

    .logo {
        font-size: 1.2rem;
    }

    .user-name {
        display: none;
    }

    .btn-logout {
        padding: 6px 10px;
        font-size: 0.8rem;
    }

    /* Limite Bar Mobile */
    .limite-container {
        flex-direction: column;
        gap: 5px;
        text-align: center;
    }

    /* Sidebar Mobile */
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        width: 280px;
        height: 100vh;
        z-index: 999;
        transform: translateX(-100%);
        box-shadow: var(--shadow-lg);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* Main Content Mobile */
    .main-content {
        padding: 15px;
    }

    /* App Container */
    .app-container {
        min-height: calc(100vh - 180px);
    }
}

/* Tablet */
@media (min-width: 769px) and (max-width: 1024px) {
    .sidebar {
        width: 220px;
    }

    .nav-section-title {
        font-size: 0.7rem;
    }

    .nav-item {
        padding: 10px 15px;
        font-size: 0.9rem;
    }
}

/* Desktop Large */
@media (min-width: 1400px) {
    .sidebar {
        width: 280px;
    }

    .main-content {
