/* DANZFLO — Classes Manage Category */

.mcat-page {
  position: relative;
  background:
    radial-gradient(ellipse 80% 50% at 0% 0%, rgba(37, 99, 235, 0.06), transparent 55%),
    radial-gradient(ellipse 55% 40% at 100% 0%, rgba(249, 115, 22, 0.05), transparent 50%),
    #f8fafc;
}

.mcat-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.mcat-page-badge {
  display: inline-flex;
  align-items: center;
  height: 2.25rem;
  padding: 0 1.125rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #ea580c;
  background: rgba(249, 115, 22, 0.1);
  border: 1px solid rgba(249, 115, 22, 0.18);
  border-radius: 9999px;
}

.mcat-page-title {
  margin: 0.5rem 0 0;
  font-size: clamp(1.5rem, 2.5vw, 1.875rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: #0f172a;
}

.mcat-page-subtitle {
  margin: 0.375rem 0 0;
  font-size: 0.875rem;
  color: #64748b;
}

.mcat-header-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 5.5rem;
  padding: 0.75rem 1rem;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 0.875rem;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.04);
}

.mcat-header-stat__value {
  font-size: 1.25rem;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: -0.02em;
}

.mcat-header-stat__label {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #94a3b8;
}

/* Panel */
.mcat-panel {
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid #e2e8f0;
  border-radius: 1rem;
  box-shadow: 0 8px 28px rgba(15, 23, 42, 0.05);
  overflow: hidden;
}

.mcat-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.875rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid #eef2f7;
}

.mcat-search {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  flex: 1 1 14rem;
  max-width: 22rem;
  height: 2.75rem;
  padding: 0 0.875rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.mcat-search:focus-within {
  background: #fff;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.mcat-search svg {
  width: 1.125rem;
  height: 1.125rem;
  color: #94a3b8;
  flex-shrink: 0;
}

.mcat-search input {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  outline: none;
  font-size: 0.875rem;
  color: #0f172a;
}

.mcat-search input::placeholder { color: #94a3b8; }

.mcat-add-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  height: 2.75rem;
  padding: 0 1.25rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  border: none;
  border-radius: 0.75rem;
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.25);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  white-space: nowrap;
}

.mcat-add-btn svg { width: 1rem; height: 1rem; }

.mcat-add-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(37, 99, 235, 0.3);
}

/* Table */
.mcat-table-wrap {
  position: relative;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.mcat-table-wrap--initial {
  min-height: 220px;
}

.mcat-table-wrap--busy .mcat-table {
  opacity: 0.45;
  transition: opacity 0.15s ease;
  pointer-events: none;
}

.mcat-table-busy-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.55);
  pointer-events: none;
}

.mcat-table th.text-center,
.mcat-table td.text-center {
  text-align: center;
}

.mcat-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  min-width: 520px;
}

.mcat-table th {
  padding: 0.875rem 1.25rem;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #64748b;
  background: #f8fafc;
  border-bottom: 2px solid #e2e8f0;
  text-align: left;
  white-space: nowrap;
}

.mcat-table th.text-right,
.mcat-table td.text-right { text-align: right; }

.mcat-table td {
  padding: 0.875rem 1.25rem;
  font-size: 0.875rem;
  color: #334155;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
}

.mcat-table tbody tr {
  transition: background 0.15s ease;
}

.mcat-table tbody tr:hover {
  background: rgba(37, 99, 235, 0.03);
}

.mcat-table tbody tr:last-child td { border-bottom: none; }

.mcat-thumb-btn {
  display: inline-flex;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: 0.5rem;
}

.mcat-thumb-btn:focus-visible {
  outline: 2px solid #93c5fd;
  outline-offset: 2px;
}

.mcat-thumb {
  display: block;
  width: 3.25rem;
  height: 3.25rem;
  object-fit: cover;
  border-radius: 0.5rem;
  border: 1px solid #e2e8f0;
  background: #f1f5f9;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.05);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.mcat-thumb-btn:hover .mcat-thumb {
  transform: scale(1.04);
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.1);
}

.mcat-thumb--empty {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3.25rem;
  height: 3.25rem;
  border-radius: 0.5rem;
  border: 1px dashed #cbd5e1;
  background: #f8fafc;
  color: #94a3b8;
}

.mcat-thumb--empty svg {
  width: 1.25rem;
  height: 1.25rem;
}

.mcat-name {
  font-weight: 600;
  color: #0f172a;
}

.mcat-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.375rem;
}

.mcat-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border: 1px solid transparent;
  border-radius: 0.5rem;
  background: transparent;
  cursor: pointer;
  transition: all 0.15s ease;
}

.mcat-action-btn svg {
  width: 1.125rem;
  height: 1.125rem;
}

.mcat-action-btn--edit {
  color: #475569;
}

.mcat-action-btn--edit:hover {
  color: #2563eb;
  background: rgba(37, 99, 235, 0.06);
  border-color: rgba(37, 99, 235, 0.15);
}

.mcat-action-btn--delete {
  color: #ef4444;
}

.mcat-action-btn--delete:hover {
  color: #dc2626;
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.18);
}

.mcat-empty {
  padding: 2.5rem 1rem;
  text-align: center;
  color: #94a3b8;
  font-size: 0.875rem;
}

/* Modals */
.mcat-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(4px);
}

.mcat-modal-overlay[hidden] { display: none !important; }

.mcat-modal {
  width: 100%;
  max-width: 32rem;
  background: #fff;
  border-radius: 1rem;
  box-shadow: 0 24px 64px rgba(15, 23, 42, 0.25);
  overflow: hidden;
  animation: mcat-modal-in 0.2s ease;
}

.mcat-modal--sm { max-width: 26rem; }

@keyframes mcat-modal-in {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to { opacity: 1; transform: none; }
}

.mcat-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid #eef2f7;
}

.mcat-modal-title {
  margin: 0;
  font-size: 1.0625rem;
  font-weight: 700;
  color: #0f172a;
}

.mcat-modal-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  color: #64748b;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.mcat-modal-close:hover {
  color: #ef4444;
  border-color: #fca5a5;
  background: #fef2f2;
}

.mcat-modal-close svg { width: 1rem; height: 1rem; }

.mcat-modal-body {
  padding: 1.25rem;
}

.mcat-modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.625rem;
  padding: 1rem 1.25rem;
  border-top: 1px solid #eef2f7;
  background: #fafbfc;
}

.mcat-form-group { margin-bottom: 1.25rem; }
.mcat-form-group:last-child { margin-bottom: 0; }

.mcat-form-label {
  display: block;
  margin-bottom: 0.375rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #334155;
}

.mcat-form-label span { color: #ef4444; margin-left: 0.125rem; }

.mcat-form-hint {
  margin: -0.125rem 0 0.625rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #0f172a;
}

.mcat-form-input {
  width: 100%;
  height: 2.75rem;
  padding: 0 0.875rem;
  font-size: 0.875rem;
  color: #0f172a;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.mcat-form-input:hover {
  background: #fff;
  border-color: #cbd5e1;
}

.mcat-form-input:focus {
  background: #fff;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.mcat-form-input.is-invalid {
  border-color: #ef4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12);
}

.mcat-form-error {
  margin: 0.375rem 0 0;
  font-size: 0.75rem;
  font-weight: 500;
  color: #ef4444;
}

.mcat-delete-msg {
  margin: 0;
  font-size: 0.9375rem;
  color: #334155;
  line-height: 1.5;
}

/* Upload */
.mcat-upload {
  border: 1.5px dashed #cbd5e1;
  border-radius: 0.875rem;
  background: #f8fafc;
  transition: border-color 0.15s ease, background 0.15s ease;
  overflow: hidden;
}

.mcat-upload.is-dragover {
  border-color: #2563eb;
  background: rgba(37, 99, 235, 0.04);
}

.mcat-upload-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 1.75rem 1rem;
  text-align: center;
}

.mcat-upload-text {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 500;
  color: #64748b;
}

.mcat-upload-icon {
  width: 2.75rem;
  height: 2.75rem;
  color: #60a5fa;
}

.mcat-upload-or {
  margin: 0;
  font-size: 0.8125rem;
  color: #94a3b8;
}

.mcat-browse-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 2.25rem;
  padding: 0 1rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #2563eb;
  background: #fff;
  border: 1.5px solid #93c5fd;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.mcat-browse-btn:hover {
  background: #eff6ff;
  border-color: #2563eb;
}

.mcat-upload-preview {
  position: relative;
}

.mcat-upload-preview img {
  display: block;
  width: 100%;
  max-height: 16rem;
  object-fit: cover;
}

.mcat-preview-remove {
  position: absolute;
  top: 0.625rem;
  right: 0.625rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  color: #0f172a;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.12);
  cursor: pointer;
  transition: all 0.15s ease;
}

.mcat-preview-remove:hover {
  color: #ef4444;
  border-color: #fca5a5;
}

.mcat-preview-remove svg { width: 0.875rem; height: 0.875rem; }

/* Buttons */
.mcat-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 5.5rem;
  height: 2.5rem;
  padding: 0 1.125rem;
  font-size: 0.875rem;
  font-weight: 600;
  border: none;
  border-radius: 0.625rem;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}

.mcat-btn--danger {
  color: #fff;
  background: #ef4444;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.25);
}

.mcat-btn--danger:hover {
  background: #dc2626;
  transform: translateY(-1px);
}

.mcat-btn--primary {
  color: #fff;
  background: #3b82f6;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.mcat-btn--primary:hover {
  background: #2563eb;
  transform: translateY(-1px);
}

/* Lightbox */
.mcat-lightbox {
  position: fixed;
  inset: 0;
  z-index: 11000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 2rem 1rem;
  background: rgba(15, 23, 42, 0.88);
  backdrop-filter: blur(6px);
}

.mcat-lightbox[hidden] { display: none !important; }

.mcat-lightbox-close {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 0.625rem;
  cursor: pointer;
  transition: background 0.15s ease;
}

.mcat-lightbox-close:hover { background: rgba(255, 255, 255, 0.22); }
.mcat-lightbox-close svg { width: 1.125rem; height: 1.125rem; }

.mcat-lightbox-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: min(90vw, 56rem);
  max-height: 65vh;
  overflow: hidden;
}

.mcat-lightbox-stage img {
  display: block;
  max-width: 100%;
  max-height: 65vh;
  object-fit: contain;
  border-radius: 0.5rem;
  transition: transform 0.2s ease;
  transform-origin: center center;
}

.mcat-lightbox-toolbar {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.5rem 0.625rem;
  background: rgba(71, 85, 105, 0.92);
  border-radius: 0.75rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.mcat-lightbox-toolbar button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  color: #fff;
  background: transparent;
  border: none;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: background 0.12s ease;
}

.mcat-lightbox-toolbar button:hover {
  background: rgba(255, 255, 255, 0.15);
}

.mcat-lightbox-toolbar svg {
  width: 1.125rem;
  height: 1.125rem;
}

.mcat-lightbox-caption {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
  letter-spacing: -0.01em;
}

@media (max-width: 640px) {
  .mcat-page-header { flex-direction: column; }
  .mcat-toolbar { flex-direction: column; align-items: stretch; }
  .mcat-search { max-width: none; }
  .mcat-add-btn { width: 100%; }
}
