/**
 * CSS Customizado - Gestor WhatsApp
 * Versão: 1.0.0
 */

/* ============================================
   VARIÁVEIS E RESET
   ============================================ */

:root {
    --primary-color: #4f46e5;
    --primary-dark: #4338ca;
    --primary-light: #e0e7ff;
    --secondary-color: #6b7280;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --info-color: #3b82f6;
    --dark-color: #1f2937;
    --light-color: #f9fafb;
    --border-color: #e5e7eb;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    font-size: 0.875rem;
    line-height: 1.5;
    color: #333;
    background-color: #f8f9fa;
}

/* ============================================
   UTILITÁRIOS
   ============================================ */

.cursor-pointer {
    cursor: pointer;
}

.text-primary {
    color: var(--primary-color) !important;
}

.bg-primary {
    background-color: var(--primary-color) !important;
}

.rounded-xl {
    border-radius: 12px !important;
}

.shadow-sm {
    box-shadow: var(--shadow) !important;
}

.shadow-md {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08) !important;
}

.shadow-lg {
    box-shadow: var(--shadow-lg) !important;
}

/* ============================================
   LAYOUT
   ============================================ */

.main-container {
    min-height: calc(100vh - 60px);
    padding: 20px;
}

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 250px;
    background: white;
    border-right: 1px solid var(--border-color);
    z-index: 1000;
}

.main-content {
    margin-left: 250px;
    padding: 20px;
}

@media (max-width: 768px) {
    .sidebar {
        width: 0;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    .sidebar.show {
        width: 250px;
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
}

/* ============================================
   CARD
   ============================================ */

.card {
    border: none;
    border-radius: 10px;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}

.card-header {
    background: white;
    border-bottom: 1px solid var(--border-color);
    padding: 15px 20px;
    border-radius: 10px 10px 0 0 !important;
}

.card-body {
    padding: 20px;
}

.card-title {
    font-weight: 600;
    color: var(--dark-color);
    margin-bottom: 15px;
}

/* ============================================
   BOTÕES
   ============================================ */

.btn {
    border-radius: 6px;
    padding: 8px 16px;
    font-weight: 500;
    font-size: 0.875rem;
    border: none;
    transition: all 0.2s ease;
}

.btn-primary {
    background: var(--primary-color);
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.btn-success {
    background: var(--success-color);
}

.btn-danger {
    background: var(--danger-color);
}

.btn-warning {
    background: var(--warning-color);
}

.btn-outline-primary {
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
    background: transparent;
}

.btn-outline-primary:hover {
    background: var(--primary-color);
    color: white;
}

/* ============================================
   FORMULÁRIOS
   ============================================ */

.form-control, .form-select {
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.form-label {
    font-weight: 500;
    color: #444;
    margin-bottom: 6px;
    font-size: 0.875rem;
}

/* ============================================
   TABELAS
   ============================================ */

.table {
    font-size: 0.875rem;
}

.table th {
    font-weight: 600;
    color: #555;
    border-bottom: 2px solid var(--border-color);
    padding: 12px 8px;
    background: #f8f9fa;
}

.table td {
    padding: 12px 8px;
    vertical-align: middle;
    border-bottom: 1px solid var(--border-color);
}

.table-striped tbody tr:nth-of-type(odd) {
    background-color: rgba(0, 0, 0, 0.02);
}

.table-hover tbody tr:hover {
    background-color: rgba(79, 70, 229, 0.05);
}

/* ============================================
   NAVBAR
   ============================================ */

.navbar {
    background: white;
    border-bottom: 1px solid var(--border-color);
    padding: 10px 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.navbar-brand {
    font-weight: 600;
    color: var(--primary-color);
    font-size: 1.2rem;
}

.navbar-nav .nav-link {
    color: #555;
    font-weight: 500;
    padding: 8px 15px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.navbar-nav .nav-link:hover {
    background: var(--primary-light);
    color: var(--primary-color);
}

.navbar-nav .nav-link.active {
    background: var(--primary-color);
    color: white;
}

/* ============================================
   DASHBOARD ELEMENTOS
   ============================================ */

.stats-card {
    border-left: 4px solid var(--primary-color);
    padding: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.stats-card .stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--dark-color);
    margin-bottom: 5px;
}

.stats-card .stat-label {
    color: var(--secondary-color);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.chart-container {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: var(--shadow);
}

/* ============================================
   MODAL
   ============================================ */

.modal-content {
    border: none;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
}

.modal-header {
    border-bottom: 1px solid var(--border-color);
    padding: 20px;
    background: #f8fafc;
    border-radius: 12px 12px 0 0;
}

.modal-body {
    padding: 25px;
}

.modal-footer {
    border-top: 1px solid var(--border-color);
    padding: 15px 25px;
    background: #f8fafc;
    border-radius: 0 0 12px 12px;
}

/* ============================================
   BADGES
   ============================================ */

.badge {
    padding: 4px 8px;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 4px;
}

.badge-success {
    background: #d1fae5;
    color: #065f46;
}

.badge-danger {
    background: #fee2e2;
    color: #991b1b;
}

.badge-warning {
    background: #fef3c7;
    color: #92400e;
}

.badge-info {
    background: #dbeafe;
    color: #1e40af;
}

/* ============================================
   ALERTS
   ============================================ */

.alert {
    border: none;
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 0.875rem;
}

.alert-success {
    background: #d1fae5;
    color: #065f46;
}

.alert-danger {
    background: #fee2e2;
    color: #991b1b;
}

.alert-warning {
    background: #fef3c7;
    color: #92400e;
}

.alert-info {
    background: #dbeafe;
    color: #1e40af;
}

/* ============================================
   LOADING
   ============================================ */

.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-top: 2px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
    .main-container {
        padding: 15px;
    }
    
    .card {
        margin-bottom: 15px;
    }
    
    .btn {
        width: 100%;
        margin-bottom: 10px;
    }
    
    .table-responsive {
        font-size: 0.8rem;
    }
}

/* ============================================
   ANIMAÇÕES
   ============================================ */

.fade-in {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.slide-in {
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from { transform: translateY(-10px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* ============================================
   CUSTOM SCROLLBAR
   ============================================ */

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

/* ============================================
   PRINT STYLES
   ============================================ */

@media print {
    .no-print {
        display: none !important;
    }
    
    body {
        background: white !important;
        color: black !important;
    }
    
    .card {
        box-shadow: none !important;
        border: 1px solid #ddd !important;
    }
}