/* GT Smart — Monitor S&P 500 (DeFi manual) */
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Inter', system-ui, sans-serif; background: linear-gradient(135deg, #1E40AF 0%, #0F2A6B 100%); min-height: 100vh; padding: 15px; }
.container { max-width: 760px; margin: 5px auto; background: #fff; border-radius: 12px; box-shadow: 0 20px 60px rgba(0,0,0,0.3); overflow: hidden; }
.header { background: linear-gradient(135deg, #1E40AF, #0F2A6B); color: #fff; padding: 15px 20px; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; }
.header h2 { font-size: 18px; display: flex; align-items: center; gap: 6px; }
.header-right { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.btn-link { background: rgba(255,255,255,0.2); color: #fff; border: 2px solid #fff; padding: 7px 13px; border-radius: 6px; font-weight: 600; font-size: 12px; text-decoration: none; }
.btn-add { background: #fff; color: #1E40AF; border: none; padding: 7px 14px; border-radius: 6px; font-weight: 700; font-size: 13px; cursor: pointer; }
.content { padding: 15px 20px; }

/* Aviso fim de semana */
.weekend-note { background: #FEF3C7; border-left: 4px solid #D97706; color: #92400E; border-radius: 8px; padding: 10px 12px; margin-bottom: 14px; font-size: 12px; font-weight: 600; }

/* Empty */
.empty-state { text-align: center; padding: 40px 20px; color: #888; }
.empty-state p { margin: 12px 0; font-size: 14px; }

/* Summary */
.summary-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 16px; }
.summary-card { border-radius: 10px; padding: 12px 8px; text-align: center; }
.summary-card .label { font-size: 10px; font-weight: 700; text-transform: uppercase; opacity: 0.85; }
.summary-card .value { font-size: 17px; font-weight: 800; margin-top: 3px; }
.sc-lucro { background: #ECFDF5; color: #0F2A6B; }
.sc-tvl { background: #E0E7FF; color: #1E40AF; }
.sc-divida { background: #f3e5f5; color: #6a1b9a; }

/* Strategy cards */
.strat-card { border: 2px solid #e5e7eb; border-radius: 12px; padding: 14px; margin-bottom: 14px; }
.strat-card-title { font-size: 15px; font-weight: 800; color: #1f2937; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.chip { font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 10px; background: #E0E7FF; color: #1E40AF; text-transform: uppercase; }

.kv-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-bottom: 12px; }
.kv-grid > div { background: #f8f9fa; border-radius: 8px; padding: 9px 10px; display: flex; flex-direction: column; gap: 2px; }
.kv-grid .k { font-size: 10px; font-weight: 600; color: #888; text-transform: uppercase; }
.kv-grid .v { font-size: 14px; font-weight: 800; color: #333; }

/* Gauge liquidação */
.gauge-wrap { margin: 6px 0 10px; }
.gauge-label { font-size: 12px; font-weight: 600; color: #555; margin-bottom: 5px; }
.gauge-label .muted { color: #999; font-weight: 500; font-size: 11px; }
.gauge-track { height: 12px; background: #e5e7eb; border-radius: 6px; overflow: hidden; }
.gauge-fill { height: 100%; border-radius: 6px; width: 0; transition: width 0.4s ease; background: #9ca3af; }
.gauge-fill.g-ok { background: linear-gradient(90deg, #34D399, #059669); }
.gauge-fill.g-warn { background: linear-gradient(90deg, #FBBF24, #D97706); }
.gauge-fill.g-danger { background: linear-gradient(90deg, #F87171, #DC2626); animation: pulse-danger 1.1s infinite; }
@keyframes pulse-danger { 0%,100% { opacity: 1; } 50% { opacity: 0.45; } }

.cost-line { font-size: 12px; color: #666; margin-top: 4px; }
.cost-line strong { color: #333; }

/* Health Factor */
.hf-box { border-radius: 10px; padding: 14px; text-align: center; margin-top: 4px; }
.hf-box.hf-ok { background: #ECFDF5; }
.hf-box.hf-warn { background: #FEF3C7; }
.hf-box.hf-danger { background: #FEE2E2; }
.hf-num { font-size: 30px; font-weight: 900; line-height: 1; }
.hf-box.hf-ok .hf-num { color: #059669; }
.hf-box.hf-warn .hf-num { color: #D97706; }
.hf-box.hf-danger .hf-num { color: #DC2626; }
.hf-label { font-size: 11px; font-weight: 700; text-transform: uppercase; margin-top: 6px; color: #555; }

/* Uniswap range */
.range-status { font-size: 13px; font-weight: 800; padding: 8px 10px; border-radius: 8px; background: #f8f9fa; color: #555; margin-bottom: 10px; text-align: center; }
.range-status.in { background: #ECFDF5; color: #059669; }
.range-status.out { background: #FEF2F2; color: #DC2626; }
.range-gauge { margin: 8px 4px 12px; }
.range-scale { display: flex; justify-content: space-between; font-size: 10px; color: #888; font-weight: 600; margin-bottom: 4px; }
.range-track { position: relative; height: 8px; background: linear-gradient(90deg, #34D399, #10B981); border-radius: 4px; }
.range-marker { position: absolute; top: -7px; width: 0; height: 0; border-left: 8px solid transparent; border-right: 8px solid transparent; border-top: 12px solid #1E40AF; transform: translateX(-8px); transition: left 0.4s ease; }

.compo-wrap { margin: 10px 0; }
.compo-bar { display: flex; height: 22px; border-radius: 6px; overflow: hidden; background: #e5e7eb; }
.compo-usdc { background: #1E40AF; transition: width 0.4s ease; }
.compo-spyon { background: #10B981; transition: width 0.4s ease; }
.compo-legend { display: flex; justify-content: space-between; font-size: 11px; font-weight: 700; color: #555; margin-top: 4px; }

/* Simular saída */
.sim-box { background: #f0f7ff; border: 2px solid #E0E7FF; border-radius: 12px; padding: 14px; }
.sim-title { font-size: 14px; font-weight: 800; color: #1E40AF; margin-bottom: 10px; }
.sim-breakdown { margin-bottom: 10px; }
.sim-row { display: flex; justify-content: space-between; padding: 5px 0; border-bottom: 1px solid #dbeafe; font-size: 13px; color: #444; }
.sim-row:last-child { border-bottom: none; }
.sim-row span:last-child { font-weight: 700; font-variant-numeric: tabular-nums; }
.sim-total { display: flex; justify-content: space-between; font-size: 15px; font-weight: 800; color: #0F2A6B; padding-top: 8px; border-top: 2px solid #1E40AF; }

/* cores valor */
.pos { color: #059669 !important; }
.neg { color: #DC2626 !important; }
.warn { color: #D97706 !important; }

/* Modal */
.modal-overlay { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); z-index: 1000; justify-content: center; align-items: flex-start; padding: 20px 10px; overflow-y: auto; }
.modal-overlay.show { display: flex; }
.modal-box { background: #fff; border-radius: 14px; padding: 20px; width: 100%; max-width: 480px; margin-bottom: 30px; }
.modal-title { font-size: 16px; font-weight: 800; color: #333; margin-bottom: 12px; text-align: center; }
.modal-section { font-size: 12px; font-weight: 800; color: #1E40AF; text-transform: uppercase; letter-spacing: 0.5px; margin: 16px 0 8px; padding-bottom: 4px; border-bottom: 2px solid #E0E7FF; }
.modal-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.modal-2col label { display: block; font-size: 11px; font-weight: 600; color: #666; margin-bottom: 3px; }
.modal-input { width: 100%; padding: 9px 10px; border: 2px solid #e0e0e0; border-radius: 8px; font-size: 14px; outline: none; font-family: inherit; }
.modal-input:focus { border-color: #1E40AF; }
.modal-box > .modal-input { margin-bottom: 4px; }
.modal-btns { display: flex; gap: 10px; margin-top: 18px; }
.modal-btn { flex: 1; padding: 12px; border-radius: 8px; font-weight: 700; font-size: 14px; cursor: pointer; border: none; }
.modal-btn-cancel { background: #f0f0f0; color: #666; }
.modal-btn-save { background: #1E40AF; color: #fff; }

@media (max-width: 600px) {
    .header { flex-direction: column; text-align: center; }
    .kv-grid { grid-template-columns: 1fr 1fr; }
    .summary-card .value { font-size: 15px; }
}
@media (max-width: 420px) {
    .modal-2col { grid-template-columns: 1fr; }
}

/* ===== DARK MODE — gaps desta pagina (central nao cobre) ===== */
[data-theme="dark"] .container { background: var(--gt-surface); color: var(--gt-text); }

/* Summary cards por tom (sc-lucro ja no central) */
[data-theme="dark"] .sc-tvl { background: rgba(96,165,250,0.13); color: var(--gt-text); }
[data-theme="dark"] .sc-divida { background: rgba(96,165,250,0.13); color: var(--gt-text); }

/* Strategy cards */
[data-theme="dark"] .strat-card { background: var(--gt-surface-2); border-color: var(--gt-border); }
[data-theme="dark"] .strat-card-title { color: var(--gt-text); }
[data-theme="dark"] .kv-grid .v { color: var(--gt-text); }

/* Gauges e tracks (fundos cinza claro) */
[data-theme="dark"] .gauge-track { background: var(--gt-border); }
[data-theme="dark"] .gauge-label { color: var(--gt-text); }
[data-theme="dark"] .cost-line { color: var(--gt-text-muted); }
[data-theme="dark"] .cost-line strong { color: var(--gt-text); }
[data-theme="dark"] .compo-bar { background: var(--gt-border); }
[data-theme="dark"] .compo-legend { color: var(--gt-text); }
[data-theme="dark"] .hf-label { color: var(--gt-text-muted); }

/* Simular saida (azul claro) */
[data-theme="dark"] .sim-box { background: rgba(96,165,250,0.13); border-color: var(--gt-border); color: var(--gt-text); }
[data-theme="dark"] .sim-title { color: var(--gt-text); }
[data-theme="dark"] .sim-row { border-color: var(--gt-border); color: var(--gt-text); }
[data-theme="dark"] .sim-total { color: var(--gt-text); border-color: var(--gt-border); }

/* Modal */
[data-theme="dark"] .modal-box { background: var(--gt-surface); color: var(--gt-text); }
[data-theme="dark"] .modal-title { color: var(--gt-text); }
[data-theme="dark"] .modal-section { color: var(--gt-text); border-color: var(--gt-border); }
[data-theme="dark"] .modal-input { background: var(--gt-input-bg); color: var(--gt-text); border-color: var(--gt-border); }
[data-theme="dark"] .modal-btn-cancel { background: var(--gt-surface-2); color: var(--gt-text); }
