/* CSS Administrativo - Estilo Moderno Elegante (Envato Style) */

/* Variáveis CSS - Tema Escuro Elegante */
:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --secondary: #64748b;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #06b6d4;
    --light: #f8fafc;
    --dark: #0f172a;
    --bg-dark: #1e293b;
    --bg-darker: #0f172a;
    --text-light: #e2e8f0;
    --text-muted: #94a3b8;
    --border-dark: #334155;

    --sidebar-width: 280px;
    --header-height: 70px;
    --border-radius: 12px;
    --shadow-elegant: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --shadow-dark: 0 10px 25px -5px rgba(0, 0, 0, 0.25), 0 10px 10px -5px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-sidebar: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
}

/* Reset básico */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    color: var(--dark);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Layout Principal */
.admin-wrapper {
    min-height: 100vh;
    position: relative;
}

/* Sidebar - Estilo Envato Moderno */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--gradient-sidebar);
    color: var(--text-light);
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 1000;
    transition: var(--transition);
    box-shadow: var(--shadow-dark);
    border-right: 1px solid var(--border-dark);
}

/* Custom Scrollbar */
.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, 0.3);
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(100, 116, 139, 0.5);
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(100, 116, 139, 0.7);
}

/* Header da Sidebar */
.sidebar-header {
    padding: 2rem 1.5rem;
    border-bottom: 1px solid rgba(51, 65, 85, 0.6);
    margin-bottom: 1rem;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-light);
    text-decoration: none;
    font-size: 1.25rem;
    font-weight: 700;
    transition: var(--transition);
}

.sidebar-brand i {
    font-size: 1.75rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.sidebar-brand:hover {
    color: #ffffff;
    transform: translateY(-1px);
}

/* Menu da Sidebar */
.sidebar-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.menu-item {
    margin: 0.25rem 0;
}

.menu-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1.5rem;
    color: var(--text-muted);
    text-decoration: none;
    transition: var(--transition);
    position: relative;
    border-radius: 0;
    margin: 0 0.75rem;
    border-radius: 10px;
    font-weight: 500;
    font-size: 0.9rem;
}

.menu-link:hover {
    color: var(--text-light);
    background: rgba(99, 102, 241, 0.1);
    transform: translateX(4px);
}

.menu-link.active {
    color: #ffffff;
    background: var(--gradient-primary);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
    transform: translateX(4px);
}

.menu-link.active::before {
    content: '';
    position: absolute;
    left: -0.75rem;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 20px;
    background: var(--primary);
    border-radius: 2px;
}

.menu-link i {
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
    opacity: 0.8;
    transition: var(--transition);
}

.menu-link:hover i,
.menu-link.active i {
    opacity: 1;
    transform: scale(1.1);
}

.menu-text {
    flex: 1;
}

/* Badge de notificações */
.menu-badge {
    background: var(--danger);
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    border-radius: 10px;
    min-width: 20px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
    animation: pulse 2s infinite;
}

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

/* Submenu */
.has-submenu > .menu-link::after {
    content: '›';
    font-size: 1.2rem;
    font-weight: bold;
    margin-left: auto;
    transition: var(--transition);
    display: inline-block;
}

.has-submenu.open > .menu-link::after {
    transform: rotate(90deg);
}

.submenu {
    list-style: none;
    padding: 0;
    margin: 0.5rem 0.75rem;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: rgba(15, 23, 42, 0.5);
    border-radius: 8px;
    border: 1px solid rgba(51, 65, 85, 0.3);
}

.has-submenu.open .submenu {
    padding: 0.5rem 0;
    opacity: 1;
}

.submenu .menu-link {
    padding: 0.625rem 1rem 0.625rem 2.5rem;
    font-size: 0.85rem;
    margin: 0;
    border-radius: 6px;
}

.submenu .menu-link::before {
    content: '•';
    margin-right: 0.5rem;
    opacity: 0.5;
}

/* Separador do menu */
li[style*="border-top"] {
    margin-top: 2rem !important;
    padding-top: 1rem !important;
    border-top: 1px solid rgba(51, 65, 85, 0.6) !important;
}

/* Conteúdo Principal */
.main-content {
    margin-left: var(--sidebar-width);
    padding: 0;
    min-height: 100vh;
    background: transparent;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

/* Header da página */
.admin-header {
    background: white;
    padding: 1rem 2rem;
    border-bottom: 1px solid rgba(226, 232, 240, 0.8);
    box-shadow: var(--shadow-elegant);
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.sidebar-toggle {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 8px;
    transition: var(--transition);
}

.sidebar-toggle:hover {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary);
}

.page-title {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--dark);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Main content area */
main {
    flex: 1;
    padding: 2rem;
    background: transparent;
}

/* Header do Conteúdo */
.content-header {
    background: white;
    padding: 1.5rem 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-elegant);
    margin-bottom: 2rem;
    border: 1px solid rgba(226, 232, 240, 0.6);
}

.content-header h1 {
    color: var(--dark);
    font-weight: 700;
    margin: 0;
    font-size: 1.75rem;
}

.content-header p {
    color: var(--secondary);
    margin: 0.5rem 0 0 0;
    opacity: 0.8;
}

/* Cards */
.card {
    background: white;
    border: 1px solid rgba(226, 232, 240, 0.8);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-elegant);
    transition: var(--transition);
    overflow: hidden;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.card-header {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-bottom: 1px solid rgba(226, 232, 240, 0.8);
    padding: 1.25rem 1.5rem;
    font-weight: 600;
    color: var(--dark);
}

.card-body {
    padding: 1.5rem;
}

/* Botões Modernos */
.btn {
    padding: 0.75rem 1.5rem;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.9rem;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.6);
    color: white;
}

.btn-success {
    background: linear-gradient(135deg, var(--success) 0%, #059669 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

.btn-success:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.6);
    color: white;
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger) 0%, #dc2626 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

.btn-danger:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(239, 68, 68, 0.6);
    color: white;
}

.btn-outline-primary {
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
}

.btn-outline-primary:hover {
    background: var(--gradient-primary);
    border-color: var(--primary);
    color: white;
    transform: translateY(-1px);
}

/* Formulários */
.form-control {
    border-radius: 10px;
    border: 2px solid #e2e8f0;
    padding: 0.75rem 1rem;
    transition: var(--transition);
    background: white;
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
    background: white;
}

.form-label {
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 0.5rem;
}

/* Tabelas */
.table {
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-elegant);
    border: 1px solid rgba(226, 232, 240, 0.8);
}

.table thead th {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: none;
    font-weight: 700;
    color: var(--dark);
    padding: 1rem 1.5rem;
}

.table tbody tr {
    border-bottom: 1px solid rgba(226, 232, 240, 0.6);
    transition: var(--transition);
}

.table tbody tr:hover {
    background: rgba(99, 102, 241, 0.02);
    transform: scale(1.001);
}

/* Alertas Modernos */
.alert {
    border: none;
    border-radius: var(--border-radius);
    padding: 1rem 1.5rem;
    box-shadow: var(--shadow-elegant);
    font-weight: 500;
}

.alert-success {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, rgba(16, 185, 129, 0.05) 100%);
    color: var(--success);
    border-left: 4px solid var(--success);
}

.alert-danger {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1) 0%, rgba(239, 68, 68, 0.05) 100%);
    color: var(--danger);
    border-left: 4px solid var(--danger);
}

.alert-warning {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.1) 0%, rgba(245, 158, 11, 0.05) 100%);
    color: var(--warning);
    border-left: 4px solid var(--warning);
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.mobile-open {
        transform: translateX(0);
    }

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

/* Efeitos de Loading */
.loading {
    position: relative;
    opacity: 0.7;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 24px;
    height: 24px;
    margin: -12px 0 0 -12px;
    border: 3px solid rgba(99, 102, 241, 0.3);
    border-top: 3px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Tooltips Modernos */
.tooltip-inner {
    background: var(--bg-darker);
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    font-size: 0.8rem;
    font-weight: 500;
}

/* Badges Modernos */
.badge {
    border-radius: 6px;
    font-weight: 600;
    padding: 0.375rem 0.75rem;
}

/* Dropdown Moderno */
.dropdown-menu {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-dark);
    padding: 0.5rem;
    background: white;
}

.dropdown-item {
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    transition: var(--transition);
    font-weight: 500;
}

.dropdown-item:hover {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary);
}

/* Top Header (se existir) */
.top-header {
    background: white;
    border-bottom: 1px solid rgba(226, 232, 240, 0.8);
    padding: 1rem 2rem;
    box-shadow: var(--shadow-elegant);
}

/* Estados de Cards */
.card-stats {
    background: white;
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-elegant);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.card-stats::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-primary);
}

.card-stats:hover {
    transform: translateY(-4px);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

/* Sistema de Grid Personalizado */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

/* Animações de entrada */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in {
    animation: fadeInUp 0.6s ease-out;
}

/* Efeitos de profundidade */
.depth-1 { box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24); }
.depth-2 { box-shadow: 0 3px 6px rgba(0, 0, 0, 0.16), 0 3px 6px rgba(0, 0, 0, 0.23); }
.depth-3 { box-shadow: 0 10px 20px rgba(0, 0, 0, 0.19), 0 6px 6px rgba(0, 0, 0, 0.23); }

/* Navegação breadcrumb moderna */
.breadcrumb {
    background: transparent;
    padding: 0;
    margin-bottom: 1rem;
}

.breadcrumb-item {
    color: var(--text-muted);
    font-weight: 500;
}

.breadcrumb-item.active {
    color: var(--primary);
    font-weight: 600;
}

/* Dark mode toggle */
.dark-mode-toggle {
    background: none;
    border: none;
    font-size: 1.2rem;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 8px;
    transition: var(--transition);
}

.dark-mode-toggle:hover {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary);
}

/* User dropdown */
.user-dropdown {
    position: relative;
}

.user-toggle {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: none;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
    border-radius: 12px;
    transition: var(--transition);
}

.user-toggle:hover {
    background: rgba(99, 102, 241, 0.1);
}

.user-avatar {
    width: 40px;
    height: 40px;
    background: var(--gradient-primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
}

.user-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.user-name {
    font-weight: 600;
    color: var(--dark);
    font-size: 0.9rem;
}

.user-role {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.user-dropdown .dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-dark);
    padding: 0.5rem;
    min-width: 180px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: var(--transition);
    z-index: 1000;
}

.user-dropdown.open .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-dropdown .dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    color: var(--dark);
    text-decoration: none;
    border-radius: 6px;
    transition: var(--transition);
    font-size: 0.9rem;
}

.user-dropdown .dropdown-item:hover {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary);
}

.user-dropdown .dropdown-item.text-danger {
    color: var(--danger);
}

.user-dropdown .dropdown-item.text-danger:hover {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

/* ===== CARDS EXATAMENTE IGUAL À PÁGINA DE INSCRIÇÕES ===== */
.stats-card {
    border-radius: 8px;
    padding: 1.25rem;
    border: none;
    color: white !important;
    text-align: center;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 0;
}

.stats-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

.stats-card.stats-primary {
    background: #3b82f6 !important;
}

.stats-card.stats-warning {
    background: #f59e0b !important;
}

.stats-card.stats-success {
    background: #10b981 !important;
}

.stats-card.stats-purple {
    background: #8b5cf6 !important;
}

.stats-card.stats-danger {
    background: #ef4444 !important;
}

.stats-card.stats-cyan {
    background: #06b6d4 !important;
}

.stats-content {
    text-align: center;
    width: 100%;
}

.stats-number {
    font-size: 2rem;
    font-weight: 700;
    color: white !important;
    margin: 0;
    line-height: 1;
    letter-spacing: -0.01em;
}

.stats-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9) !important;
    margin-top: 0.125rem;
    text-transform: capitalize;
}

/* Cards de inscrições pendentes */
.pending-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 1rem;
    transition: all 0.3s ease;
}

.pending-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: #d1d5db;
}
}

.stats-icon {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 2rem;
    opacity: 0.15;
    color: #64748b;
}

/* Responsividade para cards compactos */
@media (max-width: 768px) {
    .stats-card {
        height: 75px;
        padding: 1rem;
    }

    .stats-number {
        font-size: 1.75rem;
    }

    .stats-label {
        font-size: 0.7rem;
    }
}

@media (max-width: 576px) {
    .stats-card {
        height: 70px;
        padding: 0.75rem;
    }

    .stats-number {
        font-size: 1.5rem;
    }

    .stats-label {
        font-size: 0.65rem;
    }
}

/* ===== HEADER DASHBOARD MODERNO ===== */
.dashboard-header {
    padding: 2rem 0;
    border-bottom: 1px solid rgba(226, 232, 240, 0.6);
    position: relative;
    margin-bottom: 1rem;
}

.dashboard-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 80px;
    height: 3px;
    background: linear-gradient(90deg, #870303, #dc2626);
    border-radius: 2px;
}

.dashboard-header h1 {
    font-size: 2.5rem;
    text-shadow: 0 2px 10px rgba(135, 3, 3, 0.1);
    margin-bottom: 1rem;
}

.dashboard-header .badge {
    font-size: 0.75rem;
    border-radius: 20px;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(34, 197, 94, 0.2);
    animation: pulse-success 2s infinite;
}

@keyframes pulse-success {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

.dashboard-header .bg-light {
    background: linear-gradient(135deg, #f8fafc, #e2e8f0) !important;
    border: 1px solid rgba(226, 232, 240, 0.8);
    border-radius: 12px !important;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

/* ===== BOTÕES MODERNOS DO DASHBOARD ===== */
.btn-modern {
    border-radius: 12px !important;
    padding: 0.875rem 1.5rem;
    font-weight: 600;
    font-size: 0.9rem;
    letter-spacing: 0.3px;
    border: none !important;
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

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

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

.btn-modern:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.btn-modern.btn-primary {
    background: linear-gradient(135deg, #870303, #dc2626);
}

.btn-modern.btn-primary:hover {
    background: linear-gradient(135deg, #6b0202, #b91c1c);
    box-shadow: 0 8px 20px rgba(135, 3, 3, 0.3);
}

.btn-modern.btn-success {
    background: linear-gradient(135deg, #059669, #10b981);
}

.btn-modern.btn-success:hover {
    background: linear-gradient(135deg, #047857, #059669);
    box-shadow: 0 8px 20px rgba(5, 150, 105, 0.3);
}

.btn-modern.btn-warning {
    background: linear-gradient(135deg, #d97706, #f59e0b);
    color: white !important;
}

.btn-modern.btn-warning:hover {
    background: linear-gradient(135deg, #b45309, #d97706);
    box-shadow: 0 8px 20px rgba(217, 119, 6, 0.3);
    color: white !important;
}

.btn-modern.btn-info {
    background: linear-gradient(135deg, #0284c7, #0ea5e9);
}

.btn-modern.btn-info:hover {
    background: linear-gradient(135deg, #0369a1, #0284c7);
    box-shadow: 0 8px 20px rgba(2, 132, 199, 0.3);
}

/* ===== CARDS MODERNOS DO DASHBOARD ===== */
.modern-card {
    border-radius: 16px !important;
    border: 1px solid rgba(226, 232, 240, 0.6);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.06);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.modern-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.12);
    border-color: rgba(135, 3, 3, 0.15);
}

.modern-header {
    background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
    border-bottom: 1px solid rgba(226, 232, 240, 0.6);
    padding: 1.25rem 1.5rem !important;
    position: relative;
}

.modern-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 1.5rem;
    right: 1.5rem;
    height: 2px;
    background: linear-gradient(90deg, #870303, #dc2626, transparent);
    border-radius: 1px;
}

.modern-header h5 {
    font-weight: 700;
    color: #1a202c;
    margin: 0;
}

.modern-card .card-body {
    padding: 1.5rem;
}

/* Melhorias nos badges dos cards */
.modern-card .badge {
    border-radius: 20px;
    padding: 0.4rem 0.8rem;
    font-weight: 700;
    font-size: 0.75rem;
    letter-spacing: 0.3px;
}

/* Estados vazios mais elegantes */
.modern-card .text-center.py-4,
.modern-card .text-center.py-5 {
    padding: 3rem 1.5rem !important;
}

.modern-card .display-6,
.modern-card .display-1 {
    opacity: 0.3;
    margin-bottom: 1rem;
}
}

/* Botões limpos */
.btn-primary {
    background: #870303 !important;
    border-color: #870303 !important;
}

.btn-primary:hover {
    background: #6b0202 !important;
    border-color: #6b0202 !important;
}

/* =====================================================================
   FASE 1 — Estilos centralizados (mover do header.php inline)
   ===================================================================== */

/* Layout principal — substitui inline do header.php antigo */
.admin-wrapper {
    display: flex;
    min-height: 100vh;
}
.admin-sidebar {
    width: 250px;
    background: var(--gradient-sidebar, linear-gradient(180deg, #1e293b 0%, #0f172a 100%));
    color: var(--text-light, #e2e8f0);
    padding: 0;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    z-index: 1000;
}
.sidebar-header {
    padding: 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}
.sidebar-brand {
    color: #fff;
    text-decoration: none;
    font-size: 1.2rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: .6rem;
}
.sidebar-brand:hover { color: #fff; opacity: .85; }

.admin-sidebar .nav-section {
    padding: 1rem 0;
    border-bottom: 1px solid rgba(255,255,255,0.07);
}
.admin-sidebar .nav-title {
    padding: 0 1rem;
    margin-bottom: .5rem;
    font-size: .75rem;
    text-transform: uppercase;
    color: rgba(255,255,255,.5);
    font-weight: 700;
    letter-spacing: .5px;
}
.admin-sidebar .nav-link {
    display: flex;
    align-items: center;
    padding: .65rem 1rem;
    color: rgba(255,255,255,.78);
    text-decoration: none;
    transition: all .2s ease;
    border-left: 3px solid transparent;
    font-size: .92rem;
}
.admin-sidebar .nav-link:hover {
    background: rgba(99,102,241,.12);
    color: #fff;
}
.admin-sidebar .nav-link.active {
    background: rgba(99,102,241,.2);
    color: #fff;
    border-left-color: var(--primary, #6366f1);
}
.admin-sidebar .nav-link i {
    margin-right: .75rem;
    width: 1.2rem;
    text-align: center;
    font-size: .95rem;
}

.main-content {
    margin-left: 250px;
    padding: 2rem;
    width: calc(100% - 250px);
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    min-height: 100vh;
}

@media (max-width: 768px) {
    .admin-sidebar {
        transform: translateX(-100%);
        transition: transform .3s ease;
    }
    .admin-sidebar.show { transform: translateX(0); }
    .main-content {
        margin-left: 0;
        width: 100%;
        padding: 1rem;
    }
    .mobile-toggle { display: flex !important; }
}

.mobile-toggle {
    display: none;
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 1100;
    background: var(--bg-darker, #0f172a);
    color: #fff;
    border: 0;
    padding: .55rem .75rem;
    border-radius: .375rem;
    box-shadow: 0 4px 12px rgba(0,0,0,.15);
}

/* =====================================================================
   COMPONENTES REUTILIZÁVEIS (Fase 2)
   ===================================================================== */

/* Cards de estatísticas (card-stat.php) */
.card-stat {
    border: 0;
    border-radius: 14px;
    transition: transform .2s ease, box-shadow .2s ease;
    box-shadow: 0 4px 14px rgba(0,0,0,.08);
}
.card-stat:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(0,0,0,.12);
}
.card-stat .card-body { padding: 1.25rem 1rem; }
.card-stat .card-stat-value {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
}
.card-stat .card-stat-label {
    font-size: .82rem;
    opacity: .9;
    margin-top: .25rem;
}
.card-stat .card-stat-icon {
    font-size: 1.5rem;
    opacity: .35;
    margin-bottom: .5rem;
}

/* Page header padronizado */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.page-header h1 {
    font-size: 1.5rem;
    margin: 0 0 .25rem 0;
    font-weight: 700;
}
.page-header .page-subtitle {
    color: #6c757d;
    margin: 0;
    font-size: .9rem;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #94a3b8;
}
.empty-state i {
    font-size: 3.5rem;
    opacity: .35;
    margin-bottom: 1rem;
    display: block;
}
.empty-state .empty-state-title {
    font-size: 1.1rem;
    color: #64748b;
    margin-bottom: .5rem;
}

/* Filter bar */
.filter-bar {
    background: #fff;
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1rem;
    box-shadow: 0 2px 8px rgba(0,0,0,.04);
}
.filter-bar .form-label.small {
    font-size: .75rem;
    text-transform: uppercase;
    color: #64748b;
    letter-spacing: .5px;
    margin-bottom: .25rem;
    font-weight: 600;
}

/* Toastify customizado */
.toastify {
    border-radius: 8px !important;
    font-size: .92rem;
    padding: 12px 18px !important;
    box-shadow: 0 8px 24px rgba(0,0,0,.15) !important;
}
.toastify.toastify-success { background: linear-gradient(135deg, #10b981, #059669); }
.toastify.toastify-error   { background: linear-gradient(135deg, #ef4444, #b91c1c); }
.toastify.toastify-info    { background: linear-gradient(135deg, #06b6d4, #0891b2); }
.toastify.toastify-warning { background: linear-gradient(135deg, #f59e0b, #d97706); }

/* Editor Quill — combina com cards do admin */
.editor-rico-wrapper { margin-bottom: .25rem; }
.editor-rico-wrapper .ql-toolbar.ql-snow {
    border-radius: 8px 8px 0 0;
    border-color: #cbd5e1;
    background: #f8fafc;
}
.editor-rico-wrapper .ql-container.ql-snow {
    border-radius: 0 0 8px 8px;
    border-color: #cbd5e1;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 14px;
}
.editor-rico-wrapper .ql-editor {
    min-height: 200px;
    line-height: 1.6;
}
.editor-rico-wrapper .ql-editor.ql-blank::before {
    color: #94a3b8;
    font-style: normal;
}

/* Upload preview (componente upload-image.php) */
.upload-preview-box {
    border: 2px dashed #cbd5e1;
    border-radius: 10px;
    padding: 1.5rem;
    text-align: center;
    background: #f8fafc;
    transition: all .2s ease;
    cursor: pointer;
}
.upload-preview-box:hover { border-color: var(--primary, #6366f1); background: #f1f5f9; }
.upload-preview-box.has-image { padding: 0; border-style: solid; }
.upload-preview-box img { max-width: 100%; border-radius: 8px; }

/* =====================================================================
   FASE 5 — Quick Search (Ctrl+K)
   ===================================================================== */

.quick-search-popup .swal2-html-container { padding: .5rem; }
.quick-search-wrapper #quickSearchInput {
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    padding: .75rem 1rem;
    font-size: 1rem;
}
.quick-links-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: .5rem;
}
.quick-link {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .65rem .85rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    color: #1e293b;
    text-decoration: none;
    font-size: .92rem;
    transition: all .15s ease;
}
.quick-link:hover {
    background: var(--primary, #6366f1);
    color: #fff;
    border-color: var(--primary, #6366f1);
    transform: translateY(-1px);
}
.quick-link i { width: 1.4rem; text-align: center; opacity: .7; }
.quick-link:hover i { opacity: 1; }

/* =====================================================================
   FASE 5 — Dark Mode (toggle no sidebar)
   ===================================================================== */

body.dark-mode {
    background: #0f172a !important;
    color: #e2e8f0;
}
body.dark-mode .main-content {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%) !important;
    color: #e2e8f0;
}

/* Cards no dark mode */
body.dark-mode .card,
body.dark-mode .filter-bar {
    background: #1e293b;
    border-color: #334155;
    color: #e2e8f0;
}
body.dark-mode .card-header,
body.dark-mode .table-light {
    background: #0f172a !important;
    color: #e2e8f0;
    border-color: #334155;
}
body.dark-mode .table {
    color: #e2e8f0;
}
body.dark-mode .table > :not(caption) > * > * {
    background-color: transparent;
    color: #e2e8f0;
    border-bottom-color: #334155;
}
body.dark-mode .table-hover > tbody > tr:hover > * {
    background-color: rgba(99, 102, 241, .1);
    color: #fff;
}

/* Inputs no dark mode */
body.dark-mode .form-control,
body.dark-mode .form-select {
    background: #0f172a;
    border-color: #334155;
    color: #e2e8f0;
}
body.dark-mode .form-control::placeholder { color: #64748b; }
body.dark-mode .form-control:focus,
body.dark-mode .form-select:focus {
    background: #0f172a;
    color: #fff;
    border-color: #6366f1;
    box-shadow: 0 0 0 .25rem rgba(99,102,241,.25);
}
body.dark-mode .form-label,
body.dark-mode .form-check-label,
body.dark-mode .text-muted { color: #94a3b8 !important; }

/* Badges no dark mode (mantém cores fortes) */
body.dark-mode .badge.bg-light { background: #334155 !important; color: #e2e8f0 !important; }

/* Botões outline no dark mode */
body.dark-mode .btn-outline-secondary {
    color: #cbd5e1;
    border-color: #475569;
}
body.dark-mode .btn-outline-secondary:hover {
    background: #475569;
    color: #fff;
}

/* Page header no dark mode */
body.dark-mode .page-header h1 { color: #fff; }
body.dark-mode .page-subtitle { color: #94a3b8; }

/* Modal no dark mode */
body.dark-mode .modal-content { background: #1e293b; color: #e2e8f0; border: 1px solid #334155; }
body.dark-mode .modal-header,
body.dark-mode .modal-footer { border-color: #334155; }

/* Empty state no dark mode */
body.dark-mode .empty-state { color: #64748b; }
body.dark-mode .empty-state .empty-state-title { color: #cbd5e1; }

/* Quill no dark mode */
body.dark-mode .editor-rico-wrapper .ql-toolbar.ql-snow,
body.dark-mode .editor-rico-wrapper .ql-container.ql-snow {
    border-color: #334155;
}
body.dark-mode .editor-rico-wrapper .ql-toolbar.ql-snow {
    background: #1e293b;
}
body.dark-mode .editor-rico-wrapper .ql-toolbar .ql-stroke { stroke: #cbd5e1; }
body.dark-mode .editor-rico-wrapper .ql-toolbar .ql-fill   { fill:   #cbd5e1; }
body.dark-mode .editor-rico-wrapper .ql-toolbar .ql-picker-label { color: #cbd5e1; }
body.dark-mode .editor-rico-wrapper .ql-container { background: #0f172a; color: #e2e8f0; }

/* kbd no sidebar */
.admin-sidebar .nav-link kbd {
    background: rgba(255,255,255,.12);
    border-radius: 4px;
    padding: 1px 5px;
    font-size: .7rem;
    color: rgba(255,255,255,.7);
    font-family: monospace;
}

/* =====================================================================
   SKELETON LOADER (componente skeleton.php)
   ===================================================================== */

.skeleton-line {
    display: inline-block;
    height: 1em;
    width: 100%;
    background: linear-gradient(90deg, #e5e7eb 0%, #f3f4f6 50%, #e5e7eb 100%);
    background-size: 200% 100%;
    border-radius: 4px;
    animation: skeleton-shimmer 1.4s ease-in-out infinite;
    vertical-align: middle;
}
.skeleton-line-sm { height: .7em; }
.skeleton-line-lg { height: 1.6em; }

@keyframes skeleton-shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

body.dark-mode .skeleton-line {
    background: linear-gradient(90deg, #1e293b 0%, #334155 50%, #1e293b 100%);
    background-size: 200% 100%;
}