/* ========================================
   PACOTES - ESTILOS PRINCIPAIS
   GestãoBLZ - Sistema de Gestão de Pacotes
   ======================================== */

/* KPIs de Pacotes */
.pacotes-kpis .kpi-card {
    background: var(--theme-card-bg, var(--white));
    border: 1px solid var(--theme-border-color, var(--gray-200));
    border-radius: 16px;
    padding: 1.75rem;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}

.pacotes-kpis .kpi-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 5px;
    height: 100%;
    background: linear-gradient(180deg, var(--primary-color), var(--primary-dark));
    opacity: 0;
    transition: all 0.4s ease;
}

.pacotes-kpis .kpi-card::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(var(--primary-r), var(--primary-g), var(--primary-b), 0.03) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.pacotes-kpis .kpi-card:hover {
    transform: translateY(-6px) scale(1.02);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
    border-color: rgba(var(--primary-r), var(--primary-g), var(--primary-b), 0.3);
}

.pacotes-kpis .kpi-card:hover::before {
    opacity: 1;
    width: 6px;
}

.pacotes-kpis .kpi-card:hover::after {
    opacity: 1;
}

.pacotes-kpis .kpi-card .kpi-icon {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    margin-bottom: 1.25rem;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.pacotes-kpis .kpi-card:hover .kpi-icon {
    transform: scale(1.1) rotate(-5deg);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.pacotes-kpis .pacotes-ativos .kpi-icon {
    color: #6366f1;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(99, 102, 241, 0.05));
}

.pacotes-kpis .receita-pacotes .kpi-icon {
    color: #10b981;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(16, 185, 129, 0.05));
}

.pacotes-kpis .creditos-disponiveis .kpi-icon {
    color: #f59e0b;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.1), rgba(245, 158, 11, 0.05));
}

.pacotes-kpis .vencendo-proximos .kpi-icon {
    color: #ef4444;
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1), rgba(239, 68, 68, 0.05));
}

.pacotes-kpis .kpi-content h3 {
    font-size: 2rem;
    font-weight: 700;
    margin: 0 0 0.5rem 0;
    color: var(--theme-text-primary, var(--secondary-color));
}

.pacotes-kpis .kpi-content p {
    font-size: 0.875rem;
    color: var(--theme-text-secondary, var(--gray-600));
    margin: 0 0 0.75rem 0;
}

.pacotes-kpis .kpi-trend {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.813rem;
    font-weight: 600;
}

.pacotes-kpis .kpi-trend.positive {
    color: #10b981;
}

.pacotes-kpis .kpi-trend.negative {
    color: #ef4444;
}

.pacotes-kpis .kpi-trend.neutral {
    color: #6b7280;
}

.pacotes-kpis .kpi-trend.warning {
    color: #f59e0b;
}

/* Filtros */
.pacotes-filters {
    margin-bottom: 1.5rem;
}

.pacotes-filters .search-box {
    position: relative;
}

.pacotes-filters .search-box i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--theme-text-tertiary, var(--gray-400));
    pointer-events: none;
}

.pacotes-filters .search-box input {
    padding-left: 2.75rem;
    background: var(--theme-card-bg, var(--white));
    border: 1px solid var(--theme-border-color, var(--gray-200));
    color: var(--theme-text-primary, var(--secondary-color));
}

.pacotes-filters .search-box input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(var(--primary-r), var(--primary-g), var(--primary-b), 0.1);
    background: var(--theme-card-bg, var(--white));
}

.pacotes-filters .form-select {
    background: var(--theme-card-bg, var(--white));
    border: 1px solid var(--theme-border-color, var(--gray-200));
    color: var(--theme-text-primary, var(--secondary-color));
}

.pacotes-filters .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(var(--primary-r), var(--primary-g), var(--primary-b), 0.1);
}

/* ---------------------------------------------------
   Gestão de Planos (seção interna da página)
--------------------------------------------------- */

.pacotes-planos .pacotes-table-card {
    margin-top: 1.5rem;
}

.pacotes-planos .table-header {
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.pacotes-planos .table-subtitle {
    margin: 0;
    font-size: 0.875rem;
    color: var(--theme-text-tertiary, var(--gray-500));
}

.pacotes-planos-table table {
    width: 100%;
    border-collapse: collapse;
}

.pacotes-planos-table thead th {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 0.85rem 1rem;
    background: var(--theme-bg-secondary, var(--gray-50));
    border-bottom: 1px solid var(--theme-border-color, var(--gray-200));
    color: var(--theme-text-tertiary, var(--gray-500));
    font-weight: 600;
}

.pacotes-planos-table tbody td {
    padding: 1rem;
    border-bottom: 1px solid var(--theme-border-color, var(--gray-200));
    vertical-align: middle;
    color: var(--theme-text-primary, var(--secondary-color));
}

.pacotes-planos-table tbody tr:hover {
    background: rgba(var(--primary-r), var(--primary-g), var(--primary-b), 0.04);
}

.pacotes-planos-table .empty-state {
    padding: 2.5rem 1.5rem;
    text-align: center;
}

.pacotes-planos-table .empty-state i {
    font-size: 2rem;
    margin-bottom: 0.75rem;
    color: var(--primary-color);
}

.pacotes-planos-table .empty-state h5 {
    margin-bottom: 0.25rem;
    font-weight: 600;
    color: var(--theme-text-primary, var(--secondary-color));
}

.pacotes-planos-table .empty-state p {
    margin: 0;
    color: var(--theme-text-secondary, var(--gray-500));
}

.pacotes-planos-table .status-badge,
.badge-status {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.65rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: capitalize;
}

.badge-status.ativo,
.status-badge.ativo {
    background: rgba(16, 185, 129, 0.12);
    color: #0f9d72;
}

.badge-status.pendente,
.status-badge.pendente {
    background: rgba(245, 158, 11, 0.18);
    color: #b87409;
}

.badge-status.vencendo {
    background: rgba(245, 158, 11, 0.18);
    color: #d97706;
}

.badge-status.vencido {
    background: rgba(239, 68, 68, 0.18);
    color: #c81e1e;
}

.badge-status.cancelado,
.status-badge.inativo {
    background: rgba(107, 114, 128, 0.18);
    color: #4b5563;
}

.acoes-tabela {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.acoes-tabela .btn-acao {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1px solid transparent;
    background: var(--theme-bg-secondary, var(--gray-100));
    color: var(--theme-text-secondary, var(--gray-600));
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.acoes-tabela .btn-acao:hover {
    background: rgba(var(--primary-r), var(--primary-g), var(--primary-b), 0.12);
    color: var(--primary-color);
    border-color: rgba(var(--primary-r), var(--primary-g), var(--primary-b), 0.25);
}

.acoes-tabela .btn-acao.danger:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
    border-color: rgba(239, 68, 68, 0.25);
}

.pacote-detalhes,
.plano-detalhes {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
}

.pacote-detalhes .detail-group,
.plano-detalhes .detail-group {
    background: var(--theme-bg-secondary, var(--gray-50));
    border-radius: 12px;
    padding: 1rem;
    border: 1px solid var(--theme-border-color, var(--gray-200));
}

.pacote-detalhes .detail-group h6,
.plano-detalhes .detail-group h6 {
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
    color: var(--theme-text-tertiary, var(--gray-500));
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.pacote-detalhes .detail-group p,
.plano-detalhes .detail-group p {
    margin: 0;
    font-size: 0.95rem;
    color: var(--theme-text-primary, var(--secondary-color));
}

.servicos-checkboxes {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.5rem;
    padding: 0.75rem;
    border: 1px dashed var(--theme-border-color, var(--gray-300));
    border-radius: 10px;
    max-height: 220px;
    overflow-y: auto;
    background: var(--theme-bg-secondary, rgba(0, 0, 0, 0.02));
}

.servicos-checkboxes .service-checkbox {
    display: flex;
    gap: 0.5rem;
    padding: 0.55rem;
    border-radius: 8px;
    border: 1px solid transparent;
    align-items: center;
    transition: all 0.2s ease;
    background: var(--white);
}

.servicos-checkboxes .service-checkbox:hover {
    border-color: rgba(var(--primary-r), var(--primary-g), var(--primary-b), 0.25);
    background: rgba(var(--primary-r), var(--primary-g), var(--primary-b), 0.06);
}

.servicos-checkboxes input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary-color);
}

.servicos-checkboxes .empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 1rem;
    color: var(--theme-text-secondary, var(--gray-500));
}

.alertas-list .alerta-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.85rem;
    border-radius: 12px;
    border: 1px solid var(--theme-border-color, var(--gray-200));
    background: var(--theme-card-bg, var(--white));
    margin-bottom: 0.75rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.alertas-list .alerta-item:last-child {
    margin-bottom: 0;
}

.alertas-list .alerta-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(15, 23, 42, 0.08);
}

.alertas-list .alerta-item.urgent {
    border-color: rgba(239, 68, 68, 0.35);
    background: rgba(239, 68, 68, 0.08);
}

.alertas-list .alerta-icon {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: rgba(var(--primary-r), var(--primary-g), var(--primary-b), 0.12);
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.alertas-list .alerta-item.urgent .alerta-icon {
    background: rgba(239, 68, 68, 0.18);
    color: #dc2626;
}

.alertas-list .alerta-info h6 {
    margin: 0;
    font-weight: 600;
    color: var(--theme-text-primary, var(--secondary-color));
}

.alertas-list .alerta-info p {
    margin: 0;
    font-size: 0.85rem;
    color: var(--theme-text-secondary, var(--gray-500));
}

.alertas-list .btn {
    white-space: nowrap;
}

.planos-detalhes-container,
.pacote-detalhes-container {
    min-height: 160px;
}

.planos-detalhes-container .loading-state,
.pacote-detalhes-container .loading-state {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    color: var(--theme-text-secondary, var(--gray-500));
    font-size: 0.95rem;
}

.plano-detalhes-container .status-badge {
    margin-top: 0.5rem;
}
/* Tabela de Pacotes */
.pacotes-table-card {
    background: var(--theme-card-bg, var(--white));
    border: 1px solid var(--theme-border-color, var(--gray-200));
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.pacotes-table-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

.pacotes-table-card .table-header {
    padding: 1.5rem 2rem;
    border-bottom: 2px solid var(--theme-border-color, var(--gray-200));
    background: linear-gradient(135deg, var(--theme-bg-secondary, var(--gray-50)), var(--theme-card-bg, var(--white)));
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
}

.pacotes-table-card .table-header::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary-color), transparent);
    opacity: 0.3;
}

.pacotes-table-card .table-header h5 {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--theme-text-primary, var(--secondary-color));
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.pacotes-table-card .table-header h5 i {
    color: var(--primary-color);
}

.pacotes-table-card .table-responsive {
    overflow-x: auto;
}

.pacotes-table {
    margin: 0;
    width: 100%;
}

.pacotes-table thead {
    background: var(--theme-bg-secondary, var(--gray-50));
}

.pacotes-table thead th {
    padding: 1rem 1.5rem;
    font-size: 0.813rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--theme-text-secondary, var(--gray-600));
    border: none;
}

.pacotes-table tbody tr {
    border-bottom: 1px solid var(--theme-border-color, var(--gray-200));
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.pacotes-table tbody tr::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--primary-color);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.pacotes-table tbody tr:hover {
    background: var(--theme-card-bg-hover, rgba(0, 0, 0, 0.02));
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transform: translateX(2px);
}

.pacotes-table tbody tr:hover::before {
    opacity: 1;
}

.pacotes-table tbody td {
    padding: 1.25rem 1.5rem;
    color: var(--theme-text-primary, var(--secondary-color));
    vertical-align: middle;
}

.pacotes-table .cliente-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.pacotes-table .cliente-avatar {
    width: 44px;
    height: 44px;
    aspect-ratio: 1/1;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.875rem;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(var(--primary-r), var(--primary-g), var(--primary-b), 0.3);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.pacotes-table .cliente-avatar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, transparent, rgba(255, 255, 255, 0.2));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.pacotes-table tbody tr:hover .cliente-avatar {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 6px 16px rgba(var(--primary-r), var(--primary-g), var(--primary-b), 0.4);
}

.pacotes-table tbody tr:hover .cliente-avatar::before {
    opacity: 1;
}

.pacotes-table .cliente-details h6 {
    margin: 0;
    font-size: 0.938rem;
    font-weight: 600;
    color: var(--theme-text-primary, var(--secondary-color));
}

.pacotes-table .cliente-details p {
    margin: 0;
    font-size: 0.813rem;
    color: var(--theme-text-secondary, var(--gray-600));
}

.pacotes-table .plano-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    border-radius: 10px;
    font-size: 0.813rem;
    font-weight: 600;
    background: var(--theme-bg-secondary, var(--gray-50));
    border: 1.5px solid var(--theme-border-color, var(--gray-200));
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.pacotes-table .plano-badge:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border-color: var(--primary-color);
}

.pacotes-table .plano-badge i {
    font-size: 1rem;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1));
}

.pacotes-table .tipo-badge {
    display: inline-block;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.pacotes-table .tipo-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 ease;
}

.pacotes-table .tipo-badge:hover::before {
    left: 100%;
}

.pacotes-table .tipo-badge.limitado {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(245, 158, 11, 0.08));
    color: #d97706;
    border: 1.5px solid rgba(245, 158, 11, 0.3);
    box-shadow: 0 2px 6px rgba(245, 158, 11, 0.15);
}

.pacotes-table .tipo-badge.limitado:hover {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(245, 158, 11, 0.12));
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.25);
}

.pacotes-table .tipo-badge.ilimitado {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(99, 102, 241, 0.08));
    color: #4f46e5;
    border: 1.5px solid rgba(99, 102, 241, 0.3);
    box-shadow: 0 2px 6px rgba(99, 102, 241, 0.15);
}

.pacotes-table .tipo-badge.ilimitado:hover {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(99, 102, 241, 0.12));
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.25);
}

.pacotes-table .creditos-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.pacotes-table .creditos-info .progress {
    flex: 1;
    height: 10px;
    background: var(--theme-bg-secondary, var(--gray-100));
    border-radius: 8px;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.06);
    position: relative;
}

.pacotes-table .creditos-info .progress::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.3), transparent);
    border-radius: 8px 8px 0 0;
}

.pacotes-table .creditos-info .progress-bar {
    background: linear-gradient(90deg, var(--primary-color), var(--primary-dark));
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    box-shadow: 0 2px 6px rgba(var(--primary-r), var(--primary-g), var(--primary-b), 0.3);
}

.pacotes-table .creditos-info .progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.pacotes-table .creditos-text {
    font-size: 0.813rem;
    font-weight: 600;
    color: var(--theme-text-primary, var(--secondary-color));
    white-space: nowrap;
}

.pacotes-table .validade-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.pacotes-table .validade-date {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--theme-text-primary, var(--secondary-color));
}

.pacotes-table .validade-days {
    font-size: 0.75rem;
    color: var(--theme-text-secondary, var(--gray-600));
}

.pacotes-table .status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 1rem;
    border-radius: 24px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.pacotes-table .status-badge::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(1.3); }
}

.pacotes-table .status-badge.ativo {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(16, 185, 129, 0.08));
    color: #059669;
    border: 1.5px solid rgba(16, 185, 129, 0.3);
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.2);
}

.pacotes-table .status-badge.ativo:hover {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(16, 185, 129, 0.12));
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.pacotes-table .status-badge.vencendo {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(245, 158, 11, 0.08));
    color: #d97706;
    border: 1.5px solid rgba(245, 158, 11, 0.3);
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.2);
}

.pacotes-table .status-badge.vencendo:hover {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(245, 158, 11, 0.12));
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.pacotes-table .status-badge.vencido {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.15), rgba(239, 68, 68, 0.08));
    color: #dc2626;
    border: 1.5px solid rgba(239, 68, 68, 0.3);
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.2);
}

.pacotes-table .status-badge.vencido:hover {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.2), rgba(239, 68, 68, 0.12));
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.pacotes-table .status-badge.cancelado {
    background: linear-gradient(135deg, rgba(107, 114, 128, 0.15), rgba(107, 114, 128, 0.08));
    color: #4b5563;
    border: 1.5px solid rgba(107, 114, 128, 0.3);
    box-shadow: 0 2px 8px rgba(107, 114, 128, 0.2);
}

.pacotes-table .status-badge.cancelado:hover {
    background: linear-gradient(135deg, rgba(107, 114, 128, 0.2), rgba(107, 114, 128, 0.12));
    box-shadow: 0 4px 12px rgba(107, 114, 128, 0.3);
}

.pacotes-table .status-badge.cancelado::before {
    animation: none;
    opacity: 0.5;
}

.pacotes-table .valor-info {
    font-size: 1rem;
    font-weight: 700;
    color: var(--theme-text-primary, var(--secondary-color));
}

.pacotes-table .valor-info small {
    display: block;
    font-size: 0.75rem;
    font-weight: 400;
    color: var(--theme-text-secondary, var(--gray-600));
}

.pacotes-table .table-actions {
    display: flex;
    gap: 0.5rem;
}

.pacotes-table .btn-action {
    width: 36px;
    height: 36px;
    padding: 0;
    border: 1.5px solid var(--theme-border-color, var(--gray-200));
    background: var(--theme-card-bg, var(--white));
    color: var(--theme-text-secondary, var(--gray-600));
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
}

.pacotes-table .btn-action::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(var(--primary-r), var(--primary-g), var(--primary-b), 0.1);
    transform: translate(-50%, -50%);
    transition: width 0.4s ease, height 0.4s ease;
}

.pacotes-table .btn-action:hover::before {
    width: 100%;
    height: 100%;
}

.pacotes-table .btn-action:hover {
    background: var(--theme-card-bg-hover, rgba(0, 0, 0, 0.02));
    color: var(--primary-color);
    border-color: var(--primary-color);
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 4px 12px rgba(var(--primary-r), var(--primary-g), var(--primary-b), 0.2);
}

.pacotes-table .btn-action.danger::before {
    background: rgba(239, 68, 68, 0.1);
}

.pacotes-table .btn-action.danger:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border-color: #ef4444;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.25);
}

.pacotes-table .btn-action i {
    position: relative;
    z-index: 1;
    transition: transform 0.3s ease;
}

.pacotes-table .btn-action:hover i {
    transform: scale(1.1);
}

/* Footer da Tabela */
.pacotes-table-card .table-footer {
    padding: 1.25rem 1.5rem;
    border-top: 1px solid var(--theme-border-color, var(--gray-200));
    background: var(--theme-bg-secondary, var(--gray-50));
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.pacotes-table-card .table-info {
    font-size: 0.875rem;
    color: var(--theme-text-secondary, var(--gray-600));
}

.pacotes-table-card .pagination {
    margin: 0;
    gap: 0.5rem;
}

.pacotes-table-card .page-item .page-link {
    background: var(--theme-card-bg, var(--white));
    border: 1px solid var(--theme-border-color, var(--gray-200));
    color: var(--theme-text-primary, var(--secondary-color));
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
}

.pacotes-table-card .page-item.active .page-link {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
}

.pacotes-table-card .page-item .page-link:hover {
    background: var(--theme-card-bg-hover, rgba(0, 0, 0, 0.02));
    border-color: var(--primary-color);
}

/* Cards de Análise */
.analysis-card {
    background: var(--theme-card-bg, var(--white));
    border: 1px solid var(--theme-border-color, var(--gray-200));
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.analysis-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-dark));
    opacity: 0;
    transition: opacity 0.4s ease;
}

.analysis-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
}

.analysis-card:hover::before {
    opacity: 1;
}

.analysis-card .card-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--theme-border-color, var(--gray-200));
    background: var(--theme-bg-secondary, var(--gray-50));
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.analysis-card .card-header h5 {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--theme-text-primary, var(--secondary-color));
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.analysis-card .card-header h5 i {
    color: var(--primary-color);
}

.analysis-card .card-content {
    padding: 1.5rem;
    background: var(--theme-card-bg, var(--white));
}

/* Ranking de Planos */
.planos-ranking .ranking-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border-radius: 8px;
    background: var(--theme-bg-secondary, var(--gray-50));
    margin-bottom: 0.75rem;
    transition: all 0.2s ease;
}

.planos-ranking .ranking-item:last-child {
    margin-bottom: 0;
}

.planos-ranking .ranking-item:hover {
    background: var(--theme-card-bg-hover, rgba(0, 0, 0, 0.02));
    transform: translateX(4px);
}

.planos-ranking .ranking-position {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.125rem;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}

.planos-ranking .ranking-position.gold {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    box-shadow: 0 6px 20px rgba(251, 191, 36, 0.4), inset 0 2px 4px rgba(255, 255, 255, 0.3);
    position: relative;
    animation: pulse-gold 2s ease-in-out infinite;
}

.planos-ranking .ranking-position.gold::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.4), transparent);
}

@keyframes pulse-gold {
    0%, 100% { box-shadow: 0 6px 20px rgba(251, 191, 36, 0.4), inset 0 2px 4px rgba(255, 255, 255, 0.3); }
    50% { box-shadow: 0 8px 28px rgba(251, 191, 36, 0.6), inset 0 2px 4px rgba(255, 255, 255, 0.3); }
}

.planos-ranking .ranking-position.silver {
    background: linear-gradient(135deg, #d1d5db, #9ca3af);
    box-shadow: 0 6px 20px rgba(156, 163, 175, 0.4), inset 0 2px 4px rgba(255, 255, 255, 0.3);
    position: relative;
}

.planos-ranking .ranking-position.silver::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.4), transparent);
}

.planos-ranking .ranking-position.bronze {
    background: linear-gradient(135deg, #d97706, #b45309);
    box-shadow: 0 6px 20px rgba(205, 127, 50, 0.4), inset 0 2px 4px rgba(255, 255, 255, 0.2);
    position: relative;
}

.planos-ranking .ranking-position.bronze::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.3), transparent);
}

.planos-ranking .plano-info {
    flex: 1;
}

.planos-ranking .plano-info h6 {
    margin: 0 0 0.25rem 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--theme-text-primary, var(--secondary-color));
}

.planos-ranking .plano-info p {
    margin: 0;
    font-size: 0.813rem;
    color: var(--theme-text-secondary, var(--gray-600));
}

.planos-ranking .plano-stats {
    text-align: right;
}

.planos-ranking .plano-stats .stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--theme-text-primary, var(--secondary-color));
}

.planos-ranking .plano-stats .stat-label {
    display: block;
    font-size: 0.75rem;
    color: var(--theme-text-secondary, var(--gray-600));
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Promoções */
.promocoes-list .promocao-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid var(--theme-border-color, var(--gray-200));
    background: var(--theme-card-bg, var(--white));
    margin-bottom: 0.75rem;
    transition: all 0.2s ease;
}

.promocoes-list .promocao-item:last-child {
    margin-bottom: 0;
}

.promocoes-list .promocao-item:hover {
    background: var(--theme-card-bg-hover, rgba(0, 0, 0, 0.02));
    border-color: var(--primary-color);
}

.promocoes-list .promocao-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    background: linear-gradient(135deg, rgba(var(--primary-r), var(--primary-g), var(--primary-b), 0.1), rgba(var(--primary-r), var(--primary-g), var(--primary-b), 0.05));
    color: var(--primary-color);
    flex-shrink: 0;
}

.promocoes-list .promocao-info {
    flex: 1;
}

.promocoes-list .promocao-info h6 {
    margin: 0 0 0.25rem 0;
    font-size: 0.938rem;
    font-weight: 600;
    color: var(--theme-text-primary, var(--secondary-color));
}

.promocoes-list .promocao-info p {
    margin: 0;
    font-size: 0.813rem;
    color: var(--theme-text-secondary, var(--gray-600));
}

/* Alertas */
.alert-card {
    background: var(--theme-card-bg, var(--white));
    border: 1px solid var(--theme-border-color, var(--gray-200));
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
}

.alert-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.alert-card.warning {
    border-top: 3px solid #f59e0b;
}

.alert-card .card-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--theme-border-color, var(--gray-200));
    background: var(--theme-bg-secondary, var(--gray-50));
}

.alert-card .card-header h5 {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--theme-text-primary, var(--secondary-color));
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.alert-card .card-header h5 i {
    color: #f59e0b;
}

.alert-card .card-content {
    padding: 1.5rem;
    background: var(--theme-card-bg, var(--white));
}

.alertas-list .alerta-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid var(--theme-border-color, var(--gray-200));
    background: var(--theme-card-bg, var(--white));
    margin-bottom: 0.75rem;
}

.alertas-list .alerta-item:last-child {
    margin-bottom: 0;
}

.alertas-list .alerta-item.urgent {
    background: rgba(239, 68, 68, 0.05);
    border-color: rgba(239, 68, 68, 0.2);
}

.alertas-list .alerta-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
    flex-shrink: 0;
}

.alertas-list .alerta-info {
    flex: 1;
}

.alertas-list .alerta-info h6 {
    margin: 0 0 0.25rem 0;
    font-size: 0.938rem;
    font-weight: 600;
    color: var(--theme-text-primary, var(--secondary-color));
}

.alertas-list .alerta-info p {
    margin: 0;
    font-size: 0.813rem;
    color: var(--theme-text-secondary, var(--gray-600));
}

.alert-card .alert-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--theme-border-color, var(--gray-200));
    background: var(--theme-bg-secondary, var(--gray-50));
    text-align: center;
}

/* Regras */
.rules-card {
    background: var(--theme-card-bg, var(--white));
    border: 1px solid var(--theme-border-color, var(--gray-200));
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
}

.rules-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.rules-card .card-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--theme-border-color, var(--gray-200));
    background: var(--theme-bg-secondary, var(--gray-50));
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.rules-card .card-header h5 {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--theme-text-primary, var(--secondary-color));
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.rules-card .card-header h5 i {
    color: var(--primary-color);
}

.rules-card .card-content {
    padding: 1.5rem;
    background: var(--theme-card-bg, var(--white));
}

.rules-list .rule-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem 0;
    border-bottom: 1px solid var(--theme-border-color, var(--gray-200));
}

.rules-list .rule-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.rules-list .rule-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(var(--primary-r), var(--primary-g), var(--primary-b), 0.1), rgba(var(--primary-r), var(--primary-g), var(--primary-b), 0.05));
    color: var(--primary-color);
    flex-shrink: 0;
}

.rules-list .rule-info h6 {
    margin: 0 0 0.25rem 0;
    font-size: 0.938rem;
    font-weight: 600;
    color: var(--theme-text-primary, var(--secondary-color));
}

.rules-list .rule-info p {
    margin: 0;
    font-size: 0.813rem;
    color: var(--theme-text-secondary, var(--gray-600));
}

/* Modal Customization - Removido para usar Bootstrap padrão */

/* Timeline do Histórico */
.historico-timeline {
    position: relative;
    padding-left: 2rem;
}

.historico-timeline::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--theme-border-color, var(--gray-200));
}

.historico-timeline .timeline-item {
    position: relative;
    padding-bottom: 1.5rem;
}

.historico-timeline .timeline-item:last-child {
    padding-bottom: 0;
}

.historico-timeline .timeline-item::before {
    content: '';
    position: absolute;
    left: -1.5rem;
    top: 0;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--primary-color);
    border: 3px solid var(--theme-card-bg, var(--white));
}

.historico-timeline .timeline-content {
    padding: 1rem;
    background: var(--theme-bg-secondary, var(--gray-50));
    border-radius: 8px;
    border: 1px solid var(--theme-border-color, var(--gray-200));
}

.historico-timeline .timeline-date {
    font-size: 0.75rem;
    color: var(--theme-text-secondary, var(--gray-600));
    margin-bottom: 0.5rem;
}

.historico-timeline .timeline-title {
    font-size: 0.938rem;
    font-weight: 600;
    color: var(--theme-text-primary, var(--secondary-color));
    margin: 0 0 0.25rem 0;
}

.historico-timeline .timeline-description {
    font-size: 0.813rem;
    color: var(--theme-text-secondary, var(--gray-600));
    margin: 0;
}

/* Responsividade */
@media (max-width: 768px) {
    .pacotes-table-card .table-footer {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }

    .pacotes-table thead {
        display: none;
    }

    .pacotes-table tbody tr {
        display: block;
        margin-bottom: 1rem;
        border: 1px solid var(--theme-border-color, var(--gray-200));
        border-radius: 8px;
        padding: 1rem;
        background: var(--theme-card-bg, var(--white));
    }

    .pacotes-table tbody td {
        display: flex;
        justify-content: space-between;
        padding: 0.5rem 0;
        border: none;
    }

    .pacotes-table tbody td::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--theme-text-secondary, var(--gray-600));
    }

    .planos-ranking .ranking-item,
    .promocoes-list .promocao-item,
    .alertas-list .alerta-item {
        flex-direction: column;
        text-align: center;
    }

    .planos-ranking .plano-stats {
        text-align: center;
    }
}

/* Dark Mode Enhancements */
[data-theme="dark"] .pacotes-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .pacotes-kpis .kpi-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .planos-ranking .ranking-item:hover,
[data-theme="dark"] .promocoes-list .promocao-item:hover,
[data-theme="dark"] .alertas-list .alerta-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .analysis-card:hover,
[data-theme="dark"] .alert-card:hover,
[data-theme="dark"] .rules-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

/* ========================================
   PLAN SUMMARY - RESUMO DO PLANO NO MODAL
   ======================================== */

.plan-summary {
    background: var(--theme-card-bg, var(--white));
    border: 1px solid var(--theme-border-color, var(--gray-200));
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1rem;
}

.plan-summary .summary-placeholder {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    text-align: center;
    color: var(--theme-text-secondary, var(--gray-600));
    font-size: 0.9rem;
}

.plan-summary .summary-placeholder i {
    font-size: 1.25rem;
    color: var(--primary-color);
}

.plan-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.25rem;
}

.summary-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.summary-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--theme-text-secondary, var(--gray-600));
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.summary-item strong {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--theme-text-primary, var(--gray-900));
}

.summary-hint {
    font-size: 0.75rem;
    color: var(--theme-text-tertiary, var(--gray-500));
    font-style: italic;
    margin-top: -0.25rem;
}

.summary-action {
    font-size: 0.85rem;
    padding: 0.25rem 0;
    text-decoration: none;
    color: var(--primary-color);
    font-weight: 500;
    transition: all 0.2s ease;
}

.summary-action:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

.summary-input {
    margin-top: 0.5rem;
    padding: 0.75rem;
    background: var(--theme-bg-alt, var(--gray-50));
    border-radius: 8px;
}

.summary-input .input-group {
    margin-bottom: 0.5rem;
}

.summary-input small {
    display: block;
    margin-top: 0.25rem;
}

/* Dark Mode para Plan Summary */
[data-theme="dark"] .plan-summary {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .summary-input {
    background: rgba(0, 0, 0, 0.2);
}

/* Responsividade */
@media (max-width: 768px) {
    .plan-summary-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

/* ========================================
   LINHAS EXPANSÍVEIS - VISUALIZAR E HISTÓRICO
   ======================================== */

/* Linha expansível que aparece abaixo do pacote */
.expandable-row {
    display: none;
    background: var(--theme-bg-secondary, var(--gray-50));
    border-left: 4px solid var(--primary-color);
}

.expandable-row.expanded {
    display: table-row;
    animation: expandRow 0.3s ease-out;
}

@keyframes expandRow {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.expandable-row td {
    padding: 0 !important;
    border: none !important;
}

.expandable-content {
    padding: 2rem;
    background: var(--theme-card-bg, var(--white));
    border: 1px solid var(--theme-border-color, var(--gray-200));
    border-radius: 12px;
    margin: 0.5rem 1rem 1rem 1rem;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.04);
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
        padding-top: 0;
        padding-bottom: 0;
    }
    to {
        opacity: 1;
        max-height: 800px;
        padding-top: 2rem;
        padding-bottom: 2rem;
    }
}

.expandable-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--theme-border-color, var(--gray-200));
}

.expandable-header h5 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--theme-text-primary, var(--secondary-color));
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.expandable-header h5 i {
    color: var(--primary-color);
    font-size: 1.5rem;
}

.btn-close-expand {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid var(--theme-border-color, var(--gray-300));
    background: var(--theme-card-bg, var(--white));
    color: var(--theme-text-secondary, var(--gray-600));
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1.25rem;
}

.btn-close-expand:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: #ef4444;
    color: #ef4444;
    transform: rotate(90deg);
}

/* Grid de detalhes do pacote */
.detalhes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

.detalhe-item {
    background: var(--theme-bg-secondary, var(--gray-50));
    border-radius: 12px;
    padding: 1.25rem;
    border: 1px solid var(--theme-border-color, var(--gray-200));
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.detalhe-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--primary-color);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.detalhe-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border-color: var(--primary-color);
}

.detalhe-item:hover::before {
    opacity: 1;
}

.detalhe-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 700;
    color: var(--theme-text-tertiary, var(--gray-500));
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.detalhe-label i {
    color: var(--primary-color);
    font-size: 0.875rem;
}

.detalhe-valor {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--theme-text-primary, var(--secondary-color));
    word-break: break-word;
}

.detalhe-valor small {
    display: block;
    font-size: 0.875rem;
    font-weight: 400;
    color: var(--theme-text-secondary, var(--gray-600));
    margin-top: 0.25rem;
}

/* Timeline do histórico */
.historico-expandable {
    max-height: 500px;
    overflow-y: auto;
    padding-right: 0.5rem;
}

.historico-expandable::-webkit-scrollbar {
    width: 6px;
}

.historico-expandable::-webkit-scrollbar-track {
    background: var(--theme-bg-secondary, var(--gray-100));
    border-radius: 10px;
}

.historico-expandable::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 10px;
}

.historico-expandable::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

.timeline-expandable {
    position: relative;
    padding-left: 2rem;
}

.timeline-expandable::before {
    content: '';
    position: absolute;
    left: 7px;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(180deg, var(--primary-color), var(--primary-light));
    border-radius: 10px;
}

.timeline-event {
    position: relative;
    padding-bottom: 2rem;
    animation: fadeInUp 0.4s ease-out backwards;
}

.timeline-event:nth-child(1) { animation-delay: 0.1s; }
.timeline-event:nth-child(2) { animation-delay: 0.2s; }
.timeline-event:nth-child(3) { animation-delay: 0.3s; }
.timeline-event:nth-child(4) { animation-delay: 0.4s; }
.timeline-event:nth-child(5) { animation-delay: 0.5s; }

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.timeline-event:last-child {
    padding-bottom: 0;
}

.timeline-event::before {
    content: '';
    position: absolute;
    left: -1.5rem;
    top: 0;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--primary-color);
    border: 3px solid var(--theme-card-bg, var(--white));
    box-shadow: 0 0 0 3px rgba(var(--primary-r), var(--primary-g), var(--primary-b), 0.2);
    transition: all 0.3s ease;
}

.timeline-event:hover::before {
    transform: scale(1.3);
    box-shadow: 0 0 0 6px rgba(var(--primary-r), var(--primary-g), var(--primary-b), 0.3);
}

.timeline-event-content {
    padding: 1.25rem;
    background: var(--theme-bg-secondary, var(--gray-50));
    border-radius: 12px;
    border: 1px solid var(--theme-border-color, var(--gray-200));
    transition: all 0.3s ease;
    position: relative;
}

.timeline-event:hover .timeline-event-content {
    transform: translateX(5px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border-color: var(--primary-color);
}

.timeline-event-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 0.75rem;
    gap: 1rem;
}

.timeline-event-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--theme-text-primary, var(--secondary-color));
    margin: 0;
    flex: 1;
}

.timeline-event-date {
    font-size: 0.75rem;
    color: var(--theme-text-tertiary, var(--gray-500));
    white-space: nowrap;
    padding: 0.25rem 0.75rem;
    background: var(--theme-card-bg, var(--white));
    border-radius: 20px;
    border: 1px solid var(--theme-border-color, var(--gray-200));
}

.timeline-event-description {
    font-size: 0.875rem;
    color: var(--theme-text-secondary, var(--gray-600));
    margin: 0;
    line-height: 1.6;
}

.timeline-event-icon {
    display: inline-flex;
    width: 28px;
    height: 28px;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(var(--primary-r), var(--primary-g), var(--primary-b), 0.1);
    color: var(--primary-color);
    margin-right: 0.5rem;
    font-size: 0.875rem;
}

/* Estado vazio */
.empty-expandable {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--theme-text-secondary, var(--gray-500));
}

.empty-expandable i {
    font-size: 3rem;
    color: var(--theme-text-tertiary, var(--gray-400));
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-expandable h6 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--theme-text-secondary, var(--gray-600));
    margin-bottom: 0.5rem;
}

.empty-expandable p {
    font-size: 0.875rem;
    color: var(--theme-text-tertiary, var(--gray-500));
    margin: 0;
}

/* Indicador visual que a linha está expandida */
tr.row-expanded {
    background: rgba(var(--primary-r), var(--primary-g), var(--primary-b), 0.05);
    border-left: 4px solid var(--primary-color);
}

tr.row-expanded td:first-child {
    border-left: 4px solid var(--primary-color);
}

/* Ícone de expandir nos botões */
.btn-acao.expanded {
    background: var(--primary-color) !important;
    color: white !important;
    border-color: var(--primary-color) !important;
}

/* Loading state */
.loading-expandable {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 2rem;
    gap: 1rem;
}

.loading-expandable i {
    font-size: 2rem;
    color: var(--primary-color);
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.loading-expandable p {
    margin: 0;
    color: var(--theme-text-secondary, var(--gray-600));
    font-size: 0.875rem;
}

/* Dark mode */
[data-theme="dark"] .expandable-content {
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] .timeline-event-content {
    background: rgba(255, 255, 255, 0.03);
}

[data-theme="dark"] .timeline-event:hover .timeline-event-content {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Responsividade */
@media (max-width: 768px) {
    .expandable-content {
        padding: 1.5rem 1rem;
        margin: 0.5rem 0.5rem 1rem 0.5rem;
    }

    .detalhes-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .expandable-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .timeline-event-header {
        flex-direction: column;
        gap: 0.5rem;
    }

    .timeline-event-date {
        align-self: flex-start;
    }
}

/* ========================================
   FORMULÁRIOS EXPANSÍVEIS - EDIÇÃO INLINE
   ======================================== */

.expandable-form {
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.expandable-form .form-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--theme-text-secondary, var(--gray-600));
    margin-bottom: 0.5rem;
}

.expandable-form .form-control,
.expandable-form .form-select {
    background: var(--theme-input-bg, var(--white));
    border: 1.5px solid var(--theme-border-color, var(--gray-200));
    color: var(--theme-text-primary, var(--secondary-color));
    padding: 0.625rem 0.875rem;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.expandable-form .form-control:focus,
.expandable-form .form-select:focus {
    background: var(--theme-input-bg, var(--white));
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(var(--primary-r), var(--primary-g), var(--primary-b), 0.1);
    outline: none;
}

.expandable-form .form-control:hover,
.expandable-form .form-select:hover {
    border-color: var(--primary-color);
}

.expandable-form textarea.form-control {
    resize: vertical;
    min-height: 60px;
}

.expandable-form .form-control-color {
    width: 100%;
    height: 45px;
    padding: 4px;
    border-radius: 8px;
    cursor: pointer;
}

.expandable-form-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 2px solid var(--theme-border-color, var(--gray-200));
}

.expandable-form-actions .btn {
    padding: 0.625rem 1.5rem;
    font-weight: 600;
    border-radius: 8px;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.expandable-form-actions .btn-secondary {
    background: var(--theme-bg-secondary, var(--gray-100));
    color: var(--theme-text-secondary, var(--gray-700));
    border: 1.5px solid var(--theme-border-color, var(--gray-300));
}

.expandable-form-actions .btn-secondary:hover {
    background: var(--theme-bg-tertiary, var(--gray-200));
    border-color: var(--theme-text-secondary, var(--gray-400));
    transform: translateY(-1px);
}

.expandable-form-actions .btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    border: none;
    box-shadow: 0 4px 12px rgba(var(--primary-r), var(--primary-g), var(--primary-b), 0.3);
}

.expandable-form-actions .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(var(--primary-r), var(--primary-g), var(--primary-b), 0.4);
}

.expandable-form-actions .btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Validação de formulário */
.expandable-form .form-control:invalid {
    border-color: #ef4444;
}

.expandable-form .form-control:valid {
    border-color: var(--theme-border-color, var(--gray-200));
}

/* Dark mode para formulários */
[data-theme="dark"] .expandable-form .form-control,
[data-theme="dark"] .expandable-form .form-select {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
    color: var(--theme-text-primary, #fff);
}

[data-theme="dark"] .expandable-form .form-control:focus,
[data-theme="dark"] .expandable-form .form-select:focus {
    background: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .expandable-form-actions .btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--theme-text-primary, #fff);
    border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .expandable-form-actions .btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Responsividade para formulários */
@media (max-width: 768px) {
    .expandable-form-actions {
        flex-direction: column;
        gap: 0.5rem;
    }

    .expandable-form-actions .btn {
        width: 100%;
        justify-content: center;
    }
}

/* Overlay de configuração Pagar.me */
.pagarme-guard {
    position: relative;
}

.pagarme-overlay {
    position: absolute;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(14, 116, 144, 0.06);
    backdrop-filter: blur(4px);
    z-index: 20;
}

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

.pagarme-overlay-card {
    background: #0f766e;
    color: #fff;
    padding: 24px;
    border-radius: 16px;
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.12);
    max-width: 620px;
    width: 100%;
    text-align: left;
}

.pagarme-overlay-card h4 {
    margin-top: 8px;
    margin-bottom: 10px;
    font-weight: 700;
}

.pagarme-overlay-card p {
    margin-bottom: 16px;
    color: rgba(255, 255, 255, 0.9);
}

.pagarme-overlay-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.pagarme-chip {
    display: inline-block;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.14);
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
}

.pagarme-webhook-box {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.12);
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 13px;
    color: #e0f2f1;
}

.pagarme-webhook-box code {
    color: #fff;
    background: transparent;
    padding: 0;
}
