.mmt-shell {
  min-height: 100vh;
  background: linear-gradient(160deg, #f8fafc 0%, #eef2ff 55%, #f0fdf4 100%);
  font-family: 'Nunito', system-ui, sans-serif;
}

.mmt-shell-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 24px;
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
  position: sticky;
  top: 0;
  z-index: 20;
}

.mmt-shell-brand {
  font-weight: 800;
  font-size: 18px;
  color: #0f172a;
  text-decoration: none;
}

.mmt-shell-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.mmt-shell-header-actions .button {
  border-radius: 10px;
  font-weight: 700;
}

.mmt-main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 20px 48px;
}

.mmt-hero {
  margin-bottom: 24px;
}

.mmt-hero h1 {
  margin: 0 0 8px;
  font-size: clamp(24px, 4vw, 32px);
  color: #0f172a;
}

.mmt-hero p {
  margin: 0;
  color: #64748b;
  max-width: 640px;
  line-height: 1.5;
}

.mmt-quota {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 16px;
}

.mmt-quota-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 12px 16px;
  min-width: 140px;
}

.mmt-quota-card strong {
  display: block;
  font-size: 22px;
  color: #0f172a;
}

.mmt-quota-card span {
  font-size: 13px;
  color: #64748b;
}

.mmt-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}

.mmt-toolbar h2 {
  margin: 0;
  font-size: 20px;
  color: #0f172a;
}

.mmt-btn {
  appearance: none;
  border: none;
  border-radius: 12px;
  padding: 11px 18px;
  font-weight: 800;
  font-size: 14px;
  cursor: pointer;
  background: linear-gradient(135deg, #16a34a, #15803d);
  color: #fff;
  box-shadow: 0 8px 20px rgba(22, 163, 74, 0.25);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.mmt-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(22, 163, 74, 0.3);
}

.mmt-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.mmt-btn--ghost {
  background: #fff;
  color: #334155;
  border: 1px solid #e2e8f0;
  box-shadow: none;
}

.mmt-btn--ghost:hover {
  background: #f8fafc;
  box-shadow: none;
}

body.mmt-modal-open {
  overflow: hidden;
}

.mmt-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.mmt-modal[hidden] {
  display: none;
}

.mmt-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
}

.mmt-modal-dialog {
  position: relative;
  width: min(100%, 480px);
  background: #fff;
  border-radius: 20px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.18);
  overflow: hidden;
}

.mmt-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px;
  border-bottom: 1px solid #e2e8f0;
}

.mmt-modal-head h3 {
  margin: 0;
  font-size: 20px;
  color: #0f172a;
}

.mmt-modal-close {
  appearance: none;
  border: none;
  background: #f1f5f9;
  color: #334155;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.mmt-modal-body {
  padding: 20px;
}

.mmt-modal-intro,
.mmt-modal-note,
.mmt-modal-preview {
  margin: 0 0 16px;
  color: #64748b;
  line-height: 1.5;
  font-size: 14px;
}

.mmt-modal-preview {
  padding: 12px 14px;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  color: #0f172a;
  font-weight: 700;
}

.mmt-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

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

.mmt-field span {
  font-size: 13px;
  font-weight: 700;
  color: #334155;
}

.mmt-field input {
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  padding: 11px 12px;
  font-size: 16px;
  color: #0f172a;
  background: #fff;
}

.mmt-field input:focus {
  outline: none;
  border-color: #16a34a;
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.15);
}

.mmt-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.mmt-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

.mmt-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 18px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.04);
  animation: mmt-card-in 320ms ease;
}

.mmt-card--pending {
  border-color: #fde68a;
  background: linear-gradient(180deg, #fffbeb 0%, #fff 40%);
}

.mmt-card--rejected {
  border-color: #fecaca;
  background: linear-gradient(180deg, #fef2f2 0%, #fff 40%);
  opacity: 0.85;
}

.mmt-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.mmt-card-head h3 {
  margin: 0;
  font-size: 18px;
  color: #0f172a;
}

.mmt-badge {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 4px 8px;
  border-radius: 999px;
}

.mmt-badge--active {
  background: #dcfce7;
  color: #166534;
}

.mmt-badge--pending {
  background: #fef3c7;
  color: #92400e;
}

.mmt-badge--rejected {
  background: #fee2e2;
  color: #991b1b;
}

.mmt-qr-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  background: #f8fafc;
  border-radius: 14px;
  border: 1px dashed #cbd5e1;
  padding: 12px;
}

.mmt-qr-link {
  display: block;
  width: 168px;
  flex: 0 0 auto;
  text-decoration: none;
  color: inherit;
  border-radius: 8px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.mmt-qr-canvas {
  display: block;
  width: 168px;
  height: 168px;
  aspect-ratio: 1 / 1;
  line-height: 0;
  overflow: hidden;
  opacity: 1;
  transform: none;
}

.mmt-qr-wrap canvas,
.mmt-qr-wrap img,
.mmt-qr-wrap svg,
.mmt-qr-wrap table,
.mmt-qr-canvas canvas,
.mmt-qr-canvas img,
.mmt-qr-canvas svg,
.mmt-qr-canvas table {
  display: block !important;
  width: 168px !important;
  height: 168px !important;
  min-width: 168px !important;
  min-height: 168px !important;
  max-width: 168px !important;
  max-height: 168px !important;
  aspect-ratio: 1 / 1 !important;
  object-fit: contain;
  border-radius: 8px;
}

.mmt-qr-canvas table {
  border-collapse: collapse !important;
  table-layout: fixed !important;
}

.mmt-qr-canvas td {
  padding: 0 !important;
  line-height: 0 !important;
}

body.mmsaas-menu-tables-page .mmt-qr-canvas img {
  width: 168px !important;
  height: 168px !important;
  max-width: 168px !important;
  max-height: 168px !important;
}

.mmt-qr-link:hover,
.mmt-qr-link:focus {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.12);
  outline: none;
}

.mmt-qr-wrap--wait {
  border-style: solid;
  border-color: #fde68a;
  background: linear-gradient(180deg, #fffbeb 0%, #f8fafc 100%);
}

.mmt-qr-wait {
  width: 100%;
  display: grid;
  justify-items: center;
  gap: 0.55rem;
  padding: 8px 4px;
  text-align: center;
}

.mmt-qr-wait-visual {
  position: relative;
  width: 72px;
  height: 72px;
  margin-bottom: 0.15rem;
}

.mmt-qr-wait-pulse {
  position: absolute;
  inset: 0;
  border-radius: 16px;
  background: rgba(245, 158, 11, 0.18);
  animation: mmt-wait-pulse 1.6s ease-in-out infinite;
}

.mmt-qr-wait-frame {
  position: absolute;
  inset: 12px;
  border-radius: 10px;
  border: 2px dashed #d97706;
  background:
    linear-gradient(#fff, #fff) padding-box,
    repeating-linear-gradient(
      45deg,
      rgba(217, 119, 6, 0.18) 0 6px,
      transparent 6px 12px
    );
}

.mmt-qr-wait strong {
  color: #92400e;
  font-size: 0.95rem;
}

.mmt-qr-wait p {
  margin: 0;
  color: #a16207;
  font-size: 0.82rem;
  line-height: 1.4;
  max-width: 18rem;
}

.mmt-qr-wait small {
  color: #b45309;
  font-size: 0.75rem;
  font-weight: 700;
}

.mmt-progress {
  width: min(100%, 200px);
  height: 12px;
  border-radius: 999px;
  background: rgba(217, 119, 6, 0.2);
  overflow: hidden;
  position: relative;
  box-shadow: inset 0 0 0 1px rgba(146, 64, 14, 0.12);
}

.mmt-progress-bar {
  display: block;
  height: 100%;
  min-width: 12%;
  border-radius: inherit;
  background: linear-gradient(90deg, #fbbf24, #f97316 55%, #ea580c);
  box-shadow: 0 0 14px rgba(249, 115, 22, 0.45);
  transition: width 0.35s ease;
  position: relative;
}

.mmt-progress-bar::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    120deg,
    transparent 0%,
    rgba(255, 255, 255, 0.45) 50%,
    transparent 100%
  );
  transform: translateX(-100%);
  animation: mmt-progress-shine 1.4s linear infinite;
}

@keyframes mmt-wait-pulse {
  0%,
  100% {
    transform: scale(0.92);
    opacity: 0.7;
  }
  50% {
    transform: scale(1.05);
    opacity: 1;
  }
}

@keyframes mmt-progress-shine {
  to {
    transform: translateX(100%);
  }
}

.mmt-qr-pending {
  text-align: center;
  color: #92400e;
  font-size: 13px;
  line-height: 1.4;
  padding: 12px;
}

.mmt-url {
  display: block;
  font-size: 12px;
  color: #2563eb;
  word-break: break-all;
  line-height: 1.4;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.mmt-url:hover,
.mmt-url:focus {
  color: #1d4ed8;
}

.mmt-card-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.mmt-card-actions button {
  flex: 1;
  min-width: 0;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  background: #fff;
  padding: 8px 10px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  color: #334155;
}

.mmt-card-actions button:hover {
  background: #f8fafc;
}

.mmt-card-actions .mmt-delete {
  color: #b91c1c;
  border-color: #fecaca;
}

.mmt-empty {
  text-align: center;
  padding: 48px 24px;
  background: #fff;
  border: 1px dashed #cbd5e1;
  border-radius: 18px;
  color: #64748b;
}

.mmt-empty strong {
  display: block;
  color: #0f172a;
  font-size: 18px;
  margin-bottom: 8px;
}

.mmt-feedback {
  margin-bottom: 16px;
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
}

.mmt-feedback.is-entering {
  animation: mmt-feedback-in 320ms ease;
}

.mmt-feedback--success {
  background: #dcfce7;
  color: #166534;
}

.mmt-feedback--info {
  background: #dbeafe;
  color: #1e40af;
}

.mmt-feedback--error {
  background: #fee2e2;
  color: #991b1b;
}

.mmt-spinner {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 3px solid rgba(22, 163, 74, 0.18);
  border-top-color: #16a34a;
  animation: mmt-spin 0.75s linear infinite;
  flex: 0 0 auto;
}

.mmt-spinner--sm {
  width: 16px;
  height: 16px;
  border-width: 2px;
}

.mmt-btn.is-loading,
.mmt-card-actions button.is-loading,
#mmt-add-submit.is-loading {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  opacity: 0.92;
  cursor: wait;
}

.mmt-busy {
  position: fixed;
  inset: 0;
  z-index: 10050;
  display: grid;
  place-items: center;
  background: rgba(15, 23, 42, 0.42);
  backdrop-filter: blur(2px);
  padding: 20px;
}

.mmt-busy[hidden] {
  display: none !important;
}

body.mmt-busy-open {
  overflow: hidden;
}

.mmt-busy-card {
  width: min(92vw, 360px);
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.28);
  padding: 1.35rem 1.25rem;
  text-align: center;
  display: grid;
  justify-items: center;
  gap: 0.65rem;
  animation: mmt-pop-in 280ms cubic-bezier(.2,.8,.2,1);
}

.mmt-busy-card strong {
  color: #0f172a;
  font-size: 1.05rem;
}

.mmt-busy-card p {
  margin: 0;
  color: #64748b;
  font-size: 0.92rem;
  line-height: 1.45;
}

.mmt-grid-loading,
.mmt-qr-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  min-height: 160px;
  color: #64748b;
  font-size: 0.9rem;
  font-weight: 700;
  text-align: center;
  grid-column: 1 / -1;
}

.mmt-qr-canvas.is-entering {
  animation: mmt-qr-in 360ms ease forwards;
}

@keyframes mmt-spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes mmt-pop-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes mmt-qr-in {
  from {
    opacity: 0;
    transform: scale(0.96);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes mmt-card-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes mmt-feedback-in {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .mmt-spinner,
  .mmt-busy-card,
  .mmt-qr-canvas.is-entering,
  .mmt-card,
  .mmt-feedback.is-entering,
  .mmt-qr-wait-pulse,
  .mmt-progress-bar::after {
    animation: none !important;
  }

  .mmt-qr-canvas {
    opacity: 1;
    transform: none;
  }
}

@media (max-width: 640px) {
  .mmt-shell-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .mmt-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

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

  .mmt-modal-actions {
    flex-direction: column-reverse;
  }

  .mmt-modal-actions .mmt-btn {
    width: 100%;
  }
}
