/* ============================================
   VARIÁVEIS CSS - Cores Padronizadas
   ============================================ */
:root {
    --primary-blue: #2563eb;
    --primary-blue-hover: #1d4ed8;
    --primary-blue-dark: #1e40af;
    --success-green: #16a34a;
    --success-green-dark: #15803d;
    --danger-red: #dc2626;
    --danger-red-dark: #b91c1c;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
}

/* ============================================
   SCROLLBAR CUSTOMIZADA
   ============================================ */
.scrollbar-none-custom {
    scrollbar-width: thin;
    scrollbar-color: #a0aec0 #edf2f7;
}

.scrollbar-none-custom::-webkit-scrollbar {
    width: 0px;
}

.scrollbar-none-custom::-webkit-scrollbar-thumb {
    background-color: #a0aec0;
    border-radius: 4px;
}

.scrollbar-none-custom::-webkit-scrollbar-track {
    background-color: #edf2f7;
    border-radius: 4px;
}

/* ============================================
   SWEETALERT2 - Personalização
   ============================================ */
/* Container do modal SweetAlert2 */
.swal2-container {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    z-index: 9999 !important;
}

/* Backdrop do SweetAlert2 - cobre toda a tela */
.swal2-backdrop-show {
    background-color: rgba(0, 0, 0, 0.4) !important;
}

.swal2-backdrop {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background-color: rgba(0, 0, 0, 0.4) !important;
    z-index: 9998 !important;
}

/* Modal SweetAlert2 com conteúdo grande */
.swal2-popup {
    max-width: 48rem !important; /* max-w-4xl */
    max-height: 90vh !important;
    overflow-y: auto !important;
}

/* Container HTML do SweetAlert2 com scroll */
.swal2-html-container {
    max-height: calc(90vh - 200px) !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
}

/* Scrollbar customizada para SweetAlert2 */
.swal2-html-container::-webkit-scrollbar {
    width: 8px;
}

.swal2-html-container::-webkit-scrollbar-track {
    background: var(--gray-100);
    border-radius: 4px;
}

.swal2-html-container::-webkit-scrollbar-thumb {
    background: var(--gray-400);
    border-radius: 4px;
}

.swal2-html-container::-webkit-scrollbar-thumb:hover {
    background: var(--gray-500);
}

.swal2-confirm {
    background-color: var(--primary-blue) !important;
}

.swal2-confirm:hover {
    background-color: var(--primary-blue-hover) !important;
}

.swal2-deny {
    background-color: var(--primary-blue) !important;
    display: inline-block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.swal2-deny:hover {
    background-color: var(--primary-blue-hover) !important;
}

.swal2-cancel {
    background-color: var(--danger-red) !important;
}

.swal2-cancel:hover {
    background-color: var(--danger-red-dark) !important;
}

/* Garantir que todos os botões do SweetAlert sejam visíveis */
.swal2-actions {
    display: flex !important;
    gap: 10px !important;
    justify-content: center !important;
}

.swal2-actions button {
    display: inline-block !important;
    visibility: visible !important;
    opacity: 1 !important;
    margin: 0 5px !important;
}

/* ============================================
   COMPONENTES PADRONIZADOS - Tabelas
   ============================================ */

/* Tabela Base Padronizada */
.table-standard {
    width: 100%;
    height: 100%;
    font-size: 0.75rem;
    border-radius: 0.75rem;
    border-collapse: separate;
    border-spacing: 0;
    overflow: hidden;
    background-color: white;
}

/* Header da Tabela */
.table-standard thead {
    height: 4rem;
}

.table-standard thead tr {
    background-color: var(--gray-800);
    color: white;
}

.table-standard thead th {
    padding: 1rem;
    text-align: left;
    font-weight: bold;
    color: white;
}

/* Respeitar classes de alinhamento específicas nos headers */
.table-standard thead th.text-center {
    text-align: center;
}

.table-standard thead th.text-right {
    text-align: right;
}

.table-standard thead th.text-left {
    text-align: left;
}

.table-standard thead th:first-child {
    border-top-left-radius: 0.75rem;
}

.table-standard thead th:last-child {
    border-top-right-radius: 0.75rem;
}

/* Body da Tabela - Linhas Striped */
.table-standard tbody {
    background-color: white;
}

.table-standard tbody tr {
    height: 2.5rem;
    transition: background-color 0.2s ease;
    border-bottom: 1px solid var(--gray-200);
}

/* Linhas alternadas (striped) - padrão odd/even */
.table-standard tbody tr:nth-child(odd) {
    background-color: white;
}

.table-standard tbody tr:nth-child(even) {
    background-color: var(--gray-50);
}

/* Hover nas linhas */
.table-standard tbody tr:hover {
    background-color: var(--gray-100);
}

/* Células do body */
.table-standard tbody td {
    padding: 0 1rem;
    vertical-align: middle;
}

/* Linha vazia (sem dados) */
.table-standard tbody tr.empty-row td {
    text-align: center;
    color: var(--gray-500);
    padding: 2rem;
    font-style: italic;
}

/* Footer da Tabela */
.table-standard tfoot {
    background-color: var(--gray-800);
}

.table-standard tfoot tr {
    height: 3rem;
    background-color: var(--gray-800);
}

.table-standard tfoot td {
    padding: 0.75rem 1rem;
}

.table-standard tfoot td:first-child {
    border-bottom-left-radius: 0.75rem;
}

.table-standard tfoot td:last-child {
    border-bottom-right-radius: 0.75rem;
}

/* Links de ação na tabela */
.table-standard .action-link {
    text-decoration: underline;
    text-decoration-color: #60a5fa;
    text-decoration-thickness: 2px;
    cursor: pointer;
    transition: color 0.2s ease;
}

.table-standard .action-link:hover {
    color: #2563eb;
}

.table-standard .action-link-delete {
    text-decoration: underline;
    text-decoration-color: #f472b6;
    text-decoration-thickness: 2px;
    cursor: pointer;
    transition: color 0.2s ease;
}

.table-standard .action-link-delete:hover {
    color: #dc2626;
}

/* Badges/Tags na tabela */
.table-standard .badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    border-radius: 9999px;
    font-weight: 500;
}

.table-standard .badge-green {
    background-color: #dcfce7;
    color: #166534;
}

.table-standard .badge-blue {
    background-color: #dbeafe;
    color: #1e40af;
}

.table-standard .badge-purple {
    background-color: #f3e8ff;
    color: #6b21a8;
}

.table-standard .badge-gray {
    background-color: var(--gray-100);
    color: var(--gray-800);
}

/* Botões no footer */
.table-standard tfoot .btn-new {
    background-color: #1e40af;
    color: white;
    padding: 0.625rem 1.25rem;
    border-radius: 0.5rem;
    font-weight: 500;
    font-size: 0.875rem;
    transition: background-color 0.2s;
    border: none;
    cursor: pointer;
}

.table-standard tfoot .btn-new:hover {
    background-color: #1e3a8a;
}

.table-standard tfoot .btn-export {
    background-color: #15803d;
    color: white;
    padding: 0.625rem 1.25rem;
    border-radius: 0.5rem;
    font-weight: 500;
    font-size: 0.875rem;
    transition: background-color 0.2s;
    border: none;
    cursor: pointer;
}

.table-standard tfoot .btn-export:hover {
    background-color: #166534;
}

/* Responsividade */
@media (max-width: 768px) {
    .table-standard {
        font-size: 0.625rem;
    }

    .table-standard thead th,
    .table-standard tbody td {
        padding: 0.5rem;
    }
}

/* ============================================
   COMPONENTES PADRONIZADOS - Botões
   ============================================ */
.btn-primary {
    background-color: #1e40af;
    color: white;
    padding: 0.625rem 1.25rem;
    border-radius: 0.5rem;
    font-weight: 500;
    font-size: 0.875rem;
    transition: background-color 0.2s;
    border: none;
    cursor: pointer;
}

.btn-primary:hover {
    background-color: #1e3a8a;
}

.btn-primary:focus {
    outline: none;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.3);
}

.btn-success {
    background-color: #15803d;
    color: white;
    padding: 0.625rem 1.25rem;
    border-radius: 0.5rem;
    font-weight: 500;
    font-size: 0.875rem;
    transition: background-color 0.2s;
    border: none;
    cursor: pointer;
}

.btn-success:hover {
    background-color: #166534;
}

.btn-success:focus {
    outline: none;
    box-shadow: 0 0 0 4px rgba(22, 163, 74, 0.3);
}

.btn-danger {
    background-color: #b91c1c;
    color: white;
    padding: 0.625rem 1.25rem;
    border-radius: 0.5rem;
    font-weight: 500;
    font-size: 0.875rem;
    transition: background-color 0.2s;
    border: none;
    cursor: pointer;
}

.btn-danger:hover {
    background-color: #991b1b;
}

.btn-danger:focus {
    outline: none;
    box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.3);
}

/* ============================================
   COMPONENTES PADRONIZADOS - Alertas
   ============================================ */
.alert-success {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 1rem;
    color: #f0fdf4;
    border-radius: 0.5rem;
    background-color: #166534;
}

.alert-error {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 1rem;
    color: #fef2f2;
    border-radius: 0.5rem;
    background-color: #991b1b;
}

.alert-warning {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 1rem;
    color: #fffbeb;
    border-radius: 0.5rem;
    background-color: #a16207;
}

.alert-info {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 1rem;
    color: #eff6ff;
    border-radius: 0.5rem;
    background-color: #1e40af;
}

/* ============================================
   COMPONENTES PADRONIZADOS - Modais
   ============================================ */
.modal-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 50;
    width: 100%;
    padding: 1rem;
    overflow-x: hidden;
    overflow-y: auto;
    max-height: calc(100% - 1rem);
}

.modal-content {
    position: relative;
    width: 100%;
    max-width: 42rem;
    max-height: 100%;
    margin: 0 auto;
}

.modal-body {
    position: relative;
    background-color: white;
    border-radius: 0.5rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 1rem;
    border-bottom: 1px solid var(--gray-200);
    border-top-left-radius: 0.5rem;
    border-top-right-radius: 0.5rem;
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--gray-900);
    margin: 0;
}

.modal-close {
    color: var(--gray-400);
    background-color: transparent;
    border: none;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    width: 2rem;
    height: 2rem;
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.modal-close:hover {
    background-color: var(--gray-200);
    color: var(--gray-900);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: 1.5rem;
    gap: 0.5rem;
    border-top: 1px solid var(--gray-200);
    border-bottom-left-radius: 0.5rem;
    border-bottom-right-radius: 0.5rem;
}

/* Modais Flowbite - Correções e melhorias */
/* Garantir que modais não saiam da tela */
.fixed.top-0.left-0.right-0.z-50 {
    max-height: 100vh;
    overflow-y: auto;
}

/* Container do modal com altura máxima */
.fixed.top-0.left-0.right-0.z-50 > .relative {
    max-height: calc(100vh - 2rem);
    display: flex;
    align-items: center;
    min-height: calc(100% - 1rem);
}

/* Modal body com scroll interno quando necessário */
.modal-body-scroll {
    max-height: calc(90vh - 200px);
    overflow-y: auto;
    overflow-x: hidden;
}

/* Tamanhos de modal maiores */
.modal-large {
    max-width: 48rem !important; /* max-w-4xl */
}

.modal-xl {
    max-width: 64rem !important; /* max-w-5xl */
}

/* Garantir que header e footer fiquem fixos */
.modal-header-fixed {
    flex-shrink: 0;
}

.modal-footer-fixed {
    flex-shrink: 0;
}

/* Scrollbar customizada para modais */
.modal-body-scroll::-webkit-scrollbar {
    width: 8px;
}

.modal-body-scroll::-webkit-scrollbar-track {
    background: var(--gray-100);
    border-radius: 4px;
}

.modal-body-scroll::-webkit-scrollbar-thumb {
    background: var(--gray-400);
    border-radius: 4px;
}

.modal-body-scroll::-webkit-scrollbar-thumb:hover {
    background: var(--gray-500);
}

/* ============================================
   COMPONENTES PADRONIZADOS - Formulários
   ============================================ */
.form-input {
    background-color: var(--gray-50);
    border: 1px solid var(--gray-300);
    color: var(--gray-900);
    font-size: 0.875rem;
    border-radius: 0.5rem;
    width: 100%;
    padding: 0.625rem;
    transition: all 0.2s;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-blue);
    background-color: white;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

.form-input:disabled {
    background-color: var(--gray-300);
    cursor: not-allowed;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-900);
}

.form-select {
    background-color: var(--gray-50);
    border: 1px solid var(--gray-300);
    color: var(--gray-900);
    font-size: 0.875rem;
    border-radius: 0.5rem;
    width: 100%;
    padding: 0.625rem;
    transition: all 0.2s;
}

.form-select:focus {
    outline: none;
    border-color: var(--primary-blue);
    background-color: white;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

/* ============================================
   UTILITÁRIOS - Padding Left Customizado
   ============================================ */
.pl-8 {
    padding-left: 2rem !important;
}

/* ============================================
   LAYOUT - Container Principal
   ============================================ */
.container-main {
    background-color: white;
    width: 80%;
    margin-left: 20%;
    padding: 5rem;
    min-height: 100vh;
}

.container-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
}

.page-title {
    color: var(--gray-900);
    font-size: 1.25rem;
    font-weight: 500;
    text-decoration: underline;
}

/* ============================================
   LAYOUT - Sidebar
   ============================================ */
.sidebar {
    position: fixed;
    min-height: 100vh;
    background-color: var(--gray-200);
    width: 20%;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    padding: 0.5rem;
    margin-bottom: 1rem;
}

/* ============================================
   RESPONSIVIDADE
   ============================================ */
@media (max-width: 768px) {
    .container-main {
        width: 100%;
        margin-left: 0;
        padding: 1rem;
    }

    .sidebar {
        width: 100%;
        position: relative;
    }
}

/* ============================================
   FORMULÁRIO CUSTO-BENEFÍCIO
   ============================================ */
.custo-beneficio-wrapper {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.form-section {
    margin-bottom: 32px;
    padding: 24px;
    background-color: #f9fafb;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
}

.section-title {
    margin: 0 0 20px 0;
    font-size: 18px;
    font-weight: 600;
    color: #111827;
    border-bottom: 2px solid #3b82f6;
    padding-bottom: 8px;
}

.form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 16px;
}

.form-group {
    flex: 1;
    min-width: 200px;
}

.form-buttons {
    display: flex;
    gap: 8px;
    margin-top: 16px;
}

.btn-secondary {
    background-color: #6b7280;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn-secondary:hover {
    background-color: #4b5563;
}

.loading {
    display: none;
    text-align: center;
    padding: 20px;
    color: #6b7280;
}

.resultado {
    margin-top: 24px;
    padding: 20px;
    border-radius: 8px;
    display: none;
}

.resultado.sucesso {
    background-color: #f0f9ff;
    border: 1px solid #0ea5e9;
}

.resultado.erro {
    background-color: #fef2f2;
    border: 1px solid #ef4444;
}

.resultado-titulo {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
}

.resultado-item {
    margin-bottom: 8px;
}

.resultado-item strong {
    font-weight: 600;
}

.comparacao-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 20px;
}

.produto-card {
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px;
    position: relative;
}

.produto-card.vencedor {
    border-color: #10b981;
    background: #f0fdf4;
}

.produto-card.vencedor::before {
    content: "🏆 MELHOR OPÇÃO";
    position: absolute;
    top: -12px;
    left: 20px;
    background: #10b981;
    color: white;
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 600;
}

.produto-titulo {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
    color: #111827;
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 8px;
}

.produto-info {
    margin-bottom: 8px;
    font-size: 14px;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.produto-info .label {
    font-weight: 500;
    color: #6b7280;
    min-width: 100px;
    flex-shrink: 0;
}

.produto-info .valor {
    font-weight: 600;
    color: #111827;
    flex: 1;
    word-wrap: break-word;
    line-height: 1.4;
}

.desconto-info {
    background: #fef3c7;
    border: 1px solid #f59e0b;
    border-radius: 8px;
    padding: 12px;
    margin-top: 12px;
}

.desconto-percentual {
    font-size: 16px;
    font-weight: 600;
    color: #92400e;
    margin-bottom: 8px;
}

.btn-desconto {
    background: #f59e0b;
    color: white;
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    display: inline-block;
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn-desconto:hover {
    background: #d97706;
    text-decoration: none;
    color: white;
}

.sem-produto {
    text-align: center;
    padding: 40px;
    color: #6b7280;
    font-style: italic;
}

@media (max-width: 768px) {
    .form-row {
        flex-direction: column;
    }

    .form-group {
        min-width: 100%;
    }

    .form-buttons {
        flex-direction: column;
    }

    .comparacao-container {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .produto-card.vencedor::before {
        left: 50%;
        transform: translateX(-50%);
    }
}

/* ============================================
   FORMULÁRIO FARMÁCIA PARCEIRA
   ============================================ */
/* Remove o outline padrão e adiciona transição suave na borda inferior */
input:focus, select:focus {
    outline: none !important;
    box-shadow: none !important;
    border-bottom: 2px solid #4B5563 !important;
    transition: border-color 0.2s ease-in-out;
}

/* Estilo base para inputs e selects */
input, select {
    height: 42px !important;
    border: 1px solid #E5E7EB !important;
    border-bottom: 2px solid #E5E7EB !important;
    padding: 8px 12px !important;
    transition: all 0.2s ease-in-out;
}

/* Remove as setas do input number */
input[type=number]::-webkit-inner-spin-button, 
input[type=number]::-webkit-outer-spin-button { 
    -webkit-appearance: none; 
    margin: 0; 
}

input[type=number] {
    -moz-appearance: textfield;
}

/* Estilo para o estado de erro */
.error-field {
    border-bottom: 2px solid #EF4444 !important;
}

/* Estilo para o placeholder */
::placeholder {
    color: #9CA3AF;
    opacity: 1;
}

/* Estilo para a imagem de preview */
#preview-image {
    object-fit: contain;
    max-height: 128px;
    border-radius: 4px;
}

/* Estilo para o botão de remover */
#remove-image {
    transition: all 0.2s ease-in-out;
}

#remove-image:hover {
    text-decoration: underline;
}

/* ============================================
   UTILITÁRIOS - Display
   ============================================ */
.hidden {
    display: none !important;
}

.show {
    display: block !important;
}

/* ============================================
   UTILITÁRIOS - Imagens
   ============================================ */
.image-preview {
    object-fit: contain;
    max-height: 128px;
    border-radius: 4px;
}

.image-icon {
    width: 18px;
    height: 15px;
}

/* ============================================
   UTILITÁRIOS - Texto
   ============================================ */
.text-muted {
    color: #9ca3af;
}

.text-center {
    text-align: center;
}

/* ============================================
   SIDEBAR - Geral
   ============================================ */
#side-navbar {
    background: linear-gradient(180deg, #f9fafb 0%, #f3f4f6 100%);
    border-right: 1px solid #e5e7eb;
    width: 20%;
    min-width: 250px;
    max-width: 400px;
    transition: transform 0.3s ease;
    z-index: 1000;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Container interno da sidebar - ocupa toda a altura */
#side-navbar > div {
    height: 100%;
    min-height: 100%;
}

#side-navbar.sidebar-hidden {
    transform: translateX(-100%);
    width: 0 !important;
    min-width: 0;
    overflow: hidden;
}

.sidebar-toggle-btn {
    position: fixed;
    top: 10px;
    left: calc(20% - 8px);
    z-index: 1001;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 0 6px 6px 0;
    padding: 8px 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    transform: translateX(-100%);
}

.sidebar-toggle-btn:hover {
    background: #f3f4f6;
    box-shadow: 2px 2px 6px rgba(0, 0, 0, 0.15);
}

.sidebar-toggle-btn:active {
    transform: translateX(-100%);
}

.sidebar-toggle-btn svg {
    color: #4b5563;
    transition: transform 0.3s ease;
}

/* Botão quando sidebar está escondida - move para a esquerda */
#side-navbar.sidebar-hidden ~ #sidebar-toggle,
body:has(#side-navbar.sidebar-hidden) #sidebar-toggle {
    left: 0;
    border-radius: 0 6px 6px 0;
    transform: translateX(0);
}

#side-navbar.sidebar-hidden ~ #sidebar-toggle:active {
    transform: scale(0.95);
}

/* Ajuste do conteúdo quando sidebar está visível */
#container-content {
    margin-left: 0;
    width: 100%;
    transition: margin-left 0.3s ease, width 0.3s ease;
}

#side-navbar .scrollbar-none-custom {
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}

#side-navbar .scrollbar-none-custom::-webkit-scrollbar {
    width: 6px;
}

#side-navbar .scrollbar-none-custom::-webkit-scrollbar-track {
    background: transparent;
}

#side-navbar .scrollbar-none-custom::-webkit-scrollbar-thumb {
    background-color: #cbd5e1;
    border-radius: 3px;
}

#side-navbar .scrollbar-none-custom::-webkit-scrollbar-thumb:hover {
    background-color: #94a3b8;
}

/* ============================================
   SIDEBAR - Acordeons
   ============================================ */
.sidebar-accordion {
    margin-bottom: 4px;
}

.sidebar-accordion:first-of-type {
    margin-top: 48px;
}

.accordion-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 5px;
    margin: 10px;
    margin-top: 5px;
    margin-bottom: 5px;
    color: #4b5563;
    cursor: pointer;
    user-select: none;
    transition: all 0.2s ease;
    border-radius: 5px;
    min-height: 25px;
    font-weight: bold;
}

.accordion-header:hover {
    background-color: #f3f4f6;
    color: #1f2937;
}

.accordion-header.active {
    color: #1f2937;
    background-color: #e5e7eb;
    font-weight: 600;
}

.accordion-header .flex {
    display: flex;
    align-items: center;
    flex: 1;
}

.accordion-header .flex > div.w-5 {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    margin-right: 5px;
}

.accordion-header .flex img {
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 100%;
    display: block;
    opacity: 0.8;
}

.accordion-header.active .flex img {
    opacity: 1;
}

.accordion-header .flex p {
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
    flex: 1;
}

.accordion-arrow {
    width: 16px;
    height: 16px;
    transition: transform 0.3s ease;
    color: currentColor;
    flex-shrink: 0;
    margin-left: 8px;
    opacity: 0.6;
}

.accordion-header.active .accordion-arrow {
    transform: rotate(180deg);
    opacity: 1;
}

.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.2s ease;
    opacity: 0;
}

.accordion-content.expanded {
    max-height: 1000px;
    opacity: 1;
}

.accordion-item {
    padding: 0;
    margin: 1px;
    color: #6b7280;
    transition: all 0.2s ease;
    border-radius: 8px;
    display: flex;
    align-items: center;
}

.accordion-item:hover {
    background-color: #f9fafb;
    color: #374151;
}

.accordion-item.active {
    background-color: #dbeafe;
    color: #1e40af;
}

.accordion-item.active:hover {
    background-color: #bfdbfe;
    color: #1e3a8a;
}

.accordion-item a {
    display: flex;
    align-items: center;
    width: 100%;
    text-decoration: none;
    color: inherit;
    padding: 10px 12px;
    padding-left: 100px;
}

.accordion-item .flex {
    display: flex;
    align-items: center;
    width: 100%;
    gap: 0;
}

.accordion-item .flex > div.w-5 {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    margin-right: 12px;
}

.accordion-item .flex img {
    width: 16px;
    height: 16px;
    object-fit: contain;
    display: block;
    opacity: 0.7;
}

.accordion-item.active .flex img {
    opacity: 1;
}

.accordion-item p {
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
    flex: 1;
    font-weight: 400;
}

.accordion-item.active p {
    font-weight: 500;
}

.accordion-item:hover a {
    color: inherit;
}

/* Badge de notificação no acordeon */
.accordion-header .badge {
    background-color: #dc2626;
    color: white;
    font-size: 12px;
    font-weight: bold;
    padding: 4px 8px;
    border-radius: 9999px;
    margin-left: auto;
    margin-right: 8px;
}

/* ============================================
   SIDEBAR - Responsivo
   ============================================ */
@media (max-width: 768px) {
    /* Sidebar em mobile - ocupa toda a largura quando aberta */
    #side-navbar {
        width: 100% !important;
        max-width: 100%;
        min-width: 100%;
        height: 100vh !important;
        z-index: 9999;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    }
    
    #side-navbar.sidebar-hidden {
        transform: translateX(-100%);
        width: 0 !important;
    }
    
    /* Overlay quando sidebar está aberta em mobile */
    .sidebar-overlay {
        display: block;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 9998;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.3s ease;
    }
    
    .sidebar-overlay.active {
        opacity: 1;
        pointer-events: all;
    }
    
    /* Botão de toggle sempre visível em mobile */
    .sidebar-toggle-btn {
        left: 0 !important;
        transform: translateX(0) !important;
        z-index: 10000;
        border-radius: 0 6px 6px 0;
    }
    
    /* Quando sidebar está aberta, botão fica dentro */
    #side-navbar:not(.sidebar-hidden) ~ #sidebar-toggle,
    body:not(:has(#side-navbar.sidebar-hidden)) #sidebar-toggle {
        left: calc(100% - 40px) !important;
        transform: translateX(-100%) !important;
    }
    
    /* Conteúdo sempre ocupa 100% em mobile */
    #container-content {
        margin-left: 0 !important;
        width: 100% !important;
        padding: 10px !important;
    }
    
    /* Ajustes nos acordeons para mobile */
    .accordion-header {
        padding: 12px 8px;
        margin: 8px;
        font-size: 14px;
    }
    
    .accordion-header .flex p {
        font-size: 14px;
    }
    
    .accordion-item a {
        padding: 10px 8px;
        padding-left: 60px;
        font-size: 13px;
    }
    
    .accordion-item p {
        font-size: 13px;
    }
    
    .sidebar-accordion:first-of-type {
        margin-top: 60px;
    }
    
    /* Logo menor em mobile */
    #logo-brease img {
        max-width: 150px;
        height: auto;
    }
}

/* Overlay escondido em desktop */
@media (min-width: 769px) {
    .sidebar-overlay {
        display: none !important;
    }
}

@media (max-width: 480px) {
    /* Ajustes adicionais para telas muito pequenas */
    .accordion-header {
        padding: 10px 6px;
        margin: 6px;
        min-height: 40px;
    }
    
    .accordion-item a {
        padding: 8px 6px;
        padding-left: 50px;
    }
    
    .sidebar-toggle-btn {
        padding: 6px 4px;
        top: 8px;
    }
    
    .sidebar-toggle-btn svg {
        width: 18px;
        height: 18px;
    }
    
    #logo-brease {
        padding: 10px;
        padding-top: 50px;
    }
    
    #logo-brease img {
        max-width: 120px;
    }
}

