/* =========================================================
   FACTURIER AUTOMATIQUE
   Surcouche légère Bootstrap 5.3
========================================================= */


/* =========================================================
   VARIABLES
========================================================= */

:root {
    --bs-font-sans-serif: 'Inter', system-ui, sans-serif;

    --bs-primary: #1d4ed8;
    --bs-primary-rgb: 29, 78, 216;

    --bs-border-radius: 0.65rem;
    --bs-border-radius-sm: 0.5rem;
    --bs-border-radius-lg: 0.85rem;
}


/* =========================================================
   BASE
========================================================= */

html,
body {
    max-width: 100%;
}

body {
    background: #f7f9fc;
    overflow-x: hidden;
}

[data-bs-theme="dark"] body {
    background: #0b1120;
}


/* =========================================================
   NAVBAR
========================================================= */


.navbar {
    width: 100%;
    max-width: 100%;
}


.navbar-brand {
    letter-spacing: -0.02em;
}

.navbar-brand,
.navbar-nav,
.navbar-collapse {
    min-width: 0;
}

.navbar-collapse {
    min-width: 0;
}

.navbar-nav {
    min-width: 0;
}

.nav-link i {
    margin-right: 4px;
}


/*
   Les liens ne doivent pas provoquer un débordement
   horizontal du navbar.
*/
.navbar-nav .nav-link {
    white-space: nowrap;
}


/*
   Partie droite du navbar
*/
.nav-right-wrapper {
    min-width: 0;
}


/*
   À partir des grands écrans, le menu peut rester
   horizontal.
*/
@media (min-width: 1400px) {

    .navbar-nav {
        flex-wrap: wrap;
    }

}


/*
   Entre les tablettes et les grands écrans,
   on laisse Bootstrap utiliser le bouton hamburger.
*/
@media (max-width: 1399.98px) {

    .navbar .navbar-collapse {
        padding-top: 0.75rem;
        padding-bottom: 0.75rem;
    }

    .navbar-nav .nav-link {
        padding-top: 0.6rem;
        padding-bottom: 0.6rem;
    }

}


/* =========================================================
   CONTENU PRINCIPAL
========================================================= */

main.container-fluid {
    width: 100%;
    max-width: 100%;
}


/* Évite qu'un élément enfant trop large
   fasse déborder toute la page */
main.container-fluid > * {
    max-width: 100%;
}


/* =========================================================
   CARTES
========================================================= */

.card {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    transition: box-shadow 0.15s ease;
}

.card:hover {
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
}


/* =========================================================
   BOUTONS
========================================================= */

.btn {
    font-weight: 500;
}

.btn-primary {
    background: linear-gradient(
        135deg,
        #2563eb,
        #1d4ed8
    );

    border: none;
}

.btn-primary:hover {
    background: linear-gradient(
        135deg,
        #1d4ed8,
        #1e3a8a
    );
}


/* =========================================================
   TABLEAUX
========================================================= */

.table thead {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #6b7280;
}

[data-bs-theme="dark"] .table thead {
    color: #9ca3af;
}


/*
   Protection contre les tableaux trop larges
*/
.table-responsive {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}


/* =========================================================
   RECHERCHE
========================================================= */

.search-box {
    position: relative;
}

.search-box input {
    padding-left: 2.2rem;
}

.search-box .icon {
    position: absolute;
    left: 0.7rem;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
}


/* =========================================================
   CAISSE
========================================================= */

.caisse-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.25rem;
    align-items: start;
}

@media (max-width: 900px) {

    .caisse-grid {
        grid-template-columns: 1fr;
    }

}


/* =========================================================
   SESSION / CARDS
========================================================= */

.session-banner,
.card.bg-primary-subtle {
    border: 1px solid rgba(
        var(--bs-primary-rgb),
        0.25
    );
}


/* =========================================================
   FACTURE A5
   Mise en page indépendante de Bootstrap
========================================================= */

.invoice-box {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 24px;
    font-size: 13px;
    width: 100%;
    max-width: 420px !important;
    margin: 0 auto;
}

.invoice-header {
    display: flex;
    justify-content: flex-end;
    align-items: flex-start;
    margin-bottom: 8px;
}

.invoice-logo {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 1px solid #111;

    display: flex;
    align-items: center;
    justify-content: center;

    overflow: hidden;
    flex-shrink: 0;
}

.invoice-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.invoice-company {
    text-align: center;
    margin-bottom: 12px;
}

.invoice-company h1 {
    font-size: 16px;
    margin: 0 0 2px;
}

.invoice-company p {
    font-size: 10px;
    color: #6b7280;
    margin: 0;
}

.invoice-meta {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    margin-bottom: 8px;
}

.invoice-box-block {
    border: 1px solid #111;
    font-size: 10px;
    margin-bottom: 12px;
}

.invoice-box-block > div {
    padding: 6px 8px;
    border-bottom: 1px solid #e5e7eb;
}

.invoice-box-block > div:last-child {
    border-bottom: none;
}

.invoice-table {
    width: 100%;
    font-size: 10px;
    border: 1px solid #111;
    margin-bottom: 12px;
}

.invoice-table thead tr {
    background: #111;
    color: #fff;
    text-transform: none;
    letter-spacing: 0;
}

.invoice-table td,
.invoice-table th {
    padding: 4px 6px;
    border-bottom: 1px solid #e5e7eb;
}

.invoice-totals {
    font-size: 11px;
    margin-bottom: 12px;
}

.invoice-totals .row {
    display: flex;
    justify-content: space-between;
    padding: 2px 0;
}

.invoice-totals .total {
    font-weight: 700;
    font-size: 14px;
    border-top: 1px solid #e5e7eb;
    padding-top: 4px;
}

.invoice-signature {
    border: 1px solid #111;
    height: 80px;
    padding: 8px;
    font-size: 10px;
    margin-bottom: 12px;

    display: flex;
    align-items: stretch;
    gap: 8px;
}

.invoice-signature img {
    flex: 1;
    height: 100%;
    object-fit: contain;
}

.invoice-footer {
    text-align: center;
    font-style: italic;
    font-size: 12px;
}

.invoice-actions {
    display: flex;
    justify-content: space-between;
    width: 100%;
    max-width: 420px !important;
    margin: 0 auto 16px auto;
}


/* =========================================================
   RESPONSIVE
========================================================= */

@media (max-width: 767.98px) {

    .invoice-box {
        padding: 16px;
    }

    .invoice-actions {
        max-width: 100%;
        gap: 0.5rem;
    }

}


/* =========================================================
   IMPRESSION
========================================================= */

@media print {

    .navbar,
    .invoice-actions,
    .no-print {
        display: none !important;
    }

    @page {
        size: A5;
        margin: 8mm;
    }

    body {
        background: #fff;
        overflow: visible;
    }

    .invoice-box {
        border: none;
        box-shadow: none;
        max-width: none;
    }

}