.overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(26, 42, 20, 0.55);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 24px 16px;
  overflow-y: auto;
  animation: fadeIn 0.2s ease;
}

.modal {
  background-color: var(--white);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  width: 100%;
  max-width: 640px;
  animation: scaleIn 0.25s ease;
  margin: auto;
}

.header {
  padding: 24px 24px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  background: var(--white);
  z-index: 1;
  border-bottom: 1px solid var(--sage-50);
  padding-bottom: 16px;
}

.title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--sage-500);
}

.closeBtn {
  background: var(--sage-50);
  border: 1px solid var(--sage-100);
  border-radius: var(--radius-md);
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--sage-400);
  cursor: pointer;
  transition: all 0.2s;
  font-size: 14px;
}

.closeBtn:hover {
  background: var(--sage-100);
  color: var(--sage-500);
}

.body {
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-height: calc(90vh - 180px);
  overflow-y: auto;
}

.grid2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.textarea {
  resize: vertical;
  min-height: 80px;
}

.errorBanner {
  background: #FEE2E2;
  border: 1px solid #FECACA;
  border-radius: var(--radius-md);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #991B1B;
  font-size: 0.875rem;
}

/* Tag Input */
.tagInput {
  display: flex;
  gap: 8px;
}

.tagInput .input {
  flex: 1;
}

.tagList {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--sage-50);
  border: 1px solid var(--sage-200);
  border-radius: var(--radius-full);
  padding: 4px 10px;
  font-size: 0.8125rem;
  color: var(--sage-500);
}

.tag button {
  background: none;
  border: none;
  color: var(--sage-400);
  font-size: 1rem;
  cursor: pointer;
  padding: 0;
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.15s;
}

.tag button:hover {
  background: var(--sage-200);
  color: var(--sage-600);
}

/* Toggle Switch */
.toggleRow {
  display: flex;
  gap: 24px;
  padding: 16px;
  background: var(--sage-50);
  border-radius: var(--radius-md);
}

.toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.toggle input {
  display: none;
}

.toggleSlider {
  position: relative;
  width: 44px;
  height: 24px;
  background: var(--sage-200);
  border-radius: 12px;
  transition: background 0.2s;
  flex-shrink: 0;
}

.toggleSlider::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  background: white;
  border-radius: 50%;
  transition: transform 0.2s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.toggle input:checked + .toggleSlider {
  background: var(--sage-500);
}

.toggle input:checked + .toggleSlider::after {
  transform: translateX(20px);
}

.toggleLabel {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--sage-500);
}

/* Footer */
.footer {
  padding: 16px 24px 24px;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  border-top: 1px solid var(--sage-50);
  position: sticky;
  bottom: 0;
  background: var(--white);
}

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

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

/* Responsive */
@media (max-width: 640px) {
  .modal {
    max-width: 100%;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  }
  .overlay {
    align-items: flex-end;
    padding: 0;
  }
  .grid2col {
    grid-template-columns: 1fr;
  }
  .body {
    padding: 16px;
  }
  .footer {
    padding: 16px;
  }
  .toggleRow {
    flex-direction: column;
    gap: 12px;
  }
}