/* Mon temps : saisie Jour / Semaine / Mois, grille, champs horaires, alertes FPT */

/* Grille de saisie */
.sheet { --cols: 92px repeat(3, minmax(150px, 1fr)) minmax(150px, 1.1fr) 66px 66px 62px; }
.sheet-row {
  display: grid; grid-template-columns: var(--cols); gap: 8px; align-items: center;
  padding: 5px 16px; border-bottom: 1px solid var(--border);
}
.sheet-head {
  position: sticky; top: 0; z-index: 2; padding-top: 9px; padding-bottom: 9px; background: var(--surface);
  font-size: 11.5px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .03em;
}
.sheet .r { text-align: right; font-variant-numeric: tabular-nums; }
.day.off { background: color-mix(in srgb, var(--surface-2) 60%, transparent); }
.day.off .d-date strong { color: var(--muted); }
.day.holiday { background: var(--sunday-soft); }
.day.today { box-shadow: inset 3px 0 0 var(--primary); }
.day.saving { opacity: .6; }
.day.error { box-shadow: inset 3px 0 0 var(--danger); background: var(--danger-soft); }
.day.pending { box-shadow: inset 3px 0 0 var(--warn); }
.d-date { display: flex; flex-direction: column; line-height: 1.2; }
.d-date strong { font-size: 13.5px; }
.d-date small { font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.slot { display: flex; align-items: center; gap: 4px; }
.slot span { color: var(--muted); }
.sheet input, .sheet select { padding: 5px 7px; border-radius: 8px; font-size: 13px; }
.sheet input[type=time] { min-width: 0; font-variant-numeric: tabular-nums; }
.sheet input[type=time]::-webkit-calendar-picker-indicator { display: none; }
.slot.evening input { background: color-mix(in srgb, var(--night-soft) 50%, var(--surface)); }
.abs { display: flex; gap: 4px; }
.abs select { min-width: 0; }
.abs .absmin { width: 64px; flex: none; }
.c-worked { font-weight: 600; }
.c-delta { font-weight: 700; }
.d-act { display: flex; justify-content: flex-end; gap: 2px; }
.sheet.readonly input, .sheet.readonly select {
  border-color: transparent; background: transparent; color: var(--text); opacity: 1; -webkit-appearance: none; appearance: none;
}
.week-row {
  display: flex; gap: 22px; justify-content: flex-end; padding: 7px 20px; font-size: 12.5px; color: var(--muted);
  background: var(--surface-2); border-bottom: 1px solid var(--border);
}
.week-row span:first-child { margin-right: auto; font-weight: 650; }
.week-row b { color: var(--text); font-variant-numeric: tabular-nums; }
.week-row .pos b { color: var(--primary); }
.week-row .neg b { color: var(--danger); }
.card.end { margin-top: 20px; }
.card.end .flow { border-bottom: 0; }
.submit-box { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; padding: 16px 20px; border-top: 1px solid var(--border); }
.submit-box label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: 13px; flex: 1; min-width: 200px; }
.submit-box label small { font-weight: 400; }
.submit-box p { margin: 0; flex: 1; }
.submit-box.review { background: color-mix(in srgb, var(--primary-soft) 50%, transparent); }
.review-info { flex-basis: 100%; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.review-info p { flex-basis: 100%; margin: 0; }

/* Navigation Jour / Semaine / Mois */
.time-nav { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.time-nav .month-label { min-width: 240px; }
.tabs { display: inline-flex; padding: 3px; border-radius: 11px; background: var(--surface-2); border: 1px solid var(--border); }
.tab {
  border: 0; background: transparent; color: var(--muted); font: inherit; font-weight: 600;
  padding: 6px 14px; border-radius: 8px; cursor: pointer;
}
.tab:hover { color: var(--text); }
.tab.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.spacer { flex: 1; }
.section-title { display: flex; align-items: center; gap: 8px; margin: 28px 0 14px; font-size: 16px; }
.section-title .ic { width: 18px; height: 18px; color: var(--muted); }

/* Vue Jour */
.day-layout { display: grid; grid-template-columns: minmax(0, 1fr) 290px; gap: 20px; align-items: start; }
.day-card { padding: 22px 24px; display: flex; flex-direction: column; gap: 18px; }
.day-card.saving { opacity: .75; }
.day-card.error { box-shadow: inset 0 3px 0 var(--danger), var(--shadow); }
.day-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.day-top h2 { font-size: 20px; }
.day-top p { margin: 2px 0 0; }
#day-note:empty { display: none; }
#day-note .banner { margin: 0; }
.tfields { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.fill-row { margin: -4px 0 0; }
.fill-row small { color: var(--muted); font-weight: 400; margin-left: 6px; }
.tfields.two { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 50%; margin-top: 12px; }
.tfield { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: 13px; }
.tfield > span { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); }
.tfield > span .ic { width: 15px; height: 15px; }
.tinput { position: relative; }
.tinput input {
  width: 100%; padding: 12px 14px; font-size: 22px; font-weight: 650; font-variant-numeric: tabular-nums;
  border-radius: 12px; text-align: center;
}
.tinput input::-webkit-calendar-picker-indicator { display: none; }
.tinput .now {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  border: 0; border-radius: 7px; padding: 3px 7px; font: inherit; font-size: 11px; font-weight: 650;
  background: var(--primary-soft); color: var(--primary); cursor: pointer; opacity: 0; transition: opacity .15s;
}
.tinput:hover .now, .tinput input:focus + .now, .tinput .now:focus { opacity: 1; }
.extra { border: 1px dashed var(--border); border-radius: 12px; padding: 10px 14px; }
.extra summary { display: flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 600; color: var(--night); list-style: none; }
.extra summary::-webkit-details-marker { display: none; }
.extra summary .ic { width: 16px; height: 16px; }
.extra .tinput input { background: color-mix(in srgb, var(--night-soft) 50%, var(--surface)); }
.extra p { margin: 8px 0 0; }
.day-card > label, .day-card .grid label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: 13px; }
.day-result {
  display: flex; gap: 10px; flex-wrap: wrap; padding: 14px 16px; border-radius: 12px; background: var(--surface-2);
}
.day-result div { display: flex; flex-direction: column; flex: 1; min-width: 110px; }
.day-result span { font-size: 12px; color: var(--muted); }
.day-result strong { font-size: 20px; font-variant-numeric: tabular-nums; }
.day-result .err { color: var(--danger); font-weight: 600; }
.day-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.day-actions .btn.primary { padding: 10px 18px; }

/* Bandeau semaine (vue Jour) */
.strip-card { position: sticky; top: 20px; }
.strip { list-style: none; margin: 0; padding: 8px; }
.strip li {
  display: grid; grid-template-columns: 1fr auto 14px; grid-template-rows: auto auto; column-gap: 8px;
  padding: 9px 12px; border-radius: 10px; cursor: pointer;
}
.strip li:hover { background: var(--surface-2); }
.strip li.on { background: var(--primary-soft); }
.s-day { color: var(--muted); }
.s-day b { color: var(--text); }
.s-val { grid-column: 1; font-weight: 650; font-variant-numeric: tabular-nums; font-size: 13px; }
.s-delta { grid-column: 2; grid-row: 1 / 3; align-self: center; font-weight: 700; font-variant-numeric: tabular-nums; }
.strip .dot { grid-column: 3; grid-row: 1 / 3; align-self: center; width: 10px; height: 10px; border-radius: 50%; background: var(--border); }
.strip .st-none .dot { background: transparent; border: 2px dashed var(--border); }
.strip .st-manquant .s-val { color: var(--danger); }
.st-valide .dot, .st-valide .c-dot, .legend .st-valide i { background: var(--st-valide); }
.st-soumis .dot, .st-soumis .c-dot, .legend .st-soumis i { background: var(--st-soumis); }
.st-brouillon .dot, .st-brouillon .c-dot, .legend .st-brouillon i { background: var(--st-brouillon); }
.st-refuse .dot, .st-refuse .c-dot, .legend .st-refuse i { background: var(--st-refuse); }
.legend .tp i { background: var(--partiel); }
.st-manquant .dot, .st-manquant .c-dot, .legend .st-manquant i { background: transparent; border: 2px solid var(--st-manquant); }

/* Vue Semaine : colonne statut en plus */
.sheet { --cols: 92px repeat(3, minmax(140px, 1fr)) minmax(140px, 1.1fr) 70px 66px 104px 62px; }
.c-status { display: flex; }
.day.locked input, .day.locked select { border-color: transparent; background: transparent; color: var(--text); opacity: 1; }
.d-date a { color: inherit; }
.d-date a:hover { color: var(--primary); }
.week-foot { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; padding: 14px 20px; }
.wf-totals { display: flex; gap: 20px; color: var(--muted); }
.wf-totals b { color: var(--text); font-variant-numeric: tabular-nums; }
.wf-totals .pos b { color: var(--primary); }
.wf-totals .neg b { color: var(--danger); }

/* Vue Mois : calendrier */
.cal-head, .cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-head { padding: 10px 12px 0; }
.cal-head span { padding: 0 8px 8px; font-size: 12px; font-weight: 650; color: var(--muted); text-transform: uppercase; }
.cal-grid { gap: 6px; padding: 0 12px 12px; }
.cal-cell {
  position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-height: 86px;
  padding: 8px 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface);
  font: inherit; color: var(--text); text-align: left; cursor: pointer;
}
.cal-cell:hover { border-color: var(--primary); }
.cal-cell.blank { border: 0; background: transparent; cursor: default; }
.cal-cell.off { background: var(--surface-2); }
/* Jour non travaillé d'un temps partiel (en semaine) */
.cal-cell.tp, .day.tp, .strip li.tp {
  background: repeating-linear-gradient(45deg, color-mix(in srgb, var(--partiel) 14%, transparent) 0 6px, color-mix(in srgb, var(--partiel) 5%, transparent) 6px 12px);
}
.cal-cell.tp .c-tp, .day.tp .d-date small, .strip li.tp .s-val { color: var(--partiel); font-weight: 650; }
.cal-cell .c-tp { font-size: 11px; }
.cal-cell.holiday { background: var(--sunday-soft); }
.cal-cell.today { box-shadow: inset 0 0 0 2px var(--primary); }
.c-num { font-weight: 700; font-size: 13px; display: flex; flex-direction: column; line-height: 1.2; }
.c-num small { font-weight: 500; font-size: 10.5px; color: var(--sunday); }
.c-main { font-weight: 650; font-variant-numeric: tabular-nums; margin-top: auto; }
.c-main small { color: var(--muted); font-weight: 600; }
.c-main.miss { color: var(--danger); font-size: 12.5px; }
.c-delta { font-size: 12.5px; font-weight: 700; font-variant-numeric: tabular-nums; }
.c-dot { position: absolute; top: 9px; right: 9px; width: 9px; height: 9px; border-radius: 50%; }
.legend { display: flex; flex-wrap: wrap; gap: 16px; padding: 12px 20px 16px; font-size: 12.5px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 50%; }
.pay-note { margin: 0; padding: 12px 20px 16px; display: flex; align-items: center; gap: 8px; }
.pay-note .ic { width: 16px; height: 16px; color: var(--muted); }
.flow .pending { margin-left: auto; opacity: .8; }

/* Champs horaires : saisie libre, suggestion du contrat en gris clair */
input.hm { font-variant-numeric: tabular-nums; text-align: center; }
input.hm::placeholder { color: var(--muted); opacity: .45; font-weight: 500; }
input.hm.invalid { border-color: var(--danger); background: var(--danger-soft); }
.sheet input.hm { width: 100%; min-width: 0; }

/* Règles FPT : alertes et jours de repos repliés */
#day-rules:empty { display: none; }
#day-rules .banner { margin: 0; align-items: flex-start; }
.rule-ic { display: inline-grid; margin-left: 4px; color: var(--warn); cursor: help; }
.rule-ic .ic { width: 15px; height: 15px; }
.rv-slots small.rule { color: var(--warn); font-style: normal; }
.kpi-value small { font-size: 14px; font-weight: 500; opacity: .7; }
.wf-totals .neg { display: inline-flex; align-items: center; gap: 4px; font-weight: 650; }
.sheet-row.day.rest { padding-top: 3px; padding-bottom: 3px; opacity: .75; }
.sheet-row.day.rest .rest-line { grid-column: 2 / -1; }
.sheet-row.day.rest .btn .ic { width: 14px; height: 14px; }
@media (max-width: 1180px) {
  .sheet-row.day.rest { display: flex; gap: 16px; align-items: center; }
}


@media (max-width: 1180px) {
  .day-layout { grid-template-columns: 1fr; }
  .strip-card { position: static; }
  .strip { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
  .strip li { grid-template-columns: 1fr; text-align: center; padding: 8px 4px; }
  .strip li > * { grid-column: 1 !important; grid-row: auto !important; justify-self: center; }
  .sheet-row.day {
    grid-template-areas: "date worked delta" "s0 s1 s2" "abs status act";
  }
  .day .c-status { grid-area: status; }
}
@media (max-width: 860px) {
  .notif-panel { left: 16px; top: 64px; }
  .tfields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tfields.two { max-width: none; }
  .cal-cell { min-height: 64px; padding: 6px; }
  .cal-cell .c-delta { display: none; }
}
@media (max-width: 640px) {
  .sheet-row.day { grid-template-areas: "date delta" "s0 s0" "s1 s1" "s2 s2" "abs abs" "status status" "worked act"; }
  .time-nav .month-label { min-width: 0; }
  .c-num small { display: none; }
  .cal-grid { gap: 3px; padding: 0 6px 6px; }
  .c-main { font-size: 11px; }
  .rv-days li { grid-template-columns: 64px 1fr auto; }
  .rv-days .rv-num:first-of-type { display: none; }
}
