/* ==========================================================================
   bots.html — page styles
   Extracted from inline <style> blocks; logic preserved verbatim.
   ========================================================================== */

/* ── Material Symbols icon overrides ───────────────────────────────────── */
.material-symbols-outlined {
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
    font-size: 24px;
    line-height: 1;
    color: inherit;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* ── Layout grid ───────────────────────────────────────────────────────── */
.app-container {
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-rows: 60px 1fr;
}

.header-bar {
    grid-column: 2;
    grid-row: 1;
}

.main-content {
    grid-column: 2;
    grid-row: 2;
    display: flex;
    flex-direction: column;
    gap: var(--gap-md);
    overflow: hidden;
    min-height: 0;
}
.main-content::-webkit-scrollbar { display: none; }

.bots-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 8px;
}

.page-title {
    font-size: 32px;
    font-weight: 700;
}

.btn-create {
    background: var(--accent-primary);
    color: white;
    padding: 12px 28px;
    border-radius: var(--radius-full);
    border: none;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: 0.2s;
}
.btn-create:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

/* ── Master-Detail layout ──────────────────────────────────────────────── */
.bots-master-detail {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 0;
    background: var(--surface);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.05);
    overflow: hidden;
    flex: 1;
    min-height: 0;
}

.bots-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    overflow: hidden;
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    min-height: 0;
}

.bots-detail {
    overflow-y: auto;
    scrollbar-width: none;
    padding: 24px;
    max-width: 480px;
}
.bots-detail::-webkit-scrollbar { display: none; }

.bots-empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-tertiary);
    font-size: 15px;
    font-weight: 500;
    grid-column: 1 / -1;
}

/* ── Detail empty state ────────────────────────────────────────────────── */
.detail-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-tertiary);
    font-size: 15px;
    font-weight: 500;
    gap: 12px;
}
.detail-empty svg { opacity: 0.3; }

/* ── Compact list card ─────────────────────────────────────────────────── */
.bot-list-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    cursor: pointer;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    border-left: 3px solid transparent;
    transition: background 0.15s ease, border-color 0.15s ease;
    user-select: none;
}
.bot-list-item:hover { background: rgba(255, 255, 255, 0.03); }
.bot-list-item.selected {
    background: rgba(16, 185, 129, 0.06);
    border-left-color: var(--accent-primary);
}
.bot-list-item-info {
    flex: 1;
    min-width: 0;
}
.bot-list-item-name {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.bot-list-item-sub {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 3px;
}
.bot-list-item-pnl {
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
    margin-left: auto;
    flex-shrink: 0;
}
.bot-list-item-pnl.up { color: var(--color-up); }
.bot-list-item-pnl.down { color: var(--color-down); }
.bot-list-item-pnl.neutral { color: var(--text-secondary); }

/* ── Detail panel content ──────────────────────────────────────────────── */
.detail-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 20px;
}
.detail-close-btn {
    background: rgba(255, 255, 255, 0.06);
    border: none;
    color: var(--text-secondary);
    width: 32px;
    height: 32px;
    border-radius: var(--radius-md);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s;
    flex-shrink: 0;
}
.detail-close-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}
.detail-header-left {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.detail-bot-name {
    font-size: 22px;
    font-weight: 700;
}
.detail-header-meta {
    display: flex;
    align-items: center;
    gap: 8px;
}
.detail-tickers {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 16px;
}
.detail-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 20px;
}
.detail-activity { margin-bottom: 20px; }
.detail-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* ── Mobile detail overlay ─────────────────────────────────────────────── */
.bots-detail-overlay { display: none; }
.detail-back-btn { display: none; }

svg {
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* ── Bot activity log ──────────────────────────────────────────────────── */
.bot-activity {
    background: var(--bg-app);
    border-radius: var(--radius-md);
    padding: 12px;
    margin-top: 12px;
    max-height: 150px;
    overflow-y: auto;
    scrollbar-width: none;
}
.bot-activity::-webkit-scrollbar { display: none; }

.activity-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}
.activity-title {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.live-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 10px;
    color: var(--color-up);
    font-weight: 600;
}
.live-dot {
    width: 6px;
    height: 6px;
    background: var(--color-up);
    border-radius: 50%;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.activity-log {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.log-entry {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 11px;
    padding: 6px 8px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 6px;
}
.log-time {
    color: var(--text-tertiary);
    font-weight: 600;
    white-space: nowrap;
}
.log-action {
    color: var(--text-secondary);
    flex: 1;
}
.log-action .buy    { color: var(--color-up);   font-weight: 600; }
.log-action .sell   { color: var(--color-down); font-weight: 600; }
.log-action .signal { color: #8CA8FF;           font-weight: 600; }
.log-action .price  { color: var(--text-primary); font-weight: 600; }

.log-profit {
    font-weight: 700;
    white-space: nowrap;
}
.log-profit.positive { color: var(--color-up); }
.log-profit.negative { color: var(--color-down); }

/* ── Modal overlay / card ──────────────────────────────────────────────── */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}
.modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}
.modal-card {
    background: var(--surface);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-xl);
    padding: 48px;
    max-width: 520px;
    width: 90%;
    box-shadow: var(--shadow-soft);
    text-align: center;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}
.modal-overlay.active .modal-card { transform: scale(1); }

.modal-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(255, 59, 48, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
}
.modal-title {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 16px;
}
.modal-text {
    font-size: 16px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 32px;
}
.modal-btn {
    background: var(--accent-primary);
    color: white;
    padding: 14px 32px;
    border-radius: var(--radius-full);
    border: none;
    font-weight: 700;
    font-size: 15px;
    cursor: pointer;
    transition: 0.2s;
}
.modal-btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

/* ==================== MOBILE ==================== */
@media (max-width: 768px) {
    body {
        padding: 0;
        padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px));
    }
    .app-container {
        grid-template-columns: 1fr !important;
        grid-template-rows: auto 1fr !important;
        gap: 0;
        border-radius: 0;
    }
    .header-bar {
        grid-column: 1 !important;
        grid-row: 1 !important;
    }
    .main-content {
        grid-column: 1 !important;
        grid-row: 2 !important;
        padding: 12px;
    }
    .bots-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    .page-title { font-size: 22px; }

    /* Master-Detail: single column on mobile */
    .bots-master-detail {
        grid-template-columns: 1fr !important;
        min-height: auto;
    }
    .bots-list {
        border-right: none;
        max-height: none;
    }
    .bots-detail { display: none; }

    /* Mobile detail overlay */
    .bots-detail-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: var(--bg-app);
        z-index: 999;
        overflow-y: auto;
        padding: 16px;
        padding-bottom: calc(80px + env(safe-area-inset-bottom, 0px));
        transform: translateX(100%);
        transition: transform 0.3s ease;
    }
    .bots-detail-overlay.open {
        display: block;
        transform: translateX(0);
    }
    .detail-back-btn {
        display: flex;
        align-items: center;
        gap: 6px;
        background: none;
        border: none;
        color: var(--accent-primary);
        font-size: 14px;
        font-weight: 600;
        cursor: pointer;
        padding: 8px 0;
        margin-bottom: 16px;
    }
    .detail-stats-grid { grid-template-columns: 1fr 1fr !important; }
    .detail-actions { flex-direction: column; }
    .card-action-btn {
        flex: 1;
        width: 100%;
    }

    /* Bottom-sheet modal */
    .modal-overlay {
        padding: 0;
        align-items: flex-end;
    }
    .modal-card {
        padding: 24px 20px !important;
        border-radius: 24px 24px 0 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        max-height: 92vh;
        overflow-y: auto;
        animation: slideUp 0.3s ease-out;
    }
    @keyframes slideUp {
        from { transform: translateY(100%); }
        to   { transform: translateY(0); }
    }
    .data-row {
        grid-template-columns: 1fr 1fr !important;
        gap: 6px;
        font-size: 13px;
    }
    .data-row.header { display: none; }
    .account-summary { grid-template-columns: 1fr 1fr !important; }
}

/* ── 480px: tighter padding ── */
@media (max-width: 480px) {
    .main-content { padding: 8px; }
    .detail-item {
        padding: 6px 8px;
        border-radius: 8px;
    }
    .detail-label { font-size: 9px; }
    .detail-value { font-size: 13px; }
    .modal-card { padding: 20px 16px !important; }
    .btn-create {
        padding: 10px 20px;
        font-size: 13px;
    }
}

/* ── 375px: minimum viable viewport ── */
@media (max-width: 375px) {
    .bot-list-item { padding: 10px 12px; }
    .bot-list-item-name { font-size: 12px; }
    .card-action-btn {
        padding: 8px 12px;
        font-size: 11px;
        min-height: 38px;
    }
    .page-title { font-size: 20px; }
}

/* ==================== DETAIL PANEL CARD STYLES ==================== */
.bot-card-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}
.detail-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    background: var(--surface-secondary);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-md);
    padding: 10px 12px;
}
.detail-label {
    font-size: 10px;
    color: var(--text-tertiary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}
.detail-value {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
}

/* ── Filter bar ────────────────────────────────────────────────────────── */
.bots-filter-bar {
    display: flex;
    gap: 4px;
    padding: 8px 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    flex-shrink: 0;
}
.bots-filter-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: transparent;
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: inherit;
}
.bots-filter-btn:hover { background: rgba(255, 255, 255, 0.04); }
.bots-filter-btn.active {
    background: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.3);
    color: var(--text-primary);
}
.bots-filter-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}
.bots-filter-dot.green { background: var(--color-up); }
.bots-filter-dot.red   { background: #EF4444; }
.bots-filter-count {
    font-size: 10px;
    color: var(--text-tertiary);
    font-weight: 500;
}
#botsList::-webkit-scrollbar { display: none; }

.bot-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-tertiary);
    flex-shrink: 0;
}
.bot-status-dot.live {
    background: var(--color-up);
    box-shadow: 0 0 6px rgba(16, 185, 129, 0.5);
    animation: pulse 1.5s infinite;
}
.bot-status-dot.idle {
    background: #F59E0B;
    box-shadow: 0 0 4px rgba(245, 158, 11, 0.3);
}
.bot-status-dot.stopped {
    background: #EF4444;
    box-shadow: 0 0 4px rgba(239, 68, 68, 0.3);
}
.bot-status-dot.off { background: var(--text-tertiary); }

.bot-live-pair {
    font-size: 9px;
    color: var(--text-tertiary);
    font-weight: 600;
    letter-spacing: 0.3px;
    display: inline-flex;
    align-items: center;
    gap: 3px;
}
.bot-live-pair.trading { color: var(--color-up); }
.bot-pair-more {
    cursor: help;
    background: rgba(255, 255, 255, 0.06);
    padding: 1px 5px;
    border-radius: 8px;
    font-size: 9px;
    transition: all 0.15s;
}
.bot-pair-more:hover {
    background: rgba(16, 185, 129, 0.15);
    color: var(--color-up);
}
.bot-list-item-sub { position: relative; }

/* Coins hover tooltip */
.bot-coins-tooltip {
    display: none;
    position: fixed;
    background: var(--surface);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 8px 0;
    font-size: 11px;
    color: var(--text-primary);
    white-space: nowrap;
    z-index: 9999;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
    min-width: 140px;
    pointer-events: none;
}
.bot-coins-tooltip.visible {
    display: block;
    animation: tooltipIn 0.15s ease-out;
}
@keyframes tooltipIn {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0); }
}
.bot-coins-tooltip-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 12px;
    font-size: 11px;
    font-weight: 500;
}
.bot-coins-tooltip-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}
.bot-coins-tooltip-dot.active {
    background: var(--color-up);
    box-shadow: 0 0 4px rgba(16, 185, 129, 0.5);
}
.bot-coins-tooltip-dot.inactive { background: var(--text-tertiary); }
.bot-coins-tooltip-status {
    margin-left: auto;
    font-size: 9px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* ── Gear button on bot list item ── */
.bot-list-gear {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.15s ease;
    color: var(--text-tertiary);
}
.bot-list-gear:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

/* ── Bot coins submenu ── */
.bot-coins-panel {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}
.bot-coins-panel.open { max-height: 600px; }
.bot-panel-collapse {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px 0;
    cursor: pointer;
    color: var(--text-tertiary);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    transition: color 0.15s, background 0.15s;
}
.bot-panel-collapse:hover {
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.03);
}
.bot-coins-list { padding: 4px 0; }
.bot-coin-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px 8px 36px;
    font-size: 12px;
    color: var(--text-secondary);
    transition: background 0.15s;
    cursor: default;
}
.bot-coin-item:hover { background: rgba(255, 255, 255, 0.03); }
.bot-coin-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--text-tertiary);
    flex-shrink: 0;
}
.bot-coin-dot.active {
    background: var(--color-up);
    box-shadow: 0 0 6px rgba(16, 185, 129, 0.5);
    animation: pulse 1.5s infinite;
}
.bot-coin-name {
    font-weight: 600;
    flex: 1;
}
.bot-coin-status {
    font-size: 10px;
    font-weight: 600;
    color: var(--text-tertiary);
}
.bot-coin-status.trading { color: var(--color-up); }
.bot-coin-gear {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.15s ease;
    color: var(--text-tertiary);
}
.bot-coin-gear:hover {
    background: rgba(16, 185, 129, 0.15);
    border-color: rgba(16, 185, 129, 0.3);
    color: var(--color-up);
}

/* ── Coin action popup ── */
.coin-popup {
    position: fixed;
    background: var(--surface);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    padding: 6px;
    min-width: 180px;
    z-index: 99000;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
    opacity: 0;
    transform: translateY(-4px) scale(0.95);
    pointer-events: none;
    transition: opacity 0.15s, transform 0.15s;
}
.coin-popup.open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: all;
}
.coin-popup-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s;
    white-space: nowrap;
}
.coin-popup-item:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
}
.coin-popup-item.start { color: var(--color-up); }
.coin-popup-item.stop  { color: var(--color-down); }
.coin-popup-item.pause { color: #F59E0B; }
.coin-popup-item.disabled {
    color: var(--text-tertiary) !important;
    opacity: 0.5;
    cursor: not-allowed;
}
.coin-popup-item.disabled:hover {
    background: none;
    color: var(--text-tertiary) !important;
}
.coin-popup-item svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.not-subscribed-tooltip {
    position: absolute;
    left: 50%;
    bottom: calc(100% + 6px);
    transform: translateX(-50%);
    background: var(--surface);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 11px;
    font-weight: 500;
    color: var(--text-secondary);
    white-space: nowrap;
    z-index: 300;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
    animation: tooltipFadeIn 0.2s ease;
    pointer-events: none;
}
@keyframes tooltipFadeIn {
    from { opacity: 0; transform: translateX(-50%) translateY(4px); }
    to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ── Detail coin row ── */
.detail-coin-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--surface-secondary);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    cursor: pointer;
    position: relative;
}
.detail-coin-chevron {
    color: var(--text-tertiary);
    flex-shrink: 0;
    transition: transform 0.2s ease;
}
.detail-coin-row.expanded .detail-coin-chevron {
    transform: rotate(180deg);
    color: var(--text-secondary);
}
.coin-action-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-tertiary);
    transition: all 0.15s;
    flex-shrink: 0;
    position: relative;
}
.coin-action-icon:hover {
    background: rgba(16, 185, 129, 0.12);
    border-color: rgba(16, 185, 129, 0.3);
    color: var(--color-up);
}
.coin-action-icon[title] { position: relative; }
.coin-action-icon[title]::after {
    content: attr(title);
    position: absolute;
    bottom: calc(100% + 4px);
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    background: var(--surface);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 6px;
    padding: 3px 7px;
    font-size: 10px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    z-index: 9999;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.12s, transform 0.12s;
}
.coin-action-icon[title]:hover::after {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ── Detail coin expandable stats ── */
.detail-coin-stats {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease;
    background: rgba(0, 0, 0, 0.15);
    border-radius: 0 0 10px 10px;
    margin-top: -2px;
}
.detail-coin-stats.open { max-height: 400px; }
.detail-coin-stats-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 16px;
    font-size: 12px;
    color: var(--text-secondary);
}
.detail-coin-stats-row:first-child { padding-top: 10px; }
.detail-coin-stats-row:last-child  { padding-bottom: 10px; }

/* ── Live activity bar on bot item ── */
.bot-live-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--color-up), transparent);
    animation: liveBarPulse 2s ease-in-out infinite;
    opacity: 0;
    transition: opacity 0.3s;
}
.bot-list-item.is-live .bot-live-bar { opacity: 1; }
@keyframes liveBarPulse {
    0%, 100% { opacity: 0.3; }
    50%      { opacity: 1; }
}

.bot-mode-pill {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    width: fit-content;
}
.bot-mode-pill.mode-live {
    background: rgba(16, 185, 129, 0.15);
    color: var(--color-up);
    border: 1px solid rgba(16, 185, 129, 0.25);
}
.bot-mode-pill.mode-paper {
    background: rgba(140, 168, 255, 0.12);
    color: var(--accent-blue);
    border: 1px solid rgba(140, 168, 255, 0.2);
}

.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.3px;
}
.status-badge.status-active {
    background: rgba(16, 185, 129, 0.15);
    color: var(--color-up);
}
.status-badge.status-inactive {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-tertiary);
}

.detail-value.up      { color: var(--color-up); }
.detail-value.down    { color: var(--color-down); }
.detail-value.neutral { color: var(--text-secondary); }

.ticker-chip {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    background: rgba(16, 185, 129, 0.1);
    color: var(--accent-primary);
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.3px;
    border: 1px solid rgba(16, 185, 129, 0.15);
    margin: 1px 2px;
}

.card-action-btn {
    padding: 10px 16px;
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    text-decoration: none;
    flex: 1;
    min-width: 100px;
}
.card-action-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}
.card-action-btn.primary {
    background: color-mix(in srgb, var(--color-up) 10%, transparent);
    border-color: color-mix(in srgb, var(--color-up) 28%, transparent);
    color: var(--color-up);
}
.card-action-btn.primary:hover {
    background: color-mix(in srgb, var(--color-up) 18%, transparent);
    color: white;
}
.card-action-btn.btn-success {
    background: color-mix(in srgb, var(--color-up) 10%, transparent);
    border-color: color-mix(in srgb, var(--color-up) 28%, transparent);
    color: var(--color-up);
}
.card-action-btn.btn-success:hover {
    background: color-mix(in srgb, var(--color-up) 18%, transparent);
    color: white;
}
.card-action-btn.btn-danger {
    background: color-mix(in srgb, var(--color-down) 10%, transparent);
    border-color: color-mix(in srgb, var(--color-down) 28%, transparent);
    color: var(--color-down);
}
.card-action-btn.btn-danger:hover {
    background: color-mix(in srgb, var(--color-down) 18%, transparent);
    color: white;
}
.card-action-btn.btn-blue {
    background: color-mix(in srgb, var(--accent-blue) 10%, transparent);
    border-color: color-mix(in srgb, var(--accent-blue) 28%, transparent);
    color: var(--accent-blue);
}
.card-action-btn.btn-blue:hover {
    background: color-mix(in srgb, var(--accent-blue) 18%, transparent);
    color: white;
}
.card-action-btn svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    stroke: currentColor;
    fill: none;
}

/* ── Bot edit modal fields ─────────────────────────────────────────────── */
.be-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.be-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary, #A1A1A1);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.be-input {
    padding: 9px 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: #fff;
    font-size: 13px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s;
}
.be-input:focus { border-color: var(--accent-primary, #10B981); }
.be-input option {
    background: #1a1a1a;
    color: #fff;
}
.be-toggle-row {
    display: flex;
    gap: 4px;
}
.be-toggle {
    flex: 1;
    padding: 7px 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-secondary, #A1A1A1);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    transition: all 0.2s;
}
.be-toggle:hover { background: rgba(255, 255, 255, 0.08); }
.be-toggle.active {
    background: rgba(16, 185, 129, 0.15);
    border-color: rgba(16, 185, 129, 0.4);
    color: #10B981;
}
.be-btn {
    padding: 9px 20px;
    border-radius: 10px;
    border: none;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s;
}
.be-btn-secondary {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-secondary, #A1A1A1);
}
.be-btn-secondary:hover { background: rgba(255, 255, 255, 0.1); }
.be-btn-primary {
    background: var(--accent-primary, #10B981);
    color: #fff;
}
.be-btn-primary:hover { filter: brightness(1.1); }
.be-btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.be-link-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-secondary, #A1A1A1);
    font-size: 11px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
}
.be-link-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

/* ── Data-row tables (positions / orders / trades) ─────────────────────── */
@keyframes spin {
    to { transform: rotate(360deg); }
}
@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.3; }
}

.data-row {
    display: grid;
    grid-template-columns: 100px 1fr 100px 100px 100px;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    align-items: center;
    font-size: 13px;
}
.data-row:last-child { border-bottom: none; }
.data-row.header {
    font-size: 11px;
    color: var(--text-tertiary);
    text-transform: uppercase;
    font-weight: 600;
}

.long  { color: #10B981; }
.short { color: #EF4444; }

.empty-data {
    padding: 24px;
    text-align: center;
    color: var(--text-tertiary);
    font-size: 13px;
}
