/* ============================================================================
   Dashboard Vendedores - CSS Customizado
   ============================================================================ */

/* --------------------------------------------------------------------------
   Variáveis CSS
   -------------------------------------------------------------------------- */
:root {
    --primary-color: #0d6efd;
    --success-color: #198754;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --orange-color: #fd7e14;
    --dark-color: #212529;
    --light-bg: #f8f9fa;
    --card-shadow: 0 0.15rem 1.75rem 0 rgba(58, 59, 69, 0.15);
    --card-border-radius: 0.5rem;
}

/* --------------------------------------------------------------------------
   Reset e Base
   -------------------------------------------------------------------------- */
* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #f4f6f9;
    color: #333;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
}

/* --------------------------------------------------------------------------
   Tipografia
   -------------------------------------------------------------------------- */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    color: var(--dark-color);
}

.text-gray-800 {
    color: #3a3b45 !important;
}

/* --------------------------------------------------------------------------
   Navbar
   -------------------------------------------------------------------------- */
.navbar {
    padding: 0.75rem 1rem;
}

.navbar-brand {
    font-size: 1.1rem;
}

.navbar-dark .navbar-nav .nav-link {
    color: rgba(255, 255, 255, 0.85);
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    transition: all 0.2s ease;
}

.navbar-dark .navbar-nav .nav-link:hover,
.navbar-dark .navbar-nav .nav-link.active {
    color: #fff;
    background-color: rgba(255, 255, 255, 0.1);
}

/* --------------------------------------------------------------------------
   Cards
   -------------------------------------------------------------------------- */
.card {
    border: none;
    border-radius: var(--card-border-radius);
    box-shadow: var(--card-shadow);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
    box-shadow: 0 0.5rem 2rem rgba(58, 59, 69, 0.2);
}

.card-header {
    background-color: #fff;
    border-bottom: 1px solid #e3e6f0;
    padding: 1rem 1.25rem;
}

.card-body {
    padding: 1.25rem;
}

/* Card com borda lateral colorida */
.card.border-start {
    border-left-width: 4px !important;
}

/* --------------------------------------------------------------------------
   KPI Cards - Círculos de Ícone
   -------------------------------------------------------------------------- */
.icon-circle {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* --------------------------------------------------------------------------
   Formulário de Filtros
   -------------------------------------------------------------------------- */
.form-label {
    font-size: 0.85rem;
    margin-bottom: 0.375rem;
    color: #6c757d;
}

.form-select,
.form-control {
    border-radius: 0.375rem;
    border-color: #ced4da;
    padding: 0.5rem 0.75rem;
    font-size: 0.95rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-select:focus,
.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.15);
}

/* --------------------------------------------------------------------------
   Botões
   -------------------------------------------------------------------------- */
.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    padding: 0.5rem 1.5rem;
    font-weight: 500;
    border-radius: 0.375rem;
    transition: all 0.2s ease;
}

.btn-primary:hover {
    background-color: #0b5ed7;
    border-color: #0a58ca;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(13, 110, 253, 0.35);
}

/* --------------------------------------------------------------------------
   Tabela
   -------------------------------------------------------------------------- */
.table {
    margin-bottom: 0;
    font-size: 0.9rem;
}

.table thead th {
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    padding: 1rem 0.75rem;
    border-bottom: none;
    white-space: nowrap;
}

.table-dark {
    --bs-table-bg: #2c3e50;
    --bs-table-color: #fff;
}

.table tbody td {
    padding: 0.875rem 0.75rem;
    vertical-align: middle;
    border-color: #e9ecef;
}

.table-striped > tbody > tr:nth-of-type(odd) > * {
    --bs-table-accent-bg: rgba(0, 0, 0, 0.02);
}

.table-hover > tbody > tr:hover > * {
    --bs-table-accent-bg: rgba(13, 110, 253, 0.05);
}

/* Rodapé da tabela */
.table tfoot td {
    padding: 1rem 0.75rem;
    border-top: 2px solid var(--primary-color);
}

.table-primary {
    --bs-table-bg: rgba(13, 110, 253, 0.08);
}

/* --------------------------------------------------------------------------
   Badges de Percentual
   -------------------------------------------------------------------------- */
.badge {
    font-weight: 500;
    font-size: 0.8rem;
    padding: 0.4em 0.8em;
}

.badge.rounded-pill {
    border-radius: 50rem;
}

/* Badge laranja customizada */
.bg-orange {
    background-color: var(--orange-color) !important;
    color: #fff;
}

/* Badge cinza para loja */
.badge.bg-secondary {
    background-color: #6c757d !important;
    font-weight: 600;
}

/* --------------------------------------------------------------------------
   Barra de Progresso
   -------------------------------------------------------------------------- */
.progress {
    background-color: #e9ecef;
    border-radius: 1rem;
    overflow: hidden;
}

.progress-bar {
    border-radius: 1rem;
    transition: width 0.6s ease;
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.footer {
    background-color: #fff !important;
    font-size: 0.85rem;
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
    .navbar-brand span {
        font-size: 0.95rem;
    }

    .card-body {
        padding: 1rem;
    }

    .icon-circle {
        width: 48px;
        height: 48px;
    }

    .icon-circle i {
        font-size: 1.25rem !important;
    }

    h1.h3 {
        font-size: 1.25rem;
    }

    .table {
        font-size: 0.8rem;
    }

    .table thead th {
        font-size: 0.7rem;
        padding: 0.75rem 0.5rem;
    }

    .table tbody td {
        padding: 0.625rem 0.5rem;
    }

    .badge {
        font-size: 0.7rem;
        padding: 0.3em 0.6em;
    }
}

@media (max-width: 576px) {
    .container-xl {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }

    /* Scroll horizontal na tabela em mobile */
    .table-responsive {
        font-size: 0.75rem;
    }

    /* KPIs em coluna */
    .icon-circle {
        width: 40px;
        height: 40px;
    }

    h3.mb-0 {
        font-size: 1.25rem;
    }
}

/* --------------------------------------------------------------------------
   Animações
   -------------------------------------------------------------------------- */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card {
    animation: fadeIn 0.3s ease-out;
}

/* Stagger animation para cards */
.row .col-md-4:nth-child(1) .card { animation-delay: 0.1s; }
.row .col-md-4:nth-child(2) .card { animation-delay: 0.2s; }
.row .col-md-4:nth-child(3) .card { animation-delay: 0.3s; }

/* --------------------------------------------------------------------------
   Estados vazios
   -------------------------------------------------------------------------- */
.table tbody td[colspan] {
    background-color: #fafbfc;
}

.table tbody td[colspan] i {
    opacity: 0.3;
}

/* --------------------------------------------------------------------------
   Utilitários
   -------------------------------------------------------------------------- */
.fw-medium {
    font-weight: 500;
}

.text-muted {
    color: #6c757d !important;
}

/* Cursor pointer para linhas clicáveis */
.table-hover tbody tr {
    cursor: default;
}

/* Sombra suave nos inputs em foco */
.form-control:focus,
.form-select:focus {
    outline: none;
}

/* --------------------------------------------------------------------------
   Print Styles
   -------------------------------------------------------------------------- */
@media print {
    .navbar,
    .footer,
    .card-header h6,
    form,
    .btn {
        display: none !important;
    }

    .card {
        box-shadow: none !important;
        border: 1px solid #ddd !important;
    }

    body {
        background-color: #fff !important;
    }

    .table thead {
        background-color: #f8f9fa !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}
