@charset "UTF-8";
        /* ===== Reset ===== */
        * { margin: 0; padding: 0; box-sizing: border-box; }

        /* ===== Variáveis CSS ===== */
        :root {
            /* Tokens de paleta (refatoração) */
            --color-primary: #0C447C;
            --color-primary-mid: #185FA5;
            --color-primary-bg: #E6F1FB;
            --color-primary-border: #B3D1EF;
            --color-bg-card: #ffffff;
            --color-bg-surface: #F7F9FC;
            --color-border: rgba(0,0,0,0.08);
            --color-text-primary: #0f172a;
            --color-text-secondary: #64748b;
            --color-text-muted: #94a3b8;
            --color-success: #10b981;
            --color-danger: #ef4444;
            --radius-card: 10px;

            /* Legacy (compatibilidade com código existente) */
            --primary: #3b82f6;
            --primary-dark: #2563eb;
            --primary-light: #60a5fa;
            --primary-50: #eff6ff;
            --primary-100: #dbeafe;
            --primary-gradient: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
            --primary-gradient-hover: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
            --secondary: #1f2937;
            --secondary-light: #374151;
            --success: #10b981;
            --success-light: #d1fae5;
            --success-dark: #059669;
            --danger: #ef4444;
            --danger-light: #fee2e2;
            --danger-dark: #dc2626;
            --warning: #f59e0b;
            --warning-light: #fef3c7;
            --warning-dark: #d97706;
            --info: #06b6d4;
            --info-light: #cffafe;
            --bg-primary: #ffffff;
            --bg-secondary: #f8fafc;
            --bg-alt: #f1f5f9;
            --bg-hover: #f8fafc;
            --border: #e2e8f0;
            --border-light: #f1f5f9;
            --border-dark: #cbd5e1;
            --text: #1e293b;
            --text-secondary: #475569;
            --text-light: #64748b;
            --text-muted: #94a3b8;
            --shadow-xs: 0 1px 2px 0 rgb(0 0 0 / 0.05);
            --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
            --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
            --shadow-md: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
            --shadow-lg: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
            --shadow-xl: 0 25px 50px -12px rgb(0 0 0 / 0.25);
            --shadow-inner: inset 0 2px 4px 0 rgb(0 0 0 / 0.05);
            --shadow-primary: 0 4px 14px 0 rgb(59 130 246 / 0.3);
            --radius-sm: 0.375rem;
            --radius: 0.5rem;
            --radius-md: 0.625rem;
            --radius-lg: 0.75rem;
            --radius-xl: 1rem;
            --radius-2xl: 1.5rem;
            --radius-full: 9999px;
            --space-1: 0.25rem;
            --space-2: 0.5rem;
            --space-3: 0.75rem;
            --space-4: 1rem;
            --space-5: 1.25rem;
            --space-6: 1.5rem;
            --space-8: 2rem;
            --space-10: 2.5rem;
            --space-12: 3rem;
            --space-16: 4rem;
            --transition-fast: all 0.15s ease;
            --transition: all 0.2s ease;
            --transition-slow: all 0.3s ease;
            --light: #f3f4f6;
        }

        /* Dark Mode */
        [data-theme="dark"] {
            --color-bg-card: #1e293b;
            --color-bg-surface: #0f172a;
            --color-border: rgba(255,255,255,0.10);
            --color-text-primary: #f1f5f9;
            --color-text-secondary: #94a3b8;
            --color-text-muted: #64748b;
            --primary: #60a5fa;
            --primary-dark: #3b82f6;
            --primary-light: #93c5fd;
            --primary-50: #1e3a5f;
            --primary-100: #1e40af;
            --primary-gradient: linear-gradient(135deg, #3b82f6 0%, #60a5fa 100%);
            --secondary: #f1f5f9;
            --secondary-light: #e2e8f0;
            --success-light: #064e3b;
            --danger-light: #7f1d1d;
            --warning-light: #78350f;
            --info-light: #164e63;
            --bg-primary: #0f172a;
            --bg-secondary: #1e293b;
            --bg-alt: #334155;
            --bg-hover: #334155;
            --border: #334155;
            --border-light: #475569;
            --border-dark: #64748b;
            --text: #f1f5f9;
            --text-secondary: #cbd5e1;
            --text-light: #94a3b8;
            --text-muted: #64748b;
        }

        /* ===== Base ===== */
        /* ===== Layout base ===== */
        body {
            font-family: 'Nunito Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
            background: var(--bg-secondary);
            color: var(--color-text-primary);
            font-size: 0.925rem;
            line-height: 1.6;
            min-height: 100vh;
        }

        /* ===== Sidebar lateral ===== */
        .sidebar {
            position: fixed;
            left: 0; top: 0; bottom: 0;
            width: 232px;
            background: #0C447C;
            display: flex;
            flex-direction: column;
            z-index: 500;
            padding: 16px 12px;
            border-right: 1px solid rgba(0,0,0,0.15);
            overflow: hidden;
        }

        /* Logo */
        .sidebar-top {
            padding-bottom: 14px;
            margin-bottom: 14px;
            border-bottom: 1px solid rgba(255,255,255,0.12);
            flex-shrink: 0;
        }

        .sidebar-logo {
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .sidebar-logo-icon {
            width: 36px; height: 36px;
            background: rgba(255,255,255,0.13);
            border-radius: 8px;
            border: 1px solid rgba(255,255,255,0.18);
            display: flex; align-items: center; justify-content: center;
            flex-shrink: 0;
        }

        .sidebar-logo-text {
            display: flex;
            flex-direction: column;
            gap: 1px;
            min-width: 0;
        }

        .sidebar-title {
            font-size: 13.5px;
            font-weight: 700;
            color: #fff;
            white-space: nowrap;
            line-height: 1.2;
        }

        .sidebar-subtitle {
            font-size: 8.5px;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 0.8px;
            color: rgba(255,255,255,0.4);
            white-space: nowrap;
        }

        /* Grupos de navegação */
        .sidebar-nav {
            flex: 1;
            overflow-y: auto;
            overflow-x: hidden;
        }

        .nav-group {
            margin-bottom: 18px;
        }

        .nav-group-label {
            font-size: 9.5px;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 1px;
            color: rgba(255,255,255,0.32);
            padding: 0 8px;
            margin-bottom: 3px;
            display: block;
        }

        /* Itens de navegação (buttons) */
        .nav-item {
            display: flex;
            align-items: center;
            gap: 9px;
            width: 100%;
            padding: 7px 8px;
            border: none;
            border-radius: 6px;
            background: transparent;
            color: rgba(255,255,255,0.62);
            font-size: 12.5px;
            font-family: inherit;
            font-weight: 400;
            text-align: left;
            cursor: pointer;
            transition: background 0.15s, color 0.15s;
            white-space: nowrap;
        }

        .nav-item:hover {
            background: rgba(255,255,255,0.10);
            color: #fff;
        }

        .nav-item.active {
            background: rgba(255,255,255,0.17);
            color: #fff;
            font-weight: 600;
            border-left: 2px solid rgba(255,255,255,0.75);
            padding-left: 6px;
        }

        .nav-item-icon {
            width: 16px; height: 16px;
            flex-shrink: 0;
            opacity: 0.85;
        }

        .nav-item.active .nav-item-icon { opacity: 1; }
        .nav-item-label { flex: 1; }

        /* Rodapé da sidebar */
        .sidebar-footer {
            flex-shrink: 0;
            padding-top: 12px;
            border-top: 1px solid rgba(255,255,255,0.12);
            display: flex;
            flex-direction: column;
            gap: 8px;
        }

        .sidebar-ted-selector .ted-chip {
            background: rgba(255,255,255,0.12);
            color: #fff;
            width: 100%;
            border-radius: 6px;
            font-size: 12px;
        }

        .sidebar-ted-selector .ted-chip .lucide { color: rgba(255,255,255,0.7); }

        .sidebar-sync {
            text-align: center;
        }

        .sidebar-action-btns {
            display: flex;
            gap: 5px;
            flex-wrap: wrap;
        }

        .sidebar-action-btns .topbar-btn { flex: 1; font-size: 11px; padding: 5px 6px; text-align: center; }
        .sidebar-action-btns .topbar-badge { font-size: 10px; padding: 3px 6px; }

        /* Botões de ação (mantidos) */
        .topbar-badge {
            font-size: 11px;
            color: rgba(255,255,255,0.75);
            padding: 4px 8px;
            background: rgba(255,255,255,0.10);
            border-radius: 6px;
        }

        .topbar-btn {
            font-size: 13px;
            padding: 6px 10px;
            border-radius: 6px;
            border: none;
            cursor: pointer;
            font-family: inherit;
        }
        .topbar-btn-carregar { background: rgba(255,255,255,0.12); color: #ffffff; }
        .topbar-btn-salvar { background: #378ADD; color: #ffffff; }
        .topbar-btn-admin-login { background: rgba(255,255,255,0.10); color: #ffffff; border: 1px solid rgba(255,255,255,0.25) !important; }
        .topbar-btn-admin-login:hover { background: rgba(255,255,255,0.20); }
        .topbar-btn-logoff { background: #dc2626; color: #ffffff; }
        .topbar-btn-logoff:hover { background: #b91c1c; }
        .topbar-mode { cursor: default; font-weight: 500; }

        .ted-chip {
            background: #E6F1FB;
            color: #0C447C;
            padding: 6px 10px;
            border-radius: 999px;
            display: inline-flex;
            align-items: center;
            gap: 8px;
            font-size: 13px;
            cursor: pointer;
        }
        .ted-status-dot { width:8px; height:8px; background: var(--color-success); border-radius:50%; display:inline-block; }
        .ted-chip .lucide { opacity: 0.9; color: #0C447C; }

        /* Hide possible floating settings button selectors if present */
        #floating-settings, .floating-settings, .settings-floating, [data-role="floating-settings"] { display:none !important; }

        .theme-toggle i { width: 20px; height: 20px; }
        .theme-icon-dark { display: none; }
        [data-theme="dark"] .theme-icon-light { display: none; }
        [data-theme="dark"] .theme-icon-dark { display: block; }

        /* Main Container — empurrado pela sidebar */
        .container {
            margin-left: 232px;
            width: calc(100vw - 232px);
            max-width: calc(100vw - 232px);
            padding: 1.5rem;
            min-height: 100vh;
            box-sizing: border-box;
            overflow-x: auto;
        }

        /* Abas — ocultas (navegação agora é pela sidebar) */
        .tabs { display: none; }

        /* Cabeçalho da aba Detalhes */
        .detalhes-header {
            display: flex;
            align-items: center;
            gap: 14px;
            margin-bottom: 1rem;
        }
        .detalhes-header h2 { margin: 0; }

        .tab-btn i {
            width: 18px;
            height: 18px;
            vertical-align: middle;
            margin-right: 4px;
        }

        /* Lucide inline icons */
        .inline-icon {
            width: 24px;
            height: 24px;
            vertical-align: middle;
            margin-right: 8px;
            display: inline-block;
        }

        .inline-icon-sm {
            width: 16px;
            height: 16px;
            vertical-align: middle;
            margin-right: 6px;
            display: inline-block;
        }

        .btn-icon-sm {
            width: 14px;
            height: 14px;
            vertical-align: middle;
            margin-right: 4px;
        }
        /* Resumo Financeiro: reduzir coluna 'Ano' */
        .tabela-padrao th.col-ano,
        .tabela-padrao td.col-ano,
        .resumo-panel .tabela-padrao th.col-ano,
        .resumo-panel .tabela-padrao td.col-ano {
            width: 64px;
            max-width: 64px;
            text-align: center;
            padding-left: 0.5rem;
            padding-right: 0.5rem;
            white-space: nowrap;
        }

        /* Cabeçalhos padronizados: unificados pela regra base `.tabela-padrao thead th` */

        /* Tabela de Aditivos / Apostilamentos (coluna lateral) */
        .tabela-aditivos { width: 100%; border-collapse: collapse; }
        .tabela-aditivos thead th, .tabela-aditivos tbody td { padding: 0.45rem 0.5rem; border-bottom: 1px solid var(--color-border); vertical-align: middle; }
        .tabela-aditivos .col-alteracoes { min-width: 220px; width: auto; }
        .tabela-aditivos .col-tipo { min-width: 110px; }
        .tabela-aditivos .col-data { width: 100px; text-align: center; }
        .tabela-aditivos .col-num { width: 30px; text-align: center; }
        .tabela-aditivos .col-acao { width: 70px; text-align: center; }
        .tabela-aditivos .alt-linha { margin-bottom: 0.15rem; font-size: 0.75rem; color: var(--color-text-secondary); }
        .tabela-aditivos .alt-linha .alt-de { color: var(--color-text-primary); margin-right: 0.35rem; }
        .tabela-aditivos .alt-linha .alt-para { color: #185FA5; font-weight:600; margin-left: 0.35rem; }
        .tabela-aditivos .alt-linha .alt-arrow { margin: 0 0.35rem; color: var(--text-muted); }

        /* Resumo Financeiro: alinhamento segue a regra base de cabeçalhos */

        /* Estilo do container Resumo Financeiro (extraído de inline styles) */
        #resumoFinanceiroChart {
            min-height: 160px;
            padding: 0.5rem;
            background: #ffffff;
            border-radius: 8px;
            overflow-x: auto;
        }

        /* Entregas / Resumo responsive layout */
        .entregas-row { display:flex; gap:0.5rem; align-items:flex-start; flex-wrap:wrap; }
        .resumo-panel { width:760px; min-width:520px; }
        .entregas-panel { flex:1; min-width:320px; }

        @media (max-width: 1000px) {
            .resumo-panel { width: 60%; min-width: 360px; }
        }

        @media (max-width: 760px) {
            .entregas-row { flex-direction: column; gap:0.75rem; }
            .resumo-panel, .entregas-panel { width: 100% !important; min-width: auto !important; }
            .resumo-panel .tabela-padrao, .resumo-panel table { width: 100%; }
            .resumo-panel { order: 0; }
            .entregas-panel { order: 1; }
        }

        .tab-btn {
            background: transparent;
            border: none;
            padding: 0.5rem 1rem;
            font-size: 0.95rem;
            cursor: pointer;
            color: var(--color-text-secondary);
            border-radius: 999px;
            display: inline-flex;
            align-items: center;
            gap: 0.5rem;
            transition: all 0.18s ease;
            font-weight: 600;
        }

        .tab-btn.active {
            background: rgba(59,130,246,0.10);
            color: var(--primary);
            box-shadow: 0 6px 18px rgba(59,130,246,0.06);
        }

        .tab-btn:hover {
            background: var(--color-bg-surface);
            color: #185FA5;
        }

        .tab-content {
            display: none;
        }

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

        /* ===== Estilos para Entregas / Subentregas (Cadastro Físico) ===== */
        .subentregas-row .subentregas-panel,
        .subentregas-panel {
            padding: 0.75rem;
            background: var(--color-bg-card);
            border-left: 4px solid var(--primary);
            border-radius: 8px;
            box-shadow: var(--shadow-sm);
            display: flex;
            flex-direction: column;
            gap: 0.5rem;
        }
        .subentregas-list { display:flex; flex-direction:column; gap:0.5rem; }
        .subentrega-item { display:flex; justify-content:space-between; gap:1rem; align-items:center; padding:0.45rem; border-radius:6px; background: rgba(0,0,0,0.02); }
        .subentrega-meta { font-size:0.9rem; color:var(--color-text-primary); }
        .subentrega-actions { display:flex; gap:0.5rem; }
        .subentregas-actions { display:flex; gap:0.5rem; align-items:center; }
        .subentregas-empty { color:var(--text-muted); padding:0.5rem; }
        .btn-small { font-size:0.8rem; padding:4px 8px; border-radius:6px; border:1px solid var(--color-border); background:transparent; cursor:pointer; }
        .btn { padding:6px 10px; border-radius:8px; border:none; background:var(--primary); color:#fff; cursor:pointer; }
        .btn-ghost { padding:6px 10px; border-radius:8px; border:1px solid var(--color-border); background:transparent; cursor:pointer; }

        /* Mini bloco de entrega dentro do Gantt */
        .entrega-mini { display:inline-block; padding:2px 6px; margin:2px 0; border-radius:6px; background:#C0DD97; color:#08303A; font-size:0.75rem; line-height:1; }

        /* Status icon pequeno para colunas */
        .status-icon { width:12px; height:12px; border-radius:50%; display:inline-block; margin-right:6px; vertical-align:middle; }
        .status-icon.vazio { background:#e5e7eb; }
        .status-icon.parcial { background:#f59e0b; }
        .status-icon.concluido { background:#10b981; }

        /* Barra de progresso compacta usada inline */
        .progress-inline { width:60px; height:6px; background:#f1f5f9; border-radius:999px; overflow:hidden; display:inline-block; vertical-align:middle; margin-right:6px; }
        .progress-inline > .fill { height:100%; background:var(--success); }

        /* Banner informativo de Execução Física sincronizada */
        .entrega-sincronizacao-banner { padding:0.5rem 0.75rem; background:linear-gradient(90deg, rgba(59,130,246,0.08), rgba(59,130,246,0.04)); border-radius:8px; color:var(--color-text-secondary); font-size:0.9rem; margin-bottom:0.5rem; }


        .tab-content.active {
            display: block !important;
            animation: fadeIn 0.25s ease;
        }

        /* Cards */
        .card {
            background: var(--color-bg-card);
            border-radius: var(--radius-lg);
            box-shadow: var(--shadow-sm);
            padding: var(--space-6);
            margin-bottom: var(--space-6);
            border: 1px solid var(--color-border);
            transition: var(--transition);
        }

        .card:hover {
            border-color: var(--color-primary-border);
        }

        .card h2 {
            color: var(--color-text-primary);
            margin-bottom: var(--space-4);
            font-size: 1.5rem;
            font-weight: 700;
            letter-spacing: -0.025em;
        }

        .card h3 {
            color: var(--color-text-primary);
            margin-bottom: 0.5rem;
            font-size: 1.1rem;
            font-weight: 600;
        }

        /* Lista de TEDs: exibir 3 cards por linha (responsivo) */
        #listaTeds {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 1rem;
        }

        @media (max-width: 1100px) {
            #listaTeds { grid-template-columns: repeat(2, 1fr); }
        }

        @media (max-width: 640px) {
            #listaTeds { grid-template-columns: 1fr; }
        }

        /* Remover margin extra nos cards dentro da grade (grid já controla espaçamento) */
        #listaTeds .card { margin: 0; }

        /* Buttons */
        .btn {
            padding: 0.5rem 1.5rem;
            border: none;
            border-radius: var(--radius);
            cursor: pointer;
            font-weight: 600;
            transition: var(--transition);
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 0.5rem;
            text-align: center;
            text-decoration: none;
            font-size: 0.875rem;
        }

        .btn-sm {
            padding: 0.35rem 0.75rem;
            font-size: 0.75rem;
            font-weight: 500;
        }

        /* Barra de execução para coluna Execução */
        .exec-bar {
            width: 60px;
            height: 4px;
            background: var(--color-bg-surface);
            border-radius: 999px;
            overflow: hidden;
            position: relative;
            flex: 0 0 auto;
        }
        .exec-bar-fill {
            height: 100%;
            width: 0%;
            transition: width 0.45s ease;
            border-radius: 999px;
            background: var(--color-primary-mid);
        }
        .exec-perc { font-family: 'Nunito Sans', ui-monospace, monospace; font-variant-numeric: tabular-nums; font-size: 13px; margin-left: 8px; color: var(--color-text-primary); }
        .status-badge { display:inline-block; font-size:11px; padding:3px 9px; border-radius:999px; margin-left:8px; font-weight:600; }
        .status-badge.concluido { background:#EAF3DE; color:#3B6D11; }
        .status-badge.acima { background:#FCEBEB; color:#A32D2D; }
        .status-badge.andamento { background:#FAEEDA; color:#854F0B; }

        /* Linha animada */
        .exec-row { opacity: 0; }
        @keyframes rowEnter { to { opacity: 1; transform: translateY(0); } }
        .exec-row.animate { animation: rowEnter 360ms cubic-bezier(.2,.9,.2,1) forwards; }

        /* Saldo: monospace e estados */
        .col-saldo { font-family: 'Nunito Sans', ui-monospace, monospace; font-variant-numeric: tabular-nums; font-size: 13px; text-align: center; }
        .col-saldo.zero { color: var(--color-text-secondary); }
        .col-saldo.neg { color: #A32D2D; }

        /* Alerta de divergência entre Cadastro Financeiro e Objetos */
        .alert-divergencia {
            background: #FAEEDA;
            border: 0.5px solid #EF9F27;
            border-radius: 8px;
            padding: 10px 14px;
            margin: 0 1.5rem 1.25rem;
            font-size: 12px;
            color: #633806;
            display: none;
        }

        /* Badge UP */
        .badge-up { display:inline-block; font-size:11px; padding:3px 8px; border-radius:999px; font-weight:600; }
        .badge-up.info { background:#E6F1FB; color:#0C447C; }
        .badge-up.neutral { background:var(--color-bg-surface); color:var(--color-text-secondary); }
        .badge-status { display:inline-block; font-size:11px; padding:3px 9px; border-radius:999px; font-weight:600; }
        .badge-status.regular { background:#EAF3DE; color:#3B6D11; }
        .badge-status.acima { background:#FAEEDA; color:#854F0B; }
        .badge-status.critico { background:#FCEBEB; color:#A32D2D; }

        .btn-primary {
            background: var(--primary-gradient);
            color: white;
            box-shadow: var(--shadow-sm);
        }

        .btn-primary:hover {
            background: #185FA5;
        }

        .btn-secondary {
            background: var(--color-bg-surface);
            color: var(--secondary);
            border: 1px solid var(--color-border);
        }

        .btn-secondary:hover {
            background: var(--color-border);
        }

        .btn-danger {
            background: var(--danger);
            color: white;
        }

        .btn-danger:hover {
            background: #dc2626;
        }

        .btn-small {
            padding: 0.25rem 0.75rem;
            font-size: 0.8rem;
        }

        /* Forms */
        .form-group {
            margin-bottom: 1.5rem;
        }

        .form-group label {
            display: block;
            margin-bottom: 0.5rem;
            font-weight: 600;
            color: var(--secondary);
            font-size: 0.875rem;
        }

        .form-group input,
        .form-group textarea,
        .form-group select {
            width: 100%;
            padding: 0.75rem 1rem;
            border: 1px solid var(--color-border);
            border-radius: var(--radius);
            font-size: 0.95rem;
            font-family: inherit;
            background: white;
            transition: var(--transition);
        }

        .form-group input:focus,
        .form-group textarea:focus,
        .form-group select:focus {
            outline: none;
            border-color: var(--primary);
            box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
        }

        .form-group input:hover,
        .form-group textarea:hover,
        .form-group select:hover {
            border-color: #378ADD;
        }

        .form-group textarea {
            resize: vertical;
            min-height: 100px;
        }

        /* Progress Bar */
        .progress-bar {
            width: 100%;
            height: 10px;
            background: var(--color-bg-surface);
            border-radius: 999px;
            overflow: hidden;
            margin: 0.5rem 0;
            box-shadow: inset 0 1px 2px rgba(0,0,0,0.1);
        }

        .progress-fill {
            height: 100%;
            background: #378ADD;
            transition: width 0.5s ease;
            border-radius: 999px;
        }

        .progress-text {
            font-size: 0.875rem;
            color: var(--text-light);
            margin-top: 0.25rem;
            font-weight: 500;
        }

        /* Grid (cards mais compactos no dashboard) */
        .grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
            gap: 0.5rem;
            margin-bottom: 0.5rem;
        }

        /* Cartões compactos do Resumo Geral */
        .stat-card {
            background: #ffffff;
            padding: 14px 16px;
            border-radius: 12px;
            border: 0.5px solid rgba(0,0,0,0.10);
            text-align: left;
            transition: box-shadow 0.15s;
            min-height: 80px;
            display: flex;
            flex-direction: column;
            justify-content: space-between;
        }

        .stat-card:hover {
            box-shadow: 0 2px 12px rgba(0,0,0,0.08);
        }

        .stat-card .label {
            font-size: 11px;
            color: #6b6b6b;
            margin-bottom: 6px;
            font-weight: 500;
            letter-spacing: 0;
        }

        .stat-card .value {
            font-size: 22px;
            font-weight: 500;
            color: #1a1a1a;
        }
        .stat-card.accent-green {
            border-left: 3px solid #639922;
            border-radius: 0 12px 12px 0;
        }
        .stat-card.accent-red {
            border-left: 3px solid #E24B4A;
            border-radius: 0 12px 12px 0;
        }

        /* Badge */
        .badge {
            display: inline-block;
            padding: 0.25rem 0.75rem;
            border-radius: 9999px;
            font-size: 0.875rem;
            font-weight: 600;
        }

        .badge-planejamento {
            background: #fef3c7;
            color: #92400e;
        }

        .badge-execucao {
            background: var(--color-primary-bg);
            color: var(--color-primary);
        }

        .badge-concluido {
            background: #dcfce7;
            color: #166534;
        }

        .badge-suspenso {
            background: #fee2e2;
            color: #7f1d1d;
        }
        
        .badge-denunciado {
            background: #fff7ed;
            color: #92400e;
        }

        .badge-finalizado {
            background: #fee2e2;
            color: #dc2626;
        }

        .badge-encerrado,
        .badge-vigencia-vencida {
            background: #fef3c7;
            color: #b45309;
            font-weight: 600;
        }

        /* ===== Badges de status financeiro ===== */
        .badge-regular, .badge-acima, .badge-critico, .badge-abaixo {
            font-size: 11px; font-weight: 500; padding: 3px 9px;
            border-radius: 999px; white-space: nowrap; display: inline-block;
        }
        .badge-regular { background: #EAF3DE; color: #3B6D11; }
        .badge-acima   { background: #FAEEDA; color: #854F0B; }
        .badge-critico { background: #FCEBEB; color: #A32D2D; }
        .badge-abaixo  { background: #E6F1FB; color: #0C447C; }
        /* UP badges */
        .up-badge { font-size: 11px; font-weight: 500; padding: 3px 8px; border-radius: 999px; white-space: nowrap; display: inline-block; }
        .up-badge-fjf { background: #E6F1FB; color: #0C447C; }
        .up-badge-fpv { background: #E6F1FB; color: #0C447C; }
        .up-badge-fe  { background: #F4F4F2; color: #5F5E5A; }
        /* Toggle months button */
        .btn-toggle-months { background: #F4F4F2; color: #6b6b6b; border: 0.5px solid rgba(0,0,0,0.12); border-radius: 7px; padding: 5px 12px; font-size: 12px; cursor: pointer; }
        .btn-toggle-months:hover { background: #e8e8e4; }
        /* Status column */
        .tabela-padrao .col-status { width: 90px; text-align: center; }

        /* ===== Filtros da aba TED (barra horizontal) ===== */
        .teds-filter-bar {
            display: flex;
            align-items: center;
            gap: 8px;
            margin-bottom: 1rem;
            padding: 10px 0;
            border-bottom: 0.5px solid rgba(0,0,0,0.08);
            flex-wrap: wrap;
        }
        .teds-filter-bar select {
            font-size: 12px;
            padding: 5px 10px;
            border-radius: 7px;
            border: 0.5px solid rgba(0,0,0,0.15);
            background: #ffffff;
            cursor: pointer;
            color: #1a1a1a;
        }
        .teds-filter-bar .filter-label {
            font-size: 12px;
            color: #6b6b6b;
            white-space: nowrap;
        }
        .teds-filter-bar .btn-limpar {
            font-size: 12px;
            color: #185FA5;
            background: none;
            border: none;
            cursor: pointer;
            padding: 5px 8px;
        }
        .teds-filter-bar .btn-limpar:hover { text-decoration: underline; }

        /* ===== Card de TED ===== */
        .ted-card {
            background: #ffffff;
            border: 0.5px solid rgba(0,0,0,0.08);
            border-radius: 0 12px 12px 0;
            padding: 14px 16px;
            margin-bottom: 10px;
            border-left: 3px solid #888780;
        }
        .ted-card:hover { box-shadow: 0 2px 12px rgba(0,0,0,0.08); }
        .ted-card-title { font-size: 16px; font-weight: 500; color: #1a1a1a; text-decoration: none; }
        .ted-card-title:hover { text-decoration: underline; }
        .ted-card-obj { font-size: 12px; color: #6b6b6b; margin: 3px 0 10px; }
        .ted-card-meta { font-size: 11px; color: #9b9b9b; margin-bottom: 10px; }
        .ted-card-progress { margin-bottom: 8px; }
        .ted-card-progress-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
        .ted-card-progress-label { font-size: 11px; color: #6b6b6b; }
        .ted-card-progress-pct { font-size: 11px; font-family: 'Nunito Sans', ui-monospace, monospace; color: #1a1a1a; }
        .ted-card-progress-track { background: rgba(0,0,0,0.07); border-radius: 4px; height: 6px; overflow: hidden; }
        .ted-card-footer { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; padding-top: 8px; border-top: 0.5px solid rgba(0,0,0,0.07); }
        .ted-card-saldo-pos { font-size: 12px; font-weight: 500; color: #3B6D11; font-family: 'Nunito Sans', ui-monospace, monospace; }
        .ted-card-saldo-neg { font-size: 12px; font-weight: 500; color: #A32D2D; font-family: 'Nunito Sans', ui-monospace, monospace; }
        .ted-card-status-col { display:flex; flex-direction:column; align-items:flex-end; gap:4px; }
        .ted-card-status-row { display:flex; gap:6px; align-items:flex-start; }
        .ted-card-status-note { font-size:11px; font-weight:600; color:#b45309; line-height:1; }

        /* Filtros Multi-Select estilo Excel */
        .filter-bar {
            display: flex;
            gap: 0.5rem;
            flex-wrap: wrap;
            margin-bottom: 0.75rem;
            align-items: center;
        }
        /* Filtro fixo no topo/esquerda da área da tabela (não acompanha scroll horizontal) */
        .table-wrapper > .filter-bar,
        .table-freeze-wrapper > .filter-bar {
            position: sticky;
            top: 0;
            left: 0;
            z-index: 80;
            background: var(--bg-alt);
            padding: 10px 12px;
            margin-bottom: 0.5rem;
            width: 100%;
            box-sizing: border-box;
            border-bottom: 0.5px solid var(--color-border);
        }
        .filter-bar-label {
            font-weight: 600;
            font-size: 0.85rem;
            color: var(--color-text-primary);
            margin-right: 0.25rem;
        }
        .filter-btn {
            position: relative;
            display: inline-flex;
            align-items: center;
            gap: 0.25rem;
            padding: 0.4rem 0.85rem;
            font-size: 0.8rem;
            background: white;
            border: 1px solid var(--color-border);
            border-radius: var(--radius);
            cursor: pointer;
            user-select: none;
            transition: var(--transition);
            font-weight: 500;
        }
        .filter-btn:hover {
            background: var(--color-bg-surface);
            border-color: #378ADD;
        }
        .filter-btn.active {
            background: #378ADD;
            border-color: var(--primary);
            color: white;
        }
        .filter-btn::after {
            content: '+';
            font-size: 0.75rem;
            margin-left: 0.35rem;
            opacity: 0.7;
        }
        .filter-menu {
            display: none;
            position: absolute;
            top: calc(100% + 4px);
            left: 0;
            min-width: 180px;
            max-height: 240px;
            overflow-y: auto;
            background: white;
            border: 1px solid var(--border-light);
            border-radius: var(--radius);
            box-shadow: var(--shadow-lg);
            z-index: 260;
            padding: 0.35rem 0;
        }
        .filter-menu.open {
            display: block;
            animation: dropdownFadeIn 0.2s ease;
        }
        @keyframes dropdownFadeIn {
            from { opacity: 0; transform: translateY(-8px); }
            to { opacity: 1; transform: translateY(0); }
        }
        .filter-menu label {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            padding: 0.45rem 0.85rem;
            font-size: 0.8rem;
            cursor: pointer;
            transition: background 0.15s;
            color: var(--text, #1e293b);
        }
        .filter-menu label:hover {
            background: var(--color-bg-surface);
        }
        .filter-menu input[type="checkbox"] {
            width: 16px;
            height: 16px;
            accent-color: var(--primary);
        }
        .filter-menu .filter-clear-btn {
            display: block;
            width: calc(100% - 1rem);
            margin: 0.35rem 0.5rem;
            padding: 0.4rem;
            font-size: 0.75rem;
            background: var(--danger-light);
            color: var(--danger);
            border: none;
            border-radius: var(--radius-sm);
            cursor: pointer;
            text-align: center;
            font-weight: 500;
            transition: var(--transition);
        }
        .filter-menu .filter-clear-btn:hover {
            background: #fecaca;
        }

        .filter-clear-all-btn {
            margin-left: 0.5rem;
            padding: 0.35rem 0.9rem;
            font-size: 0.78rem;
            background: #fee2e2;
            border: 1px solid #fca5a5;
            border-radius: var(--radius);
            color: #b91c1c;
            cursor: pointer;
            font-weight: 500;
            transition: var(--transition);
        }
        .filter-clear-all-btn:hover {
            background: #fecaca;
            border-color: #f87171;
        }

        /* Próximas Ações - Layout 4 colunas (adiciona coluna extra em telas grandes) */
        .proximas-acoes-grid {
            display: grid;
            grid-template-columns: repeat(4, minmax(0, 1fr));
            gap: 1rem;
        }
        .proxima-col {
            background: #ffffff;
            border: 0.5px solid rgba(0,0,0,0.08);
            border-radius: 12px;
            padding: 12px 14px;
            min-height: 90px;
            min-width: 0;
            display: flex;
            flex-direction: column;
        }
        .proxima-col > div {
            flex: 1 1 auto;
        }
        .proxima-col .table-wrapper { min-width: 0; max-width: 100%; }
        .proxima-col table { min-width: 0; width: 100%; }
        .proxima-col .proxima-col-header {
            display: flex;
            align-items: center;
            gap: 7px;
            font-size: 13px;
            font-weight: 500;
            color: #1a1a1a;
            padding-bottom: 8px;
            margin-bottom: 8px;
            border-bottom: 0.5px solid rgba(0,0,0,0.08);
        }
        .proxima-col .proxima-col-header svg,
        .proxima-col .proxima-col-header .inline-icon-sm {
            width: 16px;
            height: 16px;
            flex-shrink: 0;
        }
        @media (max-width: 1200px) {
            .proximas-acoes-grid { grid-template-columns: repeat(3, 1fr); }
        }
        @media (max-width: 1000px) {
            .proximas-acoes-grid { grid-template-columns: repeat(2, 1fr); }
        }
        @media (max-width: 640px) {
            .proximas-acoes-grid { grid-template-columns: 1fr; }
        }

        /* Modal */
        .modal {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0,0,0,0.6);
            backdrop-filter: blur(4px);
            z-index: 1000;
            justify-content: center;
            align-items: center;
        }

        .modal.active {
            display: flex;
            animation: modalFadeIn 0.3s ease;
        }

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

        .modal-content {
            background: white;
            border-radius: var(--radius-xl);
            padding: 2rem;
            max-width: 500px;
            width: 90%;
            box-shadow: var(--shadow-lg);
            animation: modalSlideIn 0.3s ease;
        }

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

        .modal-header {
            font-size: 1.5rem;
            font-weight: 700;
            margin-bottom: 1.5rem;
            color: var(--secondary);
        }

        .modal-footer {
            display: flex;
            gap: 1rem;
            margin-top: 2rem;
            justify-content: flex-end;
        }

        /* Empty State */
        .empty-state {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            gap: 12px;
            text-align: center;
            padding: 2.5rem 1rem;
            color: var(--color-text-primary);
            background: transparent;
        }
        .empty-state svg { width: 96px; height: 96px; color: var(--color-text-muted); opacity: 0.95; }
        .empty-state .empty-title { font-weight: 700; font-size: 1.05rem; color: var(--color-text-primary); }
        .empty-state .empty-sub { color: var(--color-text-muted); font-size: 0.95rem; max-width: 520px; }

        /* Banner de versão desatualizada (pwa.js: checkAppVersion) */
        .pwa-version-banner {
            position: fixed; top: 0; left: 0; right: 0; z-index: 10001;
            display: flex; align-items: center; justify-content: center; gap: 12px;
            flex-wrap: wrap; padding: 10px 16px;
            background: var(--warning-light); color: var(--warning-dark);
            border-bottom: 1px solid var(--warning);
            font-size: 0.9rem; font-weight: 600;
            box-shadow: 0 2px 10px rgba(0,0,0,0.08);
        }
        .pwa-version-banner-text { flex: 1 1 auto; min-width: 200px; text-align: center; }
        .pwa-version-banner-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
        .pwa-version-banner-btn {
            padding: 5px 12px; border-radius: 6px; border: 1px solid var(--warning-dark);
            background: var(--warning-dark); color: #fff; font-size: 0.85rem; font-weight: 600;
            cursor: pointer;
        }
        .pwa-version-banner-btn:hover { opacity: 0.9; }
        .pwa-version-banner-close {
            background: none; border: none; color: var(--warning-dark); font-size: 1.3rem;
            line-height: 1; cursor: pointer; padding: 0 4px;
        }

        /* Global loader (overlay) */
        .global-loader { position: fixed; inset: 0; display: none; align-items: center; justify-content: center; z-index: 2147483647; }
        .global-loader.active { display: flex; }
        .global-loader-backdrop { position: absolute; inset: 0; background: rgba(2,6,23,0.55); backdrop-filter: blur(3px); }
        .global-loader-content { position: relative; z-index: 100000; display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 16px 20px; border-radius: 12px; background: rgba(0,0,0,0.48); color: #fff; box-shadow: 0 8px 30px rgba(0,0,0,0.45); }
        .global-loader-message { color: #fff; font-weight: 600; }
        .spinner { width: 48px; height: 48px; border-radius: 50%; border: 4px solid rgba(255,255,255,0.12); border-top-color: var(--success); animation: spin 1s linear infinite; }
        @keyframes spin { to { transform: rotate(360deg); } }

        /* Save confirmation on buttons */
        .btn-saved { background: var(--success) !important; color: white !important; border-color: transparent !important; }
        .save-check { display: inline-block; font-weight: 700; font-size: 1.05rem; line-height: 1; transform: scale(0.9); animation: pop 260ms ease; }
        @keyframes pop { 0% { transform: scale(0.6); opacity: 0; } 60% { transform: scale(1.08); opacity: 1; } 100% { transform: scale(1); } }

        /* Table wrapper with scroll */
        .table-wrapper {
            display: block;
            vertical-align: top;
            overflow-x: auto;
            position: relative;
            border: 1px solid var(--border-light);
            border-radius: var(--radius);
            background: white;
            width: 100%;
            max-width: 100%;
        }

        /* Indicador de scroll horizontal */
        .table-wrapper::after {
            content: '';
            position: absolute;
            top: 0;
            right: 0;
            bottom: 0;
            width: 30px;
            background: linear-gradient(90deg, transparent, rgba(255,255,255,0.9));
            pointer-events: none;
            opacity: 0;
            transition: opacity 0.3s;
        }

        .table-wrapper.has-scroll::after {
            opacity: 1;
        }

        /* Garantir que sticky funcione */
        .table-wrapper table {
            border-collapse: collapse;
        }

        /* Responsive */
        @media (max-width: 768px) {
            .container {
                padding: 1rem;
            }

            .nav-inner {
                flex-direction: column;
                gap: 1rem;
                padding: 0 1rem;
                align-items: flex-start;
            }

            .nav-brand-name {
                font-size: 1.6rem;
            }

            .nav-brand-sub {
                text-align: justify;
                text-align-last: justify;
                letter-spacing: 0.06em;
            }

            .tabs {
                flex-wrap: wrap;
            }

            .grid {
                grid-template-columns: 1fr;
            }

            .modal-content {
                width: 95%;
            }
        }

        /* Estilos para Informações do TED */
        .ted-info-section {
            margin-bottom: 2rem;
            padding: 1.5rem;
            background: var(--color-bg-card);
            border-radius: var(--radius-card);
            box-shadow: 0 2px 12px rgba(0,0,0,0.08);
            position: relative;
            color: var(--color-text-primary);
            border: 1px solid var(--color-border);
            overflow: hidden;
        }

        .ted-info-section::before {
            content: none;
        }

        .ted-info-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 1.5rem;
            padding-bottom: 1rem;
            border-bottom: 1px solid var(--color-border);
            position: relative;
            z-index: 1;
        }

        .ted-info-section .ted-info-title,
        .card .ted-info-title {
            margin: 0;
            color: var(--color-primary);
            display: inline-flex;
            align-items: center;
            gap: 0.2rem;
            font-size: 0.92rem;
            font-weight: 700;
        }

        .ted-info-title .inline-icon {
            color: var(--color-primary);
        }


        .ted-info-title-code {
            color: var(--color-primary);
            font-weight: 700;
            margin-left: 0.5rem;
            font-size: 2.1rem;
            letter-spacing: 0.01em;
        }

        .ted-info-actions {
            display: flex;
            gap: 0.5rem;
            flex-wrap: wrap;
        }

        .btn-edit, .btn-save, .btn-cancel {
            padding: 0.5rem 1rem;
            border: none;
            border-radius: 0.5rem;
            cursor: pointer;
            font-weight: 600;
            transition: all 0.3s;
            display: inline-flex;
            align-items: center;
            gap: 0.5rem;
            font-size: 0.9rem;
        }

        .btn-edit {
            background: var(--color-primary-bg);
            color: var(--color-primary);
            border: 1px solid var(--color-primary-border);
        }

        .btn-edit:hover {
            background: var(--color-primary-border);
        }

        .btn-save {
            background: var(--color-success);
            color: white;
        }

        .btn-save:hover {
            background: var(--success-dark);
            box-shadow: 0 4px 12px rgba(99,153,34,0.3);
        }

        .btn-cancel {
            background: var(--color-danger);
            color: white;
        }

        .btn-cancel:hover {
            background: var(--danger-dark);
            box-shadow: 0 4px 12px rgba(163,45,45,0.3);
        }

        /* Action button icons (delete, edit) - discreet / low-contrast */
        .btn-icon-action {
            background: transparent;
            border: none;
            cursor: pointer;
            padding: 1px 3px;
            border-radius: 3px;
            transition: var(--transition);
            display: inline-flex;
            align-items: center;
            justify-content: center;
            font-size: 12px;
            line-height: 1;
            opacity: 0.8;
        }

        .btn-icon-action:hover {
            opacity: 1;
        }

        .btn-icon-action.delete {
            color: rgba(220,38,38,0.9);
            background: transparent;
        }

        .btn-icon-action.delete:hover {
            background: rgba(220,38,38,0.08);
            color: #dc2626;
            box-shadow: 0 2px 6px rgba(16,24,40,0.06);
        }

        .btn-icon-action.edit {
            color: #185FA5;
            background: transparent;
        }

        .btn-icon-action.edit:hover {
            background: rgba(37,99,235,0.08);
            color: #185FA5;
            box-shadow: 0 2px 6px rgba(16,24,40,0.06);
        }

        /* Override específico para botões de ação dentro de tabelas (detalhes) */
        #detalhes #tedsDetalheContainer .tabela-padrao .btn-icon-action {
            width: 26px; height: 26px; padding: 0; border-radius: 6px; border: 0.5px solid var(--color-border); background: transparent; font-size: 13px;
            display:inline-flex; align-items:center; justify-content:center; opacity:1;
        }
        #detalhes #tedsDetalheContainer .tabela-padrao .btn-icon-action.edit { color: #185FA5; }
        #detalhes #tedsDetalheContainer .tabela-padrao .btn-icon-action.delete { color: #A32D2D; }

        /* Dark mode: keep icons subtle */
        [data-theme="dark"] .btn-icon-action {
            color: rgba(226,232,240,0.8);
        }

        [data-theme="dark"] .btn-icon-action.delete:hover {
            background: rgba(220,38,38,0.12);
        }

        [data-theme="dark"] .btn-icon-action.edit:hover {
            background: rgba(59,130,246,0.08);
        }

        .ted-info-grid {
            display: flex;
            flex-direction: column;
            gap: 1.1rem;
            position: relative;
            z-index: 1;
        }

        /* ===== Metrics Grid (Detalhes TED) ===== */
        .metrics-grid {
            display: grid;
            grid-template-columns: repeat(4, minmax(0, 1fr));
            gap: 10px;
            margin-bottom: 1.25rem;
        }

        .metric-card {
            background: #ffffff;
            border: 0.5px solid rgba(0,0,0,0.10);
            border-radius: 12px;
            padding: 14px 16px;
        }

        .metric-card.accent-green {
            border-left: 3px solid #639922;
            border-radius: 0 12px 12px 0;
        }

        .metric-card.accent-red {
            border-left: 3px solid #E24B4A;
            border-radius: 0 12px 12px 0;
        }

        .metric-label {
            font-size: 11px;
            color: #6b6b6b;
            margin-bottom: 6px;
        }

        .metric-value {
            font-size: 19px;
            font-weight: 500;
            color: #1a1a1a;
        }

        .metric-value.green { color: #3B6D11; }
        .metric-value.red   { color: #A32D2D; }

        .metric-sub {
            font-size: 11px;
            color: #6b6b6b;
            margin-top: 3px;
        }

        .status-pill {
            display: inline-block;
            font-size: 12px;
            font-weight: 500;
            padding: 4px 12px;
            border-radius: 999px;
            background: #E6F1FB;
            color: #0C447C;
            margin-top: 4px;
        }

        .valor-negativo { color: #A32D2D !important; }

        .ted-info-row {
            display: grid;
            gap: 1rem;
        }

        .ted-info-row.row-4 {
            grid-template-columns: repeat(4, 1fr);
        }

        .ted-info-row.row-3 {
            grid-template-columns: repeat(3, 1fr);
        }

        .ted-info-row.row-5 {
            grid-template-columns: repeat(5, 1fr);
        }

        .ted-info-card {
            background: var(--color-bg-surface);
            border: 1px solid var(--color-border);
            border-radius: var(--radius-md);
            padding: 1rem 1rem 0.9rem;
            transition: all 0.18s ease-in-out;
            min-height: 92px;
            display: flex;
            flex-direction: column;
            justify-content: space-between;
            box-shadow: 0 1px 4px rgba(0,0,0,0.05);
        }

        .ted-info-card:hover {
            border-color: var(--color-primary-border);
        }

        .ted-info-label {
            font-weight: 600;
            color: var(--color-text-secondary);
            font-size: 11px;
            display: block;
            margin-bottom: 6px;
            text-transform: none;
            letter-spacing: 0.02em;
        }

        .ted-info-value {
            color: var(--color-text-primary);
            font-size: 13px;
            font-weight: 500;
            min-height: 1.5rem;
            line-height: 1.35;
            word-break: normal;
            overflow-wrap: normal;
        }

        /* ===== Layout de duas colunas (Detalhes TED) ===== */
        .detail-two-col {
            display: grid;
            /* duas colunas iguais para que cada card ocupe metade da área */
            grid-template-columns: 1fr 1fr;
            gap: 12px;
            margin-bottom: 1rem;
        }
        .detail-right-col { display: flex; flex-direction: column; gap: 12px; }

        /* Cards dc (Dados Cadastrais, Aditivos, Situação) */
        .dc-card { background: #ffffff; border: 0.5px solid rgba(0,0,0,0.08); border-radius: 12px; padding: 14px 16px; }
        .dc-header { display:flex; align-items:center; justify-content:space-between; margin-bottom:12px; }
        .dc-title { font-size:13px; font-weight:600; color:#1a1a1a; }
        .btn-dc-edit   { background:#E6F1FB; color:#185FA5; border:none; border-radius:6px; padding:4px 10px; font-size:12px; cursor:pointer; }
        .btn-dc-edit:hover { background:#B3D1EF; }
        .btn-dc-save   { background:#EAF3DE; color:#3B6D11; border:none; border-radius:6px; padding:4px 10px; font-size:12px; cursor:pointer; }
        .btn-dc-cancel { background:#FEE2E2; color:#A32D2D; border:none; border-radius:6px; padding:4px 10px; font-size:12px; cursor:pointer; }
        .badge-neutro { display:inline-block; background:#F4F4F2; color:#6b6b6b; font-size:11px; padding:2px 8px; border-radius:999px; white-space:nowrap; }
        .dc-divider { border:none; border-top:0.5px solid rgba(0,0,0,0.08); margin:12px 0; }
        .sub-group-title { font-size:11px; font-weight:500; color:#6b6b6b; margin-bottom:10px; }

        /* Campo grid */
        .field-grid { display:grid; grid-template-columns:1fr 1fr; gap:8px 16px; margin-bottom:14px; }
        .field-label { font-size:11px; color:#6b6b6b; margin-bottom:2px; }
        .field-value { font-size:13px; font-weight:500; color:#1a1a1a; min-height:1.2em; word-break:normal; overflow-wrap:normal; }
        .field-value.mono { font-family: 'Nunito Sans', ui-monospace, monospace; font-size:13px; }
        .field-value.empty { color:#9b9b9b; }

        /* Legado (mantido para compatibilidade com outros usos) */
        .grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.9rem; margin-bottom: 0.6rem; }
        .mono { font-family: 'Nunito Sans', ui-monospace, monospace; }
        .badge-prorrogado { background:#EAF3DE; color:#3B6D11; padding:3px 8px; border-radius:999px; font-weight:600; font-size:11px; margin-left:6px; }
        .fim-vigencia-current { display:flex; align-items:center; gap:0.5rem; font-weight:500; }
        .fim-vigencia-meta { font-size:11px; color:#9b9b9b; margin-top:3px; }
        .vig-orig-tachado { text-decoration:line-through; color:#e53e3e; font-size:0.88em; margin-right:6px; }
        .vig-novo-valor { font-weight:600; color:#1a1a1a; }

        /* Tabela aditivos (bloco duplicado removido; ver definição mais completa acima) */
        .ad-action-cell .btn-icon.delete { width:22px; height:22px; padding:0; border-radius:50%; border:0.5px solid rgba(0,0,0,0.12); display:inline-flex; align-items:center; justify-content:center; background:transparent; cursor:pointer; font-size:13px; }

        .aditivos-footer { margin-top:10px; }
        .btn-add-aditivo { width:100%; padding:8px; border:0.5px dashed #85B7EB; background:transparent; color:#185FA5; border-radius:6px; font-size:12px; cursor:pointer; }

        /* Aditivos: compactar linhas e destacar valores alterados (movido de index.html) */
        .aditivo-change-row { margin-left: 12px; margin-bottom: 2px; font-size: 0.75rem; }
        .aditivo-change-badge { font-size: 0.75rem; padding:1px 5px; border-radius:5px; display:inline-block; margin:0 3px; background:transparent; }
        .aditivo-change-old, .val-antigo, .alt-de { text-decoration: line-through; color:#ef4444; background: rgba(239,68,68,0.06); padding:1px 5px; border-radius:5px; display:inline-block; font-size: 0.75rem; }
        .aditivo-change-new, .val-novo, .alt-para { color:#16a34a; background: rgba(34,197,94,0.06); padding:1px 5px; border-radius:5px; display:inline-block; font-weight:600; font-size: 0.75rem; }
        .alt-linha { display:inline-block; margin-right:6px; vertical-align:middle; font-size: 0.75rem; }
        .alt-arrow, .alter-arrow { margin: 0 4px; color: var(--text-muted); font-size: 0.75rem; }
        .celula-alterada-aditivo .val-antigo { text-decoration: line-through; color:#ef4444; margin-right:6px; }
        .celula-alterada-aditivo .val-novo { color:#16a34a; margin-left:6px; font-weight:600; }
        /* Tabela de detalhes do aditivo/apostilamento */
        .aditivo-detalhe-table { width:100%; border-collapse:collapse; margin-bottom:8px; font-size:0.92rem; }
        .aditivo-detalhe-table th { text-align:left; padding:6px 8px; font-size:0.86rem; color:var(--text-muted); border-bottom:1px solid rgba(0,0,0,0.06); }
        .aditivo-detalhe-table td { padding:6px 8px; vertical-align:middle; border-bottom:1px dashed rgba(0,0,0,0.04); }
        .aditivo-row-new td { background: rgba(34,197,94,0.04); color: #166534; font-weight:600; }
        .aditivo-row-removed td { background: rgba(239,68,68,0.04); color: #7f1d1d; text-decoration:line-through; }
        .aditivo-section-title { font-weight:700; margin-top:8px; margin-bottom:6px; }

        /* Gantt compacto (rodapé dos cards de cadastro) */
        .gantt-compact { background: var(--color-bg-surface); padding: 10px 12px; border-radius: 8px; }
        .gantt-compact .gantt-anos { display:flex; gap:0.25rem; margin-bottom:6px; font-size:11px; color:var(--color-text-secondary); }
        .gantt-compact .gantt-meses { display:flex; gap:4px; overflow-x:auto; }
        .gantt-compact .gantt-meses .mes { width:36px; text-align:center; font-size:9px; color:var(--color-text-secondary); }
        .gantt-compact .gantt-bars { display:flex; gap:4px; margin-top:8px; }
        .gantt-compact .gantt-bar { height:16px; border-radius:3px; margin: 8px 2px; }
        .gantt-compact .gantt-bar.previsto { background: #B5D4F4; }
        .gantt-compact .gantt-bar.realizado { background: #C0DD97; margin-left: -16px; opacity:0.95; }
        .gantt-compact .gantt-legend { margin-top:8px; font-size:11px; color:var(--color-text-secondary); display:flex; gap:12px; align-items:center; }

        .ted-info-toolbar {
            display: flex;
            align-items: center;
            gap: 0.9rem;
            margin: 0.15rem 0 0.1rem;
            padding: 0.85rem 1rem;
            background: var(--color-bg-surface);
            border: 1px solid var(--color-border);
            border-radius: var(--radius-md);
            flex-wrap: wrap;
        }

        .ted-info-resumo {
            font-size: 0.85rem;
            color: var(--color-text-secondary);
            background: var(--color-bg-surface);
            border: 1px solid var(--color-border);
            border-radius: 999px;
            padding: 0.35rem 0.75rem;
            display: inline-flex;
            align-items: center;
            min-height: 32px;
        }

        .ted-info-historico {
            display: none;
            background: var(--color-bg-card);
            border: 1px solid var(--color-border);
            border-radius: var(--radius-md);
            padding: 0.3rem 0.75rem 0.75rem;
            overflow-x: auto;
        }

        .ted-info-historico table {
            width: 100%;
            border-collapse: separate;
            border-spacing: 0;
        }

        .ted-info-historico th {
            font-size: 0.78rem;
            text-transform: uppercase;
            letter-spacing: 0.5px;
            color: var(--color-text-secondary);
            background: var(--color-bg-surface);
        }

        .ted-info-historico th,
        .ted-info-historico td {
            padding: 0.7rem 0.8rem;
        }

        .ted-info-historico tbody tr:hover {
            background: var(--color-primary-bg);
        }

        .ted-info-input {
            width: 100%;
            padding: 0.5rem;
            border: 1px solid var(--color-border);
            border-radius: 0.375rem;
            background: var(--color-bg-card);
            color: var(--color-text-primary);
            font-size: 1rem;
            font-family: inherit;
        }

        .ted-info-input:focus {
            outline: none;
            border-color: var(--color-primary-mid);
            background: white;
            box-shadow: 0 0 0 3px var(--color-primary-bg);
        }

        @media (max-width: 900px) {
            .detail-two-col { grid-template-columns: 1fr; }
        }

        @media (max-width: 768px) {
            .metrics-grid,
            .ted-info-row.row-4,
            .ted-info-row.row-3,
            .ted-info-row.row-5 {
                grid-template-columns: 1fr;
            }
            
            .ted-info-header {
                flex-direction: column;
                gap: 1rem;
                align-items: flex-start;
            }
            
            .ted-info-actions {
                width: 100%;
                justify-content: flex-end;
            }

            .ted-info-section {
                padding: 1.25rem;
            }

            .ted-info-toolbar {
                padding: 0.75rem;
            }
        }

        /* Estilos para congelar colunas nas tabelas com Gantt */
        .table-freeze-wrapper {
            display: inline-block;
            vertical-align: top;
            width: auto;
            max-width: 100%;
            overflow-x: auto;
            position: relative;
        }

        .table-freeze-wrapper table {
            border-collapse: collapse;
            width: max-content;
        }

        .table-freeze-wrapper th.freeze-col,
        .table-freeze-wrapper td.freeze-col {
            position: sticky;
            z-index: 2;
        }

        .table-freeze-wrapper thead th.freeze-col {
            z-index: 3;
        }

        /* Sombra para indicar colunas congeladas - última coluna freeze */
        .table-freeze-wrapper .freeze-col.freeze-last {
            box-shadow: 3px 0 6px rgba(0, 0, 0, 0.15);
        }

        /* ===== ESTILOS PADRONIZADOS PARA TODAS AS TABELAS ===== */
        .tabela-padrao {
            width: 100%;
            border-collapse: collapse;
            font-family: 'Nunito Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
            font-size: 13px;
        }
                /* Regra base para cabeçalhos de tabela (padronizada) */
                .tabela-padrao thead th {
                    background: #F4F4F2;
                    color: #1a1a1a;
                    font-size: 11px;
                    font-weight: 700;
                    text-align: center;
                    vertical-align: middle;
                    padding: 10px 12px;
                    border-bottom: 2px solid #85B7EB;
                    white-space: nowrap;
                    letter-spacing: 0.03em;
                    position: sticky;
                    top: 0;
                    z-index: 120;
                }

        .tabela-padrao th,
        .tabela-padrao td {
            padding: 0.6rem 0.5rem;
            vertical-align: middle;
            text-align: center;
        }
        .tabela-padrao thead th {
            text-align: center;
        }
        /* Colunas congeladas (aplicadas dinamicamente via JS) */
        .tabela-padrao .sticky-freeze {
            position: sticky;
            z-index: 130;
            background-clip: padding-box;
            background: var(--surface, #ffffff);
            isolation: isolate;
        }
        .tabela-padrao tbody .sticky-freeze,
        .tabela-padrao tfoot .sticky-freeze {
            z-index: 130;
            background: var(--surface, #ffffff);
        }
        .tabela-padrao thead .sticky-freeze {
            z-index: 140;
            background: var(--color-bg-surface) !important;
            color: var(--color-text-primary);
        }
        .tabela-padrao .sticky-freeze.sticky-freeze-last {
            box-shadow: 3px 0 6px rgba(0,0,0,0.18);
        }
        /* Divisão visual de anos (linha preta) */
        .tabela-padrao .year-divider-cell {
            border-left: 2px solid #000;
            box-shadow: inset 2px 0 0 #000;
        }
        .tabela-padrao thead .year-divider-group {
            border-left: 2px solid #000;
            box-shadow: inset 2px 0 0 #000;
        }
        .tabela-padrao th {
            font-weight: 700;
            white-space: nowrap;
            letter-spacing: 0.02em;
        }
        /* Larguras padrão para colunas comuns */
        .tabela-padrao .col-acao { min-width: 70px; text-align: center; }
        .tabela-padrao .col-m { width: 50px; text-align: center; }
        .tabela-padrao .col-mes { width: 90px; text-align: center; }
        .tabela-padrao .col-qtde { width: 75px; min-width: 75px; text-align: center; white-space: nowrap; }
        .tabela-padrao .col-valor { width: 100px; text-align: center; }
        .tabela-padrao .col-percent { min-width: 90px; text-align: center; }
        .tabela-padrao .col-nd { min-width: 60px; text-align: center; }
        .tabela-padrao .col-up { min-width: 60px; text-align: center; }
        .tabela-padrao .col-fase { width: 80px; text-align: center; }
        .tabela-padrao .col-objeto { min-width: 100px; text-align: center; }
        .tabela-padrao .col-descricao { min-width: 150px; text-align: center; }
        .tabela-padrao .col-meta { width: 100px; text-align: center; }
        .tabela-padrao .col-saldo { width: 100px; text-align: center; }
        /* Linhas: branco de base e hover suave */
        .tabela-padrao tbody tr { background: #ffffff; }
        .tabela-padrao tbody td { border-bottom: 0.5px solid var(--color-border); }
        .tabela-padrao tbody tr:last-child td { border-bottom: none; }

        /* Valores financeiros: alinhamento direito com numerais tabulares */
        .tabela-padrao .col-valor { text-align: center; font-variant-numeric: normal; }

        /* Linha de total (sempre em tfoot) */
        .tabela-padrao .linha-total {
            background: var(--color-bg-surface);
            font-weight: 500;
            border-top: 0.5px solid rgba(0,0,0,0.15);
        }

        /* Tabela vazia (sem cabeçalho visível) */
        .tabela-padrao.tabela-vazia thead { display: none; }
        .empty-metas .empty-title { font-size:13px; color: var(--color-text-secondary); margin:0 0 6px 0; font-weight:500; }
        .empty-metas .empty-sub { font-size:12px; color: var(--color-text-secondary); opacity:0.7; margin:0; }
        .tabela-padrao tbody tr:nth-child(odd) { background: #ffffff; }
        .tabela-padrao tbody tr:hover { background: #eef6ff; }
        /* reforçar separador entre linhas (melhora contraste com bordas) */
        .tabela-padrao tbody td { border-bottom: 1px solid rgba(16,24,40,0.04); }

        /* Dark mode table rows */
        [data-theme="dark"] .tabela-padrao tbody tr:nth-child(even) { background: #081224; }
        [data-theme="dark"] .tabela-padrao tbody tr:nth-child(odd) { background: #06111b; }
        [data-theme="dark"] .tabela-padrao tbody tr:hover { background: #0b2a44; }
        [data-theme="dark"] .tabela-padrao tbody td { border-bottom: 1px solid rgba(255,255,255,0.03); }

        /* ===== Blocos de seção padronizados (aba Detalhes) ===== */
        #detalhes #tedsDetalheContainer .detalhe-secao {
            position: relative;
            margin-bottom: 1.75rem;
            padding: 0;
            background: #ffffff;
            border: 0.5px solid var(--color-border);
            border-radius: 12px;
            overflow: clip; /* clip mantém border-radius sem bloquear scroll do filho */
            transition: box-shadow 0.12s ease;
        }
        #detalhes #tedsDetalheContainer .detalhe-secao.months-expanded {
            overflow: visible;
        }
        #detalhes #tedsDetalheContainer .detalhe-secao.months-expanded .detalhe-secao-body {
            overflow-x: auto;
        }
        #detalhes #tedsDetalheContainer .detalhe-secao:hover {
            box-shadow: 0 6px 18px rgba(12,20,35,0.06);
        }

        /* Cabeçalho da seção (novo padrão) */
        #detalhes #tedsDetalheContainer .detalhe-secao-header {
            display:flex; align-items:center; justify-content:space-between; gap:1rem;
            padding: 0.6rem 1rem; background: transparent; border-bottom: 0.5px solid var(--color-border);
        }
        #detalhes #tedsDetalheContainer .detalhe-secao-titulo {
            display:flex; align-items:center; gap:0.5rem; margin:0; font-size:13px; font-weight:500; color:var(--color-text-primary);
        }
        #detalhes #tedsDetalheContainer .detalhe-secao-titulo .inline-icon-sm,
        #detalhes #tedsDetalheContainer .detalhe-secao-titulo i,
        #detalhes #tedsDetalheContainer .detalhe-secao-titulo svg {
            width: 16px; height:16px; color:var(--color-text-secondary); opacity:0.9; stroke:currentColor; fill:none;
        }

        /* Contador/Badge neutro à esquerda do título */
        .section-count-badge { display:inline-flex; align-items:center; justify-content:center; margin-left:8px; background:var(--color-bg-card); border:0.5px solid var(--color-border); color:var(--color-text-secondary); padding:2px 8px; border-radius:999px; font-size:12px; font-weight:600; }

        .detalhe-secao-actions { display:flex; align-items:center; gap:0.5rem; }
        .section-add-btn {
            background: #E6F1FB; color: #0C447C; border: 0.5px solid #85B7EB; border-radius:7px; padding:6px 14px; font-size:12px; font-weight:600; cursor:pointer;
        }
        #detalhes #tedsDetalheContainer .detalhe-secao-titulo .inline-icon-sm,
        #detalhes #tedsDetalheContainer .detalhe-secao-titulo i,
        #detalhes #tedsDetalheContainer .detalhe-secao-titulo svg {
            width: 18px;
            height: 18px;
            opacity: 0.92;
            color: var(--color-primary);
            stroke: currentColor;
            fill: none;
        }

        /* Corpo da seção (formulário + tabela) */
        #detalhes #tedsDetalheContainer .detalhe-secao-body {
            padding: 1.25rem 1.5rem;
            overflow-x: auto;
        }

        /* KPI containers e CadFin ocupam toda a largura */
        #wrapperCadFin,
        #cfKpiWrap,
        #execfin-kpis-container,
        #recgeral-kpis-container {
            width: 100%;
            box-sizing: border-box;
        }

        /* Form groups dentro das seções: labels mais legíveis */
        #detalhes #tedsDetalheContainer .detalhe-secao .form-group label {
            font-size: 0.78rem;
            font-weight: 600;
            color: #475569;
            text-transform: uppercase;
            letter-spacing: 0.03em;
            margin-bottom: 0.3rem;
        }
        #detalhes #tedsDetalheContainer .detalhe-secao .form-group input,
        #detalhes #tedsDetalheContainer .detalhe-secao .form-group select {
            border: 1px solid #cbd5e1;
            border-radius: 0.45rem;
            transition: border-color 0.15s, box-shadow 0.15s;
        }
        #detalhes #tedsDetalheContainer .detalhe-secao .form-group input:focus,
        #detalhes #tedsDetalheContainer .detalhe-secao .form-group select:focus {
            border-color: var(--color-primary-mid);
            box-shadow: 0 0 0 3px var(--color-primary-bg);
            outline: none;
        }

        /* Botão "Adicionar" dentro das seções */
        #detalhes #tedsDetalheContainer .detalhe-secao .btn-primary {
            border-radius: 0.5rem;
            font-weight: 600;
            font-size: 0.82rem;
            text-transform: uppercase;
            letter-spacing: 0.03em;
        }

        /* Dark mode */
        [data-theme="dark"] #detalhes #tedsDetalheContainer .detalhe-secao {
            background: #0d1b2a;
            border-color: rgba(147, 197, 253, 0.18);
            box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(147, 197, 253, 0.08);
        }
        [data-theme="dark"] #detalhes #tedsDetalheContainer .detalhe-secao:hover {
            box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(147, 197, 253, 0.15);
        }
        [data-theme="dark"] #detalhes #tedsDetalheContainer .detalhe-secao-titulo {
            background: #0f1e32;
            color: #93c5fd;
            border-bottom-color: rgba(147,197,253,0.15);
        }
        [data-theme="dark"] #detalhes #tedsDetalheContainer .detalhe-secao .form-group label {
            color: #94a3b8;
        }
        [data-theme="dark"] #detalhes #tedsDetalheContainer .detalhe-secao .form-group input,
        [data-theme="dark"] #detalhes #tedsDetalheContainer .detalhe-secao .form-group select {
            background: #0f1f36;
            border-color: #334155;
            color: #e2e8f0;
        }

        /* ===== Melhorias visuais das tabelas (somente aba Detalhes do TED) ===== */
        #detalhes #tedsDetalheContainer .table-wrapper,
        #detalhes #tedsDetalheContainer .table-freeze-wrapper,
        #detalhes #tedsDetalheContainer div[style*="overflow-x: auto"] {
            border: 1px solid rgba(30, 64, 175, 0.18) !important;
            border-radius: 0.7rem !important;
            box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
            background: #ffffff;
        }
        /* Aditivo/Apostilamento histórico dentro das seções claras (detalhe-secao) */
        #detalhes #tedsDetalheContainer .detalhe-secao .aditivo-historico,
        #detalhes #tedsDetalheContainer .detalhe-secao .ted-info-historico {
            border: 1px solid rgba(30, 64, 175, 0.18) !important;
            border-radius: 0.7rem !important;
            box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
            background: #ffffff;
        }

        #detalhes #tedsDetalheContainer .tabela-padrao {
            font-family: 'Nunito Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
            font-size: 13px;
            line-height: 1.35;
        }

        #detalhes #tedsDetalheContainer .tabela-padrao thead tr {
            background: var(--color-bg-surface);
            color: var(--color-text-primary);
        }

                /* Override para o contexto de Detalhes TED: z-index maior para cabeçalhos congelados */
                #detalhes #tedsDetalheContainer .tabela-padrao thead th {
                    z-index: 20;
                    background: #F4F4F2;
                }

        /* Colunas congeladas (sticky-freeze) */
        /* Corpo/rodapé: background sólido branco */
        #detalhes #tedsDetalheContainer .tabela-padrao tbody .sticky-freeze,
        #detalhes #tedsDetalheContainer .tabela-padrao tfoot .sticky-freeze {
            position: sticky;
            z-index: 12;
            background: #ffffff !important;
        }
        /* Zebra: linhas pares dentro de colunas congeladas */
        #detalhes #tedsDetalheContainer .tabela-padrao tbody tr:nth-child(even) .sticky-freeze {
            background: #f7faff !important;
        }
        /* Hover dentro de colunas congeladas */
        #detalhes #tedsDetalheContainer .tabela-padrao tbody tr:hover .sticky-freeze {
            background: #eaf2ff !important;
        }
        /* Cabeçalho congelado: mesmo background opaco, z-index mais alto */
        #detalhes #tedsDetalheContainer .tabela-padrao thead .sticky-freeze {
            position: sticky;
            z-index: 40;
            background: var(--color-bg-surface) !important;
            color: var(--color-text-primary);
        }
        /* Sombra na última coluna congelada */
        #detalhes #tedsDetalheContainer .tabela-padrao .sticky-freeze.sticky-freeze-last {
            box-shadow: 4px 0 8px rgba(0,0,0,0.16);
        }

        /* Linhas do corpo */
        #detalhes #tedsDetalheContainer .tabela-padrao tbody tr:nth-child(even) {
            background: #f7faff;
        }
        #detalhes #tedsDetalheContainer .tabela-padrao tbody tr:nth-child(odd) {
            background: #ffffff;
        }
        /* Resumo (cons): fundo branco uniforme em tr, td e col-sticky */
        #detalhes #tedsDetalheContainer .execfin-table tbody tr.cons,
        #detalhes #tedsDetalheContainer .execfin-table tbody tr.cons td,
        #detalhes #tedsDetalheContainer .execfin-table tbody tr.cons .col-sticky,
        #detalhes #tedsDetalheContainer .rg-table tbody tr.cons,
        #detalhes #tedsDetalheContainer .rg-table tbody tr.cons td,
        #detalhes #tedsDetalheContainer .rg-table tbody tr.cons .col-sticky {
            background: #ffffff !important;
            box-shadow: none !important;
        }
        /* Exceções: total e resultado mantêm seus fundos */
        #detalhes #tedsDetalheContainer .execfin-table tbody tr.cons.total td,
        #detalhes #tedsDetalheContainer .execfin-table tbody tr.cons.total .col-sticky,
        #detalhes #tedsDetalheContainer .rg-table tbody tr.cons.total td,
        #detalhes #tedsDetalheContainer .rg-table tbody tr.cons.total .col-sticky {
            background: #F0F4F9 !important;
        }
        #detalhes #tedsDetalheContainer .execfin-table tbody tr.cons.resultado td,
        #detalhes #tedsDetalheContainer .execfin-table tbody tr.cons.resultado .col-sticky,
        #detalhes #tedsDetalheContainer .rg-table tbody tr.cons.resultado td,
        #detalhes #tedsDetalheContainer .rg-table tbody tr.cons.resultado .col-sticky {
            background: #FFF1F1 !important;
        }
        /* Resumo (cons): célula de label é congelada (sticky-freeze) e estava
           recebendo a zebra das colunas fixas (regra tr:nth-child(even) .sticky-freeze,
           que tem 2 IDs de especificidade). Forçar branco aqui — exceto total/resultado,
           que mantêm suas cores próprias via regras de td acima. */
        #detalhes #tedsDetalheContainer .execfin-table tbody tr.cons:not(.total):not(.resultado) td.sticky-freeze,
        #detalhes #tedsDetalheContainer .rg-table tbody tr.cons:not(.total):not(.resultado) td.sticky-freeze {
            background: #ffffff !important;
        }
        #detalhes #tedsDetalheContainer .tabela-padrao tbody tr:hover {
            background: #eaf2ff;
        }
        #detalhes #tedsDetalheContainer .tabela-padrao tbody td {
            border-color: rgba(15, 23, 42, 0.08);
            padding-top: 0.6rem;
            padding-bottom: 0.6rem;
        }

        /* Garantir legibilidade em modo claro: forçar texto escuro em todas as células
           dentro das tabelas da aba Detalhes. Usa alta especificidade e !important para
           sobrepor estilos inline dinâmicos ou regras de maior precedência (ex.: sticky-freeze).
        */
        #detalhes #tedsDetalheContainer .tabela-padrao tbody td,
        #detalhes #tedsDetalheContainer .tabela-padrao tbody th,
        #detalhes #tedsDetalheContainer .tabela-padrao tfoot td,
        #detalhes #tedsDetalheContainer .tabela-padrao td[style],
        #detalhes #tedsDetalheContainer .tabela-padrao th[style],
        #detalhes #tedsDetalheContainer .tabela-padrao tbody .sticky-freeze,
        #detalhes #tedsDetalheContainer .tabela-padrao tfoot .sticky-freeze,
        #detalhes #tedsDetalheContainer .tabela-padrao tbody .sticky-freeze * {
            color: #0f172a !important; /* cor escura para leitura */
        }
        /* Exceção: linha Resultado nas tabelas cons — fonte vermelha */
        #detalhes #tedsDetalheContainer .execfin-table tbody tr.cons.resultado td,
        #detalhes #tedsDetalheContainer .execfin-table tbody tr.cons.resultado td *,
        #detalhes #tedsDetalheContainer .rg-table tbody tr.cons.resultado td,
        #detalhes #tedsDetalheContainer .rg-table tbody tr.cons.resultado td * {
            color: #A32D2D !important; font-style: normal !important;
        }
        /* Exceção: linha Total a Receber nas tabelas cons — fundo e fonte azul */
        #detalhes #tedsDetalheContainer .execfin-table tbody tr.cons.total,
        #detalhes #tedsDetalheContainer .rg-table tbody tr.cons.total {
            box-shadow: 0 -1px 0 #B3D1EF, 0 1px 0 #B3D1EF;
        }
        #detalhes #tedsDetalheContainer .execfin-table tbody tr.cons.total td,
        #detalhes #tedsDetalheContainer .execfin-table tbody tr.cons.total td *,
        #detalhes #tedsDetalheContainer .rg-table tbody tr.cons.total td,
        #detalhes #tedsDetalheContainer .rg-table tbody tr.cons.total td * {
            background: #F0F4F9 !important;
            color: #0C447C !important; font-style: normal !important;
            border-top: none !important;
            border-bottom: none !important;
        }

        #detalhes #tedsDetalheContainer .tabela-padrao tbody tr:hover td {
            box-shadow: inset 0 0 0 9999px rgba(29, 78, 216, 0.04);
        }

        #detalhes #tedsDetalheContainer .tabela-padrao tbody td[colspan] {
            color: #5b6b86;
            font-style: italic;
            background: #f8fbff;
        }
        /* Linhas cons: cancelar itálico e cor acinzentada do td[colspan] */
        #detalhes #tedsDetalheContainer .execfin-table tbody tr.cons td,
        #detalhes #tedsDetalheContainer .execfin-table tbody tr.cons td *,
        #detalhes #tedsDetalheContainer .rg-table tbody tr.cons td,
        #detalhes #tedsDetalheContainer .rg-table tbody tr.cons td * {
            font-style: normal !important;
            color: #374151 !important;
        }

        #detalhes #tedsDetalheContainer .tabela-padrao .col-acao {
            min-width: 84px;
        }

        #detalhes #tedsDetalheContainer .tabela-padrao tbody .btn-icon,
        #detalhes #tedsDetalheContainer .tabela-padrao tbody .btn-icon-action {
            border-radius: 0.45rem;
        }

        #detalhes #tedsDetalheContainer .table-wrapper::-webkit-scrollbar,
        #detalhes #tedsDetalheContainer .table-freeze-wrapper::-webkit-scrollbar,
        #detalhes #tedsDetalheContainer div[style*="overflow-x: auto"]::-webkit-scrollbar {
            height: 10px;
        }

        #detalhes #tedsDetalheContainer .table-wrapper::-webkit-scrollbar-thumb,
        #detalhes #tedsDetalheContainer .table-freeze-wrapper::-webkit-scrollbar-thumb,
        #detalhes #tedsDetalheContainer div[style*="overflow-x: auto"]::-webkit-scrollbar-thumb {
            background: rgba(59, 130, 246, 0.42);
            border-radius: 999px;
        }

        [data-theme="dark"] #detalhes #tedsDetalheContainer .table-wrapper,
        [data-theme="dark"] #detalhes #tedsDetalheContainer .table-freeze-wrapper,
        [data-theme="dark"] #detalhes #tedsDetalheContainer div[style*="overflow-x: auto"] {
            background: #0b1529;
            border-color: rgba(147, 197, 253, 0.22) !important;
            box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28);
        }
        [data-theme="dark"] #detalhes #tedsDetalheContainer .detalhe-secao .aditivo-historico,
        [data-theme="dark"] #detalhes #tedsDetalheContainer .detalhe-secao .ted-info-historico {
            background: #0b1529;
            border-color: rgba(147, 197, 253, 0.22) !important;
            box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28);
        }

        [data-theme="dark"] #detalhes #tedsDetalheContainer .tabela-padrao thead tr {
            background: linear-gradient(180deg, #1a2f55 0%, #131e36 100%);
            color: #e0ecff;
        }

        [data-theme="dark"] #detalhes #tedsDetalheContainer .tabela-padrao tbody tr:nth-child(even) {
            background: #0e1c33;
        }

        [data-theme="dark"] #detalhes #tedsDetalheContainer .tabela-padrao tbody tr:nth-child(odd) {
            background: #0b172c;
        }

        [data-theme="dark"] #detalhes #tedsDetalheContainer .tabela-padrao tbody tr:hover {
            background: #123057;
        }

        [data-theme="dark"] #detalhes #tedsDetalheContainer .tabela-padrao tbody td {
            border-color: rgba(226, 232, 240, 0.08);
            color: #e6edf8;
        }

/* Pagination controls for large tables */
.table-pagination {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0;
}
.table-pagination .pagination-info { color: var(--text-secondary); font-size: 0.9rem; }
.table-pagination .pagination-controls { display:flex; gap:0.5rem; align-items:center; }
.table-pagination .pagination-controls select { padding: 4px 8px; border-radius:6px; border:1px solid var(--border); background:var(--color-bg-card); }
.table-pagination .pagination-controls button[disabled] { opacity:0.45; cursor:not-allowed; }
.table-pagination .page-numbers { font-size:0.88rem; color:var(--text-secondary); margin: 0 6px; }


        /* Dark mode: colunas congeladas com background opaco */
        [data-theme="dark"] #detalhes #tedsDetalheContainer .tabela-padrao thead .sticky-freeze {
            background: linear-gradient(180deg, #1a2f55 0%, #131e36 100%) !important;
        }
        [data-theme="dark"] #detalhes #tedsDetalheContainer .tabela-padrao tbody .sticky-freeze,
        [data-theme="dark"] #detalhes #tedsDetalheContainer .tabela-padrao tfoot .sticky-freeze {
            background: #0b172c !important;
        }
        [data-theme="dark"] #detalhes #tedsDetalheContainer .tabela-padrao tbody tr:nth-child(even) .sticky-freeze {
            background: #0e1c33 !important;
        }
        [data-theme="dark"] #detalhes #tedsDetalheContainer .tabela-padrao tbody tr:hover .sticky-freeze {
            background: #123057 !important;
        }

        [data-theme="dark"] #detalhes #tedsDetalheContainer .tabela-padrao tbody td[colspan] {
            color: #9fb1cd !important;
            background: #0b1a31;
        }
        
        /* Se o histórico de aditivos/apostilamentos estiver dentro de um detalhe-secao
           (bloco claro), forçar esquema claro para manter legibilidade) */
        #detalhes #tedsDetalheContainer .detalhe-secao .ted-info-historico,
        #detalhes #tedsDetalheContainer .detalhe-secao .aditivo-historico {
            background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
            border: 1px solid rgba(30,64,175,0.06);
            color: var(--text, #0f172a);
            padding: 0.6rem 0.9rem;
        }
        #detalhes #tedsDetalheContainer .detalhe-secao .ted-info-historico table,
        #detalhes #tedsDetalheContainer .detalhe-secao .aditivo-historico table {
            width: 100%;
            border-collapse: collapse;
        }
        #detalhes #tedsDetalheContainer .detalhe-secao .ted-info-historico th,
        #detalhes #tedsDetalheContainer .detalhe-secao .aditivo-historico th {
            color: #0f172a;
            background: rgba(15,23,42,0.02);
            font-weight: 700;
        }
        #detalhes #tedsDetalheContainer .detalhe-secao .ted-info-historico td,
        #detalhes #tedsDetalheContainer .detalhe-secao .aditivo-historico td {
            color: var(--text, #0f172a);
            padding: 0.6rem 0.8rem;
            border-bottom: 1px solid rgba(15,23,42,0.04);
        }
        
        /* ===== Dashboard: Cards e painéis ===== */
        #dashboard .dashboard-stats {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
            gap: 1rem;
        }

        #dashboard .stat-card {
            padding: 1rem 1rem;
            border-radius: 0.75rem;
            background: #ffffff;
            border: 1px solid rgba(30, 64, 175, 0.06);
            box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
            display: flex;
            flex-direction: column;
            gap: 0.35rem;
            min-height: 72px;
            position: relative;
            overflow: hidden;
            isolation: isolate;
        }
        #dashboard .stat-card .label {
            font-size: 0.78rem;
            color: #64748b;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 0.03em;
            position: relative;
            z-index: 1;
        }
        #dashboard .stat-card .value {
            font-family: 'Nunito Sans', ui-monospace, monospace;
            font-size: 1.5rem;
            font-weight: 700;
            color: #0f172a;
            position: relative;
            z-index: 1;
        }

        #dashboard .stat-card .stat-watermark {
            position: absolute;
            right: 0.7rem;
            bottom: 0.55rem;
            width: 3.3rem;
            height: 3.3rem;
            pointer-events: none;
            z-index: 0;
            color: #0f172a;
            display: inline-flex;
            align-items: center;
            justify-content: center;
        }

        #dashboard .stat-card .stat-watermark .lucide,
        #dashboard .stat-card .stat-watermark svg {
            width: 100%;
            height: 100%;
            stroke-width: 1.6;
            opacity: 0.12;
        }

        #dashboard .stat-card.wm-blue .stat-watermark { color: #1d4ed8; }
        #dashboard .stat-card.wm-amber .stat-watermark { color: #b45309; }
        #dashboard .stat-card.wm-indigo .stat-watermark { color: #4338ca; }
        #dashboard .stat-card.wm-green .stat-watermark { color: #166534; }

        #dashboard .stat-card.wm-blue .stat-watermark .lucide,
        #dashboard .stat-card.wm-blue .stat-watermark svg { opacity: 0.13; }
        #dashboard .stat-card.wm-amber .stat-watermark .lucide,
        #dashboard .stat-card.wm-amber .stat-watermark svg { opacity: 0.12; }
        #dashboard .stat-card.wm-indigo .stat-watermark .lucide,
        #dashboard .stat-card.wm-indigo .stat-watermark svg { opacity: 0.12; }
        #dashboard .stat-card.wm-green .stat-watermark .lucide,
        #dashboard .stat-card.wm-green .stat-watermark svg { opacity: 0.13; }

        @media (max-width: 640px) {
            #dashboard .stat-card .stat-watermark {
                width: 2.8rem;
                height: 2.8rem;
                right: 0.55rem;
                bottom: 0.5rem;
            }
        }

        #dashboard .proximas-acoes-grid {
            display: grid;
            grid-template-columns: repeat(4, minmax(0, 1fr));
            gap: 1rem;
        }
        @media (max-width: 900px) {
            #dashboard .proximas-acoes-grid { grid-template-columns: 1fr; }
        }

        #dashboard .proxima-col {
            padding: 0.75rem;
            border-radius: 0.6rem;
            background: #ffffff;
            border: 1px solid rgba(30, 64, 175, 0.06);
            box-shadow: 0 2px 10px rgba(15,23,42,0.04);
            min-height: 88px;
        }
        #dashboard .proxima-col h4 { margin: 0 0 0.5rem 0; font-weight:700; }
        #dashboard .proxima-col .empty-state { margin: 0; }

        /* Entregas / Resumo financeiro panels */
        #dashboard .resumo-panel .card,
        #dashboard .entregas-panel .card {
            border-radius: 0.6rem;
            border: 1px solid rgba(30,64,175,0.06);
            box-shadow: 0 6px 18px rgba(15,23,42,0.06);
            background: #ffffff;
        }

        /* Small improvements for filters and buttons in dashboard */
        #dashboard .filter-bar label,
        #dashboard .graficos-filters label { font-weight:600; color:var(--color-text-primary); }
        #dashboard .filter-bar select,
        #dashboard .graficos-filters select { border-radius:0.4rem; padding:0.25rem; border:1px solid #dbeafe; }

        /* ===== Multi-select dropdown (filtros Gráficos) ===== */
        .ms-dropdown {
            position: relative;
        }
        .ms-btn {
            display: flex; align-items: center; gap: 6px;
            min-width: 220px; max-width: 320px;
            padding: 5px 10px;
            border: 1px solid #dbeafe; border-radius: 6px;
            background: #fff; color: var(--color-text-primary);
            font-size: 0.86rem; cursor: pointer;
            text-align: left; white-space: nowrap;
        }
        .ms-btn span { flex: 1; overflow: hidden; text-overflow: ellipsis; }
        .ms-btn:hover { border-color: var(--color-primary-mid); }
        .ms-panel {
            display: none;
            position: absolute; top: calc(100% + 4px); left: 0; z-index: 600;
            background: #fff; border: 1px solid #dbeafe; border-radius: 8px;
            box-shadow: 0 4px 16px rgba(0,0,0,0.12);
            min-width: 240px; max-width: 340px;
            max-height: 280px; overflow-y: auto;
        }
        .ms-panel.open { display: block; }
        .ms-search-wrap { padding: 6px 8px; border-bottom: 1px solid #f0f4ff; }
        .ms-search {
            width: 100%; padding: 4px 8px;
            border: 1px solid #dbeafe; border-radius: 4px;
            font-size: 0.82rem; box-sizing: border-box;
        }
        .ms-list { padding: 4px 0; }
        .ms-item {
            display: flex; align-items: center; gap: 8px;
            padding: 6px 12px; cursor: pointer;
            font-size: 0.85rem; color: var(--color-text-primary);
            transition: background 0.1s;
        }
        .ms-item:hover { background: #f0f6ff; }
        .ms-item input[type="checkbox"] { width: 14px; height: 14px; flex-shrink: 0; accent-color: var(--color-primary); cursor: pointer; }
        .ms-item label { cursor: pointer; flex: 1; }
        .ms-tag-count {
            display: inline-flex; align-items: center; justify-content: center;
            background: var(--color-primary); color: #fff;
            border-radius: 999px; font-size: 10px; font-weight: 700;
            min-width: 18px; height: 18px; padding: 0 5px;
        }
        /* Dark mode adjustments */
        [data-theme="dark"] #dashboard .stat-card,
        [data-theme="dark"] #dashboard .proxima-col,
        [data-theme="dark"] #dashboard .resumo-panel .card,
        [data-theme="dark"] #dashboard .entregas-panel .card {
            background: linear-gradient(180deg,#071428,#071826);
            border-color: rgba(99,102,241,0.12);
            box-shadow: 0 6px 18px rgba(0,0,0,0.45);
            color: #e6eefc;
        }
        [data-theme="dark"] #dashboard .stat-card .stat-watermark {
            color: #e2e8f0;
        }
        [data-theme="dark"] #dashboard .stat-card .stat-watermark .lucide,
        [data-theme="dark"] #dashboard .stat-card .stat-watermark svg {
            opacity: 0.16;
        }
        /* Linha de total */
        .tabela-padrao .linha-total {
            background: #e8f4f8;
            font-weight: bold;
        }
        /* Cabeçalho secundário (meses Gantt) */
        .tabela-padrao .header-meses {
            background: var(--color-primary-bg);
            color: var(--color-primary);
            font-size: 0.75rem;
        }
        /* Estilos isolados para a tabela do Gantt - manter consistente com .tabela-padrao */
        .gantt-table {
            width: 100%;
            border-collapse: separate;
            border-spacing: 0;
            font-size: 0.8rem;
            position: relative;
            z-index: 1;
        }
        #ganttVigencia,
        #ganttVigencia .gantt-wrap {
            position: relative;
            z-index: 1;
        }
        .gantt-table thead tr {
            background: var(--color-bg-surface);
            color: var(--color-text-primary);
        }
        .gantt-table th,
        .gantt-table td {
            padding: 0.5rem;
            border-right: 1px solid #ddd;
            border-bottom: 1px solid #ddd;
            vertical-align: middle;
            box-sizing: border-box;
        }
        .gantt-table th:first-child,
        .gantt-table td:first-child {
            border-left: 1px solid #ddd;
        }
        .gantt-table thead tr:first-child th {
            border-top: 1px solid #ddd;
        }
        .gantt-table th {
            font-weight: 600;
            white-space: nowrap;
        }
        /* Linha alternada para Gantt */
        .gantt-table tbody tr:nth-child(even) { background: #f9f9f9; }
        .gantt-table tbody tr:nth-child(odd) { background: #fff; }
        /* Cabeçalho secundário de meses no Gantt */
        .gantt-table .header-meses {
            background: var(--color-primary-bg);
            color: var(--color-primary);
            font-size: 0.75rem;
        }
        /* Congelar colunas UP e TED na tabela de vigência */
        .gantt-table .sticky-up,
        .gantt-table .sticky-ted {
            position: sticky;
        }
        /* Gantt deve ficar abaixo dos cabeçalhos congelados das demais tabelas */
        .gantt-table th.sticky-up,
        .gantt-table th.sticky-ted {
            z-index: 4;
            background: var(--color-bg-surface);
            color: var(--color-text-primary);
        }
        .gantt-table td.sticky-up,
        .gantt-table td.sticky-ted {
            z-index: 2;
            background: #fff;
        }
        .gantt-table tbody tr:nth-child(even) td.sticky-up,
        .gantt-table tbody tr:nth-child(even) td.sticky-ted {
            background: #f9f9f9;
        }
        .gantt-table .sticky-up {
            left: 0;
        }
        .gantt-table .sticky-ted {
            left: 140px;
            box-shadow: 4px 0 6px rgba(0,0,0,0.15);
        }
        /* Forçar Gantt atrás de cabeçalhos sticky das tabelas: reduzir stacking e z-index */
        .gantt-wrap { position: relative; z-index: 0 !important; isolation: isolate; }
        .gantt-table { position: relative; z-index: 0 !important; }
        .gantt-table thead th { z-index: 0 !important; }
        .gantt-vline { z-index: 0 !important; }
        .gantt-legenda, .gantt-legend { z-index: 0 !important; }
        /* Barra do Gantt (vigência) - legado, mantido para compatibilidade */
        .gantt-row-label { white-space: nowrap; font-weight:600; }
        /* Célula de mês do Gantt - container posicionado para vlines */
        td.gantt-m {
            position: relative;
            padding: 6px 0 !important;
        }
        /* Barra dentro de células de vigência */
        td.gantt-m .gantt-bar-seg {
            height: 16px;
            background: var(--color-primary-mid);
        }
        td.gantt-m.bar-start .gantt-bar-seg {
            margin-left: 4px;
            border-radius: 3px 0 0 3px;
        }
        td.gantt-m.bar-end .gantt-bar-seg {
            margin-right: 4px;
            border-radius: 0 3px 3px 0;
        }
        td.gantt-m.bar-start.bar-end .gantt-bar-seg {
            margin-left: 4px;
            margin-right: 4px;
            border-radius: 3px;
        }
        /* Linha vertical marcadora (ano / hoje) */
        .gantt-vline {
            position: absolute;
            top: 0;
            bottom: 0;
            left: 0;
            pointer-events: none;
            z-index: 5;
        }
        .gantt-vline-year {
            width: 3px;
            background: rgba(31,41,55,0.92);
        }
        .gantt-vline-today {
            width: 4px;
            background: #f97316;
        }
        /* Estilo aditivo: valor original tachado + novo valor */
        .valor-original-tachado {
            text-decoration: line-through;
            color: var(--color-text-muted);
            font-size: 0.85em;
        }
        .valor-aditivo-novo {
            color: var(--color-success);
            font-weight: 700;
            margin-left: 6px;
        }
        /* Barra de aditivo no Gantt - cores por aditivo */
        td.gantt-m .gantt-bar-seg.bar-aditivo-1 { background: #16a34a; }
        td.gantt-m .gantt-bar-seg.bar-aditivo-2 { background: #d97706; }
        td.gantt-m .gantt-bar-seg.bar-aditivo-3 { background: #dc2626; }
        td.gantt-m .gantt-bar-seg.bar-aditivo-4 { background: #7c3aed; }
        td.gantt-m .gantt-bar-seg.bar-aditivo-5 { background: #0891b2; }
        td.gantt-m .gantt-bar-seg.bar-aditivo-6 { background: #be185d; }
        td.gantt-m .gantt-bar-seg.bar-aditivo-7 { background: #4d7c0f; }
        td.gantt-m .gantt-bar-seg.bar-aditivo-8 { background: #9333ea; }
        /* Transição suave entre segmentos: remover border-radius interno */
        td.gantt-m.bar-seg-transition .gantt-bar-seg {
            border-radius: 0 !important;
            margin-left: 0 !important;
            margin-right: 0 !important;
        }
        /* Legenda do Gantt */
        .gantt-legenda {
            display: flex;
            flex-wrap: wrap;
            gap: 0.75rem;
            padding: 0.5rem 0.25rem;
            font-size: 0.8rem;
            color: var(--color-text-primary);
            align-items: center;
        }
        .gantt-legenda-item {
            display: flex;
            align-items: center;
            gap: 4px;
        }
        .gantt-legenda-cor {
            display: inline-block;
            width: 14px;
            height: 10px;
            border-radius: 2px;
        }
        /* Nova legenda compacta */
        .gantt-legend { display: flex; gap: 16px; margin-top: 8px; font-size: 11px; color: #6b6b6b; }
        .gantt-legend .legend-item { display: flex; align-items: center; gap: 5px; }
        .gantt-legend .dot { width: 10px; height: 6px; border-radius: 2px; display: inline-block; }
        /* Modal de aditivo */
        .aditivo-modal-overlay {
            display: none;
            position: fixed;
            top: 0; left: 0; right: 0; bottom: 0;
            background: rgba(0,0,0,0.72);
            backdrop-filter: blur(4px);
            -webkit-backdrop-filter: blur(4px);
            z-index: 1000;
            justify-content: center;
            align-items: center;
            padding: 1rem;
        }
        .aditivo-modal-overlay.active { display: flex; }
        .aditivo-modal {
            background: var(--color-bg-card);
            border-radius: 12px;
            padding: 1.25rem 1.5rem;
            min-width: 420px;
            max-width: 96%;
            box-shadow: 0 30px 80px rgba(0,0,0,0.55);
            border: 1px solid rgba(0,0,0,0.08);
            color: var(--color-text-primary);
        }
        .aditivo-modal h3 { margin: 0 0 1rem 0; color: var(--primary); }
        .aditivo-historico { margin-top: 1rem; font-size: 0.85rem; }
        .aditivo-historico table { width: 100%; border-collapse: collapse; color: var(--color-text-primary); }
        .aditivo-historico th, .aditivo-historico td { padding: 6px 8px; border-bottom: 1px solid var(--color-border); text-align: left; }
        .aditivo-historico th { background: var(--color-bg-surface); font-weight: 600; }
        .aditivo-historico td .btn-icon { margin: 0; width: 30px; height: 28px; font-size: 0.95rem; }
        .aditivo-historico .btn-icon.edit { background: transparent; color: var(--color-primary); border: 1px solid var(--color-border); }
        .aditivo-historico .btn-icon.edit:hover { background: var(--color-primary-bg); }
        .aditivo-historico .btn-icon.delete { background: transparent; color: var(--color-danger); border: 1px solid rgba(163,45,45,0.15); }
        .aditivo-historico .btn-icon.delete:hover { background: var(--color-danger-bg); }
        .aditivo-historico td.valor-aditivo { text-align: center; vertical-align: middle; white-space: nowrap; }
        .aditivo-historico td.valor-aditivo .valor-text { display:inline-block; min-width:6rem; }

        /* Forçar contraste no modal (labels/inputs) */
        .aditivo-modal { color: var(--color-text-primary); }
        .aditivo-modal label { color: var(--color-text-primary); font-weight:600; display:block; margin-bottom:6px; }
        .aditivo-modal input { color: var(--color-text-primary); background: var(--bg-secondary); border:1px solid var(--color-border); padding:0.5rem 0.75rem; border-radius:6px; width:100%; box-sizing:border-box; }
        .aditivo-modal input:focus { outline: 2px solid rgba(59,130,246,0.18); box-shadow: 0 4px 12px rgba(59,130,246,0.06); }
        .aditivo-modal select { color: var(--color-text-primary); background: var(--bg-secondary); border:1px solid var(--color-border); padding:0.5rem 0.75rem; border-radius:6px; width:100%; box-sizing:border-box; }
        .aditivo-modal textarea { color: var(--color-text-primary); background: var(--bg-secondary); border:1px solid var(--color-border); padding:0.5rem 0.75rem; border-radius:6px; width:100%; box-sizing:border-box; resize:vertical; min-height:60px; }
        /* Expanded aditivo modal */
        .aditivo-modal-expanded { min-width: 720px; max-width: 96vw; max-height: 90vh; overflow-y: auto; }
        .aditivo-modal-expanded .aditivo-clone-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; margin-bottom: 1rem; }
        .aditivo-modal-expanded .aditivo-clone-grid .form-group { margin-bottom: 0; }
        .aditivo-modal-expanded .aditivo-clone-grid label { font-size: 0.8rem; font-weight: 600; color: var(--color-text-secondary); margin-bottom: 4px; display: block; }
        .aditivo-modal-expanded .aditivo-clone-grid .full-width { grid-column: 1 / -1; }
        .aditivo-modal-expanded .aditivo-section-title { font-size: 0.9rem; font-weight: 700; color: var(--primary); margin: 1rem 0 0.5rem 0; padding-bottom: 0.25rem; border-bottom: 1px solid var(--color-border); }
        .aditivo-modal-expanded .campo-modificado input,
        .aditivo-modal-expanded .campo-modificado select,
        .aditivo-modal-expanded .campo-modificado textarea { border-color: #f59e0b !important; background: rgba(245,158,11,0.06) !important; }
        .aditivo-modal-expanded .campo-modificado label::after { content: ' (alterado)'; font-size: 0.75rem; color: #f59e0b; font-weight: 400; margin-left: 6px; }
        /* Change display in history table */
        .aditivo-change-badge { display: inline-block; font-size: 0.63rem; padding: 1px 5px; border-radius: 4px; margin: 1px 2px; line-height: 1.4; }
        .aditivo-change-old { background: rgba(239,68,68,0.10); color: #dc2626; text-decoration: line-through; }
        .aditivo-change-new { background: rgba(34,197,94,0.12); color: #16a34a; font-weight: 600; }
        .aditivo-change-field { font-weight: 600; color: var(--color-text-secondary); font-size: 0.75rem; }
        .aditivo-changes-list { display: flex; flex-direction: column; gap: 3px; max-width: 400px; }
        .aditivo-change-row { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
        /* Info view: valor com alteração via aditivo */
        .valor-alterado-aditivo { display: inline-flex; align-items: center; gap: 6px; }
        .valor-alterado-aditivo .valor-antigo { text-decoration: line-through; text-decoration-color: #ef4444; text-decoration-thickness: 2px; color: #64748b; font-size: 0.85em; }
        .valor-alterado-aditivo .valor-novo { color: #16a34a; font-weight: 700; }
        /* Tabela clone dentro do modal de aditivo */
        .aditivo-clone-table { width: 100%; border-collapse: collapse; font-size: 0.82rem; }
        .aditivo-clone-table th { background: rgba(59,130,246,0.06); color: var(--color-text-primary); font-weight: 600; padding: 6px 8px; text-align: left; border-bottom: 2px solid var(--color-border); white-space: nowrap; }
        .aditivo-clone-table td { padding: 5px 8px; border-bottom: 1px solid var(--border-light); color: var(--color-text-primary); }
        .aditivo-clone-table td[contenteditable="true"] { cursor: text; outline: none; }
        .aditivo-clone-table td[contenteditable="true"]:focus { background: rgba(59,130,246,0.06); outline: 2px solid rgba(59,130,246,0.2); border-radius: 2px; }
        .aditivo-clone-table tr:hover { background: rgba(59,130,246,0.03); }
        .aditivo-clone-table tr[data-removido="1"] td,
        .aditivo-clone-table tr[data-removido="1"] td * { text-decoration: line-through !important; text-decoration-color: #ef4444 !important; text-decoration-thickness: 2px !important; color: #64748b !important; }
        /* Destaque de células alteradas via aditivo/apostilamento nas tabelas principais */
        .celula-alterada-aditivo { position: relative; white-space: nowrap; }
        .celula-alterada-aditivo .val-antigo { text-decoration: line-through; text-decoration-color: #ef4444; text-decoration-thickness: 2px; color: #64748b; font-size: 0.92em; display: inline-block; margin-right:6px; }
        .celula-alterada-aditivo .alter-arrow { color: #9ca3af; margin: 0 6px; font-weight:600; }
        .celula-alterada-aditivo .val-novo { color: #16a34a; font-weight: 700; display: inline-block; }
        tr.linha-adicionada-aditivo { background: rgba(34,197,94,0.08) !important; }
        tr.linha-adicionada-aditivo td:first-child::before { content: '+'; color: #16a34a; font-weight: 700; margin-right: 4px; font-size: 12px; }
        tr.linha-excluida-aditivo { background: rgba(239,68,68,0.06) !important; }
        tr.linha-excluida-aditivo td,
        tr.linha-excluida-aditivo td * { text-decoration: line-through !important; text-decoration-color: #ef4444 !important; text-decoration-thickness: 2px !important; color: #64748b !important; }
        tr.linha-excluida-aditivo td:first-child::before { content: '×'; color: #ef4444; font-weight: 700; margin-right: 4px; font-size: 15px; text-decoration: none !important; display: inline-block; }
        tr.linha-removida-aditivo { background: rgba(239,68,68,0.06) !important; }
        tr.linha-removida-aditivo td,
        tr.linha-removida-aditivo td * { text-decoration: line-through !important; text-decoration-color: #ef4444 !important; text-decoration-thickness: 2px !important; color: #64748b !important; }
        /* Entregas - novo layout de cards */
        .entregas-controls { display:flex; gap:0.5rem; align-items:center; margin-bottom:0.5rem; }
        .entrega-grid, [class*="entregas-grid"], [class*="entrega-cards"], .entregas-cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; width: 100%; padding:1.125rem; }
        .entrega-card { background: var(--color-bg-surface); border-radius:8px; padding:14px; display:flex; flex-direction:column; gap:8px; box-sizing:border-box; }
        .entrega-card .entrega-nome { font-size:12px; color:var(--color-text-secondary); }
        .entrega-card .entrega-perc { font-size:20px; font-weight:500; }
        .entrega-card .entrega-progress { height:6px; border-radius:999px; background:#ffffff; overflow:hidden; position:relative; }
        .entrega-card .entrega-fill { height:100%; border-radius:999px; width:0%; transition:width 0.4s ease; }
        .entrega-card .entrega-badge { align-self:flex-start; margin-top:8px; }
        .entrega-card .entrega-badge .badge { color: #fff; font-weight:600; padding:4px 8px; border-radius:999px; font-size:0.8rem; }

        /* Garantir que badges/status não quebrem linha */
        .entrega-card .badge,
        .entrega-card [class*="badge"],
        .entrega-card [class*="status"] {
            white-space: nowrap;
            display: inline-block;
        }

        /* Wrapper rolável para o Resumo Financeiro */
        .resumo-fin-scroll { overflow-x: auto; width: 100%; -webkit-overflow-scrolling: touch; }
        .resumo-fin-scroll .resumo-anual-card { min-width: 600px; width: 100%; }

        /* Ajustes de largura/colunas para o grid do Resumo Anual */
        .resumo-anual-grid .resumo-header {
            font-size: 12px;
            font-weight: 500;
            color: #6b6b6b;
            text-align: right;
            padding-bottom: 8px;
            border-bottom: 0.5px solid rgba(0,0,0,0.08);
        }
        .resumo-anual-grid .resumo-label {
            min-width: 200px;
            max-width: 260px;
            font-size: 12px;
            color: #6b6b6b;
            white-space: normal;
            word-break: break-word;
            padding: 8px 16px 8px 0;
            text-align: left;
            line-height: 1.4;
            align-self: center;
        }
        .resumo-anual-grid .resumo-value {
            min-width: 130px;
            text-align: right;
            font-family: ui-monospace, monospace;
            font-size: 12px;
            white-space: nowrap;
            padding: 8px 12px;
        }
        .resumo-anual-grid .resumo-value.negative { color: #A32D2D; }
        .resumo-anual-grid .resumo-value.saldo {
            font-weight: 500;
            color: #1a1a1a;
            border-top: 0.5px solid rgba(0,0,0,0.10);
            padding-top: 8px;
        }

        /* Resumo Anual (grid transposto por ano) */
        .resumo-anual-card { background: #ffffff; border-radius:12px; padding:1.125rem; box-sizing:border-box; }
        .resumo-anual-grid { display:grid; gap:0; align-items:center; }
        .resumo-anual-grid .resumo-header { font-size:12px; font-weight:500; color:var(--color-text-secondary); text-align:center; padding-bottom:10px; }
        .resumo-anual-grid .resumo-label { font-size:12px; color:var(--color-text-secondary); padding:8px 10px; text-align:left; white-space:normal; word-break:break-word; line-height:1.4; align-self:center; }
        .resumo-anual-grid .resumo-value { font-family: 'Nunito Sans', ui-monospace, monospace; font-size:12px; text-align:center; padding:8px 10px; border-bottom: 0.5px solid rgba(0,0,0,0.06); }
        .resumo-anual-grid .resumo-value.negative { color: #A32D2D; }
        .resumo-anual-grid .resumo-value.saldo { font-weight:500; color:var(--color-text-primary); border-bottom: none; }

        /* Título pequeno azul para cards (consistente com detalhe-secao-titulo) */
        .card .card-title-blue {
            display: flex;
            align-items: center;
            gap: 0.55rem;
            margin: 0 0 0.5rem 0;
            padding: 0.45rem 0.9rem;
            font-size: 0.92rem;
            font-weight: 700;
            color: var(--color-primary);
            background: var(--color-bg-surface);
            border-radius: 0.5rem;
            letter-spacing: 0.02em;
            border: 1px solid var(--color-border);
        }
        .card .card-title-blue .inline-icon-sm,
        .card .card-title-blue svg {
            width: 18px;
            height: 18px;
            color: var(--color-primary);
            stroke: currentColor;
            fill: none;
            opacity: 0.92;
        }

        /* Override: when aditivo/ted-historico is inside detalhe-secao ensure light theme wins
           Use !important to ensure this block overrides earlier dark-oriented rules. */
        #detalhes #tedsDetalheContainer .detalhe-secao .aditivo-historico,
        #detalhes #tedsDetalheContainer .detalhe-secao .ted-info-historico {
            background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%) !important;
            border: 1px solid rgba(30,64,175,0.06) !important;
            color: #0f172a !important;
        }
        #detalhes #tedsDetalheContainer .detalhe-secao .aditivo-historico table,
        #detalhes #tedsDetalheContainer .detalhe-secao .ted-info-historico table {
            color: #0f172a !important;
        }
        #detalhes #tedsDetalheContainer .detalhe-secao .aditivo-historico th,
        #detalhes #tedsDetalheContainer .detalhe-secao .ted-info-historico th {
            background: rgba(15,23,42,0.02) !important;
            color: #0f172a !important;

        /* Padronização de fonte nas áreas de Detalhes solicitadas */
        #detalhes #tedsDetalheContainer .field-value,
        #detalhes #tedsDetalheContainer .aditivo-historico th,
        #detalhes #tedsDetalheContainer .aditivo-historico td,
        #detalhes #tedsDetalheContainer #tabelaFinanceiraCompleta th,
        #detalhes #tedsDetalheContainer #tabelaFinanceiraCompleta td {
            font-family: inherit !important;
            font-variant-numeric: normal !important;
        }
        }
        #detalhes #tedsDetalheContainer .detalhe-secao .aditivo-historico td,
        #detalhes #tedsDetalheContainer .detalhe-secao .ted-info-historico td {
            color: #0f172a !important;
            border-bottom: 1px solid rgba(15,23,42,0.04) !important;
        }

        /* Botões de ícone (editar/excluir) */
        .btn-icon {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            width: 32px;
            height: 32px;
            padding: 0;
            border: none;
            border-radius: var(--radius);
            cursor: pointer;
            font-size: 0.9rem;
            transition: var(--transition);
            background: transparent;
        }
        .btn-icon:hover {
            transform: scale(1.1);
        }
        .btn-icon.edit {
            background: var(--warning-light);
            color: #b45309;
        }
        .btn-icon.edit:hover {
            background: #fde68a;
            box-shadow: var(--shadow-sm);
        }
        .btn-icon.delete {
            background: var(--danger-light);
            color: var(--danger);
        }
        .btn-icon.delete:hover {
            background: #fecaca;
            box-shadow: var(--shadow-sm);
        }

        /* Toast/Notificação */
        .toast-container {
            position: fixed;
            top: 80px;
            right: 20px;
            z-index: 9999;
            display: flex;
            flex-direction: column;
            gap: 10px;
        }
        .toast {
            padding: 12px 20px;
            border-radius: var(--radius);
            background: white;
            box-shadow: var(--shadow-lg);
            display: flex;
            align-items: center;
            gap: 10px;
            animation: toastSlideIn 0.3s ease;
            max-width: 350px;
            font-size: 0.9rem;
        }
        .toast.success {
            border-left: 4px solid var(--success);
        }
        .toast.error {
            border-left: 4px solid var(--danger);
        }
        .toast.warning {
            border-left: 4px solid var(--warning);
        }
        .toast.info {
            border-left: 4px solid var(--primary);
        }
        @keyframes toastSlideIn {
            from { transform: translateX(100%); opacity: 0; }
            to { transform: translateX(0); opacity: 1; }
        }
        @keyframes toastSlideOut {
            from { transform: translateX(0); opacity: 1; }
            to { transform: translateX(100%); opacity: 0; }
        }

        /* Alerta melhorado */
        .alert-box {
            padding: 0.75rem 1rem;
            border-radius: var(--radius);
            margin-top: 0.75rem;
            display: flex;
            align-items: center;
            gap: 0.5rem;
            font-weight: 500;
            font-size: 0.875rem;
        }
        .alert-box.warning {
            background: var(--warning-light);
            border: 1px solid #fde68a;
            color: #92400e;
        }
        .alert-box.success {
            background: var(--success-light);
            border: 1px solid #a7f3d0;
            color: #166534;
        }
        .alert-box.danger {
            background: var(--danger-light);
            border: 1px solid #fecaca;
            color: #b91c1c;
        }

        /* Loading spinner */
        .spinner {
            width: 20px;
            height: 20px;
            border: 2px solid var(--color-border);
            border-top-color: var(--primary);
            border-radius: 50%;
            animation: spin 0.8s linear infinite;
        }
        @keyframes spin {
            to { transform: rotate(360deg); }
        }

        /* Scroll suave */
        html {
            scroll-behavior: smooth;
        }
        /* Modal para marcar realizada */
        .modal-backdrop { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.4); align-items: center; justify-content: center; z-index: 9999; }
        .modal-backdrop.open { display: flex; }
        .modal-realizada { background: var(--color-bg-card); border-radius: 0.5rem; padding: 1rem; width: 420px; max-width: 95%; box-shadow: var(--shadow-lg); }
        .modal-realizada h3 { margin-bottom: 0.5rem; font-size: 1rem; }
        .modal-realizada .form-row { display:flex; gap:0.5rem; margin-bottom:0.5rem; }
        .modal-realizada label { font-size: 0.85rem; color: var(--color-text-secondary); }
        .modal-realizada input { width:100%; padding:0.4rem 0.5rem; border:1px solid var(--color-border); border-radius:0.375rem; }
        .modal-realizada input:focus { outline:2px solid var(--primary); box-shadow:0 0 0 3px rgba(59,130,246,0.08); }
        .modal-realizada .actions { display:flex; gap:0.5rem; justify-content:flex-end; margin-top:0.5rem; }
        .modal-realizada .error { color:#b91c1c; background:#fff1f2; border:1px solid #fecaca; padding:0.4rem; border-radius:0.35rem; font-size:0.9rem; margin-bottom:0.5rem; display:none; }
        .modal-realizada .error.open { display:block; }

        /* Modal Cadastro de Objetos */
        .modal-objeto-backdrop { display:none; position:fixed; inset:0; background:rgba(0,0,0,0.45); align-items:center; justify-content:center; z-index:10000; }
        .modal-objeto-backdrop.open { display:flex; }
        .modal-objeto { background:var(--color-bg-card); border-radius:0.625rem; padding:1.5rem; width:460px; max-width:95vw; box-shadow:var(--shadow-lg); }
        .modal-objeto h3 { margin:0 0 1rem; font-size:1.1rem; display:flex; align-items:center; gap:0.5rem; }
        .modal-objeto .form-group { margin-bottom:0.85rem; }
        .modal-objeto label { display:block; font-size:0.85rem; font-weight:600; color:var(--color-text-secondary); margin-bottom:0.25rem; }
        .modal-objeto input { width:100%; padding:0.5rem 0.6rem; border:1px solid var(--color-border); border-radius:0.375rem; font-size:0.95rem; background:var(--color-bg-card); color:var(--color-text-primary); }
        .modal-objeto input:focus { outline:2px solid var(--primary); box-shadow:0 0 0 3px rgba(59,130,246,0.08); }
        .modal-objeto .modal-objeto-actions { display:flex; gap:0.5rem; justify-content:flex-end; margin-top:1rem; }
        .modal-objeto .modal-objeto-error { color:#b91c1c; background:#fff1f2; border:1px solid #fecaca; padding:0.4rem 0.6rem; border-radius:0.35rem; font-size:0.9rem; margin-bottom:0.75rem; display:none; }
        .modal-objeto .modal-objeto-error.open { display:block; }
                /* Exceção: tabela de resumo assinados/encerrados -> fonte escura (mantém comportamento) */
                #resumoGeralGrid table thead th {
                    background: transparent;
                    color: #1a1a1a;
                    border-bottom: none;
                }

        /* Garantir fonte mínima no Relatório Mensal do Dashboard */
        #resumoGeralContainer #relatorioMensalContainer table th,
        #resumoGeralContainer #relatorioMensalContainer table td {
            font-size: 11px;
        }
        /* Cabeçalhos de meses/anos do Gantt (estilo específico) */
        .tabela-padrao .header-meses,
        .gantt-table .header-meses {
            background: #E6F1FB;
            color: #0C447C;
            font-size: 0.75rem;
        }

        /* Corpo das tabelas: fonte e espaçamento unificados */
        table tbody td,
        .tabela-padrao tbody td,
        .table-wrapper tbody td,
        .table-freeze-wrapper tbody td {
            font-size: 13px;
            font-weight: 400;
            color: #1a1a1a;
            padding: 9px 12px;
            vertical-align: middle;
            border-bottom: 1px solid rgba(0,0,0,0.06);
            /* evitar quebra vertical de texto dentro de células */
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            word-break: normal;
        }

        /* ===== Fix global: evitar quebra em células, badges e valores ===== */
        td, th {
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        td span,
        td .badge,
        td .badge-pill,
        td .status-badge,
        td [class*="badge"],
        td [class*="pill"],
        td [class*="status"] {
            white-space: nowrap;
            display: inline-block;
            overflow: hidden;
        }

        td.valor,
        td.saldo,
        td.valor-total,
        td.valor-unit,
        td [class*="valor"],
        td [class*="saldo"] {
            white-space: nowrap;
        }

        td.up-col,
        th.up-col,
        td[data-col="up"],
        .gantt-up-cell {
            white-space: nowrap;
            min-width: 48px;
            text-align: center;
        }

        td.execucao-col,
        td[data-col="execucao"],
        th.execucao-col {
            min-width: 160px;
            white-space: nowrap;
        }

        /* Numerais tabulares para colunas numéricas — IBM Plex Mono para alinhamento perfeito */
        .tabela-padrao .col-saldo,
        .tabela-padrao .col-valor,
        td.valor,
        td.saldo,
        td.nd-code {
            font-family: 'Nunito Sans', ui-monospace, monospace;
            font-variant-numeric: tabular-nums;
            font-size: 13px;
        }

        /* Alinhamento de colunas numéricas */
        .tabela-padrao .col-valor,
        td.col-valor,
        td.valor { text-align: right; }

        /* Zebra e hover padrão (padrão claro); regras mais específicas em #detalhes continuam válidas */
        .tabela-padrao tbody tr:nth-child(even) td { background: #ffffff; }
        .tabela-padrao tbody tr:hover td { background: #F4F8FE; }

        /* Rodapé / linhas de total */
        .tabela-padrao tfoot td,
        .tabela-padrao .linha-total td {
            background: #F4F4F2;
            font-weight: 600;
            font-size: 13px;
            border-top: 1px solid rgba(0,0,0,0.12);
            text-align: center;
        }

        /* CadFin: largura determinada pelo colgroup, não estica para preencher wrapper */
        #tabelaFinanceiraCompleta {
            width: auto;
            table-layout: fixed;
        }

        /* Cadastro Financeiro: quando meses ocultos a tabela tem largura fixa (~620px) */
        #tabelaFinanceiraCompleta.months-collapsed {
            width: auto !important;
            min-width: 0 !important;
            table-layout: fixed !important;
        }
        #tabelaFinanceiraCompleta.months-collapsed th,
        #tabelaFinanceiraCompleta.months-collapsed td {
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }
        /* Larguras fixas em px para as 7 colunas visíveis — soma=800px */
        #tabelaFinanceiraCompleta col.col-nd      { width: 120px; }
        #tabelaFinanceiraCompleta col.col-up      { width: 70px; }
        #tabelaFinanceiraCompleta col.col-m       { width: 50px; }
        #tabelaFinanceiraCompleta col.col-mes     { width: 130px; }
        #tabelaFinanceiraCompleta col.col-valor   { width: 200px; }
        #tabelaFinanceiraCompleta col.col-percent { width: 160px; }
        #tabelaFinanceiraCompleta col.col-acao    { width: 70px; }
        /* Container: encolhe ao tamanho da tabela, scroll quando necessário */
        #wrapperCadFin {
            display: block;
            width: 100%;
            max-width: 800px;
            overflow-x: auto;
            border: 1px solid #ddd;
            border-radius: 0.25rem;
            position: relative;
        }
        /* Card da seção encolhe junto quando meses ocultos */
        .detalhe-secao.cadFin-collapsed {
            display: block;
            width: 100%;
            min-width: 0;
            max-width: 100%;
        }
        .detalhe-secao.cadFin-collapsed .detalhe-secao-header {
            display: flex;
            width: 100%;
        }

/* ===== Sub-entregas Cadastro Físico ===== */
.subentregas-row td { background: #F7F9FC; padding: 0.5rem 1rem 0.75rem 2.5rem !important; }
.subentregas-container { border-left: 3px solid #85B7EB; padding-left: 0.75rem; }
.subentregas-titulo { font-size: 12px; font-weight: 700; color: #0C447C; margin-bottom: 0.5rem; }
.subentrega-item { display: flex; align-items: center; gap: 0.5rem; font-size: 12px; padding: 4px 0; border-bottom: 0.5px solid rgba(0,0,0,0.06); }
.subentrega-item:last-child { border-bottom: none; }
.btn-add-entrega { background: #185FA5; color: #ffffff; border: none; border-radius: 6px; padding: 6px 14px; font-size: 12px; font-weight: 600; cursor: pointer; margin-top: 0.5rem; }
.btn-add-entrega:hover { background: #0C447C; }
.mini-form-entrega { background: #ffffff; border: 1px solid #B3D1EF; border-radius: 8px; padding: 0.75rem; margin-top: 0.5rem; display: none; }
.mini-form-entrega.open { display: block; }
.mini-form-entrega .form-row { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0.5rem; margin-bottom: 0.5rem; }
.mini-form-entrega label { font-size: 11px; font-weight: 600; color: #475569; display: block; margin-bottom: 2px; }
.mini-form-entrega input { width: 100%; padding: 0.35rem 0.5rem; border: 1px solid #cbd5e1; border-radius: 0.375rem; font-size: 12px; }
.mini-form-entrega .form-actions { display: flex; gap: 0.5rem; justify-content: flex-end; margin-top: 0.5rem; }
.status-icon-vazio { color: #94a3b8; font-size: 16px; cursor: pointer; }
.status-icon-parcial { color: #f59e0b; font-size: 16px; cursor: pointer; }
.status-icon-concluido { color: #10b981; font-size: 16px; cursor: pointer; }
.progress-inline { display: inline-flex; align-items: center; gap: 6px; }
.progress-inline .progress-bar { width: 60px; height: 4px; margin: 0; display: inline-block; }
.entrega-sincronizacao-banner { background: #E6F1FB; border: 1px solid #85B7EB; border-radius: 8px; padding: 10px 14px; margin-bottom: 0.75rem; font-size: 12px; color: #0C447C; display: flex; align-items: center; gap: 8px; }

/* ============================================================
   GANTT-TABLE: Correção definitiva de z-index para colunas
   congeladas vs cabeçalho (sticky top) do Gantt de Vigência
   Hierarquia: thead th.sticky-* (50) > th.sticky-* (40) >
               thead th geral (30) > td.sticky-* (20)
   ============================================================ */

/* Remover isolamento do wrapper imediato — stacking context
   não deve ser criado no wrapper direto da tabela */
.gantt-wrap { isolation: auto !important; }

/* 1. Cabeçalhos de ano/mês (sticky top) — base da hierarquia */
.gantt-table thead th {
    z-index: 30 !important;
    position: sticky;
    top: 0;
    background: var(--color-bg-surface, #F4F4F2) !important;
}

/* 2. Colunas congeladas em th (cabeçalho de coluna fixa) */
.gantt-table th.sticky-up,
.gantt-table th.sticky-ted {
    z-index: 40 !important;
    background: var(--color-bg-surface, #F4F4F2) !important;
}

/* 3. Colunas congeladas em td (corpo da tabela) */
.gantt-table td.sticky-up,
.gantt-table td.sticky-ted {
    z-index: 20 !important;
    background: #ffffff !important;
}

/* 4. Células de canto: frozen + header — prioridade máxima */
.gantt-table thead th.sticky-up,
.gantt-table thead th.sticky-ted {
    z-index: 50 !important;
    background: var(--color-bg-surface, #F4F4F2) !important;
}

/* 5. Linhas alternadas: fundo opaco nas colunas congeladas */
.gantt-table tbody tr:nth-child(even) td.sticky-up,
.gantt-table tbody tr:nth-child(even) td.sticky-ted {
    background: #f9f9f9 !important;
}

/* 6. Hover nas linhas: fundo opaco nas colunas congeladas */
.gantt-table tbody tr:hover td.sticky-up,
.gantt-table tbody tr:hover td.sticky-ted {
    background: #f1f5f9 !important;
}

/* ============================================================
   DARK MODE: backgrounds opacos nas colunas congeladas do Gantt
   ============================================================ */
[data-theme="dark"] .gantt-table th.sticky-up,
[data-theme="dark"] .gantt-table th.sticky-ted {
    background: #1a2f55 !important;
}
[data-theme="dark"] .gantt-table td.sticky-up,
[data-theme="dark"] .gantt-table td.sticky-ted {
    background: #0b172c !important;
}
[data-theme="dark"] .gantt-table tbody tr:nth-child(even) td.sticky-up,
[data-theme="dark"] .gantt-table tbody tr:nth-child(even) td.sticky-ted {
    background: #0e1c33 !important;
}
[data-theme="dark"] .gantt-table tbody tr:hover td.sticky-up,
[data-theme="dark"] .gantt-table tbody tr:hover td.sticky-ted {
    background: #123057 !important;
}

/* ===== Relatório ND/UP/Ano ===== */
.relatorio-filtros {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    align-items: center;
    padding: 0.6rem 0.75rem;
    background: var(--color-bg-surface, #f8f9fa);
    border: 0.5px solid var(--color-border, #e0e0e0);
    border-radius: 8px;
    justify-content: flex-start;
}
.relatorio-filtro-grupo {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    position: relative;
}
.relatorio-filtro-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary, #6b7280);
    white-space: nowrap;
}
.rel-multiselect {
    position: relative;
}
.rel-multiselect-btn {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.25rem 0.55rem;
    font-size: 12px;
    font-weight: 500;
    background: #fff;
    border: 1px solid var(--color-border, #d1d5db);
    border-radius: 6px;
    cursor: pointer;
    color: var(--color-text-primary, #111827);
    white-space: nowrap;
    min-width: 90px;
    justify-content: space-between;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.rel-multiselect-btn:hover {
    border-color: var(--primary, #0C447C);
    box-shadow: 0 0 0 2px rgba(12,68,124,0.08);
}
.rel-multiselect-menu {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    min-width: 180px;
    max-height: 240px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid var(--color-border, #d1d5db);
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
    z-index: 900;
    padding: 0.3rem 0;
}
.rel-multiselect-menu.open {
    display: block;
}
.rel-menu-acoes {
    display: flex;
    gap: 0.3rem;
    padding: 0.3rem 0.5rem 0.4rem;
    border-bottom: 0.5px solid var(--color-border, #e5e7eb);
}
.rel-menu-acoes button {
    font-size: 11px;
    padding: 0.15rem 0.45rem;
    border: 1px solid var(--color-border, #d1d5db);
    border-radius: 4px;
    background: var(--color-bg-surface, #f3f4f6);
    cursor: pointer;
    color: var(--primary, #0C447C);
    font-weight: 600;
}
.rel-menu-acoes button:hover {
    background: var(--primary, #0C447C);
    color: #fff;
    border-color: var(--primary, #0C447C);
}
.rel-menu-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.3rem 0.6rem;
    font-size: 12px;
    cursor: pointer;
    color: var(--color-text-primary, #111827);
    transition: background 0.1s;
}
.rel-menu-item:hover {
    background: var(--color-bg-surface, #f3f4f6);
}
.rel-menu-item input[type="checkbox"] {
    accent-color: var(--primary, #0C447C);
    width: 13px;
    height: 13px;
    flex-shrink: 0;
}
.rel-ndupano-tabela th, .rel-ndupano-tabela td {
    padding: 7px 10px;
    font-size: 12px;
}
.rel-ndupano-tabela th {
    background: var(--color-bg-surface, #f8f9fa);
    font-weight: 600;
    color: var(--primary, #0C447C);
    white-space: nowrap;
    text-align: left;
}
.rel-ndupano-tabela th.col-rel-ano {
    text-align: center;
    min-width: 110px;
}
.rel-ndupano-tabela td {
    border-bottom: 0.5px solid rgba(0,0,0,0.05);
}
.rel-ndupano-tabela tbody tr:hover td {
    background: rgba(12,68,124,0.04);
}
.rel-total-row td {
    background: var(--color-bg-surface, #f0f4fa) !important;
    border-top: 1.5px solid var(--primary, #0C447C);
    border-bottom: none !important;
    font-weight: 700 !important;
    color: var(--primary, #0C447C) !important;
}
.rel-td-merged {
    vertical-align: middle;
    white-space: nowrap;
    background: var(--color-bg-surface, #f8f9fa);
    border-right: 2px solid var(--color-border, #e5e7eb);
}
.rel-td-ted {
    font-weight: 600;
    color: var(--primary, #0C447C);
}
.rel-td-nd {
    color: var(--color-text-primary, #111827);
}
[data-theme="dark"] .rel-multiselect-btn,
[data-theme="dark"] .rel-multiselect-menu {
    background: #1a2a3a;
    color: #e2e8f0;
    border-color: #2d3f55;
}
[data-theme="dark"] .rel-menu-item:hover {
    background: #1e3248;
}
[data-theme="dark"] .rel-menu-acoes {
    border-color: #2d3f55;
}
[data-theme="dark"] .rel-menu-acoes button {
    background: #1e3248;
    border-color: #2d3f55;
    color: #93c5fd;
}
[data-theme="dark"] .rel-menu-acoes button:hover {
    background: #185FA5;
    color: #fff;
}

/* ===== Auto-generated classes (extract_inline.py) ===== */
.auto-style-001 { display: none; }
.auto-style-002 { margin-bottom: 0.5rem; }
.auto-style-003 { display: grid; gap: 0.75rem; grid-template-columns: 1fr 1fr; }
.auto-style-004 { color: var(--text); padding: 0.75rem; }
.auto-style-005 { margin-left: 0.5rem; }
.auto-style-006 { align-items: center; display: flex; gap: 0.5rem; }
.auto-style-007 { font-weight: 600; }
.auto-style-008 { margin: 0; }
.auto-style-009 { margin-bottom: 1.5rem; }
.auto-style-010 { color: var(--primary); font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em; margin: 0 0 0.75rem 0; text-transform: uppercase; }
.auto-style-011 { border: none; border-top: 1px solid var(--border); margin: 0 0 1.25rem 0; }
.auto-style-012 { background: var(--surface); color: var(--text-muted); }
.auto-style-013 { width: 100%; }
.auto-style-014 { color: var(--text); padding: 1rem; text-align: center; }
.auto-style-015 { border: 1px solid #ddd; border-radius: 0.25rem; position: relative; }
.auto-style-016 { background: var(--color-bg-surface); border: 0.5px solid var(--color-border); border-radius: 8px; padding: 1rem; }
.auto-style-017 { display: block; font-weight: 600; margin-bottom: 0.5rem; }

/* ═══════════════════════════════════════
   ABA RELATÓRIOS — estilos refatorados
   ═══════════════════════════════════════ */

.rel-header {
  padding: 1.1rem 1.25rem 0.75rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}
.rel-header-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 0.75rem;
}
.rel-page-title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
}
.rel-page-sub {
  margin: 2px 0 0;
  font-size: 0.78rem;
  color: var(--text-muted);
}
.rel-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}
.btn-rel-export {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  font-size: 0.78rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
  transition: background 0.15s;
}
.btn-rel-export:hover { background: var(--bg-secondary); }
.btn-rel-excel { background: #1a5c27; color: #fff; border-color: #1a5c27; }
.btn-rel-excel:hover { background: #154f21; }
.btn-rel-refresh {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  font-size: 0.78rem;
  border: 1px solid var(--primary);
  border-radius: 6px;
  background: var(--primary);
  color: #fff;
  cursor: pointer;
}
.btn-rel-refresh:hover { opacity: 0.9; }

.rel-filtros-globais {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 0.78rem;
  color: var(--text-muted);
  padding-bottom: 0.5rem;
}
.rel-filtros-label { font-weight: 500; color: var(--text-muted); white-space: nowrap; }
.rel-filtro-item { display: flex; align-items: center; gap: 5px; }
.rel-filtro-tag {
  font-size: 0.7rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 7px;
  color: var(--text-muted);
  font-weight: 500;
  white-space: nowrap;
}
.rel-select-multi {
  font-size: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 3px 6px;
  background: var(--bg);
  color: var(--text);
  max-width: 140px;
  height: 28px;
}
.btn-rel-limpar {
  font-size: 0.72rem;
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 3px 9px;
  background: var(--bg);
  color: var(--text-muted);
  cursor: pointer;
}
.btn-rel-limpar:hover { background: var(--bg-secondary); }

.rel-catalogo { padding: 1rem 1.25rem 0.5rem; }
.rel-secao-label {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  margin: 0 0 0.6rem;
}
.rel-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 10px;
}
.rel-card {
  position: relative;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 14px 12px;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
  overflow: hidden;
}
.rel-card:hover { border-color: var(--primary); }
.rel-card.rel-card-ativo {
  border-color: var(--primary);
  border-width: 1.5px;
  background: var(--bg-secondary);
}
.rel-card-accent {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  border-radius: 10px 10px 0 0;
}
.rel-card-icon {
  width: 30px; height: 30px;
  border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 9px;
}
.rel-card-icon svg { width: 15px; height: 15px; }
.ic-blue   { background: #dbeafe; color: #1e40af; }
.ic-green  { background: #dcfce7; color: #166534; }
.ic-amber  { background: #fef3c7; color: #92400e; }
.ic-purple { background: #ede9fe; color: #5b21b6; }
.ic-teal   { background: #ccfbf1; color: #115e59; }
.ic-coral  { background: #fee2e2; color: #991b1b; }

.rel-card-nome {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}
.rel-card-desc {
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.45;
}
.rel-card-tipo {
  display: inline-block;
  margin-top: 8px;
  font-size: 0.65rem;
  background: var(--bg-secondary);
  color: var(--text-muted);
  border-radius: 4px;
  padding: 2px 7px;
  border: 1px solid var(--border);
}
.rel-card-new {
  position: absolute;
  top: 9px; right: 9px;
  font-size: 0.62rem;
  background: #dbeafe;
  color: #1e40af;
  border-radius: 4px;
  padding: 1px 6px;
  font-weight: 600;
}

.rel-preview-area {
  margin: 0.75rem 1.25rem 1.5rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}
.rel-preview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
}
.rel-preview-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
}
.rel-preview-exports { display: flex; gap: 6px; }
.btn-rel-sm {
  font-size: 0.72rem;
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 3px 10px;
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
}
.btn-rel-sm:hover { background: var(--bg-secondary); }
.rel-preview-body { padding: 1rem 1.25rem; }

.rel-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
  margin-bottom: 1rem;
}
.rel-kpi-card {
  background: var(--bg-secondary);
  border-radius: 8px;
  padding: 10px 13px;
}
.rel-kpi-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.rel-kpi-val {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text);
  font-family: 'Nunito Sans', monospace;
}
.rel-kpi-sub {
  font-size: 0.68rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.rel-bar-wrap { display: flex; align-items: center; gap: 7px; }
.rel-bar-bg {
  flex: 1;
  height: 5px;
  background: var(--border);
  border-radius: 3px;
  min-width: 60px;
}
.rel-bar-fill { height: 100%; border-radius: 3px; }
.rel-bar-val { font-size: 0.72rem; color: var(--text-muted); min-width: 34px; text-align: right; }

.rel-badge {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 600;
}
.rel-badge-ok     { background: #dcfce7; color: #166534; }
.rel-badge-warn   { background: #fef3c7; color: #92400e; }
.rel-badge-danger { background: #fee2e2; color: #991b1b; }
.rel-badge-info   { background: #dbeafe; color: #1e40af; }

.rel-busca-nf-wrap {
  display: flex; gap: 8px; align-items: center; margin-bottom: 1rem;
}
.rel-busca-nf-wrap input {
  flex: 1; max-width: 320px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 7px;
  font-size: 0.82rem;
  background: var(--bg);
  color: var(--text);
}

.inline-icon-sm { width: 13px; height: 13px; vertical-align: -2px; }

.rel-menu-acoes {
  display: flex;
  gap: 4px;
  padding: 5px 8px 4px;
  border-bottom: 1px solid var(--border);
}
.rel-menu-acoes button {
  flex: 1;
  font-size: 0.68rem;
  padding: 3px 6px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--bg);
  color: var(--text-muted);
  cursor: pointer;
}
.rel-menu-acoes button:hover { background: var(--primary); color: #fff; border-color: var(--primary); }

.rel-menu-item {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 5px 10px;
  font-size: 0.78rem;
  cursor: pointer;
  color: var(--text, #1e293b);
  transition: background 0.12s;
}
.rel-menu-item:hover { background: var(--color-bg-surface); }
.rel-menu-item input[type="checkbox"] { width: 14px; height: 14px; accent-color: var(--primary); }

/* ============================================================
   VISÃO GERAL REDESIGN — Hero, KPIs, Timeline, Aditivos, Objetos
   ============================================================ */

/* Hero TED */
.ted-hero {
  background: linear-gradient(135deg, #0C447C 0%, #185FA5 100%);
  color: #fff; border-radius: 14px; padding: 20px 24px;
  display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap;
  margin-bottom: 14px; box-shadow: 0 4px 16px rgba(12,68,124,0.18);
}
.ted-hero-left { min-width: 0; flex: 1; }
.overview-two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px; align-items: start; }
@media (max-width: 1100px) { .overview-two-col { grid-template-columns: 1fr; } }
.ted-hero-id {
  font-family: 'Nunito Sans', monospace; font-size: 12px;
  color: rgba(255,255,255,0.70); margin-bottom: 6px; letter-spacing: 0.04em;
  display: flex; align-items: baseline; gap: 6px;
}
.ted-hero-id .num { font-weight: 700; font-size: 22px; color: #fff; letter-spacing: 0.03em; line-height: 1; }
.ted-hero-title {
  font-size: 15px; font-weight: 600; line-height: 1.3; margin-bottom: 4px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: rgba(255,255,255,0.90);
}
.ted-hero-sub { font-size: 12px; color: rgba(255,255,255,0.78); }
.ted-hero-status {
  display: inline-flex; align-items: center; gap: 7px;
  background: rgba(255,255,255,0.18); padding: 7px 15px;
  border-radius: 999px; font-size: 12.5px; font-weight: 600; white-space: nowrap;
}
.ted-hero-status .dot {
  width: 8px; height: 8px; border-radius: 50%; background: #BFEAA9;
  box-shadow: 0 0 8px rgba(191,234,169,0.7); animation: pulse-dot 2s infinite;
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; } 50% { opacity: 0.5; }
}
.ted-hero-status.status-vencido { background: rgba(163,45,45,0.35); }
.ted-hero-status.status-vencido .dot { background: #fca5a5; box-shadow: 0 0 8px rgba(252,165,165,0.7); }
.ted-hero-status.status-finalizado { background: rgba(99,153,34,0.3); }
.ted-hero-status.status-finalizado .dot { background: #BFEAA9; animation: none; }
.ted-hero-cd {
  text-align: right; padding-left: 16px;
  border-left: 1px solid rgba(255,255,255,0.18);
}
.ted-hero-cd-num {
  font-size: 32px; font-weight: 700; font-family: 'Nunito Sans', monospace;
  line-height: 1; color: #fff;
}
.ted-hero-cd-label {
  font-size: 9px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.08em; color: rgba(255,255,255,0.65); margin-top: 4px;
}

/* KPI Cards */
.kpi-grid {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px; margin-bottom: 14px;
}
@media (max-width: 900px) { .kpi-grid { grid-template-columns: repeat(2, 1fr); } }
.kpi {
  background: #fff; border: 0.5px solid rgba(0,0,0,0.10);
  border-radius: 12px; padding: 15px 16px; position: relative; overflow: hidden;
}
.kpi.lead-blue   { border-left: 3px solid #185FA5; }
.kpi.lead-green  { border-left: 3px solid #639922; }
.kpi.lead-red    { border-left: 3px solid #A32D2D; }
.kpi.lead-amber  { border-left: 3px solid #c07a1c; }
.kpi-icon {
  position: absolute; right: 11px; top: 11px;
  width: 26px; height: 26px; border-radius: 7px;
  display: inline-flex; align-items: center; justify-content: center;
}
.kpi-icon.b-blue  { background: #E6F1FB; color: #0C447C; }
.kpi-icon.b-green { background: #EAF3DE; color: #3B6D11; }
.kpi-icon.b-red   { background: #FCEBEB; color: #A32D2D; }
.kpi-icon.b-amber { background: #FAEEDA; color: #854F0B; }
.kpi-label {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.06em; color: #94a3b8; margin-bottom: 5px;
}
.kpi-val {
  font-size: 17px; font-weight: 600; font-family: 'Nunito Sans', monospace;
  color: #1a1a1a; line-height: 1.2; margin-bottom: 3px;
}
.kpi-val .cur { font-size: 10px; color: #94a3b8; margin-right: 2px; font-weight: 500; }
.kpi-val.green { color: #3B6D11; }
.kpi-val.red   { color: #A32D2D; }
.kpi-sub { font-size: 11px; color: #64748b; line-height: 1.35; }
.kpi-bar { height: 4px; background: #F7F9FC; border-radius: 3px; margin-top: 7px; overflow: hidden; }
.kpi-bar-fill { height: 100%; border-radius: 3px; transition: width 0.5s ease; }
.kpi-chips { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 5px; }
.kpi-chip {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 10.5px; font-weight: 600;
  font-family: 'Nunito Sans', monospace;
  padding: 2px 8px; border-radius: 999px;
}
.kpi-chip.blue  { background: #E6F1FB; color: #0C447C; }
.kpi-chip.amber { background: #FAEEDA; color: #854F0B; }
.kpi-chip.green { background: #EAF3DE; color: #3B6D11; }
.kpi-chip.red   { background: #FCEBEB; color: #A32D2D; }

/* Timeline de Vigência */
.vig-card {
  background: #fff; border: 0.5px solid rgba(0,0,0,0.10);
  border-radius: 12px; padding: 10px 16px; margin-bottom: 10px;
  overflow: visible;
}
.vig-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 2px; flex-wrap: wrap; gap: 6px;
}
.vig-title {
  font-size: 12.5px; font-weight: 600; color: #1a1a1a;
  display: flex; align-items: center; gap: 8px;
}
.vig-pror-pill {
  background: #EAF3DE; color: #3B6D11; font-size: 9.5px; font-weight: 700;
  padding: 2px 8px; border-radius: 999px; letter-spacing: 0.04em;
}
.vig-meta { font-size: 11px; color: #64748b; font-family: 'Nunito Sans', monospace; }
/* ── Timeline de Vigência (SVG) ───────────────────────────────────── */
.vig-bar-wrap {
  display: block; margin: 0 4px;
  pointer-events: none;
}
.vig-bar-wrap svg { display: block; overflow: visible; }
.vig-legend {
  display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px;
  font-size: 10.5px; color: #64748b;
}
.vig-legend-item { display: inline-flex; align-items: center; gap: 5px; }
.vig-legend-sw { width: 14px; height: 8px; border-radius: 2px; flex-shrink: 0; }

/* Aditivos como cards */
.aditivo-cards-list { display: flex; flex-direction: column; gap: 8px; }
.aditivo-card-new {
  background: #fff; border: 0.5px solid rgba(0,0,0,0.10);
  border-radius: 10px; padding: 11px 14px; display: flex; gap: 12px;
  align-items: flex-start;
}
.aditivo-num-badge {
  width: 34px; height: 34px; border-radius: 8px; flex-shrink: 0;
  background: #E6F1FB; color: #0C447C;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Nunito Sans', monospace; font-size: 12px; font-weight: 700;
}
.aditivo-num-badge.apostilamento { background: #EAF3DE; color: #3B6D11; }
.aditivo-card-body { flex: 1; min-width: 0; }
.aditivo-card-line1 {
  display: flex; align-items: center; gap: 8px; margin-bottom: 5px; flex-wrap: wrap;
}
.aditivo-card-tipo { font-size: 12.5px; font-weight: 600; color: #1a1a1a; }
.aditivo-card-date { font-size: 11px; color: #64748b; font-family: 'Nunito Sans', monospace; }
.change-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.change-chip-new {
  display: inline-flex; align-items: center; gap: 4px;
  background: #F7F9FC; border: 0.5px solid rgba(0,0,0,0.10);
  padding: 2px 8px; border-radius: 6px; font-size: 11px;
}
.change-chip-new .ch-field { color: #64748b; font-weight: 500; }
.change-chip-new .ch-old  { text-decoration: line-through; text-decoration-color: #ef4444; text-decoration-thickness: 2px; color: #64748b; font-family: 'Nunito Sans', monospace; font-size: 10.5px; }
.change-chip-new .ch-arrow { color: #94a3b8; margin: 0 2px; }
.change-chip-new .ch-new  { color: #3B6D11; font-weight: 600; font-family: 'Nunito Sans', monospace; font-size: 10.5px; }
.change-chip-new.amber .ch-new { color: #854F0B; }
.aditivo-card-actions { display: flex; gap: 5px; align-items: center; flex-shrink: 0; pointer-events: auto; position: relative; z-index: 10; }
.aditivo-card-obs {
  display: flex; align-items: center; gap: 5px; margin-top: 5px;
  font-size: 11px; color: #64748b; font-style: italic;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* Estilo para aditivos/apostilamentos excluídos: exibir riscado e diminuir destaque */
.aditivo-card-new.excluido { opacity: 0.6; background: #fafafa; }
.aditivo-num-badge.excluido { background: #f1f5f9; color: #94a3b8; }
.aditivo-card-new.excluido .aditivo-card-tipo,
.aditivo-card-new.excluido .aditivo-card-date,
.aditivo-card-new.excluido .change-chip-new .ch-field,
.aditivo-card-new.excluido .change-chip-new .ch-new { text-decoration: line-through; text-decoration-color: #ef4444; text-decoration-thickness: 2px; }
.aditivo-card-new.excluido .change-chip-new .ch-old { text-decoration: line-through; text-decoration-color: #ef4444; text-decoration-thickness: 2px; color: #64748b; }

/* Objetos com share-bar */
.obj-card-new {
  background: #fff; border: 0.5px solid rgba(0,0,0,0.10);
  border-radius: 12px; overflow: hidden;
}
/* colunas: Objeto | Qtde | V.Unitário | V.Total | Ações */
.obj-row-new {
  display: grid;
  grid-template-columns: 1fr 110px 150px 160px 56px;
  gap: 10px; align-items: center;
  padding: 9px 14px; border-bottom: 1px solid rgba(0,0,0,0.05);
  font-size: 12.5px;
}
.obj-row-new:last-child { border-bottom: none; }
.obj-row-new.linha-adicionada-aditivo { background: #f0fdf4; }
.obj-row-new.linha-excluida-aditivo { background: rgba(239,68,68,0.06); }
.obj-row-new.linha-excluida-aditivo .obj-name-new,
.obj-row-new.linha-excluida-aditivo .obj-num-new,
.obj-row-new.linha-excluida-aditivo .obj-sub-new,
.obj-row-new.linha-excluida-aditivo .obj-total-new { text-decoration: line-through; text-decoration-color: #ef4444; text-decoration-thickness: 2px; color: #64748b; }
.obj-name-new { font-weight: 600; color: #1a1a1a; }
.obj-sub-new  { font-size: 10.5px; color: #94a3b8; margin-top: 1px; }
.obj-num-new  { font-family: 'Nunito Sans', monospace; font-size: 11.5px; color: #64748b; text-align: right; white-space: nowrap; }
.obj-share-bar-new { height: 5px; background: #F7F9FC; border-radius: 3px; overflow: hidden; width: 100%; }
.obj-share-fill-new { height: 100%; background: #185FA5; border-radius: 3px; transition: width 0.4s; }
.obj-total-new { font-family: 'Nunito Sans', monospace; font-size: 12.5px; font-weight: 600; color: #1a1a1a; text-align: right; white-space: nowrap; }
.obj-actions-new { display: flex; gap: 4px; justify-content: flex-end; }
.obj-tfoot-new {
  display: grid;
  grid-template-columns: 1fr 110px 150px 160px 56px;
  gap: 10px; align-items: center;
  padding: 8px 14px; background: #F7F9FC; border-top: 1px solid rgba(0,0,0,0.07);
  font-size: 11.5px; color: #64748b;
}
.obj-tfoot-total { font-family: 'Nunito Sans', monospace; font-size: 13px; font-weight: 700; color: #0C447C; text-align: right; white-space: nowrap; }

/* Situação do TED — card condicional */
.situacao-ted-card {
  background: #fff; border: 0.5px solid rgba(0,0,0,0.10);
  border-radius: 10px; padding: 13px 16px; margin-top: 10px;
}
.situacao-ted-card.finalizado { border-left: 3px solid #639922; }
.situacao-ted-card.denunciado { border-left: 3px solid #A32D2D; }

/* ============================================================
   EXECUÇÃO FÍSICA — REDESIGN (ef-*)
   ============================================================ */
.ef-kpis { display: grid; grid-template-columns: repeat(4,1fr); gap: 10px; margin-bottom: 14px; max-width: 800px; }
@media (max-width: 900px) { .ef-kpis { grid-template-columns: repeat(2,1fr); } }
.ef-kpi {
  background: #fff; border: 0.5px solid rgba(0,0,0,0.10);
  border-radius: 11px; padding: 13px 16px; position: relative;
}
.ef-kpi.lead-blue  { border-left: 3px solid #185FA5; }
.ef-kpi.lead-green { border-left: 3px solid #639922; }
.ef-kpi.lead-amber { border-left: 3px solid #c07a1c; }
.ef-kpi.lead-gray  { border-left: 3px solid #94a3b8; }
.ef-kpi-label {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.06em; color: #94a3b8; margin-bottom: 5px;
}
.ef-kpi-val {
  font-size: 19px; font-weight: 600; font-family: 'Nunito Sans', monospace;
  color: #1a1a1a; line-height: 1.1;
}
.ef-kpi-val .small { font-size: 12px; color: #94a3b8; font-weight: 500; margin-left: 4px; }
.ef-kpi-sub { font-size: 11.5px; color: #64748b; margin-top: 3px; }
.ef-kpi-bar { height: 4px; background: #F7F9FC; border-radius: 3px; margin-top: 7px; overflow: hidden; }
.ef-kpi-bar-fill { height: 100%; border-radius: 3px; }

.ef-filters {
  display: flex; gap: 6px; padding: 9px 14px;
  background: #F7F9FC; border-bottom: 1px solid rgba(0,0,0,0.08);
  align-items: center; flex-wrap: wrap;
}
.ef-filters .ef-filter-label {
  font-size: 10.5px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.06em; color: #94a3b8; margin-right: 4px; white-space: nowrap;
}
.ef-chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 11px; border-radius: 999px;
  font-size: 11.5px; cursor: pointer; font-family: inherit;
  border: 1px solid rgba(0,0,0,0.10); background: #fff; color: #64748b;
  transition: all 0.15s;
}
.ef-chip:hover { background: #F7F9FC; }
.ef-chip.active { background: #0C447C; color: #fff; border-color: #0C447C; font-weight: 600; }
.ef-chip .ef-chip-pill {
  background: rgba(0,0,0,0.07); padding: 1px 6px; border-radius: 999px;
  font-size: 10px; margin-left: 2px;
}
.ef-chip.active .ef-chip-pill { background: rgba(255,255,255,0.22); color: #fff; }

/* Wrappers Cadastro Físico e Execução Física — visual igual ao table-wrapper do Financeiro */
#wrapperCadFis {
    display: block;
    width: 100%;
    max-width: 800px;
    overflow-x: auto;
    border: 1px solid var(--border-light, #e2e8f0);
    border-radius: 8px;
    background: #fff;
}
#wrapperExecFis {
    display: block;
    width: 100%;
    max-width: 800px;
    overflow-x: auto;
    border: 1px solid var(--border-light, #e2e8f0);
    border-radius: 8px;
    background: #fff;
}
#tabelaCadFisTable {
    width: 100%;
    table-layout: fixed;
    min-width: 0;
}
#tabelaExecFisTable {
    width: 100%;
    table-layout: auto;
    min-width: 0;
}
#tabelaExecFisTable .col-objeto { width: 280px; max-width: 320px; }
#tabelaExecFisTable .col-saldo { width: 60px; min-width: 60px; text-align: center; }
#tabelaExecFisTable .col-percent { width: 220px; min-width: 220px; max-width: 260px; white-space: nowrap; }

.ef-table { width: 100%; border-collapse: collapse; }
.ef-table thead th {
  background: #F4F4F2; color: #64748b;
  font-size: 10.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.05em;
  padding: 9px 12px; text-align: left;
  border-bottom: 1px solid rgba(0,0,0,0.08);
  white-space: nowrap;
}
.ef-table thead th.center { text-align: center; }
.ef-table thead th.right  { text-align: center; }
.ef-table tbody tr { border-bottom: 1px solid rgba(0,0,0,0.05); transition: background 0.1s; }
.ef-table tbody tr:last-child { border-bottom: none; }
.ef-table tbody tr:hover { background: #FAFBFC; }
.ef-table tbody tr.ef-row-done { background: #FBFEF8; }
.ef-table tbody tr.ef-row-done:hover { background: #F4FCEC; }
.ef-table tbody tr.ef-row-hidden { display: none; }
.ef-table tbody td { padding: 9px 12px; font-size: 12.5px; vertical-align: middle; color: #1a1a1a; }
.ef-table tbody td.center { text-align: center; }
.ef-table tbody td.right  { text-align: right; }

.ef-row-status {
  width: 26px; height: 26px; border-radius: 7px;
  display: inline-flex; align-items: center; justify-content: center; font-size: 13px;
}
.ef-row-status.done    { background: #EAF3DE; color: #3B6D11; }
.ef-row-status.pending { background: #F7F9FC; color: #94a3b8; }
.ef-row-status.partial { background: #FAEEDA; color: #854F0B; }

.ef-fase-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 30px; height: 22px; border-radius: 6px;
  background: #E6F1FB; color: #0C447C;
  font-family: 'Nunito Sans', monospace; font-size: 11.5px; font-weight: 700;
  padding: 0 6px; white-space: nowrap;
}

.ef-obj-idem { color: #c0c8d4; font-style: italic; font-size: 12px; }
.ef-obj-distinct {
  background: #FCEBEB; color: #A32D2D; padding: 1px 7px;
  border-radius: 999px; font-size: 10.5px; font-weight: 600; margin-left: 6px;
}

.ef-qty-wrap { display: inline-flex; flex-direction: column; align-items: flex-end; gap: 3px; min-width: 90px; }
.ef-qty-line { display: flex; gap: 4px; align-items: baseline; font-family: 'Nunito Sans', monospace; }
.ef-qty-line .num   { font-size: 13px; font-weight: 600; }
.ef-qty-line .denom { font-size: 11px; color: #94a3b8; }
.ef-qty-bar { width: 100%; height: 3px; background: #F1F5F9; border-radius: 2px; overflow: hidden; }
.ef-qty-bar-fill      { height: 100%; background: #639922; border-radius: 2px; }
.ef-qty-bar-fill.amber { background: #c07a1c; }

.ef-periodo { font-size: 12.5px; text-align: center; }
.ef-periodo-meses { font-family: 'Nunito Sans', monospace; font-size: 11.5px; color: #1a1a1a; font-weight: 500; text-align: center; }
.ef-periodo-datas { font-size: 11.5px; color: #64748b; margin-top: 2px; text-align: center; }
.ef-adit-pill {
  display: inline-flex; align-items: center; gap: 3px;
  background: #FAEEDA; color: #854F0B;
  font-size: 10px; font-weight: 600; padding: 2px 7px;
  border-radius: 4px; margin-top: 4px; letter-spacing: 0.02em; white-space: nowrap;
}

.ef-row-actions { display: inline-flex; gap: 4px; }
.ef-row-actions button {
  width: 26px; height: 26px; border-radius: 6px;
  border: 0.5px solid rgba(0,0,0,0.10); background: transparent;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; color: #64748b; font-family: inherit;
}
.ef-row-actions button:hover { background: #F7F9FC; color: #185FA5; }
.ef-row-actions button.delete:hover { color: #A32D2D; background: #FCEBEB; }
.ef-row-actions button.ef-confirm { background: #EAF3DE; color: #3B6D11; border-color: rgba(99,153,34,0.3); }
.ef-row-actions button.ef-confirm:hover { background: #D4ECB8; }

.ef-empty-filter {
  text-align: center; padding: 24px; color: #94a3b8;
  font-size: 12.5px; font-style: italic;
}
/* sobrescrever tabela padrão quando ef-table está ativo */
table.ef-table thead th { padding: 9px 12px; }
table.ef-table thead th.center { text-align: center; }
table.ef-table thead th.right  { text-align: center; }
table.ef-table tbody td.center { text-align: center; }
table.ef-table tbody td.right  { text-align: right; }

/* ============================================================
   CADASTRO FINANCEIRO — redesign
   ============================================================ */
.cf-kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 14px;
  max-width: 800px;
}
@media (max-width: 900px) { .cf-kpis { grid-template-columns: repeat(2, 1fr); } }
.cf-kpi {
  border-radius: 10px;
  padding: 12px 14px;
  background: #fff;
  border: 1px solid rgba(0,0,0,0.08);
  display: flex; flex-direction: column; gap: 2px;
}
.cf-kpi.lead-blue  { border-left: 4px solid #3B82F6; }
.cf-kpi.lead-green { border-left: 4px solid #22c55e; }
.cf-kpi.lead-amber { border-left: 4px solid #F59E0B; }
.cf-kpi.lead-purple{ border-left: 4px solid #a855f7; }
.cf-kpi-label { font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: #6b7280; }
.cf-kpi-val   { font-size: 18px; font-weight: 700; color: #111; line-height: 1.2; white-space: nowrap; }
.cf-kpi-sub   { font-size: 11px; color: #6b7280; }
.cf-kpi.lead-blue .cf-kpi-val { font-size: clamp(13px, 1.6vw, 18px); }

/* ND tags */
.nd-tag { display: inline-block; padding: 2px 7px; border-radius: 5px; font-size: 13px; font-weight: 600; font-family: 'Nunito Sans', -apple-system, sans-serif; white-space: nowrap; }
.nd-tag.invest  { background: transparent; color: #1d4ed8; }
.nd-tag.custeio { background: transparent; color: #92400e; }
.nd-tag.outros  { background: transparent; color: #374151; }

/* UP pills */
.up-pill { display: inline-block; padding: 2px 7px; border-radius: 99px; font-size: 13px; font-weight: 600; font-family: 'Nunito Sans', -apple-system, sans-serif; white-space: nowrap; }
.up-pill.fi { background: #dcfce7; color: #15803d; }
.up-pill.ua { background: #fce7f3; color: #9d174d; }
.up-pill.outros { background: #f3f4f6; color: #374151; }
/* UGs adicionais (usadas em Repasse às UGs) — mesmas cores de .up-badge-fe/fjf/fpv já
   existentes em outras telas, só que no formato pill; fmce ganha uma cor própria. */
.up-pill.fe   { background: #F4F4F2; color: #5F5E5A; }
.up-pill.fjf  { background: #E6F1FB; color: #0C447C; }
.up-pill.fpv  { background: #E6F1FB; color: #0C447C; }
.up-pill.fmce { background: #f3e8ff; color: #7e22ce; }

/* Group header row */
.cf-grp-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 7px 12px;
  margin-bottom: 4px;
  cursor: pointer;
  user-select: none;
}
.cf-grp-head:hover { background: #f1f5f9; }
.cf-grp-head-left { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.cf-grp-toggle { font-size: 10px; color: #94a3b8; transition: transform 0.15s; }
.cf-grp-toggle.open { transform: rotate(90deg); }
.mes-pill { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: 11.5px; font-weight: 700; background: #e0f2fe; color: #0369a1; white-space: nowrap; }
.cf-grp-subtotal {
  display: flex;
  align-items: baseline;
  justify-content: flex-end;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  color: #374151;
  white-space: nowrap;
  flex-shrink: 0;
  margin-left: auto;
  padding-right: 8px;
  overflow: visible;
}
.cf-grp-subtotal-recebido,
.cf-grp-subtotal-total {
  display: inline-block;
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}
.cf-grp-subtotal-recebido { color: #16a34a; }
.cf-grp-subtotal-sep { color: #94a3b8; font-weight: 400; flex-shrink: 0; }
.cf-grp-count { font-size: 11px; color: #94a3b8; }

/* Inner table within each group */
.cf-grp-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 10px;
  font-size: 13px;
}
.cf-grp-table thead th {
  background: #f9fafb;
  padding: 5px 10px;
  font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .03em;
  color: #6b7280;
  border-bottom: 1px solid #e5e7eb;
  white-space: nowrap;
}
.cf-grp-table tbody tr { border-bottom: 1px solid #f3f4f6; transition: background 0.1s; }
.cf-grp-table tbody tr:hover { background: #f8fafc; }
.cf-grp-table tbody td { padding: 6px 10px; vertical-align: middle; }
.cf-grp-table tbody td.right { text-align: center; }
.cf-grp-table tbody td.center { text-align: center; }

/* val-share mini bar — mantido para compatibilidade */
.val-share { display: flex; align-items: center; gap: 5px; width: 100%; }
.val-share-bar { flex: 1; height: 5px; border-radius: 99px; background: #e5e7eb; overflow: hidden; min-width: 30px; }
.val-share-fill { height: 100%; border-radius: 99px; background: #3b82f6; }
.val-share-pct { font-size: 11px; color: #374151; white-space: nowrap; min-width: 36px; text-align: right; font-family: 'Nunito Sans', monospace; }

/* coluna "A Receber" — formato diferenciado do valor da ND */
.saldo-receber {
    display: inline-block;
    font-size: 0.72rem;
    font-family: 'Nunito Sans', 'Courier New', monospace;
    font-weight: 500;
    color: #b45309;
    background: #fef3c7;
    border: 1px solid #fde68a;
    border-radius: 4px;
    padding: 2px 6px;
    white-space: nowrap;
    letter-spacing: 0.01em;
}
.saldo-receber--zero {
    color: #15803d;
    background: #dcfce7;
    border-color: #86efac;
    font-family: inherit;
    font-weight: 600;
    font-size: 0.72rem;
    letter-spacing: 0;
}

/* total footer card */
.cf-total-card {
  display: flex; justify-content: space-between; align-items: center;
  background: #eff6ff; border: 1px solid #bfdbfe; border-radius: 8px;
  padding: 8px 14px; margin-top: 4px; font-size: 13px; font-weight: 700; color: #1d4ed8;
}
.cf-total-card .cf-total-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: #3b82f6; }

/* aditivo changed row highlight inside cf-grp-table */
.cf-grp-table tbody tr.linha-adicionada-aditivo { box-shadow: inset 3px 0 0 #22c55e; }
.cf-grp-table tbody tr.linha-adicionada-aditivo td { background: #f0fdf4; }
.cf-grp-table tbody tr.linha-alterada-aditivo { box-shadow: inset 3px 0 0 #f59e0b; }
.cf-grp-table tbody tr.linha-alterada-aditivo td { background: #fffaf0; }
/* Linha SUPRIMIDA por aditivo/apostilamento: fora de toda soma. Antes o risco cobria
   a linha inteira (ND, UP, botões inclusive), o que virava ruído — sete células
   tachadas para comunicar um único fato. Agora: opacidade reduzida + faixa lateral
   cinza para o estado, e o tachado fica só no valor (que é o dado que efetivamente
   deixou de valer). */
.cf-grp-table tbody tr.linha-excluida-aditivo {
    opacity: 0.6;
    box-shadow: inset 3px 0 0 #94a3b8;
}
.cf-grp-table tbody tr.linha-excluida-aditivo td { background: rgba(148,163,184,0.07) !important; color: #64748b !important; }
.cf-grp-table tbody tr.linha-excluida-aditivo td .col-valor-sup,
.cf-grp-table tbody tr.linha-excluida-aditivo td .col-valor-sup * {
    text-decoration: line-through !important;
    text-decoration-color: #94a3b8 !important;
    text-decoration-thickness: 2px !important;
}
/* O × inicial não deve ser riscado */
.cf-grp-table tbody tr.linha-excluida-aditivo td:first-child::before {
    content: '×'; color: #94a3b8; font-weight: 700; margin-right: 4px; font-size: 13px;
    text-decoration: none !important; display: inline-block;
}
/* Pills da ND/UP em estado "removido": dessaturar para reforçar visual */
.cf-grp-table tbody tr.linha-excluida-aditivo td .nd-tag,
.cf-grp-table tbody tr.linha-excluida-aditivo td .up-pill {
    filter: grayscale(1);
}
/* Linhas suprimidas ficam escondidas por padrão dentro do bloco recolhido */
.cf-grp-table tbody tr.cf-sup-item { display: none; }
/* Bloco recolhido "N lançamentos suprimidos" */
.cf-grp-sup-toggle {
    background: #fbfcfe; color: #64748b; font-size: 0.72rem; cursor: pointer; user-select: none;
}
.cf-grp-sup-toggle:hover { background: #f4f7fb; }
.cf-grp-sup-toggle td { padding: 5px 12px !important; border-bottom: 1px solid #f1f4f8; }
.cf-grp-sup-toggle .car { display:inline-block; width:10px; }
.cf-grp-sup-toggle b { color: #b91c1c; font-variant-numeric: tabular-nums; }
/* Chip de atribuição (qual aditivo/apostilamento originou a alteração) */
.cf-chip-alt {
    display:inline-block; font-size:9.5px; font-weight:700; letter-spacing:.3px;
    padding:1px 5px; border-radius:4px; margin-left:5px; cursor:help; vertical-align:1px;
}
.cf-chip-alt.tipo-aditivo { background:#dcfce7; color:#15803d; }
.cf-chip-alt.tipo-apostilamento { background:#dbeafe; color:#1d4ed8; }

/* Legenda da seção Repasse às UGs */
.legenda-repasse { display:flex; gap:16px; flex-wrap:wrap; font-size:11.5px; color:var(--color-text-secondary); padding:10px 2px 0; }
.legenda-repasse span { display:inline-flex; align-items:center; gap:6px; }
.legenda-repasse .dot { width:9px; height:9px; border-radius:3px; display:inline-block; }

/* Indicador inline (Cadastro Financeiro, coluna A Receber): mostra se o valor pendente
   já está em caixa na SEDE (aguardando só o repasse interno) ou se ainda depende do
   repassador — sem precisar abrir a seção Repasse às UGs pra saber. */
.repasse-hint { display:inline-block; margin-left:5px; font-size:9px; cursor:help; vertical-align:1px; }
.repasse-hint.pronto  { color:#854F0B; }
.repasse-hint.aguarda { color:#A32D2D; opacity:.55; }

/* Interruptor Vigente / Comparado / Original do Cadastro Financeiro */
.cf-modo-seg {
    display: inline-flex; border: 1px solid var(--border, #e2e8f0); border-radius: 8px;
    overflow: hidden; background: var(--bg-secondary, #fff); margin-right: auto;
}
.cf-modo-seg button {
    border: 0; background: transparent; padding: 5px 13px; font-size: 12px;
    color: var(--text-secondary, #64748b); cursor: pointer; font-weight: 600; font-family: inherit;
}
.cf-modo-seg button + button { border-left: 1px solid var(--border, #e2e8f0); }
.cf-modo-seg button.on { background: var(--primary, #0c447c); color: #fff; }
.table-actions-bar:has(.cf-modo-seg) { justify-content: flex-start; gap: 10px; }

/* ============================================================
   ABAS INTERNAS — DETALHES TED (dt-tab-*)
   ============================================================ */
.dt-tab-switch {
  display: flex;
  gap: 2px;
  background: var(--bg, #fff);
  border: 1px solid var(--border, rgba(0,0,0,0.07));
  border-radius: 9px;
  padding: 3px;
  width: fit-content;
  margin: 14px 0 18px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  flex-wrap: wrap;
}
.dt-tab-btn {
  padding: 7px 16px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  font-size: 13px;
  font-family: inherit;
  color: var(--text-muted, #64748b);
  background: transparent;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}
.dt-tab-btn:hover { color: var(--text, #1a1a1a); background: var(--surface-alt, #f1f5f9); }
.dt-tab-btn.active { background: var(--primary, #0C447C); color: #fff; font-weight: 600; }
.dt-tab-btn .new-pill {
  background: #f5b50b;
  color: #4a3a04;
  font-size: 9px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 3px;
  margin-left: 6px;
  vertical-align: 2px;
  letter-spacing: 0.04em;
}
.dt-tab-panel { display: none; }
.dt-tab-panel.active { display: block; }

/* ============================================================
   FATURAMENTO
   ============================================================ */

/* KPIs */
.fat-kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.fat-kpi {
  background: var(--bg, #fff);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 10px;
  padding: 14px 16px;
}
.fat-kpi-label {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted, #64748b);
  margin-bottom: 4px;
}
.fat-kpi-value {
  font-size: 1.2rem;
  font-weight: 700;
  font-family: 'Nunito Sans', monospace;
  color: var(--text, #0f172a);
  line-height: 1.2;
}
.fat-kpi-delta { font-size: 0.72rem; margin-top: 4px; font-weight: 600; }
.fat-kpi-delta.pos { color: #166534; }
.fat-kpi-delta.neg { color: #991b1b; }
.fat-kpi-sub { font-size: 0.68rem; color: var(--text-muted, #64748b); margin-top: 3px; }

/* Tip */
.fat-tip {
  background: #EFF6FF;
  border: 1px solid #BFDBFE;
  border-radius: 8px;
  padding: 9px 14px;
  font-size: 0.76rem;
  color: #1e3a5f;
  margin-bottom: 14px;
  line-height: 1.5;
}
.fat-tip a { color: var(--primary); font-weight: 600; text-decoration: none; }
.fat-tip a:hover { text-decoration: underline; }

/* Badges */
.fat-badge {
  font-size: 0.62rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 20px;
  white-space: nowrap;
  letter-spacing: 0.03em;
}
.fat-badge.pago      { background: #EAF3DE; color: #3B6D11; }
.fat-badge.planejado { background: #E6F1FB; color: #185FA5; }
.fat-badge.atrasado  { background: #FEE2E2; color: #A32D2D; }
.fat-badge.em-curso  { background: #FEF9C3; color: #854d0e; }

/* Diff chip */
.fat-diff-chip {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
  white-space: nowrap;
}
.fat-diff-chip.pos  { background: #EAF3DE; color: #3B6D11; }
.fat-diff-chip.neg  { background: #FEE2E2; color: #A32D2D; }
.fat-diff-chip.zero { background: #f1f5f9; color: #64748b; }

/* Blocos por fase */
.fat-fase-block {
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 10px;
  margin-bottom: 14px;
  overflow: hidden;
}
.fat-fase-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--surface-alt, #f8fafc);
  cursor: pointer;
  user-select: none;
  flex-wrap: wrap;
}
.fat-fase-head:hover { background: #eef2f7; }
.fat-fase-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--primary, #0C447C);
  min-width: 60px;
}
.fat-fase-totais {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-family: 'Nunito Sans', monospace;
  flex: 1;
}
.fat-fase-chevron { font-size: 0.8rem; color: var(--text-muted); transition: transform 0.2s; margin-left: auto; }
.fat-fase-block.collapsed .fat-fase-chevron { transform: rotate(-90deg); }
.fat-fase-body { background: var(--bg); overflow-x: auto; }
.fat-fase-block.collapsed .fat-fase-body { display: none; }

/* Tabela comparativa */
.fat-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
}
.fat-table thead tr { background: var(--surface-alt, #f8fafc); }
.fat-table th {
  padding: 7px 12px;
  text-align: left;
  font-size: 0.67rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.fat-th-obj    { width: 22%; }
.fat-th-prev   { width: 26%; }
.fat-th-exec   { width: 30%; }
.fat-th-delta  { width: 14%; }
.fat-th-status { width: 8%; text-align: center; }

.fat-tr { border-top: 1px solid var(--border, #e2e8f0); }
.fat-tr:hover { background: var(--surface-alt, #f8fafc); }

.fat-td-obj {
  padding: 10px 12px;
  font-weight: 600;
  color: var(--text);
  vertical-align: top;
}
.fat-td-prev, .fat-td-exec {
  padding: 10px 12px;
  vertical-align: top;
}
.fat-td-delta {
  padding: 10px 12px;
  vertical-align: top;
}
.fat-td-status {
  padding: 10px 12px;
  text-align: center;
  vertical-align: top;
}

/* Coluna Previsto */
.fat-cell-prev {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.fat-cell-data {
  font-weight: 700;
  color: var(--primary, #0C447C);
  font-size: 0.82rem;
}
.fat-cell-qtde {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-family: 'Nunito Sans', monospace;
}
.fat-cell-valor {
  font-size: 0.78rem;
  font-weight: 700;
  font-family: 'Nunito Sans', monospace;
  color: var(--text);
}

/* Coluna Executado */
.fat-cell-exec {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.fat-cell-exec-vazio {
  color: var(--text-muted);
  font-style: italic;
  font-size: 0.72rem;
  padding: 4px 0;
}
.fat-entrega-item {
  display: grid;
  grid-template-columns: 68px 60px 1fr auto;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  background: #F0FDF4;
  border: 1px solid #BBF7D0;
  border-radius: 6px;
}
.fat-entrega-data {
  font-weight: 700;
  color: #166534;
  font-size: 0.75rem;
}
.fat-entrega-qtde {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-family: 'Nunito Sans', monospace;
}
.fat-entrega-valor {
  font-size: 0.75rem;
  font-weight: 700;
  font-family: 'Nunito Sans', monospace;
  color: #166534;
}
.fat-nf {
  font-size: 0.65rem;
  color: #64748b;
  background: #f1f5f9;
  padding: 1px 5px;
  border-radius: 3px;
  white-space: nowrap;
}

/* Diferença de datas */
.fat-delta-data {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 5px;
  display: inline-block;
}
.fat-delta-data.pos  { background: #EAF3DE; color: #3B6D11; }
.fat-delta-data.neg  { background: #FEE2E2; color: #A32D2D; }
.fat-delta-data.zero { background: #E6F1FB; color: #185FA5; }

/* Rodapé da tabela */
.fat-tfoot-row { background: var(--surface-alt, #f8fafc); }
.fat-tfoot-label {
  padding: 7px 12px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  border-top: 2px solid var(--border);
}
.fat-tfoot-val {
  padding: 7px 12px;
  font-size: 0.78rem;
  font-weight: 700;
  font-family: 'Nunito Sans', monospace;
  color: #166534;
  border-top: 2px solid var(--border);
}
.fat-tfoot-diff {
  padding: 7px 12px;
  font-size: 0.72rem;
  font-weight: 700;
  font-family: 'Nunito Sans', monospace;
  border-top: 2px solid var(--border);
}
.fat-tfoot-diff.pos  { color: #3B6D11; }
.fat-tfoot-diff.neg  { color: #A32D2D; }
.fat-tfoot-diff.zero { color: #64748b; }

/* Totais gerais */
.fat-totais {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
  margin-top: 20px;
  padding: 14px 16px;
  background: var(--surface-alt, #f8fafc);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.fat-totais-item-label { font-size: 0.65rem; font-weight: 600; text-transform: uppercase; color: var(--text-muted); margin-bottom: 3px; letter-spacing: 0.04em; }
.fat-totais-item-value { font-size: 1rem; font-weight: 700; font-family: 'Nunito Sans', monospace; }
.fat-totais-item-value.neg { color: #A32D2D; }

.fat-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* ============================================================
   EXECUÇÃO FINANCEIRA — REDESIGN (execfin-*)
   ============================================================ */

/* wrapper — não estica, abraça a tabela */
#wrapperExecFin {
    display: block;
    width: 100%;
    max-width: 800px;
    overflow-x: auto;
    padding-left: 0;
    margin-left: 0;
}
#wrapperExecFin #tabelaExecFinanceiraTable {
    width: 100%;
}

/* KPI strip */
.execfin-kpis { display: grid; grid-template-columns: repeat(4,1fr); gap: 10px; margin-bottom: 14px; max-width: 800px; }
@media (max-width: 900px) { .execfin-kpis { grid-template-columns: repeat(2,1fr); } }
.execfin-kpi {
  background: #fff; border: 0.5px solid rgba(0,0,0,0.10);
  border-radius: 11px; padding: 13px 16px;
}
.execfin-kpi.lead-blue  { border-left: 3px solid #185FA5; }
.execfin-kpi.lead-green { border-left: 3px solid #639922; }
.execfin-kpi.lead-amber { border-left: 3px solid #c07a1c; }
.execfin-kpi.lead-red   { border-left: 3px solid #A32D2D; }
.execfin-kpi-label {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.06em; color: #94a3b8; margin-bottom: 5px;
}
.execfin-kpi-val {
  font-size: 17px; font-weight: 600; font-family: 'Nunito Sans', monospace;
  color: #1a1a1a; line-height: 1.15;
}
.execfin-kpi-val .cur { font-size: 11px; color: #94a3b8; margin-right: 3px; font-weight: 500; }
.execfin-kpi-val.red   { color: #A32D2D; }
.execfin-kpi-val.green { color: #3B6D11; }
.execfin-kpi-sub { font-size: 11.5px; color: #64748b; margin-top: 3px; }
.execfin-kpi-bar { height: 4px; background: #F7F9FC; border-radius: 3px; margin-top: 7px; overflow: hidden; }
.execfin-kpi-bar-fill { height: 100%; border-radius: 3px; }

/* Barra de ações acima da tabela */
.table-actions-bar {
    display: flex; gap: 8px; align-items: center;
    padding: 8px 0 8px 0; margin-bottom: 4px;
}

/* Table wrapper */
.execfin-table-wrap { overflow-x: auto; background: #fff; }

#tabelaExecFinanceiraTable {
    width: 100%;
    min-width: 0;
    table-layout: fixed;
    border-collapse: collapse;
    border-spacing: 0;
}

/* colunas fixas — ND+UP+VPrev+VReal+Saldo = 800px */
#tabelaExecFinanceiraTable col.col-nd     { width: 100px; }
#tabelaExecFinanceiraTable col.col-up     { width: 60px; }
#tabelaExecFinanceiraTable col.col-vprev  { width: 213px; }
#tabelaExecFinanceiraTable col.col-vreal  { width: 213px; }
#tabelaExecFinanceiraTable col.col-saldo  { width: 214px; }
#tabelaExecFinanceiraTable col.col-status { width: 90px; }

/* box-sizing nas células */
#tabelaFinanceiraCompleta th, #tabelaFinanceiraCompleta td,
#tabelaExecFinanceiraTable th, #tabelaExecFinanceiraTable td {
    box-sizing: border-box;
}

/* ND e UP — alinhamento igual ao CadFin */
#tabelaExecFinanceiraTable th.col-nd,
#tabelaExecFinanceiraTable td.col-nd { text-align: center; }

/* Centralizar colunas de valor na ExecFinanceira consolidada */
#tabelaExecFinanceiraTable td.col-valor,
#tabelaExecFinanceiraTable td.col-saldo { text-align: center; }

/* Cabeçalhos das tabelas financeiras: fonte uniforme, caixa alta, centralizado */
#tabelaFinanceiraCompleta thead th,
#tabelaExecFinanceiraTable thead th,
#tabelaRecursosGeraisTable thead th {
  font-family: 'Nunito Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  text-transform: uppercase;
  text-align: center;
  white-space: nowrap;
  letter-spacing: 0.03em;
  color: #1a1a1a;
  background: #F4F4F2;
  padding: 10px 12px;
  border-bottom: 2px solid #85B7EB;
}
/* thead base — herda tabela-padrao, mas garante centralizacao e border */
.execfin-table thead th {
  text-align: center;
}
.execfin-table thead th.right { text-align: center; }

/* Year group header — fundo azul + borda esquerda marcando separação de ano */
.execfin-table thead th.year-group {
  background: #E6F1FB; color: #0C447C;
  font-weight: 700; border-left: 2px solid #185FA5;
  border-bottom: 2px solid #85B7EB;
}

/* Linha de meses — mesmo azul do CadFin .header-meses */
.execfin-table thead th.month-col {
  min-width: 80px;
  background: #E6F1FB; color: #0C447C;
  border-bottom: 2px solid #85B7EB;
}
.execfin-table thead th.month-col.first { border-left: 2px solid #185FA5; }
.execfin-table thead th.month-col.current {
  background: #185FA5; color: #fff;
  border-bottom: 2px solid #185FA5;
}
.execfin-table thead th.month-col.current::after {
  content: 'ATUAL'; display: block;
  font-size: 8px; color: #fff; opacity: 0.85;
  margin-top: 1px; letter-spacing: 0.06em;
}

/* Sticky first columns */
.execfin-table .col-sticky {
  position: sticky; left: 0;
  background: inherit; z-index: 2;
}
.execfin-table thead .col-sticky { background: #F4F4F2; z-index: 130; }

/* Body */
.execfin-table tbody tr { border-bottom: 1px solid rgba(0,0,0,0.04); }
.execfin-table tbody tr:hover td { background: #FAFBFC; }
.execfin-table tbody tr:hover .col-sticky { background: #FAFBFC; }
.execfin-table tbody td {
  padding: 9px 12px !important; font-size: 13px; vertical-align: middle; color: #1a1a1a;
  white-space: nowrap;
}
.execfin-table tbody td.right  { text-align: center; }
.execfin-table tbody td.center { text-align: center; }

/* Monthly value cells */
.execfin-table tbody td.month-cell {
  font-family: 'Nunito Sans', monospace; font-size: 11px;
  text-align: right; border-left: 1px solid rgba(0,0,0,0.03);
  color: #475569; background: #FCFDFE; cursor: pointer;
  white-space: nowrap; min-width: 110px;
}
.execfin-table tbody td.month-cell.first { border-left: 1px solid rgba(24,95,165,0.18); }
.execfin-table tbody td.month-cell.has-value {
  background: #EAF3DE; color: #2D5A0A; font-weight: 600;
}
.execfin-table tbody td.month-cell.has-neg {
  background: #FCEBEB; color: #A32D2D; font-weight: 600;
}
.execfin-table tbody td.month-cell.current { background: #EDF4FD; }
.execfin-table tbody td.month-cell.current.has-value {
  background: linear-gradient(135deg, #EAF3DE 0%, #E6F1FB 100%);
}
.execfin-table tbody td.month-cell.current.has-neg {
  background: linear-gradient(135deg, #FCEBEB 0%, #FDE8E8 100%);
}

/* TOTAL row */
.execfin-table tbody tr.execfin-total-row td {
  background: #F0F4F9 !important;
  border-top: 2px solid #185FA5;
  border-bottom: 3px solid #0C447C;
  padding: 11px 10px; font-weight: 700; color: #1a1a1a; font-size: 14px;
  text-align: center;
}
.execfin-table tbody tr.execfin-total-row .col-sticky {
  background: #F0F4F9 !important;
}
.execfin-table tbody tr.execfin-total-row td.month-cell {
  font-family: 'Nunito Sans', monospace; font-size: 11.5px;
}
.execfin-table tbody tr.execfin-total-row td.month-cell.has-value {
  background: linear-gradient(135deg, #DDE9F4 0%, #C8DCE9 100%) !important;
  color: #0C447C;
}
.execfin-table tbody tr.execfin-total-row td.month-cell.has-neg {
  background: #F5D5D5 !important;
  color: #A32D2D;
}

/* ND tag */
.execfin-nd-tag {
  display: inline-flex; align-items: center;
  font-family: 'Nunito Sans', -apple-system, sans-serif; font-weight: 600;
  font-size: 13px; padding: 2px 7px; border-radius: 5px;
}
.execfin-nd-tag.invest  { background: transparent; color: #0C447C; }
.execfin-nd-tag.custeio { background: transparent; color: #92400E; }
.execfin-nd-tag.outros  { background: transparent; color: #374151; }

/* UP pill */
.execfin-up-pill {
  display: inline-block; font-size: 13px; font-weight: 600;
  padding: 2px 7px; border-radius: 99px;
  font-family: 'Nunito Sans', -apple-system, sans-serif; letter-spacing: 0.04em;
}
.execfin-up-pill.fi { background: #EAF3DE; color: #3B6D11; }
.execfin-up-pill.ua { background: #FCE7F3; color: #9D174D; }
.execfin-up-pill.outros { background: #F3F4F6; color: #374151; }

/* Value cells */
.execfin-val { font-family: 'Nunito Sans', monospace; font-size: 13px; }
.execfin-val.previsto  { color: #475569; }
.execfin-val.realizado { color: #1a1a1a; font-weight: 700; }
.execfin-val.saldo     { color: #1a1a1a; font-weight: 700; }
.execfin-val.saldo.alert { color: #A32D2D; }
.execfin-val.saldo.ok    { color: #3B6D11; }
.execfin-val.saldo.neg   { color: #A32D2D; }
.execfin-val.zero { color: #94a3b8; }

/* Status pill */
.execfin-status {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px; border-radius: 999px;
  font-size: 11px; font-weight: 600; white-space: nowrap;
}
.execfin-status .dot { width: 5px; height: 5px; border-radius: 50%; flex-shrink: 0; }
.execfin-status.abaixo   { background: #FCEBEB; color: #A32D2D; }
.execfin-status.abaixo .dot { background: #A32D2D; }
.execfin-status.regular  { background: #EAF3DE; color: #3B6D11; }
.execfin-status.regular .dot { background: #639922; }
.execfin-status.acima    { background: #EAF3DE; color: #3B6D11; }
.execfin-status.acima .dot { background: #639922; }
.execfin-status.critico  { background: #FCEBEB; color: #A32D2D; }
.execfin-status.critico .dot { background: #A32D2D; }

/* ── Linhas consolidadas (cons) — visual IDÊNTICO ao ra-table ── */

/* Fundo branco, sem zebra, hover suave — igual ao ra-table */
.execfin-table tbody tr.cons td,
.rg-table tbody tr.cons td {
  background: #fff !important; color: #374151;
  padding: 8px 10px; font-size: 12.5px;
  border-bottom: 1px solid #f1f5f9;
  text-align: left;
}
#detalhes #tedsDetalheContainer .execfin-table tbody tr.cons td,
#detalhes #tedsDetalheContainer .rg-table tbody tr.cons td { background: #fff; }
.execfin-table tbody tr.cons:hover td,
.rg-table tbody tr.cons:hover td { filter: brightness(0.97); }

/* Célula de label — igual ao ra-td-label */
.execfin-table tbody tr.cons td.label-cell,
.rg-table tbody tr.cons td.label-cell {
  vertical-align: middle; font-weight: 400; white-space: nowrap;
}
.cons .label-cell-inner { display: flex; align-items: center; gap: 6px; }
.cons-label-text { display: flex; align-items: baseline; gap: 5px; font-size: 12.5px; }
.cons-formula { font-size: 10px; color: #94a3b8; font-style: italic; font-weight: 400; }

/* Ícone inline sem badge — igual ao ra-table (ícone Lucide simples, cor herdada) */
.execfin-table tbody tr.cons td.label-cell .icon,
.rg-table tbody tr.cons td.label-cell .icon {
  width: auto; height: auto; border-radius: 0;
  background: transparent !important; color: inherit !important;
  display: inline-flex; align-items: center;
}

/* Total a Receber — azul, igual ao ra-row-total */
.execfin-table tbody tr.cons.total,
.rg-table tbody tr.cons.total {
  box-shadow: 0 -1px 0 #B3D1EF, 0 1px 0 #B3D1EF;
}
.execfin-table tbody tr.cons.total td,
.execfin-table tbody tr.cons.total td.col-sticky,
.rg-table tbody tr.cons.total td,
.rg-table tbody tr.cons.total td.col-sticky {
  background: #F0F4F9 !important; font-weight: 700; color: #0C447C;
  border-top: none !important; border-bottom: none !important;
}

/* Resultado — vermelho, igual ao ra-row-resultado.
   box-shadow no TR simula border-top/bottom que border-collapse cancela. */
.execfin-table tbody tr.cons.resultado,
.rg-table tbody tr.cons.resultado {
  box-shadow: 0 -2px 0 #FCBFBF, 0 2px 0 #FCBFBF;
}
.execfin-table tbody tr.cons.resultado td,
.execfin-table tbody tr.cons.resultado td.col-sticky,
.rg-table tbody tr.cons.resultado td,
.rg-table tbody tr.cons.resultado td.col-sticky,
#detalhes #tedsDetalheContainer .execfin-table tbody tr.cons.resultado td,
#detalhes #tedsDetalheContainer .rg-table tbody tr.cons.resultado td {
  background: #FFF1F1 !important;
  color: #A32D2D !important; font-weight: 700;
}
.execfin-table tbody tr.cons.resultado .cons-formula,
.rg-table tbody tr.cons.resultado .cons-formula { color: rgba(163,45,45,0.65); }

/* Células de ano (meses expandidos) */
.execfin-table tbody tr.cons td.year-total,
.rg-table tbody tr.cons td.year-total {
  text-align: center; font-family: 'Nunito Sans', monospace;
  font-size: 12px; font-weight: 400; color: #374151;
  background: inherit; border-left: none;
  vertical-align: middle; padding: 8px 10px;
}
.execfin-table tbody tr.cons td.year-total.zero,
.rg-table tbody tr.cons td.year-total.zero  { color: #c0c8d4; }
.execfin-table tbody tr.cons td.year-total.neg,
.rg-table tbody tr.cons td.year-total.neg   { color: #A32D2D; }
.execfin-table tbody tr.cons td.year-total.green,
.rg-table tbody tr.cons td.year-total.green { color: #3B6D11; }
.execfin-table tbody tr.cons td.year-total.year-current,
.rg-table tbody tr.cons td.year-total.year-current { background: #F0F6FF; }
.execfin-table tbody tr.cons.total td.year-total,
.rg-table tbody tr.cons.total td.year-total { background: #F0F4F9 !important; color: #0C447C !important; }
.execfin-table tbody tr.cons.resultado td.year-total,
.rg-table tbody tr.cons.resultado td.year-total { background: #FFF1F1 !important; color: #A32D2D !important; }

/* ============================================================
   CADASTRO FINANCEIRO — cabeçalho de meses padronizado
   ============================================================ */
/* Agrupador de ano — igual ao execfin year-group */
.tabela-padrao thead th.year-group-cadfin {
  background: #E6F1FB !important; color: #0C447C !important;
  text-align: center; font-weight: 700;
  border-left: 2px solid #185FA5;
}
/* Primeiro mês de cada ano — borda esquerda azul */
.tabela-padrao .header-meses th.mes-first {
  border-left: 2px solid #185FA5;
}
/* Mês atual — fundo azul escuro + label "ATUAL" */
.tabela-padrao .header-meses th.mes-current {
  background: #185FA5 !important; color: #fff !important;
}
.tabela-padrao .header-meses th.mes-current::after {
  content: 'ATUAL'; display: block;
  font-size: 8px; color: #fff; opacity: 0.85;
  margin-top: 1px; letter-spacing: 0.06em;
}

/* ============================================================
   RECURSOS GERAIS IMBEL — REDESIGN (rg-*)
   ============================================================ */

/* wrapper — não estica, abraça a tabela */
#wrapperRecGeral {
    display: block;
    width: 100%;
    max-width: 800px;
    overflow-x: auto;
}
#wrapperRecGeral #tabelaRecursosGeraisTable {
    width: 100%;
}

#tabelaRecursosGeraisTable {
    width: 100%;
    min-width: 0;
    table-layout: fixed;
    border-collapse: separate;
    border-spacing: 0;
}

/* colunas fixas — ND+VPrev+VReal+Saldo = 800px */
#tabelaRecursosGeraisTable col.rg-col-nd    { width: 159.9px; }
#tabelaRecursosGeraisTable col.rg-col-vprev { width: 212.15px; }
#tabelaRecursosGeraisTable col.rg-col-vreal { width: 212.23px; }
#tabelaRecursosGeraisTable col.rg-col-saldo { width: 213.06px; }
#tabelaRecursosGeraisTable td.rg-col-nd    { text-align: center; }
#tabelaRecursosGeraisTable td.rg-col-vprev { text-align: center; }
#tabelaRecursosGeraisTable td.rg-col-vreal { text-align: center; }
#tabelaRecursosGeraisTable td.rg-col-saldo { text-align: center; }

/* thead */
#tabelaRecursosGeraisTable thead th,
.rg-table thead th { text-align: center; text-transform: uppercase; white-space: nowrap; }
.rg-table thead th.right { text-align: center; }

/* Year group header */
.rg-table thead th.year-group {
  background: #E6F1FB; color: #0C447C;
  font-weight: 700; border-left: 2px solid #185FA5;
  border-bottom: 2px solid #85B7EB; padding: 4px 8px; font-size: 11px;
}
.rg-table thead th.year-group.future {
  background: #F4F4F2; color: #94a3b8; border-left: 2px solid #cbd5e1;
}

/* Month header */
.rg-table thead th.month-col {
  min-width: 80px; background: #E6F1FB; color: #0C447C;
  border-bottom: 2px solid #85B7EB; font-size: 10px; padding: 6px 4px;
}
.rg-table thead th.month-col.first { border-left: 2px solid #185FA5; }
.rg-table thead th.month-col.first.future { border-left: 2px solid #cbd5e1; }
.rg-table thead th.month-col.current {
  background: #185FA5; color: #fff; border-bottom: 2px solid #185FA5;
}
.rg-table thead th.month-col.current::after {
  content: 'ATUAL'; display: block;
  font-size: 8px; color: #fff; opacity: 0.85;
}
.rg-table thead th.month-col.future { color: #c0c8d4; background: #F7F9FC; }

/* ND tag — rg-nd-tag */
.rg-nd-tag {
  display: inline-flex; align-items: center;
  font-family: 'Nunito Sans', -apple-system, sans-serif; font-weight: 600;
  font-size: 13px; padding: 2px 7px; border-radius: 5px;
}
.rg-nd-tag.invest  { background: transparent; color: #1a1a1a; }
.rg-nd-tag.invest2 { background: transparent; color: #1a1a1a; }
.rg-nd-tag.custeio { background: transparent; color: #1a1a1a; }
.rg-nd-tag.outros  { background: transparent; color: #1a1a1a; }

/* Valores */
.rg-val { font-family: 'Nunito Sans', monospace; font-size: 13px; color: #1a1a1a; }
.rg-val.previsto  { color: #1a1a1a; }
.rg-val.realizado { color: #1a1a1a; font-weight: 700; }
.rg-val.saldo     { color: #1a1a1a; font-weight: 700; }
.rg-val.saldo.alert { color: #1a1a1a; }
.rg-val.saldo.ok    { color: #1a1a1a; }
.rg-val.saldo.neg   { color: #A32D2D; }

/* Células mensais */
.rg-table tbody td.month-cell {
  background: transparent; font-family: 'Nunito Sans', monospace;
  font-size: 11px; text-align: right; padding: 6px 6px;
  border-left: 1px solid rgba(0,0,0,0.03); color: #475569;
  cursor: pointer; white-space: nowrap; min-width: 110px;
}
.rg-table tbody td.month-cell.first { border-left: 1px solid rgba(24,95,165,0.18); }
.rg-table tbody td.month-cell.first.future { border-left: 1px solid rgba(148,163,184,0.18); }
.rg-table tbody td.month-cell.has-value { background: #EAF3DE; color: #2D5A0A; font-weight: 600; }
.rg-table tbody td.month-cell.has-value.neg { background: #FCEBEB; color: #A32D2D; font-weight: 600; }
.rg-table tbody td.month-cell.current { background: #E6F1FB; }
.rg-table tbody td.month-cell.current.has-value { background: linear-gradient(135deg,#EAF3DE 0%,#E6F1FB 100%); }
.rg-table tbody td.month-cell.future { color: #c0c8d4; }

/* Zebra das linhas de dados — pinta as células diretamente porque a rg-table não
   passa pelo congelamento que copia a cor da linha (e a regra global
   .tabela-padrao tbody tr:nth-child(even) td pinta de branco). Resumo (cons),
   linha TOTAL e células de mês com valor mantêm suas próprias cores. */
.rg-table tbody tr:nth-child(even):not(.cons):not(.rg-total-row) td:not(.month-cell),
.rg-table tbody tr:nth-child(even):not(.cons):not(.rg-total-row) td.month-cell:not(.has-value):not(.current) {
  background: #f7faff;
}
.rg-table tbody tr:hover:not(.cons):not(.rg-total-row) td:not(.month-cell),
.rg-table tbody tr:hover:not(.cons):not(.rg-total-row) td.month-cell:not(.has-value):not(.current) {
  background: #eaf2ff;
}

/* Linha TOTAL */
.rg-table tbody tr.rg-total-row td {
  background: #F0F4F9 !important; font-weight: 700; color: #1a1a1a; font-size: 14px;
  border-top: 2px solid #185FA5; border-bottom: 3px solid #0C447C;
  padding: 10px 10px; text-align: center;
}
.rg-table tbody tr.rg-total-row td.month-cell {
  background: #F0F4F9 !important; font-family: 'Nunito Sans', monospace; font-size: 11px;
}
.rg-table tbody tr.rg-total-row td.month-cell.has-value {
  background: linear-gradient(135deg,#DDE9F4 0%,#C8DCE9 100%) !important; color: #0C447C;
}
.rg-table tbody tr.rg-total-row td.month-cell.has-value.neg {
  background: #FCEBEB !important; color: #A32D2D;
}

/* Linhas consolidadas — reutiliza .cons do ExecFin, só adiciona variações de future */
.rg-table tbody tr.cons td.year-total.future { background: rgba(148,163,184,0.04); }
.rg-table tbody tr.cons td.year-total.future.zero { color: #c0c8d4; }
.rg-table tbody tr.cons td.year-total.future.neg  { background: rgba(163,45,45,0.04); }
.rg-table tbody tr.cons.resultado td.year-total.future { background: rgba(163,45,45,0.06); }

/* Banner de insight */
.rg-insight-banner {
  background: #FFF8E6; border: 1px solid #F5D77A; color: #4a3a04;
  padding: 10px 14px; border-radius: 8px; font-size: 12.5px; line-height: 1.5;
  margin: 14px 0 4px; display: flex; align-items: flex-start; gap: 8px;
}


/* ===== RESUMO ANUAL — REDESIGN ===== */
.ra-kpis {
  display: flex; flex-wrap: wrap; gap: 10px; padding: 0 0 14px 0;
}
.ra-kpi {
  background: #fff; border: 1px solid #e2e8f0; border-radius: 10px;
  padding: 10px 14px; min-width: 160px; flex: 1 1 160px;
}
.ra-kpi.blue  { border-left: 4px solid #185FA5; }
.ra-kpi.green { border-left: 4px solid #3B6D11; }
.ra-kpi.amber { border-left: 4px solid #92400E; }
.ra-kpi.red   { border-left: 4px solid #A32D2D; }
.ra-kpi.ok    { border-left: 4px solid #3B6D11; }
.ra-kpi-label { font-size: 11px; color: #64748b; text-transform: uppercase; letter-spacing: 0.04em; }
.ra-kpi-value { font-family: 'Nunito Sans', monospace; font-size: 14px; font-weight: 700; color: #0f172a; margin: 2px 0; }
.ra-kpi-sub   { font-size: 10.5px; color: #94a3b8; }
.ra-kpi-bar   { height: 4px; background: #f1f5f9; border-radius: 2px; margin: 4px 0 2px; }
.ra-kpi-fill  { height: 4px; background: #3B6D11; border-radius: 2px; transition: width 0.4s; }

.ra-resumo-wrap { margin-top: 12px; }
.ra-table-wrap { overflow-x: auto; }
.ra-table {
  border-collapse: separate; border-spacing: 0;
  width: 100%; min-width: 500px; font-size: 12.5px;
}
.ra-table .ra-th-label {
  text-align: left; padding: 8px 10px; font-size: 11px; color: #94a3b8;
  background: #F7F9FC; border-bottom: 2px solid #e2e8f0; min-width: 220px;
}
.ra-table .ra-th-ano {
  text-align: center; padding: 8px 10px; font-weight: 700; font-size: 12px;
  background: #F7F9FC; border-bottom: 2px solid #e2e8f0; min-width: 130px;
  white-space: nowrap; position: relative;
}
.ra-table .ra-th-ano.current { background: #185FA5; color: #fff; }
.ra-table .ra-th-ano.future  { background: #F4F4F2; color: #94a3b8; }
.ra-atual-badge {
  display: block; font-size: 8px; font-weight: 600;
  color: rgba(255,255,255,0.85); letter-spacing: 0.08em;
}
.ra-formula { font-size: 10px; color: #94a3b8; margin-left: 5px; font-style: italic; }

.ra-table .ra-td-label {
  padding: 8px 10px; color: #374151; white-space: nowrap;
  border-bottom: 1px solid #f1f5f9; background: #fff;
}
.ra-table .ra-td-val {
  text-align: right; padding: 8px 10px; font-family: 'Nunito Sans', monospace;
  font-size: 12px; border-bottom: 1px solid #f1f5f9; color: #374151; background: #fff;
}
.ra-table .ra-td-val.current { background: #F0F6FF; }
.ra-table .ra-td-val.future  { color: #c0c8d4; }
.ra-table .ra-td-val.pos     { color: #3B6D11; font-weight: 700; }
.ra-table .ra-td-val.neg     { color: #A32D2D; font-weight: 700; }
.ra-table .ra-td-val.zero    { color: #94a3b8; }

.ra-table .ra-row-total td {
  background: #F0F4F9 !important; font-weight: 700; color: #0C447C;
  border-top: 1px solid #B3D1EF; border-bottom: 1px solid #B3D1EF;
}
.ra-table .ra-row-resultado td {
  background: #FFF1F1 !important; font-weight: 700;
  border-top: 2px solid #FCBFBF; border-bottom: 2px solid #FCBFBF;
}
.ra-table .ra-row-resultado .ra-td-label { color: #A32D2D; }
.ra-table .ra-row-resultado .ra-td-val.current { background: #FCDCDC !important; }
.ra-table .ra-row-resultado .ra-td-val.future  { background: rgba(163,45,45,0.04) !important; color: #c0c8d4; }
.ra-table tbody tr:hover td { filter: brightness(0.97); }

/* ===== ENTREGAS — REDESIGN v2 ===== */

/* Header */
.ent2-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 0 14px 0; border-bottom: 1px solid #e2e8f0; margin-bottom: 16px;
}
.ent2-header-title {
  display: flex; align-items: center; gap: 8px;
  font-size: 15px; font-weight: 700; color: #0f172a;
}
.ent2-header-meta {
  font-size: 11px; font-weight: 600; color: #185FA5;
  background: #EFF6FF; border-radius: 20px; padding: 2px 10px;
}

/* Grid de cards */
.ent2-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

/* Card */
.ent2-card {
  background: #fff; border: 1px solid #e2e8f0; border-radius: 12px;
  padding: 18px 20px; display: flex; flex-direction: column; gap: 14px;
  transition: box-shadow 0.15s; border-left: 4px solid #94a3b8;
}
.ent2-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.08); }
.ent2-card.concluido { border-left-color: #3B6D11; }
.ent2-card.andamento { border-left-color: #185FA5; }
.ent2-card.pendente  { border-left-color: #d97706; }

/* Parte superior do card */
.ent2-card-top { display: flex; flex-direction: column; gap: 4px; }
.ent2-card-nome-row { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.ent2-card-nome { font-size: 14px; font-weight: 700; color: #0f172a; line-height: 1.3; }
.ent2-perc-ted {
  font-size: 10.5px; font-weight: 600; color: #64748b;
  background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 20px;
  padding: 1px 8px; white-space: nowrap; flex-shrink: 0;
}
.ent2-card-sub { font-size: 11px; color: #64748b; margin-bottom: 2px; }
.ent2-meta-valor { font-weight: 600; color: #334155; }

/* Percentual grande */
.ent2-perc-big {
  font-family: 'Nunito Sans', monospace;
  font-size: 36px; font-weight: 700; line-height: 1;
  margin: 4px 0 0 0; color: #0f172a;
}
.ent2-perc-big.concluido { color: #3B6D11; }
.ent2-perc-big.andamento { color: #B45309; }
.ent2-perc-big.pendente  { color: #64748b; }

/* Fração */
.ent2-fracao {
  font-family: 'Nunito Sans', monospace;
  font-size: 13px; color: #475569; margin: 2px 0 6px 0;
}
.ent2-frac-sep { color: #94a3b8; margin: 0 3px; }
.ent2-frac-un  { color: #94a3b8; font-size: 11px; margin-left: 2px; }

/* Barra de progresso */
.ent2-progress-bar {
  height: 8px; background: #f1f5f9; border-radius: 4px; overflow: hidden;
}
.ent2-progress-fill { height: 8px; border-radius: 4px; transition: width 0.4s; background: #94a3b8; }
.ent2-progress-fill.concluido { background: #3B6D11; }
.ent2-progress-fill.andamento { background: #185FA5; }
.ent2-progress-fill.pendente  { background: #d1d5db; }

/* Datas */
.ent2-card-datas {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
  padding-top: 10px; border-top: 1px solid #f1f5f9;
}
.ent2-data-label {
  font-size: 10px; font-weight: 600; color: #94a3b8;
  text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 3px;
}
.ent2-data-val { font-size: 12.5px; color: #1e293b; }
.ent2-data-val strong { font-weight: 700; }
.ent2-nenhuma { color: #94a3b8; font-style: italic; }

/* Status row */
.ent2-card-status-row {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.ent2-status-pill {
  font-size: 11px; font-weight: 600; border-radius: 20px;
  padding: 3px 10px; white-space: nowrap;
}
.ent2-status-pill.concluido { background: #D1FAE5; color: #3B6D11; }
.ent2-status-pill.andamento { background: #DBEAFE; color: #185FA5; }
.ent2-status-pill.pendente  { background: #FEF3C7; color: #92400E; }
.ent2-restam { font-size: 11px; color: #64748b; text-align: right; }
.ent2-restam strong { color: #ef4444; font-weight: 700; }

/* Cronograma de fases */
.ent2-card-cronograma {
  padding-top: 10px; border-top: 1px solid #f1f5f9;
}
.ent2-cronograma-label {
  font-size: 9.5px; font-weight: 600; color: #94a3b8;
  text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 8px;
}
.ent2-fases-row {
  display: flex; flex-wrap: wrap; gap: 4px; align-items: center;
}
.ent2-fase-dot {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 26px; border-radius: 6px;
  font-size: 10px; font-weight: 700; cursor: default;
  transition: transform 0.1s;
}
.ent2-fase-dot:hover { transform: scale(1.1); }
.ent2-fase-dot.concluido { background: #3B6D11; color: #fff; }
.ent2-fase-dot.atual     { background: #FFF3CD; color: #92400E; border: 2px solid #d97706; }
.ent2-fase-dot.futuro    { background: #F1F5F9; color: #94a3b8; border: 1px solid #e2e8f0; }
.ent2-fase-unica-label {
  font-size: 11px; color: #94a3b8; font-style: italic; margin-left: 6px;
}

/* Insight bar */
.ent2-insight {
  display: flex; gap: 10px; align-items: flex-start;
  background: #FFFBEB; border: 1px solid #FDE68A; border-radius: 8px;
  padding: 10px 14px; font-size: 12px; color: #78350F; line-height: 1.5;
}
.ent2-insight i { color: #D97706; margin-top: 1px; }
.ent2-insight strong { color: #92400E; }

/* ===== MELHORIA 1: PAINEL DE SAÚDE DA EXECUÇÃO ===== */
.saude-card {
    background: #fff;
    border: 1px solid rgba(30,64,175,0.12);
    border-radius: 10px;
    padding: 16px 20px;
    margin-bottom: 14px;
    box-shadow: 0 2px 8px rgba(15,23,42,0.05);
}
.saude-title {
    font-size: 12px;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 14px;
}
.saude-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}
.saude-label {
    font-size: 12px;
    color: #475569;
    width: 80px;
    flex-shrink: 0;
}
.saude-bar-track {
    flex: 1;
    height: 8px;
    background: #F1F5F9;
    border-radius: 4px;
    overflow: hidden;
}
.saude-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.4s ease;
}
.saude-pct {
    font-size: 12px;
    font-weight: 700;
    font-family: 'Nunito Sans', monospace;
    color: #1e293b;
    width: 50px;
    text-align: right;
    flex-shrink: 0;
}
.saude-status { margin-top: 12px; }
.saude-pill {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 999px;
    white-space: nowrap;
}
.saude-pill.ritmo   { background: #EAF3DE; color: #2D5A0A; }
.saude-pill.atrasado { background: #FAEEDA; color: #854F0B; }
.saude-pill.risco   { background: #FCEBEB; color: #A32D2D; }

/* ===== MELHORIA 2: RECONCILIAÇÃO FATURAMENTO × RECEBIMENTO ===== */
.reconciliacao-card {
    background: #fff;
    border: 1px solid rgba(30,64,175,0.12);
    border-radius: 10px;
    padding: 16px 20px;
    margin: 12px 0;
    box-shadow: 0 2px 8px rgba(15,23,42,0.05);
}
.reconciliacao-title {
    font-size: 13px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 2px;
}
.reconciliacao-sub {
    font-size: 11px;
    color: #94a3b8;
    margin-bottom: 14px;
}
.reconciliacao-cols {
    display: flex;
    align-items: center;
    gap: 0;
    margin-bottom: 12px;
}
.reconciliacao-col {
    flex: 1;
    padding: 0 16px;
}
.reconciliacao-col:first-child { padding-left: 0; }
.reconciliacao-col:last-child  { padding-right: 0; }
.reconciliacao-col-label {
    font-size: 11px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 4px;
}
.reconciliacao-col-value {
    font-size: 18px;
    font-weight: 700;
    font-family: 'Nunito Sans', monospace;
    margin-bottom: 4px;
}
.reconciliacao-col-sub {
    font-size: 11px;
    color: #94a3b8;
}
.reconciliacao-divider {
    width: 1px;
    height: 60px;
    background: #e2e8f0;
    flex-shrink: 0;
}
.reconciliacao-diff {
    font-size: 12px;
    color: #475569;
    border-top: 1px solid #f1f5f9;
    padding-top: 10px;
}
.reconciliacao-diff b { color: #1e293b; }
.reconciliacao-diff-note { color: #94a3b8; }

/* ===== MELHORIA 3: STATUS-TAG UNIFICADO ===== */
.status-tag {
    font-size: 11px;
    font-weight: 600;
    padding: 3px 9px;
    border-radius: 999px;
    display: inline-block;
    white-space: nowrap;
}
.status-tag.regular  { background: #EAF3DE; color: #2D5A0A; }
.status-tag.abaixo   { background: #E6F1FB; color: #0C447C; }
.status-tag.acima    { background: #FAEEDA; color: #854F0B; }
.status-tag.critico  { background: #FCEBEB; color: #A32D2D; }

/* ===== MELHORIA 5: RODAPÉ DE RASTREABILIDADE ===== */
.tab-footer {
    font-size: 11px;
    color: #94a3b8;
    padding: 16px 0 8px;
    border-top: 0.5px solid rgba(0,0,0,0.06);
    margin-top: 24px;
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

/* ============================================================
   DASHBOARD REDESIGN — "Livro-Razão" (Ledger & Signal)
   Um painel de controle orçamentário público não precisa parecer
   um SaaS genérico. Aqui a referência é o gazette/relatório oficial:
   fundo cor de papel, tinta azul-marinho profunda, números sempre
   em mono tabular de verdade (não Nunito Sans disfarçado), títulos
   em serifada editorial. As cores de destaque (navy/verde/âmbar/
   vermelho) são as MESMAS já usadas nas tabelas de Resumo Anual/
   Execução Financeira — consistência proposital com o resto do
   sistema, não uma paleta nova isolada.
   Escopo: somente #dashboard, para não afetar as demais abas.
   ============================================================ */

#dashboard {
    background: #FAF6EC;
    padding: 1.75rem 1.75rem 0.5rem;
    margin: -1.5rem -1.5rem 0;
}

#dashboard .card {
    background: #FFFDF7;
    border: 1px solid rgba(12,68,124,0.12);
    border-top: 3px solid #0C447C;
    border-radius: 3px;
    box-shadow: none;
}
#dashboard .card:hover { border-color: rgba(12,68,124,0.12); }

#dashboard .card h2 {
    font-family: 'Fraunces', 'Nunito Sans', serif;
    font-optical-sizing: auto;
    font-weight: 600;
    font-size: 1.5rem;
    letter-spacing: -0.01em;
    color: #0C2A47;
    padding-bottom: 0.65rem;
    margin-bottom: 1.15rem;
    border-bottom: 1px solid rgba(12,68,124,0.14);
    display: flex;
    align-items: baseline;
    gap: 0.05rem;
}

#dashboard .stat-card {
    background: #FFFDF7;
    border: 1px solid rgba(12,68,124,0.12);
    border-left: none;
    border-top: 3px solid var(--tile-accent, #0C447C);
    border-radius: 2px;
    box-shadow: none;
    padding: 1.15rem 1.2rem 1.05rem;
}
#dashboard .stat-card.wm-blue    { --tile-accent: #0C447C; }
#dashboard .stat-card.wm-amber   { --tile-accent: #854F0B; }
#dashboard .stat-card.wm-indigo  { --tile-accent: #4A3B6E; }
#dashboard .stat-card.wm-green,
#dashboard .stat-card.accent-green { --tile-accent: #3B6D11; border-radius: 2px; }
#dashboard .stat-card.accent-red   { --tile-accent: #A32D2D; border-radius: 2px; }

#dashboard .stat-card .label {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.66rem;
    letter-spacing: 0.08em;
    color: #7A6E5A;
    font-weight: 600;
}
#dashboard .stat-card .value {
    font-family: 'IBM Plex Mono', monospace;
    font-variant-numeric: tabular-nums;
    font-size: 1.9rem;
    font-weight: 700;
    color: #0C2A47;
    letter-spacing: -0.015em;
}
#dashboard .stat-card .stat-watermark .lucide,
#dashboard .stat-card .stat-watermark svg { opacity: 0.07; stroke-width: 1.1; }

#dashboard .proxima-col {
    background: #FFFDF7;
    border: 1px solid rgba(12,68,124,0.12);
    border-radius: 2px;
    box-shadow: none;
}
#dashboard .proxima-col .proxima-col-header {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: #0C2A47;
    padding-bottom: 5px;
    margin-bottom: 5px;
}
/* O .empty-state global é feito para tela cheia (padding 2.5rem, centralizado, ícone
   de 96px) e dentro destes cards pequenos abre um vão grande entre o título e o texto.
   Aqui ele vira uma nota curta, encostada no topo. O !important é necessário porque o
   padding vem inline do JS (renderProximasEntregas e afins, em js/main.js). */
#dashboard .proxima-col .empty-state {
    display: block;
    padding: 0 !important;
    text-align: left;
    font-size: 0.78rem;
    line-height: 1.45;
    color: var(--color-text-muted);
}
/* Conteúdo com dados (tabelas/listas) também encosta no topo, sem esticar junto com
   o card mais alto da linha. */
#dashboard .proxima-col > div { flex: 0 0 auto; }

/* Distribuição por Status (donut) */
#dashboard .status-donut-card {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 0.5rem 0.25rem;
}
#dashboard .status-donut {
    width: 92px;
    height: 92px;
    border-radius: 50%;
    flex-shrink: 0;
    position: relative;
}
#dashboard .status-donut::after {
    content: '';
    position: absolute;
    inset: 15px;
    background: #FFFDF7;
    border-radius: 50%;
}
#dashboard .status-donut-legend {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
}
#dashboard .status-donut-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    font-size: 0.8rem;
}
#dashboard .status-donut-label {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    color: #6b6558;
}
#dashboard .status-donut-label i {
    width: 8px;
    height: 8px;
    border-radius: 2px;
    flex-shrink: 0;
    display: inline-block;
}
#dashboard .status-donut-count {
    font-family: 'IBM Plex Mono', monospace;
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    color: #0C2A47;
}

/* Painéis de Resumo Financeiro / Entregas */
#dashboard .resumo-panel .card,
#dashboard .entregas-panel .card {
    border-radius: 2px;
    border: 1px solid rgba(12,68,124,0.12);
    border-top: 3px solid #0C447C;
    box-shadow: none;
    background: #FFFDF7;
}
#dashboard .resumo-panel .card-title-blue,
#dashboard .entregas-panel .card-title-blue {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #0C2A47;
}

/* Filtros: mantém a diagramação, aquece a paleta de bordas */
#dashboard .filter-bar select,
#dashboard .graficos-filters select,
#dashboard .ms-btn { border-color: rgba(12,68,124,0.22); }
#dashboard .ms-btn:hover { border-color: #0C447C; }

/* ============================================================
   TEDs — "Livro-Razão" aplicado à lista de TEDs
   Mesma paleta/tipografia do Dashboard: fundo cor de papel,
   cartões com regra superior azul-marinho, rótulos em mono,
   números tabulares. Escopo: somente #teds.
   ============================================================ */

#teds {
    background: #FAF6EC;
    padding: 1.75rem 1.75rem 0.5rem;
    margin: -1.5rem -1.5rem 0;
}

#teds .card {
    background: #FFFDF7;
    border: 1px solid rgba(12,68,124,0.12);
    border-top: 3px solid #0C447C;
    border-radius: 3px;
    box-shadow: none;
}

#teds .card > h2,
#teds h2.auto-style-008 {
    font-family: 'Fraunces', 'Nunito Sans', serif;
    font-optical-sizing: auto;
    font-weight: 600;
    font-size: 1.5rem;
    letter-spacing: -0.01em;
    color: #0C2A47;
}

#teds .teds-filter-bar {
    border-bottom: 1px solid rgba(12,68,124,0.14);
}
#teds .teds-filter-bar .filter-label {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.66rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #7A6E5A;
}
#teds .teds-filter-bar select {
    border-color: rgba(12,68,124,0.22);
    color: #0C2A47;
}
#teds .teds-filter-bar .btn-limpar { color: #0C447C; }

#teds .ted-card {
    background: #FFFDF7;
    border: 1px solid rgba(12,68,124,0.12);
    border-left: 3px solid var(--tile-accent, #888780);
    border-radius: 2px;
}
#teds .ted-card:hover { box-shadow: none; border-color: #0C447C; }
#teds .ted-card-title {
    font-family: 'Fraunces', 'Nunito Sans', serif;
    font-optical-sizing: auto;
    font-weight: 600;
    font-size: 1.05rem;
    color: #0C2A47;
}
#teds .ted-card-obj { color: #6b6558; }
#teds .ted-card-meta {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.68rem;
    letter-spacing: 0.02em;
    color: #7A6E5A;
}
/* Chip de prazo dentro do meta line, colorido por urgência */
#teds .ted-card-prazo {
    font-family: 'IBM Plex Mono', monospace;
    font-variant-numeric: tabular-nums;
    font-weight: 700;
}
#teds .ted-card-prazo.prazo-vencido,
#teds .ted-card-prazo.prazo-critico { color: #A32D2D; }
#teds .ted-card-prazo.prazo-atencao { color: #854F0B; }
#teds .ted-card-prazo.prazo-ok,
#teds .ted-card-prazo.prazo-encerrado { color: #7A6E5A; font-weight: 600; }
#teds .ted-card-progress-label {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.66rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #7A6E5A;
}
#teds .ted-card-progress-pct,
#teds .ted-card-saldo-pos,
#teds .ted-card-saldo-neg {
    font-family: 'IBM Plex Mono', monospace;
    font-variant-numeric: tabular-nums;
    font-weight: 600;
}
#teds .ted-card-progress-track { background: rgba(12,68,124,0.08); }
#teds .ted-card-footer { border-top: 1px solid rgba(12,68,124,0.10); }
#teds .ted-card-footer > span:first-child {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.64rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #7A6E5A;
}

/* ============================================================
   DETALHES TED — "Livro-Razão" aplicado à ficha do TED
   Mesma paleta/tipografia do Dashboard/TEDs. O hero mantém o
   degradê navy (é o único "cartaz" da tela, funciona como capa
   de dossiê); todo o resto vira papel + mono tabular.
   Escopo: somente #detalhes.
   ============================================================ */

#detalhes { background: #FAF6EC; padding: 1.75rem 1.75rem 0.5rem; margin: -1.5rem -1.5rem 0; }

#detalhes .card {
    background: #FFFDF7;
    border: 1px solid rgba(12,68,124,0.12);
    border-top: 3px solid #0C447C;
    border-radius: 3px;
    box-shadow: none;
}
#detalhes .detalhes-header h2 {
    font-family: 'Fraunces', 'Nunito Sans', serif;
    font-optical-sizing: auto;
    font-weight: 600;
    font-size: 1.5rem;
    letter-spacing: -0.01em;
    color: #0C2A47;
}
#detalhes .ted-chip { border-color: rgba(12,68,124,0.22); }
#detalhes .ted-chip-text { font-family: 'IBM Plex Mono', monospace; font-size: 0.78rem; }

/* Nav de abas internas: mono, ativa em navy sólido (sem gradiente) */
#detalhes .dt-tab-switch { background: #FFFDF7; border-color: rgba(12,68,124,0.16); box-shadow: none; }
#detalhes .dt-tab-btn {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.72rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #7A6E5A;
}
#detalhes .dt-tab-btn:hover { background: rgba(12,68,124,0.06); color: #0C2A47; }
#detalhes .dt-tab-btn.active { background: #0C447C; color: #FFFDF7; }

/* Hero: mantém o degradê como "capa"; tipografia alinhada ao resto */
#detalhes .ted-hero { border-radius: 3px; box-shadow: none; }
#detalhes .ted-hero-id { font-family: 'IBM Plex Mono', monospace; }
#detalhes .ted-hero-title { font-family: 'Fraunces', 'Nunito Sans', serif; font-weight: 500; }

/* KPI cards: topo colorido por tipo, números em mono tabular */
#detalhes .kpi {
    background: #FFFDF7;
    border: 1px solid rgba(12,68,124,0.12);
    border-left: none;
    border-top: 3px solid var(--kpi-accent, #0C447C);
    border-radius: 2px;
}
#detalhes .kpi.lead-blue  { --kpi-accent: #0C447C; }
#detalhes .kpi.lead-green { --kpi-accent: #3B6D11; }
#detalhes .kpi.lead-red   { --kpi-accent: #A32D2D; }
#detalhes .kpi.lead-amber { --kpi-accent: #854F0B; }
#detalhes .kpi-label {
    font-family: 'IBM Plex Mono', monospace;
    color: #7A6E5A;
}
#detalhes .kpi-val {
    font-family: 'IBM Plex Mono', monospace;
    font-variant-numeric: tabular-nums;
    color: #0C2A47;
}
#detalhes .kpi-val .cur { color: #9C7A34; }
#detalhes .kpi-sub { color: #6b6558; }
#detalhes .kpi-chip {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 600;
}

/* Timeline de vigência */
#detalhes .vig-card {
    background: #FFFDF7;
    border: 1px solid rgba(12,68,124,0.12);
    border-radius: 2px;
}
#detalhes .vig-title { font-family: 'Fraunces', 'Nunito Sans', serif; font-weight: 600; color: #0C2A47; }
#detalhes .vig-meta { font-family: 'IBM Plex Mono', monospace; color: #7A6E5A; }

/* Dados Cadastrais + Aditivos */
#detalhes .dc-card {
    background: #FFFDF7;
    border: 1px solid rgba(12,68,124,0.12);
    border-radius: 2px;
}
#detalhes .dc-title {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.72rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #0C2A47;
}
#detalhes .sub-group-title,
#detalhes .field-label {
    font-family: 'IBM Plex Mono', monospace;
    letter-spacing: 0.03em;
    color: #7A6E5A;
}
#detalhes .field-value { color: #0C2A47; }
#detalhes .field-value.mono { font-family: 'IBM Plex Mono', monospace; font-variant-numeric: tabular-nums; }

#detalhes .aditivo-card-new {
    background: #FFFDF7;
    border: 1px solid rgba(12,68,124,0.12);
    border-radius: 2px;
}
#detalhes .aditivo-num-badge { background: #E6F1FB; color: #0C447C; font-family: 'IBM Plex Mono', monospace; }
#detalhes .aditivo-card-date { font-family: 'IBM Plex Mono', monospace; color: #7A6E5A; }

/* ===== Modo Mobile (recorte de campo: Lista de TEDs / Detalhe / Registrar Entrega) =====
   Ativado abaixo de 768px — mesmo corte já usado em outras regras pontuais deste arquivo.
   Só adiciona por cima do layout desktop (.sidebar/.container acima não são editados),
   então nada aqui deveria afetar telas >768px. window._isMobileShell (js/main.js) espelha
   este mesmo breakpoint via matchMedia para o guard de navegação em switchTab().
   Regras base (escondidas por padrão) vêm ANTES da media query de propósito: como as duas
   têm a mesma especificidade, quem vier depois no arquivo vence o empate — a media query
   precisa ser a última para conseguir sobrescrever o `display: none` base em telas ≤768px. */
.mobile-bottom-nav {
    display: none;
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 600;
    background: #fff;
    border-top: 1px solid var(--color-border);
    padding: 0.4rem 0.4rem calc(env(safe-area-inset-bottom, 0px) + 0.4rem);
    box-shadow: 0 -2px 12px rgba(0,0,0,0.08);
}
[data-theme="dark"] .mobile-bottom-nav {
    background: var(--color-bg-card);
    border-top-color: var(--color-border);
}
.mobile-nav-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
    background: none;
    border: none;
    color: var(--color-text-muted);
    font-family: 'Nunito Sans', sans-serif;
    font-size: 0.66rem;
    font-weight: 600;
    padding: 0.4rem 0;
    border-radius: 10px;
    cursor: pointer;
}
.mobile-nav-btn .nav-item-icon { width: 20px; height: 20px; }
.mobile-nav-btn.active { color: var(--color-primary); background: var(--color-primary-bg); }

/* Barra superior mobile: repõe tema/logout, que ficam inacessíveis com a sidebar
   escondida (ver comentário no index.html, acima do <header class="mobile-topbar">). */
.mobile-topbar {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 600;
    align-items: center;
    justify-content: space-between;
    background: var(--color-primary);
    color: #fff;
    padding: calc(env(safe-area-inset-top, 0px) + 0.6rem) 0.9rem 0.6rem;
}
.mobile-topbar-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: 'Fraunces', 'Nunito Sans', serif;
    font-weight: 600;
    font-size: 0.95rem;
}
.mobile-topbar-actions { display: flex; gap: 0.3rem; }
.mobile-topbar-actions button {
    background: rgba(255,255,255,0.14);
    border: none;
    color: #fff;
    border-radius: 8px;
    padding: 0.4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}
.mobile-topbar-actions .nav-item-icon { width: 18px; height: 18px; }

/* max-width sozinho só cobre celular em pé — deitado, a largura de um celular comum
   facilmente passa de 768px (ex.: ~915px), mas a altura fica baixa (~350-430px, a mesma
   largura que tinha em pé). Um tablet/desktop genuíno tem as DUAS dimensões grandes, então
   somar "OR altura baixa" pega celular deitado sem confundir com tela grande de verdade. */
@media (max-width: 768px), (max-height: 500px) {
    .sidebar { display: none; }
    .container {
        margin-left: 0;
        width: 100vw;
        max-width: 100vw;
        padding-top: calc(env(safe-area-inset-top, 0px) + 52px);
        padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 76px);
    }
    .mobile-bottom-nav { display: flex; }
    .mobile-topbar { display: flex; }

    /* Cards de resumo administrativo das sub-abas Físico (.ef-kpis: Total de fases/
       Concluídas/Qtde entregue), Financeiro (.cf-kpis: Total Cadastrado/Maior ND/
       Distribuição por UP/Próximo Período) e as duas seções que reaproveitam
       .execfin-kpis dentro do Financeiro — Execução Financeira e Recursos Gerais IMBEL
       (Previsto Total/Realizado Total/Saldo a Receber/Maior ND) — decisão do usuário:
       não fazem sentido no recorte de consulta em campo, só no desktop. */
    .ef-kpis, .cf-kpis, .execfin-kpis { display: none; }

    /* Coluna de Ações (editar/excluir) nas tabelas de Cadastro Físico e Cadastro
       Financeiro — decisão do usuário: o app é só consulta, não edita nem cria nada,
       então esses botões só ocupam espaço que falta nas telas estreitas. Não dá pra usar
       :last-child: com "Ver detalhes mensais" expandido, colunas de mês são inseridas
       DEPOIS da coluna de Ação em ambas as tabelas (atualizarTabelaFisicos/
       atualizarTabelaFinanceira), então ela deixa de ser a última. .col-acao já era usado
       de forma inconsistente entre as duas tabelas — padronizei nas duas (js/main.js) pra
       poder escondê-la aqui por classe, não por posição. Também não dá pra mirar
       #tabelaCadFisTable: atualizarTabelaFisicos() troca o id da tabela pra
       "efTabelaFisicos" assim que renderiza dados de verdade — .ef-table é a classe
       estável que ela recebe nesse mesmo momento. */
    #tabelaFinanceiraCompleta .col-acao,
    .ef-table .col-acao {
        display: none;
    }
}

/* ===== Ajuste de conteúdo da aba Detalhes em telas de celular =====
   O shell (sidebar/bottom-nav) acima já cobre 768px; estas regras miram especificamente
   a largura de um celular (≤480px), onde o grid de KPIs em 2 colunas e o título de uma
   linha só do hero banner (ambos desenhados pra desktop) cortavam texto. Só sobrescreve
   propriedades pontuais — não duplica nem substitui as regras base de .kpi-grid/.ted-hero-title
   /.dt-tab-switch acima. */
@media (max-width: 480px) {
    /* KPI cards: 1 coluna em vez de 2 — o valor em R$ não cabia em ~170px sem cortar */
    .kpi-grid { grid-template-columns: 1fr; }

    /* Objetivo do TED: permitir 2 linhas em vez de truncar com reticências numa só linha.
       -webkit-line-clamp exige overflow:hidden pra funcionar — usar overflow:visible aqui
       (como numa primeira tentativa) quebra o clamp e sobrepõe o texto ao elemento seguinte. */
    .ted-hero-title {
        white-space: normal;
        overflow: hidden;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
    }

    /* Sub-abas (Visão Geral/Físico/Financeiro/Faturamento): rolagem horizontal em vez de
       empilhar 4 linhas — mantém o visual de "pills" numa faixa só, como o resto do app
       já faz em filtros com muitas opções. */
    .dt-tab-switch {
        width: 100%;
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    .dt-tab-switch::-webkit-scrollbar { display: none; }
    .dt-tab-btn { flex-shrink: 0; }

    /* Toasts (showToast, js/main.js): no desktop ficam ancorados no canto superior
       direito com max-width:350px — num celular de 375px isso sobra só 5px de margem
       na esquerda. Em campo os avisos de "salvo localmente"/erro de sincronização
       (ver entregas_adicionar) precisam ser bem legíveis, então aqui viram uma faixa
       centralizada com margens simétricas em vez de ancorados no canto. */
    .toast-container { left: 12px; right: 12px; top: 12px; align-items: center; }
    .toast { max-width: 100%; width: 100%; box-sizing: border-box; }
}

/* ===== Numeração P Trab: cabeçalho congelado =====
   .table-wrapper já é contexto de scroll (overflow-x:auto), então o sticky do thead
   precisa de rolagem vertical no próprio wrapper — sem max-height quem rola é a
   página e o cabeçalho nunca "gruda". */
#tabPlanoTrabalho .table-wrapper {
    max-height: calc(100vh - 230px);
    overflow-y: auto;
}
#tabPlanoTrabalho .tabela-plano-trabalho thead th {
    position: sticky;
    top: 0;
    z-index: 5;
    /* border-collapse:collapse descarta as bordas do th ao grudar; box-shadow mantém a linha */
    box-shadow: inset 0 -1px 0 var(--border-light, rgba(0,0,0,0.12));
}

/* Separador de ano na tabela de Numeração P Trab */
#tabPlanoTrabalho .tabela-plano-trabalho tbody tr.pt-ano-sep td {
    background: #EEF2F7;
    color: #334155;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-align: left;
    padding: 6px 12px;
    border-top: 2px solid #94A3B8;
    border-bottom: 1px solid rgba(0,0,0,0.08);
    white-space: nowrap;
}
/* Primeiro bloco encosta no cabeçalho — a borda grossa ali vira ruído */
#tabPlanoTrabalho .tabela-plano-trabalho tbody tr.pt-ano-sep:first-child td {
    border-top: none;
}
#tabPlanoTrabalho .tabela-plano-trabalho tbody tr.pt-ano-sep .pt-ano-sep-count {
    margin-left: 10px;
    font-weight: 400;
    letter-spacing: 0;
    color: #64748B;
}
[data-theme="dark"] #tabPlanoTrabalho .tabela-plano-trabalho tbody tr.pt-ano-sep td {
    background: #16233c;
    color: #cbd5e1;
    border-top-color: #475569;
}
[data-theme="dark"] #tabPlanoTrabalho .tabela-plano-trabalho tbody tr.pt-ano-sep .pt-ano-sep-count {
    color: #94a3b8;
}
