/* ===================================================================
   PORTAL LOJA UNIPREMIUM - CUSTOM CSS
   Baseado no Portal Cliente com tema verde para lojas
   =================================================================== */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
}

/* ===================================================================
   SIDEBAR - Tema Verde para Lojas
   =================================================================== */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 280px;
    background: linear-gradient(135deg, #198754 0%, #20c997 100%);
    color: white;
    padding: 1.5rem 0;
    transform: translateX(0);
    transition: all 0.3s ease;
    z-index: 1000;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
}

.sidebar-header {
    padding: 0 1.5rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header h6 {
    font-weight: 600;
    font-size: 1.1rem;
}

.sidebar-nav {
    padding: 0 1rem;
}

.sidebar .nav-link {
    color: rgba(255, 255, 255, 0.8);
    padding: 0.75rem 1rem;
    margin: 0.25rem 0;
    border-radius: 8px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    text-decoration: none;
}

.sidebar .nav-link:hover {
    color: white;
    background: rgba(255, 255, 255, 0.1);
    transform: translateX(5px);
}

.sidebar .nav-link.active {
    color: white;
    background: rgba(255, 255, 255, 0.2);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.sidebar .nav-link i {
    width: 20px;
    margin-right: 10px;
    text-align: center;
}

.sidebar-footer {
    position: absolute;
    bottom: 1.5rem;
    left: 1rem;
    right: 1rem;
}

/* ===================================================================
   MOBILE TOGGLE
   =================================================================== */
.mobile-toggle {
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 1001;
    background: #198754;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 0.5rem;
    display: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

/* ===================================================================
   MAIN CONTENT
   =================================================================== */
.main-content {
    margin-left: 280px;
    min-height: 100vh;
    padding: 2rem;
    transition: all 0.3s ease;
}

.content-header {
    margin-bottom: 2rem;
}

.content-header h2 {
    color: #198754;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.content-section {
    display: none;
}

.content-section.active {
    display: block;
}

/* ===================================================================
   CARDS E COMPONENTES
   =================================================================== */
.card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: 0 4px 20px rgba(0,0,0,0.12);
    transform: translateY(-2px);
}

.card-header {
    border-radius: 12px 12px 0 0 !important;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

/* Dashboard Cards */
.bg-primary.bg-opacity-10 {
    background-color: rgba(25, 135, 84, 0.1) !important;
}

.text-primary {
    color: #198754 !important;
}

.bg-success.bg-opacity-10 {
    background-color: rgba(32, 201, 151, 0.1) !important;
}

.bg-warning.bg-opacity-10 {
    background-color: rgba(255, 193, 7, 0.1) !important;
}

.bg-info.bg-opacity-10 {
    background-color: rgba(13, 202, 240, 0.1) !important;
}

/* ===================================================================
   FORMULÁRIOS
   =================================================================== */
.form-control:focus {
    border-color: #198754;
    box-shadow: 0 0 0 0.2rem rgba(25, 135, 84, 0.25);
}

.form-select:focus {
    border-color: #198754;
    box-shadow: 0 0 0 0.2rem rgba(25, 135, 84, 0.25);
}

.btn-success {
    background-color: #198754;
    border-color: #198754;
}

.btn-success:hover {
    background-color: #157347;
    border-color: #146c43;
}

.input-group-text {
    background-color: #f8f9fa;
    border-color: #dee2e6;
}

/* ===================================================================
   TABELAS
   =================================================================== */
.table {
    border-radius: 8px;
    overflow: hidden;
}

.table thead th {
    background-color: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
    font-weight: 600;
    color: #495057;
}

.table-hover tbody tr:hover {
    background-color: rgba(25, 135, 84, 0.05);
}

/* ===================================================================
   BADGES E STATUS
   =================================================================== */
.badge {
    font-size: 0.75rem;
    font-weight: 500;
}

.badge.bg-success {
    background-color: #198754 !important;
}

.badge.bg-warning {
    background-color: #ffc107 !important;
    color: #000;
}

.badge.bg-info {
    background-color: #0dcaf0 !important;
}

/* ===================================================================
   ALERTS
   =================================================================== */
.alert {
    border-radius: 8px;
    border: none;
}

.alert-info {
    background-color: rgba(13, 202, 240, 0.1);
    color: #055160;
}

.alert-success {
    background-color: rgba(25, 135, 84, 0.1);
    color: #0a3622;
}

.alert-warning {
    background-color: rgba(255, 193, 7, 0.1);
    color: #664d03;
}

.alert-danger {
    background-color: rgba(220, 53, 69, 0.1);
    color: #58151c;
}

/* ===================================================================
   RESPONSIVIDADE
   =================================================================== */

/* Tablet */
@media (max-width: 1024px) {
    .sidebar {
        width: 260px;
    }

    .main-content {
        margin-left: 260px;
        padding: 1.5rem;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .mobile-toggle {
        display: block;
    }

    .sidebar {
        transform: translateX(-100%);
        width: 280px;
    }

    .sidebar.show {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
        padding: 1rem;
        padding-top: 4rem; /* Espaço para botão mobile */
    }

    .content-header h2 {
        font-size: 1.5rem;
    }

    /* Cards em coluna única no mobile */
    .row .col-md-6,
    .row .col-lg-3 {
        margin-bottom: 1rem;
    }

    /* Tabelas responsivas */
    .table-responsive {
        font-size: 0.9rem;
    }

    .table th,
    .table td {
        padding: 0.5rem;
    }
}

/* Mobile pequeno */
@media (max-width: 576px) {
    .main-content {
        padding: 0.75rem;
        padding-top: 4rem;
    }

    .content-header {
        margin-bottom: 1.5rem;
    }

    .card-body {
        padding: 1rem;
    }

    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }

    /* Formulário de nova venda mais compacto */
    .form-label {
        font-size: 0.9rem;
        margin-bottom: 0.25rem;
    }

    .form-control,
    .form-select {
        padding: 0.5rem;
        font-size: 0.9rem;
    }
}

/* ===================================================================
   ANIMAÇÕES E TRANSIÇÕES
   =================================================================== */
.card {
    animation: fadeInUp 0.5s ease-out;
}

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

/* Loading spinner */
.spinner-border-sm {
    width: 1rem;
    height: 1rem;
}

/* Hover effects */
.nav-link {
    position: relative;
    overflow: hidden;
}

.nav-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.1);
    transition: left 0.3s ease;
}

.nav-link:hover::before {
    left: 100%;
}

/* Chart container */
#vendasChart {
    max-height: 400px;
}

/* Form validation styles */
.is-valid {
    border-color: #198754;
}

.is-invalid {
    border-color: #dc3545;
}

.valid-feedback {
    color: #198754;
}

.invalid-feedback {
    color: #dc3545;
    font-size: 0.875rem;
}

/* ===================================================================
   PRINT STYLES
   =================================================================== */
@media print {
    .sidebar,
    .mobile-toggle {
        display: none;
    }

    .main-content {
        margin-left: 0;
        padding: 0;
    }

    .card {
        box-shadow: none;
        border: 1px solid #dee2e6;
    }
}