/* CSS específico para o sidebar */

/* ===== SIDEBAR PRINCIPAL ===== */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 280px;
    height: 100vh;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    border-right: 1px solid #e2e8f0;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    z-index: 1000;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    backdrop-filter: blur(12px);
}

/* ===== HEADER DO SIDEBAR ===== */
.sidebar-header {
    padding: 2rem 1.5rem 1.5rem;
    border-bottom: 1px solid #e2e8f0;
    background: linear-gradient(135deg, rgba(255,255,255,0.95) 0%, rgba(248,250,252,0.95) 100%);
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.logo-container {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 0.75rem;
    flex: 1;
}

.sidebar-logo {
    width: 60px;
    height: 60px;
    object-fit: contain;
    border-radius: 12px;
    transition: transform 0.3s ease;
}

.sidebar-logo:hover {
    transform: scale(1.05);
}

.company-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1e293b;
    letter-spacing: -0.02em;
}

.company-tagline {
    font-size: 0.8rem;
    color: #64748b;
    text-align: center;
}

/* ===== BOTÃO DE FECHAR ===== */
.sidebar-close-btn {
    background: #ef4444;
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
    font-size: 0.875rem;
    position: absolute;
    top: 1rem;
    right: 1rem;
}

.sidebar-close-btn:hover {
    background: #dc2626;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

.sidebar-close-btn:active {
    transform: scale(0.95);
}

/* ===== BUSCA GLOBAL NO SIDEBAR ===== */
.search-container {
    position: relative;
    padding: 0.5rem;
    margin: 0.25rem 0;
}

.search-container .input-group {
    margin-bottom: 0.5rem;
}

.search-container .form-control {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%) !important;
    border: 1px solid #d4af37 !important;
    border-radius: 6px !important;
    font-size: 0.8rem !important;
    padding: 0.375rem 0.5rem !important;
    color: #333 !important;
}

.search-container .form-control:focus {
    background: linear-gradient(135deg, #ffffff 0%, #f0f8ff 100%) !important;
    border-color: #d4af37 !important;
    box-shadow: 0 0 0 0.2rem rgba(212, 175, 55, 0.25) !important;
    color: #333 !important;
}

.search-container .btn {
    background: linear-gradient(135deg, #d4af37 0%, #b8860b 100%) !important;
    border: 1px solid #d4af37 !important;
    color: white !important;
    border-radius: 6px !important;
    padding: 0.375rem 0.5rem !important;
    font-size: 0.8rem !important;
    transition: all 0.3s ease !important;
}

.search-container .btn:hover {
    background: linear-gradient(135deg, #b8860b 0%, #9a7209 100%) !important;
    border-color: #b8860b !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 2px 8px rgba(212, 175, 55, 0.3) !important;
    color: white !important;
}

.search-results-dropdown {
    position: absolute !important;
    top: 100% !important;
    left: 0.5rem !important;
    right: 0.5rem !important;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%) !important;
    border: 2px solid #d4af37 !important;
    border-radius: 8px !important;
    box-shadow: 0 8px 25px rgba(212, 175, 55, 0.2) !important;
    z-index: 1050 !important;
    max-height: 300px !important;
    overflow-y: auto !important;
    margin-top: 2px !important;
}

.search-results-content {
    padding: 0.75rem;
}

.search-result-item {
    background: linear-gradient(135deg, #ffffff 0%, #f0f8ff 100%) !important;
    border: 1px solid #e9ecef !important;
    border-radius: 6px !important;
    padding: 0.5rem !important;
    margin-bottom: 0.375rem !important;
    transition: all 0.3s ease !important;
    cursor: pointer !important;
    text-decoration: none !important;
    color: #333 !important;
    display: block !important;
    font-size: 0.8rem !important;
}

.search-result-item:hover {
    background: linear-gradient(135deg, #d4af37 0%, #b8860b 100%) !important;
    color: white !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 3px 10px rgba(212, 175, 55, 0.3) !important;
    text-decoration: none !important;
}

.search-result-item:last-child {
    margin-bottom: 0;
}

.search-result-header {
    display: flex;
    align-items: center;
    margin-bottom: 0.25rem;
}

.search-result-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 0.5rem;
    font-size: 0.7rem;
    font-weight: 600;
}

.search-result-icon.clientes {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%) !important;
    color: white !important;
}

.search-result-icon.produtos {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%) !important;
    color: white !important;
}

.search-result-icon.requisicoes {
    background: linear-gradient(135deg, #d4af37 0%, #b8860b 100%) !important;
    color: white !important;
}

.search-result-icon.usuarios {
    background: linear-gradient(135deg, #6f42c1 0%, #5a2d91 100%) !important;
    color: white !important;
}

.search-result-icon.setores {
    background: linear-gradient(135deg, #fd7e14 0%, #e55a00 100%) !important;
    color: white !important;
}

.search-result-title {
    font-weight: 600 !important;
    font-size: 0.8rem !important;
    margin: 0 !important;
    color: #333 !important;
}

.search-result-subtitle {
    font-size: 0.7rem !important;
    opacity: 0.8 !important;
    margin: 0 !important;
    color: #666 !important;
}

.search-result-details {
    font-size: 0.65rem !important;
    opacity: 0.7 !important;
    margin-top: 0.125rem !important;
    color: #666 !important;
}

.search-no-results {
    text-align: center !important;
    padding: 1rem !important;
    color: #6c757d !important;
    font-size: 0.8rem !important;
}

.search-no-results i {
    font-size: 1.5rem !important;
    color: #d4af37 !important;
    margin-bottom: 0.25rem !important;
}

.search-loading {
    text-align: center !important;
    padding: 0.75rem !important;
    color: #6c757d !important;
    font-size: 0.8rem !important;
}

.search-loading i {
    animation: spin 1s linear infinite;
}

.search-result-item:hover .search-result-icon {
    transform: scale(1.05) !important;
}

.search-result-item:hover .search-result-title,
.search-result-item:hover .search-result-subtitle,
.search-result-item:hover .search-result-details {
    color: white !important;
}

/* ===== NAVEGAÇÃO ===== */
.sidebar-nav {
    padding: 1.5rem 1rem;
}

.nav-section {
    margin-bottom: 2rem;
}

.nav-section-title {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #64748b;
    margin-bottom: 0.75rem;
    padding: 0 0.75rem;
}

.nav-menu {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

/* ===== ITENS DO MENU ===== */
.nav-item {
    position: relative;
    animation: fadeInUp 0.3s ease forwards;
    opacity: 0;
}

.nav-item:nth-child(1) { animation-delay: 0.05s; }
.nav-item:nth-child(2) { animation-delay: 0.1s; }
.nav-item:nth-child(3) { animation-delay: 0.15s; }
.nav-item:nth-child(4) { animation-delay: 0.2s; }
.nav-item:nth-child(5) { animation-delay: 0.25s; }
.nav-item:nth-child(6) { animation-delay: 0.3s; }

.nav-link {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    color: #64748b;
    text-decoration: none;
    border-radius: 12px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    font-weight: 500;
    font-size: 0.9rem;
    gap: 0.75rem;
}

.nav-link:hover {
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    color: #1e293b;
    transform: translateX(4px);
}

.nav-item.active .nav-link {
    background: linear-gradient(135deg, #d4af37 0%, #eab308 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.3);
}

.nav-item.active .nav-link::before {
    content: '';
    position: absolute;
    left: -1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 60%;
    background: #d4af37;
    border-radius: 0 2px 2px 0;
}

/* ===== ÍCONES ===== */
.nav-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    opacity: 0.8;
    transition: all 0.2s ease;
}

.nav-item:hover .nav-icon {
    opacity: 1;
    transform: scale(1.1);
}

.nav-item.active .nav-icon {
    opacity: 1;
}

/* ===== SUBMENU ===== */
.nav-submenu {
    list-style: none;
    margin-top: 0.5rem;
    margin-left: 2.5rem;
    border-left: 2px solid #e2e8f0;
    padding-left: 0;
}

.nav-submenu-item {
    position: relative;
}

.nav-submenu-link {
    display: block;
    padding: 0.5rem 1rem;
    color: #64748b;
    text-decoration: none;
    font-size: 0.85rem;
    border-radius: 8px;
    margin: 0.125rem 0;
    transition: all 0.2s ease;
    position: relative;
}

.nav-submenu-link::before {
    content: '';
    position: absolute;
    left: -2px;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 4px;
    background: #cbd5e1;
    border-radius: 50%;
}

.nav-submenu-link:hover {
    background: #f1f5f9;
    color: #1e293b;
    padding-left: 1.25rem;
}

.nav-submenu-link:hover::before {
    background: #d4af37;
    transform: translateY(-50%) scale(1.5);
}

/* ===== SETA DO DROPDOWN ===== */
.nav-arrow {
    margin-left: auto;
    font-size: 0.7rem;
    transition: transform 0.2s ease;
    opacity: 0.6;
}

.nav-item.expanded .nav-arrow {
    transform: rotate(90deg);
}

/* ===== BOTÃO TOGGLE ===== */
.sidebar-toggle {
    position: fixed;
    top: 1.5rem;
    left: 1.5rem;
    z-index: 1001;
    background: #d4af37;
    border: none;
    color: white;
    padding: 12px;
    border-radius: 12px;
    cursor: pointer;
    display: none;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.3);
}

.sidebar-toggle:hover {
    background: #b8860b;
    transform: scale(1.05);
}

/* ===== OVERLAY ===== */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.sidebar-overlay.show {
    opacity: 1;
    visibility: visible;
}

/* ===== ESTADO COLAPSADO ===== */
.sidebar.collapsed {
    width: 70px;
}

.sidebar.collapsed .sidebar-header {
    padding: 1rem 0.5rem;
}

.sidebar.collapsed .company-name,
.sidebar.collapsed .company-tagline,
.sidebar.collapsed .nav-section-title {
    display: none;
}

.sidebar.collapsed .nav-link {
    justify-content: center;
    padding: 0.75rem 0.5rem;
}

.sidebar.collapsed .nav-text,
.sidebar.collapsed .nav-arrow {
    display: none;
}

.sidebar.collapsed .nav-submenu {
    display: none !important;
}

/* ===== BADGE ===== */
.nav-badge {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    font-size: 0.65rem;
    padding: 0.15rem 0.4rem;
    border-radius: 10px;
    margin-left: auto;
    font-weight: 600;
    min-width: 18px;
    text-align: center;
}

/* ===== SCROLLBAR ===== */
.sidebar::-webkit-scrollbar {
    width: 4px;
}

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

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(203, 213, 225, 0.5);
    border-radius: 2px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(203, 213, 225, 0.8);
}

/* ===== RESPONSIVIDADE ===== */
@media (max-width: 768px) {
    .sidebar {
        left: -100%;
        width: 300px;
        z-index: 1050;
    }

    .sidebar.show {
        left: 0;
    }

    .sidebar-toggle {
        display: block;
    }
    
    .sidebar-close-btn {
        display: flex;
    }
}

@media (max-width: 480px) {
    .sidebar {
        width: 100%;
    }

    .sidebar-header {
        padding: 1.5rem 1rem;
    }

    .sidebar-logo {
        width: 50px;
        height: 50px;
    }

    .company-name {
        font-size: 1rem;
    }
}

/* ===== ANIMAÇÕES ===== */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== ESTADOS ESPECIAIS ===== */
.nav-item.expanded .nav-submenu {
    display: block;
    animation: slideDown 0.3s ease;
}

/* ===== HOVER EFFECTS ===== */
.nav-link:hover .nav-icon {
    color: #d4af37;
}

.nav-item.active .nav-link .nav-icon {
    color: white;
}

/* ===== FOCUS STATES ===== */
.nav-link:focus,
.nav-submenu-link:focus {
    outline: 2px solid #d4af37;
    outline-offset: 2px;
}