:root {
    /* Rouge (accent principal) */
    --rz-primary: #e11d48;
    --rz-primary-light: #f43f5e;
    --rz-primary-lighter: #fb7185;
    --rz-primary-dark: #be123c;
    --rz-primary-darker: #9f1239;
    --rz-on-primary: #ffffff;
    --rz-on-primary-light: #1c1917;
    --rz-on-primary-lighter: #1c1917;
    --rz-on-primary-dark: #ffffff;
    --rz-on-primary-darker: #ffffff;
    /* Noir / anthracite (accent secondaire) */
    --rz-secondary: #18181b;
    --rz-secondary-light: #27272a;
    --rz-secondary-lighter: #3f3f46;
    --rz-secondary-dark: #09090b;
    --rz-secondary-darker: #000000;
    --rz-on-secondary: #ffffff;
    --rz-on-secondary-light: #ffffff;
    --rz-on-secondary-lighter: #ffffff;
    --rz-on-secondary-dark: #ffffff;
    --rz-on-secondary-darker: #ffffff;
    /* Trois paliers de noir bien distincts */
    --rz-base-900: #08080a;
    --rz-base-800: #19191c;
    --rz-base-700: #252529;
    --rz-base-600: #323236;
    --rz-base-dark: #19191c;
    --rz-base-darker: #000000;
    /* Header / sidebar */
    --rz-header-background-color: #140206;
    --rz-header-color: #ffffff;
    --rz-sidebar-background-color: var(--rz-base-800);
    --rz-sidebar-border-inline-end: 1px solid var(--rz-primary-darker);
    /* Menu latéral aligné sur le rouge plutôt que le bleu par défaut */
    --rz-panel-menu-item-active-indicator: var(--rz-primary);
    --rz-panel-menu-item-active-background-color: var(--rz-primary);
    --rz-panel-menu-item-active-color: var(--rz-on-primary);
    --rz-panel-menu-item-hover-background-color: var(--rz-base-700);
    --rz-panel-menu-item-background-color: transparent;
    --rz-panel-menu-item-border-radius: 8px;
    --rz-panel-menu-item-margin-inline: 0.75rem;
    --rz-panel-menu-item-margin-block: 0.125rem;
    /* Arrondis plus doux dans toute l'appli */
    --rz-border-radius: 10px;
}

body {
    background-color: var(--rz-base-900);
    background-image: radial-gradient(circle at 100% 0%, rgba(225, 29, 72, 0.08), transparent 45%);
    background-attachment: fixed;
}

/* En-tête */
.rz-header {
    background: linear-gradient(120deg, #5c0a1e 0%, #2a0510 35%, #0c0205 70%, #000000 100%);
    border-bottom: 2px solid var(--rz-primary);
    box-shadow: 0 2px 20px rgba(225, 29, 72, 0.3);
    min-height: 4rem;
}

.header-bar {
    height: 100%;
}

.rz-header .rz-text-h6 {
    font-weight: 800;
    letter-spacing: 0.03em;
}

.brand-icon {
    width: 2.5rem;
    height: 2.5rem;
    min-width: 2.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.22);
    color: #ffffff;
    box-shadow: 0 0 0 4px rgba(225, 29, 72, 0.15);
}

.header-user {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.3rem 1rem 0.3rem 0.3rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: #ffffff;
    text-decoration: none;
    font-size: 0.875rem;
    transition: background-color 0.15s ease, transform 0.15s ease;
}

    .header-user:hover {
        background: rgba(255, 255, 255, 0.14);
        transform: translateY(-1px);
    }

.header-avatar {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background: var(--rz-primary);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
}

/* Barre latérale */
.rz-sidebar {
    box-shadow: 2px 0 16px rgba(0, 0, 0, 0.5);
    padding-block-start: 0.75rem;
}

.rz-navigation-item-wrapper {
    transition: background-color 0.15s ease, transform 0.15s ease;
}

    .rz-navigation-item-wrapper:hover {
        transform: translateX(2px);
    }

.rz-navigation-item-wrapper-active .rz-navigation-item-icon,
.rz-navigation-item-wrapper-active .rz-navigation-item-link {
    color: var(--rz-on-primary) !important;
}

.rz-navigation-item-wrapper-active {
    box-shadow: 0 4px 12px rgba(225, 29, 72, 0.4);
}

/* Sous-items du groupe "Finances" dans le menu : legere indentation pour marquer
   le regroupement visuel (Comptes / Categories sous un meme parent) */
.rz-navigation-item-wrapper .rz-navigation-item-wrapper {
    margin-inline-start: 0.75rem;
}

/* Cartes en relief, avec un liseré rouge en accent */
.rz-card {
    background-color: var(--rz-base-800);
    border: 1px solid var(--rz-base-700);
    border-top: 3px solid var(--rz-primary);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

    .rz-card:hover {
        transform: translateY(-2px);
        box-shadow: 0 8px 28px rgba(0, 0, 0, 0.6);
    }

/* Boutons : léger effet de survol */
.rz-button.rz-variant-filled.rz-primary {
    box-shadow: 0 2px 10px rgba(225, 29, 72, 0.35);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

    .rz-button.rz-variant-filled.rz-primary:hover {
        transform: translateY(-1px);
        box-shadow: 0 4px 16px rgba(225, 29, 72, 0.5);
    }

/* Zone de contenu principale : largeur de lecture confortable */
.rz-body > .rz-p-4 {
    max-width: 1200px;
    margin: 0 auto;
}

/* Cartes indicateurs (page d'accueil) */
.stat-card .rz-card {
    border-top: 3px solid var(--rz-primary);
}

.stat-icon {
    width: 3rem;
    height: 3rem;
    min-width: 3rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--rz-primary);
    color: var(--rz-on-primary);
}

    .stat-icon .rzi {
        font-size: 1.5rem;
    }

.stat-icon-positive {
    background: #16a34a;
}

.stat-icon-negative {
    background: var(--rz-primary);
}

.stat-label {
    color: var(--rz-base-400);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.75rem;
}

.page-subtitle {
    color: var(--rz-base-400);
}

/* Liste des comptes sur le tableau de bord */
.account-row {
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--rz-base-700);
}

    .account-row:last-child {
        border-bottom: none;
    }

.account-type {
    color: var(--rz-base-400);
}

/* Scrollbar plus discrète, cohérente avec le thème sombre */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--rz-base-900);
}

::-webkit-scrollbar-thumb {
    background: var(--rz-base-700);
    border-radius: 8px;
}

    ::-webkit-scrollbar-thumb:hover {
        background: var(--rz-primary-darker);
    }

/* --- Responsive mobile (telephone, type iPhone ~390-430px de large) --- */
@media (max-width: 768px) {
    /* Moins de marge autour du contenu : chaque pixel compte sur petit ecran */
    .rz-body > .rz-p-4 {
        max-width: 100%;
        padding: 0.75rem !important;
    }

    .header-bar {
        padding-inline: 0.5rem !important;
    }

    /* Le nom "FinanceApp" prend de la place inutilement a cote du bouton menu + de l'icone */
    .brand-title {
        display: none;
    }

    .brand-icon {
        width: 2.1rem;
        height: 2.1rem;
        min-width: 2.1rem;
    }

    /* Email/nom masque dans le badge utilisateur du header, l'avatar seul suffit sur petit ecran */
    .header-user span {
        display: none;
    }

    .header-user {
        padding: 0.3rem;
    }

    /* Les deux cartes Revenus/Depenses et les cartes de compte respirent moins en largeur */
    .stat-icon {
        width: 2.5rem;
        height: 2.5rem;
        min-width: 2.5rem;
    }

    .account-row {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
}
