/* EventOS — الهوية البنفسجية الداكنة (مستوحاة من قالب Muvent): RTL اصيل، Tajawal، بلا ايموجي */
:root {
  --bg: #12062e; --bg-2: #1a0b3d; --bg-3: #24104f; --panel: rgba(255,255,255,.05); --panel-2: rgba(255,255,255,.09);
  --line: rgba(255,255,255,.12); --line-2: rgba(255,255,255,.2);
  --ink: #f4f1fb; --ink-2: #cdc4e6; --ink-3: #9d92bf;
  --magenta: #ff2d95; --violet: #8b3dff; --pink: #ff6bd6; --cyan: #37d6ff; --gold: #ffc857;
  --grad: linear-gradient(135deg, #ff2d95 0%, #8b3dff 100%);
  --grad-soft: linear-gradient(135deg, rgba(255,45,149,.25), rgba(139,61,255,.25));
  --ok: #3ddc97; --ok-soft: rgba(61,220,151,.15); --warn: #ffb547; --warn-soft: rgba(255,181,71,.15); --err: #ff5c7a; --err-soft: rgba(255,92,122,.15); --info: #37d6ff; --info-soft: rgba(55,214,255,.15);
  --radius: 14px; --glow: 0 10px 40px rgba(139,61,255,.35);
}
* { box-sizing: border-box; }
html { font-size: 16px; scroll-behavior: smooth; }
body { margin: 0; font-family: Tajawal, "Segoe UI", Tahoma, system-ui, sans-serif; color: var(--ink); background: var(--bg); line-height: 1.65; direction: rtl; min-height: 100vh;
  background-image: radial-gradient(900px 500px at 85% -10%, rgba(255,45,149,.28), transparent 60%), radial-gradient(800px 600px at 5% 20%, rgba(139,61,255,.28), transparent 60%), radial-gradient(700px 500px at 60% 110%, rgba(55,214,255,.12), transparent 60%); background-attachment: fixed; }
a { color: var(--pink); text-decoration: none; }
a:hover { color: #fff; }
h1, h2, h3, h4 { margin: 0 0 .5rem; line-height: 1.25; font-weight: 800; letter-spacing: -.01em; }
h1 { font-size: 2rem; } h2 { font-size: 1.4rem; } h3 { font-size: 1.1rem; }
p { margin: 0 0 .8rem; }
.muted { color: var(--ink-3); }
.small { font-size: .875rem; }
.num, .ltr { direction: ltr; unicode-bidi: isolate; display: inline-block; }
.mono { font-family: ui-monospace, Consolas, monospace; }
.eyebrow { color: var(--pink); font-weight: 700; letter-spacing: .12em; font-size: .75rem; text-transform: uppercase; margin-bottom: .35rem; display: block; }
.gradient-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* الرأس */
.topbar { position: sticky; top: 0; z-index: 50; backdrop-filter: blur(14px); background: rgba(18,6,46,.7); border-bottom: 1px solid var(--line); }
.topbar-in { max-width: 1240px; margin: 0 auto; padding: .7rem 1.25rem; display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.brand { font-weight: 900; font-size: 1.25rem; color: #fff; display: inline-flex; align-items: center; gap: .5rem; }
.brand b { color: var(--pink); }
.brand-mark { width: 30px; height: 30px; border-radius: 50%; background: var(--grad); display: inline-flex; align-items: center; justify-content: center; box-shadow: var(--glow); }
.brand-mark svg { width: 16px; height: 16px; stroke: #fff; }
.nav { display: flex; gap: .15rem; flex-wrap: wrap; }
.nav a { padding: .4rem .75rem; border-radius: 999px; color: var(--ink-2); font-weight: 600; font-size: .92rem; }
.nav a.active, .nav a:hover { background: var(--panel-2); color: #fff; }
.spacer { flex: 1; }
.wrap { max-width: 1240px; margin: 0 auto; padding: 1.5rem 1.25rem 4rem; }
.wrap-narrow { max-width: 760px; }
.grid { display: grid; gap: 1rem; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.15rem 1.3rem; backdrop-filter: blur(8px); }
.card-glow { position: relative; overflow: hidden; }
.card-glow::before { content: ""; position: absolute; inset: 0; background: var(--grad-soft); opacity: .6; pointer-events: none; }
.card-glow > * { position: relative; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: .8rem; flex-wrap: wrap; }
.stack > * + * { margin-top: 1rem; }
.row { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.row-end { justify-content: flex-end; }

/* المؤشرات */
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.1rem; position: relative; overflow: hidden; }
.stat::after { content: ""; position: absolute; left: -30px; bottom: -30px; width: 90px; height: 90px; border-radius: 50%; background: var(--grad); opacity: .18; filter: blur(12px); }
.stat .label { color: var(--ink-3); font-size: .82rem; }
.stat .value { font-size: 2rem; font-weight: 900; direction: ltr; unicode-bidi: isolate; text-align: right; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stat .sub { color: var(--ink-3); font-size: .8rem; }

/* الازرار */
.btn { display: inline-flex; align-items: center; gap: .45rem; padding: .6rem 1.15rem; border-radius: 999px; border: 1px solid var(--line-2); background: var(--panel-2); color: #fff; font: inherit; font-weight: 700; cursor: pointer; line-height: 1.2; transition: transform .15s, box-shadow .15s, background .15s; }
.btn:hover { background: rgba(255,255,255,.16); transform: translateY(-1px); }
.btn-primary { background: var(--grad); border-color: transparent; box-shadow: var(--glow); }
.btn-primary:hover { filter: brightness(1.08); }
.btn-danger { background: var(--err-soft); border-color: rgba(255,92,122,.5); color: #ffb3c1; }
.btn-warn { background: var(--warn-soft); border-color: rgba(255,181,71,.5); color: #ffd699; }
.btn-sm { padding: .3rem .7rem; font-size: .82rem; }
.btn-block { width: 100%; justify-content: center; }
.btn[disabled] { opacity: .45; cursor: not-allowed; transform: none; }

/* النماذج */
label { display: block; font-weight: 700; margin-bottom: .3rem; font-size: .9rem; color: var(--ink-2); }
.hint { color: var(--ink-3); font-size: .8rem; margin-top: .25rem; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=datetime-local], input[type=search], input[type=file], select, textarea {
  width: 100%; padding: .65rem .85rem; border: 1px solid var(--line-2); border-radius: 12px; font: inherit; background: rgba(0,0,0,.25); color: #fff;
}
select option { color: #111; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--violet); outline-offset: 1px; border-color: var(--violet); }
textarea { min-height: 110px; resize: vertical; }
.field { margin-bottom: 1rem; }
.check { display: flex; align-items: center; gap: .5rem; font-weight: 400; color: var(--ink); }
.check input { width: 1.1rem; height: 1.1rem; accent-color: var(--magenta); }
input[type=datetime-local], input[type=number], input[type=email] { direction: ltr; text-align: right; }
.error { color: var(--err); font-size: .85rem; margin-top: .25rem; }
.is-invalid { border-color: var(--err) !important; }

/* التنبيهات */
.alert { padding: .8rem 1rem; border-radius: 12px; border: 1px solid; margin-bottom: 1rem; }
.alert-ok { background: var(--ok-soft); border-color: rgba(61,220,151,.4); color: #9df0c9; }
.alert-err { background: var(--err-soft); border-color: rgba(255,92,122,.4); color: #ffb3c1; }
.alert-warn { background: var(--warn-soft); border-color: rgba(255,181,71,.4); color: #ffd699; }
.alert-info { background: var(--info-soft); border-color: rgba(55,214,255,.4); color: #a8ecff; }

/* الجداول */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .93rem; }
th, td { text-align: right; padding: .6rem .65rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--ink-3); font-weight: 700; font-size: .8rem; background: rgba(0,0,0,.18); }
tr:hover td { background: rgba(255,255,255,.03); }
td.actions { white-space: nowrap; }
td.actions form { display: inline; }

/* الشارات */
.badge { display: inline-block; padding: .18rem .65rem; border-radius: 999px; font-size: .76rem; font-weight: 700; border: 1px solid transparent; }
.badge-ok { background: var(--ok-soft); color: #9df0c9; border-color: rgba(61,220,151,.4); }
.badge-warn { background: var(--warn-soft); color: #ffd699; border-color: rgba(255,181,71,.4); }
.badge-err { background: var(--err-soft); color: #ffb3c1; border-color: rgba(255,92,122,.4); }
.badge-info { background: var(--info-soft); color: #a8ecff; border-color: rgba(55,214,255,.4); }
.badge-muted { background: var(--panel-2); color: var(--ink-2); border-color: var(--line-2); }
.cat { display: inline-flex; align-items: center; gap: .35rem; padding: .18rem .65rem; border-radius: 999px; color: #fff; font-size: .78rem; font-weight: 700; box-shadow: 0 4px 14px rgba(0,0,0,.25); }
.cat svg { width: 14px; height: 14px; }
.ico { width: 18px; height: 18px; vertical-align: -3px; }

/* الصفحة العامة: البطل */
.hero { position: relative; overflow: hidden; padding: 4.5rem 1.25rem 3.5rem; }
.hero::before { content: ""; position: absolute; inset: 0; background: radial-gradient(600px 300px at 80% 20%, rgba(255,45,149,.35), transparent 60%), radial-gradient(500px 300px at 20% 80%, rgba(139,61,255,.4), transparent 60%); pointer-events: none; }
.hero-in { position: relative; max-width: 1240px; margin: 0 auto; display: grid; grid-template-columns: 1.1fr .9fr; gap: 2rem; align-items: center; }
.hero h1 { font-size: clamp(2rem, 5vw, 3.4rem); margin: .3rem 0 .6rem; line-height: 1.15; }
.hero .lead { color: var(--ink-2); font-size: 1.1rem; max-width: 560px; }
.hero .meta { display: flex; gap: 1.2rem; flex-wrap: wrap; color: var(--ink-2); margin: .8rem 0 1.2rem; }
.hero .meta span { display: inline-flex; align-items: center; gap: .4rem; }
.hero-art { position: relative; min-height: 260px; border-radius: 24px; background: var(--grad); box-shadow: var(--glow); overflow: hidden; }
.hero-art::after { content: ""; position: absolute; inset: 0; background: repeating-radial-gradient(circle at 70% 40%, rgba(255,255,255,.08) 0 2px, transparent 2px 22px); }
.hero-art img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; mix-blend-mode: luminosity; opacity: .85; }
.hero-art .orb { position: absolute; width: 180px; height: 180px; border-radius: 50%; background: rgba(255,255,255,.12); filter: blur(2px); }
.countdown { display: flex; gap: .6rem; margin-top: 1.2rem; }
.countdown .unit { background: rgba(0,0,0,.25); border: 1px solid var(--line-2); border-radius: 14px; padding: .55rem .8rem; min-width: 70px; text-align: center; }
.countdown .n { font-size: 1.6rem; font-weight: 900; direction: ltr; line-height: 1; }
.countdown .u { color: var(--ink-3); font-size: .72rem; margin-top: .2rem; }
.pills { display: flex; gap: .8rem; flex-wrap: wrap; margin-top: 1.4rem; }
.pill { border: 1px solid var(--line-2); border-radius: 999px; padding: .5rem 1rem; display: inline-flex; align-items: center; gap: .6rem; background: rgba(0,0,0,.2); }
.pill .n { font-weight: 900; font-size: 1.15rem; direction: ltr; }
.pill .l { color: var(--ink-3); font-size: .8rem; }

/* الاقسام العامة */
.section { padding: 2.5rem 1.25rem; }
.section-in { max-width: 1240px; margin: 0 auto; }
.section-head { text-align: center; margin-bottom: 1.8rem; }
.section-head h2 { font-size: 1.8rem; }
.section-head p { color: var(--ink-3); max-width: 620px; margin: .3rem auto 0; }
.ticket-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.2rem; }
.ticket-card { background: var(--panel); border: 1px solid var(--line); border-radius: 20px; padding: 1.4rem; text-align: center; position: relative; overflow: hidden; transition: transform .2s, border-color .2s; }
.ticket-card:hover { transform: translateY(-4px); border-color: rgba(255,45,149,.5); }
.ticket-card::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 4px; background: var(--grad); }
.ticket-card .t-name { font-size: 1.2rem; font-weight: 800; }
.ticket-card .t-price { font-size: 2rem; font-weight: 900; margin: .4rem 0; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.ticket-card .t-desc { color: var(--ink-3); font-size: .9rem; min-height: 2.6em; }
.gallery { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1rem; }
.gallery figure { margin: 0; border-radius: 16px; overflow: hidden; border: 1px solid var(--line); background: var(--panel); }
.gallery img { width: 100%; aspect-ratio: 4/3; object-fit: cover; display: block; transition: transform .3s; }
.gallery figure:hover img { transform: scale(1.04); }
.gallery figcaption { padding: .6rem .8rem; color: var(--ink-2); font-size: .85rem; }
.gallery .video { position: relative; aspect-ratio: 16/9; background: #000; }
.gallery .video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.public-wrap { max-width: 1000px; margin: 0 auto; padding: 1.5rem 1.25rem 3rem; }
.footer { text-align: center; color: var(--ink-3); font-size: .8rem; padding: 2.5rem 1rem; border-top: 1px solid var(--line); margin-top: 2rem; }

/* البطاقة الرقمية */
.pass { max-width: 440px; margin: 0 auto; background: linear-gradient(160deg, #2a1259, #1a0b3d); border-radius: 22px; overflow: hidden; border: 1px solid var(--line-2); box-shadow: var(--glow); position: relative; }
.pass::before { content: ""; position: absolute; inset: 0; background: radial-gradient(300px 200px at 90% 0%, rgba(255,45,149,.3), transparent 60%); pointer-events: none; }
.pass-top { height: 8px; }
.pass-body { padding: 1.3rem 1.4rem; position: relative; }
.pass-name { font-size: 1.6rem; font-weight: 900; margin: .4rem 0 .1rem; }
.pass-qr { display: block; width: 250px; height: 250px; margin: 1rem auto .5rem; border-radius: 16px; background: #fff; padding: 10px; }
.pass-foot { border-top: 1px dashed var(--line-2); padding: .8rem 1.4rem; color: var(--ink-3); font-size: .85rem; display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; position: relative; }

/* الاقتراحات */
.suggest { position: relative; }
.suggest-list { position: absolute; top: 100%; right: 0; left: 0; background: #22104a; border: 1px solid var(--line-2); border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.4); z-index: 10; max-height: 220px; overflow: auto; }
.suggest-list button { display: block; width: 100%; text-align: right; padding: .55rem .8rem; border: 0; background: none; color: var(--ink); font: inherit; cursor: pointer; }
.suggest-list button:hover { background: var(--panel-2); }
.suggest-list .add { color: var(--pink); font-weight: 700; border-top: 1px solid var(--line); }

/* الماسح */
.scan-app { min-height: 100vh; color: #fff; display: flex; flex-direction: column; }
.scan-head { padding: .8rem 1rem; display: flex; justify-content: space-between; align-items: center; background: rgba(0,0,0,.35); border-bottom: 1px solid var(--line); }
.scan-main { flex: 1; padding: 1rem; display: flex; flex-direction: column; gap: 1rem; max-width: 560px; width: 100%; margin: 0 auto; }
#reader { width: 100%; border-radius: 16px; overflow: hidden; background: #000; border: 1px solid var(--line-2); }
.result { border-radius: 16px; padding: 1.1rem 1.2rem; min-height: 120px; border: 1px solid var(--line-2); }
.result.ok { background: linear-gradient(135deg, rgba(61,220,151,.35), rgba(61,220,151,.1)); } .result.warn { background: linear-gradient(135deg, rgba(255,181,71,.35), rgba(255,181,71,.1)); } .result.error { background: linear-gradient(135deg, rgba(255,92,122,.4), rgba(255,92,122,.1)); } .result.idle { background: var(--panel); }
.result .r-label { font-size: 1.35rem; font-weight: 900; }
.result .r-name { font-size: 1.15rem; margin-top: .3rem; }
.result .r-sub { opacity: .85; font-size: .9rem; }

/* دخول */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 2rem 1rem; }
.auth-card { width: 100%; max-width: 440px; }

@media (max-width: 900px) { .hero-in { grid-template-columns: 1fr; } .hero-art { min-height: 200px; } }
@media (max-width: 640px) {
  .wrap { padding: 1rem .9rem 3rem; }
  .card { padding: .95rem 1rem; }
  .stat .value { font-size: 1.5rem; }
  .countdown .unit { min-width: 58px; padding: .45rem .5rem; }
  .countdown .n { font-size: 1.25rem; }
}
@media print {
  body { background: #fff; color: #000; }
  .topbar, .no-print, .footer { display: none !important; }
  .card, .stat, .pass { background: #fff; border-color: #ccc; color: #000; box-shadow: none; }
  .stat .value, .ticket-card .t-price { color: #000; -webkit-text-fill-color: #000; }
}

/* م3: الرعاة على الصفحة العامة */
.sponsor-tier { margin-bottom: 1.4rem; }
.sponsor-tier-name { color: var(--ink-3); font-size: .85rem; font-weight: 700; margin-bottom: .5rem; letter-spacing: .02em; }
.sponsor-logos { display: flex; flex-wrap: wrap; gap: .8rem; }
.sponsor-logo { background: #fff; border-radius: 12px; padding: .7rem 1rem; min-width: 140px; min-height: 72px; display: flex; align-items: center; justify-content: center; border: 1px solid var(--line-2); }
.sponsor-logo img { max-height: 48px; max-width: 160px; object-fit: contain; }
.sponsor-logo .sponsor-name { color: #2a1a4d; font-weight: 800; }
.sponsor-logo a { display: flex; align-items: center; justify-content: center; }

/* م3: الخريطة التفاعلية — المخطط لا يقلب (dir=ltr على المسرح وحده) والواجهة حوله RTL */
.fmap-editor { display: grid; grid-template-columns: 300px 1fr; gap: 1rem; align-items: start; }
.fmap-side { position: sticky; top: 70px; max-height: calc(100vh - 90px); overflow: auto; }
.fmap-list { display: flex; flex-direction: column; gap: .35rem; max-height: 46vh; overflow: auto; }
.fmap-item { display: flex; align-items: center; gap: .5rem; padding: .45rem .6rem; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); font: inherit; cursor: pointer; text-align: right; }
.fmap-item:hover { background: var(--panel-2); }
.fmap-item .fm-lbl { font-weight: 800; direction: ltr; unicode-bidi: isolate; }
.fmap-stage-wrap { overflow: auto; }
.fmap-stage { position: relative; display: block; width: 100%; user-select: none; background: #fff; border-radius: 12px; overflow: hidden; }
.fmap-stage img { width: 100%; height: auto; display: block; }
.fmap-stage.placing { cursor: crosshair; outline: 2px dashed var(--magenta); }
.fmap-empty { min-height: 320px; display: flex; align-items: center; justify-content: center; color: #6b7280; background: repeating-linear-gradient(45deg, #f3f0fa, #f3f0fa 12px, #ebe6f5 12px, #ebe6f5 24px); }
.fmap-marker { position: absolute; transform: translate(-50%, -100%); display: flex; flex-direction: column; align-items: center; gap: 2px; cursor: grab; touch-action: none; background: none; border: 0; padding: 0; font: inherit; z-index: 2; }
.fmap-marker:active { cursor: grabbing; }
.fmap-marker .fm-pin { width: 18px; height: 18px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); border: 2px solid #fff; box-shadow: 0 2px 8px rgba(0,0,0,.35); background: var(--violet); }
.fmap-marker .fm-tag { font-size: .7rem; font-weight: 800; background: rgba(18,6,46,.88); color: #fff; padding: .1rem .4rem; border-radius: 6px; white-space: nowrap; direction: ltr; unicode-bidi: isolate; }
.fm-booth .fm-pin, .fm-booth .fm-dot { background: var(--ok); }
.fm-sponsor .fm-pin, .fm-sponsor .fm-dot { background: var(--magenta); }
.fm-activity .fm-pin, .fm-activity .fm-dot { background: var(--gold); }
.fm-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; }
.fmap-marker.dim { opacity: .25; }
.fmap-marker.hit .fm-pin { transform: rotate(-45deg) scale(1.35); box-shadow: 0 0 0 4px rgba(255,45,149,.35); }
.fmap-public { position: relative; }
.fmap-tools { display: flex; gap: .8rem; align-items: center; flex-wrap: wrap; margin-bottom: .8rem; }
.fmap-tools input[type=search] { flex: 1; min-width: 200px; }
.fmap-legend { display: flex; gap: .9rem; font-size: .85rem; color: var(--ink-2); }
.fmap-legend span { display: inline-flex; align-items: center; gap: .35rem; }
.fmap-scroll { overflow: auto; border-radius: 12px; border: 1px solid var(--line); background: #fff; max-height: 75vh; }
.fmap-detail { position: absolute; top: 60px; right: 0; width: min(340px, 100%); background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 14px; padding: 1rem; box-shadow: var(--glow); z-index: 5; }
@media (max-width: 900px) { .fmap-editor { grid-template-columns: 1fr; } .fmap-side { position: static; max-height: none; } .fmap-detail { position: fixed; top: auto; bottom: 0; right: 0; left: 0; width: auto; border-radius: 14px 14px 0 0; } }

/* DEC-EV-007: هوية الفعالية المخصصة في الترويسة */
.brand-event .brand-logo { height: 34px; max-width: 140px; object-fit: contain; background: #fff; border-radius: 8px; padding: 3px 6px; }
