/* ── Overlay ── */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 16px;
  animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* ── Modal ── */
.modal {
  background: #f8fafc;
  border-radius: 20px;
  width: 100%;
  max-width: 880px;
  max-height: 94vh;
  overflow: auto;
  box-shadow: 0 24px 64px -12px rgba(0, 0, 0, 0.3);
  animation: slideUp 0.25s ease-out;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ── Modal Scrollbar ── */
.modal::-webkit-scrollbar {
  width: 6px;
}
.modal::-webkit-scrollbar-track {
  background: transparent;
}
.modal::-webkit-scrollbar-thumb {
  background: #d9ccf0;
  border-radius: 99px;
}

/* ── Top Bar ── */
.topbar {
  padding: 20px 28px;
  background: #ffffff;
  border-bottom: 1px solid #eae5f1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-radius: 20px 20px 0 0;
  position: sticky;
  top: 0;
  z-index: 10;
}

.topbarLeft {
  display: flex;
  align-items: center;
  gap: 14px;
}

.backBtn {
  background: none;
  border: none;
  font-size: 20px;
  color: #4a0080;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 8px;
  transition: background 0.15s;
  font-weight: 700;
}

.backBtn:hover:not(:disabled) {
  background: #f1edf9;
}

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

.pageTitle {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  color: #1a0440;
  letter-spacing: -0.02em;
}

.pageSub {
  margin: 4px 0 0;
  font-size: 13px;
  color: #8b8397;
  font-weight: 400;
}

.topbarActions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.btnGhost {
  padding: 10px 24px;
  border-radius: 10px;
  border: 1.5px solid #eae5f1;
  background: #ffffff;
  color: #7c3aed;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
}

.btnGhost:hover:not(:disabled) {
  background: #f8f5ff;
  border-color: #c4b5d6;
}

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

.btnPrimary {
  padding: 10px 28px;
  border-radius: 10px;
  border: none;
  background: linear-gradient(135deg, #7c3aed, #4a0080);
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 8px 24px -8px rgba(74, 0, 128, 0.4);
}

.btnPrimary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px -8px rgba(74, 0, 128, 0.5);
}

.btnPrimary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* ── Content ── */
.content {
  padding: 24px 28px;
}

.content::-webkit-scrollbar {
  width: 6px;
}
.content::-webkit-scrollbar-track {
  background: transparent;
}
.content::-webkit-scrollbar-thumb {
  background: #d9ccf0;
  border-radius: 99px;
}

/* ── Card ── */
.card {
  background: #ffffff;
  border-radius: 16px;
  border: 1px solid #eae5f1;
  margin-bottom: 20px;
  overflow: hidden;
}

.card:last-child {
  margin-bottom: 0;
}

.cardHead {
  padding: 16px 20px;
  border-bottom: 1px solid #f1edf9;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #faf9fd;
}

.cardHeadLeft {
  display: flex;
  align-items: center;
  gap: 12px;
}

.stepBadge {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, #7c3aed, #4a0080);
  color: #fff;
  font-size: 16px;
  flex-shrink: 0;
}

.cardTitle {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: #1a0440;
}

.cardHint {
  margin: 2px 0 0;
  font-size: 12px;
  color: #8b8397;
}

.cardBody {
  padding: 20px;
}

/* ── File Count Badge ── */
.fileCount {
  display: flex;
  align-items: center;
}

.fileCountBadge {
  background: linear-gradient(135deg, #7c3aed, #4a0080);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 99px;
}

/* ── Grid ── */
.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.full {
  grid-column: 1 / -1;
}

.half {
  grid-column: span 1;
}

/* ── Labels ── */
.label {
  font-size: 11px;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
  display: block;
}

.req::after {
  content: ' *';
  color: #ef4444;
  font-weight: 700;
}

/* ── Dropzone ── */
.dropzone {
  border: 2px dashed #d9ccf0;
  border-radius: 12px;
  padding: 32px 20px;
  text-align: center;
  color: #8b7fb0;
  background: #fbfaff;
  font-size: 13px;
  display: block;
  cursor: pointer;
  transition: all 0.2s;
}

.dropzone:hover:not(:has(input:disabled)) {
  border-color: #7c3aed;
  background: #f8f5ff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.08);
}

.dropzoneIcon {
  font-size: 32px;
  margin-bottom: 8px;
  color: #7c3aed;
}

.dropzoneText {
  color: #4a0080;
  font-weight: 500;
}

.browseText {
  color: #7c3aed;
  text-decoration: underline;
  font-weight: 600;
}

.dropzoneHint {
  font-size: 11px;
  color: #8b8397;
  margin-top: 6px;
}

/* ── File List ── */
.fileList {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.fileItem {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: #f8f5ff;
  border: 1px solid #eae5f1;
  border-radius: 8px;
  transition: all 0.15s;
}

.fileItem:hover {
  background: #f3eefb;
}

.fileIcon {
  font-size: 20px;
  flex-shrink: 0;
}

.fileInfo {
  flex: 1;
  min-width: 0;
}

.fileName {
  font-size: 13px;
  font-weight: 500;
  color: #1a0440;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fileSize {
  font-size: 11px;
  color: #8b8397;
}

.fileRemove {
  background: none;
  border: none;
  color: #ef4444;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.fileRemove:hover {
  background: #fef2f2;
}

/* ── Inputs ── */
.input {
  width: 100%;
  border: 1.5px solid #eae5f1;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 13px;
  outline: none;
  background: #fcfbfe;
  font-family: inherit;
  color: #26203a;
  transition: all 0.15s;
}

.input:focus:not(:disabled) {
  border-color: #7c3aed;
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
  background: #ffffff;
}

.input:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.input::placeholder {
  color: #b5afc4;
}

.select {
  width: 100%;
  border: 1.5px solid #eae5f1;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 13px;
  outline: none;
  background: #fcfbfe;
  font-family: inherit;
  color: #26203a;
  transition: all 0.15s;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%238b8397' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}

.select:focus:not(:disabled) {
  border-color: #7c3aed;
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
  background: #ffffff;
}

.select:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.textarea {
  width: 100%;
  border: 1.5px solid #eae5f1;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 13px;
  outline: none;
  background: #fcfbfe;
  font-family: inherit;
  color: #26203a;
  resize: vertical;
  transition: all 0.15s;
}

.textarea:focus:not(:disabled) {
  border-color: #7c3aed;
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
  background: #ffffff;
}

.textarea:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.textarea::placeholder {
  color: #b5afc4;
}

/* ── Role Chips ── */
.roleChips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.roleChip {
  padding: 6px 16px;
  border-radius: 99px;
  border: 1.5px solid #eae5f1;
  background: #ffffff;
  color: #8b8397;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
  transition: all 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.roleChip:hover:not(:disabled) {
  border-color: #c4b5d6;
  background: #f8f5ff;
}

.roleChipActive {
  background: #4a0080;
  border-color: #4a0080;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(74, 0, 128, 0.25);
}

.roleChipActive:hover:not(:disabled) {
  background: #5a1090;
  border-color: #5a1090;
}

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

.roleCheck {
  font-size: 12px;
}

/* ── Member List ── */
.memberList {
  max-height: 160px;
  overflow-y: auto;
  border: 1.5px solid #eae5f1;
  border-radius: 10px;
  background: #fcfbfe;
}

.memberList::-webkit-scrollbar {
  width: 4px;
}
.memberList::-webkit-scrollbar-thumb {
  background: #d9ccf0;
  border-radius: 99px;
}

.memberItem {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-bottom: 1px solid #f1edf9;
  cursor: pointer;
  transition: all 0.12s;
}

.memberItem:last-child {
  border-bottom: none;
}

.memberItem:hover:not(.memberSkipped) {
  background: #f8f5ff;
}

.memberSkipped {
  opacity: 0.5;
}

.memberSkipped:hover {
  background: #faf9fd;
}

.memberCheckbox {
  cursor: pointer;
  width: 16px;
  height: 16px;
  accent-color: #4a0080;
  flex-shrink: 0;
}

.memberCheckbox:disabled {
  cursor: not-allowed;
}

.memberInfo {
  min-width: 0;
  flex: 1;
}

.memberName {
  font-size: 12.5px;
  font-weight: 600;
  color: #26203a;
}

.memberEmail {
  font-size: 11px;
  color: #8b8397;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.memberIconActive {
  color: #7c3aed;
  flex-shrink: 0;
}

.memberIconSkipped {
  color: #9ca3af;
  flex-shrink: 0;
}

.loadingState {
  font-size: 12px;
  color: #9ca3af;
  padding: 10px 0;
}

.emptyState {
  font-size: 12px;
  color: #9ca3af;
  padding: 4px 0;
}

/* ── Helper Text ── */
.helperText {
  font-size: 11px;
  color: #8b8397;
  margin: 0 0 8px;
  line-height: 1.5;
}

/* ── Notify Count ── */
.notifyCount {
  color: #8b8397;
  font-weight: 600;
  text-transform: none;
  margin-left: 4px;
}

/* ── Switch ── */
.switchGrid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.switchRow {
  display: flex;
  align-items: center;
  gap: 10px;
}

.switch {
  width: 40px;
  height: 22px;
  border-radius: 99px;
  background: #e2e0ea;
  border: none;
  position: relative;
  cursor: pointer;
  flex: none;
  transition: background 0.2s;
  padding: 0;
}

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

.switchOn {
  background: #4a0080;
}

.switchThumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #ffffff;
  transition: left 0.2s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.switchThumbOn {
  left: 20px;
}

.switchLabel {
  font-size: 12.5px;
  color: #26203a;
}

/* ── Progress ── */
.progressContainer {
  background: #ffffff;
  border-radius: 16px;
  border: 1px solid #eae5f1;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 20px;
}

.progressTrack {
  flex: 1;
  height: 6px;
  border-radius: 99px;
  background: #f3eefb;
  overflow: hidden;
}

.progressFill {
  height: 100%;
  background: linear-gradient(90deg, #7c3aed, #4a0080);
  transition: width 0.3s ease;
  border-radius: 99px;
}

.progressLabel {
  font-size: 12px;
  color: #4a0080;
  font-weight: 700;
  min-width: 40px;
  text-align: right;
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .overlay {
    padding: 8px;
  }

  .modal {
    max-height: 100vh;
    border-radius: 16px;
  }

  .topbar {
    padding: 16px 18px;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    border-radius: 16px 16px 0 0;
  }

  .topbarLeft {
    gap: 10px;
  }

  .topbarActions {
    flex-direction: column;
    gap: 8px;
  }

  .topbarActions button {
    width: 100%;
    justify-content: center;
  }

  .content {
    padding: 16px 18px;
  }

  .cardHead {
    padding: 14px 16px;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .cardBody {
    padding: 16px;
  }

  .grid {
    grid-template-columns: 1fr;
  }

  .half {
    grid-column: 1 / -1;
  }

  .stepBadge {
    width: 32px;
    height: 32px;
    font-size: 14px;
  }

  .pageTitle {
    font-size: 16px;
  }

  .pageSub {
    font-size: 12px;
  }

  .dropzone {
    padding: 20px 16px;
  }

  .memberList {
    max-height: 120px;
  }

  .btnGhost,
  .btnPrimary {
    padding: 10px 16px;
    font-size: 12px;
  }

  .fileItem {
    flex-wrap: wrap;
    padding: 6px 10px;
  }

  .fileInfo {
    width: calc(100% - 60px);
  }

  .fileRemove {
    margin-left: auto;
  }

  .progressContainer {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .progressLabel {
    text-align: center;
  }
}

@media (max-width: 480px) {
  .topbar {
    padding: 12px 14px;
  }

  .content {
    padding: 12px 14px;
  }

  .cardHead {
    padding: 12px 14px;
  }

  .cardBody {
    padding: 12px 14px;
  }

  .fileCountBadge {
    font-size: 10px;
    padding: 3px 10px;
  }

  .roleChip {
    padding: 4px 12px;
    font-size: 11px;
  }

  .backBtn {
    font-size: 18px;
    padding: 4px 8px;
  }

  .pageTitle {
    font-size: 15px;
  }

  .dropzoneIcon {
    font-size: 24px;
  }

  .dropzoneText {
    font-size: 12px;
  }

  .dropzoneHint {
    font-size: 10px;
  }
}

/* ── Dark Mode Support ── */
@media (prefers-color-scheme: dark) {
  .overlay {
    background: rgba(0, 0, 0, 0.8);
  }

  .modal {
    background: #0f0a1a;
  }

  .topbar {
    background: #1a0f2e;
    border-bottom-color: #2a1a3e;
  }

  .pageTitle {
    color: #e8dff5;
  }

  .pageSub {
    color: #a895b8;
  }

  .backBtn {
    color: #a78bfa;
  }

  .backBtn:hover:not(:disabled) {
    background: #2a1a3e;
  }

  .btnGhost {
    background: #1a0f2e;
    border-color: #2a1a3e;
    color: #a78bfa;
  }

  .btnGhost:hover:not(:disabled) {
    background: #2a1a3e;
    border-color: #4a2a6e;
  }

  .card {
    background: #1a0f2e;
    border-color: #2a1a3e;
  }

  .cardHead {
    background: #22153a;
    border-bottom-color: #2a1a3e;
  }

  .cardTitle {
    color: #e8dff5;
  }

  .cardHint {
    color: #a895b8;
  }

  .dropzone {
    background: #22153a;
    border-color: #3a2a5e;
  }

  .dropzone:hover:not(:has(input:disabled)) {
    border-color: #7c3aed;
    background: #2a1a4e;
  }

  .dropzoneText {
    color: #c4b5d6;
  }

  .dropzoneHint {
    color: #8b7fb0;
  }

  .input {
    background: #22153a;
    border-color: #3a2a5e;
    color: #e8dff5;
  }

  .input:focus:not(:disabled) {
    border-color: #7c3aed;
    background: #2a1a4e;
  }

  .input::placeholder {
    color: #6a5a8e;
  }

  .select {
    background: #22153a;
    border-color: #3a2a5e;
    color: #e8dff5;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%238b7fb0' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  }

  .select:focus:not(:disabled) {
    border-color: #7c3aed;
    background: #2a1a4e;
  }

  .textarea {
    background: #22153a;
    border-color: #3a2a5e;
    color: #e8dff5;
  }

  .textarea:focus:not(:disabled) {
    border-color: #7c3aed;
    background: #2a1a4e;
  }

  .textarea::placeholder {
    color: #6a5a8e;
  }

  .roleChip {
    background: #22153a;
    border-color: #3a2a5e;
    color: #a895b8;
  }

  .roleChip:hover:not(:disabled) {
    background: #2a1a4e;
    border-color: #5a3a8e;
  }

  .roleChipActive {
    background: #4a0080;
    border-color: #4a0080;
    color: #ffffff;
  }

  .roleChipActive:hover:not(:disabled) {
    background: #5a1090;
  }

  .memberList {
    background: #22153a;
    border-color: #3a2a5e;
  }

  .memberItem {
    border-bottom-color: #2a1a3e;
  }

  .memberItem:hover:not(.memberSkipped) {
    background: #2a1a4e;
  }

  .memberName {
    color: #e8dff5;
  }

  .memberEmail {
    color: #8b7fb0;
  }

  .fileItem {
    background: #22153a;
    border-color: #3a2a5e;
  }

  .fileItem:hover {
    background: #2a1a4e;
  }

  .fileName {
    color: #e8dff5;
  }

  .fileSize {
    color: #8b7fb0;
  }

  .fileCountBadge {
    background: linear-gradient(135deg, #7c3aed, #4a0080);
  }

  .progressContainer {
    background: #1a0f2e;
    border-color: #2a1a3e;
  }

  .progressTrack {
    background: #2a1a3e;
  }

  .progressLabel {
    color: #a78bfa;
  }

  .switch {
    background: #3a2a5e;
  }

  .switchOn {
    background: #4a0080;
  }

  .switchLabel {
    color: #c4b5d6;
  }

  .label {
    color: #8b7fb0;
  }

  .helperText {
    color: #8b7fb0;
  }

  .emptyState {
    color: #6a5a8e;
  }

  .loadingState {
    color: #6a5a8e;
  }

  .notifyCount {
    color: #8b7fb0;
  }

  .fileRemove {
    color: #f87171;
  }

  .fileRemove:hover {
    background: #3a1a1a;
  }

  .dropzoneIcon {
    color: #a78bfa;
  }

  .browseText {
    color: #a78bfa;
  }

  .modal::-webkit-scrollbar-thumb {
    background: #3a2a5e;
  }

  .content::-webkit-scrollbar-thumb {
    background: #3a2a5e;
  }

  .memberList::-webkit-scrollbar-thumb {
    background: #3a2a5e;
  }
}