﻿.account-page {
    color: var(--fg);
}

:root {
    --ctl-h: 38px; /* hauteur unique pour label, inputs et bouton */
}

.head .filters {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

    /* Chaque couple Label + input tient sur la même ligne et a la même hauteur */
    .head .filters .inline-field {
        display: inline-flex;
        align-items: center;
        padding-top: 13px;
        gap: 6px;
        height: var(--ctl-h);
    }

        /* Label verticalement centré et sans décalage de baseline */
        .head .filters .inline-field label {
            display: inline-flex;
            align-items: center;
            height: 100%;
            line-height: var(--ctl-h);
            margin: 0; /* supprime toute marge par défaut éventuelle */
        }

/* Dates: même hauteur + line-height + padding vertical à 0 */
.head input[type="date"] {
    height: var(--ctl-h);
    line-height: var(--ctl-h);
}

/* Bouton: inline-flex pour centrer le texte verticalement */
.head .filters button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: var(--ctl-h);
    line-height: var(--ctl-h);
    border: 1px solid var(--color2);
    background: var(--bg);
    border-radius: 10px;
    padding: 0 12px; /* pas de padding vertical, tout se joue avec la hauteur */
    color: var(--fg);
}

    .head .filters button:hover {
        border-color: var(--color1);
    }

.kpis {
    padding-top: 20px;
    display: grid;
    grid-template-columns: repeat(6, minmax(0,1fr));
    gap: 10px;
}

.kpi {
    border: 1px solid var(--lineColor);
    background: var(--backgroundInfo);
    border-radius: 10px;
    padding: 12px;
    text-align: center;
    font-family: var(--textePolice);
}

    .kpi .val {
        font-size: 1.2rem;
        font-weight: 700;
    }

    .kpi.pnl.pos {
        color: #17c964;
    }

    .kpi.pnl.neg {
        color: #f31260;
    }

.equity-card {
    border: 1px solid var(--cyan);
    background: var(--bg);
    border-radius: 10px;
    padding: 10px;
}

.equity-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
    color: var(--fg);
}

.hc {
    min-height: 300px;
}
/* hauteur du graphique */


/* Tabs (ancienne barre d’onglets, au-dessus des matrices) */
.tabs {
    display: flex;
    gap: 10px;
    border-bottom: 1px solid var(--lineColor);
    margin: 16px 0 10px;
}

    .tabs button {
        border: 1px solid var(--color2);
        background: var(--bg);
        border-radius: 10px 10px 0 0;
        padding: 8px 12px;
        color: var(--fg);
    }

        .tabs button.active,
        .tabs button:hover {
            border-color: var(--color1);
        }

#tab-weekly {
    display: block;
}

/* Weekly matrix */
.matrix-wrap {
    overflow: auto;
    border: 1px solid var(--lineColor);
    border-radius: 10px;
    background: var(--backgroundInfo);
}

table.matrix {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

    table.matrix th,
    table.matrix td {
        border-bottom: 1px solid var(--lineColor);
        padding: 8px 10px;
        text-align: center;
    }

    table.matrix .th-left,
    table.matrix #td-left {
        text-align: left;
    }

    table.matrix thead th {
        position: sticky;
        top: 0;
        background: var(--backgroundInfo);
        z-index: 1;
    }

    table.matrix a,
    table.matrix a.sort,
    table.matrix a:hover,
    table.matrix a.sort:hover {
        border-color: transparent;
    }

.cell {
    border-left: 1px solid var(--lineColor);
}

    .cell.pos {
        background: rgba(23,201,100,.12);
    }

    .cell.neg {
        background: rgba(243,18,96,.12);
    }

    .cell a {
        color: inherit;
        text-decoration: none;
        display: block;
    }

.cell-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2px;
    font-size: .85rem;
    line-height: 1.1;
    text-align: left;
}

.cell .label {
    opacity: .7;
    margin-right: 4px;
}

.cell .val.pos {
    color: #17c964;
}

.cell .val.neg {
    color: #f31260;
}

/* Bins WR (0..4 => rouge -> vert) */
.val.wr.bin0 {
    color: #f31260
}

.val.wr.bin1 {
    color: #f67a7a
}

.val.wr.bin2 {
    color: #f9c66a
}

.val.wr.bin3 {
    color: #8bd694
}

.val.wr.bin4 {
    color: #17c964
}

/* Bins DD (0..3 => vert -> rouge) */
.val.dd.bin0 {
    color: #17c964
}

.val.dd.bin1 {
    color: #8bd694
}

.val.dd.bin2 {
    color: #f9c66a
}

.val.dd.bin3 {
    color: #f31260
}

/* Charts grid */
#tab-charts {
    display: none;
}

.charts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0,1fr));
    gap: 16px;
}

/* Mobile / tablette : 1 par ligne */
@media (max-width: 960px) {
    .charts {
        grid-template-columns: 1fr;
    }

    .donut-wrap {
        flex-direction: column;
    }
    /* légende sous le donut en mobile */
}

.chart-card {
    border: 1px solid var(--lineColor);
    border-radius: 10px;
    padding: 10px;
    background: var(--backgroundInfo);
}

    .chart-card #chart-dow,
    .chart-card #chart-hour,
    .chart-card #chart-sym,
    .chart-card #chart-sense {
        height: 320px;
    }

.chart-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

    .chart-head .toggle {
        border: 1px solid var(--color2);
        background: var(--bg);
        border-radius: 8px;
        padding: 6px 10px;
        cursor: pointer;
        color: var(--fg);
    }

        .chart-head .toggle:hover {
            border-color: var(--color1);
        }

.donut-wrap {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.donut-legend {
    min-width: 220px;
    max-height: 360px;
    overflow: auto;
}

    .donut-legend .legend-item {
        display: flex;
        align-items: center;
        gap: .5rem;
        cursor: pointer;
        padding: .25rem .35rem;
        border-radius: .35rem;
    }

        .donut-legend .legend-item:hover {
            background: rgba(255,255,255,.06);
        }

    .donut-legend .swatch {
        width: 12px;
        height: 12px;
        border-radius: 2px;
        background: rgba(255,255,255,.3); /* TESTER SANS / AVEC */
    }

    .donut-legend .percent {
        margin-left: auto;
        opacity: .8;
    }

    .donut-legend .off {
        opacity: .45;
        text-decoration: line-through;
    }

/* 🔹 Onglets “Solde / Rendement” + boutons de période */
.chart-tabs {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 2px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--grid, rgba(255,255,255,0.12));
}

.chart-tab {
    border: none;
    background: transparent;
    color: var(--fg, #eaeaea);
    font-size: 0.875rem;
    padding: 0.35rem 0.9rem;
    border-radius: 999px;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease, transform 0.1s ease;
    white-space: nowrap;
}

    .chart-tab:hover {
        background: rgba(255, 255, 255, 0.06);
        transform: translateY(-1px);
    }

    .chart-tab.is-active {
        background: var(--color1, #ff00ff);
        color: #000;
    }

/* Boutons de période dans les .chart-tabs */
.js-period-btn {
    border-radius: 999px;
    padding: 0.25rem 0.9rem;
    border: 1px solid #f31260; /* rouge (comme --neg) */
    background-color: transparent;
    color: #f31260;
    font-size: 0.85rem;
}

    /* État sélectionné : fond rouge + texte blanc */
    .js-period-btn.active {
        background-color: #f31260;
        color: #ffffff;
    }

/* 🔧 Reset du look natif des boutons sur mobile (iOS / Android) */
.chart-tab,
.js-period-btn,
.head .filters button {
    -webkit-appearance: none;
    appearance: none;
    border-radius: 999px;
}

/* 🔹 Ajustements spécifiques mobile pour les boutons de période */
@media (max-width: 768px) {
    #period-buttons.chart-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
    }

    #period-buttons .chart-tab {
        flex: 0 0 auto;
        min-width: 90px;
        font-size: 0.8rem;
        padding: 0.3rem 0.8rem;
    }
}

.is-hidden {
    display: none !important;
}

.week-label {
    cursor: pointer;
}

/* =============================
   Blazor WASM (routes migrated)
   ============================= */

/* Header "Équity" : titre + onglets sur une même ligne */
.equity-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

.equity-title {
    margin: 0;
}

/* Période (Blazor) : remplace .head .filters */
.period-select {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.period-label {
    font-weight: 700;
    opacity: .9;
}

.period-inputs {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.period-field {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: var(--ctl-h);
    margin: 0;
}

    .period-field span {
        display: inline-flex;
        align-items: center;
        height: 100%;
        line-height: var(--ctl-h);
        margin: 0;
        opacity: .85;
    }

.period-select input[type="date"] {
    height: var(--ctl-h);
    line-height: var(--ctl-h);
}

/* Dans la matrice: Blazor utilise <button> au lieu de <a> */
.cell-btn {
    width: 100%;
    border: 0;
    background: transparent;
    padding: 0;
    color: inherit;
    text-decoration: none;
    display: block;
    cursor: pointer;
    text-align: left;
}

.muted {
    color: var(--footer);
}

.simple-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

    .simple-list li {
        display: flex;
        align-items: baseline;
        justify-content: space-between;
        gap: 12px;
        padding: 6px 0;
        border-bottom: 1px solid var(--lineColor);
    }

.table-wrap {
    overflow: auto;
}

.table.table-sm th,
.table.table-sm td {
    padding: 6px 8px;
}

.text-end {
    text-align: right;
}

/* ====== RESPONSIVE ====== */

/* Tablet */
@media (max-width: 1024px) {
    .kpis {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

/* Small tablet / large phone */
@media (max-width: 768px) {
    .kpis {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .equity-card-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .period-select {
        flex-direction: column;
        align-items: flex-start;
    }

    .matrix-wrap {
        -webkit-overflow-scrolling: touch;
    }

    table.matrix {
        min-width: 600px;
    }
}

/* Phone */
@media (max-width: 480px) {
    .kpis {
        grid-template-columns: 1fr;
    }

    .kpi .val {
        font-size: 1rem;
    }

    .charts {
        grid-template-columns: 1fr;
    }

    .donut-wrap {
        flex-direction: column;
    }

    .donut-legend {
        min-width: unset;
    }

    .chart-tab {
        font-size: 0.8rem;
        padding: 0.3rem 0.7rem;
    }
}