:root {
    --app-sidebar: #14213d;
    --app-sidebar-hover: #1f3157;
    --app-accent: #2f6fed;
    --app-bg: #f4f6fb;
}
body { background: var(--app-bg); font-size: .925rem; }
.app { display: flex; min-height: 100vh; }
.app-sidebar {
    width: 250px; flex-shrink: 0; background: var(--app-sidebar); color: #c9d3ea;
    position: sticky; top: 0; height: 100vh; overflow-y: auto; padding: 1rem .75rem;
}
.app-brand { display: block; color: #fff; font-weight: 700; font-size: 1.15rem; text-decoration: none; padding: .25rem .5rem 1rem; }
.app-brand i { color: #7fb0ff; }
.app-sidebar .nav-link {
    color: #c9d3ea; border-radius: .4rem; padding: .45rem .6rem; display: flex; align-items: center; gap: .55rem;
}
.app-sidebar .nav-link:hover { background: var(--app-sidebar-hover); color: #fff; }
.app-sidebar .nav-link.active { background: var(--app-accent); color: #fff; }
.app-sidebar .nav-section { text-transform: uppercase; font-size: .7rem; letter-spacing: .06em; color: #7f8db0; padding: 1rem .6rem .3rem; }
.app-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.app-topbar { background: #fff; border-bottom: 1px solid #e3e7f0; padding: .6rem 1.25rem; display: flex; align-items: center; position: sticky; top: 0; z-index: 1020; }
.app-search { position: relative; align-items: center; width: 420px; }
.app-search i { position: absolute; left: .65rem; color: #8a94a8; }
.app-search input { padding-left: 2rem; }
.app-content { padding: 1.25rem; }
.avatar { display: inline-flex; width: 28px; height: 28px; border-radius: 50%; background: var(--app-accent); color: #fff; align-items: center; justify-content: center; font-size: .75rem; font-weight: 600; }
.page-header { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; margin-bottom: 1rem; }
.page-header h1 { font-size: 1.4rem; margin: 0; font-weight: 600; }
.page-header .actions { margin-left: auto; display: flex; gap: .5rem; flex-wrap: wrap; }
.card { border: 1px solid #e3e7f0; box-shadow: 0 1px 2px rgba(16,24,40,.04); }
.card-header { background: #fff; font-weight: 600; }
.kpi { padding: 1rem 1.1rem; }
.kpi .valeur { font-size: 1.6rem; font-weight: 700; line-height: 1.1; }
.kpi .libelle { color: #6c757d; font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; }
.table > :not(caption) > * > * { padding: .5rem .6rem; }
.table thead th { font-size: .75rem; text-transform: uppercase; letter-spacing: .03em; color: #6c757d; font-weight: 600; white-space: nowrap; }
.table-hover tbody tr { cursor: default; }
.progress-fine { height: 6px; }
.liste-echeances .list-group-item { display: flex; align-items: center; gap: .75rem; }
.liste-echeances .date { width: 54px; text-align: center; line-height: 1.05; flex-shrink: 0; }
.liste-echeances .date .j { font-size: 1.2rem; font-weight: 700; }
.liste-echeances .date .m { font-size: .7rem; text-transform: uppercase; color: #6c757d; }
.bloc-retard { border-left: 4px solid #dc3545; }
.bloc-semaine { border-left: 4px solid #fd7e14; }
.bloc-mois { border-left: 4px solid #0d6efd; }
.grille-prev input { width: 64px; text-align: right; padding: .2rem .35rem; font-size: .85rem; }
.grille-prev th, .grille-prev td { white-space: nowrap; }
.table-sticky thead th { position: sticky; top: 56px; background: #fff; z-index: 2; }
.fil-message { max-width: 85%; border-radius: .75rem; padding: .75rem 1rem; margin-bottom: .75rem; }
.fil-message.cabinet { background: #eef3ff; margin-right: auto; }
.fil-message.client { background: #e9f7ef; margin-left: auto; }
.fil-message .entete { font-size: .78rem; color: #6c757d; margin-bottom: .3rem; }
.zone-depot { border: 2px dashed #b6c2dc; border-radius: .75rem; padding: 2rem 1rem; text-align: center; background: #fafcff; cursor: pointer; transition: .15s; }
.zone-depot.survol { background: #eaf1ff; border-color: var(--app-accent); }
.diff-avant { color: #b02a37; text-decoration: line-through; }
.diff-apres { color: #146c43; }
.echeance-faite { text-decoration: line-through; opacity: .7; }
.badge { font-weight: 500; }
@media (max-width: 991.98px) {
    .app-sidebar { position: fixed; left: -260px; z-index: 1040; transition: left .2s; }
    .app-sidebar.show { left: 0; }
}
@media print {
    .app-sidebar, .app-topbar, .actions, .btn, form { display: none !important; }
    .app-content { padding: 0; }
}

/* Catalogue de pièces (nouvelle demande) */
.catalogue-pieces { max-height: 340px; overflow-y: auto; background: #fbfcfe; }
.catalogue-pieces .form-check { margin-bottom: .2rem; }
.piece-portail .btn { white-space: nowrap; }

/* Cloche de notifications */
.cloche { position: relative; }
.cloche .badge { position: absolute; top: -4px; right: -6px; font-size: .65rem; }
.menu-notifications { width: 360px; max-height: 70vh; overflow-y: auto; }
.menu-notifications .dropdown-item { white-space: normal; }
.notif-non-lue { background: #eef4ff; }

/* Tableaux triables / filtrables */
.table-triable th a.tri { color: inherit; text-decoration: none; white-space: nowrap; }
.table-triable th a.tri:hover { color: var(--app-accent); }
.table-triable th .bi-arrow-down-up { opacity: .3; font-size: .75em; }
.table-triable tr.filtres th { padding: .25rem .3rem; background: #f8f9fb; font-weight: normal; }
.table-triable tr.filtres .form-control, .table-triable tr.filtres .form-select { font-size: .8rem; padding: .15rem .35rem; min-width: 70px; }

.table-tri-serveur th a.tri { color: inherit; text-decoration: none; white-space: nowrap; }
.table-tri-serveur th a.tri:hover, .table-tri-serveur th a.tri.text-primary { color: var(--app-accent) !important; }
.table-tri-serveur th .bi-arrow-down-up { opacity: .3; font-size: .75em; }

/* FullCalendar harmonisé avec Bootstrap */
.fc a { text-decoration: none; }
.fc .fc-col-header-cell-cushion, .fc .fc-daygrid-day-number, .fc .fc-list-day-text, .fc .fc-list-day-side-text { color: #334155; text-decoration: none; }
.fc .fc-col-header-cell-cushion { text-transform: capitalize; font-weight: 600; font-size: .85rem; padding: 6px 4px; }
.fc .fc-daygrid-day-number { font-size: .85rem; padding: 4px 6px; }
.fc .fc-day-other .fc-daygrid-day-number { color: #a0aec0; }
.fc .fc-day-today { background: #fff8e1 !important; }
.fc .fc-day-today .fc-daygrid-day-number { background: var(--app-accent, #2563eb); color: #fff; border-radius: 999px; min-width: 1.6rem; text-align: center; }
.fc .fc-toolbar-title { font-size: 1.25rem; font-weight: 600; text-transform: capitalize; }
.fc .fc-button { font-size: .85rem; padding: .3rem .7rem; box-shadow: none !important; text-transform: capitalize; }
.fc .fc-button-primary { background: #fff; border-color: #d0d7e2; color: #334155; }
.fc .fc-button-primary:hover { background: #f1f5f9; border-color: #c3ccd9; color: #1e293b; }
.fc .fc-button-primary:not(:disabled).fc-button-active, .fc .fc-button-primary:not(:disabled):active { background: var(--app-accent, #2563eb); border-color: var(--app-accent, #2563eb); color: #fff; }
.fc .fc-button-primary:disabled { background: #f8fafc; color: #94a3b8; border-color: #e2e8f0; }
.fc .fc-daygrid-event { font-size: .78rem; border-radius: 4px; padding: 0 2px; }
.fc .fc-daygrid-more-link { font-size: .78rem; color: var(--app-accent, #2563eb); font-weight: 600; }
.fc .fc-popover { z-index: 1060; }
.fc .fc-popover-body { max-height: 320px; overflow-y: auto; }
.page-header .actions { flex-wrap: wrap; justify-content: flex-end; }
.fc .fc-timegrid-axis-cushion { font-size: .75rem; white-space: nowrap; }
