/* ===== Admin Absence — vue semaine ===== */
.absence-admin-layout {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 14px;
  overflow: hidden;
}

.absence-admin-sidebar {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
  overflow: hidden;
}

.absence-staff-results {
  flex: 1;
  min-height: 0;
  overflow: auto;
  display: grid;
  gap: 6px;
  align-content: start;
}

.absence-staff-hit {
  text-align: left;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.28);
  color: var(--text);
  display: grid;
  gap: 2px;
}

.absence-staff-hit strong { font-size: 0.95rem; }
.absence-staff-hit span { color: var(--muted); font-size: 0.85rem; }

.absence-staff-hit.is-active,
.absence-staff-hit:hover {
  border-color: rgba(224, 177, 35, 0.55);
  background: rgba(224, 177, 35, 0.12);
}

.absence-selected {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(224, 177, 35, 0.35);
  background: rgba(224, 177, 35, 0.1);
  display: grid;
  gap: 2px;
}

.absence-selected span {
  color: var(--muted);
  font-size: 0.88rem;
}

.absence-admin-main {
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.absence-empty-hint {
  grid-column: 2;
  display: grid;
  place-items: center;
  color: var(--muted);
  border: 1px dashed rgba(255, 255, 255, 0.14);
  border-radius: 16px;
  padding: 28px;
  text-align: center;
  background:
    radial-gradient(circle at 20% 20%, rgba(224, 177, 35, 0.08), transparent 45%),
    rgba(0, 0, 0, 0.2);
}

.absence-empty-hint[hidden],
.absence-admin-main[hidden],
.absence-selected[hidden] {
  display: none !important;
}

.absence-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
  flex-shrink: 0;
}

.absence-motif-field {
  min-width: 240px;
  flex: 1;
}

.absence-motif-field select:invalid,
.absence-motif-field select.motif-required {
  border-color: rgba(242, 63, 67, 0.55);
}

.absence-week-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.absence-week-nav strong {
  min-width: 210px;
  text-align: center;
  font-family: var(--font-display);
  letter-spacing: 0.03em;
  font-size: 0.92rem;
}

.absence-time-inputs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-end;
  flex-shrink: 0;
}

.absence-hint {
  margin: 0 !important;
  color: var(--muted) !important;
  font-size: 0.9rem !important;
  flex-shrink: 0;
}

.absence-hint.is-warn {
  color: #ffb4b4 !important;
}

/* Week calendar */
.week-cal {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  border-radius: 16px;
  border: 1px solid rgba(224, 177, 35, 0.22);
  background:
    linear-gradient(180deg, rgba(24, 24, 28, 0.95), rgba(10, 10, 12, 0.98));
  overflow: hidden;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
}

.week-cal-head {
  display: grid;
  grid-template-columns: 56px repeat(7, minmax(0, 1fr));
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  flex-shrink: 0;
}

.week-cal-corner {
  border-right: 1px solid rgba(255, 255, 255, 0.06);
}

.week-cal-dayhead {
  padding: 10px 6px;
  text-align: center;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
}

.week-cal-dayhead:last-child { border-right: 0; }

.week-cal-dayhead em {
  display: block;
  font-style: normal;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
}

.week-cal-dayhead strong {
  display: block;
  margin-top: 2px;
  font-size: 1.05rem;
  font-family: var(--font-display);
  color: #ffe9a8;
}

.week-cal-dayhead.is-today {
  background: rgba(224, 177, 35, 0.12);
}

.week-cal-dayhead.is-today strong {
  color: #fff;
}

.week-cal-body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  display: grid;
  grid-template-columns: 56px repeat(7, minmax(0, 1fr));
  scrollbar-width: thin;
}

.week-cal-hours {
  display: grid;
  grid-template-rows: repeat(24, 28px);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.25);
  position: sticky;
  left: 0;
  z-index: 2;
}

.week-cal-hour {
  display: grid;
  place-items: start end;
  padding: 2px 6px 0 0;
  font-size: 0.7rem;
  color: var(--muted);
  font-weight: 700;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.week-cal-daycol {
  position: relative;
  display: grid;
  grid-template-rows: repeat(24, 28px);
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  background:
    repeating-linear-gradient(
      to bottom,
      transparent 0,
      transparent 27px,
      rgba(255, 255, 255, 0.05) 27px,
      rgba(255, 255, 255, 0.05) 28px
    );
}

.week-cal-daycol:last-child { border-right: 0; }

.week-cal-cell {
  cursor: crosshair;
  position: relative;
  z-index: 1;
}

.week-cal-cell:hover {
  background: rgba(224, 177, 35, 0.08);
}

.week-cal-block {
  position: absolute;
  left: 3px;
  right: 3px;
  border-radius: 8px;
  padding: 4px 6px;
  overflow: hidden;
  z-index: 3;
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.28);
}

.week-cal-block.is-draft {
  pointer-events: auto;
  cursor: pointer;
  z-index: 5;
  background: linear-gradient(160deg, rgba(224, 177, 35, 0.75), rgba(180, 120, 20, 0.85));
  color: #111;
  border-color: rgba(255, 233, 168, 0.55);
}

.week-cal-drag-overlay {
  pointer-events: none !important;
  opacity: 0.9;
}

.week-cal-block.is-saved {
  background: linear-gradient(160deg, rgba(229, 80, 70, 0.88), rgba(150, 30, 40, 0.92));
  color: #fff;
  z-index: 4;
}

.week-cal-block.is-pending-motif {
  background: linear-gradient(160deg, rgba(224, 177, 35, 0.9), rgba(160, 90, 20, 0.92));
  color: #111;
  border-color: rgba(255, 233, 168, 0.55);
  box-shadow: 0 0 0 1px rgba(224, 177, 35, 0.35), 0 8px 18px rgba(0, 0, 0, 0.28);
}

/* Cloche motifs à préciser */
.admin-tab {
  position: relative;
}

.admin-tab-bell {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: 8px;
  padding: 2px 7px 2px 6px;
  border-radius: 999px;
  background: rgba(224, 177, 35, 0.2);
  border: 1px solid rgba(224, 177, 35, 0.45);
  vertical-align: middle;
}

.admin-bell-ico {
  width: 12px;
  height: 12px;
  display: inline-block;
  background: #e0b123;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M12 22a2.5 2.5 0 0 0 2.45-2h-4.9A2.5 2.5 0 0 0 12 22Zm8-6V11a8 8 0 1 0-16 0v5l-2 2v1h20v-1l-2-2Z'/%3E%3C/svg%3E") center / contain no-repeat;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M12 22a2.5 2.5 0 0 0 2.45-2h-4.9A2.5 2.5 0 0 0 12 22Zm8-6V11a8 8 0 1 0-16 0v5l-2 2v1h20v-1l-2-2Z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.admin-bell-count {
  font-size: 0.72rem;
  font-weight: 800;
  color: #f0d78a;
  font-family: var(--font-display);
}

.absence-pending-panel {
  position: absolute;
  top: 8px;
  right: 12px;
  z-index: 20;
  width: min(360px, calc(100% - 24px));
  max-height: min(420px, 70%);
  overflow: auto;
  border-radius: 14px;
  border: 1px solid rgba(224, 177, 35, 0.35);
  background: linear-gradient(165deg, rgba(28, 24, 14, 0.98), rgba(12, 14, 20, 0.98));
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
  padding: 12px;
}

.admin-panel[data-admin-panel="absence"] {
  position: relative;
}

.absence-pending-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.absence-pending-head strong {
  font-family: var(--font-display);
  letter-spacing: 0.04em;
  color: #f0d78a;
}

.absence-pending-close {
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 1.2rem;
  cursor: pointer;
}

.absence-pending-item {
  display: block;
  width: 100%;
  text-align: left;
  margin-bottom: 8px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(224, 177, 35, 0.28);
  background: rgba(224, 177, 35, 0.1);
  color: inherit;
  cursor: pointer;
}

.absence-pending-item:hover {
  background: rgba(224, 177, 35, 0.18);
}

.absence-pending-item strong {
  display: block;
}

.absence-pending-item span {
  display: block;
  font-size: 0.82rem;
  color: var(--muted);
}

.absence-pending-item em {
  display: block;
  margin-top: 4px;
  font-style: normal;
  font-size: 0.75rem;
  font-weight: 700;
  color: #e0b123;
}

.absence-view-motif-edit {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.absence-view-motif-edit .field {
  margin-bottom: 10px;
}

.absence-view-motif-edit select {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(8, 12, 20, 0.9);
  color: #fff;
  font: inherit;
}

.absence-view-motif-edit .btn {
  width: 100%;
}

.week-cal-block.is-event {
  pointer-events: none;
  z-index: 2;
  background: linear-gradient(
    160deg,
    color-mix(in srgb, var(--evt-color, #3b82f6) 78%, transparent),
    color-mix(in srgb, var(--evt-color, #3b82f6) 55%, #0a1628)
  );
  color: #f4f8ff;
  border-color: color-mix(in srgb, var(--evt-color, #3b82f6) 65%, #fff);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.22);
  opacity: 0.92;
}

.week-cal-block strong {
  display: block;
  font-size: 0.72rem;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.week-cal-block span {
  display: block;
  font-size: 0.68rem;
  opacity: 0.9;
}

.absence-list-wrap {
  flex-shrink: 0;
  max-height: 140px;
  overflow: auto;
}

.absence-list-wrap h4 {
  margin: 0 0 8px;
  font-family: var(--font-display);
  letter-spacing: 0.04em;
  font-size: 0.88rem;
}

.absence-day-item {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(229, 80, 70, 0.35);
  background: rgba(229, 80, 70, 0.12);
  margin-bottom: 8px;
}

.absence-day-item strong { display: block; }

.absence-evt-title {
  margin: 14px 0 8px;
  font-family: var(--font-display);
  letter-spacing: 0.04em;
  font-size: 0.88rem;
}

.absence-day-item.is-event {
  border-color: rgba(59, 130, 246, 0.4);
  background: rgba(59, 130, 246, 0.14);
}
.absence-day-item span { color: var(--muted); font-size: 0.88rem; }

/* Popup détail absence — pages 1/2 */
.absence-view-card {
  width: min(420px, 94vw);
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(224, 177, 35, 0.28);
  background: linear-gradient(165deg, rgba(22, 28, 40, 0.98), rgba(12, 16, 24, 0.98));
}

.absence-view-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px 18px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.absence-view-head .eyebrow {
  margin: 0 0 4px;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold, #e0b123);
}

.absence-view-head h3 {
  margin: 0;
  font-size: 1.15rem;
}

.absence-view-pager {
  display: flex;
  gap: 6px;
  margin-left: auto;
  align-self: center;
}

.absence-page-btn {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  font-weight: 800;
  cursor: pointer;
}

.absence-page-btn.is-active {
  background: linear-gradient(160deg, #e0b123, #b47814);
  color: #111;
  border-color: transparent;
}

.absence-view-close {
  margin-left: auto;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
}

.absence-view-pager:not([hidden]) ~ .absence-view-close {
  margin-left: 4px;
}

.absence-view-close:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.absence-view-page {
  padding: 16px 18px 18px;
}

.absence-view-section-label {
  margin: 0 0 10px;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.absence-view-event-card {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--evt-color, #3b82f6) 45%, transparent);
  background: color-mix(in srgb, var(--evt-color, #3b82f6) 18%, transparent);
  margin-bottom: 10px;
}

.absence-view-event-card strong {
  display: block;
  margin-bottom: 4px;
}

.absence-view-event-card span,
.absence-view-meta span {
  display: block;
  color: var(--muted);
  font-size: 0.88rem;
}

.absence-view-empty {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.absence-view-meta {
  display: grid;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(229, 80, 70, 0.35);
  background: rgba(229, 80, 70, 0.12);
}

.absence-view-meta strong {
  display: block;
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 2px;
}

.absence-view-meta p {
  margin: 0;
  font-weight: 700;
}

.absence-view-delete {
  display: block;
  width: 100%;
  margin-top: 16px;
  padding: 10px 12px;
  border: 0;
  background: transparent;
  color: #ff6b63;
  font-weight: 700;
  font-size: 0.95rem;
  text-align: center;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.absence-view-delete:hover {
  color: #ff8f88;
}

@media (max-width: 980px) {
  .absence-admin-layout {
    grid-template-columns: 1fr;
  }
}
