/* Modals + sprint flows */

.modal-backdrop {
  position: fixed; inset: 0; z-index: 10000;
  background: rgba(15, 23, 41, 0.38);
  display: flex; align-items: center; justify-content: center;
  animation: fadeIn .12s ease-out;
}
@keyframes fadeIn { from { opacity: 0 } to { opacity: 1 } }

.modal {
  background: white; border-radius: 14px;
  box-shadow: 0 24px 60px rgba(16, 22, 40, 0.28);
  max-height: 88vh; display: flex; flex-direction: column;
  overflow: hidden;
  /* Flex column with max-height needs an explicit min-height: 0 so
     the inner .modal-body can shrink + scroll instead of pushing
     the footer past the 88vh cap (which would then be clipped by
     the modal's overflow: hidden, hiding action buttons like
     "Reset password"). */
  min-height: 0;
  animation: modalIn .14s ease-out;
}
@keyframes modalIn { from { transform: translateY(8px); opacity: 0 } to { transform: none; opacity: 1 } }

.modal-header {
  display: flex; align-items: flex-start; gap: 16px;
  padding: 20px 22px 16px;
  /* Pin header to its natural size — never grow, never shrink — so
     the body is the only flex item that absorbs the height budget. */
  flex: 0 0 auto;
}
.modal-title { font-size: 17px; font-weight: 700; color: #0f1729; letter-spacing: -0.01em; }
.modal-subtitle { font-size: 12.5px; color: #676879; margin-top: 3px; }
.modal-close {
  background: transparent; border: none; color: #676879;
  width: 28px; height: 28px; border-radius: 6px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  margin-left: auto;
}
.modal-close:hover { background: #f0f1f4; color: #0f1729; }

.modal-body {
  padding: 4px 22px 20px;
  /* Take all remaining vertical space inside .modal, but allow the
     content to scroll instead of overflowing — min-height: 0 is
     required for flex children with overflow: auto to actually
     shrink below their content height. */
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
}
.modal-footer {
  display: flex; align-items: center; gap: 8px;
  padding: 14px 22px;
  border-top: 1px solid #eceef2;
  background: #fafbfc;
  /* Pin footer to natural size so primary actions ("Reset password",
     "Save", etc.) always stay visible at the bottom of the modal. */
  flex: 0 0 auto;
}

/* Form grid */
.ms-grid { display: flex; flex-direction: column; gap: 16px; }
.ms-row { display: flex; flex-direction: column; gap: 6px; }
.ms-row-split { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.ms-label {
  font-size: 11px; font-weight: 700; color: #676879;
  letter-spacing: 0.06em; text-transform: uppercase;
  display: flex; justify-content: space-between; align-items: center;
}
.ms-optional { color: #a3a8b6; font-weight: 500; text-transform: none; letter-spacing: 0; }
.ms-input {
  height: 36px; border: 1px solid #e6e9ef; border-radius: 6px;
  padding: 0 10px; font: inherit; color: inherit; background: white;
}
.ms-input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(162, 93, 220, 0.15); }

.ms-toggle { display: flex; gap: 3px; background: #f5f6f8; border-radius: 7px; padding: 3px; }
.ms-toggle button {
  flex: 1; padding: 7px 10px; font-size: 12.5px; font-weight: 500;
  border: none; background: transparent; border-radius: 4px; cursor: pointer; color: #676879;
}
.ms-toggle button.is-active { background: white; color: #0f1729; box-shadow: 0 1px 3px rgba(0,0,0,.08); font-weight: 600; }

/* Task picker list */
.ms-task-list {
  border: 1px solid #e6e9ef; border-radius: 8px;
  max-height: 260px; overflow: auto;
  background: white;
}
.ms-task {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; cursor: pointer;
  border-bottom: 1px solid #f2f3f6;
  font-size: 13px;
}
.ms-task:last-child { border-bottom: none; }
.ms-task:hover { background: #f8f9fb; }
.ms-task.is-on { background: #f5efff; }
.ms-task input[type="checkbox"] { margin: 0; }
.ms-task-epic-bar { width: 3px; height: 16px; border-radius: 2px; flex-shrink: 0; }
.ms-task-name { flex: 1; color: #0f1729; font-weight: 500; }
.ms-task-epic { color: #676879; font-size: 11.5px; }
.ms-task-points {
  width: 28px; text-align: center;
  background: #eceef2; color: #0f1729;
  font-size: 11px; font-weight: 600;
  padding: 3px 0; border-radius: 4px;
}

/* Sprint recap (complete flow) */
.sprint-recap {
  display: flex; align-items: center; gap: 18px;
  padding: 14px 16px;
  background: linear-gradient(135deg, #fafbfc, #f5f6f8);
  border: 1px solid #eceef2; border-radius: 10px;
}
.recap-ring { position: relative; width: 72px; height: 72px; flex-shrink: 0; }
.recap-ring-label {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 16px; color: #0f1729;
}
.recap-stats { display: flex; gap: 22px; margin-bottom: 10px; }
.recap-stats > div { display: flex; flex-direction: column; }
.recap-stats b { font-size: 18px; font-weight: 700; color: #0f1729; }
.recap-stats span { font-size: 11px; color: #676879; letter-spacing: 0.02em; }
.recap-bar { height: 6px; }
.recap-bar .epic-status-summary { height: 6px; width: 100%; }

/* Carryover options */
.carry-opts { display: flex; flex-direction: column; gap: 6px; }
.carry-opt {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px;
  border: 1px solid #e6e9ef; border-radius: 8px;
  cursor: pointer; background: white;
}
.carry-opt:hover { border-color: #d1d5e0; }
.carry-opt.is-on { border-color: var(--brand); background: #faf7ff; box-shadow: 0 0 0 3px rgba(162, 93, 220, 0.12); }
.carry-opt input[type="radio"] { margin: 0; accent-color: var(--brand); }
.carry-opt-icon {
  width: 28px; height: 28px; border-radius: 6px;
  background: #f0f1f4; display: flex; align-items: center; justify-content: center;
  color: #676879;
}
.carry-opt.is-on .carry-opt-icon { background: var(--brand); color: white; }
.carry-opt-title { font-size: 13px; font-weight: 600; color: #0f1729; }
.carry-opt-desc { font-size: 11.5px; color: #676879; margin-top: 1px; }

/* Incomplete list preview */
.incomplete-list {
  border: 1px solid #eceef2; border-radius: 8px;
  max-height: 180px; overflow: auto;
  background: white;
}
.incomplete-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px;
  border-bottom: 1px solid #f2f3f6;
  font-size: 13px;
}
.incomplete-row:last-child { border-bottom: none; }

.btn:disabled { opacity: 0.5; cursor: not-allowed; }
