/* ====================================================================== */
/* 💎 BELENERGY ENGINEERING SYSTEM - MONOTONE PRO UI v6.0                */
/* ====================================================================== */

:root {
    /* Paleta Monocromática & Focada (Slate & Indigo Sutil) */
    --primaria: #334155;       /* Slate-700 - Profissional e Neutro */
    --primaria-hover: #1E293B; /* Slate-800 */
    --primaria-light: #F1F5F9; /* Slate-100 - Destaque muito leve */
    
    --bg-body: #F8FAFC;        /* Slate-50 */
    --bg-card: #FFFFFF;
    --bg-sidebar: #1E293B;     /* Slate-800 - Menos agressivo que o preto */
    --bg-input: #FFFFFF;
    
    --texto-header: #0F172A;   /* Slate-900 */
    --texto-corpo: #475569;    /* Slate-600 */
    --texto-apoio: #94A3B8;    /* Slate-400 */
    
    --borda-suave: #E2E8F0;    /* Slate-200 */
    --borda-forte: #CBD5E1;    /* Slate-300 */
    --borda-focada: #64748B;   /* Slate-500 - Foco discreto */
    
    /* Destaques de Seleção (Substituindo o Amber) */
    --accent-select: #E0E7FF;  /* Indigo-100 - Para itens selecionados */
    --accent-text: #4338CA;    /* Indigo-700 - Texto em itens selecionados */
    
    --radius-sm: 4px;
    --radius-md: 6px;
    --radius-lg: 8px;
    
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.05); /* Sombra mais leve */
    
    /* Tipografia Compacta */
    --font-xs: 0.75rem;   /* 12px */
    --font-sm: 0.8125rem; /* 13px */
    --font-base: 0.875rem;/* 14px */
    --font-md: 1rem;      /* 16px */
    --font-lg: 1.125rem;  /* 18px */
    --font-xl: 1.25rem;   /* 20px */
}

/* --- Ajustes de Componentes Específicos para o Tema Monótono --- */

/* Sidebar: Mais sóbria */
.sidebar-engenharia .item-menu.active {
    background-color: rgba(255, 255, 255, 0.1);
    color: #FFFFFF;
    border-left: 3px solid var(--borda-forte); /* Marcador lateral em vez de cor sólida */
}

/* Valor de Destaque no Header: Agora em Slate-900 para ser sério */
.valor-destaque { color: var(--texto-header) !important; font-weight: 800; }

/* Cards de Módulo: Seleção discreta em azul claro/cinza */
.card-modulo.selecionado-usuario {
    border: 1px solid var(--borda-focada) !important;
    background: var(--primaria-light) !important;
}

.card-modulo.recomendado-ia {
    border: 1px solid #94A3B8 !important; /* Cinza médio */
    background: #F8FAFC !important;
}

.card-modulo.recomendado-ia .btn-selecionar-campeao {
    background: var(--primaria) !important;
}

/* Botões: Saem do Laranja para o Slate (Cinza Azulado) */
.btn-primary, .btn-primario, .btn-avancar, .btn-nav-wizard.avancar, .btn-proposta-ativo {
    background-color: var(--primaria) !important;
    color: #FFFFFF !important;
}

.btn-primary:hover, .btn-primario:hover, .btn-avancar:hover {
    background-color: var(--primaria-hover) !important;
}

/* Abas: Design "Pill" monótono */
.tab-button.active {
    background: var(--primaria) !important;
    color: white !important;
}

/* Etapas (Wizard): O "Ativo" agora é cinza escuro, o "Acessível" é cinza claro */
.item-etapa.ativo {
    color: var(--texto-header) !important;
    background-color: var(--borda-suave) !important;
}

/* Badges de Eficiência: Tons pastéis dessaturados */
.badge-eficiencia.ideal { background: #F1F5F9; color: #475569; border: 1px solid var(--borda-suave); }
.badge-eficiencia.critico { background: #FEF2F2; color: #991B1B; border: 1px solid #FCA5A5; }

/* Painel Financeiro: Foco total no número, não na cor */
.total-geral-proposta {
    background: #F8FAFC !important;
    color: var(--texto-header) !important;
    border: 1px solid var(--borda-forte) !important;
}

.destaque-lucro { 
    color: #0F172A !important; 
    background: #E2E8F0 !important; 
}

/* Reset & Base */
body {
    margin: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: #f1f5f9; /* Slate-100, para quebrar a monotonia do branco */
    color: var(--texto-corpo);
    font-size: var(--font-base);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* Scrollbar Fina e Elegante */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #CBD5E1; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #94A3B8; }

/* ====================================================================== */
/* LAYOUT: DASHBOARD (Sidebar + Main)                                     */
/* ====================================================================== */

.app-container {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

.sidebar-engenharia {
    width: 160px; /* Mais compacto */
    background-color: var(--bg-sidebar);
    color: #F1F5F9;
    display: flex;
    flex-direction: column;
    border-right: 1px solid #1E293B;
    flex-shrink: 0;
    transition: width 0.3s ease;
}

.sidebar-engenharia .logo-area {
    height: 56px;
    display: flex;
    align-items: center;
    padding: 0 15px; /* Margem reduzida */
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.sidebar-engenharia .logo-area img {
    max-height: 28px;
    width: auto;
}

.menu-principal {
    flex: 1;
    padding: 10px 8px; /* Padding reduzido */
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow-y: auto;
}

.item-menu {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    border-radius: var(--radius-md);
    color: #94A3B8;
    text-decoration: none;
    font-weight: 500;
    font-size: var(--font-sm);
    cursor: pointer;
    transition: all 0.2s;
}

.item-menu:hover {
    background-color: rgba(255,255,255,0.05);
    color: #F8FAFC;
}

.item-menu.active {
    background-color: var(--primaria);
    color: #FFFFFF;
    font-weight: 600;
}

.user-info-area {
    padding: 10px 15px;
    border-top: 1px solid rgba(255,255,255,0.08);
    background-color: rgba(0,0,0,0.2);
}

.user-name {
    display: none; /* Oculta nome na sidebar */
}

.logout-link {
    font-size: var(--font-xs);
    color: #94A3B8;
    text-decoration: none;
    margin-top: 2px;
    display: block;
}
.logout-link:hover { color: #EF4444; }

.main-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background-color: var(--bg-body);
}

.header-principal {
    height: 56px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--borda-suave);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    flex-shrink: 0;
}

.info-sessao { display: none; } /* Oculta info de sessão no header */

.conteudo-principal {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}

/* ====================================================================== */
/* LAYOUT: GERADOR (Header Fixo + Area Trabalho)                          */
/* ====================================================================== */

.header-engenharia-fixo {
    height: 52px; /* Ultra compacto */
    background: var(--bg-sidebar); /* FUNDO ESCURO PARA O HEADER */
    border-bottom: 1px solid #1E293B; /* Borda mais escura, slate-800 */
    display: flex;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 0 20px;
    box-shadow: var(--shadow-sm);
}

.header-container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-engenharia-fixo .logo-area {
    display: flex;
    align-items: center;
    height: 100%;
}

.logo-top-fixa { height: 24px; width: auto; }

.divider-v {
    width: 1px;
    height: 20px;
    background: var(--borda-suave);
    margin: 0 12px;
}

.vital-item {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 0 8px;
    line-height: 1.1;
}

.vital-item small {
    font-size: 0.6rem;
    font-weight: 600;
    color: #94A3B8; /* Slate-400, bom contraste em fundo escuro */
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.vital-item strong {
    font-size: 0.8rem;
    font-weight: 600;
    color: #F1F5F9; /* Texto claro para fundo escuro */
}

.vitals-monitor { display: flex; align-items: center; }
.valor-destaque { color: var(--primaria); }

.area-trabalho-engenharia {
    max-width: 1100px; /* Mais estreito para leitura */
    margin: 20px auto;
    padding: 0 20px 60px 20px;
    display: flex;
    flex-direction: column;
    gap: 12px; /* Gap reduzido */
}

/* ====================================================================== */
/* COMPONENTES: CARDS & CONTAINERS                                        */
/* ====================================================================== */

.card-tecnico {
    background: var(--bg-card);
    border: 1px solid var(--borda-suave);
    border-radius: var(--radius-lg);
    padding: 16px 20px; /* Padding reduzido */
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.2s, border-color 0.2s;
}

.card-tecnico:hover {
    border-color: var(--borda-forte);
    box-shadow: var(--shadow-md);
}

.secao-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--borda-suave);
}

.secao-header > div { display: flex; align-items: center; gap: 8px; }
.secao-header i { color: var(--primaria); font-size: 0.9rem; }
.secao-header span { font-size: var(--font-base); font-weight: 600; color: var(--texto-header); }
.secao-header small { font-size: var(--font-xs); color: var(--texto-apoio); font-weight: 400; margin-left: 5px; }

.header-modulo {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--borda-suave);
    padding-bottom: 8px;
}
.header-modulo h2 {
    font-size: var(--font-lg);
    font-weight: 700;
    color: var(--texto-header);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ====================================================================== */
/* COMPONENTES: FORMULÁRIOS & INPUTS                                      */
/* ====================================================================== */

.grid-inputs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px 16px;
}

/* Grid de Formulário (12 Colunas Fixas) - Para Cadastros Compactos */
.grid-form {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 12px 16px;
}

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

.form-group label {
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--texto-corpo);
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.input-estilizado, .input-monitorado, .input-financeiro, select.input-estilizado, select.input-monitorado {
    height: 30px !important; /* Altura compacta */
    padding: 0 8px !important;
    font-size: 0.8rem !important;
    color: var(--texto-header);
    background: var(--bg-input);
    border: 1px solid var(--borda-suave) !important;
    border-radius: var(--radius-md) !important;
    transition: all 0.2s;
    width: 100%;
    box-sizing: border-box;
}

.input-estilizado:focus, .input-monitorado:focus, .input-financeiro:focus {
    border-color: var(--borda-focada) !important;
    outline: none;
    box-shadow: 0 0 0 2px rgba(217, 119, 6, 0.1) !important;
}

.input-estilizado::placeholder { color: #CBD5E1; }
.input-heranca { background-color: #F1F5F9; color: #64748b; cursor: default; }

/* Colunas Utilitárias */
.col-4 { grid-column: span 4; }
.col-6 { grid-column: span 6; }
.col-8 { grid-column: span 8; }
.col-12 { grid-column: span 12; }

/* Responsividade para Grid Form */
@media (max-width: 768px) {
    .grid-form { display: flex; flex-direction: column; }
    .col-4, .col-6, .col-8, .col-12 { width: 100%; }
}

/* ====================================================================== */
/* COMPONENTES: BOTÕES                                                    */
/* ====================================================================== */

.btn-primary, .btn-primario {
    background-color: var(--primaria);
    color: #FFFFFF;
    font-weight: 600;
    font-size: var(--font-sm);
    padding: 8px 16px;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: background 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    justify-content: center;
    height: 30px;
}

.btn-primary:hover, .btn-primario:hover {
    background-color: var(--primaria-hover);
}

.btn-secundario {
    background-color: #FFFFFF; /* Fundo sólido para destaque */
    border: 1px solid var(--borda-forte); /* Borda mais visível */
    color: var(--texto-header); /* Texto mais escuro */
    font-weight: 600;
    font-size: var(--font-sm);
    padding: 8px 16px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 30px;
    box-shadow: var(--shadow-sm); /* Profundidade */
}

.btn-secundario:hover {
    background-color: #F8FAFC;
    border-color: var(--texto-apoio);
    transform: translateY(-1px); /* Feedback tátil */
    box-shadow: var(--shadow-md);
}

/* Botão de Perigo (Excluir/Cancelar Crítico) */
.btn-perigo {
    background-color: #FFFFFF;
    border: 1px solid #EF4444;
    color: #EF4444;
    font-weight: 600;
    font-size: var(--font-sm);
    padding: 8px 16px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 30px;
    box-shadow: var(--shadow-sm);
}

.btn-perigo:hover {
    background-color: #FEF2F2;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(239, 68, 68, 0.15);
}

/* Botão de Visualização (Lista) */
.btn-visualizar {
    background-color: #FFFFFF;
    border: 1px solid #3B82F6;
    color: #3B82F6;
    font-weight: 600;
    font-size: var(--font-sm);
    padding: 6px 12px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    box-shadow: var(--shadow-sm);
}

.btn-visualizar:hover {
    background-color: #EFF6FF;
    transform: translateY(-1px);
}

.btn-primary-sm {
    padding: 4px 10px;
    font-size: var(--font-xs);
    height: 28px;
}

.botoes-fluxo {
    display: flex;
    justify-content: space-between; /* Separa os botões nas extremidades */
    align-items: center;
    gap: 10px;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid var(--borda-suave);
}

/* ====================================================================== */
/* COMPONENTES: TABELAS (TRADICIONAL)                                     */
/* ====================================================================== */

.tabela-container, .tabela-scroll-engenharia {
    overflow-x: auto;
    border: 1px solid var(--borda-suave);
    border-radius: var(--radius-md);
    background: #FFFFFF;
    max-height: 500px; /* Altura controlada */
    overflow-y: auto;
}

.tabela-gestao, .tabela-tecnica, .tabela-transversal, .tabela-sugestoes, .tabela-projetos, .tabela-propostas {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--font-sm);
}

.tabela-gestao thead, .tabela-tecnica thead, .tabela-transversal thead, .tabela-sugestoes thead, .tabela-projetos thead, .tabela-propostas thead {
    display: table-header-group !important;
}

.tabela-gestao th, .tabela-tecnica th, .tabela-transversal th, .tabela-sugestoes th, .tabela-projetos th, .tabela-propostas th {
    background-color: #F8FAFC;
    color: var(--texto-apoio);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.65rem;
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--borda-suave);
    position: sticky;
    top: 0;
    z-index: 10;
}

.tabela-gestao tbody, .tabela-tecnica tbody, .tabela-transversal tbody, .tabela-sugestoes tbody, .tabela-projetos tbody, .tabela-propostas tbody {
    display: table-row-group;
}

.tabela-gestao tr, .tabela-tecnica tr, .tabela-transversal tr, .tabela-sugestoes tr, .tabela-projetos tr, .tabela-propostas tr {
    display: table-row;
    background: transparent;
    border: none;
    border-radius: 0;
    margin: 0;
    padding: 0;
    box-shadow: none;
}

.tabela-gestao tbody tr:hover, .tabela-tecnica tbody tr:hover, .tabela-transversal tbody tr:hover, .tabela-sugestoes tbody tr:hover, .tabela-projetos tbody tr:hover, .tabela-propostas tbody tr:hover {
    background-color: #F1F5F9;
    transform: none;
    box-shadow: none;
}

.tabela-gestao td, .tabela-tecnica td, .tabela-transversal td, .tabela-sugestoes td, .tabela-projetos td, .tabela-propostas td {
    display: table-cell;
    padding: 12px 16px;
    border-bottom: 1px solid var(--borda-suave);
    color: var(--texto-corpo);
    font-size: 0.75rem !important; /* Padronização forçada */
    vertical-align: middle;
    background-color: transparent;
    border-radius: 0;
    border: none;
    border-bottom: 1px solid var(--borda-suave);
}

/* Tenta recuperar o Label via atributo data-label (se existir no HTML) */
.tabela-gestao td::before, .tabela-tecnica td::before, .tabela-transversal td::before, .tabela-sugestoes td::before, .tabela-projetos td::before, .tabela-propostas td::before {
    display: none;
}

/* Reset Actions Column */
.tabela-gestao td:last-child, .tabela-tecnica td:last-child, .tabela-transversal td:last-child, .tabela-sugestoes td:last-child, .tabela-projetos td:last-child, .tabela-propostas td:last-child {
    position: static;
    opacity: 1;
    pointer-events: auto;
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--borda-suave);
    padding: 12px 16px;
    margin: 0;
    display: table-cell;
    text-align: right;
    box-shadow: none;
}

.btn-icon {
    border: none;
    background: transparent;
    color: var(--texto-apoio);
    cursor: pointer;
    padding: 6px;
    font-size: 1rem;
    transition: color 0.2s;
}
.btn-icon:hover { color: var(--primaria); }

/* ====================================================================== */
/* COMPONENTES: DASHBOARD WIDGETS                                         */
/* ====================================================================== */

.grid-resumo-dashboard {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.card-indicador {
    background: var(--bg-card);
    padding: 12px 16px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--borda-suave);
    display: flex;
    align-items: center;
    gap: 10px;
}

.icon-indicador {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    background-color: var(--primaria-light);
    color: var(--primaria);
    transition: all 0.3s ease;
}

.icon-indicador i {
    color: var(--primaria);
}

.info-indicador span {
    display: block;
    font-size: 0.6rem;
    color: var(--texto-apoio);
    font-weight: 600;
    text-transform: uppercase;
}

.etapa-ativa {
    display: block !important;
    animation: fadeIn 0.5s ease-in-out;
}

.info-indicador strong {
    font-size: 1.1rem;
    color: var(--texto-header);
    font-weight: 700;
    line-height: 1.2;
}

/* ====================================================================== */
/* COMPONENTES: GERADOR ESPECÍFICOS                                       */
/* ====================================================================== */

.hsp-display-luxe {
    display: flex;
    align-items: center;
    background: #F8FAFC;
    border: 1px solid var(--borda-suave);
    border-radius: var(--radius-md);
    padding: 4px 10px;
    height: 30px;
    box-sizing: border-box;
}

.hsp-icon { color: var(--primaria); margin-right: 8px; font-size: 0.9rem; }
.hsp-valor span { font-weight: 700; color: var(--texto-header); font-size: 0.9rem; }
.hsp-valor small { font-size: 0.6rem; color: var(--texto-apoio); margin-left: 4px; }

.seletor-modo-engenharia {
    display: flex;
    background: #F1F5F9;
    padding: 2px;
    border-radius: var(--radius-md);
    border: 1px solid var(--borda-suave);
}

.btn-modo-eng {
    border: none;
    background: transparent;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--texto-apoio);
    cursor: pointer;
}

.btn-modo-eng.ativo {
    background: #FFFFFF;
    color: var(--texto-header);
    box-shadow: var(--shadow-sm);
}

/* Painel Financeiro */
.painel-detalhamento-cascata {
    background: #F8FAFC;
    border-radius: var(--radius-lg);
    padding: 12px;
    margin-top: 12px;
    border: 1px solid var(--borda-suave);
}

.painel-detalhamento-cascata h4 {
    margin: 0 0 8px 0;
    font-size: var(--font-sm);
    color: var(--texto-header);
}

.linha-custo {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    font-size: 0.8rem;
    color: var(--texto-corpo);
    border-bottom: 1px dashed var(--borda-suave);
}

.destaque-lucro { color: #16A34A; font-weight: 600; background: #DCFCE7; padding: 2px 6px; border-radius: 4px; border-bottom: none; }
.destaque-imposto { color: #DC2626; font-weight: 600; }

.total-geral-proposta {
    background: #F0FDF4;
    color: #15803D;
    padding: 10px;
    border-radius: var(--radius-md);
    margin-top: 10px;
    display: flex;
    justify-content: space-between;
    font-weight: 700;
    font-size: 0.95rem;
    border: 1px solid #BBF7D0;
}

/* Resumo Final */
.grid-resumo-final {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    padding: 8px 0;
}

.item-resumo label {
    display: block;
    font-size: 0.65rem;
    text-transform: uppercase;
    color: var(--texto-apoio);
    font-weight: 700;
    margin-bottom: 2px;
}

.item-resumo p {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--texto-header);
    margin: 0;
}

.texto-destaque-valor { color: #16A34A !important; font-size: 1.1rem !important; }

/* Botão Final */
.container-acao-final { margin-top: 24px; text-align: center; }

.btn-proposta-ativo {
    background: var(--primaria);
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(217, 119, 6, 0.2);
    width: 100%;
    font-size: 0.95rem;
    transition: transform 0.2s;
}
.btn-proposta-ativo:hover { transform: translateY(-1px); }

.btn-proposta-desabilitado {
    background-color: #E2E8F0;
    color: #94A3B8;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: not-allowed;
    width: 100%;
    font-size: 0.95rem;
}

/* Botão quando movido para o Header Fixo */
.btn-header-destaque {
    height: 36px !important;
    padding: 0 20px !important;
    font-size: 0.85rem !important;
    box-shadow: 0 0 10px rgba(217, 119, 6, 0.4) !important;
}

/* Utilitários */
.oculto { display: none !important; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.clickable { cursor: pointer; }

/* Toggle Switch Lux */
.toggle-container-lux {
    display: flex;
    background-color: #E2E8F0;
    border-radius: 4px;
    padding: 2px;
}
.toggle-container-lux input[type="radio"] { display: none; }
.toggle-container-lux label {
    padding: 4px 8px;
    cursor: pointer;
    border-radius: 3px;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--texto-apoio);
    transition: all 0.2s;
}
.toggle-container-lux input[type="radio"]:checked+label {
    background-color: #FFFFFF;
    color: var(--texto-header);
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

/* Badges */
.badge-contagem {
    background: #F1F5F9;
    color: var(--texto-corpo);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    border: 1px solid var(--borda-suave);
}

/* Badges de Eficiência (Tabela de Sugestões) */
.badge-eficiencia {
    font-size: 0.65rem;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.badge-eficiencia.ideal { background: #DCFCE7; color: #15803D; border: 1px solid #86EFAC; }
.badge-eficiencia.info { background: #EFF6FF; color: #1E40AF; border: 1px solid #93C5FD; }
.badge-eficiencia.atencao { background: #FEF3C7; color: #B45309; border: 1px solid #FCD34D; }
.badge-eficiencia.critico { background: #FEF2F2; color: #B91C1C; border: 1px solid #FCA5A5; }
.badge-eficiencia.ocioso { background: #F1F5F9; color: #64748B; border: 1px solid #CBD5E1; }

.badge-recomendado {
    background: #EFF6FF;
    color: #2563EB;
    border: 1px solid #60A5FA;
    font-size: 0.65rem;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* Login Page Specifics */
.body-login {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
    background-color: #0F172A;
}
.container-login {
    background: #FFFFFF;
    padding: 30px;
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 360px;
    text-align: center;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}
.logo-login { max-height: 40px; margin-bottom: 20px; }
.container-login h1 { font-size: 1.1rem; color: var(--texto-header); margin-bottom: 24px; }

/* Cards de Módulos (Grid Sugestões) */
.grid-sugestoes {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin-top: 12px;
}

.card-modulo {
    background: #fff;
    border: 1px solid var(--borda-suave);
    border-radius: var(--radius-md);
    padding: 12px;
    text-align: center;
    transition: all 0.2s;
    position: relative;
}

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

.card-modulo.recomendado-ia {
    border: 1px solid #22c55e;
    background: #f0fdf4;
}

.card-modulo.selecionado-usuario {
    border: 1px solid #3b82f6;
    background: #eff6ff;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

.label-potencia {
    font-size: 1.1rem;
    font-weight: 800;
    color: #0f172a;
    display: block;
    margin: 6px 0;
}

.btn-selecionar-campeao {
    width: 100%;
    padding: 6px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.75rem;
    cursor: pointer;
    border: none;
    margin-top: 10px;
    background: #f1f5f9;
    color: #475569;
}

.card-modulo.recomendado-ia .btn-selecionar-campeao { background: #22c55e; color: white; }
.card-modulo.selecionado-usuario .btn-selecionar-campeao { background: #3b82f6; color: white; }

/* Chips e Tags */
.tag-inversor-selecionado {
    display: inline-flex;
    align-items: center;
    background: #F1F5F9;
    padding: 4px 8px;
    border-radius: 12px;
    margin: 2px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #334155;
    border: 1px solid var(--borda-suave);
}
.tag-inversor-selecionado i { margin-left: 6px; color: #94a3b8; cursor: pointer; font-size: 0.8rem; }
.tag-inversor-selecionado i:hover { color: #ef4444; }

.alerta-sugestao-clean {
    background-color: #F0FDF4;
    border: 1px dashed #16A34A;
    color: #166534;
    padding: 10px;
    border-radius: var(--radius-md);
    font-size: 0.85rem;
}

/* Seções de Configuração (Dashboard) */
.secao-config {
    background-color: #F8FAFC;
    border: 1px solid var(--borda-suave);
    border-radius: var(--radius-md);
    padding: 20px;
}

/* ====================================================================== */
/* 📑 NAVEGAÇÃO POR ABAS (HORIZONTAL)                                    */
/* ====================================================================== */

/* Força o container das abas a ser horizontal e elegante */
.container-abas-proposta {
    display: flex !important;
    flex-direction: row !important; /* Garante horizontalidade */
    gap: 8px;
    background: rgba(255, 255, 255, 0.1); /* Fundo sutil para abas no header escuro */
    padding: 6px;
    border-radius: var(--radius-lg);
    margin: 15px 0;
    width: fit-content;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

/* ====================================================================== */
/* 📌 BARRA DE CONTEXTO DO PROJETO (STICKY)                               */
/* ====================================================================== */

#sticky_wrapper_contexto {
    position: sticky;
    top: 52px; /* Altura do header fixo */
    z-index: 90;
    background-color: #f1f5f9; /* Deve ser igual ao novo fundo do body */
    padding-top: 10px;
    margin-bottom: 10px;
}

.contexto-projeto-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #E2E8F0; /* Fundo cinza discreto (Slate-200) */
    padding: 10px 20px;
    border-radius: var(--radius-lg);
    border: 1px solid #CBD5E1; /* Borda um pouco mais visível */
    box-shadow: none; /* Remove sombra para aspecto "flat" */
    margin-bottom: 10px;
    flex-wrap: wrap;
    gap: 15px;
}

.ctx-item {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.ctx-item label {
    font-size: 0.65rem;
    text-transform: uppercase;
    color: #64748B; /* Slate-500 para melhor contraste no cinza */
    font-weight: 700;
    letter-spacing: 0.5px;
}

.ctx-item span {
    font-size: 0.85rem;
    font-weight: 500;
    color: #1E293B; /* Slate-800 para leitura clara */
}

.ctx-divider {
    width: 1px;
    height: 25px;
    background: #CBD5E1; /* Slate-300 para aparecer no fundo cinza */
}

/* ====================================================================== */
/* 🧭 NAVEGAÇÃO DE ETAPAS (WIZARD STEPS)                                  */
/* ====================================================================== */

.menu-etapas-container {
    display: flex;
    align-items: center;
    justify-content: space-between; /* Espaça botões e etapas */
    gap: 8px;
    padding: 8px 12px; /* Padding ajustado */
    margin-bottom: 0; /* Margem controlada pelo wrapper sticky */
    background: #fff;
    border-bottom: 1px solid var(--borda-suave);
    width: 100%;
    border-radius: var(--radius-lg);
    border: 1px solid var(--borda-suave);
    box-sizing: border-box;
}

/* Container central das etapas (Scrollável se necessário) */
.lista-etapas-scroll {
    display: flex;
    align-items: center;
    gap: 8px;
    overflow-x: auto;
    flex: 1;
    justify-content: center;
    padding: 4px 0;
}

.item-etapa {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: var(--font-sm); /* Fonte menor e elegante */
    font-weight: 600;
    color: var(--texto-apoio);
    padding: 6px 12px;
    border-radius: 20px;
    transition: all 0.2s ease;
    white-space: nowrap;
    user-select: none;
}

.item-etapa i {
    font-size: 0.85em; /* Ícone pequeno */
}

/* Estado: Ativo (Etapa Atual) */
.item-etapa.ativo {
    color: var(--primaria);
    background-color: var(--primaria-light);
    box-shadow: 0 0 0 1px rgba(217, 119, 6, 0.1);
}

/* Estado: Acessível (Passado/Clicável) */
.item-etapa.acessivel {
    cursor: pointer;
    color: var(--texto-corpo);
}

.item-etapa.acessivel:hover {
    background-color: #f1f5f9;
    color: var(--texto-header);
}

/* Estado: Bloqueado (Futuro) */
.item-etapa.bloqueado {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Separador entre etapas */
.separador-etapa {
    color: var(--borda-forte);
    font-size: 0.65rem;
    display: flex;
    align-items: center;
    opacity: 0.6;
}

.tab-button {
    padding: 8px 20px;
    border: none;
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    background: transparent;
    color: var(--texto-apoio);
    transition: all 0.3s ease;
    font-size: var(--font-sm); /* Ajuste para fonte média/menor */
    display: flex;
    align-items: center;
    gap: 8px;
}

.tab-button i {
    font-size: 0.9em; /* Ícone pequeno */
}

/* Estado Ativo: Segue o padrão Amber da sua marca */
.tab-button.active {
    background: white;
    color: var(--primaria);
    box-shadow: var(--shadow-sm);
}

.tab-button:hover:not(.active) {
    background: rgba(255, 255, 255, 0.15);
    color: #FFF;
}

/* ====================================================================== */
/* 🚧 CONTROLE DE VISIBILIDADE (O FIM DO EMPILHAMENTO)                   */
/* ====================================================================== */

/* Esconde todos os containers de abas que NÃO estão ativos */
.aba-content {
    display: none !important; 
}

/* Mostra apenas o que tem a classe active */
.aba-content.active {
    display: block !important;
}

/* FIX: Esconde as ETAPAS que não estão ativas para resolver o empilhamento */
.etapa-oculta {
    display: none !important;
}

/* ====================================================================== */
/* 🚀 BOTÕES DE NAVEGAÇÃO E ÁREA DE AÇÃO                                  */
/* ====================================================================== */

.area-acao-navegacao {
    margin-top: 25px;
    text-align: center;
    padding: 20px;
    border: 1px solid;
    border-radius: var(--radius-lg);
    transition: all 0.3s ease;
}

.area-acao-navegacao.estado-valido {
    background-color: #F0FDF4;
    border-color: #BBF7D0;
}

.area-acao-navegacao.estado-valido .feedback-validacao { color: #15803D; }

.area-acao-navegacao.estado-invalido {
    background-color: #F8FAFC;
    border-color: var(--borda-suave);
}

.area-acao-navegacao.estado-invalido .feedback-validacao { color: var(--texto-apoio); }

.feedback-validacao {
    font-weight: 600;
    margin-bottom: 15px;
    font-size: var(--font-sm);
}

.btn-avancar {
    background-color: var(--primaria);
    color: #FFFFFF;
    font-weight: 600;
    font-size: var(--font-base);
    padding: 10px 24px;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: var(--shadow-sm);
}

.btn-avancar:hover {
    background-color: var(--primaria-hover);
    transform: translateY(-1px);
}

.btn-avancar.inativo {
    background-color: var(--borda-suave);
    color: var(--texto-apoio);
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

/* Botões de Navegação Fixa (Wizard) */
.btn-nav-wizard {
    height: 36px;
    padding: 0 20px;
    font-weight: 700;
    font-size: 0.85rem;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-nav-wizard.avancar {
    background-color: var(--primaria);
    color: white;
    border: 1px solid var(--primaria-hover);
    box-shadow: 0 2px 4px rgba(217, 119, 6, 0.25); /* Sombra expressiva */
}
.btn-nav-wizard.avancar:hover:not(:disabled) {
    background-color: var(--primaria-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(217, 119, 6, 0.3);
}
.btn-nav-wizard.avancar:disabled {
    background-color: #E2E8F0;
    color: #94A3B8;
    border-color: #CBD5E1;
    cursor: not-allowed;
    box-shadow: none;
}

.btn-nav-wizard.voltar {
    background-color: white;
    color: var(--texto-corpo);
    border: 1px solid var(--borda-forte);
}
.btn-nav-wizard.voltar:hover {
    background-color: #F1F5F9;
    color: var(--texto-header);
}

.nav-etapa-container {
    margin-bottom: 15px;
}

.btn-voltar-etapa {
    background-color: transparent;
    border: 1px solid var(--borda-forte);
    color: var(--texto-corpo);
    font-weight: 500;
    font-size: var(--font-sm);
    padding: 8px 16px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-voltar-etapa:hover {
    background-color: #F1F5F9;
    color: var(--texto-header);
    border-color: var(--texto-apoio);
}

/* ====================================================================== */
/* 🛠️ COMPONENTES DE EXPANSÃO E EDIÇÃO                                    */
/* ====================================================================== */

.btn-ver-todos {
    background-color: transparent;
    border: 1px solid var(--borda-suave);
    color: var(--texto-corpo);
    font-weight: 600;
    font-size: var(--font-sm);
    padding: 10px;
    border-radius: var(--radius-md);
    cursor: pointer;
    width: 100%;
    transition: all 0.2s;
    margin-top: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-ver-todos:hover {
    background-color: #F1F5F9;
    color: var(--texto-header);
    border-color: var(--borda-forte);
}

.inversor-sugerido.selecionado {
    background-color: #F0FDF4 !important;
    border-left: 4px solid #16A34A;
}

.btn-icon-sm {
    background: transparent;
    border: none;
    color: var(--primaria);
    cursor: pointer;
    font-size: 0.85rem;
    padding: 4px;
    transition: color 0.2s;
}

.btn-icon-sm:hover {
    color: var(--primaria-hover);
}

/* ====================================================================== */
/* 👁️ MODO LEITURA (VISUALIZAÇÃO SUTIL)                                  */
/* ====================================================================== */

.modo-leitura-ativo .input-monitorado,
.modo-leitura-ativo .input-estilizado,
.modo-leitura-ativo .input-financeiro,
.modo-leitura-ativo select {
    background-color: transparent !important;
    border: none !important;
    border-bottom: 1px dashed #cbd5e1 !important; /* Linha sutil para guiar o olho */
    border-radius: 0 !important;
    color: #334155 !important;
    font-weight: 500;
    pointer-events: none; /* Impede clique */
    padding-left: 0 !important;
    box-shadow: none !important;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

/* Remove setas de select no modo leitura */
.modo-leitura-ativo select {
    background-image: none !important;
}

/* Esconde elementos de controle no modo leitura */
.modo-leitura-ativo .controles-orientacao,
.modo-leitura-ativo .btn-remover-linha,
.modo-leitura-ativo .btn-add-linha,
.modo-leitura-ativo .fa-times-circle, /* Remove X dos inversores */
.modo-leitura-ativo .btn-icon-sm,     /* Remove lápis de edição */
.modo-leitura-ativo .btn-nav-wizard,  /* Remove botões de navegação inferior */
.modo-leitura-ativo .btn-ver-todos,   /* Remove expansão de listas */
.modo-leitura-ativo .btn-secundario-sm /* Remove botão adicionar inversor manual */
{
    display: none !important;
}

/* ====================================================================== */
/* 🎛️ CONTROLES DE VISUALIZAÇÃO (DASHBOARD TOGGLE)                       */
/* ====================================================================== */

.controles-visualizacao {
    display: flex;
    gap: 5px;
    background: var(--bg-body);
    padding: 4px;
    border-radius: 6px;
    border: 1px solid var(--borda-suave);
}

.btn-icon-toggle {
    background: transparent;
    border: none;
    color: var(--texto-apoio);
    padding: 6px 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 4px;
    font-size: 1rem;
}

.btn-icon-toggle:hover {
    color: var(--primaria);
}

/* Estado Ativo: Mudança discreta mas perceptível */
.btn-icon-toggle.active {
    background: var(--bg-card);
    color: var(--primaria);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    font-weight: bold;
}

/* ====================================================================== */
/* 💎 COMPONENTES SOFISTICADOS (VÁRIAS ÁGUAS & SELECTS)                   */
/* ====================================================================== */

.linha-orientacao {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr auto;
    gap: 15px;
    align-items: end;
    background: #FFFFFF;
    border: 1px solid var(--borda-suave);
    border-radius: var(--radius-md);
    padding: 15px;
    margin-bottom: 10px;
    transition: all 0.2s;
}

.linha-orientacao:hover {
    border-color: var(--borda-forte);
    box-shadow: var(--shadow-sm);
}

.btn-remover-linha {
    height: 30px;
    width: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #FECACA;
    background: #FEF2F2;
    color: #EF4444;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 2px; /* Alinhamento visual com inputs */
}

.btn-remover-linha:hover {
    background: #EF4444;
    color: white;
}

.select-wrapper-sophisticated {
    position: relative;
    background: #fff;
    border: 1px solid var(--borda-suave);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    transition: all 0.2s;
}

.select-wrapper-sophisticated:hover {
    border-color: var(--borda-focada);
    box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.1);
}

.select-wrapper-sophisticated .select-arrow {
    position: absolute;
    right: 10px;
    color: var(--primaria);
    pointer-events: none;
    font-size: 0.8rem;
}

.select-wrapper-sophisticated select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    padding-right: 30px !important;
    cursor: pointer;
    border: none !important; /* Remove borda do input interno */
    background: transparent !important;
    box-shadow: none !important;
    font-weight: 600;
    color: var(--texto-header);
}

/* ====================================================================== */
/* 🛡️ SEGURANÇA E DISPOSITIVOS                                            */
/* ====================================================================== */

.card-seguranca {
    border-left: 4px solid var(--primaria);
}

.dispositivo-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid var(--borda-suave);
    transition: background 0.2s;
}
.dispositivo-item:last-child { border-bottom: none; }
.dispositivo-item:hover { background-color: #F8FAFC; }

.dispositivo-item.bloqueado { background-color: #FEF2F2; border-left: 3px solid #EF4444; }
.dispositivo-item.pendente { background-color: #FFFBEB; border-left: 3px solid #F59E0B; }

.badge-status {
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-dono { background: #DCFCE7; color: #166534; border: 1px solid #86EFAC; }
.status-pendente { background: #FEF3C7; color: #B45309; border: 1px solid #FCD34D; }
.status-bloqueado { background: #FEE2E2; color: #991B1B; border: 1px solid #FCA5A5; }

.btn-acao {
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    border: none;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-autorizar { background: #DCFCE7; color: #166534; border: 1px solid #86EFAC; }
.btn-autorizar:hover { background: #22C55E; color: white; border-color: #22C55E; }

.btn-bloquear { background: #FEE2E2; color: #991B1B; border: 1px solid #FCA5A5; }
.btn-bloquear:hover { background: #EF4444; color: white; border-color: #EF4444; }

/* ====================================================================== */
/* � BUSCA INTELIGENTE (HEADER)                                          */
/* ====================================================================== */

.search-container-header {
    position: relative;
    width: 100%;
    max-width: 400px;
    margin: 0 auto; /* Centraliza se desejar, ou ajuste */
}

.input-search-header {
    width: 100%;
    padding: 8px 12px 8px 35px;
    border-radius: 20px;
    border: 1px solid var(--borda-suave);
    background-color: #F1F5F9;
    font-size: 0.9rem;
    color: var(--texto-header);
    transition: all 0.2s;
}

.input-search-header:focus {
    background-color: #FFFFFF;
    border-color: var(--primaria);
    box-shadow: 0 0 0 2px rgba(217, 119, 6, 0.1);
    outline: none;
}

.search-icon-header {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--texto-apoio);
    font-size: 0.9rem;
}

.search-results-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: white;
    border: 1px solid var(--borda-suave);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    margin-top: 5px;
    z-index: 1000;
    max-height: 300px;
    overflow-y: auto;
    display: none;
}

.search-result-item {
    padding: 10px 15px;
    border-bottom: 1px solid var(--borda-suave);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: background 0.1s;
}

.search-result-item:last-child { border-bottom: none; }
.search-result-item:hover { background-color: #F8FAFC; }

.result-icon {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
}

.result-info { display: flex; flex-direction: column; line-height: 1.2; }
.result-title { font-size: 0.85rem; font-weight: 600; color: var(--texto-header); }
.result-subtitle { font-size: 0.7rem; color: var(--texto-apoio); }

/* ====================================================================== */
/* 🍃 REFINAMENTO: INPUTS DISCRETOS & MODO LEITURA ULTRA-CLEAN            */
/* ====================================================================== */

/* Inputs em estado de repouso: Bordas quase invisíveis */
.input-estilizado, 
.input-monitorado, 
.input-financeiro, 
select.input-estilizado {
    border-color: #F1F5F9 !important; /* Slate-100: Quase funde com o fundo branco */
    background-color: #FCFDFF;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: none !important;
}

/* Hover nos inputs: Revela a borda suavemente */
.input-estilizado:hover, 
.input-monitorado:hover {
    border-color: var(--borda-suave) !important;
}

/* Foco: O único momento em que o input ganha "cor" (Slate-500) */
.input-estilizado:focus, 
.input-monitorado:focus {
    border-color: var(--borda-focada) !important;
    background-color: #FFFFFF;
    box-shadow: 0 0 0 1px var(--borda-focada) !important;
}

/* 👁️ MODO LEITURA: "Design Fantasma" */
.modo-leitura-ativo .card-tecnico {
    box-shadow: none !important;
    border-color: #F1F5F9 !important;
}

.modo-leitura-ativo .input-monitorado,
.modo-leitura-ativo .input-estilizado,
.modo-leitura-ativo .input-financeiro,
.modo-leitura-ativo select {
    border-bottom: 1px solid transparent !important; /* Remove até a linha tracejada */
    color: var(--texto-header) !important;
    font-weight: 600; /* Texto ganha peso para compensar a falta de borda */
    padding-left: 0 !important;
    background-color: transparent !important;
}

/* Em modo leitura, as labels ficam ainda mais leves para o dado brilhar */
.modo-leitura-ativo label {
    color: var(--texto-apoio) !important;
    font-size: 0.6rem !important;
    letter-spacing: 0.05em;
}

/* Placeholder desaparece totalmente no modo leitura */
.modo-leitura-ativo ::placeholder {
    color: transparent !important;
}

/* Sticky Context Bar no modo leitura: Fica flat com o fundo */
.modo-leitura-ativo #sticky_wrapper_contexto {
    padding-top: 0;
}

.modo-leitura-ativo .contexto-projeto-bar {
    background: transparent !important;
    border: none !important;
    padding: 10px 0;
    border-bottom: 1px solid var(--borda-suave) !important;
    border-radius: 0;
}

/* ====================================================================== */
/* ⚡ OVERRIDES ESPECÍFICOS DO DASHBOARD (FORÇAR DESIGN MONÓTONO)         */
/* ====================================================================== */

/* Força ícones monocromáticos no Dashboard, ignorando cores inline ou classes antigas */
#area_dinamica .icon-indicador,
#area_dinamica .icon-indicador i,
#area_dinamica .card-indicador i {
    background-color: var(--primaria-light) !important;
    color: var(--primaria) !important;
    box-shadow: none !important;
    text-shadow: none !important;
    border-color: var(--borda-suave) !important;
}

/* ====================================================================== */
/* 📱 RESPONSIVIDADE AVANÇADA (MOBILE & TABLET)                           */
/* ====================================================================== */

@media (max-width: 1024px) {
    /* Ajustes para Tablets e Notebooks pequenos */
    .sidebar-engenharia {
        width: 70px; /* Sidebar recolhida (ícones apenas) */
        padding: 10px 5px;
    }
    
    .sidebar-engenharia .item-menu {
        justify-content: center;
        padding: 10px 0;
    }
    
    .sidebar-engenharia .item-menu span {
        display: none; /* Esconde texto */
    }
    
    .sidebar-engenharia .logo-area {
        padding: 0 5px;
        justify-content: center;
    }
    
    .sidebar-engenharia .logo-area img {
        max-height: 24px;
    }
    
    .area-trabalho-engenharia {
        padding: 0 15px 40px 15px;
    }
}

@media (max-width: 768px) {
    /* Layout Geral Mobile */
    .app-container {
        flex-direction: column;
        height: 100vh; /* Mantém viewport height */
        overflow: hidden;
    }

    .sidebar-engenharia {
        width: 100%;
        height: 60px; /* Altura fixa para barra inferior */
        flex-direction: row;
        overflow-x: auto;
        padding: 5px;
        border-right: none;
        border-top: 1px solid #1E293B;
        border-bottom: none;
        order: 2; /* Joga para baixo (Bottom Navigation) */
        justify-content: space-around;
        background-color: var(--bg-sidebar);
        z-index: 1000;
        flex-shrink: 0;
    }
    
    .sidebar-engenharia .logo-area {
        display: none; /* Remove logo na barra inferior */
    }
    
    .menu-principal {
        flex-direction: row;
        padding: 0;
        gap: 0;
        width: 100%;
        justify-content: space-around;
        overflow: visible;
    }
    
    .item-menu {
        flex-direction: column;
        gap: 2px;
        padding: 4px;
        font-size: 0.65rem;
        text-align: center;
        border-radius: 8px;
        width: auto;
        flex: 1;
        justify-content: center;
    }
    
    .item-menu i {
        font-size: 1.1rem;
        margin: 0;
    }
    
    .item-menu span {
        display: block; /* Mostra texto pequeno */
        font-size: 0.6rem;
        line-height: 1;
    }
    
    .sidebar-engenharia .item-menu.active {
        border-left: none;
        border-top: 3px solid var(--borda-forte); /* Marcador no topo */
        background-color: rgba(255, 255, 255, 0.05);
    }

    .user-info-area {
        display: none;
    }

    .main-panel {
        width: 100%;
        height: calc(100vh - 60px); /* Restante da tela */
        flex: 1;
        order: 1;
    }
    
    .header-principal {
        padding: 0 15px;
        height: 50px;
    }

    .conteudo-principal {
        padding: 15px;
        padding-bottom: 80px; /* Espaço extra para scroll */
    }

    /* Header Fixo do Gerador */
    .header-engenharia-fixo {
        position: sticky;
        top: 0;
        height: auto;
        min-height: 52px;
        padding: 8px 15px;
        flex-wrap: wrap;
        z-index: 90;
    }
    
    .header-container {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
        width: 100%;
    }
    
    .header-engenharia-fixo .logo-area {
        justify-content: center;
        margin-bottom: 5px;
    }
    
    .vitals-monitor {
        justify-content: space-between;
        width: 100%;
        background: rgba(0,0,0,0.2);
        padding: 5px;
        border-radius: 6px;
    }
    
    .divider-v {
        display: none;
    }
    
    .vital-item {
        align-items: center;
        text-align: center;
    }

    /* Contexto Bar */
    .contexto-projeto-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        padding: 15px;
    }
    
    .ctx-divider { display: none; }
    .ctx-item { 
        width: 100%; 
        flex-direction: row; 
        justify-content: space-between;
        align-items: center;
        border-bottom: 1px solid #E2E8F0; 
        padding-bottom: 8px; 
    }
    .ctx-item:last-child { border-bottom: none; padding-bottom: 0; }

    /* Grids e Formulários */
    .grid-form {
        display: flex;
        flex-direction: column;
        gap: 15px;
    }
    
    .col-4, .col-6, .col-8, .col-12 { width: 100%; }
    
    .linha-orientacao {
        display: flex;
        flex-direction: column;
        gap: 12px;
        padding-bottom: 15px;
        height: auto;
    }
    
    .btn-remover-linha {
        position: static;
        width: 100%;
        margin-top: 5px;
        height: 40px;
        justify-content: center;
    }
    
    .btn-remover-linha::after {
        content: " Remover Orientação";
        font-size: 0.8rem;
        font-weight: 600;
        margin-left: 5px;
    }

    /* Resumo Final */
    .grid-resumo-final {
        grid-template-columns: 1fr;
        gap: 0;
    }
    
    .item-resumo {
        display: flex;
        justify-content: space-between;
        align-items: center;
        border-bottom: 1px dashed var(--borda-suave);
        padding: 10px 0;
    }
    .item-resumo:last-child { border-bottom: none; }

    /* Botões de Ação */
    .botoes-fluxo {
        flex-direction: column-reverse;
        gap: 12px;
        padding-bottom: 20px;
    }
    
    .botoes-fluxo button, .btn-nav-wizard {
        width: 100%;
        justify-content: center;
        height: 44px; /* Touch target maior */
    }
    
    /* Wizard Steps */
    .menu-etapas-container {
        flex-direction: column;
        padding: 10px;
        gap: 10px;
    }
    
    .lista-etapas-scroll {
        width: 100%;
        padding-bottom: 5px;
        justify-content: flex-start;
    }
    
    .nav-etapa-container {
        width: 100%;
        display: flex;
        justify-content: space-between;
    }

    /* Tabelas */
    .tabela-container {
        max-height: none;
    }
    
    /* Ajustes de Texto */
    h1, h2 { font-size: 1.2rem !important; }
    h3 { font-size: 1.1rem !important; }
    
    /* Cards */
    .card-modulo {
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    /* Ajuste HSP (Horas de Sol) para não quebrar */
    .hsp-display-luxe {
        height: auto;
        min-height: 36px;
        flex-wrap: wrap;
        padding: 8px;
    }
}

@media (max-width: 480px) {
    /* Ajustes Ultra-Compactos (< 480px) */
    
    /* Container principal com menos padding */
    .conteudo-principal, .area-trabalho-engenharia {
        padding: 10px;
        padding-bottom: 80px;
    }

    /* Tabelas: Expansão lateral (Bleed) e compactação */
    .tabela-container, .tabela-scroll-engenharia {
        margin-left: -10px;
        margin-right: -10px;
        width: calc(100% + 20px);
        border-left: none;
        border-right: none;
        border-radius: 0;
    }

    /* Formulários e Cards */
    .card-tecnico, .secao-config {
        padding: 12px;
    }
    
    /* Botões Full Width */
    .btn-primary, .btn-secundario, .btn-perigo, .btn-visualizar {
        width: 100%;
        justify-content: center;
        margin-bottom: 8px;
    }
    
    /* Visualização de Proposta */
    .total-geral-proposta {
        flex-direction: column;
        text-align: center;
        gap: 8px;
    }

    /* Painel Financeiro (Cascata) */
    .linha-custo {
        flex-direction: column;
        align-items: flex-start;
        gap: 2px;
        padding: 8px 0;
    }
    .linha-custo span:first-child {
        font-weight: 600;
        color: var(--texto-header);
        margin-bottom: 2px;
    }
    
    /* Ajuste de Inputs */
    .grid-inputs { grid-template-columns: 1fr; }
}
