/* ASFAN VR LMS – design system (RTL/LTR aware via logical properties) */
:root {
  --brand: #00A3E0;
  --brand-2: #6D5BFF;
  --bg: #070f1f;
  --bg-2: #0b1730;
  --surface: #0f1d3a;
  --surface-2: #132449;
  --surface-3: #1a2e5a;
  --line: rgba(148, 178, 230, .14);
  --line-2: rgba(148, 178, 230, .24);
  --text: #e8f0ff;
  --text-2: #a9b9d6;
  --text-3: #7286a8;
  --ok: #22c55e;
  --warn: #f59e0b;
  --bad: #ef4444;
  --info: #38bdf8;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 10px 30px rgba(0, 0, 0, .35);
  --font: "Segoe UI", "Segoe UI Variable", Tahoma, "Noto Sans Arabic", "Helvetica Neue", Arial, sans-serif;
  --sidebar: 248px;
  color-scheme: dark;
}
[data-theme="light"] {
  --bg: #eef3fa;
  --bg-2: #e4ebf6;
  --surface: #ffffff;
  --surface-2: #f4f7fc;
  --surface-3: #e8eef8;
  --line: rgba(15, 35, 75, .10);
  --line-2: rgba(15, 35, 75, .18);
  --text: #0b1a33;
  --text-2: #42557a;
  --text-3: #7083a3;
  --shadow: 0 8px 24px rgba(15, 35, 75, .10);
  color-scheme: light;
}

* { box-sizing: border-box; }
/* default icon size; any more specific rule below overrides it */
:where(svg):not([width]) { width: 1.2em; height: 1.2em; flex: none; vertical-align: -0.2em; }
.pill svg { width: 14px; height: 14px; }
.banner-alert svg { width: 20px; height: 20px; }
[dir="rtl"] svg.rtl-flip { transform: scaleX(-1); }
html, body { height: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); font-size: 14.5px; line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; }
::selection { background: color-mix(in srgb, var(--brand) 40%, transparent); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 10px; border: 2px solid var(--bg); }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- boot ---------- */
.boot { height: 100vh; display: grid; place-content: center; justify-items: center; gap: 22px; }
.boot-bar { width: 180px; height: 4px; border-radius: 4px; background: var(--surface-2); overflow: hidden; }
.boot-bar span { display: block; height: 100%; width: 40%; background: linear-gradient(90deg, var(--brand), var(--brand-2)); animation: boot 1.1s ease-in-out infinite; }
@keyframes boot { 0% { transform: translateX(-120%); } 100% { transform: translateX(320%); } }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; overflow-y: auto; background: var(--bg-2);
  border-inline-end: 1px solid var(--line); display: flex; flex-direction: column; padding: 14px 14px 10px; gap: 2px; z-index: 20;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 4px 8px 10px; }
.brand img { width: 40px; height: 40px; border-radius: 11px; }
.brand b { display: block; font-size: 16px; letter-spacing: .5px; }
.brand small { color: var(--text-3); font-size: 12px; display: block; max-width: 160px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-label { font-size: 11.5px; text-transform: uppercase; letter-spacing: 1px; color: var(--text-3); padding: 10px 12px 4px; }
.nav a {
  display: flex; align-items: center; gap: 12px; padding: 7px 12px; border-radius: 10px; color: var(--text-2);
  font-weight: 500; transition: background .15s, color .15s;
}
.nav a svg { width: 19px; height: 19px; flex: none; opacity: .85; }
.nav a:hover { background: var(--surface); color: var(--text); }
.nav a.active { background: linear-gradient(90deg, color-mix(in srgb, var(--brand) 22%, transparent), transparent); color: var(--text); box-shadow: inset 3px 0 0 var(--brand); }
[dir="rtl"] .nav a.active { background: linear-gradient(-90deg, color-mix(in srgb, var(--brand) 22%, transparent), transparent); box-shadow: inset -3px 0 0 var(--brand); }
.nav a .count { margin-inline-start: auto; font-size: 11.5px; background: var(--bad); color: #fff; border-radius: 10px; padding: 0 7px; }
.sidebar-foot { margin-top: auto; padding: 10px 8px 0; border-top: 1px solid var(--line); display: grid; gap: 8px; }

/* ASFAN vendor signature at the bottom of the sidebar */
.vendor { display: grid; gap: 4px; margin-top: 6px; padding: 12px 10px 4px; border-top: 1px solid var(--line); }
.vendor a { display: flex; align-items: center; gap: 8px; color: var(--text-3); font-size: 12px; padding: 2px 4px; border-radius: 6px; }
.vendor a:hover { color: var(--brand); }
.vendor a svg { width: 14px; height: 14px; }
.vendor .vendor-logo { padding: 2px 4px 6px; }
.vendor .vendor-logo img { height: 26px; width: auto; }
[data-theme="dark"] .logo-on-light, [data-theme="light"] .logo-on-dark { display: none; }
.auth-vendor .vendor { border-top-color: rgba(255,255,255,.15); max-width: 320px; }
.auth-vendor .vendor a { color: #a9bde0; font-size: 13px; }
.auth-vendor .logo-on-light { display: none; }
.auth-vendor .logo-on-dark { display: block !important; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 15; display: flex; align-items: center; gap: 12px; padding: 12px 28px;
  background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line);
}
.topbar .crumbs { display: flex; align-items: center; gap: 8px; color: var(--text-3); font-size: 13.5px; min-width: 0; }
.topbar .crumbs a { color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 240px; flex-shrink: 1; }
.topbar .crumbs b { color: var(--text); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .spacer { flex: 1; }
.search { position: relative; width: min(320px, 34vw); }
.search input { width: 100%; padding: 8px 36px 8px 12px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); outline: none; }
[dir="ltr"] .search input { padding: 8px 12px 8px 36px; }
.search svg { position: absolute; inset-inline-end: 10px; top: 50%; transform: translateY(-50%); width: 17px; color: var(--text-3); }
[dir="ltr"] .search svg { inset-inline-end: auto; inset-inline-start: 10px; }
.search input:focus { border-color: var(--brand); }
.content { padding: 26px 28px 60px; max-width: 1480px; width: 100%; margin: 0 auto; }
.menu-btn { display: none; }

/* ---------- chips / badges ---------- */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 30px; font-size: 12.5px; font-weight: 600; background: var(--surface); border: 1px solid var(--line); color: var(--text-2); white-space: nowrap; }
.pill .dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.pill.ok { color: var(--ok); background: color-mix(in srgb, var(--ok) 12%, transparent); border-color: color-mix(in srgb, var(--ok) 30%, transparent); }
.pill.warn { color: var(--warn); background: color-mix(in srgb, var(--warn) 12%, transparent); border-color: color-mix(in srgb, var(--warn) 30%, transparent); }
.pill.bad { color: var(--bad); background: color-mix(in srgb, var(--bad) 12%, transparent); border-color: color-mix(in srgb, var(--bad) 30%, transparent); }
.pill.info { color: var(--info); background: color-mix(in srgb, var(--info) 12%, transparent); border-color: color-mix(in srgb, var(--info) 30%, transparent); }
.pill.brand { color: var(--brand); background: color-mix(in srgb, var(--brand) 12%, transparent); border-color: color-mix(in srgb, var(--brand) 30%, transparent); }
.tag { display: inline-block; font-size: 12px; padding: 2px 8px; border-radius: 6px; background: var(--surface-2); color: var(--text-2); border: 1px solid var(--line); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 16px; border-radius: 10px; border: 1px solid var(--line-2);
  background: var(--surface); color: var(--text); font-weight: 600; cursor: pointer; transition: transform .08s, background .15s, border-color .15s, box-shadow .15s;
  white-space: nowrap; text-decoration: none; font-size: 14px;
}
.btn svg { width: 18px; height: 18px; }
.btn:hover { background: var(--surface-2); border-color: var(--brand); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: linear-gradient(135deg, var(--brand), color-mix(in srgb, var(--brand) 55%, var(--brand-2))); border-color: transparent; color: #fff; box-shadow: 0 6px 18px color-mix(in srgb, var(--brand) 35%, transparent); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { color: var(--bad); }
.btn.danger:hover { border-color: var(--bad); background: color-mix(in srgb, var(--bad) 10%, transparent); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--surface); }
.btn.sm { padding: 6px 11px; font-size: 13px; border-radius: 8px; }
.btn.lg { padding: 13px 22px; font-size: 15.5px; border-radius: 12px; }
.btn.icon { padding: 8px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

/* ---------- cards & layout ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.card.pad-0 { padding: 0; }
.card h3 { margin: 0 0 14px; font-size: 16px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card-head h3 { margin: 0; }
.grid { display: grid; gap: 18px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head h1 { margin: 0; font-size: 26px; letter-spacing: -.2px; }
.page-head p { margin: 4px 0 0; color: var(--text-2); }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.small { font-size: 12.5px; }
.mono { font-family: Consolas, "Cascadia Mono", monospace; letter-spacing: .5px; }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.stack { display: grid; gap: 12px; }
.hr { height: 1px; background: var(--line); margin: 18px 0; }
.right { margin-inline-start: auto; }

/* ---------- KPI ---------- */
.kpi { position: relative; overflow: hidden; padding: 18px 20px; }
.kpi .k-label { color: var(--text-2); font-size: 13px; display: flex; align-items: center; gap: 8px; }
.kpi .k-label svg { width: 17px; height: 17px; color: var(--brand); }
.kpi .k-val { font-size: 30px; font-weight: 700; margin-top: 6px; letter-spacing: -.5px; }
.kpi .k-sub { color: var(--text-3); font-size: 12.5px; }
.kpi { border-top: 2px solid color-mix(in srgb, var(--brand) 45%, transparent); }

/* ---------- hero ---------- */
.hero {
  position: relative; overflow: hidden; border-radius: 20px; padding: 30px 32px; margin-bottom: 24px; border: 1px solid var(--line);
  background:
    radial-gradient(700px 300px at 85% -20%, color-mix(in srgb, var(--brand-2) 40%, transparent), transparent 60%),
    radial-gradient(600px 300px at 0% 120%, color-mix(in srgb, var(--brand) 35%, transparent), transparent 60%),
    linear-gradient(135deg, #0b1a3a, #0a1430);
  color: #fff;
}
.hero:before { content: ""; position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px); background-size: 34px 34px; mask-image: linear-gradient(180deg, #000, transparent); }
.hero > * { position: relative; }
.hero h1 { margin: 0; font-size: 30px; letter-spacing: -.3px; }
.hero p { margin: 8px 0 0; color: #bcd0f0; max-width: 680px; }
.hero .hero-row { display: flex; gap: 22px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.hero-stats { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 20px; }
.hero-stat { background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.12); border-radius: 12px; padding: 10px 16px; min-width: 120px; backdrop-filter: blur(6px); }
.hero-stat b { display: block; font-size: 22px; }
.hero-stat span { font-size: 12.5px; color: #bcd0f0; }
.hero-visual { width: 150px; height: 150px; flex: none; }

/* ---------- section cards (home) ---------- */
.sections-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 18px; }
.sec-card {
  --c: var(--brand);
  position: relative; display: flex; flex-direction: column; gap: 12px; padding: 20px; border-radius: 18px; cursor: pointer; overflow: hidden; color: var(--text);
  background: linear-gradient(160deg, color-mix(in srgb, var(--c) 14%, var(--surface)), var(--surface) 55%);
  border: 1px solid color-mix(in srgb, var(--c) 22%, var(--line)); transition: transform .18s, box-shadow .18s, border-color .18s; min-height: 200px;
}
.sec-card:hover { transform: translateY(-4px); box-shadow: 0 16px 40px color-mix(in srgb, var(--c) 25%, transparent); border-color: color-mix(in srgb, var(--c) 60%, transparent); }
.sec-card .sec-icon { width: 54px; height: 54px; border-radius: 15px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, var(--c), color-mix(in srgb, var(--c) 55%, #000)); box-shadow: 0 8px 20px color-mix(in srgb, var(--c) 40%, transparent); }
.sec-card .sec-icon svg { width: 28px; height: 28px; }
.sec-card h3 { margin: 0; font-size: 17px; line-height: 1.35; }
.sec-card p { margin: 0; color: var(--text-2); font-size: 13px; flex: 1; }
.sec-card .sec-foot { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-2); }
.sec-card .sec-foot .bar { flex: 1; height: 5px; border-radius: 5px; background: var(--surface-3); overflow: hidden; }
.sec-card .sec-foot .bar span { display: block; height: 100%; background: var(--c); }
.sec-card .sec-num { position: absolute; inset-inline-end: 16px; top: 12px; font-size: 44px; font-weight: 800; opacity: .07; }
.sec-card.locked { filter: saturate(.25); }
.sec-card.locked .sec-num { display: none; }
.sec-card.locked:hover { transform: none; box-shadow: none; }
.sec-card .lock { position: absolute; inset-inline-end: 14px; top: 14px; display: inline-flex; gap: 6px; align-items: center; font-size: 12px; padding: 4px 10px; border-radius: 20px; background: rgba(0,0,0,.45); color: #fff; }
.sec-card .lock svg { width: 14px; height: 14px; }

/* ---------- section banner ---------- */
.banner {
  --c: var(--brand);
  position: relative; overflow: hidden; border-radius: 20px; padding: 28px 30px; margin-bottom: 22px; color: #fff;
  background: radial-gradient(600px 260px at 90% 0%, color-mix(in srgb, var(--c) 70%, transparent), transparent 70%), linear-gradient(135deg, color-mix(in srgb, var(--c) 45%, #071330), #071330 70%);
  border: 1px solid color-mix(in srgb, var(--c) 35%, transparent);
}
.banner .row { gap: 18px; }
.banner .sec-icon { width: 68px; height: 68px; border-radius: 18px; display: grid; place-items: center; background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.2); }
.banner .sec-icon svg { width: 36px; height: 36px; }
.banner h1 { margin: 0; font-size: 26px; }
.banner p { margin: 4px 0 0; color: rgba(255,255,255,.78); }
.banner .pill { background: rgba(255,255,255,.12); color: #fff; border-color: rgba(255,255,255,.2); }

/* ---------- tabs ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 20px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.tabs button { background: none; border: 0; padding: 10px 16px; color: var(--text-2); cursor: pointer; font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs button.active { color: var(--text); border-bottom-color: var(--brand); }
.tabs button .n { font-size: 11.5px; margin-inline-start: 6px; color: var(--text-3); }

/* ---------- library items ---------- */
.lib-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.item {
  --c: var(--brand);
  display: flex; flex-direction: column; border-radius: 16px; overflow: hidden; background: var(--surface); border: 1px solid var(--line); cursor: pointer; transition: transform .15s, border-color .15s, box-shadow .15s; color: var(--text);
}
.item:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--c) 55%, transparent); box-shadow: var(--shadow); }
.item .thumb { position: relative; aspect-ratio: 16 / 9; display: grid; place-items: center; overflow: hidden; background: linear-gradient(135deg, color-mix(in srgb, var(--c) 55%, #08142c), #08142c); }
.item .thumb img { width: 100%; height: 100%; object-fit: cover; }
.item .thumb .glyph { width: 56px; height: 56px; color: rgba(255,255,255,.9); }
.item .thumb .glyph svg { width: 100%; height: 100%; }
.item .thumb:after { content: ""; position: absolute; inset: 0; background-image: radial-gradient(rgba(255,255,255,.18) 1px, transparent 1px); background-size: 14px 14px; opacity: .35; }
.item .thumb .badges { position: absolute; top: 10px; inset-inline-start: 10px; inset-inline-end: 10px; display: flex; gap: 6px; justify-content: space-between; z-index: 1; }
.item .badges .pill { background: rgba(0,0,0,.5); color: #fff; border-color: rgba(255,255,255,.15); backdrop-filter: blur(4px); }
.item .body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.item h4 { margin: 0; font-size: 15px; line-height: 1.4; }
.item .meta { display: flex; gap: 12px; color: var(--text-3); font-size: 12.5px; margin-top: auto; padding-top: 6px; align-items: center; }
.item .meta svg { width: 14px; height: 14px; vertical-align: -2px; margin-inline-end: 3px; }
.item.locked { opacity: .55; }
.done-mark { position: absolute; bottom: 10px; inset-inline-end: 10px; z-index: 1; width: 28px; height: 28px; border-radius: 50%; background: var(--ok); color: #fff; display: grid; place-items: center; }
.done-mark svg { width: 16px; height: 16px; }

/* ---------- list rows ---------- */
.list { display: grid; }
.list-row { display: flex; align-items: center; gap: 14px; padding: 12px 4px; border-bottom: 1px solid var(--line); }
.list-row:last-child { border-bottom: 0; }
.avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; color: #fff; flex: none; background: linear-gradient(135deg, var(--brand), var(--brand-2)); font-size: 14px; }
.ico-tile { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; flex: none; color: #fff; }
.ico-tile svg { width: 21px; height: 21px; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th { text-align: start; font-weight: 600; color: var(--text-3); font-size: 12px; text-transform: uppercase; letter-spacing: .5px; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--surface); position: sticky; top: 0; }
.tbl td { padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:hover td { background: color-mix(in srgb, var(--surface-2) 60%, transparent); }
.tbl td.actions { text-align: end; white-space: nowrap; }

/* ---------- forms ---------- */
.field { display: grid; gap: 6px; }
.field > span { font-size: 13px; color: var(--text-2); font-weight: 600; }
.field small { color: var(--text-3); font-size: 12px; }
.input, select.input, textarea.input {
  width: 100%; padding: 10px 12px; border-radius: 10px; background: var(--bg-2); border: 1px solid var(--line-2); outline: none; transition: border-color .15s, box-shadow .15s;
}
[data-theme="light"] .input { background: #fff; }
.input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 20%, transparent); }
textarea.input { min-height: 90px; resize: vertical; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.form-grid .full { grid-column: 1 / -1; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; }
.check input { width: 17px; height: 17px; accent-color: var(--brand); }
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 8px 14px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg-2); max-height: 260px; overflow: auto; }
.switch { display: inline-block; position: relative; width: 42px; height: 24px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; border-radius: 24px; background: var(--surface-3); transition: .2s; cursor: pointer; }
.switch span:before { content: ""; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px; border-radius: 50%; background: #fff; transition: .2s; }
.switch input:checked + span { background: var(--brand); }
.switch input:checked + span:before { transform: translateX(18px); }

/* ---------- progress ---------- */
.progress { height: 8px; border-radius: 8px; background: var(--surface-3); overflow: hidden; }
.progress > span { display: block; height: 100%; border-radius: 8px; background: linear-gradient(90deg, var(--brand), var(--brand-2)); transition: width .4s; }
.ring { --p: 0; --c: var(--brand); width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--c) calc(var(--p) * 1%), var(--surface-3) 0); flex: none; }
.ring > b { width: 50px; height: 50px; border-radius: 50%; background: var(--surface); display: grid; place-items: center; font-size: 13.5px; }

/* ---------- modal ---------- */
.modal-back { position: fixed; inset: 0; background: rgba(3, 8, 20, .66); backdrop-filter: blur(4px); display: grid; place-items: center; padding: 20px; z-index: 100; animation: fade .15s; }
.modal { width: min(560px, 100%); max-height: calc(100vh - 40px); overflow: auto; background: var(--surface); border: 1px solid var(--line-2); border-radius: 18px; box-shadow: 0 30px 80px rgba(0,0,0,.5); animation: pop .18s; }
.modal.wide { width: min(880px, 100%); }
.modal.xwide { width: min(1100px, 100%); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--surface); z-index: 2; }
.modal-head h3 { margin: 0; font-size: 17px; }
.modal-body { padding: 20px 22px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 22px; border-top: 1px solid var(--line); position: sticky; bottom: 0; background: var(--surface); }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { transform: translateY(10px) scale(.98); opacity: 0; } }

/* ---------- toast ---------- */
#toast-root { position: fixed; bottom: 20px; inset-inline-start: 20px; display: grid; gap: 10px; z-index: 200; }
.toast { min-width: 260px; max-width: 420px; padding: 12px 16px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line-2); box-shadow: var(--shadow); display: flex; gap: 10px; align-items: flex-start; animation: pop .2s; }
.toast.ok { border-inline-start: 4px solid var(--ok); }
.toast.bad { border-inline-start: 4px solid var(--bad); }
.toast.info { border-inline-start: 4px solid var(--info); }

/* ---------- auth ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.auth-art {
  position: relative; overflow: hidden; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; color: #fff;
  background: radial-gradient(800px 500px at 80% 10%, rgba(109,91,255,.55), transparent 60%), radial-gradient(700px 500px at 10% 100%, rgba(0,194,255,.45), transparent 60%), #071330;
}
.auth-art:before { content: ""; position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,.06) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.06) 1px, transparent 1px); background-size: 40px 40px; mask-image: radial-gradient(circle at 50% 40%, #000, transparent 75%); }
.auth-art > * { position: relative; }
.auth-art h1 { font-size: 40px; line-height: 1.2; margin: 0 0 14px; max-width: 520px; }
.auth-art p { color: #c4d4ef; max-width: 480px; font-size: 16px; }
.auth-chips { display: flex; flex-wrap: wrap; gap: 8px; max-width: 560px; }
.auth-chips span { padding: 6px 12px; border-radius: 20px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.15); font-size: 13px; }
.auth-form { display: grid; place-items: center; padding: 40px; background: var(--bg); }
.auth-box { width: min(400px, 100%); display: grid; gap: 16px; }
.auth-box h2 { margin: 0; font-size: 26px; }
.lang-switch { position: absolute; top: 18px; inset-inline-end: 18px; }

/* ---------- experience detail ---------- */
.xp-hero { display: grid; grid-template-columns: 1.25fr 1fr; gap: 22px; margin-bottom: 22px; }
.xp-media { --c: var(--brand); position: relative; border-radius: 18px; overflow: hidden; aspect-ratio: 16 / 9; display: grid; place-items: center; background: radial-gradient(500px 260px at 70% 20%, color-mix(in srgb, var(--c) 70%, transparent), transparent 70%), linear-gradient(135deg, color-mix(in srgb, var(--c) 35%, #061024), #061024); border: 1px solid var(--line); }
.xp-media img { width: 100%; height: 100%; object-fit: cover; }
.xp-media .glyph { width: 110px; height: 110px; color: rgba(255,255,255,.92); }
.xp-media .glyph svg { width: 100%; height: 100%; }
.xp-side h1 { margin: 6px 0 8px; font-size: 26px; line-height: 1.3; }
.facts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 16px 0; }
.fact { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; }
.fact span { display: block; color: var(--text-3); font-size: 12px; }
.fact b { font-size: 15px; }
.launch-box { display: grid; gap: 10px; }

/* live session */
.live-code { font-size: 46px; font-weight: 800; letter-spacing: 10px; text-align: center; padding: 14px; border-radius: 14px; background: var(--bg-2); border: 1px dashed var(--line-2); font-family: Consolas, monospace; }
.live-steps { display: grid; gap: 6px; max-height: 220px; overflow: auto; font-size: 13px; }
.live-steps div { display: flex; gap: 10px; padding: 6px 10px; border-radius: 8px; background: var(--bg-2); }
.pulse { width: 10px; height: 10px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 0 rgba(34,197,94,.6); animation: pulse 1.4s infinite; display: inline-block; }
@keyframes pulse { 70% { box-shadow: 0 0 0 10px rgba(34,197,94,0); } 100% { box-shadow: 0 0 0 0 rgba(34,197,94,0); } }
.score-big { font-size: 54px; font-weight: 800; text-align: center; }

/* players */
.player { background: #000; border-radius: 14px; overflow: hidden; }
.player video, .player iframe, .player canvas { width: 100%; display: block; border: 0; }
.player iframe { height: 75vh; background: #fff; }
.player canvas { aspect-ratio: 16 / 9; cursor: grab; }
.quiz-q { padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--bg-2); margin-bottom: 12px; }
.quiz-q h4 { margin: 0 0 10px; }
.quiz-opt { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); margin-top: 8px; cursor: pointer; background: var(--surface); }
.quiz-opt:hover { border-color: var(--brand); }
.quiz-opt.right { border-color: var(--ok); background: color-mix(in srgb, var(--ok) 12%, var(--surface)); }
.quiz-opt.wrong { border-color: var(--bad); background: color-mix(in srgb, var(--bad) 12%, var(--surface)); }

/* charts */
.chart { width: 100%; height: auto; display: block; }
.chart text { fill: var(--text-3); font-size: 11px; font-family: var(--font); }
.chart .grid-line { stroke: var(--line); }
.hbar { display: grid; grid-template-columns: 170px 1fr 60px; align-items: center; gap: 10px; font-size: 13px; padding: 5px 0; }
.hbar .t { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text-2); }
.hbar .b { height: 10px; border-radius: 10px; background: var(--surface-3); overflow: hidden; }
.hbar .b span { display: block; height: 100%; border-radius: 10px; }
.hbar .v { text-align: end; font-weight: 600; }

/* empty */
.empty { text-align: center; padding: 50px 20px; color: var(--text-3); }
.empty svg { width: 48px; height: 48px; opacity: .5; margin-bottom: 8px; }
.empty h3 { color: var(--text-2); margin: 0 0 6px; }

/* license */
.lic-card { position: relative; overflow: hidden; border-radius: 20px; padding: 26px; color: #fff; background: linear-gradient(135deg, #0d2a5c, #3a2a8c); border: 1px solid rgba(255,255,255,.12); }
.lic-card.bad { background: linear-gradient(135deg, #5c1020, #3a1a4c); }
.lic-card.warn { background: linear-gradient(135deg, #5c3a0d, #3a2a4c); }
.lic-card:after { content: ""; position: absolute; width: 260px; height: 260px; inset-inline-end: -80px; top: -80px; border-radius: 50%; border: 40px solid rgba(255,255,255,.05); }
.lic-card .row b { font-size: 22px; }
.lic-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 18px; }
.lic-grid div span { display: block; font-size: 12px; color: rgba(255,255,255,.65); }
.lic-grid div b { font-size: 15px; }
.banner-alert { display: flex; gap: 12px; align-items: center; padding: 12px 16px; border-radius: 12px; margin-bottom: 18px; border: 1px solid; }
.banner-alert.warn { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 40%, transparent); background: color-mix(in srgb, var(--warn) 10%, transparent); }
.banner-alert.bad { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 40%, transparent); background: color-mix(in srgb, var(--bad) 10%, transparent); }
.banner-alert.info { color: var(--text); border-color: color-mix(in srgb, var(--brand) 35%, transparent); background: color-mix(in srgb, var(--brand) 8%, transparent); }
.banner-alert.info svg { color: var(--brand); flex: none; }
.banner-alert .btn { margin-inline-start: auto; }

/* responsive */
@media (max-width: 1200px) { .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .lic-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 980px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset-block: 0; inset-inline-start: 0; width: 270px; transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow); }
  [dir="rtl"] .sidebar { transform: translateX(100%); }
  .shell.nav-open .sidebar { transform: none; }
  .menu-btn { display: inline-flex; }
  .g3, .g2, .xp-hero { grid-template-columns: 1fr; }
  .auth { grid-template-columns: 1fr; }
  .auth-art { display: none; }
  .content { padding: 18px 16px 50px; }
  .topbar { padding: 10px 16px; }
  .form-grid { grid-template-columns: 1fr; }
  .hbar { grid-template-columns: 110px 1fr 50px; }
}
@media (max-width: 600px) { .g4 { grid-template-columns: 1fr 1fr; } .search { display: none; } .hero { padding: 22px; } .hero h1 { font-size: 23px; } .hero-visual { display: none; } }
@media print { .sidebar, .topbar, .btn { display: none !important; } .shell { display: block; } body { background: #fff; color: #000; } }
