/* ========================================
   CONFIGURAÇÕES DASHBOARD - DESIGN PREMIUM
   ======================================== */

/* Reset e base para garantir que os estilos sejam aplicados */
.config-dashboard * {
    box-sizing: border-box;
}

.config-dashboard {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
}

/* CSS carregado com sucesso! */

:root {
    /* Paleta de cores moderna */
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --secondary: #f59e0b;
    --accent: #8b5cf6;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #06b6d4;
    
    /* Tons de cinza modernos */
    --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;
    
    /* Backgrounds */
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    --bg-dark: #0f172a;
    
    /* Text colors */
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --text-white: #ffffff;
    
    /* Shadows modernas */
    --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --shadow-xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    
    /* Border radius */
    --radius-sm: 0.375rem;
    --radius: 0.5rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;
    
    /* Transitions */
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: all 0.15s ease;
    --transition-slow: all 0.3s ease;
}

/* ========================================
   DASHBOARD CONTAINER PREMIUM
   ======================================== */

.config-dashboard {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
    background: #ffffff !important;
    min-height: calc(100vh - 200px) !important;
    padding: 2rem 0 !important;
    margin: 0 !important;
    position: relative !important;
    overflow: hidden !important;
}

/* Removido o pseudo-elemento de fundo gradiente */

.config-dashboard .container-fluid {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem 1rem;
    position: relative;
    z-index: 1;
}

/* ========================================
   HEADER PREMIUM
   ======================================== */

.config-dashboard .row.mb-4 {
    background: #ffffff !important;
    border: 1px solid #e5e7eb !important;
    border-radius: var(--radius-xl) !important;
    padding: 2rem !important;
    margin-bottom: 2rem !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1) !important;
}

.config-dashboard .h3 {
    font-size: 2.5rem !important;
    font-weight: 800 !important;
    margin-bottom: 0.5rem !important;
    color: #1f2937 !important;
}

.config-dashboard .text-muted {
    color: #6b7280 !important;
    font-size: 1.1rem !important;
    font-weight: 500 !important;
}

.config-dashboard .d-flex.gap-2 {
    gap: 1rem !important;
}

/* ========================================
   CARDS PREMIUM
   ======================================== */

.modern-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: var(--transition-slow);
    overflow: hidden;
    position: relative;
}

.modern-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
}

.modern-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 32px 64px rgba(0, 0, 0, 0.2);
}

.card-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    color: var(--text-white);
    padding: 2rem;
    border: none;
    position: relative;
    overflow: hidden;
}

.card-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(255,255,255,0.1) 25%, transparent 25%, transparent 75%, rgba(255,255,255,0.1) 75%);
    background-size: 20px 20px;
    opacity: 0.3;
}

.card-header h3 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 1rem;
    position: relative;
    z-index: 1;
}

.card-header .icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.2);
    border-radius: var(--radius);
    backdrop-filter: blur(10px);
}

.card-body {
    padding: 2rem;
}

.card-footer {
    background: var(--gray-50);
    padding: 1.5rem 2rem;
    border-top: 1px solid var(--gray-200);
}

/* ========================================
   STATS CARDS PREMIUM
   ======================================== */

.stats-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)) !important;
    gap: 2rem !important;
    margin-bottom: 3rem !important;
}

.stat-card {
    background: #ffffff !important;
    border-radius: var(--radius-xl) !important;
    padding: 2rem !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1) !important;
    border: 1px solid #e5e7eb !important;
    transition: var(--transition-slow) !important;
    position: relative !important;
    overflow: hidden !important;
    cursor: pointer !important;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
}

.stat-card:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.stat-card.success::before {
    background: linear-gradient(90deg, var(--success), #34d399);
}

.stat-card.warning::before {
    background: linear-gradient(90deg, var(--warning), #fbbf24);
}

.stat-card.danger::before {
    background: linear-gradient(90deg, var(--danger), #f87171);
}

.stat-card.info::before {
    background: linear-gradient(90deg, var(--info), #22d3ee);
}

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

.stat-title {
    font-size: 0.875rem !important;
    font-weight: 700 !important;
    color: #6b7280 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.1em !important;
    margin: 0 !important;
}

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--text-white);
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
}

.stat-icon::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(255,255,255,0.2) 25%, transparent 25%, transparent 75%, rgba(255,255,255,0.2) 75%);
    background-size: 8px 8px;
    opacity: 0.5;
}

.stat-icon.primary {
    background: linear-gradient(135deg, var(--primary), var(--accent));
}

.stat-icon.success {
    background: linear-gradient(135deg, var(--success), #34d399);
}

.stat-icon.warning {
    background: linear-gradient(135deg, var(--warning), #fbbf24);
}

.stat-icon.danger {
    background: linear-gradient(135deg, var(--danger), #f87171);
}

.stat-icon.info {
    background: linear-gradient(135deg, var(--info), #22d3ee);
}

.stat-value {
    font-size: 3rem !important;
    font-weight: 800 !important;
    color: #1f2937 !important;
    margin: 0 !important;
    line-height: 1 !important;
}

.stat-change {
    font-size: 0.875rem;
    font-weight: 700;
    margin-top: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-lg);
    background: var(--gray-100);
    width: fit-content;
}

.stat-change.positive {
    color: var(--success);
    background: rgba(16, 185, 129, 0.1);
}

.stat-change.negative {
    color: var(--danger);
    background: rgba(239, 68, 68, 0.1);
}

/* ========================================
   TABELA PREMIUM
   ======================================== */

.modern-table-container {
    background: #ffffff !important;
    border-radius: var(--radius-xl) !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1) !important;
    border: 1px solid #e5e7eb !important;
    overflow: hidden !important;
    position: relative !important;
}

.modern-table-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
}

.modern-table {
    width: 100%;
    margin: 0;
    border-collapse: separate;
    border-spacing: 0;
}

.modern-table thead {
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    color: var(--text-white);
    position: relative;
}

.modern-table thead::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(255,255,255,0.1) 25%, transparent 25%, transparent 75%, rgba(255,255,255,0.1) 75%);
    background-size: 20px 20px;
    opacity: 0.3;
}

.modern-table thead th {
    padding: 1.5rem 2rem;
    font-weight: 700;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    border: none;
    position: relative;
    z-index: 1;
}

.modern-table thead th:not(:last-child)::after {
    content: '';
    position: absolute;
    right: 0;
    top: 25%;
    bottom: 25%;
    width: 1px;
    background: rgba(255, 255, 255, 0.3);
}

.modern-table tbody tr {
    transition: var(--transition);
    border-bottom: 1px solid var(--gray-200);
    position: relative;
}

.modern-table tbody tr:hover {
    background: #f9fafb;
    transform: scale(1.01);
}

.modern-table tbody tr:last-child {
    border-bottom: none;
}

.modern-table tbody td {
    padding: 1.5rem 2rem !important;
    vertical-align: middle !important;
    border: none !important;
    color: #1f2937 !important;
    font-weight: 500 !important;
}

/* ========================================
   BADGES PREMIUM
   ======================================== */

.modern-badge {
    display: inline-flex !important;
    align-items: center !important;
    padding: 0.5rem 1rem !important;
    border-radius: var(--radius-xl) !important;
    font-size: 0.75rem !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.1em !important;
    gap: 0.5rem !important;
    box-shadow: var(--shadow-sm) !important;
    position: relative !important;
    overflow: hidden !important;
}

.modern-badge::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.5s;
}

.modern-badge:hover::before {
    left: 100%;
}

.badge-primary {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: var(--text-white);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.badge-success {
    background: linear-gradient(135deg, var(--success), #34d399);
    color: var(--text-white);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.badge-warning {
    background: linear-gradient(135deg, var(--warning), #fbbf24);
    color: var(--text-white);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.badge-danger {
    background: linear-gradient(135deg, var(--danger), #f87171);
    color: var(--text-white);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.badge-info {
    background: linear-gradient(135deg, var(--info), #22d3ee);
    color: var(--text-white);
    box-shadow: 0 4px 12px rgba(6, 182, 212, 0.3);
}

.badge-light {
    background: linear-gradient(135deg, var(--gray-200), var(--gray-300));
    color: var(--gray-700);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* ========================================
   BOTÕES PREMIUM
   ======================================== */

.btn-modern {
    display: inline-flex !important;
    align-items: center !important;
    gap: 0.75rem !important;
    padding: 1rem 2rem !important;
    border: none !important;
    border-radius: var(--radius-xl) !important;
    font-weight: 700 !important;
    font-size: 0.875rem !important;
    text-decoration: none !important;
    cursor: pointer !important;
    transition: var(--transition-slow) !important;
    position: relative !important;
    overflow: hidden !important;
    box-shadow: var(--shadow-md) !important;
    text-transform: uppercase !important;
    letter-spacing: 0.05em !important;
}

.btn-modern::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.6s;
}

.btn-modern:hover::before {
    left: 100%;
}

.btn-modern:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: var(--shadow-xl);
    text-decoration: none;
}

.btn-modern:active {
    transform: translateY(-1px) scale(1.02);
}

.btn-primary-modern {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: var(--text-white);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.4);
}

.btn-primary-modern:hover {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    color: var(--text-white);
    box-shadow: 0 15px 35px rgba(99, 102, 241, 0.6);
}

.btn-success-modern {
    background: linear-gradient(135deg, var(--success), #34d399);
    color: var(--text-white);
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.4);
}

.btn-warning-modern {
    background: linear-gradient(135deg, var(--warning), #fbbf24);
    color: var(--text-white);
    box-shadow: 0 8px 25px rgba(245, 158, 11, 0.4);
}

.btn-danger-modern {
    background: linear-gradient(135deg, var(--danger), #f87171);
    color: var(--text-white);
    box-shadow: 0 8px 25px rgba(239, 68, 68, 0.4);
}

.btn-outline-modern {
    background: #ffffff;
    border: 2px solid #d1d5db;
    color: #374151;
}

.btn-outline-modern:hover {
    background: #f9fafb;
    color: #1f2937;
    border-color: #9ca3af;
}

.btn-sm-modern {
    padding: 0.75rem 1.5rem;
    font-size: 0.75rem;
}

.btn-lg-modern {
    padding: 1.25rem 2.5rem;
    font-size: 1rem;
}

/* ========================================
   FORMULÁRIOS MODERNOS
   ======================================== */

.form-group-modern {
    margin-bottom: 1.5rem;
}

.form-label-modern {
    display: block;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

.form-control-modern {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--bg-tertiary);
    border-radius: var(--border-radius);
    font-size: 0.875rem;
    transition: var(--transition);
    background: var(--bg-primary);
    color: var(--text-primary);
}

.form-control-modern:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 114, 218, 0.1);
}

.form-control-modern::placeholder {
    color: var(--text-muted);
}

/* ========================================
   MODAIS MODERNOS
   ======================================== */

.modal-modern .modal-content {
    border: 1px solid #e5e7eb !important;
    border-radius: var(--radius-xl) !important;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1) !important;
    overflow: hidden !important;
    background: #ffffff !important;
}

.modal-modern .modal-header {
    background: #ffffff !important;
    color: #1f2937 !important;
    border-bottom: 1px solid #e5e7eb !important;
    padding: 1.5rem 2rem !important;
}

.modal-modern .modal-title {
    font-weight: 700 !important;
    font-size: 1.25rem !important;
    margin: 0 !important;
    display: flex !important;
    align-items: center !important;
    gap: 0.75rem !important;
    color: #1f2937 !important;
}

.modal-modern .btn-close {
    background: #f3f4f6 !important;
    border: none !important;
    border-radius: var(--radius) !important;
    color: #6b7280 !important;
    opacity: 1 !important;
    padding: 0.5rem !important;
    transition: var(--transition) !important;
}

.modal-modern .btn-close:hover {
    background: #e5e7eb !important;
    color: #374151 !important;
}

.modal-modern .modal-body {
    padding: 2rem !important;
    background: #ffffff !important;
    color: #1f2937 !important;
}

.modal-modern .modal-footer {
    background: #f9fafb !important;
    border-top: 1px solid #e5e7eb !important;
    padding: 1.5rem 2rem !important;
    display: flex !important;
    gap: 1rem !important;
    justify-content: flex-end !important;
}

/* Elementos dentro das modais */
.modal-modern .form-label {
    color: #374151 !important;
    font-weight: 600 !important;
    margin-bottom: 0.5rem !important;
}

.modal-modern .form-label-modern {
    color: #374151 !important;
    font-weight: 600 !important;
    margin-bottom: 0.5rem !important;
}

.modal-modern .form-group-modern {
    margin-bottom: 1rem !important;
}

.modal-modern .bg-light {
    background-color: #f9fafb !important;
    border: 1px solid #e5e7eb !important;
    border-radius: var(--radius) !important;
}

.modal-modern .user-info-modern {
    color: #1f2937 !important;
}

.modal-modern .user-name-modern {
    color: #1f2937 !important;
}

.modal-modern .user-email-modern {
    color: #6b7280 !important;
}

.modal-modern .text-muted {
    color: #6b7280 !important;
}

.modal-modern .text-center {
    text-align: center !important;
}

.modal-modern .mb-2 {
    margin-bottom: 0.5rem !important;
}

.modal-modern .mb-4 {
    margin-bottom: 1.5rem !important;
}

.modal-modern .p-3 {
    padding: 1rem !important;
}

.modal-modern .rounded {
    border-radius: var(--radius) !important;
}

.modal-modern .small {
    font-size: 0.875rem !important;
    color: #6b7280 !important;
}

.modal-modern code {
    background-color: #f3f4f6 !important;
    color: #1f2937 !important;
    padding: 0.25rem 0.5rem !important;
    border-radius: var(--radius-sm) !important;
    font-size: 0.875rem !important;
}

.modal-modern .mt-3 {
    margin-top: 1rem !important;
}

.modal-modern .g-3 {
    --bs-gutter-x: 1rem !important;
    --bs-gutter-y: 1rem !important;
}

.modal-modern .row {
    display: flex !important;
    flex-wrap: wrap !important;
    margin-right: calc(var(--bs-gutter-x) * -0.5) !important;
    margin-left: calc(var(--bs-gutter-x) * -0.5) !important;
}

.modal-modern .col-md-4,
.modal-modern .col-md-6 {
    flex: 0 0 auto !important;
    width: 33.33333333% !important;
}

@media (max-width: 768px) {
    .modal-modern .col-md-4,
    .modal-modern .col-md-6 {
        width: 100% !important;
    }
}

.modal-modern .form-control {
    border: 1px solid #d1d5db !important;
    border-radius: var(--radius) !important;
    padding: 0.75rem 1rem !important;
    color: #1f2937 !important;
    background: #ffffff !important;
}

.modal-modern .form-control:focus {
    border-color: #6366f1 !important;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1) !important;
}

.modal-modern .form-select {
    border: 1px solid #d1d5db !important;
    border-radius: var(--radius) !important;
    padding: 0.75rem 1rem !important;
    color: #1f2937 !important;
    background: #ffffff !important;
}

.modal-modern .form-select:focus {
    border-color: #6366f1 !important;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1) !important;
}

.modal-modern .text-muted {
    color: #6b7280 !important;
}

.modal-modern .alert {
    border-radius: var(--radius) !important;
    border: none !important;
    padding: 1rem !important;
}

.modal-modern .alert-info {
    background: #eff6ff !important;
    color: #1e40af !important;
}

.modal-modern .alert-warning {
    background: #fffbeb !important;
    color: #92400e !important;
}

.modal-modern .alert-danger {
    background: #fef2f2 !important;
    color: #dc2626 !important;
}

/* ========================================
   AVATARES E USUÁRIOS PREMIUM
   ======================================== */

.user-avatar-modern {
    width: 48px !important;
    height: 48px !important;
    border-radius: 50% !important;
    background: linear-gradient(135deg, #6366f1, #8b5cf6) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: #ffffff !important;
    font-weight: 800 !important;
    font-size: 1.125rem !important;
    flex-shrink: 0 !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1) !important;
    position: relative !important;
    overflow: hidden !important;
}

.user-avatar-modern::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(255,255,255,0.2) 25%, transparent 25%, transparent 75%, rgba(255,255,255,0.2) 75%);
    background-size: 6px 6px;
    opacity: 0.5;
}

.user-info-modern {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-details-modern {
    flex: 1;
    min-width: 0;
}

.user-name-modern {
    font-weight: 700 !important;
    color: #1f2937 !important;
    margin: 0 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    font-size: 1rem !important;
}

.user-email-modern {
    font-size: 0.875rem !important;
    color: #6b7280 !important;
    margin: 0.25rem 0 0 0 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    font-weight: 500 !important;
}

/* ========================================
   LOADING E ANIMAÇÕES
   ======================================== */

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(10px);
}

.loading-overlay.show {
    display: flex;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(255, 255, 255, 0.2);
    border-top: 4px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    box-shadow: var(--shadow-xl);
}

.loading-text {
    margin-top: 1.5rem;
    font-weight: 700;
    color: var(--text-white);
    font-size: 1.1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

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

@media (max-width: 1200px) {
    .config-dashboard .container-fluid {
        max-width: 100%;
        padding: 0 20px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 1.5rem;
    }
}

@media (max-width: 992px) {
    .config-dashboard {
        padding: 1rem 0;
    }
    
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 1rem;
    }
    
    .config-dashboard .d-flex.gap-2 {
        flex-direction: column;
        gap: 0.5rem !important;
    }
    
    .config-dashboard .btn-modern {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .config-dashboard .h3 {
        font-size: 1.5rem;
    }
    
    .modern-table-container {
        overflow-x: auto;
    }
    
    .modern-table {
        min-width: 600px;
    }
    
    .config-dashboard .row.g-3 {
        flex-direction: column;
    }
    
    .config-dashboard .col-md-5,
    .config-dashboard .col-md-3,
    .config-dashboard .col-md-4 {
        width: 100%;
        margin-bottom: 1rem;
    }
}

@media (max-width: 576px) {
    .config-dashboard {
        padding: 0.5rem 0;
    }
    
    .config-dashboard .container-fluid {
        padding: 0 10px;
    }
    
    .config-dashboard .h3 {
        font-size: 1.25rem;
    }
    
    .config-dashboard .d-flex.justify-content-between {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }
    
    .modal-modern .modal-body {
        padding: 1rem !important;
    }
    
    .modal-modern .modal-footer {
        padding: 1rem !important;
        flex-direction: column !important;
    }
    
    .modal-modern .modal-header {
        padding: 1rem !important;
    }
}

/* ========================================
   BOTÕES DE AÇÃO ESPECÍFICOS
   ======================================== */

.action-buttons {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.action-buttons .btn-modern {
    min-width: 40px;
    height: 40px;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.action-buttons .btn-modern i {
    font-size: 0.875rem;
}

.action-buttons .btn-modern span {
    display: none;
}

@media (min-width: 768px) {
    .action-buttons .btn-modern span {
        display: inline;
        margin-left: 0.5rem;
    }
    
    .action-buttons .btn-modern {
        min-width: auto;
        padding: 0.5rem 1rem;
    }
}

/* ========================================
   PERMISSÕES E ACESSO
   ======================================== */

.permissions-preview,
.last-access {
    display: flex !important;
    align-items: center !important;
    gap: 0.5rem !important;
    font-size: 0.875rem !important;
    color: #6b7280 !important;
}

.permissions-preview i,
.last-access i {
    font-size: 0.75rem !important;
    opacity: 0.7 !important;
    color: #6b7280 !important;
}

/* ========================================
   UTILITÁRIOS
   ======================================== */

.text-gradient {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.shadow-modern {
    box-shadow: var(--shadow);
}

.shadow-lg-modern {
    box-shadow: var(--shadow-lg);
}

.border-radius-modern {
    border-radius: var(--border-radius);
}

.border-radius-lg-modern {
    border-radius: var(--border-radius-lg);
}

.fade-in {
    animation: fadeIn 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.slide-in {
    animation: slideIn 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideIn {
    from {
        transform: translateX(-100%) scale(0.9);
        opacity: 0;
    }
    to {
        transform: translateX(0) scale(1);
        opacity: 1;
    }
}

.bounce-in {
    animation: bounceIn 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes bounceIn {
    0% {
        transform: scale(0.3);
        opacity: 0;
    }
    50% {
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.pulse {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

/* ========================================
   SCROLLBAR PERSONALIZADA
   ======================================== */

::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

::-webkit-scrollbar-track {
    background: var(--gray-100);
    border-radius: var(--radius);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    box-shadow: var(--shadow);
}

/* ========================================
   MATRIZ DE PERMISSÕES
   ======================================== */

.permission-matrix-table {
    font-size: 0.9rem !important;
    border-collapse: separate !important;
    border-spacing: 0 !important;
}

.permission-matrix-table th {
    font-weight: 700 !important;
    white-space: nowrap !important;
    padding: 1rem 0.75rem !important;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%) !important;
    color: var(--text-white) !important;
    border: none !important;
    position: relative !important;
}

.permission-matrix-table th:first-child {
    background: linear-gradient(135deg, var(--gray-700) 0%, var(--gray-800) 100%) !important;
}

.permission-matrix-table tbody tr {
    transition: var(--transition) !important;
    border-bottom: 1px solid var(--gray-200) !important;
}

.permission-matrix-table tbody tr:hover {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.05), rgba(139, 92, 246, 0.05)) !important;
    transform: scale(1.01) !important;
}

.permission-matrix-table tbody td {
    padding: 1rem 0.75rem !important;
    vertical-align: middle !important;
    border: none !important;
    color: var(--text-primary) !important;
    font-weight: 500 !important;
}

.role-name-cell {
    font-weight: 700 !important;
    min-width: 120px !important;
    background: var(--gray-50) !important;
}

.permission-icon {
    font-size: 1.2rem !important;
    transition: var(--transition) !important;
}

.permission-icon:hover {
    transform: scale(1.2) !important;
}

.role-row[data-role="Administrador"] {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.05), rgba(220, 38, 38, 0.05)) !important;
}

.role-row[data-role="Atendimento"] {
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.05), rgba(8, 145, 178, 0.05)) !important;
}

.role-row[data-role="Financeiro"] {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.05), rgba(5, 150, 105, 0.05)) !important;
}

.role-row[data-role="SEO"] {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.05), rgba(217, 119, 6, 0.05)) !important;
}

/* ========================================
   DARK MODE SUPPORT
   ======================================== */

@media (prefers-color-scheme: dark) {
    :root {
        --bg-primary: #0f172a;
        --bg-secondary: #1e293b;
        --bg-tertiary: #334155;
        --text-primary: #f8fafc;
        --text-secondary: #cbd5e1;
        --text-muted: #94a3b8;
    }
    
    .config-dashboard {
        background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    }
    
    .modern-card {
        background: rgba(30, 41, 59, 0.95);
        border-color: rgba(255, 255, 255, 0.1);
    }
    
    .stat-card {
        background: rgba(30, 41, 59, 0.95);
        border-color: rgba(255, 255, 255, 0.1);
    }
}
