
body {
    background-color:  #f6f4f1;
}


/* =========================================================
   RESET & BASE
   ========================================================= */
* {
    box border-bottom: 1px solid #e0e0e0;    box-sizing: border-box;
}

.nav-toggle {
    display: block;
    font-size: 1.6rem;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.75rem 1rem;
}

.nav-links {
    list-style: none;
    display: none;
    flex-direction: column;
}

.nav-links.open {
    display: flex;
}

.nav-links li {
    border-top: 1px solid #f0f0f0;
}

.nav-links a {
    display: block;
    padding: 0.75rem 1rem;
    color: #333;
}

.nav-links a:hover {
    background: #f6f7f8;
}

.admin-link a { font-weight: 600; }
.logout a { color: #c0392b; }

/* ---- DESKTOP ---- */
@media (min-width: 768px) {
    .nav-toggle { display: none; }

    .nav-links {
        display: flex;
        flex-direction: row;
        justify-content: center;
        gap: 1.25rem;
    }

    .nav-links li { border: none; }
}

/* =========================================================
   BOUTONS
   ========================================================= */
button, .btn {
    padding: 0.6rem 1.2rem;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-weight: 500;
}

.btn-primary {
    background-color: #2ecc71;
    color: #fff;
}

.btn-secondary {
    background-color: #3498db;
    color: #fff;
}

/* =========================================================
   CARTES / ALERTES
   ========================================================= */
.card {
    background: #faf9f7;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 6px 14px rgba(0,0,0,0.06);
}


.dashboard-details {
    margin-top: 2rem;
}

.alert-info {
    background: #f0f6fa;
    border-left: 5px solid #3498db;
    padding: 0.8rem;
    border-radius: 8px;
}

.alert-warning {
    background: #fff3e0;
    border-left: 5px solid #e67e22;
    padding: 0.8rem;
    border-radius: 8px;
}

.alert-success {
    background: #e6f7ee;
    border-left: 5px solid #2ecc71;
    padding: 0.8rem;
    border-radius: 8px;
}

/* =========================================================
   DASHBOARD
   ========================================================= */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.score-card {
    text-align: center;
}

.score-value {
    font-size: 3rem;
    font-weight: bold;
}

.score-A { color: #27ae60; }
.score-B { color: #f1c40f; }
.score-C { color: #e74c3c; }

/* Tendances */
.trend-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.trend-item {
    background: #f6f7f8;
    border-radius: 8px;
    padding: 0.8rem;
    text-align: center;
    border-left: 4px solid #95a5a6;
}

.trend-item.up    { border-left-color: #27ae60; }
.trend-item.down  { border-left-color: #e74c3c; }
.trend-item.stable{ border-left-color: #95a5a6; }

.trend-label { font-weight: 600; }
.trend-icon  { font-size: 1.6rem; }
.trend-text  { font-size: 0.85rem; color: #555; }

/* =========================================================
   TRANSACTIONS
   ========================================================= */
.month-balance {
    margin: 1.5rem 0;
    padding: 1rem;
    text-align: center;
    border-radius: 12px;
}

.month-balance.positive {
    background: #e6f7ee;
    color: #2e8b57;
}

.month-balance.negative {
    background: #fdecea;
    color: #c0392b;
}

.tx-block {
    margin-top: 2rem;
    padding: 1rem;
    border-radius: 14px;
}

.tx-block.income {
    background: #e6f7ee;
    border-left: 6px solid #2ecc71;
}

.tx-block.fixed {
    background: #eaf4fb;
    border-left: 6px solid #3498db;
}

.tx-block.variable {
    background: #f0f6fa;
    border-left: 6px solid #5dade2;
}

.tx-card {
    background: #fff;
    padding: 0.9rem 1rem;
    border-radius: 10px;
    margin-bottom: 0.8rem;
}

/* =========================================================
   CHAT – HARMONISATION AVEC LE THÈME SABLE
   ========================================================= */

/* Message standard */

.chat-box {
    margin-top: 1.5rem;
}

.chat-message {
    background: #ffffff; /* bien contrasté sur sable */
    border-radius: 10px;
    padding: 0.7rem 0.9rem;
    margin-bottom: 1rem; /* espace entre chaque message */
    box-shadow: 0 2px 6px rgba(0,0,0,0.04);
}

/* Message de l'utilisateur connecté */
.chat-message.mine {
    background: #f5f8fc; /* léger bleu très doux */
    border-left: 4px solid #6ba4d9;
}

/* Message du modérateur */
.chat-message.moderator {
    background: #fff7ee; /* beige chaud */
    border-left: 4px solid #e67e22;
}

/* En-tête du message */
.chat-header {
    font-size: 0.8rem;
    margin-bottom: 0.4rem;
    display: flex;
    justify-content: space-between;
}

.chat-author {
    font-weight: 600;
    color: #3e3a35;
}

.chat-date {
    color: #777;
}

/* Contenu */
.chat-content {
    font-size: 0.95rem;
    color: #2c2a27;
}

/* =========================================================
   FORMULAIRE CHAT — CORRECTION CHROME & MOBILE
   ========================================================= */

.chat-form {
    display: flex;
    flex-direction: column;
    gap: 0.8rem; /* espace propre entre textarea et bouton */
}

.chat-form textarea {
    width: 100%;
    display: block;
    resize: vertical;
}

.chat-form button {
    align-self: flex-end; /* bouton à droite (pro) */
}

@media (max-width: 480px) {
    .chat-form button {
        width: 100%;
        align-self: stretch;
    }
}

/* =========================================================
   AUTH (LOGIN / REGISTER)
   ========================================================= */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 80vh;
}

.auth-card {
    max-width: 420px;
    background: #fff;
    padding: 2rem;
    border-radius: 14px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

/* =========================================================
   LOGIN / REGISTER — CORRECTION CHROME & MOBILE
   ========================================================= */

.auth-card form {
    display: block;
}

.auth-card form label {
    display: block;
    margin-top: 1rem;
    font-weight: 500;
}

.auth-card form input,
.auth-card form select,
.auth-card form textarea {
    display: block;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    margin-top: 0.4rem;
}

@media (max-width: 480px) {
    .auth-card {
        padding: 1.5rem;
    }

    .auth-card form input {
        font-size: 1rem;
    }
}

/* Espacement bouton login / register */
.auth-card button {
    margin-top: 1.5rem;
}

/* =========================================================
   FOOTER
   ========================================================= */
footer {
    margin-top: 4rem;
    text-align: center;
    color: #777;
    font-size: 0.9rem;
}
    margin: 0;
    padding: 0;
}

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: #626364;
    color: #222;
    line-height: 1.6;
}

a {
    color: inherit;
    text-decoration: none;
}

/* =========================================================
   LAYOUT
   ========================================================= */
.container {
    max-width: 960px;
    margin: 0 auto;
    padding: 1.5rem;
}

/* =========================================================
   NAVIGATION (MOBILE FIRST)
   ========================================================= */
.main-nav {
    background-color: #f0ede8; /* sable légèrement plus marqué */
    box-shadow: 0 2px 6px rgba(0,0,0,0.04);
}

/* =========================================================
   RÉSUMÉ REVENUS / DÉPENSES — TRANSACTIONS
   ========================================================= */

.dashboard-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.dashboard-cards .card {
    text-align: center;
}

.amount {
    font-size: 1.6rem;
    font-weight: bold;
    margin-top: 0.3rem;
}

.amount.positive {
    color: #2ecc71; /* vert revenus */
}

.amount.negative {
    color: #e74c3c; /* rouge dépenses */
}

/* =========================================================
   FORÇAGE LAYOUT REVENUS / DÉPENSES — DESKTOP
   ========================================================= */

/* Mobile : empilé (par défaut) */
.dashboard-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

/* Desktop : côte à côte */
@media (min-width: 768px) {
    .dashboard-cards {
        grid-template-columns: 1fr 1fr;
        align-items: stretch;
    }
}

/* Le container ne doit PAS avoir de fond */
.container {
    background: transparent !important;
}

html {
    background-color: transparent;
}

/* =========================================================
   FORMULAIRES – CORRECTION CHROME / MOBILE (GLOBAL)
   ========================================================= */

form {
    display: block;
}

form label {
    display: block;
    margin-top: 1rem;
    font-weight: 500;
}

form input,
form select,
form textarea {
    display: block;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    margin-top: 0.4rem;
}

form textarea {
    resize: vertical;
}

form button {
    margin-top: 1.5rem;
}

/* =========================================================
   FORMULAIRES – LARGEUR CONFORTABLE SUR DESKTOP
   ========================================================= */

@media (min-width: 768px) {
    form input,
    form select,
    form textarea {
        max-width: 420px; /* largeur confortable */
    }
}

@media (min-width: 768px) {
    .tx-form,
    .auth-card form,
    .chat-form {
        align-items: flex-start;
    }
}

/* =========================================================
   FORMULAIRES – ADD TRANSACTIONS
   ========================================================= */

/* Mobile : empilé */
.form-row {
    display: block;
}

/* Desktop : aligné */
@media (min-width: 768px) {
    .form-row {
        display: flex;
        gap: 1rem;
        align-items: flex-end;
    }

    .form-row .field {
        display: flex;
        flex-direction: column;
    }

    .form-row input[type="date"] {
        max-width: 180px;
    }

    .form-row input[type="number"] {
        max-width: 160px;
    }
}

@media (min-width: 768px) {
    .fieldc select {
        max-width: 160px;
    }
}

/* =========================================================
   TITRES FORMULAIRES ADD TRANSACTION
   ========================================================= */

.form-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #3e3a35;
}

/* Variantes légères par type */
.form-title.revenue {
    border-left: 4px solid #2ecc71;
    padding-left: 0.6rem;
}

.form-title.fixed {
    border-left: 4px solid #3498db;
    padding-left: 0.6rem;
}

.form-title.variable {
    border-left: 4px solid #e67e22;
    padding-left: 0.6rem;
}

/* =========================================================
   SÉLECTEUR DE MOIS – TRANSACTIONS
   ========================================================= */

/* Mobile : empilé */
.month-field {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

/* Desktop : aligné et réduit */
@media (min-width: 768px) {
    .month-field {
        flex-direction: row;
        align-items: flex-end;
        gap: 0.6rem;
    }

    .month-field input[type="month"] {
        max-width: 180px;
    }

    .month-field button {
        padding: 0.45rem 0.9rem;
    }
}

.hero {
    margin: 3rem 0;
}

.hero h1 {
    font-size: 2.2rem;
    line-height: 1.25;
    margin-bottom: 1rem;
}

.hero .subtitle {
    font-size: 1.05rem;
    color: #5a5650;
    max-width: 620px;
}

.features {
    margin-top: 4rem;
    display: grid;
    gap: 1.5rem;
}

.features-compact {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.feature {
    background: #ffffff;
    padding: 1.4rem;
    border-radius: 14px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

.cta {
    margin-top: 2rem;
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* =========================================================
   PAYPAL – CENTRAGE ET REDIMENSIONNEMENT
   ========================================================= */

.paypal-wrapper {
    display: flex;
    justify-content: center;
    margin-top: 1.2rem;
}

/* Cible l’image PayPal */
.paypal-wrapper img,
.paypal-wrapper input[type="image"] {
    max-width: 160px;   /* taille raisonnable */
    height: auto;
}


.contact-form {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    margin-top: 1rem;
}

.contact-form textarea {
    max-width: 520px;
}

.contact-form button {
    align-self: flex-start;
}

.helper-text {
    font-size: 0.85rem;
    color: #6a665f;
}

input[readonly] {
    background-color: #f9f7f4;
    border: none;
    padding-left: 0;
    font-weight: 500;
    color: #3e3a35;
}

.site-footer {
    margin-top: 4rem;
    padding: 1.2rem 0;
    text-align: center;
    font-size: 0.85rem;
    color: #6a665f;
}

.footer-info {
    margin: 0;
}

/* =========================================================
   RESEAUX
   ========================================================= */


.social-btn {
    display: inline-block;
    padding: 10px 18px;
    border-radius: 8px;
    background: #1877f2;
    color: #fff;
    font-weight: 600;
}

.social-btn:hover {
    opacity: 0.9;
}