/* Horaires individuels. */

/* Horaires individuels ------------------------------------------------- */

/* L'en-tête est le héros commun (.page-hero, lot H3 du plan v0.17.0). */
.individual-schedule-panel { display: grid; gap: var(--rh-space-4); }

.individual-schedule-toolbar,
.individual-schedule-filters,
.individual-schedule-legend {
    display: flex;
    align-items: center;
    gap: var(--rh-space-2);
}

.individual-schedule-toolbar {
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--rh-space-4);
    padding: var(--rh-space-3) var(--rh-space-4);
    border: 1px solid var(--rh-line);
    border-radius: var(--rh-radius-lg);
    background:
        linear-gradient(100deg, var(--rh-surface), var(--rh-primary-soft) 180%),
        var(--rh-surface);
    box-shadow: var(--rh-shadow-sm);
}

.individual-schedule-toolbar .week-navigation {
    display: flex;
    align-items: center;
    gap: var(--rh-space-2);
}

.individual-period {
    min-width: 218px;
    padding: 0 var(--rh-space-2);
    text-align: center;
}

.individual-period small {
    display: block;
    color: var(--rh-muted);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.individual-period strong { font-size: 0.94rem; }
.individual-period strong span { color: var(--rh-muted); font-weight: 500; }

.individual-schedule-filters {
    flex: 1 1 580px;
    justify-content: flex-end;
}

.individual-filter-field {
    display: grid;
    gap: 2px;
}

.individual-filter-field label {
    color: var(--rh-muted);
    font-size: 0.68rem;
    font-weight: 700;
}

.individual-filter-field input { width: 142px; }
.individual-filter-employee select { min-width: 190px; }
.individual-schedule-filters > .button { align-self: flex-end; min-height: 38px; }
.individual-current-week { margin-left: var(--rh-space-1); }

.individual-schedule-legend {
    justify-content: space-between;
    flex-wrap: wrap;
    padding: 0 var(--rh-space-1);
    color: var(--rh-muted);
    font-size: 0.75rem;
}

.individual-legend-statuses { display: flex; gap: var(--rh-space-2); flex-wrap: wrap; }

.individual-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border: 1px solid var(--rh-line);
    border-radius: var(--rh-radius-pill);
    background: var(--rh-surface);
    color: var(--rh-ink-soft);
    font-weight: 650;
}

.individual-legend-item i { width: 7px; height: 7px; border-radius: 50%; background: var(--rh-muted); }
.individual-legend-item.is-success i { background: var(--rh-success); }
.individual-legend-item.is-warning i { background: var(--rh-warning); }
.individual-legend-item.is-danger i { background: var(--rh-danger); }
.individual-legend-item.is-success { border-color: var(--rh-success-line); background: var(--rh-success-soft); color: var(--rh-success); }
.individual-legend-item.is-warning { border-color: var(--rh-warning-line); background: var(--rh-warning-soft); color: var(--rh-warning); }
.individual-legend-item.is-danger { border-color: var(--rh-danger-line); background: var(--rh-danger-soft); color: var(--rh-danger); }
.individual-legend-statuses .is-history { color: var(--rh-muted); }
.individual-schedule-legend p { display: flex; align-items: center; gap: 5px; margin: 0; }

.individual-week {
    overflow: hidden;
    border: 1px solid var(--rh-line);
    border-radius: var(--rh-radius-lg);
    background: var(--rh-surface);
    box-shadow: var(--rh-shadow-sm);
}

.individual-week + .individual-week { margin-top: 0; }

.individual-week-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--rh-space-3);
    min-height: 58px;
    padding: var(--rh-space-3) var(--rh-space-4);
    border-bottom: 1px solid var(--rh-line);
    background:
        linear-gradient(100deg, color-mix(in srgb, var(--rh-primary-soft) 82%, var(--rh-primary) 8%), var(--rh-surface) 78%),
        var(--rh-primary-soft);
}

.individual-week-header > div { display: flex; align-items: center; gap: var(--rh-space-3); }
.individual-week-tools { display: flex; align-items: center; gap: var(--rh-space-2); justify-content: flex-end; }
.individual-week-number {
    display: grid;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: var(--rh-primary);
    color: var(--rh-primary-ink);
    font-size: 0.78rem;
    font-weight: 800;
    place-items: center;
}

.individual-week h2 { margin: 0; font-size: 1rem; }
.individual-week-header p { margin: 2px 0 0; color: var(--rh-muted); font-size: 0.75rem; }
.individual-week-header p span { color: var(--rh-ink-soft); }
.individual-week-scroll { overflow-x: auto; }

.individual-schedule-table {
    width: 100%;
    min-width: 1360px;
    border-collapse: separate;
    border-spacing: 0;
    table-layout: fixed;
    font-size: 0.75rem;
}

.individual-schedule-table th,
.individual-schedule-table td {
    height: 50px;
    padding: 3px 5px;
    vertical-align: middle;
    text-align: center;
    background-color: var(--rh-surface);
}

/* Mise en page épurée validée sur maquette (retour MOA 03/11/2026) :
   plus de quadrillage — séparateurs horizontaux fins entre les lignes et
   un seul liseré vertical après la colonne Salarié. */
.individual-schedule-table tbody tr + tr th,
.individual-schedule-table tbody tr + tr td {
    border-top: 1px solid var(--rh-line);
}

.individual-schedule-table thead th {
    border-bottom: 1px solid var(--rh-line-strong);
}

.individual-schedule-table tbody th,
.individual-schedule-table thead th:first-child {
    border-right: 2px solid var(--rh-line-strong);
}

/* Les six jours du lundi au samedi restent de largeur égale ; le dimanche
   est plus étroit mais garde une place suffisante pour un créneau court
   (retour MOA 08/09/2026 et 03/11/2026, maquette validée). */
.individual-schedule-table .individual-col-employee { width: 160px; }
.individual-schedule-table .individual-col-day { width: calc((100% - 720px) / 6); }
.individual-schedule-table .individual-col-sunday { width: 104px; }
.individual-schedule-table .individual-col-total { width: 152px; }
.individual-schedule-table .individual-col-status { width: 104px; }
.individual-schedule-table .individual-col-actions { width: 200px; }
.individual-schedule-table th:first-child { text-align: left; }

.individual-schedule-table thead th {
    height: 42px;
    padding: 5px 6px;
    background: color-mix(in srgb, var(--rh-primary-soft) 48%, var(--rh-surface));
    color: var(--rh-ink-soft);
    white-space: nowrap;
    font-size: 0.68rem;
    font-weight: 650;
    text-transform: uppercase;
}

.individual-schedule-table thead th span,
.individual-schedule-table thead th strong { display: inline; }
.individual-schedule-table thead th strong { margin-left: 3px; color: var(--rh-ink); }
.individual-schedule-table thead th small { display: block; color: var(--rh-danger); text-transform: none; }

.individual-schedule-table tbody th {
    padding-left: var(--rh-space-3);
    font-weight: 650;
    text-align: left;
}

/* Alternance discrète des lignes ; les teintes de journée spéciale
   (week-end, dimanche, aujourd'hui) restent au-dessus. */
.individual-schedule-table tbody tr:nth-child(even) td,
.individual-schedule-table tbody tr:nth-child(even) th {
    background-color: color-mix(in srgb, var(--rh-surface-muted) 40%, var(--rh-surface));
}

.individual-schedule-table tbody tr:hover td,
.individual-schedule-table tbody tr:hover th {
    background-color: color-mix(in srgb, var(--rh-primary-soft) 26%, var(--rh-surface));
}

/* Les pastilles (absence, jour férié, état) peuvent être plus larges que
   leur colonne fixe : sans passage à la ligne elles débordaient sur les
   cellules voisines (retour MOA 07/09/2026). */
.individual-schedule-table .badge {
    white-space: normal;
    text-align: left;
}

/* Les teintes de journée spéciale restent au-dessus du zébrage et du
   survol : sélecteurs aussi larges que le zébrage, placés après lui. */
.individual-schedule-table tbody tr td.is-weekend {
    background: color-mix(in srgb, var(--rh-surface-muted) 74%, var(--rh-primary-soft));
}

.individual-schedule-table tbody tr td.is-sunday {
    background: color-mix(in srgb, var(--rh-danger-soft) 68%, var(--rh-surface));
}

.individual-schedule-table thead .is-sunday {
    color: var(--rh-danger);
}

.individual-schedule-table tbody tr td.is-today {
    background: color-mix(in srgb, var(--rh-info-soft) 76%, var(--rh-surface));
    box-shadow: inset 0 3px 0 var(--rh-info);
}

/* Puces d'horaires légères validées sur maquette (retour MOA 03/11/2026) :
   fond primaire doux sans bordure marquée, hauteur constante. */
.individual-time {
    display: block;
    min-height: 20px;
    line-height: 18px;
    padding: 0 8px;
    border-radius: 99px;
    background: var(--rh-primary-soft);
    color: var(--rh-primary);
    font-weight: 750;
    text-align: center;
    white-space: nowrap;
}

.individual-time + .individual-time { margin-top: 2px; }
.individual-time.is-remote-work { border: 1px dashed var(--rh-info); background: color-mix(in srgb, var(--rh-info-soft) 44%, var(--rh-surface)); }
.individual-time small { margin-left: 3px; color: var(--rh-info); font-size: .58rem; }
.individual-remote-work-key { padding: 1px 4px; border: 1px dashed var(--rh-info); border-radius: 4px; color: var(--rh-info); font-weight: 800; }
.individual-empty { display: block; padding-bottom: 3px; color: var(--rh-muted); font-size: 0.7rem; }

/* Retour MOA 13/09/2026 : contenu des cellules calé sur le bas de la ligne —
   le bandeau rouge d'absence forme ainsi un alignement horizontal continu sur
   toute la semaine, quel que soit le nombre de créneaux du jour. */
.individual-schedule-table tbody td { vertical-align: bottom; }

/* Retour MOA 13/09/2026 : absence en rouge uniforme, quelle que soit sa
   nature ; bloc compact d'une seule ligne pour ne pas déformer l'alignement
   de la ligne du tableau. */
.individual-absence {
    display: block;
    margin-top: 2px;
    height: 16px;
    line-height: 14px;
    border: 1px solid var(--rh-danger-line);
    border-radius: 3px;
    background: var(--rh-danger-soft);
    color: var(--rh-danger);
    font-size: 0.58rem;
    font-weight: 750;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* Colonne « Horaire / Contrat » hiérarchisée (maquette validée 03/11/2026) :
   total fort, contrat discret, écart sur sa propre ligne colorée ; les
   mentions secondaires sont abrégées, libellé complet au survol. */
.individual-total strong,
.individual-total small { display: block; }
.individual-total-main { display: block; white-space: nowrap; }
.individual-total-main strong { color: var(--rh-ink); font-size: 1rem; }
.individual-total-main span { color: var(--rh-muted); margin-left: 2px; }
/* Retour MOA du 10/11/2026 : les mentions secondaires peuvent passer sur
   deux lignes — le nowrap les faisait déborder sur la colonne « État ».
   La mention « Déclaré » a été retirée à la revue : le comptabilisé, déjà
   valeur principale, se suffit. */
.individual-total small { margin-top: 1px; font-weight: 700; }
.individual-total .is-balanced { color: var(--rh-success); }
.individual-total .is-unbalanced { color: var(--rh-warning); }
.individual-cover-note {
    display: inline-block;
    margin-top: 2px;
    padding: 0 8px;
    border-radius: 99px;
    line-height: 16px;
    background: color-mix(in srgb, var(--rh-warning-soft) 60%, var(--rh-surface));
    color: var(--rh-warning);
    font-size: 0.6rem;
    font-weight: 700;
    white-space: nowrap;
    cursor: help;
}

.individual-status {
    text-align: center;
}

/* Badge et mention de version sur la colonne « État » (104 px) : une police
   réduite pour tenir sur une à deux lignes propres, version noble au survol. */
.individual-status .badge { justify-content: center; font-size: 0.66rem; }
/* Signalétique « Identique au cycle » (retour MOA du 11/11/2026) : badge
   secondaire sous l'état, libellé complet au survol. */
.individual-status .badge.individual-cycle-match { margin-top: 2px; font-size: 0.6rem; }
.individual-status small { display: block; margin-top: 2px; font-size: 0.62rem; white-space: nowrap; }
.individual-actions { display: flex; align-items: center; justify-content: flex-end; gap: 3px; white-space: nowrap; }
.individual-actions form { margin: 0; }
.individual-actions .button { min-height: 27px; padding: 0 6px; font-size: 0.68rem; }
.individual-actions-menu { position: relative; }
.individual-actions-menu > summary { list-style: none; }
.individual-actions-menu > summary::-webkit-details-marker { display: none; }
.individual-actions-popover { position: absolute; z-index: 20; top: calc(100% + 4px); right: 0; display: grid; gap: 5px; width: 220px; padding: var(--rh-space-2); border: 1px solid var(--rh-line); border-radius: var(--rh-radius-md); background: var(--rh-surface); box-shadow: var(--rh-shadow-md); white-space: normal; }
.individual-actions-popover .button { width: 100%; justify-content: flex-start; }
.individual-withdraw-form { display: grid; gap: 4px; padding-top: 5px; border-top: 1px solid var(--rh-line); }
.individual-withdraw-form label { color: var(--rh-muted); font-size: .68rem; font-weight: 650; text-align: left; }
.individual-withdraw-form input { width: 100%; min-height: 30px; padding: 3px 6px; }

.individual-filter-check {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--rh-ink-soft);
    font-size: 0.78rem;
    white-space: nowrap;
}

.individual-filter-check input { margin: 0; }

@media (max-width: 900px) {
    .individual-schedule-toolbar,
    .individual-schedule-filters { align-items: stretch; flex-direction: column; }
    .individual-schedule-filters { flex-basis: auto; }
    .individual-filter-field input,
    .individual-filter-employee select { width: 100%; }
    .individual-current-week { margin-left: 0; }
    .individual-week-header { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 640px) {
    .individual-schedule-toolbar { padding: var(--rh-space-3); }
    .individual-schedule-toolbar .week-navigation { width: 100%; }
    .individual-period { flex: 1; min-width: 0; }
    .individual-period strong { font-size: 0.82rem; }
    .individual-schedule-legend { align-items: flex-start; flex-direction: column; }
    .individual-schedule-legend p { align-items: flex-start; }
}

.preview-week-ok {
    color: var(--rh-success);
    font-weight: 650;
}

.preview-week-missing {
    color: var(--rh-danger);
    font-weight: 650;
}

.generation-duties {
    margin-top: var(--rh-space-5);
    padding-top: var(--rh-space-4);
    border-top: 1px solid var(--rh-line);
}

.generation-duties h3 { margin-bottom: var(--rh-space-1); }
.generation-duties select { min-width: 12rem; }

.generation-period-summary {
    display: flex;
    flex-wrap: wrap;
    gap: var(--rh-space-2) var(--rh-space-4);
    align-items: center;
    margin-bottom: var(--rh-space-4);
    padding: var(--rh-space-3) var(--rh-space-4);
    border: 1px solid var(--rh-line);
    border-radius: var(--rh-radius-md);
    background: var(--rh-surface-muted);
}

.generation-week-column {
    position: sticky;
    left: 0;
    z-index: 1;
    min-width: 12rem;
    background: var(--rh-surface);
}

thead .generation-week-column {
    z-index: 2;
    background: var(--rh-surface-muted);
}

@media (max-width: 640px) {
    .week-toolbar,
    .planning-summary {
        align-items: stretch;
        flex-direction: column;
    }

    .week-navigation {
        justify-content: space-between;
    }

    .week-navigation .button span { display: none; }
    .week-navigation > strong { min-width: 0; }
    .week-jump { justify-content: flex-start; }
    .planning-alert-counts { flex-wrap: wrap; }

    .absence-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .absence-period-nav { justify-content: center; }
    .absence-filters .field { min-width: 100%; }
    .absence-filters .button { flex: 1; }

    .employee-list-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .employee-search {
        width: 100%;
    }

    .collection-row {
        align-items: stretch;
        flex-direction: column;
    }
}
