/* =========================================================
   BUDGET FAMILLE
   ========================================================= */

   * {
    box-sizing: border-box;
}


html,
body {
    margin: 0;
    width: 100%;
    min-height: 100%;
    overflow-x: hidden;
}


body {
    font-family:
        Arial,
        Helvetica,
        sans-serif;

    background: #f4f6f8;

    color: #1f2937;
}


/* =========================================================
   ECRAN DE CONNEXION
   ========================================================= */

.login-screen {

    min-height: 100vh;

    display: flex;

    align-items: center;

    justify-content: center;

    padding: 20px;

    background:
        linear-gradient(
            135deg,
            #2563eb,
            #7c3aed
        );
}


.login-box {

    width: 100%;

    max-width: 420px;

    background: white;

    border-radius: 22px;

    padding: 38px;

    box-shadow:
        0 25px 60px
        rgba(0, 0, 0, 0.25);
}


.login-logo {

    text-align: center;

    font-size: 56px;

    margin-bottom: 8px;
}


.login-box h1 {

    margin: 0;

    text-align: center;

    font-size: 30px;

    color: #1f2937;
}


.login-subtitle {

    margin:

        10px
        0
        30px;

    text-align: center;

    color: #6b7280;

    line-height: 1.5;
}


/* =========================================================
   FORMULAIRE LOGIN
   ========================================================= */

.login-form {

    display: flex;

    flex-direction: column;

    gap: 18px;
}


.login-field {

    display: flex;

    flex-direction: column;

    gap: 7px;
}


.login-field label {

    font-size: 14px;

    font-weight: bold;

    color: #374151;
}


.login-field input {

    width: 100%;

    padding: 14px;

    border:

        1px solid
        #d1d5db;

    border-radius: 10px;

    font-size: 16px;

    outline: none;
}


.login-field input:focus {

    border-color: #2563eb;

    box-shadow:

        0
        0
        0
        3px

        rgba(
            37,
            99,
            235,
            0.15
        );
}


/* =========================================================
   MOT DE PASSE
   ========================================================= */

.password-wrapper {

    position: relative;

    width: 100%;
}


.password-wrapper input {

    padding-right: 55px;
}


.toggle-password {

    position: absolute;

    right: 5px;

    top: 50%;

    transform:
        translateY(-50%);

    background: transparent;

    color: #6b7280;

    padding: 8px 10px;

    font-size: 18px;

    border: none;

    box-shadow: none;
}


.toggle-password:hover {

    transform:
        translateY(-50%);

    color: #2563eb;

    opacity: 1;
}


/* =========================================================
   BOUTON LOGIN
   ========================================================= */

.login-button {

    width: 100%;

    padding: 14px;

    margin-top: 5px;

    border-radius: 10px;

    font-size: 16px;

    background:

        linear-gradient(
            135deg,
            #2563eb,
            #7c3aed
        );
}


/* =========================================================
   ERREUR LOGIN
   ========================================================= */

.login-error {

    margin: 0;

    color: #b91c1c;

    text-align: center;

    font-size: 14px;
}


/* =========================================================
   APPLICATION
   ========================================================= */

.app {

    max-width: 1200px;

    margin: auto;

    padding: 20px;
}


/* =========================================================
   HEADER
   ========================================================= */

header {

    display: flex;

    justify-content: space-between;

    align-items: center;

    gap: 20px;

    background: white;

    padding: 25px;

    border-radius: 16px;

    margin-bottom: 20px;

    box-shadow:

        0
        4px
        15px

        rgba(
            0,
            0,
            0,
            0.08
        );
}


header h1 {

    margin: 0;

    font-size: 28px;
}


header p {

    margin:

        8px
        0
        0;

    color: #6b7280;
}


.connected-user {

    margin-top: 12px;

    font-size: 14px;

    font-weight: bold;

    color: #2563eb;
}


/* =========================================================
   ACTIONS HEADER
   ========================================================= */

.header-actions {

    display: flex;

    align-items: center;

    gap: 12px;

    flex-wrap: wrap;

    justify-content: flex-end;
}


.month-selector {

    display: flex;

    align-items: center;

    gap: 8px;
}


.month {

    min-width: 180px;

    text-align: center;

    background: #eef2ff;

    color: #3730a3;

    padding: 12px 18px;

    border-radius: 10px;

    font-weight: bold;
}


.month-button {

    padding: 10px 12px;

    min-width: 42px;

    flex-shrink: 0;
}


.logout-button {

    background: #ef4444;

    padding: 10px 14px;

    white-space: nowrap;

    flex-shrink: 0;
}


.logout-button:hover {

    background: #dc2626;
}


/* =========================================================
   DASHBOARD
   ========================================================= */

.dashboard {

    display: grid;

    grid-template-columns:
        repeat(4, 1fr);

    gap: 15px;

    margin-bottom: 20px;
}


.card {

    padding: 20px;

    border-radius: 16px;

    color: white;

    box-shadow:

        0
        5px
        15px

        rgba(
            0,
            0,
            0,
            0.12
        );
}


.card span {

    font-size: 14px;

    opacity: 0.9;
}


.card h2 {

    margin: 10px 0 0;

    font-size: 26px;
}


.income {
    background: #16a34a;
}


.expense {
    background: #dc2626;
}


.remaining {
    background: #2563eb;
}


.forecast {
    background: #7c3aed;
}


/* =========================================================
   PANELS
   ========================================================= */

.panel {

    background: white;

    border-radius: 16px;

    padding: 25px;

    margin-bottom: 20px;

    box-shadow:

        0
        4px
        15px

        rgba(
            0,
            0,
            0,
            0.08
        );
}


.panel h2 {

    margin-top: 0;
}


/* =========================================================
   FORMULAIRE
   ========================================================= */

.form-row {

    display: grid;

    grid-template-columns:

        130px
        140px
        1fr
        1fr
        150px
        120px;

    gap: 10px;
}


input,
select {

    width: 100%;

    padding: 12px;

    border:

        1px solid
        #d1d5db;

    border-radius: 8px;

    font-size: 15px;

    outline: none;
}


input:focus,
select:focus {

    border-color: #2563eb;

    box-shadow:

        0
        0
        0
        3px

        rgba(
            37,
            99,
            235,
            0.15
        );
}


/* =========================================================
   BOUTONS
   ========================================================= */

button {

    border: none;

    border-radius: 8px;

    padding: 12px 18px;

    background: #2563eb;

    color: white;

    font-size: 15px;

    font-weight: bold;

    cursor: pointer;

    transition: 0.2s;
}


button:hover {

    transform:
        translateY(-1px);

    opacity: 0.9;
}


button:active {

    transform:
        translateY(0);
}


/* =========================================================
   LISTE DES OPERATIONS
   ========================================================= */

.section-header {

    display: flex;

    justify-content: space-between;

    align-items: center;

    gap: 15px;

    margin-bottom: 20px;
}


.operation {

    display: flex;

    justify-content: space-between;

    align-items: center;

    gap: 15px;

    padding: 15px;

    border-bottom:

        1px solid
        #e5e7eb;
}


.operation:last-child {

    border-bottom: none;
}


.operation-info {

    display: flex;

    flex-direction: column;

    gap: 5px;

    min-width: 0;
}


.operation-description {

    font-weight: bold;

    font-size: 16px;

    word-break: break-word;
}


.operation-date {

    color: #6b7280;

    font-size: 13px;
}


.operation-right {

    display: flex;

    align-items: center;

    gap: 10px;

    flex-shrink: 0;
}


.operation-amount {

    font-weight: bold;

    font-size: 17px;

    white-space: nowrap;
}


.operation-income {

    color: #16a34a;
}


.operation-expense {

    color: #dc2626;
}


.delete-button {

    background: #ef4444;

    padding: 8px 12px;

    font-size: 13px;
}


/* =========================================================
   MESSAGE VIDE
   ========================================================= */

.empty {

    text-align: center;

    padding: 30px;

    color: #6b7280;
}


/* =========================================================
   TABLETTE
   ========================================================= */

@media (max-width: 900px) {

    .dashboard {

        grid-template-columns:
            repeat(2, 1fr);
    }


    .form-row {

        grid-template-columns:
            1fr 1fr;
    }


    header {

        align-items: flex-start;

        flex-direction: column;
    }


    .header-actions {

        width: 100%;

        justify-content: space-between;
    }

}


/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 600px) {

    .app {

        padding: 10px;
    }


    header {

        padding: 18px;

        gap: 18px;
    }


    header h1 {

        font-size: 24px;
    }


    .header-actions {

        flex-direction: column;

        align-items: stretch;

        width: 100%;
    }


    .month-selector {

        width: 100%;

        justify-content: space-between;
    }


    .month {

        min-width: 0;

        flex: 1;

        padding: 10px 6px;

        font-size: 14px;
    }


    .logout-button {

        width: 100%;
    }


    .dashboard {

        grid-template-columns:
            1fr;
    }


    .form-row {

        grid-template-columns:
            1fr;
    }


    .section-header {

        align-items: stretch;

        flex-direction: column;
    }


    .section-header button {

        width: 100%;
    }


    .operation {

        align-items: flex-start;

        flex-direction: column;
    }


    .operation-right {

        width: 100%;

        justify-content: space-between;

        flex-wrap: wrap;
    }


    .login-screen {

        padding: 15px;
    }


    .login-box {

        padding: 28px 20px;

        border-radius: 18px;
    }


    .login-box h1 {

        font-size: 26px;
    }

}