:root {
  --bg: #f3f6fb;
  --card: #ffffff;
  --ink: #132033;
  --muted: #667a94;
  --line: #d7e1ef;
  --blue-900: #142f5e;
  --blue-700: #235eba;
  --blue-600: #2f74e7;
  --blue-500: #4f90f7;
  --blue-200: #dbe9ff;
  --danger: #dc3545;
  --warning: #e19410;
  --success: #188457;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif; overflow-x: hidden; }
body.modal-open { overflow: hidden; }

.admin-login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.admin-login-card {
  width: min(380px, 100%);
  display: grid;
  gap: 16px;
  padding: 28px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 18px 45px rgba(25, 42, 70, .12);
}
.admin-login-card h1 {
  margin: 0;
  font-size: 24px;
}
.login-error {
  margin: 0;
  color: #b42318;
  font-weight: 700;
}

.app-shell { display: flex; min-height: 100vh; overflow: hidden; }
.sidebar {
  width: 240px;
  background: linear-gradient(180deg, #112f60 0%, #164186 100%);
  color: #dce8ff;
  display: flex;
  flex-direction: column;
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 1000;
}
.brand { display: flex; gap: 10px; align-items: center; padding: 22px 20px; border-bottom: 1px solid rgba(255,255,255,0.15); }
.brand strong { font-size: 17px; }
.brand small { display: block; color: #b6c8e9; }
.brand-badge {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: #5ca2ff;
  color: #fff;
  font-weight: 700;
}
.menu { padding: 14px; display: grid; gap: 8px; }
.menu-item {
  border: 0;
  text-align: left;
  background: transparent;
  color: #dce8ff;
  border-radius: 8px;
  padding: 11px 12px;
  cursor: pointer;
  font-size: 17px;
  font-weight: 600;
}
.menu-item:hover { background: rgba(255,255,255,0.1); }
.menu-item.active { background: #fff; color: #12356d; }
.sidebar-footer { margin-top: auto; padding: 14px; border-top: 1px solid rgba(255,255,255,0.15); }
.sidebar-footer a { color: #fff; text-decoration: none; }

.main { margin-left: 240px; width: calc(100vw - 240px); flex: 0 0 auto; overflow: hidden; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #fff;
  border-bottom: 1px solid var(--line);
  padding: 16px 24px;
}
.topbar h1 { margin: 0; font-size: 24px; }
.pill { border-radius: 999px; background: var(--blue-200); color: var(--blue-900); padding: 6px 10px; font-size: 12px; }

.view { display: none; padding: 20px 24px; overflow: hidden; }
.view.active { display: block; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 14px;
}
.card h3 { margin-top: 0; }

/* Catégories de Paramètres repliables */
.card:has(> details.settings-section) { padding: 0; }
.settings-section > .settings-summary {
  list-style: none;
  cursor: pointer;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  user-select: none;
  border-radius: 12px;
}
.settings-section > .settings-summary::-webkit-details-marker { display: none; }
.settings-section > .settings-summary::before {
  content: '▸';
  color: var(--accent, #2f74e7);
  font-size: 13px;
  transition: transform 0.15s ease;
}
.settings-section[open] > .settings-summary::before { transform: rotate(90deg); }
.settings-section > .settings-summary h3 { margin: 0; }
.settings-section[open] > .settings-summary { border-bottom: 1px solid var(--line); border-radius: 12px 12px 0 0; }
.settings-section > .settings-body { padding: 4px 16px 16px; }

.btn-primary, .btn-secondary, .button-like, button {
  border-radius: 8px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  cursor: pointer;
  background: #fff;
  color: inherit;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}
.btn-primary { background: var(--blue-600); border-color: var(--blue-600); color: #fff; }
.btn-secondary { background: #fff; color: var(--ink); }
button:hover { filter: brightness(0.98); }

.controls { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.controls #undo-action,
.controls #redo-action {
  width: 42px;
  min-width: 42px;
  font-size: 18px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.export-trigger-wrap {
  position: relative;
  display: inline-flex;
}
.export-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 150px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.18);
  z-index: 200;
  padding: 6px;
}
.export-menu button {
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  padding: 10px 12px;
  border-radius: 8px;
}
.export-menu button:hover {
  background: #f3f7ff;
}
.export-custom-dates {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.export-groups {
  display: grid;
  gap: 12px;
  margin-top: 4px;
}
.export-group {
  border: 1px solid #dbe7f7;
  border-radius: 12px;
  padding: 10px 12px;
  background: #f8fbff;
}
.export-group-title {
  font-size: 12px;
  font-weight: 800;
  color: #18345b;
  margin-bottom: 8px;
}
.check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 6px 0;
}

.planning-period-head {
  text-align: center;
  margin-bottom: 10px;
}
.planning-year {
  font-size: 13px;
  color: var(--muted);
  font-weight: 700;
  text-transform: uppercase;
}
.planning-month {
  font-size: 24px;
  font-weight: 800;
  color: #173f80;
  text-transform: capitalize;
}

.calendar-card {
  overflow: auto;
  max-height: 78vh;
  position: relative;
  background: #fff;
  padding: 0;
}
.week-vertical {
  --slot-h: 16px;
  --slot-count: 64;
  --head-h: 76px;
  --absence-h: 38px;
  display: grid;
  grid-template-columns: 72px repeat(7, minmax(185px, 1fr));
  gap: 0;
  min-width: 1340px;
}

.time-col {
  border: 1px solid var(--line);
  border-radius: 0;
  background: #fff;
  position: sticky;
  left: 0;
  z-index: 60;
}

.time-head {
  padding: 8px;
  min-height: var(--head-h);
  background: #f8fafc;
  border-bottom: 1px solid var(--line);
  font-weight: 800;
  font-size: 0.88rem;
  position: sticky;
  top: 0;
  z-index: 70;
}

.time-absence-spacer {
  height: var(--absence-h);
  border-bottom: 1px solid #e6edf8;
  background: #fbfdff;
  position: sticky;
  top: var(--head-h);
  z-index: 65;
}

.time-body {
  height: calc(var(--slot-h) * var(--slot-count));
  position: relative;
  z-index: 1;
}

.time-mark {
  height: calc(var(--slot-h) * 4);
  border-top: 1px solid #e5ecf7;
  padding: 2px 6px;
  font-size: 0.72rem;
  color: var(--muted);
}

.week-v-day {
  border: 1px solid var(--line);
  border-radius: 0;
  background: #fff;
  min-width: 0;
  position: relative;
  z-index: 1;
  margin-left: -1px;
}
.week-v-day.day-floating-open { z-index: 45; }
.week-v-day.today {
  z-index: 2;
  box-shadow: inset 0 0 0 2px #2f74e7;
}
.week-v-day.today .week-v-title,
.week-v-day.today .absence-strip {
  background-image: linear-gradient(180deg, rgba(47,116,231,0.08), rgba(47,116,231,0.02));
}

.week-v-day.closed {
  background: #f5f7fb;
}
.week-v-day.vacation {
  background: #f7f3ff;
}
.week-v-day.holiday {
  background: #fff4f5;
}

.week-v-title {
  padding: 8px;
  min-height: var(--head-h);
  background: #f8fafc;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 30;
  background-clip: padding-box;
}

.week-v-title-main {
  font-weight: 800;
  font-size: 0.9rem;
  margin-bottom: 4px;
}

.week-v-title-badges {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}

.absence-strip {
  position: sticky;
  top: var(--head-h);
  z-index: 28;
  min-height: var(--absence-h);
  padding: 5px 8px;
  border-bottom: 1px solid #e6edf8;
  background: #fbfdff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  overflow: visible;
}

.absence-pop {
  position: relative;
  top: 0;
  right: 0;
  z-index: 36;
  flex: 1 1 auto;
}

.absence-toggle {
  width: 100%;
  border: 1px solid #d8e2f0;
  background: #f4f8fe;
  color: #47607d;
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  text-align: left;
}

.day-quick-add-pop {
  position: relative;
  z-index: 36;
  flex: 0 0 auto;
}
.absence-pop.open,
.day-quick-add-pop.open,
.absence-pop:hover,
.day-quick-add-pop:hover { z-index: 120; }

.day-quick-add-toggle {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid #cbd8eb;
  background: #fff;
  color: #1f63cb;
  font-weight: 900;
  font-size: 18px;
  line-height: 1;
  display: grid;
  place-items: center;
  padding: 0;
}

.day-quick-add-panel {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  width: min(340px, 64vw);
  max-height: 280px;
  overflow: auto;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 10px;
  padding: 8px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.2);
  z-index: 140;
}

.day-quick-add-group + .day-quick-add-group {
  margin-top: 6px;
}

.day-quick-add-group-title {
  font-size: 11px;
  font-weight: 800;
  color: #314a6d;
  padding: 4px 2px 6px;
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 1;
}

.day-quick-add-pop:hover .day-quick-add-panel,
.day-quick-add-pop.open .day-quick-add-panel {
  display: block;
}

.day-quick-add-item {
  padding: 6px 0;
  border-bottom: 1px solid #edf2fa;
  display: block;
}

.day-quick-add-item:last-child {
  border-bottom: 0;
}

.day-quick-piece-btn {
  width: 100%;
  border: 1px solid #dbe7f7;
  background: #f8fbff;
  border-radius: 8px;
  padding: 8px;
  text-align: left;
  display: grid;
  gap: 3px;
}

.day-quick-piece-btn strong {
  font-size: 12px;
  color: #142642;
}

.day-quick-piece-btn span {
  font-size: 11px;
  color: #5a6f8c;
}

.quick-place-ghost {
  position: fixed;
  z-index: 350;
  pointer-events: none;
  display: none;
  max-width: 260px;
  border: 1px solid #cfe0fb;
  background: rgba(248, 251, 255, 0.98);
  color: #14356a;
  border-radius: 10px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 700;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.18);
}

body.quick-placing .quick-place-ghost {
  display: block;
}

.absence-toggle.has-absences {
  border-color: #efc97f;
  background: #ffeec9;
  color: #7e5000;
}

.absence-popover {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  width: min(340px, 70vw);
  max-height: 220px;
  overflow: auto;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 10px;
  padding: 8px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.2);
  z-index: 140;
}

.absence-pop:hover .absence-popover,
.absence-pop.open .absence-popover {
  display: block;
}

.absence-popover-head {
  font-size: 12px;
  font-weight: 800;
  color: #243755;
  margin-bottom: 6px;
}

.absence-section-title {
  font-size: 11px;
  font-weight: 800;
  color: #6f819d;
  text-transform: uppercase;
  letter-spacing: .04em;
  margin: 4px 0 2px;
}

.absence-divider {
  height: 1px;
  background: #e6edf8;
  margin: 8px 0 6px;
}

.absence-item {
  padding: 6px 0;
  border-bottom: 1px solid #edf2fa;
  display: grid;
  gap: 2px;
  position: relative;
}
.absence-manage-btn {
  position: absolute;
  top: 4px;
  right: 0;
  width: 24px;
  height: 24px;
  padding: 0;
  line-height: 1;
  font-size: 12px;
  border: 1px solid #d8e3f2;
  border-radius: 8px;
  background: #fff;
  color: #2f74e7;
  cursor: pointer;
}
.absence-manage-btn:hover { background: #eef4ff; }
.absence-item > strong { padding-right: 30px; width: 100%; box-sizing: border-box; }
.absence-decl-date {
  margin-left: auto;
  font-size: 10px;
  font-weight: 600;
  color: #8aa0bd;
  white-space: nowrap;
  letter-spacing: .02em;
}

.absence-item:last-child {
  border-bottom: 0;
}

.absence-item strong {
  font-size: 12px;
  color: #142642;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.absence-item > .absence-detail {
  font-size: 11px;
  color: #5a6f8c;
  display: block;
  min-width: 0;
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.35;
}

.absence-detail-full,
.absence-detail-compact {
  display: inline;
}

.absence-detail-note {
  display: inline;
}

.absence-item > .absence-detail .absence-detail-compact {
  display: none;
}

@media (max-width: 720px) {
  .absence-item > .absence-detail.is-availability-detail .absence-detail-full {
    display: none;
  }
  .absence-item > .absence-detail.is-availability-detail .absence-detail-compact {
    display: inline;
  }
}

.week-v-body {
  position: relative;
  height: calc(var(--slot-h) * var(--slot-count));
  user-select: none;
  overflow: hidden;
}
.week-v-edge-halo {
  position: absolute;
  left: 3px;
  right: 3px;
  height: 10px;
  opacity: 0;
  pointer-events: none;
  z-index: 5;
  transition: opacity .22s ease-out;
  --halo-color: rgba(47, 116, 231, 0.22);
  filter: blur(1.4px) saturate(0.95);
}
.week-v-edge-halo.top {
  top: 1px;
  background:
    linear-gradient(to bottom, rgba(255,255,255,0) 0%, var(--halo-color) 10%, rgba(255,255,255,0) 38%),
    radial-gradient(140% 120% at 50% -30%, var(--halo-color) 0%, rgba(255,255,255,0) 68%),
    radial-gradient(46% 95% at 14% -15%, rgba(255,255,255,0) 0%, rgba(255,255,255,0) 52%, rgba(47,116,231,0.08) 66%, rgba(255,255,255,0) 84%),
    radial-gradient(54% 100% at 83% -10%, rgba(255,255,255,0) 0%, rgba(255,255,255,0) 50%, rgba(47,116,231,0.07) 66%, rgba(255,255,255,0) 86%),
    linear-gradient(to bottom, rgba(255,255,255,0.08), rgba(255,255,255,0));
}
.week-v-edge-halo.bottom {
  bottom: 1px;
  background:
    linear-gradient(to top, rgba(255,255,255,0) 0%, var(--halo-color) 10%, rgba(255,255,255,0) 38%),
    radial-gradient(140% 120% at 50% 130%, var(--halo-color) 0%, rgba(255,255,255,0) 68%),
    radial-gradient(48% 95% at 18% 118%, rgba(255,255,255,0) 0%, rgba(255,255,255,0) 52%, rgba(47,116,231,0.08) 66%, rgba(255,255,255,0) 84%),
    radial-gradient(56% 100% at 80% 114%, rgba(255,255,255,0) 0%, rgba(255,255,255,0) 50%, rgba(47,116,231,0.07) 66%, rgba(255,255,255,0) 86%),
    linear-gradient(to top, rgba(255,255,255,0.08), rgba(255,255,255,0));
}

.week-v-grid {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-rows: repeat(var(--slot-count), var(--slot-h));
}

.week-v-slot-gaps {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}

.week-v-slot-gap {
  position: absolute;
  left: 6px;
  right: 6px;
  border: 1px dashed rgba(47, 116, 231, 0.38);
  background: linear-gradient(180deg, rgba(47, 116, 231, 0.08), rgba(47, 116, 231, 0.03));
  border-radius: 8px;
  min-height: 18px;
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  padding: 3px 5px;
}

.week-v-slot-gap > span {
  font-size: 11px;
  font-weight: 700;
  color: #2b61b7;
  background: rgba(255,255,255,0.9);
  border-radius: 999px;
  padding: 1px 6px;
}

.week-v-slot-gap.child-vacation {
  border-color: rgba(126, 81, 255, 0.38);
  background: linear-gradient(180deg, rgba(126, 81, 255, 0.09), rgba(126, 81, 255, 0.03));
}

.week-v-slot-gap.child-vacation > span {
  color: #6241c6;
}

.week-v-line {
  border-top: 1px solid #edf2f9;
}

.week-v-line:nth-child(4n + 1) {
  border-top-color: #dfe7f4;
}

.week-v-line.slot-highlight {
  background: linear-gradient(90deg, rgba(47,116,231,0.065), rgba(47,116,231,0.02));
  box-shadow: inset 2px 0 0 rgba(47,116,231,0.28);
}

.week-v-line.slot-highlight-child-vac {
  background: linear-gradient(90deg, rgba(126, 81, 255, 0.07), rgba(126, 81, 255, 0.02));
  box-shadow: inset 2px 0 0 rgba(126, 81, 255, 0.3);
}

.week-v-events {
  position: absolute;
  inset: 0;
  z-index: 4;
}

body.external-dragging .week-v-events,
body.external-dragging .week-v-slot-gaps {
  pointer-events: none;
}

.week-v-body-target {
  box-shadow: inset 0 0 0 2px #60a5fa;
}
.week-v-body.drop-invalid-absence {
  box-shadow: inset 0 0 0 2px rgba(220, 53, 69, 0.78);
}
.week-v-body.drop-overlap-warning {
  box-shadow: inset 0 0 0 2px rgba(225, 148, 16, 0.72);
}
.week-v-preview {
  position: absolute;
  left: 6px;
  z-index: 35;
  display: none;
  font-size: 0.7rem;
  font-weight: 800;
  color: #0f172a;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid #c7d2fe;
  border-radius: 7px;
  padding: 2px 6px;
  pointer-events: none;
  box-shadow: 0 3px 10px rgba(15, 23, 42, 0.14);
  max-width: min(280px, calc(100% - 12px));
}

.week-v-preview .preview-time {
  font-size: 11px;
  font-weight: 800;
  color: #132744;
}

.week-v-preview .preview-proximity {
  margin-top: 4px;
}

.week-v-preview.drop-preview {
  border-color: #8fb2ff;
  background: rgba(255, 255, 255, 0.98);
}
.week-v-preview.invalid-absence {
  border-color: rgba(220, 53, 69, 0.72);
  background: rgba(255, 249, 249, 0.98);
}
.week-v-preview.overlap-warning {
  border-color: rgba(225, 148, 16, 0.66);
  background: rgba(255, 252, 245, 0.98);
}
.week-v-preview .preview-absence-warning {
  margin-top: 4px;
  color: #9f1239;
  font-size: 11px;
  font-weight: 800;
}
.week-v-preview .preview-overlap-warning {
  margin-top: 4px;
  color: #9a5a00;
  font-size: 11px;
  font-weight: 800;
}

.week-v-event {
  position: absolute;
  border-radius: 7px;
  padding: 2px 4px;
  color: #fff;
  overflow: hidden;
  cursor: grab;
  box-shadow: 0 5px 12px rgba(15, 23, 42, 0.16);
  -webkit-user-select: none;
  user-select: none;
}
.week-v-event:hover {
  z-index: 16;
}
/* Événement annulé : bloc franchement grisé + tampon encreur « ANNULÉ » rouge sombre.
   On force un fond gris (override de la couleur inline) plutôt qu'un filter, pour que
   le tampon rouge posé au-dessus garde ses vraies couleurs. */
.week-v-event.is-cancelled {
  background: #6b7079 !important;
  color: #e8eaed;
}
.week-v-event.is-cancelled .week-v-label,
.week-v-event.is-cancelled .week-v-time,
.week-v-event.is-cancelled .week-v-label-vertical {
  text-decoration: line-through;
  text-decoration-color: rgba(255, 255, 255, 0.65);
}
.week-v-event.is-cancelled .week-v-cancel-ribbon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-11deg);
  z-index: 5;
  pointer-events: none;
  color: #8a1410;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  padding: 2px 11px;
  border: 1.5px solid #8a1410;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.85);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
  white-space: nowrap;
}
.week-v-event.swap-source {
  box-shadow: 0 0 0 2px rgba(255,255,255,0.95), 0 0 0 5px rgba(47,116,231,0.35), 0 5px 12px rgba(15, 23, 42, 0.16);
}
.week-v-event.swap-target {
  box-shadow: 0 0 0 2px rgba(255,255,255,0.95), 0 0 0 5px rgba(16,185,129,0.45), 0 5px 12px rgba(15, 23, 42, 0.16);
}
.week-v-event.swap-target::after {
  content: "Échange";
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  background: rgba(15, 23, 42, 0.78);
  color: #fff;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .02em;
  pointer-events: none;
}

.week-v-event .week-v-time {
  display: block;
  font-size: 0.66rem;
  font-weight: 800;
  line-height: 1;
}

.week-v-event.location .week-v-time,
.week-v-event.blocked .week-v-time,
.week-v-event.business .week-v-time {
  margin-top: 7px;
}

.week-v-event .week-v-label {
  display: block;
  margin-top: 2px;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.1;
  white-space: normal;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  -webkit-user-select: none;
  user-select: none;
}

.week-v-event.business .week-v-label,
.week-v-event.location .week-v-label,
.week-v-event.blocked .week-v-label {
  -webkit-line-clamp: 2;
}

.week-v-event .week-v-altline {
  display: block;
  margin-top: 2px;
  font-size: 0.58rem;
  font-weight: 700;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 0.95;
  color: rgba(255,255,255,0.95);
}

.week-v-event .week-v-label-vertical {
  display: none;
  position: absolute;
  right: 2px;
  bottom: 10px;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  line-height: 1;
  opacity: 0.9;
  max-height: calc(100% - 28px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  pointer-events: none;
}

.week-v-event.label-vertical .week-v-label {
  display: none;
}

.week-v-event.label-vertical .week-v-label-vertical {
  display: block;
}

.week-v-event.small-label .week-v-label-vertical {
  opacity: 0.65;
  font-size: 0.7rem;
  right: 1px;
}
.week-v-event.small-label .week-v-altline,
.week-v-event.tiny-label .week-v-altline,
.week-v-event.label-vertical .week-v-altline {
  display: none;
}

.week-v-event.tiny-label .week-v-label-vertical {
  display: none;
}

.week-v-meta {
  position: absolute;
  right: 4px;
  bottom: 3px;
  display: flex;
  gap: 4px;
  align-items: center;
  z-index: 6;
}
.week-v-handle {
  position: absolute;
  left: 50%;
  width: 14px;
  height: 4px;
  margin-left: -7px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.85);
  cursor: ns-resize;
  z-index: 7;
}
.week-v-handle-top { top: 1px; }
.week-v-handle-bottom { bottom: 1px; }

.score-badge {
  display: inline-block;
  border-radius: 10px;
  padding: 1px 6px;
  font-size: 11px;
}
.score-red { background: #ffdadd; color: #a21d2b; }
.score-orange { background: #ffe7d1; color: #a75b08; }
.score-yellow { background: #fff4c7; color: #946d00; }
.score-green-light { background: #dff6db; color: #1d7f47; }
.score-green-dark { background: #caefd0; color: #146739; }

.badge-error { color: #a52230; background: #ffeaed; border-radius: 999px; padding: 2px 8px; font-size: 11px; }
.badge-warning { color: #8f6100; background: #fff4da; border-radius: 999px; padding: 2px 8px; font-size: 11px; }
.badge-ok { color: #11613a; background: #dff7ea; border-radius: 999px; padding: 2px 8px; font-size: 11px; }
.badge-vacation { color: #5b3f96; background: #eee4ff; border-radius: 999px; padding: 2px 8px; font-size: 11px; }
.badge-holiday { color: #9a1f33; background: #ffe1e6; border-radius: 999px; padding: 2px 8px; font-size: 11px; }
.badge-slot-missing { color: #1c56a7; background: #e6f0ff; border-radius: 999px; padding: 2px 8px; font-size: 11px; }
.business-preview {
  display: inline-flex;
  color: #fff;
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 700;
}

.business-settings {
  display: grid;
  gap: 10px;
}

.business-row {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) 58px 90px minmax(160px, auto) 110px;
  gap: 10px;
  align-items: center;
}

.business-row input[type="color"] {
  width: 58px;
  height: 38px;
  padding: 4px;
  border-radius: 8px;
}
.business-row input[type="number"] {
  width: 100%;
}
.business-row.preset-archived {
  opacity: .58;
}

.param-warning-list {
  margin: 8px 0 10px;
  border: 1px solid #f2d39f;
  background: #fff7e8;
  border-radius: 10px;
  padding: 10px;
  display: grid;
  gap: 8px;
}

.param-warning-list[data-priority="child"] {
  border-left: 4px solid #7e51ff;
}

.param-warning-list[data-priority="standard"] {
  border-left: 4px solid #2f74e7;
}

.param-warning-list.is-ok {
  border-color: #bfe2ca;
  background: #effaf2;
}

.param-warning-head {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

.param-warning-head strong {
  color: #6f4900;
  font-size: 13px;
}

.param-warning-list.is-ok .param-warning-head strong {
  color: #1d6a41;
}

.param-warning-mode {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 700;
  color: #624400;
  background: rgba(255,255,255,0.65);
  border: 1px solid rgba(122,83,0,0.12);
}

.param-warning-list[data-priority="child"] .param-warning-mode {
  color: #4f36a8;
  border-color: rgba(126,81,255,0.2);
}

.param-warning-list[data-priority="standard"] .param-warning-mode {
  color: #1952a8;
  border-color: rgba(47,116,231,0.22);
}

.param-warning-legend {
  display: grid;
  gap: 4px;
  font-size: 12px;
  color: #7a5300;
  background: rgba(255,255,255,0.55);
  border-radius: 8px;
  padding: 7px 8px;
}

.param-warning-item {
  font-size: 12px;
  color: #7a5300;
  background: rgba(255,255,255,0.45);
  border-radius: 7px;
  padding: 4px 6px;
}

.pieces-drawer {
  position: fixed;
  top: 100px;
  right: -320px;
  width: 320px;
  max-height: 74vh;
  overflow: auto;
  z-index: 40;
  transition: right .22s ease;
  box-shadow: 0 12px 28px rgba(14, 36, 74, 0.18);
}
.pieces-drawer.open { right: 16px; }
.pieces-drawer-handle {
  position: fixed;
  top: 280px;
  right: 0;
  transform: rotate(-90deg);
  transform-origin: right top;
  background: #1f63cb;
  color: #fff;
  padding: 8px 10px;
  border-radius: 8px 8px 0 0;
  font-size: 12px;
  z-index: 41;
}
.pieces-drawer-hint {
  position: fixed;
  right: 4px;
  top: 48%;
  transform: translateY(-50%);
  z-index: 39;
  width: 16px;
  height: 38px;
  border-radius: 10px 0 0 10px;
  background: rgba(31, 99, 203, 0.18);
  color: #1f63cb;
  display: grid;
  place-items: center;
  font-weight: 900;
  font-size: 11px;
  animation: hint-pulse 1.8s ease-in-out infinite;
  pointer-events: none;
  transition: opacity .2s ease;
}
@keyframes hint-pulse {
  0%, 100% { opacity: .4; }
  50% { opacity: .9; }
}

.comedien-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  display: inline-block;
  vertical-align: middle;
  border: 1px solid rgba(255,255,255,0.6);
  box-shadow: 0 0 0 1px rgba(20,47,94,0.15);
}

.team-dot-absence {
  background: #d75a5a !important;
}

.team-dot-tech {
  background: #4b87df;
}

.team-role {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 700;
}
.team-role-comedien { background: #e2ecff; color: #184995; }
.team-role-technicien { background: #e7f8f1; color: #1c6b4f; }
.team-role-admin { background: #ede9fe; color: #6d28d9; }
.team-role-entree_libre { background: #fff2e2; color: #9a5a00; }
.team-role-autre { background: #eef1f6; color: #485f7d; }
.team-member-row { cursor: pointer; }
.team-member-row:hover { background: #f6f8fb; }
.team-member-row:focus { outline: 2px solid #2f74e7; outline-offset: -2px; }
.rich-editor {
  min-height: 160px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fff;
  line-height: 1.45;
  overflow: auto;
}
.rich-editor:empty::before {
  content: attr(data-placeholder);
  color: var(--muted);
}
.broadcast-recipient-tools {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin: 8px 0;
}
.broadcast-recipient-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 8px;
  max-height: 230px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  background: #f8fbff;
  margin-bottom: 10px;
}
.broadcast-recipient-row {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  padding: 7px 8px;
  border: 1px solid #e1e9f5;
  border-radius: 8px;
  background: #fff;
}
.broadcast-recipient-row small {
  grid-column: 3;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.broadcast-recipient-row.is-disabled {
  opacity: .58;
}
.broadcast-preview {
  border: 1px solid #dbe7f7;
  border-radius: 10px;
  padding: 12px;
  margin: 12px 0;
  background: #f8fbff;
}
.broadcast-preview h4 {
  margin: 0 0 8px;
  font-size: 13px;
  color: #1f3f69;
}
.broadcast-preview-body {
  border: 1px solid #e5edf8;
  border-radius: 8px;
  background: #fff;
  padding: 12px;
  max-height: 260px;
  overflow: auto;
}
.inline-check { display: inline-flex; align-items: center; gap: 6px; margin: 0; }
.piece-card {
  border: 1px solid var(--line);
  background: #fff;
  border-left: 4px solid var(--blue-500);
  border-radius: 8px;
  padding: 8px;
  margin-bottom: 8px;
  cursor: grab;
}
.piece-card[data-cat="ENFANT"] { border-left-color: #7ebdff; }
.piece-card[data-cat="ADULTE"] { border-left-color: #1f6fe5; }

.trash-zone {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: -80px;
  width: 220px;
  text-align: center;
  background: #961b28;
  color: #fff;
  border-radius: 12px;
  padding: 12px;
  z-index: 60;
  opacity: 0;
  pointer-events: none;
  transition: .18s;
}
.trash-zone.show { bottom: 16px; opacity: 1; pointer-events: auto; }
.trash-zone.dragover {
  background: #d51f37;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.95), 0 0 0 10px rgba(213, 31, 55, 0.35);
  transform: translateX(-50%) scale(1.08);
}

.calendar-list {
  max-height: 180px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px;
  background: #f9fbff;
}
.calendar-item {
  font-size: 12px;
  padding: 4px 2px;
  border-bottom: 1px solid #edf2fa;
}
.calendar-item:last-child { border-bottom: 0; }

.google-source-list,
.google-map-list {
  display: grid;
  gap: 10px;
}

.google-source-row,
.google-map-row {
  display: grid;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8fbff;
}

.google-source-row {
  grid-template-columns: minmax(260px, 1.5fr) minmax(150px, 0.8fr) minmax(150px, 0.8fr);
}

.google-map-row {
  grid-template-columns: minmax(220px, 1.3fr) minmax(180px, 1fr) minmax(180px, 0.8fr) auto;
}

.google-map-list[data-google-kind="comedian"] .google-map-row,
.google-map-list[data-google-kind="piece"] .google-map-row {
  grid-template-columns: minmax(220px, 1.2fr) minmax(220px, 1fr) auto;
}

.google-source-file {
  font-weight: 700;
  color: #1b335e;
  word-break: break-word;
}

.google-mapping-card {
  margin-top: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfdff;
}

.google-mapping-card h4 {
  margin: 0 0 6px;
}

.google-occ-list {
  display: grid;
  gap: 12px;
}

.google-occ-group {
  display: grid;
  gap: 8px;
}

.google-occ-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 800;
  color: #183562;
}

.google-occ-group-collapsed {
  border-top: 1px dashed #d7e1ef;
  padding-top: 10px;
}

.google-occ-group-collapsed > summary {
  cursor: pointer;
  list-style: none;
}

.google-occ-group-collapsed > summary::-webkit-details-marker {
  display: none;
}

.google-occ-group-body {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.google-occ-row {
  display: grid;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.google-occ-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.google-occ-meta {
  color: var(--muted);
  font-size: 12px;
}

.google-occ-files {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.google-occ-file {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: #eef4ff;
  color: #224c90;
  font-size: 12px;
}

.google-occ-actions {
  display: grid;
  grid-template-columns: minmax(180px, 240px) minmax(0, 1fr);
  gap: 8px;
}

.google-keep-box {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #27456f;
}

.google-keep-box input {
  margin: 0;
}

.google-occ-search {
  width: 100%;
  margin: 6px 0 10px;
  padding: 8px 10px;
  border: 1px solid #d6e1f0;
  border-radius: 10px;
  background: #fbfdff;
  color: #183152;
}

.event-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(13, 26, 45, 0.45);
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 8px;
  overflow: hidden;
  overscroll-behavior: contain;
}
.event-modal {
  width: min(520px, 92vw);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
  max-height: 90vh;
  overflow: auto;
  overflow-x: hidden;
  touch-action: pan-y;
}
.absence-modal {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.absence-modal-scroll {
  min-height: 0;
  overflow: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding-right: 2px;
  touch-action: pan-y;
}
.conflict-alert-modal {
  max-width: 680px;
}
.conflict-alert-list {
  margin: 10px 0 4px;
  display: grid;
  gap: 8px;
  max-height: 42vh;
  overflow: auto;
}

.google-import-choice-modal {
  max-width: 720px;
}

.google-import-doubt-list {
  display: grid;
  gap: 8px;
  margin: 12px 0;
}

.google-import-doubt-item {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f8fbff;
}

.google-import-doubt-item span {
  color: var(--muted);
  white-space: nowrap;
}
.conflict-alert-item {
  border-radius: 10px;
  padding: 10px 12px;
  font-weight: 600;
  line-height: 1.25;
  border: 1px solid #d7e1ef;
  background: #f8fbff;
}
.conflict-alert-item.error {
  border-color: #f2b8bf;
  background: #fff3f4;
  color: #8b1322;
}
.conflict-alert-item.warning {
  border-color: #f2d7a7;
  background: #fff9ef;
  color: #8c5a00;
}

.slot-picker-modal {
  width: min(760px, 94vw);
}

.slot-picker-groups {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.slot-picker-group {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  background: #fbfdff;
}

.slot-picker-group h4 {
  margin: 0 0 8px;
  font-size: 12px;
  color: #1b447f;
  text-transform: uppercase;
  letter-spacing: .03em;
  padding: 6px 8px;
  border-radius: 8px;
  background: #f2f6fe;
  border: 1px solid #dbe7fb;
}

.slot-picker-list {
  display: grid;
  gap: 8px;
  max-height: 48vh;
  overflow: auto;
}
.modal-replace-piece-list {
  max-height: 34vh;
  overflow: auto;
}

.slot-piece-btn {
  border: 1px solid #dbe7f7;
  border-radius: 9px;
  background: #fff;
  padding: 8px 10px;
  display: grid;
  gap: 2px;
  text-align: left;
}
.slot-piece-btn.pref-match {
  border-color: #bfe6cb;
  background: #f4fff7;
}
.slot-piece-btn.pref-mismatch {
  border-color: #f2c9cf;
  background: #fff7f8;
}
.slot-piece-btn.tone-great:not(.pref-mismatch),
.slot-piece-btn.tone-ok:not(.pref-mismatch) {
  box-shadow: inset 0 0 0 1px rgba(33, 140, 80, 0.12);
}
.slot-piece-btn.is-primary {
  border-color: #73d19a;
  background: #f0fff6;
  box-shadow: inset 4px 0 0 #22a35a;
}
.slot-piece-btn.tone-danger {
  box-shadow: inset 0 0 0 1px rgba(188, 53, 66, 0.14);
}
.slot-piece-hint {
  display: inline-flex;
  width: fit-content;
  border-radius: 999px;
  padding: 2px 6px;
  font-size: 10px;
  font-weight: 800;
}
.slot-piece-hint.pref-match {
  color: #1f7b3f;
  background: #eaf8ee;
}
.slot-piece-hint.pref-mismatch {
  color: #a43b46;
  background: #fdecef;
}
.slot-piece-btn.is-unplayable {
  border-color: #e3a0a8;
  background: #fdecef;
  box-shadow: inset 0 0 0 2px rgba(188, 53, 66, 0.28);
}
.slot-piece-btn.is-unplayable strong { color: #a43b46; }
.slot-piece-hint.slot-piece-unplayable {
  color: #fff;
  background: #c4354b;
}
.slot-piece-btn.tone-warn,
.slot-piece-btn.is-alt {
  box-shadow: inset 0 0 0 2px rgba(201, 122, 0, 0.30);
  background: #fff8ec;
}
.slot-piece-btn.is-alt {
  box-shadow: inset 4px 0 0 #e2a027, inset 0 0 0 1px rgba(201, 122, 0, 0.18);
}
.slot-piece-hint.slot-piece-alt {
  color: #8a5200;
  background: #ffe9c4;
}

.slot-piece-btn.child {
  border-left: 4px solid #7ebdff;
}

.slot-piece-btn.adult {
  border-left: 4px solid #2f74e7;
}

.slot-piece-btn strong {
  font-size: 12px;
  color: #132744;
}

.slot-piece-btn span {
  font-size: 11px;
  color: #5a6f8c;
}
.auto-alt-list {
  display: grid;
  gap: 10px;
  margin: 12px 0;
}
.auto-alt-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, .8fr);
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid #dbe7f7;
  border-radius: 8px;
  background: #f8fbff;
}
.auto-alt-row span {
  display: grid;
  gap: 3px;
}
.auto-alt-row small {
  color: var(--muted);
}
.proximity-timeline {
  margin-top: 4px;
  display: grid;
  grid-template-columns: 42px 18px minmax(0,1fr) 18px 42px;
  grid-template-rows: 16px auto auto;
  align-items: center;
  gap: 2px 4px;
  padding: 6px 7px;
  border-radius: 8px;
  background: #f6f9ff;
  border: 1px solid #e3ebfb;
}
.proximity-timeline.warn {
  background: #fff9ec;
  border-color: #f1dfb0;
}
.proximity-timeline.ok {
  background: #f2fbf2;
  border-color: #c9eacb;
}
.proximity-timeline.great {
  background: #ebfbf0;
  border-color: #bfe8c9;
}
.proximity-timeline.danger {
  background: #fff1f1;
  border-color: #f0c1c1;
}
.proximity-days {
  font-size: 12px;
  font-weight: 800;
  text-align: center;
  color: #33557f;
  grid-row: 1;
  line-height: 1;
  align-self: end;
}
.proximity-days.left { grid-column: 1; }
.proximity-days.right { grid-column: 5; }
.proximity-arrow {
  font-size: 15px;
  font-weight: 900;
  color: #4b6b97;
  text-align: center;
  grid-row: 2;
}
.proximity-arrow.left { grid-column: 2; }
.proximity-arrow.right { grid-column: 4; }
.proximity-center {
  grid-column: 3;
  grid-row: 2;
  min-width: 0;
  text-align: center;
  font-size: 11px;
  font-weight: 800;
  color: #17355c;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.proximity-note {
  grid-column: 1 / -1;
  grid-row: 3;
  font-size: 10px;
  color: #526f93;
}
.proximity-note.side {
  grid-row: 3;
  font-size: 9px;
  font-weight: 700;
  text-align: center;
}
.proximity-note.side.left {
  grid-column: 1 / 3;
}
.proximity-note.side.right {
  grid-column: 4 / 6;
}
.proximity-note.below-side {
  grid-row: 4;
}
.proximity-note.danger {
  color: #a43a3a;
  font-weight: 700;
}
.proximity-note.warn {
  color: #8b6500;
  font-weight: 700;
}
.proximity-timeline.danger .proximity-days,
.proximity-timeline.danger .proximity-arrow,
.proximity-timeline.danger .proximity-center {
  color: #a43a3a;
}
.proximity-timeline.warn .proximity-days,
.proximity-timeline.warn .proximity-arrow,
.proximity-timeline.warn .proximity-center {
  color: #8b6500;
}
.proximity-timeline.ok .proximity-days,
.proximity-timeline.ok .proximity-arrow,
.proximity-timeline.ok .proximity-center,
.proximity-timeline.great .proximity-days,
.proximity-timeline.great .proximity-arrow,
.proximity-timeline.great .proximity-center {
  color: #1e6b45;
}
.score-badge.alt-used-badge {
  background: #e8f6ec;
  color: #1f7b3f;
  border-color: #bfe5c9;
}
.score-badge.note-badge {
  background: #eaf2ff;
  color: #2251a8;
  border-color: #b9d3f7;
}
.tm-access-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding: 8px 10px;
  margin: 4px 0 6px;
  border: 1px solid #e6edf6;
  border-radius: 10px;
  background: #f7fafe;
}
.tm-access-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* Badge statut d'accès portail (liste équipe) */
.portal-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.3;
  border: 1px solid transparent;
  white-space: nowrap;
}
.portal-status-badge .portal-status-icon { font-size: 12px; }
.portal-status-badge.is-approved {
  background: #1f9d55;
  color: #fff;
  border-color: #178047;
  box-shadow: 0 2px 8px rgba(31, 157, 85, 0.35);
}
.portal-status-badge.is-pending {
  background: #fff4e0;
  color: #9a6300;
  border-color: #f0d199;
}
.portal-status-badge.is-rejected {
  background: #fdeaea;
  color: #b42318;
  border-color: #f2c2be;
}
.portal-status-badge.is-none {
  background: #eef2f7;
  color: #64748b;
  border-color: #d8e0ea;
}
.team-member-row.is-portal-approved > td:first-child {
  box-shadow: inset 3px 0 0 #1f9d55;
}

/* Notes d'équipe (lecture seule) dans le modal admin */
.admin-team-notes { display: flex; flex-direction: column; gap: 8px; }
.atn-note { border: 1px solid #e6edf6; border-radius: 10px; padding: 8px 10px; background: #fbfdff; }
.atn-head { display: flex; align-items: center; gap: 6px; font-size: 12px; color: #1f3a63; }
.atn-head .atn-dot { width: 9px; height: 9px; border-radius: 50%; flex: 0 0 auto; }
.atn-head .atn-date { color: #8aa0bd; font-weight: 600; font-size: 11px; margin-left: auto; }
.atn-text { margin-top: 4px; font-size: 13px; color: #2b3a4f; white-space: pre-wrap; overflow-wrap: anywhere; }

.week-v-preview .proximity-timeline {
  margin-top: 0;
  padding: 4px 5px;
  grid-template-columns: 34px 14px minmax(0,1fr) 14px 34px;
  gap: 1px 2px;
}
.week-v-preview .proximity-days,
.week-v-preview .proximity-note {
  font-size: 10px;
}
.week-v-preview .proximity-arrow {
  font-size: 12px;
}
.week-v-preview .proximity-center {
  font-size: 10px;
}

.pieces-drawer-group {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}
.pieces-drawer-group h4 {
  margin: 2px 0 0;
  font-size: 12px;
  color: #274a77;
  letter-spacing: .02em;
}
.event-hover-tooltip {
  position: fixed;
  z-index: 300;
  display: none;
  max-width: min(360px, 70vw);
  background: rgba(17, 27, 44, 0.96);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 12px;
  line-height: 1.35;
  box-shadow: 0 10px 24px rgba(11, 20, 34, 0.28);
  pointer-events: none;
}
body.is-dragging .event-hover-tooltip,
body.external-dragging .event-hover-tooltip,
body.quick-placing .event-hover-tooltip {
  display: none !important;
}
.event-hover-title {
  font-weight: 800;
  font-size: 13px;
  margin-bottom: 4px;
}
.event-hover-time {
  display: inline-flex;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 700;
  margin-bottom: 6px;
}
.event-hover-proximity {
  margin-bottom: 6px;
}
.event-hover-proximity .proximity-timeline {
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.12);
}
.event-hover-proximity .proximity-center,
.event-hover-proximity .proximity-days,
.event-hover-proximity .proximity-arrow,
.event-hover-proximity .proximity-note {
  color: #dce8ff;
}
.event-hover-proximity .proximity-timeline.danger .proximity-center,
.event-hover-proximity .proximity-timeline.danger .proximity-days,
.event-hover-proximity .proximity-timeline.danger .proximity-arrow,
.event-hover-proximity .proximity-timeline.danger .proximity-note {
  color: #ffb3b3;
}
.event-hover-proximity .proximity-timeline.warn .proximity-center,
.event-hover-proximity .proximity-timeline.warn .proximity-days,
.event-hover-proximity .proximity-timeline.warn .proximity-arrow,
.event-hover-proximity .proximity-timeline.warn .proximity-note {
  color: #ffe4a8;
}
.event-hover-proximity .proximity-timeline.ok .proximity-center,
.event-hover-proximity .proximity-timeline.ok .proximity-days,
.event-hover-proximity .proximity-timeline.ok .proximity-arrow,
.event-hover-proximity .proximity-timeline.ok .proximity-note,
.event-hover-proximity .proximity-timeline.great .proximity-center,
.event-hover-proximity .proximity-timeline.great .proximity-days,
.event-hover-proximity .proximity-timeline.great .proximity-arrow,
.event-hover-proximity .proximity-timeline.great .proximity-note {
  color: #bbf2c9;
}
.event-hover-note {
  margin-top: 2px;
  margin-bottom: 6px;
  background: rgba(255,255,255,0.05);
  border-radius: 8px;
  padding: 6px 8px;
}
.event-hover-note > span {
  display: block;
  font-size: 10px;
  opacity: .8;
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-bottom: 2px;
}
.event-hover-note > div {
  font-size: 12px;
}
.event-hover-conflicts {
  display: grid;
  gap: 4px;
}
.event-hover-conflicts > div {
  font-size: 11px;
  color: #ffd3d8;
  border-left: 2px solid rgba(255, 142, 157, 0.75);
  padding-left: 6px;
}
.modal-error {
  margin-top: 4px;
  margin-bottom: 4px;
  color: #a52230;
  background: #ffeaed;
  border: 1px solid #f5c2c7;
  border-radius: 8px;
  padding: 6px 8px;
  font-size: 12px;
  font-weight: 700;
}

body.is-dragging,
body.is-dragging * {
  -webkit-user-select: none !important;
  user-select: none !important;
  cursor: grabbing !important;
}

.table { width: 100%; border-collapse: collapse; }
.table th, .table td { border-bottom: 1px solid var(--line); padding: 8px; text-align: left; font-size: 13px; }
.table .table-section-row td {
  background: #f4f7fc;
  color: #23416b;
  font-weight: 800;
  letter-spacing: .02em;
}
.subtle-card {
  margin-top: 10px;
  background: #f8fbff;
  border: 1px solid #e2ebfa;
  border-radius: 10px;
  padding: 10px;
}
.subtle-card h4 {
  margin: 0 0 6px;
  font-size: 13px;
  color: #1f3f69;
}
.piece-config-list {
  display: grid;
  gap: 10px;
}
.piece-config-card {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 10px;
  padding: 10px;
}
.piece-config-card.archived {
  opacity: .72;
  background: #fafbfe;
}
.piece-config-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}
.piece-config-identity { display:flex; align-items:flex-start; gap:11px; min-width:0; }
.piece-config-copy { min-width:0; }
.piece-config-poster { flex:0 0 52px; width:52px; aspect-ratio:2/3; overflow:hidden; display:flex; align-items:center; justify-content:center; border:1px solid #dce5f2; border-radius:7px; background:#f1f4f8; color:#8492a6; font-size:9px; line-height:1.2; text-align:center; }
.piece-config-poster img { width:100%; height:100%; object-fit:cover; }
.piece-config-grid {
  margin-top: 8px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.piece-config-grid > div {
  border: 1px solid #edf2fb;
  border-radius: 8px;
  padding: 7px 8px;
  background: #fbfdff;
  font-size: 12px;
}
.piece-chip {
  display: inline-flex;
  margin-left: 6px;
  padding: 2px 7px;
  border-radius: 999px;
  background: #e7eefb;
  color: #204a88;
  font-size: 11px;
  font-weight: 800;
}
.piece-inline-badges {
  margin-top: 6px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.piece-mini-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 700;
  color: #294d7b;
  background: #eef4ff;
  border: 1px solid #dbe7fb;
}
.piece-mini-badge.warning {
  color: #8b5e08;
  background: #fff4d8;
  border-color: #f3d18d;
}
.piece-mini-badge.ok {
  color: #176d49;
  background: #edf9f1;
  border-color: #cbead6;
}
.piece-archived-wrap {
  margin-top: 12px;
}
.piece-archived-wrap > summary {
  cursor: pointer;
  color: #274a77;
  font-weight: 700;
}
.piece-group-block {
  margin-top: 12px;
  display: grid;
  gap: 8px;
  border: 1px solid #dde8fa;
  border-radius: 10px;
  padding: 10px;
  background: #fbfdff;
}
.piece-group-block > h4 {
  margin: 0;
  color: #1f467d;
  font-size: 12px;
  letter-spacing: .02em;
  text-transform: uppercase;
  padding-bottom: 6px;
  border-bottom: 1px solid #e8effb;
}
.scheduler-pause-box { margin:10px 0 14px; padding:11px; border:1px solid #dfc98e; border-radius:9px; background:#fffaf0; }
.scheduler-pause-box > div:first-child { display:flex; flex-direction:column; gap:3px; margin-bottom:9px; }
.scheduler-pause-box > div:first-child span { color:var(--muted); font-size:12px; }
.scheduler-pause-box button { margin-top:7px; }
@media (max-width:720px) {
  .piece-config-head { flex-direction:column; }
  .piece-config-head > .actions-row { width:100%; }
}
.piece-config-modal {
  max-width: 760px;
}
.piece-casting-readonly {
  display: grid;
  gap: 8px;
}
.piece-cast-ro-item {
  border: 1px solid #e1e9f8;
  border-radius: 10px;
  background: #fff;
  padding: 8px;
}
.piece-cast-ro-role {
  font-weight: 800;
  color: #193a67;
  font-size: 12px;
}
.piece-cast-ro-primary {
  margin-top: 4px;
  font-weight: 700;
  color: #213f67;
  font-size: 12px;
}
.piece-cast-ro-alts {
  margin-top: 5px;
  display: grid;
  gap: 6px;
  font-size: 11px;
  color: #5c718f;
}
.piece-alt-picker {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 10px;
}
.piece-alt-picker .check-row.compact {
  font-size: 12px;
}
.month-pills .day-pill {
  min-width: 48px;
}
.piece-casting-list {
  display: grid;
  gap: 8px;
}
.piece-casting-row {
  display: grid;
  grid-template-columns: 1.1fr 1fr 1.2fr auto;
  gap: 8px;
  align-items: end;
  border: 1px solid #e2ebfa;
  background: #fff;
  border-radius: 10px;
  padding: 8px;
}
.piece-casting-row .piece-casting-alts select {
  min-height: 92px;
}
.btn-danger-soft {
  border: 1px solid #f1c2c9;
  background: #fff3f5;
  color: #9b2331;
  border-radius: 8px;
  padding: 8px 10px;
  font-weight: 700;
}
.inline-edit { display: inline-flex; gap: 6px; align-items: center; }
.inline-edit input { width: 78px; padding: 6px; }
.inline-edit button { padding: 6px 8px; }

.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 10px; }
@media (max-width: 980px) {
  .piece-config-grid {
    grid-template-columns: 1fr;
  }
  .piece-config-head {
    flex-direction: column;
  }
  .piece-casting-row {
    grid-template-columns: 1fr;
    align-items: stretch;
  }
  .google-source-row,
  .google-map-row,
  .google-map-list[data-google-kind="comedian"] .google-map-row,
  .google-map-list[data-google-kind="piece"] .google-map-row {
    grid-template-columns: 1fr;
  }
  .google-occ-actions {
    grid-template-columns: 1fr;
  }
}
label { display: grid; gap: 4px; font-size: 13px; }
input, select, textarea {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  font: inherit;
  background: #fff;
}
textarea { resize: vertical; }

.day-pills, .slot-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.day-pill {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 6px 10px;
  cursor: pointer;
}
.day-pill.on { background: #e6f0ff; border-color: #9fc2ff; color: #174f9f; font-weight: 600; }
.slot-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid #b7cff5;
  background: #edf4ff;
  color: #1b4f9b;
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 12px;
}
.slot-chip button { border: 0; background: transparent; padding: 0; color: inherit; }

.actions-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.muted { color: var(--muted); }

.slot-day-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.slot-day-row {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  background: #fbfdff;
}

.slot-day-row.is-closed {
  background: #f6f8fc;
}

.slot-day-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.slot-day-head strong {
  font-size: 14px;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  background: #12356d;
  color: #fff;
  padding: 10px 12px;
  border-radius: 8px;
  opacity: 0;
  transform: translateY(10px);
  transition: .2s;
  pointer-events: none;
  z-index: 120;
}
.toast.show { opacity: 1; transform: translateY(0); }

.comedien-body { background: #eef3fb; min-height: 100dvh; overflow-x: hidden; }
.comedien-shell { max-width: 960px; margin: 0 auto; padding: 16px; min-height: 100dvh; overflow-x: hidden; }
.comedien-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.portal-top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.portal-mobile-toolbar {
  display: none;
  margin-bottom: 10px;
}
.portal-mobile-menu {
  min-height: 44px;
  padding: 10px 14px;
  border-radius: 12px;
  font-weight: 800;
}
.portal-nav-undo {
  min-width: 44px;
  min-height: 44px;
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 12px;
  font-size: 20px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.portal-undo-icon {
  display: block;
  width: 1em;
  height: 1em;
  line-height: .86;
  transform: translateY(-1px);
  pointer-events: none;
}
.portal-mobile-actions { display: none; }
.portal-mobile-actions[hidden],
.portal-mobile-actions button[hidden] { display: none !important; }
.portal-account-menu {
  position: relative;
}
.portal-account-menu[open] {
  z-index: 1400;
}
.portal-account-summary {
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}
.portal-account-summary::-webkit-details-marker {
  display: none;
}
.portal-menu-icon {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #edf4ff;
  border: 1px solid #d8e3f2;
  color: #23416d;
  font-weight: 800;
}
.portal-account-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 220px;
  display: grid;
  gap: 6px;
  padding: 10px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid #d8e3f2;
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.12);
  z-index: 1400;
}
.portal-account-panel button {
  justify-content: flex-start;
  min-height: 42px;
}
.comedien-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  color: #fff;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 700;
  background: #2f74e7;
}
.portal-role-badge {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 12px;
  letter-spacing: .02em;
  border: 1px solid #d8e3f2;
  color: #23416d;
  background: #f4f8ff;
}
.portal-role-badge.comedien {
  color: #176d49;
  background: #edf9f1;
  border-color: #cbead6;
}
.portal-role-badge.technicien {
  color: #2251a8;
  background: #edf4ff;
  border-color: #c8daf7;
}
.portal-role-badge.admin {
  color: #6d28d9;
  background: #f5f3ff;
  border-color: #c4b5fd;
}
.portal-mobile-role { display: none; }
.portal-mobile-role[hidden] { display: none !important; }
.recaps-list {
  display: grid;
  gap: 10px;
}
.recap-link-row {
  display: grid;
  grid-template-columns: minmax(90px, 140px) 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid #d8e0ec;
  border-radius: 8px;
  color: inherit;
  text-decoration: none;
  background: #fff;
}
.recap-link-row:hover {
  border-color: #2f74e7;
  background: #f7faff;
}
.recap-link-row small {
  color: #667a94;
}
.color-with-badge {
  display: flex;
  align-items: center;
  gap: 8px;
}
.color-with-badge .comedien-chip {
  min-height: 34px;
}
.tab-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.portal-planning-nav {
  display: grid;
  gap: 10px;
  margin-bottom: 10px;
}
#m-view-toggle {
  display: none;
}
.portal-nav-main-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.portal-nav-center {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  justify-content: center;
}
.portal-nav-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}
.portal-filters-dropdown {
  position: relative;
}
.portal-filters-dropdown summary {
  list-style: none;
  cursor: pointer;
}
.portal-filters-dropdown summary::-webkit-details-marker {
  display: none;
}
.portal-nav-filters-btn {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 12px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  user-select: none;
}
.portal-filters-dropdown[open] .portal-nav-filters-btn {
  background: #e6f0ff;
  border-color: #96b9f4;
  color: #173f80;
}
.portal-nav-add-block {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 12px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
  border: 1px solid #a7e4c8;
  background: #e9fff4;
  color: #176d49;
  touch-action: manipulation;
}
.portal-filters-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 60;
  min-width: 200px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.12);
}
.portal-view-switch {
  display: inline-flex;
  gap: 8px;
  flex-wrap: wrap;
}
.portal-nav-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.portal-nav-arrow {
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  border-radius: 12px;
  font-size: 24px;
  line-height: 1;
  align-items: center;
  justify-content: center;
  touch-action: manipulation;
}
.portal-nav-label {
  min-height: 44px;
  padding: 0 14px;
  border-radius: 12px;
  font-weight: 800;
  align-items: center;
  justify-content: center;
  line-height: 1;
  touch-action: manipulation;
}
.portal-nav-undo,
.portal-nav-filters-btn,
.portal-view-toggle-btn,
.portal-view-switch .tab-btn {
  touch-action: manipulation;
}
.tab-btn.active {
  background: #e6f0ff;
  border-color: #96b9f4;
  color: #173f80;
  font-weight: 700;
}
.auth-pane,
.view-pane {
  display: none;
}
.auth-pane.active,
.view-pane.active {
  display: block;
}
.month-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}
.month-head { background: #edf3ff; padding: 8px; font-weight: 700; font-size: 12px; }
.portal-inline-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 4px;
  font-size: 13px;
  color: #21406f;
  font-weight: 700;
}
.month-day {
  background: #fff;
  min-height: 192px;
  padding: 6px;
  cursor: pointer;
  border: 1px solid transparent;
  display: grid;
  align-content: start;
  gap: 6px;
  position: relative;
  overflow: hidden;
  -webkit-user-select: none;
  user-select: none;
  touch-action: manipulation;
}
.month-day:hover { border-color: #9ec0fb; }
.month-day.selected { background: #e9f2ff; border-color: #4f90f7; }
.month-day.drop-target { border-color: #1f63cb; box-shadow: inset 0 0 0 2px rgba(31,99,203,0.18); }
.month-day.full-day-absence {
  border-color: #ea8d96;
}
.month-day.month-pad {
  background: #f4f7fc;
  min-height: 64px;
  cursor: default;
  border-color: transparent;
}
.month-day > * {
  position: relative;
  z-index: 1;
}
.month-day-hold-indicator {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  display: none;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  background:
    conic-gradient(rgba(224, 66, 66, 0.95) 0 var(--hold-progress, 0%), rgba(255,255,255,0.2) var(--hold-progress, 0%) 100%);
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.16);
}
.month-day.hold-active .month-day-hold-indicator {
  display: inline-flex;
}
.month-day.hold-add .month-day-hold-indicator {
  background:
    conic-gradient(rgba(224, 66, 66, 0.95) 0 var(--hold-progress, 0%), rgba(255,255,255,0.18) var(--hold-progress, 0%) 100%);
}
.month-day.hold-remove .month-day-hold-indicator {
  background:
    conic-gradient(rgba(53, 104, 203, 0.95) 0 var(--hold-progress, 0%), rgba(255,255,255,0.18) var(--hold-progress, 0%) 100%);
}
.month-day-headline {
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.month-day-title {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  min-width: 0;
}
.month-day-name {
  font-size: 11px;
  font-weight: 800;
  color: #476387;
}
.month-day-date { font-weight: 700; font-size: 12px; color: #476387; }
.month-day .a { margin-top: 6px; font-size: 11px; color: #9b2032; }
.month-day-absence-bg {
  position: relative;
  height: 16px;
  border-radius: 999px;
  background: rgba(225, 66, 66, 0.1);
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  margin-top: -2px;
}
.month-day-absence-bg.is-full-day {
  background: linear-gradient(90deg, rgba(225, 66, 66, 0.28) 0%, rgba(225, 66, 66, 0.38) 100%);
  box-shadow: inset 0 0 0 1px rgba(194, 40, 40, 0.24);
}
.month-day-absence-range {
  position: absolute;
  top: 0;
  bottom: 0;
  background: linear-gradient(90deg, rgba(225, 66, 66, 0.22) 0%, rgba(225, 66, 66, 0.34) 100%);
  border-left: 1px solid rgba(194, 40, 40, 0.34);
  border-right: 1px solid rgba(194, 40, 40, 0.34);
}
.day-plan-list {
  display: grid;
  gap: 4px;
}
.day-plan-chip {
  min-height: 18px;
  padding: 2px 5px;
  border-left: 3px solid #8f9db1;
  border-radius: 6px;
  background: #f5f8fe;
  font-size: 10px;
  line-height: 1.2;
  color: #18345b;
  display: grid;
  gap: 1px;
  -webkit-user-select: none;
  user-select: none;
  touch-action: manipulation;
}
.day-plan-chip.show {
  background: #eef5ff;
}
.day-plan-chip.show.mine {
  background: #e9fff4;
  border-left-width: 5px;
  box-shadow: inset 0 0 0 1px rgba(24, 132, 87, 0.16);
}
.day-plan-chip.business {
  background: #f6f4fb;
}
.day-plan-chip.offsite {
  border-left-width: 5px;
  box-shadow: inset 0 0 0 1px rgba(139, 92, 246, 0.22);
}
.chip-offsite {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  align-self: flex-start;
  margin-top: 1px;
  padding: 1px 6px;
  border-radius: 999px;
  background: #8b5cf6;
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  line-height: 1.3;
}

/* Badge Info / notes d'équipe sur la pastille d'événement */
.chip-note-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 1px 5px;
  min-height: 18px;
  border-radius: 999px;
  border: 1px solid #d8e3f2;
  background: #fff;
  color: #2f74e7;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  opacity: .45;
  filter: grayscale(1);
}
.chip-note-badge.has-notes {
  opacity: 1;
  filter: none;
  background: #eaf2ff;
  border-color: #2f74e7;
  box-shadow: 0 1px 4px rgba(47, 116, 231, 0.25);
}
.chip-note-badge:hover { opacity: 1; }
.day-plan-chip { position: relative; }

/* Événement annulé : chip franchement grisé + tampon encreur « ANNULÉ » rouge sombre. */
.day-plan-chip.is-cancelled {
  overflow: hidden;
  background: #d3d7dd !important;
  border-left-color: #9aa0a8 !important;
}
.day-plan-chip.is-cancelled .t,
.day-plan-chip.is-cancelled .l {
  color: #6a7078;
  text-decoration: line-through;
  text-decoration-color: rgba(106, 112, 120, 0.7);
}
.day-plan-chip.is-cancelled .cancel-ribbon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-11deg);
  z-index: 3;
  pointer-events: none;
  color: #8a1410;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  padding: 2px 11px;
  border: 1.5px solid #8a1410;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
  white-space: nowrap;
}

/* Modal notes d'équipe */
.portal-notes-modal .en-list { display: flex; flex-direction: column; gap: 8px; margin: 8px 0 12px; max-height: 40vh; overflow: auto; }
.en-note { border: 1px solid #e6edf6; border-radius: 10px; padding: 8px 10px; background: #fbfdff; }
.en-note-head { display: flex; align-items: center; gap: 6px; font-size: 12px; color: #1f3a63; }
.en-note-head .en-dot { width: 9px; height: 9px; border-radius: 50%; flex: 0 0 auto; }
.en-note-head .en-date { color: #8aa0bd; font-weight: 600; font-size: 11px; }
.en-note-head .en-edit { margin-left: auto; border: none; background: none; color: #2251a8; font-size: 11px; font-weight: 700; cursor: pointer; padding: 2px 4px; }
.en-note-head .en-del { border: none; background: none; color: #b42318; font-size: 16px; line-height: 1; cursor: pointer; padding: 0 4px; }
.en-note-text { margin-top: 4px; font-size: 13px; color: #2b3a4f; white-space: pre-wrap; overflow-wrap: anywhere; }
.day-plan-chip.absence {
  background: #fff2f2;
  border-left-color: #d94f5c;
  color: #5f1c25;
}
.day-plan-chip.assignable-tech {
  cursor: pointer;
}
.day-plan-chip.tech-selected {
  background: #eef6ff;
  box-shadow: inset 0 0 0 1px rgba(46, 106, 214, 0.18);
}
.day-plan-chip.tech-multi-selected {
  box-shadow: inset 0 0 0 2px rgba(46, 106, 214, 0.35);
  background: #f3f8ff;
}
.day-plan-chip .t {
  font-weight: 800;
}
.day-plan-chip .l {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}
.day-plan-chip.show .l {
  font-weight: 800;
  color: #132033;
}
.portal-special-casting {
  display: block;
  margin-top: 2px;
  color: #28486f;
  font-size: 9px;
  font-weight: 750;
  line-height: 1.25;
}
.day-plan-chip .mine-flag {
  justify-self: start;
  margin-top: 2px;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(24, 132, 87, 0.14);
  color: #176d49;
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .02em;
}
.day-plan-chip .mine-flag.tech-flag {
  background: rgba(46, 106, 214, 0.14);
  color: #2251a8;
}
.portal-block-edit {
  justify-self: start;
  margin-top: 3px;
  min-height: 24px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid #c8d8ef;
  background: #fff;
  color: #173f80;
  font-size: 10px;
  font-weight: 800;
}

@media (min-width: 721px) {
  .comedien-shell {
    max-width: 1240px;
    padding: 24px 18px;
  }
  .comedien-topbar {
    align-items: flex-start;
    margin-bottom: 14px;
  }
  .comedien-topbar h1 {
    margin: 0;
    font-size: 34px;
    line-height: 1.05;
    letter-spacing: 0;
  }
  .comedien-topbar #portal-sub {
    margin: 12px 0 0;
    font-size: 18px;
  }
  .portal-top-actions {
    padding-top: 8px;
  }
  .portal-role-badge,
  .portal-menu-icon,
  .comedien-chip {
    min-height: 34px;
  }
  .portal-menu-icon {
    width: 34px;
    height: 34px;
    border-radius: 10px;
  }
  .portal-tab-card.card {
    padding: 14px 16px;
    margin-bottom: 14px;
  }
  #tab-planning > .card {
    padding: 16px;
  }
  .tab-btn {
    min-height: 36px;
    padding: 7px 12px;
    font-size: 14px;
  }
  .portal-planning-nav {
    margin-bottom: 8px;
  }
  .portal-nav-arrow,
  .portal-nav-label,
  .portal-nav-undo,
  .portal-nav-filters-btn,
  .portal-view-switch .tab-btn {
    min-height: 38px;
    border-radius: 10px;
    align-items: center;
    justify-content: center;
    line-height: 1;
  }
  .portal-nav-arrow,
  .portal-nav-undo {
    min-width: 38px;
    font-size: 20px;
  }
  .portal-nav-label {
    padding: 0 14px;
    font-size: 14px;
  }
  .planning-period-head {
    margin: 4px 0 10px;
  }
  .planning-year {
    font-size: 13px;
  }
  .planning-month {
    font-size: 26px;
  }
  .month-head {
    padding: 7px 8px;
  }
  .month-day {
    min-height: 134px;
    padding: 6px;
    gap: 5px;
  }
  .day-plan-chip {
    min-height: 24px;
    padding: 4px 6px;
    font-size: 11px;
    border-radius: 7px;
  }
}
.day-plan-chip .tech-presence-names {
  font-size: 9px;
  color: #36598f;
  line-height: 1.2;
}
.tech-presence-modal {
  max-width: 560px;
}
.tech-presence-target {
  display: grid;
  gap: 4px;
  margin: 10px 0 14px;
  padding: 12px 14px;
  border: 1px solid #dbe6f5;
  border-radius: 12px;
  background: #f8fbff;
}
.tech-presence-target strong {
  font-size: 18px;
  color: #19365f;
}
.tech-presence-list {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}
.day-plan-more {
  font-size: 10px;
  font-weight: 700;
  color: #647a98;
  padding: 1px 2px 0;
}
.absence-days-summary {
  margin-bottom: 4px;
  font-weight: 700;
  color: #1b335e;
}
.absence-days-detail {
  margin-bottom: 10px;
  font-size: 12px;
  color: #647a98;
}
.absence-day-planning {
  border: 1px solid #dbe7f7;
  border-radius: 10px;
  background: #f8fbff;
  padding: 10px;
  margin: 10px 0 12px;
  display: grid;
  gap: 10px;
}
.absence-day-planning.existing-absences {
  background: #fff8f8;
  border-color: #f1d7d7;
}
.absence-day-planning-head {
  font-size: 12px;
  font-weight: 800;
  color: #18345b;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.absence-day-plan-group {
  display: grid;
  gap: 5px;
}
.absence-day-plan-date {
  font-size: 12px;
  font-weight: 700;
  color: #21406f;
}
.absence-day-plan-list {
  display: grid;
  gap: 4px;
}
.absence-day-plan-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #18345b;
}
.absence-day-plan-item .dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  flex: 0 0 auto;
}
.absence-day-plan-item .tech-dot {
  background: #4f90f7;
}
.absence-day-plan-tech-row {
  color: #36598f;
}
.absence-day-plan-tech {
  display: block;
  margin-top: 2px;
  color: #36598f;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.25;
}
.absence-day-plan-lieu {
  display: inline-block;
  margin-top: 2px;
  color: #7c4bd0;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.25;
}
.absence-full-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 10px 0 6px;
  font-weight: 600;
  color: #18345b;
}
.absence-full-toggle input[type="checkbox"] {
  margin: 0;
  inline-size: 18px;
  block-size: 18px;
  flex: 0 0 auto;
}
.absence-existing-item .absence-dot {
  background: #d75a5a;
}
.absence-existing-item {
  width: 100%;
  border: 0;
  background: transparent;
  padding: 0;
  text-align: left;
  cursor: pointer;
}
.absence-existing-item.readonly {
  cursor: default;
}
.absence-existing-item:hover strong {
  text-decoration: underline;
}
.absence-existing-item.readonly:hover strong {
  text-decoration: none;
}
.absence-existing-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
  align-items: center;
}
.absence-inline-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}
.absence-inline-duplicate,
.absence-inline-delete {
  width: 28px;
  height: 28px;
  min-width: 28px;
  padding: 0;
  border-radius: 8px;
  border: 1px solid #f0c8c8;
  background: #fff;
  color: #b42318;
  font-size: 18px;
  line-height: 1;
}
.absence-inline-duplicate {
  border-color: #c8d7f0;
  color: #1d4ed8;
  font-size: 15px;
}
.timeline-picker {
  --portal-timeline-slot-height: 6px;
  display: grid;
  grid-template-columns: 62px 1fr;
  gap: 8px;
  margin: 10px 0;
}
.timeline-picker.disabled {
  opacity: .82;
}
.timeline-scale {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}
.timeline-scale > div {
  height: calc(var(--portal-timeline-slot-height) * 4);
  padding: 2px 6px;
  border-top: 1px solid #edf2f9;
  font-size: 12px;
  color: var(--muted);
}
.timeline-scale > div:first-child { border-top: 0; }
.timeline-grid {
  border: 1px solid var(--line);
  border-radius: 8px;
  position: relative;
  height: calc(64 * var(--portal-timeline-slot-height));
  background: #fff;
  overflow: hidden;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
}
.timeline-picker.disabled .timeline-grid {
  touch-action: pan-y;
}
.timeline-existing {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

@media (max-width: 720px) {
  .comedien-shell {
    max-width: none;
    width: 100%;
    padding: calc(22px + env(safe-area-inset-top)) 10px 10px;
    box-sizing: border-box;
    overflow-x: hidden;
  }
  .comedien-topbar {
    align-items: center;
    justify-content: space-between;
    flex-direction: row;
    padding: 4px 0 8px;
  }
  .comedien-topbar h1 {
    font-size: 18px;
    margin: 0;
  }
  .comedien-topbar #portal-sub {
    display: none;
  }
  .portal-top-actions {
    margin-left: auto;
    width: auto;
    flex-shrink: 0;
  }
  .portal-role-badge {
    display: none;
  }
  .portal-mobile-role {
    display: inline-block;
    margin-top: 4px;
    padding: 2px 7px;
    border-radius: 999px;
    background: #edf9f1;
    color: #176d49;
    font-size: 10px;
    line-height: 1.35;
    font-weight: 800;
  }
  .portal-mobile-role.technicien { background: #edf4ff; color: #2251a8; }
  .portal-mobile-role.admin { background: #f5f3ff; color: #6d28d9; }
  .portal-account-summary .comedien-chip {
    max-width: 58vw;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .portal-mobile-toolbar {
    display: block;
  }
  .portal-filters-dropdown {
    position: relative;
    width: auto;
  }
  .portal-filters-panel {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    box-shadow: 0 16px 36px rgba(15, 23, 42, 0.14);
    border-radius: 12px;
    margin-top: 0;
    min-width: 0;
    width: min(280px, calc(100vw - 24px));
  }
  .portal-filters-panel > label {
    width: 100%;
  }
  .portal-nav-actions {
    flex-shrink: 0;
  }
  .portal-inline-toggle {
    min-height: 44px;
    padding: 8px 10px;
    border: 1px solid #d9e4f5;
    border-radius: 12px;
    background: #fff;
  }
  .tab-row {
    display: none;
  }
  .portal-tab-card {
    display: none;
  }
  .planning-month {
    font-size: 18px;
    white-space: nowrap;
  }
  #tab-planning > .card {
    padding: 0;
    border: none;
    background: transparent;
    box-shadow: none;
    margin-bottom: 96px;
  }
  .portal-planning-nav {
    position: sticky;
    top: 0;
    z-index: 40;
    padding: 8px 10px;
    background: rgba(255,255,255,0.97);
    backdrop-filter: blur(8px);
    border-radius: 12px;
    margin-bottom: 8px;
    gap: 0;
    overflow: visible;
  }
  .portal-nav-main-row {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 5px;
    width: auto;
    min-width: 0;
    overflow: visible;
  }
  .portal-nav-center {
    flex: 1 1 auto;
    min-width: 0;
    justify-content: center;
    gap: 4px;
  }
  .portal-nav-actions {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    flex: 0 0 auto;
  }
  #m-view-toggle {
    flex-shrink: 0;
  }
  .portal-nav-center #m-today {
    font-size: 12px;
    padding: 0 6px;
    min-width: 0;
    flex: 1 1 auto;
    height: 38px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .portal-view-switch {
    display: none;
  }
  #m-view-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    height: 38px;
    padding: 0 10px;
    font-size: 13px;
    font-weight: 700;
    border-radius: 10px;
    white-space: nowrap;
  }
  .portal-nav-arrow {
    min-width: 38px;
    min-height: 38px;
    width: 38px;
    height: 38px;
    font-size: 20px;
  }
  .portal-nav-undo {
    min-width: 38px;
    min-height: 38px;
    width: 38px;
    height: 38px;
    font-size: 18px;
    padding: 0;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .portal-nav-filters-btn {
    min-height: 38px;
    height: 38px;
    font-size: 12px;
    align-items: center;
    justify-content: center;
  }
  .portal-nav-add-block {
    min-width: 38px;
    width: 38px;
    min-height: 38px;
    height: 38px;
    padding: 0;
    font-size: 22px;
    font-weight: 700;
  }
  .month-grid {
    grid-template-columns: 1fr;
    gap: 8px;
    background: transparent;
    border: 0;
  }
  .month-head {
    display: none;
  }
  .month-day {
    min-height: 0;
    padding: 10px;
    gap: 8px;
    border: 1px solid #d8e2f0;
    border-radius: 16px;
    box-shadow: 0 8px 20px rgba(16, 38, 73, 0.05);
    scroll-margin-top: 96px;
    transform-origin: center center;
    will-change: transform;
    transition: transform 0.08s ease-out;
  }
  .month-day.is-today {
    border-color: #164186;
    /* Liseré en inset : reste à l'intérieur de la carte, jamais masqué par une carte voisine agrandie au scroll. */
    box-shadow: inset 0 0 0 2px #164186, 0 8px 20px rgba(16, 38, 73, 0.12);
    position: relative;
    z-index: 2;
  }
  .month-day.is-today .month-day-date {
    background: #164186;
    color: #fff;
    border-radius: 999px;
    padding: 0 9px;
  }
  .month-day-headline {
    display: flex;
    align-items: baseline;
    gap: 10px;
  }
  .month-day-title {
    gap: 8px;
    flex-wrap: wrap;
  }
  .month-day-name {
    font-size: 14px;
    font-weight: 800;
    color: #18345b;
  }
  .month-day-date {
    font-size: 16px;
    color: #18345b;
  }
  .month-day-absence-bg {
    height: 18px;
    margin-top: -1px;
  }
  .day-plan-list {
    gap: 6px;
  }
  .day-plan-chip {
    min-height: 28px;
    padding: 5px 7px;
    font-size: 12px;
    border-left-width: 4px;
    border-radius: 8px;
  }
  .day-plan-chip .t {
    font-size: 12px;
  }
  .day-plan-chip .l {
    -webkit-line-clamp: 3;
  }
  .day-plan-chip.show .l {
    font-weight: 900 !important;
    color: #0f1f38 !important;
  }
  .day-plan-chip .mine-flag,
  .day-plan-chip .tech-presence-names {
    font-size: 10px;
  }
  .portal-special-casting { margin-top:3px; font-size:11px; }
  .event-modal {
    width: min(100vw - 16px, 680px);
    max-height: calc(100dvh - 18px - env(safe-area-inset-bottom) - 44px);
    padding: 14px;
    border-radius: 18px;
  }
  .absence-modal {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding-bottom: 0;
  }
  .absence-modal-scroll {
    min-height: 0;
    overflow: auto;
    overflow-x: hidden;
    padding-bottom: 12px;
  }
  .absence-day-planning {
    padding: 8px;
    max-height: 112px;
    overflow: auto;
  }
  .absence-modal .actions-row {
    position: sticky;
    bottom: 0;
    flex: 0 0 auto;
    z-index: 3;
    margin-top: auto;
    margin-right: -14px;
    margin-left: -14px;
    padding: 10px 14px calc(18px + env(safe-area-inset-bottom));
    background: linear-gradient(180deg, rgba(255,255,255,0.88) 0%, rgba(255,255,255,1) 35%);
    border-top: 1px solid #e5edf8;
  }
  .timeline-picker {
    --portal-timeline-slot-height: 6px;
    grid-template-columns: 56px 1fr;
    gap: 6px;
    margin: 6px 0;
  }
  .timeline-scale > div {
    height: calc(var(--portal-timeline-slot-height) * 4);
    padding: 3px 5px;
    font-size: 11px;
  }
  .timeline-selection-handle {
    width: 28px;
    height: 10px;
    margin-left: -14px;
  }
  .absence-full-toggle {
    min-height: 44px;
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #d9e4f5;
    border-radius: 12px;
    background: #fff;
    box-sizing: border-box;
  }
  .absence-full-toggle input[type="checkbox"] {
    inline-size: 22px;
    block-size: 22px;
  }
  .grid-2,
  .grid-3 {
    grid-template-columns: 1fr;
  }
  .tech-presence-modal .check-row {
    min-height: 44px;
    align-items: center;
  }
  #trash-zone {
    right: 10px;
    left: 10px;
    bottom: 10px;
    width: auto;
  }
  .portal-mobile-actions {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 12px 14px calc(14px + env(safe-area-inset-bottom));
    display: grid;
    gap: 10px;
    z-index: 18;
    background: rgba(238, 243, 251, 0.88);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-top: 1px solid rgba(22, 65, 134, 0.14);
    box-shadow: 0 -6px 28px rgba(16, 38, 73, 0.18);
  }
  .portal-mobile-actions button {
    min-height: 54px;
    width: 100%;
    font-size: 15px;
    font-weight: 700;
    border-radius: 14px;
    box-shadow: 0 4px 16px rgba(16, 38, 73, 0.18);
  }
}

@media (pointer: coarse) {
  .portal-mobile-actions {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 12px 14px calc(14px + env(safe-area-inset-bottom));
    display: grid;
    gap: 10px;
    z-index: 18;
    background: rgba(238, 243, 251, 0.88);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-top: 1px solid rgba(22, 65, 134, 0.14);
    box-shadow: 0 -6px 28px rgba(16, 38, 73, 0.18);
  }
  .portal-mobile-actions button {
    min-height: 54px;
    width: 100%;
    font-size: 15px;
    font-weight: 700;
    border-radius: 14px;
    box-shadow: 0 4px 16px rgba(16, 38, 73, 0.18);
  }
}
.portal-month-float {
  position: fixed;
  top: calc(12px + env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%) translateY(-8px);
  z-index: 1300;
  padding: 7px 18px;
  border-radius: 999px;
  background: rgba(22, 65, 134, 0.94);
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: .02em;
  box-shadow: 0 8px 24px rgba(16, 38, 73, 0.28);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.portal-month-float.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.timeline-existing-range {
  position: absolute;
  left: 0;
  right: 0;
  background: rgba(215, 90, 90, 0.16);
  border-top: 1px solid rgba(215, 90, 90, 0.22);
  border-bottom: 1px solid rgba(215, 90, 90, 0.22);
}
.timeline-existing-range.is-focused {
  background: rgba(215, 90, 90, 0.24);
  box-shadow: inset 0 0 0 1px rgba(172, 32, 32, 0.18);
}
.timeline-line {
  height: var(--portal-timeline-slot-height);
  border-top: 1px solid #edf2f9;
}
.timeline-line:nth-child(4n + 1) {
  border-top-color: #dfe7f4;
}
.timeline-selection {
  position: absolute;
  left: 2px;
  right: 2px;
  background: rgba(47, 116, 231, 0.22);
  border: 1px solid rgba(47, 116, 231, 0.58);
  border-radius: 6px;
  display: none;
  pointer-events: auto;
  cursor: grab;
  -webkit-user-select: none;
  user-select: none;
}
.timeline-selection-handle {
  position: absolute;
  left: 50%;
  width: 26px;
  height: 6px;
  margin-left: -13px;
  border-radius: 999px;
  background: rgba(255,255,255,0.9);
  box-shadow: 0 0 0 1px rgba(47,116,231,0.22);
  cursor: ns-resize;
}
.timeline-selection-handle.top {
  top: 2px;
}
.timeline-selection-handle.bottom {
  bottom: 2px;
}

@media (max-width: 1100px) {
  .pieces-drawer { display: none; }
  .pieces-drawer-handle { display: none; }
  .pieces-drawer-hint { display: none; }
}

@media (max-width: 960px) {
  .sidebar { position: static; width: 100%; height: auto; }
  .main { margin-left: 0; }
  .app-shell { display: block; }
  .week-vertical { min-width: 980px; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .slot-day-grid { grid-template-columns: 1fr; }
  .business-row { grid-template-columns: 1fr 58px 90px; }
  .business-row .business-preview { grid-column: 1 / 3; }
  .business-row button[data-action] { grid-column: 3; }
}

/* ===== Lieux & blocs externes ===== */
/* Bloc externe (ponctuel, sans fiche) : hachuré, distinct des pièces internes */
.week-v-event.externe {
  background-image: repeating-linear-gradient(45deg, rgba(201,122,0,.95), rgba(201,122,0,.95) 9px, rgba(160,96,0,.95) 9px, rgba(160,96,0,.95) 18px);
  border-left: 3px solid #ffae42;
}
/* Marqueur "EXT" sur les événements au lieu Extérieur */
.week-v-event[data-lieu="exterieur"]::after {
  content: "EXT";
  position: absolute; top: 2px; right: 3px;
  font-size: 8px; font-weight: 700; letter-spacing: .5px;
  background: rgba(0,0,0,.5); color: #fff; padding: 0 3px; border-radius: 3px;
}
/* Filtre de lieux (cases à cocher façon Google Agenda) */
.lieu-hidden { display: none !important; }
.lieu-filter { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin: 6px 0 10px; }
.week-v-offsite { display: inline-block; align-self: flex-start; margin: 2px 0; padding: 1px 6px; border-radius: 999px; color: #fff; font-size: 10px; font-weight: 800; line-height: 1.4; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.week-v-note { display: block; font-size: 10px; font-style: italic; opacity: .92; line-height: 1.25; white-space: normal; overflow: hidden; }
.week-v-event.is-offsite { outline: 2px dashed rgba(15,23,42,.45); outline-offset: -2px; }
.comedien-dot.team-dot-exterior { box-shadow: 0 0 0 2px #fff, 0 0 0 3px #c97a00; }
#s-lieux-list { display: grid; gap: 8px; margin-bottom: 10px; }
.lieu-row { display: grid; grid-template-columns: 44px minmax(120px,1fr) minmax(180px,1.2fr) auto; gap: 8px; align-items: center; }
.lieu-row .lieu-color { width: 44px; height: 36px; padding: 0; border: 1px solid #d8dee6; border-radius: 6px; }
.lieu-row .lieu-del { color: #b91c1c; }
.lieu-filter .lieu-filter-title { font-size: 12px; color: #64748b; font-weight: 600; }
.lieu-filter label { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; cursor: pointer; }
.lieu-filter .lieu-dot { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }

/* Badge "En billetterie" : pastille verte en haut à gauche du bloc */
.week-v-event.is-online::before,
.week-v-event.is-paused::before,
.week-v-event.is-test::before {
  content: "";
  position: absolute; top: 4px; right: 4px; left: auto; z-index: 3;
  width: 9px; height: 9px; border-radius: 50%;
  background: #22c55e; box-shadow: 0 0 0 2px rgba(255,255,255,.85);
}
/* En pause : pastille orange (en billetterie guichet, retirée du site) */
.week-v-event.is-paused::before { background: #f59e0b; }
/* Test : site + Guichet, mais séance masquée du portail équipe. */
.week-v-event.is-test::before { background: #8b5cf6; }
.online-toggle { margin: 4px 0; }

/* Titre du bloc toujours visible au scroll (sticky piloté en JS, car .week-v-event a overflow:hidden) */
.week-v-event .week-v-head { position: relative; z-index: 2; background-color: inherit; padding-right: 14px; will-change: transform; }

/* Appui long : barre de progression + flash de bascule en ligne */
.week-v-event .lp-bar { position: absolute; left: 0; bottom: 0; height: 3px; width: 0; background: #22c55e; z-index: 4; animation: lp-fill .6s linear forwards; }
@keyframes lp-fill { from { width: 0; } to { width: 100%; } }
.week-v-event.lp-ready { outline: 2px solid #22c55e; outline-offset: -2px; }
.week-v-event.lp-flash { animation: lp-flash .6s ease; }
@keyframes lp-flash { 0% { box-shadow: 0 0 0 0 rgba(34,197,94,.75); } 100% { box-shadow: 0 0 0 10px rgba(34,197,94,0); } }

/* Avertissement fiche incomplète dans le modal Publier */
.pub-evt.incomplete { background: #fff7ed; }
.pub-warn { color: #c2410c; font-size: 11px; font-weight: 700; }
.pub-gaps { background: #fff7ed; border: 1px solid #fdba74; border-radius: 8px; padding: 10px 12px; margin: 4px 0 12px; font-size: 13px; color: #9a3412; line-height: 1.5; }

/* Menu Publier */
.export-menu-label { font-size: 11px; text-transform: uppercase; letter-spacing: .4px; color: #94a3b8; padding: 6px 10px 2px; }
.export-menu button.danger { color: #e0556a; }

/* Modal de publication (aperçu calendrier) */
.pub-modal { max-width: 520px; }
.pub-calendar { max-height: 320px; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; margin: 10px 0; }
.pub-day { border: 1px solid #e2e8f0; border-radius: 8px; overflow: hidden; flex-shrink: 0; }
.pub-day-head { background: #0056d6; color: #fff; padding: 5px 10px; font-size: 13px; font-weight: 600; text-transform: capitalize; }
.pub-selection-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 10px 0 4px; }
.pub-selection-tools button { min-height: 34px; padding: 6px 10px; }
.pub-selection-tools strong { margin-left: auto; color: #334155; font-size: 12px; }
.pub-evt { display: grid; grid-template-columns: 20px 48px minmax(0, 1fr); align-items: start; gap: 5px; padding: 7px 10px; font-size: 13px; border-top: 1px solid #f1f5f9; cursor: pointer; }
.pub-evt:hover { background: #f8fafc; }
.pub-evt.incomplete:hover { background: #fff1df; }
.pub-evt input { width: 16px; height: 16px; margin: 1px 0 0; }
.pub-evt .pub-evt-time { color: #64748b; font-variant-numeric: tabular-nums; }
.pub-evt .pub-evt-main { min-width: 0; color: #172033; }
.pub-evt em { color: #c97a00; font-style: normal; font-size: 11px; }
.pub-evt .pub-location { display: block; margin-top: 2px; color: #7c3aed; font-weight: 700; }
.pub-evt.is-exterior { box-shadow: inset 3px 0 #8b5cf6; }

.portal-tutorial-overlay {
  position: fixed;
  inset: 0;
  z-index: 5000;
  pointer-events: auto;
}
.portal-tutorial-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.48);
  animation: portal-tutorial-fade 180ms ease-out;
}
.portal-tutorial-highlight {
  position: absolute;
  top: 0;
  left: 0;
  border: 3px solid #6aa0ff;
  border-radius: 18px;
  box-shadow: 0 0 0 9999px rgba(15, 23, 42, 0.48), 0 12px 36px rgba(25, 86, 196, 0.28);
  pointer-events: none;
  transition: transform 260ms ease, width 260ms ease, height 260ms ease;
}
.portal-tutorial-highlight::after {
  content: "";
  position: absolute;
  inset: -8px;
  border: 2px solid rgba(106, 160, 255, 0.45);
  border-radius: 22px;
  animation: portal-tutorial-pulse 1.25s ease-in-out infinite;
}
.portal-tutorial-card {
  position: absolute;
  top: 0;
  left: 0;
  width: min(360px, calc(100vw - 32px));
  padding: 18px;
  border: 1px solid #cfe0f7;
  border-radius: 16px;
  background: #fff;
  color: #142238;
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.24);
  transition: transform 260ms ease;
  animation: portal-tutorial-card-in 220ms ease-out;
}
.portal-tutorial-card h2 {
  margin: 4px 0 8px;
  font-size: 22px;
  line-height: 1.15;
  letter-spacing: 0;
}
.portal-tutorial-card p {
  margin: 0;
  color: #50627d;
  font-size: 15px;
  line-height: 1.45;
}
.portal-tutorial-count {
  color: #2465d6;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}
.portal-tutorial-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
}
@keyframes portal-tutorial-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes portal-tutorial-card-in {
  from { opacity: 0; transform: translate(var(--tutorial-x, 0), calc(var(--tutorial-y, 0) + 10px)); }
  to { opacity: 1; }
}
@keyframes portal-tutorial-pulse {
  0%, 100% { opacity: 0.45; transform: scale(1); }
  50% { opacity: 0.9; transform: scale(1.025); }
}
@media (max-width: 700px) {
  .portal-tutorial-card {
    width: calc(100vw - 32px);
    padding: 16px;
    border-radius: 14px;
  }
  .portal-tutorial-card h2 {
    font-size: 20px;
  }
  .portal-tutorial-actions {
    justify-content: stretch;
  }
  .portal-tutorial-actions button {
    flex: 1;
  }
}

/* Admin mobile only: desktop layout stays unchanged above 720px. */
@media (max-width: 720px) {
  .app-shell {
    display: block;
    min-height: 100dvh;
    overflow-x: hidden;
  }

  .app-shell .sidebar {
    position: sticky;
    top: 0;
    z-index: 80;
    width: 100%;
    height: auto;
    padding-top: env(safe-area-inset-top);
    box-shadow: 0 8px 24px rgba(15, 35, 72, .16);
  }

  .app-shell .brand {
    padding: 10px 12px;
  }

  .app-shell .brand-badge {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    font-size: 13px;
  }

  .app-shell .brand strong {
    font-size: 14px;
  }

  .app-shell .brand small {
    font-size: 11px;
  }

  .app-shell .menu {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding: 8px 10px 10px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .app-shell .menu::-webkit-scrollbar {
    display: none;
  }

  .app-shell .menu-item {
    flex: 0 0 auto;
    border-radius: 999px;
    padding: 9px 11px;
    font-size: 13px;
    line-height: 1.1;
    white-space: nowrap;
  }

  .app-shell .sidebar-footer {
    display: none;
  }

  .app-shell .main {
    width: 100%;
    margin-left: 0;
    overflow: visible;
  }

  .app-shell .topbar {
    position: sticky;
    top: 0;
    z-index: 70;
    gap: 10px;
    padding: 10px 12px;
  }

  .app-shell .topbar h1 {
    min-width: 0;
    font-size: 20px;
    line-height: 1.15;
  }

  .app-shell .topbar form {
    flex: 0 0 auto;
  }

  .app-shell .topbar button {
    min-height: 36px;
    padding: 7px 10px;
    font-size: 13px;
    white-space: nowrap;
  }

  .app-shell .view {
    padding: 12px 10px 18px;
    overflow: visible;
  }

  .app-shell .card {
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 10px;
  }

  .app-shell .view > .card {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .app-shell .controls {
    flex-wrap: nowrap;
    gap: 6px;
    overflow-x: auto;
    margin: 0 -2px 10px;
    padding: 0 2px 6px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .app-shell .controls::-webkit-scrollbar {
    display: none;
  }

  .app-shell .controls > button,
  .app-shell .controls .export-trigger-wrap {
    flex: 0 0 auto;
  }

  .app-shell .controls button {
    min-height: 38px;
    padding: 8px 10px;
    font-size: 13px;
    white-space: nowrap;
  }

  .app-shell .controls #undo-action,
  .app-shell .controls #redo-action {
    width: 38px;
    min-width: 38px;
    padding: 8px;
    font-size: 16px;
  }

  .app-shell .export-menu {
    right: auto;
    left: 0;
    max-width: calc(100vw - 24px);
  }

  .app-shell .planning-period-head {
    gap: 2px;
    margin: 8px 0 10px;
  }

  .app-shell .planning-year {
    font-size: 12px;
  }

  .app-shell .planning-month {
    font-size: 22px;
  }

  .app-shell .lieu-filter,
  .app-shell .day-pills,
  .app-shell .slot-chips {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .app-shell .lieu-filter::-webkit-scrollbar,
  .app-shell .day-pills::-webkit-scrollbar,
  .app-shell .slot-chips::-webkit-scrollbar {
    display: none;
  }

  .app-shell .lieu-filter label,
  .app-shell .day-pill,
  .app-shell .slot-chip {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  .app-shell .calendar-card {
    max-height: calc(100dvh - 245px);
    min-height: 420px;
    padding: 0;
    overflow: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }

  .app-shell .week-vertical {
    min-width: 980px;
  }

  .app-shell .time-col {
    width: 64px;
  }

  .app-shell .table {
    min-width: 720px;
  }

  .app-shell .table th,
  .app-shell .table td {
    padding: 7px;
    font-size: 12px;
  }

  .app-shell .grid-2,
  .app-shell .grid-3,
  .app-shell .slot-day-grid,
  .app-shell .export-custom-dates,
  .app-shell .auto-alt-row,
  .app-shell .lieu-row,
  .app-shell .piece-config-grid {
    grid-template-columns: 1fr;
  }

  .app-shell .piece-config-head {
    display: grid;
    gap: 8px;
  }

  .app-shell .piece-inline-badges {
    gap: 5px;
  }

  .app-shell .business-row {
    grid-template-columns: 42px minmax(0, 1fr) 72px;
    gap: 7px;
  }

  .app-shell .business-row .business-preview {
    grid-column: 1 / -1;
  }

  .app-shell .business-row button[data-action] {
    grid-column: 1 / -1;
    justify-content: center;
  }

  .app-shell label {
    min-width: 0;
  }

  .app-shell input,
  .app-shell select,
  .app-shell textarea {
    width: 100%;
    min-width: 0;
  }

  .app-shell .actions-row {
    gap: 7px;
  }

  .app-shell .actions-row button,
  .app-shell .actions-row .button-like {
    min-height: 38px;
    justify-content: center;
  }
}

/* Fiche membre : section « Accès Manager » (droits par onglet) */
.tm-manager-access {
  margin: 12px 0 4px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfdff;
  padding: 4px 12px;
}
.tm-manager-access > summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--blue-900);
  padding: 8px 0;
  list-style: none;
}
.tm-manager-access > summary::-webkit-details-marker { display: none; }
.tm-manager-access > summary::before { content: '▸ '; color: var(--muted); }
.tm-manager-access[open] > summary::before { content: '▾ '; }
.mt-all { display: inline-flex; margin: 4px 0 10px; }
.mt-groups {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  padding-bottom: 10px;
}
.mt-group-title {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .4px;
  color: var(--muted);
  font-weight: 700;
  margin-bottom: 6px;
}
.mt-group-items { display: flex; flex-direction: column; gap: 5px; }
.mt-check {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13.5px;
  color: var(--ink);
  cursor: pointer;
}
.mt-check input { width: 16px; height: 16px; accent-color: var(--blue-600); }

.media-source-notice {
  display: grid;
  gap: 4px;
  margin: 0 0 14px;
  padding: 11px 13px;
  border: 1px solid #b9d7f5;
  border-radius: 10px;
  background: #eef7ff;
  color: #244b72;
  font-size: 13px;
}
.media-source-notice a { color: #075da8; font-weight: 700; }
.casting-sync-notice.has-casting-change { border-color:#f0c36a; background:#fff7df; color:#76510b; }
.app-shell input.source-managed-field[readonly] {
  background: #eef1f4;
  color: #65717d;
  border-color: #cbd2d9;
  cursor: not-allowed;
}
.app-shell input[type="number"].source-managed-field[readonly] {
  appearance: textfield;
  -moz-appearance: textfield;
}
.app-shell input[type="number"].source-managed-field[readonly]::-webkit-inner-spin-button,
.app-shell input[type="number"].source-managed-field[readonly]::-webkit-outer-spin-button {
  margin: 0;
  -webkit-appearance: none;
}
