/* ===== MODAL OVERRIDES FOR LARGER CONTENT ===== */
.m-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.m-overlay.active {
  opacity: 1;
  visibility: visible;
}

.m-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
}

.m-card {
  position: relative;
  background: linear-gradient(145deg, rgba(20, 20, 30, 0.95), rgba(15, 15, 25, 0.98));
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 24px;
  padding: 2rem;
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(0.9) translateY(20px);
  transition: transform 0.3s ease;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.5);
}

.m-card-lg {
  max-width: 640px;
}

.m-overlay.active .m-card {
  transform: scale(1) translateY(0);
}

.m-close {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.6);
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  z-index: 10;
}

.m-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.2);
}

.m-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.25rem;
}

.m-subtitle {
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 1.5rem;
}

/* ===== FORM SCROLL ===== */
.m-form-scroll {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* ===== SECTIONS ===== */
.m-section {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 16px;
  padding: 1.25rem;
}

.m-section-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.m-section-icon {
  color: #4ade80;
  font-size: 0.75rem;
}

.m-section-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
}

/* ===== FIELDS ===== */
.m-field {
  margin-bottom: 1rem;
}

.m-field:last-child {
  margin-bottom: 0;
}

.m-label {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 0.5rem;
}

.m-required {
  color: #4ade80;
}

.m-optional {
  color: rgba(255, 255, 255, 0.35);
  font-weight: 400;
  font-size: 0.75rem;
  text-transform: lowercase;
}

.m-input {
  width: 100%;
  padding: 0.75rem 1rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  color: #fff;
  font-size: 0.875rem;
  transition: all 0.2s ease;
  outline: none;
}

.m-input::placeholder {
  color: rgba(255, 255, 255, 0.25);
}

.m-input:focus {
  border-color: #4ade80;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.1);
}

.m-field-hint {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.3);
  margin-top: 0.375rem;
}

/* ===== ERROR MESSAGE ===== */
.m-err-msg {
  display: none;
  align-items: center;
  gap: 0.375rem;
  margin-top: 0.375rem;
  font-size: 0.75rem;
  color: #f87171;
}

.m-err-msg.show {
  display: flex;
}

.m-err-msg i {
  font-size: 0.7rem;
}

/* ===== UPLOAD ZONE ===== */
.m-upload-zone {
  border: 2px dashed rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 160px;
  cursor: pointer;
  transition: all 0.2s ease;
  background: rgba(255, 255, 255, 0.02);
}

.m-upload-zone:hover {
  border-color: rgba(74, 222, 128, 0.4);
  background: rgba(74, 222, 128, 0.03);
}

.m-upload-icon {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.75rem;
}

.m-upload-icon i {
  font-size: 1.25rem;
  color: rgba(255, 255, 255, 0.4);
}

.m-upload-text {
  font-size: 0.875rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.6);
}

.m-upload-hint {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.3);
  margin-top: 0.25rem;
}

.m-upload-preview {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.m-preview-img {
  width: 7rem;
  height: 7rem;
  border-radius: 16px;
  object-fit: cover;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.m-filename {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.5);
  margin-top: 0.75rem;
  max-width: 20rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.m-remove-btn {
  margin-top: 0.5rem;
  font-size: 0.75rem;
  color: #f87171;
  background: none;
  border: none;
  cursor: pointer;
  transition: color 0.2s ease;
}

.m-remove-btn:hover {
  color: #fca5a5;
}

/* ===== TAGS INPUT ===== */
.m-tags-input {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  min-height: 3rem;
  padding: 0.5rem 0.75rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  transition: all 0.2s ease;
}

.m-tags-input:focus-within {
  border-color: #4ade80;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.1);
}

.m-tags-container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
}

.m-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.25rem 0.625rem;
  background: rgba(74, 222, 128, 0.15);
  border: 1px solid rgba(74, 222, 128, 0.3);
  border-radius: 8px;
  font-size: 0.75rem;
  color: #4ade80;
}

.m-tag-remove {
  background: none;
  border: none;
  color: rgba(74, 222, 128, 0.6);
  cursor: pointer;
  font-size: 0.625rem;
  padding: 0;
  display: flex;
  align-items: center;
  transition: color 0.2s ease;
}

.m-tag-remove:hover {
  color: #4ade80;
}

.m-tags-input-field {
  flex: 1;
  min-width: 8.75rem;
  background: transparent;
  border: none;
  outline: none;
  font-size: 0.875rem;
  color: #fff;
}

.m-tags-input-field::placeholder {
  color: rgba(255, 255, 255, 0.25);
}

/* ===== PILLS ===== */
.m-pills-container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.m-pill {
  padding: 0.375rem 0.875rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.6);
  cursor: pointer;
  transition: all 0.2s ease;
}

.m-pill:hover,
.m-pill.active {
  background: rgba(74, 222, 128, 0.15);
  border-color: rgba(74, 222, 128, 0.3);
  color: #4ade80;
}

/* ===== ICON PREVIEW ===== */
.m-icon-preview-row {
  margin-bottom: 0.5rem;
}

.m-icon-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.875rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
}

.m-icon-text {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.5);
}

.m-icon-clear {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.3);
  cursor: pointer;
  font-size: 0.75rem;
  padding: 0;
  transition: color 0.2s ease;
}

.m-icon-clear:hover {
  color: #f87171;
}

.m-browse-btn {
  font-size: 0.75rem;
  color: #4ade80;
  background: none;
  border: none;
  cursor: pointer;
  transition: color 0.2s ease;
  margin-top: 0.5rem;
}

.m-browse-btn:hover {
  color: #86efac;
}

.m-icon-picker {
  margin-top: 0.75rem;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
}

.m-icon-search {
  width: 100%;
  padding: 0.5rem 0.75rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: #fff;
  font-size: 0.75rem;
  outline: none;
  margin-bottom: 0.75rem;
}

.m-icon-search::placeholder {
  color: rgba(255, 255, 255, 0.25);
}

.m-icon-search:focus {
  border-color: #4ade80;
}

.m-icon-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(2.5rem, 1fr));
  gap: 0.375rem;
  max-height: 200px;
  overflow-y: auto;
}

.m-icon-item {
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  font-size: 0.875rem;
  transition: all 0.2s ease;
}

.m-icon-item:hover,
.m-icon-item.selected {
  background: rgba(74, 222, 128, 0.15);
  border-color: rgba(74, 222, 128, 0.3);
  color: #4ade80;
}

/* ===== GRID ===== */
.m-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

@media (max-width: 640px) {
  .m-grid-2 {
    grid-template-columns: 1fr;
  }
}

/* ===== TOGGLE ===== */
.m-toggle-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.25rem;
}

.m-toggle {
  width: 2.75rem;
  height: 1.5rem;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  position: relative;
  cursor: pointer;
  transition: background 0.2s ease;
}

.m-toggle.active {
  background: #4ade80;
}

.m-toggle-thumb {
  width: 1.25rem;
  height: 1.25rem;
  background: #fff;
  border-radius: 50%;
  position: absolute;
  top: 50%;
  left: 0.125rem;
  transform: translateY(-50%);
  transition: transform 0.2s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.m-toggle.active .m-toggle-thumb {
  transform: translateY(-50%) translateX(1.25rem);
}

.m-toggle-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.5);
  transition: color 0.2s ease;
}

.m-toggle-label.active {
  color: #4ade80;
}

/* ===== ACTIONS ===== */
.m-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding-top: 0.5rem;
}

@media (min-width: 640px) {
  .m-actions {
    flex-direction: row;
  }
}

.m-submit {
  width: 100%;
  padding: 0.875rem 2rem;
  background: linear-gradient(135deg, #4ade80, #22c55e);
  border: none;
  border-radius: 12px;
  color: #052e16;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

@media (min-width: 640px) {
  .m-submit {
    width: auto;
  }
}

.m-submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(74, 222, 128, 0.3);
}

.m-submit:active {
  transform: translateY(0);
}

.m-submit.loading .m-btn-text {
  opacity: 0;
}

.m-submit.loading .m-btn-spin {
  opacity: 1;
}

.m-btn-spin {
  position: absolute;
  width: 1.25rem;
  height: 1.25rem;
  border: 2px solid rgba(5, 46, 22, 0.2);
  border-top-color: #052e16;
  border-radius: 50%;
  opacity: 0;
  animation: mSpin 0.6s linear infinite;
}

@keyframes mSpin {
  to {
    transform: rotate(360deg);
  }
}

.m-reset-btn {
  width: 100%;
  padding: 0.875rem 2rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
}

@media (min-width: 640px) {
  .m-reset-btn {
    width: auto;
  }
}

.m-reset-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.8);
  border-color: rgba(255, 255, 255, 0.15);
}

/* ===== TOAST ===== */
.m-toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.5rem;
  background: rgba(20, 20, 30, 0.95);
  border: 1px solid rgba(74, 222, 128, 0.3);
  border-radius: 12px;
  color: #4ade80;
  font-size: 0.875rem;
  font-weight: 500;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 10000;
  backdrop-filter: blur(12px);
}

.m-toast.show {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

/* ===== HIDDEN UTILITY ===== */
.hidden {
  display: none !important;
}

/* ===== SCROLLBAR ===== */
.m-card::-webkit-scrollbar,
.m-icon-grid::-webkit-scrollbar {
  width: 6px;
}

.m-card::-webkit-scrollbar-track,
.m-icon-grid::-webkit-scrollbar-track {
  background: transparent;
}

.m-card::-webkit-scrollbar-thumb,
.m-icon-grid::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 3px;
}

.m-card::-webkit-scrollbar-thumb:hover,
.m-icon-grid::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.25);
}