/* app.css — صفحات التطبيق (الدخول، الحساب، الحلول، اللوحة) على نظام هوية site.css نفسه. */
.top-actions { display: flex; gap: 8px; align-items: center; }
.show-sm { display: none; }
@media (max-width: 420px) { .hide-sm { display: none; } .show-sm { display: block; } }
.link { color: var(--brand); font-weight: 800; }
.link:hover { text-decoration: underline; }
.bio { color: var(--ink-2); font-size: 18px; margin: 0; }
.portrait img { width: 100%; height: 100%; object-fit: cover; }

.flash { margin: 16px 0 0; padding: 14px 18px; border-radius: 16px; font-weight: 800; }
.flash.ok { background: rgba(255,203,69,.12); color: #ffe7a3; border: 1px solid rgba(255,203,69,.4); }
.flash.err { background: rgba(255,90,110,.12); color: #ffc2ca; border: 1px solid rgba(255,90,110,.45); }

.page { padding: 34px 0 60px; }
.page-head { margin-bottom: 22px; }
.page-head h1 { margin: 0; font-size: clamp(28px, 5vw, 40px); font-weight: 900; line-height: 1.3; }
.page-head p { margin: 6px 0 0; color: var(--ink-2); }
.crumbs { display: flex; gap: 8px; color: var(--ink-3); font-size: 14.5px; font-weight: 700; margin-bottom: 10px; }
.crumbs a:hover { color: var(--ink); }

.panel { border-radius: var(--r-lg); background: var(--glass); border: 1px solid var(--line); padding: 24px; }
.panel + .panel { margin-top: 18px; }
.panel h2 { margin: 0 0 14px; font-size: 22px; font-weight: 900; }
.panel h2 small { font-size: 14px; color: var(--ink-3); font-weight: 700; margin-inline-start: 6px; }
.cols { display: grid; gap: 18px; grid-template-columns: minmax(0, 1fr); }
.cols > * { min-width: 0; }
@media (min-width: 900px) { .cols { grid-template-columns: 1fr 1fr; } .cols.c3 { grid-template-columns: repeat(3, 1fr); } }

/* النماذج */
.form { display: grid; gap: 16px; }
.field { display: grid; gap: 6px; }
.field > label, .field > .lbl { font-weight: 800; font-size: 15.5px; }
.field .hint { color: var(--ink-3); font-size: 13.5px; }
.field .error { color: #ff9aa8; font-size: 14px; font-weight: 700; }
.input, .select, .textarea { width: 100%; min-height: 50px; padding: 10px 16px; border-radius: 14px; border: 1.5px solid var(--line); background: rgba(3,7,22,.6);
  color: var(--ink); font: 600 16.5px var(--font); }
.textarea { min-height: 110px; resize: vertical; line-height: 1.7; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px rgba(255,203,69,.15); }
.input.ltr { direction: ltr; text-align: right; }
.input[type=file] { padding: 10px; min-height: 0; }
.check { display: flex; gap: 10px; align-items: center; font-weight: 700; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--brand); }
.choices { display: grid; gap: 10px; }
@media (min-width: 560px) { .choices.two { grid-template-columns: 1fr 1fr; } }
.choice { position: relative; display: block; cursor: pointer; }
.choice input { position: absolute; opacity: 0; }
.choice > span { display: block; padding: 14px 16px; border-radius: 16px; border: 1.5px solid var(--line); background: rgba(255,255,255,.03); transition: border-color .15s, background .15s; }
.choice > span b { display: block; font-size: 16.5px; }
.choice > span small { color: var(--ink-3); font-size: 14px; }
.choice input:checked + span { border-color: var(--brand); background: rgba(255,203,69,.08); box-shadow: 0 0 0 3px rgba(255,203,69,.12); }
.choice input:focus-visible + span { outline: 3px solid var(--brand); outline-offset: 2px; }
.form-foot { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; }
.auth-card { max-width: 480px; margin: 20px auto 0; }

/* الحالة والشارات */
.status { display: flex; gap: 16px; align-items: center; padding: 18px 20px; border-radius: 20px; }
.status.on { background: linear-gradient(135deg, rgba(255,203,69,.16), rgba(255,203,69,.04)); border: 1.5px solid rgba(255,203,69,.5); }
.status.off { background: rgba(255,255,255,.04); border: 1.5px dashed rgba(255,255,255,.2); }
.status .ic { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; background: rgba(255,203,69,.15); color: var(--brand); flex: none; }
.status .ic svg { width: 26px; height: 26px; }
.status b { display: block; font-size: 19px; }
.status small { color: var(--ink-2); font-size: 15px; }
.pill { display: inline-flex; padding: 3px 12px; border-radius: 999px; font-size: 13px; font-weight: 800; white-space: nowrap; }
.pill.pending { background: rgba(255,203,69,.14); color: var(--brand); }
.pill.approved, .pill.available { background: rgba(127,176,255,.14); color: #a9c6ff; }
.pill.rejected, .pill.revoked, .pill.expired { background: rgba(255,255,255,.08); color: var(--ink-3); }
.pill.redeemed { background: rgba(255,255,255,.06); color: var(--ink-2); }
.note-box { padding: 14px 16px; border-radius: 14px; background: rgba(255,255,255,.04); border: 1px solid var(--line); color: var(--ink-2); font-size: 15px; white-space: pre-line; }

/* الجداول */
.table-wrap { overflow-x: auto; border-radius: 18px; border: 1px solid var(--line); }
table.t { width: 100%; border-collapse: collapse; font-size: 15px; }
.t th, .t td { padding: 12px 14px; text-align: start; border-bottom: 1px solid var(--line); vertical-align: middle; }
.t th { font-size: 13.5px; color: var(--ink-3); font-weight: 800; background: rgba(255,255,255,.03); white-space: nowrap; }
.t tr:last-child td { border-bottom: 0; }
.t .num, .t .ltr { direction: ltr; unicode-bidi: isolate; text-align: right; white-space: nowrap; }
.t .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.empty { padding: 34px; text-align: center; color: var(--ink-3); font-weight: 700; }
.mono { font-family: ui-monospace, Consolas, monospace; direction: ltr; unicode-bidi: isolate; letter-spacing: .04em; }
.codes-out { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.codes-out code { padding: 12px 14px; border-radius: 12px; background: rgba(3,7,22,.7); border: 1px dashed rgba(255,203,69,.5); font-size: 18px; text-align: center; color: #ffe7a3; }
.pager { display: flex; gap: 8px; justify-content: center; margin-top: 18px; flex-wrap: wrap; }
.pager a, .pager span { padding: 8px 14px; border-radius: 10px; background: rgba(255,255,255,.05); font-weight: 800; }

/* اللوحة */
body.admin .top { background: rgba(5,11,31,.95); }
.admin-shell { display: grid; gap: 20px; padding: 26px 0 60px; }
@media (min-width: 980px) { .admin-shell { grid-template-columns: 230px 1fr; align-items: start; } }
.side { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; }
@media (min-width: 980px) { .side { flex-direction: column; position: sticky; top: 92px; } }
.side a { display: flex; align-items: center; gap: 10px; padding: 11px 16px; border-radius: 14px; font-weight: 800; color: var(--ink-2); white-space: nowrap; }
.side a:hover { background: rgba(255,255,255,.05); color: var(--ink); }
.side a.on { background: rgba(255,203,69,.12); color: var(--brand); }
.side a .count { margin-inline-start: auto; min-width: 24px; padding: 0 7px; border-radius: 99px; background: var(--brand); color: var(--brand-ink); font-size: 13px; text-align: center; }
.stats { display: grid; gap: 14px; grid-template-columns: repeat(2, 1fr); }
@media (min-width: 900px) { .stats { grid-template-columns: repeat(4, 1fr); } }
.stat { padding: 18px 20px; border-radius: 20px; background: var(--glass); border: 1px solid var(--line); }
.stat small { display: block; color: var(--ink-3); font-weight: 800; font-size: 14px; }
.stat b { display: block; font-size: 34px; font-weight: 900; line-height: 1.3; }
.stat.hot { border-color: rgba(255,203,69,.55); background: linear-gradient(160deg, rgba(255,203,69,.12), var(--glass)); }
.stat.hot b { color: var(--brand); }
.req-card { display: grid; gap: 12px; padding: 18px; border-radius: 20px; background: rgba(255,255,255,.035); border: 1px solid var(--line); }
.req-card + .req-card { margin-top: 12px; }
.req-top { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; justify-content: space-between; }
.req-top b { font-size: 17.5px; }
.req-meta { color: var(--ink-3); font-size: 14.5px; display: flex; flex-wrap: wrap; gap: 6px 14px; }
.req-acts { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.req-acts .input { min-height: 42px; flex: 1; min-width: 180px; }
.btn-danger { background: rgba(255,90,110,.14); color: #ffb3bd; box-shadow: inset 0 0 0 1.5px rgba(255,90,110,.45); }
.btn-danger:hover { background: rgba(255,90,110,.22); }

/* صفحة الحلّ */
.watch { display: grid; gap: 24px; align-items: start; }
@media (min-width: 980px) { .watch { grid-template-columns: minmax(300px, 420px) 1fr; } }
.player { position: relative; aspect-ratio: 9/16; max-height: 82vh; width: 100%; border-radius: 28px; overflow: hidden; background: #02040c; box-shadow: var(--shadow); border: 1px solid var(--line); }
.player video, .player img { width: 100%; height: 100%; object-fit: contain; display: block; }
.player .lock { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 14px; padding: 24px; text-align: center;
  background: linear-gradient(180deg, rgba(2,4,12,.35), rgba(2,4,12,.92)); }
.player .lock svg { width: 46px; height: 46px; color: var(--brand); }
.player .lock b { font-size: 20px; }
.lib-ch { margin-top: 26px; }
.lib-ch h2 { display: flex; align-items: center; gap: 10px; font-size: 20px; margin: 0 0 12px; }
.lib-ch h2 span { color: var(--ink-3); font-size: 14px; font-weight: 800; }
