/* ============================================
   MENU ADMIN - Panel del menú digital
   Dark theme — low saturation
   ============================================ */

#menu-digital { padding: 12px; }

.ma-header {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 16px; flex-wrap: wrap;
}
.ma-title { margin: 0; font-size: 18px; font-weight: 700; color: #e5e5e5; }
.ma-rest-selector { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.ma-rest-selector label { color: #9ca3af; font-size: 13px; }
.ma-rest-selector select {
  padding: 6px 10px; border-radius: 8px; border: 1px solid #3a3a3a;
  background: #2a2a2a; color: #e5e5e5; font-size: 14px; min-width: 180px;
}

.ma-toolbar {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 12px; flex-wrap: wrap;
}
.ma-toolbar h3 { margin: 0; font-size: 16px; color: #e5e5e5; }
.ma-toolbar-actions { margin-left: auto; display: flex; gap: 6px; }

.ma-loading, .ma-empty {
  padding: 30px; text-align: center; color: #9ca3af;
  background: #232323; border-radius: 10px;
}
.ma-empty-sm { padding: 12px; text-align: center; color: #6b7280; font-size: 13px; }

/* ===== HERO CONFIG ===== */
.ma-hero-config {
  background: #232323; border: 1px solid #3a3a3a; border-radius: 10px;
  padding: 14px; margin-bottom: 16px;
}
.ma-hero-head {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-bottom: 6px;
}
.ma-hero-head h3 { margin: 0; font-size: 15px; color: #e5e5e5; }
.ma-hero-actions { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; }
.ma-hero-hint { font-size: 12px; color: #9ca3af; margin-bottom: 10px; line-height: 1.4; }

.ma-hero-empty {
  padding: 18px; text-align: center; color: #6b7280; font-size: 13px;
  border: 1px dashed #3a3a3a; border-radius: 8px; background: #1e1e1e;
}

.ma-contact-grid {
  display: grid; gap: 10px 14px;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}
.ma-contact-field { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: #cbd5e1; }
.ma-contact-field input {
  background: #1e1e1e; border: 1px solid #3a3a3a; border-radius: 6px;
  color: #f3f4f6; padding: 8px 10px; font-size: 13px;
}
.ma-contact-field input:focus { outline: none; border-color: #d4a853; }

/* ===== PHONE MOCKUP PREVIEW ===== */
.ma-phone-wrap {
  display: flex; justify-content: center;
  padding: 16px 8px 8px;
}
.ma-phone {
  position: relative;
  width: 100%;
  max-width: 320px;
  aspect-ratio: 9 / 19.5;
  background: #0a0a0a;
  border-radius: 40px;
  border: 1px solid #3a3a3a;
  padding: 10px;
  box-shadow:
    0 0 0 2px #1a1a1a,
    0 18px 40px rgba(0,0,0,0.55);
}
.ma-phone-notch {
  position: absolute;
  top: 14px; left: 50%;
  transform: translateX(-50%);
  width: 100px; height: 22px;
  background: #000;
  border-radius: 14px;
  z-index: 3;
  pointer-events: none;
}
.ma-phone-screen {
  position: relative;
  width: 100%; height: 100%;
  border-radius: 32px;
  overflow: hidden;
  background-color: #1a1a1a;
}
.ma-phone-screen-img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: var(--bg-x, 50%) var(--bg-y, 50%);
  transform: scale(var(--bg-zoom, 1));
  transform-origin: center center;
  pointer-events: none;
  -webkit-user-drag: none;
  user-select: none;
}
.ma-phone-overlay {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.75);
  pointer-events: none;
  z-index: 1;
}
.ma-phone-content {
  position: relative; z-index: 2;
  width: 100%; height: 100%;
  display: flex; flex-direction: column;
  padding: 40px 14px 16px;
  color: #fff;
  overflow: hidden;
  pointer-events: none;
}
.ma-mock-hero {
  flex: 0 0 auto;
  text-align: center;
  padding: 6px 0 14px;
}
.ma-mock-logo { line-height: 1; margin-bottom: 8px; }
.ma-mock-logo-top {
  display: block;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 0.55rem; font-weight: 400;
  color: #d4a853; letter-spacing: 0.35em;
  margin-bottom: 1px;
}
.ma-mock-logo-bottom {
  display: block;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 1.5rem; font-weight: 800;
  color: #d4a853; letter-spacing: 0.08em;
}
.ma-mock-tagline {
  font-size: 0.5rem;
  color: rgba(255,255,255,0.55);
  letter-spacing: 0.25em;
  margin: 4px 0 6px;
}
.ma-mock-rest {
  font-size: 0.6rem;
  color: #c9c9c9;
  margin-bottom: 8px;
  line-height: 1.3;
}
.ma-mock-rating {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 10px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 999px;
  font-size: 0.58rem;
  color: #fff;
}
.ma-mock-rating .ma-mock-stars { color: #facc15; font-size: 0.5rem; letter-spacing: -1px; }
.ma-mock-rating strong { font-weight: 700; }
.ma-mock-rating-label { color: #9a9a9a; }
.ma-mock-info {
  margin-top: 10px;
  font-size: 0.58rem; color: #9a9a9a;
}
.ma-mock-cats {
  margin-top: auto;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
  padding-top: 10px;
}
.ma-mock-cat {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 4px;
  padding: 8px 4px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(212,168,83,0.2);
  border-radius: 10px;
  min-height: 48px;
}
.ma-mock-cat-icon { font-size: 1.1rem; line-height: 1; }
.ma-mock-cat-name {
  font-size: 0.55rem;
  color: #fff;
  text-align: center;
  line-height: 1.2;
  max-width: 100%;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ===== HERO EDITOR MODAL ===== */
.ma-hero-editor-backdrop {
  position: fixed; inset: 0; z-index: 1001;
  background: rgba(0,0,0,0.75);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 16px; overflow-y: auto;
}
.ma-hero-editor {
  background: #1f1f1f; border: 1px solid #3a3a3a; border-radius: 12px;
  padding: 16px; width: 100%; max-width: 420px;
  margin: auto 0;
  display: flex; flex-direction: column; gap: 12px;
}
.ma-hero-editor-title { font-size: 16px; font-weight: 700; color: #e5e5e5; }
.ma-hero-editor-hint { font-size: 12px; color: #9ca3af; line-height: 1.4; }

.ma-hero-editor-phone-wrap {
  display: flex; justify-content: center;
  padding: 4px 0;
}
.ma-phone--editor { max-width: 220px; }
@media (max-height: 760px) {
  .ma-phone--editor { max-width: 180px; }
}
@media (max-height: 620px) {
  .ma-phone--editor { max-width: 150px; }
}
.ma-phone-screen--drag {
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-drag: none;
}
.ma-phone-screen--drag:active { cursor: grabbing; }

.ma-hero-editor-zoom {
  display: flex; align-items: center; gap: 10px;
  padding: 4px 2px;
}
.ma-hero-editor-zoom label {
  font-size: 12px; color: #9ca3af; min-width: 40px;
}
.ma-hero-editor-zoom input[type="range"] {
  flex: 1; accent-color: #d4a853;
}
.ma-hero-editor-zoom span {
  min-width: 44px; text-align: right;
  font-size: 12px; color: #d4a853; font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.ma-hero-editor-pos {
  font-size: 12px; color: #9ca3af; text-align: center;
}
.ma-hero-editor-pos span { color: #d4a853; font-weight: 600; font-variant-numeric: tabular-nums; }
.ma-hero-editor-actions {
  display: flex; gap: 8px; justify-content: flex-end;
}

/* Loading overlay for hero operations */
.ma-hero-loading {
  position: fixed; inset: 0; z-index: 1100;
  background: rgba(0,0,0,0.6);
  display: flex; align-items: center; justify-content: center;
}
.ma-hero-loading-box {
  background: #2a2a2a; border: 1px solid #3a3a3a;
  padding: 14px 20px; border-radius: 10px;
  color: #e5e5e5; font-size: 13px;
}

/* ===== CATEGORY LIST ===== */
.ma-cat-list { display: flex; flex-direction: column; gap: 8px; }
.ma-cat-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; background: #2a2a2a;
  border: 1px solid #3a3a3a; border-radius: 10px;
  transition: background .15s;
}
.ma-cat-row:hover { background: #333333; }
.ma-cat-row.ma-cat-disabled { opacity: 0.5; }
.ma-drag { cursor: grab; color: #6b7280; font-size: 16px; user-select: none; }
.ma-drag-sub { cursor: grab; color: #6b7280; font-size: 14px; user-select: none; margin-right: 4px; }
.ma-cat-icon { font-size: 24px; }
.ma-cat-info { flex: 1; min-width: 0; }
.ma-cat-name { font-weight: 600; font-size: 15px; color: #e5e5e5; }
.ma-cat-meta { font-size: 12px; color: #9ca3af; }

/* ===== SUBCATEGORY BLOCK ===== */
.ma-subcat-block {
  background: #2a2a2a; border: 1px solid #3a3a3a;
  border-radius: 12px; margin-bottom: 14px; overflow: hidden;
}
.ma-subcat-block.ma-subcat-disabled { opacity: 0.5; }
.ma-subcat-header {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px; background: #252525;
  border-bottom: 1px solid #3a3a3a;
}
.ma-subcat-header h4 { margin: 0; font-size: 15px; flex: 1; color: #e5e5e5; }
.ma-subcat-header > div { display: flex; gap: 6px; align-items: center; }
.ma-count {
  display: inline-block; background: #3a3a3a; color: #9ca3af;
  padding: 1px 8px; border-radius: 10px; font-size: 11px; margin-left: 6px;
}

.ma-item-list { padding: 8px; display: flex; flex-direction: column; gap: 6px; }
.ma-item-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; background: #262626;
  border: 1px solid #333; border-radius: 8px;
  transition: background .15s;
}
.ma-item-row:hover { background: #303030; }

/* Thumbnail: cuadrado gris vacío cuando no hay foto */
.ma-item-thumb {
  width: 48px; height: 48px; object-fit: cover; border-radius: 6px;
  background: #3a3a3a; flex-shrink: 0;
}
.ma-item-thumb.ma-no-img {
  /* cuadrado gris vacío, sin emoji */
}
#ma-img-preview.ma-no-img {
  display: flex; align-items: center; justify-content: center;
  color: #6b7280; font-size: 13px; background: #3a3a3a;
}

.ma-item-info { flex: 1; min-width: 0; }
.ma-item-name { font-weight: 600; font-size: 14px; color: #e5e5e5; }
.ma-item-price { font-size: 13px; color: #d97706; }
.ma-badge { display: inline-block; margin-left: 4px; font-size: 12px; }

/* ===== BUTTONS: edit (ghost) + delete (subtle red on hover) ===== */
.ma-btn-edit {
  background: transparent; border: 1px solid #4a4a4a; color: #9ca3af;
  padding: 4px 8px; border-radius: 6px; cursor: pointer; font-size: 13px;
  transition: all .15s;
}
.ma-btn-edit:hover { border-color: #6b7280; color: #e5e5e5; }

.ma-btn-delete {
  background: transparent; border: 1px solid #4a4a4a; color: #6b7280;
  padding: 4px 8px; border-radius: 6px; cursor: pointer; font-size: 13px;
  transition: all .15s;
}
.ma-btn-delete:hover { background: #8b2c2c; border-color: #8b2c2c; color: #fca5a5; }

/* ===== SWITCH ===== */
.ma-switch { position: relative; display: inline-block; width: 38px; height: 22px; flex-shrink: 0; }
.ma-switch input { opacity: 0; width: 0; height: 0; }
.ma-slider {
  position: absolute; cursor: pointer; inset: 0;
  background-color: #4a4a4a; transition: .2s; border-radius: 22px;
}
.ma-slider:before {
  position: absolute; content: ""; height: 16px; width: 16px;
  left: 3px; bottom: 3px; background-color: #9ca3af;
  transition: .2s; border-radius: 50%;
}
.ma-switch input:checked + .ma-slider { background-color: #2d7a3a; }
.ma-switch input:checked + .ma-slider:before { transform: translateX(16px); background-color: #4ade80; }

/* ===== MODAL (stays light for readability) ===== */
.ma-modal-backdrop {
  position: fixed; inset: 0; background: rgba(0, 0, 0, 0.65);
  display: flex; align-items: center; justify-content: center;
  z-index: 10000; padding: 16px;
}
.ma-modal {
  background: #1e1e1e; border: 1px solid #3a3a3a; border-radius: 12px;
  width: 100%; max-width: 520px;
  max-height: 92vh; display: flex; flex-direction: column; overflow: hidden;
  color: #e5e5e5;
}
.ma-modal-lg { max-width: 720px; }
.ma-modal-header {
  display: flex; align-items: center; padding: 12px 16px;
  border-bottom: 1px solid #3a3a3a;
}
.ma-modal-header h3 { margin: 0; flex: 1; font-size: 16px; color: #e5e5e5; }
.ma-close {
  background: none; border: none; font-size: 24px; line-height: 1;
  cursor: pointer; color: #6b7280; padding: 0 6px;
}
.ma-close:hover { color: #e5e5e5; }
.ma-modal-body { padding: 16px; overflow-y: auto; flex: 1; }
.ma-modal-body label {
  display: block; font-size: 12px; font-weight: 600;
  color: #9ca3af; margin: 10px 0 4px;
}
.ma-modal-body input[type="text"],
.ma-modal-body input[type="number"],
.ma-modal-body textarea,
.ma-modal-body select {
  width: 100%; padding: 8px 10px; border: 1px solid #3a3a3a;
  border-radius: 8px; font-size: 14px; font-family: inherit; box-sizing: border-box;
  background: #2a2a2a; color: #e5e5e5;
}
.ma-modal-body input::placeholder,
.ma-modal-body textarea::placeholder { color: #6b7280; }
.ma-modal-body h4 {
  margin: 16px 0 8px; font-size: 14px; color: #e5e5e5;
  display: flex; align-items: center; gap: 8px;
}
.ma-modal-footer {
  display: flex; gap: 8px; justify-content: flex-end;
  padding: 12px 16px; border-top: 1px solid #3a3a3a; background: #1a1a1a;
}
.ma-modal-footer .btn-danger { margin-right: auto; background: #8b2c2c; border-color: #8b2c2c; }
.ma-modal-footer .btn-danger:hover { background: #a33; }

/* ===== LANG TABS ===== */
.ma-lang-tabs {
  display: flex; gap: 2px; flex-wrap: wrap;
  border-bottom: 1px solid #3a3a3a; margin-bottom: 10px;
}
.ma-lang-tab {
  padding: 6px 12px; background: none; border: none;
  cursor: pointer; font-size: 12px; font-weight: 600; color: #6b7280;
  border-bottom: 2px solid transparent;
}
.ma-lang-tab.active { color: #d97706; border-bottom-color: #d97706; }
.ma-lang-panel { display: none; }
.ma-lang-panel.active { display: block; }

/* ===== PRICES ===== */
.ma-price-row {
  display: flex; gap: 6px; margin-bottom: 6px; align-items: center;
}
.ma-price-row input[type="text"] { flex: 2; }
.ma-price-row input[type="number"] { flex: 1; }

/* Variant photo in price row */
.ma-variant-photo {
  display: flex; align-items: center; gap: 4px; flex-shrink: 0;
}
.ma-variant-photo-btn {
  background: transparent; border: 1px solid #4a4a4a; color: #9ca3af;
  padding: 4px 6px; border-radius: 6px; cursor: pointer; font-size: 12px;
  transition: all .15s; white-space: nowrap;
}
.ma-variant-photo-btn:hover { border-color: #6b7280; color: #e5e5e5; }
.ma-variant-thumb {
  width: 32px; height: 32px; object-fit: cover; border-radius: 4px;
  background: #3a3a3a; flex-shrink: 0;
}
.ma-variant-remove { padding: 2px 5px !important; font-size: 11px !important; }

/* ===== CHECKS ===== */
.ma-checks {
  display: flex; flex-wrap: wrap; gap: 8px;
  padding: 4px 0;
}
.ma-check {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 13px; font-weight: 500; cursor: pointer;
  padding: 4px 10px; background: #2a2a2a; border-radius: 6px;
  color: #d1d5db; border: 1px solid #3a3a3a;
  margin: 0 !important;
}
.ma-check input { width: auto !important; }

.ma-toggles { display: flex; gap: 12px; margin-top: 12px; }

/* ===== IMAGE ===== */
.ma-img-row {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}
#ma-img-preview {
  width: 100px; height: 100px; object-fit: cover;
  border-radius: 8px; background: #3a3a3a;
}
.ma-img-status {
  font-size: 12px; font-weight: 600; padding: 4px 0; margin-top: 4px;
  color: #9ca3af;
}
.ma-img-status-working { color: #d97706; }
.ma-img-status-success { color: #4ade80; }

/* ===== BANNER ===== */
.ma-banner {
  padding: 10px 16px; border-radius: 8px; margin-bottom: 14px;
  font-size: 14px; line-height: 1.5;
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap;
}
.ma-banner-text { flex: 1; min-width: 200px; }
.ma-banner-actions { display: inline-flex; gap: 8px; flex-shrink: 0; flex-wrap: wrap; }
.ma-banner-action { flex-shrink: 0; }
.ma-banner-ajax { background: #1a2e3d; border: 1px solid #2a4a5e; color: #7ec8e3; }
.ma-banner-local { background: #2d2618; border: 1px solid #4a3d22; color: #e0b860; }

/* ===== QR MODAL ===== */
.ma-modal-qr { max-width: 460px; }
.ma-qr-preview-wrap {
  display: flex; align-items: center; justify-content: center;
  min-height: 300px; padding: 16px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid #2a2a2a; border-radius: 12px;
  margin-bottom: 12px;
}
.ma-qr-preview {
  width: 280px; height: 280px;
  image-rendering: pixelated; image-rendering: crisp-edges;
  border-radius: 6px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}
.ma-qr-preview-classic { background: #fff; padding: 8px; }
.ma-qr-preview-branded { background: #1a1a1a; padding: 8px; border: 1px solid #3a3320; }
.ma-qr-preview-loading,
.ma-qr-preview-error {
  font-size: 13px; color: #9ca3af;
}
.ma-qr-preview-error { color: #e8a0a0; }
.ma-qr-url {
  font-family: 'SFMono-Regular', Menlo, Consolas, monospace;
  font-size: 11px; color: #9ca3af;
  text-align: center; word-break: break-all;
  margin: 0 0 16px;
  padding: 8px 12px;
  background: #161616; border: 1px solid #2a2a2a; border-radius: 6px;
}
.ma-qr-controls {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px;
}
.ma-qr-controls.ma-qr-controls-2col { grid-template-columns: repeat(2, 1fr); }
.ma-qr-control { display: flex; flex-direction: column; gap: 4px; }
.ma-qr-control > span {
  font-size: 11px; font-weight: 600; color: #9ca3af;
  text-transform: uppercase; letter-spacing: 0.06em;
}
.ma-qr-control select {
  padding: 8px 10px;
  background: #2a2a2a; color: #e5e5e5;
  border: 1px solid #3a3a3a; border-radius: 8px;
  font-size: 13px; font-family: inherit;
  cursor: pointer;
}
.ma-qr-control select:focus { outline: none; border-color: #d4a853; }
@media (max-width: 480px) {
  .ma-qr-controls { grid-template-columns: 1fr; }
  .ma-qr-preview { width: 220px; height: 220px; }
}

/* ===== OVERRIDE BADGES ===== */
.ma-badge-override {
  display: inline-block; font-size: 11px; font-weight: 600;
  background: #3d3520; color: #e0b860; padding: 2px 8px;
  border-radius: 6px; margin-left: 4px; white-space: nowrap;
}
.ma-badge-disabled {
  display: inline-block; font-size: 11px; font-weight: 600;
  background: #3a2828; color: #e8a0a0; padding: 2px 8px;
  border-radius: 6px; margin-left: 4px; white-space: nowrap;
}
.ma-price-local { font-size: 11px; color: #e0b860; font-weight: 600; }
.ma-item-inactive { opacity: 0.4; }

/* ===== INHERITED VALUES ===== */
.ma-inherited {
  padding: 6px 10px; background: #232323; border-radius: 6px;
  color: #6b7280; font-size: 13px; font-style: italic;
  border: 1px dashed #3a3a3a;
}
.ma-inherited-section { opacity: 0.6; }
.ma-master-prices {
  margin-bottom: 8px; padding: 8px 10px; background: #232323;
  border-radius: 6px; border: 1px dashed #3a3a3a;
}
.ma-master-prices label { display: inline; font-size: 12px; color: #6b7280; margin: 0 !important; }
.ma-ref-price {
  display: inline-block; background: #333; padding: 2px 8px;
  border-radius: 4px; font-size: 12px; margin: 2px 4px; color: #9ca3af;
}
.ma-hint { font-size: 12px; color: #6b7280; font-style: italic; }

/* ===== CROP EDITOR ===== */
.ma-crop-overlay {
  position: fixed; inset: 0; z-index: 10001;
  background: rgba(0,0,0,0.85);
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
}
.ma-crop-dialog {
  background: #1e1e1e; border: 1px solid #3a3a3a; border-radius: 12px;
  width: 100%; max-width: 500px; max-height: 90vh;
  display: flex; flex-direction: column; overflow: hidden;
}
.ma-crop-header {
  display: flex; align-items: center; padding: 12px 16px;
  border-bottom: 1px solid #3a3a3a;
}
.ma-crop-header h3 { margin: 0; font-size: 16px; color: #e5e5e5; }
.ma-crop-header > div { flex: 1; }
.ma-crop-step {
  font-size: 11px; font-weight: 700; color: #d4a853;
  letter-spacing: 0.04em; margin-bottom: 2px;
}
.ma-crop-body { flex: 1; overflow: hidden; display: flex; flex-direction: column; }
.ma-crop-container {
  flex: 1; min-height: 300px; max-height: 60vh;
  background: #111; overflow: hidden;
}
.ma-crop-container img { display: block; max-width: 100%; }
.ma-crop-toolbar {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; background: #252525;
  border-top: 1px solid #3a3a3a;
}
.ma-crop-zoom-btn {
  width: 36px; height: 36px; border-radius: 8px;
  background: #3a3a3a; color: #e5e5e5; font-size: 18px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; border: none; transition: background 0.15s;
}
.ma-crop-zoom-btn:hover { background: #4a4a4a; }
#ma-crop-zoom { flex: 1; accent-color: #d4a853; height: 4px; }
.ma-crop-footer {
  display: flex; gap: 8px; justify-content: flex-end;
  padding: 12px 16px; border-top: 1px solid #3a3a3a; background: #1a1a1a;
}

/* ===== PHONE PREVIEW ===== */
.ma-preview-overlay {
  position: fixed; inset: 0; z-index: 10001;
  background: rgba(0,0,0,0.85);
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
}
.ma-phone-frame {
  width: 100%; max-width: 375px;
  background: #000; border-radius: 40px;
  padding: 12px; position: relative;
  box-shadow: 0 0 0 3px #333, 0 20px 60px rgba(0,0,0,0.5);
}
.ma-phone-notch {
  width: 120px; height: 28px; margin: 0 auto 8px;
  background: #000; border-radius: 0 0 16px 16px;
  position: relative; z-index: 2;
}
.ma-phone-screen {
  background: #1a1a1a; border-radius: 28px;
  overflow-y: auto; max-height: 70vh;
  scrollbar-width: thin; scrollbar-color: #d4a853 transparent;
}
.ma-pv-img-wrap {
  width: 100%; aspect-ratio: 27/35; overflow: hidden;
  background: #242424; border-radius: 28px 28px 0 0;
}
.ma-pv-img-wrap.ma-pv-no-img {
  display: flex; align-items: center; justify-content: center;
  font-size: 3rem; color: #555;
}
.ma-pv-img { width: 100%; height: 100%; object-fit: cover; }
.ma-pv-body { padding: 20px 16px 24px; }
.ma-pv-title {
  font-size: 1.3rem; font-weight: 700; color: #fff;
  line-height: 1.3; margin-bottom: 8px;
}
.ma-pv-desc {
  font-size: 0.85rem; color: #9a9a9a; line-height: 1.7;
  margin-bottom: 16px;
}
.ma-pv-price-single {
  font-size: 1.5rem; font-weight: 700; color: #d4a853;
  margin-bottom: 16px;
}
.ma-pv-prices { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.ma-pv-price-var {
  padding: 10px 16px; text-align: center;
  background: rgba(212,168,83,0.06);
  border: 1.5px solid rgba(212,168,83,0.4);
  border-radius: 12px;
}
.ma-pv-price-var:first-child {
  background: rgba(212,168,83,0.12); border-color: #d4a853;
}
.ma-pv-var-name { display: block; font-size: 0.7rem; color: #9a9a9a; margin-bottom: 2px; }
.ma-pv-var-price { font-size: 0.95rem; font-weight: 700; color: #d4a853; }
.ma-pv-labels { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.ma-pv-label {
  display: inline-flex; align-items: center;
  padding: 3px 10px; border-radius: 6px;
  font-size: 0.7rem; font-weight: 600;
  background: rgba(212,168,83,0.12); color: #d4a853;
}
.ma-pv-allergens { padding-top: 16px; border-top: 1px solid #333; }
.ma-pv-allergens-title {
  font-size: 0.7rem; font-weight: 600; color: #9a9a9a;
  letter-spacing: 0.06em; margin-bottom: 8px;
}
.ma-pv-allergens-list { display: flex; flex-wrap: wrap; gap: 6px; }
.ma-pv-allergen {
  font-size: 0.72rem; color: #9a9a9a;
  background: #242424; padding: 4px 10px; border-radius: 6px;
}
.ma-pv-close-btn {
  display: block; width: 100%; margin-top: 8px;
  padding: 10px; background: #333; color: #e5e5e5;
  border: none; border-radius: 20px; font-size: 14px;
  font-weight: 600; cursor: pointer; transition: background 0.15s;
}
.ma-pv-close-btn:hover { background: #444; }

/* Preview toggle + list card */
.ma-pv-toggle {
  display: flex; gap: 4px; padding: 8px 12px;
  background: #111; border-radius: 0;
}
.ma-pv-toggle-btn {
  flex: 1; padding: 8px; border: none; border-radius: 8px;
  font-size: 12px; font-weight: 600; cursor: pointer;
  background: transparent; color: #9a9a9a; transition: all 0.15s;
}
.ma-pv-toggle-btn.active { background: #333; color: #d4a853; }
.ma-pv-view { display: none; }
.ma-pv-view.active { display: block; }
.ma-pv-list-card {
  display: flex; gap: 12px; padding: 14px;
  background: #2a2a2a; border: 1px solid #333;
  border-radius: 14px; margin: 16px;
}
.ma-pv-list-thumb {
  width: 76px; height: 76px; object-fit: cover;
  border-radius: 10px; background: #3a3a3a; flex-shrink: 0;
}
.ma-pv-list-info { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: 4px; }
.ma-pv-list-name-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.ma-pv-list-name { font-size: 0.9rem; font-weight: 600; color: #fff; line-height: 1.3; }
.ma-pv-list-price { font-size: 0.9rem; font-weight: 700; color: #d4a853; white-space: nowrap; flex-shrink: 0; }
.ma-pv-list-desc {
  font-size: 0.75rem; color: #9a9a9a; line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

/* Thumb preview in admin form */
.ma-thumb-preview {
  width: 70px; height: 70px; object-fit: cover;
  border-radius: 6px; background: #3a3a3a; flex-shrink: 0;
}
.ma-thumb-preview.ma-no-img {
  display: flex; align-items: center; justify-content: center;
  color: #6b7280; font-size: 11px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 600px) {
  .ma-header { gap: 8px; }
  .ma-rest-selector { margin-left: 0; width: 100%; }
  .ma-rest-selector select { flex: 1; }
  .ma-cat-row { flex-wrap: wrap; }
  .ma-cat-info { flex-basis: 100%; order: -1; }
  .ma-subcat-header { flex-wrap: wrap; }
  .ma-subcat-header h4 { flex-basis: 100%; }
  .ma-item-row { flex-wrap: wrap; }
  .ma-item-info { flex-basis: calc(100% - 70px); }
}

/* ===== ANALYTICS DASHBOARD ===== */
.ma-an-toolbar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 10px 0 14px; border-bottom: 1px solid #2a2a2a; margin-bottom: 14px;
}
.ma-an-title { margin: 0; flex: 1; font-size: 16px; color: #e5e5e5; }
.ma-an-range { display: inline-flex; align-items: center; gap: 8px; }
.ma-an-range > span { font-size: 11px; color: #9ca3af; text-transform: uppercase; letter-spacing: 0.06em; }
.ma-an-range select {
  padding: 6px 10px; background: #2a2a2a; color: #e5e5e5;
  border: 1px solid #3a3a3a; border-radius: 8px; font-size: 13px; cursor: pointer;
}
.ma-an-range select:focus { outline: none; border-color: #d4a853; }

.ma-an-cards {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px;
  margin-bottom: 16px;
}
.ma-an-card {
  display: flex; flex-direction: column; gap: 4px;
  padding: 14px 16px;
  background: #1e1e1e; border: 1px solid #2a2a2a; border-radius: 12px;
}
.ma-an-card-label {
  font-size: 11px; color: #9ca3af;
  text-transform: uppercase; letter-spacing: 0.08em; font-weight: 600;
}
.ma-an-card-value {
  font-size: 26px; font-weight: 700; color: #d4a853;
  font-variant-numeric: tabular-nums; line-height: 1.1;
}

.ma-an-section {
  background: #1e1e1e; border: 1px solid #2a2a2a; border-radius: 12px;
  padding: 14px 16px; margin-bottom: 14px;
}
.ma-an-section h4 {
  margin: 0 0 12px; font-size: 13px; color: #e5e5e5;
  text-transform: uppercase; letter-spacing: 0.08em; font-weight: 600;
}
.ma-an-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px;
}
.ma-an-grid > .ma-an-section { margin-bottom: 0; }

.ma-an-chart-wrap { position: relative; height: 260px; }
.ma-an-chart-wrap-sm { height: 200px; }

.ma-an-list {
  list-style: none; margin: 0; padding: 0;
}
.ma-an-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 4px; border-top: 1px solid rgba(255,255,255,0.04);
  font-size: 14px; color: #e5e5e5;
}
.ma-an-list > .ma-an-row:first-child { border-top: none; }
.ma-an-rank {
  flex-shrink: 0; width: 22px; height: 22px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: rgba(212,168,83,0.15); color: #d4a853;
  font-size: 11px; font-weight: 700;
}
.ma-an-row-name {
  flex: 1; min-width: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ma-an-row-name.ma-an-mono { font-family: 'SFMono-Regular', Menlo, Consolas, monospace; font-size: 13px; }
.ma-an-row-count {
  flex-shrink: 0; color: #d4a853; font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.ma-an-empty {
  list-style: none; padding: 14px; text-align: center;
  color: #6b7280; font-size: 13px;
}

.ma-an-devices { display: flex; flex-direction: column; gap: 10px; }
.ma-an-device {
  display: grid; grid-template-columns: 90px 1fr 50px;
  align-items: center; gap: 10px; font-size: 13px;
}
.ma-an-device-label { color: #e5e5e5; }
.ma-an-device-bar {
  position: relative; height: 8px;
  background: #2a2a2a; border-radius: 4px; overflow: hidden;
}
.ma-an-device-fill {
  display: block; height: 100%;
  background: linear-gradient(90deg, #d4a853, #e8c87a);
  border-radius: 4px; transition: width 0.3s ease;
}
.ma-an-device-pct {
  text-align: right; color: #d4a853;
  font-weight: 700; font-variant-numeric: tabular-nums;
}
.ma-an-device-meta {
  margin-top: 6px; font-size: 11px;
  color: #6b7280; text-align: center;
}

.ma-an-table {
  width: 100%; border-collapse: collapse; font-size: 13px;
}
.ma-an-table th, .ma-an-table td {
  padding: 10px 12px; text-align: left;
  border-top: 1px solid rgba(255,255,255,0.05);
}
.ma-an-table th {
  font-size: 11px; color: #9ca3af; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.06em;
  border-top: none; border-bottom: 1px solid #2a2a2a;
  background: #161616;
}
.ma-an-table tbody tr:hover { background: rgba(212,168,83,0.04); }
.ma-an-table .ma-an-num { text-align: right; font-variant-numeric: tabular-nums; }
.ma-an-muted { color: #6b7280; font-weight: 400; }

@media (max-width: 900px) {
  .ma-an-cards { grid-template-columns: repeat(2, 1fr); }
  .ma-an-grid { grid-template-columns: 1fr; }
}
