/* ============================================
   PAINEL ADMIN - ESTILOS MELHORADOS
   ============================================ */

/* Container do Painel */
.admin-panel {
    background: white;
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    margin: 50px auto;
}

/* Cabeçalho do Painel */
.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 20px;
}

.admin-title {
    display: flex;
    flex-direction: column;
}

.admin-title h3 {
    color: var(--primary);
    margin: 0;
    font-size: 1.8rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.admin-title p {
    color: var(--gray);
    margin: 5px 0 0;
    font-size: 0.95rem;
}

/* Estatísticas */
.admin-stats {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.stat-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 25px;
    border-radius: 12px;
    text-align: center;
    min-width: 120px;
}

.stat-card.green { background: linear-gradient(135deg, #10b981 0%, #059669 100%); }
.stat-card.yellow { background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%); }
.stat-card.blue { background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%); }

.stat-card .stat-number {
    font-size: 2rem;
    font-weight: 700;
    margin: 0;
}

.stat-card .stat-label {
    font-size: 0.85rem;
    opacity: 0.9;
    margin: 5px 0 0;
}

/* Controles do Painel */
.admin-controls {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    align-items: center;
}

.search-box {
    flex: 1;
    min-width: 250px;
    position: relative;
}

.search-box input {
    width: 100%;
    padding: 12px 40px 12px 15px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 0.95rem;
    transition: all 0.3s;
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.search-box .search-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray);
    font-size: 1.2rem;
}

.filter-select {
    padding: 12px 35px 12px 15px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 0.95rem;
    background: white;
    cursor: pointer;
    transition: all 0.3s;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
}

.filter-select:focus {
    outline: none;
    border-color: var(--primary);
}

.btn-export {
    padding: 12px 20px;
    background: #10b981;
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s;
}

.btn-export:hover {
    background: #059669;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.btn-clear {
    padding: 12px 20px;
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-clear:hover {
    background: #dc2626;
}

/* Tabela */
.admin-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

.admin-table thead {
    background: #f9fafb;
}

.admin-table th {
    padding: 15px;
    text-align: left;
    font-weight: 700;
    color: var(--dark);
    border-bottom: 2px solid #e5e7eb;
    cursor: pointer;
    user-select: none;
    position: relative;
}

.admin-table th:hover {
    background: #f3f4f6;
}

.admin-table th.sortable::after {
    content: " ↕";
    opacity: 0.3;
    font-size: 0.8rem;
}

.admin-table th.sorted-asc::after {
    content: " ↑";
    opacity: 1;
    color: var(--primary);
}

.admin-table th.sorted-desc::after {
    content: " ↓";
    opacity: 1;
    color: var(--primary);
}

.admin-table tbody tr {
    border-bottom: 1px solid #f3f4f6;
    transition: all 0.2s;
}

.admin-table tbody tr:hover {
    background: #f9fafb;
}

.admin-table td {
    padding: 15px;
    color: var(--dark);
}

/* Status Pills */
.status-pill {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
}

.status-pill.cadastrado {
    background: #dbeafe;
    color: #1e40af;
}

.status-pill.pendente {
    background: #fef3c7;
    color: #92400e;
}

.status-pill.pago {
    background: #dcfce7;
    color: #166534;
}

.status-pill.iniciou {
    background: #e0e7ff;
    color: #4338ca;
}

/* Paginação */
.pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.pagination-info {
    color: var(--gray);
    font-size: 0.95rem;
}

.pagination-controls {
    display: flex;
    gap: 5px;
    align-items: center;
}

.page-btn {
    padding: 8px 12px;
    border: 1px solid #e5e7eb;
    background: white;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
    min-width: 38px;
    text-align: center;
}

.page-btn:hover:not(:disabled) {
    background: #f3f4f6;
    border-color: var(--primary);
}

.page-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.page-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    font-weight: 700;
}

.per-page-select {
    padding: 8px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    background: white;
    cursor: pointer;
    font-size: 0.9rem;
}

/* Loading State */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
    border-radius: 16px;
}

.spinner {
    border: 4px solid #f3f4f6;
    border-top: 4px solid var(--primary);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--gray);
}

.empty-state i {
    font-size: 4rem;
    opacity: 0.3;
    margin-bottom: 20px;
}

.empty-state h4 {
    margin: 0 0 10px;
    color: var(--dark);
}

/* Responsive */
@media (max-width: 768px) {
    .admin-panel {
        padding: 20px;
    }
    
    .admin-controls {
        flex-direction: column;
    }
    
    .search-box {
        width: 100%;
    }
    
    .admin-table {
        font-size: 0.85rem;
    }
    
    .admin-table th,
    .admin-table td {
        padding: 10px 8px;
    }
    
    .pagination {
        flex-direction: column;
    }
    
    .pagination-controls {
        flex-wrap: wrap;
        justify-content: center;
    }
}