:root {
    --app-sidebar-width: 230px;
    --app-topbar-height: 48px;
    --app-brand: #f59e0b;
    --app-brand-dark: #d97706;
    --app-sidebar-bg: #2f3337;
    --app-sidebar-border: #3d4247;
    --bs-body-font-family: 'Ubuntu', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --bs-body-font-weight: 300;
    --bs-body-color: #334155;
}

body {
    font-family: var(--bs-body-font-family);
    font-weight: 300;
    background-color: #f1f5f9;
}

h1, h2, h3, h4, h5, h6,
.form-label,
.btn,
.nav-link,
th {
    font-weight: 400;
}

strong, b {
    font-weight: 500;
}

/* Couleur de marque */
.btn-primary {
    --bs-btn-color: #fff;
    --bs-btn-bg: var(--app-brand);
    --bs-btn-border-color: var(--app-brand);
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: var(--app-brand-dark);
    --bs-btn-hover-border-color: var(--app-brand-dark);
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: #b45309;
    --bs-btn-active-border-color: #b45309;
    --bs-btn-disabled-color: #fff;
    --bs-btn-disabled-bg: var(--app-brand);
    --bs-btn-disabled-border-color: var(--app-brand);
    --bs-btn-focus-shadow-rgb: 245, 158, 11;
}

.form-control:focus,
.form-select:focus,
.form-check-input:focus {
    border-color: #fbbf24;
    box-shadow: 0 0 0 .25rem rgba(245, 158, 11, .2);
}

.form-check-input:checked {
    background-color: var(--app-brand);
    border-color: var(--app-brand);
}

.text-brand {
    color: var(--app-brand-dark) !important;
}

.app-brand-mark {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
}

.app-brand-mark img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.app-brand-name {
    font-family: 'Ubuntu', system-ui, -apple-system, 'Segoe UI', sans-serif;
    font-weight: 300;
    font-size: 1.15rem;
}

/* Menu vertical */
.app-sidebar {
    --bs-offcanvas-width: var(--app-sidebar-width);
    color: #d0d4d8;
}

.offcanvas-lg.app-sidebar,
.app-sidebar .offcanvas-body {
    background-color: var(--app-sidebar-bg) !important;
}

@media (min-width: 992px) {
    .app-sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        width: var(--app-sidebar-width);
        display: flex;
        flex-direction: column;
        z-index: 1030;
    }

    .app-sidebar .offcanvas-body,
    .app-sidebar .offcanvas-body > nav {
        min-height: 0;
    }

    .app-main {
        margin-left: var(--app-sidebar-width);
    }
}

.app-sidebar .app-sidebar-brand {
    height: var(--app-topbar-height);
    border-bottom: 1px solid var(--app-sidebar-border);
}

.app-sidebar .nav-section {
    margin: .35rem 0 .1rem;
    padding: 0 .75rem;
    font-size: .65rem;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: #8a9198;
}

.app-sidebar .nav-link {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .2rem .75rem;
    border-radius: .4rem;
    color: #d0d4d8;
    font-size: .8rem;
    font-weight: 300;
}

.app-sidebar .nav-link .app-nav-badge {
    font-size: .62rem;
    font-weight: 500;
    padding: .2em .5em;
    border-radius: 0;
}

/* Strip calling for an action, above the page content */
.app-attention-band {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem .75rem;
    padding: .5rem .75rem;
    border: 1px solid #fde3b4;
    border-left: 3px solid var(--app-brand);
    border-radius: .5rem;
    background: #fff8eb;
    font-size: .8rem;
}

/* The page stacks its blocks with a 1.5rem gap: bring the next block closer. */
.app-attention-band-tight {
    margin-bottom: -1rem;
}

.app-attention-band-text {
    flex: 1 1 14rem;
    min-width: 0;
}

.app-attention-band-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: .4rem;
    background: #fdecc8;
    color: #b45309;
    font-size: .95rem;
}

.app-sidebar .nav-link .bi {
    font-size: .9rem;
    color: #a3a9af;
}

.app-sidebar .nav-link:hover {
    background: rgba(255, 255, 255, .07);
    color: #fff;
}

.app-sidebar .nav-link.active {
    background: rgba(255, 255, 255, .1);
    color: #fff;
    box-shadow: inset 3px 0 0 var(--app-brand);
}

.app-sidebar .nav-link.active .bi {
    color: var(--app-brand);
}

.app-sidebar .nav-link.disabled {
    color: #6c737a;
}

.app-sidebar .nav-link[aria-expanded="true"] .app-chevron {
    transform: rotate(180deg);
}

.app-sidebar .app-chevron {
    transition: transform .2s;
    font-size: .75rem !important;
}

.app-sidebar .app-submenu {
    margin-left: 1.4rem;
    padding-left: .6rem;
    border-left: 1px solid var(--app-sidebar-border);
}

/* Utilisateur connecté */
.app-avatar {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--app-brand);
    color: #fff;
    font-size: .72rem;
    font-weight: 500;
    letter-spacing: .02em;
}

.app-avatar-lg {
    width: 44px;
    height: 44px;
    font-size: 1rem;
}

.app-user-toggle {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    padding: .2rem .4rem;
    border: 0;
    border-radius: .5rem;
    background: transparent;
    color: #334155;
    font-size: .78rem;
    font-weight: 300;
}

.app-user-toggle:hover,
.app-user-toggle[aria-expanded="true"] {
    background: #f1f5f9;
}

.app-user-menu {
    min-width: 14rem;
    font-size: .76rem;
    font-weight: 300;
}

.app-user-menu .dropdown-item {
    padding: .3rem 1rem;
}

.app-user-menu .badge {
    font-size: .65rem;
}

/* Cloche des alertes */
.app-bell {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: .5rem;
    background: transparent;
    color: #475569;
    font-size: 1.05rem;
}

.app-bell:hover,
.app-bell[aria-expanded="true"] {
    background: #f1f5f9;
}

.app-bell .bi-bell-fill {
    color: var(--app-brand-dark);
}

.app-bell-count {
    position: absolute;
    top: 2px;
    right: 1px;
    min-width: 17px;
    padding: 0 4px;
    border-radius: 999px;
    background: #dc2626;
    color: #fff;
    font-size: .6rem;
    font-weight: 500;
    line-height: 17px;
    text-align: center;
}

.app-bell-menu {
    width: 21rem;
    max-width: calc(100vw - 1.5rem);
    overflow: hidden;
}

.app-bell-item {
    border-bottom: 1px solid #f1f5f9;
}

.app-bell-item:hover {
    background: #f8fafc;
}

.app-bell-item.is-unread {
    background: #fffbeb;
    box-shadow: inset 3px 0 0 var(--app-brand);
}

.app-bell-icon {
    flex-shrink: 0;
    width: 1.25rem;
    font-size: .95rem;
    text-align: center;
}

.app-bell-body {
    font-size: .74rem;
    line-height: 1.35;
}

.app-bell-time {
    margin-top: .1rem;
    font-size: .68rem;
}

.min-w-0 {
    min-width: 0;
}

/* Recherche globale */
.app-search {
    position: relative;
    flex-shrink: 0;
    width: 15rem;
}

.app-search .form-control {
    padding-left: 1.9rem;
    padding-right: 1.9rem;
    background: #f8fafc;
}

.app-search .form-control:focus {
    background: #fff;
}

.app-search-icon {
    position: absolute;
    top: 50%;
    left: .65rem;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: .8rem;
    pointer-events: none;
}

.app-search-key {
    position: absolute;
    top: 50%;
    right: .5rem;
    transform: translateY(-50%);
    padding: 0 .35rem;
    border: 1px solid #e2e8f0;
    border-radius: .3rem;
    background: #fff;
    color: #94a3b8;
    font-size: .68rem;
    pointer-events: none;
}

.app-search .form-control:focus ~ .app-search-key {
    display: none;
}

.app-search-results mark {
    padding: 0;
    background: #fef3c7;
    color: inherit;
}

/* Barre supérieure */
.app-topbar {
    position: sticky;
    top: 0;
    z-index: 1020;
    height: var(--app-topbar-height);
    background: rgba(255, 255, 255, .92);
    backdrop-filter: blur(6px);
    border-bottom: 1px solid #e2e8f0;
}

.app-topbar-icon {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: .4rem;
    background: #fff7e6;
    color: var(--app-brand-dark);
    font-size: .85rem;
}

.app-topbar-title h1 {
    font-weight: 400;
    flex-shrink: 0;
}

.app-topbar-description {
    min-width: 0;
    margin-left: .25rem;
    padding-left: .75rem;
    border-left: 1px solid #e2e8f0;
    color: #6c757d;
    font-size: .78rem;
}

/* Notifications */
.app-toasts {
    top: var(--app-topbar-height);
    z-index: 1090;
}

.app-toast {
    --bs-toast-max-width: 380px;
    --bs-toast-padding-x: .85rem;
    --bs-toast-padding-y: .6rem;
    padding: var(--bs-toast-padding-y) var(--bs-toast-padding-x);
    font-family: var(--bs-body-font-family);
    font-size: .82rem;
    font-weight: 300;
    color: #334155;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-left: 4px solid var(--app-toast-color, #64748b);
    box-shadow: 0 6px 20px rgba(15, 23, 42, .12);
}

.app-toast .btn-close {
    flex-shrink: 0;
    font-size: .6rem;
}

.app-toast-icon {
    flex-shrink: 0;
    color: var(--app-toast-color, #64748b);
    font-size: 1rem;
}

.app-toast-success {
    --app-toast-color: #16a34a;
}

.app-toast-warning {
    --app-toast-color: #d97706;
}

.app-toast-danger {
    --app-toast-color: #dc2626;
}

.copy-field .form-control {
    font-size: .76rem;
    background-color: #f8fafc;
}

.client-photo {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    object-fit: cover;
    border: 1px solid #e2e8f0;
    border-radius: 50%;
}

.client-photo-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    background: #fff7e6;
    color: var(--app-brand-dark);
}

.company-logo {
    max-width: 160px;
    max-height: 56px;
    padding: .25rem;
    object-fit: contain;
    background-color: #fff;
    border: 1px solid #e2e8f0;
    border-radius: .4rem;
}

/* Modale de confirmation */
.app-confirm .modal-dialog {
    max-width: 440px;
}

.app-confirm .modal-content {
    border: 0;
    border-radius: .75rem;
    box-shadow: 0 20px 45px rgba(15, 23, 42, .18);
    font-weight: 300;
}

.app-confirm .modal-body {
    padding: 1.25rem 1.25rem 1rem;
}

.app-confirm .modal-footer {
    padding: .6rem 1rem;
    gap: .5rem;
    background-color: #f8fafc;
    border-top: 1px solid #e2e8f0;
    border-radius: 0 0 .75rem .75rem;
}

.app-confirm .modal-footer > * {
    margin: 0;
}

.app-confirm-icon {
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: .6rem;
    font-size: 1.15rem;
}

.app-confirm-message {
    font-size: .82rem;
}

.app-confirm-summary {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: .3rem .9rem;
    margin-top: .75rem;
    padding: .6rem .75rem;
    font-size: .78rem;
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: .5rem;
}

.app-confirm-summary dt {
    font-weight: 300;
    color: #64748b;
}

.app-confirm-summary dd {
    margin: 0;
    color: #0f172a;
    font-variant-numeric: tabular-nums;
    overflow-wrap: anywhere;
}

/* Contenu */
.card {
    border-color: #e2e8f0;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
}

.card-header {
    background: #fff;
    border-bottom-color: #f1f5f9;
    padding: 1rem 1.5rem;
}

.card-body {
    padding: 1.5rem;
}

.stat-icon {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: .6rem;
    font-size: 1.2rem;
}

.card-link-hover {
    transition: border-color .15s;
}

.card-link-hover:hover {
    border-color: #fcd34d;
}

.num {
    font-weight: 300;
    font-variant-numeric: tabular-nums;
    letter-spacing: .02em;
}

/* Tableaux compacts */
.table-compact {
    --bs-table-striped-bg: #f6f7f9;
    font-size: .8rem;
    font-weight: 300;
}

.table-compact > thead th {
    font-size: .68rem;
    font-weight: 400;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: #6c757d;
    background: #eef0f3;
    white-space: nowrap;
}

.table-compact > :not(caption) > * > * {
    padding: .4rem .65rem;
}

.table-compact .badge {
    font-weight: 400;
}

.table-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: .4rem;
    background: #fff7e6;
    color: var(--app-brand-dark);
    font-size: .85rem;
}

.table-dense,
.table-tight {
    font-size: .7rem;
    line-height: 1.25;
}

.table-dense > :not(caption) > * > *,
.table-tight > :not(caption) > * > * {
    padding: .13rem .45rem;
}

.table-dense > thead th,
.table-tight > thead th {
    font-size: .58rem;
    padding-top: .2rem;
    padding-bottom: .2rem;
}

.table-dense .table-icon,
.table-tight .table-icon {
    width: 16px;
    height: 16px;
    border-radius: .25rem;
    font-size: .6rem;
}

.table-dense .app-avatar,
.table-tight .app-avatar {
    width: 16px;
    height: 16px;
    font-size: .5rem;
}

.table-dense .btn-action,
.table-tight .btn-action {
    --bs-btn-padding-y: 0;
    --bs-btn-padding-x: .35rem;
    --bs-btn-font-size: .65rem;
    --bs-btn-line-height: 1.45;
}

.table-dense .badge,
.table-tight .badge {
    font-size: .62rem;
    padding: .2em .45em;
}

.status-square {
    display: inline-block;
    flex-shrink: 0;
    width: .5rem;
    height: .5rem;
    border-radius: 2px;
}

.app-panel > .app-panel-section + .app-panel-section {
    border-top: 1px solid #eef0f3;
}

.app-panel .app-panel-section {
    padding: .75rem 1rem;
}

.app-panel .app-panel-table {
    margin: 0 1rem 1rem;
    border: 1px solid #eef0f3;
    border-radius: .5rem;
}

.form-control,
.form-select,
.input-group-text,
.form-check-label {
    font-weight: 300;
}

/* The open list of a select is drawn by the browser, which only applies the font set on the options themselves. */
select,
select option,
select optgroup {
    font-family: var(--bs-body-font-family);
    font-weight: 300;
}

select optgroup {
    font-weight: 400;
}

.app-section-title {
    float: none;
    width: auto;
    margin-bottom: .15rem;
    padding: 0;
    font-size: .85rem;
    font-weight: 400;
    color: #212529;
}

.app-section-title .bi {
    margin-right: .4rem;
    color: var(--app-brand-dark);
}

.app-section-description {
    margin-bottom: .75rem;
    font-size: .75rem;
    color: #6c757d;
}

.app-form .form-label {
    margin-bottom: .2rem;
    font-size: .76rem;
    color: #475569;
}

.app-form .form-control,
.app-form .form-select,
.app-form .input-group-text {
    padding: .3rem .6rem;
    font-size: .82rem;
}

.app-form .form-select {
    padding-right: 2rem;
}

.app-form .form-text {
    font-size: .72rem;
}

.app-form .app-panel-section {
    padding: 1rem;
}

/* The value sits above its label so long amounts keep the full width of the tile. */
.stat-tile {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    column-gap: .6rem;
    row-gap: .15rem;
    padding: .45rem .75rem;
    border: 1px solid #eef0f3;
    border-radius: .5rem;
    background: #fafbfc;
}

.stat-tile .stat-icon {
    grid-row: span 2;
    width: 32px;
    height: 32px;
    border-radius: .45rem;
    font-size: .95rem;
}

.stat-tile .stat-label {
    font-size: .68rem;
    line-height: 1.1;
}

.btn-sm {
    --bs-btn-padding-y: .18rem;
    --bs-btn-padding-x: .6rem;
    --bs-btn-font-size: .76rem;
    --bs-btn-border-radius: .35rem;
}

.btn-action {
    --bs-btn-padding-y: .1rem;
    --bs-btn-padding-x: .45rem;
    --bs-btn-font-size: .7rem;
}

.btn-action.dropdown-toggle::after {
    margin-left: .3rem;
    vertical-align: .15em;
}

.app-row-actions-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.25rem;
    height: 1rem;
    padding: 0;
    border: 0;
    border-radius: .25rem;
    background: transparent;
    color: #64748b;
    font-size: .62rem;
    line-height: 1;
    vertical-align: middle;
}

.app-row-actions-toggle:hover,
.app-row-actions-toggle[aria-expanded="true"] {
    background: #e2e8f0;
    color: #0f172a;
}

.app-row-actions-toggle .bi {
    transition: transform .15s;
}

.app-row-actions-toggle[aria-expanded="true"] .bi {
    transform: rotate(180deg);
}

.dropdown-item {
    font-family: var(--bs-body-font-family);
    font-weight: 300;
}

.app-row-actions {
    min-width: 8.5rem;
    padding: .25rem 0;
    font-size: .72rem;
}

.app-row-actions .dropdown-item {
    padding: .22rem .75rem;
    font-size: .72rem;
}

.app-row-actions .dropdown-divider {
    margin: .2rem 0;
}

.search-bar .form-control,
.search-bar .form-select,
.search-bar .input-group-text,
.search-bar .btn {
    padding-top: .22rem;
    padding-bottom: .22rem;
    font-size: .76rem;
    font-weight: 300;
}

.search-bar .form-select {
    background-position: right .6rem center;
}

.stat-tile .stat-value {
    font-size: .9rem;
    line-height: 1.1;
}

.btn-check + .btn.option-card {
    text-align: start;
    color: #334155;
    background: #fff;
    border-color: #cbd5e1;
}

.btn-check:checked + .btn.option-card {
    background: #fffbeb;
    border-color: var(--app-brand);
    box-shadow: 0 0 0 1px var(--app-brand);
    color: #0f172a;
}

.btn-check:disabled + .btn.option-card {
    background: #f8fafc;
    opacity: .6;
}

/* Pages de connexion */
.app-guest {
    background: linear-gradient(rgba(17, 24, 39, .35), rgba(17, 24, 39, .35)), url('../images/background.jpg') center / cover no-repeat fixed, #3a3f47;
}

.app-guest,
.app-guest * {
    font-family: 'Ubuntu', system-ui, -apple-system, 'Segoe UI', sans-serif;
    font-weight: 300;
}

.app-guest .bi {
    font-family: bootstrap-icons !important;
}

.app-guest-box {
    width: 100%;
    max-width: 400px;
}

.app-guest-brand {
    color: #1f2937;
}

.app-guest .app-panel-section.app-guest-header-compact {
    padding-bottom: 0;
}

.app-guest .app-guest-header-compact + form > .app-panel-section:first-of-type {
    padding-top: .3rem;
}

.app-guest .app-brand-mark {
    width: 56px;
    height: 56px;
}

.app-guest .app-panel {
    box-shadow: 0 1rem 2.5rem rgba(0, 0, 0, .25);
}

.app-guest .form-label,
.app-guest .form-check-label,
.app-guest .small {
    font-size: .78rem;
}

.app-guest .form-control,
.app-guest .input-group .btn,
.app-guest .btn {
    font-size: .8rem;
}

.app-guest .form-control {
    padding: .25rem .6rem;
    line-height: 1.4;
}

.app-guest .d-grid > .btn {
    padding-top: .25rem;
    padding-bottom: .25rem;
}

.app-guest .input-group .btn {
    padding-top: 0;
    padding-bottom: 0;
}

.app-guest .app-panel-section {
    padding: .7rem 1rem;
}

.app-guest .row {
    --bs-gutter-y: .6rem;
}

/* Field with a leading icon: the group carries the focus ring so the icon and the input read as one control. */
.app-field-icon {
    border-radius: var(--bs-border-radius);
    transition: box-shadow .15s ease-in-out;
}

.app-field-icon > .input-group-text {
    justify-content: center;
    min-width: 2.6rem;
    border-right: 0;
    background: #f8f9fa;
    color: #475569;
}

.app-field-icon > .form-control {
    border-left: 0;
}

.app-field-icon > .input-group-text,
.app-field-icon > .form-control:has(+ .btn) {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.app-field-icon > .form-control::placeholder {
    color: #adb5bd;
}

.app-field-icon > .form-control:focus {
    box-shadow: none;
}

.app-field-icon > .btn {
    border-color: var(--bs-border-color);
    background: #fff;
    color: #64748b;
}

.app-field-icon > .btn:hover {
    background: #f8f9fa;
    color: #1f2937;
}

.app-field-icon:focus-within {
    box-shadow: 0 0 0 .25rem rgba(245, 158, 11, .2);
}

.app-field-icon:focus-within > .input-group-text,
.app-field-icon:focus-within > .btn {
    border-color: #fbbf24;
}

.app-field-icon:has(.is-invalid) > .input-group-text {
    border-color: var(--bs-form-invalid-border-color);
}

.app-guest .app-field-icon > .form-control,
.app-guest .app-field-icon > .input-group-text {
    padding-top: .45rem;
    padding-bottom: .45rem;
}

/* Carte de connexion sur fond gris léger, champs blancs */
.app-guest .app-panel.app-guest-tinted {
    background: #f3f4f6;
}

.app-guest .app-guest-tinted > .app-guest-header-compact + form > .app-panel-section:first-of-type {
    padding-top: 0;
}

.app-guest .app-guest-tinted .app-panel-section + .app-panel-section {
    border-top-color: #e5e7eb;
}

/* Habilitations */
.app-permission-group {
    height: 100%;
    padding: .75rem .9rem;
    border: 1px solid #eef0f3;
    border-radius: .5rem;
    background: #fafbfc;
}

.app-permission-group .form-check {
    margin-bottom: .2rem;
    font-size: .85rem;
}

/* Tableau de bord */
.app-chart {
    position: relative;
    height: 260px;
}

.app-chart-sm {
    height: 200px;
}

.app-kpi {
    display: flex;
    flex-direction: column;
    gap: .2rem;
    height: 100%;
    padding: .8rem 1rem;
    border: 1px solid #eef0f3;
    border-left: 3px solid var(--app-kpi-color, var(--app-brand));
    border-radius: .5rem;
    background: #fff;
}

.app-kpi-label {
    color: #6c757d;
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: .03em;
}

.app-kpi-value {
    font-size: 1.25rem;
    font-weight: 400;
    line-height: 1.2;
}

.app-kpi-hint {
    color: #94a3b8;
    font-size: .75rem;
}

/* Tableau de bord : typographie resserrée */
.app-dashboard {
    font-size: .9rem;
}

.app-dashboard .h6 {
    font-size: .88rem;
}

.app-dashboard .small {
    font-size: .8rem;
}

.app-dashboard .app-kpi {
    padding: .65rem .9rem;
}

.app-dashboard .app-kpi-label,
.app-dashboard .app-kpi-hint {
    font-size: .68rem;
}

.app-dashboard .app-kpi-value {
    font-size: 1.1rem;
}

.app-dashboard .btn-action {
    --bs-btn-font-size: .7rem;
}

.app-kpi-success { --app-kpi-color: #16a34a; }
.app-kpi-danger { --app-kpi-color: #dc2626; }
.app-kpi-primary { --app-kpi-color: #2563eb; }
.app-kpi-warning { --app-kpi-color: #d97706; }
.app-kpi-secondary { --app-kpi-color: #64748b; }

.app-bar {
    height: 6px;
    border-radius: 3px;
    background: #f1f5f9;
    overflow: hidden;
}

.app-bar > span {
    display: block;
    height: 100%;
    background: var(--app-brand);
}

.qr-card {
    max-width: 22rem;
    margin: 0 auto;
    padding: 1.25rem;
    border: 1px solid #eef0f3;
    border-radius: .75rem;
    background: #fff;
    text-align: center;
}

.qr-frame {
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1;
    width: 100%;
    max-width: 18rem;
    margin: 0 auto;
}

.qr-frame svg,
.qr-frame img {
    width: 100%;
    height: auto;
}

.invoice-lines td {
    vertical-align: top;
}

.invoice-lines [data-line-subtotal] {
    padding-top: .45rem;
}

.invoice-totals {
    min-width: 16rem;
}

.invoice-totals > div {
    display: flex;
    justify-content: space-between;
    gap: 1.5rem;
    padding: .2rem 0;
}

.invoice-totals dt {
    font-weight: 400;
    color: #64748b;
}

.invoice-totals dd {
    margin: 0;
    color: #0f172a;
}

.invoice-totals-grand {
    border-top: 1px solid #e2e8f0;
    margin-top: .2rem;
    padding-top: .4rem !important;
    font-size: .9rem;
}

.invoice-totals-grand dt,
.invoice-totals-grand dd {
    color: #0f172a;
    font-weight: 500;
}

.qr-frame-placeholder {
    border: 1px dashed #cbd5e1;
    border-radius: .5rem;
    background: #fafbfc;
    color: #94a3b8;
    font-size: .8rem;
    padding: 1rem;
}

.qr-card:fullscreen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    max-width: none;
    border: 0;
    border-radius: 0;
}

.qr-card:fullscreen .qr-frame {
    max-width: min(70vh, 90vw);
}

.qr-print-sheet {
    display: none;
}

@media print {
    body.is-printing-qr {
        background: #fff !important;
    }

    body.is-printing-qr > :not(.qr-print-sheet) {
        display: none !important;
    }

    .qr-print-sheet {
        display: block;
        padding-top: 2cm;
    }

    .qr-print-sheet .qr-card {
        max-width: none;
        border: 0;
    }

    .qr-print-sheet .qr-frame {
        max-width: 12cm;
    }
}

.app-export-menu {
    width: 19rem;
}

/* Barre de chargement en haut de l'écran, comme celle du playground PI-SPI */
.app-progress {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 2000;
    height: 4px;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    transition: opacity .3s ease;
}

.app-progress.is-visible {
    opacity: 1;
}

.app-progress-track {
    position: absolute;
    inset: 0;
    background-color: rgba(245, 158, 11, .25);
}

.app-progress-bar {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 100%;
    transform-origin: top left;
}

.app-progress-inner {
    position: absolute;
    display: inline-block;
    width: 100%;
    border-top: 4px solid var(--app-brand);
}

.app-progress-primary {
    left: -145.166611%;
}

.app-progress-secondary {
    left: -54.888891%;
}

.app-progress.is-visible .app-progress-primary {
    animation: app-progress-primary-translate 2s linear infinite;
}

.app-progress.is-visible .app-progress-primary > .app-progress-inner {
    animation: app-progress-primary-scale 2s linear infinite;
}

.app-progress.is-visible .app-progress-secondary {
    animation: app-progress-secondary-translate 2s linear infinite;
}

.app-progress.is-visible .app-progress-secondary > .app-progress-inner {
    animation: app-progress-secondary-scale 2s linear infinite;
}

@keyframes app-progress-primary-translate {
    0% { transform: translateX(0); }
    20% { animation-timing-function: cubic-bezier(.5, 0, .701732, .495819); transform: translateX(0); }
    59.15% { animation-timing-function: cubic-bezier(.302435, .381352, .55, .956352); transform: translateX(83.67142%); }
    100% { transform: translateX(200.611057%); }
}

@keyframes app-progress-primary-scale {
    0% { transform: scaleX(.08); }
    36.65% { animation-timing-function: cubic-bezier(.334731, .12482, .785844, 1); transform: scaleX(.08); }
    69.15% { animation-timing-function: cubic-bezier(.06, .11, .6, 1); transform: scaleX(.661479); }
    100% { transform: scaleX(.08); }
}

@keyframes app-progress-secondary-translate {
    0% { animation-timing-function: cubic-bezier(.15, 0, .515058, .409685); transform: translateX(0); }
    25% { animation-timing-function: cubic-bezier(.31033, .284058, .8, .733712); transform: translateX(37.651913%); }
    48.35% { animation-timing-function: cubic-bezier(.4, .627035, .6, .902026); transform: translateX(84.386165%); }
    100% { transform: translateX(160.277782%); }
}

@keyframes app-progress-secondary-scale {
    0% { animation-timing-function: cubic-bezier(.205028, .057051, .57661, .453971); transform: scaleX(.08); }
    19.15% { animation-timing-function: cubic-bezier(.152313, .196432, .648374, 1.004315); transform: scaleX(.457104); }
    44.15% { animation-timing-function: cubic-bezier(.257759, -.003163, .211762, 1.38179); transform: scaleX(.72796); }
    100% { transform: scaleX(.08); }
}

/* Choix de la langue */
.app-locale {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    padding: 2px;
    border: 1px solid #e2e8f0;
    border-radius: .4rem;
    background: #fff;
}

.app-locale-option {
    padding: .1rem .45rem;
    border: 0;
    border-radius: .3rem;
    background: transparent;
    color: #64748b;
    font-size: .68rem;
    font-weight: 400;
    letter-spacing: .03em;
    line-height: 1.5;
}

.app-locale-option:hover {
    color: #0f172a;
}

.app-locale-option.is-active {
    background: var(--app-brand);
    color: #fff;
}

.app-guest-locale {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 10;
}

/* Assistant d'installation */
.app-guest-box.app-install-box {
    max-width: 760px;
}

.app-install-steps {
    display: flex;
    gap: .35rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.app-install-steps li {
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .15rem;
    min-width: 0;
    padding-bottom: .35rem;
    border-bottom: 2px solid #e5e7eb;
    color: #9ca3af;
    font-size: .72rem;
    text-align: center;
}

.app-install-steps li span {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.app-install-steps li.is-current {
    border-bottom-color: var(--app-brand);
    color: #1f2937;
}

.app-install-steps li.is-current .bi {
    color: var(--app-brand-dark);
}

.app-install-steps li.is-done {
    border-bottom-color: #198754;
    color: #198754;
}

.app-install-requirement + .app-install-requirement {
    border-top: 1px dashed #eef0f3;
}

