/* ==============================================================================
   MÓDULO: FLUXO DE CAIXA OPERACIONAL & FINANCEIRO (MODULAR)
   Estilo Executivo de Alta Fidelidade (FinTech / Dashboard Corporativo)
============================================================================== */

.fc-container {
    padding: 24px 32px;
    background-color: #f8fafc;
    min-height: calc(100vh - 64px);
    box-sizing: border-box;
    font-family: var(--font-primary, 'Plus Jakarta Sans', sans-serif);
}

/* Header do Fluxo de Caixa */
.fc-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 16px;
}

.fc-brand {
    display: flex;
    align-items: center;
    gap: 14px;
}

.fc-brand-icon {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    box-shadow: 0 4px 10px rgba(2, 132, 199, 0.25);
}

.fc-brand-text h1 {
    font-size: 1.40rem;
    font-weight: 800;
    color: #0f172a;
    margin: 0;
    letter-spacing: -0.3px;
    line-height: 1.2;
}

.fc-brand-text .sub-brand {
    font-size: 0.82rem;
    color: #64748b;
    font-weight: 500;
}

/* Abas de Navegação Principal (Fluxo Completo vs Lançamentos Avulsos) */
.fc-main-nav-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 10px;
}

.fc-nav-tab-btn {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    background: #ffffff;
    color: #475569;
    font-weight: 700;
    font-size: 0.84rem;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.fc-nav-tab-btn:hover {
    background: #f8fafc;
    color: #0f172a;
    border-color: #cbd5e1;
}

.fc-nav-tab-btn.active {
    background: #0f172a;
    color: #ffffff;
    border-color: #0f172a;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.15);
}

.fc-subview-panel {
    animation: fcFadeIn 0.2s ease-in-out;
}

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

/* Toolbar Principal */
.fc-toolbar-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 16px 20px;
    margin-bottom: 20px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.02), 0 2px 4px -2px rgba(0, 0, 0, 0.02);
}

.fc-toolbar-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
}

.fc-filter-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.fc-filter-label {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: #64748b;
}

.fc-select, .fc-input-date {
    height: 36px;
    padding: 0 12px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.82rem;
    color: #0f172a;
    background: #ffffff;
    transition: all 0.15s ease;
}

.fc-select:focus, .fc-input-date:focus {
    border-color: #0284c7;
    outline: none;
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.12);
}

/* Segmented Buttons (Pills de Visão e Agrupamento) */
.fc-segmented-control {
    display: inline-flex;
    background: #f1f5f9;
    padding: 3px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    gap: 2px;
}

.fc-segmented-btn {
    border: none;
    background: transparent;
    padding: 5px 14px;
    font-size: 0.74rem;
    font-weight: 700;
    border-radius: 6px;
    color: #64748b;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.fc-segmented-btn:hover {
    color: #0f172a;
}

.fc-segmented-btn.active {
    background: #ffffff;
    color: #0284c7;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.06);
}

/* Barra de Atalhos */
.fc-sub-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px dashed #e2e8f0;
    overflow-x: auto;
}

.fc-chip-btn {
    font-size: 0.70rem;
    padding: 3px 10px;
    border-radius: 14px;
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    color: #475569;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.fc-chip-btn:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
    color: #0f172a;
}

.fc-chip-btn.active-chip {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #1d4ed8;
    font-weight: 700;
}

/* Grid de Cards KPI */
.fc-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}

.fc-kpi-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px 18px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.02);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.fc-kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.04);
}

.fc-kpi-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 4px;
}

.fc-kpi-card.kpi-blue::before { background: #0284c7; }
.fc-kpi-card.kpi-emerald::before { background: #10b981; }
.fc-kpi-card.kpi-rose::before { background: #f43f5e; }
.fc-kpi-card.kpi-purple::before { background: #8b5cf6; }
.fc-kpi-card.kpi-dark::before { background: #0f172a; }

.fc-kpi-title {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #64748b;
    margin-bottom: 6px;
}

.fc-kpi-value {
    font-size: 1.35rem;
    font-weight: 800;
    color: #0f172a;
    font-family: var(--font-secondary, 'Outfit', monospace);
    letter-spacing: -0.5px;
    line-height: 1.1;
}

.fc-kpi-value.val-emerald { color: #059669; }
.fc-kpi-value.val-rose { color: #e11d48; }
.fc-kpi-value.val-purple { color: #7c3aed; }

.fc-kpi-desc {
    font-size: 0.70rem;
    color: #94a3b8;
    margin-top: 6px;
    font-weight: 500;
}

/* Card da Tabela Matricial */
.fc-table-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.02), 0 2px 4px -2px rgba(0, 0, 0, 0.02);
    position: relative;
}

.fc-table-scroll {
    overflow-x: auto;
    max-height: calc(100vh - 280px);
    min-height: 420px;
}

.fc-table-scroll::-webkit-scrollbar {
    height: 8px;
    width: 8px;
}

.fc-table-scroll::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.fc-table-scroll::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.fc-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.81rem;
}

/* Cabeçalho da Tabela */
.fc-table thead tr th {
    background: #f8fafc;
    color: #475569;
    font-weight: 700;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    padding: 10px 14px;
    border-bottom: 2px solid #cbd5e1;
    border-top: none;
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 25;
}

.fc-th-sticky-code {
    position: sticky !important;
    left: 0;
    z-index: 30 !important;
    width: 70px;
    min-width: 70px;
    max-width: 70px;
    border-right: 1px solid #e2e8f0;
    background: #f8fafc !important;
    text-align: center;
}

.fc-th-sticky-title {
    position: sticky !important;
    left: 70px;
    z-index: 30 !important;
    min-width: 310px;
    width: 330px;
    border-right: 2px solid #cbd5e1;
    background: #f8fafc !important;
    box-shadow: 4px 0 6px -2px rgba(0, 0, 0, 0.05);
}

.fc-th-col {
    text-align: right;
    min-width: 120px;
    padding: 10px 14px;
}

.fc-th-total {
    background: #f1f5f9 !important;
    border-left: 2px solid #cbd5e1;
    color: #0f172a !important;
    font-weight: 800 !important;
    text-align: right;
    min-width: 135px;
}

.fc-th-av {
    background: #f8fafc !important;
    border-left: 1px solid #e2e8f0;
    color: #0f172a !important;
    font-weight: 800 !important;
    text-align: right;
    min-width: 75px;
}

/* Linhas e Células */
.fc-table tbody tr {
    transition: background 0.12s ease;
}

.fc-table tbody td {
    padding: 7px 12px;
    border-bottom: 1px solid #f1f5f9;
    white-space: nowrap;
    color: #1e293b;
    line-height: 1.35;
}

.fc-td-code {
    position: sticky !important;
    left: 0;
    z-index: 15;
    width: 70px;
    min-width: 70px;
    max-width: 70px;
    font-family: monospace;
    font-size: 0.74rem;
    font-weight: 600;
    color: #64748b;
    text-align: center;
    border-right: 1px solid #e2e8f0;
    background-color: #ffffff;
}

.fc-td-title {
    position: sticky !important;
    left: 70px;
    z-index: 15;
    min-width: 310px;
    width: 330px;
    border-right: 2px solid #cbd5e1;
    background-color: #ffffff;
    box-shadow: 4px 0 6px -2px rgba(0, 0, 0, 0.05);
}

.fc-td-val {
    text-align: right;
    font-family: var(--font-secondary, 'Outfit', monospace);
    font-size: 0.81rem;
    font-weight: 500;
}

.fc-td-total {
    text-align: right;
    font-family: var(--font-secondary, 'Outfit', monospace);
    font-size: 0.83rem;
    font-weight: 800;
    border-left: 2px solid #cbd5e1;
    background-color: #f8fafc;
}

.fc-td-av {
    padding: 7px 12px;
    text-align: right;
    font-family: monospace;
    font-size: 0.76rem;
    font-weight: 700;
    color: #475569;
    background: #f8fafc;
    border-left: 1px solid #e2e8f0;
}

/* Container de Valor e Ponto Indicador */
.fc-cell-box {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    width: 100%;
}

.fc-cell-txt {
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum";
    white-space: nowrap;
    letter-spacing: -0.2px;
}

.fc-cell-cue {
    display: inline-block;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background-color: #0284c7;
    flex-shrink: 0;
    box-shadow: 0 0 2px rgba(2, 132, 199, 0.4);
    transition: transform 0.15s ease, background-color 0.15s ease;
}

.fc-cell-cue.is-abated {
    background-color: #b45309;
    box-shadow: 0 0 2px rgba(180, 83, 9, 0.4);
}

.fc-drillable-cell:hover .fc-cell-cue {
    transform: scale(1.5);
}

/* Zebra striping nas linhas normais */
.fc-table tbody tr.fc-tr-line:nth-child(even):not(.fc-row-drawer):not(.fc-row-subtotal):not(.fc-row-saldo-inicial):not(.fc-row-saldo-final) td {
    background-color: #fafbfc;
}
.fc-table tbody tr.fc-tr-line:nth-child(even):not(.fc-row-drawer):not(.fc-row-subtotal):not(.fc-row-saldo-inicial):not(.fc-row-saldo-final) .fc-td-code,
.fc-table tbody tr.fc-tr-line:nth-child(even):not(.fc-row-drawer):not(.fc-row-subtotal):not(.fc-row-saldo-inicial):not(.fc-row-saldo-final) .fc-td-title {
    background-color: #fafbfc !important;
}
.fc-table tbody tr.fc-tr-line:nth-child(even):not(.fc-row-drawer):not(.fc-row-subtotal):not(.fc-row-saldo-inicial):not(.fc-row-saldo-final) .fc-td-total {
    background-color: #f1f5f9;
}

/* Efeito de hover em toda a linha (incluindo colunas fixas) */
.fc-table tbody tr:hover td {
    background-color: #f0f7ff !important;
}
.fc-table tbody tr:hover .fc-td-total {
    background-color: #e0f2fe !important;
}

/* Modificadores de Linha */
.fc-row-bold {
    font-weight: 700;
}

.fc-row-drawer td {
    background-color: #f1f5f9 !important;
    font-weight: 700;
    color: #0f172a;
    border-top: 1px solid #cbd5e1;
    border-bottom: 1px solid #e2e8f0;
}

.fc-row-subtotal td {
    background-color: #f1f5f9 !important;
    border-top: 2px solid #cbd5e1;
    border-bottom: 2px solid #cbd5e1;
    font-weight: 800;
    color: #0f172a;
}

.fc-row-saldo-inicial td {
    background-color: #f8fafc !important;
    border-top: 2px solid #64748b;
    border-bottom: 2px solid #cbd5e1;
    font-weight: 800;
    color: #1e293b;
}

.fc-row-saldo-final td {
    background-color: #eff6ff !important;
    border-top: 2px solid #2563eb;
    border-bottom: 2px solid #2563eb;
    font-weight: 800;
    color: #1e40af;
}

/* Cores de status */
.fc-val-positive { color: #059669 !important; }
.fc-val-negative { color: #dc2626 !important; }
.fc-val-zero { color: #94a3b8 !important; }

/* Botão de Expandir / Recolher Gaveta */
.fc-drawer-btn {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #334155;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
    font-weight: 800;
    cursor: pointer;
    margin-right: 10px;
    line-height: 1;
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.fc-drawer-btn:hover {
    border-color: #0284c7;
    color: #0284c7;
    background: #eff6ff;
}

/* Badges de Categoria na Tabela */
.fc-badge {
    font-size: 0.62rem;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-left: 8px;
}

.fc-badge-rec { background: #dcfce7; color: #15803d; border: 1px solid #bbf7d0; }
.fc-badge-pag { background: #ffe4e6; color: #be123c; border: 1px solid #fecdd3; }
.fc-badge-saldo { background: #dbeafe; color: #1d4ed8; border: 1px solid #bfdbfe; }
.fc-badge-prov { background: #fef3c7; color: #b45309; border: 1px solid #fde68a; }

/* ==============================================================================
   MODAL DO CONFIGURADOR DE ESTRUTURA (DESIGN FINTECH EXECUTIVO)
============================================================================== */
.fc-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.70);
    backdrop-filter: blur(6px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

.fc-modal-card {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    width: 1240px;
    max-width: 96vw;
    height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid #cbd5e1;
}

.fc-modal-header {
    padding: 16px 24px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #ffffff;
    flex-shrink: 0;
}

.fc-modal-header h3 {
    font-size: 1.15rem;
    font-weight: 800;
    color: #0f172a;
    margin: 0;
    letter-spacing: -0.3px;
}

.fc-modal-body {
    flex: 1;
    overflow: hidden;
    padding: 18px 24px;
    background: #f8fafc;
    display: flex;
}

.fc-modal-footer {
    padding: 14px 24px;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #ffffff;
    flex-shrink: 0;
}

/* Split Container: Roster à Esquerda e Editor à Direita */
.fc-builder-grid {
    display: grid;
    grid-template-columns: 360px 1fr;
    gap: 18px;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

/* Coluna Esquerda: Árvore Hierárquica */
.fc-builder-sidebar {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    height: 100%;
    box-sizing: border-box;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.fc-builder-sidebar-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    flex-shrink: 0;
}

.fc-builder-sidebar-title {
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: #475569;
}

.fc-builder-actions {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
    flex-shrink: 0;
}

.fc-tree-container {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding-right: 4px;
}

.fc-tree-container::-webkit-scrollbar {
    width: 6px;
}
.fc-tree-container::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.fc-tree-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 7px 10px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.80rem;
    border: 1px solid #e2e8f0;
    background: #ffffff;
    transition: all 0.12s ease;
}

.fc-tree-item:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.fc-tree-item.selected {
    background: #eff6ff !important;
    border-color: #0284c7 !important;
    box-shadow: 0 0 0 1px #0284c7;
}

.fc-tree-item-text {
    display: flex;
    align-items: center;
    gap: 8px;
    overflow: hidden;
    flex: 1;
    min-width: 0;
}

.fc-tree-item-code {
    font-family: monospace;
    font-size: 0.74rem;
    color: #64748b;
    font-weight: 700;
    flex-shrink: 0;
}

.fc-tree-item-title {
    font-size: 0.78rem;
    font-weight: 600;
    color: #0f172a;
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
}

.fc-tree-item-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

/* Coluna Direita: Editor de Linha */
.fc-builder-editor {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px 24px;
    overflow-y: auto;
    height: 100%;
    box-sizing: border-box;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.fc-builder-editor::-webkit-scrollbar {
    width: 6px;
}
.fc-builder-editor::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.fc-editor-section {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 16px;
}

.fc-editor-section-title {
    font-size: 0.82rem;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 14px;
    padding-bottom: 8px;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    align-items: center;
    gap: 8px;
}

.fc-field-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.fc-field-grid-3 {
    display: grid;
    grid-template-columns: 100px 1fr 100px;
    gap: 14px;
}

.fc-field-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.fc-field-label {
    font-size: 0.72rem;
    font-weight: 700;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.fc-input-text, .fc-input-select {
    height: 38px;
    padding: 0 12px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 0.84rem;
    color: #0f172a;
    background: #ffffff;
    transition: all 0.15s ease;
    box-sizing: border-box;
    width: 100%;
}

.fc-input-text:focus, .fc-input-select:focus {
    border-color: #0284c7;
    outline: none;
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.12);
}

/* Box de Provisão Financeira */
.fc-provisao-box {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 10px;
    padding: 14px 16px;
    margin-top: 12px;
}

.fc-provisao-box-title {
    font-size: 0.75rem;
    font-weight: 800;
    color: #1e40af;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
}

/* ==============================================================================
   TELA DEDICADA: ESTÚDIO DE CONFIGURAÇÃO DO FLUXO DE CAIXA
   Design Executivo, Full Viewport, Alta Performance e Fluidez
============================================================================== */
.fc-cfg-wrapper {
    min-height: calc(100vh - 64px);
    background-color: #f8fafc;
    padding: 20px 32px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 16px;
    font-family: var(--font-primary, 'Plus Jakarta Sans', sans-serif);
}

.fc-cfg-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 14px 22px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.02);
    flex-wrap: wrap;
    gap: 16px;
}

.fc-cfg-topbar-left {
    display: flex;
    align-items: center;
    gap: 18px;
}

.fc-cfg-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 38px;
    padding: 0 14px;
    font-weight: 700;
    font-size: 0.80rem;
    border-radius: 8px;
}

.fc-cfg-titles h1 {
    font-size: 1.25rem;
    font-weight: 800;
    color: #0f172a;
    margin: 0;
    letter-spacing: -0.3px;
    line-height: 1.2;
}

.fc-cfg-titles .sub-titles {
    font-size: 0.78rem;
    color: #64748b;
    font-weight: 500;
}

.fc-cfg-status-badge {
    font-size: 0.68rem;
    font-weight: 800;
    background: #eff6ff;
    color: #0284c7;
    border: 1px solid #bfdbfe;
    padding: 2px 8px;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.fc-cfg-topbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.fc-cfg-model-selector-group {
    display: flex;
    flex-direction: column;
}

.fc-cfg-model-btns {
    display: flex;
    gap: 6px;
}

/* Grid Principal de 2 Colunas (Full Viewport) */
.fc-cfg-main-grid {
    display: grid;
    grid-template-columns: 390px 1fr;
    gap: 18px;
    height: calc(100vh - 190px);
    min-height: 580px;
    overflow: hidden;
}

/* Coluna 1: Painel da Árvore */
.fc-cfg-tree-panel {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 18px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.02);
    overflow: hidden;
    height: 100%;
    box-sizing: border-box;
}

.fc-cfg-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.fc-cfg-panel-title {
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #334155;
}

.fc-cfg-count-pill {
    font-size: 0.70rem;
    font-weight: 700;
    background: #eff6ff;
    color: #0284c7;
    padding: 2px 8px;
    border-radius: 12px;
    margin-left: 8px;
}

.fc-cfg-search-input {
    width: 100%;
    height: 36px;
    padding: 0 12px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 0.80rem;
    color: #0f172a;
    background: #f8fafc;
    box-sizing: border-box;
    transition: all 0.15s ease;
}

.fc-cfg-search-input:focus {
    background: #ffffff;
    border-color: #0284c7;
    outline: none;
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.12);
}

.fc-cfg-quick-actions {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.fc-cfg-tree-scroll {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding-right: 4px;
}

.fc-cfg-tree-scroll::-webkit-scrollbar {
    width: 6px;
}
.fc-cfg-tree-scroll::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

/* Coluna 2: Painel do Editor */
.fc-cfg-editor-panel {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 22px 28px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.02);
    overflow-y: auto;
    height: 100%;
    box-sizing: border-box;
}

.fc-cfg-editor-panel::-webkit-scrollbar {
    width: 6px;
}
.fc-cfg-editor-panel::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.fc-cfg-empty-state {
    text-align: center;
    padding: 140px 30px;
    color: #64748b;
}

.fc-cfg-empty-state h2 {
    font-size: 1.15rem;
    font-weight: 800;
    color: #1e293b;
    margin: 12px 0 6px 0;
}

.fc-cfg-empty-state p {
    font-size: 0.82rem;
    max-width: 480px;
    margin: 0 auto;
    line-height: 1.5;
}

.fc-cfg-editor-content {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.fc-cfg-active-banner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 18px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
}

.fc-cfg-active-meta {
    display: flex;
    align-items: center;
    gap: 12px;
}

.fc-cfg-active-code {
    font-family: monospace;
    font-weight: 800;
    font-size: 0.90rem;
    background: #0f172a;
    color: #ffffff;
    padding: 4px 10px;
    border-radius: 6px;
}

.fc-cfg-active-title {
    font-size: 1.05rem;
    font-weight: 800;
    color: #0f172a;
}

.fc-cfg-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 18px 20px;
}

.fc-cfg-card-title {
    font-size: 0.82rem;
    font-weight: 800;
    color: #0f172a;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding-bottom: 10px;
    border-bottom: 1px solid #f1f5f9;
    margin-bottom: 14px;
}

.fc-cfg-grid-3 {
    display: grid;
    grid-template-columns: 130px 1fr 110px;
    gap: 14px;
}

.fc-cfg-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.fc-cfg-test-card {
    background: #f8fafc;
    border-color: #cbd5e1;
}

/* Itens da Árvore no Estúdio Dedicado */
.fc-cfg-tree-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.82rem;
    border: 1px solid #e2e8f0;
    background: #ffffff;
    transition: all 0.12s ease;
    user-select: none;
}

.fc-cfg-tree-item:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

.fc-cfg-tree-item.selected {
    background: #eff6ff !important;
    border-color: #0284c7 !important;
    box-shadow: 0 0 0 1.5px #0284c7;
}

.fc-cfg-tree-item-left {
    display: flex;
    align-items: center;
    gap: 8px;
    overflow: hidden;
    flex: 1;
    min-width: 0;
}

.fc-cfg-tree-item-code {
    font-family: monospace;
    font-size: 0.74rem;
    color: #475569;
    font-weight: 800;
    background: #f1f5f9;
    padding: 1px 6px;
    border-radius: 4px;
    flex-shrink: 0;
}

.fc-cfg-tree-item.selected .fc-cfg-tree-item-code {
    background: #0284c7;
    color: #ffffff;
}

.fc-cfg-tree-item-title {
    font-size: 0.80rem;
    font-weight: 600;
    color: #0f172a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.fc-cfg-tree-item-right {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.fc-cfg-badge {
    font-size: 0.62rem;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 4px;
    background: #f1f5f9;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.btn-fc-cfg-add-child {
    border: 1px solid #bbf7d0;
    background: #dcfce7;
    color: #15803d;
    font-size: 0.68rem;
    font-weight: 700;
    border-radius: 4px;
    padding: 2px 7px;
    cursor: pointer;
    transition: all 0.12s ease;
}

.btn-fc-cfg-add-child:hover {
    background: #bbf7d0;
}

.btn-fc-cfg-del-line {
    border: none;
    background: none;
    color: #94a3b8;
    font-weight: bold;
    font-size: 1.05rem;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
    transition: color 0.12s ease;
}

.btn-fc-cfg-del-line:hover {
    color: #dc2626;
}

/* Células Clicáveis para Raio-X Analítico e Rastreabilidade D+N */
.fc-drillable-cell {
    cursor: pointer !important;
    transition: background-color 0.12s ease, box-shadow 0.12s ease, color 0.12s ease;
    position: relative;
}

.fc-drillable-cell:hover {
    background-color: #e0f2fe !important;
    box-shadow: inset 0 0 0 1.5px #0284c7;
}

.fc-drillable-cell:hover .fc-cell-txt {
    font-weight: 700;
}

/* ==============================================================================
   UX EXECUTIVA: MODAL DE RAIO-X & DETALHAMENTO ANALÍTICO (DRILLDOWN)
   ============================================================================== */
#modalFcDrilldown .fc-modal-card {
    box-shadow: 0 20px 45px -10px rgba(15, 23, 42, 0.25), 0 0 0 1px rgba(15, 23, 42, 0.08);
    border-radius: 12px;
    animation: fcModalFadeIn 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fcModalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.98) translateY(6px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.btn-fc-drill-tab {
    border: none;
    background: transparent;
    color: #64748b;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.14s ease;
}

.btn-fc-drill-tab:hover {
    color: #1e293b;
    background: #e2e8f0;
}

.btn-fc-drill-tab.active {
    background: #ffffff !important;
    color: #0f172a !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

#fcDrillTableWrapper::-webkit-scrollbar,
#fcDrillRulesBox::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

#fcDrillTableWrapper::-webkit-scrollbar-thumb,
#fcDrillRulesBox::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

#fcDrillTableWrapper::-webkit-scrollbar-thumb:hover,
#fcDrillRulesBox::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

#fcDrillTableHead th {
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    border-bottom: 2px solid #e2e8f0;
    z-index: 2;
}

#fcDrillTableBody tr {
    transition: background-color 0.12s ease;
}

#fcDrillTableBody tr:hover {
    background-color: #f8fafc;
}

#fcDrillSearchInput:focus {
    outline: none;
    border-color: #0284c7;
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}



