/* Spark Gym — التطبيق. الألوان: أبيض، أسود، أخضر. */
:root {
	--black: #0b0b0b;
	--ink: #141414;
	--ink-2: #2a2a2a;
	--muted: #6b6f6c;
	--line: #e6e8e6;
	--bg: #f5f6f5;
	--white: #ffffff;
	--green: #16c060;
	--green-d: #0e8f46;
	--green-l: #e8f9ef;
	--warn: #d98a00;
	--warn-l: #fff5e0;
	--bad: #d93a3a;
	--bad-l: #fdecec;
	--radius: 14px;
	--shadow: 0 1px 2px rgba(0,0,0,.04), 0 4px 16px rgba(0,0,0,.04);
	--side: 250px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
	font-family: "Cairo", system-ui, -apple-system, "Segoe UI", Tahoma, sans-serif;
	font-size: 15px;
	line-height: 1.55;
	color: var(--ink);
	background: var(--bg);
	-webkit-font-smoothing: antialiased;
}
a { color: var(--green-d); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0 0 .5rem; line-height: 1.25; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.05rem; font-weight: 700; }
p { margin: 0 0 .5rem; }
.sg-muted { color: var(--muted); }
.sg-small { font-size: .85rem; }
.sg-center { text-align: center; }
.sg-mt { margin-top: 1rem; }
.sg-mb { margin-bottom: 1rem; }
.sg-inline { display: inline; }
.sg-warn-text { color: var(--warn); }
input, select, textarea, button { font: inherit; color: inherit; }

/* ---------- الهيكل ---------- */
.sg-shell { display: flex; min-height: 100vh; }
.sg-side {
	width: var(--side);
	flex: 0 0 var(--side);
	background: var(--black);
	color: #d9d9d9;
	display: flex;
	flex-direction: column;
	position: sticky;
	top: 0;
	height: 100vh;
	overflow-y: auto;
	padding: 18px 12px;
}
.sg-brand { display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 800; font-size: 1.15rem; padding: 4px 8px 18px; text-decoration: none !important; }
.sg-logo {
	display: inline-grid; place-items: center;
	width: 34px; height: 34px; border-radius: 10px;
	background: var(--green); color: var(--black);
	font-weight: 900; font-size: 1.1rem; font-family: system-ui, sans-serif;
}
.sg-nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.sg-nav-label { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: #7c7c7c; padding: 14px 10px 4px; }
.sg-nav a {
	display: flex; align-items: center; gap: 10px;
	padding: 9px 10px; border-radius: 10px;
	color: #cfcfcf; text-decoration: none; font-weight: 600; font-size: .93rem;
}
.sg-nav a:hover { background: #1b1b1b; color: #fff; }
.sg-nav a.on { background: var(--green); color: var(--black); }
.sg-side-foot { display: flex; justify-content: space-between; padding: 14px 10px 0; border-top: 1px solid #222; font-size: .88rem; }
.sg-side-foot a { color: #9a9a9a; }
.sg-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.sg-top {
	position: sticky; top: 0; z-index: 20;
	display: flex; align-items: center; gap: 12px;
	padding: 12px 24px;
	background: rgba(255,255,255,.92);
	backdrop-filter: blur(8px);
	border-bottom: 1px solid var(--line);
}
.sg-top h1 { font-size: 1.2rem; margin: 0; flex: 1; }
.sg-top-actions { display: flex; align-items: center; gap: 10px; }
.sg-burger { display: none; background: none; border: 0; padding: 4px; cursor: pointer; }
.sg-bell { position: relative; color: var(--ink); display: inline-flex; padding: 6px; }
.sg-bell b { position: absolute; top: -2px; inset-inline-end: -4px; background: var(--green); color: var(--black); border-radius: 99px; font-size: .7rem; min-width: 18px; height: 18px; display: grid; place-items: center; padding: 0 4px; }
.sg-me { display: flex; flex-direction: column; line-height: 1.2; color: var(--ink); text-decoration: none !important; }
.sg-me-name { font-weight: 700; font-size: .9rem; }
.sg-me-role { font-size: .75rem; color: var(--muted); }
.sg-content { padding: 22px 24px 60px; max-width: 1280px; width: 100%; }
.sg-overlay { display: none; }

/* ---------- عناصر عامة ---------- */
.sg-card {
	background: var(--white);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	padding: 18px;
	margin-bottom: 16px;
	box-shadow: var(--shadow);
}
.sg-card-flush { padding: 0; overflow: hidden; }
.sg-empty { text-align: center; color: var(--muted); padding: 28px 16px; }
.sg-grid { display: grid; gap: 16px; }
.sg-grid > .sg-card { margin-bottom: 0; }
.sg-grid { margin-bottom: 16px; }
.sg-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.sg-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.sg-row-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.sg-stack > * + * { margin-top: 0; }
.sg-h2 { font-size: 1rem; color: var(--muted); font-weight: 700; margin: 22px 0 10px; }
.sg-h2:first-child { margin-top: 0; }

.sg-btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 6px;
	padding: 9px 16px; border-radius: 10px; border: 1px solid transparent;
	font-weight: 700; font-size: .92rem; cursor: pointer; text-decoration: none !important;
	transition: transform .05s, background .15s;
	white-space: nowrap;
}
.sg-btn:active { transform: translateY(1px); }
.sg-btn-primary { background: var(--green); color: var(--black); }
.sg-btn-primary:hover { background: #12a853; }
.sg-btn-dark { background: var(--black); color: #fff; }
.sg-btn-dark:hover { background: var(--ink-2); }
.sg-btn-ghost { background: var(--white); border-color: var(--line); color: var(--ink); }
.sg-btn-ghost:hover { border-color: #c9cdc9; }
.sg-btn-warn { background: var(--warn); color: #fff; }
.sg-btn-danger { background: var(--bad); color: #fff; }
.sg-btn-wa { background: #1faa55; color: #fff; }
.sg-btn-sm { padding: 5px 10px; font-size: .82rem; border-radius: 8px; }
.sg-btn-xl { padding: 14px 28px; font-size: 1.1rem; border-radius: 12px; }
.sg-btn-block { width: 100%; }
.sg-chip { display: inline-grid; place-items: center; min-width: 34px; height: 30px; padding: 0 8px; border-radius: 8px; border: 1px solid var(--line); background: var(--white); font-weight: 800; font-size: .8rem; cursor: pointer; color: var(--ink); text-decoration: none !important; }
.sg-x { background: none; border: 0; color: var(--muted); font-size: 1.2rem; line-height: 1; cursor: pointer; padding: 2px 6px; border-radius: 6px; }
.sg-x:hover { color: var(--bad); background: var(--bad-l); }

.sg-badge { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: .75rem; font-weight: 700; white-space: nowrap; }
.sg-badge-ok { background: var(--green-l); color: var(--green-d); }
.sg-badge-bad { background: var(--bad-l); color: var(--bad); }
.sg-badge-warn { background: var(--warn-l); color: var(--warn); }
.sg-badge-info { background: #eef1f4; color: #3c4a57; }
.sg-badge-muted { background: #eee; color: #777; }
.sg-tag { display: inline-block; padding: 2px 10px; border-radius: 8px; background: var(--bg); border: 1px solid var(--line); font-size: .8rem; margin-inline-end: 4px; }
.sg-tag-bad { background: var(--bad-l); border-color: #f5caca; color: var(--bad); }
.sg-count { display: inline-block; background: var(--black); color: #fff; border-radius: 99px; font-size: .75rem; padding: 0 8px; margin-inline-start: 6px; vertical-align: middle; }
.sg-debt { color: var(--bad); font-weight: 700; }
.sg-note { background: var(--warn-l); border-radius: 8px; padding: 6px 10px; font-size: .88rem; }

.sg-flash { padding: 11px 14px; border-radius: 10px; margin-bottom: 14px; font-weight: 600; }
.sg-flash-success { background: var(--green-l); color: var(--green-d); border: 1px solid #bfeccf; }
.sg-flash-error { background: var(--bad-l); color: var(--bad); border: 1px solid #f5caca; }

/* ---------- النماذج ---------- */
.sg-field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.sg-field > span { font-size: .85rem; font-weight: 700; color: var(--ink-2); }
.sg-field small { font-size: .75rem; }
input[type=text], input[type=tel], input[type=email], input[type=number], input[type=password], input[type=date], input[type=month], input[type=time], input[type=url], input[type=search], input[type=file], select, textarea {
	width: 100%;
	padding: 9px 12px;
	border: 1px solid #d6d9d6;
	border-radius: 10px;
	background: var(--white);
	min-height: 40px;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--green); outline-offset: -1px; border-color: var(--green); }
input[type=file] { padding: 6px; }
.sg-input-sm { width: 100px !important; min-height: 32px !important; padding: 4px 8px !important; }
.sg-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 14px; }
.sg-form-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.sg-span-2 { grid-column: span 2; }
.sg-check { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; font-size: .92rem; }
.sg-check input { width: 18px; height: 18px; accent-color: var(--green); }
.sg-check-bad { color: var(--bad); }
.sg-checks { display: flex; flex-wrap: wrap; gap: 10px 22px; margin: 4px 0 14px; }
.sg-checks-col { flex-direction: column; }
.sg-seg { display: inline-flex; border: 1px solid #d6d9d6; border-radius: 10px; overflow: hidden; background: var(--white); margin-bottom: 12px; }
.sg-seg label { cursor: pointer; }
.sg-seg input { position: absolute; opacity: 0; pointer-events: none; }
.sg-seg span { display: block; padding: 8px 18px; font-weight: 700; font-size: .9rem; }
.sg-seg input:checked + span { background: var(--black); color: #fff; }
.sg-inline-form { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.sg-inline-form input[type=text], .sg-inline-form select { width: auto; }
.sg-actions-bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.sg-total { font-weight: 800; font-size: 1.1rem; padding: 8px 0; }
.sg-total-inline { font-weight: 700; margin-inline-start: auto; }
.sg-filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.sg-filters input[type=search] { flex: 1 1 240px; width: auto; }
.sg-filters select, .sg-filters input[type=date], .sg-filters input[type=month] { width: auto; }
.sg-filters label { display: inline-flex; align-items: center; gap: 6px; font-size: .88rem; }
.sg-details summary { cursor: pointer; font-weight: 700; color: var(--green-d); margin: 10px 0; }
.sg-pop { position: relative; display: inline-block; }
.sg-pop summary { list-style: none; }
.sg-pop summary::-webkit-details-marker { display: none; }
.sg-pop-body { position: absolute; z-index: 30; inset-inline-end: 0; top: calc(100% + 6px); background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.12); display: flex; flex-direction: column; gap: 8px; width: 240px; }

/* ---------- الجداول ---------- */
.sg-table-wrap { overflow-x: auto; }
.sg-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.sg-table th { text-align: start; font-size: .78rem; color: var(--muted); font-weight: 700; padding: 10px 12px; border-bottom: 1px solid var(--line); background: #fafbfa; white-space: nowrap; }
.sg-table td { padding: 10px 12px; border-bottom: 1px solid #f0f1f0; vertical-align: middle; }
.sg-table tr:last-child td { border-bottom: 0; }
.sg-table-hover tbody tr:hover { background: #fafcfb; cursor: pointer; }
.sg-table-compact td { padding: 7px 4px; }
.sg-num { text-align: end; font-variant-numeric: tabular-nums; white-space: nowrap; }
.sg-tr-total td { font-weight: 800; border-top: 2px solid var(--ink); }
.sg-row-muted td { opacity: .5; }
.sg-row-warn td { background: #fffaf0; }
.sg-td-actions { white-space: nowrap; }
.sg-td-actions > * { display: inline-flex; vertical-align: middle; margin-inline-end: 4px; }
.sg-person { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); }
.sg-person span { display: flex; flex-direction: column; line-height: 1.2; }
.sg-pages { display: flex; gap: 4px; justify-content: center; margin: 10px 0; flex-wrap: wrap; }
.sg-pages a { padding: 4px 10px; border-radius: 8px; border: 1px solid var(--line); background: #fff; color: var(--ink); }
.sg-pages a.on { background: var(--black); color: #fff; border-color: var(--black); }
.sg-list { list-style: none; margin: 0; padding: 0; }
.sg-list li { padding: 8px 0; border-bottom: 1px solid #f0f1f0; }
.sg-list li:last-child { border-bottom: 0; }
.sg-list li a { display: flex; align-items: center; gap: 8px; color: var(--ink); }
.sg-list-tight li { padding: 5px 0; }
.sg-chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.sg-chips li { background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 3px 10px; font-size: .82rem; }
.sg-chips li.warn { background: var(--warn-l); border-color: #f2d9a6; }

/* ---------- الصور الرمزية ---------- */
.sg-avatar { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; flex: 0 0 auto; background: var(--black); }
.sg-avatar-empty { display: inline-grid; place-items: center; color: var(--green); font-weight: 800; }
.sg-avatar-sm { width: 32px; height: 32px; font-size: .85rem; }
.sg-avatar-lg { width: 84px; height: 84px; font-size: 1.8rem; }
.sg-avatar-xl { width: 120px; height: 120px; font-size: 2.6rem; border-radius: 18px; }

/* ---------- لوحة المؤشرات ---------- */
.sg-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-bottom: 16px; }
.sg-kpi { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; }
.sg-kpi span { font-size: .8rem; color: var(--muted); font-weight: 600; }
.sg-kpi b { font-size: 1.45rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.sg-kpi .sg-small-b, .sg-small-b { font-size: 1rem; }
.sg-kpi-accent { background: var(--black); border-color: var(--black); }
.sg-kpi-accent span { color: #a8a8a8; }
.sg-kpi-accent b { color: var(--green); }
.sg-quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
.sg-quick-btn { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 18px 10px; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); color: var(--ink); font-weight: 700; text-decoration: none !important; }
.sg-quick-btn svg { width: 28px; height: 28px; }
.sg-quick-btn:hover { border-color: var(--green); }
.sg-quick-main { background: var(--green); border-color: var(--green); color: var(--black); }
.sg-hello { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.sg-link-card { display: flex; gap: 14px; align-items: center; color: var(--ink); text-decoration: none !important; }
.sg-link-card svg { width: 34px; height: 34px; color: var(--green-d); }
.sg-link-card:hover { border-color: var(--green); }
.sg-sub-card { border-top: 4px solid var(--green); }
.sg-sub-expired, .sg-sub-used { border-top-color: var(--bad); }
.sg-sub-upcoming { border-top-color: #9aa5ae; }
.sg-sub-stats { display: flex; gap: 22px; margin-top: 10px; flex-wrap: wrap; }
.sg-sub-stats div { display: flex; flex-direction: column; }
.sg-sub-stats b { font-size: 1.6rem; font-weight: 800; line-height: 1.1; }
.sg-sub-stats span { font-size: .78rem; color: var(--muted); }

/* ---------- مكتب الدخول ---------- */
.sg-desk { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
.sg-desk:not(:has(.sg-desk-side)) { grid-template-columns: minmax(0, 860px); }
.sg-scan { display: flex; gap: 8px; margin-bottom: 10px; }
.sg-scan-btn { min-height: 52px; margin-bottom: 16px; display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 1.05rem; }
.sg-ticket-form { display: grid; grid-template-columns: 1fr auto auto; gap: 12px; align-items: end; }
.sg-ticket-price { display: block; font-size: 1.25rem; padding: 6px 0; }
/* داخل القاعة */
.sg-inside { list-style: none; margin: 0; padding: 0; }
.sg-inside-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "who act" "meta act"; gap: 2px 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.sg-inside-row:last-child { border-bottom: 0; }
.sg-inside-who { grid-area: who; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sg-inside-meta { grid-area: meta; padding-inline-start: 40px; }
.sg-inside-actions { grid-area: act; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.sg-inside-alert { display: none; background: var(--bad-l); color: var(--bad); font-weight: 700; font-size: .8rem; border-radius: 999px; padding: 1px 10px; }
.sg-inside-over .sg-inside-alert { display: inline-block; }
.sg-inside-over .sg-inside-dur { color: var(--bad); }
/* قسم قابل للطي */
.sg-fold > summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.sg-fold > summary::-webkit-details-marker { display: none; }
.sg-fold > summary h3 { margin: 0; }
.sg-fold > summary h3::before { content: "▸ "; color: var(--green-d); }
.sg-fold[open] > summary { margin-bottom: 12px; }
.sg-fold[open] > summary h3::before { content: "▾ "; }
/* المفضلة في البيع */
.sg-favs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.sg-fav-btn { border: 2px solid var(--green); background: var(--green-l); color: var(--green-d); font-weight: 700; border-radius: 12px; padding: 10px 14px; cursor: pointer; min-height: 48px; }
.sg-fav-btn:hover { background: var(--green); color: #fff; }
.sg-fav-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 6px; margin: 10px 0; }
.sg-scan input { font-size: 1.15rem; min-height: 54px; border-width: 2px; border-color: var(--black); }
.sg-scan .sg-btn { min-height: 54px; }
.sg-camera { position: relative; margin-bottom: 16px; border-radius: var(--radius); overflow: hidden; background: #000; }
.sg-camera video { width: 100%; max-height: 360px; display: block; object-fit: cover; }
.sg-camera button { position: absolute; top: 10px; inset-inline-end: 10px; }
.sg-gate { border-width: 2px; }
.sg-gate-ok { border-color: var(--green); }
.sg-gate-bad { border-color: var(--bad); }
.sg-gate-person { display: flex; gap: 18px; align-items: center; margin-bottom: 14px; }
.sg-gate-person > div:nth-child(2) { flex: 1; }
.sg-gate-light { width: 74px; height: 74px; border-radius: 50%; display: grid; place-items: center; font-size: 2.2rem; font-weight: 900; color: #fff; flex: 0 0 auto; }
.sg-gate-ok .sg-gate-light { background: var(--green); color: var(--black); }
.sg-gate-bad .sg-gate-light { background: var(--bad); }
.sg-issue { padding: 9px 12px; border-radius: 10px; font-weight: 700; margin-bottom: 8px; }
.sg-issue-bad { background: var(--bad-l); color: var(--bad); }
.sg-issue-warn { background: var(--warn-l); color: #8a5a00; }
.sg-gate-form { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin-top: 12px; }
.sg-gate-form .sg-field { flex: 1 1 260px; margin: 0; }
.sg-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.sg-tabs a { padding: 7px 14px; border-radius: 99px; background: var(--white); border: 1px solid var(--line); color: var(--ink); font-weight: 700; font-size: .88rem; text-decoration: none !important; }
.sg-tabs a.on { background: var(--black); border-color: var(--black); color: #fff; }
.sg-tabs-inline { margin: 0; }

/* ---------- ملف المشترك ---------- */
.sg-profile-head { display: flex; gap: 18px; align-items: flex-start; flex-wrap: wrap; }
.sg-profile-info { flex: 1 1 280px; }
.sg-profile-actions { display: flex; flex-wrap: wrap; gap: 6px; }

/* ---------- البطاقة ---------- */
.sg-member-card-wrap { max-width: 380px; margin: 0 auto; }
.sg-member-card { background: var(--black); color: #fff; border-radius: 22px; padding: 22px; margin-bottom: 14px; box-shadow: 0 20px 40px rgba(0,0,0,.2); }
.sg-mc-head { display: flex; align-items: center; gap: 10px; font-size: 1.1rem; margin-bottom: 18px; }
.sg-mc-body { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.sg-mc-body h2 { margin: 0; font-size: 1.25rem; }
.sg-mc-body p { margin: 0; color: var(--green); font-weight: 700; letter-spacing: .04em; }
.sg-mc-qr { background: #fff; border-radius: 16px; padding: 10px; display: grid; place-items: center; }
.sg-mc-qr svg { width: 100%; height: auto; max-width: 260px; }
.sg-mc-code { text-align: center; font-family: ui-monospace, monospace; color: #9a9a9a; margin: 10px 0 0; font-size: .85rem; letter-spacing: .1em; }

/* ---------- المتجر ---------- */
.sg-pos-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; margin-bottom: 90px; }
.sg-pos-item { background: var(--white); border: 2px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; }
.sg-pos-item.has { border-color: var(--green); }
.sg-pos-item.out { opacity: .5; }
.sg-pos-add { background: none; border: 0; padding: 14px; text-align: start; cursor: pointer; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.sg-pos-add b { font-size: 1rem; }
.sg-pos-add span { font-weight: 800; color: var(--green-d); }
.sg-pos-qty { display: flex; border-top: 1px solid var(--line); }
.sg-pos-qty button { width: 44px; border: 0; background: var(--bg); font-size: 1.2rem; font-weight: 800; cursor: pointer; }
.sg-pos-qty input { border: 0 !important; border-radius: 0 !important; text-align: center; font-weight: 800; min-height: 40px; }
.sg-pos-bar { position: fixed; bottom: 0; inset-inline: var(--side) 0; background: var(--black); color: #fff; padding: 12px 24px; display: flex; justify-content: space-between; align-items: center; z-index: 15; }
[dir=ltr] .sg-pos-bar { left: var(--side); right: 0; }
[dir=rtl] .sg-pos-bar { right: var(--side); left: 0; }
.sg-pos-total { font-size: 1.8rem; color: var(--green); font-variant-numeric: tabular-nums; }

/* ---------- البرامج ---------- */
.sg-prog-head { margin-bottom: 14px; }
.sg-day summary { cursor: pointer; display: flex; align-items: center; gap: 10px; list-style: none; }
.sg-day summary::-webkit-details-marker { display: none; }
.sg-day-n { width: 30px; height: 30px; border-radius: 8px; background: var(--black); color: var(--green); display: grid; place-items: center; font-weight: 800; }
.sg-ex-list { margin: 14px 0 0; padding-inline-start: 22px; }
.sg-ex-list li { padding: 10px 0; border-bottom: 1px solid #f0f1f0; }
.sg-ex-list li:last-child { border-bottom: 0; }
.sg-ex-name { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.sg-ex-meta { display: flex; gap: 14px; flex-wrap: wrap; font-size: .88rem; color: var(--muted); }
.sg-ex-meta b { color: var(--ink); }
.sg-meals { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.sg-meals .sg-card { margin: 0; }
.sg-meal-items { margin: 6px 0 0; padding-inline-start: 18px; }
.sg-note-card { background: var(--green-l); border-color: #bfeccf; }

/* محرر البرامج */
.sg-ed-day { border: 1px solid var(--line); border-radius: var(--radius); background: #fff; padding: 14px; margin-bottom: 12px; }
.sg-ed-day-head { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; }
.sg-ed-day-head input { flex: 1; font-weight: 700; }
.sg-ed-row { display: grid; grid-template-columns: minmax(160px, 2.2fr) 70px 90px 80px minmax(100px, 1.5fr) auto; gap: 6px; margin-bottom: 6px; align-items: center; }
.sg-ed-row.sg-ed-head { font-size: .75rem; color: var(--muted); font-weight: 700; }
.sg-ed-row input { min-height: 36px; padding: 6px 8px; }
.sg-ed-meal { display: grid; grid-template-columns: 1.5fr 100px 90px auto; gap: 6px; margin-bottom: 6px; }
.sg-ed-meal textarea { grid-column: 1 / -1; }
.sg-ed-tools { display: flex; gap: 4px; }
.sg-ed-tools button { border: 1px solid var(--line); background: #fff; border-radius: 6px; cursor: pointer; padding: 2px 7px; }

/* أوقات الأسبوع */
.sg-week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; }
.sg-week-day { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 10px; display: flex; flex-direction: column; gap: 6px; }
.sg-slot { display: flex; flex-direction: column; border-radius: 8px; padding: 5px 8px; font-weight: 700; font-size: .85rem; direction: ltr; text-align: center; }
.sg-slot small { font-weight: 600; font-size: .72rem; }
.sg-slot-male { background: var(--black); color: #fff; }
.sg-slot-female { background: var(--green); color: var(--black); }
.sg-slot-mixed { background: var(--bg); border: 1px solid var(--line); }

/* التقارير */
.sg-bar-col { width: 40%; }
.sg-bar { display: block; height: 7px; border-radius: 4px; margin: 2px 0; min-width: 1px; }
.sg-bar-in { background: var(--green); }
.sg-bar-out { background: var(--black); }
.sg-legend { display: flex; gap: 16px; font-size: .82rem; margin-bottom: 8px; }
.sg-legend span::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-inline-end: 6px; vertical-align: middle; }
.sg-legend-in::before { background: var(--green); }
.sg-legend-out::before { background: var(--black); }

/* التنبيهات */
.sg-notifs { list-style: none; margin: 0; padding: 0; }
.sg-notifs li { display: flex; justify-content: space-between; gap: 10px; padding: 12px 16px; border-bottom: 1px solid #f0f1f0; }
.sg-notifs li.unread { background: var(--green-l); font-weight: 700; }
.sg-notifs li a { color: var(--ink); }

/* ---------- صفحة الدخول ---------- */
.sg-login-page { background: var(--black); min-height: 100vh; }
.sg-login-wrap { min-height: 100vh; display: grid; grid-template-columns: 1fr 440px; }
.sg-login-side { padding: 48px; color: #fff; display: flex; flex-direction: column; justify-content: center; background: radial-gradient(circle at 20% 20%, rgba(22,192,96,.25), transparent 50%), var(--black); }
.sg-brand-lg { font-size: 1.6rem; padding: 0; margin-bottom: 26px; }
.sg-brand-lg .sg-logo { width: 46px; height: 46px; font-size: 1.4rem; }
.sg-login-tag { font-size: 2.2rem; font-weight: 800; line-height: 1.2; max-width: 520px; margin-bottom: 28px; }
.sg-login-roles { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; color: #bdbdbd; }
.sg-login-roles b { color: var(--green); }
.sg-login-card { background: #fff; padding: 48px 40px; display: flex; flex-direction: column; justify-content: center; gap: 4px; }
.sg-login-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.sg-login-head h1 { margin: 0; font-size: 1.6rem; }
.sg-login-card .sg-btn-block { margin: 12px 0; padding: 13px; font-size: 1.05rem; }

/* ---------- الجوال ---------- */
@media (max-width: 1100px) {
	.sg-form-grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.sg-desk { grid-template-columns: 1fr; }
	.sg-grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.sg-week { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 860px) {
	.sg-side { position: fixed; z-index: 50; inset-block: 0; transform: translateX(110%); transition: transform .2s; height: 100%; }
	[dir=rtl] .sg-side { right: 0; }
	[dir=ltr] .sg-side { left: 0; transform: translateX(-110%); }
	.sg-nav-open .sg-side { transform: none; }
	.sg-nav-open .sg-overlay { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 40; }
	.sg-burger { display: inline-flex; }
	.sg-top { padding: 10px 14px; }
	.sg-me { display: none; }
	.sg-content { padding: 16px 14px 80px; }
	.sg-grid-2, .sg-grid-3, .sg-form-grid, .sg-form-grid-4 { grid-template-columns: 1fr; }
	.sg-span-2 { grid-column: auto; }
	.sg-quick { grid-template-columns: repeat(2, 1fr); }
	.sg-pos-bar { left: 0 !important; right: 0 !important; padding: 10px 14px; }
	.sg-login-wrap { grid-template-columns: 1fr; }
	.sg-login-side { padding: 32px 24px 12px; }
	.sg-login-tag { font-size: 1.5rem; margin-bottom: 12px; }
	.sg-login-roles { display: none; }
	.sg-login-card { padding: 28px 22px; border-radius: 22px 22px 0 0; }
	.sg-week { grid-template-columns: repeat(2, 1fr); }
	.sg-ed-row { grid-template-columns: 1fr 1fr 1fr; }
	.sg-ed-row > :first-child, .sg-ed-row > :nth-child(5) { grid-column: 1 / -1; }
	.sg-ed-row.sg-ed-head { display: none; }
	.sg-gate-person { flex-wrap: wrap; }
	.sg-avatar-xl { width: 96px; height: 96px; }
	.sg-scan { flex-wrap: wrap; }
	.sg-ticket-form { grid-template-columns: 1fr 1fr; }
	.sg-ticket-form .sg-btn { grid-column: 1 / -1; }
	.sg-inside-row { grid-template-columns: 1fr; grid-template-areas: "who" "meta" "act"; }
	.sg-inside-actions { justify-content: flex-start; padding-inline-start: 40px; }
}

/* ---------- الصندوقان والمكمّلات والتقارير ---------- */
a.sg-kpi { color: inherit; text-decoration: none !important; }
a.sg-kpi:hover { border-color: var(--green); }
.sg-kpi-bad b { color: var(--bad); }
.sg-kpis-sm .sg-kpi b { font-size: 1.15rem; }
.sg-in { color: #0d8a43; }
.sg-card-warn { border-color: var(--warn); box-shadow: inset 4px 0 0 var(--warn); }
[dir="rtl"] .sg-card-warn { box-shadow: inset -4px 0 0 var(--warn); }
.sg-sale-table select, .sg-sale-table input { min-width: 0; }
.sg-sale-table td:first-child select { min-width: 180px; }
.sg-sale-table td:nth-child(2) select { min-width: 125px; }
.sg-sale-table td:nth-child(3) input { min-width: 80px; }
.sg-inline-form select[name="box"] { min-width: 140px; }
.sg-inline-form { flex-wrap: nowrap; }
.sg-sale-table small { display: block; margin-top: 2px; }
.sg-row-bad td { background: #fff1f1; }
.sg-sale-debt { color: var(--bad); font-weight: 700; }
.sg-pad { padding: 14px 16px 0; }
.sg-tools { display: inline-flex; gap: 6px; }
.sg-print-title { display: none; }
.sg-hours { display: flex; align-items: flex-end; gap: 4px; height: 170px; padding-top: 8px; overflow-x: auto; }
.sg-hour { flex: 1 0 26px; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 2px; }
.sg-hour-bar { width: 100%; min-height: 2px; background: var(--green); border-radius: 4px 4px 0 0; }
.sg-hour b { font-size: .72rem; }
.sg-hour small { font-size: .7rem; color: var(--muted); }
h4 { margin: 14px 0 6px; font-size: .95rem; }

/* ---------- الاشتراك عن بعد ---------- */
.sg-flash-warn { background: var(--warn-l); color: #8a5800; border: 1px solid #f3dca8; gap: 10px; flex-wrap: wrap; }
.sg-nav-count { margin-inline-start: auto; background: var(--bad); color: #fff; border-radius: 99px; font-size: .72rem; min-width: 20px; padding: 0 6px; text-align: center; line-height: 20px; }
.sg-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.sg-plan-sec { margin: 12px 0 6px; font-weight: 700; }
.sg-plan-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.sg-plan-opt { cursor: pointer; position: relative; }
.sg-plan-opt input { position: absolute; opacity: 0; pointer-events: none; }
.sg-plan-opt > span { display: flex; flex-direction: column; gap: 2px; height: 100%; padding: 12px 14px; border: 2px solid var(--line); border-radius: 12px; background: var(--white); transition: border-color .15s, background .15s; }
.sg-plan-opt em { font-style: normal; font-weight: 800; font-size: 1.15rem; color: var(--green-d); }
.sg-plan-opt:hover > span { border-color: #b9c2bb; }
.sg-plan-opt input:checked + span { border-color: var(--green); background: var(--green-l); }
.sg-plan-opt input:focus-visible + span { outline: 2px solid var(--black); outline-offset: 2px; }
.sg-pay-box { border: 1px dashed #c9cfca; border-radius: 12px; padding: 6px 14px; background: #fafbfa; }
.sg-pay-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.sg-pay-row:last-child { border-bottom: 0; }
.sg-pay-row > span { color: var(--muted); min-width: 130px; }
.sg-pay-amount { font-size: 1.3rem; color: var(--green-d); }
.sg-pay-rip { font-family: ui-monospace, Consolas, monospace; letter-spacing: .04em; word-break: break-all; }
.sg-step-nav { display: flex; gap: 10px; justify-content: flex-end; margin-top: 16px; }
.sg-join-page { background: var(--bg); min-height: 100vh; }
.sg-join-top { display: flex; justify-content: space-between; align-items: center; padding: 12px 20px; background: var(--black); }
.sg-join-top .sg-brand { padding: 0; }
.sg-join-main { max-width: 760px; margin: 0 auto; padding: 24px 16px 60px; }
.sg-join-title { font-size: 1.6rem; margin-bottom: 14px; }
.sg-steps { display: flex; gap: 8px; list-style: none; padding: 0; margin: 0 0 16px; counter-reset: st; }
.sg-steps li { flex: 1; counter-increment: st; padding: 8px 10px; border-radius: 10px; background: var(--white); border: 1px solid var(--line); font-weight: 700; font-size: .9rem; color: var(--muted); }
.sg-steps li::before { content: counter(st) ". "; }
.sg-steps li.on { background: var(--black); color: #fff; border-color: var(--black); }
.sg-steps li.done { background: var(--green-l); color: var(--green-d); border-color: #bfeccf; }
.sg-join-done { text-align: center; padding: 36px 24px; }
.sg-join-done p { max-width: 520px; margin-inline: auto; }
.sg-join-done .sg-btn { margin-top: 12px; }
.sg-done-icon { width: 64px; height: 64px; margin: 0 auto 12px; border-radius: 50%; background: var(--green); color: var(--black); display: grid; place-items: center; font-size: 2rem; font-weight: 900; }
.sg-done-wait { background: var(--warn-l); }
.sg-locked { text-align: center; padding: 36px 24px; }
.sg-locked-icon { font-size: 2.6rem; margin-bottom: 6px; }
.sg-locked .sg-flash { max-width: 520px; margin: 12px auto; }
.sg-locked-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 14px; }
.sg-proof-img { max-width: 100%; max-height: 520px; border-radius: 10px; border: 1px solid var(--line); display: block; }
.sg-proof-pdf { width: 100%; height: 520px; border: 1px solid var(--line); border-radius: 10px; }
.sg-signup-photo { width: 120px; height: 120px; object-fit: cover; border-radius: 12px; }
.sg-fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.sg-reject summary { list-style: none; display: inline-flex; cursor: pointer; }
.sg-reject summary::-webkit-details-marker { display: none; }
/* SMS */
.sg-btn-sms { background: #1f6feb; color: #fff; display: inline-flex; align-items: center; gap: 5px; }
.sg-btn-sms:hover { background: #1958c0; color: #fff; text-decoration: none; }
.sg-msg-btns { white-space: nowrap; }
.sg-msg-btns .sg-btn + .sg-btn { margin-inline-start: 6px; }
.sg-sms-card { border-color: #bcd3f7; }
.sg-sms-preview { background: #f2f6fd; border-radius: 12px; padding: 10px 14px; font-size: .92rem; white-space: pre-wrap; }
.sg-sms-card .sg-btn-primary { display: flex; justify-content: center; align-items: center; gap: 6px; }

/* بطاقة مشترك جديد (مكتب الدخول) */
.sg-new-member-btn { margin-bottom: 14px; border: 2px dashed #c9cfca; font-weight: 800; }
.sg-dialog { width: min(760px, 96vw); max-height: 92vh; padding: 0; border: 0; border-radius: 18px; background: var(--bg); color: var(--ink); box-shadow: 0 20px 60px rgba(0,0,0,.35); }
.sg-dialog::backdrop { background: rgba(0,0,0,.55); }
.sg-dialog-head { position: sticky; top: 0; z-index: 2; display: flex; justify-content: space-between; align-items: center; padding: 12px 18px; background: var(--black); color: #fff; }
.sg-dialog-head h2 { margin: 0; font-size: 1.15rem; }
.sg-dialog-head .sg-x { color: #fff; font-size: 1.6rem; background: none; border: 0; cursor: pointer; line-height: 1; padding: 4px 8px; }
.sg-dialog-body { padding: 14px; }
.sg-dialog .sg-actions-bar { position: sticky; bottom: 0; background: var(--bg); padding: 10px 0 4px; margin: 0; }

@media (max-width: 860px) {
	.sg-dialog { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0; border-radius: 0; }
	.sg-dialog-body { padding: 10px; }
	.sg-dialog .sg-field input, .sg-dialog .sg-field select, .sg-dialog .sg-field textarea { font-size: 16px; min-height: 44px; }
	.sg-dialog .sg-actions-bar .sg-btn { flex: 1; min-height: 46px; }
	.sg-table-stack thead { display: none; }
	.sg-table-stack tr { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
	.sg-table-stack td { border: 0 !important; padding: 0 !important; }
	.sg-table-stack td:first-child { flex: 1 1 100%; }
	.sg-table-stack td.sg-msg-btns { flex: 1 1 100%; display: flex; gap: 8px; margin-top: 4px; }
	.sg-table-stack td.sg-msg-btns .sg-btn { flex: 1; justify-content: center; margin: 0 !important; min-height: 40px; }
	.sg-pay-row > span { min-width: 90px; }
	.sg-steps li { font-size: .8rem; padding: 7px 8px; }
}

@media print {
	body { background: #fff; }
	.sg-side, .sg-top, .sg-center, .sg-flash, .sg-no-print, .sg-tools, .sg-filters, .sg-tabs { display: none !important; }
	.sg-content { padding: 0; }
	.sg-print-title { display: block; font-size: 1.1rem; margin: 0 0 12px; }
	.sg-card, .sg-kpi { break-inside: avoid; box-shadow: none; }
	.sg-kpi-accent, .sg-hour-bar { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
	.sg-member-card { box-shadow: none; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
