/* ============================================================
   Lisan Arabtilim — Premium Design System
   ============================================================ */
:root{
  --bg:#f7faf8; --surface:#ffffff; --surface-2:#eef4f0; --surface-3:#e3ece7;
  --text:#0f241d; --muted:#5b6f66;
  --emerald:#0f766e; --emerald-dark:#115e59; --emerald-light:#d7f3e8; --emerald-soft:#ecfdf5;
  --gold:#c9a227; --gold-soft:#fef6d8;
  --border:#e2ebe6; --border-strong:#cbdcd3;
  --shadow-sm:0 1px 2px rgba(15,36,29,.06),0 2px 8px rgba(15,36,29,.05);
  --shadow:0 6px 24px rgba(15,36,29,.09),0 2px 6px rgba(15,36,29,.05);
  --shadow-lg:0 18px 48px rgba(15,36,29,.16),0 4px 12px rgba(15,36,29,.08);
  --radius:18px; --radius-sm:12px; --radius-lg:26px;
  --grad:linear-gradient(135deg,#0f766e 0%,#115e59 100%);
  --grad-soft:linear-gradient(135deg,#ecfdf5 0%,#f0fdf9 100%);
  --grad-gold:linear-gradient(135deg,#c9a227,#a87f1a);
  --ease:cubic-bezier(.22,1,.36,1);
}
[data-theme="dark"]{
  --bg:#0b1310; --surface:#131f1a; --surface-2:#1a2721; --surface-3:#223129;
  --text:#e6efe9; --muted:#93a89d;
  --emerald:#34d399; --emerald-dark:#10b981; --emerald-light:#0d3b2e; --emerald-soft:#122a22;
  --gold:#e3c565; --gold-soft:#2a2410;
  --border:#223129; --border-strong:#2f4238;
  --shadow-sm:0 1px 2px rgba(0,0,0,.4);
  --shadow:0 8px 28px rgba(0,0,0,.45);
  --shadow-lg:0 20px 56px rgba(0,0,0,.55);
  --grad:linear-gradient(135deg,#10b981 0%,#0f766e 100%);
  --grad-soft:linear-gradient(135deg,#122a22 0%,#16241d 100%);
  --grad-gold:linear-gradient(135deg,#e3c565,#c9a227);
}
*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}
html{scroll-behavior:smooth;-webkit-text-size-adjust:100%}
body{
  background:var(--bg);color:var(--text);
  font-family:'Inter',system-ui,-apple-system,sans-serif;
  line-height:1.6;transition:background .35s var(--ease),color .35s var(--ease);
  overflow-x:hidden;min-width:0;
}
.ar{font-family:'Amiri','Scheherazade New',serif;direction:rtl;unicode-bidi:embed}
.container{max-width:1200px;margin:0 auto;padding:0 1.25rem;min-width:0}
a{color:var(--emerald);text-decoration:none}
img,svg,video{max-width:100%;height:auto}
code,pre{overflow-wrap:anywhere;word-break:normal}
:focus-visible{outline:2px solid var(--emerald);outline-offset:2px;border-radius:4px}

/* ---------- Icons ---------- */
.icon{width:1.1em;height:1.1em;vertical-align:-.18em;stroke-width:2;display:inline-block;flex-shrink:0}
.icon-lg{width:1.6rem;height:1.6rem;stroke-width:1.75;display:inline-block}
.icon-xl{width:2.4rem;height:2.4rem;stroke-width:1.5;display:inline-block}
.icon-btn .icon{width:1.25rem;height:1.25rem;vertical-align:middle}
.sidebar a .icon{width:1.15rem;height:1.15rem}
.admin-nav a .icon{width:1rem;height:1rem}

/* ---------- Buttons ---------- */
.btn{display:inline-flex;align-items:center;justify-content:center;gap:.5rem;padding:.65rem 1.25rem;border-radius:14px;border:1px solid transparent;font-weight:600;font-size:.92rem;cursor:pointer;transition:transform .25s var(--ease),box-shadow .25s var(--ease),background .25s,color .25s,border-color .25s;font-family:inherit;white-space:normal;text-align:center;max-width:100%;overflow-wrap:anywhere}
.btn:active{transform:scale(.96)}
.btn-primary{background:var(--grad);color:#fff;box-shadow:0 6px 18px rgba(15,118,110,.35)}
.btn-primary:hover{transform:translateY(-2px);box-shadow:0 10px 28px rgba(15,118,110,.42)}
.btn-outline{border-color:var(--border-strong);color:var(--text);background:var(--surface)}
.btn-outline:hover{border-color:var(--emerald);color:var(--emerald);transform:translateY(-2px);box-shadow:var(--shadow-sm)}
.btn-gold{background:var(--grad-gold);color:#3a2f00;box-shadow:0 6px 18px rgba(201,162,39,.35)}
.btn-gold:hover{transform:translateY(-2px)}
.btn-sm{padding:.42rem .85rem;font-size:.85rem;border-radius:11px}
.btn-block{width:100%}
.icon-btn{background:var(--surface);border:1px solid var(--border);border-radius:12px;width:40px;height:40px;cursor:pointer;color:var(--text);display:inline-flex;align-items:center;justify-content:center;transition:all .25s var(--ease)}
.icon-btn:hover{border-color:var(--emerald);color:var(--emerald);transform:translateY(-2px)}

/* ---------- Header ---------- */
.site-header{position:sticky;top:0;z-index:60;background:color-mix(in srgb,var(--surface) 82%,transparent);backdrop-filter:blur(16px) saturate(1.4);-webkit-backdrop-filter:blur(16px) saturate(1.4);border-bottom:1px solid var(--border)}
.header-inner{display:flex;align-items:center;justify-content:space-between;height:66px;gap:.75rem;min-width:0}
.logo{display:flex;align-items:center;gap:.6rem;font-weight:800;font-size:1.12rem;color:var(--text);letter-spacing:-.02em;min-width:0}
.logo span:last-child{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.logo-badge{width:38px;height:38px;border-radius:12px;background:var(--grad);display:flex;align-items:center;justify-content:center;color:#fff;font-family:'Amiri',serif;font-size:1.35rem;box-shadow:0 4px 12px rgba(15,118,110,.4);flex-shrink:0}
.nav{display:flex;gap:1.15rem;align-items:center;min-width:0}
.nav a{color:var(--muted);font-weight:500;font-size:.9rem;position:relative;padding:.25rem 0;transition:color .25s}
.nav a::after{content:"";position:absolute;left:0;bottom:-2px;height:2px;width:0;background:var(--emerald);transition:width .3s var(--ease)}
.nav a:hover{color:var(--emerald)}
.nav a:hover::after{width:100%}
.header-actions{display:flex;gap:.5rem;align-items:center;flex-shrink:0}

/* ---------- Mobile bottom nav ---------- */
.bottom-nav{display:none;position:fixed;bottom:0;left:0;right:0;z-index:70;background:color-mix(in srgb,var(--surface) 92%,transparent);backdrop-filter:blur(18px) saturate(1.4);-webkit-backdrop-filter:blur(18px) saturate(1.4);border-top:1px solid var(--border);padding:.35rem .25rem calc(.35rem + env(safe-area-inset-bottom));grid-template-columns:repeat(4,1fr)}
.bottom-nav a{display:flex;flex-direction:column;align-items:center;gap:.15rem;padding:.35rem .2rem;border-radius:12px;color:var(--muted);font-size:.68rem;font-weight:600;transition:color .2s,background .2s;min-width:0}
.bottom-nav a .icon{width:1.35rem;height:1.35rem}
.bottom-nav a.active,.bottom-nav a:hover{color:var(--emerald);background:var(--emerald-soft)}

/* ---------- Hero ---------- */
.hero{position:relative;padding:4.5rem 0 4rem;text-align:center;overflow:hidden;background:radial-gradient(ellipse 90% 70% at 50% -10%,var(--emerald-light) 0%,transparent 65%)}
.hero::before{content:"";position:absolute;inset:0;background-image:radial-gradient(circle at 1px 1px,var(--border-strong) 1px,transparent 0);background-size:26px 26px;opacity:.5;pointer-events:none;mask-image:radial-gradient(ellipse 80% 70% at 50% 40%,black 30%,transparent 75%);-webkit-mask-image:radial-gradient(ellipse 80% 70% at 50% 40%,black 30%,transparent 75%)}
.hero-inner{position:relative;z-index:1}
.hero-ar{font-size:clamp(1.6rem,5vw,2.4rem);color:var(--emerald);margin-bottom:.75rem;letter-spacing:.02em;animation:fadeUp .9s var(--ease) both}
.hero h1{font-size:clamp(1.9rem,6vw,3.1rem);line-height:1.15;letter-spacing:-.03em;margin-bottom:1.1rem;font-weight:800;animation:fadeUp .9s .12s var(--ease) both;overflow-wrap:anywhere}
.hero h1 .accent{background:var(--grad);-webkit-background-clip:text;background-clip:text;-webkit-text-fill-color:transparent;color:transparent}
.hero p{font-size:clamp(1rem,2.4vw,1.18rem);color:var(--muted);max-width:620px;margin:0 auto 1.6rem;animation:fadeUp .9s .24s var(--ease) both}
.hero-cta{display:flex;gap:.75rem;justify-content:center;flex-wrap:wrap;animation:fadeUp .9s .36s var(--ease) both}
.hero-badge{display:inline-flex;align-items:center;gap:.45rem;padding:.35rem .85rem;border-radius:999px;background:var(--surface);border:1px solid var(--border);font-size:.8rem;font-weight:600;color:var(--emerald-dark);box-shadow:var(--shadow-sm);margin-bottom:1.1rem;animation:fadeUp .9s .05s var(--ease) both}
[data-theme="dark"] .hero-badge{color:var(--emerald)}

/* floating letters */
.float-layer{position:absolute;inset:0;pointer-events:none;z-index:0}
.float-letter{position:absolute;font-family:'Amiri',serif;color:var(--emerald);opacity:.16;user-select:none;animation:floatY 9s ease-in-out infinite;font-weight:700}
[data-theme="dark"] .float-letter{opacity:.22}
@keyframes floatY{0%,100%{transform:translateY(0) rotate(-4deg)}50%{transform:translateY(-34px) rotate(6deg)}}
@keyframes fadeUp{from{opacity:0;transform:translateY(28px)}to{opacity:1;transform:none}}
@keyframes pulseGlow{0%,100%{box-shadow:0 0 0 0 rgba(15,118,110,.35)}50%{box-shadow:0 0 0 8px rgba(15,118,110,0)}}

/* hero stats strip */
.hero-stats{display:flex;gap:1.5rem;justify-content:center;flex-wrap:wrap;margin-top:2rem;animation:fadeUp .9s .48s var(--ease) both}
.hero-stat{text-align:center;min-width:0}
.hero-stat b{display:block;font-size:1.35rem;letter-spacing:-.02em;color:var(--emerald-dark)}
[data-theme="dark"] .hero-stat b{color:var(--emerald)}
.hero-stat span{font-size:.78rem;color:var(--muted);font-weight:500}

/* ---------- Cards ---------- */
.grid{display:grid;gap:1.25rem;min-width:0}
.grid-3{grid-template-columns:repeat(auto-fill,minmax(min(280px,100%),1fr))}
.grid-4{grid-template-columns:repeat(auto-fill,minmax(min(220px,100%),1fr))}
.card{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);padding:1.5rem;box-shadow:var(--shadow-sm);transition:transform .3s var(--ease),box-shadow .3s var(--ease),border-color .3s;min-width:0;overflow-wrap:anywhere}
.card:hover{transform:translateY(-4px);box-shadow:var(--shadow);border-color:var(--border-strong)}
.card h3{margin-bottom:.4rem;letter-spacing:-.01em}
.muted{color:var(--muted)}
.section{padding:3rem 0}
.section-title{font-size:clamp(1.35rem,3.5vw,1.7rem);margin-bottom:1.25rem;letter-spacing:-.02em;font-weight:800;overflow-wrap:anywhere}
.eyebrow{display:inline-flex;align-items:center;gap:.4rem;font-size:.75rem;font-weight:700;letter-spacing:.09em;text-transform:uppercase;color:var(--emerald);margin-bottom:.5rem}

/* ---------- Feature cards (dashboard) ---------- */
.feature-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:.75rem;min-width:0}
@media(min-width:640px){.feature-grid{grid-template-columns:repeat(3,1fr);gap:1rem}}
@media(min-width:1024px){.feature-grid{grid-template-columns:repeat(4,1fr);gap:1.1rem}}
.feature-card{position:relative;display:flex;flex-direction:column;gap:.5rem;padding:1.1rem 1rem;background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);box-shadow:var(--shadow-sm);color:var(--text);overflow:hidden;transition:transform .3s var(--ease),box-shadow .3s var(--ease),border-color .3s;min-width:0;text-align:left;cursor:pointer;font-family:inherit}
.feature-card::before{content:"";position:absolute;top:0;left:0;right:0;height:3px;background:var(--grad);opacity:.85}
.feature-card:hover{transform:translateY(-5px);box-shadow:var(--shadow-lg);border-color:var(--emerald)}
.feature-card:active{transform:scale(.97)}
.feature-icon{width:46px;height:46px;border-radius:13px;display:flex;align-items:center;justify-content:center;background:var(--emerald-soft);color:var(--emerald);flex-shrink:0;transition:transform .3s var(--ease)}
.feature-card:hover .feature-icon{transform:scale(1.12) rotate(-3deg)}
.feature-icon .icon{width:1.4rem;height:1.4rem}
.feature-card h3{font-size:.95rem;margin:0;letter-spacing:-.01em;overflow-wrap:anywhere}
.feature-card p{font-size:.76rem;color:var(--muted);line-height:1.45;margin:0;overflow-wrap:anywhere}
.feature-card .fc-arrow{position:absolute;bottom:.7rem;right:.75rem;color:var(--border-strong);transition:transform .3s var(--ease),color .3s}
.feature-card:hover .fc-arrow{transform:translateX(4px);color:var(--emerald)}
/* accent variants */
.fc-gold::before{background:var(--grad-gold)} .fc-gold .feature-icon{background:var(--gold-soft);color:#a87f1a}
.fc-blue::before{background:linear-gradient(135deg,#2563eb,#1e40af)} .fc-blue .feature-icon{background:#eff6ff;color:#2563eb}
.fc-violet::before{background:linear-gradient(135deg,#7c3aed,#5b21b6)} .fc-violet .feature-icon{background:#f5f3ff;color:#7c3aed}
.fc-rose::before{background:linear-gradient(135deg,#e11d48,#9f1239)} .fc-rose .feature-icon{background:#fff1f2;color:#e11d48}
[data-theme="dark"] .fc-blue .feature-icon{background:#172554;color:#93c5fd}
[data-theme="dark"] .fc-violet .feature-icon{background:#2e1065;color:#c4b5fd}
[data-theme="dark"] .fc-rose .feature-icon{background:#4c0519;color:#fda4af}
[data-theme="dark"] .fc-gold .feature-icon{color:var(--gold)}

/* staggered entrance */
.reveal{opacity:0;transform:translateY(26px);transition:opacity .6s var(--ease),transform .6s var(--ease)}
.reveal.in{opacity:1;transform:none}
.feature-grid .feature-card{opacity:0;transform:translateY(22px);animation:cardIn .55s var(--ease) forwards}
@keyframes cardIn{to{opacity:1;transform:none}}
.feature-grid .feature-card:nth-child(1){animation-delay:.02s}.feature-grid .feature-card:nth-child(2){animation-delay:.06s}
.feature-grid .feature-card:nth-child(3){animation-delay:.10s}.feature-grid .feature-card:nth-child(4){animation-delay:.14s}
.feature-grid .feature-card:nth-child(5){animation-delay:.18s}.feature-grid .feature-card:nth-child(6){animation-delay:.22s}
.feature-grid .feature-card:nth-child(7){animation-delay:.26s}.feature-grid .feature-card:nth-child(8){animation-delay:.30s}
.feature-grid .feature-card:nth-child(9){animation-delay:.34s}.feature-grid .feature-card:nth-child(10){animation-delay:.38s}
.feature-grid .feature-card:nth-child(11){animation-delay:.42s}.feature-grid .feature-card:nth-child(12){animation-delay:.46s}
.feature-grid .feature-card:nth-child(13){animation-delay:.50s}.feature-grid .feature-card:nth-child(14){animation-delay:.54s}

/* ---------- API docs panel ---------- */
.api-panel{position:relative;background:linear-gradient(160deg,#0f241d 0%,#115e59 100%);color:#eafff5;border-radius:var(--radius-lg);padding:1.5rem;overflow:hidden;box-shadow:var(--shadow-lg);border:1px solid rgba(255,255,255,.08);max-width:100%}
.api-panel::after{content:"";position:absolute;width:340px;height:340px;border-radius:50%;background:radial-gradient(circle,rgba(52,211,153,.22),transparent 70%);top:-120px;right:-120px;pointer-events:none}
.api-panel h2,.api-panel h3{color:#fff;letter-spacing:-.02em}
.api-panel .muted{color:#a7d9c6}
.api-chip{display:inline-flex;align-items:center;gap:.4rem;padding:.3rem .7rem;border-radius:8px;background:rgba(255,255,255,.1);border:1px solid rgba(255,255,255,.14);font-size:.75rem;font-weight:600;color:#a7f3d0;font-family:'JetBrains Mono',ui-monospace,monospace}
.code-block{position:relative;background:#07120d;border:1px solid rgba(255,255,255,.1);border-radius:var(--radius-sm);padding:.85rem 1rem;font-family:'JetBrains Mono',ui-monospace,monospace;font-size:.78rem;line-height:1.6;color:#a7f3d0;overflow-x:auto;white-space:pre-wrap;overflow-wrap:anywhere;word-break:break-word;max-width:100%;margin:.5rem 0}
.code-block .cm{color:#5b8a76}
.copy-btn{position:absolute;top:.5rem;right:.5rem;display:inline-flex;align-items:center;gap:.35rem;background:rgba(255,255,255,.08);border:1px solid rgba(255,255,255,.14);color:#d1fae5;border-radius:8px;padding:.3rem .55rem;font-size:.72rem;cursor:pointer;transition:background .2s;font-family:inherit}
.copy-btn:hover{background:rgba(255,255,255,.16)}
.endpoint-row{display:flex;align-items:center;gap:.6rem;padding:.5rem .6rem;border-radius:10px;border:1px solid transparent;transition:background .2s;min-width:0}
.endpoint-row:hover{background:rgba(255,255,255,.06)}
.method{font-family:ui-monospace,monospace;font-size:.68rem;font-weight:700;padding:.2rem .45rem;border-radius:6px;background:#065f46;color:#6ee7b7;flex-shrink:0}
.endpoint-path{font-family:ui-monospace,monospace;font-size:.78rem;color:#eafff5;overflow-wrap:anywhere;min-width:0}

/* ---------- Forms ---------- */
.form{max-width:440px;margin:0 auto;background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-lg);padding:2rem;box-shadow:var(--shadow);min-width:0}
.form h1{font-size:1.5rem;margin-bottom:1rem;letter-spacing:-.02em}
.field{margin-bottom:1rem;min-width:0}
.field label{display:block;font-size:.85rem;font-weight:600;margin-bottom:.35rem}
.field input,.field select,.field textarea{width:100%;padding:.7rem .85rem;border:1px solid var(--border-strong);border-radius:12px;background:var(--bg);color:var(--text);font-size:.95rem;font-family:inherit;transition:border-color .2s,box-shadow .2s;min-width:0}
.field input:focus,.field select:focus,.field textarea:focus{outline:none;border-color:var(--emerald);box-shadow:0 0 0 3px var(--emerald-light)}
.alert{padding:.75rem 1rem;border-radius:12px;margin-bottom:1rem;font-size:.9rem;overflow-wrap:anywhere}
.alert-error{background:#fee2e2;color:#991b1b;border:1px solid #fecaca}
.alert-success{background:#d1fae5;color:#065f46;border:1px solid #a7f3d0}
.alert-info{background:#e0f2fe;color:#075985;border:1px solid #bae6fd}
[data-theme="dark"] .alert-error{background:#450a0a;color:#fecaca;border-color:#7f1d1d}
[data-theme="dark"] .alert-success{background:#052e1f;color:#a7f3d0;border-color:#065f46}
[data-theme="dark"] .alert-info{background:#082f3f;color:#bae6fd;border-color:#075985}

/* ---------- Tables ---------- */
.table-wrap{overflow-x:auto;background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);-webkit-overflow-scrolling:touch}
table{width:100%;border-collapse:collapse;font-size:.9rem}
th,td{padding:.7rem .9rem;text-align:left;border-bottom:1px solid var(--border);overflow-wrap:anywhere}
th{background:var(--surface-2);font-size:.75rem;text-transform:uppercase;letter-spacing:.06em;color:var(--muted)}
tr:last-child td{border-bottom:none}

/* ---------- Badges ---------- */
.badge{display:inline-flex;align-items:center;gap:.3rem;padding:.22rem .65rem;border-radius:999px;font-size:.73rem;font-weight:700;white-space:nowrap}
.badge-green{background:var(--emerald-light);color:var(--emerald-dark)}
.badge-gold{background:var(--gold-soft);color:#92400e}
.badge-gray{background:var(--surface-2);color:var(--muted)}
[data-theme="dark"] .badge-green{color:#6ee7b7}
[data-theme="dark"] .badge-gold{color:var(--gold)}

/* ---------- Progress ---------- */
.progress{height:10px;background:var(--surface-2);border-radius:999px;overflow:hidden}
.progress-bar{height:100%;background:var(--grad);border-radius:999px;transition:width .6s var(--ease)}

/* ---------- Dashboard layout ---------- */
.dash{display:grid;grid-template-columns:1fr;gap:1.25rem;padding:1.5rem 0;min-width:0}
@media(min-width:1024px){.dash{grid-template-columns:250px 1fr;gap:1.5rem}}
.sidebar{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);padding:1rem;height:fit-content;position:sticky;top:84px;box-shadow:var(--shadow-sm);min-width:0}
.sidebar a{display:flex;gap:.6rem;align-items:center;padding:.55rem .7rem;border-radius:11px;color:var(--text);font-size:.9rem;font-weight:500;transition:background .2s,color .2s;min-width:0}
.sidebar a:hover,.sidebar a.active{background:var(--emerald-soft);color:var(--emerald-dark)}
[data-theme="dark"] .sidebar a:hover,[data-theme="dark"] .sidebar a.active{color:var(--emerald)}
.stat-card{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);padding:1.1rem;box-shadow:var(--shadow-sm);min-width:0;transition:transform .3s var(--ease),box-shadow .3s var(--ease)}
.stat-card:hover{transform:translateY(-3px);box-shadow:var(--shadow)}
.stat-num{font-size:clamp(1.3rem,4vw,1.6rem);font-weight:800;color:var(--emerald);letter-spacing:-.02em;overflow-wrap:anywhere}

/* ---------- Arabic letter grid ---------- */
.letter-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(min(150px,100%),1fr));gap:1rem}
.letter-card{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);padding:1rem;text-align:center;transition:transform .3s var(--ease),box-shadow .3s var(--ease)}
.letter-card:hover{transform:translateY(-4px);box-shadow:var(--shadow)}
.letter-big{font-size:3rem;font-family:'Amiri',serif;color:var(--emerald-dark)}
[data-theme="dark"] .letter-big{color:var(--emerald)}
.letter-forms{display:flex;justify-content:center;gap:.5rem;font-size:1.3rem;font-family:'Amiri',serif;color:var(--muted);margin:.4rem 0;flex-wrap:wrap}

/* ---------- Footer ---------- */
.site-footer{border-top:1px solid var(--border);padding:2.5rem 0 6rem;margin-top:3rem;color:var(--muted);font-size:.88rem;background:var(--surface)}
@media(min-width:1024px){.site-footer{padding-bottom:2.5rem}}
.footer-grid{display:flex;justify-content:space-between;gap:2rem;flex-wrap:wrap;min-width:0}
.footer-grid a{color:var(--muted)} .footer-grid a:hover{color:var(--emerald)}

/* ---------- Admin ---------- */
.admin-nav{display:flex;gap:.4rem;flex-wrap:wrap;margin-bottom:1.25rem}
.admin-nav a{display:inline-flex;align-items:center;gap:.35rem;padding:.42rem .75rem;border-radius:10px;background:var(--surface-2);color:var(--text);font-size:.82rem;font-weight:600;transition:all .2s;white-space:nowrap}
.admin-nav a:hover{background:var(--surface-3)}
.admin-nav a.active{background:var(--grad);color:#fff}

/* ---------- Chat ---------- */
.chat-box{display:flex;flex-direction:column;height:60vh;background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);overflow:hidden;box-shadow:var(--shadow-sm)}
.chat-messages{flex:1;overflow-y:auto;padding:1rem;display:flex;flex-direction:column;gap:.75rem}
.msg{max-width:78%;padding:.6rem .9rem;border-radius:16px;font-size:.95rem;white-space:pre-wrap;overflow-wrap:anywhere}
.msg-user{align-self:flex-end;background:var(--grad);color:#fff;border-bottom-right-radius:4px}
.msg-ai{align-self:flex-start;background:var(--surface-2);border-bottom-left-radius:4px}
.chat-input{display:flex;gap:.5rem;padding:.75rem;border-top:1px solid var(--border)}
.chat-input input{flex:1;padding:.65rem .8rem;border:1px solid var(--border-strong);border-radius:12px;background:var(--bg);color:var(--text);min-width:0}

/* ---------- Flashcard ---------- */
.flashcard{max-width:420px;margin:0 auto;background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-lg);padding:2.5rem 1.5rem;text-align:center;box-shadow:var(--shadow);min-height:280px;display:flex;flex-direction:column;justify-content:center;gap:.75rem}
.flashcard .word{font-size:clamp(2rem,9vw,3rem);font-family:'Amiri',serif;color:var(--emerald-dark);overflow-wrap:anywhere}
[data-theme="dark"] .flashcard .word{color:var(--emerald)}

/* ---------- Loader ---------- */
.lisan-loader{position:fixed;inset:0;z-index:100;background:var(--bg);display:flex;flex-direction:column;align-items:center;justify-content:center;gap:1rem;transition:opacity .4s var(--ease),visibility .4s;animation:loaderAutoHide .6s 2.5s forwards}
@keyframes loaderAutoHide{to{opacity:0;visibility:hidden;pointer-events:none}}
.lisan-loader.done{opacity:0;visibility:hidden;pointer-events:none}
.loader-badge{width:72px;height:72px;border-radius:20px;background:var(--grad);display:flex;align-items:center;justify-content:center;color:#fff;font-family:'Amiri',serif;font-size:2.4rem;animation:loaderPulse 1.4s var(--ease) infinite;box-shadow:0 12px 40px rgba(15,118,110,.4)}
@keyframes loaderPulse{0%,100%{transform:scale(1)}50%{transform:scale(1.12)}}
.loader-bar{width:120px;height:3px;border-radius:999px;background:var(--surface-2);overflow:hidden}
.loader-bar::after{content:"";display:block;height:100%;width:40%;background:var(--grad);border-radius:999px;animation:loaderSlide 1.2s var(--ease) infinite}
@keyframes loaderSlide{0%{transform:translateX(-100%)}100%{transform:translateX(320%)}}

/* ---------- Page transition ---------- */
.page-fade{animation:pageFade .45s var(--ease) both}
@keyframes pageFade{from{opacity:0;transform:translateY(10px)}to{opacity:1;transform:none}}

/* ---------- Responsive ---------- */
@media(max-width:1023px){
  .nav{display:none}
  .bottom-nav{display:grid}
  .sidebar{position:static;order:2}
  .dash{padding-bottom:1rem}
}
@media(max-width:640px){
  .container{padding:0 .9rem}
  .section{padding:2rem 0}
  .hero{padding:3rem 0 2.5rem}
  .header-inner{height:58px}
  .logo{font-size:1rem}
  .logo-badge{width:34px;height:34px;font-size:1.15rem}
  .header-actions .btn-outline{display:none}
  .card{padding:1.15rem}
  .form{padding:1.5rem 1.25rem}
  .hero-stats{gap:1rem}
}
@media(max-width:380px){
  .feature-grid{gap:.55rem}
  .feature-card{padding:.85rem .75rem}
  .feature-card p{font-size:.72rem}
  .feature-icon{width:40px;height:40px}
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce){
  *,*::before,*::after{animation-duration:.01ms !important;animation-iteration-count:1 !important;transition-duration:.01ms !important;scroll-behavior:auto !important}
  .reveal{opacity:1;transform:none}
  .feature-grid .feature-card{opacity:1;transform:none;animation:none}
}

/* ---------- Hero: Islamic geometric pattern + 3D book ---------- */
.hero-pattern{position:absolute;inset:0;pointer-events:none;opacity:.55;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='96' height='96'%3E%3Cpath fill='none' stroke='%230f766e' stroke-opacity='.18' stroke-width='1.4' d='M48 4l38 22v44L48 92 10 70V26z'/%3E%3Cpath fill='none' stroke='%230f766e' stroke-opacity='.13' stroke-width='1.2' d='M48 22l22 13v26L48 74 26 61V35z'/%3E%3Ccircle cx='48' cy='48' r='3.4' fill='%230f766e' fill-opacity='.16'/%3E%3C/svg%3E");background-size:96px 96px;mask-image:radial-gradient(ellipse 90% 80% at 50% 20%,#000 30%,transparent 75%);-webkit-mask-image:radial-gradient(ellipse 90% 80% at 50% 20%,#000 30%,transparent 75%)}
[data-theme="dark"] .hero-pattern{opacity:.35}
.hero-book{position:relative;width:150px;height:110px;margin:0 auto 1.4rem;animation:fadeUp .9s .02s var(--ease) both,bookBob 6s 1s ease-in-out infinite;filter:drop-shadow(0 22px 30px rgba(15,118,110,.35))}
@keyframes bookBob{0%,100%{transform:translateY(0) rotate(-2deg)}50%{transform:translateY(-16px) rotate(2.5deg)}}
.book-cover{position:absolute;inset:0;border-radius:10px 16px 16px 10px;background:linear-gradient(150deg,#14b8a6 0%,#0f766e 55%,#115e59 100%);border:1px solid rgba(255,255,255,.35);display:flex;flex-direction:column;align-items:center;justify-content:center;gap:.15rem;color:#fff}
.book-cover .book-ar{font-family:'Amiri',serif;font-size:2rem;line-height:1}
.book-cover .book-sub{font-size:.55rem;letter-spacing:.22em;text-transform:uppercase;opacity:.85}
.book-spine{position:absolute;left:0;top:0;bottom:0;width:14px;border-radius:10px 0 0 10px;background:linear-gradient(180deg,#115e59,#0b3f3a)}
.book-pages{position:absolute;right:-6px;top:6px;bottom:6px;width:8px;border-radius:0 4px 4px 0;background:repeating-linear-gradient(180deg,#fff 0 3px,#e8e4d8 3px 4px)}
@media(max-width:640px){.hero-book{width:120px;height:88px}.book-cover .book-ar{font-size:1.6rem}}
