/* Rotation : styles isolés, couleurs héritées du thème actif. */
.p2-rotation-redesign { max-width: 1120px; --rot-accent: var(--accent, var(--primary)); color: var(--text-main); }
.p2-rotation-redesign .p2-modal-header { padding: 22px 26px; }
.p2-rotation-redesign .p2-modal-body { padding: 22px 26px; }
.p2-rotation-redesign h2,.p2-rotation-redesign h3,.p2-rotation-redesign p { margin: 0; }
.p2-rotation-redesign h2 { font-size: 22px; letter-spacing: -.5px; line-height: 1.3; }
.rot-heading { display: flex; align-items: center; gap: 14px; }
.rot-icon { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 14px; background: color-mix(in srgb, var(--rot-accent) 12%, var(--bg-card)); color: var(--rot-accent); font-size: 25px; }
.rot-eyebrow { display: block; font-size: 10px; font-weight: 700; letter-spacing: 1.3px; color: var(--text-muted); margin-bottom: 4px; }
.p2-rotation-redesign .rot-intro { font-size: 14px; color: var(--text-muted); margin-bottom: 22px; line-height: 1.6; }
.rot-fields { border: 0; padding: 0; margin: 0; min-width: 0; }
.rot-layout { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.rot-main,.rot-aside { display: grid; gap: 20px; min-width: 0; }
.rot-section { min-width: 0; }
.rot-section-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.rot-section-heading h3 { display: flex; align-items: center; gap: 9px; font-size: 14px; font-weight: 700; }
.rot-step { display: grid; place-items: center; width: 23px; height: 23px; border-radius: 7px; font-size: 11px; background: color-mix(in srgb, var(--rot-accent) 10%, var(--bg-card)); color: var(--rot-accent); }
.rot-pill { border: 1px solid var(--border-panel); padding: 4px 8px; border-radius: 20px; color: var(--text-muted); font-size: 11px; white-space: nowrap; }
.rot-help { color: var(--text-muted); font-size: 12px; line-height: 1.5; }
.rot-slots { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px 24px; grid-auto-rows: 112px; margin-top: 14px; max-height: 242px; overflow-y: auto; padding: 3px 22px 3px 3px; align-content: start; scrollbar-gutter: stable; }
.rot-slot-arrow { position: absolute; right: -20px; top: 50%; transform: translateY(-50%); color: var(--rot-accent); font-size: 19px; line-height: 1; pointer-events: none; }
.rot-slot:nth-child(3n) .rot-slot-arrow { transform: translateY(-50%) rotate(90deg); }
.rot-slot:last-child .rot-slot-arrow { display: none; }
.rot-slot { display: grid; position: relative; grid-template-columns: 23px minmax(0, 1fr) 22px; align-items: center; gap: 8px 5px; border: 1px solid var(--border-panel); background: var(--bg-card); border-radius: 12px; padding: 10px; min-width: 0; }
.rot-slot.assigned { border-color: color-mix(in srgb, var(--rot-accent) 35%, var(--border-panel)); }
.rot-slot.over { border-color: var(--rot-accent); background: color-mix(in srgb, var(--rot-accent) 8%, var(--bg-card)); }
.rot-week-number { grid-column: 1; grid-row: 1; display: grid; place-items: center; width: 23px; height: 25px; background: var(--bg-body); color: var(--text-muted); border-radius: 6px; font-size: 11px; font-weight: 700; }
.assigned .rot-week-number { background: color-mix(in srgb, var(--rot-accent) 12%, var(--bg-card)); color: var(--rot-accent); }
.rot-slot-content { display: contents; }
.rot-slot-content label { grid-column: 2; grid-row: 1; font-size: 11px; font-weight: 600; color: var(--text-muted); }
.rot-slot-content select { grid-column: 1 / -1; grid-row: 2; }
.p2-rotation-redesign select { display: block; box-sizing: border-box; width: 100%; max-width: 100%; min-width: 0; height: 34px; padding: 3px 9px; border: 1px solid var(--border-panel); border-radius: 7px; background: var(--bg-body); color: var(--text-main); font: inherit; font-size: 13px; font-weight: 600; }
.rot-slot-content small { grid-column: 1 / -1; grid-row: 3; display: block; color: var(--text-muted); font-size: 10px; line-height: 1.4; }
.rot-remove { grid-column: 3; grid-row: 1; width: 22px; height: 25px; background: transparent; color: var(--text-muted); border: 0; border-radius: 7px; cursor: pointer; }
.rot-remove:hover { background: var(--bg-body); color: var(--color-danger); }
.rot-add { display: flex; align-items: center; justify-content: center; gap: 7px; width: 100%; min-height: 37px; border: 1px dashed var(--border-panel); border-radius: 10px; background: transparent; color: var(--rot-accent); font-size: 12px; font-weight: 600; margin-top: 10px; cursor: pointer; }
.rot-add:hover { background: var(--bg-body); border-color: var(--rot-accent); }
.rot-loop { display: flex; justify-content: center; align-items: center; gap: 6px; font-size: 11px; color: var(--text-muted); margin-top: 9px; }
.rot-settings { border-top: 1px solid var(--border-panel); border-bottom: 1px solid var(--border-panel); padding: 18px 0; }
.rot-duration { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.rot-duration label { font-size: 12px; font-weight: 600; }
.rot-stepper { display: flex; flex-shrink: 0; align-items: center; border: 1px solid var(--border-panel); border-radius: 9px; overflow: hidden; background: var(--bg-body); }
.rot-stepper button { width: 33px; height: 36px; border: 0; background: transparent; color: var(--text-main); cursor: pointer; font-size: 17px; }
.rot-stepper input { width: 45px; height: 36px; text-align: center; border: 0; padding: 0; background: var(--bg-card); color: var(--text-main); font: inherit; font-weight: 700; appearance: textfield; }
.rot-stepper input::-webkit-inner-spin-button { appearance: none; }
.rot-team { display: flex; align-items: center; gap: 10px; padding: 12px; background: var(--bg-body); border: 1px solid var(--border-panel); border-radius: 10px; cursor: pointer; }
.rot-team span { flex: 1; }
.rot-team strong { display: block; font-size: 12px; }
.rot-team small { display: block; color: var(--text-muted); font-size: 11px; line-height: 1.5; margin-top: 3px; }
.p2-rotation-redesign input[type=checkbox] { accent-color: var(--rot-accent); width: 16px; height: 16px; flex-shrink: 0; }
.rot-members { display: grid; gap: 9px; margin-top: 10px; }
.rot-members input[type=search] { width: 100%; box-sizing: border-box; padding: 9px; background: var(--bg-card); border: 1px solid var(--border-panel); border-radius: 8px; color: var(--text-main); }
.rot-member-list { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; max-height: 180px; overflow-y: auto; }
.rot-member-list label { display: flex; align-items: center; gap: 7px; font-size: 12px; }
.rot-library,.rot-preview { border-radius: 13px; padding: 16px; border: 1px solid var(--border-panel); background: var(--bg-body); min-width: 0; }
.rot-template-list { display: grid; gap: 8px; max-height: 230px; overflow-y: auto; margin-top: 13px; }
.rot-template { display: flex; align-items: center; gap: 9px; border: 1px solid var(--border-panel); border-radius: 9px; padding: 12px 10px; background: var(--bg-card); cursor: grab; }
.rot-template>div { flex: 1; min-width: 0; }
.rot-template strong,.rot-template small { display: block; overflow-wrap: anywhere; }
.rot-template strong { font-size: 13px; }
.rot-template small { color: var(--text-muted); font-size: 11px; margin-top: 3px; }
.rot-template>i { color: var(--text-muted); }
.rot-template:hover { border-color: var(--rot-accent); }
.rot-preview { background: var(--bg-card); }
.rot-timeline { max-height: 264px; overflow-y: auto; margin-top: 10px; }
.rot-preview-row { display: flex; align-items: center; gap: 12px; position: relative; min-height: 56px; padding: 5px 0; }
.rot-preview-row:not(:last-child)::after { content: ''; position: absolute; top: 36px; bottom: -25px; left: 4px; width: 1px; background: var(--border-panel); }
.rot-dot { width: 9px; height: 9px; flex-shrink: 0; border-radius: 50%; background: var(--border-panel); z-index: 1; }
.ready .rot-dot { background: var(--rot-accent); }
.rot-preview-row>div { flex: 1; min-width: 0; }
.rot-preview-row small { display: block; color: var(--text-muted); font-size: 10px; margin-bottom: 4px; }
.rot-preview-row strong { display: block; font-size: 12px; overflow-wrap: anywhere; }
.rot-cycle-index { font-size: 10px; color: var(--text-muted); border: 1px solid var(--border-panel); padding: 3px 6px; border-radius: 5px; }
.rot-note { display: flex; align-items: start; gap: 8px; color: var(--text-muted); font-size: 11px; line-height: 1.6; border-top: 1px solid var(--border-panel); padding-top: 16px; margin-top: 20px; }
.rot-note i { font-size: 16px; }
.rot-footer { justify-content: space-between; gap: 12px; }
.rot-footer>div { display: flex; gap: 8px; }
.rot-footer-status { color: var(--text-muted); font-size: 11px; }
.p2-rotation-redesign .rot-error { color: var(--color-danger); font-size: 12px; margin: 10px 0; }
.rot-empty { display: grid; gap: 8px; padding: 12px 0; text-align: center; color: var(--text-muted); font-size: 12px; line-height: 1.6; }
.p2-rotation-redesign :focus-visible { outline: 2px solid var(--rot-accent); outline-offset: 3px; }
@media (max-width: 760px) {
 .rot-layout { grid-template-columns: minmax(0,1fr); gap: 20px; }
 .p2-rotation-redesign .p2-modal-header,.p2-rotation-redesign .p2-modal-body { padding: 16px; }
 .p2-rotation-redesign h2 { font-size: 18px; }
 .rot-footer { flex-wrap: wrap; }
 .rot-footer>div { width: 100%; justify-content: flex-end; }
 .rot-footer-status { display: none; }
 .rot-duration { flex-wrap: wrap; }
 .rot-member-list { grid-template-columns: 1fr; }
}

@media (min-width: 761px) and (max-width: 1050px), (max-width: 560px) {
 .rot-slots { grid-template-columns: repeat(2, minmax(0, 1fr)); }
 .rot-slot:nth-child(3n) .rot-slot-arrow { transform: translateY(-50%); }
 .rot-slot:nth-child(2n) .rot-slot-arrow { transform: translateY(-50%) rotate(90deg); }
}
@media (max-width: 360px) {
 .rot-slots { grid-template-columns: minmax(0, 1fr); }
 .rot-slot .rot-slot-arrow { transform: translateY(-50%) rotate(90deg); }
}
