/* ABHA17 — Ali Bin Harmal Educational Award · design system
   Palette: gold #b88a12 / #d4af37, green #16a34a / #22c55e, on soft neutrals. */

:root {
  --gold: #b88a12;
  --gold-2: #d4af37;
  --gold-soft: rgba(184, 138, 18, .12);
  --green: #16a34a;
  --green-2: #22c55e;
  --green-soft: rgba(22, 163, 74, .12);
  --bg: #f8f9fc;
  --card: #ffffff;
  --text: #111827;
  --muted: #6b7280;
  --border: #e5e7eb;
  --row-alt: #fbfbfd;
  --input-bg: #ffffff;
  --error: #dc2626;
  --amber: #d97706;
  --blue: #2563eb;
  --violet: #7c3aed;
  --teal: #0d9488;
  --sb-bg: linear-gradient(180deg, #10241a 0%, #09150f 100%);
  --sb-text: #cfd8d2;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 4px 12px rgba(16, 24, 40, .05);
  --shadow-lg: 0 18px 40px -12px rgba(16, 24, 40, .25);
  --radius: 16px;
  --font: 'Cairo', 'Segoe UI', Tahoma, sans-serif;
  --font-en: 'Inter', 'Segoe UI', sans-serif;
}

[data-theme="dark"] {
  --bg: #0b1210;
  --card: #121c18;
  --text: #e8eeea;
  --muted: #92a39a;
  --border: #22322b;
  --row-alt: #0f1814;
  --input-bg: #0e1713;
  --gold-soft: rgba(212, 175, 55, .14);
  --green-soft: rgba(34, 197, 94, .14);
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 4px 14px rgba(0, 0, 0, .3);
  --shadow-lg: 0 18px 40px -12px rgba(0, 0, 0, .7);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  font-size: 15px;
  min-height: 100vh;
}
.en, [dir="ltr"] { font-family: var(--font-en), var(--font); }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: 1rem; color: var(--text); }
small { font-size: .78rem; color: var(--muted); font-weight: 400; }
code { background: var(--gold-soft); padding: .1rem .45rem; border-radius: 6px; font-family: var(--font-en); }
[hidden] { display: none !important; }

.muted { color: var(--muted); }
.center { text-align: center; }
.strong { font-weight: 700; }
.nowrap { white-space: nowrap; }
.small { font-size: .85rem; }
.pad { padding: 1.5rem; }
.p0 { padding: 0 !important; }
.mt { margin-top: 1.6rem; }
.stack { display: flex; flex-direction: column; gap: 1.1rem; }
.inline { display: inline; }
.divider { height: 1px; background: var(--border); margin: 1rem 0; }
.link { color: var(--gold); font-weight: 600; font-size: .9rem; }
.link:hover { text-decoration: underline; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .65rem 1.3rem; border: 1px solid transparent; border-radius: 10px;
  font-weight: 700; font-size: .95rem; transition: transform .15s, box-shadow .15s, background .15s, border-color .15s;
}
.btn:hover { transform: translateY(-1px); }
.btn-gold { background: linear-gradient(135deg, var(--gold), var(--gold-2)); color: #fff; box-shadow: 0 6px 16px -6px rgba(184, 138, 18, .65); }
.btn-gold:hover { box-shadow: 0 10px 22px -8px rgba(184, 138, 18, .8); }
.btn-green { background: var(--green); color: #fff; }
.btn-green:hover { background: var(--green-2); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn-ghost:hover { border-color: var(--gold); color: var(--gold); }
.btn-block { width: 100%; }
.btn-lg { padding: .85rem 1.4rem; font-size: 1.05rem; }
.btn-sm { padding: .35rem .8rem; font-size: .82rem; border-radius: 8px; }

.icon-btn {
  width: 40px; height: 40px; display: inline-grid; place-items: center;
  background: transparent; border: 1px solid var(--border); border-radius: 10px; color: var(--text);
  transition: background .15s, color .15s, border-color .15s;
}
.icon-btn:hover { background: var(--gold-soft); color: var(--gold); border-color: var(--gold); }
.icon-btn.sm { width: 34px; height: 34px; border-radius: 8px; font-size: .85rem; }
.icon-btn .on { color: var(--green); }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: .4rem; }
.field > span { font-weight: 700; font-size: .92rem; display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
.field > span i { color: var(--gold); }
.field em { font-style: normal; color: var(--muted); font-weight: 400; font-size: .8rem; }
.req { color: var(--error); }
.hint { margin-top: -.1rem; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=search], input:not([type]), select {
  width: 100%; padding: .72rem .95rem; background: var(--input-bg);
  border: 2px solid var(--border); border-radius: 10px; transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 4px var(--gold-soft); }
input[readonly] { background: var(--row-alt); color: var(--muted); }
.pw-wrap { position: relative; }
.pw-wrap input { padding-inline-end: 2.8rem; }
.pw-toggle { position: absolute; inset-inline-end: .5rem; top: 50%; transform: translateY(-50%); background: none; border: 0; color: var(--muted); padding: .4rem; }
.pw-toggle:hover { color: var(--gold); }
.check { display: flex; align-items: flex-start; gap: .6rem; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--gold); margin-top: .25rem; flex: none; }
.check span { display: flex; flex-direction: column; line-height: 1.35; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

/* ---------- Alerts / toasts ---------- */
.alert { display: flex; gap: .6rem; align-items: flex-start; padding: .8rem 1rem; border-radius: 10px; font-weight: 600; font-size: .92rem; border: 1px solid; }
.alert-error { background: rgba(220, 38, 38, .08); color: var(--error); border-color: rgba(220, 38, 38, .25); }
.alert-success { background: var(--green-soft); color: var(--green); border-color: rgba(22, 163, 74, .3); }
.alert-warn { background: rgba(217, 119, 6, .1); color: var(--amber); border-color: rgba(217, 119, 6, .3); }
.toasts { position: fixed; top: 76px; inset-inline-start: 50%; transform: translateX(-50%); z-index: 90; display: flex; flex-direction: column; gap: .5rem; width: min(480px, calc(100vw - 2rem)); transition: opacity .4s; }
[dir="rtl"] .toasts { transform: translateX(50%); }
[dir="ltr"] .toasts { transform: translateX(-50%); }
.toasts.hide { opacity: 0; pointer-events: none; }
.toast { display: flex; gap: .7rem; align-items: center; background: var(--card); border: 1px solid var(--border); border-inline-start: 4px solid var(--gold); padding: .85rem 1.1rem; border-radius: 12px; box-shadow: var(--shadow-lg); font-weight: 600; }
.toast-success { border-inline-start-color: var(--green); } .toast-success i { color: var(--green); }
.toast-error { border-inline-start-color: var(--error); } .toast-error i { color: var(--error); }
.toast-warn i { color: var(--amber); }

/* ---------- Auth pages ---------- */
.auth-body { background: var(--bg); min-height: 100vh; display: grid; place-items: center; padding: 1.5rem; }
.install-card { width: min(520px, 100%); background: var(--card); border-radius: 22px; padding: 2.4rem; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; gap: 1rem; border-top: 6px solid var(--gold); }
.install-card h1 { font-size: 1.5rem; font-weight: 800; }
.install-card.center { text-align: center; align-items: center; }
.brand-mark { width: 68px; height: 68px; border-radius: 20px; display: grid; place-items: center; font-size: 1.9rem; color: #fff; background: linear-gradient(135deg, var(--gold), var(--gold-2)); box-shadow: 0 10px 24px -8px rgba(184, 138, 18, .7); }

.login-wrap { width: min(1080px, 100%); min-height: min(640px, calc(100vh - 3rem)); display: grid; grid-template-columns: 1.05fr 1fr; background: var(--card); border-radius: 26px; overflow: hidden; box-shadow: var(--shadow-lg); }
.login-hero { position: relative; color: #fff; padding: 3rem; display: flex; flex-direction: column; justify-content: space-between; background: radial-gradient(120% 90% at 100% 0%, #d4af37 0%, #b88a12 38%, #6b4f08 100%); overflow: hidden; }
.hero-pattern { position: absolute; inset: 0; opacity: .14; background-image: radial-gradient(circle at 20% 20%, #fff 0 2px, transparent 3px), radial-gradient(circle at 70% 60%, #fff 0 2px, transparent 3px); background-size: 46px 46px, 62px 62px; }
.hero-pattern::after { content: ""; position: absolute; width: 420px; height: 420px; border-radius: 50%; border: 60px solid rgba(255, 255, 255, .08); bottom: -170px; inset-inline-start: -120px; }
.hero-inner { position: relative; display: flex; flex-direction: column; gap: .8rem; }
.hero-badge { width: 72px; height: 72px; border-radius: 22px; display: grid; place-items: center; font-size: 2rem; background: rgba(255, 255, 255, .16); border: 1px solid rgba(255, 255, 255, .35); backdrop-filter: blur(4px); }
.hero-inner h1 { font-size: 2rem; font-weight: 800; line-height: 1.3; text-shadow: 0 2px 8px rgba(0, 0, 0, .2); }
.hero-en { font-family: var(--font-en); letter-spacing: .04em; opacity: .9; }
.hero-rule { width: 70px; height: 4px; border-radius: 4px; background: #fff; opacity: .85; margin: .4rem 0; }
.hero-text { max-width: 36ch; opacity: .95; }
.hero-points { list-style: none; display: flex; flex-direction: column; gap: .55rem; margin-top: .8rem; }
.hero-points li { display: flex; gap: .6rem; align-items: center; font-weight: 600; }
.hero-points i { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: rgba(255, 255, 255, .18); font-size: .85rem; }
.hero-foot { position: relative; font-family: var(--font-en); opacity: .75; letter-spacing: .12em; font-size: .85rem; }
.login-panel { display: grid; place-items: center; padding: 2.4rem; }
.login-card { width: min(400px, 100%); }
.lc-head h2 { font-size: 1.7rem; font-weight: 800; }
.login-note { text-align: center; color: var(--muted); font-size: .82rem; }
.login-note i { color: var(--green); }

/* ---------- App shell ---------- */
.app-shell { display: flex; min-height: 100vh; }
.sidebar { width: 270px; flex: none; background: var(--sb-bg); color: var(--sb-text); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; z-index: 60; }
.sb-brand { display: flex; align-items: center; gap: .8rem; padding: 1.4rem 1.2rem 1.1rem; border-bottom: 1px solid rgba(255, 255, 255, .07); }
.sb-logo { width: 46px; height: 46px; border-radius: 14px; flex: none; display: grid; place-items: center; font-size: 1.35rem; color: #fff; background: linear-gradient(135deg, var(--gold), var(--gold-2)); box-shadow: 0 8px 18px -6px rgba(212, 175, 55, .6); }
.sb-title { display: flex; flex-direction: column; line-height: 1.3; }
.sb-title strong { color: #fff; font-size: .98rem; }
.sb-title small { color: var(--gold-2); font-family: var(--font-en); letter-spacing: .06em; }
.sb-nav { padding: .8rem .8rem 1rem; flex: 1; display: flex; flex-direction: column; gap: .15rem; }
.sb-section { padding: 1rem .7rem .35rem; font-size: .72rem; letter-spacing: .08em; color: rgba(255, 255, 255, .38); font-weight: 700; }
.sb-link { display: flex; align-items: center; gap: .8rem; padding: .62rem .8rem; border-radius: 12px; color: var(--sb-text); transition: background .15s, color .15s; position: relative; }
.sb-link i { width: 22px; text-align: center; color: rgba(255, 255, 255, .55); font-size: 1rem; }
.sb-link span { display: flex; flex-direction: column; line-height: 1.25; font-weight: 600; font-size: .93rem; }
.sb-link small { color: rgba(255, 255, 255, .38); font-family: var(--font-en); font-size: .7rem; }
.sb-link:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.sb-link.active { background: linear-gradient(90deg, rgba(212, 175, 55, .22), rgba(212, 175, 55, .06)); color: #fff; }
.sb-link.active i { color: var(--gold-2); }
.sb-link.active::before { content: ""; position: absolute; inset-inline-start: -.8rem; top: 20%; bottom: 20%; width: 4px; border-radius: 4px; background: var(--gold-2); }
.sb-link.soon { opacity: .55; cursor: default; }
.badge-soon { margin-inline-start: auto; font-style: normal; font-size: .65rem; padding: .1rem .5rem; border-radius: 99px; background: rgba(255, 255, 255, .1); color: rgba(255, 255, 255, .7); }
.sb-foot { padding: 1rem; border-top: 1px solid rgba(255, 255, 255, .07); }
.sb-user { display: flex; align-items: center; gap: .7rem; }
.sb-user-txt { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.sb-user-txt strong { color: #fff; font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb-user-txt small { color: var(--gold-2); }
.avatar { width: 40px; height: 40px; border-radius: 50%; flex: none; display: grid; place-items: center; font-weight: 800; color: #fff; background: linear-gradient(135deg, var(--green), var(--green-2)); }
.avatar.sm { width: 32px; height: 32px; font-size: .85rem; }
.sb-backdrop { display: none; }

.main-col { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: 1rem; padding: .85rem 1.8rem; background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); }
.tb-title { flex: 1; min-width: 0; display: flex; align-items: baseline; gap: .8rem; flex-wrap: wrap; }
.tb-title h1 { font-size: 1.35rem; font-weight: 800; }
.tb-title .en { font-size: .85rem; }
.tb-actions { display: flex; align-items: center; gap: .6rem; }
.only-mobile { display: none; }
.dropdown { position: relative; }
.user-chip { display: flex; align-items: center; gap: .55rem; padding: .3rem .8rem .3rem .5rem; background: var(--card); border: 1px solid var(--border); border-radius: 99px; color: var(--text); font-weight: 600; font-size: .9rem; }
.user-chip i { font-size: .7rem; color: var(--muted); }
.user-chip:hover { border-color: var(--gold); }
.dropdown-menu { position: absolute; inset-inline-end: 0; top: calc(100% + .5rem); min-width: 250px; background: var(--card); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-lg); padding: .4rem; display: none; z-index: 70; }
.dropdown-menu.show { display: block; }
.dm-head { display: flex; flex-direction: column; padding: .7rem .8rem; border-bottom: 1px solid var(--border); margin-bottom: .3rem; }
.dropdown-menu a, .dropdown-menu button { display: flex; align-items: center; gap: .6rem; width: 100%; padding: .6rem .8rem; border: 0; background: none; border-radius: 9px; color: var(--text); font-size: .92rem; text-align: start; }
.dropdown-menu a:hover, .dropdown-menu button:hover { background: var(--gold-soft); color: var(--gold); }
.content { flex: 1; padding: 1.8rem; display: flex; flex-direction: column; gap: 1.5rem; }
.app-foot { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding: 1rem 1.8rem; border-top: 1px solid var(--border); color: var(--muted); font-size: .82rem; }

/* ---------- Cards / layout ---------- */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 1.3rem; border-bottom: 1px solid var(--border); }
.card-head h2 { font-size: 1.05rem; font-weight: 800; display: flex; align-items: center; gap: .6rem; }
.card-head h2 i { color: var(--gold); }
.card-body { padding: 1.3rem; }
.count { background: var(--gold-soft); color: var(--gold); padding: .05rem .6rem; border-radius: 99px; font-size: .82rem; font-family: var(--font-en); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; align-items: start; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; align-items: start; }
.grid-link { display: grid; grid-template-columns: 380px 1fr; gap: 1.5rem; align-items: start; }

.welcome { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; padding: 1.6rem 1.8rem; border-radius: 20px; color: #fff; background: linear-gradient(120deg, #7a5a08 0%, var(--gold) 45%, var(--gold-2) 100%); box-shadow: 0 16px 34px -14px rgba(184, 138, 18, .7); position: relative; overflow: hidden; }
.welcome::after { content: ""; position: absolute; width: 260px; height: 260px; border-radius: 50%; border: 44px solid rgba(255, 255, 255, .09); inset-inline-end: -70px; top: -110px; }
.welcome h2 { font-size: 1.5rem; font-weight: 800; }
.welcome p { opacity: .92; }
.welcome-role { position: relative; z-index: 1; background: rgba(255, 255, 255, .18); border: 1px solid rgba(255, 255, 255, .35); padding: .4rem 1rem; border-radius: 99px; font-weight: 700; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 1.1rem; }
.stat { display: flex; align-items: center; gap: 1rem; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.1rem 1.2rem; box-shadow: var(--shadow); transition: transform .2s, box-shadow .2s; }
.stat:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.stat b { display: block; font-size: 1.9rem; font-weight: 800; line-height: 1.1; font-family: var(--font-en); }
.stat span { color: var(--muted); font-size: .88rem; }
.stat-ico { width: 52px; height: 52px; border-radius: 15px; flex: none; display: grid; place-items: center; font-size: 1.3rem; }
.stat-ico.gold { background: var(--gold-soft); color: var(--gold); }
.stat-ico.green { background: var(--green-soft); color: var(--green); }
.stat-ico.amber { background: rgba(217, 119, 6, .12); color: var(--amber); }
.stat-ico.blue { background: rgba(37, 99, 235, .12); color: var(--blue); }
.stat-ico.violet { background: rgba(124, 58, 237, .12); color: var(--violet); }
.stat-ico.teal { background: rgba(13, 148, 136, .12); color: var(--teal); }

.ring-wrap { display: flex; flex-direction: column; align-items: center; gap: .8rem; }
.ring { width: 190px; height: 190px; }
.ring-bg { fill: none; stroke: var(--border); stroke-width: 10; }
.ring-fg { fill: none; stroke: var(--green); stroke-width: 10; stroke-linecap: round; }
.ring-num { font-size: 26px; font-weight: 800; fill: var(--text); font-family: var(--font-en); }
.ring-sub { font-size: 9px; fill: var(--muted); font-family: var(--font-en); }
.bar-row { display: grid; grid-template-columns: 90px 1fr 34px; align-items: center; gap: .8rem; margin-bottom: .7rem; font-size: .9rem; }
.bar { height: 10px; background: var(--border); border-radius: 99px; overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--gold), var(--gold-2)); }
.bar.alt i { background: linear-gradient(90deg, var(--green), var(--green-2)); }
.bar-row b { font-family: var(--font-en); text-align: end; }
.mini-title { font-size: .85rem; color: var(--muted); margin-bottom: .6rem; }
.roadmap { list-style: none; display: flex; flex-direction: column; gap: .9rem; }
.roadmap li { display: flex; gap: .7rem; align-items: flex-start; color: var(--muted); font-size: .92rem; }
.roadmap li i { margin-top: .35rem; }
.roadmap li.done { color: var(--text); font-weight: 600; }
.roadmap li.done i { color: var(--green); }
.kv { display: grid; grid-template-columns: 140px 1fr; gap: .8rem 1rem; }
.kv dt { color: var(--muted); }
.kv dd { font-weight: 600; }

/* ---------- Toolbar ---------- */
.toolbar { display: flex; gap: .8rem; flex-wrap: wrap; align-items: center; }
.toolbar-end { margin-inline-start: auto; display: flex; gap: .6rem; flex-wrap: wrap; }
.search { position: relative; flex: 1; min-width: 220px; max-width: 360px; }
.search i { position: absolute; inset-inline-start: .95rem; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search input { padding-inline-start: 2.6rem; }
.select { width: auto; min-width: 150px; }

/* ---------- Tables ---------- */
.table-scroll { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: .92rem; }
.tbl th { text-align: start; padding: .8rem 1rem; background: var(--row-alt); color: var(--muted); font-size: .78rem; font-weight: 700; letter-spacing: .03em; border-bottom: 1px solid var(--border); white-space: nowrap; position: sticky; top: 0; }
.tbl td { padding: .75rem 1rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.tbl tbody tr:hover { background: var(--gold-soft); }
.tbl tbody tr:last-child td { border-bottom: 0; }
.actions { white-space: nowrap; text-align: end; }
.actions .icon-btn { margin-inline-start: .25rem; }
.empty-row { padding: 2rem; text-align: center; }
.code { font-family: var(--font-en); font-size: .8rem; font-weight: 600; background: var(--gold-soft); color: var(--gold); padding: .12rem .5rem; border-radius: 6px; }
.copy-cell { display: flex; gap: .4rem; align-items: center; min-width: 260px; }
.copy-cell input { padding: .4rem .6rem; font-size: .8rem; border-width: 1px; }

.pill { display: inline-block; padding: .12rem .7rem; border-radius: 99px; font-size: .78rem; font-weight: 700; white-space: nowrap; }
.pill-gold { background: var(--gold-soft); color: var(--gold); }
.pill-green { background: var(--green-soft); color: var(--green); }
.pill-amber { background: rgba(217, 119, 6, .13); color: var(--amber); }
.pill-blue { background: rgba(37, 99, 235, .12); color: var(--blue); }
.pill-gray { background: rgba(107, 114, 128, .15); color: var(--muted); }

/* ---------- Modal ---------- */
.modal { position: fixed; inset: 0; z-index: 100; background: rgba(8, 18, 12, .55); backdrop-filter: blur(3px); display: grid; place-items: center; padding: 1rem; overflow-y: auto; }
.modal-box { width: min(560px, 100%); background: var(--card); border-radius: 20px; padding: 1.6rem; box-shadow: var(--shadow-lg); border-top: 5px solid var(--gold); max-height: calc(100vh - 2rem); overflow-y: auto; }
.modal-box.wide { width: min(780px, 100%); }
.modal-head { display: flex; justify-content: space-between; align-items: center; }
.modal-head h3 { font-size: 1.25rem; font-weight: 800; }
.modal-foot { display: flex; justify-content: flex-end; gap: .7rem; margin-top: .4rem; }
body.modal-open { overflow: hidden; }
.perm-box { border: 1px solid var(--border); border-radius: 14px; padding: 1rem; }
.perm-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: .6rem; }
.perm-head i { color: var(--gold); }
.perm-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
.perm-grid.disabled { opacity: .5; pointer-events: none; }
.perm-grid fieldset { border: 0; display: flex; flex-direction: column; gap: .5rem; }
.perm-grid legend { font-weight: 800; color: var(--gold); font-size: .85rem; margin-bottom: .3rem; }

.reveal { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; padding: 1rem 1.2rem; border-radius: 14px; background: var(--gold-soft); border: 1px dashed var(--gold); }
.reveal code { font-size: 1.15rem; letter-spacing: .06em; background: var(--card); padding: .3rem .8rem; }

.empty-state { text-align: center; padding: 4rem 1rem; display: flex; flex-direction: column; align-items: center; gap: .8rem; }
.empty-state > i { font-size: 3rem; color: var(--gold); }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .grid-3 { grid-template-columns: 1fr 1fr; }
  .grid-link { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .login-wrap { grid-template-columns: 1fr; }
  .login-hero { padding: 2rem; min-height: 280px; }
  .hero-points, .hero-foot { display: none; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .only-mobile { display: inline-grid; }
  .sidebar { position: fixed; top: 0; bottom: 0; inset-inline-start: 0; transform: translateX(100%); transition: transform .25s; box-shadow: var(--shadow-lg); }
  [dir="ltr"] .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: none !important; }
  .sb-backdrop.show { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, .5); z-index: 55; }
  .topbar { padding: .7rem 1rem; }
  .content { padding: 1rem; }
  .uc-name { display: none; }
  .tb-title .en { display: none; }
}
@media (max-width: 560px) {
  .row-2, .perm-grid { grid-template-columns: 1fr; }
  .install-card { padding: 1.6rem; }
  .login-panel { padding: 1.4rem; }
  .kv { grid-template-columns: 1fr; gap: .2rem; }
  .kv dd { margin-bottom: .6rem; }
}

/* ================= Phase 2 additions ================= */
body.lang-en { font-family: var(--font-en), var(--font); }
body.lang-en .en { font-family: var(--font-en); }
.hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.logo-img, .hero-logo { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }
.hero-badge:has(img), .sb-logo:has(img), .reg-logo:has(img) { background: #fff; padding: 6px; }
.hero-top { position: relative; display: flex; justify-content: flex-end; }
.lang-switch { display: inline-flex; align-items: center; gap: .45rem; padding: .35rem .95rem; border-radius: 99px; font-weight: 700; font-size: .85rem; border: 1px solid rgba(255,255,255,.45); color: #fff; background: rgba(255,255,255,.14); backdrop-filter: blur(4px); transition: background .15s; }
.lang-switch:hover { background: rgba(255,255,255,.28); }
.reg-top .lang-switch { color: var(--gold); border-color: var(--border); background: var(--card); }
.reg-top .lang-switch:hover { border-color: var(--gold); background: var(--gold-soft); }

/* Registration page */
.reg-body { background: radial-gradient(120% 60% at 50% 0%, rgba(212,175,55,.16), transparent 60%), var(--bg); min-height: 100vh; display: flex; flex-direction: column; }
.reg-top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 1.5rem; max-width: 880px; width: 100%; margin: 0 auto; }
.reg-brand { display: flex; align-items: center; gap: .8rem; }
.reg-brand strong { display: block; line-height: 1.25; }
.reg-brand small { display: block; font-family: var(--font-en); }
.reg-logo { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; color: #fff; font-size: 1.4rem; background: linear-gradient(135deg, var(--gold), var(--gold-2)); box-shadow: 0 8px 18px -6px rgba(184,138,18,.6); }
.reg-main { flex: 1; width: 100%; max-width: 880px; margin: 0 auto; padding: 0 1.5rem 2rem; }
.reg-foot { text-align: center; color: var(--muted); font-size: .82rem; padding: 1.2rem; }
.reg-card { background: var(--card); border: 1px solid var(--border); border-top: 6px solid var(--gold); border-radius: 22px; box-shadow: var(--shadow-lg); padding: 2rem; display: flex; flex-direction: column; gap: 1.6rem; }
.reg-card.center { align-items: center; text-align: center; padding: 3rem 2rem; gap: 1rem; }
.reg-head h1, .reg-card.center h1 { font-size: 1.55rem; font-weight: 800; }
.reg-step { display: flex; flex-direction: column; gap: 1rem; padding-top: 1.4rem; border-top: 1px dashed var(--border); }
.reg-head + .alert + .reg-step, .reg-head + .reg-step { border-top: 0; padding-top: 0; }
.reg-step h2 { display: flex; align-items: center; gap: .7rem; font-size: 1.1rem; font-weight: 800; }
.num { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(135deg, var(--gold), var(--gold-2)); color: #fff; font-family: var(--font-en); font-size: .95rem; }
.state-ico { width: 84px; height: 84px; border-radius: 50%; display: grid; place-items: center; font-size: 2.3rem; background: var(--gold-soft); color: var(--gold); }
.state-ico.ok { background: var(--green-soft); color: var(--green); }
.state-ico.err { background: rgba(220,38,38,.1); color: var(--error); }
.secret-code { font-family: var(--font-en); font-size: 2rem; font-weight: 800; letter-spacing: .2em; padding: 1rem 1.6rem; border: 2px dashed var(--gold); border-radius: 14px; background: var(--gold-soft); color: var(--gold); user-select: all; }
.id-drop { position: relative; border: 2px dashed var(--border); border-radius: 16px; padding: 1.8rem 1rem; text-align: center; display: flex; flex-direction: column; align-items: center; gap: .3rem; background: var(--row-alt); transition: border-color .15s, background .15s; }
.id-drop:hover, .id-drop.drag { border-color: var(--gold); background: var(--gold-soft); }
.id-drop i { font-size: 2.4rem; color: var(--gold); }
.id-drop input[type=file] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.privacy { font-size: .85rem; color: var(--muted); }
.privacy i { color: var(--green); margin-inline-end: .3rem; }
.id-status { display: flex; align-items: center; gap: .6rem; padding: .75rem 1rem; border-radius: 10px; font-weight: 600; font-size: .92rem; background: var(--gold-soft); color: var(--gold); }
.id-status.ok { background: var(--green-soft); color: var(--green); }
.id-status.err { background: rgba(220,38,38,.09); color: var(--error); }
.progress { height: 8px; background: var(--border); border-radius: 99px; overflow: hidden; }
.progress i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--gold), var(--gold-2)); transition: width .2s; }
#regSubmit:disabled { opacity: .6; cursor: wait; }
@media (max-width: 560px) { .reg-card { padding: 1.3rem; } .reg-top { padding: .8rem 1rem; } .reg-main { padding: 0 1rem 1.5rem; } .secret-code { font-size: 1.4rem; } }
.app-body { font-family: var(--font-en), var(--font); }
.app-body .tbl th { letter-spacing: .02em; }
.sb-section { text-transform: uppercase; }

/* ================= Phase 3 additions ================= */
.file-list { list-style: none; display: flex; flex-direction: column; gap: .45rem; }
.file-list li { display: flex; align-items: center; gap: .6rem; padding: .5rem .8rem; background: var(--row-alt); border: 1px solid var(--border); border-radius: 10px; font-size: .9rem; }
.file-list li i.fa-file { color: var(--gold); }
.file-list li span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-list li.err { color: var(--error); background: rgba(220,38,38,.08); border-color: rgba(220,38,38,.25); }
.receipt { width: 100%; max-width: 460px; border: 1px solid var(--border); border-radius: 14px; overflow: hidden; text-align: start; }
.receipt div { display: flex; justify-content: space-between; gap: 1rem; padding: .65rem 1rem; border-bottom: 1px solid var(--border); }
.receipt div:last-child { border-bottom: 0; }
.receipt span { color: var(--muted); }
.receipt b { text-align: end; }
.progress.indeterminate i { background: linear-gradient(90deg, var(--gold), var(--gold-2), var(--gold)); background-size: 200% 100%; animation: slide 1.1s linear infinite; }
@keyframes slide { to { background-position: -200% 0; } }
.level-chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.chip { display: inline-flex; align-items: center; gap: .4rem; padding: .25rem .4rem .25rem .8rem; border: 1px solid var(--border); border-radius: 99px; font-size: .85rem; background: var(--row-alt); }
.chip.off { opacity: .5; text-decoration: line-through; }
.chip form { display: inline; }
.chip button { border: 0; background: none; color: var(--muted); padding: .1rem .35rem; border-radius: 99px; }
.chip button:hover { color: var(--gold); }
.comp-card { padding: 1.1rem 1.3rem; border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: .8rem; }
.comp-card:last-child { border-bottom: 0; }
.comp-top { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.add-level { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.add-level input { width: auto; flex: 1; min-width: 150px; padding: .45rem .7rem; border-width: 1px; }
.file-rows { display: flex; flex-direction: column; gap: .5rem; }
.file-rows a { display: flex; align-items: center; gap: .6rem; padding: .55rem .9rem; border: 1px solid var(--border); border-radius: 10px; }
.file-rows a:hover { border-color: var(--gold); background: var(--gold-soft); }
.file-rows a i { color: var(--gold); }
.file-rows a small { margin-inline-start: auto; }
/* ================= Registration pages (rp-*) — one-page professional form ================= */
.rp-body { background: #f3f1ea; color: var(--text); font-family: var(--font-en), var(--font); min-height: 100vh; display: flex; flex-direction: column; }
.rp-hero { background: linear-gradient(120deg, #6b4f08 0%, #b88a12 48%, #d4af37 100%); color: #fff; position: relative; overflow: hidden; }
.rp-hero::before { content: ""; position: absolute; width: 520px; height: 520px; border-radius: 50%; border: 70px solid rgba(255,255,255,.07); right: -140px; top: -300px; }
.rp-hero::after { content: ""; position: absolute; width: 300px; height: 300px; border-radius: 50%; border: 44px solid rgba(255,255,255,.06); left: -90px; bottom: -200px; }
.rp-hero-in { position: relative; z-index: 1; max-width: 1120px; margin: 0 auto; padding: 1.6rem 1.5rem; display: flex; align-items: center; gap: 1.1rem; flex-wrap: wrap; }
.rp-logo { width: 64px; height: 64px; border-radius: 18px; flex: none; display: grid; place-items: center; font-size: 1.9rem; color: #fff; background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.4); backdrop-filter: blur(4px); }
.rp-logo:has(img) { background: #fff; padding: 6px; }
.rp-titles h1 { font-size: 1.45rem; font-weight: 800; letter-spacing: .01em; line-height: 1.25; }
.rp-titles p { font-family: var(--font); font-size: 1.05rem; opacity: .93; margin-top: .1rem; }
.rp-badge { margin-inline-start: auto; padding: .45rem 1.1rem; border-radius: 99px; background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.4); font-weight: 700; font-size: .9rem; backdrop-filter: blur(4px); }
.rp-badge bdi { font-family: var(--font); font-weight: 600; }

.rp-wrap { flex: 1; width: 100%; max-width: 1120px; margin: 0 auto; padding: 2rem 1.5rem 3rem; display: grid; grid-template-columns: 290px 1fr; gap: 2rem; align-items: start; }
.rp-wrap.single { grid-template-columns: 1fr; max-width: 760px; }
.rp-aside { position: sticky; top: 1.5rem; background: #10241a; color: #cfd8d2; border-radius: 20px; padding: 1.5rem 1.4rem; box-shadow: 0 18px 40px -18px rgba(16,36,26,.7); }
.rp-aside h2 { font-size: .8rem; letter-spacing: .09em; text-transform: uppercase; color: var(--gold-2); margin-bottom: 1.2rem; font-weight: 700; }
.rp-aside h2 bdi { font-family: var(--font); letter-spacing: 0; text-transform: none; }
.rp-steps { list-style: none; display: flex; flex-direction: column; gap: 0; }
.rp-steps li { display: flex; gap: .9rem; align-items: flex-start; position: relative; padding-bottom: 1.4rem; }
.rp-steps li:last-child { padding-bottom: 0; }
.rp-steps li:not(:last-child)::after { content: ""; position: absolute; inset-inline-start: 15px; top: 34px; bottom: 2px; width: 2px; background: rgba(255,255,255,.14); }
.rp-dot { width: 32px; height: 32px; border-radius: 50%; flex: none; display: grid; place-items: center; border: 2px solid rgba(255,255,255,.28); font-weight: 700; font-size: .85rem; color: #fff; position: relative; z-index: 1; background: #10241a; transition: all .2s; }
.rp-dot i { display: none; font-size: .8rem; }
.rp-steps li.done .rp-dot { background: var(--green); border-color: var(--green); }
.rp-steps li.done .rp-dot i { display: block; }
.rp-steps li.done .rp-dot em { display: none; }
.rp-steps li.done:not(:last-child)::after { background: var(--green); }
.rp-dot em { font-style: normal; }
.rp-st { display: flex; flex-direction: column; line-height: 1.35; padding-top: .15rem; }
.rp-st b { color: #fff; font-size: .95rem; }
.rp-st bdi { color: rgba(255,255,255,.6); font-family: var(--font); font-size: .85rem; }
.rp-note { margin-top: 1.6rem; padding-top: 1.2rem; border-top: 1px solid rgba(255,255,255,.12); display: flex; gap: .7rem; font-size: .82rem; line-height: 1.55; color: rgba(255,255,255,.72); }
.rp-note i { color: var(--green-2); margin-top: .15rem; }
.rp-note bdi { display: block; font-family: var(--font); margin-top: .2rem; }

.rp-content { min-width: 0; }
.rp-form { display: flex; flex-direction: column; gap: 1.4rem; }
.rp-card { background: #fff; border: 1px solid #e8e4d6; border-radius: 20px; padding: 1.6rem 1.7rem; box-shadow: 0 10px 30px -18px rgba(70,50,5,.35); display: flex; flex-direction: column; gap: 1.15rem; position: relative; transition: border-color .2s; }
.rp-card.done { border-color: rgba(22,163,74,.45); }
.rp-card.done::after { content: "\f058"; font-family: "Font Awesome 6 Free"; font-weight: 900; position: absolute; top: 1.2rem; inset-inline-end: 1.4rem; color: var(--green); font-size: 1.3rem; }
.rp-card-h { display: flex; align-items: center; gap: .9rem; padding-bottom: 1rem; border-bottom: 1px solid #f0ecde; }
.rp-card-h h2 { font-size: 1.15rem; font-weight: 800; line-height: 1.25; }
.rp-card-h h2 small { font-weight: 500; color: var(--muted); font-size: .8rem; }
.rp-card-h bdi { font-family: var(--font); color: var(--muted); font-size: .95rem; }
.rp-n { width: 40px; height: 40px; flex: none; border-radius: 12px; display: grid; place-items: center; font-weight: 800; color: #fff; font-size: 1.05rem; background: linear-gradient(135deg, var(--gold), var(--gold-2)); box-shadow: 0 8px 16px -8px rgba(184,138,18,.8); }

.rf { display: flex; flex-direction: column; gap: .4rem; min-width: 0; }
.rf-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1.1rem; }
.rf-l { font-size: .9rem; font-weight: 700; line-height: 1.4; }
.l-en { color: #111827; }
.l-sep { color: #b0aa97; font-weight: 400; }
.l-ar { color: var(--muted); font-family: var(--font); font-weight: 600; }
.rf .req { color: var(--error); margin-inline-start: .2rem; }
.rf-w { position: relative; display: block; }
.rf-w > i { position: absolute; inset-inline-start: .95rem; top: 50%; transform: translateY(-50%); color: var(--gold); font-size: .95rem; pointer-events: none; width: 18px; text-align: center; }
.rf-w input, .rf-w select { width: 100%; height: 50px; padding: 0 .95rem 0 2.8rem; border: 1.5px solid #e2dece; border-radius: 12px; background: #fcfbf7; font-size: .97rem; color: #111827; transition: border-color .15s, box-shadow .15s, background .15s; }
.rf-w select { appearance: none; -webkit-appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23b88a12' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right .95rem center; padding-right: 2.4rem; text-overflow: ellipsis; }
.rf-w input:focus, .rf-w select:focus { outline: none; border-color: var(--gold); background: #fff; box-shadow: 0 0 0 4px rgba(184,138,18,.15); }
.rf-w input[readonly] { background: #f4f2ea; color: #4b5563; }
.rf-w input:disabled, .rf-w select:disabled { background: #f0eee6; color: #7a7566; cursor: not-allowed; }
.rf-w input::placeholder { color: #aba58f; }
.rf-h { color: var(--muted); font-size: .78rem; line-height: 1.45; }

.rp-check { display: flex; gap: .8rem; align-items: flex-start; padding: 1rem 1.1rem; background: #fbf6e6; border: 1px solid #efe3b8; border-radius: 14px; cursor: pointer; font-size: .88rem; line-height: 1.55; }
.rp-check input { width: 20px; height: 20px; margin-top: .15rem; flex: none; accent-color: var(--gold); }
.rp-check bdi { display: block; font-family: var(--font); color: var(--muted); margin-top: .25rem; }

.rp-lock { border: 0; padding: 0; margin: 0; min-width: 0; display: flex; flex-direction: column; gap: 1.4rem; }
.rp-lock:disabled { opacity: .45; pointer-events: none; filter: grayscale(.4); position: relative; }
.verify-row { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.verify-msg { font-weight: 700; font-size: .92rem; display: inline-flex; gap: .5rem; align-items: center; }
.verify-msg.ok, .rp-card.done .verify-msg { color: var(--green); }
.verify-msg.err { color: var(--error); }

.rp-state { align-items: center; text-align: center; padding: 2.8rem 1.8rem; }
.rp-state h2 { font-size: 1.5rem; font-weight: 800; }
.rp-ar { font-family: var(--font); color: var(--muted); font-size: 1.1rem; margin-top: -.6rem; }
.rp-state .alert, .rp-state .receipt { text-align: start; width: 100%; }
.rp-school { font-weight: 800; font-size: 1.05rem; line-height: 1.5; }
.rp-school bdi { font-family: var(--font); font-weight: 600; color: var(--muted); }
.rp-foot { text-align: center; padding: 1.4rem 1rem 2rem; color: #8b8670; font-size: .8rem; }
.rp-body .id-drop { background: #fcfbf7; border-color: #e2dece; }
.rp-body .id-drop:hover, .rp-body .id-drop.drag { border-color: var(--gold); background: #fbf6e6; }
.rp-body .id-drop bdi { font-family: var(--font); color: var(--muted); }
.rp-body .privacy { display: flex; gap: .6rem; font-size: .83rem; line-height: 1.55; }
.rp-body .privacy bdi { display: block; font-family: var(--font); margin-top: .15rem; }
.rp-body .alert { align-items: flex-start; line-height: 1.6; }
.rp-body .alert bdi { font-family: var(--font); }
.rp-body .receipt div { font-size: .92rem; }

@media (max-width: 900px) {
  .rp-wrap { grid-template-columns: 1fr; padding: 1.2rem 1rem 2rem; gap: 1.2rem; }
  .rp-aside { position: static; padding: 1.1rem 1.2rem; }
  .rp-steps { flex-direction: row; gap: .8rem; overflow-x: auto; }
  .rp-steps li { padding-bottom: 0; flex: 1; min-width: 120px; flex-direction: column; align-items: center; text-align: center; gap: .4rem; }
  .rp-steps li:not(:last-child)::after, .rp-note { display: none; }
  .rp-st { align-items: center; }
  .rp-badge { margin-inline-start: 0; }
}
@media (max-width: 600px) {
  .rf-row { grid-template-columns: 1fr; }
  .rp-card { padding: 1.2rem 1.1rem; border-radius: 16px; }
  .rp-hero-in { padding: 1.2rem 1rem; }
  .rp-titles h1 { font-size: 1.15rem; }
}
/* ============ Original-platform look for registration pages (og-*) ============ */
.og-body { background: #f8f9fc; font-family: 'Segoe UI', Tahoma, Geneva, 'Cairo', Verdana, sans-serif; }
.og-body .rp-hero { background: linear-gradient(135deg, #b88a12, #d4af37); padding: 1.5rem 0; box-shadow: 0 4px 6px -1px rgba(0,0,0,.1), 0 2px 4px -1px rgba(0,0,0,.06); }
.og-body .rp-hero::before, .og-body .rp-hero::after { display: none; }
.og-body .rp-hero-in { justify-content: center; text-align: center; flex-wrap: wrap; gap: 1rem; padding: 0 1rem; }
.og-body .rp-logo { width: auto; height: auto; background: none; border: 0; backdrop-filter: none; font-size: 2.5rem; border-radius: 0; }
.og-body .rp-logo:has(img) { background: #fff; padding: 6px; border-radius: 14px; width: 64px; height: 64px; }
.og-body .rp-titles h1 { font-size: 1.9rem; font-weight: 700; text-shadow: 1px 1px 3px rgba(0,0,0,.2); }
.og-body .rp-titles h1 bdi { font-family: 'Segoe UI', Tahoma, 'Cairo', sans-serif; }
.og-body .rp-titles p { font-size: .95rem; opacity: .95; }
.og-body .rp-wrap.single { max-width: 1200px; padding: 2rem 1rem 2rem; }
.og-body .rp-form { gap: 2rem; }

.og-body .rp-card { display: block; padding: 0; gap: 0; border: 0; border-radius: 16px; overflow: hidden; background: #fff; box-shadow: 0 10px 15px -3px rgba(0,0,0,.1), 0 4px 6px -2px rgba(0,0,0,.05); transition: transform .2s ease; }
.og-body .rp-card:hover { transform: translateY(-3px); }
.og-body .rp-card.done { border: 0; }
.og-body .rp-card.done::after { top: 1.45rem; inset-inline-end: auto; inset-inline-start: 1.6rem; color: #fff; font-size: 1.4rem; }
.og-body .rp-card-h { background: #b88a12; color: #fff; padding: 1.5rem; border: 0; gap: 1rem; align-items: center; }
.og-body .rp-ci { font-size: 1.5rem; }
.og-body .rp-card-h h2 { font-size: 1.5rem; font-weight: 600; color: #fff; }
.og-body .rp-card-h h2 small { color: rgba(255,255,255,.8); }
.og-body .rp-card-h > div { display: flex; flex-wrap: wrap; align-items: baseline; gap: .3rem .9rem; }
.og-body .rp-card-h bdi { color: rgba(255,255,255,.92); font-size: 1.2rem; font-family: 'Segoe UI', Tahoma, 'Cairo', sans-serif; }
.og-body .rp-card > :not(.rp-card-h) { margin-inline: 2rem; margin-top: 1.5rem; }
.og-body .rp-card > :last-child { margin-bottom: 2rem; }
.og-body .rp-card.rp-state { padding: 2.5rem 2rem; display: flex; }
.og-body .rp-card.rp-state > * { margin: 0; }

.og-body .rf-row { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.5rem; }
.og-body .rp-card > .rf:only-of-type, .og-body .rp-card > .rf { }
.og-body .rf { gap: .5rem; }
.og-body .rf-l { display: flex; align-items: center; flex-wrap: wrap; gap: .45rem; font-weight: 600; font-size: 1rem; margin-bottom: 0; color: #111827; }
.og-body .rf-l > i { color: #b88a12; width: 20px; text-align: center; }
.og-body .l-en, .og-body .l-ar { color: #111827; }
.og-body .l-ar { font-family: 'Segoe UI', Tahoma, 'Cairo', sans-serif; font-weight: 600; }
.og-body .l-sep { color: #9ca3af; margin: 0 .1rem; }
.og-body .rf .req { color: #dc2626; margin: 0 .3rem; }
.og-body .rf-w input, .og-body .rf-w select { height: auto; padding: .8rem 1rem; border: 2px solid #e5e7eb; border-radius: 8px; background: #fff; font-size: 1rem; }
.og-body .rf-w select { background-position: left .9rem center; padding-left: 2.4rem; padding-right: 1rem; }
.og-body .rf-w input:focus, .og-body .rf-w select:focus { border-color: #b88a12; box-shadow: 0 0 0 3px rgba(184,138,18,.2); background: #fff; }
.og-body .rf-w input[readonly], .og-body .rf-w select:disabled, .og-body .rf-w input:disabled { background: #f3f4f6; color: #6b7280; }
.og-body .rf-h { color: #6b7280; }

.og-body .id-drop { border: 2px dashed #e5e7eb; border-radius: 8px; background: #f9fafb; padding: 2rem; }
.og-body .id-drop:hover, .og-body .id-drop.drag { border-color: #b88a12; background: rgba(184,138,18,.05); }
.og-body .id-drop > i { font-size: 3rem; color: #b88a12; }
.og-body .file-list li i.fa-file { color: #16a34a; }
.og-body .rp-check { background: #f9fafb; border: 1px solid #e5e7eb; border-radius: 8px; }

.og-buttons { display: flex; justify-content: center; gap: 1rem; flex-wrap: wrap; margin-top: 0; }
.og-body .og-buttons .btn, .og-body .rp-form > .btn { padding: .8rem 2rem; border-radius: 8px; font-size: 1rem; font-weight: 600; box-shadow: none; }
.og-body .btn-green { background: #16a34a; color: #fff; }
.og-body .btn-green:hover:not(:disabled) { background: #22c55e; transform: translateY(-2px); }
.og-body .btn-green:disabled { opacity: .6; cursor: not-allowed; }
.og-body .btn-ghost { background: #e5e7eb; color: #111827; border: 0; }
.og-body .btn-ghost:hover { background: #d1d5db; color: #111827; transform: translateY(-2px); }
.og-body .rp-foot { background: #b88a12; color: #fff; padding: 1.5rem; margin-top: auto; }
.og-body .rp-foot bdi { font-family: 'Segoe UI', Tahoma, 'Cairo', sans-serif; }
.og-body .progress { margin-top: 1rem; }

@media (max-width: 768px) {
  .og-body .rp-titles h1 { font-size: 1.35rem; }
  .og-body .rp-card-h h2 { font-size: 1.2rem; }
  .og-body .rp-card-h bdi { font-size: 1rem; }
  .og-body .rp-card > :not(.rp-card-h) { margin-inline: 1.1rem; }
  .og-buttons { flex-direction: column; }
  .og-body .og-buttons .btn { width: 100%; }
}
/* ---- fixes: right-to-left alignment, big title, full-width ID fields ---- */
.og-body .rp-hero-in { justify-content: flex-start; text-align: right; direction: rtl; max-width: 1200px; padding: 1.6rem 1rem; gap: 1.2rem; }
.og-body .rp-titles { flex: 1; min-width: 260px; text-align: right; }
.og-body .rp-titles h1 { font-size: 2.6rem; line-height: 1.3; font-weight: 800; text-align: right; }
.og-body .rp-titles .rp-en { font-size: 1.15rem; opacity: .95; text-align: right; margin-top: .2rem; letter-spacing: .02em; }
.og-body .rp-logo { font-size: 3.2rem; }
.og-body .rp-badge { margin: 0; font-size: 1.05rem; }
.og-body .rp-card-h > div { text-align: right; }
.og-body .rf-l, .og-body .rf-h, .og-body .privacy, .og-body .rp-check, .og-body .alert, .og-body .verify-row { text-align: right; direction: rtl; }
.og-body .rf-h { display: block; }
.og-body .rf-row.one { grid-template-columns: 1fr; }
.og-body .rf-w input { min-width: 0; text-overflow: clip; letter-spacing: .02em; }
#eidName, #eidNumber { font-size: 1.05rem; font-weight: 600; direction: ltr; text-align: left; }
@media (max-width: 768px) { .og-body .rp-titles h1 { font-size: 1.7rem; } .og-body .rp-hero-in { padding: 1.2rem 1rem; } }
/* ---- Arabic first, then English ---- */
.og-body .rp-card-h > div { display: flex; flex-wrap: wrap; align-items: baseline; gap: .2rem .8rem; }
.og-body .rp-card-h bdi { font-size: 1.5rem; font-weight: 600; color: #fff; }
.og-body .rp-card-h h2 { font-size: 1.15rem; font-weight: 500; color: rgba(255,255,255,.9); }
.og-body .rp-card-h h2::before { content: "— "; }
.og-body .rp-state h2 { font-size: 1.6rem; }
.og-body .rp-ar { font-family: 'Segoe UI', Tahoma, sans-serif; }
.og-body .id-drop bdi, .og-body .privacy bdi, .og-body .rp-check bdi { display: block; font-family: 'Segoe UI', Tahoma, 'Cairo', sans-serif; color: #111827; font-weight: 600; margin: 0 0 .15rem; }
/* ================= Flat form (no cards) + scroll fix ================= */
/* The hidden honeypot used left:-9999px, which in a right-to-left page widens the scroll area. */
.hp { position: absolute !important; top: 0; inset-inline-start: 0; left: auto; width: 1px; height: 1px; opacity: 0; overflow: hidden; clip: rect(0 0 0 0); pointer-events: none; }
/* overflow on html only: also setting it on body makes body a second scroll container, which makes scrolling sticky/laggy */
html { overflow-x: hidden; }
body.og-body { max-width: 100%; }
.og-body { background: #fff; }
.og-body .rp-wrap.single { max-width: 1040px; padding: 2.2rem 1.25rem 2.5rem; }
.og-body .rp-form { gap: 2.6rem; }

.og-body .rp-card { background: transparent; box-shadow: none; border: 0; border-radius: 0; overflow: visible; padding: 0; transform: none !important; }
.og-body .rp-card:hover { transform: none !important; }
.og-body .rp-card > :not(.rp-card-h) { margin-inline: 0; margin-top: 1.25rem; }
.og-body .rp-card > :last-child { margin-bottom: 0; }
.og-body .rp-card-h { background: transparent; color: #111827; padding: 0 0 .7rem; border: 0; border-bottom: 3px solid #b88a12; gap: .8rem; }
.og-body .rp-ci { color: #b88a12; font-size: 1.5rem; }
.og-body .rp-card-h bdi { color: #111827; font-size: 1.45rem; font-weight: 700; }
.og-body .rp-card-h h2 { color: #6b7280; font-size: 1.1rem; font-weight: 500; }
.og-body .rp-card.done::after { top: .15rem; inset-inline-start: 0; inset-inline-end: auto; color: #16a34a; font-size: 1.3rem; }
.og-body .rp-card.rp-state { padding: 2rem 0; }

.og-body .id-drop { background: #fafaf7; }
.og-body .rp-check { background: #fbf8ee; border-color: #efe6c4; }
.client-err { margin-bottom: 0; }
.client-err ul { margin: .3rem 1.2rem 0 0; padding: 0; list-style: disc; font-weight: 600; line-height: 1.8; }
.og-body .client-err { align-items: flex-start; }
.og-body .btn-green:not(.ready):not(:disabled) { opacity: .85; }
.og-body .btn-green.ready { box-shadow: 0 6px 16px -6px rgba(22,163,74,.6); }
.og-body .rp-foot { text-align: center; }
/* ---- ID camera buttons, danger icon ---- */
.id-actions { display: flex; gap: .8rem; flex-wrap: wrap; justify-content: center; }
.id-actions .btn { padding: .7rem 1.4rem; font-weight: 600; }
.id-tip { text-align: center; }
.id-tip i { color: #b88a12; margin-inline-end: .3rem; }
.icon-btn.danger:hover { background: rgba(220,38,38,.1); color: #dc2626; border-color: #dc2626; }
@media (max-width: 600px) { .id-actions .btn { width: 100%; } }
/* ---- Dashboard home bar ---- */
.home-bar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding: 1rem 1.3rem; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.home-clock { display: flex; align-items: center; gap: .9rem; }
.home-clock > i { width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center; font-size: 1.3rem; color: var(--gold); background: var(--gold-soft); }
.home-clock b { display: block; font-size: 1.1rem; font-weight: 700; }
.home-clock span { color: var(--muted); font-variant-numeric: tabular-nums; font-size: .95rem; }
/* ================= Official logo placement ================= */
.login-logo { display: flex; justify-content: center; margin-bottom: .4rem; }
.login-logo-img { display: block; width: min(330px, 100%); height: auto; }
.sb-brand.logo { flex-direction: column; align-items: stretch; gap: .65rem; padding: 1.1rem 1rem 1rem; }
.sb-logo-plate { display: block; background: #fff; border-radius: 14px; padding: .55rem .75rem; }
.sb-logo-img { display: block; width: 100%; height: auto; }
.sb-sub { color: var(--gold-2); font-family: var(--font-en); letter-spacing: .1em; text-align: center; font-size: .7rem; text-transform: uppercase; }
.rp-plate { background: #fff; border-radius: 16px; padding: .7rem 1.2rem; box-shadow: 0 8px 22px -10px rgba(0,0,0,.4); flex: none; display: block; }
.rp-plate-img { display: block; height: 66px; width: auto; max-width: 100%; }
.og-body .rp-titles-page h1 { font-size: 2.2rem; font-weight: 800; text-align: right; }
.og-body .rp-titles-page .rp-en { font-size: 1.15rem; text-align: right; }
@media (max-width: 768px) {
  .rp-plate-img { height: 48px; }
  .og-body .rp-titles-page h1 { font-size: 1.6rem; }
  .og-body .rp-titles-page .rp-en { font-size: 1rem; }
}
/* ================= Installable app (PWA) ================= */
html { -webkit-tap-highlight-color: transparent; }
body { overscroll-behavior-y: none; }
.topbar { padding-top: calc(.85rem + env(safe-area-inset-top)); padding-inline: max(1.8rem, env(safe-area-inset-left), env(safe-area-inset-right)); }
.sidebar { padding-top: env(safe-area-inset-top); padding-bottom: env(safe-area-inset-bottom); }
.content { padding-bottom: max(1.8rem, env(safe-area-inset-bottom)); }
.ios-tip { font-size: .85rem; line-height: 1.55; color: var(--muted); text-align: center; padding: .6rem .8rem; background: var(--gold-soft); border-radius: 10px; }
.ios-tip i { color: var(--gold); margin-inline-end: .35rem; }
.dm-tip { margin: .3rem .5rem .5rem; text-align: start; }
.pwa-bar { position: fixed; z-index: 200; inset-inline: 1rem; bottom: calc(1rem + env(safe-area-inset-bottom)); max-width: 460px; margin-inline: auto;
  display: flex; align-items: center; justify-content: space-between; gap: .8rem; padding: .8rem 1.1rem; border-radius: 14px;
  background: #10241a; color: #fff; font-weight: 600; font-size: .92rem; box-shadow: 0 18px 40px -12px rgba(0,0,0,.5); }
.pwa-bar[hidden] { display: none; }
.pwa-bar.off { background: #b45309; justify-content: center; }
.pwa-bar button { border: 0; border-radius: 9px; padding: .45rem .95rem; font-weight: 700; cursor: pointer; background: linear-gradient(135deg, #b88a12, #d4af37); color: #fff; }
@media (max-width: 900px) { .topbar { padding-inline: max(1rem, env(safe-area-inset-left), env(safe-area-inset-right)); } }
@media (display-mode: standalone) { .app-foot { padding-bottom: calc(1rem + env(safe-area-inset-bottom)); } }
/* ================= App download page (/app) ================= */
.ap-body { background: #f8f9fc; font-family: 'Segoe UI', Tahoma, 'Cairo', system-ui, sans-serif; color: var(--text); min-height: 100vh; display: flex; flex-direction: column; overflow-x: hidden; }
.ap-hero { position: relative; overflow: hidden; text-align: center; color: #fff; padding: 2.4rem 1rem 4.2rem; background: linear-gradient(135deg, #8a640a 0%, #b88a12 45%, #d4af37 100%); }
.ap-hero::before { content: ""; position: absolute; width: 560px; height: 560px; border-radius: 50%; border: 80px solid rgba(255,255,255,.07); inset-inline-end: -180px; top: -320px; }
.ap-hero::after { content: ""; position: absolute; width: 320px; height: 320px; border-radius: 50%; border: 50px solid rgba(255,255,255,.06); inset-inline-start: -110px; bottom: -190px; }
.ap-hero-in { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: .8rem; }
.ap-hero h1 { font-size: 2.4rem; font-weight: 800; line-height: 1.3; text-shadow: 0 2px 8px rgba(0,0,0,.2); }
.ap-sub { font-family: var(--font-en); opacity: .95; font-size: 1.1rem; }
.ap-wrap { width: 100%; max-width: 1040px; margin: -2.6rem auto 0; padding: 0 1.25rem 2.5rem; position: relative; z-index: 2; display: flex; flex-direction: column; gap: 2.2rem; }

.ap-install { display: grid; grid-template-columns: 1fr 250px; gap: 2rem; align-items: center; background: #fff; border-radius: 22px; padding: 2rem 2.2rem; box-shadow: 0 24px 50px -22px rgba(70,50,5,.45); }
.ap-install-txt h2 { font-size: 1.7rem; font-weight: 800; }
.ap-en { color: var(--muted); font-family: var(--font-en); margin: .1rem 0 .9rem; text-align: left; }
.ap-desc { line-height: 1.85; color: #374151; margin-bottom: 1.2rem; }
.ap-desc-en { display: block; color: var(--muted); font-family: var(--font-en); font-size: .9rem; margin-top: .3rem; text-align: left; }
.ap-actions { display: flex; gap: .8rem; flex-wrap: wrap; }
.ap-actions .btn { font-weight: 700; }
.ap-actions .btn-green { background: #16a34a; color: #fff; box-shadow: 0 10px 22px -10px rgba(22,163,74,.75); }
.ap-actions .btn-green:hover { background: #22c55e; }
.ap-actions .btn-ghost { background: #eef0f4; border: 0; color: #111827; }
.ap-state { margin-top: 1rem; padding: .75rem 1rem; border-radius: 10px; background: var(--gold-soft); color: #7a5a08; font-weight: 600; font-size: .9rem; line-height: 1.6; }
.ap-state.ok { background: var(--green-soft); color: var(--green); }
.ap-install .ios-tip { margin-top: 1rem; text-align: start; }
.ap-qr-box { display: flex; flex-direction: column; align-items: center; gap: .35rem; text-align: center; padding: 1.2rem 1rem; border: 2px dashed #e4d7a6; border-radius: 18px; background: #fffdf5; }
.ap-qr { width: 190px; height: 190px; background: #fff; border-radius: 12px; padding: 8px; display: grid; place-items: center; box-shadow: 0 6px 18px -10px rgba(0,0,0,.35); }
.ap-qr svg { width: 100%; height: 100%; display: block; }
.ap-qr-box strong { margin-top: .5rem; }
.ap-qr-box span { color: var(--muted); font-family: var(--font-en); font-size: .85rem; }
.ap-qr-box code { background: #f4f1e3; font-size: .78rem; margin-top: .3rem; word-break: break-all; }

.ap-h2 { font-size: 1.4rem; font-weight: 800; text-align: center; margin-bottom: 1.2rem; }
.ap-h2-en { color: var(--muted); font-family: var(--font-en); font-weight: 600; font-size: 1.05rem; }
.ap-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.2rem; }
.ap-step { background: #fff; border: 1px solid #ece7d3; border-radius: 18px; padding: 1.4rem 1.3rem; }
.ap-ico { width: 52px; height: 52px; border-radius: 15px; display: grid; place-items: center; font-size: 1.6rem; color: #fff; margin-bottom: .8rem; background: linear-gradient(135deg, #b88a12, #d4af37); box-shadow: 0 10px 20px -10px rgba(184,138,18,.8); }
.ap-step h3 { font-size: 1.15rem; font-weight: 800; margin-bottom: .7rem; }
.ap-step h3 small { color: var(--muted); font-family: var(--font-en); font-weight: 600; font-size: .78rem; margin-inline-start: .3rem; }
.ap-step ol { list-style: none; counter-reset: s; display: flex; flex-direction: column; gap: .7rem; }
.ap-step li { counter-increment: s; position: relative; padding-inline-start: 2.1rem; line-height: 1.6; font-size: .93rem; }
.ap-step li::before { content: counter(s); position: absolute; inset-inline-start: 0; top: .05rem; width: 1.5rem; height: 1.5rem; border-radius: 50%; display: grid; place-items: center; font-size: .78rem; font-weight: 800; color: #7a5a08; background: var(--gold-soft); font-family: var(--font-en); }
.ap-step li em { display: block; font-style: normal; color: var(--muted); font-family: var(--font-en); font-size: .82rem; text-align: left; }
.ap-step li i { color: var(--gold); }

.ap-why { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
.ap-why > div { display: flex; flex-direction: column; align-items: center; gap: .25rem; text-align: center; padding: 1.1rem .6rem; border-radius: 16px; background: #fff; border: 1px solid #ece7d3; }
.ap-why i { font-size: 1.5rem; color: #b88a12; margin-bottom: .2rem; }
.ap-why span { color: var(--muted); font-family: var(--font-en); font-size: .82rem; }
.ap-body .rp-foot { background: #b88a12; color: #fff; text-align: center; padding: 1.3rem; margin-top: auto; font-size: .85rem; }
.ap-body .rp-foot bdi { font-family: 'Segoe UI', Tahoma, 'Cairo', sans-serif; }
.ap-body .rp-plate { box-shadow: 0 14px 30px -12px rgba(0,0,0,.5); }

.app-link { display: flex; align-items: center; justify-content: center; gap: .55rem; padding: .7rem 1rem; border-radius: 12px; font-weight: 700; font-size: .92rem; color: var(--gold); background: var(--gold-soft); transition: background .15s; }
.app-link:hover { background: rgba(184,138,18,.2); }

@media (max-width: 900px) {
  .ap-install { grid-template-columns: 1fr; padding: 1.5rem 1.3rem; }
  .ap-qr-box { display: none; }                 /* the QR is for scanning from another device */
  .ap-grid { grid-template-columns: 1fr; }
  .ap-why { grid-template-columns: repeat(2, 1fr); }
  .ap-hero h1 { font-size: 1.8rem; }
}

/* ================= Mobile bottom navigation (app feel) ================= */
.bottom-nav { display: none; }
@media (max-width: 900px) {
  .bottom-nav { display: flex; position: fixed; z-index: 70; inset-inline: 0; bottom: 0; background: var(--card); border-top: 1px solid var(--border);
    box-shadow: 0 -10px 30px -14px rgba(16,24,40,.35); padding: .35rem .4rem calc(.35rem + env(safe-area-inset-bottom)); }
  .bn-item { flex: 1; display: flex; flex-direction: column; align-items: center; gap: .15rem; padding: .45rem .2rem; border: 0; background: none;
    border-radius: 12px; color: var(--muted); font-size: .68rem; font-weight: 600; font-family: inherit; text-decoration: none; min-width: 0; }
  .bn-item i { font-size: 1.15rem; }
  .bn-item span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .bn-item.active { color: var(--gold); background: var(--gold-soft); }
  .content { padding-bottom: calc(5.6rem + env(safe-area-inset-bottom)); }
  .app-foot { display: none; }
  .pwa-bar { bottom: calc(5rem + env(safe-area-inset-bottom)); }
  .toasts { top: calc(70px + env(safe-area-inset-top)); }
}
.ap-state .ap-desc-en, .ap-install .ios-tip .ap-desc-en { font-weight: 500; font-size: .82rem; margin-top: .2rem; }

/* ================= /get-app — single button page (ga-*) ================= */
.ga-body { min-height: 100vh; display: flex; justify-content: center; font-family: 'Segoe UI', Tahoma, 'Cairo', system-ui, sans-serif; color: #111827; overflow-x: hidden;
  background: radial-gradient(120% 70% at 50% -10%, rgba(212,175,55,.28), transparent 60%), #f8f9fc; }
.ga-wrap { width: min(560px, 100%); padding: calc(1.6rem + env(safe-area-inset-top)) 1.1rem calc(1.6rem + env(safe-area-inset-bottom)); display: flex; flex-direction: column; align-items: center; gap: 1.2rem; }
.ga-logo-img { display: block; width: min(300px, 80vw); height: auto; }
.ga-card { width: 100%; background: #fff; border-radius: 26px; padding: 2rem 1.5rem 1.6rem; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 1rem;
  box-shadow: 0 28px 60px -26px rgba(70,50,5,.5); border-top: 6px solid #b88a12; }
.ga-appicon img { display: block; width: 96px; height: 96px; border-radius: 24px; box-shadow: 0 14px 28px -12px rgba(184,138,18,.8); }
.ga-card h1 { font-size: 1.45rem; font-weight: 800; line-height: 1.45; }
.ga-en { color: #6b7280; font-family: var(--font-en); font-size: .95rem; margin-top: -.5rem; }

.ga-main { width: 100%; min-height: 70px; display: flex; align-items: center; justify-content: center; gap: .9rem; border: 0; border-radius: 18px; cursor: pointer;
  color: #fff; background: #16a34a; font-family: inherit; padding: .8rem 1.2rem; transition: transform .15s, background .15s, box-shadow .15s;
  box-shadow: 0 16px 30px -14px rgba(22,163,74,.85); }
.ga-main:hover { background: #22c55e; transform: translateY(-2px); }
.ga-main > i { font-size: 1.7rem; }
.ga-main span { display: flex; flex-direction: column; line-height: 1.3; text-align: start; }
.ga-main bdi { font-size: 1.3rem; font-weight: 800; }
.ga-main small { font-family: var(--font-en); font-size: .9rem; opacity: .92; font-weight: 500; }
.ga-main.ready { animation: gaPulse 2.2s ease-in-out infinite; }
@keyframes gaPulse { 0%, 100% { box-shadow: 0 16px 30px -14px rgba(22,163,74,.85); } 50% { box-shadow: 0 16px 38px -8px rgba(22,163,74,1); } }
.ga-done { width: 100%; padding: 1rem; border-radius: 14px; background: var(--green-soft); color: var(--green); font-weight: 700; }

.ga-help { width: 100%; text-align: start; background: #fffbea; border: 1px solid #efe3b0; border-radius: 18px; padding: 1.1rem 1.1rem 1rem; }
.ga-help h2 { font-size: 1.1rem; font-weight: 800; display: flex; align-items: center; flex-wrap: wrap; gap: .45rem; margin-bottom: .8rem; }
.ga-help h2 i { color: #b88a12; }
.ga-help h2 small { color: #6b7280; font-family: var(--font-en); font-weight: 600; font-size: .78rem; }
.ga-steps { list-style: none; display: flex; flex-direction: column; gap: .8rem; }
.ga-steps li { display: flex; gap: .8rem; align-items: flex-start; }
.ga-steps .n { flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; color: #fff; background: linear-gradient(135deg, #b88a12, #d4af37); font-family: var(--font-en); }
.ga-steps div { line-height: 1.6; }
.ga-steps em { display: block; font-style: normal; color: #6b7280; font-family: var(--font-en); font-size: .85rem; text-align: left; }
.ga-steps i { color: #b88a12; }
.ga-note { margin-top: .8rem; font-size: .86rem; line-height: 1.7; color: #4b5563; }
.ga-note span { display: block; color: #6b7280; font-family: var(--font-en); font-size: .8rem; text-align: left; margin-top: .15rem; }

.ga-row { width: 100%; }
.ga-link { display: flex; align-items: center; justify-content: center; gap: .5rem; flex-wrap: wrap; padding: .75rem 1rem; border-radius: 14px; background: #eef0f4; font-weight: 700; color: #111827; }
.ga-link:hover { background: #e3e6ec; }
.ga-link small { color: #6b7280; font-family: var(--font-en); font-weight: 500; }
.ga-share { display: flex; gap: .6rem; flex-wrap: wrap; justify-content: center; }
.ga-chip { display: inline-flex; align-items: center; gap: .45rem; padding: .5rem 1rem; border: 1px solid #e5e7eb; background: #fff; border-radius: 99px; font-size: .85rem; font-weight: 600; font-family: inherit; cursor: pointer; color: #374151; }
.ga-chip:hover { border-color: #b88a12; color: #b88a12; }
.ga-qr-box { display: none; flex-direction: column; align-items: center; gap: .5rem; padding-top: .4rem; font-size: .85rem; color: #6b7280; }
.ga-qr { width: 150px; height: 150px; padding: 6px; background: #fff; border-radius: 12px; box-shadow: 0 6px 18px -10px rgba(0,0,0,.4); }
.ga-qr svg { width: 100%; height: 100%; display: block; }
@media (min-width: 901px) { .ga-qr-box:not([hidden]) { display: flex; } }
.ga-trust { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: .4rem 1rem; font-size: .78rem; color: #6b7280; }
.ga-trust i { color: #16a34a; margin-inline-end: .25rem; }
.ga-foot { font-size: .78rem; color: #8b8670; text-align: center; }
.ga-foot bdi { font-family: 'Segoe UI', Tahoma, 'Cairo', sans-serif; }
.ga-main small, .ga-main bdi { color: #fff; }
.ga-link small { color: #6b7280; }

/* ---- iPhone guide ---- */
.ga-ico { display: inline-grid; place-items: center; width: 1.7rem; height: 1.7rem; border-radius: 8px; background: #e7f0ff; color: #0a7aff; vertical-align: middle; }
.ga-steps b { color: #b88a12; }
.ga-fakerow { display: flex; align-items: center; gap: .7rem; margin-top: .55rem; padding: .7rem .9rem; border-radius: 12px; background: #fff; border: 1px solid #e5e7eb; box-shadow: 0 4px 12px -8px rgba(0,0,0,.3); font-weight: 600; }
.ga-fakerow i { font-size: 1.35rem; color: #111827; }
.ga-fakerow span { display: flex; flex-direction: column; line-height: 1.4; }
.ga-fakerow small { color: #6b7280; font-family: var(--font-en); font-weight: 500; }
.ga-warn { padding: .7rem .8rem; border-radius: 12px; background: #fff1f0; color: #9a3412; }
.ga-warn span { color: #9a3412; }
.ga-arrow { position: fixed; z-index: 300; display: flex; flex-direction: column; align-items: center; gap: .15rem; padding: .5rem .8rem; border-radius: 14px;
  background: #10241a; color: #fff; font-weight: 700; font-size: .82rem; box-shadow: 0 14px 30px -10px rgba(0,0,0,.6); pointer-events: none; }
.ga-arrow i { font-size: 1.6rem; color: #d4af37; }
.ga-arrow[hidden] { display: none; }
.ga-arrow.bottom { bottom: calc(env(safe-area-inset-bottom) + 64px); inset-inline: 0; margin-inline: auto; width: max-content; animation: gaBounceY 1.1s ease-in-out infinite; flex-direction: column; }
.ga-arrow.top { top: calc(env(safe-area-inset-top) + 56px); right: 12px; flex-direction: column-reverse; animation: gaBounceUp 1.1s ease-in-out infinite; }
@keyframes gaBounceY { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(10px); } }
@keyframes gaBounceUp { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
/* ---- iPhone: compact 3-icon guide, nothing else ---- */
.ga-strip { list-style: none; display: flex; align-items: flex-start; justify-content: center; gap: .3rem; margin: .2rem 0 .6rem; }
.ga-strip li { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: .35rem; text-align: center; line-height: 1.35; }
.ga-strip li.sep { flex: 0 0 auto; align-self: center; margin-top: -1.2rem; color: #b88a12; font-size: .9rem; }
.ga-strip .ic { width: 58px; height: 58px; border-radius: 16px; display: grid; place-items: center; font-size: 1.5rem; color: #111827; background: #fff; border: 1px solid #e5e7eb; box-shadow: 0 8px 18px -10px rgba(0,0,0,.35); }
.ga-strip .ic.share { color: #0a7aff; background: #e7f0ff; border-color: #cfe0ff; }
.ga-strip .ic.ok { color: #fff; background: #16a34a; border-color: #16a34a; }
.ga-strip b { font-size: .88rem; font-weight: 800; }
.ga-strip small { color: #6b7280; font-family: var(--font-en); font-size: .74rem; }
.ga-where { text-align: center; font-size: .85rem; color: #4b5563; line-height: 1.7; }
.ga-where [hidden] { display: none; }
.ga-more { margin-top: .7rem; font-size: .86rem; }
.ga-more summary { cursor: pointer; font-weight: 700; color: #9a3412; text-align: center; list-style: none; padding: .4rem; }
.ga-more summary::-webkit-details-marker { display: none; }
.ga-more p { margin: .5rem 0; line-height: 1.7; color: #4b5563; }
.ga-more p span { display: block; color: #6b7280; font-family: var(--font-en); font-size: .8rem; text-align: left; }
.ga-more .ga-chip { margin: 0 auto; display: flex; }
.ga-card.ga-ios #gaInstall, .ga-card.ga-ios .ga-share, .ga-card.ga-ios .ga-trust { display: none; }
.ga-card.ga-ios .ga-help { background: transparent; border: 0; padding: 0; }
.ga-card.ga-ios .ga-help h2 { justify-content: center; }
.ga-where bdi { display: block; }
.ga-where bdi[dir=ltr] { color: #6b7280; font-family: var(--font-en); font-size: .8rem; }

/* ================= Registration: category rules ================= */
.cat-info { background: #fffbea; border: 1px solid #efe3b0; border-radius: 12px; padding: .9rem 1rem; font-size: .9rem; line-height: 1.7; }
.cat-info .ci-h { font-weight: 800; margin-bottom: .3rem; }
.cat-info .ci-h i { color: #b88a12; margin-inline-end: .4rem; }
.cat-info .ci-r { color: #4b5563; }
.cat-info .ci-d { margin-top: .5rem; }
.cat-info .ci-d summary { cursor: pointer; font-weight: 700; color: #9a6b00; }
.cat-info .ci-d p { margin-top: .4rem; color: #4b5563; font-size: .85rem; }
.parts-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(46px, 1fr)); gap: .45rem; direction: ltr; margin: .4rem 0; }
.parts-grid .part { position: relative; display: block; }
.parts-grid .part input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; cursor: pointer; margin: 0; }
.parts-grid .part span { display: grid; place-items: center; height: 42px; border: 2px solid #e5e7eb; border-radius: 10px; background: #fff; font-weight: 700; color: #374151; transition: all .12s; }
.parts-grid .part input:checked + span { background: #16a34a; border-color: #16a34a; color: #fff; }
.parts-grid .part input:disabled + span { opacity: .4; cursor: not-allowed; }
.parts-grid .part input:focus-visible + span { box-shadow: 0 0 0 3px rgba(184,138,18,.35); }
.fixed-box { background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: 12px; padding: .9rem 1rem; line-height: 1.8; color: #14532d; }
.fixed-box i { margin-inline-end: .4rem; }
.tm-row { display: grid; grid-template-columns: 1.6fr 1fr 1fr auto; gap: .5rem; align-items: center; margin-bottom: .5rem; }
.tm-row input, .tm-row select { width: 100%; padding: .65rem .8rem; border: 2px solid #e5e7eb; border-radius: 8px; background: #fff; font: inherit; font-size: .92rem; }
.tm-row input:focus, .tm-row select:focus { outline: none; border-color: #b88a12; box-shadow: 0 0 0 3px rgba(184,138,18,.2); }
@media (max-width: 700px) { .tm-row { grid-template-columns: 1fr 1fr; } .tm-row .tm-name { grid-column: 1 / -1; } .tm-row .tm-del { justify-self: end; } }
.row-off { opacity: .55; }

.tbl-cats td:first-child, .tbl-cats th:first-child { min-width: 300px; }
.tbl-cats td.small { min-width: 160px; }

/* ================= Registration by Emirates ID: field cards ================= */
.field-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: .8rem; margin-top: .4rem; }
.fcard { position: relative; display: block; cursor: pointer; }
.fcard input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.fcard > span { display: flex; flex-direction: column; align-items: center; gap: .3rem; text-align: center; padding: 1rem .6rem; min-height: 132px; justify-content: center;
  border: 2px solid #e5e7eb; border-radius: 14px; background: #fff; transition: all .15s; }
.fcard i { font-size: 1.7rem; color: #b88a12; }
.fcard b { font-size: .98rem; line-height: 1.4; color: #111827; }
.fcard small { color: #6b7280; font-size: .74rem; line-height: 1.35; }
.fcard:hover > span { border-color: #b88a12; }
.fcard input:checked + span { border-color: #16a34a; background: #f0fdf4; box-shadow: 0 8px 20px -12px rgba(22,163,74,.7); }
.fcard input:checked + span i { color: #16a34a; }
.fcard input:focus-visible + span { box-shadow: 0 0 0 3px rgba(184,138,18,.35); }
@media (max-width: 700px) { .field-cards { grid-template-columns: 1fr; } .fcard > span { min-height: 0; flex-direction: row; justify-content: flex-start; text-align: start; padding: .8rem 1rem; } }
.tm-row { grid-template-columns: 1.5fr 1.3fr 1fr 1fr auto; }
@media (max-width: 900px) { .tm-row { grid-template-columns: 1fr 1fr; } .tm-row .tm-name, .tm-row .tm-eid { grid-column: 1 / -1; } }
.tm-act { display: flex; gap: .3rem; justify-self: end; }
.tm-scan:hover { color: #b88a12; border-color: #b88a12; }
/* ---- School code viewer (Coordinators) ---- */
.code-view { background: var(--card); border: 2px solid var(--gold); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.3rem; display: flex; flex-direction: column; gap: 1rem; }
.code-view .cv-head { display: flex; gap: .9rem; align-items: center; }
.code-view .cv-head > i { width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center; font-size: 1.3rem; color: var(--gold); background: var(--gold-soft); }
.code-view .cv-code { display: flex; gap: .8rem; align-items: center; flex-wrap: wrap; }
.code-view .cv-code code { font-size: 1.8rem; letter-spacing: .18em; font-weight: 800; padding: .4rem 1rem; background: var(--gold-soft); color: var(--gold); border: 2px dashed var(--gold); border-radius: 12px; user-select: all; }
.code-view textarea { width: 100%; padding: .8rem 1rem; border: 2px solid var(--border); border-radius: 10px; background: var(--input-bg); color: var(--text); font: inherit; font-size: .9rem; line-height: 1.7; resize: vertical; }
.code-view .cv-actions { display: flex; gap: .6rem; flex-wrap: wrap; }/* team members: one card per member, filled only by reading their ID */
.tm-row { grid-template-columns: 1fr 1fr; padding: .9rem; border: 1px solid #e5e7eb; border-radius: 12px; background: #fafaf7; }
.tm-row .tm-top { grid-column: 1 / -1; display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.tm-row .tm-no { color: #b88a12; font-weight: 800; }
.tm-row .tm-st { flex: 1; min-width: 160px; font-size: .85rem; line-height: 1.5; }
.tm-row .tm-st.ok { color: #16a34a; } .tm-row .tm-st.err { color: #dc2626; } .tm-row .tm-st.busy { color: #6b7280; }
.tm-row .tm-name, .tm-row .tm-eid, .tm-row .tm-gtxt { background: #f3f4f6; color: #374151; }
@media (max-width: 600px) { .tm-row { grid-template-columns: 1fr; } .tm-row .tm-top .btn { flex: 1; } }
/* ---- choose the award: one card per competition, each opens its own registration page ---- */
.award-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.1rem; }
.award-card { display: flex; flex-direction: column; align-items: center; text-align: center; gap: .45rem; padding: 1.6rem 1.2rem; border: 2px solid #e5e7eb; border-radius: 18px; background: #fff; color: #111827; text-decoration: none; transition: border-color .15s, box-shadow .15s, transform .15s; }
.award-card:hover { border-color: #b88a12; box-shadow: 0 14px 30px -16px rgba(184,138,18,.7); transform: translateY(-3px); }
.award-ic { width: 72px; height: 72px; border-radius: 20px; display: grid; place-items: center; font-size: 2rem; color: #fff; background: linear-gradient(135deg, #b88a12, #d4af37); }
.award-card b { font-size: 1.35rem; font-weight: 800; }
.award-en { color: #6b7280; font-weight: 600; }
.award-card small { color: #6b7280; line-height: 1.6; }
.award-card em { margin-top: .5rem; font-style: normal; font-weight: 700; color: #b88a12; }
/* guardian consent to photography */
.photo-box { display: flex; flex-direction: column; gap: .6rem; padding: 1.1rem 1.2rem; border: 2px solid #efe3b0; border-radius: 12px; background: #fffbea; text-align: right; direction: rtl; }
.photo-box > b { font-size: 1.05rem; } .photo-box > b i { color: #b88a12; margin-inline-end: .35rem; }
.photo-box p { line-height: 1.7; } .photo-box small { color: #6b7280; line-height: 1.6; }
.pc-opt { display: flex; align-items: center; gap: .6rem; padding: .7rem .9rem; border: 2px solid #e5e7eb; border-radius: 10px; background: #fff; cursor: pointer; }
.pc-opt:has(input:checked) { border-color: #b88a12; background: #fdf6dc; }
.pc-opt input { width: 20px; height: 20px; accent-color: #b88a12; flex: none; }
.photo-no { color: #dc2626; font-weight: 700; }
.tm-row .tm-photo { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; padding: .6rem .8rem; border-radius: 10px; background: #fffbea; border: 1px solid #efe3b0; }
.tm-row .tm-photo b { flex: 1 1 100%; font-size: .9rem; } .tm-row .tm-photo b i { color: #b88a12; margin-inline-end: .3rem; }
.tm-row .tm-photo label { display: inline-flex; align-items: center; gap: .4rem; padding: .35rem .8rem; border: 2px solid #e5e7eb; border-radius: 99px; background: #fff; cursor: pointer; font-weight: 600; }
.tm-row .tm-photo label:has(input:checked) { border-color: #b88a12; background: #fdf6dc; }
.tm-row .tm-photo input { accent-color: #b88a12; }
.bulk-bar { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; padding: .7rem 1rem; border-bottom: 1px solid var(--border); }
.bulk-bar #bulkCount { display: inline-block; min-width: 1.4em; padding: 0 .4em; border-radius: 99px; background: var(--gold-soft); color: var(--gold); font-weight: 700; }
.tbl .chk { width: 36px; text-align: center; } .tbl .chk input { width: 17px; height: 17px; accent-color: var(--gold); cursor: pointer; }
/* registration links: extend the validity */
.act-stack { display: flex; flex-direction: column; align-items: flex-end; gap: .4rem; }
.ext-form { display: flex; align-items: center; gap: .3rem; flex-wrap: wrap; justify-content: flex-end; }
.ext-form .ext-sel, .ext-form .ext-date { padding: .3rem .45rem; font-size: .8rem; border: 1px solid var(--border); border-radius: 8px; background: var(--card); color: var(--text); max-width: 150px; }
.ext-form .icon-btn i { color: var(--gold); }
/* manual ID fallback (only for schools switched on by the super admin) */
.manual-box { margin: .8rem 0 .4rem; text-align: center; }
.manual-box .rf-h { text-align: right; direction: rtl; margin-top: .6rem; padding: .7rem .9rem; border: 1.5px solid #efe3b0; border-radius: 10px; background: #fffbea; line-height: 1.7; color: #4b5563; }
.manual-box .rf-h i { color: #b88a12; }
.link-btn { background: none; border: 0; padding: 0; margin-top: .3rem; display: block; color: #b88a12; font: inherit; font-weight: 700; text-decoration: underline; cursor: pointer; }
.tm-row .tm-man.on { border-color: #b88a12; color: #b88a12; }
.tm-row .tm-st.warn { color: #9a6b00; }
#nameInp:not([readonly]), #eidInp:not([readonly]), #dobInp:not([readonly]), #natInp:not([readonly]), .tm-row .tm-name:not([readonly]), .tm-row .tm-eid:not([readonly]) { background: #fff; color: #111827; border-color: #b88a12; }
#genderManual, .tm-gsel { padding: .8rem 1rem; border: 2px solid #b88a12; border-radius: 8px; background: #fff; font: inherit; width: 100%; }
.tm-gsel { padding: .65rem .8rem; font-size: .92rem; }
.tm-gsel[hidden], #genderManual[hidden] { display: none; }
/* e-mail sending page */
.mq-bar { height: 12px; border-radius: 99px; background: var(--border); overflow: hidden; margin-bottom: 1rem; }
.mq-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--gold), #16a34a); border-radius: 99px; transition: width .4s; }
.mq-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: .8rem; }
.mq-stats > div { padding: .8rem 1rem; border: 1px solid var(--border); border-radius: 12px; background: var(--row-alt); }
.mq-stats b { display: block; font-size: 1.6rem; font-weight: 800; line-height: 1.2; } .mq-stats b.ok { color: #16a34a; } .mq-stats b.bad { color: #dc2626; }
.mq-stats span { color: var(--muted); font-size: .8rem; }
.inline-check { display: inline-flex; align-items: center; gap: .35rem; margin-inline-start: .6rem; cursor: pointer; }
.pill-red { background: rgba(220,38,38,.12); color: #b91c1c; }
/* judge registration page */
.doc-row input[type=file] { width: 100%; padding: .7rem .9rem; border: 2px dashed #d9cfa5; border-radius: 10px; background: #fffdf5; font: inherit; font-size: .92rem; cursor: pointer; }
.doc-row input[type=file]:hover { border-color: #b88a12; }
.doc-row[hidden] { display: none; }
.pc-row { display: flex; gap: .7rem; flex-wrap: wrap; } .pc-row .pc-opt { flex: 1 1 200px; }
.field-cards input[type=checkbox] { position: absolute; opacity: 0; pointer-events: none; }
.fcard:has(input:checked) > span { border-color: #b88a12; box-shadow: 0 0 0 3px rgba(184,138,18,.18); background: #fffbea; }
/* STEM teams page */
.team-list { list-style: none; margin: .4rem 0 0; padding: 0; display: flex; flex-direction: column; gap: .25rem; }
.team-list li { font-size: .88rem; line-height: 1.5; }
