/* ================================== */
/* REGRA GLOBAL DE BOX-SIZING         */
/* ================================== */
html { box-sizing: border-box; }
*, *:before, *:after { box-sizing: inherit; }

/* ================================== */
/* LOADER (TELA DE CARREGAMENTO)      */
/* ================================== */
#loader { position: fixed; top: 0; left: 0; width: 100%; height: 100%; display: flex; flex-direction: column; justify-content: center; align-items: center; background-color: #f4f4f9; z-index: 9999; }
.spinner { border: 4px solid rgba(0, 0, 0, 0.1); width: 36px; height: 36px; border-radius: 50%; border-left-color: #007BFF; animation: spin 1s ease infinite; }
#loader p { margin-top: 15px; font-size: 16px; color: #555; }
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

/* ================================== */
/* ESTRUTURA PRINCIPAL E CENTRALIZAÇÃO */
/* ================================== */
#app-content { 
    display: none; 
    width: 100%; 
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

/* ================================== */
/* HEADER E INFORMAÇÕES DO USUÁRIO     */
/* ================================== */
.main-header { 
    background: #fff; 
    padding: 10px 20px; 
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center; 
    box-shadow: 0 2px 4px rgba(0,0,0,0.1); 
    position: fixed; 
    top: 0; left: 0; width: 100%; 
    z-index: 1001; 
}

.header-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    grid-column: 1 / 2;
    justify-self: flex-start;
}
.header-actions .button-secondary {
    padding: 8px 15px;
    font-size: 14px;
    font-weight: 600;
}

.header-user-info {
    display: flex;
    align-items: center;
    gap: 15px;
    grid-column: 3 / 4;
    justify-self: flex-end;
}
.user-info { color: #555; font-size: 14px; font-weight: bold;}
#logout-btn { background: #dc3545; color: white; border: none; padding: 8px 15px; border-radius: 5px; cursor: pointer; font-size: 14px; transition: background-color 0.3s ease; }
#logout-btn:hover { background-color: #c82333; }
.button-profile {
    background-color: #6c757d;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s ease;
}
.button-profile:hover { background-color: #5a6268; }

.header-total-profit {
    display: flex;
    align-items: center;
    gap: 8px;
    background-color: #f8f9fa;
    padding: 5px 12px;
    border-radius: 5px;
    border: 1px solid #e9ecef;
}
.header-total-profit span { font-size: 12px; font-weight: 600; color: #666; }
.header-total-profit strong { font-size: 14px; }
.header-total-profit strong.positivo { color: #28a745; }
.header-total-profit strong.negativo { color: #dc3545; }

.header-toggles {
    display: flex;
    gap: 20px;
    grid-column: 2 / 3;
    justify-self: center;
    flex-wrap: wrap; 
}
.toggle-container { display: flex; align-items: center; gap: 10px; }
.toggle-label { font-size: 14px; font-weight: 600; color: #555; }
.switch { position: relative; display: inline-block; width: 50px; height: 26px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #ccc; transition: .4s; }
.slider.round { border-radius: 26px; }
.slider:before { position: absolute; content: ""; height: 20px; width: 20px; left: 3px; bottom: 3px; background-color: white; transition: .4s; border-radius: 50%; }
input:checked + .slider { background-color: #28a745; }
input:focus + .slider { box-shadow: 0 0 1px #28a745; }
input:checked + .slider:before { transform: translateX(24px); }

/* ================================== */
/* ESTILOS GERAIS                     */
/* ================================== */
body { 
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; 
    background-color: #f4f4f9; 
    color: #333; 
    padding-top: 80px;
    margin: 0; 
}
.container { width: 100%; max-width: 1200px; background: #ffffff; padding: 25px; border-radius: 8px; box-shadow: 0 4px 12px rgba(0,0,0,0.1); }
h1, h2, h3 { text-align: center; color: #444; margin-bottom: 20px; }
h1, .modal-content h2, .modal-content h3 { margin-top: 0; }
.button-primary { background-color: #007BFF; color: white; padding: 12px 25px; border: none; border-radius: 6px; font-size: 16px; font-weight: bold; cursor: pointer; transition: background-color 0.3s ease; }
.button-primary:hover { background-color: #0056b3; }
.button-secondary { background-color: #6c757d; color: white; border: none; padding: 12px 25px; font-size: 16px; font-weight: bold; cursor: pointer; transition: background-color 0.3s ease; border-radius: 6px; }
.button-secondary:hover { background-color: #5a6268; }
.button-danger { background-color: #dc3545; color: white; border: none; transition: background-color 0.3s ease; }
.button-danger:hover { background-color: #c82333; }
.button-danger:disabled { background-color: #e2828b; cursor: not-allowed; }
.hidden { display: none !important; }

/* ================================== */
/* LAYOUT DE DUAS COLUNAS             */
/* ================================== */
.main-content-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 30px; }
.coluna-lateral { display: flex; flex-direction: column; gap: 20px; }
.secao-header { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #eee; padding-bottom: 10px; }
.secao-header h2 { margin: 0; }
.win-rate { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.win-rate span { color: #666; }
.win-rate strong { font-size: 16px; }
.win-rate .positivo { color: #28a745; }
.win-rate .negativo { color: #dc3545; }

/* ================================== */
/* FORMULÁRIO (DENTRO DO MODAL)       */
/* ================================== */
.trade-entry { 
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); 
    gap: 15px; 
    /* CORREÇÃO: Alinha os inputs pela base (bottom), resolvendo o desnivelamento dos labels */
    align-items: flex-end; 
}
.ativo-container { display: flex; gap: 10px; align-items: center; margin-bottom: 20px; }
.ativo-container select, .ativo-container input[type="text"] { flex-grow: 1; }
.button-icon { background-color: #6c757d; color: white; border: none; border-radius: 6px; font-size: 24px; font-weight: bold; cursor: pointer; transition: background-color 0.3s ease; width: 48px; height: 48px; flex-shrink: 0; padding: 0; line-height: 48px; }
.button-icon:hover { background-color: #5a6268; }
input, select, textarea { padding: 12px; border-radius: 6px; border: 1px solid #ddd; font-size: 15px; width: 100%; box-sizing: border-box;}
input:focus, select:focus, textarea:focus { outline: none; border-color: #007BFF; box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25); }
#add-ativo-form button[type="submit"] { background-color: #28a745; color: white; cursor: pointer; font-weight: bold; border: none; transition: background-color 0.3s ease; padding: 12px; border-radius: 6px; font-size: 15px; margin-top: 15px; }
#add-ativo-form button[type="submit"]:hover { background-color: #218838; }
.button-submit-full { background-color: #28a745; color: white; cursor: pointer; font-weight: bold; border: none; transition: background-color 0.3s ease; padding: 14px; border-radius: 6px; font-size: 16px; width: 100%; }
.button-submit-full:hover { background-color: #218838; }
.form-grid-container { display: flex; flex-direction: column; gap: 15px; margin-bottom: 20px; }
.form-grid { display: grid; gap: 15px; }
.form-grid-4-col { grid-template-columns: repeat(4, 1fr); }
.form-grid-2-col { grid-template-columns: repeat(2, 1fr); }
#reentradas-container { display: flex; flex-direction: column; gap: 10px; }
.reentrada-item { display: flex; align-items: center; gap: 10px; }
.reentrada-item input { flex-grow: 1; }
.remove-reentrada-btn { background-color: #dc3545; color: white; border: none; border-radius: 50%; width: 30px; height: 30px; font-size: 18px; font-weight: bold; cursor: pointer; flex-shrink: 0; line-height: 30px; padding: 0; transition: background-color 0.2s; }
.remove-reentrada-btn:hover { background-color: #c82333; }
.button-add-reentrada { background-color: #17a2b8; color: white; border: none; padding: 10px; font-size: 14px; font-weight: bold; border-radius: 5px; cursor: pointer; transition: background-color 0.2s; text-align: center; width: 100%; margin-top: 5px; }
.button-add-reentrada:hover { background-color: #138496; }

/* ================================== */
/* ALTERNADOR DE TIPO (ESTILIZADO)    */
/* ================================== */
.trade-type-switcher {
    display: flex;
    justify-content: center;
    gap: 15px; /* Mais espaço entre eles */
    margin-bottom: 20px;
    background-color: transparent; /* Removemos o fundo cinza do container */
    padding: 0;
}

.type-option {
    flex: 1;
    text-align: center;
    padding: 12px;
    cursor: pointer;
    border-radius: 8px;
    font-weight: 700; /* Texto mais grosso */
    font-size: 15px;
    color: #64748b;
    background-color: #f1f5f9; /* Fundo cinza padrão */
    border: 2px solid transparent; /* Borda invisível para evitar pulo no layout */
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.type-option input {
    display: none;
}

.type-option:hover:not(.active) {
    background-color: #e2e8f0;
    transform: translateY(-2px);
}

/* --- Cores Específicas quando ATIVO --- */

/* Opção Binária (Azul) */
.type-option.option-binary.active {
    background-color: #007BFF;
    color: white;
    border-color: #0056b3;
    box-shadow: 0 4px 10px rgba(0, 123, 255, 0.3);
}

/* Opção Forex (Roxo) */
.type-option.option-forex.active {
    background-color: #8b5cf6; /* Roxo vibrante */
    color: white;
    border-color: #7c3aed;
    box-shadow: 0 4px 10px rgba(139, 92, 246, 0.3);
}

/* ================================================= */
/* LISTA DE OPERAÇÕES (ESTILO ACORDEÃO)              */
/* ================================================= */
#trades-list { margin-top: 20px; min-height: 50px; }
.trade-item { background-color: #fff; border: 1px solid #eee; margin-bottom: 10px; border-radius: 6px; box-shadow: 0 1px 3px rgba(0,0,0,0.05); }
.trade-summary { display: flex; justify-content: space-between; align-items: center; padding: 15px; cursor: pointer; background-color: #fafafa; }
.trade-summary .info { flex-grow: 1; color: #555; font-size: 16px; overflow-wrap: break-word; word-wrap: break-word; word-break: break-all; min-width: 0; }
.trade-summary .resultado { font-weight: bold; min-width: 100px; text-align: right; display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.trade-counter { font-weight: bold; color: #888; min-width: 30px; margin-right: 15px; font-size: 16px; }
.resultado.gain { color: #28a745; }
.resultado.loss { color: #dc3545; }
.expand-icon { font-size: 20px; font-weight: bold; color: #aaa; transition: transform 0.3s ease; }
.trade-item.ativo .expand-icon { transform: rotate(45deg); }
.trade-details { max-height: 0; opacity: 0; overflow: hidden; padding: 0 15px; transition: all 0.4s ease-in-out; }
.trade-item.ativo .trade-details { max-height: 300px; opacity: 1; padding: 15px; border-top: 1px solid #eee; }
.trade-details ul { list-style: none; padding: 0; margin: 0; }
.trade-details li { display: flex; justify-content: space-between; padding: 5px 0; color: #666; }
.trade-actions { margin-top: 15px; padding-top: 10px; border-top: 1px dashed #ddd; text-align: right; }
.delete-trade-btn { padding: 6px 12px; font-size: 12px; font-weight: bold; border-radius: 5px; width: auto; cursor: pointer; }

/* ================================== */
/* DISPLAY DE METAS E BARRA DE PROGRESSO       */
/* ================================== */
#metas-display { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 15px; background-color: #f8f9fa; border-radius: 8px; margin: 25px auto; max-width: 400px; }
.meta-label { text-align: center; font-size: 12px; color: #666; }
.meta-label strong { display: block; font-size: 16px; }
.meta-label.stop-loss strong { color: #dc3545; }
.meta-label.stop-win strong { color: #28a745; }
.progress-bar-container { flex-grow: 1; height: 25px; background-color: #e9ecef; border-radius: 5px; position: relative; overflow: hidden; }
#progress-bar-fill { height: 100%; width: 50%; background-color: #6c757d; transition: width 0.5s ease, background-color 0.5s ease; }
#progress-bar-text { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); color: white; font-weight: bold; font-size: 14px; text-shadow: 1px 1px 2px rgba(0,0,0,0.5); }

/* ================================== */
/* BOTÃO DE RESUMO                    */
/* ================================== */
.resumo-section { margin-top: 30px; text-align: center; }
#botao-resumo { padding: 15px 30px; font-size: 18px; font-weight: bold; border-radius: 8px; transition: background-color 0.3s ease, transform 0.2s ease; cursor: pointer; background-color: #6c757d; color: white; border: none; }
#botao-resumo:hover { transform: translateY(-2px); }
#botao-resumo.botao-resumo-positivo { background-color: #28a745; }
#botao-resumo.botao-resumo-positivo:hover { background-color: #218838; }
#botao-resumo.botao-resumo-negativo { background-color: #dc3545; }
#botao-resumo.botao-resumo-negativo:hover { background-color: #c82333; }
#botao-resumo.botao-resumo-neutro { background-color: #6c757d; }
#botao-resumo.botao-resumo-neutro:hover { background-color: #5a6268; }

/* ================================================= */
/* MODAIS E ELEMENTOS DE INTERFACE                   */
/* ================================================= */
.modal-container { position: fixed; left: 0; top: 0; width: 100%; height: 100%; background-color: rgba(0, 0, 0, 0.5); display: none; align-items: center; justify-content: center; z-index: 1000; opacity: 0; transition: opacity 0.3s ease; }
.modal-container.ativo { display: flex; opacity: 1; }
.modal-content { 
    background-color: #fff; padding: 30px; border-radius: 8px; box-shadow: 0 5px 15px rgba(0,0,0,0.3); width: 90%; max-width: 800px; position: relative; 
    transform: translateY(-50px); transition: transform 0.3s ease;
    max-height: 90vh; 
    overflow-y: auto; 
}
.modal-container.ativo .modal-content { transform: translateY(0); }
.close-button { position: absolute; top: 15px; right: 20px; font-size: 28px; font-weight: bold; color: #aaa; cursor: pointer; }
.close-button:hover { color: #333; }
#manage-ativo-modal .modal-content, #calculator-modal .modal-content, #metas-modal .modal-content, #delete-confirm-modal .modal-content, #profile-modal .modal-content { max-width: 500px; }
#add-trade-modal .modal-content, #ranking-modal .modal-content { max-width: 650px; }
#manage-ativo-modal, #calculator-modal, #metas-modal, #delete-confirm-modal, #profile-modal, #ai-calculator-modal { z-index: 1002; }
.modal-content.modal-lg { max-width: 90vw; width: 1200px; }
.input-group { margin-bottom: 20px; }
.input-group label { display: block; margin-bottom: 5px; font-weight: bold; color: #555; }
#final-delete-btn { width: 100%; padding: 12px; font-size: 16px; font-weight: bold; border-radius: 6px; cursor: pointer; }

/* MODAL DE PERFIL E UPLOAD DE FOTO */
.profile-picture-container { display: flex; flex-direction: column; align-items: center; gap: 15px; margin-bottom: 30px; }
#profile-image-preview { width: 120px; height: 120px; border-radius: 50%; border: 4px solid #eee; object-fit: cover; cursor: pointer; }
#profile-image-upload { display: none; }
.upload-btn-label { padding: 10px 20px; font-size: 14px; }

/* MODAL DO RANKING E PÓDIO */
.ranking-filters { display: flex; gap: 15px; margin-bottom: 20px; }
#podium-container { display: flex; justify-content: center; align-items: flex-end; gap: 10px; margin-bottom: 30px; min-height: 200px; border-bottom: 2px solid #f0f0f0; padding-bottom: 20px; }
.podium-place { width: 30%; display: flex; flex-direction: column; align-items: center; text-align: center; background-color: #f8f9fa; border: 1px solid #e9ecef; border-bottom: none; padding: 15px 10px; border-radius: 8px 8px 0 0; }
.podium-place.second { height: 160px; }
.podium-place.first { height: 200px; background-color: #fff1cc; border-color: #ffe4a1; }
.podium-place.third { height: 160px; }
.podium-place img { width: 60px; height: 60px; border-radius: 50%; object-fit: cover; border: 3px solid #fff; box-shadow: 0 2px 4px rgba(0,0,0,0.1); margin-bottom: 10px; }
.podium-place.first img { width: 80px; height: 80px; }
.podium-place .podium-name { font-weight: bold; font-size: 14px; color: #333; word-break: break-word; }
.podium-place .podium-profit { font-size: 16px; font-weight: bold; }
.podium-place .podium-rank { font-size: 24px; font-weight: bold; color: #fff; background-color: #6c757d; width: 35px; height: 35px; line-height: 35px; border-radius: 50%; margin-top: auto; }
.podium-place.first .podium-rank { background-color: #ffc107; color: #333; }
.podium-place.second .podium-rank { background-color: #c0c0c0; }
.podium-place.third .podium-rank { background-color: #cd7f32; }
#ranking-table-container { max-height: 40vh; overflow-y: auto; }
.ranking-table { width: 100%; border-collapse: collapse; margin-top: 20px; }
.ranking-table th, .ranking-table td { padding: 12px 15px; text-align: left; border-bottom: 1px solid #ddd; }
.ranking-table th { background-color: #f8f9fa; font-weight: bold; color: #555; }
.ranking-table tr:nth-of-type(even) { background-color: #fcfcfd; }
.ranking-table .rank-position { font-weight: bold; font-size: 1.1em; text-align: center; width: 50px; }
.ranking-table .rank-profit.positivo { color: #28a745; }
.ranking-table .rank-profit.negativo { color: #dc3545; }
.ranking-table .rank-winrate.positivo { color: #28a745; }
.ranking-table .rank-winrate.negativo { color: #dc3545; }

/* MODAL DE ALERTA CUSTOMIZADO */
.custom-alert {
    position: fixed;
    top: -100px;
    left: 50%;
    transform: translateX(-50%);
    min-width: 300px;
    max-width: 90%;
    background-color: #fff;
    color: #333;
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 9999;
    transition: top 0.5s ease-in-out;
    border-left: 5px solid #007BFF;
}
.custom-alert.ativo {
    top: 20px;
}
.custom-alert #alert-icon svg { width: 24px; height: 24px; }
.custom-alert.alert-success { border-left-color: #28a745; }
.custom-alert.alert-success #alert-icon { color: #28a745; }
.custom-alert.alert-error { border-left-color: #dc3545; }
.custom-alert.alert-error #alert-icon { color: #dc3545; }
.custom-alert.alert-warning { border-left-color: #ffc107; }
.custom-alert.alert-warning #alert-icon { color: #ffc107; }
.custom-alert p { margin: 0; font-weight: 500; }
.alert-progress-bar { position: absolute; bottom: 0; left: 0; width: 100%; height: 4px; background-color: #e9ecef; }
#alert-progress-bar-inner { height: 100%; width: 100%; background-color: #007BFF; }
.custom-alert.alert-success #alert-progress-bar-inner { background-color: #28a745; }
.custom-alert.alert-error #alert-progress-bar-inner { background-color: #dc3545; }
.custom-alert.alert-warning #alert-progress-bar-inner { background-color: #ffc107; }

/* SUGESTÃO DE METAS NO MODAL */
.sugestao-meta-box { padding: 15px; background-color: #f8f9fa; border: 1px solid #eee; border-radius: 6px; margin-bottom: 25px; }
.sugestao-meta-box h3 { margin-top: 0; margin-bottom: 15px; font-size: 16px; }
#sugerir-meta-btn { width: auto; padding: 10px 20px; font-size: 14px; font-weight: bold; color: white; background-color: #6c757d; border: none; border-radius: 5px; cursor: pointer; transition: background-color 0.2s; display: block; margin: 15px auto 0;}
#sugerir-meta-btn:hover { background-color: #5a6268; }

/* ESTILOS PARA O GERENCIADOR DE ATIVOS */
#manage-ativo-modal h3 { text-align: left; margin-bottom: 10px; }
.lista-ativos { max-height: 200px; overflow-y: auto; border: 1px solid #ddd; border-radius: 6px; padding: 10px; }
.ativo-item { display: flex; justify-content: space-between; align-items: center; padding: 8px; border-bottom: 1px solid #eee; }
.ativo-item:last-child { border-bottom: none; }
.ativo-info { flex-grow: 1; }
.ativo-actions button { font-size: 12px; padding: 4px 8px; margin-left: 5px; }

/* ESTILOS PARA A CALCULADORA DE RISCO E SLIDERS */
.risk-slider-container { display: flex; align-items: center; gap: 15px; }
.risk-slider-container input[type="range"] { flex-grow: 1; }
.risk-slider-container span { font-weight: bold; color: #007BFF; min-width: 40px; }
.calculator-result { margin-top: 25px; padding-top: 20px; border-top: 1px solid #eee; text-align: center; display: flex; justify-content: center; align-items: center; gap: 10px; }
.calculator-result span { font-size: 16px; color: #666; }
.calculator-result strong { display: inline-block; font-size: 28px; color: #28a745; margin-top: 0; }

/* ================================================= */
/* ESTILOS DO DASHBOARD, GRÁFICO E STATS             */
/* ================================================= */
#dashboard-container, #grafico-container, #reentrada-stats-container { 
    padding: 20px; 
    background-color: #f8f9fa; 
    border-radius: 8px; 
    transition: all 0.4s ease; 
    display: block; 
    position: relative; 
}
#dashboard-container h3, #grafico-container h3 { margin-top: 0; }
.dashboard-filtro { display: flex; gap: 10px; margin-bottom: 20px; }
.filtro-btn { flex-grow: 1; padding: 8px; font-size: 12px; font-weight: bold; color: #555; background-color: #e9ecef; border: 1px solid #ddd; border-radius: 5px; cursor: pointer; transition: all 0.2s; }
.filtro-btn.ativo { background-color: #007BFF; color: white; border-color: #007BFF; }
.dashboard-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 15px; }
.metric-card { background-color: #fff; padding: 15px; border-radius: 6px; border: 1px solid #eee; }
.metric-card .label { font-size: 12px; color: #666; margin-bottom: 5px; }
.metric-card .value { font-size: 20px; font-weight: bold; color: #333; }
.metric-card .value.positivo { color: #28a745; }
.metric-card .value.negativo { color: #dc3545; }
.chart-wrapper { position: relative; height: 250px; width: 100%; margin-top: 20px; }
#view-modal-content .chart-wrapper { height: 65vh; width: 100%; }
.expand-btn { position: absolute; top: 15px; right: 15px; background: none; border: none; cursor: pointer; padding: 5px; opacity: 0.5; transition: opacity 0.2s; z-index: 10; }
.expand-btn:hover { opacity: 1; }
.expand-btn svg { width: 20px; height: 20px; fill: #555; }

/* Estilos para o Card de Estatísticas de Entradas */
.stats-card { background-color: #fff; padding: 15px 20px; border-radius: 6px; border: 1px solid #eee; }
.stats-card h4 { margin-top: 0; margin-bottom: 15px; font-size: 14px; color: #333; text-align: left; border-bottom: 1px solid #f0f0f0; padding-bottom: 10px; }
.stats-card p { text-align: center; color: #888; font-size: 14px; padding: 10px 0; }
.stats-list { list-style: none; padding: 0; margin: 0; }
.stats-list li { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; font-size: 14px; color: #555; }
.stats-list li:not(:last-child) { border-bottom: 1px dashed #eee; }
.stats-list li strong { font-weight: bold; font-size: 16px; color: #007BFF; }

/* ================================================= */
/* ESTILOS DO CALENDÁRIO MENSAL                */
/* ================================================= */
#calendario-container { margin-bottom: 0; padding: 20px; background-color: #f8f9fa; border-radius: 8px; }
.calendario-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; }
.calendario-header h2 { margin: 0; font-size: 18px; color: #333; }
.calendario-header button { background: #007BFF; color: white; border: none; border-radius: 50%; width: 30px; height: 30px; font-size: 18px; cursor: pointer; transition: background-color 0.2s; }
.calendario-header button:hover { background: #0056b3; }
.calendario-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.dia-semana { text-align: center; font-weight: bold; color: #888; font-size: 12px; padding-bottom: 5px; }
.dia { display: flex; justify-content: center; align-items: center; height: 35px; background-color: #e9ecef; border-radius: 4px; font-size: 12px; transition: all 0.2s ease; }
.dia:not(.vazio) { cursor: pointer; }
.dia:not(.vazio):hover { background-color: #d1d6db; }
.dia.positivo { background-color: #28a745; color: white; font-weight: bold; }
.dia.negativo { background-color: #dc3545; color: white; font-weight: bold; }
.dia.neutro { background-color: #6c757d; color: white; }
.dia.hoje { box-shadow: 0 0 0 2px #007BFF; }
.dia.vazio { background-color: transparent; }
.dia.selecionado { box-shadow: 0 0 0 3px #0056b3 inset; transform: scale(0.9); }
.calendario-footer { margin-top: 15px; padding-top: 15px; border-top: 1px solid #ddd; display: flex; justify-content: space-between; align-items: center; font-size: 14px; font-weight: bold; }
.resultado-mensal.positivo { color: #28a745; }
.resultado-mensal.negativo { color: #dc3545; }

/* ================================================= */
/* RESPONSIVIDADE                                    */
/* ================================================= */
@media (max-width: 992px) { 
    .main-content-grid { grid-template-columns: 1fr; }
    #dashboard-container, #grafico-container { grid-column: 1 / -1; }
}
@media (max-width: 768px) {
    .container { width: 100%; max-width: 100%;}
    h1 { font-size: 22px; }
    .trade-summary .info { font-size: 15px; }
    .trade-summary .resultado { font-size: 16px; min-width: auto; }
    #botao-resumo, .button-primary, .button-secondary { width: 100%; }
    .modal-content { padding: 20px; }
    .main-header { padding: 10px; display: flex; flex-direction: column; height: auto; gap: 10px; align-items: center; }
    .header-actions { order: 3; width: 100%; display: grid; grid-template-columns: 1fr 1fr; gap:5px; }
    #open-tech-calc-btn { grid-column: span 2; } 
    .header-toggles { order: 2; grid-column: auto; justify-self: auto; justify-content: center; }
    .header-user-info { order: 1; grid-column: auto; justify-self: auto; flex-wrap: wrap; justify-content: center; }
    body { padding-top: 200px; }
    .dia { height: 35px; font-size: 12px;}
    .dashboard-grid { grid-template-columns: 1fr; }
    .form-grid-4-col, .form-grid-2-col { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
    .form-grid-4-col, .form-grid-2-col { grid-template-columns: 1fr; }
}
.fab { position: fixed; bottom: 30px; right: 30px; width: 60px; height: 60px; background-color: #007BFF; color: white; border: none; border-radius: 50%; box-shadow: 0 4px 12px rgba(0,0,0,0.2); font-size: 32px; font-weight: normal; line-height: 60px; text-align: center; cursor: pointer; z-index: 1000; transition: background-color 0.3s ease, box-shadow 0.3s ease, transform 0.2s ease; padding: 0; }
.fab:hover { background-color: #0056b3; box-shadow: 0 6px 16px rgba(0,0,0,0.3); transform: translateY(-2px); }

/* ================================== */
/* ESTILOS DA CALCULADORA TECH (ISOLADO) */
/* ================================== */
.ai-theme-scope {
    background-color: #1e293b !important;
    color: #f8fafc !important;
    border: 1px solid #334155;
    max-width: 500px !important;
    max-height: 90vh;
    overflow-y: auto;
}

/* Box de Análise */
.ai-analysis-box {
    background: linear-gradient(145deg, rgba(139, 92, 246, 0.1), rgba(15, 23, 42, 0.8));
    border: 1px solid #8b5cf6;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 1.5rem;
    display: none;
}
.ai-analysis-title { color: #8b5cf6; font-weight: bold; display: flex; align-items: center; gap: 8px; font-size: 0.9rem; margin-bottom: 8px; }

/* Inputs Escuros Específicos */
.ai-input {
    width: 100%; padding: 12px; 
    background-color: #020617 !important; 
    border: 1px solid #334155 !important;
    border-radius: 8px; 
    color: #fff !important; 
    font-size: 1.1rem; 
    box-sizing: border-box; 
    transition: 0.2s;
}
.ai-input:focus { outline: none; border-color: #3b82f6 !important; }

/* Resultado */
.result-area {
    background-color: #020617; border-radius: 12px; padding: 1.5rem; margin-top: 1.5rem;
    border-left: 4px solid #334155; transition: border-color 0.3s;
}
.result-label { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 1px; color: #94a3b8; margin-bottom: 5px; }
.result-price { font-size: 2.5rem; font-weight: 800; color: #f8fafc; font-family: monospace; line-height: 1; }