/* ==========================================================================
   DASHBOARD ORGANIZADOR - REESTILIZAÇÃO PREMIUM (UI/UX)
   ========================================================================== */

body {
    background-color: #f8f9fa !important; /* Uniformiza com o fundo das outras paginas refatoradas */
}

/* Hero Section (Welcome Banner) */
.dashboard-hero-banner {
    background: linear-gradient(135deg, #481389 0%, #2E0854 100%);
    border-radius: 16px;
    padding: 24px 30px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(72, 19, 137, 0.15);
    color: white;
}

.hero-bg-accent {
    position: absolute;
    right: -10%;
    top: -30%;
    width: 250px;
    height: 250px;
    background: radial-gradient(circle, rgba(123, 31, 162, 0.4) 0%, rgba(123, 31, 162, 0) 70%);
    border-radius: 50%;
    pointer-events: none;
    z-index: 1;
}

.company-badge {
    display: inline-flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.hero-title {
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: white;
}

.hero-subtitle {
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.95rem;
    font-weight: 400;
}

/* Mercado Pago Alert Card */
.mp-config-card {
    display: flex;
    align-items: center;
    background: rgba(253, 126, 20, 0.12); /* Laranja sutil */
    border: 1px solid rgba(253, 126, 20, 0.25);
    border-radius: 12px;
    padding: 10px 15px;
    gap: 12px;
    transition: all 0.3s ease;
    backdrop-filter: blur(4px);
    z-index: 2;
}

.mp-config-card:hover {
    background: rgba(253, 126, 20, 0.18);
    border-color: rgba(253, 126, 20, 0.35);
    transform: translateY(-2px);
}

.mp-card-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(253, 126, 20, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fd7e14;
    font-size: 0.95rem;
}

.mp-card-info h6 {
    margin: 0;
    font-size: 0.8rem !important;
    font-weight: 700 !important;
    color: #fd7e14 !important;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.mp-card-info p {
    margin: 0;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
}

.mp-card-action {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #fd7e14;
    color: white !important;
    text-decoration: none;
    font-size: 0.8rem;
    transition: all 0.3s ease;
}

.mp-card-action:hover {
    background: #e0690d;
    transform: scale(1.1);
}

/* Criar Workshop Button */
.btn-hero-create {
    background: #FFD700;
    color: #2E0854 !important;
    border: none;
    font-weight: 700;
    padding: 12px 24px;
    border-radius: 12px;
    font-size: 0.9rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.25);
    display: inline-flex;
    align-items: center;
    z-index: 2;
}

.btn-hero-create:hover {
    background: #ffea70;
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 8px 25px rgba(255, 215, 0, 0.4);
}

/* Stats Cards (Estatísticas Principais) */
.nexum-stat-card {
    background: #FFFFFF !important;
    border-radius: 16px !important;
    padding: 1.5rem !important;
    box-shadow: 0 4px 12px rgba(74, 20, 140, 0.03) !important;
    border: 1px solid rgba(74, 20, 140, 0.06) !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    position: relative !important;
    overflow: hidden !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    justify-content: space-between !important;
    gap: 0 !important;
    height: 100%;
}

.nexum-stat-card::before {
    display: none !important; /* Remove a barra rígida do topo */
}

.nexum-stat-card:hover {
    transform: translateY(-5px) !important;
    box-shadow: 0 12px 24px rgba(74, 20, 140, 0.1) !important;
    border-color: rgba(74, 20, 140, 0.15) !important;
}

/* Ícones de estatísticas — cor chapada, sem degradê ou translúcido */
.nexum-stat-icon {
    width: 48px !important;
    height: 48px !important;
    border-radius: 12px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 1.25rem !important;
    color: #ffffff !important;
    background-image: none !important;
    margin-bottom: 0.85rem !important;
    transition: transform 0.3s ease !important;
    opacity: 1 !important;
}

.nexum-stat-icon i {
    color: #ffffff !important;
}

.nexum-stat-card:hover .nexum-stat-icon {
    transform: scale(1.1) rotate(3deg);
}

.nexum-stat-icon.primary {
    background: #4a148c !important;
    background-color: #4a148c !important;
    background-image: none !important;
}

.nexum-stat-icon.success {
    background: #059669 !important;
    background-color: #059669 !important;
    background-image: none !important;
}

.nexum-stat-icon.warning {
    background: #d97706 !important;
    background-color: #d97706 !important;
    background-image: none !important;
}

.nexum-stat-icon.info {
    background: #0284c7 !important;
    background-color: #0284c7 !important;
    background-image: none !important;
}

.nexum-stat-icon.indigo {
    background: #4338ca !important;
    background-color: #4338ca !important;
    background-image: none !important;
}

.nexum-stat-icon.teal {
    background: #0d9488 !important;
    background-color: #0d9488 !important;
    background-image: none !important;
}

.nexum-stat-icon.rose {
    background: #e11d48 !important;
    background-color: #e11d48 !important;
    background-image: none !important;
}

.nexum-stat-icon.purple-dark {
    background: #2e0854 !important;
    background-color: #2e0854 !important;
    background-image: none !important;
}

.nexum-stat-value {
    font-size: 1.65rem !important;
    font-weight: 700 !important;
    color: #2E0854 !important;
    margin: 0 0 4px 0 !important;
    letter-spacing: -0.5px;
}

.nexum-stat-label {
    color: #6C7582 !important;
    font-weight: 500 !important;
    font-size: 0.85rem !important;
    margin: 0 !important;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Listas e Painéis Laterais (Atividades / Avaliações) */
.border-bottom {
    border-bottom: 1px solid rgba(74, 20, 140, 0.06) !important;
    padding-bottom: 12px !important;
    margin-bottom: 12px !important;
    transition: background-color 0.2s ease;
    border-radius: 8px;
    padding: 10px;
}

.border-bottom:hover {
    background-color: rgba(74, 20, 140, 0.02);
}

.border-bottom:last-child {
    border-bottom: none !important;
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
}

.border-bottom h6 {
    color: #2E0854 !important;
    font-weight: 600 !important;
    font-size: 0.9rem !important;
}

.border-bottom .text-muted {
    font-size: 0.8rem !important;
}

.border-bottom .fst-italic {
    font-size: 0.85rem !important;
    color: #555 !important;
    display: block;
    margin-top: 5px;
}

/* Custom Table Re-styling (Workshops Recentes) */
.nexum-table {
    border-collapse: separate !important;
    border-spacing: 0 6px !important; /* Espaçamento entre as linhas */
    width: 100% !important;
}

.nexum-table thead th {
    background: #2E0854 !important;
    color: white !important;
    font-weight: 600 !important;
    padding: 12px 16px !important;
    font-size: 0.85rem !important;
    text-transform: uppercase !important;
    letter-spacing: 0.8px !important;
    border: none !important;
}

.nexum-table tbody tr {
    box-shadow: 0 2px 6px rgba(0,0,0,0.02) !important;
    border-radius: 8px !important;
    transition: all 0.2s ease !important;
}

.nexum-table tbody td {
    background: #FFFFFF !important;
    padding: 14px 16px !important;
    border: none !important;
    border-top: 1px solid rgba(74, 20, 140, 0.04) !important;
    border-bottom: 1px solid rgba(74, 20, 140, 0.04) !important;
}

.nexum-table tbody td:first-child {
    border-left: 1px solid rgba(74, 20, 140, 0.04) !important;
    border-top-left-radius: 8px !important;
    border-bottom-left-radius: 8px !important;
}

.nexum-table tbody td:last-child {
    border-right: 1px solid rgba(74, 20, 140, 0.04) !important;
    border-top-right-radius: 8px !important;
    border-bottom-right-radius: 8px !important;
}

.nexum-table tbody tr:hover td {
    background-color: rgba(74, 20, 140, 0.02) !important;
}

/* Headings dos Cards */
.main-card-wrapper h5, .main-card-wrapper h6 {
    color: #2E0854 !important;
    font-weight: 700 !important;
    font-size: 1.1rem !important;
    letter-spacing: -0.3px;
}

.main-card-wrapper h5 i, .main-card-wrapper h6 i {
    color: #6A1B9A !important;
}

/* Badges Modernos para as Tabelas */
.nexum-badge {
    padding: 4px 10px !important;
    border-radius: 12px !important;
    font-size: 0.75rem !important;
    font-weight: 600 !important;
    text-transform: capitalize !important;
}

.nexum-badge.success {
    background: rgba(40, 167, 69, 0.1) !important;
    color: #28a745 !important;
    border: 1px solid rgba(40, 167, 69, 0.15) !important;
}

.nexum-badge.primary {
    background: rgba(74, 20, 140, 0.08) !important;
    color: #4A148C !important;
    border: 1px solid rgba(74, 20, 140, 0.15) !important;
}

.nexum-badge.warning {
    background: rgba(255, 193, 7, 0.1) !important;
    color: #ffc107 !important;
    border: 1px solid rgba(255, 193, 7, 0.2) !important;
}

/* Ticket Stats Card */
.ticket-stats-card {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 12px;
    border: 1px solid #e9ecef;
}
.ticket-stats-card .ticket-name {
    font-weight: 600;
    color: #343a40;
}
.ticket-stats-card .progress-bar {
    background: linear-gradient(135deg, #4A148C 0%, #6A1B9A 100%);
}

/* Tabela */
.table {
    border-collapse: separate;
    border-spacing: 0;
}
.table thead th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #495057;
    border-top: none;
    border-bottom: 1px solid #dee2e6;
}
.table tbody tr:hover {
    background-color: #f1f3f5;
}
.table td, .table th {
    vertical-align: middle;
}
.table-hover tbody tr.reembolsado-row {
    background-color: #fceeee;
    text-decoration: line-through;
    color: #999;
}
.table-hover tbody tr.reembolsado-row:hover {
    background-color: #f8d7da;
}

.btn-edit-custom {
    padding-top: 0.25rem;
    padding-bottom: 0.25rem;
    font-size: 0.8rem;
    height: 30px;
}

/* Analytics Section */
.bg-light {
    background-color: #f8f9fa !important;
}

.nav-tabs .nav-link {
    color: var(--nx-muted, #6c757d); /* Use muted text for inactive tabs */
    border: none;
    border-radius: 10px 10px 0 0;
    margin-right: 5px; /* Adjust spacing between tabs */
    padding: 1rem 1.5rem;
    font-weight: 600;
    transition: all 0.3s ease;
    background-color: #f8f9fa; /* Light background for inactive */
}

.nav-tabs .nav-link:hover {
    color: var(--nx-purple, #4A148C);
    background-color: #e9ecef; /* Slightly darker on hover */
    border-color: transparent;
}

.nav-tabs .nav-link.active {
    background: linear-gradient(135deg, var(--nx-purple, #4A148C) 0%, #6A1B9A 100%); /* Purple gradient for active tab */
    color: var(--nx-white, #FFFFFF);
    border-color: transparent;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    transform: translateY(-2px); /* Slight lift for active tab */
}

.nav-tabs .nav-link.active:hover {
    color: var(--nx-white, #FFFFFF);
    background: linear-gradient(135deg, var(--nx-purple, #4A148C) 0%, #6A1B9A 100%); /* Maintain gradient on hover for active */
}

/* Ensure the card-header for tabs has no bottom border if tabs are part of it */
.card-header.p-0 {
    border-bottom: none;
}

/* ==========================================================================
   RESPONSIVIDADE E OTIMIZAÇÃO PARA DISPOSITIVOS MÓVEIS (MOBILE)
   ========================================================================== */

@media (max-width: 1200px) {
    /* Ajustes Gerais de Espaçamento no Wrapper Mobile */
    .container-fluid {
        padding-left: 8px !important;
        padding-right: 8px !important;
    }
    
    /* Garantir que o canvas do grafico de vendas nao estoure a largura no mobile */
    .chart-container-sales {
        position: relative;
        width: 100% !important;
        overflow: hidden !important;
    }
    #grafico_vendas, #grafico_ingressos {
        width: 100% !important;
        height: auto !important;
    }
    
    /* Hero Banner Mobile */
    .dashboard-hero-banner {
        padding: 20px 18px !important;
        text-align: center;
    }
    
    .hero-bg-accent {
        width: 150px;
        height: 150px;
        right: -20px;
        top: -20px;
    }
    
    .company-badge {
        margin: 0 auto 10px !important;
    }
    
    .hero-title {
        font-size: 1.35rem !important;
        line-height: 1.3;
    }
    
    .hero-subtitle {
        font-size: 0.85rem !important;
        margin-bottom: 15px !important;
    }
    
    .dashboard-hero-banner .d-flex {
        align-items: center !important;
        justify-content: center !important;
    }

    /* Mercado Pago Notification no Mobile (100% largura) */
    .mp-config-card {
        width: 100% !important;
        justify-content: space-between;
        padding: 12px !important;
    }
    
    .mp-card-info {
        text-align: left;
    }

    /* Botão de Criar Workshop 100% no Mobile */
    .btn-hero-create {
        width: 100% !important;
        justify-content: center;
        padding: 12px !important;
    }

    /* Grid de Estatísticas em 2 Colunas no Mobile */
    .row.g-2.mb-2 {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 8px !important;
    }
    
    .row.g-2.mb-2 > div {
        width: 100% !important;
        max-width: 100% !important;
        flex: none !important;
    }
    
    /* Faz os wrappers de gráficos tomarem a largura total de 2 blocos (como Eventos Recentes) */
    .row.g-2.mb-2 > .col-lg-8,
    .row.g-2.mb-2 > .col-lg-4 {
        grid-column: span 2 !important;
    }
    
    .nexum-stat-card {
        padding: 1rem !important;
        align-items: center;
        text-align: center;
    }
    
    .nexum-stat-icon {
        margin-bottom: 0.8rem !important;
    }
    
    .nexum-stat-value {
        font-size: 1.3rem !important;
    }
    
    .nexum-stat-label {
        font-size: 0.75rem !important;
    }

    /* Transformar Tabelas em Cards Verticais (Garante leitura limpa sem scroll horizontal) */
    .nexum-table thead {
        display: none !important; /* Esconde cabeçalho */
    }
    
    .nexum-table, .nexum-table tbody, .nexum-table tr, .nexum-table td {
        display: block !important;
        width: 100% !important;
    }
    
    .nexum-table tbody tr {
        margin-bottom: 12px !important;
        box-shadow: 0 4px 10px rgba(0,0,0,0.04) !important;
        border: 1px solid rgba(74, 20, 140, 0.08) !important;
        border-radius: 12px !important;
        background: #fff !important;
        overflow: hidden;
    }
    
    .nexum-table tbody td {
        padding: 10px 14px !important;
        text-align: right !important;
        position: relative !important;
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        border: none !important;
        border-bottom: 1px solid rgba(74, 20, 140, 0.04) !important;
    }
    
    .nexum-table tbody td:last-child {
        border-bottom: none !important;
    }
    
    /* Adiciona Labels dinâmicos no celular */
    .nexum-table tbody td::before {
        content: attr(data-label);
        font-weight: 700;
        color: #6C7582;
        font-size: 0.8rem;
        text-transform: uppercase;
        text-align: left;
    }
    
    /* Corrige o alinhamento de textos das células no Mobile */
    .nexum-table tbody td h6 {
        font-size: 0.9rem !important;
        margin: 0 !important;
        text-align: right !important;
    }

    .nexum-table tbody td small {
        display: block;
        text-align: right;
    }
}

/* Telas ultra estreitas (ex: iPhone SE antigo, 320px) */
@media (max-width: 350px) {
    .row.g-2.mb-2 {
        grid-template-columns: 1fr !important; /* 1 card por linha se for muito estreito */
    }
}

.dash-attention a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.7rem 0.85rem;
    margin-bottom: 0.4rem;
    border-radius: 12px;
    background: #fff;
    border: 1px solid rgba(72, 19, 137, 0.08);
    color: #4B5563;
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 600;
}

.dash-attention a:hover {
    background: #F4EFFF;
    color: #481389;
}

.dash-attention a:last-child {
    margin-bottom: 0;
}

.dash-meter-track {
    height: 8px;
    border-radius: 999px;
    background: #E5E7EB;
    overflow: hidden;
    margin-top: 0.25rem;
}

.dash-meter-track span {
    display: block;
    height: 100%;
    background: linear-gradient(135deg, #481389 0%, #2E0854 100%);
    border-radius: 999px;
}

.dash-table-actions {
    display: flex;
    gap: 0.4rem;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.dash-table-actions .btn,
.finance-container .dash-table-actions a.btn {
    text-decoration: none;
    font-size: 0.75rem;
    padding: 0.3rem 0.7rem;
    border-radius: 8px;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
}

.dash-badge-live {
    background: #481389 !important;
    color: #fff !important;
}