/* =========================================================================
   SatrixTool — Design System
   الألوان مأخوذة حرفياً من qml/Satrix/Theme/Theme.qml
   ========================================================================= */

@font-face {
    font-family: 'Satrix UI';
    src: url('../fonts/Exo2.ttf') format('truetype');
    font-weight: 400 600;
    font-display: swap;
}
@font-face {
    font-family: 'Satrix UI';
    src: url('../fonts/Exo2-Bold.ttf') format('truetype');
    font-weight: 700 900;
    font-display: swap;
}
@font-face {
    font-family: 'Satrix Display';
    src: url('../fonts/Orbitron.ttf') format('truetype');
    font-weight: 400 900;
    font-display: swap;
}

:root {
    /* --- dark (default) : نفس تدرّج الأداة --- */
    --bg:            #080D18;
    --surface:       #111A2B;
    --surface-alt:   #18243A;
    --surface-high:  #1E2C46;
    --surface-edge:  #2B3D5C;

    --primary:       #5C97FF;
    --primary-hover: #7AABFF;
    --primary-deep:  #2854B8;
    --accent:        #2FDA8F;
    --danger:        #FF6B76;
    --warning:       #FFC24F;

    --text:          #E8EFFB;
    --text-soft:     #8C9CB8;
    --text-new:      #63D6E8;

    --border:        #21304A;
    --border-strong: #33466A;

    --radius-s: 6px;
    --radius-m: 10px;
    --radius-l: 16px;
    --radius-xl: 22px;

    --shadow-1: 0 2px 8px rgba(0, 0, 0, .35);
    --shadow-2: 0 12px 32px rgba(0, 0, 0, .42);
    --shadow-glow: 0 0 0 1px rgba(92, 151, 255, .28), 0 18px 50px -18px rgba(92, 151, 255, .55);

    --header-h: 62px;
    --sidebar-w: 248px;

    --ease: cubic-bezier(.22, .61, .36, 1);
    --fast: 140ms;
    --normal: 240ms;
    --slow: 420ms;

    color-scheme: dark;
}

[data-theme="light"] {
    --bg:            #F4F7FB;
    --surface:       #FFFFFF;
    --surface-alt:   #EEF3FA;
    --surface-high:  #E4ECF7;
    --surface-edge:  #FFFFFF;

    --primary:       #3B73E8;
    --primary-hover: #2859C7;
    --primary-deep:  #2854B8;
    --accent:        #159A68;
    --danger:        #D94755;
    --warning:       #C9820B;

    --text:          #162238;
    --text-soft:     #63738B;
    --text-new:      #0D5C75;

    --border:        #DCE5F0;
    --border-strong: #C3D2E4;

    --shadow-1: 0 2px 8px rgba(20, 35, 60, .08);
    --shadow-2: 0 14px 36px rgba(20, 35, 60, .12);

    color-scheme: light;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    min-height: 100vh;
    font-family: 'Satrix UI', 'Segoe UI', system-ui, sans-serif;
    font-size: 14.5px;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

h1, h2, h3, h4 {
    margin: 0 0 .4em;
    font-weight: 700;
    letter-spacing: -.015em;
    line-height: 1.25;
}
h1 { font-size: 1.9rem; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.08rem; }
p  { margin: 0 0 1em; color: var(--text-soft); }

a {
    color: var(--primary);
    text-decoration: none;
    transition: color var(--fast) var(--ease);
}
a:hover { color: var(--primary-hover); }

img { max-width: 100%; height: auto; }

::selection { background: rgba(92, 151, 255, .35); color: #fff; }

:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
    border-radius: 4px;
}

/* ---------- ambient background (مكافئ AmbientBackground.qml) ---------- */
.ambient {
    position: fixed;
    inset: 0;
    z-index: -2;
    overflow: hidden;
    background: var(--bg);
    pointer-events: none;
}
.ambient__blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(70px);
    opacity: .55;
    will-change: transform;
}
.ambient__blob--a {
    width: 560px; height: 560px;
    left: -6%; top: -12%;
    background: radial-gradient(circle, rgba(92,151,255,.55), transparent 68%);
    animation: drift-a 26s var(--ease) infinite alternate;
}
.ambient__blob--b {
    width: 460px; height: 460px;
    right: -8%; bottom: -14%;
    background: radial-gradient(circle, rgba(99,214,232,.4), transparent 70%);
    animation: drift-b 32s var(--ease) infinite alternate;
}
.ambient__blob--c {
    width: 320px; height: 320px;
    right: 18%; top: 4%;
    background: radial-gradient(circle, rgba(47,218,143,.28), transparent 70%);
    animation: drift-c 38s var(--ease) infinite alternate;
}
.ambient__grid {
    position: absolute;
    inset: -40%;
    background-image:
        linear-gradient(to right, rgba(120, 160, 220, .07) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(120, 160, 220, .07) 1px, transparent 1px);
    background-size: 64px 64px;
    transform: perspective(700px) rotateX(58deg);
    mask-image: radial-gradient(ellipse at 50% 0%, #000 10%, transparent 72%);
    -webkit-mask-image: radial-gradient(ellipse at 50% 0%, #000 10%, transparent 72%);
    opacity: .5;
}
.ambient__vignette {
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 50% 40%, transparent 35%, var(--bg) 135%);
}

@keyframes drift-a {
    0%   { transform: translate3d(0, 0, 0) scale(1); }
    100% { transform: translate3d(70px, 50px, 0) scale(1.12); }
}
@keyframes drift-b {
    0%   { transform: translate3d(0, 0, 0) scale(1.06); }
    100% { transform: translate3d(-60px, -46px, 0) scale(.94); }
}
@keyframes drift-c {
    0%   { transform: translate3d(0, 0, 0) scale(.96); }
    100% { transform: translate3d(48px, 60px, 0) scale(1.1); }
}

/* ---------- layout ---------- */
.shell { min-height: 100vh; display: flex; flex-direction: column; }

.container {
    width: min(1280px, 100% - 40px);
    margin-inline: auto;
}

.dash {
    display: grid;
    grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
    min-height: 100vh;
}

/* ---------- top bar (public) ---------- */
.topbar {
    position: sticky;
    top: 0;
    z-index: 40;
    height: var(--header-h);
    display: flex;
    align-items: center;
    background: color-mix(in srgb, var(--bg) 78%, transparent);
    backdrop-filter: blur(14px) saturate(140%);
    border-bottom: 1px solid var(--border);
}
.topbar .container {
    display: flex;
    align-items: center;
    gap: 18px;
    width: min(1280px, 100% - 40px);
}
.topbar__nav {
    display: flex;
    gap: 4px;
    margin-inline-start: auto;
    align-items: center;
}
.topbar__link {
    padding: 8px 14px;
    border-radius: var(--radius-s);
    color: var(--text-soft);
    font-weight: 600;
    font-size: .9rem;
    transition: background var(--fast) var(--ease), color var(--fast) var(--ease);
}
.topbar__link:hover { color: var(--text); background: var(--surface-alt); }
.topbar__link.is-active { color: var(--primary); background: rgba(92,151,255,.12); }

/* ---------- brand lockup (شعار الأداة الحقيقي) ---------- */
.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text);
    flex-shrink: 0;
}
.brand__mark {
    position: relative;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    border-radius: 11px;
}
/* الشعار صورة شفافة — بلا خلفية مصطنعة، فقط توهّج خفيف */
.brand__mark--image {
    background: transparent;
    filter: drop-shadow(0 3px 10px rgba(59, 115, 232, .45));
    transition: filter var(--normal) var(--ease), transform var(--normal) var(--ease);
    overflow: visible;
}
.brand__mark--image::after { content: none; }
.brand:hover .brand__mark--image {
    filter: drop-shadow(0 4px 16px rgba(59, 115, 232, .7)) drop-shadow(0 0 8px rgba(47, 218, 143, .35));
    transform: translateY(-1px);
}
.brand__logo {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    user-select: none;
    -webkit-user-drag: none;
}
[data-theme="light"] .brand__mark--image {
    filter: drop-shadow(0 2px 8px rgba(20, 35, 60, .22));
}
[data-theme="light"] .brand:hover .brand__mark--image {
    filter: drop-shadow(0 4px 14px rgba(20, 35, 60, .32));
}
.brand__name {
    font-family: 'Satrix Display', 'Satrix UI', sans-serif;
    font-weight: 700;
    font-size: 1.06rem;
    letter-spacing: .02em;
    line-height: 1;
}
.brand__name span { color: var(--accent); }
.brand__sub {
    display: block;
    font-family: 'Satrix UI', sans-serif;
    font-size: .62rem;
    font-weight: 500;
    letter-spacing: .18em;
    color: var(--text-soft);
    text-transform: uppercase;
    margin-top: 3px;
}

/* ---------- sidebar ---------- */
.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 18px 14px;
    background: color-mix(in srgb, var(--surface) 72%, transparent);
    backdrop-filter: blur(10px);
    border-inline-end: 1px solid var(--border);
    z-index: 50;
}
.sidebar__head { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; }
.sidebar__section {
    font-size: .68rem;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--text-soft);
    padding: 16px 12px 6px;
    opacity: .75;
}
.sidebar__link {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 10px 12px;
    border-radius: var(--radius-m);
    color: var(--text-soft);
    font-weight: 600;
    font-size: .92rem;
    position: relative;
    transition: background var(--fast) var(--ease), color var(--fast) var(--ease), transform var(--fast) var(--ease);
}
.sidebar__link svg { flex-shrink: 0; opacity: .85; }
.sidebar__link:hover { background: var(--surface-alt); color: var(--text); transform: translateX(2px); }
.sidebar__link.is-active {
    color: var(--primary);
    background: linear-gradient(90deg, rgba(92,151,255,.18), rgba(92,151,255,.05));
}
.sidebar__link.is-active::before {
    content: '';
    position: absolute;
    inset-inline-start: -14px;
    top: 50%;
    translate: 0 -50%;
    width: 3px;
    height: 22px;
    border-radius: 0 3px 3px 0;
    background: var(--primary);
    box-shadow: 0 0 14px var(--primary);
}
[dir="rtl"] .sidebar__link.is-active::before {
    inset-inline-start: -14px;
    border-radius: 3px 0 0 3px;
}
[dir="rtl"] .sidebar__link.is-active {
    background: linear-gradient(270deg, rgba(92,151,255,.18), rgba(92,151,255,.05));
}
.sidebar__foot { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--border); }

/* ---------- main ---------- */
.main { padding: 24px 26px 56px; min-width: 0; }
.main__head {
    display: flex;
    align-items: flex-end;
    gap: 18px;
    flex-wrap: wrap;
    margin-bottom: 22px;
}
.main__head h1 { margin: 0; font-size: 1.55rem; }
.main__head p { margin: 4px 0 0; font-size: .9rem; }
.main__actions { margin-inline-start: auto; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--text-new);
    margin-bottom: 12px;
}
.eyebrow::before {
    content: '';
    width: 22px;
    height: 2px;
    border-radius: 2px;
    background: linear-gradient(90deg, var(--accent), transparent);
}

/* ---------- cards ---------- */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-l);
    box-shadow: var(--shadow-1);
    position: relative;
    overflow: hidden;
}
.card::before {
    content: '';
    position: absolute;
    inset: 0 0 auto 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--surface-edge) 22%, var(--surface-edge) 78%, transparent);
    opacity: .9;
}
.card__body { padding: 20px 22px; }
.card__head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 22px;
    border-bottom: 1px solid var(--border);
}
.card__head h2, .card__head h3 { margin: 0; font-size: 1rem; }
.card__head .card__tools { margin-inline-start: auto; display: flex; gap: 8px; align-items: center; }

/* ---------- stats ---------- */
.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}
.stat {
    padding: 18px 20px;
    border-radius: var(--radius-l);
    border: 1px solid var(--border);
    background: linear-gradient(165deg, var(--surface-alt), var(--surface));
    position: relative;
    overflow: hidden;
    transition: transform var(--normal) var(--ease), border-color var(--normal) var(--ease);
}
.stat:hover { transform: translateY(-3px); border-color: var(--border-strong); }
.stat::after {
    content: '';
    position: absolute;
    inset-inline-end: -30px;
    top: -30px;
    width: 110px;
    height: 110px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(92,151,255,.18), transparent 70%);
}
.stat__label {
    font-size: .74rem;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--text-soft);
    font-weight: 700;
    margin-bottom: 8px;
}
.stat__value {
    font-family: 'Satrix UI', 'Segoe UI', sans-serif;
    font-variant-numeric: tabular-nums;
    font-size: 1.65rem;
    font-weight: 700;
    letter-spacing: -.02em;
    line-height: 1.1;
}
.stat__hint { font-size: .78rem; color: var(--text-soft); margin-top: 6px; }
.stat--accent .stat__value { color: var(--accent); }
.stat--primary .stat__value { color: var(--primary); }
.stat--warning .stat__value { color: var(--warning); }

/* ---------- grid ---------- */
.grid { display: grid; gap: 16px; }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }

/* ---------- buttons ---------- */
.btn {
    --btn-bg: var(--surface-alt);
    --btn-fg: var(--text);
    --btn-bd: var(--border-strong);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: var(--radius-m);
    border: 1px solid var(--btn-bd);
    background: var(--btn-bg);
    color: var(--btn-fg);
    font-family: inherit;
    font-size: .9rem;
    font-weight: 700;
    line-height: 1.2;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: transform var(--fast) var(--ease), box-shadow var(--fast) var(--ease),
                background var(--fast) var(--ease), border-color var(--fast) var(--ease);
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(.99); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }

.btn--primary {
    --btn-bd: transparent;
    --btn-fg: #fff;
    background: linear-gradient(180deg, #6FA8FF, #3B73E8);
    box-shadow: 0 8px 22px -10px rgba(59,115,232,.9);
}
.btn--primary:hover { box-shadow: 0 12px 28px -10px rgba(59,115,232,1); }

.btn--accent {
    --btn-bd: transparent;
    --btn-fg: #04231A;
    background: linear-gradient(180deg, #58E8AC, #1FBE7C);
    box-shadow: 0 8px 22px -10px rgba(47,218,143,.85);
}

.btn--danger {
    --btn-bd: transparent;
    --btn-fg: #fff;
    background: linear-gradient(180deg, #FF8A93, #E2464F);
}

.btn--ghost { --btn-bg: transparent; }
.btn--ghost:hover { background: var(--surface-alt); }

.btn--sm { padding: 7px 12px; font-size: .8rem; border-radius: var(--radius-s); }
.btn--block { width: 100%; }

/* لمعة تمرّ عند المرور — نفس فكرة الـ sweep في الأداة */
.btn--primary::after,
.btn--accent::after {
    content: '';
    position: absolute;
    top: 0;
    left: -120%;
    width: 60%;
    height: 100%;
    background: linear-gradient(100deg, transparent, rgba(255,255,255,.45), transparent);
    transform: skewX(-18deg);
    transition: left var(--slow) var(--ease);
}
.btn--primary:hover::after,
.btn--accent:hover::after { left: 130%; }

.btn.is-loading { color: transparent !important; pointer-events: none; }
.btn.is-loading::before {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,.45);
    border-top-color: #fff;
    animation: spin .7s linear infinite;
    left: 50%;
    top: 50%;
    margin: -9px 0 0 -9px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- forms ---------- */
.field { margin-bottom: 16px; }
.field__label {
    display: block;
    font-size: .82rem;
    font-weight: 700;
    color: var(--text-soft);
    margin-bottom: 7px;
    letter-spacing: .01em;
}
.input,
.select,
.textarea {
    width: 100%;
    padding: 11px 14px;
    border-radius: var(--radius-m);
    background: var(--surface-alt);
    border: 1px solid var(--border);
    color: var(--text);
    font-family: inherit;
    font-size: .93rem;
    transition: border-color var(--fast) var(--ease), box-shadow var(--fast) var(--ease), background var(--fast) var(--ease);
}
.input::placeholder, .textarea::placeholder { color: color-mix(in srgb, var(--text-soft) 75%, transparent); }
.input:hover, .select:hover, .textarea:hover { border-color: var(--border-strong); }
.input:focus, .select:focus, .textarea:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--surface);
    box-shadow: 0 0 0 3px rgba(92,151,255,.18);
}
.textarea { min-height: 92px; resize: vertical; }
.select {
    appearance: none;
    background-image: linear-gradient(45deg, transparent 50%, var(--text-soft) 50%),
                      linear-gradient(135deg, var(--text-soft) 50%, transparent 50%);
    background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%;
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
    padding-inline-end: 34px;
}
.field--error .input, .field--error .select { border-color: var(--danger); }
.field__error { display: block; margin-top: 6px; font-size: .78rem; color: var(--danger); }
.field__hint { display: block; margin-top: 6px; font-size: .76rem; color: var(--text-soft); }

.input-group { display: flex; gap: 8px; }
.input-group .input { flex: 1; }

.check {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    font-size: .88rem;
    color: var(--text-soft);
    cursor: pointer;
    user-select: none;
}
.check input { width: 17px; height: 17px; accent-color: var(--primary); cursor: pointer; }

/* ---------- table ---------- */
.table-wrap { overflow-x: auto; border-radius: var(--radius-l); }
.table { width: 100%; border-collapse: collapse; font-size: .89rem; }
.table th {
    text-align: start;
    padding: 12px 16px;
    font-size: .72rem;
    letter-spacing: .09em;
    text-transform: uppercase;
    color: var(--text-soft);
    font-weight: 700;
    background: var(--surface-alt);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
.table td {
    padding: 13px 16px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}
.table tbody tr { transition: background var(--fast) var(--ease); }
.table tbody tr:hover { background: var(--surface-alt); }
.table tbody tr:last-child td { border-bottom: none; }
.table__num { font-variant-numeric: tabular-nums; }
.table__empty { text-align: center; padding: 44px 20px; color: var(--text-soft); }

.mono { font-family: 'SFMono-Regular', Consolas, 'Courier New', monospace; font-size: .86em; letter-spacing: -.01em; }

/* ---------- badges ---------- */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .02em;
    border: 1px solid transparent;
    white-space: nowrap;
}
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge--ok    { color: var(--accent);  background: rgba(47,218,143,.12);  border-color: rgba(47,218,143,.3); }
.badge--warn  { color: var(--warning); background: rgba(255,194,79,.12);  border-color: rgba(255,194,79,.3); }
.badge--info  { color: var(--primary); background: rgba(92,151,255,.12);  border-color: rgba(92,151,255,.3); }
.badge--bad   { color: var(--danger);  background: rgba(255,107,118,.12); border-color: rgba(255,107,118,.3); }
.badge--muted { color: var(--text-soft); background: var(--surface-alt); border-color: var(--border); }

/* ---------- alerts ---------- */
.alert {
    display: flex;
    gap: 11px;
    align-items: flex-start;
    padding: 12px 16px;
    border-radius: var(--radius-m);
    font-size: .88rem;
    border: 1px solid var(--border);
    background: var(--surface-alt);
    margin-bottom: 14px;
    animation: alert-in var(--normal) var(--ease);
}
.alert--success { border-color: rgba(47,218,143,.35); background: rgba(47,218,143,.08); color: var(--accent); }
.alert--error   { border-color: rgba(255,107,118,.35); background: rgba(255,107,118,.08); color: var(--danger); }
.alert--info    { border-color: rgba(92,151,255,.35); background: rgba(92,151,255,.08); color: var(--primary); }
.alert--warning { border-color: rgba(255,194,79,.35); background: rgba(255,194,79,.08); color: var(--warning); }
.alert strong { color: inherit; }
@keyframes alert-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

/* ---------- avatar ---------- */
.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-weight: 800;
    font-size: .8rem;
    color: #fff;
    background: linear-gradient(145deg, #5C97FF, #2b52a8);
    flex-shrink: 0;
    letter-spacing: .02em;
}
.avatar--lg { width: 52px; height: 52px; font-size: 1rem; }
.avatar--sm { width: 28px; height: 28px; font-size: .68rem; }

/* ---------- pagination ---------- */
.pager {
    display: flex;
    gap: 6px;
    align-items: center;
    justify-content: center;
    padding: 16px;
    flex-wrap: wrap;
}
.pager__btn {
    min-width: 34px;
    height: 34px;
    padding: 0 10px;
    display: grid;
    place-items: center;
    border-radius: var(--radius-s);
    border: 1px solid var(--border);
    background: var(--surface-alt);
    color: var(--text-soft);
    font-size: .84rem;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--fast) var(--ease);
}
.pager__btn:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); }
.pager__btn.is-current { background: var(--primary); border-color: var(--primary); color: #fff; }
.pager__btn:disabled { opacity: .4; cursor: not-allowed; }

/* ---------- skeleton ---------- */
.skeleton {
    border-radius: var(--radius-s);
    background: linear-gradient(90deg, var(--surface-alt) 25%, var(--surface-high) 50%, var(--surface-alt) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.3s linear infinite;
}
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- modal ---------- */
.modal {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(4, 8, 16, .68);
    backdrop-filter: blur(6px);
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--normal) var(--ease), visibility var(--normal) var(--ease);
}
.modal.is-open { opacity: 1; visibility: visible; }
.modal__panel {
    width: min(520px, 100%);
    max-height: 88vh;
    overflow-y: auto;
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-2);
    transform: translateY(18px) scale(.97);
    transition: transform var(--normal) var(--ease);
}
.modal.is-open .modal__panel { transform: none; }
.modal__head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px 22px;
    border-bottom: 1px solid var(--border);
}
.modal__head h3 { margin: 0; font-size: 1.05rem; }
.modal__close {
    margin-inline-start: auto;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-s);
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-soft);
    cursor: pointer;
    display: grid;
    place-items: center;
    transition: all var(--fast) var(--ease);
}
.modal__close:hover { background: var(--surface-alt); color: var(--text); }
.modal__body { padding: 22px; }
.modal__foot {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    padding: 16px 22px;
    border-top: 1px solid var(--border);
}

/* ---------- toast (مكافئ Notification.qml) ---------- */
.toast-host {
    position: fixed;
    inset-inline-end: 20px;
    bottom: 20px;
    z-index: 300;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}
.toast {
    min-width: 240px;
    max-width: 380px;
    padding: 12px 16px;
    border-radius: var(--radius-m);
    background: var(--surface-high);
    border: 1px solid var(--border-strong);
    box-shadow: var(--shadow-2);
    font-size: .87rem;
    font-weight: 600;
    display: flex;
    gap: 10px;
    align-items: center;
    pointer-events: auto;
    animation: toast-in var(--normal) var(--ease);
}
.toast.is-out { animation: toast-out var(--normal) var(--ease) forwards; }
.toast--success { border-inline-start: 3px solid var(--accent); }
.toast--error   { border-inline-start: 3px solid var(--danger); }
.toast--info    { border-inline-start: 3px solid var(--primary); }
@keyframes toast-in  { from { opacity: 0; transform: translateX(28px); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateX(28px); } }

/* ---------- public landing ---------- */
.hero {
    padding: 74px 0 56px;
    position: relative;
}
.hero__grid {
    display: grid;
    grid-template-columns: minmax(0, 1.06fr) minmax(0, .94fr);
    gap: 48px;
    align-items: center;
}
.hero h1 {
    font-size: clamp(2.1rem, 4.4vw, 3.35rem);
    letter-spacing: -.03em;
    line-height: 1.08;
    margin-bottom: 18px;
}
.hero h1 em {
    font-style: normal;
    background: linear-gradient(100deg, var(--primary), var(--text-new) 55%, var(--accent));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.hero p.lead {
    font-size: 1.04rem;
    max-width: 52ch;
    color: var(--text-soft);
}
.hero__cta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 26px; }
.hero__meta {
    display: flex;
    gap: 26px;
    margin-top: 38px;
    padding-top: 22px;
    border-top: 1px solid var(--border);
    flex-wrap: wrap;
}
.hero__meta b {
    display: block;
    font-family: 'Satrix UI', 'Segoe UI', sans-serif;
    font-variant-numeric: tabular-nums;
    font-size: 1.5rem;
    color: var(--text);
    line-height: 1.1;
}
.hero__meta span { font-size: .78rem; color: var(--text-soft); letter-spacing: .06em; text-transform: uppercase; }

.hero__panel {
    position: relative;
    border-radius: var(--radius-xl);
    padding: 22px;
    background: linear-gradient(160deg, rgba(30,44,70,.92), rgba(17,26,43,.92));
    border: 1px solid var(--border-strong);
    box-shadow: var(--shadow-glow);
}
.hero__panel::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(140deg, rgba(92,151,255,.14), transparent 42%);
    pointer-events: none;
}
.term {
    font-family: 'SFMono-Regular', Consolas, monospace;
    font-size: .8rem;
    line-height: 1.85;
    color: #A8BCDA;
    margin: 0;
    white-space: pre-wrap;
    word-break: break-word;
}
.term .k { color: var(--primary); }
.term .s { color: var(--accent); }
.term .w { color: var(--warning); }
.term .m { color: var(--text-soft); }

.feature {
    padding: 24px;
    border-radius: var(--radius-l);
    background: var(--surface);
    border: 1px solid var(--border);
    transition: transform var(--normal) var(--ease), border-color var(--normal) var(--ease), box-shadow var(--normal) var(--ease);
    position: relative;
    overflow: hidden;
}
.feature:hover { transform: translateY(-4px); border-color: var(--border-strong); box-shadow: var(--shadow-2); }
.feature__icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: linear-gradient(150deg, rgba(92,151,255,.2), rgba(47,218,143,.12));
    color: var(--primary);
    margin-bottom: 14px;
    border: 1px solid var(--border);
}
.feature h3 { font-size: 1rem; margin-bottom: 6px; }
.feature p { font-size: .87rem; margin: 0; }

.section { padding: 56px 0; }
.section__head { text-align: center; max-width: 62ch; margin: 0 auto 34px; }
.section__head h2 { font-size: clamp(1.5rem, 2.6vw, 2.1rem); }
.section__head p { font-size: .96rem; }

/* ---------- auth ---------- */
.auth {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}
.auth__brand {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 42px;
    overflow: hidden;
    background:
        radial-gradient(120% 90% at 12% 8%, rgba(92,151,255,.28), transparent 62%),
        radial-gradient(90% 80% at 88% 92%, rgba(47,218,143,.2), transparent 60%),
        linear-gradient(165deg, #0D1730, #080D18 70%);
    border-inline-end: 1px solid var(--border);
}
.auth__brand::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(to right, rgba(120,160,220,.06) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(120,160,220,.06) 1px, transparent 1px);
    background-size: 46px 46px;
    mask-image: radial-gradient(ellipse at 40% 40%, #000 20%, transparent 78%);
    -webkit-mask-image: radial-gradient(ellipse at 40% 40%, #000 20%, transparent 78%);
}
.auth__ring {
    position: absolute;
    border-radius: 50%;
    border: 1px solid rgba(140,180,255,.16);
    pointer-events: none;
}
.auth__ring--1 { width: 460px; height: 460px; right: -170px; bottom: -150px; animation: spin 68s linear infinite; }
.auth__ring--2 { width: 280px; height: 280px; left: -110px; top: -90px; animation: spin 46s linear infinite reverse; }
.auth__ring::after {
    content: '';
    position: absolute;
    width: 7px; height: 7px;
    border-radius: 50%;
    background: var(--primary);
    box-shadow: 0 0 14px var(--primary);
    top: -4px; left: 50%;
}
.auth__brand-body { position: relative; z-index: 1; max-width: 46ch; }
.auth__brand-body h2 {
    font-size: clamp(1.6rem, 2.6vw, 2.2rem);
    line-height: 1.18;
    margin-bottom: 14px;
}
.auth__points { list-style: none; padding: 0; margin: 26px 0 0; display: grid; gap: 12px; }
.auth__points li {
    display: flex;
    gap: 11px;
    align-items: flex-start;
    font-size: .89rem;
    color: var(--text-soft);
}
.auth__points svg { flex-shrink: 0; margin-top: 3px; color: var(--accent); }
.auth__form-side {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 36px 24px;
    position: relative;
}
.auth__card {
    width: min(430px, 100%);
    position: relative;
    padding: 34px 30px;
    border-radius: var(--radius-xl);
    background: color-mix(in srgb, var(--surface) 92%, transparent);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-2);
    backdrop-filter: blur(12px);
    animation: card-in var(--slow) var(--ease) both;
}
.auth__card::before {
    content: '';
    position: absolute;
    inset: 0 0 auto 0;
    height: 1px;
    border-radius: inherit;
    background: linear-gradient(90deg, transparent, var(--surface-edge) 30%, var(--surface-edge) 70%, transparent);
}
@keyframes card-in {
    from { opacity: 0; transform: translateY(16px) rotate(-.6deg); }
    to   { opacity: 1; transform: none; }
}
.auth__card h1 { font-size: 1.6rem; margin-bottom: 6px; }
.auth__card > p { font-size: .9rem; margin-bottom: 24px; }
.auth__switch { text-align: center; font-size: .87rem; color: var(--text-soft); margin-top: 18px; }
.auth__foot { position: relative; z-index: 1; font-size: .76rem; color: var(--text-soft); }

.auth__card--wide { width: min(470px, 100%); }
.auth__card-top {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: flex-end;
    margin-bottom: 14px;
}
[dir="rtl"] .auth__card-top { justify-content: flex-start; }

/* password visibility toggle */
.pw { position: relative; }
.pw .input { padding-inline-end: 44px; }
.pw__toggle {
    position: absolute;
    inset-inline-end: 6px;
    top: 50%;
    translate: 0 -50%;
    width: 32px; height: 32px;
    border: 0;
    border-radius: var(--radius-s);
    background: transparent;
    color: var(--text-soft);
    cursor: pointer;
    display: grid;
    place-items: center;
    transition: color var(--fast) var(--ease), background var(--fast) var(--ease);
}
.pw__toggle:hover { color: var(--text); background: var(--surface-high); }

/* strength meter */
.pw-meter { display: flex; gap: 5px; margin-top: 8px; }
.pw-meter i {
    height: 3px;
    flex: 1;
    border-radius: 3px;
    background: var(--border);
    transition: background var(--normal) var(--ease);
}

/* ---------- misc ---------- */
.tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: .74rem;
    font-weight: 600;
    background: var(--surface-alt);
    border: 1px solid var(--border);
    color: var(--text-soft);
}
.divider { height: 1px; background: var(--border); margin: 18px 0; border: 0; }
.muted { color: var(--text-soft); }
.small { font-size: .82rem; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row--between { justify-content: space-between; }
.spacer { flex: 1; }
.hidden { display: none !important; }

.user-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 12px 7px 7px;
    border-radius: 999px;
    background: var(--surface-alt);
    border: 1px solid var(--border);
    font-size: .85rem;
    font-weight: 600;
    color: var(--text);
    transition: border-color var(--fast) var(--ease);
}
.user-chip:hover { border-color: var(--border-strong); color: var(--text); }
.user-chip small { display: block; font-size: .7rem; color: var(--text-soft); font-weight: 500; line-height: 1.2; }

.icon-btn {
    width: 36px; height: 36px;
    display: inline-grid;
    place-items: center;
    border-radius: var(--radius-s);
    border: 1px solid var(--border);
    background: var(--surface-alt);
    color: var(--text-soft);
    cursor: pointer;
    transition: all var(--fast) var(--ease);
    vertical-align: middle;
}
.icon-btn:hover { color: var(--primary); border-color: var(--primary); }

/* زر الثيم: الأيقونتان في نفس الموضع تماماً */
.js-theme-toggle {
    display: inline-grid;
    place-items: center;
    padding: 0;
}
.js-theme-toggle .icon-moon,
.js-theme-toggle .icon-sun {
    grid-area: 1 / 1;
    display: grid;
    place-items: center;
    line-height: 0;
}
.js-theme-toggle .icon-sun { color: var(--warning); }

.cell-actions { display: flex; gap: 6px; align-items: center; }

/* reveal-on-scroll — تدريجي: يبقى المحتوى ظاهراً إن تعطّل JavaScript */
.js [data-reveal] {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity var(--slow) var(--ease), transform var(--slow) var(--ease);
}
.js [data-reveal].is-in { opacity: 1; transform: none; }

/* chart bars */
.chart { display: flex; gap: 10px; align-items: flex-end; height: 132px; padding-top: 10px; }
.chart__col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; height: 100%; justify-content: flex-end; }
.chart__bar {
    width: 100%;
    max-width: 34px;
    border-radius: 6px 6px 3px 3px;
    background: linear-gradient(180deg, var(--primary), rgba(92,151,255,.25));
    min-height: 4px;
    transform-origin: bottom;
    animation: bar-rise var(--slow) var(--ease) both;
}
.chart__bar--accent { background: linear-gradient(180deg, var(--accent), rgba(47,218,143,.22)); }
@keyframes bar-rise { from { transform: scaleY(.05); opacity: .3; } to { transform: scaleY(1); opacity: 1; } }
.chart__label { font-size: .7rem; color: var(--text-soft); font-weight: 700; letter-spacing: .06em; }

/* feature list in model card */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: .74rem;
    background: rgba(92,151,255,.1);
    color: var(--text-new);
    border: 1px solid rgba(92,151,255,.22);
}

/* footer */
.footer {
    border-top: 1px solid var(--border);
    padding: 26px 0;
    margin-top: auto;
    font-size: .82rem;
    color: var(--text-soft);
}
.footer .container { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; justify-content: space-between; }

/* ---------- responsive ---------- */
@media (max-width: 1024px) {
    .hero__grid { grid-template-columns: 1fr; gap: 34px; }
    .auth { grid-template-columns: 1fr; }
    .auth__brand { display: none; }
    .auth__form-side { min-height: 100vh; padding: 24px 16px; }
    .dash { grid-template-columns: 1fr; }
    .footer__grid { grid-template-columns: repeat(2, minmax(140px, 1fr)); gap: 22px; }
    .footer__brand { grid-column: 1 / -1; }
    .sidebar {
        position: fixed;
        inset-block: 0;
        inset-inline-start: 0;
        width: min(84vw, var(--sidebar-w));
        transform: translateX(-102%);
        transition: transform var(--normal) var(--ease);
        box-shadow: var(--shadow-2);
        background: var(--surface);
    }
    .sidebar.is-open { transform: none; }
    .main { padding: 18px 16px 48px; }
    .scrim {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(4,8,16,.6);
        z-index: 45;
        opacity: 0;
        visibility: hidden;
        transition: opacity var(--normal) var(--ease), visibility var(--normal) var(--ease);
    }
    .scrim.is-open { opacity: 1; visibility: visible; }
    .menu-toggle { display: inline-grid !important; }
}
@media (max-width: 620px) {
    .container { width: calc(100% - 28px); }
    .topbar__nav { gap: 4px; }
    .topbar__nav .topbar__link:not(.btn) { display: none; }
    .topbar__sep { display: none; }
    .main__head { align-items: flex-start; }
    .main__actions { width: 100%; margin-inline-start: 0; }
    .stats { grid-template-columns: 1fr 1fr; }
    .stat__value { font-size: 1.35rem; }
    .table th, .table td { padding: 10px 12px; }
    .modal__panel { max-height: 92vh; }
    .hero { padding: 44px 0 36px; }
    .footer__grid { grid-template-columns: 1fr; }
}

/* =========================================================================
   RTL — يعمل مع dir="rtl" على <html>
   ========================================================================= */
[dir="rtl"] .sidebar__link:hover { transform: translateX(-2px); }
[dir="rtl"] .lang-switch__menu { inset-inline-end: 0; }
[dir="rtl"] .hero__meta { direction: rtl; }
[dir="rtl"] .term { direction: ltr; text-align: start; }
[dir="rtl"] .mono { direction: ltr; unicode-bidi: embed; }
[dir="rtl"] .table th { text-align: right; }
[dir="rtl"] .step__num { inset-inline-end: 18px; }

/* السهم في زر اللغة يبقى منطقياً في RTL */
[dir="rtl"] .btn svg,
[dir="rtl"] .sidebar__link svg,
[dir="rtl"] .feature__icon svg { flex-shrink: 0; }

/* شريط التقدم في تطبيق سطح المكتب يظل من اليسار لليمين لأنه مؤشّر رقمي */
[dir="rtl"] .app-mock__track i { direction: ltr; }

/* =========================================================================
   Small helpers used by the rewritten views
   ========================================================================= */
.select--inline {
    padding: 5px 26px 5px 9px;
    font-size: .8rem;
    min-width: 118px;
}
.feature-search { padding: 16px 20px; border-bottom: 1px solid var(--border); }
.feature-row { padding: 11px 20px; border-bottom: 1px solid var(--border); }
.feature-row.is-active { background: var(--surface-alt); }
.feature-row .muted { color: var(--text-soft); }
.js-feature-del {
    border: 0;
    background: transparent;
    color: var(--danger);
    cursor: pointer;
    padding: 0 0 0 4px;
    display: inline-flex;
    align-items: center;
}
.audit-dot { background: linear-gradient(145deg, #2FDA8F, #159A68); }
.audit-action { color: var(--text-new); }
.audit-detail { max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.error-code {
    font-family: 'Satrix Display', sans-serif;
    font-size: 3rem;
    margin-bottom: 6px;
    color: var(--primary);
    line-height: 1;
}
.user-chip__text { display: block; line-height: 1.25; }

/* =========================================================================
   Control Center — شريط جانبي مجمّع
   ========================================================================= */
.sidebar__nav {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding-inline-end: 2px;
    scrollbar-width: thin;
}
.sidebar__nav::-webkit-scrollbar { width: 6px; }
.sidebar__nav::-webkit-scrollbar-thumb {
    background: var(--border-strong);
    border-radius: 3px;
}
.sidebar__group { display: flex; flex-direction: column; gap: 2px; }
.sidebar__footer-spacer { flex: 1; }

.ctrl-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 11px;
    border-radius: 999px;
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--text-new);
    background: rgba(92, 151, 255, .12);
    border: 1px solid rgba(92, 151, 255, .28);
}
.ctrl-badge svg { opacity: .85; }

.stats--5 {
    grid-template-columns: repeat(auto-fit, minmax(178px, 1fr));
}

.perm-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 10px 12px;
    border-radius: var(--radius-s);
    border: 1px solid var(--border);
    background: var(--surface-alt);
    transition: border-color var(--fast) var(--ease);
}
.perm-row:hover { border-color: var(--border-strong); }

/* التخطيط: الشريط الجانبي يأخذ ارتفاع الشاشة والتنقّل يتمرّر داخله */
.dash--admin .sidebar {
    overflow: hidden;
    padding-bottom: 12px;
}
.dash--admin .sidebar__foot {
    margin-top: 8px;
    flex-shrink: 0;
}

@media (max-width: 1024px) {
    .dash--admin .sidebar {
        overflow-y: auto;
        display: flex;
    }
    .dash--admin .sidebar__nav { overflow: visible; }
}

/* =========================================================================
   Page head (inner public pages)
   ========================================================================= */
.page-head {
    padding: 54px 0 26px;
    position: relative;
}
.page-head h1 {
    font-size: clamp(1.8rem, 3.4vw, 2.7rem);
    letter-spacing: -.025em;
    margin-bottom: 12px;
}
.page-head .lead { font-size: 1.02rem; max-width: 62ch; margin-bottom: 0; }
.page-head__meta { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 20px; }

.section--tight { padding: 32px 0; }
.container--narrow { width: min(860px, 100% - 40px); margin-inline: auto; }

/* =========================================================================
   Trust bullets under the hero
   ========================================================================= */
.trust-list {
    list-style: none;
    padding: 0;
    margin: 20px 0 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px 20px;
}
.trust-list li {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: .84rem;
    font-weight: 600;
    color: var(--text-soft);
}
.trust-list svg { color: var(--accent); flex-shrink: 0; }

/* =========================================================================
   Model checker
   ========================================================================= */
.checker {
    position: relative;
    padding: 24px;
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-strong);
    background: linear-gradient(165deg, var(--surface-alt), var(--surface));
    box-shadow: var(--shadow-2);
}
.checker::before {
    content: '';
    position: absolute;
    inset: 0 0 auto 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
    opacity: .5;
    border-radius: inherit;
}
.checker__head { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 16px; }
.checker__head > svg {
    flex-shrink: 0;
    margin-top: 3px;
    color: var(--primary);
}
.checker__title { font-size: 1.06rem; margin: 0 0 3px; }
.checker__sub { margin: 0; font-size: .85rem; }
.checker__form { display: block; }
.checker__hint { display: block; margin-top: 8px; font-size: .76rem; color: var(--text-soft); }

.checker__result { margin-top: 16px; }

.checker__box {
    border-radius: var(--radius-m);
    border: 1px solid var(--border);
    background: var(--surface);
    padding: 16px 18px;
    animation: alert-in var(--normal) var(--ease);
}
.checker__box--yes { border-color: rgba(47,218,143,.35); }
.checker__box--no  { border-color: rgba(255,107,118,.3); }

.checker__box-head { display: flex; align-items: center; gap: 9px; margin-bottom: 10px; }
.checker__icon {
    width: 22px; height: 22px;
    display: grid; place-items: center;
    border-radius: 50%;
    font-size: .72rem;
    font-weight: 900;
    flex-shrink: 0;
}
.checker__box--yes .checker__icon { background: rgba(47,218,143,.16); color: var(--accent); }
.checker__box--no  .checker__icon { background: rgba(255,107,118,.14); color: var(--danger); }
.checker__box-head strong { font-size: .92rem; }

.checker__model { font-size: 1.02rem; margin: 0 0 2px; }
.checker__code { color: var(--text-new); margin-bottom: 12px; }

.checker__rows { display: grid; gap: 0; margin-bottom: 14px; }
.checker__row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 14px;
    padding: 7px 0;
    border-bottom: 1px solid var(--border);
    font-size: .87rem;
}
.checker__row:last-child { border-bottom: 0; }
.checker__services { text-align: end; font-weight: 600; }
.checker__price { color: var(--accent); font-variant-numeric: tabular-nums; }
.checker__note { margin: 0 0 12px; font-size: .86rem; color: var(--text-soft); }

/* =========================================================================
   Supported models list
   ========================================================================= */
.model-grid { display: grid; gap: 8px; }
.model-row {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 18px;
    border-radius: var(--radius-m);
    background: var(--surface);
    border: 1px solid var(--border);
    transition: border-color var(--fast) var(--ease), background var(--fast) var(--ease);
}
.model-row:hover { border-color: var(--border-strong); background: var(--surface-alt); }
.model-row__main { min-width: 0; flex: 1; }
.model-row__brand {
    display: inline-block;
    font-size: .68rem;
    font-weight: 800;
    letter-spacing: .09em;
    text-transform: uppercase;
    color: var(--text-soft);
    margin-bottom: 3px;
}
.model-row__name { font-size: .95rem; margin: 0 0 2px; font-weight: 700; }
.model-row__code { font-size: .78rem; color: var(--text-new); }
.model-row__side { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.model-row__price { color: var(--accent); font-weight: 700; font-size: .95rem; }

/* =========================================================================
   Pricing plans
   ========================================================================= */
.plans {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
    align-items: stretch;
}
.plan {
    position: relative;
    display: flex;
    flex-direction: column;
    padding: 28px 24px 24px;
    border-radius: var(--radius-xl);
    background: var(--surface);
    border: 1px solid var(--border);
    transition: transform var(--normal) var(--ease), border-color var(--normal) var(--ease);
}
.plan:hover { transform: translateY(-3px); border-color: var(--border-strong); }
.plan--featured {
    border-color: rgba(92,151,255,.45);
    box-shadow: var(--shadow-glow);
    background: linear-gradient(170deg, rgba(92,151,255,.08), var(--surface) 42%);
}
.plan__badge {
    position: absolute;
    top: -11px;
    inset-inline-start: 24px;
    padding: 4px 11px;
    border-radius: 999px;
    font-size: .68rem;
    font-weight: 800;
    letter-spacing: .05em;
    color: #fff;
    background: linear-gradient(180deg, #6FA8FF, #3B73E8);
    box-shadow: 0 6px 16px -8px rgba(59,115,232,.9);
}
.plan__badge--muted {
    background: var(--surface-high);
    color: var(--text-soft);
    border: 1px solid var(--border-strong);
    box-shadow: none;
}
.plan__title { font-size: 1.15rem; margin-bottom: 3px; }
.plan__sub { font-size: .82rem; color: var(--text-soft); margin-bottom: 18px; }
.plan__list { list-style: none; padding: 0; margin: 0 0 22px; display: grid; gap: 10px; flex: 1; }
.plan__list li { display: flex; gap: 9px; align-items: flex-start; font-size: .88rem; }
.plan__list svg { color: var(--accent); flex-shrink: 0; margin-top: 3px; }
.plan__list li.is-muted svg { color: var(--text-soft); }
.plan__list li.is-muted span { color: var(--text-soft); }

.compare-table td { font-size: .88rem; }
.compare-table td:first-child { color: var(--text-soft); font-weight: 600; }
.compare-yes { color: var(--accent); font-weight: 600; }
.compare-part { color: var(--warning); font-weight: 600; }

/* =========================================================================
   FAQ accordion
   ========================================================================= */
.faq { display: grid; gap: 8px; }
.faq__item {
    border-radius: var(--radius-m);
    border: 1px solid var(--border);
    background: var(--surface);
    overflow: hidden;
    transition: border-color var(--fast) var(--ease);
}
.faq__item[open] { border-color: var(--border-strong); }
.faq__q {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px 18px;
    cursor: pointer;
    font-size: .92rem;
    font-weight: 700;
    list-style: none;
    transition: background var(--fast) var(--ease);
}
.faq__q::-webkit-details-marker { display: none; }
.faq__q:hover { background: var(--surface-alt); }
.faq__caret { margin-inline-start: auto; color: var(--text-soft); transition: transform var(--normal) var(--ease); flex-shrink: 0; }
.faq__item[open] .faq__caret { transform: rotate(180deg); color: var(--primary); }
.faq__a {
    padding: 0 18px 16px;
    font-size: .88rem;
    color: var(--text-soft);
    line-height: 1.72;
    animation: faq-open var(--normal) var(--ease);
}
@keyframes faq-open { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

/* =========================================================================
   Download page
   ========================================================================= */
.download-card {
    display: flex;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
    padding: 26px 28px;
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-strong);
    background:
        radial-gradient(90% 140% at 6% 0%, rgba(92,151,255,.16), transparent 60%),
        linear-gradient(165deg, var(--surface-alt), var(--surface));
    box-shadow: var(--shadow-2);
}
.download-card__main { display: flex; align-items: center; gap: 16px; flex: 1; min-width: 240px; }
.download-card__icon {
    width: 56px; height: 56px;
    display: grid; place-items: center;
    border-radius: 15px;
    background: linear-gradient(150deg, rgba(92,151,255,.22), rgba(47,218,143,.12));
    border: 1px solid var(--border);
    color: var(--primary);
    flex-shrink: 0;
}
.download-card__side { text-align: center; }

.download-facts { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }

.driver {
    padding: 20px;
    border-radius: var(--radius-l);
    background: var(--surface);
    border: 1px solid var(--border);
    transition: transform var(--normal) var(--ease), border-color var(--normal) var(--ease);
}
.driver:hover { transform: translateY(-3px); border-color: var(--border-strong); }
.driver__head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.driver__icon {
    width: 34px; height: 34px;
    display: grid; place-items: center;
    border-radius: 9px;
    background: rgba(92,151,255,.12);
    color: var(--primary);
    flex-shrink: 0;
}
.driver h3 { font-size: .96rem; margin-bottom: 4px; }
.driver p { font-size: .84rem; margin-bottom: 14px; }

.changelog { display: grid; gap: 14px; }
.changelog__entry {
    padding: 18px 22px;
    border-radius: var(--radius-l);
    background: var(--surface);
    border: 1px solid var(--border);
    border-inline-start: 3px solid var(--primary);
}
.changelog__head { display: flex; align-items: center; gap: 9px; margin-bottom: 10px; }
.changelog__dot {
    width: 7px; height: 7px;
    border-radius: 50%;
    background: var(--primary);
    box-shadow: 0 0 10px var(--primary);
    flex-shrink: 0;
}
.changelog__list { margin: 0; padding-inline-start: 20px; display: grid; gap: 5px; }
.changelog__list li { font-size: .86rem; color: var(--text-soft); }

@media (max-width: 620px) {
    .page-head { padding: 34px 0 20px; }
    .checker { padding: 18px; }
    .checker .input-group { flex-direction: column; }
    .checker .input-group .btn { width: 100%; }
    .model-row { flex-direction: column; align-items: flex-start; gap: 8px; }
    .model-row__side { width: 100%; justify-content: space-between; }
    .download-card { padding: 20px; }
    .download-card__side { width: 100%; }
    .download-card__side .btn { width: 100%; }
}

.menu-toggle { display: none; }

/* =========================================================================
   Language switcher
   ========================================================================= */
.lang-switch { position: relative; }

.lang-switch__btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 11px;
    border-radius: var(--radius-s);
    border: 1px solid var(--border);
    background: var(--surface-alt);
    color: var(--text-soft);
    font-family: inherit;
    font-size: .82rem;
    font-weight: 700;
    letter-spacing: .03em;
    cursor: pointer;
    transition: color var(--fast) var(--ease), border-color var(--fast) var(--ease);
}
.lang-switch__btn:hover { color: var(--text); border-color: var(--border-strong); }

.lang-switch__caret { transition: transform var(--fast) var(--ease); opacity: .7; }
.lang-switch.is-open .lang-switch__caret { transform: rotate(180deg); }

.lang-switch__menu {
    position: absolute;
    inset-inline-end: 0;
    top: calc(100% + 8px);
    min-width: 180px;
    margin: 0;
    padding: 6px;
    list-style: none;
    border-radius: var(--radius-m);
    background: var(--surface-high);
    border: 1px solid var(--border-strong);
    box-shadow: var(--shadow-2);
    z-index: 120;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity var(--fast) var(--ease), transform var(--fast) var(--ease), visibility var(--fast) var(--ease);
}
.lang-switch.is-open .lang-switch__menu { opacity: 1; visibility: visible; transform: none; }

.lang-switch__item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: var(--radius-s);
    color: var(--text-soft);
    font-size: .88rem;
    font-weight: 600;
    transition: background var(--fast) var(--ease), color var(--fast) var(--ease);
}
.lang-switch__item:hover { background: var(--surface-alt); color: var(--text); }
.lang-switch__item.is-active { color: var(--primary); background: rgba(92,151,255,.1); }
.lang-switch__short {
    width: 26px;
    height: 22px;
    display: grid;
    place-items: center;
    border-radius: 5px;
    background: var(--surface-alt);
    border: 1px solid var(--border);
    font-size: .68rem;
    font-weight: 800;
    letter-spacing: .04em;
    flex-shrink: 0;
}
.lang-switch__item.is-active .lang-switch__short { border-color: rgba(92,151,255,.4); }
.lang-switch__check { margin-inline-start: auto; }

.topbar__sep {
    width: 1px;
    height: 20px;
    background: var(--border);
    margin-inline: 4px;
}

/* =========================================================================
   Desktop application mock (hero panel)
   ========================================================================= */
.app-mock { padding: 0; overflow: hidden; }

.app-mock__bar {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 11px 16px;
    background: var(--surface-alt);
    border-bottom: 1px solid var(--border);
}
.app-mock__dot {
    width: 9px; height: 9px;
    border-radius: 50%;
    background: var(--border-strong);
}
.app-mock__dot:nth-child(1) { background: #FF6B76; }
.app-mock__dot:nth-child(2) { background: #FFC24F; }
.app-mock__dot:nth-child(3) { background: #2FDA8F; }
.app-mock__title {
    font-size: .78rem;
    font-weight: 700;
    color: var(--text-soft);
    letter-spacing: .02em;
    margin-inline-start: 6px;
}

.app-mock__body { padding: 18px; }

.app-mock__device {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: var(--radius-m);
    background: var(--surface-alt);
    border: 1px solid var(--border);
    margin-bottom: 14px;
    position: relative;
}
.app-mock__device strong { display: block; font-size: .9rem; }
.app-mock__icon {
    width: 38px; height: 38px;
    display: grid; place-items: center;
    border-radius: 10px;
    background: rgba(92,151,255,.14);
    color: var(--primary);
    flex-shrink: 0;
}
.app-mock__pulse {
    margin-inline-start: auto;
    width: 9px; height: 9px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 0 0 rgba(47,218,143,.6);
    animation: mock-pulse 2s var(--ease) infinite;
}
@keyframes mock-pulse {
    0%   { box-shadow: 0 0 0 0 rgba(47,218,143,.55); }
    70%  { box-shadow: 0 0 0 9px rgba(47,218,143,0); }
    100% { box-shadow: 0 0 0 0 rgba(47,218,143,0); }
}

.app-mock__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 2px;
    border-bottom: 1px solid var(--border);
    font-size: .84rem;
    color: var(--text-soft);
}
.app-mock__row strong { color: var(--text); font-weight: 600; }
.app-mock__row:last-of-type { border-bottom: 0; }

.app-mock__progress {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 14px 0 16px;
}
.app-mock__track {
    flex: 1;
    height: 6px;
    border-radius: 4px;
    background: var(--surface-high);
    overflow: hidden;
}
.app-mock__track i {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    animation: mock-fill 2.6s var(--ease) infinite alternate;
}
@keyframes mock-fill { from { width: 48%; } to { width: 78%; } }

.app-mock__cta {
    padding: 11px;
    border-radius: var(--radius-m);
    text-align: center;
    font-size: .86rem;
    font-weight: 700;
    color: #04231A;
    background: linear-gradient(180deg, #58E8AC, #1FBE7C);
    box-shadow: 0 8px 22px -12px rgba(47,218,143,.9);
}
.app-mock__note {
    margin: 10px 0 0;
    font-size: .74rem;
    text-align: center;
    color: var(--text-soft);
}

/* =========================================================================
   How-it-works steps
   ========================================================================= */
.steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 14px;
    list-style: none;
    padding: 0;
    margin: 0;
    counter-reset: step;
}
.step {
    position: relative;
    padding: 24px 22px 20px;
    border-radius: var(--radius-l);
    background: var(--surface);
    border: 1px solid var(--border);
    transition: transform var(--normal) var(--ease), border-color var(--normal) var(--ease);
}
.step:hover { transform: translateY(-3px); border-color: var(--border-strong); }
.step__num {
    position: absolute;
    inset-inline-end: 18px;
    top: 14px;
    font-family: 'Satrix Display', sans-serif;
    font-size: 1.9rem;
    font-weight: 700;
    color: var(--border-strong);
    opacity: .5;
    line-height: 1;
}
.step__icon {
    width: 40px; height: 40px;
    display: grid; place-items: center;
    border-radius: 11px;
    background: linear-gradient(150deg, rgba(92,151,255,.18), rgba(47,218,143,.1));
    color: var(--primary);
    border: 1px solid var(--border);
    margin-bottom: 13px;
}
.step h3 { font-size: .98rem; margin-bottom: 5px; }
.step p { font-size: .85rem; margin: 0; }

/* =========================================================================
   Footer
   ========================================================================= */
.footer__grid {
    display: grid;
    grid-template-columns: minmax(200px, 1.4fr) repeat(3, minmax(120px, 1fr));
    gap: 28px;
    padding-bottom: 22px;
}
.footer__brand { display: flex; flex-direction: column; gap: 12px; }
.footer__note { display: flex; align-items: center; gap: 6px; margin: 0; font-size: .78rem; color: var(--text-soft); }
.footer__col { display: flex; flex-direction: column; gap: 7px; }
.footer__col h4 {
    margin: 0 0 4px;
    font-size: .72rem;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--text-soft);
}
.footer__col a, .footer__col span { font-size: .85rem; color: var(--text-soft); }
.footer__col a:hover { color: var(--primary); }
.footer__base {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    padding-top: 18px;
    border-top: 1px solid var(--border);
    font-size: .8rem;
}

/* =========================================================================
   Closing CTA band
   ========================================================================= */
.cta-band {
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    background:
        radial-gradient(90% 130% at 10% 0%, rgba(92,151,255,.14), transparent 62%),
        radial-gradient(80% 120% at 92% 100%, rgba(47,218,143,.12), transparent 60%),
        var(--surface);
    padding: 34px 0;
    margin-top: 20px;
}
.cta-band__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 22px;
    flex-wrap: wrap;
}
.cta-band__inner h2 { font-size: clamp(1.15rem, 2vw, 1.5rem); }

.brand-card .price { color: var(--accent); font-size: 1.02rem; }

.summary-row { padding: 9px 0; border-bottom: 1px solid var(--border); }

/* الستر يُستخدم في الشاشات الصغيرة فقط. */
.scrim { display: none; }

/* =========================================================================
   Navigation transitions — انتقالات سلسة بين الصفحات
   ========================================================================= */

/* شريط التقدّم أعلى الصفحة أثناء الانتقال */
.nav-progress {
    position: fixed;
    inset-block-start: 0;
    inset-inline-start: 0;
    z-index: 500;
    height: 2px;
    width: 0;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    box-shadow: 0 0 12px var(--primary);
    opacity: 0;
    pointer-events: none;
    transition: width 380ms var(--ease), opacity 140ms linear;
}
.nav-progress.is-active {
    width: 82%;
    opacity: 1;
}

/* خروج المحتوى بلطف قبل الانتقال */
.js body > .shell,
.js body > .dash,
.js body > .auth {
    transition: opacity 170ms var(--ease), transform 170ms var(--ease);
}
.js body.is-leaving > .shell,
.js body.is-leaving > .dash,
.js body.is-leaving > .auth {
    opacity: 0;
    transform: translateY(-6px) scale(.995);
}

/* دخول المحتوى عند الوصول */
@keyframes page-in {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: none; }
}
.js body > .shell > main,
.js body > .dash > .main {
    animation: page-in 380ms var(--ease) both;
}

/* الشريط العلوي يبقى ثابتاً بلا وميض أثناء الانتقال */
.js body.is-leaving .topbar,
.js body.is-leaving .sidebar {
    opacity: .55;
    transition: opacity 170ms var(--ease);
}

/* مؤشّر التنقّل النشط في القائمة */
.sidebar__link,
.topbar__link {
    position: relative;
}

/* تأثير التمرير اللطيف للروابط الداخلية بالمرساة */
@media (prefers-reduced-motion: no-preference) {
    html { scroll-behavior: smooth; }
}

/* احترام تقليل الحركة */
@media (prefers-reduced-motion: reduce) {
    .js body > .shell > main,
    .js body > .dash > .main {
        animation: none;
    }
    .js body.is-leaving > .shell,
    .js body.is-leaving > .dash,
    .js body.is-leaving > .auth {
        opacity: 1;
        transform: none;
    }
    .nav-progress { transition: none; }

    *, *::before, *::after {
        animation-duration: .001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .001ms !important;
    }
}
