/* Admin catalogue (manage.*): services and prices, banners, promo codes,
   loyalty, photo frames, settings. Every class starts with .mg-; logical
   properties only, so right-to-left needs nothing of its own. */

.mg-narrow { max-width: 860px; }
.mg-group { margin-block-end: 6px; }
.mg-count { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px;
            background: var(--soft); color: var(--brand-d); font-size: 12px; font-weight: 800; }

/* list rows: one height, text cut with "..." */
.mg-row { min-height: 72px; }
.mg-row.is-off { background: #FBF9FC; }
.mg-row.is-off .row-title, .mg-row.is-off .mg-thumb, .mg-row.is-off > .bubble { opacity: .6; }
.mg-thumb { width: 44px; height: 44px; flex: none; border-radius: 14px; object-fit: cover; background: var(--soft); }
.mg-price { color: var(--ink); font-weight: 800; }
.mg-soft { color: var(--muted); font-weight: 700; }
.mg-none { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 72px; padding: 0 14px;
           border: 1.5px dashed var(--line); border-radius: var(--r); color: var(--muted); font-weight: 700; min-width: 0; }
.mg-none:hover { border-color: var(--brand); color: var(--brand); text-decoration: none; }
.mg-none .ic { flex: none; }

/* where a banner or a code stands */
.badge.mg-st-live { background: var(--ok-soft); color: var(--ok); }
.badge.mg-st-scheduled { background: var(--info-soft); color: var(--info); }
.badge.mg-st-ended, .badge.mg-st-hidden { background: #EFEBF1; color: #6B6075; }
.badge.mg-st-used_up { background: var(--warn-soft); color: var(--warn); }

/* colour dots */
.mg-dots { display: flex; flex-wrap: wrap; gap: 10px; }
.mg-dot { position: relative; display: block; width: 44px; height: 44px; flex: none; cursor: pointer; margin: 0; }
.mg-dot input, .mg-icon-choice input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0;
                                        cursor: pointer; z-index: 1; }
.mg-dot span { display: grid; place-items: center; width: 100%; height: 100%; border-radius: 50%; background: var(--c);
               color: transparent; border: 3px solid #fff; box-shadow: 0 0 0 1.5px var(--line); }
.mg-dot span .ic { width: 20px; height: 20px; stroke-width: 3; }
.mg-dot input:checked + span { color: #fff; box-shadow: 0 0 0 2.5px var(--ink-2); }
.mg-dot input:focus-visible + span, .mg-icon-choice input:focus-visible + span { outline: 3px solid #E3D7EC; outline-offset: 2px; }

/* reward icons */
.mg-icons { display: flex; flex-wrap: wrap; gap: 8px; }
.mg-icon-choice { position: relative; display: block; width: 48px; height: 48px; flex: none; cursor: pointer; margin: 0; }
.mg-icon-choice span { display: grid; place-items: center; width: 100%; height: 100%; border-radius: 14px; background: #fff;
                       border: 2px solid var(--line); color: var(--ink-2); }
.mg-icon-choice span .ic { width: 22px; height: 22px; }
.mg-icon-choice:hover span { border-color: #D9CBE4; }
.mg-icon-choice input:checked + span { background: var(--brand); border-color: var(--brand); color: #fff; }

/* a picture: fixed size, whatever was chosen */
.mg-pic-row { display: flex; align-items: center; gap: 14px; min-width: 0; }
.mg-pic { display: grid; place-items: center; width: 128px; height: 96px; flex: none; overflow: hidden;
          border-radius: var(--r-sm); background: var(--soft); color: var(--muted); border: 1.5px solid var(--line); }
.mg-pic > img, .mg-pic .shot, .mg-pic .shot img { display: block; width: 100%; height: 100%; object-fit: cover; }
.mg-pic .ic { width: 28px; height: 28px; }
.mg-pic.is-alpha { background-color: #fff; background-size: 16px 16px;
                   background-image: conic-gradient(#EFE8F3 25%, #fff 0 50%, #EFE8F3 0 75%, #fff 0); }
.mg-pic.is-alpha > img, .mg-pic.is-alpha .shot img { object-fit: contain; }
.mg-pic-tools { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; min-width: 0; }
.mg-file { position: relative; overflow: hidden; cursor: pointer; }
.mg-file input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; font-size: 0; }
.mg-file:focus-within { outline: 3px solid #E3D7EC; }

/* a box with its unit inside (BD, %, points) */
.mg-money { position: relative; display: block; min-width: 0; }
.mg-money input { padding-inline-end: 66px; }
.mg-money b { position: absolute; inset-block: 0; inset-inline-end: 14px; display: flex; align-items: center; max-width: 56px;
              overflow: hidden; white-space: nowrap; color: var(--muted); font-weight: 800; pointer-events: none; }
.mg-money b .ic { width: 18px; height: 18px; }
.mg-code { text-transform: uppercase; letter-spacing: .04em; }

.mg-checks { display: flex; flex-wrap: wrap; gap: 12px 24px; }
.mg-foot { padding-block-start: 4px; }
.mg-danger-zone { display: flex; justify-content: flex-end; margin-block-start: 14px; }
.btn.mg-danger { color: var(--bad); border-color: var(--bad-soft); }
.btn.mg-danger:hover { color: #fff; background: var(--bad); border-color: var(--bad); }
.mg-of { font-size: 18px; color: var(--muted); font-weight: 700; }

/* the banner as families see it */
.mg-preview { margin-block-end: 16px; }
.mg-preview .slides { overflow: hidden; }
.mg-preview-note { display: flex; align-items: center; gap: 6px; margin-block-start: 8px; min-width: 0; }
.mg-preview-note .ic { flex: none; width: 16px; height: 16px; }

.mg-example { flex: 1 1 240px; margin: 0; padding: 10px 14px; min-width: 0; }
.mg-example .ic { flex: none; }

/* frames */
a.mg-frame { display: flex; flex-direction: column; padding: 0; overflow: hidden; color: var(--ink); }
a.mg-frame:hover { text-decoration: none; border-color: var(--brand); }
.mg-frame-img { display: block; aspect-ratio: 6 / 5; overflow: hidden; background: var(--bg); }
.mg-frame-img img, .mg-frame-big img { display: block; width: 100%; height: 100%; object-fit: contain; }
.mg-frame-body { display: flex; align-items: center; gap: 8px; min-height: 64px; padding: 10px 14px; min-width: 0; }
.mg-frame.is-off .mg-frame-img { opacity: .55; }
.mg-frame-big { width: min(100%, 420px); aspect-ratio: 6 / 5; margin-inline: auto; margin-block-end: 16px; overflow: hidden;
                border-radius: var(--r); border: 1px solid var(--line); background: var(--bg); }
.mg-swatches { display: flex; flex-wrap: wrap; gap: 12px 18px; }
.mg-swatch { display: flex; align-items: center; gap: 8px; min-width: 0; margin: 0; cursor: pointer; }
.mg-swatch input[type="color"] { width: 56px; height: 48px; flex: none; padding: 4px; border: 1.5px solid var(--line);
                                 border-radius: var(--r-sm); background: #fff; cursor: pointer; }
.mg-swatch span { width: 64px; }

/* settings */
.mg-anchor { scroll-margin-block-start: 84px; }
.mg-week { display: flex; flex-direction: column; gap: 8px; }
.mg-day { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "day shut" "times times";
          align-items: center; gap: 8px 12px; padding: 10px 12px; min-width: 0; background: #fff;
          border: 1px solid var(--line); border-radius: var(--r); }
.mg-day-name { grid-area: day; min-width: 0; }
.mg-shut { grid-area: shut; }
.mg-times { grid-area: times; display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center;
            gap: 8px; min-width: 0; }
.mg-times input { min-width: 0; }
.mg-day:has(.mg-shut input:checked) .mg-times { opacity: .4; }
.mg-day:has(.mg-shut input:checked) .mg-day-name { color: var(--muted); }
@media (min-width: 640px) {
  .mg-day { grid-template-columns: 120px auto minmax(0, 1fr); grid-template-areas: "day shut times"; }
}
