/* MIHWAR design tokens. Variable names are kept from the first version so every page keeps working. */
:root {
  color-scheme: dark;
  --navy: #0B1220; --blue: #2F7BFF; --blue-2: #60A5FF; --paper: #F4F6FA;
  --bg: #0B1220; --surface: #101A2E; --surface-2: #15223B; --ink: #F4F6FA; --muted: #9AA8C2; --line: #1F2D4A; --line-2: #2A3B5E;
  --espresso: #080E1A; --espresso-2: #121D33; --espresso-line: #1B2742;
  --ember: #2F7BFF; --ember-d: #60A5FF; --ember-soft: #13264A; --crema: #60A5FF; --crema-soft: #132A4D;
  --peach: #A9CBFF; --slate: #7F8FAD;
  --ok: #34D399; --ok-soft: #0E2B2A; --warn: #FBBF24; --warn-soft: #2E2612; --bad: #F87171; --bad-soft: #351A22; --info: #60A5FF; --info-soft: #12284A;
  --grad: linear-gradient(135deg, #2F7BFF, #1F5FE0);
  --glow: 0 8px 24px rgba(47,123,255,.28);
  --r: 16px; --r-sm: 12px; --shadow: 0 1px 0 rgba(255,255,255,.03) inset, 0 10px 30px rgba(2,6,16,.35);
  --font: "Tajawal", system-ui, -apple-system, "Segoe UI", sans-serif;
  --display: "Tajawal", var(--font);
  --side: 272px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 16px; line-height: 1.7; -webkit-tap-highlight-color: transparent;
  background-image: radial-gradient(900px 500px at 100% -10%, rgba(47,123,255,.10), transparent 60%), radial-gradient(700px 420px at 0% 110%, rgba(96,165,255,.06), transparent 60%); background-attachment: fixed; }
h1, h2, h3 { font-family: var(--display); font-weight: 700; line-height: 1.4; margin: 0; letter-spacing: 0; }
h1 { font-size: 28px; } h2 { font-size: 20px; } h3 { font-size: 17px; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--ember-d); text-decoration: none; }
.num, input[type=number], input[type=date], input[type=time], .ltr { direction: ltr; unicode-bidi: plaintext; }
td.num, .num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.logo-mark { display: inline-block; flex: none; } .logo-mark svg { width: 100%; height: 100%; display: block; } .small { font-size: 14px; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--blue) 70%, white); outline-offset: 2px; }
::selection { background: rgba(47,123,255,.45); color: #fff; }
* { scrollbar-color: var(--line-2) transparent; scrollbar-width: thin; }

/* shell */
.app { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); min-height: 100vh; min-height: 100dvh; }
.side { background: linear-gradient(180deg, #0A1224, var(--espresso)); color: #D6E0F2; position: sticky; top: 0; height: 100vh; height: 100dvh; display: flex; flex-direction: column; padding: 20px 14px 14px; overflow-y: auto; z-index: 30; border-inline-end: 1px solid var(--espresso-line); }
.brand { display: flex; flex-direction: column; gap: 10px; padding: 4px 8px 18px; border-bottom: 1px solid var(--espresso-line); margin-bottom: 8px; }
.brand-sub { display: inline-flex; align-items: center; gap: 8px; align-self: flex-start; font-size: 13px; color: #B9C8E4; background: var(--espresso-2); border: 1px solid var(--espresso-line); padding: 3px 10px; border-radius: 999px; }
.brand-sub i { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px rgba(52,211,153,.18); }
.nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav-group { font-size: 12.5px; font-weight: 700; color: #6F80A3; padding: 16px 12px 6px; letter-spacing: .02em; }
.nav a { position: relative; display: flex; align-items: center; gap: 12px; min-height: 46px; padding: 0 12px; border-radius: 12px; color: #C3CFE6; font-weight: 500; transition: background .18s, color .18s; }
.nav a svg { color: #7F95BD; transition: color .18s; }
.nav a:hover { background: var(--espresso-2); color: #fff; } .nav a:hover svg { color: var(--blue-2); }
.nav a.active { background: linear-gradient(90deg, rgba(47,123,255,.22), rgba(47,123,255,.06)); color: #fff; font-weight: 700; box-shadow: inset 0 0 0 1px rgba(96,165,255,.22); }
.nav a.active svg { color: var(--blue-2); }
.nav a.active::before { content: ""; position: absolute; inset-inline-start: -14px; top: 10px; bottom: 10px; width: 4px; border-radius: 4px; background: var(--blue); box-shadow: 0 0 12px var(--blue); }
.nav svg { flex: none; }
.side-foot { border-top: 1px solid var(--espresso-line); padding-top: 12px; margin-top: 12px; display: flex; align-items: center; gap: 10px; }
.avatar { width: 40px; height: 40px; border-radius: 12px; background: var(--grad); color: #fff; display: grid; place-items: center; font-weight: 800; flex: none; box-shadow: var(--glow); }
.who { flex: 1; min-width: 0; line-height: 1.3; } .who b { display: block; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #fff; } .who span { font-size: 13px; color: #9AA8C2; }
.side-btn { background: var(--espresso-2); border-color: var(--espresso-line); color: #D6E0F2; }
.side-btn:hover { background: #1A2846; }
.main { min-width: 0; }
.view > * { min-width: 0; max-width: 100%; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 14px; padding: 14px 28px; background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.topbar h1 { flex: 1; font-size: 22px; font-weight: 800; }
.menu-btn { display: none; }
.top-mark { display: none; flex: none; padding: 5px; border-radius: 10px; background: rgba(47,123,255,.1); border: 1px solid rgba(96,165,255,.25); }
.view { padding: 24px 28px 56px; max-width: 1360px; margin: 0 auto; display: flex; flex-direction: column; gap: 20px; }
.scrim { display: none; }

@media (max-width: 1100px) {
  .app { grid-template-columns: 1fr; }
  .side { position: fixed; inset-block: 0; inset-inline-start: 0; width: 290px; transform: translateX(100%); visibility: hidden; transition: transform .25s ease, visibility .25s; }
  .nav-open .side { transform: none; visibility: visible; box-shadow: -10px 0 40px rgba(0,0,0,.5); }
  .nav-open .scrim { display: block; position: fixed; inset: 0; background: rgba(3,7,16,.65); z-index: 25; }
  .menu-btn { display: inline-flex; color: var(--ink); }
  .top-mark { display: inline-flex; }
  .topbar { padding: 12px 18px; } .view { padding: 18px 18px 48px; }
}
@media (max-width: 640px) { h1 { font-size: 23px; } .topbar h1 { font-size: 18px; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .topbar { gap: 10px; } .view { padding: 14px 12px 40px; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

.lang-float { position: absolute; inset-block-start: 18px; inset-inline-start: 18px; z-index: 5; }
.lang-btn { gap: 8px; }
[dir=ltr] body { font-family: var(--font); }
@media (max-width: 1100px) { [dir=ltr] .side { transform: translateX(-100%); } [dir=ltr] .nav-open .side { transform: none; box-shadow: 10px 0 40px rgba(0,0,0,.5); } }

/* wordmark */
.wordmark { display: flex; align-items: center; gap: 12px; }
.wm-text { display: flex; flex-direction: column; line-height: 1.1; }
.wm-ar { font-weight: 800; font-size: 26px; }
.wm-en { font-weight: 700; font-size: 12.5px; letter-spacing: .32em; color: var(--blue-2); direction: ltr; text-align: start; }
.wordmark.light { color: #fff; } .wordmark.dark { color: var(--ink); }
.wordmark.big { gap: 18px; } .wordmark.big .wm-ar { font-size: 52px; } .wordmark.big .wm-en { font-size: 17px; }
[lang=en] .wm-en { font-size: 22px; letter-spacing: .14em; color: #fff; } [lang=en] .wordmark.big .wm-en { font-size: 40px; }
