/* Shared Live Trades account-panel styles used by manual and EA pages. */

body {
    margin: 0;
    font-family: 'Inter', 'Segoe UI', sans-serif;
    padding: 76px 20px 32px;
    color: var(--tb-text);
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow-x: hidden;
}

.back-home-btn {
    position: fixed;
    top: 18px;
    left: 20px;
    z-index: 1000;
}

.tb-shell {
    width: 100%;
    max-width: 1200px;
    display: grid;
    gap: 20px;
    padding-bottom: 40px;
}

.tb-shell > * {
    min-width: 0;
}

.hero {
    padding: 28px;
}

.hero-head {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: flex-start;
    flex-wrap: wrap;
}

.toolbar {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
    margin-top: 20px;
}

.toolbar > * {
    min-width: 0;
}

.toolbar input {
    flex: 1 1 260px;
    min-width: 220px;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: rgba(15, 23, 42, 0.72);
    color: var(--tb-text);
}

.toolbar button,
.toolbar a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 16px;
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    text-decoration: none;
    font-weight: 700;
    cursor: pointer;
}

.toolbar button {
    background: linear-gradient(135deg, rgba(32, 227, 178, 0.24), rgba(87, 199, 255, 0.22));
    color: #fff;
}

.toolbar button:disabled {
    opacity: 0.75;
    cursor: wait;
}

.toolbar a {
    background: rgba(71, 85, 105, 0.9);
    color: #fff;
}

.date-label {
    font-size: 0.88rem;
    color: var(--tb-muted, #94a3b8);
    font-weight: 600;
    white-space: nowrap;
}

.date-input {
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid rgba(148, 163, 184, 0.22);
    color: var(--tb-text, #e2e8f0);
    border-radius: 10px;
    padding: 9px 12px;
    font-size: 0.88rem;
    font-family: inherit;
    cursor: pointer;
    min-width: 0;
}

.date-input::-webkit-calendar-picker-indicator {
    filter: invert(0.7);
    cursor: pointer;
}

.date-input:focus {
    outline: 2px solid rgba(32, 227, 178, 0.5);
    outline-offset: 1px;
    border-color: rgba(32, 227, 178, 0.4);
}

.page-shell {
    display: grid;
    gap: 20px;
    padding-bottom: 40px;
}

.live-accounts-summary {
    margin-bottom: 16px;
}

.account-card {
    padding: 22px;
}

.account-head {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    align-items: flex-start;
}

.account-head h2 {
    margin: 0 0 6px;
    font-size: 1.25rem;
}

.account-head p {
    margin: 0;
    color: var(--tb-muted);
}

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 5px 10px;
    border-radius: 999px;
    background: rgba(32, 227, 178, 0.16);
    color: #9ff5db;
    font-size: 0.78rem;
    font-weight: 700;
    border: 1px solid rgba(32, 227, 178, 0.26);
}

.badge-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.badge-demo {
    background: rgba(245, 158, 11, 0.16);
    color: #fcd34d;
    border-color: rgba(245, 158, 11, 0.3);
}

.demo-account {
    border: 1px dashed rgba(245, 158, 11, 0.28);
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.06), rgba(7, 17, 31, 0.42));
}

.demo-note {
    margin-top: 8px;
    color: #fbbf24;
    font-size: 0.82rem;
    font-weight: 600;
}

.account-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
    margin-top: 16px;
}

.meta-chip {
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.72);
    border: 1px solid rgba(148, 163, 184, 0.12);
}

.meta-chip span {
    display: block;
    color: var(--tb-muted);
    font-size: 0.78rem;
    margin-bottom: 4px;
}

.meta-chip strong {
    font-size: 0.96rem;
}

.tables-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-top: 18px;
}

.table-card {
    padding: 16px;
    border-radius: 16px;
    background: rgba(7, 17, 31, 0.42);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.table-card h3 {
    margin: 0 0 4px;
    font-size: 1rem;
}

.table-card p {
    margin: 0 0 12px;
    color: var(--tb-muted);
    font-size: 0.88rem;
}

.table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 14px;
    border: 1px solid rgba(148, 163, 184, 0.14);
}

table {
    width: 100%;
    border-collapse: collapse;
    table-layout: auto;
    min-width: 560px;
    background: rgba(3, 10, 20, 0.42);
}

th,
td {
    padding: 8px 10px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.1);
    text-align: left;
    font-size: 0.84rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

th {
    color: #cbd5e1;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    background: rgba(15, 23, 42, 0.9);
    position: sticky;
    top: 0;
}

td.muted {
    color: var(--tb-muted);
}

.empty-state {
    padding: 24px;
    text-align: center;
    color: var(--tb-muted);
}

.account-tabs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 8px;
    overflow: hidden;
    padding: 4px 0 12px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    scrollbar-width: thin;
    scrollbar-color: rgba(148, 163, 184, 0.2) transparent;
}

.tab-btn {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    padding: 9px 18px;
    border-radius: 10px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: rgba(15, 23, 42, 0.6);
    color: var(--tb-muted, #94a3b8);
    font-size: 0.86rem;
    font-weight: 600;
    cursor: pointer;
    white-space: normal;
    text-align: center;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.tab-btn:hover {
    background: rgba(32, 227, 178, 0.1);
    color: var(--tb-text, #e2e8f0);
    border-color: rgba(32, 227, 178, 0.3);
}

.tab-btn.active,
.tab-btn[aria-selected="true"] {
    background: linear-gradient(135deg, rgba(32, 227, 178, 0.18), rgba(87, 199, 255, 0.14));
    color: #9ff5db;
    border-color: rgba(32, 227, 178, 0.4);
}

.account-panels {
    display: grid;
    gap: 18px;
    min-width: 0;
}

.account-panel,
.table-card,
.table-wrap {
    min-width: 0;
}

.account-panel[hidden] {
    display: none;
}

.equity-curve-section {
    margin-top: 18px;
}

.equity-curve-title {
    margin: 0 0 8px;
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--tb-muted, #94a3b8);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.equity-curve-wrap {
    border-radius: 12px;
    overflow: hidden;
    background: rgba(3, 10, 20, 0.42);
    border: 1px solid rgba(255, 255, 255, 0.06);
    padding: 8px 8px 4px;
}

.equity-svg {
    display: block;
    width: 100%;
    height: 110px;
}

.equity-empty {
    padding: 16px;
    font-size: 0.88rem;
    text-align: center;
}

.metrics-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
    margin-top: 14px;
}

@media (max-width: 980px) {
    .tables-grid {
        grid-template-columns: 1fr;
    }

    .account-meta,
    .metrics-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    body {
        padding: 70px 14px 14px;
    }

    .hero,
    .account-card {
        padding: 18px;
    }

    .back-home-btn {
        top: 14px;
        left: 14px;
    }

    .toolbar {
        gap: 10px;
    }

    .toolbar button,
    .toolbar .threshold-label,
    .toolbar .threshold-input,
    .toolbar .date-input,
    .toolbar .status-pill {
        flex: 1 1 calc(50% - 10px);
    }

    .toolbar .threshold-label {
        display: grid;
        gap: 6px;
    }

    .toolbar .threshold-label .threshold-input {
        width: 100%;
        min-width: 0;
    }

    .date-label {
        display: none;
    }

    .table-wrap {
        overflow-x: hidden;
    }

    table {
        min-width: 0;
        table-layout: fixed;
    }

    th,
    td {
        white-space: normal;
        overflow: visible;
        text-overflow: clip;
        overflow-wrap: anywhere;
        word-break: break-word;
    }
}

@media (max-width: 560px) {
    .toolbar button,
    .toolbar .threshold-label,
    .toolbar .threshold-input,
    .toolbar .date-input,
    .toolbar .status-pill {
        flex: 1 1 100%;
    }

    .account-meta,
    .metrics-row {
        grid-template-columns: 1fr;
    }

    .trades-table--magic th:nth-child(3),
    .trades-table--magic td:nth-child(3),
    .trades-table--magic th:nth-child(5),
    .trades-table--magic td:nth-child(5) {
        display: none;
    }

    .trades-table--no-magic th:nth-child(2),
    .trades-table--no-magic td:nth-child(2),
    .trades-table--no-magic th:nth-child(4),
    .trades-table--no-magic td:nth-child(4) {
        display: none;
    }
}
