:root {
  --mhwc-ink: #1f1b17;
  --mhwc-muted: #5c5248;
  --mhwc-accent: #ff7a3d;
  --mhwc-accent-deep: #d85721;
  --mhwc-mint: #2f8f7b;
  --mhwc-warn: #b13b1b;
  --mhwc-card: #ffffff;
  --mhwc-border: rgba(31, 27, 23, 0.12);
  --mhwc-shadow: 0 12px 30px rgba(20, 18, 16, 0.12);
  --mhwc-radius: 18px;
}

.mhwc-admin {
  font-family: "Space Grotesk", "Avenir Next", "Segoe UI", sans-serif;
  color: var(--mhwc-ink);
}

.mhwc-admin h1,
.mhwc-admin h2,
.mhwc-admin .mhwc-panel__title {
  font-family: "Fraunces", "Baskerville", "Times New Roman", serif;
  letter-spacing: 0.2px;
}

.mhwc-admin .mhwc-hero {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr);
  gap: 24px;
  padding: 28px;
  border-radius: var(--mhwc-radius);
  background: linear-gradient(135deg, #fff7f1 0%, #ffe6d6 45%, #f2f8f4 100%);
  box-shadow: var(--mhwc-shadow);
  position: relative;
  overflow: hidden;
  margin: 20px 0 26px;
  animation: mhwc-float-in 0.6s ease-out both;
}

.mhwc-admin .mhwc-hero::after {
  content: "";
  position: absolute;
  inset: -40% -20% auto auto;
  width: 260px;
  height: 260px;
  background: radial-gradient(circle, rgba(255, 122, 61, 0.22), rgba(255, 122, 61, 0));
  pointer-events: none;
}

.mhwc-admin .mhwc-hero__content p {
  color: var(--mhwc-muted);
  max-width: 640px;
}

.mhwc-admin .mhwc-hero__badges {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.mhwc-admin .mhwc-badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: rgba(31, 27, 23, 0.08);
  color: var(--mhwc-ink);
}

.mhwc-admin .mhwc-badge.is-good {
  background: rgba(47, 143, 123, 0.18);
  color: #135546;
}

.mhwc-admin .mhwc-badge.is-warn {
  background: rgba(177, 59, 27, 0.18);
  color: var(--mhwc-warn);
}

.mhwc-admin .mhwc-badge.is-info {
  background: rgba(47, 143, 123, 0.12);
  color: #135546;
}

.mhwc-admin .mhwc-progress-bar {
  width: 100%;
  height: 8px;
  background: rgba(31, 27, 23, 0.12);
  border-radius: 4px;
  margin: 12px 0 8px;
  overflow: hidden;
}

.mhwc-admin .mhwc-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--mhwc-accent) 0%, var(--mhwc-mint) 100%);
  border-radius: 4px;
  transition: width 0.3s ease;
}

.mhwc-admin .mhwc-hero__panel p {
  margin: 8px 0 12px;
  font-weight: 600;
  color: var(--mhwc-ink);
}

.mhwc-admin .mhwc-note--success {
  color: var(--mhwc-mint);
  font-weight: 600;
}

.mhwc-admin .mhwc-batch-progress {
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  border: 2px solid #e2e8f0;
  border-radius: 16px;
  padding: 24px;
  margin: 20px 0;
  position: relative;
  overflow: hidden;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1), 0 4px 10px rgba(0, 0, 0, 0.05);
  animation: mhwc-slide-in 0.4s ease-out;
}

.mhwc-admin .mhwc-batch-progress::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--mhwc-accent) 0%, var(--mhwc-mint) 50%, var(--mhwc-accent) 100%);
  background-size: 200% 100%;
  animation: mhwc-progress-shine 2s infinite linear;
}

.mhwc-admin .mhwc-progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  position: relative;
  z-index: 2;
}

.mhwc-admin .mhwc-progress-title {
  font-weight: 700;
  font-size: 16px;
  color: #1a202c;
  display: flex;
  align-items: center;
  gap: 8px;
}

.mhwc-admin .mhwc-progress-title::before {
  content: '⚡';
  font-size: 18px;
  animation: mhwc-pulse 1.5s infinite;
}

.mhwc-admin .mhwc-progress-title.mhwc-complete::before {
  content: '✅';
  animation: none;
}

.mhwc-admin .mhwc-progress-title.mhwc-error::before {
  content: '❌';
  animation: none;
}

.mhwc-admin .mhwc-cancel-batch {
  background: linear-gradient(135deg, #e53e3e 0%, #c53030 100%);
  border: none;
  color: white;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(197, 48, 48, 0.2);
}

.mhwc-admin .mhwc-cancel-batch:hover {
  background: linear-gradient(135deg, #c53030 0%, #9b2c2c 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(197, 48, 48, 0.3);
}

.mhwc-admin .mhwc-progress-bar-container {
  width: 100%;
  height: 16px;
  background: #edf2f7;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 16px;
  position: relative;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.mhwc-admin .mhwc-progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--mhwc-accent) 0%, var(--mhwc-mint) 50%, var(--mhwc-accent) 100%);
  background-size: 200% 100%;
  border-radius: 8px;
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  animation: mhwc-progress-fill 0.8s ease-out;
  box-shadow: 0 0 10px rgba(255, 122, 61, 0.3);
}

.mhwc-admin .mhwc-progress-bar-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.4) 50%,
    transparent 100%
  );
  animation: mhwc-shimmer 2s infinite;
}

.mhwc-admin .mhwc-progress-text {
  text-align: center;
  font-weight: 700;
  font-size: 18px;
  color: #2d3748;
  margin-bottom: 8px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.mhwc-admin .mhwc-progress-details {
  text-align: center;
  color: #718096;
  font-size: 14px;
  line-height: 1.5;
  background: rgba(255, 255, 255, 0.8);
  padding: 12px 16px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  position: relative;
  z-index: 2;
}

.mhwc-admin .mhwc-progress-details strong {
  color: #2d3748;
  font-weight: 600;
}

.mhwc-admin .mhwc-batch-progress.mhwc-error {
  border-color: #e53e3e;
  background: linear-gradient(135deg, #fed7d7 0%, #feb2b2 100%);
}

.mhwc-admin .mhwc-batch-progress.mhwc-error .mhwc-progress-bar-container {
  background: #fed7d7;
}

.mhwc-admin .mhwc-batch-progress.mhwc-complete {
  border-color: var(--mhwc-mint);
  background: linear-gradient(135deg, #c6f6d5 0%, #9ae6b4 100%);
}

.mhwc-admin .mhwc-batch-progress.mhwc-complete .mhwc-progress-bar-fill {
  background: linear-gradient(90deg, var(--mhwc-mint) 0%, #38a169 100%);
  box-shadow: 0 0 15px rgba(72, 187, 120, 0.4);
}

@keyframes mhwc-fade-in {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes mhwc-slide-in {
  from {
    opacity: 0;
    transform: translateY(-20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes mhwc-progress-shine {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

@keyframes mhwc-pulse {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.1);
    opacity: 0.8;
  }
}

@keyframes mhwc-progress-fill {
  from {
    transform: scaleX(0);
  }
  to {
    transform: scaleX(1);
  }
}

@keyframes mhwc-shimmer {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

@keyframes mhwc-bounce-in {
  0% {
    transform: scale(0.3);
    opacity: 0;
  }
  50% {
    transform: scale(1.05);
  }
  70% {
    transform: scale(0.9);
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

/* Enhanced button styles */
.mhwc-admin .mhwc-convert-batch-btn,
.mhwc-admin .mhwc-delete-batch-btn {
  background: linear-gradient(135deg, var(--mhwc-accent) 0%, var(--mhwc-accent-deep) 100%);
  border: none;
  color: white;
  padding: 12px 24px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 12px rgba(255, 122, 61, 0.3);
  position: relative;
  overflow: hidden;
}

.mhwc-admin .mhwc-convert-batch-btn::before,
.mhwc-admin .mhwc-delete-batch-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s;
}

.mhwc-admin .mhwc-convert-batch-btn:hover,
.mhwc-admin .mhwc-delete-batch-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(255, 122, 61, 0.4);
}

.mhwc-admin .mhwc-convert-batch-btn:hover::before,
.mhwc-admin .mhwc-delete-batch-btn:hover::before {
  left: 100%;
}

.mhwc-admin .mhwc-delete-batch-btn {
  background: linear-gradient(135deg, #e53e3e 0%, #c53030 100%);
  box-shadow: 0 4px 12px rgba(229, 62, 62, 0.3);
}

.mhwc-admin .mhwc-delete-batch-btn:hover {
  box-shadow: 0 8px 20px rgba(229, 62, 62, 0.4);
}

/* Loading spinner */
.mhwc-admin .mhwc-loading-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: white;
  animation: mhwc-spin 1s ease-in-out infinite;
  margin-right: 8px;
}

/* Progress spinner */
.mhwc-admin .mhwc-progress-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(31, 27, 23, 0.3);
  border-radius: 50%;
  border-top-color: var(--mhwc-accent);
  animation: mhwc-spin 1s ease-in-out infinite;
  margin-right: 8px;
}

@keyframes mhwc-spin {
  to {
    transform: rotate(360deg);
  }
}

/* Success animation */
.mhwc-admin .mhwc-success-checkmark {
  display: inline-block;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #38a169;
  position: relative;
  animation: mhwc-bounce-in 0.6s ease-out;
  margin-right: 8px;
}

.mhwc-admin .mhwc-success-checkmark::after {
  content: '✓';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-weight: bold;
  font-size: 12px;
}

/* Responsive improvements */
@media (max-width: 782px) {
  .mhwc-admin .mhwc-batch-progress {
    padding: 16px;
    margin: 16px 0;
  }

  .mhwc-admin .mhwc-progress-header {
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
  }

  .mhwc-admin .mhwc-cancel-batch {
    align-self: flex-end;
  }

  .mhwc-admin .mhwc-convert-batch-btn,
  .mhwc-admin .mhwc-delete-batch-btn {
    width: 100%;
    margin-bottom: 8px;
  }
}

@keyframes mhwc-shimmer {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

.mhwc-admin .mhwc-hero__panel {
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(31, 27, 23, 0.08);
  border-radius: 14px;
  padding: 18px 18px 14px;
  position: relative;
  z-index: 1;
}

.mhwc-admin .mhwc-hero__panel ul {
  margin: 10px 0 0;
  padding-left: 18px;
  color: var(--mhwc-muted);
}

.mhwc-admin .mhwc-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 24px;
}

.mhwc-admin .mhwc-card {
  background: var(--mhwc-card);
  border-radius: var(--mhwc-radius);
  border: 1px solid var(--mhwc-border);
  padding: 24px;
  box-shadow: 0 8px 22px rgba(24, 20, 16, 0.08);
  animation: mhwc-float-in 0.6s ease-out both;
}

.mhwc-admin .mhwc-card:nth-of-type(2) {
  animation-delay: 0.08s;
}

.mhwc-admin .mhwc-card:nth-of-type(3) {
  animation-delay: 0.16s;
}

.mhwc-admin .mhwc-card__header p {
  color: var(--mhwc-muted);
  margin-top: 6px;
}

.mhwc-admin .mhwc-card--settings {
  grid-column: 1 / -1;
}

.mhwc-admin .form-table th {
  width: 260px;
  color: var(--mhwc-ink);
  padding-top: 16px;
}

.mhwc-admin .form-table td {
  padding-top: 12px;
}

.mhwc-admin input[type="number"],
.mhwc-admin input[type="text"],
.mhwc-admin select {
  border-radius: 10px;
  border: 1px solid rgba(31, 27, 23, 0.16);
  padding: 6px 10px;
}

.mhwc-admin .mhwc-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-top: 12px;
}

.mhwc-admin .mhwc-actions label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  color: var(--mhwc-ink);
}

.mhwc-admin .mhwc-note {
  margin-top: 10px;
  color: var(--mhwc-muted);
}

.mhwc-admin .button-primary {
  background: var(--mhwc-accent);
  border-color: var(--mhwc-accent-deep);
  box-shadow: none;
}

.mhwc-admin .button-primary:hover {
  background: var(--mhwc-accent-deep);
  border-color: var(--mhwc-accent-deep);
}

.mhwc-admin .button-secondary,
.mhwc-admin .button-delete {
  border-radius: 10px;
}

.mhwc-admin .notice.inline {
  margin: 12px 0 0;
}

@media (max-width: 1024px) {
  .mhwc-admin .mhwc-hero {
    grid-template-columns: 1fr;
  }

  .mhwc-admin .mhwc-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 782px) {
  .mhwc-admin .form-table th,
  .mhwc-admin .form-table td {
    display: block;
    width: 100%;
  }

  .mhwc-admin .form-table th {
    padding-bottom: 4px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .mhwc-admin .mhwc-hero,
  .mhwc-admin .mhwc-card {
    animation: none;
  }
}

@keyframes mhwc-float-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
