/* =============================================================================
   شكل «ميركادو» — نسخة من تصميم تطبيق Mercado (Liquid Glass بألوان اللوجو: كحلي #1f203c + أخضر #01c38e)
   للادمن وبوابة العميل وصندوق المتابعة وصفحات الدخول.
   - كل القواعد تحت html[data-skin="mercado"] (بيتحط قبل اول رسم من _skin_head.html)، فمن غيرها الشكل الاساسي زي ما هو.
   - الاستثناء الوحيد: اخفاء نسخ ايقونات ميركادو في الشكل الاساسي، وشكل زرار التبديل وكروت «شكل البوابة» (عناصر جديدة).
   - Mercado نفسه فاتح بس؛ الغامق هنا مأخوذ من الوان Mercado الغامقة الاساسية (app.css) بنفس الاخضر.
   بيتحمل بعد admin / theme / brand / ops / glass.
   ============================================================================= */

/* ---------------------------------------------------------------- الايقونات: نسخة Mercado بدل نسخة Flowly (نفس الاسم) */
html:not([data-skin="mercado"]) .sbi.mx { display: none !important; }
html[data-skin="mercado"] .sbi.fw { display: none !important; }

/* ---------------------------------------------------------------- زرار التبديل السريع وكروت «شكل البوابة» (الشكلين) */
.skin-sw { display: block; width: 18px; height: 18px; border-radius: 50%; flex: none;
  background: conic-gradient(from 200deg, #11b159 0 50%, #1f203c 50% 78%, #01c38e 78%); box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .7), 0 0 0 1px rgba(0, 0, 0, .08); }
.skp { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.skp-opt { display: flex; flex-direction: column; align-items: stretch; gap: 4px; padding: 10px 10px 12px; border: 1.5px solid var(--line); border-radius: var(--radius-sm, 12px);
  background: var(--surface); color: var(--ink); font: inherit; text-align: start; cursor: pointer; transition: border-color .15s, box-shadow .15s, transform .15s; }
.skp-opt:hover { border-color: var(--line-strong); }
.skp-opt:active { transform: scale(.985); }
.skp-opt[aria-checked="true"] { border-color: var(--teal); box-shadow: 0 0 0 3px var(--teal-soft); }
.skp-opt b { font-size: 14px; margin-top: 6px; color: var(--ink-strong, var(--ink)); }
.skp-opt small { font-size: 12px; color: var(--muted); line-height: 1.5; }
.skp-prev { position: relative; display: block; height: 96px; border-radius: 10px; overflow: hidden; direction: rtl; }
.skp-prev i { position: absolute; display: block; }
.skp-glass { background: radial-gradient(120px 90px at 90% -10%, rgba(43, 212, 127, .45), transparent 70%), radial-gradient(120px 90px at 0% 20%, rgba(96, 178, 255, .35), transparent 70%),
  radial-gradient(120px 90px at 60% 120%, rgba(160, 132, 255, .3), transparent 70%), #eaf3ee; }
.skp-glass .pv-side { top: 7px; bottom: 7px; right: 7px; width: 26%; border-radius: 9px; background: rgba(255, 255, 255, .62); box-shadow: inset 0 1px 0 #fff; }
.skp-glass .pv-on { top: 22px; right: 12px; width: 18%; height: 9px; border-radius: 4px; background: #11b159; }
.skp-glass .pv-c1 { top: 7px; right: calc(26% + 14px); left: 7px; height: 36px; border-radius: 10px; background: rgba(255, 255, 255, .62); box-shadow: inset 0 1px 0 #fff; }
.skp-glass .pv-c2 { top: 49px; right: calc(26% + 14px); left: 40%; bottom: 7px; border-radius: 10px; background: rgba(255, 255, 255, .62); box-shadow: inset 0 1px 0 #fff; }
.skp-glass .pv-btn { bottom: 12px; left: 9px; width: 24%; height: 12px; border-radius: 99px; background: linear-gradient(150deg, #2bd47f, #0c8f47); }
.skp-mx { background: radial-gradient(130px 90px at 100% -10%, rgba(1, 195, 142, .22), transparent 70%), linear-gradient(180deg, #f8f8fa, #f1f1f4); }
.skp-mx .pv-top { top: 0; left: 0; right: 0; height: 16px; background: rgba(255, 255, 255, .8); border-bottom: 1px solid rgba(23, 23, 23, .06); }
.skp-mx .pv-side { top: 22px; bottom: 6px; right: 6px; width: 25%; border-radius: 9px; background: rgba(255, 255, 255, .7); box-shadow: 0 4px 10px rgba(20, 25, 40, .06); }
.skp-mx .pv-on { top: 30px; right: 10px; width: 17%; height: 9px; border-radius: 4px; background: rgba(1, 195, 142, .16); box-shadow: inset -2px 0 0 #00875f; }
.skp-mx .pv-c1 { top: 22px; right: calc(25% + 12px); left: 6px; height: 32px; border-radius: 10px; background: rgba(255, 255, 255, .75); box-shadow: 0 4px 10px rgba(20, 25, 40, .05); }
.skp-mx .pv-c2 { top: 60px; right: calc(25% + 12px); left: 40%; bottom: 6px; border-radius: 10px; background: rgba(255, 255, 255, .75); box-shadow: 0 4px 10px rgba(20, 25, 40, .05); }
.skp-mx .pv-btn { bottom: 11px; left: 8px; width: 24%; height: 12px; border-radius: 5px; background: linear-gradient(180deg, #1ad6a2, #01c38e 55%, #00a97b); box-shadow: inset 0 0 0 1px rgba(0, 135, 95, .4); }
.skp-mx .pv-c1::after { content: ""; position: absolute; top: 9px; right: 9px; width: 3px; height: 13px; border-radius: 2px; background: #00875f; }
.skp-mode { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.skp-mode > span { font-size: 13px; font-weight: 700; color: var(--ink-2); margin-inline-end: 4px; }
html .skp-mode .btn[aria-checked="true"] { border-color: var(--teal) !important; color: var(--teal-dark) !important; background: var(--teal-soft) !important; box-shadow: none !important; }
@media (max-width: 520px) { .skp-prev { height: 78px; } }

/* =============================================================================
   الالوان والمقاسات (Liquid Glass بألوان لوجو Mercado)
   ============================================================================= */
html[data-skin="mercado"] {
  color-scheme: light;
  --mx-navy: #1f203c; --mx-navy-2: #2c2e55; --mx-green: #01c38e; --mx-ink: #00875f; --mx-ink-2: #006b4c; --mx-rgb: 1, 195, 142;
  --mx-soft: #e6f9f3; --mx-ring: rgba(1, 195, 142, .22); --mx-focus: #2c2e55;
  --mx-bg: #F5F5F7; --mx-text: #171717; --mx-soft-t: #3a3a3c; --mx-muted: #777777; --mx-faint: #8e8e93; --mx-ic: #6e6e73;
  --mx-ok: #159B59; --mx-info: #2785D8; --mx-warn: #E99A32; --mx-violet: #8061DC; --mx-bad: #e5484d;
  --mx-line: rgba(23, 23, 23, .06); --mx-line-2: rgba(23, 23, 23, .09);
  --mx-lg-s: rgba(255, 255, 255, .58); --mx-lg-c: rgba(255, 255, 255, .52); --mx-lg-b: rgba(255, 255, 255, .8);
  --mx-lg-hi: linear-gradient(180deg, rgba(255, 255, 255, .6), rgba(255, 255, 255, 0) 48%);
  --mx-lg-sh: 0 8px 24px rgba(20, 25, 40, .045), inset 0 1px 0 rgba(255, 255, 255, .9);
  --mx-lg-sh2: 0 1px 2px rgba(20, 25, 40, .05), 0 6px 16px rgba(20, 25, 40, .04), inset 0 1px 0 rgba(255, 255, 255, .95);
  --mx-sh-hover: 0 14px 30px rgba(20, 25, 40, .07), inset 0 1px 0 #fff;
  --mx-sh-pop: 0 24px 60px rgba(20, 25, 40, .14), inset 0 1px 0 #fff;
  --mx-hover: rgba(255, 255, 255, .6); --mx-solid: #ffffff; --mx-pop-bg: rgba(255, 255, 255, .985); --mx-dlg-bg: rgba(255, 255, 255, .94);
  --mx-top-bg: rgba(245, 245, 247, .55); --mx-top-line: rgba(255, 255, 255, .7); --mx-chip: rgba(255, 255, 255, .75); --mx-chip-b: #fff;
  --mx-on-sh: inset 0 1px 0 rgba(255, 255, 255, .9), 0 0 0 1px rgba(1, 195, 142, .10);
  --mx-top-h: 64px;
  /* متغيرات Flowly نفسها: كل الصفحات بتاخد الالوان دي من غير ما نلمسها */
  --font: "Inter", "Cairo", system-ui, "Segoe UI", sans-serif; --font-display: "Inter", "Cairo", sans-serif;
  --teal: #01c38e; --teal-dark: #00875f; --teal-soft: #e6f9f3; --navy: #1f203c;
  --bg: #F5F5F7; --bg-subtle: #F5F5F7; --surface: #ffffff; --surface-hover: rgba(255, 255, 255, .6); --surface-active: rgba(255, 255, 255, .85);
  --ink: #171717; --ink-strong: #171717; --ink-2: #3a3a3c; --muted: #777777; --icon-ink: #6e6e73;
  --line: rgba(23, 23, 23, .06); --line-2: rgba(23, 23, 23, .05); --line-strong: rgba(23, 23, 23, .12);
  --radius: 24px; --radius-sm: 14px; --sb-w: 264px;
  --shadow-xs: 0 1px 2px rgba(20, 25, 40, .05); --shadow-sm: var(--mx-lg-sh); --shadow-md: var(--mx-sh-pop);
  --focus: 0 0 0 3px var(--mx-soft);
  --glass-bg: var(--mx-lg-hi), var(--mx-lg-s);
  --glass-bg-strong: var(--mx-lg-hi), rgba(255, 255, 255, .9);
  --glass-tint: var(--mx-lg-c); --glass-brd: var(--mx-lg-b);
  --glass-edge: inset 0 1px 0 rgba(255, 255, 255, .9);
  --glass-drop: 0 8px 24px rgba(20, 25, 40, .045);
  --glass-shadow: var(--mx-lg-sh);
  --glass-filter: blur(24px) saturate(160%);
  --glass-field: rgba(255, 255, 255, .55); --glass-hair: rgba(23, 23, 23, .06);
  --tb-bg: var(--mx-lg-hi), var(--mx-lg-s); --tb-ring: #fff;
  --an-c2: #1f203c; --an-heat: #01c38e;
}
html[data-skin="mercado"][data-theme="dark"] {
  color-scheme: dark;
  --mx-ink: #2fd9a6; --mx-ink-2: #01c38e; --mx-soft: rgba(1, 195, 142, .14); --mx-ring: rgba(1, 195, 142, .26); --mx-focus: #01c38e;
  --mx-bg: #0f0f11; --mx-text: #f4f4f5; --mx-soft-t: #b4b4bc; --mx-muted: #9b9ba4; --mx-faint: #7c7c85; --mx-ic: #a1a1aa;
  --mx-line: rgba(255, 255, 255, .07); --mx-line-2: rgba(255, 255, 255, .11);
  --mx-lg-s: rgba(28, 28, 32, .66); --mx-lg-c: rgba(255, 255, 255, .05); --mx-lg-b: rgba(255, 255, 255, .08);
  --mx-lg-hi: linear-gradient(180deg, rgba(255, 255, 255, .05), rgba(255, 255, 255, 0) 48%);
  --mx-lg-sh: 0 8px 24px rgba(0, 0, 0, .35), inset 0 1px 0 rgba(255, 255, 255, .06);
  --mx-lg-sh2: 0 1px 2px rgba(0, 0, 0, .4), inset 0 1px 0 rgba(255, 255, 255, .05);
  --mx-sh-hover: 0 14px 30px rgba(0, 0, 0, .5), inset 0 1px 0 rgba(255, 255, 255, .08);
  --mx-sh-pop: 0 24px 60px rgba(0, 0, 0, .6), inset 0 1px 0 rgba(255, 255, 255, .06);
  --mx-hover: rgba(255, 255, 255, .06); --mx-solid: #18181b; --mx-pop-bg: rgba(28, 28, 32, .985); --mx-dlg-bg: rgba(28, 28, 32, .94);
  --mx-top-bg: rgba(15, 15, 17, .72); --mx-top-line: rgba(255, 255, 255, .07); --mx-chip: rgba(255, 255, 255, .06); --mx-chip-b: rgba(255, 255, 255, .08);
  --mx-on-sh: inset 0 1px 0 rgba(255, 255, 255, .06), 0 0 0 1px rgba(1, 195, 142, .22);
  --teal: #01c38e; --teal-dark: #2fd9a6; --teal-soft: rgba(1, 195, 142, .14); --navy: #e6e8f2;
  --bg: #0f0f11; --bg-subtle: #0f0f11; --surface: #18181b; --surface-hover: rgba(255, 255, 255, .06); --surface-active: rgba(255, 255, 255, .1);
  --ink: #e4e4e7; --ink-strong: #f4f4f5; --ink-2: #b4b4bc; --muted: #9b9ba4; --icon-ink: #a1a1aa;
  --line: rgba(255, 255, 255, .07); --line-2: rgba(255, 255, 255, .05); --line-strong: rgba(255, 255, 255, .14);
  --focus: 0 0 0 3px var(--mx-soft);
  --glass-bg-strong: var(--mx-lg-hi), rgba(30, 30, 35, .94);
  --glass-edge: inset 0 1px 0 rgba(255, 255, 255, .06); --glass-drop: 0 8px 24px rgba(0, 0, 0, .35);
  --glass-field: rgba(255, 255, 255, .04); --glass-hair: rgba(255, 255, 255, .07);
  --tb-ring: #18181b;
  --an-c2: #8b8fd6;
}
@media (max-width: 900px) { html[data-skin="mercado"] { --mx-top-h: 72px; } }

/* ---------------------------------------------------------------- الخلفية والخط */
html[data-skin="mercado"] { background: var(--mx-bg); }
html[data-skin="mercado"] body {
  font-family: var(--font); color: var(--mx-text);
  background:
    radial-gradient(520px 420px at 106% -8%, rgba(1, 195, 142, .15), transparent 70%),
    radial-gradient(420px 360px at -14% 58%, rgba(1, 195, 142, .09), transparent 70%),
    radial-gradient(640px 420px at 50% 114%, rgba(1, 195, 142, .07), transparent 70%),
    linear-gradient(180deg, #f8f8fa, #f1f1f4) !important;
  background-attachment: fixed !important;
}
html[data-skin="mercado"][data-theme="dark"] body {
  background:
    radial-gradient(520px 420px at 106% -8%, rgba(1, 195, 142, .12), transparent 70%),
    radial-gradient(420px 360px at -14% 58%, rgba(1, 195, 142, .06), transparent 70%),
    radial-gradient(640px 420px at 50% 114%, rgba(44, 46, 85, .35), transparent 70%),
    #0f0f11 !important;
  background-attachment: fixed !important;
}
@media (max-width: 900px) { html[data-skin="mercado"] body, html[data-skin="mercado"][data-theme="dark"] body { background-attachment: scroll !important; } }
html[data-skin="mercado"] :is(button, input, select, textarea, .btn, .badge, .nav-item) { font-family: var(--font); }
html[data-skin="mercado"] ::selection { background: rgba(1, 195, 142, .18); }
html[data-skin="mercado"] a { color: var(--mx-ink); }
html[data-skin="mercado"] :focus-visible { outline: 2px solid var(--mx-ink); outline-offset: 2px; }
html[data-skin="mercado"] input[type=checkbox], html[data-skin="mercado"] input[type=radio] { accent-color: var(--mx-ink); }

/* =============================================================================
   الهيكل: شريط فوق بعرض الصفحة + قائمة جانبية كارت عايم تحته (زي Mercado)
   ============================================================================= */
html[data-skin="mercado"] :is(.mobile-bar, .sb-user, .skin-btn) { display: none !important; }
html[data-skin="mercado"] body.shell { padding: var(--mx-top-h) 0 0; gap: 0; align-items: flex-start; }

/* ---------------- الشريط اللي فوق */
html[data-skin="mercado"] .mx-top {
  position: fixed; top: 0; left: 0; right: 0; z-index: 42; height: var(--mx-top-h);
  display: flex; align-items: center; gap: 12px; padding-block: 0; padding-inline: 16px 24px;
  background: var(--mx-top-bg); -webkit-backdrop-filter: blur(22px) saturate(160%); backdrop-filter: blur(22px) saturate(160%);
  border-bottom: 1px solid var(--mx-top-line); box-shadow: 0 1px 0 rgba(20, 25, 40, .04);
  view-transition-name: fx-mxtop; transition: transform .3s cubic-bezier(.16, 1, .3, 1);
}
::view-transition-group(fx-mxtop) { animation: none; }
html[data-skin="mercado"] .mx-top .icon-btn { width: 44px; height: 44px; flex: none; border-radius: 50%; display: grid; place-items: center; color: var(--mx-text);
  background: transparent; border: 0; cursor: pointer; transition: background .15s, color .15s; }
html[data-skin="mercado"] .mx-top .icon-btn svg { width: 20px; height: 20px; }
html[data-skin="mercado"] .mx-top .mx-collapse:hover, html[data-skin="mercado"] .mx-top .mx-drawer:hover { background: var(--mx-hover); }
html[data-skin="mercado"] .mx-brand { display: flex; align-items: center; gap: 10px; width: 186px; flex: none; min-width: 0; text-decoration: none !important; }
html[data-skin="mercado"] .mx-logo { display: block; height: 30px; width: auto; }
html[data-skin="mercado"] .mx-mark { display: none; border-radius: 9px; }
html[data-skin="mercado"] .mx-drawer { display: none !important; }
html[data-skin="mercado"] .mx-r { margin-inline-start: auto; display: flex; align-items: center; gap: 6px; }
html[data-skin="mercado"] .mx-r > .icon-btn, html[data-skin="mercado"] .mx-r .mx-pw > .icon-btn {
  background: var(--mx-lg-hi), var(--mx-chip); border: 1px solid var(--mx-lg-b); box-shadow: var(--mx-lg-sh2); }
html[data-skin="mercado"] .mx-r .icon-btn:hover { background: var(--mx-lg-hi), var(--mx-solid); }
html[data-skin="mercado"] .mx-r .icon-btn[aria-expanded="true"] { background: var(--mx-solid); color: var(--mx-ink); }
html[data-skin="mercado"] .mx-lang { font: 800 12.5px "Lato", "Cairo", sans-serif; letter-spacing: .3px; }
html[data-skin="mercado"][lang="en"] .mx-lang { font-size: 0; }
html[data-skin="mercado"] .mx-thm .mx-moon, html[data-skin="mercado"][data-theme="dark"] .mx-thm .mx-sun { display: none; }
html[data-skin="mercado"][data-theme="dark"] .mx-thm .mx-moon { display: inline-flex; }
html[data-skin="mercado"]:not([data-theme="dark"]) .mx-thm .mx-sun { display: inline-flex; }

/* القوايم اللي بتنزل من الشريط */
html[data-skin="mercado"] .mx-pw { position: relative; }
html[data-skin="mercado"] .mx-pop {
  position: absolute; top: calc(100% + 8px); inset-inline-end: 0; z-index: 60; min-width: 220px; max-width: calc(100vw - 24px); padding: 6px;
  background: var(--mx-lg-hi), var(--mx-pop-bg); -webkit-backdrop-filter: blur(30px) saturate(170%); backdrop-filter: blur(30px) saturate(170%);
  border: 1px solid var(--mx-lg-b); border-radius: 20px; box-shadow: var(--mx-sh-pop);
  opacity: 0; visibility: hidden; transform: translateY(-6px) scale(.98); transform-origin: top;
  transition: opacity .16s, transform .2s cubic-bezier(.16, 1, .3, 1), visibility .16s;
}
html[data-skin="mercado"] .mx-pop.open { opacity: 1; visibility: visible; transform: none; }
html[data-skin="mercado"] .mx-ph { padding: 8px 10px 4px; font-size: 11.5px; font-weight: 700; color: var(--mx-faint); }
html[data-skin="mercado"] .mx-mi { display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px 10px; border: 0; background: none; border-radius: 12px;
  font: 500 13.5px var(--font); color: var(--mx-text); cursor: pointer; text-align: start; text-decoration: none !important; }
html[data-skin="mercado"] .mx-mi:hover { background: var(--mx-hover); }
html[data-skin="mercado"] .mx-mi svg { width: 18px; height: 18px; flex: none; color: var(--mx-ic); }
html[data-skin="mercado"] .mx-mi > span { flex: 1; min-width: 0; }
html[data-skin="mercado"] .mx-mi > svg:last-child:not(:first-child) { display: none; color: var(--mx-ink); }
html[data-skin="mercado"] .mx-mi.on { color: var(--mx-ink); font-weight: 700; }
html[data-skin="mercado"] .mx-mi.on svg { color: var(--mx-ink); }
html[data-skin="mercado"] .mx-mi.on > svg:last-child:not(:first-child) { display: block; }
html[data-skin="mercado"] .mx-mi.danger, html[data-skin="mercado"] .mx-mi.danger svg { color: #b91c1c; }
html[data-skin="mercado"][data-theme="dark"] .mx-mi.danger, html[data-skin="mercado"][data-theme="dark"] .mx-mi.danger svg { color: #f87171; }
html[data-skin="mercado"] .mx-meh { display: flex; flex-direction: column; gap: 1px; padding: 8px 10px 10px; margin-bottom: 4px; border-bottom: 1px solid var(--mx-line); }
html[data-skin="mercado"] .mx-meh b { font-size: 13.5px; color: var(--mx-text); }
html[data-skin="mercado"] .mx-meh small { font-size: 11.5px; color: var(--mx-muted); }

/* ---------------- القائمة الجانبية */
html[data-skin="mercado"] body.shell .sidebar { width: var(--sb-w); }
@media (min-width: 901px) {
  html[data-skin="mercado"] body.shell .sidebar { position: sticky; top: calc(var(--mx-top-h) + 12px); height: calc(100vh - var(--mx-top-h) - 24px); margin: 12px; border-radius: 24px; }
  html[data-skin="mercado"] .sb-top { display: none; }
  html[data-skin="mercado"].sb-mini { --sb-w: 72px; }
  html[data-skin="mercado"].sb-mini .sb-nav { padding-inline: 10px; }
  html[data-skin="mercado"].sb-mini .sb-label { height: 1px; padding: 0; margin: 8px 10px; font-size: 0; background: var(--mx-line); overflow: hidden; color: transparent; }
  html[data-skin="mercado"].sb-mini .nav-item { justify-content: center; padding: 0; gap: 0; }
  html[data-skin="mercado"].sb-mini .mx-switch { display: none; }
  html[data-skin="mercado"].sb-mini .sb-foot { padding: 10px; }
}
html[data-skin="mercado"] .sidebar { background: var(--mx-lg-hi), var(--mx-lg-s); border: 1px solid var(--mx-lg-b) !important; box-shadow: var(--mx-lg-sh) !important;
  -webkit-backdrop-filter: blur(24px) saturate(160%); backdrop-filter: blur(24px) saturate(160%); }
html[data-skin="mercado"] .sb-nav { padding: 10px; display: flex; flex-direction: column; gap: 2px; }
html[data-skin="mercado"] .sb-label { font-size: 12px; font-weight: 600; color: var(--mx-faint); letter-spacing: .2px; padding: 14px 12px 6px; margin: 0; }
html[data-skin="mercado"] .nav-item {
  position: relative; flex: none; height: 44px; margin: 0; padding: 0 12px; gap: 12px; border-radius: 14px; border: 0;
  font-size: 14px; font-weight: 500; color: var(--mx-soft-t); background: transparent; width: 100%; text-align: start; cursor: pointer;
  transition: background .15s, color .15s; text-decoration: none !important;
}
html[data-skin="mercado"] .nav-item:hover { background: var(--mx-hover) !important; color: var(--mx-text); }
html[data-skin="mercado"] .nav-item .nav-ic, html[data-skin="mercado"] .nav-item:hover .nav-ic, html[data-skin="mercado"] .nav-item.active .nav-ic {
  width: 22px; height: 22px; border: 0; border-radius: 0; background: none; box-shadow: none; transform: none; color: var(--mx-ic); transition: transform .25s cubic-bezier(.16, 1, .3, 1); }
html[data-skin="mercado"] .nav-item:hover .nav-ic { transform: scale(1.12); }
html[data-skin="mercado"] .nav-item .nav-ic .sbi, html[data-skin="mercado"] .nav-item .nav-ic svg { width: 19px; height: 19px; }
html[data-skin="mercado"] .nav-item.active, html[data-skin="mercado"][data-theme="dark"] .nav-item.active {
  background: var(--mx-lg-hi), rgba(var(--mx-rgb), .07) !important; color: var(--mx-ink); font-weight: 700; box-shadow: var(--mx-on-sh) !important; }
html[data-skin="mercado"] .nav-item.active .nav-ic { color: var(--mx-ink); }
/* مؤشر القسم المفتوح: خط اخضر على حافة القائمة */
html[data-skin="mercado"] .nav-item.active::before { content: ""; position: absolute; inset-inline-start: -10px; top: 50%; width: 3px; height: 24px; margin-top: -12px;
  border-radius: 3px; background: var(--mx-ink); animation: mx-ind .45s cubic-bezier(.16, 1, .3, 1) both; }
@keyframes mx-ind { from { transform: scaleY(0); opacity: 0; } }
html[data-skin="mercado"] .sb-foot { padding: 10px 12px; border-top: 1px solid var(--mx-line); }
html[data-skin="mercado"] .mx-foot { display: flex; flex-direction: column; gap: 2px; }
html[data-skin="mercado"] .mx-out:hover { color: #b91c1c; background: #fee2e2 !important; }
html[data-skin="mercado"] .mx-out:hover .nav-ic { color: #b91c1c; }
html[data-skin="mercado"][data-theme="dark"] .mx-out:hover { color: #f87171; background: rgba(239, 68, 68, .14) !important; }
html[data-skin="mercado"][data-theme="dark"] .mx-out:hover .nav-ic { color: #f87171; }
html[data-skin="mercado"] .mx-switch { margin-inline-start: auto; width: 34px; height: 20px; border-radius: 999px; background: var(--mx-line-2); position: relative; flex: none; transition: background .25s; }
html[data-skin="mercado"] .mx-switch::after { content: ""; position: absolute; top: 2px; right: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .25s cubic-bezier(.16, 1, .3, 1); }
html[data-skin="mercado"][data-theme="dark"] .mx-switch { background: var(--mx-ink-2); }
html[data-skin="mercado"][data-theme="dark"] .mx-switch::after { transform: translateX(-14px); }

/* ---------------- مساحة الصفحة */
html[data-skin="mercado"] body.shell:not(.inbox-page) .content { max-width: 1400px; padding: 20px 24px 32px; }
html[data-skin="mercado"] .ws-strip { top: var(--mx-top-h); }

/* ---------------- الموبايل: القائمة بتزق الصفحة جنبها (زي Mercado) */
@media (max-width: 900px) {
  html[data-skin="mercado"] .mx-top { padding-inline: 12px; gap: 8px; }
  html[data-skin="mercado"] .mx-drawer { display: grid !important; }
  html[data-skin="mercado"] .mx-collapse, html[data-skin="mercado"] .mx-lang, html[data-skin="mercado"] .mx-thm-w { display: none !important; }
  html[data-skin="mercado"] .mx-brand { width: auto; }
  html[data-skin="mercado"] .mx-logo { display: none; }
  html[data-skin="mercado"] .mx-mark { display: block; }
  html[data-skin="mercado"] .mx-r { gap: 2px; }
  html[data-skin="mercado"] .mx-r .mx-pop { position: fixed; top: calc(var(--mx-top-h) + 6px); left: 12px; right: 12px; width: auto; }
  html[data-skin="mercado"] body.shell .sidebar, html[data-skin="mercado"][dir="ltr"] body.shell .sidebar {
    position: fixed; top: 0; bottom: 0; height: auto; width: 280px; margin: 0; border-radius: 0; z-index: 46;
    background: var(--mx-solid); -webkit-backdrop-filter: none; backdrop-filter: none; box-shadow: none !important; border: 0 !important;
    border-inline-end: 1px solid var(--mx-line) !important; transition: transform .3s cubic-bezier(.16, 1, .3, 1), visibility 0s linear .3s; }
  html[data-skin="mercado"] body.shell .sidebar { inset: 0 0 0 auto; }
  html[data-skin="mercado"][dir="ltr"] body.shell .sidebar { inset: 0 auto 0 0; }
  html[data-skin="mercado"] body.sb-open .sidebar { transition: transform .3s cubic-bezier(.16, 1, .3, 1); }
  html[data-skin="mercado"] .sb-top { display: flex; height: 64px; flex: none; padding: 0 14px; border-bottom: 1px solid var(--mx-line); }
  html[data-skin="mercado"] .sb-top .sb-brand { padding: 0; }
  html[data-skin="mercado"] .sb-top .sb-logo { width: 120px; }
  html[data-skin="mercado"] :is(.main-col, .tabbar) { transition: transform .3s cubic-bezier(.16, 1, .3, 1); }
  html[data-skin="mercado"] body.sb-open :is(.main-col, .mx-top) { transform: translateX(-280px); }
  html[data-skin="mercado"] body.sb-open nav.tabbar { transform: translateX(-280px); opacity: 1; }
  html[data-skin="mercado"][dir="ltr"] body.sb-open :is(.main-col, .mx-top), html[data-skin="mercado"][dir="ltr"] body.sb-open nav.tabbar { transform: translateX(280px); }
  html[data-skin="mercado"] body.sb-open .sb-scrim { background: transparent; -webkit-backdrop-filter: none; backdrop-filter: none; }
  html[data-skin="mercado"] body.shell:not(.inbox-page) .content { padding: 8px 14px 40px; }
  html[data-skin="mercado"] body.has-tabbar:not(.inbox-page) .content { padding-bottom: calc(124px + env(safe-area-inset-bottom, 0px)); }
}
/* جوه الدايرة العايمة / الصفحة المضمنة: من غير شريط */
html[data-skin="mercado"] body.embed .mx-top { display: none !important; }
html[data-skin="mercado"] body.shell.embed { padding-top: 0; }

/* ---------------- شريط التنقل اللي تحت (الموبايل): كبسولة زجاج عايمة */
@media (max-width: 860px) {
  html[data-skin="mercado"] body nav.tabbar, html[data-skin="mercado"][data-theme="dark"] body nav.tabbar {
    display: flex; align-items: stretch; gap: 2px; inset: auto 12px calc(10px + env(safe-area-inset-bottom, 0px)) 12px; height: 70px; padding: 0 6px; border-radius: 28px;
    background: var(--mx-lg-hi), var(--mx-lg-s); -webkit-backdrop-filter: blur(24px) saturate(160%); backdrop-filter: blur(24px) saturate(160%);
    border: 1px solid var(--mx-lg-b); box-shadow: var(--mx-lg-sh); }
  html[data-skin="mercado"] .tabbar a:not(.fab), html[data-skin="mercado"] .tabbar button {
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 44px; margin: 7px 0; padding: 0;
    border-radius: 22px; color: var(--mx-ic); position: relative; }
  html[data-skin="mercado"] .tabbar a span, html[data-skin="mercado"] .tabbar button span { font-size: 12.5px; font-weight: 600; }
  html[data-skin="mercado"] .tabbar a:not(.fab) .sbi, html[data-skin="mercado"] .tabbar button .sbi { width: 23px; height: 23px; color: inherit; }
  html[data-skin="mercado"] .tabbar :is(a, button).on, html[data-skin="mercado"][data-theme="dark"] .tabbar :is(a, button).on {
    color: var(--mx-ink); background: var(--mx-lg-hi), rgba(var(--mx-rgb), .07); box-shadow: var(--mx-on-sh); }
  html[data-skin="mercado"] .tabbar :is(a, button).on .sbi { color: var(--mx-ink); transform: none; }
  html[data-skin="mercado"] .tabbar .on::after { display: block; content: ""; position: absolute; top: -8px; bottom: auto; left: 50%; width: 30px; height: 3px; margin-left: -15px;
    border-radius: 0 0 3px 3px; background: var(--mx-ink); }
  /* زرار «أرسل»: مربع عايم فوق الشريط على اليمين (زي زرار + في Mercado) */
  html[data-skin="mercado"] body .tabbar a.fab, html[data-skin="mercado"][data-theme="dark"] body .tabbar a.fab {
    position: absolute; right: 6px; left: auto; bottom: calc(100% + 14px); width: 42px; height: 42px; margin: 0; border-radius: 13px; display: grid; place-items: center;
    background: radial-gradient(120% 90% at 30% 15%, #1ad6a2, #00875f 55%, #006b4c); color: #fff; border: 1px solid rgba(255, 255, 255, .35);
    box-shadow: 0 12px 24px -10px rgba(1, 195, 142, .7), inset 0 1px 0 rgba(255, 255, 255, .4); }
  html[data-skin="mercado"] body .tabbar a.fab .sbi.r { width: 19px; height: 19px; }
  html[data-skin="mercado"] body .tabbar a.fab::after { display: none; }
}

/* =============================================================================
   الكروت ورأس الصفحة والارقام
   ============================================================================= */
html[data-skin="mercado"] :is(.card, .stat, .dh-kpi, .dh-panel, .nb-card, .an-kpi, .an-stat2, .of-stat, .of-gcard, .of-kpi) { border-radius: 24px; }
html[data-skin="mercado"] :is(.stat, .dh-kpi, .an-kpi, .of-kpi, .of-stat) { border-radius: 22px; }
html[data-skin="mercado"] :is(.card, .stat, .quota-strip .q, .dh-kpi, .dh-panel, .nb-card, .dh-range, .an-kpi, .an-minis, .an-stat2, .of-stat, .of-tpl, .of-step, .of-gcard,
  .of-kpi, .of-flowstat, .of-msg, .of-connect, .ml-row, .ml-empty, .rc-row, .fx-card) { border: 1px solid var(--mx-lg-b); }
html[data-skin="mercado"] .page-head { margin-bottom: 18px; }
html[data-skin="mercado"] .page-head h1 { font-size: 26px; font-weight: 800; letter-spacing: -.2px; color: var(--mx-text); }
html[data-skin="mercado"] .page-head h1 svg { width: 26px; height: 26px; padding: 0; background: none; border-radius: 0; color: var(--mx-ink); }
html[data-skin="mercado"] .page-head p { color: var(--mx-muted); font-size: 13.5px; }
html[data-skin="mercado"] .card-head { border-bottom: 0; padding: 18px 22px 10px; }
html[data-skin="mercado"] .card-head h2 { font-size: 20px; font-weight: 800; color: var(--mx-text); display: flex; align-items: center; gap: 10px; }
html[data-skin="mercado"] .card-head h2::before { content: ""; width: 3px; height: 20px; border-radius: 3px; background: var(--mx-ink); flex: none; }
html[data-skin="mercado"] .card-head h2 svg { width: 22px; height: 22px; color: var(--mx-ink); }
html[data-skin="mercado"] .card-head .hint { font-size: 13px; color: var(--mx-muted); }
html[data-skin="mercado"] .card-body { padding: 8px 22px 20px; }
html[data-skin="mercado"] .card-body.tight { padding: 0; }
html[data-skin="mercado"] .card:hover { box-shadow: var(--mx-lg-sh); }
@media (max-width: 900px) {
  html[data-skin="mercado"] .card-head { padding: 16px 16px 8px; }
  html[data-skin="mercado"] .card-body { padding: 8px 16px 18px; }
  html[data-skin="mercado"] .card-body.tight { padding: 0; }
  html[data-skin="mercado"] .page-head h1 { font-size: 23px; }
}

/* الارقام: دايرة زجاج ملونة للايقونة، ورقم كبير */
html[data-skin="mercado"] .stat { --k: var(--mx-info); position: relative; overflow: hidden; padding: 20px; min-height: 118px; transition: transform .2s cubic-bezier(.16, 1, .3, 1), box-shadow .2s; }
html[data-skin="mercado"] .grid > .stat:nth-child(4n+2) { --k: var(--mx-ok); }
html[data-skin="mercado"] .grid > .stat:nth-child(4n+3) { --k: var(--mx-violet); }
html[data-skin="mercado"] .grid > .stat:nth-child(4n+4) { --k: var(--mx-ink); }
html[data-skin="mercado"] .stat.accent, html[data-skin="mercado"] .grid > .stat.accent { --k: var(--mx-ink); }
html[data-skin="mercado"] .stat.warn, html[data-skin="mercado"] .grid > .stat.warn { --k: var(--mx-warn); }
html[data-skin="mercado"] .stat.danger, html[data-skin="mercado"] .grid > .stat.danger { --k: var(--mx-bad); }
html[data-skin="mercado"] .stat:hover { transform: translateY(-2px); box-shadow: var(--mx-sh-hover); }
html[data-skin="mercado"] .stat:active { transform: scale(.985); }
html[data-skin="mercado"] .stat .label { font-size: 14px; font-weight: 600; color: var(--mx-soft-t); gap: 12px; margin-bottom: 8px; }
html[data-skin="mercado"] .stat .label svg { width: 22px; height: 22px; padding: 12px; box-sizing: content-box; border-radius: 50%; color: var(--k);
  background: var(--mx-lg-hi), var(--mx-chip); border: 1px solid var(--mx-chip-b);
  box-shadow: 0 4px 12px color-mix(in srgb, var(--k) 18%, transparent), inset 0 1px 0 rgba(255, 255, 255, .9); }
html[data-skin="mercado"] .stat .value { font-family: var(--font); font-size: 32px; font-weight: 800; letter-spacing: -.5px; line-height: 1.15; color: var(--mx-text); }
html[data-skin="mercado"] .stat.accent .value { color: var(--mx-ink); }
html[data-skin="mercado"] .stat .sub { font-size: 13px; color: var(--mx-muted); }
@media (max-width: 900px) {
  html[data-skin="mercado"] .stat { padding: 14px; min-height: 0; }
  html[data-skin="mercado"] .stat .label { font-size: 13px; }
  html[data-skin="mercado"] .stat .label svg { width: 18px; height: 18px; padding: 10px; }
  html[data-skin="mercado"] .stat .value { font-size: 26px; }
}
html[data-skin="mercado"] .quota-strip .q { border-radius: 18px; }
html[data-skin="mercado"] .quota-strip .q svg { color: var(--mx-ink); }

/* =============================================================================
   الجداول والازرار والمدخلات والتابات والشارات
   ============================================================================= */
html[data-skin="mercado"] thead th, html[data-skin="mercado"][data-theme="dark"] thead th {
  background: transparent !important; color: var(--mx-muted); font-size: 12.5px; font-weight: 600; letter-spacing: 0; border-bottom: 1px solid var(--mx-line); }
html[data-skin="mercado"] tbody td { border-bottom: 1px solid var(--mx-line); }
html[data-skin="mercado"] tbody tr:last-child td { border-bottom: 0; }
html[data-skin="mercado"] tbody tr:hover td { background: var(--mx-hover); }

html[data-skin="mercado"] body:not(.inbox-page) .btn {
  min-height: 44px; padding: 8px 16px; border-radius: 14px; font-weight: 600; color: var(--mx-text);
  background: var(--mx-lg-hi), var(--mx-lg-c); border: 1px solid var(--mx-lg-b); box-shadow: var(--mx-lg-sh2); }
html[data-skin="mercado"] body:not(.inbox-page) .btn:hover { background: var(--mx-lg-hi), var(--mx-hover); }
html[data-skin="mercado"] body:not(.inbox-page) .btn svg { color: currentColor; }
html[data-skin="mercado"] body:not(.inbox-page) .btn.sm { min-height: 34px; padding: 4px 12px; border-radius: 12px; font-size: 12.5px; }
html[data-skin="mercado"] body:not(.inbox-page) .btn.primary {
  background: linear-gradient(180deg, #1ad6a2, #01c38e 55%, #00a97b) !important; border: 1px solid rgba(0, 135, 95, .55) !important; color: #1f203c !important;
  box-shadow: 0 8px 18px -8px rgba(1, 195, 142, .6), inset 0 1px 0 rgba(255, 255, 255, .45) !important; }
html[data-skin="mercado"] body:not(.inbox-page) .btn.primary:hover { filter: brightness(1.05); }
html[data-skin="mercado"] body:not(.inbox-page) .btn.dark { background: var(--mx-lg-hi), #1f203c; border-color: #1f203c; color: #fff; }
html[data-skin="mercado"] body:not(.inbox-page) .btn.danger { background: var(--mx-lg-hi), rgba(229, 72, 77, .07); border-color: rgba(229, 72, 77, .22); color: var(--mx-bad); }
html[data-skin="mercado"] body:not(.inbox-page) .btn.ghost { background: transparent; border-color: transparent; box-shadow: none; }
html[data-skin="mercado"] body:not(.inbox-page) .btn.ghost:hover { background: var(--mx-hover); }
html[data-skin="mercado"] body:not(.inbox-page) .btn.copied { background: var(--mx-soft); border-color: rgba(1, 195, 142, .35); color: var(--mx-ink); }
html[data-skin="mercado"] body:not(.inbox-page) .btn:active { transform: scale(.97); }

html[data-skin="mercado"] body:not(.inbox-page) :is(input:not([type]), input[type=text], input[type=password], input[type=email], input[type=number], input[type=url], input[type=date],
  input[type=search], input[type=tel], input[type=time], input[type=datetime-local], select, textarea) {
  background: var(--mx-lg-hi), var(--mx-lg-c); border: 1px solid var(--mx-line-2); border-radius: 14px; color: var(--mx-text); box-shadow: var(--mx-lg-sh2); }
html[data-skin="mercado"] body:not(.inbox-page) :is(input:not([type]), input[type=text], input[type=password], input[type=email], input[type=number], input[type=url], input[type=date],
  input[type=search], input[type=tel], input[type=datetime-local], select) { height: 44px !important; min-height: 44px !important; }
html[data-skin="mercado"] body:not(.inbox-page) :is(input, select, textarea):focus { border-color: var(--mx-focus); box-shadow: 0 0 0 3px var(--mx-soft); outline: none; }
html[data-skin="mercado"] input::placeholder, html[data-skin="mercado"] textarea::placeholder { color: var(--mx-faint); }
html[data-skin="mercado"] label { color: var(--mx-soft-t); }
html[data-skin="mercado"] :is(.secret-box, pre) { background: var(--mx-lg-hi), var(--mx-lg-c); border-color: var(--mx-line-2); border-radius: 14px; }

html[data-skin="mercado"] .tabs { gap: 6px; padding: 2px 0; background: none; border: 0; box-shadow: none; border-radius: 0; }
html[data-skin="mercado"] .tabs a { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px; border-radius: 999px; font-size: 13.5px; font-weight: 600;
  color: var(--mx-soft-t); background: var(--mx-lg-hi), var(--mx-lg-c); border: 1px solid var(--mx-lg-b); box-shadow: var(--mx-lg-sh2); transition: background .2s, color .2s, border-color .2s, transform .15s; }
html[data-skin="mercado"] .tabs a:hover { color: var(--mx-text); background: var(--mx-lg-hi), var(--mx-hover); }
html[data-skin="mercado"] .tabs a:active { transform: scale(.96); }
html[data-skin="mercado"] .tabs a.active { color: var(--mx-ink); background: rgba(var(--mx-rgb), .08); border-color: rgba(var(--mx-rgb), .3); box-shadow: none; }

html[data-skin="mercado"] .badge { padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; color: #3f3f46;
  background: var(--mx-lg-hi), var(--mx-lg-c); border: 1px solid var(--mx-lg-b); box-shadow: var(--mx-lg-sh2); }
html[data-skin="mercado"] .badge:is(.connected, .active, .sent, .delivered, .read, .ok, .success, .paid, .enabled, .done, .resolved) { color: #15803d; }
html[data-skin="mercado"] .badge:is(.qr_required, .connecting, .queued, .sending, .warn, .pending, .trial, .paused) { color: #b45309; }
html[data-skin="mercado"] .badge:is(.error, .failed, .suspended, .cancelled, .unpaid) { color: #b91c1c; }
html[data-skin="mercado"] .badge:is(.info, .inbound, .new) { color: #0369a1; }
html[data-skin="mercado"] .badge:is(.disconnected, .logged_out, .inactive, .expired, .disabled) { color: #52525b; }
html[data-skin="mercado"] .badge.teal { color: var(--mx-ink); }
html[data-skin="mercado"][data-theme="dark"] .badge { color: #d4d4d8; filter: none; }
html[data-skin="mercado"][data-theme="dark"] .badge:is(.connected, .active, .sent, .delivered, .read, .ok, .success, .paid, .enabled, .done, .resolved) { color: #4ade80; }
html[data-skin="mercado"][data-theme="dark"] .badge:is(.qr_required, .connecting, .queued, .sending, .warn, .pending, .trial, .paused) { color: #fbbf24; }
html[data-skin="mercado"][data-theme="dark"] .badge:is(.error, .failed, .suspended, .cancelled, .unpaid) { color: #f87171; }
html[data-skin="mercado"][data-theme="dark"] .badge:is(.info, .inbound, .new) { color: #38bdf8; }

html[data-skin="mercado"] .alert { border-radius: 16px; box-shadow: var(--mx-lg-sh2); }
html[data-skin="mercado"] .alert.info { background: var(--mx-soft); color: var(--mx-ink); border-color: transparent; font-weight: 600; }
html[data-skin="mercado"] .notice { border-radius: 16px; border-style: solid; border-color: var(--mx-lg-b); color: var(--mx-muted); }
html[data-skin="mercado"] .empty svg { background: var(--mx-lg-hi), var(--mx-chip); border: 1px solid var(--mx-chip-b); border-radius: 50%; color: var(--mx-faint); }
html[data-skin="mercado"] .meter { background: rgba(23, 23, 23, .07); border-radius: 99px; }
html[data-skin="mercado"][data-theme="dark"] .meter { background: rgba(255, 255, 255, .08); }
html[data-skin="mercado"] .meter > i:not(.warn):not(.over) { background: var(--mx-green); }
html[data-skin="mercado"] .avatar { background: linear-gradient(135deg, #2c2e55, #1f203c); color: #fff; }

/* شريط تابات الشغل (الادمن) */
html[data-skin="mercado"] .ws-tab[data-active="true"] { color: var(--mx-ink); }
html[data-skin="mercado"] .ws-indicator { background: var(--mx-ink) !important; }

/* =============================================================================
   النوافذ والقوايم
   ============================================================================= */
html[data-skin="mercado"] :is(dialog, .menu > div, .dh-rp, .fc-tip) { background: var(--mx-lg-hi), var(--mx-dlg-bg); border: 1px solid var(--mx-lg-b); box-shadow: var(--mx-sh-pop);
  -webkit-backdrop-filter: blur(28px) saturate(1.6); backdrop-filter: blur(28px) saturate(1.6); color: var(--mx-text); }
html[data-skin="mercado"] dialog { border-radius: 18px; }
html[data-skin="mercado"] :is(.menu > div, .dh-rp) { border-radius: 20px; }
html[data-skin="mercado"] dialog::backdrop { background: rgba(9, 9, 11, .45); -webkit-backdrop-filter: none; backdrop-filter: none; }
html[data-skin="mercado"] .fd-scrim { background: rgba(9, 9, 11, .45); font-family: var(--font); }
html[data-skin="mercado"] .fd-box { background: var(--mx-lg-hi), var(--mx-dlg-bg); color: var(--mx-text); border: 1px solid var(--mx-lg-b); border-radius: 18px; padding: 18px 20px 16px;
  box-shadow: var(--mx-sh-pop); -webkit-backdrop-filter: blur(28px) saturate(1.6); backdrop-filter: blur(28px) saturate(1.6); }
html[data-skin="mercado"] .fd-ic { background: var(--mx-soft); color: var(--mx-ink); border-radius: 50%; }
html[data-skin="mercado"] .fd-t { font-size: 18px; }
html[data-skin="mercado"] .fd-m { color: var(--mx-soft-t); }
html[data-skin="mercado"] .fd-a button { border-radius: 14px; font-family: var(--font); }
html[data-skin="mercado"] .fd-ok { background: linear-gradient(180deg, #1ad6a2, #01c38e 55%, #00a97b); color: #1f203c; border: 1px solid rgba(0, 135, 95, .55);
  box-shadow: 0 8px 18px -8px rgba(1, 195, 142, .6), inset 0 1px 0 rgba(255, 255, 255, .45); }
html[data-skin="mercado"] .fd-no { background: var(--mx-lg-hi), var(--mx-lg-c); color: var(--mx-text); border: 1px solid var(--mx-lg-b); box-shadow: var(--mx-lg-sh2); }
html[data-skin="mercado"] .fd-no:hover { background: var(--mx-lg-hi), var(--mx-hover); }

/* =============================================================================
   صندوق المتابعة
   ============================================================================= */
html[data-skin="mercado"] .ib:not([data-theme="dark"]) {
  --ib-brand: #01c38e; --ib-brand-d: #00875f; --ib-brand-soft: #e6f9f3; --ib-active: rgba(1, 195, 142, .08);
  --ib-ink: #171717; --ib-ink2: #3a3a3c; --ib-muted: #777777; --ib-faint: #8e8e93; --ib-line: rgba(23, 23, 23, .06);
  --ib-in: #ffffff; --ib-out: #e6f9f3; --ib-bub-sh: 0 1px 2px rgba(20, 25, 40, .04);
  --ibg: var(--mx-lg-hi), rgba(255, 255, 255, .58); --ibg-strong: var(--mx-lg-hi), rgba(255, 255, 255, .92); --ibg-brd: rgba(255, 255, 255, .8);
  --ibg-edge: inset 0 1px 0 rgba(255, 255, 255, .9); --ibg-drop: 0 24px 60px rgba(20, 25, 40, .14);
  --ib-soft: rgba(255, 255, 255, .6); --ib-hover: rgba(255, 255, 255, .6); --ib-chip: rgba(255, 255, 255, .7); --ib-input: rgba(255, 255, 255, .75);
  background: radial-gradient(520px 420px at 106% -8%, rgba(1, 195, 142, .15), transparent 70%), radial-gradient(420px 360px at -14% 58%, rgba(1, 195, 142, .09), transparent 70%),
    linear-gradient(180deg, #f8f8fa, #f1f1f4);
}
html[data-skin="mercado"] .ib[data-theme="dark"] {
  --ib-brand: #01c38e; --ib-brand-d: #2fd9a6; --ib-brand-soft: rgba(1, 195, 142, .14); --ib-active: rgba(1, 195, 142, .14);
  --ib-ink: #f4f4f5; --ib-ink2: #d4d4d8; --ib-muted: #9b9ba4; --ib-faint: #7c7c85; --ib-line: rgba(255, 255, 255, .07);
  --ib-in: #1f1f23; --ib-out: #123b30; --ib-bub-sh: 0 1px 2px rgba(0, 0, 0, .4);
  --ibg: var(--mx-lg-hi), rgba(24, 24, 27, .7); --ibg-strong: var(--mx-lg-hi), rgba(30, 30, 35, .95); --ibg-brd: rgba(255, 255, 255, .08);
  --ibg-edge: inset 0 1px 0 rgba(255, 255, 255, .06); --ibg-drop: 0 24px 60px rgba(0, 0, 0, .6);
  --ib-soft: rgba(255, 255, 255, .05); --ib-hover: rgba(255, 255, 255, .06); --ib-chip: rgba(255, 255, 255, .06); --ib-input: rgba(255, 255, 255, .05);
  background: radial-gradient(520px 420px at 106% -8%, rgba(1, 195, 142, .12), transparent 70%), #0f0f11;
}
html[data-skin="mercado"] .ib { font-family: var(--font); }
/* الحيطة: لون هادي من غير رسومات واتساب (زي محادثة Mercado) */
html[data-skin="mercado"] .ib .ib-thread { background-image: none; background-color: rgba(255, 255, 255, .35); }
html[data-skin="mercado"] .ib[data-theme="dark"] .ib-thread { background-image: none; background-color: rgba(0, 0, 0, .18); }
html[data-skin="mercado"] .ib .ib-top h1 { font-size: 22px; font-weight: 800; }
html[data-skin="mercado"] .ib .ib-item { margin: 2px 8px; border-radius: 14px; }
html[data-skin="mercado"] .ib .ib-item:hover { background: var(--ib-hover); }
html[data-skin="mercado"] .ib .ib-item.on { background: var(--mx-lg-hi), var(--ib-active); box-shadow: var(--mx-on-sh); }
html[data-skin="mercado"] .ib .ib-view { border-radius: 999px; border: 1px solid var(--ibg-brd); box-shadow: var(--mx-lg-sh2); background: var(--mx-lg-hi), var(--ib-chip); }
html[data-skin="mercado"] .ib .ib-view.on { background: var(--mx-ink) !important; color: #fff; border-color: var(--mx-ink); box-shadow: 0 6px 14px -8px rgba(1, 195, 142, .6); }
html[data-skin="mercado"] .ib .ib-view.on b { background: rgba(255, 255, 255, .25); color: #fff; }
html[data-skin="mercado"] .ib .ib-search input { border-radius: 14px; height: 42px; }
html[data-skin="mercado"] .ib .ib-search input:focus { box-shadow: 0 0 0 3px var(--ib-brand-soft); }
html[data-skin="mercado"] .ib .ib-head { min-height: 64px; }
/* الفقاعات: مستديرة من غير ذيل، والوارد بحد خفيف (زي Mercado) */
html[data-skin="mercado"] .ib .ib-row .ib-bub { border-radius: 14px; padding: 8px 12px; border: 1px solid var(--ib-line); box-shadow: var(--ib-bub-sh); }
html[data-skin="mercado"] .ib .ib-row.in .ib-bub, html[data-skin="mercado"] .ib .ib-row.in.first .ib-bub { border-radius: 14px; border-end-end-radius: 4px; }
html[data-skin="mercado"] .ib .ib-row.out .ib-bub, html[data-skin="mercado"] .ib .ib-row.out.first .ib-bub { border-radius: 14px; border-end-start-radius: 4px; border-color: rgba(1, 195, 142, .28); }
html[data-skin="mercado"] .ib .ib-row.first .ib-bub::before { display: none; }
html[data-skin="mercado"] .ib .ib-day { border-radius: 999px; }
/* شريط الكتابة */
html[data-skin="mercado"] .ib .ib-box { border-radius: 16px; }
html[data-skin="mercado"] .ib .ib-box:focus-within { border-color: var(--mx-focus); box-shadow: 0 0 0 3px var(--ib-brand-soft); }
/* خانة الرسالة جوه الصندوق: الاطار بيبقى على الصندوق بس — من غير اطار تاني جواه */
html[data-skin="mercado"] .ib .ib-box :is(textarea, input):focus-visible { outline: none; }
html[data-skin="mercado"] .ib .ib-send { border-radius: 14px; background: linear-gradient(180deg, #1ad6a2, #01c38e 55%, #00a97b); color: #1f203c; border: 1px solid rgba(0, 135, 95, .55);
  box-shadow: 0 8px 18px -8px rgba(1, 195, 142, .6), inset 0 1px 0 rgba(255, 255, 255, .45); }
html[data-skin="mercado"] .ib .ib-toolsbtn { border-radius: 14px; }
/* الصفحة: الصندوق كارت عايم جنب القائمة وتحت الشريط */
html[data-skin="mercado"] body.inbox-page .content { height: calc(100vh - var(--mx-top-h)); height: calc(100dvh - var(--mx-top-h)); }
@media (min-width: 821px) {
  html[data-skin="mercado"] body.inbox-page:not(.embed) .content { padding: 12px; padding-inline-start: 0; }
  html[data-skin="mercado"] body.inbox-page:not(.embed) .ib { border-radius: 24px; overflow: hidden; border: 1px solid var(--mx-lg-b); box-shadow: var(--mx-lg-sh); }
}
@media (max-width: 820px) {
  html[data-skin="mercado"] body.inbox-page .content { height: calc(var(--ib-vh, 100dvh) - var(--mx-top-h)); }
  html[data-skin="mercado"] body.inbox-page.kb-open .content { height: var(--ib-vh, 100dvh); }
  html[data-skin="mercado"] body.inbox-page.kb-open .mx-top { display: none !important; }
  html[data-skin="mercado"] body.inbox-page.kb-open.shell { padding-top: 0; }
}
html[data-skin="mercado"] body.embed.inbox-page .content { height: 100vh; height: var(--ib-vh, 100dvh); }

/* =============================================================================
   صفحات الدخول والتسجيل
   ============================================================================= */
html[data-skin="mercado"] .auth { font-family: var(--font); color: #171717; background: #fff; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
html[data-skin="mercado"] .auth-brand { margin: 0; border-radius: 0; border: 0; box-shadow: none; padding: 48px clamp(24px, 5vw, 64px) 22px;
  background: radial-gradient(560px 560px at 100% -10%, rgba(1, 195, 142, .32), transparent 65%), radial-gradient(420px 420px at -10% 110%, rgba(0, 0, 0, .35), transparent 65%),
    linear-gradient(160deg, #2c2e55 0%, #1f203c 30%, #14152a 58%, #0b0c18 82%, #05060c 100%); }
html[data-skin="mercado"] .auth-brand::before { opacity: .35; }
html[data-skin="mercado"] .auth-brand .chip, html[data-skin="mercado"] .auth-brand li span { background: rgba(255, 255, 255, .09); border: 1px solid rgba(255, 255, 255, .18); border-radius: 12px; box-shadow: none; }
html[data-skin="mercado"] .auth-brand li span { color: #01c38e; }
html[data-skin="mercado"] .auth-brand h1 { font-family: var(--font); font-size: 34px; }
html[data-skin="mercado"] .auth-brand .foot { font: 400 11.5px "Lato", sans-serif; letter-spacing: 1.5px; opacity: .5; }
html[data-skin="mercado"] .auth-form { background: #fff; padding: 26px clamp(20px, 6vw, 80px); }
html[data-skin="mercado"] .auth-form .box { max-width: 420px; padding: 24px 0; background: none; border: 0; border-radius: 0; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none;
  animation: mx-lift .7s cubic-bezier(.16, 1, .3, 1) both; }
@keyframes mx-lift { from { opacity: 0; transform: translateY(14px); } }
html[data-skin="mercado"] .auth-form h2 { font-family: var(--font); font-size: 30px; font-weight: 800; }
html[data-skin="mercado"] .auth-form .sub { color: #777; }
html[data-skin="mercado"] .auth-field label { font-size: 13px; font-weight: 600; color: #171717; }
html[data-skin="mercado"] .auth-input input { height: 50px; border-radius: 16px; border: 1px solid rgba(23, 23, 23, .09); background: #fafafa; box-shadow: none; font-size: 14.5px; color: #171717; }
html[data-skin="mercado"] .auth-input input:focus { border-color: #2c2e55; box-shadow: 0 0 0 3px #e6f9f3; background: #fff; }
html[data-skin="mercado"] .auth-input input::placeholder { color: #a1a1aa; }
html[data-skin="mercado"] .auth-input svg.ico { color: #8e8e93; }
html[data-skin="mercado"] .auth-input:focus-within svg.ico { color: #00875f; }
html[data-skin="mercado"] .auth-btn { position: relative; overflow: hidden; height: 50px; margin-top: 22px; border-radius: 12px; font: 700 15px var(--font);
  background: linear-gradient(180deg, #1ad6a2, #01c38e 55%, #00a97b); border: 1px solid rgba(0, 135, 95, .55); color: #1f203c;
  box-shadow: 0 8px 18px -8px rgba(1, 195, 142, .6), inset 0 1px 0 rgba(255, 255, 255, .45); }
html[data-skin="mercado"] .auth-btn:hover { background: linear-gradient(180deg, #1ad6a2, #01c38e 55%, #00a97b); filter: brightness(1.06); transform: translateY(-1px); }
html[data-skin="mercado"] .auth-btn::after { content: ""; position: absolute; top: 0; bottom: 0; left: 0; width: 28%; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .34), transparent);
  animation: mx-sheen 3.2s ease-in-out infinite; pointer-events: none; }
@keyframes mx-sheen { 0% { transform: translateX(-160%) skewX(-20deg); } 55%, 100% { transform: translateX(420%) skewX(-20deg); } }
html[data-skin="mercado"] .auth-links a { color: #00875f; }
html[data-skin="mercado"] .auth-alert { border-radius: 10px; box-shadow: none; font-weight: 600; font-size: 13px; }
html[data-skin="mercado"] .auth-alert.err { background: #fee2e2; color: #b91c1c; }
html[data-skin="mercado"] .auth-alert.ok { background: #e6f9f3; color: #00875f; }
html[data-skin="mercado"] .auth-remember input { accent-color: #00875f; }
@media (max-width: 900px) {
  html[data-skin="mercado"] .auth { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  html[data-skin="mercado"] .auth-brand { display: flex; order: -1; padding: 58px 20px 24px; align-items: center; text-align: center; }
  html[data-skin="mercado"] .auth-brand :is(.top, ul, .foot) { display: none; }
  html[data-skin="mercado"] .auth-brand .mid { margin: 0; }
  html[data-skin="mercado"] .auth-brand .wordmark { width: 170px; margin: 0 auto 8px; }
  html[data-skin="mercado"] .auth-brand h1 { font-size: 16px; font-weight: 700; margin: 0; }
  html[data-skin="mercado"] .auth-brand h1 br { display: none; }
  html[data-skin="mercado"] .auth-form .mobile-logo { display: none; }
  html[data-skin="mercado"] .auth-form { padding: 20px; background: #fff; }
  html[data-skin="mercado"] .auth-form .box { padding: 4px 0 20px; }
  html[data-skin="mercado"] .auth-form h2 { font-size: 26px; }
}

/* =============================================================================
   حركة اقل لو الجهاز طالب كده
   ============================================================================= */
@media (prefers-reduced-motion: reduce) {
  html[data-skin="mercado"] :is(.stat, .nav-item .nav-ic, .mx-pop, .mx-top, .main-col, .tabbar, .sidebar) { transition: none !important; }
  html[data-skin="mercado"] :is(.stat:hover, .stat:active, .nav-item:hover .nav-ic) { transform: none; }
  html[data-skin="mercado"] .auth-btn::after, html[data-skin="mercado"] .nav-item.active::before, html[data-skin="mercado"] .auth-form .box { animation: none; }
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  html[data-skin="mercado"] :is(.mx-top, .sidebar, .mx-pop, .tabbar) { background: var(--mx-solid); }
}
