/* Calendrier accompagnements, exclusivement sous #hd-calendar-page. */
#hd-calendar-page {
    --hd-ink:#334861;
    --hd-muted:#8394ac;
    --hd-line:#e2e8f0;
    --hd-surface:#fff;
    --hd-soft:#f5f7fb;
    --hd-green:#16cb86;
    --hd-blue:#167bfa;
    --hd-orange:#ff9f1a;
    --hd-grey:#94a3b8;
    color:var(--hd-ink);
    padding:2px 0 28px;
    max-width:100%;
}
#hd-calendar-page *{box-sizing:border-box}
#hd-calendar-page button,#hd-calendar-page input,#hd-calendar-page select{font:inherit}
#hd-calendar-page .hd-page-header{display:flex;justify-content:space-between;align-items:center;flex-wrap:wrap;gap:12px;margin:0 0 22px}
#hd-calendar-page .hd-page-header h2{font-size:25px;line-height:1.3;font-weight:700;color:var(--hd-ink);margin:0;letter-spacing:-.35px}
#hd-calendar-page .hd-header-actions{display:flex;gap:10px;flex-wrap:wrap}
#hd-calendar-page .hd-header-actions .btn{display:flex;align-items:center;gap:8px;justify-content:center;padding:9px 13px;font-weight:600}
#hd-calendar-page .hd-header-actions .btn-dark{background:#121419;border-color:#121419}
#hd-calendar-page .hd-stats-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;margin-bottom:12px}
#hd-calendar-page .hd-stat{background:#fff;border-radius:10px;min-height:78px;padding:17px;display:flex;align-items:center;gap:15px}
#hd-calendar-page .hd-stat-icon{width:39px;height:39px;display:grid;place-items:center;flex:0 0 39px;border-radius:13px;font-size:22px}
#hd-calendar-page .hd-stat-total,#hd-calendar-page .hd-stat-planned{color:#168aff;background:#edf3ff}
#hd-calendar-page .hd-stat-pending{color:#ff9f1a;background:#fff6e2}
#hd-calendar-page .hd-stat-completed{color:#10bf80;background:#e6fbf3}
#hd-calendar-page .hd-stat small{display:block;color:#8294af;font-weight:650;font-size:14px;margin-bottom:1px}
#hd-calendar-page .hd-stat strong{font-size:22px;line-height:1.2;color:var(--hd-ink)}
#hd-calendar-page .hd-calendar-layout{display:grid;grid-template-columns:minmax(250px,282px) minmax(0,1fr);gap:12px;align-items:start}
#hd-calendar-page .hd-calendar-sidebar{display:flex;flex-direction:column;gap:12px;min-width:0}
#hd-calendar-page .hd-panel{background:#fff;border-radius:11px;min-width:0}
#hd-calendar-page .hd-calendar-sidebar .hd-panel{padding:17px 18px}
#hd-calendar-page h3{font-size:16px;font-weight:700;color:var(--hd-ink);margin:1px 0 14px}
#hd-calendar-page .hd-count{background:#fff4d8;color:#ef9700;font-size:13px;font-weight:700;padding:3px 8px;border-radius:25px;margin-left:4px}
#hd-calendar-page .hd-blue{background:#e9f1ff;color:#168aff}
#hd-calendar-page .hd-pending-list{max-height:330px;overflow-y:auto;display:flex;flex-direction:column;gap:7px}
#hd-calendar-page .hd-event{display:block;text-decoration:none;color:#101b2c!important;}
#hd-calendar-page .hd-pending-event{border-left:3px solid var(--hd-orange);border-radius:6px;background:#fff7dd;padding:7px 8px;box-shadow:0 2px 5px #253b5d0a}
#hd-calendar-page .hd-pending-event strong{display:block;font-size:13px;font-weight:750;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}
#hd-calendar-page .hd-pending-event span{display:block;font-size:12px;margin-top:2px;color:#536482}
#hd-calendar-page .hd-pending-event small{display:block;font-size:12px;color:#72829d;font-style:italic;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}
#hd-calendar-page .hd-guides-panel h3{margin-bottom:12px}
#hd-calendar-page .hd-search-wrap{position:relative;margin-bottom:12px}
#hd-calendar-page .hd-search-wrap input{font-size:14px;padding-right:29px;height:32px;border:1px solid #dce3ee}
#hd-calendar-page .hd-search-wrap .icon{position:absolute;right:10px;top:8px;color:#8294af;font-size:17px}
#hd-calendar-page .hd-select-all{display:flex;align-items:center;gap:8px;font-weight:700;font-size:14px;color:var(--hd-ink);margin-bottom:7px;cursor:pointer}
#hd-calendar-page input[type=checkbox]{accent-color:#111;cursor:pointer}
#hd-calendar-page .hd-guides-list{max-height:690px;overflow-y:auto;padding-right:1px}
#hd-calendar-page .hd-guide-row{display:flex;align-items:center;gap:9px;padding:7px 0;border-bottom:1px solid #f0f3f8;cursor:pointer}
#hd-calendar-page .hd-guide-row:last-child{border-bottom:none}
#hd-calendar-page .hd-guide-row>input{margin:0;flex:0 0 auto}
#hd-calendar-page .hd-avatar{width:34px;height:34px;border-radius:50%;display:flex;align-items:center;justify-content:center;flex:0 0 34px;color:#fff;font-weight:700;font-size:13px;overflow:hidden}
#hd-calendar-page .hd-avatar-sm{width:25px;height:25px;flex-basis:25px;font-size:12px}
#hd-calendar-page .hd-guide-info{display:block;min-width:0;flex:1}
#hd-calendar-page .hd-guide-name{display:flex;align-items:center;justify-content:space-between;gap:5px;margin-bottom:7px;font-size:14px;color:#152235}
#hd-calendar-page .hd-guide-name b{font-weight:700;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#hd-calendar-page .hd-work-badge{display:block;color:#fff;border-radius:25px;padding:2px 7px;font-size:12px;flex-shrink:0;white-space:nowrap;font-weight:750}
#hd-calendar-page .hd-progress{height:5px;background:#c0c0c0;border-radius:5px;display:block;overflow:hidden}
#hd-calendar-page .hd-progress>span{height:100%;display:block;border-radius:5px}
#hd-calendar-page .hd-sidebar-footnote{color:#8190a6;font-size:12px;line-height:1.5;margin:11px 0 0}
#hd-calendar-page .hd-calendar-main{padding:14px 17px 12px}
#hd-calendar-page .hd-calendar-filterbar{display:flex;gap:8px;margin-bottom:10px; width: fit-content;}
#hd-calendar-page .hd-calendar-filterbar select{max-width:160px;min-width:125px;height:30px;border:1px solid #dce3ef;color:#60718b;font-size:13px;padding:4px 25px 4px 9px;border-radius:5px}
#hd-calendar-page .hd-calendar-toolbar{display:flex;align-items:center;justify-content:space-between;gap:8px;flex-wrap:wrap;margin-bottom:13px}
#hd-calendar-page .hd-calendar-nav,#hd-calendar-page .hd-calendar-actions,#hd-calendar-page .hd-calendar-views{display:flex;align-items:center;gap:7px}
#hd-calendar-page .hd-calendar-nav strong{font-size:15px;min-width:0;margin-right:8px;font-weight:750;color:#405779}
#hd-calendar-page .hd-calendar-nav button{color:#6f86a9;border:0;background:none;cursor:pointer;padding:6px 8px}
#hd-calendar-page .hd-calendar-nav button:hover{background:#f2f5fa;border-radius:4px}
#hd-calendar-page .hd-calendar-actions{gap:8px}
#hd-calendar-page .hd-calendar-actions button{font-size:13px;font-weight:650;border:1px solid #dde5ef;background:#fff;color:#6a7d9a;cursor:pointer;padding:7px 12px;min-height:29px}
#hd-calendar-page .hd-calendar-actions button:hover{background:#f5f7fa}
#hd-calendar-page .hd-calendar-actions button.active{background:#f0f2f8;color:#334862}
#hd-calendar-page .hd-calendar-actions .hd-today{border-radius:4px;margin-right:1px}
#hd-calendar-page .hd-calendar-views{gap:0}
#hd-calendar-page .hd-calendar-views button:not(:last-child){border-right:0}
#hd-calendar-page .hd-calendar-views button:first-child{border-radius:5px 0 0 5px}
#hd-calendar-page .hd-calendar-views button:last-child{border-radius:0 5px 5px 0}
#hd-calendar-page .hd-calendar-content{min-width:0;border:1px solid #e0e6f0;border-radius:8px;overflow:hidden}
#hd-calendar-page .hd-empty{color:#8290a8;font-size:13px;line-height:1.5;padding:12px 3px}
#hd-calendar-page .hd-no-guides{padding:60px 18px;text-align:center}
#hd-calendar-page .hd-legend{display:flex;gap:13px;flex-wrap:wrap;margin:9px 1px 0;font-size:12px;color:#667b97}
#hd-calendar-page .hd-legend>span{display:flex;align-items:center;gap:6px}
#hd-calendar-page .hd-legend-dot{width:8px;height:8px;border-radius:2px;display:inline-block}
#hd-calendar-page .hd-legend-completed{background:var(--hd-green)}
#hd-calendar-page .hd-legend-planned{background:var(--hd-blue)}
#hd-calendar-page .hd-legend-pending{background:var(--hd-orange)}
#hd-calendar-page .hd-legend-other{background:var(--hd-grey)}
#hd-calendar-page .hd-calendar-error{background:#fff1f1;color:#a6282f;padding:12px;border-radius:5px;margin-top:8px;font-size:14px}
#hd-calendar-page .hd-calendar-error[hidden]{display:none}
#hd-calendar-page.hd-is-loading .hd-calendar-content{opacity:.62}
/* FullCalendar mois. Toutes les cartes sont les badges agrégés, pas des événements individuels. */
#hd-calendar-page .fc{color:var(--hd-ink);font-size:13px}
#hd-calendar-page .fc .fc-scrollgrid{border:none}
#hd-calendar-page .fc-theme-standard td,#hd-calendar-page .fc-theme-standard th{border-color:#e2e8f2}
#hd-calendar-page .fc .fc-col-header-cell{background:#f7f9fc}
#hd-calendar-page .fc .fc-col-header-cell-cushion{font-size:13px;font-weight:700;color:#526887;padding:6px 3px;text-transform:capitalize}
#hd-calendar-page .fc .fc-daygrid-day{cursor:pointer}
#hd-calendar-page .fc .fc-daygrid-day:hover{background:#f9fbff}
#hd-calendar-page .fc .fc-daygrid-day.fc-day-today,#hd-calendar-page .fc .hd-today-cell{background:#fff9e6}
#hd-calendar-page .fc .fc-daygrid-day-number{color:#567190;font-size:13px;padding:6px 7px;text-decoration:none}
#hd-calendar-page .fc .fc-daygrid-day-frame{min-height:105px}
#hd-calendar-page .fc .fc-daygrid-day-events{min-height:0;margin:0 4px 5px}
#hd-calendar-page .hd-month-badges{display:flex;align-items:flex-start;flex-direction:column;gap:4px;padding:0 1px 2px}
#hd-calendar-page .hd-month-badge{display:block;max-width:100%;padding:4px 5px;border-radius:2px;font-size:12px;line-height:1.1;font-weight:600;overflow-wrap:anywhere}
#hd-calendar-page .hd-month-completed{color:#01b977;background:#e0f9ec}
#hd-calendar-page .hd-month-planned{color:#2366fa;background:#eaf0ff}
#hd-calendar-page .hd-month-pending{color:#ea8800;background:#fff2e5}
#hd-calendar-page .hd-month-other{color:#64748b;background:#f1f5f9}
/* Vues guides personnalisées */
#hd-calendar-page .hd-view-root{min-width:0}
#hd-calendar-page .hd-heading-name{font-size:13px;font-weight:700;white-space:nowrap;overflow:hidden;text-overflow:ellipsis; max-width: 100%;}
#hd-calendar-page .hd-day-scroll,#hd-calendar-page .hd-week-scroll{overflow:auto;max-height:790px;position:relative}
#hd-calendar-page .hd-day-grid,#hd-calendar-page .hd-week-grid{display:grid;width:100%;align-items:stretch}
#hd-calendar-page .hd-day-header{display:flex;gap:6px;align-items:center;justify-content:center;background:#fff;border-bottom:3px solid #e3e8f1;border-right:1px solid #dfe5ee;min-height:37px;padding:3px;position:sticky;top:0;z-index:4}
#hd-calendar-page .hd-day-corner{left:0;z-index:6}
#hd-calendar-page .hd-day-hour-col{position:sticky;left:0;background:#fff;z-index:3;border-right:1px solid #dfe5ee}
#hd-calendar-page .hd-hour-label{position:absolute;right:5px;font-size:12px;color:#5f7394;transform:translateY(-50%)}
#hd-calendar-page .hd-day-guide-col{position:relative;border-right:1px solid #dae2ed;background-image:linear-gradient(to bottom,#e5eaf2 1px,transparent 1px),linear-gradient(to bottom,#f1f3f8 1px,transparent 1px);background-size:100% var(--hd-hour-height),100% calc(var(--hd-hour-height)/2)}
#hd-calendar-page .hd-day-position{position:absolute;min-width:0;z-index:1}
#hd-calendar-page .hd-now-line{position:absolute;left:0;right:0;border-top:1px solid #f4433c;z-index:2;pointer-events:none}
#hd-calendar-page .hd-now-line::before{content:'';position:absolute;left:-4px;top:-4px;background:#f4433c;width:8px;height:8px;border-radius:50%}
#hd-calendar-page .hd-day-position>.hd-event{height:100%;padding:5px 6px}
#hd-calendar-page .hd-week-heading{background:#f7f9fc;border:0;border-right:1px solid var(--hd-line);border-bottom:1px solid var(--hd-line);font-size:13px;color:#526887;font-weight:700;min-height:26px;cursor:pointer;position:sticky;top:0;z-index:4;text-transform:capitalize}
#hd-calendar-page .hd-week-corner{left:0;z-index:6}
#hd-calendar-page .hd-week-guide{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;border-right:1px solid var(--hd-line);border-bottom:1px solid var(--hd-line);background:#fff;min-height:110px;position:sticky;left:0;z-index:3;text-align:center;padding:7px 3px}
#hd-calendar-page .hd-week-cell{border-right:1px solid var(--hd-line);border-bottom:1px solid var(--hd-line);min-height:110px;display:flex;flex-direction:column;gap:4px;padding:5px;background:#fff;cursor:pointer}
#hd-calendar-page .hd-week-today{background:#fff9e6}
#hd-calendar-page .hd-event{background:#fff;border-radius:5px;border-left:3px solid var(--hd-blue);padding:5px 6px;box-shadow:0 1px 4px #1a375112;font-size:13px;line-height:1.3}
#hd-calendar-page .hd-event:hover{filter:brightness(.98);box-shadow:0 2px 7px #1a375126}
#hd-calendar-page .hd-event strong{display:block;font-size:13px;font-weight:750;color:#142033;overflow-wrap:anywhere}
#hd-calendar-page .hd-event .hd-event-time{display:block;font-size:12px;color:#314b6f;margin-top:2px}
#hd-calendar-page .hd-event small{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden;color:#536c87;font-size:12px;font-style:italic;margin-top:3px;overflow-wrap:anywhere}
#hd-calendar-page .hd-event-completed{background:#e2fcf2;border-left-color:var(--hd-green)}
#hd-calendar-page .hd-event-planned{background:#fff;border-left-color:var(--hd-blue)}
#hd-calendar-page .hd-event-pending{background:#fff9e9;border-left-color:var(--hd-orange)}
#hd-calendar-page .hd-event-other{background:#f6f7fa;border-left-color:var(--hd-grey)}
#hd-calendar-page .hd-list-view{max-height:790px;overflow:auto}
#hd-calendar-page .hd-list-day{padding:12px 16px;border-bottom:1px solid var(--hd-line)}
#hd-calendar-page .hd-list-day>h4{font-size:14px;color:#506584;margin:0 0 10px;text-transform:capitalize}
#hd-calendar-page .hd-list-event{display:flex;flex-direction:column;gap:2px;margin:5px 0;max-width:100%}
#hd-calendar-page .hd-list-guides{color:#7386a3;font-size:12px}
@media(max-width:1400px){
    #hd-calendar-page .hd-calendar-layout{grid-template-columns:minmax(225px,260px) minmax(0,1fr)}
    #hd-calendar-page .hd-calendar-main{padding:13px}
}
@media(max-width:990px){
    #hd-calendar-page .hd-stats-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
    #hd-calendar-page .hd-calendar-layout{grid-template-columns:minmax(0,1fr)}
    #hd-calendar-page .hd-calendar-sidebar{display:grid;grid-template-columns:repeat(2,minmax(0,1fr))}
    #hd-calendar-page .hd-guides-list{max-height:340px}
}
@media(max-width:620px){
    #hd-calendar-page .hd-page-header h2{font-size:20px}
    #hd-calendar-page .hd-page-header{align-items:flex-start}
    #hd-calendar-page .hd-header-actions .btn{padding:7px 9px;font-size:13px}
    #hd-calendar-page .hd-stat{padding:10px;min-height:65px;gap:8px}
    #hd-calendar-page .hd-stat-icon{width:32px;height:32px;flex-basis:32px}
    #hd-calendar-page .hd-stat small{font-size:12px}
    #hd-calendar-page .hd-stat strong{font-size:19px}
    #hd-calendar-page .hd-calendar-sidebar{display:flex}
    #hd-calendar-page .hd-calendar-toolbar{flex-direction:column;align-items:stretch}
    #hd-calendar-page .hd-calendar-actions{justify-content:space-between}
    #hd-calendar-page .hd-calendar-actions button{padding:7px 8px}
    #hd-calendar-page .hd-calendar-filterbar select{flex:1;max-width:none;min-width:100px}
    #hd-calendar-page .hd-calendar-main{padding:8px}
    #hd-calendar-page .fc .fc-daygrid-day-frame{min-height:88px}
    #hd-calendar-page .hd-month-badge{font-size:12px;padding:3px}
    #hd-calendar-page .hd-week-scroll,#hd-calendar-page .hd-day-scroll{max-height:620px}
}

#hd-calendar-page .hd-avatar img{width:100%;height:100%;object-fit:cover;display:block}

/* Page plein écran utile : uniquement quand le calendrier est présent.
 * :has() suit automatiquement l'injection AJAX et évite de toucher au layout
 * des autres pages qui gardent leur container-xl. */
@media (min-width: 992px) {
    .nk-content:has(#hd-calendar-page) {
        padding: 14px 18px 24px;
    }
    .nk-content:has(#hd-calendar-page) .container-xl.wide-xl {
        max-width: none !important;
        width: 100%;
        padding-left: 0;
        padding-right: 0;
        margin-left: 0;
        margin-right: 0;
    }
    #hd-calendar-page .hd-calendar-layout {
        grid-template-columns: minmax(285px, 315px) minmax(0, 1fr);
        gap: 16px;
    }
}
#hd-calendar-page { font-size: 14px; line-height: 1.45; }
#hd-calendar-page .hd-calendar-filterbar select {
    min-height: 38px;
    height: 38px;
}
#hd-calendar-page .hd-calendar-actions button {
    min-height: 36px;
}
#hd-calendar-page .hd-search-wrap input {
    height: 38px;
}
#hd-calendar-page .hd-event {
    line-height: 1.45;
}
#hd-calendar-page .hd-pending-event { padding: 10px 11px; }
#hd-calendar-page .hd-day-header { min-height: 45px; }
#hd-calendar-page .hd-guide-row { padding: 9px 0; }
#hd-calendar-page .hd-avatar-sm { width: 30px; height: 30px; flex-basis: 30px; }
#hd-calendar-page .hd-week-heading { min-height: 35px; }
#hd-calendar-page .hd-month-badge { line-height: 1.35; padding: 5px 7px; }
#hd-calendar-page .hd-page-header h2 { letter-spacing: -.45px; }
@media (max-width: 990px) {
    #hd-calendar-page .hd-calendar-layout { grid-template-columns: minmax(0, 1fr); }
}

/* Actions planning : glisser-déposer, attribution et menu contextuel. */
#hd-calendar-page .hd-pending-list {
    max-height: min(46vh, 430px);
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
    padding-right: 5px;
}
#hd-calendar-page .hd-pending-event[draggable="true"] {
    cursor: grab;
    position: relative;
    padding-right: 27px;
    user-select: none;
    -webkit-user-select: none;
}
#hd-calendar-page .hd-pending-event[draggable="true"]:active { cursor: grabbing; }
#hd-calendar-page .hd-pending-event .hd-drag-handle {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 20px;
    font-weight: 600;
    color: #cf8a17;
    display: block;
    margin: 0;
    pointer-events: none;
}
#hd-calendar-page.hd-is-dragging [data-drop-guide] {
    outline: 2px dashed #7f9fc7;
    outline-offset: -3px;
    transition: background-color .14s ease;
}
#hd-calendar-page.hd-is-dragging [data-drop-guide].hd-drop-over {
    outline: 3px solid #167bfa;
    outline-offset: -3px;
    background-color: #eaf3ff;
}
#hd-calendar-page .hd-event-shell {
    position: relative;
    min-width: 0;
    max-width: 100%;
    flex: 0 0 auto;
}
#hd-calendar-page .hd-event-shell > .hd-event { width: 100%; padding-right: 27px; }
#hd-calendar-page .hd-event-more {
    position: absolute;
    z-index: 2;
    top: 3px;
    right: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 25px;
    height: 24px;
    padding: 0;
    border: 0;
    border-radius: 5px;
    background: rgba(255,255,255,.9);
    color: #314b6f;
    font-size: 21px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
}
#hd-calendar-page .hd-event-more:hover,
#hd-calendar-page .hd-event-more:focus-visible { background: #d9e8ff; color: #075abe; }
#hd-calendar-page .hd-day-position > .hd-event-shell { height: 100%; }
#hd-calendar-page .hd-day-position > .hd-event-shell > .hd-event { height: 100%; padding: 5px 28px 5px 6px; }
#hd-calendar-page .hd-week-cell > .hd-event-shell { width: 100%; }
#hd-calendar-page .hd-list-event { margin: 0; }
#hd-calendar-page .hd-list-view .hd-event-shell { margin: 5px 0; }
#hd-calendar-page .hd-list-view .hd-event-shell > .hd-list-event { display: flex; flex-direction: column; gap: 2px; }
#hd-calendar-page .hd-calendar-context {
    position: fixed;
    z-index: 12000;
    width: min(340px, calc(100vw - 16px));
    max-height: min(440px, calc(100vh - 16px));
    overflow: auto;
    background: #fff;
    border: 1px solid #dce5f0;
    border-radius: 10px;
    box-shadow: 0 16px 40px rgba(31,50,75,.23);
    padding: 13px;
    color: #24364b;
    font-size: 14px;
}
#hd-calendar-page .hd-calendar-context[hidden] { display: none !important; }
#hd-calendar-page .hd-context-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
#hd-calendar-page .hd-context-header strong { display: block; font-size: 15px; line-height: 1.25; }
#hd-calendar-page .hd-context-header small { display: block; font-size: 13px; color: #637892; margin-top: 3px; }
#hd-calendar-page .hd-context-header > button { flex: 0 0 27px; border: 0; background: #f3f6fa; border-radius: 5px; font-size: 21px; line-height: 27px; cursor: pointer; }
#hd-calendar-page .hd-context-current { margin: 10px 0; font-size: 12px; line-height: 1.35; color: #64748b; }
#hd-calendar-page .hd-context-search { display: block; width: 100%; border-radius: 6px; padding: 9px 10px; background: #fff; border: 1px solid #ced8e5; font-size: 14px; }
#hd-calendar-page .hd-context-guide-list { margin-top: 8px; max-height: 240px; overflow-y: auto; }
#hd-calendar-page .hd-context-guide { width: 100%; display: flex; align-items: center; gap: 10px; padding: 8px 6px; background: transparent; color: #24364b; border: 0; border-radius: 6px; text-align: left; font-size: 14px; cursor: pointer; }
#hd-calendar-page .hd-context-guide > span:nth-child(2) { flex: 1; }
#hd-calendar-page .hd-context-guide:hover,#hd-calendar-page .hd-context-guide:focus-visible { background: #edf4ff; }
#hd-calendar-page .hd-calendar-feedback {
    position: fixed;
    z-index: 12010;
    right: 22px;
    bottom: 22px;
    max-width: min(410px, calc(100vw - 32px));
    padding: 12px 17px;
    border-radius: 8px;
    color: #fff;
    background: #196347;
    box-shadow: 0 12px 28px #1a375132;
    font-size: 14px;
    font-weight: 600;
}
#hd-calendar-page .hd-calendar-feedback[hidden] { display: none !important; }
#hd-calendar-page .hd-calendar-feedback.hd-feedback-error { background: #ab303b; }
#hd-calendar-page.hd-assigning .hd-event-more,
#hd-calendar-page.hd-assigning .hd-pending-event[draggable="true"] { pointer-events: none; opacity: .65; }
@media(max-width: 620px) {
    #hd-calendar-page .hd-pending-list { max-height: 310px; }
    #hd-calendar-page .hd-calendar-feedback { right: 12px; bottom: 12px; }
}

/* Réaffectation directe depuis les cartes du planning. */
#hd-calendar-page .hd-event-shell[draggable="true"] {
    cursor: grab;
    -webkit-user-select: none;
    user-select: none;
}
#hd-calendar-page .hd-event-shell[draggable="true"]:active { cursor: grabbing; }
#hd-calendar-page .hd-event-shell[draggable="true"] > .hd-event { cursor: inherit; }
#hd-calendar-page .hd-event-shell.hd-drag-origin { opacity: .5; }
#hd-calendar-page .hd-context-assigned { padding-top: 6px; }
#hd-calendar-page .hd-context-section-title { margin: 9px 0 6px; color: #4f647e; font-size: 12px; font-weight: 750; }
#hd-calendar-page .hd-context-assigned-guide { display: flex; align-items: center; gap: 9px; padding: 5px 0; }
#hd-calendar-page .hd-context-assigned-guide > span:nth-child(2) { flex: 1; font-size: 14px; overflow-wrap: anywhere; }
#hd-calendar-page .hd-context-remove-guide { border: 1px solid #f1cbd0; color: #aa2e3c; background: #fff5f6; border-radius: 5px; padding: 5px 9px; font-size: 12px; cursor: pointer; }
#hd-calendar-page .hd-context-remove-guide:hover, #hd-calendar-page .hd-context-remove-guide:focus-visible { background: #fae3e6; }
#hd-calendar-page .hd-context-add-section { border-top: 1px solid #eef1f6; margin-top: 8px; padding-top: 2px; }
#hd-calendar-page.hd-assigning .hd-event-shell[draggable="true"] { pointer-events: none; opacity: .65; }


/* Mises à jour AJAX : chargement visible sans masquer les éléments manipulables. */
#hd-calendar-page .hd-calendar-content,
#hd-calendar-page .hd-stat,
#hd-calendar-page .hd-panel {
    transition: opacity .2s ease, box-shadow .2s ease, transform .2s ease;
}
#hd-calendar-page .hd-calendar-main { position: relative; }
#hd-calendar-page .hd-calendar-main::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    z-index: 9;
    pointer-events: none;
    opacity: 0;
    background: linear-gradient(90deg, transparent 0%, #167bfa 45%, transparent 100%);
    background-size: 55% 100%;
}
#hd-calendar-page.hd-is-loading .hd-calendar-main::before {
    opacity: 1;
    animation: hd-calendar-progress .85s linear infinite;
}
#hd-calendar-page.hd-is-loading .hd-calendar-content { opacity: .76; }
#hd-calendar-page .hd-stat:hover { box-shadow: 0 5px 16px #273d5c0c; }
#hd-calendar-page .hd-pending-event,
#hd-calendar-page .hd-event-shell,
#hd-calendar-page .hd-guide-row {
    transition: transform .17s ease, box-shadow .17s ease, background-color .17s ease;
}
#hd-calendar-page .hd-pending-event:hover { transform: translateY(-1px); }
#hd-calendar-page .hd-event-shell:hover { transform: translateY(-1px); }
#hd-calendar-page .hd-guide-row:hover { background-color: #f7f9fd; }
#hd-calendar-page .hd-calendar-filterbar select:focus {
    border-color: #768ba8;
    box-shadow: 0 0 0 2px #c7d8ef70;
}
#hd-calendar-page.hd-refreshed .hd-stat strong,
#hd-calendar-page.hd-refreshed .hd-month-badge,
#hd-calendar-page.hd-refreshed .hd-pending-event,
#hd-calendar-page.hd-refreshed .hd-event-shell,
#hd-calendar-page.hd-refreshed .hd-guide-row {
    animation: hd-calendar-reveal .26s ease-out both;
}
@keyframes hd-calendar-reveal {
    from { opacity: .68; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes hd-calendar-progress {
    from { background-position-x: -130%; }
    to { background-position-x: 230%; }
}
@media (prefers-reduced-motion: reduce) {
    #hd-calendar-page .hd-calendar-content,
    #hd-calendar-page .hd-stat,
    #hd-calendar-page .hd-panel,
    #hd-calendar-page .hd-pending-event,
    #hd-calendar-page .hd-event-shell,
    #hd-calendar-page .hd-guide-row { transition: none; }
    #hd-calendar-page.hd-refreshed .hd-stat strong,
    #hd-calendar-page.hd-refreshed .hd-month-badge,
    #hd-calendar-page.hd-refreshed .hd-pending-event,
    #hd-calendar-page.hd-refreshed .hd-event-shell,
    #hd-calendar-page.hd-refreshed .hd-guide-row,
    #hd-calendar-page.hd-is-loading .hd-calendar-main::before { animation: none; }
}

#hd-calendar-page .hd-calendar-filterbar {
    flex-wrap: wrap;
    width: 100%;
}
#hd-calendar-page .hd-calendar-filterbar select {
    max-width: none;
    min-width: 150px;
    flex: 0 1 auto;
}
@media (max-width: 620px) {
    #hd-calendar-page .hd-calendar-filterbar select { flex: 1 1 145px; }
}
/* Select2 injecté par afterContentLoad() après une navigation AJAX. */
#hd-calendar-page .hd-calendar-filterbar > .select2-container {
    min-width: 150px;
    max-width: 215px;
    flex: 0 1 auto;
}
#hd-calendar-page .hd-calendar-filterbar .select2-selection--single {
    min-height: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    border: 1px solid #dce3ef;
    border-radius: 5px;
}
#hd-calendar-page .hd-calendar-filterbar .select2-selection__arrow {
    top: 6px;
}
@media (max-width: 620px) {
    #hd-calendar-page .hd-calendar-filterbar > .select2-container {
        flex: 1 1 145px;
        max-width: none;
    }
}

/* Événements indisponibilité – visuel distinct, cohérent Dashlite. */
.hd-absence-shell { position:relative; min-width:0; height:100%; }
.hd-absence-event { display:flex; flex-direction:column; height:100%; min-height:40px; padding:7px 8px; border:2px dashed #94a3b8; border-radius:6px; color:#475569; background:#f1f3f6; font-size:12px; line-height:1.4; text-decoration:none; overflow:hidden; }
.hd-absence-event:hover { background:#e5e9ee; color:#334155; border-color:#64748b; }
.hd-absence-event strong { display:block; overflow:hidden; text-overflow:ellipsis; }
.hd-absence-event .ni { color:#64748b; }
.hd-week-cell .hd-absence-shell, .hd-list-day .hd-absence-shell { height:auto; margin-bottom:4px; }
.hd-legend-absence { background:#94a3b8; }
.hd-month-absences { background:#f1f3f6; color:#475569; border:1px dashed #94a3b8; }
.hd-event-choice { display:flex; align-items:center; justify-content:center; flex-direction:column; min-height:160px; gap:12px; border-radius:14px; text-decoration:none; transition:transform .18s ease,box-shadow .18s ease; font-size:18px; }
.hd-event-choice:hover { transform:translateY(-2px); box-shadow:0 8px 18px rgba(0,0,0,.07); }
.hd-event-choice .ni { font-size:35px; }
.hd-event-choice-absence { color:#475569; background:#f1f3f6; border:2px dashed #94a3b8; }
.hd-event-choice-accompaniment { color:#06c781; background:#e7faf2; }
/* Jours récurrents : pastilles seules, sans case à cocher visible.
 * « Journée entière » conserve séparément la checkbox native Dashlite. */
.hd-absence-days { display:flex; flex-wrap:wrap; gap:8px; align-items:center; }
.hd-absence-day { position:relative; display:inline-flex; align-items:center; margin:0; min-height:36px; cursor:pointer; }
.hd-absence-day .hd-absence-day-input {
    position:absolute; width:1px; height:1px; padding:0; margin:0;
    opacity:0; overflow:hidden; clip-path:inset(50%); pointer-events:none;
}
.hd-absence-day span {
    display:inline-block; padding:7px 12px; border:1px solid #d3dbe5;
    border-radius:7px; color:#586a86; line-height:1.25;
    transition:background-color .15s,color .15s,border-color .15s;
}
.hd-absence-day:hover span { border-color:#7e8da5; }
.hd-absence-day.is-selected span,
.hd-absence-day .hd-absence-day-input:checked + span {
    background:#000000; color:#ffffff; border-color:#000000;
}
.hd-absence-day .hd-absence-day-input:focus-visible + span {
    outline:2px solid #64748b; outline-offset:2px;
}
.hd-absence-event .hd-absence-comment { display:-webkit-box; -webkit-box-orient:vertical; -webkit-line-clamp:2; line-clamp:2; overflow:hidden; font-size:11px; line-height:1.35; font-style:italic; color:#536274; white-space:pre-line; overflow-wrap:anywhere; margin-top:4px; }
.hd-week-cell .hd-absence-event .hd-absence-comment,
.hd-list-day .hd-absence-event .hd-absence-comment { -webkit-line-clamp:3; line-clamp:3; }
.hd-absence-form [hidden] { display:none!important; }

#hd-calendar-page .hd-context-absence-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
#hd-calendar-page .hd-context-absence-delete { display: flex; align-items: center; justify-content: flex-start; gap: 8px; width: 100%; text-align: left; white-space: normal; height: auto; padding: 9px 12px; }

#hd-calendar-page .hd-urgent-pending{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;margin:0 0 12px;padding:12px 15px;border-radius:9px;font-size:14px}
#hd-calendar-page .hd-urgent-pending[hidden]{display:none!important}
#hd-calendar-page .hd-urgent-pending-intro{display:flex;align-items:center;gap:9px; line-height: normal;}
#hd-calendar-page .hd-urgent-pending-intro .icon{font-size:19px}
#hd-calendar-page .hd-urgent-pending-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
#hd-calendar-page .hd-urgent-pending-actions .btn{gap:8px;font-size:13px; line-height: normal;}
#hd-calendar-page .hd-urgent-pending-actions .btn[hidden]{display:none!important}
#hd-calendar-page .hd-urgent-pending-actions [data-pending-count]{font-weight:750;font-variant-numeric:tabular-nums}

#hd-calendar-page .hd-guide-stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
#hd-calendar-page[data-is-admin="0"] .hd-calendar-layout { grid-template-columns: minmax(0, 1fr); }
@media (max-width: 620px) {
  #hd-calendar-page .hd-guide-stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  #hd-calendar-page .hd-guide-stats-grid .hd-stat { padding: 11px 8px; gap: 8px; }
  #hd-calendar-page .hd-guide-stats-grid .hd-stat small { font-size: 12px; }
  #hd-calendar-page .hd-guide-stats-grid .hd-stat strong { font-size: 19px; }
}

#hd-calendar-page .hd-legend-cancelled{background:#e85347}
#hd-calendar-page .hd-event-cancelled{background:#fff0ef;border-left-color:#e85347}
#hd-calendar-page .hd-month-cancelled{background:#fce8e6;color:#c53c35}


/* Semaine/Mois sur téléphone en portrait : superposition limitée à la grille.
   La barre de navigation (Jour / Semaine / Mois / Liste) n'est jamais recouverte.
   Aucun plein écran, aucun verrouillage physique de l'orientation. */
#hd-calendar-page .hd-calendar-content { position: relative; }
#hd-calendar-page .hd-calendar-landscape-prompt[hidden] { display: none !important; }
#hd-calendar-page.hd-calendar-rotation-required .hd-calendar-content {
    height: clamp(320px, 52vh, 440px);
    height: clamp(320px, 52svh, 440px);
    overflow: hidden;
}
#hd-calendar-page .hd-calendar-landscape-prompt {
    position: absolute;
    inset: 0;
    z-index: 8;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    background: rgba(246, 249, 253, .97);
    text-align: center;
}
#hd-calendar-page .hd-calendar-landscape-dialog {
    width: min(350px, 100%);
    max-height: 100%;
    overflow-y: auto;
    padding: 14px 15px;
    border: 1px solid #e1e8f2;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 8px 30px rgba(25, 48, 80, .08);
    color: var(--hd-ink);
}
#hd-calendar-page .hd-calendar-landscape-animation {
    display: block;
    width: min(180px, 100%);
    height: 150px;
    border: 0;
    margin: 0 auto 4px;
    background: transparent;
    pointer-events: none;
}
#hd-calendar-page .hd-calendar-landscape-dialog h3 {
    margin: 0 0 8px;
    font-size: 19px;
    font-weight: 700;
}
#hd-calendar-page .hd-calendar-landscape-dialog p {
    margin: 0 0 8px;
    font-size: 14px;
    line-height: 1.45;
}
#hd-calendar-page .hd-calendar-landscape-dialog small {
    display: block;
    font-size: 12px;
    line-height: 1.45;
    color: var(--hd-muted);
}

/* Même sur un petit téléphone (paysage ~667 px), les huit colonnes
   doivent tenir sur la largeur disponible, sans scroll horizontal. */
#hd-calendar-page.hd-calendar-compact-week .hd-week-grid {
    grid-template-columns: 83px repeat(7, minmax(0, 1fr)) !important;
    min-width: 0 !important; width: 100%;
}
#hd-calendar-page.hd-calendar-compact-week .hd-week-scroll {
    overflow-x: hidden; overflow-y: auto;
}
#hd-calendar-page.hd-calendar-compact-week .hd-week-heading {
    min-width: 0; padding: 5px 1px; font-size: 10px; overflow-wrap: anywhere;
}
#hd-calendar-page.hd-calendar-compact-week .hd-week-guide {
    min-width: 0; min-height: 78px; padding: 4px 2px; font-size: 10px;
}
#hd-calendar-page.hd-calendar-compact-week .hd-week-guide .hd-avatar-sm {
    width: 23px; height: 23px; flex-basis: 23px; font-size: 9px;
}
#hd-calendar-page.hd-calendar-compact-week .hd-week-guide .hd-heading-name {
    font-size: 10px; white-space: normal; overflow-wrap: anywhere;
}
#hd-calendar-page.hd-calendar-compact-week .hd-week-cell {
    min-width: 0; min-height: 78px; padding: 2px; gap: 3px;
}
#hd-calendar-page.hd-calendar-compact-week .hd-week-cell .hd-event,
#hd-calendar-page.hd-calendar-compact-week .hd-week-cell .hd-absence-event {
    padding: 3px 2px; font-size: 10px; min-width: 0; overflow-wrap: anywhere;
}
#hd-calendar-page.hd-calendar-compact-week .hd-week-cell .hd-event strong,
#hd-calendar-page.hd-calendar-compact-week .hd-week-cell .hd-absence-event strong {
    font-size: 10px; line-height: 1.25; overflow-wrap: anywhere;
}
#hd-calendar-page.hd-calendar-compact-week .hd-week-cell .hd-event-time,
#hd-calendar-page.hd-calendar-compact-week .hd-week-cell .hd-absence-event span {
    font-size: 9px; overflow-wrap: anywhere;
}
#hd-calendar-page.hd-calendar-compact-week .hd-week-cell .hd-event small,
#hd-calendar-page.hd-calendar-compact-week .hd-week-cell .hd-absence-comment {
    display: none; /* toujours consultables dans la modale du détail */
}
#hd-calendar-page.hd-calendar-compact-week .hd-week-cell .hd-event-more {
    min-width: 18px; min-height: 18px; padding: 0 1px;
}
#hd-calendar-page.hd-calendar-compact-month .fc,
#hd-calendar-page.hd-calendar-compact-month .fc-scrollgrid,
#hd-calendar-page.hd-calendar-compact-month .fc-daygrid-body,
#hd-calendar-page.hd-calendar-compact-month .fc-daygrid-body table {
    max-width: 100%; min-width: 0 !important; width: 100% !important;
}
#hd-calendar-page.hd-calendar-compact-month .fc-col-header-cell-cushion {
    font-size: 11px; padding: 3px 0; overflow-wrap: anywhere;
}
#hd-calendar-page.hd-calendar-compact-month .fc-daygrid-day-number {
    font-size: 11px; padding: 2px 4px;
}
#hd-calendar-page.hd-calendar-compact-month .hd-month-badge {
    font-size: 10px; line-height: 1.25; padding: 2px 3px;
}

/* Repli volontaire en portrait : aucune barre de défilement horizontal non plus. */
@media (orientation: portrait) {
    #hd-calendar-page.hd-calendar-compact-week .hd-week-grid {
        grid-template-columns: 60px repeat(7, minmax(0, 1fr)) !important;
    }
    #hd-calendar-page.hd-calendar-compact-week .hd-week-heading,
    #hd-calendar-page.hd-calendar-compact-week .hd-week-cell .hd-event strong,
    #hd-calendar-page.hd-calendar-compact-week .hd-week-guide .hd-heading-name {
        font-size: 9px;
    }
}
