﻿/* ==========================================================================
   CAPTAIN - responsive RTL design system
   Mobile first. Breakpoints: 860px (sidebar/bottom-nav switch), 560px (phones)
   ========================================================================== */

:root {
  --navy: #1B283E;
  --navy-2: #26365a;
  --navy-text: #0E2B6D;
  --blue: #2F6FFC;
  --blue-dark: #2459d1;
  --blue-50: #EAF1FF;
  --green: #01B574;
  --green-dark: #019a63;
  --green-50: #E3F8EF;
  --orange: #F18915;
  --orange-50: #FEF1E1;
  --purple: #6C4CC6;
  --purple-50: #EFEAFB;
  --red: #E5484D;
  --red-dark: #c93a3f;
  --red-50: #FDECEC;
  --text: #1c2740;
  --muted: #6b7a99;
  --border: #E4E9F2;
  --bg: #F5F7FB;
  --card: #ffffff;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 32, 64, .05), 0 4px 14px rgba(16, 32, 64, .05);
  --sidebar-w: 240px;
  --topbar-h: 62px;
  --bottom-h: 64px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: 'Cairo', 'Segoe UI', Tahoma, system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-tap-highlight-color: transparent;
}

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }
button { font-family: inherit; }
h1, h2, h3, h4 { margin: 0; color: var(--navy-text); line-height: 1.3; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.center { text-align: center; }
.hidden { display: none !important; }
.nowrap { white-space: nowrap; }
.ltr { direction: ltr; unicode-bidi: embed; }
.mt { margin-top: 16px; }
.mb { margin-bottom: 16px; }
.grow { flex: 1; }

/* ---------- icons ---------- */
.i { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.i.sm { width: 16px; height: 16px; }
.i.lg { width: 26px; height: 26px; }

/* ---------- app shell ---------- */
.app { min-height: 100vh; }

.sidebar {
  position: fixed; top: 0; bottom: 0; left: 0;
  width: var(--sidebar-w);
  background: var(--navy);
  color: #dbe4f5;
  display: flex; flex-direction: column;
  z-index: 60;
  padding: 18px 14px 14px;
  transition: transform .25s ease;
}

.brand { display: flex; align-items: center; gap: 12px; padding: 4px 6px 16px; border-bottom: 1px solid rgba(255,255,255,.12); margin-bottom: 14px; }
.brand img { width: 48px; height: 48px; border-radius: 10px; object-fit: contain; background: rgba(255,255,255,.06); }
.brand .names { min-width: 0; }
.brand .gym { font-weight: 800; color: #fff; font-size: 17px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand .tag { font-size: 12px; letter-spacing: 2px; color: #93a4c7; font-weight: 700; }

.nav { display: flex; flex-direction: column; gap: 4px; flex: 1; overflow-y: auto; }
.nav a {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 14px; border-radius: 10px;
  color: #dbe4f5; font-weight: 600; font-size: 15.5px;
  text-decoration: none;
  min-height: 44px;
}
.nav a:hover { background: rgba(255,255,255,.07); text-decoration: none; }
.nav a.active { background: #568BF5; color: #fff; }

.userbox { margin-top: 12px; border: 1px solid rgba(255,255,255,.18); border-radius: 12px; padding: 10px 12px; display: flex; align-items: center; gap: 10px; }
.userbox .avatar { width: 38px; height: 38px; border-radius: 50%; background: #3a4a6b; display: grid; place-items: center; color: #fff; }
.userbox .who { min-width: 0; flex: 1; }
.userbox .name { font-weight: 800; color: #fff; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.userbox .role { font-size: 12px; color: #9fb0d3; display: flex; align-items: center; gap: 6px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #29c56b; display: inline-block; }
.userbox form { margin: 0; }
.iconbtn { background: transparent; border: 0; color: #cfd9ee; cursor: pointer; padding: 8px; border-radius: 8px; display: grid; place-items: center; min-width: 40px; min-height: 40px; }
.iconbtn:hover { background: rgba(255,255,255,.1); }

.main { margin-left: var(--sidebar-w); min-height: 100vh; display: flex; flex-direction: column; }

.topbar {
  height: var(--topbar-h);
  display: flex; align-items: center; gap: 12px;
  padding: 0 24px;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 40;
}
.topbar .title { font-size: 19px; font-weight: 800; color: var(--navy-text); }
.topbar .subtitle { font-size: 12px; color: var(--muted); margin-top: -4px; }
.topbar .clock { font-size: 13px; color: var(--muted); font-weight: 600; white-space: nowrap; }
.menu-btn { display: none; background: transparent; border: 0; color: var(--navy-text); padding: 8px; border-radius: 10px; min-width: 44px; min-height: 44px; cursor: pointer; }

.trial-bar {
  background: linear-gradient(90deg, #fff4e0, #ffe9c7);
  color: #8a5300;
  padding: 8px 24px; font-weight: 700; font-size: 14px;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  border-bottom: 1px solid #f6d9a6;
}
.trial-bar.paid { background: linear-gradient(90deg, #e6f8ef, #d6f3e6); color: #0b6b45; border-color: #b7e6cf; }
.trial-bar.trial-bar-danger { background: linear-gradient(90deg, #ffeaea, #ffd0d0); color: #8b0000; border-color: #f5a0a0; animation: trial-pulse 2s ease-in-out infinite; }
@keyframes trial-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.82; } }
.trial-bar a { font-weight: 800; }

.content { padding: 24px; flex: 1; min-width: 0; max-width: 1500px; width: 100%; }

.scrim { display: none; }

.bottom-nav { display: none; }

/* ---------- page header / toolbar ---------- */
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 18px 0; }
.toolbar .search { flex: 1 1 260px; min-width: 0; }
.m-only { display: none; }
.tabs-scroll { gap: 8px; }
.more { position: relative; }
.more summary { list-style: none; cursor: pointer; min-width: 44px; justify-content: center; font-size: 20px; line-height: 1; }
.more summary::-webkit-details-marker { display: none; }
.more-panel { position: absolute; inset-inline-start: 0; top: calc(100% + 6px); z-index: 40; min-width: 190px; background: #fff; border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 8px 24px rgba(16, 32, 64, .18); padding: 6px; display: flex; flex-direction: column; }
.more-panel a, .more-panel button { display: flex; align-items: center; gap: 8px; padding: 12px; border: 0; background: transparent; color: var(--navy-text); font: inherit; font-weight: 700; text-align: start; border-radius: 8px; cursor: pointer; text-decoration: none; }
.more-panel a:hover, .more-panel button:hover { background: #f4f7fd; }
.btn.wa { background: #25D366; }
.sub-start { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin: 14px 0 4px; font-size: 14px; }
.modal-head > div { min-width: 0; }
.modal-head .small { margin-top: 2px; }
.plans-acc summary { cursor: pointer; font-weight: 800; font-size: 16px; list-style: none; }
.plans-acc summary::-webkit-details-marker { display: none; }
.plans-acc summary small { display: block; font-weight: 400; color: var(--muted); font-size: 12px; }
.plans-acc[open] summary { margin-bottom: 8px; }
.plan-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 0; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.plan-row-main { min-width: 0; overflow-wrap: anywhere; }
.plan-row-side { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
/* ---------- الحضور ---------- */
.att-search { display: flex; flex-direction: column; gap: 8px; }
.att-search-row { display: flex; gap: 8px; align-items: stretch; }
.att-search-row .input { flex: 1; min-width: 0; height: 46px; }
.att-cam { flex: none; width: 46px; border: 0; border-radius: 12px; background: #7F77DD; color: #fff; display: grid; place-items: center; cursor: pointer; }
.att-res { border-radius: 16px; padding: 14px; margin-bottom: 14px; border: 2px solid; }
.att-res.ok { background: #E3F6EC; border-color: #00B578; }
.att-res.warn { background: #FFF6E0; border-color: #EF9F27; }
.att-res.err { background: #FCEBEB; border-color: #E24B4A; }
.att-res-head { display: flex; gap: 12px; align-items: center; }
.att-res-av { width: 54px; height: 54px; border-radius: 50%; background: #fff; display: grid; place-items: center; font-weight: 800; font-size: 22px; flex: none; }
.att-res.ok .att-res-av { color: #0F6E56; } .att-res.warn .att-res-av { color: #854F0B; } .att-res.err .att-res-av { color: #A32D2D; }
.att-res-id { min-width: 0; }
.att-res-name { font-weight: 800; font-size: 18px; line-height: 1.3; overflow-wrap: anywhere; }
.att-res-sub { font-size: 13px; color: #4a566a; }
.att-res-main { font-weight: 800; font-size: 16px; margin-top: 10px; }
.att-res.ok .att-res-main { color: #0F6E56; } .att-res.warn .att-res-main { color: #854F0B; } .att-res.err .att-res-main { color: #A32D2D; }
.att-res-detail { font-size: 13px; color: #4a566a; line-height: 1.7; margin-top: 2px; }
.att-res-acts { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; margin-top: 12px; }
.att-res-acts .btn { justify-content: center; height: 42px; }
.att-pick { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.att-pick-id { min-width: 0; overflow-wrap: anywhere; }
.att-pick-id .n { font-weight: 800; }
.att-pick-act { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex: none; }
.att-strip { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.att-chip { background: #fff; border: 1px solid var(--border); border-radius: 999px; padding: 5px 12px; font-size: 12.5px; font-weight: 700; }
.att-days { display: flex; gap: 8px; margin: 4px 0 10px; flex-wrap: wrap; }
.att-day { padding: 7px 16px; border-radius: 999px; border: 1px solid var(--border); background: #fff; font-weight: 700; font-size: 13px; color: var(--navy-text); text-decoration: none; cursor: pointer; position: relative; display: inline-flex; align-items: center; gap: 6px; }
.att-day.on { background: var(--blue); border-color: var(--blue); color: #fff; }
.att-date input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer; }
.att-rec { display: flex; justify-content: space-between; align-items: center; gap: 8px; background: #fff; border-radius: 12px; padding: 10px 12px; margin-bottom: 8px; box-shadow: 0 1px 3px rgba(16, 32, 64, .06); }
.att-rec-id b { display: block; font-size: 15px; }
.att-rec-id span { font-size: 12px; color: var(--muted); }
.att-rec-time { font-weight: 700; font-size: 14px; white-space: nowrap; }
/* ---------- استيراد الأعضاء ---------- */
.im-wrap { max-width: 640px; }
.im-steps { display: flex; justify-content: space-between; margin: 4px 4px 16px; max-width: 640px; }
.im-step { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; color: #8a94a8; }
.im-step b { width: 30px; height: 30px; border-radius: 50%; background: #e6ebf3; display: grid; place-items: center; font-size: 14px; color: #6b7686; }
.im-step.on { color: #185FA5; } .im-step.on b { background: var(--blue); color: #fff; }
.im-step.ok b { background: #00B578; color: #fff; }
.im-cols { background: #EAF3FF; border-radius: 10px; padding: 10px 12px; font-size: 13px; line-height: 1.9; color: #0C447C; }
.im-file { display: flex; align-items: center; gap: 10px; border: 1px solid #cfe5d9; background: #EAF7F0; border-radius: 12px; padding: 10px; margin-top: 12px; }
.im-file-ico { font-size: 22px; }
.im-file-info { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.im-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.im-chip, .im-tag { border-radius: 999px; padding: 4px 10px; font-size: 12px; font-weight: 800; white-space: nowrap; }
.im-chip.b { background: #EAF3FF; color: #0C447C; } .im-chip.g, .im-tag.g { background: #E3F6EC; color: #0F6E56; }
.im-chip.a, .im-tag.a { background: #FAEEDA; color: #854F0B; } .im-chip.r, .im-tag.r { background: #FCEBEB; color: #A32D2D; }
.im-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; margin-bottom: 8px; }
.im-row.skip { background: #f1f3f7; }
.im-row-main { min-width: 0; overflow-wrap: anywhere; }
.im-note { color: #854F0B; margin-top: 2px; }
.im-skip { display: flex; justify-content: space-between; gap: 8px; padding: 8px 0; border-bottom: 1px solid #eef1f6; font-size: 14px; }
.im-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
@media (hover: hover) { .im-touch { display: none; } }
@media (hover: none) { .im-mouse { display: none; } }
.im-drop-main { margin: .5rem 0 .25rem; font-weight: 600; }
/* ---------- بطاقة العضو ---------- */
.mc-seg { display: grid; grid-template-columns: repeat(3, 1fr); background: #e6ebf3; border-radius: 12px; padding: 4px; margin-bottom: 6px; }
.mc-seg a { text-align: center; padding: 9px 4px; border-radius: 9px; font-weight: 700; font-size: 14px; color: #4a566a; text-decoration: none; }
.mc-seg a.on { background: #fff; color: var(--blue); box-shadow: 0 1px 3px rgba(16, 32, 64, .15); }
.mc-note { font-size: 12.5px; color: var(--muted); text-align: center; margin: 4px 0 14px; }
.mc-initial { background: #E6EEFB; color: #185FA5; display: grid; place-items: center; font-weight: 800; font-size: 20px; flex: none; }
body.card-sticker .member-card .mc-initial { display: none; }
.mc-chips { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin: 14px 0; }
.mc-chip { background: #EAF3FF; color: #0C447C; border-radius: 999px; padding: 5px 12px; font-size: 12px; font-weight: 700; }
.mc-bar { position: sticky; bottom: 0; z-index: 6; background: #fff; border-top: 1px solid var(--border); padding: 12px; margin: 16px -12px -16px; }
.mc-bar .btn { height: 48px; justify-content: center; font-size: 15px; }
.mc-bar-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.mc-bar .btn[disabled] { opacity: .6; cursor: progress; }
/* ---------- تفاصيل العضو ---------- */
.member-page { max-width: 820px; }
.md-back { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); text-decoration: none; font-weight: 700; margin-bottom: 8px; }
.md-head { display: flex; align-items: center; gap: 12px; padding: 14px; margin-bottom: 12px; }
.md-avatar { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; flex: none; }
.md-initial { background: #E6EEFB; color: #185FA5; display: grid; place-items: center; font-weight: 800; font-size: 26px; }
.md-id { min-width: 0; flex: 1; }
.md-name { margin: 0; font-size: 19px; line-height: 1.3; overflow-wrap: anywhere; }
.md-head .pill { margin-top: 6px; }
.md-acts { display: grid; grid-template-columns: repeat(auto-fit, minmax(76px, 1fr)); gap: 8px; margin-bottom: 12px; }
@media (max-width: 560px) { .md-acts:has(> :nth-child(5)) { grid-template-columns: repeat(3, 1fr); } }
.md-tile-form { display: contents; }
.md-tile { display: flex; flex-direction: column; align-items: center; justify-content: flex-start; background: #fff; border: 0; border-radius: 14px; padding: 12px 4px; text-align: center; font: inherit; font-weight: 800; font-size: 13px; color: var(--navy-text); text-decoration: none; box-shadow: 0 1px 3px rgba(16, 32, 64, .08); cursor: pointer; width: 100%; }
.md-tile i { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; margin: 0 auto 6px; color: #fff; }
.md-tile i.blue { background: #378ADD; } .md-tile i.wa { background: #25D366; } .md-tile i.green { background: #00B578; } .md-tile i.purple { background: #7F77DD; }
.md-sub { padding: 14px; margin-bottom: 12px; }
.md-sub-top { display: flex; justify-content: space-between; gap: 8px; font-size: 16px; }
.md-bar { height: 8px; border-radius: 4px; background: #e6ebf3; overflow: hidden; margin: 10px 0 6px; }
.md-bar b { display: block; height: 100%; background: #00B578; border-radius: 4px; }
.md-bar.orange b { background: #EF9F27; } .md-bar.red b { background: #E24B4A; }
.md-sub-acts { margin-top: 10px; display: flex; }
.md-sub-acts .btn { flex: 1; justify-content: center; height: 42px; }
.md-tabs { display: flex; gap: 8px; margin-bottom: 10px; }
.md-tabs button { flex: 1; padding: 9px; border-radius: 10px; background: #fff; border: 1px solid var(--border); font: inherit; font-weight: 700; font-size: 14px; color: var(--navy-text); cursor: pointer; }
.md-tabs button.on { background: var(--blue); border-color: var(--blue); color: #fff; }
.md-att-title { font-weight: 800; margin-bottom: 6px; }
.md-week { display: flex; gap: 6px; margin: 8px 0 12px; }
.md-dot { width: 32px; height: 32px; border-radius: 8px; background: #e6ebf3; color: var(--muted); display: grid; place-items: center; font-size: 12px; font-weight: 700; }
.md-dot.on { background: #00B578; color: #fff; }
.more-panel .danger { color: #A32D2D; }
.md-head .more { margin-inline-start: auto; }
/* ---------- نموذج إضافة/تعديل عضو ---------- */
.mf-card { background: #fff; border: 1px solid var(--border); border-radius: 14px; padding: 14px; margin-bottom: 12px; }
.mf-title { font-weight: 800; font-size: 16px; margin-bottom: 10px; color: var(--navy-text); }
.mf-title .sm, .mf-extra summary .sm { font-weight: 400; color: var(--muted); font-size: 13px; }
.mf-add { width: 100%; height: 44px; border: 1.5px dashed var(--blue); color: var(--blue); background: transparent; border-radius: 12px; font: inherit; font-weight: 800; cursor: pointer; }
.mf-sub { position: relative; border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; margin-bottom: 8px; }
.mf-sub b { font-size: 15px; }
.mf-sub .mf-m { font-size: 13px; color: var(--muted); margin-top: 2px; }
.mf-sub .mf-x { position: absolute; inset-inline-end: 8px; top: 6px; border: 0; background: transparent; color: #A32D2D; font-size: 18px; font-weight: 800; cursor: pointer; padding: 4px 8px; }
.mf-link { border: 0; background: transparent; color: var(--blue); font: inherit; font-weight: 700; font-size: 13px; padding: 6px 0 0; cursor: pointer; }
.mf-panel { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
.mf-grp { font-weight: 800; font-size: 13px; color: var(--muted); margin: 10px 0 6px; }
.mf-plans { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.mf-plan { border: 1px solid var(--border); background: #fff; border-radius: 12px; padding: 10px 6px; text-align: center; font: inherit; font-weight: 700; cursor: pointer; color: var(--navy-text); }
.mf-plan span { display: block; font-weight: 400; color: var(--muted); font-size: 13px; }
.mf-plan.on { border: 2px solid var(--blue); background: #EAF3FF; }
.mf-plan:disabled { opacity: .45; cursor: not-allowed; }
.mf-row { display: flex; gap: 8px; margin-top: 12px; }
.mf-row .btn { flex: 1; justify-content: center; }
.mf-new { width: 100%; margin-top: 14px; border: 1.5px dashed #7F77DD; color: #3C3489; background: #F5F4FF; border-radius: 12px; padding: 12px; font: inherit; font-weight: 800; cursor: pointer; }
.mf-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.mf-chip input { position: absolute; opacity: 0; pointer-events: none; }
.mf-chip span { display: inline-block; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--border); background: #fff; font-weight: 700; font-size: 14px; cursor: pointer; }
.mf-chip input:checked + span { border-color: var(--blue); background: #EAF3FF; color: var(--blue); }
.mf-chip input:focus-visible + span { outline: 2px solid var(--blue); outline-offset: 2px; }
.mf-total { margin-top: 12px; background: #EAF3FF; color: #0C447C; border-radius: 10px; padding: 10px 12px; line-height: 1.7; }
.mf-extra summary { cursor: pointer; font-weight: 800; font-size: 16px; list-style: none; }
.mf-extra summary::-webkit-details-marker { display: none; }
.mf-extra summary small { display: block; font-weight: 400; color: var(--muted); font-size: 12px; margin-top: 2px; }
.mf-extra[open] summary { margin-bottom: 12px; }
.mf-photo-btns { display: flex; gap: 8px; }
.mf-file { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.mf-bar { display: flex; gap: 8px; position: sticky; bottom: 0; z-index: 6; background: #fff; border-top: 1px solid var(--border); padding: 12px 0; margin-top: 8px; }
.mf-bar .btn { height: 48px; justify-content: center; font-size: 15px; }
.mf-bar .btn.green { flex: 2; }
.mf-bar .btn.ghost { flex: 1; }
.remind-bar { margin: 4px 0 12px; text-align: center; }
.remind-bar .btn { width: 100%; height: 46px; justify-content: center; font-size: 15px; }
.remind-bar .btn:disabled { opacity: .6; cursor: default; }
.remind-bar .small { margin-top: 4px; display: block; }
.mcard { background: #fff; border-radius: 12px; padding: 12px; margin-bottom: 8px; box-shadow: 0 1px 3px rgba(16, 32, 64, .08); }
.mcard-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.mcard-name { font-weight: 800; font-size: 16px; color: #0f1e3d; text-decoration: none; overflow-wrap: anywhere; }
.mcard-line { font-size: 13px; color: #4a566a; margin: 8px 0; }
.mcard-acts { display: flex; gap: 6px; margin-top: 8px; }
.mcard-acts .btn { flex: 1; justify-content: center; }
.toolbar .count { color: var(--navy-text); font-weight: 700; font-size: 14px; white-space: nowrap; }

/* ---------- stat cards ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px; }
.stat {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px 18px; display: flex; align-items: center; gap: 14px; box-shadow: var(--shadow);
  min-width: 0;
}
.stat .info { flex: 1; min-width: 0; }
.stat .label { font-weight: 800; font-size: 13.5px; color: #0f1e3d; }
.stat .value { font-size: 28px; font-weight: 800; line-height: 1.15; color: var(--blue); }
.stat .sub { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.stat .ico { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; flex: none; }
.c-blue { color: var(--blue); } .bg-blue { background: var(--blue-50); }
.c-green { color: var(--green); } .bg-green { background: var(--green-50); }
.c-orange { color: var(--orange); } .bg-orange { background: var(--orange-50); }
.c-purple { color: var(--purple); } .bg-purple { background: var(--purple-50); }
.c-red { color: var(--red); } .bg-red { background: var(--red-50); }
.stat .value.c-green { color: #06894f; } .stat .value.c-red { color: #c81e24; }

/* ---------- cards / panels ---------- */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.card-head h3 { font-size: 17px; }
.card-body { padding: 20px; }
.grid { display: grid; gap: 16px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 20px;
  border: 0; border-radius: 10px;
  background: var(--blue); color: #fff;
  font-weight: 800; font-size: 15px; cursor: pointer;
  text-decoration: none; white-space: nowrap;
  transition: filter .15s, transform .05s;
}
.btn:hover { filter: brightness(.94); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn.green { background: var(--green); }
.btn.purple { background: var(--purple); }
.btn.orange { background: var(--orange); }
.btn.red { background: var(--red); }
.btn.ghost { background: #fff; color: var(--navy-text); border: 1px solid var(--border); }
.btn.ghost:hover { background: #f4f7fd; }
.btn.light-blue { background: var(--blue-50); color: var(--blue); }
.btn.outline { background: #fff; color: var(--blue); border: 1px solid #B5D4F4; }
.btn.outline-red { background: #fff; color: #A32D2D; border: 1px solid #F7C1C1; }
.topbar .top-logo { width: 36px; height: 36px; border-radius: 9px; object-fit: cover; margin-inline: 4px 10px; flex: none; }
.trial-bar a { white-space: nowrap; }
.btn.sm { min-height: 34px; padding: 0 12px; font-size: 13px; border-radius: 8px; }
.btn.block { display: flex; width: 100%; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

/* ---------- forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; min-width: 0; }
.field > label { font-weight: 800; font-size: 13.5px; color: var(--navy-text); }
.field .req { color: var(--red); }
.input, select.input, textarea.input {
  width: 100%; min-height: 46px;
  border: 1px solid var(--border); border-radius: 10px;
  padding: 8px 14px; font: inherit; color: var(--text); background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
textarea.input { min-height: 90px; resize: vertical; }
.input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(47,111,252,.15); }
.input[readonly] { background: #f6f8fc; }
.field .hint { font-size: 12.5px; color: var(--muted); }
.field .err, .validation { color: #c81e24; font-size: 13px; font-weight: 700; }
.alert { border-radius: 10px; padding: 12px 14px; font-weight: 700; font-size: 14px; margin-bottom: 14px; }
.alert.err { background: var(--red-50); color: #b1181e; border: 1px solid #f6c3c5; }
.alert.ok { background: var(--green-50); color: #06724a; border: 1px solid #b9e8d3; }
.alert.warn { background: var(--orange-50); color: #8a5300; border: 1px solid #f6d9a6; }
.alert.info { background: var(--blue-50); color: #1b4fc2; border: 1px solid #c6d9ff; }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.check { display: flex; align-items: center; gap: 10px; font-weight: 600; cursor: pointer; }
.check input { width: 20px; height: 20px; }

/* ---------- tables ---------- */
.table-wrap { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.table-scroll { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { background: #F3F6FB; color: #0f1e3d; font-weight: 800; text-align: right; padding: 13px 14px; white-space: nowrap; border-bottom: 2px solid #dce5f0; font-size: 13.5px; }
.table td { padding: 13px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.th-cell { display: inline-flex; align-items: center; gap: 5px; }
.sort-btn { background: none; border: 0; cursor: pointer; padding: 0 1px; display: inline-flex; align-items: center; line-height: 1; border-radius: 3px; }
.sort-icon .sa-up, .sort-icon .sa-dn { fill-opacity: .25; transition: fill-opacity .15s; }
.sort-btn:hover .sa-up, .sort-btn:hover .sa-dn { fill-opacity: .55; }
.sort-btn[data-dir="asc"] .sa-up { fill-opacity: 1; fill: var(--blue); }
.sort-btn[data-dir="asc"] .sa-dn { fill-opacity: .2; }
.sort-btn[data-dir="desc"] .sa-dn { fill-opacity: 1; fill: var(--blue); }
.sort-btn[data-dir="desc"] .sa-up { fill-opacity: .2; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: #fafcff; }
.table .num { color: var(--muted); }
.table .actions { display: flex; gap: 6px; flex-wrap: wrap; }
.empty { padding: 42px 20px; text-align: center; color: var(--muted); font-weight: 600; }
.name-cell .n { font-weight: 800; color: #0f1e3d; }
.name-cell .s { font-size: 12.5px; color: var(--muted); }

/* ---------- pills ---------- */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 800; white-space: nowrap; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.plain::before { display: none; }
.pill.green { background: var(--green-50); color: #06894f; }
.pill.red { background: var(--red-50); color: #c81e24; }
.pill.orange { background: var(--orange-50); color: #c46d05; }
.pill.blue { background: var(--blue-50); color: var(--blue); }
.pill.purple { background: var(--purple-50); color: var(--purple); }
.pill.gray { background: #eef1f6; color: #5b6982; }

/* ---------- modal ---------- */
dialog.modal { border: 0; padding: 0; border-radius: 18px; width: min(640px, calc(100vw - 24px)); max-height: calc(100vh - 32px); overflow: auto; box-shadow: 0 24px 60px rgba(10,20,40,.35); color: var(--text); }
dialog.modal::backdrop { background: rgba(14, 24, 44, .55); backdrop-filter: blur(2px); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: #fff; z-index: 2; }
.modal-head h3 { font-size: 18px; }
.modal-body { padding: 20px; }

/* ---------- toasts ---------- */
.toasts { position: fixed; top: 16px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; width: min(420px, calc(100vw - 24px)); }
.toast { background: #10233f; color: #fff; padding: 12px 16px; border-radius: 12px; font-weight: 700; box-shadow: 0 8px 26px rgba(0,0,0,.25); animation: pop .2s ease; }
.toast.ok { background: #06784d; }
.toast.err { background: #b1181e; }
@keyframes pop { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

/* ---------- auth pages ---------- */
.auth-body { min-height: 100vh; display: grid; place-items: center; padding: 20px 14px; background: linear-gradient(160deg, #eef3ff 0%, #f8faff 45%, #eaf7f2 100%); }
.auth-card { width: min(440px, 100%); background: #fff; border-radius: 20px; box-shadow: 0 20px 60px rgba(20, 40, 90, .14); border: 1px solid var(--border); padding: 28px 24px; }
.auth-card .logo { display: grid; place-items: center; margin-bottom: 8px; }
.auth-card .logo img { width: 92px; height: 92px; object-fit: contain; }
.auth-card h1 { text-align: center; font-size: 22px; }
.auth-card .lead { text-align: center; color: var(--muted); margin: 6px 0 20px; font-weight: 600; }
.auth-foot { text-align: center; margin-top: 16px; color: var(--muted); font-weight: 600; font-size: 14px; }
.badge-trial { display: inline-block; background: var(--green-50); color: #06724a; border-radius: 999px; padding: 4px 14px; font-weight: 800; font-size: 13px; }

/* ---------- plan picker (activation screen) ---------- */
.plans { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.plan-option {
    position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px;
    border: 2px solid var(--border); border-radius: 12px; padding: 14px 8px 12px; cursor: pointer;
    text-align: center; transition: border-color .15s, background .15s;
}
.plan-option:hover { border-color: var(--blue-dark); }
.plan-option input { position: absolute; opacity: 0; width: 0; height: 0; }
.plan-option:has(input:checked) { border-color: var(--blue); background: var(--blue-50); }
.plan-name { font-weight: 800; font-size: 13.5px; color: var(--navy-text); }
.plan-price { font-weight: 800; font-size: 20px; color: var(--blue); }
.plan-price small { font-size: 12px; font-weight: 700; color: var(--muted); }
.plan-badge { background: var(--green-50); color: #06724a; border-radius: 999px; padding: 2px 10px; font-weight: 800; font-size: 11px; }
.plan-option.recommended { border-color: var(--green); }
.plan-option.recommended:has(input:checked) { border-color: var(--green); background: var(--green-50); }
@media (max-width: 480px) {
    .plans { grid-template-columns: 1fr; }
    .plan-option { flex-direction: row; justify-content: space-between; text-align: start; padding: 12px 14px; }
}

/* ---------- password field with show/hide ---------- */
.pw { position: relative; }
.pw .input { padding-left: 46px; }
.pw .pw-btn { position: absolute; left: 4px; top: 3px; color: var(--muted); }
.pw .pw-btn:hover { background: #eef2fa; }

/* ---------- misc ---------- */
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 6px 14px; }
.kv dt { color: var(--muted); font-weight: 700; }
.kv dd { margin: 0; font-weight: 700; }
.code-box { font-family: Consolas, 'Courier New', monospace; font-size: 20px; font-weight: 800; letter-spacing: 2px; direction: ltr; text-align: center; background: #f2f6ff; border: 1px dashed #b8cdfc; border-radius: 10px; padding: 10px; user-select: all; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.tabs a { padding: 8px 16px; border-radius: 999px; background: #fff; border: 1px solid var(--border); color: var(--navy-text); font-weight: 800; font-size: 14px; text-decoration: none; }
.tabs a.active { background: var(--blue); color: #fff; border-color: var(--blue); }

/* =========================================================================
   Tablet & mobile
   ========================================================================= */
@media (max-width: 1100px) {
  .grid.three { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 860px) {
  .sidebar { transform: translateX(-102%); box-shadow: none; width: min(300px, 86vw); }
  body.nav-open .sidebar { transform: none; box-shadow: 8px 0 30px rgba(0,0,0,.35); }
  body.nav-open .scrim { display: block; position: fixed; inset: 0; background: rgba(10, 18, 34, .5); z-index: 55; }
  .main { margin-left: 0; padding-bottom: calc(var(--bottom-h) + var(--safe-bottom)); }
  .menu-btn { display: grid; place-items: center; }
  .topbar { padding: 0 12px; }
  .topbar .clock { display: none; }
  .content { padding: 16px 12px; }
  .trial-bar { padding: 8px 12px; font-size: 13px; }

  .bottom-nav {
    display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
    background: #fff; border-top: 1px solid var(--border);
    height: calc(var(--bottom-h) + var(--safe-bottom)); padding-bottom: var(--safe-bottom);
    box-shadow: 0 -4px 18px rgba(16, 32, 64, .08);
  }
  .bottom-nav a, .bottom-nav button {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
    color: var(--muted); font-size: 11.5px; font-weight: 800; text-decoration: none;
    background: transparent; border: 0; cursor: pointer; padding: 6px 2px;
  }
  .bottom-nav .i { width: 23px; height: 23px; }
  .bottom-nav a.active { color: var(--blue); }

  .grid.two, .grid.three { grid-template-columns: minmax(0, 1fr); }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .stat { padding: 12px; gap: 10px; flex-direction: row-reverse; }
  .stat .value { font-size: 22px; }
  .stat .ico { width: 38px; height: 38px; }
  .toolbar .btn { flex: 1 1 auto; }
  .toolbar .count { white-space: normal; flex: 1 1 100%; }
  .kv { grid-template-columns: 110px 1fr; }

  /* tables become stacked cards */
  table.table.stack thead { display: none; }
  table.table.stack, table.table.stack tbody, table.table.stack tr, table.table.stack td { display: block; width: 100%; }
  table.table.stack tr { display: flex; flex-direction: column; border-bottom: 8px solid var(--bg); padding: 6px 4px; }
  table.table.stack td { display: flex; justify-content: space-between; align-items: center; gap: 12px; border: 0; padding: 4px 12px; text-align: left; }
  /* بطاقة مختصرة: عنوان بارز + الأهم بس، والباقي يظهر في صفحة التفاصيل */
  table.table.stack td.m-head { order: -1; display: block; padding: 8px 12px 4px; font-size: 16px; text-align: right; }
  table.table.stack td.m-head::before { display: none; }
  .m-hide { display: none !important; }
  .m-only { display: block; }
  .mc-bar { bottom: calc(var(--bottom-h) + var(--safe-bottom)); }
  .mf-bar.in-page { bottom: calc(var(--bottom-h) + var(--safe-bottom)); margin-inline: -4px; padding-inline: 4px; }
  details.m-only { display: block; }
  .d-only { display: none !important; }
  .tabs-scroll { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
  .tabs-scroll::-webkit-scrollbar { display: none; }
  .tabs-scroll a { white-space: nowrap; flex: none; }
  .page-head { gap: 8px; }
  table.table.stack td::before { content: attr(data-label); font-weight: 800; color: var(--muted); font-size: 12.5px; flex: none; }
  table.table.stack td.no-label::before { display: none; }
  table.table.stack td.no-label { justify-content: flex-start; }
  .table .actions { justify-content: flex-end; }

  /* modals become bottom sheets */
  dialog.modal { width: 100vw; max-width: 100vw; max-height: 94vh; margin: auto 0 0 0; border-radius: 20px 20px 0 0; }
}

@media (max-width: 340px) {
  .stats { grid-template-columns: 1fr; }
}

/* ---------- print ---------- */
@media print {
  .sidebar, .topbar, .bottom-nav, .trial-bar, .toolbar, .no-print, .toasts, .scrim { display: none !important; }
  .main { margin: 0 !important; padding: 0 !important; }
  .content { padding: 0 !important; max-width: none; }
  body { background: #fff; }
  .card, .table-wrap, .stat { box-shadow: none; }
}

/* ---------- member card (credit-card size) ---------- */
.member-card { width: 8.6cm; height: 5.4cm; margin: 0 auto; background: #fff; border: 1px solid #cfd8ea; border-radius: 12px; box-shadow: var(--shadow); padding: 8px 10px; display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; color: #0f1e3d; }
.mc-head { display: flex; align-items: center; gap: 8px; border-bottom: 2px solid #2F6FFC; padding-bottom: 4px; }
.mc-head img { width: 34px; height: 34px; object-fit: contain; }
.mc-gym { font-weight: 800; font-size: 13px; line-height: 1.1; }
.mc-sub { font-size: 9px; color: #5b6982; letter-spacing: 1px; }
.mc-body { display: flex; align-items: center; gap: 8px; flex: 1; min-height: 0; }
.mc-qr { margin-inline-start: auto; flex: none; }
.mc-qr svg { width: 1.9cm; height: 1.9cm; display: block; }
.mc-photo { width: 46px; height: 46px; border-radius: 50%; object-fit: cover; }
.mc-name { font-weight: 800; font-size: 14px; }
.mc-phone { font-size: 10.5px; color: #5b6982; }
.mc-code { text-align: center; }
.mc-bars svg { height: 30px; width: auto; max-width: 100%; }
.mc-num { font-size: 9.5px; font-weight: 700; letter-spacing: 1px; }
@media print { .member-card { box-shadow: none; margin: 0; } @page { size: 8.6cm 5.4cm; margin: 0; } }
/* ---------- الجولة الإرشادية (نافذة خطوة بخطوة) ---------- */
@media (min-width: 861px) { dialog.modal:has([data-tour]) { width: min(460px, calc(100vw - 24px)); } }
.tour-sheet { padding: 18px 20px 22px; color: #0F1E3D; }
.tour-sheet h3 { font-size: 21px; margin: 0 0 4px; }
.tour-sheet p { font-size: 14px; line-height: 1.8; color: #5B6982; margin: 0 0 16px; }
.tour-stepper { display: flex; align-items: center; margin: 2px 0 18px; }
.tour-stepper .tc { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 800; background: #EDF0F6; color: #7A869C; flex: none; }
.tour-stepper .tc.n { background: var(--blue); color: #fff; }
.tour-stepper .tc.d { background: var(--green); color: #fff; }
.tour-stepper .tl { flex: 1; height: 3px; background: #EDF0F6; margin: 0 5px; border-radius: 2px; }
.tour-stepper .tl.d { background: var(--green); }
.tour-ic { width: 54px; height: 54px; border-radius: 16px; display: grid; place-items: center; margin-bottom: 12px; }
.tour-ic .i { width: 28px; height: 28px; }
.tour-ic.blue { background: #EAF1FF; color: #2F6FFC; }
.tour-ic.purple { background: #EFEAFB; color: #6C4CC6; }
.tour-ic.orange { background: #FFF1E0; color: #F18915; }
.tour-ic.green { background: #E3F8EF; color: #01B574; }
.tour-ic.teal { background: #E0F7F7; color: #0891B2; }
.tour-in { width: 100%; height: 50px; border: 1.5px solid #E1E6F0; border-radius: 12px; background: #F7F9FC; padding: 0 14px; font: inherit; font-size: 15px; color: #0F1E3D; margin-bottom: 10px; }
.tour-in:focus { outline: none; border-color: var(--blue); background: #fff; }
.tour-btn { display: flex; align-items: center; justify-content: center; width: 100%; height: 52px; border: 0; border-radius: 14px; background: var(--blue); color: #fff; font: inherit; font-size: 16px; font-weight: 800; cursor: pointer; margin-top: 4px; }
.tour-btn { text-decoration: none; }
.tour-btn:hover { filter: brightness(1.06); }
.tour-btn.green { background: var(--green); }
.tour-skip { display: block; margin: 14px auto 0; background: none; border: 0; font: inherit; font-size: 13px; color: #8A96AB; cursor: pointer; }
.tour-skip:hover { color: #5B6982; }
.tour-spin { display: none; font-size: 13px; color: var(--muted); margin-top: 10px; text-align: center; }
.tour-spin.htmx-request { display: block; }
.tour-next-card { display: flex; align-items: center; gap: 14px; width: 100%; background: #fff; border: 1px solid #E1E6F0; border-radius: 14px; padding: 14px 16px; cursor: pointer; font: inherit; text-align: right; transition: border-color .15s; }
.tour-next-card:hover { border-color: #B0BFDA; }
.tour-next-card--accent { border: 2px solid #2F6FFC; }
.tour-next-ic { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; flex-shrink: 0; }
.tour-next-ic .i { width: 20px; height: 20px; }
.tour-next-ic.blue { background: #EAF1FF; color: #2F6FFC; }
.tour-next-ic.purple { background: #EFEAFB; color: #6C4CC6; }
.tour-next-ic.green { background: #E3F8EF; color: #01B574; }
.tour-next-body { display: flex; flex-direction: column; gap: 3px; }
.tour-next-body b { font-size: 14px; font-weight: 700; color: #0F1E3D; }
.tour-next-body small { font-size: 12px; color: #8A96AB; }
.tour-plan { display: flex; align-items: center; gap: 12px; border: 2px solid var(--blue); background: #EEF3FF; border-radius: 14px; padding: 12px 14px; margin-bottom: 14px; }
.tour-plan .i { width: 26px; height: 26px; color: var(--blue); flex: none; }
.tour-plan b { display: block; font-size: 15px; }
.tour-plan span { font-size: 12.5px; color: #5B6982; }
.tour-price { font-size: 19px; font-weight: 800; color: var(--blue); white-space: nowrap; }
.tour-member { display: flex; align-items: center; gap: 12px; border: 1.5px solid #E1E6F0; border-radius: 14px; padding: 12px 14px; margin-bottom: 14px; }
.tour-member .av { width: 42px; height: 42px; border-radius: 50%; background: #EFEAFB; color: #6C4CC6; display: grid; place-items: center; font-weight: 800; flex: none; }
.tour-member b { display: block; font-size: 15px; }
.tour-member span.ltr { font-size: 12.5px; color: #5B6982; }
.tour-tag { font-size: 12px; background: #E3F8EF; color: #01875A; border-radius: 8px; padding: 3px 8px; font-weight: 700; white-space: nowrap; }
.tour-center { text-align: center; }
.tour-win { width: 68px; height: 68px; border-radius: 50%; background: var(--green); color: #fff; display: grid; place-items: center; margin: 6px auto 12px; }
.tour-win .i { width: 36px; height: 36px; }
.tour-done-list { list-style: none; margin: 0 0 12px; padding: 6px 14px; background: #F5F7FB; border-radius: 14px; }
.tour-done-list li { display: flex; align-items: center; gap: 10px; padding: 8px 0; font-size: 14.5px; font-weight: 700; }
.tour-done-list .ck { width: 22px; height: 22px; border-radius: 50%; background: var(--green); color: #fff; display: grid; place-items: center; flex: none; }
.tour-done-list .ck .i { width: 14px; height: 14px; }
.tour-note { font-size: 12.5px !important; color: #8A96AB !important; margin-bottom: 14px !important; }
.tour-fab { position: fixed; bottom: 18px; left: 18px; z-index: 40; display: flex; align-items: center; gap: 4px; }
.tour-fab-btn { display: flex; align-items: center; gap: 8px; background: var(--blue); color: #fff; border: 0; border-radius: 999px; padding: 12px 18px; font: inherit; font-size: 14px; font-weight: 800; cursor: pointer; box-shadow: 0 10px 24px rgba(47, 111, 252, .35); }
.tour-fab-x { width: 28px; height: 28px; border-radius: 50%; border: 0; background: #fff; color: #5B6982; display: grid; place-items: center; cursor: pointer; box-shadow: 0 4px 10px rgba(10, 20, 40, .18); }
@media (max-width: 860px) { .tour-fab { bottom: 78px; left: 12px; } }

/* ---------- icons extra sizes ---------- */
.i.xl { width: 40px; height: 40px; }

/* ---------- import page ---------- */
.import-drop { border: 2px dashed var(--border); border-radius: var(--radius); padding: 36px 24px; text-align: center; cursor: pointer; transition: border-color .15s, background .15s; }
.import-drop:hover, .import-drop.drag-over { border-color: var(--blue); background: var(--blue-50); }
.import-cols-hint { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.import-col-item { background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 8px 12px; font-size: 13.5px; }
.badge-req { display: inline-block; background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; border-radius: 5px; padding: 1px 7px; font-size: 11px; font-weight: 700; margin-inline-start: 4px; }
.card { padding: 24px; }

/* ===== شاشة البيع (كاشير) ===== */
.pos { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
.pos-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.pos-card { display: flex; flex-direction: column; gap: 4px; align-items: stretch; text-align: center; padding: 14px 10px; min-height: 96px; border: 1px solid var(--border); border-radius: 14px; background: #fff; cursor: pointer; font: inherit; color: inherit; touch-action: manipulation; }
.pos-card:active { transform: scale(.98); }
.pos-card:disabled { opacity: .5; cursor: not-allowed; }
.pos-card.low { border-color: #f5b041; }
.pos-name { font-weight: 800; }
.pos-price { color: #06894f; font-weight: 800; }
.pos-stock { font-size: 12.5px; color: #5b6982; }
.pos-card.low .pos-stock { color: #c46d05; font-weight: 700; }
.pos-card.out .pos-stock { color: #c81e24; font-weight: 700; }
.pos-cart { position: sticky; top: 76px; }
.cart-lines { max-height: 38vh; overflow: auto; margin-bottom: 12px; }
.cart-line { display: grid; grid-template-columns: 1fr auto auto; gap: 8px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--border); }
.cl-qty { display: flex; align-items: center; gap: 8px; }
.cl-qty button { width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--border); background: #fff; font-size: 18px; font-weight: 800; cursor: pointer; }
.cl-sum { font-weight: 800; min-width: 52px; text-align: left; }
.cart-total { display: flex; justify-content: space-between; align-items: center; font-size: 18px; margin: 10px 0 14px; }
.btn.block { width: 100%; justify-content: center; }
@media (max-width: 860px) { .pos { grid-template-columns: 1fr; } .pos-cart { position: static; } }

/* ===== بطاقات العضو (طباعة PVC / ستيكر) ===== */
.mc-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
body.card-sticker .member-card { width: 38mm; height: 38mm; border-radius: 50%; padding: 4mm; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
body.card-sticker .member-card .mc-head, body.card-sticker .member-card .mc-code, body.card-sticker .member-card .mc-photo, body.card-sticker .member-card .mc-phone { display: none; }
body.card-sticker .member-card .mc-body { flex-direction: column; gap: 2mm; }
body.card-sticker .member-card .mc-qr svg { width: 22mm; height: 22mm; }
body.card-sticker .member-card .mc-name { font-size: 9pt; }

/* ===== PWA / الجوال والتابلت ===== */
.nav-install { display: flex; align-items: center; gap: 10px; width: 100%; background: transparent; border: 0; color: inherit; font: inherit; padding: 10px 14px; cursor: pointer; border-radius: 10px; }
.nav-install:hover { background: rgba(255,255,255,.08); }
html { -webkit-text-size-adjust: 100%; }
body { overscroll-behavior-y: none; -webkit-tap-highlight-color: transparent; }
button, a, select, label, summary { touch-action: manipulation; }
/* iOS بيكبّر الصفحة لو الخط في الحقل أقل من 16px */
@media (max-width: 900px) { .input, input, select, textarea { font-size: 16px; } }
@media (display-mode: standalone) {
  .topbar { padding-top: max(8px, env(safe-area-inset-top)); }
}

.mc-acts { text-align: center; font-size: 11px; font-weight: 700; color: #b91c1c; margin: 2px 0; }
body.card-sticker .member-card .mc-acts { display: none; }

.mc-no { font-size: 11px; color: #5b6982; }
.mc-no b { color: #2f6bff; font-size: 15px; margin-inline-start: 4px; }
body.card-sticker .member-card .mc-no { display: none; }

/* المدفوعات (موبايل) */
.pm-hero { background: #fff; border-radius: 18px; padding: 16px 18px; box-shadow: 0 2px 10px rgba(16, 32, 64, .06); display: flex; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.pm-big { flex: 1.4; }
.pm-side { flex: 1; }
.pm-div { width: 1px; align-self: stretch; background: var(--border); margin: 0 14px; }
.pm-l { font-size: 13px; color: var(--muted); }
.pm-v { font-size: 28px; font-weight: 800; color: #0f1e3d; line-height: 1.3; }
.pm-v small { font-size: 14px; font-weight: 700; color: var(--muted); }
.pm-v.pm-g { font-size: 22px; color: var(--green-dark); }
.pm-mini { flex-basis: 100%; display: flex; justify-content: space-between; gap: 8px; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--border); font-size: 12.5px; color: var(--muted); }
.pm-mini b { color: #0f1e3d; }
.pm-seg { display: flex; background: #e9eef7; border-radius: 12px; padding: 4px; margin-bottom: 10px; overflow-x: auto; scrollbar-width: none; }
.pm-seg::-webkit-scrollbar { display: none; }
.pm-seg a { flex: 1 0 auto; text-align: center; padding: 8px 12px; border-radius: 9px; font-weight: 700; font-size: 13.5px; color: var(--muted); text-decoration: none; white-space: nowrap; }
.pm-seg a.on { background: #fff; color: var(--blue); box-shadow: 0 1px 3px rgba(16, 32, 64, .12); }
.pm-search { display: flex; gap: 8px; margin-bottom: 12px; align-items: flex-start; }
.pm-search .input { flex: 1; min-width: 0; }
.pm-total { font-size: 13px; font-weight: 700; color: #0f1e3d; margin: 0 4px 6px; }
.pm-total small { color: var(--muted); font-weight: 600; }
.pm-day { display: flex; justify-content: space-between; align-items: baseline; margin: 14px 4px 8px; }
.pm-day b { font-size: 14px; color: #0f1e3d; }
.pm-day span { font-size: 13px; color: var(--muted); }
.pm-grp { background: #fff; border-radius: 16px; box-shadow: 0 2px 10px rgba(16, 32, 64, .06); overflow: hidden; }
.pm-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-bottom: 1px solid #f0f3f9; color: inherit; text-decoration: none; }
.pm-row:last-child { border-bottom: 0; }
.pm-ic { width: 38px; height: 38px; border-radius: 12px; display: flex; align-items: center; justify-content: center; flex: none; }
.pm-ic.n { background: var(--blue-50); color: var(--blue); }
.pm-ic.r { background: var(--green-50); color: var(--green-dark); }
.pm-ic.m { background: #fff1de; color: #c46d05; }
.pm-mid { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pm-mid b { font-size: 15px; color: #0f1e3d; overflow-wrap: anywhere; }
.pm-s { font-size: 12.5px; color: var(--muted); margin-top: 1px; }
.pm-am { text-align: left; flex: none; }
.pm-am b { display: block; font-size: 16px; color: #0f1e3d; }
.pm-rc { font-size: 11.5px; color: var(--blue); direction: ltr; display: block; }
.pm-bar .btn { width: 100%; }
@media (max-width: 860px) { .pm-bar { margin-top: 14px; } }
.pm-v.pm-r, .pm-am b.pm-r { color: #d92d20; }
.pm-row.pm-col { flex-direction: column; align-items: stretch; gap: 8px; }
.pm-line { display: flex; align-items: center; gap: 12px; }
.pm-note { font-size: 12.5px; color: #4a566a; background: #f6f8fc; border-radius: 8px; padding: 5px 9px; overflow-wrap: anywhere; }
.pm-acts { display: flex; gap: 8px; }

/* المبيعات (موبايل): الفاتورة ورقة بتطلع من تحت + شريط عرض الفاتورة */
.pos-q { position: absolute; top: 8px; left: 8px; background: var(--blue); color: #fff; border-radius: 999px; min-width: 24px; height: 24px; line-height: 24px; text-align: center; font-weight: 800; font-size: 13px; }
.pos-q[hidden], .cart-bar[hidden], .cart-dim[hidden] { display: none !important; }
.pos-card { position: relative; }
.pos-card.sel { border-color: var(--blue); background: var(--blue-50); }
.cart-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.cart-close { border: 0; background: transparent; color: var(--muted); font: inherit; font-size: 13px; cursor: pointer; }
@media (max-width: 860px) {
  .pos-grid { grid-template-columns: 1fr 1fr; }
  .pos-card { text-align: right; }
  .pos-cart { position: fixed; left: 0; right: 0; bottom: 0; top: auto; z-index: 70; max-height: 82vh; overflow: auto; border-radius: 22px 22px 0 0; transform: translateY(105%); transition: transform .22s ease; margin: 0; padding-bottom: calc(16px + var(--safe-bottom)); }
  .pos-cart.open { transform: none; }
  .cart-dim { position: fixed; inset: 0; background: rgba(15, 30, 61, .4); z-index: 69; }
  .cart-bar { position: fixed; left: 12px; right: 12px; bottom: calc(var(--bottom-h) + var(--safe-bottom) + 8px); z-index: 30; display: flex; justify-content: space-between; align-items: center; border: 0; border-radius: 14px; padding: 14px 16px; background: var(--green); color: #fff; font: inherit; font-weight: 800; font-size: 15px; box-shadow: 0 6px 18px rgba(1, 181, 116, .35); cursor: pointer; }
  .pos-grid { padding-bottom: 76px; }
}

.pm-back { margin: 0 0 16px; }
.pm-kv { display: flex; gap: 8px; flex-wrap: wrap; }
.pm-kv span { background: #f6f8fc; border-radius: 8px; padding: 4px 10px; font-size: 12.5px; color: #4a566a; }
.pm-kv b { color: #0f1e3d; }

.pm-prog { height: 6px; background: #e9eef7; border-radius: 4px; overflow: hidden; }
.pm-prog i { display: block; height: 100%; background: var(--blue); border-radius: 4px; }
.mf-chip-add { padding: 8px 14px; border-radius: 999px; border: 1.5px dashed #7F77DD; color: #3C3489; background: #F5F4FF; font: inherit; font-weight: 800; font-size: 14px; cursor: pointer; }

@media (max-width: 860px) { .page-head { margin-bottom: 20px; } }

.pm-v.pm-r { color: #d92d20; }
.pm-dates { display: flex; gap: 8px; margin-bottom: 10px; }
.pm-dates .input { flex: 1; min-width: 0; }
.pm-trio { display: flex; gap: 8px; margin-bottom: 12px; }
.pm-trio > div { flex: 1; background: #fff; border-radius: 14px; padding: 10px 6px; box-shadow: 0 2px 8px rgba(16, 32, 64, .05); text-align: center; }
.pm-trio small { display: block; color: var(--muted); font-size: 11.5px; }
.pm-trio b { display: block; font-size: 20px; color: #0f1e3d; }
.pm-trio i { display: block; font-style: normal; font-size: 11px; color: var(--muted); }

/* الإعدادات: أقسام مطوية */
.pm-fold { border-top: 1px solid var(--border); margin-top: 14px; padding-top: 4px; }
.pm-fold > summary { list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 0; cursor: pointer; font-weight: 800; color: #0f1e3d; font-size: 16px; }
.pm-fold > summary::-webkit-details-marker { display: none; }
.pm-fold > summary::after { content: "⌄"; color: var(--muted); font-size: 18px; transition: transform .15s; }
.pm-fold[open] > summary::after { transform: rotate(180deg); }
.pm-fold > summary small { display: block; font-weight: 600; font-size: 12px; color: var(--muted); margin-top: 2px; }
@media (min-width: 861px) { .pm-fold > summary::after { display: none; } .pm-fold > summary { cursor: default; } }
.pm-logo-img { width: 140px; height: 140px; }
@media (max-width: 860px) { .pm-logo { order: -1; } .pm-logo-img { width: 84px; height: 84px; } }

.pm-pw { display: flex; gap: 8px; align-items: center; }
.pm-pw .input { flex: 1; min-width: 0; }

.pm-me { display: flex; align-items: center; gap: 14px; background: #fff; border-radius: 18px; padding: 14px 16px; box-shadow: 0 2px 10px rgba(16, 32, 64, .06); margin-bottom: 12px; max-width: 520px; }
.pm-me .pm-ic { display: flex; align-items: center; justify-content: center; flex: none; }
.pw-wrap { position: relative; }
.pw-wrap .input { padding-inline-end: 44px; }
.pw-eye { position: absolute; inset-inline-end: 8px; top: 50%; transform: translateY(-50%); border: 0; background: transparent; font-size: 18px; cursor: pointer; padding: 6px; opacity: .6; }

/* الإيصال (موبايل) */
.rc-hero { text-align: center; margin: 6px 0 14px; padding-bottom: 12px; border-bottom: 2px dashed #e3e8f1; }
.rc-ok { width: 54px; height: 54px; border-radius: 50%; background: var(--green-50); color: var(--green-dark); display: flex; align-items: center; justify-content: center; font-size: 26px; margin: 0 auto 6px; }
.rc-amt { font-size: 32px; font-weight: 800; color: #06894f; line-height: 1.3; }
.rc-amt small { font-size: 15px; color: var(--muted); font-weight: 700; }
.rc-no { color: var(--blue); font-weight: 700; direction: ltr; }

@media (max-width: 860px) { .rc-dup { display: none; } }

/* نوافذ الإدخال: خانة مبلغ كبيرة + أزرار الحفظ ثابتة تحت (موبايل) */
.amount-big { font-size: 26px; font-weight: 800; text-align: center; padding: 12px; }
.mf-chip-other span { border: 1.5px dashed #7F77DD; color: #3C3489; background: #F5F4FF; }
.mf-chip-other input:checked + span { border-style: solid; border-color: var(--blue); background: #EAF3FF; color: var(--blue); }
@media (max-width: 860px) {
  .modal-body .form-actions { position: sticky; bottom: 0; z-index: 3; background: #fff; border-top: 1px solid var(--border); margin: 14px -20px -20px; padding: 12px 20px calc(12px + var(--safe-bottom)); flex-wrap: nowrap; }
  .modal-body .form-actions .btn { flex: 1; height: 48px; justify-content: center; }
  .modal-body .form-actions .btn.green { flex: 2; }
}

/* الاشتراك والتفعيل: كارت بارز + باقات اختيار + زرار شراء */
.act-pts { display: flex; flex-direction: column; gap: 8px; margin: 2px 2px 14px; font-size: 14px; color: #0f1e3d; }
.act-pts b { color: var(--green-dark); }
.act-plans { display: flex; flex-direction: column; gap: 12px; margin-bottom: 16px; }
.act-plan { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 10px; background: #fff; border: 2px solid var(--border); border-radius: 18px; padding: 14px 16px; cursor: pointer; }
.act-plan input { position: absolute; opacity: 0; pointer-events: none; }
.act-plan .ap-main { display: flex; flex-direction: column; gap: 2px; }
.act-plan .ap-main b { font-size: 17px; color: #0f1e3d; }
.act-plan .ap-main small { color: var(--muted); font-size: 12.5px; }
.ap-badge { background: var(--green-50); color: #06724a; font-size: 11.5px; font-weight: 800; border-radius: 999px; padding: 2px 10px; margin-inline-start: 6px; }
.ap-price { font-size: 26px; font-weight: 800; color: #0f1e3d; }
.ap-price small { font-size: 13px; color: var(--muted); font-weight: 700; }
.act-plan:has(input:checked) { border-color: var(--blue); background: #f4f8ff; box-shadow: 0 6px 18px rgba(47, 111, 252, .18); }
.act-plan.rec::before { content: "الأكثر طلبًا"; position: absolute; top: -11px; inset-inline-start: 16px; background: var(--blue); color: #fff; font-size: 11.5px; font-weight: 800; padding: 3px 12px; border-radius: 999px; }
.act-cta { width: 100%; border: 0; background: var(--green); color: #fff; font: inherit; font-weight: 800; font-size: 16px; padding: 15px; border-radius: 14px; box-shadow: 0 6px 16px rgba(1, 181, 116, .35); cursor: pointer; }
.nav-cta { background: linear-gradient(90deg, #f59e0b, #f97316) !important; color: #fff !important; font-weight: 800; }
.nav-cta .nav-pill { margin-inline-start: auto; background: #fff; color: #c2410c; border-radius: 999px; padding: 1px 9px; font-size: 11px; }

@media (max-width: 359px) { .bottom-nav a, .bottom-nav button { font-size: 10px; padding: 6px 0; min-width: 0; } .bottom-nav .i { width: 21px; height: 21px; } }
@media (max-width: 359px) { .mf-bar .btn { min-width: 0; padding-inline: 6px; font-size: 13.5px; } .mf-bar { gap: 6px; } }

/* مسافات رأسية أريح بين العناصر على الموبايل (زيادة بسيطة عشان الصفحة ما تطولش) */
@media (max-width: 860px) {
  .mcard { padding: 14px; margin-bottom: 12px; }
  .mcard-line { margin: 10px 0; }
  .mcard-acts { margin-top: 12px; }
  .pm-hero { margin-bottom: 16px; }
  .pm-seg { margin-bottom: 14px; }
  .pm-search { margin-bottom: 16px; }
  .pm-total { margin: 4px 4px 10px; }
  .pm-day { margin: 18px 4px 10px; }
  .pm-row { padding: 14px 16px; gap: 14px; }
  .pm-row.pm-col { gap: 10px; }
  .pm-grp + .pm-grp, .pm-grp + .pm-day { margin-top: 14px; }
  .mf-chips { gap: 10px; }
  .tabs { gap: 8px; margin-bottom: 16px; }
  .tabs-scroll { gap: 10px; }
  .field { margin-bottom: 18px; gap: 8px; }
  .stats { gap: 14px; }
  .card-pad { padding: 18px; }
  .card.mb, .mb { margin-bottom: 18px; }
  .page-head { margin-bottom: 20px; }
  .toolbar { gap: 12px; margin: 16px 0; }
  .alert { margin-bottom: 16px; }
  .cart-line { padding-block: 10px; }
  .nav { gap: 6px; }
}

.more-panel { max-width: calc(100vw - 16px); }
html, body { overflow-x: clip; }

.ap-price { white-space: nowrap; flex: none; display: inline-flex; align-items: baseline; gap: 5px; }
.ap-price b { font-weight: 800; }
.act-plan .ap-main { min-width: 0; }
.act-plan .ap-charge { color: var(--muted); font-size: 12px; }
.ap-nw { white-space: nowrap; }
.act-plan .ap-main small { display: block; }

@media screen and (max-width: 345px) { .member-card { zoom: .85; } }

/* ==========================================================================
   تطبيق الأعضاء (/m/...): نفس هوية كابتن (الخط والأزرار والألوان والأيقونات)
   والتمييز: هيدر كحلي بشعار الجيم وشارة "عضو" + بطاقة دخول QR + شريط تنقل خاص
   ========================================================================== */
body.ma { background: #e9eef7; }
.ma-wrap { max-width: 520px; margin: 0 auto; min-height: 100vh; display: flex; flex-direction: column; background: var(--bg); }
@media (min-width: 561px) { .ma-wrap { box-shadow: 0 0 40px rgba(16, 32, 64, .14); } }
.ma-head { background: var(--navy); color: #fff; padding: 12px 16px; display: flex; align-items: center; gap: 12px; position: sticky; top: 0; z-index: 20; }
.ma-head img { width: 40px; height: 40px; border-radius: 11px; object-fit: cover; flex: none; background: rgba(255, 255, 255, .08); }
.ma-head .gn { font-weight: 800; font-size: 16px; line-height: 1.25; overflow-wrap: anywhere; }
.ma-head .tg { font-size: 11.5px; color: #aab6cf; letter-spacing: .6px; }
.ma-head .ma-badge { margin-inline-start: auto; flex: none; background: var(--blue); color: #fff; border-radius: 999px; font-size: 12px; font-weight: 800; padding: 3px 12px; }
.ma-content { flex: 1; padding: 16px 14px calc(var(--bottom-h) + 28px + var(--safe-bottom)); min-width: 0; }
.ma-title { font-size: 21px; font-weight: 800; color: var(--navy-text); margin: 2px 2px 16px; }
.ma-sec { font-size: 14px; font-weight: 800; color: var(--navy-text); margin: 22px 4px 10px; display: flex; align-items: center; justify-content: space-between; }
.ma-nav { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 520px; z-index: 30; display: flex; background: #fff; border-top: 1px solid var(--border); height: calc(var(--bottom-h) + var(--safe-bottom)); padding-bottom: var(--safe-bottom); box-shadow: 0 -4px 18px rgba(16, 32, 64, .08); }
.ma-nav a { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--muted); font-size: 11.5px; font-weight: 800; text-decoration: none; }
.ma-nav a.active { color: var(--blue); }
.ma-nav .i { width: 23px; height: 23px; }

.ma-card { background: #fff; border-radius: 18px; padding: 16px; box-shadow: 0 2px 10px rgba(16, 32, 64, .06); margin-bottom: 14px; }
.ma-card h3 { font-size: 16px; }
.ma-hero { background: var(--navy); color: #fff; border-radius: 20px; padding: 18px; margin-bottom: 14px; }
.ma-hero .lbl { color: #aab6cf; font-size: 13px; font-weight: 700; }
.ma-hero .big { font-size: 40px; font-weight: 800; line-height: 1.1; margin: 4px 0; }
.ma-hero .big small { font-size: 16px; font-weight: 700; color: #aab6cf; margin-inline-start: 6px; }
.ma-hero .line { color: #dbe4f7; font-size: 14px; font-weight: 600; }
.ma-hero.off { background: #3b4660; }
.ma-pill { display: inline-block; border-radius: 999px; padding: 2px 12px; font-size: 12.5px; font-weight: 800; }
.ma-pill.ok { background: var(--green-50); color: var(--green-dark); }
.ma-pill.warn { background: var(--orange-50); color: #a85d00; }
.ma-pill.bad { background: var(--red-50); color: #b1181e; }
.ma-pill.info { background: var(--blue-50); color: var(--blue); }
.ma-pill.mute { background: #eef1f7; color: var(--muted); }
.ma-hero .ma-pill { margin-bottom: 6px; }
.ma-pass { text-align: center; }
.ma-pass .qr { width: 188px; max-width: 70%; margin: 10px auto 6px; background: #fff; padding: 8px; border-radius: 14px; border: 1px solid var(--border); }
.ma-pass .qr svg { width: 100%; height: auto; display: block; }
.ma-pass .code { font-weight: 800; letter-spacing: 1.5px; color: var(--navy-text); direction: ltr; }
.ma-crowd { display: flex; align-items: center; gap: 12px; }
.ma-crowd .dot { width: 14px; height: 14px; border-radius: 50%; flex: none; }
.ma-crowd .dot.n { background: var(--green); }
.ma-crowd .dot.m { background: var(--orange); }
.ma-crowd .dot.r { background: var(--red); }
.ma-grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.ma-prod { background: #fff; border-radius: 16px; padding: 14px 12px; box-shadow: 0 2px 10px rgba(16, 32, 64, .06); display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.ma-prod .ph { height: 54px; border-radius: 12px; background: var(--blue-50); color: var(--blue); display: grid; place-items: center; margin-bottom: 4px; }
.ma-prod b { font-size: 15px; color: #0f1e3d; overflow-wrap: anywhere; }
.ma-prod .pr { font-weight: 800; color: var(--navy-text); }
.ma-note { font-size: 12.5px; color: var(--muted); text-align: center; margin: 10px 8px; }
.ma-req { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0; border-bottom: 1px solid #f0f3f9; }
.ma-req:last-child { border-bottom: 0; }
.ma-auth { min-height: 100vh; display: flex; flex-direction: column; background: var(--navy); }
.ma-auth .top { padding: 34px 20px 24px; text-align: center; color: #fff; }
.ma-auth .top img { width: 84px; height: 84px; border-radius: 22px; object-fit: cover; background: rgba(255, 255, 255, .08); }
.ma-auth .top h1 { color: #fff; font-size: 22px; margin: 12px 0 2px; }
.ma-auth .top p { color: #aab6cf; margin: 0; font-weight: 600; }
.ma-auth .sheet { flex: 1; background: var(--bg); border-radius: 26px 26px 0 0; padding: 24px 18px 30px; }
.ma-auth .sheet-in { max-width: 440px; margin: 0 auto; }
.ma-link { color: var(--blue); font-weight: 800; }

.pm-acts { flex-wrap: wrap; }
.pm-acts .btn { min-width: 0; }

/* ---------- صفحة الاشتراك والتفعيل (باقات أساسي وبلس) ---------- */

/* أهداف اللمس على الجوال: الروابط والأزرار الصغيرة بتتكبّر لـ 36px على الأقل */
@media (max-width: 768px) {
  .trial-bar a, .mf-link, .md-back, .cart-close { display: inline-flex; align-items: center; min-height: 36px; }
  .tour-fab-x { width: 36px; height: 36px; }
}

/* بطاقة تفعيل الإشعارات */

/* روابط الدخول/التسجيل على الجوال: مساحة لمس مريحة */
@media (max-width: 768px) {
  .already-have a, .auth-foot a, .auth-card p a, .auth-card .muted a, .lnd-text-link { display: inline-block; padding: 8px 6px; min-height: 36px; box-sizing: border-box; }
}

/* ===== لوحة الأدمن: جوال أولًا ===== */
.adm .adm-bn { display: none; }
.adm .gcards, .adm .qcards { display: none; }
.adm .acc { background: #fff; border: 1px solid var(--border); border-radius: 14px; margin-bottom: 10px; }
.adm .acc > summary { list-style: none; cursor: pointer; padding: 14px 16px; font-weight: 800; font-size: 15px; display: flex; justify-content: space-between; align-items: center; gap: 10px; min-height: 48px; }
.adm .acc > summary::-webkit-details-marker { display: none; }
.adm .acc > summary small { color: var(--muted); font-weight: 600; font-size: 12px; }
.adm .acc > summary::after { content: "⌄"; color: var(--muted); font-size: 18px; }
.adm .acc[open] > summary::after { content: "⌃"; }
.adm .acc > .acc-body { padding: 0 16px 16px; }
.adm .acc.danger > summary { color: #A32D2D; }
.adm .qa { display: flex; gap: 8px; flex-wrap: wrap; }
.adm .qa form { margin: 0; flex: 1; }
.adm .qa .btn, .adm .qa a.btn { width: 100%; justify-content: center; min-height: 44px; }
.adm .gsum { background: #fff; border: 1px solid var(--border); border-radius: 16px; padding: 14px; margin-bottom: 12px; }
.adm .gsum .nm { font-size: 20px; font-weight: 800; color: var(--navy-text); }
.adm .gsum .mt { color: var(--muted); font-size: 13px; line-height: 1.8; margin: 4px 0 12px; }
.adm .gcard { background: #fff; border: 1px solid var(--border); border-radius: 14px; padding: 12px 14px; margin-bottom: 10px; }
.adm .gcard .gr { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.adm .gcard .gn { font-size: 17px; font-weight: 800; color: var(--navy-text); }
.adm .gcard .gm { color: var(--muted); font-size: 13px; margin: 4px 0 10px; line-height: 1.7; }
.adm .gcard .ga { display: flex; gap: 8px; }
.adm .gcard .ga .btn { flex: 1; justify-content: center; min-height: 42px; }
.adm .prog { height: 8px; background: #dfe6f3; border-radius: 99px; margin: 6px 0 12px; overflow: hidden; }
.adm .prog i { display: block; height: 8px; background: #4169E1; border-radius: 99px; }

@media (max-width: 768px) {
  .adm .adm-d { display: none !important; }
  .adm .adm-top .title { font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
  .adm main.content { padding-bottom: 96px; }
  .adm .adm-bn { display: flex; position: fixed; bottom: 0; inset-inline: 0; z-index: 50; background: #fff; border-top: 1px solid var(--border); padding: 6px 4px max(10px, env(safe-area-inset-bottom)); }
  .adm .adm-bn a, .adm .adm-bn button { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; font: inherit; font-size: 12px; font-weight: 700; color: var(--muted); text-decoration: none; background: none; border: 0; padding: 6px 2px; min-height: 48px; cursor: pointer; }
  .adm .adm-bn a.on { color: #4169E1; }
  .adm .adm-bn form { flex: 1; display: flex; }
  .adm .adm-bn .i { width: 22px; height: 22px; }
  .adm .gtable-wrap { display: none; }
  .adm .gcards { display: block; }
  .adm .qcards { display: block; }
  .adm .qtable-wrap { display: none; }
  .adm .tabs { overflow-x: auto; flex-wrap: nowrap; white-space: nowrap; }
  .adm .grid.two, .adm .grid.three { grid-template-columns: 1fr; }
  .adm .out-dock { position: fixed; inset-inline: 0; bottom: 64px; z-index: 40; background: #fff; border-top: 1px solid var(--border); padding: 10px 12px; margin: 0 !important; display: flex !important; flex-wrap: wrap; gap: 8px !important; }
  .adm .out-dock form:first-child { flex: 1 1 100%; }
  .adm .out-dock form:first-child .btn { width: 100%; font-size: 1.15rem !important; padding: 14px !important; justify-content: center; }
  .adm .out-dock form:not(:first-child) { flex: 1; }
  .adm .out-dock form:not(:first-child) .btn { width: 100%; justify-content: center; min-height: 44px; }
  .adm main.content.has-dock { padding-bottom: 190px; }
  .adm .out-stats { display: none; }
}
@media (min-width: 769px) {
  .adm .gtable-wrap table { table-layout: auto !important; min-width: 0 !important; width: 100%; }
  .adm .gtable-wrap .table-scroll { overflow-x: visible; }
}
.adm .adm-m { display: none; }
@media (max-width: 768px) {
  .adm .adm-m { display: block; }
  .adm main.content:has(.out-dock) { padding-bottom: 200px; }
}
@media (max-width: 768px) {
  .adm .stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .adm .stat { padding: 8px 10px; min-height: 0; }
  .adm .stat .ico { display: none; }
  .adm .stat .value { font-size: 20px; }
  .adm .stat .label { font-size: 11.5px; }
  .adm .qa > a.btn { flex: 1; width: auto; }
}

.push-ask { position: fixed; z-index: 60; inset-inline: 12px; top: 68px; bottom: auto; max-width: 460px; margin-inline: auto; background: #fff; border: 1px solid var(--border); border-radius: 16px; padding: 14px; box-shadow: 0 10px 30px rgba(16, 32, 64, .22); display: flex; flex-direction: column; gap: 10px; }
.push-ask.hidden { display: none; }
.push-ask-txt { display: flex; flex-direction: column; gap: 4px; color: var(--navy-text); font-size: 14px; line-height: 1.6; }
.push-ask-txt b { font-size: 16px; }
.push-ask-btns { display: flex; gap: 8px; }
.push-ask-btns .btn { flex: 1; justify-content: center; min-height: 40px; }
@media (min-width: 769px) { .push-ask { top: auto; bottom: 20px; inset-inline: auto; right: 20px; left: auto; width: 400px; margin-inline: 0; } }
.act-hero { display: flex; align-items: center; gap: 10px; background: var(--navy); color: #fff; border-radius: 14px; padding: 9px 14px; margin-bottom: 12px; font-weight: 700; font-size: 13.5px; }
.act-hero.paid { background: #0a8a5a; }
.act-hero .ah-cd { background: rgba(255, 255, 255, .14); border-radius: 9px; padding: 2px 10px; font-weight: 800; }
.act-hero .ah-s { margin-inline-start: auto; opacity: .8; font-weight: 500; }
.pp-country { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.pp-link { background: none; border: 0; color: var(--blue); font: inherit; font-weight: 800; cursor: pointer; padding: 4px 8px; }
.pp-seg { display: flex; background: #e6ecf6; border-radius: 14px; padding: 4px; margin-bottom: 12px; }
.pp-seg button { flex: 1; border: 0; background: transparent; font: inherit; font-weight: 800; font-size: 14px; color: var(--muted); padding: 9px 4px; border-radius: 11px; cursor: pointer; white-space: nowrap; }
.pp-seg button.on { background: #fff; color: var(--blue); box-shadow: 0 2px 6px rgba(16, 32, 64, .14); }
.pp-sv { display: inline-block; background: var(--green-50); color: var(--green-dark); border-radius: 99px; padding: 0 8px; font-size: 12px; font-weight: 800; margin-inline-start: 4px; }
.pp-cards { display: flex; flex-direction: column; gap: 11px; }
.pp-card { display: flex; gap: 12px; background: #fff; border: 2px solid var(--border); border-radius: 18px; padding: 13px 14px; cursor: pointer; }
.pp-card.sel { border-color: var(--blue); background: linear-gradient(180deg, #fff, var(--blue-50)); box-shadow: 0 6px 18px rgba(47, 111, 252, .16); }
.pp-radio { flex: none; width: 22px; height: 22px; border-radius: 50%; border: 2px solid #c3cde0; margin-top: 4px; display: flex; align-items: center; justify-content: center; }
.pp-card.sel .pp-radio { background: var(--blue); border-color: var(--blue); }
.pp-card.sel .pp-radio::after { content: "✓"; color: #fff; font-size: 13px; font-weight: 800; line-height: 1; }
.pp-main { flex: 1; min-width: 0; }
.pp-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.pp-name { font-size: 19px; font-weight: 800; color: var(--navy-text); }
.pp-name { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.pp-tag { display: inline-block; white-space: nowrap; background: var(--blue); color: #fff; font-weight: 800; font-size: 11.5px; line-height: 1.7; border-radius: 8px; padding: 1px 9px; }
.pp-price { display: flex; align-items: baseline; gap: 5px; flex-wrap: wrap; justify-content: flex-end; }
.pp-big { font-size: 30px; font-weight: 800; line-height: 1.1; color: #0f1e3d; }
.pp-price small { font-size: 12px; font-weight: 700; color: var(--muted); }
.pp-strike { text-decoration: line-through; color: #9aa5bd; font-size: 14px; font-weight: 700; }
.pp-sv { white-space: nowrap; }
.pp-charge { color: var(--muted); font-size: 12.5px; font-weight: 600; margin: 2px 0 6px; }
.pp-feat { display: flex; flex-direction: column; gap: 3px; font-weight: 600; font-size: 13.5px; }
.pp-feat div::before { content: "✓"; color: var(--green-dark); font-weight: 800; margin-inline-end: 8px; }
.pp-btn { display: none; }
.pp-dock { position: sticky; bottom: 12px; z-index: 20; margin: 8px -8px 0; }
@media (max-width: 860px) { body:has(.bottom-nav) .pp-dock { bottom: calc(var(--bottom-h) + var(--safe-bottom) + 8px); } }
.pp-go { width: 100%; border: 0; background: var(--green); color: #fff; font: inherit; font-weight: 800; font-size: 17px; padding: 13px; border-radius: 13px; cursor: pointer; box-shadow: 0 5px 14px rgba(1, 181, 116, .35); }
.pp-dsub { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 4px 8px; margin-top: 10px; }
.pp-foot { margin: 0; font-size: 12px; color: var(--muted); font-weight: 600; }
.pp-dsub .pp-link { font-size: 12.5px; padding: 2px 4px; white-space: nowrap; }
.pp-cards[data-period="monthly"] [data-p]:not([data-p="monthly"]),
.pp-cards[data-period="quarter"] [data-p]:not([data-p="quarter"]),
.pp-cards[data-period="year"] [data-p]:not([data-p="year"]) { display: none; }
.pp-charge { color: #7a869e; }
