/* الشكل المعتمد: كحلي رسمي */
:root {
  color-scheme: light;
  --bg: #f3f6fa; --card: #fff; --ink: #14233a; --soft: #5a6b82; --line: #dde5ee;
  --main: #143a6b; --bar: #1f78b4; --head-bg: #102d54; --onmain: #fff; --ok: #0b7352; --warn: #8a5a00; --bad: #b3262e;
  --okbg: #e0f3ec; --warnbg: #fcf0d6; --badbg: #fbe6e7; --r: 14px;
  --head: "Noto Kufi Arabic", sans-serif; --body: "IBM Plex Sans Arabic", sans-serif;
}
/* الوضع الغامق من نفس الكحلي */
:root[data-mode="dark"] {
  color-scheme: dark;
  --bg: #0d1726; --card: #15233a; --ink: #e8eef7; --soft: #a3b3c9; --line: #2a3b57;
  --main: #2a64ad; --bar: #55a8e0; --head-bg: #0a1f3d; --ok: #6fd6ae; --warn: #f0c469; --bad: #ff9a94;
  --okbg: #123a30; --warnbg: #3b2f14; --badbg: #432224;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 16px/1.65 var(--body); }
h1, h2, h3 { font-family: var(--head); margin: 0; line-height: 1.5; }
h1 { font-size: 24px; } h2 { font-size: 21px; } h3 { font-size: 17px; }
bdi { font-variant-numeric: tabular-nums; }
button, input, select, textarea { font: inherit; color: inherit; }
.wrap { max-width: 900px; margin: 0 auto; padding: 20px 16px 60px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row.sp { justify-content: space-between; }
.soft { color: var(--soft); font-size: 14px; }
.ok { color: var(--ok); } .bad { color: var(--bad); } .warn { color: var(--warn); }
header.top { background: var(--head-bg); color: #fff; border-bottom: 3px solid var(--bar); position: sticky; top: 0; z-index: 4; }
header.top > div { max-width: 900px; margin: 0 auto; padding: 10px 16px; }
header.top h1 { font-size: 20px; }
header.top .btn { background: none; color: #fff; border-color: rgb(255 255 255 / .4); }
.btn { border: 1px solid var(--line); background: var(--card); border-radius: calc(var(--r) * .6 + 2px); padding: 8px 14px; min-height: 42px; cursor: pointer; }
.btn:hover { border-color: var(--main); }
.btn.main { background: var(--main); color: var(--onmain); border-color: var(--main); }
.btn.sm { padding: 3px 11px; min-height: 36px; font-size: 14px; }
.btn.del { color: var(--bad); }
:focus-visible { outline: 3px solid var(--main); outline-offset: 2px; }
.tabs { display: flex; gap: 6px; overflow-x: auto; margin-bottom: 16px; }
.tabs .btn[aria-current="true"] { background: var(--main); color: var(--onmain); border-color: var(--main); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; margin-bottom: 14px; }
.sums { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 14px 0; }
.sum { border: 1px solid var(--line); border-radius: calc(var(--r) * .7); padding: 10px 14px; }
.sum > span { display: block; color: var(--soft); font-size: 14px; }
.sum b { font-size: 21px; font-weight: 600; white-space: nowrap; }
.sum.big { border-color: var(--main); }
.bar { height: 8px; background: var(--line); border-radius: 9px; overflow: hidden; margin: 8px 0 4px; }
.bar i { display: block; height: 100%; background: var(--bar); }
.item { border-top: 1px solid var(--line); padding: 12px 0; }
.item:last-child { padding-bottom: 0; }
.tag { border-radius: 99px; padding: 1px 12px; font-size: 14px; font-weight: 500; white-space: nowrap; }
.tag.active { background: var(--okbg); color: var(--ok); }
.tag.stopped { background: var(--warnbg); color: var(--warn); }
.tag.done { background: var(--line); color: var(--ink); }
.left { font-weight: 600; }
.pays { margin: 6px 0 0; padding: 0; list-style: none; font-size: 15px; }
.pays li { display: flex; justify-content: space-between; gap: 8px; align-items: center; padding: 2px 0; }
section { margin-top: 18px; }
section > .row { margin-bottom: 8px; }
.empty { color: var(--soft); padding: 10px 0; }
.alert { background: var(--badbg); color: var(--bad); border-radius: calc(var(--r) * .7); padding: 9px 14px; margin-bottom: 10px; }
.alert.w { background: var(--warnbg); color: var(--warn); }

/* الباقي للترويج هو الرقم الأبرز */
.sum { background: var(--bg); border-color: transparent; }
.sum.big { background: var(--main); }
.sum.big > span, .sum.big b, .sum.big b span { color: var(--onmain) !important; }
.sum.big b { font-size: 26px; }
.card { box-shadow: 0 1px 2px rgb(16 32 56 / .05); }

.login { border-top: 4px solid var(--main); max-width: 400px; margin: 9vh auto 0; }
label { display: block; margin-top: 11px; font-size: 15px; }
label.ck { display: flex; gap: 9px; align-items: center; }
input:not([type=checkbox]), select, textarea { display: block; width: 100%; margin-top: 3px; padding: 9px 12px; min-height: 44px; border: 1px solid var(--line); border-radius: calc(var(--r) * .5 + 2px); background: var(--bg); color: var(--ink); }
input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--main); }
input[type=email], input[type=password], input[type=tel] { direction: ltr; text-align: right; }
dialog { border: 1px solid var(--line); border-radius: var(--r); background: var(--card); color: var(--ink); width: min(440px, calc(100vw - 24px)); padding: 20px; }
dialog::backdrop { background: rgb(0 0 0 / .55); }
dialog .row { margin-top: 18px; }
.err { color: var(--bad); margin-top: 8px; min-height: 1.6em; }
.hint { background: var(--bg); border-radius: 8px; padding: 8px 12px; margin-top: 12px; }
#toast { position: fixed; bottom: 24px; inset-inline: 16px; margin: auto; width: fit-content; max-width: calc(100% - 32px); background: var(--ink); color: var(--bg); border-radius: 10px; padding: 9px 18px; opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 5; }
#toast.on { opacity: 1; }
@media (max-width: 480px) { .sums { grid-template-columns: 1fr 1fr; } .sum { padding: 9px 10px; } .sum b { font-size: 18px; } .sum.big { grid-column: 1 / -1; } .sum:last-child:nth-child(6) { grid-column: 1 / -1; } .sum.big b { font-size: 28px; } .card { padding: 14px; } }
@media print { .btn, .tabs, #toast { display: none !important; } body { background: #fff; print-color-adjust: exact; -webkit-print-color-adjust: exact; } header.top { position: static; } .card { break-inside: avoid; } }
fieldset { border: 1px solid var(--line); border-radius: 8px; margin: 12px 0 0; padding: 2px 12px 10px; }
[hidden] { display: none !important; }
@media print { :root[data-mode="dark"] { color-scheme: light; --bg: #f3f6fa; --card: #fff; --ink: #14233a; --soft: #5a6b82; --line: #dde5ee; --main: #143a6b; --bar: #1f78b4; --head-bg: #102d54; --ok: #0b7352; --warn: #8a5a00; --bad: #b3262e; --okbg: #e0f3ec; --warnbg: #fcf0d6; --badbg: #fbe6e7; } }
.owner { text-align: center; border-top: 1px solid var(--line); margin: 28px auto 0; padding-top: 16px; max-width: 400px; }
.owner > span, .owner > b { display: block; }
.owner > .row { display: flex; justify-content: center; margin-top: 8px; }
.owner a { text-decoration: none; color: inherit; display: inline-flex; align-items: center; }
@media print { .owner .btn { display: inline-flex !important; border: 0; } .owner a[target] { display: none !important; } }
.name { display: flex; gap: 12px; align-items: center; }
.logo { width: 56px; height: 56px; object-fit: contain; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 4px; flex: none; }
.kind { margin: 20px 0 10px; padding-inline-start: 10px; border-inline-start: 4px solid var(--bar); }
.mine { display: flex; flex-wrap: wrap; gap: 4px 18px; align-items: center; border: 1px dashed var(--line); border-radius: 10px; padding: 7px 14px; margin: 8px 0; }
@media print { .mine { display: none; } }

/* ———— اللمسة الفخمة والحركة ———— */
:root { --gold: #d9b36a; }
header.top { background: linear-gradient(100deg, #0a1f3d, #163f78 55%, #0d2a52); border-bottom: 0; }
header.top::after { content: ""; position: absolute; inset: auto 0 0; height: 2px; background: linear-gradient(90deg, transparent, var(--gold), transparent); background-size: 50% 100%; background-repeat: no-repeat; animation: slide 6s linear infinite; }
header.top h1 { display: flex; gap: 10px; align-items: center; }
header.top h1 img, .mark, .inst img { border-radius: 24%; }
.sum.big { position: relative; overflow: hidden; background: linear-gradient(125deg, #0d2a52, #1d559c); box-shadow: inset 0 -3px 0 var(--gold); }
.sum.big::after { content: ""; position: absolute; inset: 0; background: linear-gradient(105deg, transparent 40%, rgb(255 255 255 / .16) 50%, transparent 60%); transform: translateX(120%); animation: shine 5s ease-in-out infinite; pointer-events: none; }
.btn { transition: transform .15s, border-color .15s, box-shadow .15s; }
.btn:active { transform: scale(.97); }
.tag.active::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: currentColor; margin-inline-end: 6px; animation: pulse 1.6s ease-in-out infinite; }
.enter .card, .enter .hero { animation: rise .55s cubic-bezier(.2, .8, .2, 1) backwards; }
.enter .card:nth-of-type(2) { animation-delay: .08s; } .enter .card:nth-of-type(3) { animation-delay: .16s; }
.enter .bar i { animation: grow 1s cubic-bezier(.2, .8, .2, 1) backwards; transform-origin: right; }
body[data-page="login"] { background: radial-gradient(90% 60% at 85% 0%, #24599f 0, transparent 70%), radial-gradient(70% 50% at 0% 100%, #17406f 0, transparent 70%), #0a1c38; background-size: 140% 140%; animation: drift 18s ease-in-out infinite alternate; min-height: 100vh; }
[data-page="login"] .login { margin-top: 18px; margin-bottom: 0; border: 0; border-top: 3px solid var(--gold); box-shadow: 0 18px 50px rgb(0 0 0 / .35); }
.hero { text-align: center; color: #fff; padding-top: 4vh; }
.hero h1 { font-size: 32px; margin-top: 10px; }
.hero p { margin: 0; color: #d5e0f0; }
.mark { box-shadow: 0 10px 30px rgb(0 0 0 / .4), 0 0 0 2px rgb(217 179 106 / .55); animation: float 5s ease-in-out infinite; }
.line { width: min(400px, 100%); height: 64px; margin-top: 8px; fill: none; stroke: var(--gold); stroke-width: 2.5; stroke-linecap: round; overflow: visible; }
.line path { stroke-dasharray: 1; animation: draw 2.2s .3s ease-out backwards; }
.line circle { fill: var(--gold); stroke: none; transform-origin: 395px 8px; animation: pulse 1.8s ease-in-out infinite; }
[data-page="login"] .owner { color: #fff; border-color: rgb(255 255 255 / .2); }
[data-page="login"] .owner .soft { color: #d5e0f0; }
[data-page="login"] .owner .btn { background: rgb(255 255 255 / .1); border-color: rgb(255 255 255 / .3); }
.inst { display: flex; gap: 14px; align-items: center; }
.steps { list-style: none; counter-reset: s; padding: 0; margin: 14px 0 0; }
.steps li { counter-increment: s; display: flex; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); animation: rise .4s calc(var(--i) * 90ms) backwards; }
.steps li::before { content: counter(s); flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--main); color: var(--onmain); display: grid; place-items: center; font-weight: 600; }
.steps svg { vertical-align: -4px; }
@keyframes slide { from { background-position: -100% 0; } to { background-position: 200% 0; } }
@keyframes shine { 0%, 60% { transform: translateX(120%); } 100% { transform: translateX(-120%); } }
@keyframes pulse { 50% { opacity: .35; } }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } }
@keyframes grow { from { transform: scaleX(0); } }
@keyframes drift { to { background-position: 60% 40%; } }
@keyframes float { 50% { transform: translateY(-6px); } }
@keyframes draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@media (max-width: 480px) { header.top h1 { font-size: 17px; } header.top .btn { padding: 3px 9px; } header.top .row { gap: 5px; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
