/* ============================================================
   Mersal Notifications — Admin design system
   Ported from the Mersal Notifications "Design Files" (themes + components),
   scoped under .mnotif-app so nothing leaks into wp-admin.
   3 themes: green (default) | cyan | light.
   ============================================================ */

/* Fonts are enqueued via wp_enqueue_style; icons are inline SVG (no icon font). */

/* ---------- Theme A: Mersal Green (default) ---------- */
.mnotif-app,
.mnotif-app[data-theme="green"] {
  --bg: #f6f4ef; --surface: #ffffff; --surface-2: #fafaf5; --surface-3: #f1efe8;
  --border: #e7e3d8; --border-strong: #d6d1c0;
  --fg-1: #18211c; --fg-2: #4f5a52; --fg-3: #8a9389; --fg-on-dark: #ffffff;
  --side-bg: #11201a; --side-bg-2: #182d24; --side-border: #25382e;
  --side-fg: #94a39a; --side-fg-strong: #d8e5dc; --side-hover: #1d3329;
  --side-active-bg: #0f7a4a; --side-active-fg: #ffffff; --side-group: #6f7b73;
  --accent: #0f7a4a; --accent-2: #0c6740; --accent-soft: #d4ebde; --accent-glow: rgba(15,122,74,.18);
  --highlight: #ea7c39; --highlight-bg: #fde9da;
  --success: #10b981; --success-bg: #d4ebde; --warning: #f59e0b; --warning-bg: #fef3c7;
  --danger: #e0524a; --danger-bg: #fde0dd; --info: #0ea5e9; --info-bg: #def1fb;
  --radius-sm: 8px; --radius-md: 10px; --radius-lg: 14px; --radius-xl: 20px;
  --shadow-sm: 0 1px 2px rgba(15,30,22,.06);
  --shadow-md: 0 2px 6px rgba(15,30,22,.06), 0 1px 2px rgba(15,30,22,.04);
  --shadow-lg: 0 10px 28px rgba(15,30,22,.10), 0 4px 8px rgba(15,30,22,.06);
  --font-display: "Plus Jakarta Sans", "Cairo", system-ui, sans-serif;
  --font-body: "Plus Jakarta Sans", "Cairo", system-ui, sans-serif;
  --font-arabic: "Cairo", "Plus Jakarta Sans", system-ui, sans-serif;
  --font-mono: ui-monospace, "SFMono-Regular", "Menlo", monospace;
}

/* ---------- Theme B: Cyan ---------- */
.mnotif-app[data-theme="cyan"] {
  --bg: #ffffff; --surface: #ffffff; --surface-2: #f8fafc; --surface-3: #f1f5f9;
  --border: #e2e8f0; --border-strong: #cbd5e1;
  --fg-1: #0f172a; --fg-2: #475569; --fg-3: #94a3b8;
  --side-bg: #0b1727; --side-bg-2: #122036; --side-border: #1e2c44;
  --side-fg: #8aa0bd; --side-fg-strong: #dbe5f1; --side-hover: #15243c;
  --side-active-bg: linear-gradient(135deg, #0891b2 0%, #155e75 100%); --side-active-fg: #fff; --side-group: #67809f;
  --accent: #0891b2; --accent-2: #0e7490; --accent-soft: #cffafe; --accent-glow: rgba(8,145,178,.20);
  --highlight: #ea7c39; --highlight-bg: #ffe7d4;
  --success: #10b981; --success-bg: #d1fae5; --warning: #f59e0b; --warning-bg: #fef3c7;
  --danger: #ef4444; --danger-bg: #fee2e2; --info: #06b6d4; --info-bg: #cffafe;
  --radius-sm: 8px; --radius-md: 12px; --radius-lg: 16px; --radius-xl: 24px;
  --shadow-sm: 0 1px 2px rgba(15,23,42,.06);
  --shadow-md: 0 1px 3px rgba(15,23,42,.06), 0 2px 8px rgba(15,23,42,.04);
  --shadow-lg: 0 16px 40px rgba(15,23,42,.10), 0 4px 10px rgba(15,23,42,.05);
  --font-display: "Inter", "Cairo", system-ui, sans-serif;
  --font-body: "Inter", "Cairo", system-ui, sans-serif;
  --font-arabic: "Cairo", "Inter", system-ui, sans-serif;
}

/* ---------- Theme C: Light ---------- */
.mnotif-app[data-theme="light"] {
  --bg: #ffffff; --surface: #ffffff; --surface-2: #fafaf9; --surface-3: #f5f5f4;
  --border: #ececea; --border-strong: #d4d4d0;
  --fg-1: #1a1a17; --fg-2: #6a6a64; --fg-3: #a3a39c;
  --side-bg: #fafaf9; --side-bg-2: #ffffff; --side-border: #ececea;
  --side-fg: #6a6a64; --side-fg-strong: #1a1a17; --side-hover: #f1f0ec;
  --side-active-bg: #1a1a17; --side-active-fg: #ffffff; --side-group: #a3a39c;
  --accent: #16835c; --accent-2: #0f6648; --accent-soft: #dff1e8; --accent-glow: rgba(22,131,92,.16);
  --highlight: #c87832; --highlight-bg: #f8e8d8;
  --success: #16835c; --success-bg: #dff1e8; --warning: #c87832; --warning-bg: #f8e8d8;
  --danger: #c1554f; --danger-bg: #f6dfdd; --info: #4880b8; --info-bg: #e0ebf5;
  --radius-sm: 6px; --radius-md: 8px; --radius-lg: 12px; --radius-xl: 16px;
  --shadow-sm: 0 0 0 1px rgba(0,0,0,.04);
  --shadow-md: 0 0 0 1px rgba(0,0,0,.05), 0 1px 2px rgba(0,0,0,.03);
  --shadow-lg: 0 0 0 1px rgba(0,0,0,.06), 0 12px 30px rgba(0,0,0,.05);
  --font-display: "Inter", "Cairo", system-ui, sans-serif;
  --font-body: "Inter", "Cairo", system-ui, sans-serif;
  --font-arabic: "Cairo", "Inter", system-ui, sans-serif;
}

/* ---------- Take over the wp-admin content area ---------- */
/*
 * Keep WordPress #wpcontent margin-left/right — core uses it to clear #adminmenu.
 * Zeroing margin here caused .mnotif-app to sit under the WP sidebar.
 */
body.mnotif-screen #wpcontent {
  padding: 0 !important;
  background: #1d2327;
}
/* Quiet Light (and other non-dark shells): match main background, not WP menu black */
body.mnotif-screen #wpcontent:has(.mnotif-app[data-theme="light"]:not([data-dark="true"])) {
  background: #ffffff;
}
body.mnotif-screen #wpcontent:has(.mnotif-app[data-theme="green"]:not([data-dark="true"])) {
  background: #f6f4ef;
}
body.mnotif-screen #wpcontent:has(.mnotif-app[data-theme="cyan"]:not([data-dark="true"])) {
  background: #ffffff;
}
body.mnotif-screen #wpbody,
body.mnotif-screen #wpbody-content {
  padding: 0 !important;
  margin: 0;
}
body.mnotif-screen #wpbody-content > .wrap { margin: 0; max-width: none; padding: 0; }
body.mnotif-screen #wpfooter { display: none; }
body.mnotif-screen .notice, body.mnotif-screen .update-nag, body.mnotif-screen #screen-meta-links { display: none !important; }
body.mnotif-screen .mnotif-app {
  margin: 0;
  border-radius: 0;
  width: 100%;
  max-width: 100%;
  position: relative;
  z-index: 1;
}
/* Folded WP menu (36px rail) — core still sets #wpcontent margin; ensure no overflow */
body.mnotif-screen.folded #wpcontent .mnotif-app,
body.mnotif-screen.auto-fold #wpcontent .mnotif-app {
  max-width: 100%;
}

.mnotif-app * { box-sizing: border-box; }
.mnotif-app {
  background: var(--bg);
  color: var(--fg-1);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  display: flex;
  align-items: stretch;
  height: calc(100vh - 32px);
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}
.mnotif-app .sidebar { width: var(--side-w, 240px); flex: 0 0 var(--side-w, 240px); }
.mnotif-app .main { flex: 1 1 auto; min-width: 0; width: auto; display: flex; flex-direction: column; min-height: 0; background: var(--bg); }
.mnotif-app[data-collapsed="true"] { --side-w: 64px; }
.mnotif-app[dir="rtl"] { font-family: var(--font-arabic); }

/* ---- Collapsed sidebar = clean icon rail ---- */
.mnotif-app[data-collapsed="true"] .side-brand .name,
.mnotif-app[data-collapsed="true"] .side-brand .ver,
.mnotif-app[data-collapsed="true"] .side-search,
.mnotif-app[data-collapsed="true"] .side-group,
.mnotif-app[data-collapsed="true"] .side-link > span:not(.mi),
.mnotif-app[data-collapsed="true"] .side-link .badge,
.mnotif-app[data-collapsed="true"] .side-link .pro,
.mnotif-app[data-collapsed="true"] .side-link .dot-hi,
.mnotif-app[data-collapsed="true"] .side-account .info,
.mnotif-app[data-collapsed="true"] .side-account .dot { display: none !important; }
.mnotif-app[data-collapsed="true"] .side-brand { justify-content: center; padding: 16px 0; }
.mnotif-app[data-collapsed="true"] .side-nav { padding: 8px 8px 16px; }
.mnotif-app[data-collapsed="true"] .side-link { justify-content: center; padding: 9px 0; }
.mnotif-app[data-collapsed="true"] .side-account { justify-content: center; padding: 8px 0; }
.mnotif-app[data-collapsed="true"] .side-foot { padding: 10px 8px; }

@media screen and (max-width: 900px) {
  .mnotif-app { flex-direction: column; height: auto; }
  .mnotif-app .sidebar { width: 100%; flex: 0 0 auto; }
}

.mnotif-app button { font: inherit; cursor: pointer; }
.mnotif-app input, .mnotif-app textarea, .mnotif-app select { font: inherit; color: inherit; }
.mnotif-app a { color: inherit; text-decoration: none; }
.mnotif-app ::selection { background: var(--accent-glow); }

/* Inline-SVG icon system (replaces the Material Symbols font) */
.mnotif-app .mi {
  font-size: 20px; line-height: 0;
  display: inline-flex; align-items: center; justify-content: center;
  width: 1em; height: 1em; flex: 0 0 auto;
  overflow: hidden; vertical-align: middle;
  visibility: hidden; /* hide the placeholder name until the SVG is injected */
}
.mnotif-app .mi.mnotif-iconized { visibility: visible; overflow: visible; }
.mnotif-app .mi > svg { width: 1em; height: 1em; display: block; }
.mnotif-app .mi.sm { font-size: 16px; }
.mnotif-app .mi.lg { font-size: 24px; }
.mnotif-app .mi.xl { font-size: 32px; }

.mnotif-app .scroll::-webkit-scrollbar { width: 10px; height: 10px; }
.mnotif-app .scroll::-webkit-scrollbar-thumb { background: rgba(0,0,0,.15); border-radius: 999px; border: 3px solid transparent; background-clip: padding-box; }
.mnotif-app .scroll::-webkit-scrollbar-thumb:hover { background-color: rgba(0,0,0,.25); background-clip: padding-box; }
.mnotif-app .scroll::-webkit-scrollbar-track { background: transparent; }

/* ---------- Sidebar ---------- */
.mnotif-app .sidebar {
  background: var(--side-bg); border-inline-end: 1px solid var(--side-border);
  color: var(--side-fg); display: flex; flex-direction: column; overflow: hidden; position: relative;
}
.mnotif-app .side-brand { padding: 18px 18px 14px; display: flex; align-items: center; gap: 10px; border-bottom: 1px solid var(--side-border); }
.mnotif-app .side-brand .logo {
  width: 32px; height: 32px; flex: 0 0 32px; border-radius: 9px; background: var(--accent);
  display: grid; place-items: center; color: #fff; font-weight: 800; font-family: var(--font-arabic); font-size: 17px;
  box-shadow: 0 0 0 1px rgba(255,255,255,.08) inset;
}
.mnotif-app .side-brand .logo img { width: 100%; height: 100%; object-fit: contain; display: block; }
.mnotif-app .side-brand .logo.mnotif-side-logo {
  background: transparent;
  box-shadow: none;
}
.mnotif-app .side-brand .name { display: flex; flex-direction: column; }
.mnotif-app .side-brand .name b { color: var(--side-fg-strong); font-weight: 700; font-size: 15px; }
.mnotif-app .side-brand .name span { color: var(--side-fg); font-size: 11px; letter-spacing: .04em; text-transform: uppercase; }
.mnotif-app .side-brand .ver { margin-inline-start: auto; font-size: 10px; color: var(--side-fg); padding: 3px 7px; border-radius: 999px; background: rgba(255,255,255,.05); border: 1px solid var(--side-border); }

.mnotif-app .side-search {
  margin: 12px 12px 4px;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 10px;
  box-sizing: border-box;
  background: var(--side-bg-2);
  border: 1px solid var(--side-border);
  border-radius: 10px;
}
.mnotif-app .side-search .mi {
  font-size: 16px;
  color: var(--side-fg);
  flex: 0 0 auto;
  align-self: center;
}
.mnotif-app .side-search input {
  flex: 1 1 auto;
  min-width: 0;
  height: 38px;
  line-height: 38px;
  padding: 0;
  margin: 0;
  background: transparent;
  border: 0;
  outline: 0;
  color: var(--side-fg-strong);
  font-size: 12.5px;
  box-sizing: border-box;
}
.mnotif-app .side-search input::placeholder { color: var(--side-fg); }
.mnotif-app .side-search kbd {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: center;
  min-height: 22px;
  padding: 3px 6px;
  line-height: 1;
  font-family: var(--font-mono);
  font-size: 10px;
  border-radius: 5px;
  background: rgba(255,255,255,.06);
  border: 1px solid var(--side-border);
  color: var(--side-fg);
  box-sizing: border-box;
}

.mnotif-app .side-nav { flex: 1; overflow-y: auto; padding: 8px 10px 16px; }
.mnotif-app .side-group { font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--side-group); padding: 16px 10px 6px; font-weight: 700; }
.mnotif-app .side-link {
  width: 100%; display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px;
  border: 0; background: transparent; color: var(--side-fg); text-align: start; font-size: 13px; font-weight: 500;
  margin: 1px 0; position: relative; transition: background .14s, color .14s; text-decoration: none;
}
.mnotif-app .side-link .mi { font-size: 18px; color: var(--side-fg); }
.mnotif-app .side-link:hover { background: var(--side-hover); color: var(--side-fg-strong); }
.mnotif-app .side-link:hover .mi { color: var(--side-fg-strong); }
.mnotif-app .side-link.active { background: var(--side-active-bg); color: var(--side-active-fg); font-weight: 600; }
.mnotif-app .side-link.active .mi { color: var(--side-active-fg); }
.mnotif-app .side-link .badge { margin-inline-start: auto; font-size: 10px; padding: 2px 6px; border-radius: 999px; background: rgba(255,255,255,.06); color: var(--side-fg-strong); font-weight: 600; }
.mnotif-app[data-theme="light"] .side-link .badge { background: var(--surface-3); color: var(--fg-2); }
.mnotif-app .side-link.active .badge { background: rgba(255,255,255,.18); color: #fff; }
.mnotif-app .side-link .pro { font-size: 9px; padding: 1px 5px; border-radius: 4px; background: linear-gradient(135deg, var(--highlight), #f0a76b); color: #fff; font-weight: 700; margin-inline-start: auto; letter-spacing: .04em; }
.mnotif-app .side-link .dot-hi { width: 8px; height: 8px; border-radius: 50%; background: var(--highlight); margin-inline-start: auto; box-shadow: 0 0 0 3px rgba(234,124,57,.2); }

.mnotif-app .side-foot { border-top: 1px solid var(--side-border); padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.mnotif-app a.side-account { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; background: var(--side-bg-2); border: 1px solid var(--side-border); text-decoration: none; color: inherit; cursor: pointer; transition: border-color .15s, background .15s; }
.mnotif-app a.side-account:hover { border-color: var(--side-border); background: var(--side-bg-2); }
.mnotif-app a.side-account:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.mnotif-app .side-account .av { width: 32px; height: 32px; flex: 0 0 32px; border-radius: 50%; background: linear-gradient(135deg, var(--accent), var(--accent-2)); display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 12px; }
.mnotif-app .side-account .info { display: flex; flex-direction: column; min-width: 0; }
.mnotif-app .side-account .info b { font-size: 12.5px; color: var(--side-fg-strong); }
.mnotif-app .side-account .info span { font-size: 10.5px; color: var(--side-fg); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mnotif-app .side-account .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--success); margin-inline-start: auto; box-shadow: 0 0 0 3px rgba(16,185,129,.18); }

/* ---------- Main + topbar ---------- */
.mnotif-app .topbar { height: 60px; flex: 0 0 60px; display: flex; align-items: center; gap: 12px; padding: 0 22px; background: var(--surface); border-bottom: 1px solid var(--border); position: relative; z-index: 5; }
.mnotif-app[data-theme="light"] .topbar { background: var(--bg); }
.mnotif-app .crumbs { display: flex; align-items: center; gap: 6px; color: var(--fg-2); font-size: 13px; min-width: 0; overflow: hidden; }
.mnotif-app .crumbs b { color: var(--fg-1); font-weight: 600; }
.mnotif-app .crumbs .sep { color: var(--fg-3); }
.mnotif-app .crumbs .mi { font-size: 16px; }
.mnotif-app .top-actions { display: flex; align-items: center; gap: 8px; margin-inline-start: auto; }

.mnotif-app .icon-btn { width: 36px; height: 36px; border-radius: 9px; display: grid; place-items: center; border: 1px solid var(--border); background: var(--surface); color: var(--fg-2); position: relative; }
.mnotif-app .icon-btn:hover { background: var(--surface-2); color: var(--fg-1); }
.mnotif-app .icon-btn .pip { position: absolute; top: 6px; inset-inline-end: 6px; width: 8px; height: 8px; border-radius: 50%; background: var(--danger); box-shadow: 0 0 0 2px var(--surface); }

.mnotif-app .lang-pill { display: flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); font-size: 12px; font-weight: 600; color: var(--fg-2); cursor: pointer; }
.mnotif-app .lang-pill .seg { padding: 2px 8px; border-radius: 999px; text-decoration: none; color: inherit; border: 0; background: transparent; font: inherit; font-size: inherit; font-weight: inherit; cursor: pointer; line-height: inherit; }
.mnotif-app .lang-pill .seg.on { background: var(--fg-1); color: #fff; }
.mnotif-app .lang-pill .seg:hover { color: var(--fg-1); }
.mnotif-app .lang-pill .seg:disabled { opacity: .55; cursor: wait; }

/* WordPress page dropdown inside our fields */
.mnotif-app .field select,
.mnotif-app .field .select { width: 100%; max-width: 100%; }
.mnotif-app .screen-reader-text {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ---------- Page wrapper (single scroll area) ---------- */
.mnotif-app .page {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.mnotif-app .page.scroll {
  flex: 1;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 24px 28px 32px;
  -webkit-overflow-scrolling: touch;
}
.mnotif-app .mnotif-settings-form { display: block; margin: 0; }
.mnotif-app .page-head { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 20px; }
.mnotif-app .page-head .titles { display: flex; flex-direction: column; gap: 4px; }
.mnotif-app .page-head h1 { margin: 0; font-size: 22px; font-weight: 700; color: var(--fg-1); letter-spacing: -.01em; font-family: var(--font-display); }
.mnotif-app .page-head p { margin: 0; color: var(--fg-2); font-size: 13.5px; }
.mnotif-app .page-head .actions { margin-inline-start: auto; display: flex; gap: 8px; flex-wrap: wrap; }

.mnotif-app .page-tabs {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 4px 8px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 22px;
  overflow: visible;
  max-height: none;
}
.mnotif-app .page-tabs a,
.mnotif-app .page-tabs button { padding: 10px 14px; border: 0; background: transparent; font-size: 13px; font-weight: 600; color: var(--fg-2); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; cursor: pointer; flex: 0 0 auto; }
.mnotif-app .page-tabs a.active,
.mnotif-app .page-tabs button.active { color: var(--fg-1); border-bottom-color: var(--accent); }
.mnotif-app .page-tabs a .mi,
.mnotif-app .page-tabs button .mi { font-size: 16px; }
.mnotif-app .page-tabs a:hover,
.mnotif-app .page-tabs button:hover { color: var(--fg-1); }

/* ---------- Card ---------- */
/* Full reset of the wp-admin core .card collision (max-width/min-width/margin/padding/position). */
.mnotif-app .card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); overflow: hidden; max-width: none !important; min-width: 0 !important; width: 100%; margin: 0; padding: 0; position: static; box-sizing: border-box; }
.mnotif-app .card-pad { max-width: none; min-width: 0; }
.mnotif-app .page-tabs a { text-decoration: none; color: inherit; }
/* PRO gating removed (keep styles minimal) */
.mnotif-app .card-head { padding: 16px 18px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 12px; }
.mnotif-app .card-head .ico { width: 32px; height: 32px; border-radius: 8px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; flex: 0 0 32px; }
.mnotif-app .card-head .ico.fill { background: var(--accent); color: #fff; }
.mnotif-app .card-head .t b { display: block; font-size: 14.5px; font-weight: 700; color: var(--fg-1); }
.mnotif-app .card-head .t span { display: block; font-size: 12.5px; color: var(--fg-2); margin-top: 2px; }
.mnotif-app .card-head .right { margin-inline-start: auto; }
.mnotif-app .card-body { padding: 18px; }
.mnotif-app .card-foot { padding: 12px 18px; border-top: 1px solid var(--border); background: var(--surface-2); font-size: 12.5px; color: var(--fg-2); display: flex; align-items: center; gap: 10px; }
.mnotif-app .card-foot.success { background: var(--accent-soft); color: var(--accent-2); }
.mnotif-app .card-foot.success .mi { color: var(--accent); }
.mnotif-app .card-pad { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); padding: 18px; }

/* ---------- Buttons ---------- */
.mnotif-app .btn { display: inline-flex; align-items: center; gap: 8px; padding: 5px 14px; border-radius: var(--radius-md); border: 1px solid var(--border); background: var(--surface); color: var(--fg-1); font-size: 13px; font-weight: 600; transition: background .14s, border-color .14s, color .14s, transform .06s; text-decoration: none; }
.mnotif-app .btn:hover { background: var(--surface-2); }
.mnotif-app .btn:active { transform: translateY(1px); }
.mnotif-app .btn .mi { font-size: 18px; }
.mnotif-app .btn.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.mnotif-app .btn.primary:hover { background: var(--accent-2); border-color: var(--accent-2); }
.mnotif-app .btn.highlight { background: var(--highlight); color: #fff; border-color: var(--highlight); }
.mnotif-app .btn.highlight:hover { filter: brightness(.95); }
.mnotif-app .btn.ghost { background: transparent; border-color: transparent; }
.mnotif-app .btn.ghost:hover { background: var(--surface-3); }

/* Topbar plans CTA */
.mnotif-app .mnotif-plans-cta { gap: 10px; }
.mnotif-app .mnotif-plans-cta .mnotif-plans-brand {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255,255,255,.16);
  border: 1px solid rgba(255,255,255,.24);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.mnotif-app .btn.danger { color: var(--danger); border-color: var(--danger); background: var(--danger-bg); }
.mnotif-app .btn.danger:hover { background: var(--danger); color: #fff; }
.mnotif-app .btn.sm { padding: 6px 10px; font-size: 12px; }
.mnotif-app .btn.lg { padding: 12px 18px; font-size: 14px; }
.mnotif-app .btn.block { width: 100%; justify-content: center; }
.mnotif-app .btn[disabled] { opacity: .55; cursor: not-allowed; }

/* ---------- Form ---------- */
.mnotif-app .field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.mnotif-app .field > label { font-size: 12.5px; font-weight: 600; color: var(--fg-1); display: flex; align-items: center; gap: 6px; }
.mnotif-app .field > label .opt { font-weight: 500; color: var(--fg-3); font-size: 11.5px; }
.mnotif-app .field .hint { font-size: 11.5px; color: var(--fg-2); }
.mnotif-app .field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 800px) { .mnotif-app .field-row { grid-template-columns: 1fr; } }

.mnotif-app .input, .mnotif-app .select, .mnotif-app .textarea {
  width: 100%; padding: 10px 12px; border-radius: var(--radius-md); border: 1px solid var(--border);
  background: var(--surface); color: var(--fg-1); font-size: 13.5px; outline: 0; transition: border-color .14s, box-shadow .14s;
}
.mnotif-app .input:focus, .mnotif-app .select:focus, .mnotif-app .textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.mnotif-app .input[disabled], .mnotif-app .select[disabled] { background: var(--surface-3); color: var(--fg-2); }
.mnotif-app .textarea { resize: vertical; min-height: 90px; font-family: var(--font-body); }
.mnotif-app .input-group { display: flex; align-items: stretch; border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; background: var(--surface); }
.mnotif-app .input-group:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.mnotif-app .input-group .prefix, .mnotif-app .input-group .suffix { padding: 0 12px; background: var(--surface-3); color: var(--fg-2); display: flex; align-items: center; font-size: 12.5px; font-weight: 600; border-inline-end: 1px solid var(--border); }
.mnotif-app .input-group .suffix { border-inline-end: 0; border-inline-start: 1px solid var(--border); }
.mnotif-app .input-group .input { border: 0; box-shadow: none; border-radius: 0; }

/* ---------- Toggle ---------- */
.mnotif-app .toggle { --w: 38px; --h: 22px; width: var(--w); height: var(--h); flex: 0 0 var(--w); border-radius: 999px; background: var(--border-strong); position: relative; transition: background .18s; border: 0; padding: 0; }
.mnotif-app .toggle::after { content: ""; position: absolute; top: 2px; inset-inline-start: 2px; width: calc(var(--h) - 4px); height: calc(var(--h) - 4px); background: #fff; border-radius: 50%; transition: transform .18s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.mnotif-app .toggle[data-on="true"] { background: var(--accent); }
.mnotif-app .toggle[data-on="true"]::after { transform: translateX(calc(var(--w) - var(--h))); }
.mnotif-app[dir="rtl"] .toggle[data-on="true"]::after { transform: translateX(calc(-1 * (var(--w) - var(--h)))); }
.mnotif-app .toggle-row { display: flex; align-items: flex-start; gap: 14px; padding: 14px; border-radius: var(--radius-md); border: 1px solid var(--border); background: var(--surface); }
.mnotif-app .toggle-row .text { flex: 1; min-width: 0; }
.mnotif-app .toggle-row .text b { display: block; font-size: 13.5px; font-weight: 600; color: var(--fg-1); }
.mnotif-app .toggle-row .text span { display: block; font-size: 12px; color: var(--fg-2); margin-top: 2px; }

/* ---------- Option list ---------- */
.mnotif-app .opt-list { display: flex; flex-direction: column; gap: 10px; }
.mnotif-app .opt { display: flex; align-items: center; gap: 12px; padding: 13px 14px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); cursor: pointer; transition: border-color .14s, background .14s; }
.mnotif-app .opt:hover { border-color: var(--border-strong); }
.mnotif-app .opt.active { border-color: var(--accent); background: var(--accent-soft); }
.mnotif-app .opt .radio { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--border-strong); flex: 0 0 18px; display: grid; place-items: center; transition: border-color .14s; }
.mnotif-app .opt.active .radio { border-color: var(--accent); }
.mnotif-app .opt.active .radio::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.mnotif-app .opt .ico { width: 32px; height: 32px; border-radius: 8px; background: var(--surface-3); color: var(--fg-2); display: grid; place-items: center; }
.mnotif-app .opt.active .ico { background: var(--accent); color: #fff; }
.mnotif-app .opt .label { flex: 1; min-width: 0; }
.mnotif-app .opt .label b { display: block; font-weight: 600; font-size: 13.5px; }
.mnotif-app .opt .label span { display: block; font-size: 12px; color: var(--fg-2); margin-top: 1px; }

/* ---------- Chips ---------- */
.mnotif-app .chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px; border-radius: 999px; background: var(--surface-3); color: var(--fg-2); font-size: 11.5px; font-weight: 600; }
.mnotif-app .chip .mi { font-size: 13px; }
.mnotif-app .chip.success { background: var(--success-bg); color: var(--accent-2); }
.mnotif-app .chip.warning { background: var(--warning-bg); color: #92400e; }
.mnotif-app .chip.danger { background: var(--danger-bg); color: var(--danger); }
.mnotif-app .chip.info { background: var(--info-bg); color: #075985; }
.mnotif-app .chip.brand { background: var(--accent-soft); color: var(--accent-2); }
.mnotif-app .chip.outline { background: transparent; border: 1px solid var(--border); color: var(--fg-2); }
.mnotif-app .dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--fg-3); }
.mnotif-app .dot.success { background: var(--success); }
.mnotif-app .dot.warning { background: var(--warning); }
.mnotif-app .dot.danger { background: var(--danger); }

/* ---------- Table ---------- */
.mnotif-app .table { width: 100%; border-collapse: collapse; font-size: 13px; }
.mnotif-app .table thead th { text-align: start; font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--fg-2); padding: 10px 14px; background: var(--surface-2); border-bottom: 1px solid var(--border); }
.mnotif-app .table tbody td { padding: 12px 14px; border-bottom: 1px solid var(--border); color: var(--fg-1); vertical-align: middle; }
.mnotif-app .table tbody tr:last-child td { border-bottom: 0; }
.mnotif-app .table tbody tr:hover td { background: var(--surface-2); }

/* ---------- Stat ---------- */
.mnotif-app .stat { display: flex; flex-direction: column; gap: 10px; padding: 18px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); position: relative; overflow: hidden; }
.mnotif-app .stat .top { display: flex; align-items: center; gap: 10px; }
.mnotif-app .stat .top .ico { width: 36px; height: 36px; border-radius: 9px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.mnotif-app .stat .top .ico.violet { background: #ede9fe; color: #7c3aed; }
.mnotif-app .stat .top .ico.amber { background: var(--warning-bg); color: #b45309; }
.mnotif-app .stat .top .ico.rose { background: #ffe4e6; color: #be123c; }
.mnotif-app .stat .top .ico.cyan { background: #cffafe; color: #0e7490; }
.mnotif-app .stat .top .ico.green { background: var(--success-bg); color: var(--accent-2); }
.mnotif-app .stat .top b { font-size: 12px; font-weight: 600; color: var(--fg-2); text-transform: uppercase; letter-spacing: .04em; }
.mnotif-app .stat .val { font-size: 26px; font-weight: 700; color: var(--fg-1); font-family: var(--font-display); letter-spacing: -.02em; }
.mnotif-app .stat .sub { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--fg-2); }
.mnotif-app .stat .sub .delta { display: inline-flex; align-items: center; gap: 2px; font-weight: 600; }
.mnotif-app .stat .sub .delta.up { color: var(--success); }
.mnotif-app .stat .sub .delta.down { color: var(--danger); }
.mnotif-app .stat .spark { position: absolute; inset-inline-end: 14px; bottom: 14px; opacity: .6; }

/* ---------- Layout helpers ---------- */
.mnotif-app .grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.mnotif-app .grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 16px; }
.mnotif-app .grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 16px; }
@media (max-width: 1100px) { .mnotif-app .grid-3, .mnotif-app .grid-4 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 700px) { .mnotif-app .grid-2, .mnotif-app .grid-3, .mnotif-app .grid-4 { grid-template-columns: 1fr; } }
.mnotif-app .stack { display: flex; flex-direction: column; gap: 16px; }
.mnotif-app .stack-sm { display: flex; flex-direction: column; gap: 8px; }
.mnotif-app .row { display: flex; align-items: center; gap: 10px; }
.mnotif-app .row-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.mnotif-app .divider { height: 1px; background: var(--border); margin: 14px 0; }
.mnotif-app .two-col { display: grid; grid-template-columns: 1.4fr 1fr; gap: 20px; }
@media (max-width: 980px) { .mnotif-app .two-col { grid-template-columns: 1fr; } }

/* ---------- Banner ---------- */
.mnotif-app .banner { display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; border-radius: var(--radius-md); background: var(--accent-soft); border: 1px solid color-mix(in oklab, var(--accent) 28%, transparent); color: var(--accent-2); font-size: 12.5px; }
.mnotif-app .banner.success { background: var(--success-bg); color: var(--accent-2); border-color: color-mix(in oklab, var(--success) 35%, transparent); }
.mnotif-app .banner.warning { background: var(--warning-bg); color: #92400e; }
.mnotif-app .banner.info { background: var(--info-bg); color: #075985; }
.mnotif-app .banner.danger { background: var(--danger-bg); color: var(--danger); }
.mnotif-app .banner .mi { flex: 0 0 auto; }

/* ---------- Code ---------- */
.mnotif-app .code { font-family: var(--font-mono); font-size: 12px; padding: 12px 14px; background: var(--surface-3); border-radius: var(--radius-md); color: var(--fg-1); overflow-x: auto; display: flex; align-items: center; gap: 10px; border: 1px solid var(--border); }
.mnotif-app .code .copy { margin-inline-start: auto; font-size: 11px; padding: 4px 8px; border-radius: 6px; background: var(--surface); border: 1px solid var(--border); color: var(--fg-2); }

/* ---------- Avatar ---------- */
.mnotif-app .av { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-3); color: var(--fg-2); font-weight: 700; font-size: 12px; border: 1px solid var(--border); }

/* ---------- Empty ---------- */
.mnotif-app .empty { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 50px 24px; text-align: center; gap: 10px; color: var(--fg-2); }
.mnotif-app .empty .ico { width: 56px; height: 56px; border-radius: 16px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; margin-bottom: 6px; }
.mnotif-app .empty b { color: var(--fg-1); font-size: 14.5px; font-weight: 700; }

/* ---------- Save bar (sticky at bottom of scroll, after content) ---------- */
.mnotif-app .savebar {
  position: sticky;
  bottom: 0;
  margin: 18px -28px 0;
  padding: 14px 28px calc(14px + env(safe-area-inset-bottom, 0px));
  background: var(--surface);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  z-index: 5;
  box-shadow: 0 -6px 24px rgba(0,0,0,.08);
  transition: transform .22s ease, opacity .22s ease;
}
.mnotif-app .savebar.is-idle { display: none !important; }
.mnotif-app .savebar.is-dirty,
.mnotif-app .savebar.is-saving,
.mnotif-app .savebar.is-saved { display: flex !important; }
.mnotif-app .savebar.is-saving { opacity: .88; pointer-events: none; }
.mnotif-app .page.scroll:has(.savebar) { padding-bottom: 0; }
.mnotif-app .page.scroll { scroll-padding-bottom: 88px; }
.mnotif-app .savebar .save-actions { display: flex; align-items: center; gap: 8px; margin-inline-start: auto; }
.mnotif-app .savebar .help { color: var(--fg-2); font-size: 12.5px; display: flex; align-items: center; gap: 6px; }
.mnotif-app .savebar .help.is-saved,
.mnotif-app .savebar .help.is-status.is-ok { color: var(--accent); }
.mnotif-app .savebar .help.is-status.is-warn { color: var(--fg-2); }
/* Save confirmation.
   It used to sit in the bottom corner, where the WordPress admin menu (and the
   collapsed-menu flyout, which paints above it) covered it — so a save looked
   like it had done nothing. It now lands dead centre of the viewport, above all
   WP chrome (#adminmenuwrap is z-index 9990, the admin bar 99999). */
.mnotif-save-toast {
  position: fixed; inset: 0; margin: auto; z-index: 160000;
  width: max-content; height: max-content; max-width: min(92vw, 520px);
  padding: 14px 24px; border-radius: 999px;
  background: var(--fg-1, #10241b); color: #fff;
  font-size: 14px; font-weight: 700; display: flex; align-items: center; gap: 9px;
  box-shadow: 0 18px 48px rgba(0, 0, 0, .3); opacity: 0; pointer-events: none;
  transform: scale(.94); transition: opacity .18s ease, transform .18s ease;
}
.mnotif-save-toast.is-visible { opacity: 1; transform: scale(1); }
@media (prefers-reduced-motion: reduce) {
  .mnotif-save-toast, .mnotif-save-toast.is-visible { transform: none; }
}

/* Shortcode grid */
.mnotif-app .sc-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 900px) { .mnotif-app .sc-grid { grid-template-columns: 1fr; } }
.mnotif-app .sc-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 16px; display: flex; flex-direction: column; gap: 10px; min-height: 120px; }
.mnotif-app .sc-card .sc-top { display: flex; align-items: flex-start; gap: 10px; }
.mnotif-app .sc-card .sc-ico { width: 34px; height: 34px; border-radius: 9px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; flex: 0 0 34px; }
.mnotif-app .sc-card b { font-size: 13.5px; color: var(--fg-1); }
.mnotif-app .sc-card span { font-size: 12px; color: var(--fg-2); }

/* Gateway picker rows */
.mnotif-app .gw-row { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); cursor: pointer; transition: border-color .14s, background .14s; position: relative; }
.mnotif-app .gw-row input[type="radio"] { position: absolute; opacity: 0; pointer-events: none; width: 0; height: 0; }
.mnotif-app .gw-row:hover { border-color: var(--border-strong); }
.mnotif-app .gw-row.is-on { border-color: var(--accent); background: var(--accent-soft); }
.mnotif-app .gw-row .gw-radio { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--border-strong); flex: 0 0 18px; display: grid; place-items: center; }
.mnotif-app .gw-row.is-on .gw-radio { border-color: var(--accent); }
.mnotif-app .gw-row.is-on .gw-radio::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.mnotif-app .gw-row .gw-meta { flex: 1; min-width: 0; }
.mnotif-app .gw-row .gw-meta b { display: block; font-size: 13.5px; }
.mnotif-app .gw-row .gw-meta span { display: block; font-size: 12px; color: var(--fg-2); margin-top: 2px; }

/* OTP code preview */
.mnotif-app .otp-settings-page { display: flex; flex-direction: column; gap: 16px; }
.mnotif-app .otp-grid { align-items: start; }
.mnotif-app .otp-card .card-head .ico.fill { background: var(--accent); color: #fff; }
.mnotif-app .otp-type-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
@media (max-width: 720px) { .mnotif-app .otp-type-grid { grid-template-columns: 1fr; } }
.mnotif-app .otp-type {
  display: flex; flex-direction: column; align-items: flex-start; gap: 4px;
  padding: 14px 12px; border: 1px solid var(--border); border-radius: var(--radius-md);
  background: var(--surface-2); cursor: pointer; text-align: start; transition: border-color .12s, background .12s;
}
.mnotif-app .otp-type input { position: absolute; opacity: 0; width: 0; height: 0; pointer-events: none; }
.mnotif-app .otp-type b { font-size: 15px; font-weight: 800; color: var(--fg-1); letter-spacing: .02em; }
.mnotif-app .otp-type span { font-size: 11.5px; color: var(--fg-3); }
.mnotif-app .otp-type.active { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 1px var(--accent); }
.mnotif-app .otp-range-field { margin-bottom: 4px; }
.mnotif-app .otp-range-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.mnotif-app .otp-range-top label { font-size: 13px; font-weight: 600; color: var(--fg-1); margin: 0; }
.mnotif-app .otp-range-out { font-size: 12.5px; font-weight: 700; color: var(--accent); white-space: nowrap; }
.mnotif-app .otp-range-input {
  width: 100%; height: 6px; margin: 0; accent-color: var(--info);
  cursor: pointer; border-radius: 999px;
}
.mnotif-app .otp-preview { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; padding: 14px; background: var(--surface-3); border-radius: var(--radius-md); border: 1px solid var(--border); }
.mnotif-app .otp-preview .digit { width: 44px; height: 50px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); display: grid; place-items: center; font-size: 20px; font-weight: 700; font-family: var(--font-mono); color: var(--fg-1); box-shadow: var(--shadow-sm); }
.mnotif-app .otp-rules { display: flex; flex-direction: column; gap: 10px; }
.mnotif-app .otp-rule-box { border: 1px solid var(--border); border-radius: var(--radius-md); padding: 2px 12px; background: var(--surface-2); }
.mnotif-app .otp-rule-box .toggle-row { margin: 0; }
.mnotif-app .otp-rule-box.is-disabled { opacity: .55; pointer-events: none; }

/* Auth page row card */
.mnotif-app .page-row-card .page-row-ico { width: 38px; height: 38px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; flex: 0 0 38px; }
.mnotif-app .page-active-banner { margin-top: 10px; padding: 8px 12px; background: var(--accent-soft); border: 1px solid color-mix(in oklab, var(--accent) 28%, transparent); border-radius: 10px; color: var(--accent-2); font-size: 12.5px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* Style preview column */
.mnotif-app .style-layout { display: grid; grid-template-columns: minmax(260px, 320px) 1fr; gap: 20px; align-items: start; }
.mnotif-app .style-layout-main { min-width: 0; display: flex; flex-direction: column; gap: 0; }
@media (max-width: 980px) { .mnotif-app .style-layout { grid-template-columns: 1fr; } }
.mnotif-app .phone-preview { width: 100%; max-width: 300px; margin: 0 auto; border: 1px solid var(--border); border-radius: 24px; background: var(--surface); box-shadow: var(--shadow-lg); overflow: hidden; }
.mnotif-app .phone-preview .ph-top { padding: 14px; text-align: center; border-bottom: 1px solid var(--border); }
.mnotif-app .phone-preview .ph-body { padding: 18px 16px 22px; display: flex; flex-direction: column; gap: 8px; }
.mnotif-app .phone-preview .ph-btn { padding: 10px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface-2); font-size: 12px; font-weight: 600; text-align: center; }

/* Quiet Light: light sidebar, dark active pill only */
.mnotif-app[data-theme="light"]:not([data-dark="true"]) .side-search { background: var(--surface); }
.mnotif-app[data-theme="light"]:not([data-dark="true"]) .side-brand .ver { background: var(--surface-3); color: var(--fg-2); border-color: var(--border); }
.mnotif-app[data-theme="light"]:not([data-dark="true"]) .side-link.active .badge { background: rgba(255,255,255,.2); color: #fff; }

/* ---------- Connection banner (dashboard hero) ---------- */
.mnotif-app .hero { margin-bottom: 20px; background: linear-gradient(115deg, var(--accent) 0%, var(--accent-2) 100%); color: #fff; border: 0; border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.mnotif-app .hero .inner { padding: 20px; display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.mnotif-app .hero .logo { width: 56px; height: 56px; border-radius: 14px; background: rgba(255,255,255,.15); display: grid; place-items: center; font-family: var(--font-arabic); font-size: 28px; font-weight: 800; }
.mnotif-app .hero .logo.mnotif-hero-logo {
  width: 52px;
  height: 52px;
  flex: 0 0 52px;
  max-width: 52px;
  padding: 4px;
  background: rgba(255,255,255,.12);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.mnotif-app .hero .logo.mnotif-hero-logo img {
  width: 100%;
  height: 100%;
  max-width: 44px;
  max-height: 44px;
  object-fit: contain;
  display: block;
}
.mnotif-app .hero .credit { text-align: center; padding: 0 16px; border-inline-start: 1px solid rgba(255,255,255,.18); }

/* ---------- Form switch (checkbox styled as the design toggle) ---------- */
.mnotif-app .mnotif-switch { display: inline-block; position: relative; width: 38px; height: 22px; flex: 0 0 38px; cursor: pointer; }
.mnotif-app .mnotif-switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.mnotif-app .mnotif-switch span { position: absolute; inset: 0; border-radius: 999px; background: var(--border-strong); transition: background .18s; }
.mnotif-app .mnotif-switch span::after { content: ""; position: absolute; top: 2px; inset-inline-start: 2px; width: 18px; height: 18px; background: #fff; border-radius: 50%; transition: transform .18s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.mnotif-app .mnotif-switch input:checked + span { background: var(--accent); }
.mnotif-app .mnotif-switch input:checked + span::after { transform: translateX(16px); }
.mnotif-app[dir="rtl"] .mnotif-switch input:checked + span::after { transform: translateX(-16px); }

/* ---------- Radio option list (no-JS friendly via :has) ---------- */
.mnotif-app .opt input[type="radio"] { position: absolute; opacity: 0; pointer-events: none; }
.mnotif-app .opt:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.mnotif-app .opt:has(input:checked) .radio { border-color: var(--accent); }
.mnotif-app .opt:has(input:checked) .radio::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.mnotif-app .opt:has(input:checked) .ico { background: var(--accent); color: #fff; }
.mnotif-app .opt.active { border-color: var(--accent); background: var(--accent-soft); }
.mnotif-app .opt.active .radio { border-color: var(--accent); }
.mnotif-app .opt.active .radio::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }

/* ---------- Color input ---------- */
.mnotif-app input[type="color"].color { width: 46px; height: 38px; padding: 2px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); cursor: pointer; }

/* ---------- Notice toast ---------- */
.mnotif-app .mnotif-saved { display: inline-flex; align-items: center; gap: 6px; color: var(--success); font-size: 12.5px; font-weight: 600; }

/* ---------- Modal (onboarding wizard) ---------- */
.mnotif-app .modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(10, 15, 12, .5);
  -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
  display: grid; place-items: center;
  z-index: 100001; padding: 20px;
  animation: mnotif-fadein .14s ease;
}
.mnotif-app .modal {
  background: var(--surface); color: var(--fg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  max-width: 480px; width: 100%;
  max-height: calc(100vh - 60px); overflow: auto;
  text-align: start;
  animation: mnotif-pop .18s cubic-bezier(.22, 1.2, .36, 1);
}
@keyframes mnotif-fadein { from { opacity: 0; } to { opacity: 1; } }
@keyframes mnotif-pop { from { transform: scale(.96); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.mnotif-app [hidden] { display: none !important; }

/* ============================================================
   Typography
   - Default: Tajawal
   - User option: data-font="tajawal|cairo|system"
   ============================================================ */
.mnotif-app[data-font="tajawal"],
.mnotif-app:not([data-font]) {
  --font-display: "Tajawal", "Cairo", system-ui, sans-serif;
  --font-body:    "Tajawal", "Cairo", system-ui, sans-serif;
  --font-arabic:  "Tajawal", "Cairo", system-ui, sans-serif;
}
.mnotif-app[data-font="cairo"] {
  --font-display: "Cairo", "Tajawal", system-ui, sans-serif;
  --font-body:    "Cairo", "Tajawal", system-ui, sans-serif;
  --font-arabic:  "Cairo", "Tajawal", system-ui, sans-serif;
}
.mnotif-app[data-font="system"] {
  --font-display: system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  --font-body:    system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  --font-arabic:  system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
}
.mnotif-app, .mnotif-app input, .mnotif-app textarea, .mnotif-app select, .mnotif-app button {
  font-family: var(--font-body);
}

/* ============================================================
   Dark mode for the admin (data-dark="true" on .mnotif-app).
   Overrides the surface/text/border palette; keeps the theme accent.
   ============================================================ */
.mnotif-app[data-dark="true"] {
  --bg:            #0f1311;
  --surface:       #171c19;
  --surface-2:     #1d2420;
  --surface-3:     #232b26;
  --border:        #2a332e;
  --border-strong: #3a443e;

  --fg-1: #eef2ef;
  --fg-2: #a9b4ad;
  --fg-3: #76817a;

  --side-bg:        #0b0f0d;
  --side-bg-2:      #141a16;
  --side-border:    #222a25;
  --side-fg:        #8c988f;
  --side-fg-strong: #dfe7e1;
  --side-hover:     #1a221d;
  --side-active-fg: #ffffff;
  --side-group:     #6c766f;

  --accent-soft:   color-mix(in oklab, var(--accent) 26%, #11150f);

  --shadow-sm: 0 1px 2px rgba(0,0,0,.4);
  --shadow-md: 0 2px 8px rgba(0,0,0,.45);
  --shadow-lg: 0 16px 40px rgba(0,0,0,.5);
}
/* In dark, the light theme's near-black sidebar-active needs a visible accent. */
.mnotif-app[data-dark="true"][data-theme="light"] { --side-active-bg: var(--accent); }
.mnotif-app[data-dark="true"] .topbar { background: var(--surface); }
.mnotif-app[data-dark="true"] .stat .top .ico.violet { background: #2a2350; color: #c4b5fd; }
.mnotif-app[data-dark="true"] .stat .top .ico.cyan   { background: #0e3a44; color: #67e8f9; }
.mnotif-app[data-dark="true"] .stat .top .ico.amber  { background: #3a2c10; color: #fcd34d; }
.mnotif-app[data-dark="true"] .stat .top .ico.rose   { background: #3a1620; color: #fda4af; }

/* Language pill — active segment readable in dark mode */
.mnotif-app[data-dark="true"] .lang-pill .seg.on {
  background: var(--accent);
  color: #fff;
}
.mnotif-app[data-dark="true"] .lang-pill .seg:not(.on) {
  color: var(--fg-2);
}

/* Dark mode + Quiet Light: keep sidebar on dark palette from [data-dark="true"] block above */
.mnotif-app[data-dark="true"][data-theme="light"] .side-link.active { --side-active-fg: #ffffff; }

/* Security page */
.mnotif-app .sec-page-grid { margin-bottom: 16px; }
.mnotif-app .sec-providers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
@media (max-width: 700px) { .mnotif-app .sec-providers { grid-template-columns: 1fr; } }
.mnotif-app .sec-prov {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius-md);
  background: var(--surface-2); cursor: pointer; transition: border-color .15s, background .15s;
}
.mnotif-app .sec-prov input { position: absolute; opacity: 0; width: 0; height: 0; pointer-events: none; }
.mnotif-app .sec-prov b { font-size: 13px; font-weight: 700; color: var(--fg-1); }
.mnotif-app .sec-prov span { font-size: 11.5px; color: var(--fg-3); }
.mnotif-app .sec-prov.active {
  border-color: var(--accent); background: var(--accent-soft);
  box-shadow: 0 0 0 1px var(--accent);
}
.mnotif-app .country-tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 10px; min-height: 28px; }
.mnotif-app .country-tag {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 8px 4px 10px; border-radius: 999px;
  background: var(--surface-3); border: 1px solid var(--border); font-size: 12.5px; color: var(--fg-1);
}
.mnotif-app .country-tag .cc { font-weight: 700; letter-spacing: .04em; }
.mnotif-app .country-tag-x {
  border: 0; background: transparent; color: var(--fg-3); cursor: pointer;
  font-size: 16px; line-height: 1; padding: 0 2px;
}
.mnotif-app .country-tag-x:hover { color: var(--danger); }
.mnotif-app .country-picker-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.mnotif-app .country-add-select { min-width: 200px; flex: 1; max-width: 320px; }

/* Message templates page — events list first in DOM → narrow column, then editor */
.mnotif-app .tmpl-layout {
  display: grid;
  grid-template-columns: minmax(200px, 252px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}
@media (max-width: 900px) {
  .mnotif-app .tmpl-layout { grid-template-columns: 1fr; }
}
.mnotif-app .tmpl-events { padding: 0; overflow: hidden; }
.mnotif-app .tmpl-events-head { padding: 14px 16px; border-bottom: 1px solid var(--border); font-size: 13px; color: var(--fg-2); }
.mnotif-app .tmpl-events-nav { display: flex; flex-direction: column; padding: 8px; gap: 4px; }
.mnotif-app .tmpl-event-link {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 10px 12px; border-radius: var(--radius-md); color: var(--fg-1); font-size: 13.5px;
  text-decoration: none; transition: background .12s;
}
.mnotif-app .tmpl-event-link:hover { background: var(--surface-3); }
.mnotif-app .tmpl-event-link.active { background: var(--accent-soft); color: var(--accent-2); font-weight: 600; }
.mnotif-app .tmpl-event-arrow { color: var(--accent); opacity: .9; }
.mnotif-app .tmpl-main { padding: 0; overflow: hidden; min-width: 0; }
.mnotif-app .tmpl-main-head { padding: 16px 18px; border-bottom: 1px solid var(--border); }
.mnotif-app .tmpl-main-head b { display: block; font-size: 15px; color: var(--fg-1); }
.mnotif-app .tmpl-main-head span { display: block; font-size: 12.5px; color: var(--fg-2); margin-top: 2px; }
.mnotif-app .tmpl-body {
  padding: 16px 18px 18px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(160px, 220px);
  grid-template-areas:
    "channels channels"
    "editor preview"
    "vars preview";
  gap: 18px;
  align-items: start;
}
@media (max-width: 800px) {
  .mnotif-app .tmpl-body {
    grid-template-columns: 1fr;
    grid-template-areas:
      "channels"
      "editor"
      "vars"
      "preview";
  }
}
.mnotif-app .tmpl-channels { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 0; grid-area: channels; }
.mnotif-app .tmpl-event-panels { grid-area: editor; min-width: 0; }
.mnotif-app .tmpl-channel {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface-2); color: var(--fg-2); font-size: 13px; cursor: pointer;
}
.mnotif-app .tmpl-channel .mi { font-size: 18px; }
.mnotif-app .tmpl-channel.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.mnotif-app .tmpl-panel.hidden { display: none !important; }
.mnotif-app .tmpl-textarea { min-height: 120px; font-size: 14px; line-height: 1.55; }
.mnotif-app .tmpl-vars { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 0; grid-area: vars; align-self: start; }
.mnotif-app .tmpl-var {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 5px 10px; border-radius: 999px; border: 1px dashed var(--border-strong);
  background: var(--surface-2); font-size: 12px; color: var(--fg-2); cursor: pointer;
}
.mnotif-app .tmpl-var:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.mnotif-app .tmpl-var .mi { font-size: 14px; }
.mnotif-app .tmpl-preview-wrap { grid-area: preview; align-self: start; min-width: 0; }
.mnotif-app[dir="rtl"] .tmpl-body {
  grid-template-areas:
    "channels channels"
    "preview editor"
    "preview vars";
}
.mnotif-app .tmpl-preview-label { font-size: 12px; color: var(--fg-3); margin-bottom: 8px; }
.mnotif-app .tmpl-phone {
  width: 100%; max-width: 200px; margin: 0 auto;
  border-radius: 28px; border: 2px solid var(--border-strong);
  background: linear-gradient(180deg, var(--surface-3), var(--surface));
  padding: 10px 8px 14px; box-shadow: var(--shadow-md);
}
.mnotif-app .tmpl-phone-notch { width: 44px; height: 5px; border-radius: 99px; background: var(--border-strong); margin: 0 auto 10px; }
.mnotif-app .tmpl-phone-screen { background: #e5ddd5; border-radius: 18px; padding: 14px 10px; min-height: 140px; }
.mnotif-app[data-dark="true"] .tmpl-phone-screen { background: #1f2c34; }
.mnotif-app .tmpl-bubble {
  max-width: 92%; margin-inline-start: auto;
  background: #dcf8c6; border-radius: 12px 12px 4px 12px;
  padding: 10px 12px; font-size: 12.5px; line-height: 1.45; color: #111;
  box-shadow: 0 1px 1px rgba(0,0,0,.06); white-space: pre-wrap; word-break: break-word;
}
.mnotif-app[dir="rtl"] .tmpl-bubble { border-radius: 12px 12px 12px 4px; margin-inline-start: 0; margin-inline-end: auto; }
.mnotif-app[data-dark="true"] .tmpl-bubble { background: #005c4b; color: #e9edef; }
.mnotif-app .page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---- Notifications: topbar bell dropdown ---- */
.mnotif-app .muted { color: var(--fg-3); font-weight: 500; font-size: 12px; margin-inline-start: 6px; }
.mnotif-app .icon-btn.danger { color: var(--danger); border-color: var(--border); }
.mnotif-app .icon-btn.danger:hover { background: var(--danger-bg); border-color: var(--danger); color: var(--danger); }

.mnotif-app .mnotif-notif { position: relative; display: inline-flex; }
.mnotif-app .notif-panel { position: absolute; top: calc(100% + 8px); inset-inline-end: 0; width: 340px; max-width: min(340px, 90vw); max-height: 460px; overflow-y: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); z-index: 50; padding: 6px; }
.mnotif-app .notif-panel[hidden] { display: none; }
.mnotif-app .notif-head { display: flex; align-items: center; justify-content: space-between; padding: 8px 10px 10px; border-bottom: 1px solid var(--border); margin-bottom: 4px; }
.mnotif-app .notif-head b { font-size: 14px; color: var(--fg-1); }
.mnotif-app .notif-head a { font-size: 12px; color: var(--accent); text-decoration: none; font-weight: 600; }
.mnotif-app .notif-readall { font-size: 12px; color: var(--accent); font-weight: 600; background: none; border: 0; padding: 0; cursor: pointer; }
.mnotif-app .notif-readall:hover { text-decoration: underline; }
.mnotif-app .notif-list { display: flex; flex-direction: column; gap: 2px; }

.mnotif-app .notif-item { display: flex; gap: 10px; padding: 10px; border-radius: var(--radius-md); align-items: flex-start; }
.mnotif-app .notif-item:hover { background: var(--surface-2); }
.mnotif-app .notif-item.is-new { background: var(--accent-soft); }
.mnotif-app .notif-ico { flex: 0 0 18px; width: 18px; height: 18px; margin-top: 1px; color: var(--info); }
.mnotif-app .notif-item.ok .notif-ico { color: var(--accent); }
.mnotif-app .notif-item.warn .notif-ico { color: var(--danger); }
.mnotif-app .notif-item.new .notif-ico { color: var(--accent-2); }
.mnotif-app .notif-body { min-width: 0; flex: 1; }
.mnotif-app .notif-title { font-size: 13px; font-weight: 600; color: var(--fg-1); line-height: 1.35; }
.mnotif-app .notif-text { font-size: 12px; color: var(--fg-2); margin-top: 2px; line-height: 1.45; word-break: break-word; }
.mnotif-app .notif-meta { font-size: 11px; color: var(--fg-3); margin-top: 4px; }
.mnotif-app .notif-meta a { color: var(--accent); text-decoration: none; font-weight: 600; }
.mnotif-app .notif-empty { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 28px 12px; color: var(--fg-3); font-size: 13px; }
.mnotif-app .notif-empty .mi { width: 26px; height: 26px; opacity: .6; }

/* ---- Notifications: manager page list ---- */
.mnotif-app .notif-manage-list { display: flex; flex-direction: column; }
.mnotif-app .notif-manage-list .notif-item { border-bottom: 1px solid var(--border); border-radius: 0; }
.mnotif-app .notif-manage-list .notif-item:last-child { border-bottom: 0; }
.mnotif-app .notif-manage-list form { flex: 0 0 auto; }


/* ==========================================================================
 * Compact settings density
 * --------------------------------------------------------------------------
 * The screens were laid out at roughly a marketing page's scale: 18px card
 * padding, 32px icon tiles, 22px headings, a card every 18px. A single
 * settings tab ran to several screens of scrolling for a dozen controls, and
 * a shop could not see a section and its options at the same time.
 *
 * This pass takes the vertical space back to about half without changing any
 * markup — every rule below overrides a base rule of the same name earlier in
 * this file. Font sizes drop by a point or two, not more: the aim is a denser
 * page, not a smaller one that has to be squinted at.
 * ========================================================================== */

.mnotif-app .page-head { margin-bottom: 12px; gap: 12px; }
.mnotif-app .page-head h1 { font-size: 17px; }
.mnotif-app .page-head p { font-size: 12px; }
.mnotif-app .page-head .titles { gap: 2px; }

.mnotif-app .card { margin-bottom: 8px !important; }
.mnotif-app .card-head { padding: 9px 11px; gap: 8px; }
.mnotif-app .card-head .ico { width: 24px; height: 24px; flex: 0 0 24px; border-radius: 7px; }
.mnotif-app .card-head .ico svg { width: 15px; height: 15px; }
.mnotif-app .card-head .t b { font-size: 13px; }
.mnotif-app .card-head .t span { font-size: 11.5px; margin-top: 1px; line-height: 1.5; }
.mnotif-app .card-body { padding: 10px 12px; }
.mnotif-app .card-foot { padding: 8px 12px; font-size: 11.5px; }
.mnotif-app .card-pad { padding: 12px; }

.mnotif-app .opt { padding: 6px 9px; gap: 8px; }
.mnotif-app .opt .ico { width: 22px; height: 22px; flex: 0 0 22px; border-radius: 6px; }
.mnotif-app .opt .ico svg { width: 13px; height: 13px; }
.mnotif-app .opt .label b { font-size: 12.5px; line-height: 1.35; }
.mnotif-app .opt .label span { font-size: 10.5px; line-height: 1.4; margin-top: 0; }
.mnotif-app .opt-list { gap: 5px; }
.mnotif-app .stack-sm { gap: 5px; }

.mnotif-app .gw-row { padding: 7px 10px; gap: 8px; }
.mnotif-app .gw-row .gw-meta b { font-size: 12.5px; }

.mnotif-app .field { margin-bottom: 10px; gap: 4px; }
.mnotif-app .field > label { font-size: 12px; }
.mnotif-app .field .hint { font-size: 11px; line-height: 1.5; }
.mnotif-app .input, .mnotif-app .select, .mnotif-app .textarea { padding: 7px 10px; font-size: 12.5px; }
.mnotif-app .textarea { min-height: 64px; line-height: 1.7; }
.mnotif-app .hint { font-size: 11px; line-height: 1.6; }
.mnotif-app .divider { margin: 10px 0; }
.mnotif-app .grid-2, .mnotif-app .grid-3, .mnotif-app .grid-4 { gap: 10px; }
.mnotif-app .banner { padding: 9px 11px; font-size: 11.5px; }

/* The switch is a touch target, so it shrinks less than everything else. */
.mnotif-app .motp-switch, .mnotif-app .mnotif-switch, .mnotif-app .mcamp-switch { width: 34px; height: 20px; flex-basis: 34px; }
.mnotif-app .motp-switch span::after, .mnotif-app .mnotif-switch span::after, .mnotif-app .mcamp-switch span::after { width: 16px; height: 16px; }
.mnotif-app .motp-switch input:checked + span::after,
.mnotif-app .mnotif-switch input:checked + span::after,
.mnotif-app .mcamp-switch input:checked + span::after { transform: translateX(14px); }
.mnotif-app[dir="rtl"] .motp-switch input:checked + span::after,
.mnotif-app[dir="rtl"] .mnotif-switch input:checked + span::after,
.mnotif-app[dir="rtl"] .mcamp-switch input:checked + span::after { transform: translateX(-14px); }

/* The shared message-list editor, matched to the same density. */
.ms-list { padding: 12px; margin-bottom: 10px; border-radius: 12px; }
.ms-list-head { gap: 9px; margin-bottom: 10px; }
.ms-list-ico { width: 26px; height: 26px; flex: 0 0 26px; border-radius: 7px; }
.ms-list-ico svg { width: 15px; height: 15px; }
.ms-list-t b { font-size: 13px; }
.ms-list-t span { font-size: 11.5px; line-height: 1.5; }
.ms-list-rows { gap: 7px; }
.ms-row { padding: 8px 9px; border-radius: 9px; }
.ms-row-top { margin-bottom: 6px; gap: 8px; }
.ms-row-n { font-size: 11px; padding: 2px 7px; }
.ms-row-ta { padding: 7px 9px; font-size: 12.5px; line-height: 1.7; }
.ms-icon { width: 24px; height: 24px; }
.ms-icon svg { width: 14px; height: 14px; }
.ms-list-foot { margin-top: 9px; }
.ms-btn { padding: 6px 11px; font-size: 12px; }
.ms-list-empty { padding: 14px; font-size: 12px; }
.ms-list-hint { font-size: 11px; }

/* Folded "advanced" sections — collapsed by default, so a settings tab shows
   the handful of controls a shop actually changes and keeps the rest one
   click away rather than three screens down. */
.mnotif-app .ms-fold { border: 1px solid var(--border); border-radius: var(--radius-md, 10px); background: var(--surface); margin-bottom: 8px; overflow: hidden; }
.mnotif-app .ms-fold > summary { list-style: none; cursor: pointer; padding: 9px 11px; display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 700; color: var(--fg-1); }
.mnotif-app .ms-fold > summary::-webkit-details-marker { display: none; }
.mnotif-app .ms-fold > summary .fold-sub { font-weight: 500; font-size: 11px; color: var(--fg-3); }
.mnotif-app .ms-fold > summary .fold-chev { margin-inline-start: auto; color: var(--fg-3); transition: transform .15s; }
.mnotif-app .ms-fold[open] > summary .fold-chev { transform: rotate(90deg); }
.mnotif-app[dir="rtl"] .ms-fold > summary .fold-chev { transform: rotate(180deg); }
.mnotif-app[dir="rtl"] .ms-fold[open] > summary .fold-chev { transform: rotate(90deg); }
.mnotif-app .ms-fold > .fold-body { padding: 0 11px 11px; }
.mnotif-app .ms-fold > .fold-body > .card,
.mnotif-app .ms-fold > .fold-body > .ms-list { margin-bottom: 0 !important; border: 0; padding-inline: 0; }
