:root {
    --bg-body: #0f172a; --bg-card: #1e293b; --primary: #38bdf8;
    --accent: #fbbf24; --text-main: #f1f5f9; --text-muted: #94a3b8;
    --border: #334155; --shadow: 0 10px 30px rgba(0,0,0,0.5);
    --check-green: #2ecc71;
}
[data-theme="light"] {
    --bg-body: #f1f5f9; --bg-card: #ffffff; --primary: #0284c7;
    --text-main: #0f172a; --text-muted: #64748b; --border: #e2e8f0;
}

body { font-family: 'Inter', sans-serif; background: var(--bg-body); color: var(--text-main); margin: 0; transition: all 0.3s ease; }

/* Layout Principal */
header { 
    display: flex; justify-content: space-between; align-items: center; 
    padding: 1rem 2rem; background: var(--bg-card); border-bottom: 1px solid var(--border);
}

/* Ajustes Gerais para Celular (Telas menores que 768px) */
@media (max-width: 768px) {
    
    /* 1. Transforma o Grid principal em uma coluna só */
    .container, .main-layout {
        display: block !important;
        padding: 10px;
    }

    /* 2. Ajusta os grids de inputs (Sessão 1 e 2) */
    .plan-section-grid, 
    .perna-inputs, 
    .perna-logistica-grid,
    .results-dashboard {
        grid-template-columns: 1fr !important; /* Tudo vira uma coluna */
        gap: 15px;
    }

    /* 3. Melhora o toque nos botões e inputs */
    input, button {
        height: 50px; /* Mais fácil de clicar com o polegar */
        font-size: 16px !important; /* Evita que o iPhone dê zoom automático no input */
    }

    /* 4. Sidebar (Checklists) vai para baixo do plano */
    .sidebar {
        width: 100% !important;
        margin-top: 30px;
    }

    /* 5. Cards de resultado (Sessão 3) */
    .res-card-mini {
        padding: 20px;
        text-align: center;
    }

    /* 6. Tabela de trechos dinâmica */
    .perna-item {
        border: 1px solid rgba(255,255,255,0.1);
        padding: 15px;
        border-radius: 12px;
        background: rgba(255,255,255,0.03);
    }
}

.container { display: flex; gap: 10px; padding: 10px; height: calc(100vh - 80px); }
.sidebar { flex: 0 0 28%; }
.main-content { flex: 1; }

.panel { 
    background: var(--bg-card); border-radius: 16px; border: 1px solid var(--border); 
    box-shadow: var(--shadow); height: 100%; display: flex; flex-direction: column; overflow: hidden;
}

/* Sistema de Abas Funcional */
.tab-nav { display: flex; background: rgba(0,0,0,0.2); padding: 5px; gap: 5px; }
.tab-btn { 
    flex: 1; padding: 12px 5px; border: none; background: transparent; color: var(--text-muted);
    cursor: pointer; font-size: 0.65rem; font-weight: 700; text-transform: uppercase; border-radius: 8px;
}
.tab-btn.active { background: var(--bg-card); color: var(--primary); }

.tab-pane { display: none; padding: 20px; height: 100%; overflow-y: auto; }
.tab-pane.active { display: block; animation: fadeIn 0.3s ease; }

/* Estilo do Checklist (Fiel à imagem original) */
.check-header { background: var(--check-green); color: #000; padding: 15px; text-align: center; font-weight: 800; border-radius: 8px 8px 0 0; }
.check-sub { background: #000; color: #fff; height: 30px; text-align: center; align-items: center; justify-content: center; padding: 8px; font-size: 0.75rem; font-weight: 700; }
/* Checklist Items */
/* Estado Normal (Não marcado) */
.chk-item {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    margin-bottom: 6px;
    font-size: 11px;
    background: rgba(255,255,255,0.03);
    border-radius: 8px;
    border-left: 4px solid var(--border); /* Borda padrão cinza ou a cor que você definiu inline */
    gap: 15px;
    transition: all 0.3s ease; /* Transição suave para o luxo */
    color: var(--text-main);
}

/* --- A MÁGICA ACONTECE AQUI --- */
/* Quando o checkbox interno estiver CHECADO (:checked), o PAI (.chk-item) muda */
.chk-item:has(input:checked) {
    border-left-color: #2ecc71 !important; /* Verde Esmeralda Luxo */
    background: rgba(46, 204, 113, 0.1);    /* Fundo levemente esverdeado */
}

/* Muda a cor de todos os textos dentro do item marcado */
.chk-item:has(input:checked) span,
.chk-item:has(input:checked) .chk-sub-item {
    color: #2ecc71 !important;
    text-shadow: 0 0 8px rgba(46, 204, 113, 0.3); /* Efeito neon sutil */
}


/* ITEM: Alinhado à esquerda e ocupa o espaço restante */
.chk-item > span:first-child {
    flex-grow: 1;
    text-align: left;
    font-weight: 600;
    text-transform: uppercase;
}

/* AÇÃO: Alinhada à direita, cor diferenciada para destaque técnico */
.chk-sub-item {
    color: var(--text-muted);
    font-weight: 700;
    text-align: right;
    min-width: 80px; /* Garante que as ações fiquem alinhadas verticalmente */
}

/* CHECK: O checkbox na ponta direita */
.chk-item input[type="checkbox"] {
    cursor: pointer;
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
    margin: 0;
}

.chk-imagem {
    justify-content: center; /* Centraliza horizontalmente */
    align-items: center;     /* Centraliza verticalmente */
    text-align: center;     /* Centralizar */
}
/* Grid de Info Direita */
.info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; padding: 5px;}
.data-card { background: var(--bg-body); padding: 15px; border-radius: 12px; border: 1px solid var(--border); text-align: center; }
.data-card label { display: block; font-size: 0.6rem; color: var(--text-muted); margin-bottom: 5px; }
.data-card span { font-size: 1.2rem; font-weight: 800; color: var(--primary); }

/* Formulário e Select */
select { 
    padding: 8px 15px; border-radius: 8px; background: var(--bg-body); color: var(--text-main); 
    border: 1px solid var(--border); outline: none;
}

/* Estilo da Galeria */
.gallery-header { margin-bottom: 25px; }

.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
}

.photo-item {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    aspect-ratio: 16 / 10;
    cursor: pointer;
    border: 1px solid var(--border);
    transition: var(--transition);
}

.photo-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.photo-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.8));
    padding: 15px;
    opacity: 0;
    transition: opacity 0.3s ease;
    display: flex;
    align-items: flex-end;
}

.photo-overlay span {
    color: white;
    font-size: 0.8rem;
    font-weight: 600;
}

.photo-item:hover img {
    transform: scale(1.1);
}

.photo-item:hover .photo-overlay {
    opacity: 1;
}

/* Lightbox Estilo Cinema */
.lightbox {
    display: none;
    position: fixed;
    z-index: 1000;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(8px);
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

.lightbox img {
    max-width: 90%;
    max-height: 80%;
    border-radius: 8px;
    box-shadow: 0 0 30px rgba(0,0,0,0.5);
    animation: zoomIn 0.3s ease;
}

@keyframes zoomIn {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.close-lightbox {
    position: absolute;
    top: 30px;
    right: 40px;
    color: white;
    font-size: 40px;
    cursor: pointer;
}

#lightbox-caption {
    color: white;
    margin-top: 20px;
    font-weight: 300;
    letter-spacing: 1px;
}

.rounded-start{border-bottom-left-radius:.25rem!important;border-top-left-radius:.25rem!important}

.img-fluid{max-width:100%;height:auto}

a{color: var(--primary);text-decoration:underline}
a:hover{color: var(--primary)}

/* Container de Texto Luxuoso */
.luxury-text-block {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-left: 4px solid var(--primary); /* Destaque lateral luxuoso */
    border-radius: 12px;
    padding: 30px;
    margin: 20px 0;
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
}

/* Efeito de fundo sutil (Marca d'água ou gradiente) */
.luxury-text-block::before {
    content: '';
    position: absolute;
    top: -50px;
    right: -50px;
    width: 150px;
    height: 150px;
    background: var(--primary);
    filter: blur(80px);
    opacity: 0.05;
}

/* Cabeçalho do Texto */
.text-header-luxury {
    margin-bottom: 20px;
}

.text-title-luxury {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--primary);
    margin: 0;
    letter-spacing: -0.5px;
}

/* Corpo do Texto Justificado */
.text-body-luxury {
    font-size: 0.95rem;
    line-height: 1.8;
    color: var(--text-muted);
    text-align: justify; /* Justificativa solicitada */
    hyphens: auto; /* Melhora a justificativa em telas menores */
}

/* Ajuste para o Tema Light */
[data-theme="light"] .luxury-text-block {
    background: #ffffff;
    border-left-color: var(--primary);
}

select{
    width: 450px;
    height: 50px;
    font-size: 20px;
    background: var(--primary);
    color: #1a012b;
}

/* CSS EXTRAS */
/* Cabeçalho Interno */
.section-header-extra {
    margin-bottom: 25px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 15px;
}

.text-title-extra { font-size: 1.3rem; font-weight: 800; color: var(--text-main); margin: 0; }
.text-subtitle-extra { font-size: 0.85rem; color: var(--text-muted); }

/* Grid de 2 Colunas */
.extra-grid-layout {
    display: grid;
    grid-template-columns: 1fr 1fr; /* Duas colunas conforme solicitado */
    gap: 15px;
}

/* Botão Luxuoso Estilo Card */
.btn-extra-luxury {
    display: flex;
    align-items: center;
    text-decoration: none;
    padding: 18px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow);
}

/* Hover refinado */
.btn-extra-luxury:hover {
    transform: translateX(5px);
    border-color: var(--primary);
    background: var(--bg-card);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

/* Ícone Lateral */
.icon-wrap {
    font-size: 1.4rem;
    margin-right: 18px;
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-body);
    border-radius: 10px;
    border: 1px solid var(--border);
}

/* Textos internos */
.info-wrap { display: flex; flex-direction: column; }

.info-wrap .title {
    color: var(--text-main);
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 2px;
}

.info-wrap .desc {
    color: var(--text-muted);
    font-size: 0.75rem;
    line-height: 1.3;
}

/* Destaque IMC */
.imc-highlight {
    border-left: 4px solid var(--accent) !important;
}

/* Estilo dos ícones SVG dentro do wrap */
.icon-wrap svg {
    width: 22px;
    height: 22px;
    color: var(--primary); /* Cor azul do projeto */
    transition: 0.3s;
}

.btn-extra-luxury:hover .icon-wrap svg {
    transform: scale(1.1);
    color: var(--text-main); /* Muda de cor no hover para destaque */
}

/* Garante que o wrap do ícone acompanhe o tema */
.icon-wrap {
    background: rgba(var(--primary-rgb), 0.1); /* Um leve fundo azulado */
    border: 1px solid var(--border);
}

/* Responsividade para Mobile */
@media (max-width: 768px) {
    .extra-grid-layout { grid-template-columns: 1fr; }
}

/* CSS PESO E BALANCEAMENTO */
/* Layout Principal WB */
.wb-container {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 25px;
    margin-top: 20px;
}

/* Painéis */
.wb-form-panel {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.graph-box {
    background: rgba(0,0,0,0.2);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 15px;
    height: 350px;
    margin-bottom: 20px;
}

/* Inputs Premium */
.input-group-wb label {
    font-size: 10px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 5px;
    display: block;
}

.input-with-unit {
    background: rgba(255,255,255,0.02);
    border: 1px solid var(--border);
    border-radius: 10px;
    display: flex;
    align-items: center;
    padding: 0 15px;
}

.input-with-unit input {
    background: transparent; border: none; color: #fff;
    padding: 12px 0; width: 100%; font-weight: 700; outline: none;
}

.input-with-unit span { font-size: 10px; font-weight: 800; color: var(--primary); }

.luxury-btn {
    background: var(--primary); color: #000; border: none; padding: 15px; 
    border-radius: 8px; width: 100%; font-weight: 700; cursor: pointer; transition: 0.3s;
}
.luxury-btn:hover { opacity: 0.8; transform: translateY(-2px); }

/* Dashboard de Resultados embaixo do gráfico */
.results-dashboard {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.res-card-mini {
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 15px;
    border-radius: 12px;
    text-align: center;
}

.res-card-mini label {
    font-size: 9px;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 1px;
}

.res-value { font-size: 1.6rem; font-weight: 800; color: var(--text-main); margin: 5px 0; }
.res-value span { font-size: 0.8rem; color: var(--primary); }

/* Barra de Progresso do MTOW */
.progress-container-wb {
    height: 6px;
    background: var(--bg-body);
    border-radius: 3px;
    overflow: hidden;
    margin-top: 10px;
}

.progress-bar-wb {
    height: 100%;
    width: 0%;
    background: var(--primary);
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* CSS CONVERSÕES */
.conv-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(33%, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.conv-card {
    background: rgba(255,255,255,0.02);
    border: 1px solid var(--border);
    padding: 20px;
    border-radius: 15px;
    transition: var(--transition);
}

.conv-card:hover {
    border-color: var(--primary);
    background: rgba(56, 189, 248, 0.05);
}

.conv-card label {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 1px;
    display: block;
    margin-bottom: 15px;
}

.conv-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.conv-sep {
    color: var(--text-muted);
    font-weight: bold;
    font-size: 1.2rem;
}

.conv-card .input-with-unit {
    flex: 1;
    background: var(--bg-body);
}

.conv-card input {
    font-size: 0.9rem;
}

/* CSS CALCULOS */
.calc-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 15px;
}

.calc-inputs input {
    background: var(--bg-body);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px;
    color: var(--text-main);
    font-size: 0.8rem;
    outline: none;
}

.res-highlight {
    background: linear-gradient(90deg, var(--primary), transparent);
    padding: 12px;
    border-radius: 8px;
    font-weight: 800;
    font-size: 1rem;
    color: #fff;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.res-highlight span {
    color: var(--accent);
}

/* PÓS-VOO */
/* Layout Global Pós-Voo */
.flight-times-input {
    display: flex; gap: 15px; margin-bottom: 25px; align-items: center;
    background: var(--bg-card); padding: 15px; border-radius: 12px; border: 1px solid var(--border);
}

.pos-voo-grid { display: grid; grid-template-columns: 1fr 320px; gap: 20px; }

/* Display de Tempos */
.times-display-card {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px;
    background: var(--border); border: 1px solid var(--border); border-radius: 12px;
    overflow: hidden; margin-bottom: 20px;
    animation: fadeIn 0.4s ease forwards;
}

.time-block, .time-total-block { background: var(--bg-card); padding: 15px; text-align: center; }
.time-total-block { grid-column: span 4; border-top: 1px solid var(--border); }

.time-block label, .time-total-block label { font-size: 9px; color: var(--text-muted); text-transform: uppercase; display: block; }
.time-block div, .time-total-block div { font-size: 1.2rem; font-weight: 800; color: var(--primary); }

/* Tabela Decimal */
.decimal-table { width: 100%; border-collapse: collapse; background: var(--bg-card); border-radius: 12px; overflow: hidden; font-size: 11px; }
.decimal-table th { background: var(--primary); color: #000; padding: 8px; }
.decimal-table td { padding: 6px 4px; text-align: center; border: 1px solid var(--border); color: var(--text-main); min-width: 30px; /* Garante alinhamento dos números */ }
.decimal-table td:last-child { font-weight: 800; color: var(--primary); background: rgba(56, 189, 248, 0.05); }

/* Calculadora */
.mini-calc { background: #1a1a1a; padding: 15px; border-radius: 15px; border: 1px solid #333; }
.calc-display { background: #2a2a2a; padding: 15px; text-align: right; font-size: 1.5rem; color: #fff; border-radius: 8px; margin-bottom: 15px; font-family: monospace; height: 35px; }
.calc-buttons { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.calc-buttons button { padding: 12px; border: none; border-radius: 6px; background: #333; color: #fff; font-weight: bold; cursor: pointer; }
.btn-op { background: #444 !important; color: var(--primary) !important; }
.btn-equal { background: var(--primary) !important; color: #000 !important; }

/* Resultado tempo de voo */
.results-voo-container { grid-column: span 4; display: grid; grid-template-columns: 1fr 1fr; /* Duas colunas */ gap: 1px; background: var(--border); border-top: 1px solid var(--border); }
.time-block-special { background: var(--bg-card); padding: 20px; text-align: center; }
.highlight-db div { color: var(--accent) !important; font-size: 1.5rem !important; }

.time-block-special label { font-size: 10px; letter-spacing: 1px; color: var(--text-muted); margin-bottom: 8px; display: block; }

/* CSS VOO IMC */
/* Container Principal */
.imc-container {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 25px;
    margin-top: 20px;
}

/* Card de Checkbox Moderno */
.imc-card-check {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 18px;
    margin-bottom: 12px;
    transition: all 0.3s ease;
}

.imc-card-check:hover {
    border-color: var(--primary);
    background: rgba(255,255,255,0.02);
}

.chk-container-modern {
    display: flex;
    align-items: center;
    cursor: pointer;
    gap: 15px;
}

.chk-label-group { display: flex; flex-direction: column; }
.chk-label-group .main-label { font-size: 0.95rem; font-weight: 700; color: var(--text-main); }
.chk-label-group .sub-label { font-size: 0.75rem; color: var(--text-muted); }

/* Painel de Resultado */
.status-main-card {
    background: var(--bg-body);
    border: 2px solid var(--border);
    border-radius: 20px;
    padding: 40px 20px;
    text-align: center;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    margin-bottom: 20px;
}

.status-indicator-tag { font-size: 10px; font-weight: 800; letter-spacing: 2px; color: var(--text-muted); }
#imc-risk-text { font-size: 1.8rem; font-weight: 900; margin: 15px 0 10px 0; }
#imc-risk-desc { font-size: 0.85rem; color: var(--text-main); opacity: 0.8; line-height: 1.4; }

/* Legenda Inferior */
.reference-mini-table {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 15px;
}

.table-title { font-size: 10px; font-weight: 800; color: var(--text-muted); display: block; margin-bottom: 10px; }
.legend-row { font-size: 11px; display: flex; align-items: center; gap: 8px; margin-bottom: 5px; color: var(--text-muted); }
.dot { width: 10px; height: 10px; border-radius: 50%; }




/* CSS PLANEJAMENTO DE VOO */
.plan-section-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
}

.plan-step-title {
    font-size: 0.75rem;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 15px;
}

.plan-row-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 15px;
    margin-top: 15px;
}

.btn-add-perna {
    background: rgba(56, 189, 248, 0.1);
    color: var(--primary);
    border: 1px dashed var(--primary);
    padding: 5px 15px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 800;
    cursor: pointer;
    transition: 0.3s;
}

.perna-item {
    background: var(--bg-body);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 10px;
    animation: fadeIn 0.3s ease;
}

.perna-header {
    font-size: 10px;
    font-weight: 800;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.perna-inputs {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.plan-input-mini {
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 8px;
    border-radius: 6px;
    color: #fff;
    font-size: 11px;
}

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

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