/* ====================================
   FINANCEIRO - CSS PERSONALIZADO
   ==================================== */

/* Container Principal */
.financial-summary-section {
    margin-bottom: 2rem;
}

/* Cards de Resumo Financeiro */
.financial-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 1.5rem;
    height: 100%;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.financial-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-hover));
    border-radius: 16px 16px 0 0;
}

.financial-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);
}

.financial-card .card-header {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.financial-card .card-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 12px;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.revenue-card .card-icon {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.expense-card .card-icon {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.profit-card .card-icon {
    background: rgba(99, 102, 241, 0.1);
    color: #6366f1;
}

.margin-card .card-icon {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
}

.financial-card .card-info {
    flex: 1;
}

.financial-card .card-title {
    font-size: 0.875rem;
    font-weight: 500;
    color: #6b7280;
    margin-bottom: 0.5rem;
}

.financial-card .card-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 0.5rem;
}

.financial-card .card-change {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.875rem;
    font-weight: 500;
}

.card-change.positive {
    color: #10b981;
}

.card-change.negative {
    color: #ef4444;
}

/* =======================================
   CUSTOM TABS - SELETORES PERSONALIZADOS
   ======================================= */

.custom-financial-tabs-section {
    margin-bottom: 2rem;
}

.custom-tabs-container {
    display: flex;
    gap: 1rem;
    background: #ffffff;
    padding: 1rem;
    border-radius: 20px;
    box-shadow:
        0 10px 25px -5px rgba(0, 0, 0, 0.1),
        0 8px 10px -6px rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e7eb;
    overflow-x: auto;
    position: relative;
}

.custom-tab-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1.25rem;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: #f8f9fa;
    border: 2px solid transparent;
    min-width: 140px;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}

.custom-tab-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg,
        rgba(var(--primary-r), var(--primary-g), var(--primary-b), 0.05) 0%,
        rgba(var(--primary-r), var(--primary-g), var(--primary-b), 0.02) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.custom-tab-item:hover::before {
    opacity: 1;
}

.custom-tab-item:hover {
    transform: translateY(-2px);
    box-shadow:
        0 8px 25px -5px rgba(var(--primary-r), var(--primary-g), var(--primary-b), 0.15),
        0 8px 10px -6px rgba(var(--primary-r), var(--primary-g), var(--primary-b), 0.1);
    border-color: rgba(var(--primary-r), var(--primary-g), var(--primary-b), 0.2);
}

.custom-tab-item.active {
    background: linear-gradient(135deg,
        var(--primary-color) 0%,
        var(--primary-hover) 100%);
    color: white;
    border-color: var(--primary-color);
    box-shadow:
        0 8px 25px -5px rgba(var(--primary-r), var(--primary-g), var(--primary-b), 0.3),
        0 8px 10px -6px rgba(var(--primary-r), var(--primary-g), var(--primary-b), 0.2);
    transform: translateY(-1px);
}

.custom-tab-item.active::before {
    opacity: 0;
}

.custom-tab-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.8);
    color: var(--primary-color);
    font-size: 1.125rem;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.custom-tab-item.active .custom-tab-icon {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.3);
}

.custom-tab-content {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
    text-align: left;
}

.custom-tab-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: #1f2937;
    transition: color 0.3s ease;
    line-height: 1.2;
}

.custom-tab-subtitle {
    font-size: 0.75rem;
    font-weight: 400;
    color: #6b7280;
    transition: color 0.3s ease;
    line-height: 1.2;
}

.custom-tab-item.active .custom-tab-title,
.custom-tab-item.active .custom-tab-subtitle {
    color: white;
}

.custom-tab-item:hover .custom-tab-title {
    color: var(--primary-color);
}

.custom-tab-item:hover .custom-tab-subtitle {
    color: var(--primary-hover);
}

.custom-tab-item.active:hover .custom-tab-title,
.custom-tab-item.active:hover .custom-tab-subtitle {
    color: white;
}

/* Cards de Seção */
.financial-section-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    height: 100%;
    position: relative;
    z-index: 1;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem;
    border-bottom: 1px solid #e5e7eb;
    background: #f9fafb;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    font-size: 1.125rem;
    font-weight: 600;
    color: #1f2937;
}

.section-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.section-body {
    padding: 1.5rem;
    min-height: 400px;
}

/* Lista de Contas */
.accounts-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.account-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    transition: all 0.3s ease;
}

.account-item:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    background: #ffffff;
}

.account-info {
    flex: 1;
}

.account-description {
    font-weight: 500;
    color: #1f2937;
    margin-bottom: 0.25rem;
}

.account-details {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.875rem;
    color: #6b7280;
}

.account-value {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.account-due-date {
    font-size: 0.875rem;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    font-weight: 500;
}

.due-today {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
}

.due-soon {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.due-normal {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

/* Gráfico de Fluxo de Caixa */
.cashflow-chart-container {
    height: 400px;
    padding: 1rem;
}

/* Lista de NFS-e */
.nfse-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.nfse-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    transition: all 0.3s ease;
}

.nfse-item:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    background: #ffffff;
}

.nfse-info {
    flex: 1;
}

.nfse-number {
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 0.25rem;
}

.nfse-details {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.875rem;
    color: #6b7280;
}

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

/* DRE (Demonstrativo de Resultado) */
.dre-content {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.dre-section {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.dre-section-header {
    padding: 1rem 1.5rem;
    background: var(--primary-color);
    color: white;
    font-weight: 600;
}

.dre-section-body {
    padding: 1.5rem;
}

.dre-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid #e5e7eb;
}

.dre-item:last-child {
    border-bottom: none;
    font-weight: 600;
    font-size: 1.125rem;
}

.dre-label {
    color: #1f2937;
}

.dre-value {
    font-weight: 500;
    color: #1f2937;
}

.dre-value.positive {
    color: #10b981;
}

.dre-value.negative {
    color: #ef4444;
}

/* Comissões */
.commissions-content {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

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

.commission-summary-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.commission-summary-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 0.25rem;
}

.commission-summary-label {
    font-size: 0.875rem;
    color: #6b7280;
}

.professionals-commissions {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.professional-commission {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.professional-commission-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.professional-name {
    font-weight: 600;
    color: #1f2937;
}

.commission-percentage {
    background: var(--primary-color);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
}

.commission-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

.commission-detail {
    text-align: center;
}

.commission-detail-value {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1f2937;
}

.commission-detail-label {
    font-size: 0.875rem;
    color: #6b7280;
}

/* Formas de Pagamento */
.payment-methods-content {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.payment-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.payment-method-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.payment-method-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.payment-method-icon {
    font-size: 2rem;
    margin-bottom: 0.75rem;
}

.payment-method-card.cash .payment-method-icon {
    color: #10b981;
}

.payment-method-card.card .payment-method-icon {
    color: #6366f1;
}

.payment-method-card.pix .payment-method-icon {
    color: #f59e0b;
}

.payment-method-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 0.25rem;
}

.payment-method-label {
    font-size: 0.875rem;
    color: #6b7280;
    margin-bottom: 0.5rem;
}

.payment-method-transactions {
    font-size: 0.75rem;
    color: #9ca3af;
}

.payment-chart-container {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 1.5rem;
    height: 300px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* Estados Vazios */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1rem;
    text-align: center;
    color: #6b7280;
}

.empty-state-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state-text {
    font-size: 1.125rem;
    margin-bottom: 0.5rem;
}

.empty-state-description {
    font-size: 0.875rem;
    opacity: 0.7;
}

/* Custom Tabs - Responsive Design */
@media (max-width: 768px) {
    .custom-tabs-container {
        gap: 0.5rem;
        padding: 0.75rem;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
    }

    .custom-tab-item {
        min-width: 120px;
        padding: 0.75rem 1rem;
        scroll-snap-align: start;
    }

    .custom-tab-icon {
        width: 36px;
        height: 36px;
        font-size: 1rem;
    }

    .custom-tab-title {
        font-size: 0.8125rem;
    }

    .custom-tab-subtitle {
        font-size: 0.6875rem;
    }
}

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

    .section-controls {
        width: 100%;
        justify-content: flex-end;
    }

    .commission-details,
    .payment-summary {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    }

    .account-item,
    .nfse-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .account-details {
        flex-wrap: wrap;
    }
}

@media (max-width: 576px) {
    .financial-card .card-value {
        font-size: 1.5rem;
    }

    .section-body {
        padding: 1rem;
    }

    .commission-summary,
    .payment-summary {
        grid-template-columns: 1fr;
    }
}

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

.financial-card,
.financial-section-card {
    animation: slideInUp 0.3s ease-out;
}

.financial-card:nth-child(1) { animation-delay: 0.1s; }
.financial-card:nth-child(2) { animation-delay: 0.2s; }
.financial-card:nth-child(3) { animation-delay: 0.3s; }
.financial-card:nth-child(4) { animation-delay: 0.4s; }

/* Loading States */
.loading-skeleton {
    background: linear-gradient(90deg, var(--bg-secondary) 25%, rgba(var(--primary-r), var(--primary-g), var(--primary-b), 0.1) 50%, var(--bg-secondary) 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

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

/* Modo escuro ajustes específicos */
[data-theme="dark"] .financial-card::before {
    background: var(--primary-gradient);
    opacity: 0.8;
}

/* Custom Tabs - Tema Escuro */
[data-theme="dark"] .custom-tabs-container {
    background: rgba(37, 37, 37, 0.9);
    border-color: #404040;
    backdrop-filter: blur(10px);
}

[data-theme="dark"] .custom-tab-item {
    background: rgba(45, 45, 45, 0.8);
    border-color: transparent;
}

[data-theme="dark"] .custom-tab-item:hover {
    background: rgba(55, 55, 55, 0.9);
    border-color: rgba(var(--primary-r), var(--primary-g), var(--primary-b), 0.3);
}

[data-theme="dark"] .custom-tab-item.active {
    background: linear-gradient(135deg,
        var(--primary-color) 0%,
        var(--primary-hover) 100%);
}

[data-theme="dark"] .custom-tab-icon {
    background: rgba(255, 255, 255, 0.1);
    color: var(--primary-color);
}

[data-theme="dark"] .custom-tab-item.active .custom-tab-icon {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

[data-theme="dark"] .custom-tab-title {
    color: #e5e7eb;
}

[data-theme="dark"] .custom-tab-subtitle {
    color: #9ca3af;
}

[data-theme="dark"] .custom-tab-item:hover .custom-tab-title {
    color: var(--primary-color);
}

[data-theme="dark"] .custom-tab-item:hover .custom-tab-subtitle {
    color: var(--primary-hover);
}

[data-theme="dark"] .payment-method-card,
[data-theme="dark"] .commission-summary-card,
[data-theme="dark"] .dre-section {
    background: rgba(var(--bg-secondary-rgb), 0.8);
    backdrop-filter: blur(10px);
}