*{margin: 0;
    padding: 0;
    box-sizing: border-box;
font-family: 'Arial', sans-serif;
}

body{
     background-color: #0d0d0d;
     color: #fff;
     display: block;
     padding: 20px;
     min-height: 100vh;
}

main {
    max-width: 1200px;
    margin: 0 auto;
}

h1 {
    color: #00ffff;
    text-align: center;
    margin-bottom: 10px;
}

h2 {
    color: #00ffff;
    font-size: 1.2rem;
    margin: 15px 0;
}

nav {
    text-align: right;
    margin-bottom: 20px;
}

nav a {
    color: #00ffff;
    text-decoration: none;
    transition: 0.2s;
}

nav a:hover {
    color: #00ff80;
}

form {
    background: rgba(255, 255, 255, 0.05);
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}

form label {
    color: #00ffff;
    font-weight: bold;
}

form select,
form button[type="submit"] {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(0, 255, 255, 0.3);
    color: #fff;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    transition: 0.2s;
}

form select {
    background-color: #1a1a1a;
    background-image: linear-gradient(#1a1a1a, #1a1a1a);
}

/* Style des options du select */
form select option {
    background-color: #1a1a1a;
    color: #fff;
    padding: 8px;
}

form select option:hover {
    background: rgba(0, 255, 255, 0.3);
}

form select option:checked {
    background: rgba(0, 255, 255, 0.5);
    color: #fff;
}

form select:hover,
form button[type="submit"]:hover {
    background: rgba(0, 255, 255, 0.2);
    border-color: #00ffff;
}

form button[type="submit"] {
    background: linear-gradient(90deg, #00ffff, #00ff80);
    color: #000;
    font-weight: bold;
    border: none;
}

form button[type="submit"]:hover {
    background: linear-gradient(90deg, #00ff80, #00ffff);
}

.selected-month {
    display: block;
    color: #00ffff;
    font-weight: bold;
    margin: 10px 0;
    font-size: 1.1rem;
}

.form-container{
    background-color: rgba(255, 255, 255, 0.1);
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.3);
    width: 320px;
    text-align: center;
}
h2{
    color: #fff;
    margin-bottom: 20px;
}

.input-box{
    position: relative;
    margin: 20px 0;

}

.input-box input{
    width: 100%;
    padding: 12px 15px;
    background: none;
    border: none;
    outline: none;
    color: #fff;
    font-size: 18px;
    border-bottom: 2px solid rgba(255,255,255,0.5);
    transition: 0.4;
}

.input-box input:focus{
    border-bottom-color: #00ffff;
    box-shadow: 0 5px 15px rgba(0, 255, 255, 0.3);
}

.input-box span{
    position: absolute;
    top: 50%;
    left: 15px;
    color: rgba(255,255,255,0.5);
    pointer-events: none;
    transition: 0.4s;
    transform: translateY(-50%);
}

.input-box input:focus + span,
.input-box input:not(:placeholder-shown) + span{
    top : 5px;
    font-size: 12px;
    color: #00ffff;
}

.submit-btn{
    background: linear-gradient(90deg,#00ffff, #00ff80);
    border: none;
    padding: 12px 30px;
    border-radius: 25px;
    color: #000;
    font-weight: bold;
    cursor: pointer;
    transition: 0.4s;
    margin-top: 10px;
}

.submit-btn:hover{
    background: linear-gradient(90deg,#00ff80, #00ffff);
    box-shadow: 0 5px 15px #00ffff80;
}

/* Modal Styles - Adapted from Portfolio */
.sr-only {
    clip: rect(0,0,0,0);
    clip-path: inset(50%);
    height: 1px;
    overflow: hidden;
    position: absolute;
    white-space: nowrap;
    width: 1px;
}

.modal-wrapper {
    background-color: rgba(0, 0, 0, 0.75);
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    height: 100vh;
    width: 100%;
    display: none;
    justify-content: center;
    align-items: center;
}

.modal-wrapper > div {
    background: rgba(13, 13, 13, 0.85);
    backdrop-filter: blur(14px);
    border: 1px solid rgba(0, 255, 255, 0.3);
    color: #fff;
    border-radius: 22px;
    padding: 40px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}

.modal-wrapper.modal-show {
    display: flex;
}

.ajout-transaction-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.ajout-transaction-form h2 {
    color: #00ffff;
    text-align: center;
    margin: 0 0 20px 0;
    font-size: 1.5rem;
}

.ajout-transaction-form label {
    color: #00ffff;
    font-weight: bold;
    margin-bottom: 5px;
    display: block;
}

.ajout-transaction-form input[type="text"],
.ajout-transaction-form input[type="month"],
.ajout-transaction-form input[type="number"],
.ajout-transaction-form select,
.ajout-transaction-form textarea {
    background: none;
    border: none;
    border-bottom: 2px solid rgba(255, 255, 255, 0.5);
    color: #fff;
    padding: 10px 0;
    font-size: 14px;
    transition: 0.3s;
    font-family: Arial, sans-serif;
}

.ajout-transaction-form select {
    background-color: transparent;
    background-image: none;
}

.ajout-transaction-form select option {
    background-color: #1a1a1a;
    color: #fff;
    padding: 8px;
}

.ajout-transaction-form select option:hover {
    background: rgba(0, 255, 255, 0.3);
}

.ajout-transaction-form select option:checked {
    background: rgba(0, 255, 255, 0.5);
    color: #fff;
}

.ajout-transaction-form input[type="text"]::placeholder,
.ajout-transaction-form textarea::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.ajout-transaction-form input[type="text"]:focus,
.ajout-transaction-form input[type="month"]:focus,
.ajout-transaction-form input[type="number"]:focus,
.ajout-transaction-form select:focus,
.ajout-transaction-form textarea:focus {
    border-bottom-color: #00ffff;
    box-shadow: 0 2px 10px rgba(0, 255, 255, 0.3);
    outline: none;
}

.ajout-transaction-form input[type="checkbox"] {
    margin-right: 8px;
    cursor: pointer;
    width: 18px;
    height: 18px;
}

.ajout-transaction-form label:has(input[type="checkbox"]) {
    display: flex;
    align-items: center;
    margin-bottom: 0;
    color: #fff;
}

.modal-button-open,
.modal-button-submit,
.modal-button-close {
    background: linear-gradient(90deg, #00ffff, #00ff80);
    border: none;
    padding: 12px 30px;
    border-radius: 25px;
    color: #000;
    font-weight: bold;
    cursor: pointer;
    transition: 0.4s;
    margin-top: 15px;
    font-size: 14px;
}

.modal-button-open:hover,
.modal-button-submit:hover,
.modal-button-close:hover {
    background: linear-gradient(90deg, #00ff80, #00ffff);
    box-shadow: 0 5px 15px rgba(0, 255, 255, 0.4);
    transform: translateY(-2px);
}

.modal-button-open:active,
.modal-button-submit:active,
.modal-button-close:active {
    transform: translateY(0);
}

.modal-button-close {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.modal-button-close:hover {
    background: rgba(255, 255, 255, 0.2);
    box-shadow: 0 2px 10px rgba(255, 255, 255, 0.1);
}

/* Messages de succès et erreur */
.message-success,
.message-error {
    padding: 15px 20px;
    margin: 15px 0;
    border-radius: 8px;
    font-weight: bold;
    text-align: center;
    animation: slideIn 0.4s ease-out;
}

.message-success {
    background: rgba(0, 255, 0, 0.15);
    border: 1px solid rgba(0, 255, 0, 0.5);
    color: #00ff80;
}

.message-error {
    background: rgba(255, 0, 0, 0.15);
    border: 1px solid rgba(255, 0, 0, 0.5);
    color: #ff4444;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Style pour le champ nombre de mois */
#nb_mois {
    background: none;
    border: none;
    border-bottom: 2px solid rgba(255, 255, 255, 0.5);
    color: #fff;
    padding: 5px;
    font-size: 14px;
    transition: 0.3s;
}

#nb_mois:focus {
    border-bottom-color: #00ffff;
    box-shadow: 0 2px 10px rgba(0, 255, 255, 0.3);
    outline: none;
}

/* Styles pour le tableau */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

thead {
    background: linear-gradient(90deg, rgba(0, 255, 255, 0.2), rgba(0, 255, 128, 0.2));
}

th {
    padding: 3px 8px;
    text-align: left;
    color: #00ffff;
    font-weight: bold;
    border-bottom: 2px solid rgba(0, 255, 255, 0.3);
}

tr {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: 0.2s;
}

tbody tr:hover {
    background: rgba(0, 255, 255, 0.1);
}

td {
    padding: 3px 8px;
    color: #fff;
    vertical-align: middle;
}

/* Styles pour les icônes dans les boutons d'action */
.bx {
    font-size: 14px !important;
    display: inline-block;
}

/* Links avec icônes */
td a {
    color: #00ffff;
    text-decoration: none;
    transition: 0.2s;
    display: inline-block;
}

td a:hover {
    color: #00ff80;
    transform: scale(1.1);
}

td a i {
    font-size: 14px;
}

/* ============================================
   Nouveau CSS pour le refactoring
   ============================================ */

/* Navbar */
.navbar {
    background: linear-gradient(90deg, rgba(0, 0, 0, 0.8), rgba(0, 255, 255, 0.1));
    border-bottom: 2px solid rgba(0, 255, 255, 0.3);
    padding: 15px 0;
    margin-bottom: 30px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
}

.navbar-brand h1 {
    margin: 0;
    font-size: 1.5rem;
}

.navbar-menu {
    display: flex;
    gap: 20px;
    align-items: center;
}

.navbar-user {
    color: #00ffff;
    font-weight: bold;
}

.navbar-link {
    color: #fff;
    text-decoration: none;
    transition: 0.2s;
    padding: 5px 10px;
    border-radius: 5px;
}

.navbar-link:hover {
    color: #00ffff;
    background: rgba(0, 255, 255, 0.1);
}

.navbar-link.logout {
    background: rgba(255, 68, 68, 0.2);
    color: #ff4444;
}

.navbar-link.logout:hover {
    background: rgba(255, 68, 68, 0.3);
    color: #ff6666;
}

/* Login */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 200px);
}

.login-box {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(0, 255, 255, 0.3);
    border-radius: 15px;
    padding: 40px;
    width: 100%;
    max-width: 400px;
    backdrop-filter: blur(10px);
}

.login-box h1 {
    color: #00ffff;
    text-align: center;
    margin-bottom: 30px;
}

.form-group {
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
}

.form-group label {
    color: #00ffff;
    font-weight: bold;
    margin-bottom: 8px;
}

.form-group input,
.form-group select,
.form-group textarea {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(0, 255, 255, 0.3);
    color: #fff;
    padding: 10px 15px;
    border-radius: 5px;
    font-family: Arial, sans-serif;
    transition: 0.2s;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: #00ffff;
    background: rgba(0, 255, 255, 0.1);
    outline: none;
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.2);
}

/* Buttons */
.btn {
    background: linear-gradient(90deg, #00ffff, #00ff80);
    color: #000;
    padding: 12px 25px;
    border: none;
    border-radius: 5px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
    text-decoration: none;
    display: inline-block;
}

.btn:hover {
    background: linear-gradient(90deg, #00ff80, #00ffff);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 255, 255, 0.3);
}

.btn-small {
    padding: 5px 10px;
    font-size: 12px;
    display: inline-block;
}

.btn-update {
    background: linear-gradient(90deg, #00ffff, #00ff80);
}

.btn-add {
    background: linear-gradient(90deg, #00ff80, #00ffff);
}

.btn-cancel {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.btn-cancel:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Dashboard */
.month-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(0, 255, 255, 0.2);
    border-radius: 12px;
    padding: 12px 20px;
    margin-bottom: 20px;
    gap: 15px;
}

.month-nav-btn {
    color: #00ffff;
    text-decoration: none;
    font-weight: bold;
    font-size: 0.95rem;
    padding: 8px 16px;
    border-radius: 8px;
    background: rgba(0, 255, 255, 0.1);
    border: 1px solid rgba(0, 255, 255, 0.2);
    transition: 0.2s;
    white-space: nowrap;
}

.month-nav-btn:hover {
    background: rgba(0, 255, 255, 0.2);
    border-color: #00ffff;
    transform: translateY(-1px);
}

.month-nav-center {
    flex: 1;
    text-align: center;
}

.month-nav-form {
    display: inline-flex;
    gap: 8px;
    background: none;
    padding: 0;
    margin: 0;
    border: none;
    border-radius: 0;
}

.month-nav-form select {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(0, 255, 255, 0.3);
    color: #fff;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: bold;
    cursor: pointer;
    transition: 0.2s;
    appearance: none;
    -webkit-appearance: none;
}

.month-nav-form select:hover {
    border-color: #00ffff;
    background: rgba(0, 255, 255, 0.1);
}

.month-nav-form select:focus {
    outline: none;
    border-color: #00ffff;
    box-shadow: 0 0 8px rgba(0, 255, 255, 0.3);
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 20px;
}

.dashboard-header h2 {
    color: #00ffff;
    font-size: 1.8rem;
}

/* Totals */
.totals-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.total-box {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(0, 255, 255, 0.3);
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    align-content: center;
}

.total-box h3 {
    color: #00ffff;
    margin-bottom: 10px;
    font-size: 0.9rem;
    text-transform: uppercase;
}

.total-box p {
    font-size: 1.5rem;
    font-weight: bold;
    color: #fff;
}

.total-box.revenue {
    border-color: rgba(0, 255, 0, 0.3);
    background: rgba(0, 255, 0, 0.05);
}

.total-box.revenue p {
    color: #00ff80;
}

.total-box.expenses {
    border-color: rgba(255, 0, 0, 0.3);
    background: rgba(255, 0, 0, 0.05);
}

.total-box.expenses p {
    color: #ff4444;
}

.total-box.balance {
    border-color: rgba(0, 255, 255, 0.3);
    background: rgba(0, 255, 255, 0.05);
}

.total-box.balance p {
    color: #00ffff;
}

.total-box.remaining-balance {
    border-color: rgba(100, 200, 255, 0.3);
    background: rgba(100, 200, 255, 0.05);
}

.total-box.remaining-balance p {
    color: #64c8ff;
}

.total-box.unpaid {
    border-color: rgba(255, 165, 0, 0.3);
    background: rgba(255, 165, 0, 0.05);
}

.total-box.unpaid p {
    color: #ffa500;
}

/* Form Section */
.form-section {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(0, 255, 255, 0.3);
    border-radius: 10px;
    padding: 25px;
    margin: 30px 0;
}

.form-section h3 {
    color: #00ffff;
    margin-bottom: 20px;
}

.transaction-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.form-group.checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-group.checkbox input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.form-group.checkbox label {
    margin: 0;
}

/* Transactions Section */
.transactions-section {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(0, 255, 255, 0.3);
    border-radius: 10px;
    padding: 25px;
    margin: 30px 0;
}

.transactions-section h3 {
    color: #00ffff;
    margin-bottom: 20px;
}

.transactions-table {
    width: 100%;
    border-collapse: collapse;
    background: transparent;
    box-shadow: none;
}

.transactions-table tr {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.transactions-table tr.revenu {
    border-left: 4px solid rgba(0, 255, 0, 0.5);
}

.transactions-table tr.depense {
    border-left: 4px solid rgba(255, 68, 68, 0.5);
}

.transactions-table tr:hover {
    background: rgba(0, 255, 255, 0.1);
}

.transactions-table td.montant {
    font-weight: bold;
    color: #00ffff;
}

.transactions-table .badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: bold;
}

.badge.revenu {
    background: rgba(0, 255, 0, 0.2);
    color: #00ff80;
}

.badge.depense {
    background: rgba(255, 68, 68, 0.2);
    color: #ff4444;
}

.badge-reguliere {
    display: inline-block;
    padding: 2px 6px;
    background: rgba(255, 200, 0, 0.2);
    color: #ffc800;
    border-radius: 3px;
    font-size: 0.8rem;
    margin-left: 8px;
}

.badge-paid {
    display: inline-block;
    padding: 4px 8px;
    background: rgba(0, 255, 0, 0.2);
    color: #00ff80;
    border-radius: 3px;
    font-size: 0.85rem;
    font-weight: bold;
}

.badge-pending {
    display: inline-block;
    padding: 4px 8px;
    background: rgba(255, 200, 0, 0.2);
    color: #ffc800;
    border-radius: 3px;
    font-size: 0.85rem;
    font-weight: bold;
}

.month-separator {
    background: rgba(0, 255, 255, 0.1);
    border-top: 2px solid rgba(0, 255, 255, 0.3);
    border-bottom: 2px solid rgba(0, 255, 255, 0.3);
}

.month-separator td {
    padding: 12px 8px;
    color: #00ffff;
    font-weight: bold;
}

.actions {
    display: flex;
    gap: 8px;
}

.btn-small {
    background: none;
    border: none;
    color: #00ffff;
    cursor: pointer;
    font-size: 1rem;
    transition: 0.2s;
    padding: 5px;
}

.btn-small:hover {
    color: #00ff80;
    transform: scale(1.15);
}

/* Footer */
.footer {
    text-align: center;
    padding: 20px;
    color: #aaa;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: 40px;
    font-size: 0.9rem;
}

/* List Page */
.list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 15px;
}

.transactions-list {
    overflow-x: auto;
}

/* Responsive */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .navbar {
        padding: 10px 0;
        margin-bottom: 15px;
    }

    .navbar-container {
        flex-direction: column;
        gap: 10px;
        padding: 0 10px;
    }

    .navbar-brand h1 {
        font-size: 1.2rem;
    }

    .navbar-menu {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
        gap: 8px;
    }

    .navbar-link {
        padding: 8px 12px;
        font-size: 0.9rem;
    }

    .navbar-user {
        font-size: 0.85rem;
    }

    /* Month navigation */
    .month-nav {
        padding: 10px 12px;
        gap: 8px;
        border-radius: 10px;
    }

    .month-nav-btn {
        font-size: 0.85rem;
        padding: 8px 12px;
    }

    .month-nav-form select {
        padding: 8px 10px;
        font-size: 0.85rem;
    }

    /* Dashboard header */
    .dashboard-header {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        margin-bottom: 15px;
    }

    .dashboard-header h2 {
        font-size: 1.4rem;
        text-align: center;
    }

    .month-selector {
        justify-content: center;
    }

    .month-selector select {
        flex: 1;
        padding: 10px;
        font-size: 1rem;
    }

    /* Totaux en grille compacte */
    .totals-container {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
        margin: 15px 0;
    }

    .total-box {
        padding: 12px 8px;
        border-radius: 8px;
    }

    .total-box h3 {
        font-size: 0.7rem;
        margin-bottom: 5px;
    }

    .total-box p {
        font-size: 1rem;
    }

    /* Bouton ajouter */
    .btn {
        width: 100%;
        text-align: center;
        padding: 14px 20px;
        font-size: 1rem;
    }

    .btn-add {
        width: 100%;
    }

    /* Section transactions */
    .transactions-section {
        padding: 15px 10px;
        margin: 15px 0;
        border-radius: 8px;
    }

    /* Tableau → format cartes sur mobile */
    .transactions-table {
        border: none;
    }

    .transactions-table thead {
        display: none;
    }

    .transactions-table tbody tr {
        display: flex;
        flex-wrap: wrap;
        padding: 12px 10px;
        margin-bottom: 8px;
        background: rgba(255, 255, 255, 0.03);
        border-radius: 8px;
        border-left: 4px solid rgba(0, 255, 255, 0.3);
        gap: 6px;
        align-items: center;
    }

    .transactions-table tbody tr.revenu {
        border-left: 4px solid rgba(0, 255, 0, 0.5);
    }

    .transactions-table tbody tr.depense {
        border-left: 4px solid rgba(255, 68, 68, 0.5);
    }

    .transactions-table td {
        padding: 2px 4px;
        border: none;
    }

    /* Masquer la date sur mobile (pas essentiel) */
    .transactions-table td:nth-child(1) {
        display: none;
    }

    /* Libellé : prend toute la largeur */
    .transactions-table td:nth-child(2) {
        flex: 1 1 60%;
        font-weight: bold;
        font-size: 0.95rem;
    }

    /* Type badge */
    .transactions-table td:nth-child(3) {
        order: -1;
        flex: 0 0 auto;
    }

    /* Montant */
    .transactions-table td:nth-child(4) {
        flex: 0 0 auto;
        font-size: 1rem;
    }

    /* Statut toggle */
    .transactions-table td:nth-child(5) {
        flex: 0 0 auto;
    }

    /* Actions */
    .transactions-table td:nth-child(6) {
        flex: 0 0 auto;
        margin-left: auto;
    }

    .transactions-table td.montant {
        font-size: 1rem;
    }

    .badge {
        font-size: 0.75rem;
        padding: 3px 6px;
    }

    .badge-reguliere {
        font-size: 0.7rem;
        padding: 1px 4px;
    }

    .btn-toggle {
        padding: 6px 10px;
        font-size: 0.8rem;
    }

    .btn-small {
        padding: 8px;
        font-size: 1.1rem;
    }

    .actions {
        gap: 4px;
    }

    /* Modal responsive */
    .modal-content {
        padding: 20px 15px;
        width: 95%;
        max-height: 95vh;
        border-radius: 10px;
    }

    .modal-content h2 {
        font-size: 1.2rem;
        padding-right: 30px;
    }

    .modal-close {
        top: 10px;
        right: 15px;
        font-size: 28px;
    }

    .modal-buttons {
        flex-direction: column;
        gap: 8px;
    }

    .modal-buttons .btn {
        padding: 14px;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 12px;
        font-size: 1rem;
    }

    /* List page */
    .list-header {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .list-header h2 {
        font-size: 1.2rem;
        text-align: center;
    }

    /* Login page */
    .login-box {
        padding: 25px 20px;
        border-radius: 10px;
    }

    .login-container {
        min-height: calc(100vh - 150px);
        align-items: flex-start;
        padding-top: 20px;
    }

    /* Messages */
    .message-success,
    .message-error {
        padding: 10px 12px;
        font-size: 0.9rem;
        margin: 10px 0;
    }
}

/* ============================================
   Modal pour ajouter/éditer une transaction
   ============================================ */

.modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: linear-gradient(135deg, #1e3c72 0%, #2a2a3e 100%);
    padding: 40px;
    border: 1px solid rgba(0, 255, 255, 0.3);
    border-radius: 15px;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.9), 0 0 30px rgba(0, 255, 255, 0.3);
    animation: slideIn 0.3s ease;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

@keyframes slideIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.modal-content h2 {
    color: #00ffff;
    margin-bottom: 25px;
    font-size: 1.5rem;
    text-align: center;
    padding-right: 40px;
}

.modal-close {
    color: #00ffff;
    position: absolute;
    top: 15px;
    right: 25px;
    font-size: 32px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.2s;
    line-height: 1;
}

.modal-close:hover,
.modal-close:focus {
    color: #00ff80;
}

.modal-buttons {
    display: flex;
    gap: 10px;
    margin-top: 25px;
}

.modal-buttons .btn {
    flex: 1;
    margin: 0;
}

/* ============================================
   Section "quelle portée" dans la modal édition
   ============================================ */

.edit-scope-box {
    width: 100%;
    background: rgba(0, 255, 255, 0.04);
    border: 1px solid rgba(0, 255, 255, 0.25);
    border-radius: 10px;
    padding: 18px 20px;
    margin-bottom: 20px;
    position: relative;
}

.edit-scope-title {
    color: #00ffff;
    font-weight: bold;
    margin-bottom: 14px;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.edit-scope-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.edit-scope-label {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fff;
    font-weight: normal;
    cursor: pointer;
    font-size: 0.95rem;
    padding: 10px 14px;
    border-radius: 7px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.03);
    transition: 0.2s;
}

.edit-scope-label:hover {
    background: rgba(0, 255, 255, 0.08);
    border-color: rgba(0, 255, 255, 0.3);
}

.edit-scope-label:has(input:checked) {
    background: rgba(0, 255, 255, 0.12);
    border-color: rgba(0, 255, 255, 0.5);
    color: #00ffff;
}

.edit-scope-label input[type="radio"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: #00ffff;
    flex-shrink: 0;
}

.edit-scope-note {
    color: #888;
    display: block;
    margin-top: 12px;
    font-size: 0.8rem;
    padding-left: 2px;
}

/* Boutons de la modal centrés */
.modal-buttons-center {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 10px;
}

.modal-buttons-center .btn {
    flex: 0 1 160px;
    text-align: center;
    padding: 12px 20px;
}
.btn-toggle {
    border: none;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: bold;
    cursor: pointer;
    transition: 0.2s;
    background: transparent;
}

.btn-toggle:hover {
    transform: scale(1.05);
    filter: brightness(1.2);
}

.btn-toggle.is-paid {
    background: rgba(0, 255, 0, 0.2);
    color: #00ff80;
}

.btn-toggle.is-received {
    background: rgba(0, 200, 255, 0.2);
    color: #00c8ff;
}

.btn-toggle.is-pending {
    background: rgba(255, 200, 0, 0.2);
    color: #ffc800;
}

/* ============================================
   Date picker custom
   ============================================ */
input[type="date"] {
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(0, 255, 255, 0.3);
    border-radius: 8px;
    color: #fff;
    padding: 10px 14px;
    font-size: 0.95rem;
    font-family: Arial, sans-serif;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
    width: 100%;
    appearance: none;
    -webkit-appearance: none;
    letter-spacing: 0.03em;
}

input[type="date"]:hover {
    border-color: #00ffff;
    background: rgba(0, 255, 255, 0.06);
}

input[type="date"]:focus {
    border-color: #00ffff;
    background: rgba(0, 255, 255, 0.08);
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 255, 255, 0.15), 0 0 14px rgba(0, 255, 255, 0.1);
}

/* Icône calendrier (webkit) */
input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(1) sepia(1) saturate(5) hue-rotate(155deg);
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s, transform 0.2s;
    padding: 0 2px;
}

input[type="date"]::-webkit-calendar-picker-indicator:hover {
    opacity: 1;
    transform: scale(1.15);
}

/* Champs texte internes */
input[type="date"]::-webkit-datetime-edit {
    color: #fff;
}

input[type="date"]::-webkit-datetime-edit-fields-wrapper {
    color: #fff;
}

input[type="date"]::-webkit-datetime-edit-text {
    color: rgba(0, 255, 255, 0.5);
    padding: 0 2px;
}

input[type="date"]::-webkit-datetime-edit-day-field,
input[type="date"]::-webkit-datetime-edit-month-field,
input[type="date"]::-webkit-datetime-edit-year-field {
    color: #fff;
    border-radius: 3px;
    padding: 1px 3px;
    transition: background 0.15s;
}

input[type="date"]::-webkit-datetime-edit-day-field:focus,
input[type="date"]::-webkit-datetime-edit-month-field:focus,
input[type="date"]::-webkit-datetime-edit-year-field:focus {
    background: rgba(0, 255, 255, 0.18);
    color: #00ffff;
    outline: none;
}
