:root {
  --bg: #f5f7fb; --surface: #ffffff; --surface-2: #eef2f8; --text: #0f1b2d; --muted: #5d6b82; --line: #dfe5ee;
  --brand: #1849a9; --brand-2: #0e7c86; --brand-ink: #ffffff; --accent: #f59e0b;
  --ok: #0f7b4f; --bad: #c4320a; --otp-bg: #e8efff;
  --radius: 14px; --shadow: 0 1px 2px rgba(15,27,45,.06), 0 8px 24px rgba(15,27,45,.06);
  --font: "Inter", "IBM Plex Sans Arabic", system-ui, "Segoe UI", Tahoma, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1220; --surface: #121b2d; --surface-2: #18233a; --text: #e8edf6; --muted: #9aa8bf; --line: #24324c;
    --brand: #5b8cff; --brand-2: #2bb3bd; --otp-bg: #1d2b4a; --shadow: none;
  }
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font-family: var(--font); background: var(--bg); color: var(--text); line-height: 1.6; }
a { color: var(--brand); text-decoration: none; }
img { max-width: 100%; display: block; }
.container { max-width: 1180px; margin: 0 auto; padding: 0 16px; }

/* ---------- top bar ---------- */
.topbar { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.topbar .container { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; flex-wrap: wrap; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 20px; color: var(--text); letter-spacing: -.02em; }
.logo-mark { width: 34px; height: 34px; border-radius: 10px; background: linear-gradient(135deg, var(--brand), var(--brand-2)); display: grid; place-items: center; color: #fff; font-size: 16px; }
.nav { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.nav a.link { color: var(--muted); padding: 6px 10px; border-radius: 8px; font-size: 15px; }
.nav a.link:hover { color: var(--text); background: var(--surface-2); }

/* ---------- buttons & inputs ---------- */
.btn, button { font: inherit; display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 16px; border-radius: 10px; border: 1px solid var(--brand); background: var(--brand); color: var(--brand-ink); cursor: pointer; font-weight: 600; font-size: 14px; white-space: nowrap; }
.btn.ghost, button.ghost { background: transparent; color: var(--text); border-color: var(--line); }
.btn.light { background: #fff; color: var(--brand); border-color: #fff; }
button.danger { background: transparent; color: var(--bad); border-color: var(--line); }
button:disabled { opacity: .5; cursor: default; }
.btn.lg { padding: 12px 22px; font-size: 16px; }
input, select, textarea { font: inherit; padding: 9px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--text); min-width: 0; }
input:focus, select:focus { outline: 2px solid color-mix(in srgb, var(--brand) 35%, transparent); border-color: var(--brand); }
label { display: grid; gap: 4px; font-size: 13px; color: var(--muted); }

/* ---------- landing ---------- */
.hero { background: radial-gradient(1200px 500px at 85% -10%, color-mix(in srgb, var(--brand-2) 30%, transparent), transparent), linear-gradient(135deg, #0f2a66, #1849a9 55%, #0e7c86); color: #fff; padding: 72px 0 84px; }
.hero .container { display: grid; grid-template-columns: 1.2fr 1fr; gap: 40px; align-items: center; }
.hero h1 { font-size: clamp(30px, 4.6vw, 52px); line-height: 1.15; margin: 0 0 16px; letter-spacing: -.02em; }
.hero p.lead { font-size: 18px; opacity: .9; margin: 0 0 28px; max-width: 560px; }
.hero .cta { display: flex; gap: 12px; flex-wrap: wrap; }
.hero .badge-row { display: flex; gap: 18px; margin-top: 28px; flex-wrap: wrap; opacity: .9; font-size: 14px; }
.mock { background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.18); border-radius: 18px; padding: 18px; backdrop-filter: blur(4px); }
.mock .row-mail { background: rgba(255,255,255,.95); color: #0f1b2d; border-radius: 12px; padding: 12px 14px; margin-bottom: 10px; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.mock .row-mail small { color: #5d6b82; display: block; }
.mock .code { font-family: ui-monospace, Consolas, monospace; font-weight: 800; background: #e8efff; color: #1849a9; padding: 4px 10px; border-radius: 8px; direction: ltr; }
section.block { padding: 72px 0; }
section.block.alt { background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-head { max-width: 720px; margin: 0 auto 36px; text-align: center; }
.section-head h2 { font-size: clamp(24px, 3vw, 34px); margin: 0 0 8px; letter-spacing: -.01em; }
.section-head p { color: var(--muted); margin: 0; }
.eyebrow { color: var(--brand-2); font-weight: 700; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; }
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; }
.feature { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.feature .ico { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--otp-bg); color: var(--brand); font-size: 20px; margin-bottom: 12px; }
.feature h3 { margin: 0 0 6px; font-size: 17px; }
.feature p { margin: 0; color: var(--muted); font-size: 15px; }
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px; counter-reset: s; }
.step { padding: 20px; border-radius: var(--radius); background: var(--bg); border: 1px dashed var(--line); }
.step::before { counter-increment: s; content: counter(s); display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--brand); color: #fff; font-weight: 800; margin-bottom: 10px; }
.step h3 { margin: 0 0 4px; font-size: 16px; }
.step p { margin: 0; color: var(--muted); font-size: 14px; }
.pricing { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px; }
.price-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; display: flex; flex-direction: column; gap: 10px; box-shadow: var(--shadow); }
.price-card.featured { border-color: var(--brand); outline: 2px solid color-mix(in srgb, var(--brand) 25%, transparent); }
.price-card h3 { margin: 0; font-size: 18px; }
.price-card .price { font-size: 34px; font-weight: 800; letter-spacing: -.02em; }
.price-card .price small { font-size: 14px; color: var(--muted); font-weight: 500; }
.price-card ul { padding: 0; margin: 6px 0 12px; list-style: none; color: var(--muted); font-size: 14px; display: grid; gap: 6px; }
.price-card ul li::before { content: "✓ "; color: var(--ok); font-weight: 700; }
.price-card .btn { margin-top: auto; }

/* ---------- news ---------- */
.news-tabs { display: flex; gap: 8px; justify-content: center; margin-bottom: 22px; }
.news-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 18px; }
.news-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; color: var(--text); box-shadow: var(--shadow); transition: transform .15s; }
.news-card:hover { transform: translateY(-2px); }
.news-card .thumb { aspect-ratio: 16 / 9; background: var(--surface-2) center / cover no-repeat; }
.news-card .body { padding: 14px 16px 16px; display: grid; gap: 6px; }
.news-card h3 { font-size: 16px; margin: 0; line-height: 1.4; }
.news-card p { margin: 0; color: var(--muted); font-size: 14px; }
.news-card .meta { font-size: 12px; color: var(--muted); display: flex; justify-content: space-between; gap: 8px; }
.news-card .meta b { color: var(--brand-2); font-weight: 700; }
.news-card.lead-story { grid-column: span 2; }
@media (max-width: 640px) { .news-card.lead-story { grid-column: auto; } }
.news-ticker { background: var(--surface); border-bottom: 1px solid var(--line); font-size: 14px; overflow: hidden; white-space: nowrap; }
.news-ticker .container { display: flex; gap: 12px; align-items: center; min-height: 40px; }
.news-ticker .label { background: var(--bad); color: #fff; font-weight: 700; font-size: 12px; padding: 2px 10px; border-radius: 6px; flex: none; }
.news-ticker .track { overflow: hidden; flex: 1; }
.news-ticker .track a { color: var(--text); }
.skeleton { background: linear-gradient(90deg, var(--surface-2), var(--surface), var(--surface-2)); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: var(--radius); min-height: 220px; }
@keyframes sk { to { background-position: -200% 0; } }

.cta-band { background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; border-radius: 20px; padding: 40px; display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap; }
.cta-band h2 { margin: 0 0 6px; }
.cta-band p { margin: 0; opacity: .9; }
footer.site { padding: 40px 0; color: var(--muted); font-size: 14px; border-top: 1px solid var(--line); background: var(--surface); }
footer.site .container { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
@media (max-width: 860px) { .hero .container { grid-template-columns: 1fr; } .mock { display: none; } }

/* ---------- auth ---------- */
.auth-wrap { min-height: calc(100vh - 64px); display: grid; place-items: center; padding: 40px 16px; }
.auth-card { width: 100%; max-width: 420px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 28px; box-shadow: var(--shadow); }
.auth-card h1 { font-size: 22px; margin: 0 0 4px; }
.auth-card form { display: grid; gap: 12px; margin-top: 18px; }
.roles-hint { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 18px; }
.roles-hint div { background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; font-size: 12px; color: var(--muted); }
.roles-hint b { display: block; color: var(--text); font-size: 13px; }

/* ---------- dashboard ---------- */
.app-shell { display: grid; grid-template-columns: 230px 1fr; min-height: calc(100vh - 64px); }
.sidebar { background: var(--surface); border-inline-end: 1px solid var(--line); padding: 18px 12px; display: flex; flex-direction: column; gap: 4px; }
.sidebar button { justify-content: flex-start; background: transparent; color: var(--muted); border-color: transparent; font-weight: 600; }
.sidebar button.active { background: var(--otp-bg); color: var(--brand); }
.sidebar .who { padding: 10px; margin-top: auto; font-size: 13px; color: var(--muted); border-top: 1px solid var(--line); }
.content { padding: 22px; min-width: 0; }
@media (max-width: 860px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { flex-direction: row; flex-wrap: wrap; border-inline-end: 0; border-bottom: 1px solid var(--line); }
  .sidebar .who { display: none; }
}
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 16px; box-shadow: var(--shadow); }
.card h2 { font-size: 16px; margin: 0 0 12px; }
.muted { color: var(--muted); font-size: 13px; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.between { justify-content: space-between; }
.grid2 { display: grid; grid-template-columns: 320px 1fr; gap: 16px; }
@media (max-width: 1000px) { .grid2 { grid-template-columns: 1fr; } }
.list { list-style: none; margin: 0; padding: 0; }
.list li { padding: 10px; border-radius: 10px; cursor: pointer; border: 1px solid transparent; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.list li:hover { background: var(--bg); }
.list li.active { border-color: var(--brand); background: var(--otp-bg); }
.addr { font-family: ui-monospace, Consolas, monospace; font-size: 13px; direction: ltr; unicode-bidi: isolate; word-break: break-all; }
.badge { font-size: 12px; padding: 2px 8px; border-radius: 99px; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.badge.ok { color: var(--ok); } .badge.bad { color: var(--bad); } .badge.role { color: var(--brand); }
.otp { display: inline-flex; gap: 8px; align-items: center; background: var(--otp-bg); padding: 6px 12px; border-radius: 8px; font-family: ui-monospace, Consolas, monospace; font-size: 18px; font-weight: 700; direction: ltr; cursor: pointer; }
iframe.body { width: 100%; min-height: 420px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
pre.body { white-space: pre-wrap; background: var(--bg); padding: 12px; border-radius: 10px; max-height: 500px; overflow: auto; font-size: 13px; }
pre.code { direction: ltr; text-align: left; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.stat b { display: block; font-size: 26px; }
.meter { height: 8px; background: var(--surface-2); border-radius: 99px; overflow: hidden; margin-top: 8px; }
.meter span { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), var(--brand-2)); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: start; padding: 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--muted); font-weight: 600; font-size: 13px; }
.table-wrap { overflow-x: auto; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; align-items: end; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 10px; display: none; z-index: 50; }
.hidden { display: none !important; }
code.inline { direction: ltr; display: inline-block; background: var(--bg); padding: 2px 6px; border-radius: 6px; font-size: 12px; word-break: break-all; }
