
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Segoe UI', sans-serif; background: linear-gradient(135deg, #f7931a 0%, #e2761b 50%, #c96100 100%); min-height: 100vh; padding: 15px; }
.container { max-width: 1000px; 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, #f7931a, #c96100); 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-back { background: rgba(255,255,255,0.2); color: white; border: 2px solid white; padding: 7px 13px; border-radius: 6px; font-weight: 600; font-size: 13px; text-decoration: none; }
.btn-refresh { background: white; color: #f7931a; border: none; padding: 7px 13px; border-radius: 6px; font-weight: 700; font-size: 13px; cursor: pointer; }
.content { padding: 15px 20px; }
.last-update { text-align: center; font-size: 11px; color: #999; margin-bottom: 12px; }
.summary-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 15px; }
.summary-card { border-radius: 10px; padding: 10px 6px; text-align: center; }
.summary-card .label { font-size: 9px; font-weight: 700; text-transform: uppercase; opacity: 0.8; }
.summary-card .value { font-size: 15px; font-weight: 800; margin-top: 2px; }
.sc-btc { background: #fff8e1; color: #f7931a; }
.sc-eth { background: #ede7f6; color: #627eea; }
.sc-market { background: #e8f5e9; color: #2e7d32; }
.sc-dom { background: #e3f2fd; color: #1565c0; }
.fav-section { margin-bottom: 15px; }
.fav-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.fav-title { font-size: 15px; font-weight: 800; color: #f7931a; }
.fav-count { font-size: 11px; color: #999; }
.fav-scroll { display: flex; flex-direction: column; gap: 8px; }
.fav-card { border: 2px solid #f7931a; border-radius: 12px; padding: 12px; display: flex; align-items: center; gap: 10px; cursor: pointer; transition: all 0.2s; position: relative; user-select: none; }
.fav-card:hover { box-shadow: 0 4px 15px rgba(247,147,26,0.3); }
.fav-card.dragging { opacity: 0.4; border-style: dashed; }
.fav-card.drag-over { border-color: #333; border-width: 3px; transform: scale(1.02); }
.fav-drag { font-size: 18px; cursor: grab; color: #ccc; padding: 4px; touch-action: none; flex-shrink: 0; }
.fav-drag:active { cursor: grabbing; color: #f7931a; }
.fav-remove { position: absolute; top: 8px; right: 8px; font-size: 14px; cursor: pointer; opacity: 0.5; background: none; border: none; color: #c62828; }
.fav-remove:hover { opacity: 1; }
.fav-icon { width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0; }
.fav-info { flex: 1; }
.fav-name { font-size: 14px; font-weight: 700; color: #333; }
.fav-symbol { font-size: 11px; color: #999; text-transform: uppercase; }
.fav-right { text-align: right; }
.fav-price { font-size: 18px; font-weight: 800; color: #333; }
.fav-change { font-size: 12px; font-weight: 700; }
.fav-empty { text-align: center; padding: 15px; color: #999; font-size: 13px; border: 2px dashed #e0e0e0; border-radius: 12px; width: 100%; }

/* Stablecoin Favoritas */
.stable-section { margin-bottom: 15px; }
.stable-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.stable-title { font-size: 15px; font-weight: 800; color: #2e7d32; }
.stable-count { font-size: 11px; color: #999; }
.stable-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.stable-card { border: 2px solid #43a047; border-radius: 12px; padding: 12px; display: flex; align-items: center; gap: 10px; cursor: pointer; transition: all 0.2s; position: relative; user-select: none; }
.stable-card:hover { box-shadow: 0 4px 15px rgba(67,160,71,0.3); }
.stable-card.dragging { opacity: 0.4; border-style: dashed; }
.stable-card.drag-over { border-color: #333; border-width: 3px; transform: scale(1.02); }
.stable-drag { font-size: 18px; cursor: grab; color: #ccc; padding: 4px; touch-action: none; flex-shrink: 0; }
.stable-drag:active { cursor: grabbing; color: #43a047; }
.stable-remove { position: absolute; top: 8px; right: 8px; font-size: 14px; cursor: pointer; opacity: 0.5; background: none; border: none; color: #c62828; }
.stable-remove:hover { opacity: 1; }
.stable-icon { width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0; }
.stable-info { flex: 1; }
.stable-name { font-size: 14px; font-weight: 700; color: #333; }
.stable-symbol { font-size: 11px; color: #999; text-transform: uppercase; }
.stable-right { text-align: right; }
.stable-price { font-size: 18px; font-weight: 800; color: #2e7d32; }
.stable-mcap { font-size: 11px; color: #999; }
.stable-empty { text-align: center; padding: 15px; color: #999; font-size: 13px; border: 2px dashed #e0e0e0; border-radius: 12px; }
.btn-add-stable { background: #43a047; color: white; border: none; padding: 8px 16px; border-radius: 8px; font-weight: 700; font-size: 12px; cursor: pointer; width: 100%; }
.btn-add-stable:hover { background: #2e7d32; }

/* ===== STABLECOINS DEFI PARTICULARES ===== */
.defi-stable-section { margin-bottom: 15px; }
.defi-stable-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.defi-stable-title { font-size: 15px; font-weight: 800; color: #1565c0; }
.defi-stable-subtitle { font-size: 10px; color: #999; margin-top: 2px; }
.defi-stable-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.defi-stable-card { border: 2px solid #1976d2; border-radius: 12px; padding: 10px 12px; display: flex; align-items: center; gap: 8px; background: #f8fbff; transition: all 0.2s; }
.defi-stable-card:hover { box-shadow: 0 4px 12px rgba(21,101,192,0.2); transform: translateY(-1px); }
.defi-stable-card.depegged { border-color: #e53935; background: #fff5f5; }
.defi-stable-card.loading { opacity: 0.5; }
.defi-stable-icon { width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0; }
.defi-stable-icon-placeholder { width: 28px; height: 28px; border-radius: 50%; background: #e3f2fd; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 800; color: #1565c0; flex-shrink: 0; }
.defi-stable-info { flex: 1; min-width: 0; }
.defi-stable-name { font-size: 12px; font-weight: 700; color: #333; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.defi-stable-desc { font-size: 10px; color: #999; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.defi-stable-right { text-align: right; flex-shrink: 0; }
.defi-stable-price { font-size: 15px; font-weight: 800; color: #1565c0; }
.defi-stable-price.depegged { color: #e53935; }
.defi-stable-peg { font-size: 10px; font-weight: 700; }
.peg-ok { color: #2e7d32; }
.peg-warn { color: #f57f17; }
.peg-bad { color: #e53935; }
.defi-stable-na { font-size: 12px; color: #bbb; font-style: italic; }
.defi-stable-loading { text-align: center; padding: 10px; color: #999; font-size: 12px; grid-column: 1/-1; }
@media (max-width: 480px) { .defi-stable-grid { grid-template-columns: 1fr; } }
.converter { background: #f8f9fa; border-radius: 12px; padding: 15px; margin-bottom: 15px; }
.converter-title { font-size: 14px; font-weight: 700; color: #333; margin-bottom: 10px; }
.converter-row { display: flex; gap: 10px; align-items: center; margin-bottom: 8px; }
.converter-input { flex: 1; padding: 10px; border: 2px solid #e0e0e0; border-radius: 8px; font-size: 14px; outline: none; }
.converter-input:focus { border-color: #f7931a; }
.converter-select { padding: 10px; border: 2px solid #e0e0e0; border-radius: 8px; font-size: 14px; outline: none; background: white; min-width: 100px; }
.converter-result { font-size: 18px; font-weight: 800; color: #f7931a; text-align: center; padding: 10px; background: #fff8e1; border-radius: 8px; }
.search-bar { display: flex; gap: 8px; margin-bottom: 15px; }
.search-input { flex: 1; padding: 10px 14px; border: 2px solid #e0e0e0; border-radius: 10px; font-size: 14px; outline: none; }
.search-input:focus { border-color: #f7931a; }
.filter-tabs { display: flex; gap: 6px; margin-bottom: 15px; flex-wrap: wrap; }
.filter-tab { padding: 6px 12px; border-radius: 18px; border: 2px solid #ddd; background: white; font-size: 11px; font-weight: 600; cursor: pointer; color: #555; transition: all 0.2s; }
.filter-tab.active { background: #f7931a; color: white; border-color: #f7931a; }
.crypto-item { display: flex; align-items: center; padding: 12px; border: 2px solid #f0f0f0; border-radius: 12px; margin-bottom: 8px; transition: all 0.2s; }
.crypto-item:hover { border-color: #f7931a; box-shadow: 0 4px 12px rgba(247,147,26,0.15); transform: translateY(-1px); }
.crypto-item.is-fav { border-color: #f7931a; background: #fffbf0; }
.crypto-rank { font-size: 12px; font-weight: 700; color: #999; width: 28px; text-align: center; }
.crypto-star { font-size: 18px; cursor: pointer; margin-right: 6px; transition: transform 0.2s; }
.crypto-star:hover { transform: scale(1.3); }
.crypto-icon { width: 36px; height: 36px; border-radius: 50%; margin: 0 10px; cursor: pointer; }
.crypto-info { flex: 1; cursor: pointer; }
.crypto-name { font-size: 14px; font-weight: 700; color: #333; }
.crypto-symbol { font-size: 11px; color: #999; text-transform: uppercase; }
.crypto-price { text-align: right; cursor: pointer; }
.crypto-usd { font-size: 16px; font-weight: 800; color: #333; }
.crypto-change { font-size: 12px; font-weight: 700; margin-top: 2px; }
.change-up { color: #2e7d32; }
.change-down { color: #c62828; }
.crypto-detail { display: none; }
.crypto-detail.show { display: block; }
.detail-header { display: flex; align-items: center; gap: 12px; margin-bottom: 15px; }
.detail-icon { width: 48px; height: 48px; border-radius: 50%; }
.detail-name { font-size: 20px; font-weight: 800; color: #333; }
.detail-symbol { font-size: 14px; color: #999; }
.detail-price-big { font-size: 32px; font-weight: 900; color: #333; margin-bottom: 5px; }
.detail-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 15px; }
.detail-stat { background: #f8f9fa; padding: 12px; border-radius: 10px; }
.detail-stat .ds-label { font-size: 10px; font-weight: 600; color: #888; text-transform: uppercase; }
.detail-stat .ds-value { font-size: 15px; font-weight: 800; color: #333; margin-top: 3px; }
.btn-fav-detail { background: #f7931a; color: white; border: none; padding: 10px 20px; border-radius: 8px; font-weight: 700; font-size: 13px; cursor: pointer; width: 100%; margin-bottom: 8px; }
.btn-fav-detail.is-fav { background: #c62828; }
.btn-back-detail { background: #666; color: white; border: none; padding: 10px 20px; border-radius: 8px; font-weight: 700; font-size: 13px; cursor: pointer; width: 100%; }
.loading { text-align: center; padding: 40px; color: #999; }
.loading .spinner { width: 40px; height: 40px; border: 4px solid #f0f0f0; border-top: 4px solid #f7931a; border-radius: 50%; animation: spin 1s linear infinite; margin: 0 auto 10px; }
@keyframes spin { to { transform: rotate(360deg); } }
.error-box { background: #fdecea; color: #c62828; padding: 12px; border-radius: 10px; text-align: center; margin-bottom: 15px; font-size: 13px; border-left: 4px solid #e53935; }
body.dark-mode { background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%); }
body.dark-mode .container { background: #0f0f23; color: #e0e0e0; }
body.dark-mode .crypto-item { border-color: #333; background: #16213e; }
body.dark-mode .crypto-item:hover { border-color: #f7931a; }
body.dark-mode .crypto-item.is-fav { border-color: #f7931a; background: #2e2515; }
body.dark-mode .crypto-name, body.dark-mode .fav-name { color: #e0e0e0; }
body.dark-mode .crypto-usd, body.dark-mode .fav-price { color: #e0e0e0; }
body.dark-mode .search-input { background: #16213e; color: #e0e0e0; border-color: #333; }
body.dark-mode .filter-tab { background: #16213e; border-color: #333; color: #aaa; }
body.dark-mode .summary-card.sc-btc { background: #2e2515; }
body.dark-mode .summary-card.sc-eth { background: #1a1a3e; }
body.dark-mode .summary-card.sc-market { background: #152e15; }
body.dark-mode .summary-card.sc-dom { background: #152030; }
body.dark-mode .fav-card { border-color: #f7931a; background: #2e2515; }
body.dark-mode .fav-empty { border-color: #333; color: #666; }
body.dark-mode .stable-card { border-color: #43a047; background: #152e15; }
body.dark-mode .stable-name { color: #e0e0e0; }
body.dark-mode .stable-empty { border-color: #333; color: #666; }
body.dark-mode .btn-add-stable { background: #2e7d32; }
body.dark-mode .defi-stable-card { background: #0d1b2a; border-color: #1976d2; }
body.dark-mode .defi-stable-name { color: #e0e0e0; }
body.dark-mode .defi-stable-desc { color: #666; }
body.dark-mode .detail-stat { background: #16213e; }
body.dark-mode .detail-stat .ds-value, body.dark-mode .detail-name, body.dark-mode .detail-price-big { color: #e0e0e0; }
body.dark-mode .converter { background: #16213e; }
body.dark-mode .converter-title { color: #e0e0e0; }
body.dark-mode .converter-input, body.dark-mode .converter-select { background: #1a1a3e; color: #e0e0e0; border-color: #333; }
body.dark-mode .converter-result { background: #2e2515; }

/* Pools */
.pool-section { margin-bottom: 15px; }
.pool-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.pool-title { font-size: 15px; font-weight: 800; color: #627eea; }
.pool-count { font-size: 11px; color: #999; }
.btn-add-pool { background: #627eea; color: white; border: none; padding: 6px 14px; border-radius: 8px; font-weight: 700; font-size: 12px; cursor: pointer; }
.pool-card { border: 2px solid #627eea; border-radius: 12px; padding: 14px; margin-bottom: 10px; position: relative; transition: all 0.2s; user-select: none; }
.pool-card.dragging { opacity: 0.4; border-style: dashed; }
.pool-card.drag-over { border-color: #333; border-width: 3px; transform: scale(1.02); }
.pool-drag { font-size: 18px; cursor: grab; color: #ccc; touch-action: none; flex-shrink: 0; display: inline-block; }
.pool-drag:active { cursor: grabbing; color: #627eea; }
.pool-card:hover { box-shadow: 0 4px 15px rgba(98,126,234,0.2); }
.pool-card.dragging { opacity: 0.4; border-style: dashed; }
.pool-card.drag-over { border-color: #333; border-width: 3px; transform: scale(1.02); }
.pool-drag { font-size: 18px; cursor: grab; color: #ccc; touch-action: none; }
.pool-drag:active { cursor: grabbing; color: #627eea; }
.pool-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.pool-pair { display: flex; align-items: center; gap: 6px; }
.pool-icons { display: flex; }
.pool-icons img { width: 28px; height: 28px; border-radius: 50%; border: 2px solid white; }
.pool-icons img:last-child { margin-left: -10px; }
.pool-pair-name { font-size: 16px; font-weight: 800; color: #333; }
.pool-remove { background: none; border: none; font-size: 16px; cursor: pointer; color: #c62828; opacity: 0.5; }
.pool-remove:hover { opacity: 1; }
.pool-prices { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pool-price-box { background: #f5f7fa; border-radius: 8px; padding: 10px; text-align: center; }
.pool-price-label { font-size: 10px; font-weight: 600; color: #888; text-transform: uppercase; }
.pool-price-value { font-size: 18px; font-weight: 800; color: #627eea; margin-top: 2px; }
.pool-price-usd { font-size: 11px; color: #999; margin-top: 2px; }
.pool-empty { text-align: center; padding: 15px; color: #999; font-size: 13px; border: 2px dashed #e0e0e0; border-radius: 12px; }

/* Add Pool 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: center; }
.modal-overlay.show { display: flex; }
.modal-box { background: white; border-radius: 14px; padding: 20px; width: 90%; max-width: 400px; }
.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; }
.modal-select { width: 100%; padding: 10px; border: 2px solid #e0e0e0; border-radius: 8px; font-size: 14px; margin-bottom: 12px; outline: none; background: white; }
.modal-select:focus { border-color: #627eea; }
.modal-arrow { text-align: center; font-size: 24px; color: #627eea; margin: 5px 0; }
.modal-preview { background: #f0f3ff; padding: 12px; border-radius: 8px; margin-bottom: 12px; text-align: center; font-size: 14px; font-weight: 700; color: #627eea; min-height: 40px; }
.modal-btns { display: flex; gap: 10px; }
.modal-btn { flex: 1; padding: 10px; border-radius: 8px; font-weight: 700; font-size: 14px; cursor: pointer; border: none; }
.modal-btn-cancel { background: #f0f0f0; color: #666; }
.modal-btn-save { background: #627eea; color: white; }
.modal-btn-save:disabled { background: #ccc; }
.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: #627eea; }
.modal-coin-list { max-height: 150px; overflow-y: auto; border: 2px solid #e0e0e0; border-radius: 8px; margin-bottom: 8px; }
.modal-coin-list::-webkit-scrollbar { width: 4px; }
.modal-coin-list::-webkit-scrollbar-thumb { background: #627eea; border-radius: 2px; }
.modal-coin-item { display: flex; align-items: center; gap: 8px; padding: 8px 10px; cursor: pointer; transition: background 0.2s; border-bottom: 1px solid #f0f0f0; }
.modal-coin-item:hover { background: #f0f3ff; }
.modal-coin-item:last-child { border-bottom: none; }
.modal-coin-item.selected { background: #e8edff; border-left: 3px solid #627eea; }
.modal-coin-item img { width: 24px; height: 24px; border-radius: 50%; }
.modal-coin-item .mci-name { font-size: 13px; font-weight: 700; color: #333; }
.modal-coin-item .mci-symbol { font-size: 11px; color: #999; text-transform: uppercase; }
.modal-coin-item .mci-price { font-size: 12px; font-weight: 700; color: #627eea; margin-left: auto; }
.modal-selected { font-size: 13px; font-weight: 700; color: #627eea; padding: 6px 10px; background: #f0f3ff; border-radius: 8px; text-align: center; margin-bottom: 8px; }

body.dark-mode .modal-search { background: #16213e; color: #e0e0e0; border-color: #333; }
body.dark-mode .modal-coin-list { border-color: #333; }
body.dark-mode .modal-coin-item { border-color: #333; }
body.dark-mode .modal-coin-item:hover { background: #1a1a3e; }
body.dark-mode .modal-coin-item.selected { background: #1a1a3e; }
body.dark-mode .modal-coin-item .mci-name { color: #e0e0e0; }
body.dark-mode .modal-selected { background: #1a1a3e; }

body.dark-mode .pool-card { border-color: #627eea; background: #16213e; }
body.dark-mode .pool-pair-name { color: #e0e0e0; }
body.dark-mode .pool-price-box { background: #1a1a3e; }
body.dark-mode .pool-empty { border-color: #333; color: #666; }
body.dark-mode .modal-box { background: #0f0f23; }
body.dark-mode .modal-title { color: #e0e0e0; }
body.dark-mode .modal-select { background: #16213e; color: #e0e0e0; border-color: #333; }
body.dark-mode .modal-preview { background: #1a1a3e; }
body.dark-mode .modal-btn-cancel { background: #333; color: #aaa; }

@media (max-width: 600px) {
    .summary-grid { grid-template-columns: repeat(2, 1fr) !important; }
    .header { flex-direction: column; text-align: center; }
}

