
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Segoe UI', sans-serif; background: linear-gradient(135deg, #2d1b69 0%, #1a1a2e 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, #2d1b69, #4a2c8a); 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; }
.btn-add { background: white; color: #2d1b69; border: none; padding: 7px 14px; border-radius: 6px; font-weight: 700; font-size: 13px; cursor: pointer; }
.content { padding: 15px 20px; }

/* Summary */
.summary-grid { display: grid; grid-template-columns: repeat(3, 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: 16px; font-weight: 800; margin-top: 2px; }
.sc-total { background: #ede7f6; color: #4a2c8a; }
.sc-chains { background: #e3f2fd; color: #1565c0; }
.sc-borrows { background: #fff3e0; color: #e65100; }

/* Filter tabs */
.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: #4a2c8a; color: white; border-color: #4a2c8a; }

/* Borrow cards */
.borrow-list { }
.borrow-card { border: 2px solid #e0e0e0; border-radius: 12px; padding: 14px; margin-bottom: 10px; transition: all 0.2s; position: relative; }
.borrow-card:hover { border-color: #4a2c8a; box-shadow: 0 4px 15px rgba(74,44,138,0.15); }
.borrow-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.borrow-crypto { display: flex; align-items: center; gap: 10px; }
.borrow-icon { width: 36px; height: 36px; border-radius: 50%; }
.borrow-name { font-size: 16px; font-weight: 800; color: #333; }
.borrow-symbol { font-size: 12px; color: #999; text-transform: uppercase; }
.borrow-actions { display: flex; gap: 6px; }
.borrow-btn { background: none; border: none; font-size: 16px; cursor: pointer; opacity: 0.5; padding: 4px; }
.borrow-btn:hover { opacity: 1; }

.borrow-details { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.borrow-stat { background: #f8f9fa; padding: 10px; border-radius: 8px; }
.borrow-stat .bs-label { font-size: 10px; font-weight: 600; color: #888; text-transform: uppercase; }
.borrow-stat .bs-value { font-size: 14px; font-weight: 800; color: #333; margin-top: 2px; }

.chain-badge { display: inline-block; padding: 3px 10px; border-radius: 12px; font-size: 10px; font-weight: 700; }
.chain-ethereum { background: #ede7f6; color: #627eea; }
.chain-polygon { background: #f3e5f5; color: #8247e5; }
.chain-arbitrum { background: #e3f2fd; color: #28a0f0; }
.chain-optimism { background: #fdecea; color: #ff0420; }
.chain-avalanche { background: #fdecea; color: #e84142; }
.chain-base { background: #e3f2fd; color: #0052ff; }
.chain-bsc { background: #fff8e1; color: #f0b90b; }
.chain-default { background: #f0f0f0; color: #666; }

.protocol-badge { display: inline-block; padding: 3px 10px; border-radius: 12px; font-size: 10px; font-weight: 700; margin-left: 6px; }
.proto-aave { background: #ede7f6; color: #2d1b69; }
.proto-compound { background: #e8f5e9; color: #00d395; }
.proto-other { background: #f0f0f0; color: #666; }

.borrow-date { font-size: 10px; color: #999; margin-top: 6px; }

/* Empty state */
.empty-state { text-align: center; padding: 40px 20px; color: #999; }
.empty-state .icon { font-size: 48px; margin-bottom: 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: 30px; overflow-y: auto; }
.modal-overlay.show { display: flex; }
.modal-box { background: white; border-radius: 14px; padding: 20px; width: 90%; max-width: 450px; 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: 10px; }
.modal-input { width: 100%; padding: 10px; border: 2px solid #e0e0e0; border-radius: 8px; font-size: 14px; outline: none; }
.modal-input:focus { border-color: #4a2c8a; }
.modal-select { width: 100%; padding: 10px; border: 2px solid #e0e0e0; border-radius: 8px; font-size: 14px; outline: none; background: white; }
.modal-select:focus { border-color: #4a2c8a; }
.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: #4a2c8a; }
.modal-coin-list { max-height: 150px; overflow-y: auto; border: 2px solid #e0e0e0; border-radius: 8px; margin-bottom: 8px; }
.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 #4a2c8a; }
.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; }
.modal-coin-item .mci-price { font-size: 12px; font-weight: 700; color: #4a2c8a; margin-left: auto; }
.modal-selected-coin { font-size: 13px; font-weight: 700; color: #4a2c8a; padding: 6px 10px; background: #ede7f6; border-radius: 8px; text-align: center; margin-bottom: 8px; }
.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: #4a2c8a; color: white; }
.modal-btn-save:disabled { background: #ccc; }

.modal-preview { background: #f5f0ff; padding: 12px; border-radius: 8px; margin-top: 10px; font-size: 13px; color: #4a2c8a; text-align: center; }

/* Dark Mode */
body.dark-mode { background: linear-gradient(135deg, #0a0a1e 0%, #16213e 100%); }
body.dark-mode .container { background: #0f0f23; color: #e0e0e0; }
body.dark-mode .borrow-card { border-color: #333; background: #16213e; }
body.dark-mode .borrow-card:hover { border-color: #4a2c8a; }
body.dark-mode .borrow-name { color: #e0e0e0; }
body.dark-mode .borrow-stat { background: #1a1a3e; }
body.dark-mode .borrow-stat .bs-value { color: #e0e0e0; }
body.dark-mode .filter-tab { background: #16213e; border-color: #333; color: #aaa; }
body.dark-mode .summary-card.sc-total { background: #1a153e; }
body.dark-mode .summary-card.sc-chains { background: #152030; }
body.dark-mode .summary-card.sc-borrows { background: #2e2515; }
body.dark-mode .modal-box { background: #0f0f23; }
body.dark-mode .modal-title { color: #e0e0e0; }
body.dark-mode .modal-input, body.dark-mode .modal-select, 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-coin { background: #1a153e; }
body.dark-mode .modal-btn-cancel { background: #333; color: #aaa; }
body.dark-mode .modal-preview { background: #1a153e; }

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

