
/* ===========================
   Page de connexion
   =========================== */
body.page-connexion {
    min-height: 100vh;
    background:
        url('../assets/images/feuille.png') center center / 90vmin 90vmin no-repeat,
        linear-gradient(135deg, #2d5a27 0%, #4a7c3f 35%, #7a5230 70%, #4a2e12 100%);
    background-attachment: fixed;
    display: flex;
    align-items: center;
    justify-content: center;
}

.boutonSelected {
    border-color: #000000;
    border-width: 3px;
    transition: 2s;
}

.boutonSelected:hover {
    transform: scale(1.1);
    transition: 2s;
}

.card-connexion {
    width: 100%;
    max-width: 420px;
    background: rgba(255, 255, 255, 0.55);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.card-connexion .card-header {
    background: rgba(30, 70, 25, 0.75);
}

.card-connexion .form-control {
    background: rgba(255, 255, 255, 0.75);
}

.card-connexion .form-label {
    font-weight: 600;
    color: #2a1a0a;
}

/* Utilitaires */
.text-right {
    text-align: right;
}

.error-message-centered {
    width: 50%;
    margin: 0 auto;
}

/* Bienvenue utilisateur dans la sidebar */
#auth-welcome {
    color: #5dbd5d;
}

nav#sidebar {
    position: fixed;
    z-index: 1000;
    background-color: rgba(0, 0, 0, 0.4);
    height: 100vh;
    width: 250px;
    display: flex;
    flex-direction: column;
}

#sidebarContent {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-height: 0;
}

.sidebar-logout-wrap {
    margin-top: auto;
    padding: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    justify-content: center;
}

.sidebar-logout-btn {
    border-radius: 0.5rem;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
}

:root {
    --sidebar-width: 250px;
    --sidebar-gutter: 0px;
    --content-offset: calc(var(--sidebar-width) + var(--sidebar-gutter));
    --primary: #098e97;
    --header: #4f594f;
    --text-muted: #6c757d;
    --primary2: #ddbd56;
}

#top-sidebar {
    margin-top: 20px;
    text-align: center;
    margin-bottom: 30px;
}
html,
body {
    max-width: 100%;
    overflow-x: hidden;
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    margin: 0;
}

* {
    box-sizing: border-box;
}

.main-container {
    flex: 1;
    margin-left: 0;
    padding: 0px;
    padding-bottom: 0px;
    width: 100%;
    min-width: 0;
    transition: margin-left 0.3s ease, width 0.3s ease;
}

.container-hors-sidebar {
    flex: 1;
    margin-left: var(--content-offset);
    margin-top: 25px;
    width: calc(100% - var(--content-offset));
    max-width: 100%;
    min-width: 0;
    overflow-x: hidden;
}

footer {
    margin-top: auto;
    z-index: 1;
}

/* Bordures communes à tous les tableaux */
.table-custom {
    border: 1px solid #dee2e6;
}

.table-custom td,
.table-custom th {
    border: 1px solid #dee2e6;
}


/* Page Comptes */
.card-comptes {
    width: 50%;
    margin-left: auto;
    margin-right: auto;
}

.table-comptes {
    margin-bottom: 0;
}

.table-comptes > :not(caption) > * > * {
    vertical-align: middle;
}

.table-comptes > tbody > tr:nth-of-type(odd) > * {
    --bs-table-color-type: var(--bs-table-striped-color);
    --bs-table-bg-type: var(--bs-table-striped-bg);
}

.table-comptes > tbody > tr:hover > * {
    --bs-table-color-state: var(--bs-table-hover-color);
    --bs-table-bg-state: var(--bs-table-hover-bg);
}

.table-comptes thead th {
    --bs-table-bg: var(--primary);
    color: #000;
}

.card-header-tva {
    background-color: var(--header);
}

.card-nouveau-compte {
    max-width: 315px;
    margin: 0 auto;
    background: transparent;
    border: none;
    padding: 0.25rem 0;
}

.card-header-liste-comptes {
    --bs-card-cap-bg: var(--header);
    color: #fff;
}

.card-comptes .card-header h5 {
    text-align: center;
}

/* Page Transaction */
.compte-libelle-titre {
    text-align: center;
}

.card-header-transactions {
    --bs-card-cap-bg: var(--header);
    color: #fff;
    text-align: center;
}

.table-transactions > :not(caption) > * > * {
    padding: 0.3rem 0.6rem;
    vertical-align: middle;
    white-space: nowrap;
    width: 1%;
}

.card-transactions,
.card-echeancier {
    width: 85%;
    margin-left: auto;
    margin-right: auto;
}

.card-tresorerie {
    position: fixed;
    bottom: 0;
    z-index: 1000;
    width: fit-content;
    max-width: calc(100% - var(--content-offset) - 20px);
    left: 50%;
    transform: translateX(calc(-50% + var(--content-offset)/2));
}

.table-transactions > :not(caption) > * > *:nth-child(7) {
    white-space: normal;
    width: 10%;
}

.table-transactions thead th {
    --bs-table-bg: var(--primary);
    color: #fff;
}

.table-transactions > tbody > tr:nth-of-type(odd) > * {
    --bs-table-color-type: var(--bs-table-striped-color);
    --bs-table-bg-type: var(--bs-table-striped-bg);
}

.table-transactions > tbody > tr:hover > * {
    --bs-table-color-state: var(--bs-table-hover-color);
    --bs-table-bg-state: var(--bs-table-hover-bg);
}

.table-transactions > tbody > tr.new > * {
    --bs-table-bg: var(--primary2);
}

.table-comptes > tbody > tr.new > * {
    --bs-table-bg: var(--primary2);
}

.table-echeancier > tbody > tr.new > * {
    --bs-table-bg: var(--primary2);
}


.table-budget > tbody > tr.new > * {
    --bs-table-bg: var(--primary2);
}

.table-transactions span.emoji
{
    font-size: 25px;
    line-height: 1;
}

.table-transactions .montantTd {
    text-align: right;
}

.table-transactions .montantTTC {
    font-weight: bold;
    font-size: 0.95rem;
}

.table-transactions .autreMontant {
    font-size: 0.8rem;
    color: #6c757d;
}

.transaction-list td.montantTd .sep-montant {
    display: inline;
}

.transaction-list td.montantTd .montant-detail {
    display: inline;
}

.transaction-list td.date .date-line {
    display: inline;
}

.transaction-list td.date .date-annee {
    font-size: 0.75em;
    color: #6c757d;
    margin-left: 0.25em;
}

.form-transaction-container {
    width: 35%;
    margin-left: auto;
    margin-right: auto;
}

.form-transaction-container .form-label {
    font-size: 0.75rem;
    margin-bottom: 0.15rem;
}

.form-transaction-container .form-control,
.form-transaction-container .form-select {
    font-size: 1rem;
    padding: 0.2rem 0.4rem;
}

.form-transaction-container .btn {
    font-size: 1rem;
    padding: 0.2rem 0.5rem;
}

.form-transaction-container .card-title {
    font-size: 1.2rem;
}

.form-transaction-container .row.g-3 {
    --bs-gutter-y: 0.4rem;
    --bs-gutter-x: 0.75rem;
}

.form-transaction-container .alert {
    font-size: 0.72rem;
    padding: 0.25rem 0.5rem;
}

.row-filtres-container {
    width: 87%;
    margin-left: auto;
    margin-right: auto;
}

/* Page Echeancier */
.table-echeancier > :not(caption) > * > * {
    padding: 0.15rem 0.15rem;
    vertical-align: middle;
    white-space: nowrap;
    width: 1%;
}

.table-echeancier > :not(caption) > * > *:nth-child(4) {
    text-align: center;
}

.table-echeancier > :not(caption) > * > *:last-child {
    white-space: normal;
    width: auto;
    max-width: 120px;
    text-align: center;
}

.table-echeancier thead th {
    --bs-table-bg: var(--primary);
    color: #fff;
    text-align: center;
}

.table-echeancier > tbody > tr:nth-of-type(odd) > * {
    --bs-table-color-type: var(--bs-table-striped-color);
    --bs-table-bg-type: var(--bs-table-striped-bg);
}

.table-echeancier > tbody > tr:hover > * {
    --bs-table-color-state: var(--bs-table-hover-color);
    --bs-table-bg-state: var(--bs-table-hover-bg);
}

.table-echeancier .montantTd {
    text-align: right;
}

.table-echeancier .montantTTC {
    font-weight: bold;
    font-size: 0.85rem;
}

.table-echeancier .autreMontant {
    font-size: 0.7rem;
    color: #6c757d;
}

.table-echeancier span.emoji {
    font-size: 30px;
    line-height: 1;
}

/* Page Budget */
.table-budget thead th {
    --bs-table-bg: var(--primary);
    color: #fff;
    text-align: center;
}

.table-budget > :not(caption) > * > * {
    vertical-align: middle;
}

.table-budget > :not(caption) > * > *:nth-child(1) {
    text-align: center;
}

.table-budget > :not(caption) > * > *:nth-child(2) {
    text-align: right;
}

.error-message-transaction {
    width: 25%;
    margin-left: auto;
    margin-right: auto;
}

/* ===========================
   Media Queries
   =========================== */

@media (max-width: 1500px) {

    body.page-connexion {
        background-size: 95vw 95vw;
    }

    .row-filtres-container {
        width: 88%;
        row-gap: 1rem;
    }

    .col-lg-3 {
        flex: 0 0 50%;
    }

    .card-comptes {
    width: 72%;
}

    #card-membres {
        width: 92%;
    }

    #card-membres .table-comptes {
        font-size: 0.92rem;
    }

    #card-membres .table-comptes th,
    #card-membres .table-comptes td {
        white-space: nowrap;
    }

    .transaction-list th:nth-child(2),
    .transaction-list td:nth-child(2) {
        width: 85px;
        white-space: normal;
    }

    .transaction-list th:nth-child(3),
    .transaction-list td:nth-child(3) {
        min-width: 110px;
        white-space: normal;
    }

    .transaction-list td.date .date-line {
        display: block;
    }

    .transaction-list td.date .date-annee {
        margin-left: 0;
    }

    .form-transaction-container {
        width: 55%;
    }

}

@media (max-width: 1080px) {

    body.page-connexion {
        background-size: 90vw 90vw;
    }

    .row-filtres-container {
        width: 100%;
        row-gap: 1rem;
    }

    .col-lg-3 {
        flex: 0 0 50%;
    }

    .card-comptes {
        width: 100%;
    }

    .card-echeancier {
        width: 100%;
    }

    #card-membres {
        width: 100%;
    }

    #card-membres .table-comptes {
        font-size: 0.88rem;
    }

    #card-membres .table-comptes th,
    #card-membres .table-comptes td {
        white-space: nowrap;
    }

    .transaction-list th:nth-child(2),
    .transaction-list td:nth-child(2) {
        width: 85px;
        white-space: normal;
    }

    .transaction-list th:nth-child(3),
    .transaction-list td:nth-child(3) {
        min-width: 110px;
        white-space: normal;
    }

    .transaction-list td.date .date-line {
        display: block;
    }

    .transaction-list td.date .date-annee {
        margin-left: 0;
    }

    .table-transactions {
        font-size: 0.8rem;
    }

    .table-transactions span.emoji {
        font-size: 16px;
    }

    .form-transaction-container .btn-group {
        flex-wrap: wrap;
    }

    .form-transaction-container .btn-group .btn {
        flex: 1 1 auto;
        min-width: 0;
    }

}

@media (max-width: 992px) {
    :root {
        --sidebar-width: 0px;
    }

    nav#sidebar {
        position: relative;
        width: 100%;
        height: auto;
    }

    .container-hors-sidebar {
        margin-left: 0;
        width: 100%;
        padding-left: 12px;
        padding-right: 12px;
    }
}

@media (max-width: 576px) {

    body.page-connexion {
        background-size: 95vw 95vw;
    }

    .card-connexion {
        max-width: 100%;
        margin: 0 0.5rem;
    }

    .row-filtres-container {
        width: 100%;
    }

    .col-lg-3 {
        flex: 0 0 100%;
    }

    .card-comptes {
        width: 100%;
        margin-left: 0;
        margin-right: 0;
    }

    .card-transactions,
    .card-echeancier {
        width: 100%;
        margin-left: 0;
        margin-right: 0;
    }

    #card-membres {
        width: 100%;
        margin-left: 0;
        margin-right: 0;
    }

    #card-membres .table-comptes {
        font-size: 0.75rem;
    }

    #card-membres .table-comptes th,
    #card-membres .table-comptes td {
        white-space: nowrap;
    }

    .form-transaction-container {
        width: 100%;
        margin-left: 0;
        margin-right: 0;
    }

    .form-transaction-container .btn-group {
        flex-wrap: wrap;
    }

    .form-transaction-container .btn-group .btn {
        flex: 1 1 auto;
        min-width: 0;
    }

    .error-message-centered {
        width: 100%;
    }

    .transaction-list th:nth-child(2),
    .transaction-list td:nth-child(2) {
        width: 70px;
        white-space: normal;
    }

    .transaction-list th:nth-child(3),
    .transaction-list td:nth-child(3) {
        min-width: 95px;
        white-space: normal;
    }

    .transaction-list td.date .date-line {
        display: block;
    }

    .transaction-list td.date .date-annee {
        margin-left: 0;
    }

    .table-transactions {
        font-size: 0.7rem;
    }

    .table-transactions span.emoji {
        font-size: 14px;
    }

    .table-echeancier {
        font-size: 0.7rem;
    }

    .table-echeancier span.emoji {
        font-size: 14px;
    }

    .table-budget {
        font-size: 0.7rem;
    }

}

.col-vide-gauche,
.col-vide-droite-1,
.col-vide-droite-2 {
    background-color: transparent !important;
    box-shadow: none !important;
    border: none !important;
}

.table-transactions > tbody > tr.ventilation-row > *:not(.col-vide-gauche):not(.col-vide-droite-1):not(.col-vide-droite-2) {
    background-color: #e5f1ff !important;
    box-shadow: inset 0 0 0 9999px #e5f1ff !important;
    color: #000000 !important;
}
