﻿/* =========================================================
   Trading Dashboard
   ========================================================= */

.trading-page {
    width: 100%;
}

.trading-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.trading-title {
    margin: 0;
    font-size: 1.8rem;
    font-weight: 600;
}

.trading-subtitle {
    color: #6c757d;
    margin-top: 4px;
}

.trading-status {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 12px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
}

    .trading-status.running {
        background: #e8f7ee;
        color: #198754;
    }

    .trading-status.stopped {
        background: #f8d7da;
        color: #dc3545;
    }

.status-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: currentColor;
}


/* =========================================================
   Statistics
   ========================================================= */

.trading-stat-card {
    background: #ffffff;
    border: 1px solid #e5e5e5;
    border-radius: 10px;
    padding: 20px;
    height: 100%;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.trading-stat-label {
    font-size: 0.85rem;
    color: #6c757d;
    margin-bottom: 8px;
}

.trading-stat-value {
    font-size: 1.45rem;
    font-weight: 600;
}

.trading-stat-small {
    font-size: 0.8rem;
    color: #6c757d;
    margin-top: 5px;
}


/* =========================================================
   Cards
   ========================================================= */

.trading-card {
    background: #ffffff;
    border: 1px solid #e5e5e5;
    border-radius: 10px;
    margin-bottom: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.trading-card-header {
    padding: 16px 20px;
    border-bottom: 1px solid #eeeeee;
    font-weight: 600;
}

.trading-card-body {
    padding: 20px;
}


/* =========================================================
   Current Position
   ========================================================= */

.position-symbol {
    font-size: 1.35rem;
    font-weight: 600;
}

.position-side {
    display: inline-block;
    margin-left: 8px;
    padding: 4px 10px;
    border-radius: 15px;
    font-size: 0.75rem;
    font-weight: 600;
}

.position-long {
    background: #d1e7dd;
    color: #198754;
}

.position-short {
    background: #f8d7da;
    color: #dc3545;
}

.position-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-top: 20px;
}

.position-item-label {
    color: #6c757d;
    font-size: 0.8rem;
    margin-bottom: 4px;
}

.position-item-value {
    font-weight: 600;
    font-size: 1rem;
}


/* =========================================================
   P/L
   ========================================================= */

.pl-positive {
    color: #198754 !important;
}

.pl-negative {
    color: #dc3545 !important;
}


/* =========================================================
   Account / Strategy Status
   ========================================================= */

.account-status-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #eeeeee;
}

    .account-status-row:last-child {
        border-bottom: none;
    }

.account-status-label {
    color: #6c757d;
}

.status-online {
    color: #198754;
    font-weight: 600;
}

.status-offline {
    color: #dc3545;
    font-weight: 600;
}


/* =========================================================
   Trade History
   ========================================================= */

.trading-history-table {
    width: 100%;
    margin-bottom: 0;
}

    .trading-history-table th {
        font-size: 0.8rem;
        color: #6c757d;
        font-weight: 600;
        white-space: nowrap;
    }

    .trading-history-table td {
        vertical-align: middle;
        white-space: nowrap;
    }


/* =========================================================
   Mobile
   ========================================================= */

@media (max-width: 768px) {

    .trading-header {
        align-items: flex-start;
        gap: 12px;
    }

    .trading-title {
        font-size: 1.45rem;
    }

    .trading-status {
        font-size: 0.75rem;
        white-space: nowrap;
    }

    .position-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }

    .trading-card-body {
        padding: 15px;
    }

    .trading-stat-card {
        padding: 15px;
    }

    .trading-stat-value {
        font-size: 1.2rem;
    }

    .trading-history-wrapper {
        overflow-x: auto;
        width: 100%;
    }

    .trading-history-table {
        min-width: 700px;
    }
}
/*taskboard section*/
```css
/* =========================================================
   TRADING TASK CONTROL CENTER
   ========================================================= */
.task-control-card {
    border-radius: 16px;
    overflow: hidden;
}


/* ---------------------------------------------------------
   Section icon
   --------------------------------------------------------- */

.task-section-icon {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: rgba(13, 110, 253, 0.08);
    color: #0d6efd;
    font-size: 17px;
}


/* ---------------------------------------------------------
   Summary badges
   --------------------------------------------------------- */

.task-summary-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 11px;
    border-radius: 20px;
    background: #f4f5f7;
    color: #6c757d;
    font-size: 12px;
    font-weight: 600;
}

    .task-summary-badge span {
        font-weight: 700;
        color: #212529;
    }

.task-running-summary {
    background: rgba(25, 135, 84, 0.08);
    color: #198754;
}

    .task-running-summary span {
        color: #198754;
    }


/* ---------------------------------------------------------
   Responsive task grid
   --------------------------------------------------------- */

.trading-task-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
    gap: 16px;
}


/* ---------------------------------------------------------
   Individual task card
   --------------------------------------------------------- */

.trading-task-item {
    position: relative;
    min-width: 0;
    border: 1px solid #e9ecef;
    border-radius: 14px;
    background: #ffffff;
    padding: 17px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.025);
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

    .trading-task-item:hover {
        transform: translateY(-2px);
        border-color: #d8dee5;
        box-shadow: 0 7px 22px rgba(0, 0, 0, 0.07);
    }


    /* ---------------------------------------------------------
   Running task
   --------------------------------------------------------- */

    .trading-task-item.task-running {
        border-left: 3px solid #198754;
        box-shadow: 0 2px 10px rgba(25, 135, 84, 0.07);
    }


    /* ---------------------------------------------------------
   Error task
   --------------------------------------------------------- */

    .trading-task-item.task-error {
        border-left: 3px solid #dc3545;
        box-shadow: 0 2px 10px rgba(220, 53, 69, 0.07);
    }


    /* ---------------------------------------------------------
   Stopped task
   --------------------------------------------------------- */

    .trading-task-item.task-stopped {
        border-left: 3px solid #adb5bd;
    }


/* ---------------------------------------------------------
   Task top row
   --------------------------------------------------------- */

.task-card-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 16px;
}


/* ---------------------------------------------------------
   Task identity
   --------------------------------------------------------- */

.task-number {
    margin-bottom: 3px;
    font-size: 10px;
    color: #9aa0a6;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.task-strategy {
    font-size: 16px;
    font-weight: 700;
    line-height: 1.25;
    color: #212529;
}

.task-instrument {
    max-width: 210px;
    margin-top: 3px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 12px;
    color: #6c757d;
}


/* ---------------------------------------------------------
   Status badge
   --------------------------------------------------------- */

.task-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 9px;
    border-radius: 20px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.03em;
    white-space: nowrap;
}

.task-status-dot {
    width: 7px;
    height: 7px;
    flex: 0 0 7px;
    border-radius: 50%;
    background: currentColor;
}


/* Running */

.task-status-running {
    color: #198754;
    background: rgba(25, 135, 84, 0.09);
}


/* Stopped */

.task-status-stopped {
    color: #6c757d;
    background: #f1f3f5;
}


/* Error */

.task-status-error {
    color: #dc3545;
    background: rgba(220, 53, 69, 0.09);
}


/* ---------------------------------------------------------
   Task metadata
   --------------------------------------------------------- */

.task-meta-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 15px;
    padding: 12px;
    border-radius: 10px;
    background: #f8f9fa;
}

.task-meta-label {
    display: block;
    margin-bottom: 3px;
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #9aa0a6;
    font-weight: 600;
}

.task-meta-value {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 12px;
    font-weight: 600;
    color: #495057;
}


/* ---------------------------------------------------------
   Heartbeat
   --------------------------------------------------------- */

.task-heartbeat {
    display: flex;
    align-items: center;
    gap: 7px;
    min-width: 0;
    padding-top: 11px;
    border-top: 1px solid #f0f1f2;
    font-size: 11px;
    color: #7a828a;
}

    .task-heartbeat i {
        flex: 0 0 auto;
        font-size: 12px;
        color: #6c757d;
    }

    .task-heartbeat span {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }


/* ---------------------------------------------------------
   Error message
   --------------------------------------------------------- */

.task-error-message {
    margin-top: 9px;
    padding: 8px 10px;
    border-radius: 8px;
    background: rgba(220, 53, 69, 0.06);
    color: #b02a37;
    font-size: 11px;
    line-height: 1.4;
}


/* ---------------------------------------------------------
   Empty state
   --------------------------------------------------------- */

.task-empty-state {
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: #8a929a;
    font-size: 13px;
    border: 1px dashed #dee2e6;
    border-radius: 12px;
}


/* =========================================================
   TASK ACTION CONTROLS
   ========================================================= */
.task-action-row {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.task-action-btn {
    min-width: 118px;
    border-radius: 7px;
    font-weight: 600;
    font-size: 0.78rem;
    padding: 5px 11px;
    transition: all 0.18s ease;
}

/* Start */

.task-action-start {
    color: #198754;
    border: 1px solid rgba(25, 135, 84, 0.25);
    background: rgba(25, 135, 84, 0.07);
}

    .task-action-start:hover {
        color: #fff;
        background: #198754;
        border-color: #198754;
    }

/* Stop */

.task-action-stop {
    color: #dc3545;
    border: 1px solid rgba(220, 53, 69, 0.25);
    background: rgba(220, 53, 69, 0.07);
}

    .task-action-stop:hover {
        color: #fff;
        background: #dc3545;
        border-color: #dc3545;
    }

/* Processing */

.task-action-processing {
    color: #6c757d;
    background: rgba(108, 117, 125, 0.06);
    border: 1px solid rgba(108, 117, 125, 0.15);
    cursor: not-allowed;
}

/* ---------------------------------------------------------
   Mobile
   --------------------------------------------------------- */
@media (max-width: 576px) {
    .trading-task-grid {
        grid-template-columns: 1fr;
    }

    .task-card-top {
        gap: 8px;
    }

    .task-meta-grid {
        grid-template-columns: 1fr 1fr;
    }

    .task-instrument {
        max-width: 170px;
    }
}
/* ======================================================
   TASK POSITION PANEL
   ====================================================== */

.task-position-panel {
    margin-top: 14px;
    padding: 12px;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.025);
    border: 1px solid rgba(0, 0, 0, 0.06);
}

.task-position-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-size: 0.78rem;
    font-weight: 600;
}

    .task-position-header span {
        color: #6c757d;
        letter-spacing: 0.04em;
    }

.task-position-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

    .task-position-grid > div {
        display: flex;
        flex-direction: column;
        gap: 2px;
    }

    .task-position-grid span,
    .task-position-pl span {
        font-size: 0.7rem;
        color: #6c757d;
    }

    .task-position-grid strong {
        font-size: 0.82rem;
        font-weight: 600;
    }

.task-position-pl {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
    padding-top: 9px;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}

    .task-position-pl strong {
        font-size: 0.9rem;
    }

.task-position-none {
    padding-bottom: 10px;
}

.task-position-none-text {
    font-size: 0.78rem;
    color: #6c757d;
    text-align: center;
    padding: 4px 0 2px;
}



