body {
    font-family: Arial, sans-serif;
    background: #f4f4f4;
    text-align: center;
}

table {
    width: 80%;
    margin: 20px auto;
    border-collapse: collapse;
    background: white;
}

th, td {
    border: 1px solid #ccc;
    padding: 10px;
}

th {
    background: #333;
    color: white;
}

.section {
    background: #555;
    color: white;
    font-weight: bold;
}

.subsection {
    background: #ddd;
    font-weight: bold;
}

input {
    width: 80px;
    text-align: center;
}

.total {
    background: #222;
    color: white;
    font-weight: bold;
}

.supprimer {
    margin-left: 10px;
    background: red;
    color: white;
    border: none;
    cursor: pointer;
    padding: 3px 6px;
}

canvas {
    border: 3px solid black;
}

tr {
    transition: all 0.3s ease;
}

tr.nouvelle-ligne {
    opacity: 0;
    transform: scale(0.8) translateY(-10px);
    transition: all 0.3s ease;
}

tr.nouvelle-ligne.visible {
    opacity: 1;
    transform: scale(1) translateY(0);
}

#graphique {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    height: 200px;
    margin-top: 20px;
    border-left: 2px solid white;
    border-bottom: 2px solid white;
    padding: 10px;
}

.barre {
    width: 30px;
    background: red;
    transition: height 0.5s ease;
}

#container {
    display: flex;
}

#axe {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 200px;
    margin-right: 10px;
    color: white;
}

#axe div {
    font-size: 12px;
}

#axe {
    color: white;
    width: 60px;
}

#container {
    display: flex;
    align-items: flex-end;
    gap: 10px;
}

#axe {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 200px;
    color: rgb(14, 13, 13);
    font-size: 12px;
}


/* 📱 RESPONSIVE MOBILE */
@media (max-width: 600px) {

    body {
        padding: 10px;
    }

    h1 {
        font-size: 18px;
        text-align: center;
    }

    table {
        font-size: 12px;
    }

    input {
        width: 70px;
        font-size: 12px;
    }

    button {
        width: 100%;
        margin-top: 10px;
    }

    #container {
        flex-direction: column;
    }

    canvas {
        width: 100% !important;
        height: auto;
    }
}

button {
    background: linear-gradient(135deg, #00c6ff, #0072ff);
    color: white;
    border: none;
    padding: 12px 20px;
    font-size: 14px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

/* ✨ hover */
button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0,0,0,0.3);
}

/* 🔥 clic */
button:active {
    transform: scale(0.95);
}

#ajouter-depense {
    background: linear-gradient(135deg, #00ff9d, #00c853);
}

body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: linear-gradient(135deg, #0f2027, #2d6274, #2c5364);
    color: rgb(27, 27, 27);
}

h1 {
    text-align: center;
    margin-top: 20px;
    font-size: 28px;
    letter-spacing: 1px;
}

table {
    width: 90%;
    margin: 20px auto;
    border-collapse: collapse;
    background: rgba(255,255,255,0.05);
    backdrop-filter: blur(10px);
    border-radius: 10px;
    overflow: hidden;
}

th, td {
    padding: 10px;
    text-align: center;
}

th {
    background: rgba(255,255,255,0.1);
}

tr {
    transition: background 0.2s;
}

tr:hover {
    background: rgba(255,255,255,0.08);
}

input {
    background: rgba(255,255,255,0.1);
    border: none;
    padding: 5px;
    border-radius: 5px;
    color: rgb(245, 233, 233);
    text-align: center;
}

input:focus {
    outline: none;
    background: rgba(255,255,255,0.2);
}

#container {
    width: 90%;
    margin: 20px auto;
}

#alerte-budget {
    width: 90%;
    margin: 10px auto;
    padding: 10px;
    text-align: center;
    font-weight: bold;
    border-radius: 8px;
}

.alert-ok {
    background: #d4edda;
    color: #155724;
}

.alert-warning {
    background: #e0c057;
    color: #2c240b;
}

.alert-danger {
    background: #f8d7da;
    color: #721c24;
}

#alerte-budget {
    transition: all 0.3s ease;
}

.animate-alert {
    animation: pop 0.4s ease;
}

@keyframes pop {
    0% { transform: scale(0.9); opacity: 0; }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); opacity: 1; }
}

@keyframes celebrate {
    0% { transform: scale(1); }
    50% { transform: scale(1.2) rotate(2deg); }
    100% { transform: scale(1); }
}

.celebrate {
    animation: celebrate 0.5s ease;
}

/* Bouton aide */
.btn-aide {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 12px 18px;
    background: black;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
}

/* Bannière cachée */
.banniere-cache {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    justify-content: center;
    align-items: center;
}

/* 🌙 FOND OVERLAY */
.banniere {
    display: none;
    position: fixed;
    top: 0;
    left: 0;

    width: 100%;
    height: 100%;

    background: rgba(0,0,0,0.6);

    justify-content: center;
    align-items: center;

    z-index: 9999;
}

/* 🧾 CONTENU */
.banniere-contenu {
    background: #ffffff;
    color: #222;

    padding: 25px;
    border-radius: 15px;

    width: 90%;
    max-width: 450px;

    max-height: 80vh;
    overflow-y: auto;

    box-shadow: 0 10px 40px rgba(0,0,0,0.3);

    position: relative;

    animation: popup 0.3s ease;
}

/* ✨ ANIMATION */
@keyframes popup {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.contenu {
    background: white;
    padding: 20px;
    border-radius: 10px;
    width: 80%;
    max-width: 400px;
    position: relative;
}

#close-aide {
    position: absolute;
    top: 10px;
    right: 15px;
    cursor: pointer;
}



.banniere-contenu {
    background: white;
    padding: 20px;
    border-radius: 10px;
    width: 80%;
    max-width: 400px;
}

.close-btn {
    cursor: pointer;
    font-size: 20px;
    float: right;
}





.banniere.active {
    display: flex;
    opacity: 1;
    transform: scale(1);
    backdrop-filter: blur(10px);
}

#auth {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;

    background: #111;
    color: white;

    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;

    gap: 10px;
    z-index: 10000;
}

#auth input {
    padding: 10px;
    width: 200px;
}

#auth button {
    padding: 10px 15px;
    cursor: pointer;
}

/* 🔥 FOND GLOBAL */
.auth-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;

    display: flex;
    justify-content: center;
    align-items: center;

    background: linear-gradient(135deg, #141e30, #243b55);
    z-index: 9999;
}

/* 💎 BOX */
.auth-box {
    background: rgb(53, 52, 52);
    padding: 30px;
    border-radius: 15px;
    width: 300px;
    text-align: center;

    box-shadow: 0 10px 30px rgba(211, 202, 202, 0.2);

    animation: fadeIn 0.5s ease;
}

/* ✨ INPUTS */
.auth-box input {
    width: 100%;
    padding: 12px;
    margin: 10px 0;

    border: 1px solid #ccc;
    border-radius: 8px;

    outline: none;
    transition: 0.3s;
}

.auth-box input:focus {
    border-color: #007bff;
    box-shadow: 0 0 5px rgba(0,123,255,0.5);
}

/* 🚀 BOUTONS */
.auth-box button {
    width: 100%;
    padding: 12px;
    margin-top: 10px;

    border: none;
    border-radius: 8px;
    cursor: pointer;

    font-weight: bold;
    transition: 0.3s;
}

/* bouton principal */
#btn-login {
    background: #007bff;
    color: white;
}

#btn-login:hover {
    background: #0056b3;
}

/* bouton secondaire */
.secondary {
    background: #eee;
}

.secondary:hover {
    background: #ddd;
}

/* 📝 MESSAGE */
#auth-msg {
    margin-top: 10px;
    font-size: 14px;
}

/* ✨ ANIMATION */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

body {
    margin: 0;
    padding: 10px;
}

/* rendre les éléments flexibles */
.container {
    width: 100%;
    max-width: 100%;
}

@media (max-width: 768px) {

    body {
        font-size: 14px;
    }

    table {
        font-size: 12px;
    }

    input {
        width: 100%;
        font-size: 14px;
    }

    button {
        width: 100%;
        padding: 10px;
    }
}

table {
    width: 100%;
    display: block;
    overflow-x: auto;
    margin-left: auto;
    margin-right: auto;
}

input {
    border-radius: 8px;
    padding: 8px;
}

button {
    border-radius: 10px;
    background: #00ffcc;
    color: black;
    font-weight: bold;
}

.container {
    width: 100%;
    max-width: 500px;
}

@media (orientation: landscape) {
    .container {
        max-width: 700px;
    }
}

.dashboard {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
  margin: 20px;
}

.card {
  background: white;
  padding: 20px;
  width: 200px;
  border-radius: 15px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
  text-align: center;
  transition: transform 0.2s;
}

.card:hover {
  transform: scale(1.05);
}

.card h3 {
  margin-bottom: 10px;
}

.card p {
  font-size: 20px;
  font-weight: bold;
}



.banniere.active {
    display: flex;
}

.banniere-contenu {
    background: #ffffff;
    color: #222;

    padding: 25px;
    border-radius: 15px;

    width: 90%;
    max-width: 450px;

    box-shadow: 0 10px 40px rgba(0,0,0,0.3);

    animation: popup 0.3s ease;
    position: relative;
}

#close-aide {
    position: absolute;
    top: 12px;
    right: 15px;

    font-size: 20px;
    cursor: pointer;
    font-weight: bold;

    transition: 0.2s;
}

#close-aide:hover {
    color: red;
    transform: scale(1.2);
}

@keyframes popup {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.banniere-contenu h2 {
    margin-bottom: 15px;
}

.banniere-contenu p, 
.banniere-contenu ul {
    text-align: left;
    line-height: 1.5;
}

.banniere-contenu {
    background: white;
    padding: 20px;
    border-radius: 10px;
}

.dashboard .card:nth-child(1) { animation-delay: 0.1s; }
.dashboard .card:nth-child(2) { animation-delay: 0.2s; }
.dashboard .card:nth-child(3) { animation-delay: 0.3s; }
.dashboard .card:nth-child(4) { animation-delay: 0.4s; }

.card {
    background: linear-gradient(135deg, #1e3c72, #2a5298);
    color: white;

    padding: 20px;
    border-radius: 15px;

    text-align: center;

    box-shadow: 0 8px 20px rgba(0,0,0,0.3);

    transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
    transform: translateY(-8px) scale(1.03);
    box-shadow: 0 15px 30px rgba(0,0,0,0.4);
}

.card h3 {
    margin-bottom: 10px;
    font-size: 16px;
    opacity: 0.9;
}

.card p {
    font-size: 22px;
    font-weight: bold;
}

#totalDepense {
    color: #ff6b6b;
}

#totalPrevu {
    color: #ffd93d;
}

#ecart {
    color: #00ffcc;
}

#objectif {
    color: #4dabf7;
}

.ligne-animation {
    opacity: 0;
    transform: translateY(-15px);
}

.ligne-animation.visible {
    opacity: 1;
    transform: translateY(0);
    transition: all 0.4s ease;
}

.ligne-suppression {
    opacity: 1;
    transform: translateY(0);
    transition: all 0.4s ease;
}

.ligne-suppression.active {
    opacity: 0;
    transform: translateY(-20px);
}

@keyframes fadeSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.card {
    animation: fadeSlideIn 0.5s ease forwards;
    opacity: 0;
}

/* ✅ FIX INPUT REVENUS */
input {
    color: black; /* rend le texte visible */
    background: white; /* fond clair lisible */
    width: 100px; /* taille stable */
    text-align: center;
}

/* 🔥 animation changement de mois */
.fade-out {
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
}

.fade-in {
    opacity: 1;
    transform: translateY(0);
    transition: all 0.3s ease;
}

.dashboard {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    width: 95%;
    max-width: 1200px;
    margin: 20px auto;
}

.card {
    flex: 1;
    min-width: 200px;
    padding: 15px;
    border: 1px solid #ccc;
    border-radius: 10px;
}

.card h3 {
    margin: 0;
    font-size: 14px;
}

.card p {
    margin-top: 10px;
    font-size: 22px;
    font-weight: bold;
}

.card {
    transition: transform 0.2s ease;
}

.card:hover {
    transform: translateY(-3px);
}

.dashboard {
    justify-content: space-between;
}

@media (max-width: 768px) {
    body {
        font-size: 14px;
    }
}

.table-container {
    overflow-x: auto;
}

input {
    width: 100%;
    max-width: 120px;
    font-size: 16px;
}

@media (max-width: 768px) {
    .dashboard {
        flex-direction: column;
    }

    .card {
        width: 100%;
    }
}

td {
    padding: 8px;
}

th {
    padding: 10px;
}

.card, table {
    border-radius: 10px;
}

#budget-body {
    transition: transform 0.4s ease, opacity 0.4s ease;
}

.slide-out-left {
    transform: translateX(-20px);
    opacity: 0;
}

.slide-in-right {
    transform: translateX(20px);
    opacity: 0;
}

.container {
    display: flex;
    justify-content: center; /* centre horizontalement */
    align-items: center;     /* centre verticalement */
}

/* Bannière scrollable */


.aide {
    font-size: 15px;
    color: #333;
}

.aide b {
    color: #007bff;
}

.aide span {
    display: block;
    margin-top: 10px;
}

@media (max-width: 600px) {
    .banniere {
        width: 95%;
        height: 450px;
        padding: 15px;
    }

    .aide {
        font-size: 14px;
    }
}


/* ✅ FIX POSITIONNEMENT BANNIÈRE */
.banniere {
    display: flex;
    justify-content: center;
    align-items: center;
}

/* ✅ CONTENU BIEN CENTRÉ + RESPONSIVE */
.banniere-contenu {
    max-height: 80vh;
    overflow-y: auto;
}

@media (max-width: 600px) {
    .banniere {
        align-items: flex-start;
        padding-top: 20px;
    }

    .banniere-contenu {
        width: 95%;
        max-height: 85vh;
    }
}

@media (max-width: 600px) {

    .banniere {
        align-items: flex-start;
        padding-top: 20px;
    }

    .banniere-contenu {
        width: 95%;
        max-height: 85vh;
        padding: 20px;
    }
}

.aide {
    font-size: 15px;
    line-height: 1.6;
}

.aide span {
    display: block;
    margin-top: 10px;
}