:root {
    --bg: #303030;
    --bg-card: #3A3A3A;
    --accent: #ED7F10;
    --text: #FFFFFF;
    --text-muted: #B5B5B5;
    --radius: 14px;
    --shadow: 0 8px 20px rgba(0,0,0,0.4);
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: "Inter", sans-serif;
    display: flex;
}

/* SIDEBAR */

.sidebar {
    width: 240px;
    background: #262626;
    padding: 30px 20px;
    display: flex;
    flex-direction: column;
    gap: 40px;
    box-shadow: var(--shadow);
    transition: width 0.3s ease;
    position: relative;
}

.sidebar.collapsed {
    width: 80px;
}

.logo {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--accent);
    text-align: center;
    transition: opacity 0.3s;
}

.sidebar.collapsed .logo {
    opacity: 0;
}

.toggle-btn {
    position: absolute;
    top: 20px;
    right: -15px;
    background: var(--accent);
    border: none;
    color: #111;
    padding: 6px 10px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
}

.sidebar nav {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.sidebar nav a {
    color: var(--text-muted);
    text-decoration: none;
    padding: 10px 14px;
    border-radius: 8px;
    transition: 0.2s;
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar nav a:hover {
    background: rgba(255,255,255,0.08);
    color: var(--text);
}

.sidebar nav .icon {
    font-size: 1.4rem;
}

.sidebar nav .label {
    transition: opacity 0.3s;
}

.sidebar.collapsed nav .label {
    opacity: 0;
    width: 0;
    overflow: hidden;
}

/* DASHBOARD GRID */

.dashboard {
    flex: 1;
    padding: 40px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-auto-rows: 180px;
    gap: 25px;
}

/* TAILLES DES CARTES */

.card-small {
    grid-row: span 1;
}

.card-medium {
    grid-row: span 1;
}

.card-large {
    grid-row: span 2;
    grid-column: span 2;
}

/* CARTES GÉNÉRALES */

.card {
    background: var(--bg-card);
    padding: 20px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    position: relative;
    gap: 10px;
}

.card h2 {
    margin: 0 0 10px 0;
    font-size: 1.4rem;
    color: var(--accent);
}

/* BOUTON + EN BAS À DROITE */

.add-btn {
    background: var(--accent);
    border: none;
    color: #111;
    font-size: 1.4rem;
    padding: 8px 14px;
    border-radius: 8px;
    cursor: pointer;
    position: absolute;
    bottom: 15px;
    right: 15px;
}

/* BUDGET */

.budget-charts {
    display: flex;
    justify-content: center;      /* centre horizontalement */
    align-items: center;          /* centre verticalement */
    gap: 40px;                    /* espace entre les deux anneaux */
    height: 150px;                /* réserve un espace propre */
}

.circle {
    width: 85px;
    height: 85px;
    border-radius: 50%;
    background: #2A2A2A;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    border: 3px solid var(--accent);
    font-size: 0.8rem;
}

.budget-info p {
    margin: 4px 0;
    color: var(--text-muted);
}

.progress-bar {
    width: 100%;
    height: 10px;
    background: #222;
    border-radius: 6px;
    margin-top: 10px;
}

#progress-fill {
    height: 100%;
    background: var(--accent);
    width: 0%;
    border-radius: 6px;
}

/* DERNIERS LIVRES */

.book-row {
    display: flex;
    gap: 15px;
}

.book-row img {
    width: 70px;
    height: 100px;
    object-fit: cover;
    border-radius: 10px;
}

/* DERNIÈRES CRITIQUES */

#last-review-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

#last-review-list li {
    margin-bottom: 6px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* SPORT */

.hexagon-chart {
    width: 100%;
    height: 120px;
    background: #2A2A2A;
    border-radius: var(--radius);
    margin-bottom: 10px;
}

.sport-stats p {
    margin: 4px 0;
    color: var(--text-muted);
}

/* ===========================
   RESPONSIVE DESIGN
=========================== */

/* TABLETTE — 2 colonnes */
@media (max-width: 1200px) {
    .dashboard {
        grid-template-columns: repeat(2, 1fr);
        grid-auto-rows: 200px;
    }

    .card-large {
        grid-column: span 2;
        grid-row: span 2;
    }
}

/* MOBILE LARGE — 1 colonne */
@media (max-width: 800px) {
    .dashboard {
        grid-template-columns: 1fr;
        grid-auto-rows: auto;
    }

    .card,
    .card-large,
    .card-medium,
    .card-small {
        grid-column: span 1;
        grid-row: auto;
    }

    /* Le menu se replie automatiquement */
    .sidebar {
        width: 80px;
    }

    .sidebar .label,
    .sidebar .logo {
        opacity: 0;
        width: 0;
    }
}

/* MOBILE PETIT — optimisation */
@media (max-width: 500px) {
    .dashboard {
        padding: 20px;
        gap: 15px;
    }

    .add-btn {
        bottom: 10px;
        right: 10px;
    }

    .book-row img {
        width: 60px;
        height: 85px;
    }
}
