/* ==========================================================================
   PLANOS Médical — Design system
   Emplacement : planning/static/planning/css/planos.css
   Réutilisable sur toutes les pages : il suffit d'inclure ce fichier
   APRÈS bootstrap.min.css.
   ========================================================================== */

/* ---------- 1. Tokens ---------- */
:root {
    --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;

    --primary: #1565C0;
    --primary-600: #0F56A8;
    --primary-50: #EBF3FD;
    --primary-100: #D6E7FB;
    --navy: #0B1F3A;

    --bg: #F4F6FA;
    --surface: #FFFFFF;
    --surface-2: #F8FAFC;
    --border: #E4E9F0;
    --border-strong: #D3DAE4;

    --text: #0F1E36;
    --text-2: #45556C;
    --muted: #7A879A;

    --success: #12805C;  --success-50: #E7F6EF;
    --warning: #B4690E;  --warning-50: #FEF4E6;
    --danger:  #C62F3B;  --danger-50:  #FDECEE;
    --violet:  #6B46C1;  --violet-50:  #F1ECFB;
    --teal:    #0E7C86;  --teal-50:    #E6F5F6;

    --radius-sm: 6px;
    --radius: 10px;
    --radius-lg: 14px;

    --shadow-xs: 0 1px 2px rgba(16, 30, 54, .05);
    --shadow-sm: 0 1px 3px rgba(16, 30, 54, .07), 0 1px 2px rgba(16, 30, 54, .04);
    --shadow-md: 0 8px 24px rgba(16, 30, 54, .08);
    --shadow-lg: 0 20px 48px rgba(16, 30, 54, .18);

    --topbar-h: 64px;
}

/* ---------- 2. Base ---------- */
body {
    margin: 0;
    font-family: var(--font);
    font-size: 14px;
    line-height: 1.5;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
}
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-600); }
h1, h2, h3, h4, h5, h6 { color: var(--text); font-weight: 600; letter-spacing: -.01em; }
.text-muted { color: var(--muted) !important; }
.fw-semibold { font-weight: 600 !important; } /* absent de Bootstrap 5.1 */
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
::selection { background: var(--primary-100); }

/* Boutons applicatifs */
.btn-app {
    display: inline-flex; align-items: center; gap: 8px;
    height: 38px; padding: 0 16px;
    border-radius: var(--radius); border: 1px solid transparent;
    font-size: 13.5px; font-weight: 600; cursor: pointer;
    transition: background .15s, border-color .15s, box-shadow .15s, color .15s;
    white-space: nowrap;
}
.btn-app-primary { background: var(--primary); color: #fff; box-shadow: 0 1px 2px rgba(21,101,192,.3); }
.btn-app-primary:hover { background: var(--primary-600); color: #fff; }
.btn-app-secondary { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn-app-secondary:hover { border-color: var(--border-strong); background: var(--surface-2); color: var(--text); }

/* Pastilles */
.pill {
    display: inline-flex; align-items: center; gap: 5px;
    font-size: 11.5px; font-weight: 600; line-height: 1;
    padding: 5px 9px; border-radius: 999px;
    background: var(--surface-2); color: var(--text-2);
}
.pill-primary { background: var(--primary-50); color: var(--primary); }
.pill-success { background: var(--success-50); color: var(--success); }
.pill-warning { background: var(--warning-50); color: var(--warning); }
.pill-danger  { background: var(--danger-50);  color: var(--danger); }
.pill-neutral { background: #EEF1F5; color: var(--text-2); }
.pill-dot::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* ---------- 3. Topbar ---------- */
.topbar {
    position: sticky; top: 0; z-index: 1030;
    height: var(--topbar-h);
    background: rgba(255, 255, 255, .92);
    backdrop-filter: saturate(180%) blur(10px);
    border-bottom: 1px solid var(--border);
}
.topbar-inner {
    max-width: 1680px; height: 100%;
    margin: 0 auto; padding: 0 24px;
    display: flex; align-items: center; gap: 16px;
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 700; font-size: 17px; letter-spacing: -.02em; line-height: 1.1; }
.brand:hover { color: var(--text); }
.brand small { display: block; font-size: 11px; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.brand-mark {
    width: 34px; height: 34px; border-radius: 9px;
    background: linear-gradient(135deg, var(--primary), #3B8BEA);
    color: #fff; display: grid; place-items: center; font-size: 15px;
    box-shadow: 0 2px 6px rgba(21, 101, 192, .35);
}
.topbar-nav { display: flex; gap: 2px; margin-left: 8px; padding-left: 16px; border-left: 1px solid var(--border); }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.topbar-actions form { display: inline-flex; margin: 0; }
.topbar-sep { width: 1px; height: 24px; background: var(--border); margin: 0 8px; }

.icon-btn {
    position: relative;
    width: 38px; height: 38px; padding: 0;
    border-radius: var(--radius); border: 1px solid transparent;
    display: inline-grid; place-items: center;
    background: transparent; color: var(--text-2);
    font-size: 15px; cursor: pointer;
    transition: background .15s, color .15s, border-color .15s;
}
.icon-btn:hover { background: var(--surface-2); border-color: var(--border); color: var(--text); }
.icon-btn.danger:hover { background: var(--danger-50); border-color: transparent; color: var(--danger); }

.unread-badge {
    position: absolute; top: 1px; right: 1px;
    min-width: 18px; height: 18px; padding: 0 5px;
    border-radius: 999px; border: 2px solid #fff;
    background: var(--danger); color: #fff;
    font-size: 10.5px; font-weight: 700; line-height: 1;
    display: none; align-items: center; justify-content: center;
}

.user-chip {
    display: flex; align-items: center; gap: 10px;
    padding: 4px 14px 4px 4px; border-radius: 999px;
    border: 1px solid var(--border); background: var(--surface); color: var(--text);
    transition: border-color .15s, box-shadow .15s;
}
.user-chip:hover { border-color: var(--border-strong); box-shadow: var(--shadow-sm); color: var(--text); }
.avatar {
    width: 32px; height: 32px; border-radius: 50%;
    background: var(--primary-50); color: var(--primary);
    display: grid; place-items: center; flex-shrink: 0;
    font-weight: 700; font-size: 12px; text-transform: uppercase;
}
.user-chip-name { display: block; font-weight: 600; font-size: 13px; line-height: 1.2; }
.user-chip-role { display: block; font-size: 11.5px; color: var(--muted); line-height: 1.2; }

/* Infobulle demandes IADE */
.demandes-iade-tooltip {
    display: none; position: absolute; top: calc(100% + 8px); right: 0;
    min-width: 300px; max-width: 420px; z-index: 3000;
    background: var(--surface); color: var(--text);
    border: 1px solid var(--border); border-radius: var(--radius);
    box-shadow: var(--shadow-md); padding: 12px 14px;
    text-align: left; cursor: default; font-size: 13px;
}
#demandesIadeIcon:hover .demandes-iade-tooltip { display: block; }
.demandes-iade-tooltip .tooltip-title { font-weight: 600; font-size: 13px; padding-bottom: 8px; margin-bottom: 4px; border-bottom: 1px solid var(--border); }
.demandes-iade-tooltip .tooltip-item { font-size: 12.5px; padding: 7px 0; border-bottom: 1px solid var(--border); }
.demandes-iade-tooltip .tooltip-item:last-child { border-bottom: 0; }
.demandes-iade-tooltip .t-nom { font-weight: 600; }
.demandes-iade-tooltip .t-type { display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 999px; background: var(--primary-50); color: var(--primary); font-size: 11px; font-weight: 600; }

/* ---------- 4. Page ---------- */
.page { max-width: 1680px; margin: 0 auto; padding: 28px 24px 0; }
.page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.page-eyebrow { font-size: 12.5px; font-weight: 600; color: var(--primary); margin-bottom: 4px; }
.page-eyebrow::first-letter { text-transform: uppercase; }
.page-title { font-size: 26px; font-weight: 700; letter-spacing: -.025em; margin: 0; }
.page-subtitle { color: var(--text-2); margin: 4px 0 0; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.dashboard-container {
    display: grid;
    grid-template-columns: 290px minmax(0, 1fr);
    gap: 24px; align-items: start;
}

/* ---------- 5. Navigation latérale ---------- */
.left-column {
    position: sticky; top: calc(var(--topbar-h) + 20px);
    max-height: calc(100vh - var(--topbar-h) - 40px); overflow-y: auto;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius-lg); box-shadow: var(--shadow-xs);
    padding: 8px;
    scrollbar-width: thin;
}
.sidebar-title { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding: 10px 12px 6px; }
.category-card + .category-card { margin-top: 2px; }
.category-header {
    width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 8px;
    padding: 9px 10px; border: 0; border-radius: var(--radius);
    background: transparent; color: var(--text); text-align: left; cursor: pointer;
    transition: background .15s;
}
.category-header:hover { background: var(--surface-2); }
.category-header[aria-expanded="true"] { background: var(--primary-50); }
.category-title { display: flex; align-items: center; gap: 10px; font-size: 13.5px; font-weight: 600; }
.category-icon {
    width: 28px; height: 28px; border-radius: 8px; flex-shrink: 0;
    display: grid; place-items: center; font-size: 12.5px;
    background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border);
    transition: .15s;
}
.category-header[aria-expanded="true"] .category-icon { background: #fff; color: var(--primary); border-color: var(--primary-100); }
.chevron { font-size: 10px; color: var(--muted); transition: transform .2s; }
.category-header[aria-expanded="true"] .chevron { transform: rotate(90deg); color: var(--primary); }

.category-content { display: none; margin: 4px 0 8px 23px; padding-left: 12px; border-left: 1px solid var(--border); }
.category-content.active { display: block; animation: fadeSlide .18s ease-out; }

.btn-custom {
    display: flex; align-items: center; gap: 10px;
    padding: 7px 10px; margin-bottom: 1px; border-radius: 8px;
    color: var(--text-2); font-size: 13px; font-weight: 500; line-height: 1.35;
    transition: background .15s, color .15s;
}
.btn-custom i { width: 16px; text-align: center; font-size: 12.5px; color: var(--muted); transition: color .15s; flex-shrink: 0; margin: 0 !important; }
.btn-custom:hover { background: var(--surface-2); color: var(--text); }
.btn-custom:hover i { color: var(--primary); }

/* ---------- 6. Cartes ---------- */
.right-column { display: grid; grid-template-columns: minmax(320px, 380px) minmax(0, 1fr); gap: 24px; align-items: start; }
.right-column.single { grid-template-columns: minmax(0, 1fr); }
.garde-section, .planning-section { display: flex; flex-direction: column; gap: 24px; min-width: 0; }

.info-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-xs); overflow: hidden; }
.info-card-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.info-card-header h5 { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 15px; font-weight: 600; }
.info-card-body { padding: 16px 20px; }
.card-icon { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; font-size: 13.5px; background: var(--primary-50); color: var(--primary); flex-shrink: 0; }
.card-icon.warm   { background: var(--warning-50); color: var(--warning); }
.card-icon.green  { background: var(--success-50); color: var(--success); }
.card-icon.violet { background: var(--violet-50);  color: var(--violet); }
.card-icon.rose   { background: var(--danger-50);  color: var(--danger); }

.empty-state { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 28px 12px; text-align: center; color: var(--muted); font-size: 13px; }
.empty-state i { font-size: 18px; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); color: var(--muted); }

/* Tuile date (gardes / marché) */
.date-tile {
    width: 44px; flex-shrink: 0; border-radius: 9px; overflow: hidden; text-align: center;
    border: 1px solid var(--border); background: var(--surface);
}
.date-tile .dt-mon { display: block; background: var(--danger); color: #fff; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; padding: 2px 0; }
.date-tile .dt-day { display: block; font-size: 17px; font-weight: 700; padding: 3px 0 4px; line-height: 1.1; }
.date-tile.is-exchange .dt-mon { background: var(--primary); }
.date-tile.is-gift .dt-mon { background: var(--success); }

/* ---------- 7. Mes gardes ---------- */
.garde-item {
    position: relative; padding: 10px 12px; margin-bottom: 8px;
    border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface);
    cursor: pointer; transition: border-color .15s, box-shadow .15s, background .15s;
}
.garde-item:last-child { margin-bottom: 0; }
.garde-item:hover { border-color: var(--primary-100); background: var(--surface-2); }
.garde-item:active { transform: scale(.995); }
.garde-row { display: flex; align-items: center; gap: 12px; padding-right: 24px; }
.garde-row .fw-bold { font-size: 13.5px; font-weight: 600 !important; }
.garde-hint { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.garde-item .click-indicator { position: absolute; right: 12px; top: 26px; color: var(--muted); font-size: 12px; transition: color .15s; }
.garde-item:hover .click-indicator { color: var(--primary); }

.garde-options-menu { display: none; gap: 8px; margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--border); }
.garde-options-menu.active { display: flex; animation: fadeSlide .2s ease-out; }
.option-echange, .option-don {
    flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    height: 34px; border-radius: 8px; font-size: 12.5px; font-weight: 600;
    border: 1px solid var(--border); background: var(--surface); transition: .15s;
}
.option-echange { color: var(--primary); }
.option-echange:hover { background: var(--primary-50); border-color: var(--primary-100); color: var(--primary); }
.option-don { color: var(--success); }
.option-don:hover { background: var(--success-50); border-color: #BFE6D3; color: var(--success); }

/* ---------- 8. Marché des gardes ---------- */
.garde-marketplace-item {
    position: relative; padding: 10px 12px; margin-bottom: 8px;
    border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface);
    cursor: pointer; transition: border-color .15s, box-shadow .15s, background .15s;
}
.garde-marketplace-item:last-child { margin-bottom: 0; }
.garde-marketplace-item:hover { border-color: var(--primary-100); box-shadow: var(--shadow-sm); }
.garde-marketplace-item.own-garde { background: var(--surface-2); border-style: dashed; }
.garde-marketplace-item.own-garde .mk-by::after { content: " · Cliquez pour gérer"; color: var(--muted); font-style: italic; }
.garde-marketplace-item.disabled { opacity: .6; cursor: not-allowed; }
.mk-row { display: flex; align-items: flex-start; gap: 12px; }
.mk-body { flex: 1; min-width: 0; }
.mk-body .fw-bold { font-size: 13.5px; font-weight: 600 !important; }
.mk-badges { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.mk-badges .badge { font-weight: 600; }

.proposition-inline {
    margin-top: 8px; padding: 8px 10px; border-radius: 8px;
    background: var(--success-50) !important; border: 1px solid #CDEBDC !important;
}
.proposition-inline .btn { width: 28px; height: 28px; padding: 0; display: grid; place-items: center; border-radius: 7px; font-size: 12px; }
.proposition-title { font-size: 12px; font-weight: 600; color: var(--success); margin-top: 8px; }

.mk-propositions { padding-left: 56px; }
@media (max-width: 768px) { .mk-propositions { padding-left: 0; } }
.proposition-item { padding: 10px 12px; margin-bottom: 8px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2); }
.proposition-item:last-child { margin-bottom: 0; }

.garde-exchange-option { padding: 12px 14px; margin-bottom: 8px; border: 1px solid var(--border) !important; border-radius: var(--radius); cursor: pointer; transition: .15s; }
.garde-exchange-option:hover { border-color: var(--primary-100) !important; background: var(--surface-2); }
.garde-exchange-option.bg-light { background: var(--primary-50) !important; border-color: var(--primary) !important; }
.selected-garde-text { font-weight: 600; color: var(--primary); }
.cursor-pointer { cursor: pointer; }

#ownerOptionsModal .btn {
    display: flex; align-items: center; gap: 8px; width: 100%;
    padding: 11px 14px; border-radius: var(--radius); font-weight: 600; font-size: 13.5px;
    border: 1px solid var(--border); background: var(--surface); text-align: left;
}
#ownerOptionsModal #changeToGift { color: var(--success); }
#ownerOptionsModal #changeToGift:hover { background: var(--success-50); }
#ownerOptionsModal #changeToExchange { color: var(--primary); }
#ownerOptionsModal #changeToExchange:hover { background: var(--primary-50); }
#ownerOptionsModal #removeFromMarket { color: var(--danger); }
#ownerOptionsModal #removeFromMarket:hover { background: var(--danger-50); }

.exchange-proposal-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px 14px; margin-bottom: 8px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2); }
.exchange-existing { padding: 14px 16px; border-radius: var(--radius); background: var(--primary-50); border: 1px solid var(--primary-100); }

/* Notification (toast) du marché des gardes */
.notification-container {
    position: fixed; right: 24px; bottom: 24px; z-index: 9999;
    display: none; align-items: center; gap: 12px;
    max-width: min(460px, calc(100vw - 32px)); padding: 12px 14px;
    background: var(--surface); color: var(--text);
    border: 1px solid var(--border); border-left: 4px solid var(--primary);
    border-radius: var(--radius); box-shadow: var(--shadow-lg); font-size: 13.5px;
    opacity: 0; transform: translateY(8px); transition: opacity .2s, transform .2s;
}
.notification-container.visible { opacity: 1; transform: translateY(0); }
.notification-container.success { border-left-color: var(--success); }
.notification-container.error { border-left-color: var(--warning); }
.notification-icon { font-size: 18px; color: var(--primary); }
.notification-container.success .notification-icon { color: var(--success); }
.notification-container.error .notification-icon { color: var(--warning); }
.notification-message { flex: 1; }
.notification-dismiss { border: 1px solid var(--border); background: var(--surface); border-radius: 8px; padding: 5px 12px; font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.notification-dismiss:hover { background: var(--surface-2); }
@media (max-width: 768px) { .notification-container { right: 16px; left: 16px; bottom: 16px; } }

/* ---------- 9. Planning hebdomadaire ---------- */
.day-block { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.day-block:first-child { padding-top: 4px; }
.day-block:last-child { border-bottom: 0; padding-bottom: 4px; }
.day-label { text-align: center; padding-top: 2px; }
.day-label .dow { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.day-label .dnum { font-size: 22px; font-weight: 700; line-height: 1.15; letter-spacing: -.02em; }
.day-label .dmon { font-size: 11.5px; color: var(--text-2); }
.day-block.is-today .day-label { background: var(--primary-50); border-radius: var(--radius); padding: 6px 0; }
.day-block.is-today .dnum, .day-block.is-today .dow { color: var(--primary); }
.day-content { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.day-tags { display: flex; flex-wrap: wrap; gap: 6px; }

.slot {
    display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
    padding: 8px 12px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface);
    transition: border-color .15s;
}
.slot:hover { border-color: var(--border-strong); }
.slot-time { font-variant-numeric: tabular-nums; font-weight: 600; font-size: 12.5px; color: var(--primary); background: var(--primary-50); padding: 3px 8px; border-radius: 6px; white-space: nowrap; }
.slot-main { font-weight: 600; font-size: 13px; }
.slot-room { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12.5px; }
.slot-room i { font-size: 11px; }

.affectation-garde, .affectation-off, .affectation-absence, .affectation-conge {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 999px;
}
.affectation-garde::before, .affectation-off::before, .affectation-absence::before, .affectation-conge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.affectation-garde   { background: var(--danger-50);  color: var(--danger); }
.affectation-off     { background: var(--success-50); color: var(--success); }
.affectation-absence { background: var(--primary-50); color: var(--primary); }
.affectation-conge   { background: var(--violet-50);  color: var(--violet); }

.supervision-iade-block { padding: 7px 12px; border-radius: 8px; background: var(--violet-50); border-left: 3px solid var(--violet); font-size: 12.5px; }
.supervision-iade-block.binome { background: var(--success-50); border-left-color: var(--success); }
.supervision-iade-label { font-weight: 600; color: var(--violet); font-size: 12.5px; }
.supervision-iade-block.binome .supervision-iade-label { color: var(--success); }
.supervision-iade-plage { color: var(--text-2); font-size: 12px; margin-top: 2px; }

/* ---------- 10. Modales Bootstrap ---------- */
.modal-backdrop.show { opacity: .35; }
.modal-content { border: 0; border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); overflow: hidden; }
.modal-header { padding: 18px 24px; border-bottom: 1px solid var(--border); background: var(--surface); }
.modal-title { font-size: 16px; font-weight: 600; }
.modal-body { padding: 20px 24px; }
.modal-footer { border-top: 1px solid var(--border); background: var(--surface-2); }
.modal-body h6, .section-label {
    font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .07em;
    color: var(--muted); margin: 0 0 10px; padding: 0; border: 0;
}

.planning-option {
    display: block; width: 100%; text-align: left;
    padding: 12px 14px; margin-bottom: 8px;
    background: var(--surface); color: var(--text);
    border: 1px solid var(--border); border-radius: var(--radius);
    font-size: 13.5px; font-weight: 500; cursor: pointer;
    transition: border-color .15s, box-shadow .15s;
}
.planning-option:hover { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-50); }
.option-row { display: flex; align-items: center; gap: 12px; }
.option-icon { width: 36px; height: 36px; border-radius: 9px; display: grid; place-items: center; background: var(--primary-50); color: var(--primary); flex-shrink: 0; font-size: 14px; }
.option-title { font-weight: 600; font-size: 13.5px; }
.option-arrow { margin-left: auto; color: var(--muted); font-size: 11px; }
.date-info { color: var(--muted); font-size: 12.5px; font-weight: 400; margin-top: 2px; }

.option-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; }
.option-grid .planning-option { margin: 0; padding: 16px; height: 100%; }
.option-grid .option-icon { margin-bottom: 10px; }

#calendarContainer, #retroCalendarContainer { display: none; margin-top: 8px; }
#calendar.form-control, #retroCalendar.form-control, .form-control {
    border: 1px solid var(--border); border-radius: var(--radius); padding: 9px 12px; font-size: 13.5px;
}
.form-control:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-50); }

/* ---------- 11. Flatpickr ---------- */
.flatpickr-calendar { border: 1px solid var(--border) !important; border-radius: var(--radius) !important; box-shadow: var(--shadow-md) !important; font-family: var(--font) !important; }
.flatpickr-day { border-radius: 8px !important; }
.flatpickr-day.selected, .flatpickr-day.selected:hover { background: var(--primary) !important; border-color: var(--primary) !important; color: #fff !important; }
.flatpickr-day.has-planning { background: var(--danger-50) !important; color: var(--danger) !important; text-decoration: line-through; }

/* ---------- 12. Messagerie ---------- */
.message-modal { display: none; position: fixed; inset: 0; z-index: 1000; background: rgba(11, 31, 58, .35); backdrop-filter: blur(2px); cursor: pointer; }
.message-modal-content {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    width: calc(100% - 32px); max-width: 560px;
    background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
    overflow: hidden; cursor: default; z-index: 1001;
}
.message-modal-header { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 14px 20px; border-bottom: 1px solid var(--border); }
.message-modal-title { font-size: 16px; font-weight: 600; margin: 0; }
.message-form { display: flex; flex-direction: column; gap: 12px; padding: 20px; }
.message-input {
    width: 100%; padding: 10px 12px; font: inherit; font-size: 13.5px; color: var(--text);
    border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface);
    transition: border-color .15s, box-shadow .15s;
}
.message-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-50); }
.message-submit { align-self: flex-end; }

.recipient-search-container { position: relative; }
.recipient-results {
    display: none; position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 1050;
    max-height: 220px; overflow-y: auto;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-md);
}
.recipient-result-item { padding: 9px 12px; font-size: 13px; cursor: pointer; }
.recipient-result-item:hover { background: var(--surface-2); }
.selected-recipients { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.selected-recipients:empty { display: none; }
.selected-recipient { display: inline-flex; align-items: center; gap: 4px; padding: 3px 4px 3px 10px; border-radius: 999px; background: var(--primary-50); color: var(--primary); font-size: 12.5px; font-weight: 600; }
.selected-recipient button { border: 0; background: none; color: inherit; width: 20px; height: 20px; border-radius: 50%; line-height: 1; cursor: pointer; }
.selected-recipient button:hover { background: var(--primary-100); }

.message-list { max-height: 440px; overflow-y: auto; }
.message-item { padding: 14px 20px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background .15s; }
.message-item:last-child { border-bottom: 0; }
.message-item:hover { background: var(--surface-2); }
.message-item.unread { background: var(--primary-50); }
.message-item.unread .message-sender::before { content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--primary); margin-right: 8px; vertical-align: middle; }
.message-item-header { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 2px; }
.message-sender { font-weight: 600; font-size: 13.5px; }
.message-actions { display: flex; align-items: center; gap: 12px; }
.message-date { color: var(--muted); font-size: 12px; }
.message-preview { color: var(--text-2); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.delete-conversation-btn { color: var(--muted); font-size: 12px; opacity: .7; transition: .15s; }
.delete-conversation-btn:hover { color: var(--danger); opacity: 1; }

/* ---------- 13. Conversation ---------- */
.conversation-modal-content {
    display: flex; flex-direction: column;
    width: calc(100% - 32px); max-width: 600px; height: 80vh; margin: 10vh auto 0;
    background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
    overflow: hidden; position: relative; cursor: default; z-index: 1001;
}
.conversation-header { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.back-button { width: 36px; height: 36px; border-radius: var(--radius); display: grid; place-items: center; cursor: pointer; color: var(--text-2); }
.back-button:hover { background: var(--surface-2); }
.conversation-user { flex: 1; display: flex; align-items: center; gap: 10px; }
.user-avatar { font-size: 26px; color: var(--border-strong); line-height: 1; }
.conversation-user h3 { margin: 0; font-size: 15px; font-weight: 600; }
.conversation-options { position: relative; width: 36px; height: 36px; display: grid; place-items: center; border-radius: var(--radius); color: var(--muted); cursor: pointer; }
.conversation-options:hover { background: var(--surface-2); }
.conversation-messages { flex: 1; overflow-y: auto; padding: 20px; background: var(--surface-2); display: flex; flex-direction: column; gap: 10px; }
.no-messages { margin: auto; color: var(--muted); font-style: italic; }
.message-bubble-container { display: flex; flex-direction: column; width: 100%; animation: fadeSlide .2s ease-out; }
.sent-container { align-items: flex-end; padding-left: 20%; }
.received-container { align-items: flex-start; padding-right: 20%; }
.message-sender-name { font-size: 11.5px; color: var(--muted); margin: 0 0 3px 6px; }
.message-bubble { padding: 9px 13px; border-radius: 16px; max-width: 100%; word-wrap: break-word; font-size: 13.5px; }
.message-sent { background: var(--primary); color: #fff; border-bottom-right-radius: 5px; }
.message-received { background: var(--surface); color: var(--text); border: 1px solid var(--border); border-bottom-left-radius: 5px; }
.message-content { white-space: pre-wrap; margin-bottom: 3px; }
.message-time { font-size: 10.5px; text-align: right; opacity: .7; }
.conversation-input { display: flex; align-items: flex-end; gap: 8px; padding: 12px; border-top: 1px solid var(--border); }
.conversation-input textarea { flex: 1; resize: none; min-height: 40px; max-height: 110px; padding: 9px 14px; border: 1px solid var(--border); border-radius: 20px; background: var(--surface-2); font: inherit; font-size: 13.5px; }
.conversation-input textarea:focus { outline: none; border-color: var(--primary); background: #fff; box-shadow: 0 0 0 3px var(--primary-50); }
.conversation-input button { width: 40px; height: 40px; border: 0; border-radius: 50%; background: var(--primary); color: #fff; display: grid; place-items: center; cursor: pointer; transition: background .15s; }
.conversation-input button:hover { background: var(--primary-600); }
.conversation-menu { display: none; position: absolute; top: calc(100% + 4px); right: 0; z-index: 100; min-width: 220px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-md); padding: 4px; }
.conversation-menu.active { display: block; animation: fadeSlide .15s ease-out; }
.menu-item { padding: 9px 12px; border-radius: 8px; color: var(--text); font-size: 13px; cursor: pointer; }
.menu-item:hover { background: var(--danger-50); color: var(--danger); }
.menu-item i { margin-right: 8px; }

/* ---------- 14. Alertes, bandeau effectifs, avertissement ---------- */
#userAlertsContainer { padding-top: 12px; background: rgba(11, 31, 58, .25); backdrop-filter: blur(2px); }
#userAlertsContainer .alert {
    max-width: 720px; margin: 12px auto !important;
    background: var(--surface); color: var(--text);
    border: 1px solid var(--border); border-left: 4px solid var(--warning); border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg); animation: fadeSlide .25s ease-out;
}
#userAlertsContainer .alert .alert-heading { font-size: 15px; font-weight: 600; color: var(--text); }
#userAlertsContainer .alert hr { border-color: var(--border); opacity: 1; }

.eff-bandeau { background: var(--warning-50); border: 1px solid #F6DDB8; border-radius: var(--radius-lg); padding: 14px 18px; }
.eff-bandeau.has-critique { background: var(--danger-50); border-color: #F5C9CE; }
.eff-bandeau-header { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.eff-bandeau-title { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 13.5px; color: var(--warning); }
.has-critique .eff-bandeau-title { color: var(--danger); }
.eff-bandeau-count { font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: #fff; color: var(--warning); }
.has-critique .eff-bandeau-count { color: var(--danger); }
.eff-bandeau-link { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 600; color: var(--primary); }
.eff-chips-wrapper { display: flex; flex-wrap: wrap; gap: 6px; position: relative; }
.eff-chip {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 5px 10px; border-radius: 8px; font-size: 12.5px; font-weight: 500; cursor: pointer;
    background: #fff; color: var(--warning); border: 1px solid #F6DDB8; transition: .15s;
}
.eff-chip.critique { color: var(--danger); border-color: #F5C9CE; }
.eff-chip:hover { box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.eff-detail-popup { width: 100%; max-width: 440px; padding: 14px 16px; margin-top: 4px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-md); font-size: 13px; }
.eff-detail-section { margin-bottom: 10px; }
.eff-detail-section:last-child { margin-bottom: 0; }
.eff-detail-section-title { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 4px; }
.eff-detail-item { display: flex; align-items: flex-start; gap: 6px; padding: 2px 0; color: var(--text); }
.eff-detail-item i { margin-top: 5px; font-size: 7px; flex-shrink: 0; }
.eff-badge-rempla, .eff-badge-conge-rempla { font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 999px; margin-left: 4px; }
.eff-badge-rempla { background: var(--primary-50); color: var(--primary); }
.eff-badge-conge-rempla { background: var(--success-50); color: var(--success); }
.eff-stat-line { display: flex; flex-wrap: wrap; gap: 14px; padding: 7px 10px; margin-bottom: 10px; border-radius: 8px; background: var(--surface-2); font-size: 12.5px; color: var(--text-2); }
.eff-stat-line span { font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }

.eff-warning-overlay { position: fixed; inset: 0; z-index: 9999; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(11, 31, 58, .35); backdrop-filter: blur(2px); animation: fadeIn .15s ease; }
.eff-warning-modal { width: 100%; max-width: 520px; background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); overflow: hidden; animation: fadeSlide .2s ease; }
.eff-warning-header { display: flex; align-items: center; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--border); }
.eff-warning-header .icon-wrap { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: var(--warning-50); color: var(--warning); flex-shrink: 0; }
.eff-warning-header h3 { margin: 0; font-size: 15px; font-weight: 600; }
.eff-warning-header p { margin: 2px 0 0; font-size: 12.5px; color: var(--muted); }
.eff-warning-body { padding: 18px 22px; }
.eff-warning-intro { font-size: 13.5px; color: var(--text-2); margin-bottom: 12px; }
.eff-warning-days { max-height: 220px; overflow-y: auto; border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 12px; }
.eff-warning-day { display: flex; align-items: center; justify-content: space-between; padding: 9px 12px; border-bottom: 1px solid var(--border); font-size: 13px; }
.eff-warning-day:last-child { border-bottom: 0; }
.eff-warning-day .day-manque { font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--danger-50); color: var(--danger); }
.eff-warning-day .day-manque.alerte { background: var(--warning-50); color: var(--warning); }
.eff-warning-note { font-size: 12px; color: var(--muted); margin: 0; }
.eff-warning-footer { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 22px; border-top: 1px solid var(--border); background: var(--surface-2); }
.eff-btn-cancel, .eff-btn-confirm { height: 38px; padding: 0 16px; border-radius: var(--radius); font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; }
.eff-btn-cancel { border: 1px solid var(--border); background: var(--surface); color: var(--text); }
.eff-btn-cancel:hover { background: var(--surface-2); }
.eff-btn-confirm { border: 0; background: var(--warning); color: #fff; }
.eff-btn-confirm:hover { filter: brightness(.94); }

/* ---------- 15. Vue Clinique Grimaldi ---------- */
.dashboard-container-grimaldi { width: 100%; }
.grimaldi-section-header {
    display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
    padding: 18px 22px; margin-bottom: 20px;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-xs);
}
.grimaldi-section-title h5 { margin: 0 0 2px; font-size: 16px; font-weight: 600; display: flex; align-items: center; }
.grimaldi-section-title h5 i { color: var(--primary); opacity: 1 !important; }
.grimaldi-section-title small { color: var(--muted); font-size: 12.5px; }
.grimaldi-week-nav { display: flex; align-items: center; gap: 4px; padding: 4px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2); }
.grimaldi-week-nav .week-label { min-width: 170px; text-align: center; font-weight: 600; font-size: 13px; padding: 0 8px; }
.grimaldi-week-nav .week-label small { display: block; font-weight: 400; font-size: 11.5px; color: var(--muted); }
.grimaldi-nav-btn { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; color: var(--text-2); font-size: 12px; transition: .15s; }
.grimaldi-nav-btn:hover { background: var(--surface); color: var(--primary); box-shadow: var(--shadow-xs); }
.grimaldi-nav-btn.today-btn { width: auto; padding: 0 12px; display: inline-flex; align-items: center; font-size: 12.5px; font-weight: 600; }
.grimaldi-nav-btn.today-btn.active-week { background: var(--primary); color: #fff; }

.grimaldi-week-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; }
.grimaldi-past-week .grimaldi-week-grid { opacity: .75; }
.grimaldi-day-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-xs); transition: box-shadow .15s; }
.grimaldi-day-card:hover { box-shadow: var(--shadow-md); }
.grimaldi-day-card.today-card { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-50); }
.grimaldi-day-header { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.grimaldi-day-card.today-card .grimaldi-day-header { background: var(--primary-50); }
.grimaldi-day-name { font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.grimaldi-day-card.today-card .grimaldi-day-name { color: var(--primary); }
.grimaldi-day-date { font-size: 14px; font-weight: 600; color: var(--text); }
.grimaldi-count-badge { min-width: 24px; height: 24px; padding: 0 7px; border-radius: 999px; display: grid; place-items: center; background: var(--primary-50); color: var(--primary); font-size: 12px; font-weight: 700; }
.grimaldi-count-badge.empty-badge { background: var(--surface-2); color: var(--muted); }
.grimaldi-day-body { padding: 10px; min-height: 80px; }
.grimaldi-anesth-pill { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 9px; margin-bottom: 4px; transition: background .15s; }
.grimaldi-anesth-pill:hover { background: var(--surface-2); }
.grimaldi-anesth-avatar { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--primary-50); color: var(--primary); font-size: 11px; font-weight: 700; flex-shrink: 0; text-transform: uppercase; }
.grimaldi-anesth-info { min-width: 0; }
.grimaldi-anesth-name { font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.grimaldi-anesth-time { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.grimaldi-empty-day { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 18px 8px; color: var(--muted); font-size: 12.5px; }
.grimaldi-empty-day i { opacity: .5; }
.grimaldi-no-planning { padding: 48px 24px; text-align: center; color: var(--muted); background: var(--surface); border: 1px dashed var(--border-strong); border-radius: var(--radius-lg); }
.grimaldi-no-planning i { display: block; font-size: 28px; margin-bottom: 10px; opacity: .5; }
.grimaldi-no-planning h6 { color: var(--text); font-weight: 600; }
.grimaldi-summary-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 20px; margin-top: 14px; padding: 12px 18px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); font-size: 13px; }
.grimaldi-summary-item { display: flex; align-items: center; gap: 8px; color: var(--text-2); }
.grimaldi-summary-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--success); }

/* ---------- 15b. Pages formulaire (templates héritant de base.html) ---------- */
.page-narrow { max-width: 760px; }
.page-form { max-width: 1180px; }

/* Formulaire + panneau latéral (récapitulatif, règles) */
.form-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: start; }
.form-aside { position: sticky; top: calc(var(--topbar-h) + 20px); display: flex; flex-direction: column; gap: 16px; }
.aside-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-xs); padding: 18px 20px; }
.aside-card h3 { margin: 0 0 12px; font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.summary-hero { display: flex; align-items: baseline; gap: 8px; padding-bottom: 14px; margin-bottom: 4px; border-bottom: 1px solid var(--border); }
.summary-hero .value { font-size: 30px; font-weight: 700; letter-spacing: -.02em; line-height: 1; color: var(--text); font-variant-numeric: tabular-nums; }
.summary-hero .unit { font-size: 13.5px; color: var(--text-2); }
.summary-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.summary-row:last-child { border-bottom: 0; padding-bottom: 0; }
.summary-row .label { color: var(--muted); }
.summary-row .val { font-weight: 600; color: var(--text); text-align: right; }
.summary-row .val.empty { font-weight: 400; color: #A3AEBD; }
.summary-empty { font-size: 13px; color: var(--muted); }
.tips { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.tips li { display: flex; gap: 10px; font-size: 13px; color: var(--text-2); line-height: 1.45; }
.tips li i { color: var(--primary); font-size: 12px; margin-top: 3px; width: 14px; text-align: center; flex-shrink: 0; }
.tips strong { color: var(--text); font-weight: 600; }
@media (max-width: 992px) {
    .form-layout { grid-template-columns: minmax(0, 1fr); }
    .form-aside { position: static; }
}
.page-medium { max-width: 1080px; }
.back-link { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 14px; font-size: 13px; font-weight: 600; color: var(--text-2); }
.back-link:hover { color: var(--primary); }
.back-link i { font-size: 11px; }

.form-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-xs); }
.form-card-header { display: flex; align-items: center; gap: 12px; padding: 18px 24px; border-bottom: 1px solid var(--border); }
.form-card-header h2 { margin: 0; font-size: 16px; font-weight: 600; }
.form-card-header p { margin: 2px 0 0; font-size: 13px; color: var(--muted); }
.form-card-body { padding: 24px; }
.form-card-footer { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; padding: 16px 24px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 var(--radius-lg) var(--radius-lg); }

.field { margin-bottom: 20px; }
.field:last-child { margin-bottom: 0; }
.field-label { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; font-size: 13.5px; font-weight: 600; color: var(--text); }
.field-label i { font-size: 12px; color: var(--muted); width: 14px; text-align: center; }
.field-label .optional { font-weight: 400; color: var(--muted); font-size: 12.5px; }
.field-hint { margin-top: 6px; font-size: 12.5px; color: var(--muted); }
.field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }

.form-select { border: 1px solid var(--border); border-radius: var(--radius); padding: 9px 36px 9px 12px; font-size: 13.5px; color: var(--text); }
.form-select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-50); }
.form-select:disabled, .form-control:disabled { background-color: var(--surface-2); color: var(--muted); }
textarea.form-control { resize: vertical; min-height: 90px; }
.form-control::placeholder { color: #A3AEBD; }
.flatpickr-input[readonly], .form-control.input[readonly] { background-color: var(--surface); cursor: pointer; }

.input-group-text { background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2); font-size: 13px; font-weight: 600; border-radius: var(--radius) 0 0 var(--radius); }
.input-group > .form-control { border-radius: 0 var(--radius) var(--radius) 0; }

/* Choix exclusifs (ex. avant/après OU entre) */
.choice-block { padding: 16px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2); }
.choice-block-title { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 12px; }
.or-divider { display: flex; align-items: center; gap: 12px; margin: 14px 0; font-size: 12px; font-weight: 700; color: var(--muted); letter-spacing: .08em; }
.or-divider::before, .or-divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }

.info-note { display: flex; gap: 10px; padding: 12px 14px; border-radius: var(--radius); background: var(--primary-50); color: var(--text-2); font-size: 13px; margin-bottom: 20px; }
.info-note i { color: var(--primary); margin-top: 2px; }

.flash-messages { display: flex; flex-direction: column; gap: 8px; margin-bottom: 20px; }
.flash { padding: 12px 16px; border-radius: var(--radius); border: 1px solid var(--border); border-left: 4px solid var(--primary); background: var(--surface); font-size: 13.5px; }
.flash-success { border-left-color: var(--success); }
.flash-warning { border-left-color: var(--warning); }
.flash-error, .flash-danger { border-left-color: var(--danger); }

.btn-app:disabled { opacity: .65; cursor: not-allowed; }

/* ---------- 16. Footer ---------- */
.app-footer { max-width: 1680px; margin: 40px auto 0; padding: 20px 24px 28px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; border-top: 1px solid var(--border); color: var(--muted); font-size: 12.5px; }
.app-footer a { color: var(--text-2); }
.app-footer a:hover { color: var(--primary); }

/* ---------- 17. Animations ---------- */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeSlide { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }

/* ---------- 18. Responsive ---------- */
@media (max-width: 1400px) {
    .grimaldi-week-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1280px) {
    .right-column { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 992px) {
    .dashboard-container { grid-template-columns: minmax(0, 1fr); }
    .left-column { position: static; max-height: none; }
    .grimaldi-week-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 768px) {
    .topbar-inner, .page { padding-left: 16px; padding-right: 16px; }
    .topbar-nav, .user-chip-text, .brand small, .topbar-sep { display: none; }
    .user-chip { padding: 3px; }
    .page-title { font-size: 22px; }
    .slot-room { margin-left: 0; width: 100%; }
    .grimaldi-week-grid { grid-template-columns: minmax(0, 1fr); }
    .grimaldi-week-nav .week-label { min-width: 120px; }
}

/* Bouton « effacer » dans un champ (heures flatpickr en lecture seule) */
.input-clearable { position: relative; }
.input-clearable .form-control { padding-right: 38px; }
.input-clear {
    position: absolute; right: 6px; top: 50%; transform: translateY(-50%); z-index: 5;
    width: 26px; height: 26px; padding: 0; border: 0; border-radius: 6px;
    display: none; place-items: center; background: transparent; color: var(--muted); font-size: 12px; cursor: pointer;
}
.input-clearable.has-value .input-clear { display: grid; }
.input-clear:hover { background: var(--danger-50); color: var(--danger); }
.input-group > .input-clear { margin-left: 0 !important; border-radius: 6px !important; }

/* ==========================================================================
   19. Composants de pages de gestion (listes, tableaux, onglets, KPI…)
   ========================================================================== */
.page-wide { max-width: 1440px; }

/* Boutons complémentaires */
.btn-app-sm { height: 32px; padding: 0 12px; font-size: 12.5px; border-radius: 8px; }
.btn-app-danger { background: var(--surface); color: var(--danger); border-color: #F2C4C9; }
.btn-app-danger:hover { background: var(--danger-50); color: var(--danger); }
.btn-app-success { background: var(--success); color: #fff; }
.btn-app-success:hover { filter: brightness(.94); color: #fff; }
.btn-app-ghost { background: transparent; color: var(--text-2); }
.btn-app-ghost:hover { background: var(--surface-2); color: var(--text); }

/* Petites actions iconiques dans les tableaux */
.row-actions { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.act { height: 30px; padding: 0 10px; display: inline-flex; align-items: center; gap: 6px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); font-size: 12.5px; font-weight: 600; cursor: pointer; transition: .15s; white-space: nowrap; }
.act:hover { border-color: var(--border-strong); background: var(--surface-2); color: var(--text); }
.act.danger:hover { background: var(--danger-50); border-color: #F2C4C9; color: var(--danger); }
.act.primary { color: var(--primary); }
.act.primary:hover { background: var(--primary-50); border-color: var(--primary-100); }
.act-icon { width: 30px; padding: 0; justify-content: center; }

/* Barre d'outils (filtres au-dessus d'un tableau) */
.toolbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.toolbar-group { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.toolbar .field { margin: 0; min-width: 170px; }
.toolbar .field-label { font-size: 12px; margin-bottom: 4px; }
.form-select-sm, .form-control-sm { height: 34px; padding-top: 5px; padding-bottom: 5px; font-size: 13px; border-radius: 8px; }

/* Liste de lignes cliquables */
.list-rows { display: flex; flex-direction: column; }
.list-row { display: flex; align-items: center; gap: 14px; padding: 14px 20px; border-bottom: 1px solid var(--border); transition: background .15s; }
.list-row:last-child { border-bottom: 0; }
.list-row:hover { background: var(--surface-2); }
.list-row-icon { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--primary-50); color: var(--primary); flex-shrink: 0; }
.list-row-main { flex: 1; min-width: 0; }
.list-row-title { font-weight: 600; font-size: 14px; }
.list-row-sub { font-size: 12.5px; color: var(--muted); }

/* Tableaux */
.table-app { width: 100%; margin: 0; font-size: 13.5px; color: var(--text); --bs-table-hover-bg: var(--surface-2); --bs-table-striped-bg: transparent; }
.table-app > :not(caption) > * > * { padding: 12px 16px; border-bottom-color: var(--border); background-color: transparent; }
.table-app thead th { font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); background: var(--surface-2) !important; white-space: nowrap; border-bottom: 1px solid var(--border); }
.table-app tbody tr:last-child > * { border-bottom: 0; }
.table-app > :not(:first-child) { border-top: 0; }
.table-app td { vertical-align: middle; }
.table-app.table-sm > :not(caption) > * > * { padding: 8px 12px; }
.info-card-body.flush { padding: 0; }
.cell-strong { font-weight: 600; }
.cell-muted { color: var(--muted); }
.person { display: flex; align-items: center; gap: 10px; }
.person .avatar { width: 30px; height: 30px; font-size: 11px; }

/* Onglets soulignés */
.tabs-app { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 20px; overflow-x: auto; flex-wrap: nowrap; padding: 0; list-style: none; }
.tabs-app .nav-link, .tabs-app > button { display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; margin-bottom: -1px; border: 0; border-bottom: 2px solid transparent; border-radius: 0; background: none; color: var(--text-2); font-size: 13.5px; font-weight: 600; white-space: nowrap; cursor: pointer; }
.tabs-app .nav-link:hover, .tabs-app > button:hover { color: var(--text); }
.tabs-app .nav-link.active, .tabs-app > button.active { color: var(--primary); border-bottom-color: var(--primary); background: none; }
.tabs-app .nav-link i, .tabs-app > button i { font-size: 12.5px; }

/* Contrôle segmenté (choix d'un type) */
.segmented { display: inline-flex; gap: 4px; padding: 4px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); flex-wrap: wrap; }
.segmented button { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 14px; border: 0; border-radius: 8px; background: transparent; color: var(--text-2); font-size: 13px; font-weight: 600; cursor: pointer; transition: .15s; }
.segmented button:hover { color: var(--text); }
.segmented button.active { background: var(--surface); color: var(--primary); box-shadow: var(--shadow-sm); }

/* Filtres en pastilles */
.filter-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.filter-chips button, .filter-btn { height: 30px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); font-size: 12.5px; font-weight: 600; cursor: pointer; transition: .15s; }
.filter-chips button:hover, .filter-btn:hover { border-color: var(--border-strong); color: var(--text); }
.filter-chips button.active, .filter-btn.active { background: var(--primary); border-color: var(--primary); color: #fff; }

/* Statuts */
.status-badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.status-badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status-pending  { background: var(--warning-50); color: var(--warning); }
.status-approved { background: var(--success-50); color: var(--success); }
.status-rejected { background: var(--danger-50);  color: var(--danger); }
.type-tag { display: inline-flex; padding: 3px 9px; border-radius: 6px; background: #EEF1F5; color: var(--text-2); font-size: 12px; font-weight: 600; white-space: nowrap; }

/* Indicateurs chiffrés */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-bottom: 24px; }
.kpi-card { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 16px 18px 16px 22px; box-shadow: var(--shadow-xs); overflow: hidden; }
.kpi-card::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--kpi, var(--primary)); }
.kpi-label { font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.kpi-value { font-size: 28px; font-weight: 700; letter-spacing: -.02em; line-height: 1.2; margin-top: 4px; color: var(--text); font-variant-numeric: tabular-nums; }
.kpi-sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.kpi-blue { --kpi: var(--primary); } .kpi-green { --kpi: var(--success); } .kpi-orange { --kpi: #E08A1E; } .kpi-red { --kpi: var(--danger); } .kpi-purple { --kpi: var(--violet); }

/* Légende */
.legende { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--text-2); }
.legende-item { display: inline-flex; align-items: center; gap: 6px; }
.legende-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }

/* Bandeau d'information dans une carte */
.callout { display: flex; gap: 10px; padding: 12px 14px; border-radius: var(--radius); font-size: 13px; line-height: 1.5; }
.callout i { margin-top: 3px; }
.callout-info { background: var(--primary-50); color: var(--text-2); } .callout-info i { color: var(--primary); }
.callout-warning { background: var(--warning-50); color: #7A4A0B; } .callout-warning i { color: var(--warning); }
.callout-success { background: var(--success-50); color: #0E5E44; } .callout-success i { color: var(--success); }
.callout-danger { background: var(--danger-50); color: #8E2029; } .callout-danger i { color: var(--danger); }

/* Notifications (toast) */
.toast-stack { position: fixed; right: 24px; bottom: 24px; z-index: 11000; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.toast-app { display: flex; align-items: center; gap: 10px; max-width: min(400px, calc(100vw - 32px)); padding: 12px 14px; background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--primary); border-radius: var(--radius); box-shadow: var(--shadow-lg); font-size: 13.5px; color: var(--text); animation: fadeSlide .2s ease-out; }
.toast-app i { font-size: 16px; color: var(--primary); }
.toast-app.success { border-left-color: var(--success); } .toast-app.success i { color: var(--success); }
.toast-app.warning { border-left-color: var(--warning); } .toast-app.warning i { color: var(--warning); }
.toast-app.danger, .toast-app.error { border-left-color: var(--danger); } .toast-app.danger i, .toast-app.error i { color: var(--danger); }

/* Chargement global */
.loading-overlay { position: fixed; inset: 0; z-index: 10500; display: none; align-items: center; justify-content: center; background: rgba(244, 246, 250, .7); backdrop-filter: blur(2px); }
.loading-overlay.show { display: flex; }
.loading-box { display: flex; align-items: center; gap: 12px; padding: 14px 20px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-md); font-weight: 600; color: var(--text-2); }

/* Cases à cocher lisibles */
.form-check-input { border-color: var(--border-strong); }
.form-check-input:checked { background-color: var(--primary); border-color: var(--primary); }
.form-check-input:focus { box-shadow: 0 0 0 3px var(--primary-50); border-color: var(--primary); }

@media (max-width: 768px) {
    .table-app > :not(caption) > * > * { padding: 10px 12px; }
    .toast-stack { left: 16px; right: 16px; bottom: 16px; align-items: stretch; }
}
.pill:empty { display: none; }