/* =========================================================
   STOCK DASHBOARD
   ========================================================= */

.dashboard-container {
    width: 100%;
    box-sizing: border-box;

    display: flex;
    flex-direction: column;
    gap: 8px;

    padding: 8px;
}


/* ---------------------------------------------------------
   Dashboard toolbar
   --------------------------------------------------------- */

.dashboard-toolbar {
    display: flex;
    align-items: flex-end;
    gap: 12px;

    width: 100%;
}

.dashboard-filter {
    flex: 0 0 180px;
}

.dashboard-filter-stock {
    flex: 1;
    min-width: 250px;
}

.dashboard-filter label {
    display: block;

    margin: 0 0 6px 2px;

    color: var(--light-foreground);
    font-size: 12px;
    font-weight: 600;
}


/* ---------------------------------------------------------
   Stock header
   --------------------------------------------------------- */

.dashboard-stock-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 24px;

    padding: 4px 2px;
}

.dashboard-stock-title {
    min-width: 0;
}

.dashboard-stock-title h1 {
    margin: 0 0 6px 0;

    color: var(--text-primary);

    font-size: 26px;
    font-weight: 600;
    line-height: 1.2;
}

.dashboard-stock-description {
    max-width: 900px;

    color: var(--light-foreground);

    font-size: 13px;
    line-height: 1.5;
}

.dashboard-available-dates {
    flex-shrink: 0;

    text-align: right;
}

.dashboard-meta-label {
    display: block;

    color: var(--text-secondary);

    font-size: 11px;
    font-weight: 500;
}

.dashboard-meta-value {
    color: var(--text-primary);

    font-size: 12px;
}


/* ---------------------------------------------------------
   Chart cards
   --------------------------------------------------------- */

.dashboard-chart-card,
.dashboard-drawdown-card {
    margin: 0;

    padding: 16px;

    min-width: 0;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;

    gap: 20px;

    margin-bottom: 8px;
}

.chart-header h3 {
    margin: 0 0 4px 0;

    color: var(--text-primary);

    font-size: 16px;
}

.chart-subtitle {
    color: var(--text-secondary);

    font-size: 11px;
}

.chart-date-control {
    flex-shrink: 0;

    width: 300px;
}

.chart-date-control label {
    display: block;

    margin-bottom: 5px;

    color: var(--text-secondary);

    font-size: 10px;
}


/* ---------------------------------------------------------
   Date picker in chart header
   --------------------------------------------------------- */

.chart-date-control .custom-date-picker {
    width: 100%;
}

.chart-date-control .DateRangePickerInput {
    width: 100%;
}

.chart-date-control .DateInput {
    width: 50%;
}


/* ---------------------------------------------------------
   Empty state
   --------------------------------------------------------- */

.dashboard-empty-state {
    padding: 50px;

    text-align: center;

    background: var(--card-bg);

    border: 1px solid var(--border-color);
    border-radius: 12px;
}

/* ---------------------------------------------------------
   Responsive dashboard
   --------------------------------------------------------- */

@media (max-width: 1200px) {
    .dashboard-container .kpi-row {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .dashboard-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .dashboard-filter,
    .dashboard-filter-stock {
        flex: none;
        width: 100%;
        min-width: 0;
    }

    .dashboard-stock-header {
        flex-direction: column;
    }

    .dashboard-available-dates {
        text-align: left;
    }

    .chart-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .chart-date-control {
        width: 100%;
    }
}

@media (max-width: 600px) {
    .dashboard-container .kpi-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dashboard-stock-title h1 {
        font-size: 22px;
    }

    .dashboard-container {
        padding: 10px;
    }

    .dashboard-chart-card,
    .dashboard-drawdown-card {
        padding: 10px;
    }
}
