/* ===================================
   ESTILOS GERAIS
   =================================== */

:root {
    --primary-color: #2E7BC4;        /* Azul da logo */
    --secondary-color: #424242;
    --success-color: #43a047;
    --danger-color: #E94235;         /* Vermelho da logo */
    --warning-color: #F7941D;        /* Laranja da logo */
    --info-color: #2E7BC4;           /* Azul da logo */
    --orange-color: #F7941D;         /* Laranja principal */
    --red-color: #E94235;            /* Vermelho principal */
    --blue-color: #2E7BC4;           /* Azul principal */
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
}

/* ===================================
   SIDEBAR MENU
   =================================== */

#wrapper {
    min-height: 100vh;
}

.sidebar {
    min-width: 280px;
    max-width: 280px;
    background: linear-gradient(180deg, #2E7BC4 0%, #1a5a8f 100%) !important;
    color: white;
    transition: all 0.3s ease;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 1000;
    overflow-y: auto;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
}

.sidebar-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-logo {
    width: 140px;
    height: auto;
    object-fit: contain;
}

.sidebar-brand h5 {
    font-size: 1.2rem;
    letter-spacing: 0.5px;
}

.sidebar-menu {
    padding: 1rem 0;
    display: flex;
    flex-direction: column;
}

.sidebar-item {
    display: flex;
    flex-direction: row;
    align-items: center;
    padding: 12px 20px;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
    width: 100%;
}

.sidebar-item i {
    font-size: 1.2rem;
    width: 30px;
    margin-right: 10px;
}

.sidebar-item:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
    border-left-color: #F7941D;
}

.sidebar-item.active {
    background-color: rgba(255, 255, 255, 0.15);
    color: white;
    border-left-color: #F7941D;
    font-weight: 600;
}

.sidebar-divider {
    height: 1px;
    background-color: rgba(255, 255, 255, 0.1);
    margin: 15px 20px;
}

.sidebar-section-title {
    padding: 10px 20px 5px;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255, 255, 255, 0.5);
    font-weight: 600;
}

#page-content-wrapper {
    margin-left: 280px;
    width: calc(100% - 280px);
    transition: all 0.3s ease;
}

/* Mobile: Sidebar oculta por padrão */
@media (max-width: 991.98px) {
    .sidebar {
        margin-left: -280px;
    }
    
    .sidebar.active {
        margin-left: 0;
    }
    
    #page-content-wrapper {
        margin-left: 0;
        width: 100%;
    }
}

/* ===================================
   NAVBAR (para páginas públicas)
   =================================== */

.navbar {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%) !important;
}

.navbar-brand {
    font-size: 1.5rem;
    letter-spacing: 1px;
}

.nav-link {
    transition: all 0.3s ease;
    border-radius: 5px;
    margin: 0 5px;
    padding: 8px 12px !important;
}

.nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

/* ===================================
   CARDS
   =================================== */

.card {
    border: none;
    border-radius: 10px;
    transition: all 0.3s ease;
}

.card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15) !important;
}

.card-header {
    border-radius: 10px 10px 0 0 !important;
    font-weight: 600;
}

/* ===================================
   BOTÕES
   =================================== */

.btn {
    border-radius: 8px;
    padding: 8px 16px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.btn-success {
    background: linear-gradient(135deg, #43a047 0%, #66bb6a 100%);
    border: none;
}

.btn-primary {
    background: linear-gradient(135deg, #1e88e5 0%, #42a5f5 100%);
    border: none;
}

.btn-danger {
    background: linear-gradient(135deg, #e53935 0%, #ef5350 100%);
    border: none;
}

/* ===================================
   TABELAS
   =================================== */

.table {
    border-radius: 10px;
    overflow: hidden;
}

.table thead {
    background: linear-gradient(135deg, #424242 0%, #616161 100%);
    color: white;
}

.table-hover tbody tr:hover {
    background-color: #f5f5f5;
    cursor: pointer;
}

/* ===================================
   FORMULÁRIOS
   =================================== */

.form-control, .form-select {
    border-radius: 8px;
    border: 1px solid #ddd;
    padding: 10px 15px;
    transition: all 0.3s ease;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(30, 136, 229, 0.25);
}

.form-label {
    font-weight: 600;
    color: #424242;
    margin-bottom: 8px;
}

/* ===================================
   MODAL
   =================================== */

.modal-content {
    border-radius: 15px;
    border: none;
}

.modal-header {
    border-radius: 15px 15px 0 0;
    background: linear-gradient(135deg, #1e88e5 0%, #42a5f5 100%);
    color: white;
}

.modal-header .btn-close {
    filter: brightness(0) invert(1);
}

/* ===================================
   BADGES
   =================================== */

.badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-weight: 500;
}

/* ===================================
   RESPONSIVIDADE MOBILE
   =================================== */

@media (max-width: 768px) {
    .navbar-brand {
        font-size: 1.2rem;
    }

    .card-body {
        padding: 1rem;
    }

    .btn {
        font-size: 0.875rem;
        padding: 6px 12px;
    }

    .table {
        font-size: 0.875rem;
    }

    .modal-dialog {
        margin: 0.5rem;
    }

    h1, h2, h3 {
        font-size: 1.5rem;
    }

    h4, h5 {
        font-size: 1.2rem;
    }

    /* Ajustes para cards em grid */
    .col-6 {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }

    /* Melhorias para tabelas em mobile */
    .table-responsive {
        border-radius: 10px;
    }

    /* Ajuste de espaçamento */
    .mb-4 {
        margin-bottom: 1.5rem !important;
    }

    .g-3 {
        gap: 0.75rem !important;
    }
}

@media (max-width: 576px) {
    .container-fluid {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .btn-group {
        flex-direction: column;
    }

    .btn-group .btn {
        border-radius: 8px !important;
        margin-bottom: 5px;
    }
}

/* ===================================
   ANIMAÇÕES
   =================================== */

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card, .table, .modal-content {
    animation: fadeIn 0.5s ease;
}

/* ===================================
   UTILITÁRIOS
   =================================== */

.shadow-sm {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
}

.shadow {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
}

.bg-gradient {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%) !important;
}

/* ===================================
   SCROLLBAR CUSTOMIZADA
   =================================== */

::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}


/* Sessão autenticada e navegação acessível */
.crm-topbar {
    background: #fff !important;
}
.account-link {
    line-height: 1.1;
}
.account-name {
    font-size: 0.9rem;
}
.sidebar-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.38);
    z-index: 999;
}
.sidebar-backdrop[hidden] {
    display: none;
}

@media (min-width: 992px) {
    .sidebar-backdrop {
        display: none !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}


/* Catálogo público */
.catalog-logo {
    height: 32px;
    width: auto;
}
.product-card {
    color: inherit;
    border: 0;
}
.product-img,
.catalog-image-placeholder {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background: #e9ecef;
}
.catalog-carousel-image,
.catalog-carousel-placeholder {
    width: 100%;
    height: 400px;
    object-fit: contain;
    background: #f8f9fa;
}
@media (max-width: 767.98px) {
    .catalog-carousel-image,
    .catalog-carousel-placeholder {
        height: 260px;
    }
}
.user-role-select {
    width: 150px;
}
.user-status-select {
    width: 105px;
}
