
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Segoe UI', sans-serif; background: linear-gradient(135deg, #004d40 0%, #00251a 100%); min-height: 100vh; padding: 15px; }
.container { max-width: 1100px; margin: 5px auto; background: white; border-radius: 12px; box-shadow: 0 20px 60px rgba(0,0,0,0.3); overflow: hidden; }
.header { background: linear-gradient(135deg, #00695c, #004d40); color: white; padding: 15px 20px; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; }
.header h2 { font-size: 18px; }
.header-right { display: flex; gap: 8px; flex-wrap: wrap; }
.btn-link { background: rgba(255,255,255,0.2); color: white; border: 2px solid white; padding: 7px 13px; border-radius: 6px; font-weight: 600; font-size: 12px; text-decoration: none; cursor: pointer; }
.btn-add { background: white; color: #00695c; border: none; padding: 7px 14px; border-radius: 6px; font-weight: 700; font-size: 13px; cursor: pointer; }
.content { padding: 15px 20px; }
.summary-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 18px; }
.summary-card { border-radius: 10px; padding: 12px 8px; text-align: center; }
.summary-card .label { font-size: 9px; font-weight: 700; text-transform: uppercase; opacity: 0.85; }
.summary-card .value { font-size: 18px; font-weight: 800; margin-top: 3px; }
.summary-card .sub { font-size: 10px; font-weight: 600; margin-top: 2px; opacity: 0.75; }
.sc-total { background: #e0f2f1; color: #00695c; }
.sc-hf { background: #e8f5e9; color: #1b5e20; }
.sc-ltv { background: #fff8e1; color: #f57f17; }
.sc-debt { background: #fce4ec; color: #880e4f; }
.hf-safe { color: #2e7d32 !important; }
.hf-warn { color: #f57f17 !important; }
.hf-danger { color: #c62828 !important; }
.alert-box { border-radius: 8px; padding: 12px 14px; margin-bottom: 12px; display: none; }
.alert-danger { background: #fdecea; border-left: 4px solid #c62828; }
.alert-warn { background: #fff8e1; border-left: 4px solid #ffa000; }
.alert-title { font-weight: 800; font-size: 13px; margin-bottom: 4px; }
.alert-danger .alert-title { color: #c62828; }
.alert-warn .alert-title { color: #e65100; }
.alert-item { font-size: 12px; padding: 2px 0; }

/* SEÇÃO POR BLOCKCHAIN */
.chain-section { border: 2px solid #e0e0e0; border-radius: 14px; margin-bottom: 16px; overflow: hidden; }
.chain-header { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; padding: 12px 16px; cursor: pointer; user-select: none; }
.chain-ethereum .chain-header { background: linear-gradient(135deg, #e8eaf6, #ede7f6); }
.chain-arbitrum .chain-header { background: linear-gradient(135deg, #e3f2fd, #e8eef8); }
.chain-polygon .chain-header { background: linear-gradient(135deg, #f3e5f5, #ede7f6); }
.chain-optimism .chain-header { background: linear-gradient(135deg, #fdecea, #fce4ec); }
.chain-base .chain-header { background: linear-gradient(135deg, #e3f2fd, #e8f4fd); }
.chain-bsc .chain-header { background: linear-gradient(135deg, #fff8e1, #fffde7); }
.chain-solana .chain-header { background: linear-gradient(135deg, #e8f5e9, #f1f8e9); }
.chain-outro .chain-header { background: #f5f5f5; }
.chain-name { font-size: 16px; font-weight: 800; }
.chain-ethereum .chain-name { color: #3f51b5; }
.chain-arbitrum .chain-name { color: #1565c0; }
.chain-polygon .chain-name { color: #7b1fa2; }
.chain-optimism .chain-name { color: #c62828; }
.chain-base .chain-name { color: #0d47a1; }
.chain-bsc .chain-name { color: #f57f17; }
.chain-solana .chain-name { color: #2e7d32; }
.chain-outro .chain-name { color: #555; }
.chain-hf-badge { padding: 5px 14px; border-radius: 20px; font-size: 13px; font-weight: 800; }
.hf-badge-safe { background: #e8f5e9; color: #2e7d32; }
.hf-badge-warn { background: #fff8e1; color: #e65100; }
.hf-badge-danger { background: #fdecea; color: #c62828; }
.hf-badge-none { background: #f5f5f5; color: #999; }
.chain-stats { display: flex; gap: 16px; flex-wrap: wrap; }
.chain-stat-item .csi-label { font-size: 9px; font-weight: 700; color: #888; text-transform: uppercase; }
.chain-stat-item .csi-value { font-size: 14px; font-weight: 800; color: #333; }
.chain-toggle { margin-left: auto; font-size: 18px; color: #999; transition: transform 0.2s; }
.chain-section.collapsed .chain-toggle { transform: rotate(-90deg); }
.chain-hf-bar { padding: 6px 16px 10px 16px; background: rgba(0,0,0,0.03); border-bottom: 1px solid #e0e0e0; }
.hf-bar-bg { background: #e0e0e0; border-radius: 8px; height: 8px; overflow: hidden; }
.hf-bar-fill { height: 100%; border-radius: 8px; transition: width 0.5s; }
.hf-safe-bar { background: linear-gradient(90deg, #43a047, #2e7d32); }
.hf-warn-bar { background: linear-gradient(90deg, #ffa000, #ff6f00); }
.hf-danger-bar { background: linear-gradient(90deg, #e53935, #b71c1c); }
.hf-markers { display: flex; justify-content: space-between; font-size: 9px; color: #bbb; margin-top: 2px; }
.chain-body { display: grid; grid-template-columns: 1fr 1fr; }
.chain-section.collapsed .chain-hf-bar, .chain-section.collapsed .chain-body { display: none; }
.chain-col { padding: 12px 14px; }
.chain-col-left { border-right: 1px solid #f0f0f0; }
.col-col-title { font-size: 10px; font-weight: 700; text-transform: uppercase; color: #888; margin-bottom: 10px; display: flex; justify-content: space-between; align-items: center; }
.add-btn { font-size: 11px; background: #00695c; color: white; border: none; padding: 3px 10px; border-radius: 12px; cursor: pointer; font-weight: 700; text-decoration: none; }
.add-btn-purple { background: #4a2c8a !important; }

/* Linhas de colateral */
.col-row { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid #f5f5f5; }
.col-row:last-child { border-bottom: none; }
.row-icon { width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0; }
.row-icon-fallback { width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 800; flex-shrink: 0; }
.row-info { flex: 1; min-width: 0; }
.row-name { font-size: 13px; font-weight: 800; color: #333; }
.row-detail { font-size: 10px; color: #999; }
.row-right { text-align: right; flex-shrink: 0; }
.row-usd-green { font-size: 13px; font-weight: 800; color: #00695c; }
.row-usd-purple { font-size: 13px; font-weight: 800; color: #4a2c8a; }
.row-pct { font-size: 10px; color: #888; }
.row-actions { display: flex; gap: 3px; flex-shrink: 0; }
.row-btn { background: none; border: none; font-size: 14px; cursor: pointer; opacity: 0.4; padding: 2px 4px; }
.row-btn:hover { opacity: 1; }
.pnl-pos { font-size: 10px; color: #2e7d32; font-weight: 600; }
.pnl-neg { font-size: 10px; color: #c62828; font-weight: 600; }
.pool-tag { display: inline-block; background: #e8f5e9; color: #2e7d32; font-size: 9px; font-weight: 700; padding: 1px 6px; border-radius: 8px; }
.col-empty { text-align: center; padding: 20px 10px; color: #ccc; font-size: 12px; }

/* 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-top: 20px; overflow-y: auto; }
.modal-overlay.show { display: flex; }
.modal-box { background: white; border-radius: 14px; padding: 20px; width: 90%; max-width: 460px; margin-bottom: 30px; }
.modal-title { font-size: 16px; font-weight: 800; color: #333; margin-bottom: 15px; text-align: center; }
.modal-label { font-size: 12px; font-weight: 600; color: #666; margin-bottom: 5px; margin-top: 12px; }
.modal-input { width: 100%; padding: 10px; border: 2px solid #e0e0e0; border-radius: 8px; font-size: 14px; outline: none; }
.modal-input:focus { border-color: #00695c; }
.modal-select { width: 100%; padding: 10px; border: 2px solid #e0e0e0; border-radius: 8px; font-size: 14px; outline: none; background: white; }
.modal-search { width: 100%; padding: 10px; border: 2px solid #e0e0e0; border-radius: 8px; font-size: 14px; outline: none; margin-bottom: 6px; }
.modal-search:focus { border-color: #00695c; }
.modal-coin-list { max-height: 130px; overflow-y: auto; border: 2px solid #e0e0e0; border-radius: 8px; margin-bottom: 6px; }
.modal-coin-item { display: flex; align-items: center; gap: 8px; padding: 8px 10px; cursor: pointer; border-bottom: 1px solid #f0f0f0; }
.modal-coin-item:hover { background: #f0faf9; }
.modal-coin-item.selected { background: #e0f2f1; border-left: 3px solid #00695c; }
.modal-coin-item img { width: 22px; height: 22px; border-radius: 50%; }
.modal-coin-item .mci-name { font-size: 12px; font-weight: 700; color: #333; }
.modal-coin-item .mci-symbol { font-size: 10px; color: #999; }
.modal-coin-item .mci-price { font-size: 11px; font-weight: 700; color: #00695c; margin-left: auto; }
.modal-selected-coin { font-size: 12px; font-weight: 700; color: #00695c; padding: 5px 10px; background: #e0f2f1; border-radius: 8px; text-align: center; margin-bottom: 6px; }
.modal-preview { background: #e0f2f1; padding: 10px 12px; border-radius: 8px; margin-top: 10px; font-size: 12px; color: #00695c; font-weight: 700; display: none; }
.modal-btns { display: flex; gap: 10px; margin-top: 15px; }
.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: #00695c; color: white; }
.modal-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.modal-sep { text-align: center; font-size: 11px; font-weight: 700; color: #aaa; margin: 14px 0 0 0; padding-top: 12px; border-top: 1px solid #eee; letter-spacing: 1px; }
.empty-state { text-align: center; padding: 50px 20px; color: #bbb; }
.empty-state .icon { font-size: 48px; margin-bottom: 12px; }
.empty-state h3 { font-size: 16px; font-weight: 700; color: #999; margin-bottom: 6px; }

@media (max-width: 650px) {
    .summary-grid { grid-template-columns: repeat(2, 1fr) !important; }
    .chain-body { grid-template-columns: 1fr !important; }
    .chain-col-left { border-right: none; border-bottom: 1px solid #f0f0f0; }
    .header { flex-direction: column; text-align: center; }
    .chain-stats { gap: 10px; }
    .modal-row2 { grid-template-columns: 1fr; }
}

