/* ==========================================================================
   Aether blade — واجهة الداشبورد
   ========================================================================== */
:root {
    --bg-0: #070914;
    --bg-1: #0b0e1c;
    --bg-2: #121631;
    --card: #0d1122;
    --card-hover: #131835;
    --card-border: #1f2646;
    --line: #171d38;
    --gold: #6b9bff;            /* اللون الأساسي (الاسم القديم محفوظ لتوافق القوالب) */
    --gold-soft: #a9c3ff;
    --accent-ink: #060a1c;
    --blurple: #5865f2;
    --violet: #9a7bff;
    --text: #e8ecfa;
    --text-dim: #8d95b6;
    --danger: #f2616f;
    --success: #38c98d;
    --warn: #f2b84b;
    --radius: 12px;
    --sidebar: 264px;
    --font: 'IBM Plex Sans Arabic', 'Tajawal', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.65;
    background: var(--bg-0);
    color: var(--text);
    min-height: 100vh;
    direction: rtl;
    -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
::selection { background: rgba(107, 155, 255, .3); }
* { scrollbar-width: thin; scrollbar-color: #262e52 transparent; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #262e52; border-radius: 8px; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.glow-bg { display: none; }

.ico { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- الأزرار ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 40px; padding: 9px 18px;
    border-radius: 10px; border: 1px solid transparent;
    font-family: inherit; font-weight: 600; font-size: .94rem; line-height: 1.2;
    cursor: pointer; transition: background .15s, border-color .15s, transform .1s, opacity .15s;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-gold { background: var(--gold); color: var(--accent-ink); }
.btn-gold:hover { background: var(--gold-soft); }
.btn-blurple { background: var(--blurple); color: #fff; }
.btn-blurple:hover { background: #6a76f5; }
.btn-danger { background: rgba(242, 97, 111, .1); color: var(--danger); border-color: rgba(242, 97, 111, .28); }
.btn-danger:hover { background: rgba(242, 97, 111, .18); }
.btn-ghost, .btn:not(.btn-gold):not(.btn-blurple):not(.btn-danger) { background: var(--bg-2); color: var(--text); border-color: var(--card-border); }
.btn-ghost:hover, .btn:not(.btn-gold):not(.btn-blurple):not(.btn-danger):hover { border-color: #353c4d; background: #1b2029; }
.btn-sm { min-height: 32px; padding: 5px 12px; font-size: .84rem; border-radius: 8px; }
.icon-delete { background: transparent; border: 0; color: var(--text-dim); cursor: pointer; width: 36px; height: 36px; border-radius: 8px; font-size: 1.2rem; line-height: 1; }
.icon-delete:hover { background: rgba(242, 97, 111, .12); color: var(--danger); }

/* ---------- صفحة الدخول ---------- */
.landing-body { overflow-x: hidden; background: var(--bg-0) radial-gradient(circle at 1px 1px, #1a1f2a 1px, transparent 0) 0 0 / 28px 28px; }
.site-nav { max-width: 1120px; margin: 0 auto; padding: 22px 24px; display: flex; align-items: center; justify-content: space-between; }
.wordmark { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.08rem; letter-spacing: .2px; }
.wordmark .logo { width: 34px; height: 34px; }
.hero { max-width: 1120px; margin: 0 auto; padding: 56px 24px 40px; display: grid; grid-template-columns: 1.05fr .95fr; gap: 56px; align-items: center; }
.hero h1 { font-size: clamp(2rem, 4.2vw, 3.2rem); line-height: 1.25; margin: 0 0 16px; font-weight: 700; letter-spacing: -.3px; }
.hero p.lead { color: var(--text-dim); font-size: 1.08rem; max-width: 520px; margin: 0 0 28px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.hero-actions .btn-gold { min-height: 46px; padding: 11px 24px; font-size: 1rem; }
.hero-note { color: var(--text-dim); font-size: .85rem; margin-top: 14px; display: flex; align-items: center; gap: 8px; }
.mock { background: var(--card); border: 1px solid var(--card-border); border-radius: 16px; overflow: hidden; box-shadow: 0 30px 60px -30px rgba(0,0,0,.7); direction: rtl; }
.mock-bar { display: flex; align-items: center; gap: 6px; padding: 12px 14px; border-bottom: 1px solid var(--line); background: var(--bg-1); }
.mock-bar i { width: 9px; height: 9px; border-radius: 50%; background: #2c3342; }
.mock-bar span { margin-right: auto; color: var(--text-dim); font-size: .78rem; }
.mock-body { display: grid; grid-template-columns: 150px 1fr; min-height: 280px; }
.mock-side { border-left: 1px solid var(--line); padding: 14px 10px; display: flex; flex-direction: column; gap: 6px; background: var(--bg-1); }
.mock-side b { height: 28px; border-radius: 8px; background: var(--bg-2); display: flex; align-items: center; padding: 0 10px; font-size: .74rem; font-weight: 500; color: var(--text-dim); }
.mock-side b.on { background: rgba(107, 155, 255, .12); color: var(--gold-soft); }
.mock-main { padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.mock-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg-1); font-size: .85rem; }
.mock-row small { display: block; color: var(--text-dim); font-size: .72rem; }
.switch { width: 34px; height: 20px; border-radius: 20px; background: #262e52; position: relative; flex: none; }
.switch::after { content: ""; position: absolute; top: 3px; right: 3px; width: 14px; height: 14px; border-radius: 50%; background: #9aa3b5; transition: .2s; }
.switch.on { background: var(--gold); }
.switch.on::after { right: 17px; background: #fff; }
.features { max-width: 1120px; margin: 0 auto; padding: 24px 24px 72px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.feature { border: 1px solid var(--card-border); background: var(--card); border-radius: 14px; padding: 22px; }
.feature .ico { width: 22px; height: 22px; color: var(--gold); margin-bottom: 14px; }
.feature h2 { margin: 0 0 6px; font-size: 1rem; font-weight: 600; line-height: 1.5; }
.feature p { margin: 0; color: var(--text-dim); font-size: .9rem; }
.site-footer { border-top: 1px solid var(--line); padding: 22px 24px; text-align: center; color: var(--text-dim); font-size: .82rem; }
@media (max-width: 900px) {
    .hero { grid-template-columns: 1fr; gap: 36px; padding-top: 28px; }
    .features { grid-template-columns: 1fr; }
    .mock-body { grid-template-columns: 110px 1fr; }
}

/* ---------- اختيار السيرفر ---------- */
.page { position: relative; max-width: 1100px; margin: 0 auto; padding: 36px 24px 56px; }
.picker-page { max-width: 1120px; }
.page-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 28px; flex-wrap: wrap; }
.page-title { font-size: 1.5rem; font-weight: 700; margin: 0; }
.page-intro { margin-bottom: 22px; }
.page-intro p { color: var(--text-dim); margin: 4px 0 0; }
.user-chip { display: flex; align-items: center; gap: 10px; }
.user-chip img { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--card-border); }
.user-chip span { font-size: .9rem; }
.search-box { position: relative; margin-bottom: 18px; }
.search-box input { padding-right: 40px; }
.search-box .ico { position: absolute; right: 13px; top: 50%; transform: translateY(-50%); color: var(--text-dim); pointer-events: none; }
.guild-grid, .premium-guild-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.guild-card { display: flex; align-items: center; gap: 14px; background: var(--card); border: 1px solid var(--card-border); border-radius: 14px; padding: 16px; transition: border-color .15s, background .15s; }
.guild-card:hover { border-color: #38405a; background: var(--card-hover); }
.guild-card img, .guild-card .fallback-icon { width: 52px; height: 52px; border-radius: 14px; flex: none; }
.guild-card .fallback-icon { display: grid; place-items: center; background: var(--bg-2); border: 1px solid var(--card-border); font-weight: 700; font-size: 1.15rem; color: var(--gold-soft); }
.guild-card .name { font-weight: 600; margin-bottom: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.guild-card .meta { color: var(--text-dim); font-size: .84rem; }
.guild-card .go { margin-right: auto; color: var(--text-dim); }
.guild-card-top { display: none; }
.empty-state { text-align: center; color: var(--text-dim); padding: 56px 20px; background: var(--card); border: 1px dashed var(--card-border); border-radius: 14px; }
.empty-state strong { display: block; color: var(--text); margin-bottom: 6px; font-size: 1.05rem; }
.eyebrow { color: var(--gold); font-size: .78rem; font-weight: 600; letter-spacing: .3px; margin-bottom: 4px; }

/* ---------- هيكل اللوحة ---------- */
.dashboard-layout { position: relative; display: flex; min-height: 100vh; }
.sidebar {
    width: var(--sidebar); flex-shrink: 0; background: var(--bg-1); border-left: 1px solid var(--line);
    padding: 16px 12px; display: flex; flex-direction: column; gap: 4px;
    position: sticky; top: 0; height: 100vh; align-self: flex-start;
}
.brand-mini { display: flex; align-items: center; gap: 10px; padding: 4px 8px 14px; }
.brand-mark { width: 34px; height: 34px; flex: none; display: grid; place-items: center; }
.brand-mini strong { display: block; font-size: 1rem; font-weight: 700; line-height: 1.2; }
.brand-mini small { display: block; color: var(--text-dim); font-size: .72rem; }
.sidebar .guild-name { display: flex; align-items: center; gap: 10px; padding: 10px; border: 1px solid var(--line); background: var(--bg-0); border-radius: 12px; margin-bottom: 12px; }
.sidebar .guild-name img, .guild-fallback { width: 34px; height: 34px; border-radius: 10px; flex: none; }
.guild-fallback { display: grid; place-items: center; background: var(--bg-2); border: 1px solid var(--card-border); font-weight: 700; color: var(--gold-soft); }
.sidebar .guild-name strong { display: block; font-size: .92rem; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 150px; }
.sidebar .guild-name small { color: var(--text-dim); font-size: .76rem; }
.nav-scroll { flex: 1; overflow-y: auto; margin: 0 -4px; padding: 0 4px 8px; }
.nav-group { margin-bottom: 14px; }
.nav-group-title { font-size: .72rem; color: var(--text-dim); font-weight: 600; padding: 0 10px 6px; letter-spacing: .2px; }
.nav-item { position: relative; display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: 9px; color: var(--text-dim); font-weight: 500; font-size: .92rem; transition: background .12s, color .12s; }
.nav-item span { display: grid; place-items: center; width: 20px; flex: none; font-size: 1rem; }
.nav-item em { font-style: normal; }
.nav-item:hover { background: rgba(255, 255, 255, .04); color: var(--text); }
.nav-item.active { background: rgba(107, 155, 255, .1); color: var(--gold-soft); font-weight: 600; }
.nav-item.active::before { content: ""; position: absolute; right: -12px; top: 8px; bottom: 8px; width: 3px; border-radius: 3px; background: var(--gold); }
.sidebar .back-link { display: flex; align-items: center; gap: 10px; color: var(--text-dim); padding: 10px; border-top: 1px solid var(--line); margin-top: 6px; font-size: .9rem; }
.sidebar .back-link:hover { color: var(--text); }
.content { flex: 1; min-width: 0; padding: 0 40px 56px; max-width: 1120px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 18px 0; margin-bottom: 14px; border-bottom: 1px solid var(--line); }
.topbar-breadcrumb { display: flex; align-items: center; gap: 8px; color: var(--text-dim); font-size: .9rem; }
.topbar-breadcrumb b { opacity: .4; font-weight: 400; }
.topbar-breadcrumb strong { color: var(--text); font-weight: 600; }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.topbar-title { font-weight: 600; }
.logout-link { color: var(--text-dim); font-size: .88rem; padding: 6px 10px; border-radius: 8px; }
.logout-link:hover { background: rgba(255, 255, 255, .05); color: var(--text); }
.online-pill { display: none; }
.mobile-back { display: none; }

.tab-title { font-size: 1.45rem; font-weight: 700; margin: 8px 0 4px; }
.tab-desc { color: var(--text-dim); margin: 0 0 24px; max-width: 760px; }

/* ---------- بطاقات ونماذج ---------- */
.card { background: var(--card); border: 1px solid var(--card-border); border-radius: 14px; padding: 22px; margin-bottom: 16px; }
.card h3 { margin: 0 0 14px; font-size: 1.02rem; font-weight: 600; }
.card-title-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.card-title-row h3 { margin: 0; }
.info-card { border-color: rgba(107, 155, 255, .25); background: rgba(107, 155, 255, .05); }
.hint-box { margin-top: 12px; padding: 12px 14px; border-radius: 10px; background: rgba(107, 155, 255, .06); border: 1px solid rgba(107, 155, 255, .18); color: var(--text-dim); font-size: .88rem; }
.field { margin-bottom: 16px; }
.field label { display: block; margin-bottom: 6px; font-size: .86rem; color: var(--text-dim); font-weight: 500; }
.field-help, .field small, small { color: var(--text-dim); font-size: .8rem; }
.muted-inline { color: var(--text-dim); font-size: .85rem; }
input[type=text], input[type=number], input[type=password], input[type=url], input[type=search], select, textarea {
    width: 100%; min-height: 42px; padding: 9px 13px; border-radius: 10px;
    border: 1px solid var(--card-border); background: var(--bg-2); color: var(--text);
    font-family: inherit; font-size: .94rem; transition: border-color .15s, box-shadow .15s;
}
select { appearance: none; padding-left: 34px; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path d='M1 1.5l5 5 5-5' fill='none' stroke='%238e96a7' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/></svg>"); background-repeat: no-repeat; background-position: left 13px center; }
select[multiple] { background-image: none; padding-left: 13px; min-height: 120px; }
input[type=color] { width: 100%; height: 42px; padding: 3px; border-radius: 10px; border: 1px solid var(--card-border); background: var(--bg-2); cursor: pointer; }
input[type=range] { width: 100%; accent-color: var(--gold); }
input[type=checkbox], input[type=radio] { accent-color: var(--gold); width: 16px; height: 16px; }
textarea { resize: vertical; min-height: 84px; line-height: 1.6; }
input::placeholder, textarea::placeholder { color: var(--placeholder); }
input:hover, select:hover, textarea:hover { border-color: #2c365e; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(107, 155, 255, .16); }
code { background: var(--bg-2); border: 1px solid var(--line); padding: 1px 6px; border-radius: 6px; font-size: .86em; direction: ltr; unicode-bidi: embed; }
.row { display: flex; gap: 14px; flex-wrap: wrap; }
.row > .field { flex: 1; min-width: 170px; }
.color-row { display: flex; gap: 8px; }
.color-row input[type=color] { width: 44px; height: 42px; padding: 3px; }
.publish-big { width: 100%; min-height: 48px; font-size: 1rem; }
.media-upload-inline { margin: 10px 0; padding: 12px; border: 1px dashed var(--card-border); border-radius: 12px; background: rgba(255, 255, 255, .015); }
.media-upload-title { font-weight: 600; margin-bottom: 8px; }
.upload-status { color: var(--text-dim); font-size: .8rem; margin-top: 6px; }

/* ---------- جداول وقوائم ---------- */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: right; padding: 11px 10px; border-bottom: 1px solid var(--line); font-size: .9rem; }
th { color: var(--text-dim); font-weight: 600; font-size: .82rem; }
tr:last-child td { border-bottom: 0; }
.pill, .mini-tag, .builder-badge, .live-indicator { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px; background: rgba(107, 155, 255, .1); color: var(--gold-soft); font-size: .76rem; font-weight: 600; border: 1px solid rgba(107, 155, 255, .2); }
.live-indicator { background: rgba(56, 201, 141, .1); color: var(--success); border-color: rgba(56, 201, 141, .25); }
.badge-danger { color: var(--danger); }
.badge-success { color: var(--success); }
.status-chip { display: inline-flex; align-items: center; gap: 7px; padding: 3px 11px; border-radius: 999px; background: var(--bg-2); border: 1px solid var(--card-border); font-size: .8rem; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--text-dim); display: inline-block; }
.status-dot.on, .status-dot.ok { background: var(--success); }
.status-dot.off, .status-dot.err { background: var(--danger); }
.data-list { display: flex; flex-direction: column; }
.data-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 4px; border-bottom: 1px solid var(--line); }
.data-row:last-child { border-bottom: 0; }

/* ---------- الرئيسية ---------- */
.dashboard-hero { padding: 6px 0 18px; }
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat-card { background: var(--card); border: 1px solid var(--card-border); border-radius: 14px; padding: 16px; display: flex; align-items: center; gap: 13px; }
.stat-icon { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; background: var(--bg-2); border: 1px solid var(--line); font-size: 1.1rem; flex: none; }
.stat-value { font-size: 1.4rem; font-weight: 700; line-height: 1.2; }
.stat-label { color: var(--text-dim); font-size: .82rem; }
.quick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.quick-card { display: block; background: var(--card); border: 1px solid var(--card-border); border-radius: 14px; padding: 16px; transition: border-color .15s, background .15s; }
.quick-card:hover { border-color: #38405a; background: var(--card-hover); }
.leaderboard-promo { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }

/* ---------- المنشئ والمعاينة ---------- */
.builder-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.builder-layout { display: grid; grid-template-columns: 1.3fr 1fr; gap: 20px; align-items: start; }
.builder-card { margin-bottom: 16px; }
.builder-item { border: 1px solid var(--card-border); border-radius: 12px; padding: 14px; margin-bottom: 10px; background: rgba(255, 255, 255, .015); }
.builder-item-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; gap: 8px; }
.workflow-button-card { border: 1px solid var(--card-border); border-radius: 12px; padding: 14px; margin-bottom: 10px; background: rgba(255, 255, 255, .015); }
.preview-sticky { position: sticky; top: 20px; }
.preview-label { display: flex; justify-content: space-between; margin-bottom: 10px; color: var(--text-dim); font-size: .76rem; font-weight: 600; }
.discord-preview { background: #313338; border: 1px solid var(--card-border); border-radius: 12px; padding: 16px; color: #dbdee1; }
.discord-preview-user { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; font-weight: 600; }
.preview-avatar { width: 40px; height: 40px; flex: none; border-radius: 50%; font-size: 0; color: transparent; overflow: hidden;
    background: #05050f url("../img/bot-avatar.png") center / cover no-repeat; }
.embed-preview { border-right: 4px solid var(--blurple); background: #2b2d31; border-radius: 8px; padding: 12px 14px; }
.preview-title { font-weight: 700; color: #fff; margin-bottom: 6px; }
.preview-desc { font-size: .9rem; white-space: pre-wrap; }
.preview-fields { display: grid; gap: 8px; margin-top: 8px; }
.preview-image { width: 100%; border-radius: 6px; margin-top: 10px; }
.preview-thumb { width: 64px; height: 64px; border-radius: 6px; object-fit: cover; float: left; margin-right: 10px; }
.preview-footer { font-size: .76rem; opacity: .7; margin-top: 10px; }
.preview-buttons { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.pv-btn { padding: 6px 14px; border-radius: 6px; font-size: .82rem; color: #fff; background: #4e5058; }
.pv-primary { background: #5865f2; }
.pv-success { background: #248046; }
.pv-danger { background: #da373c; }
.pv-link { background: #4e5058; }
.role-picker-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; max-height: 320px; overflow: auto; padding: 4px; }
.role-check { display: flex; align-items: center; gap: 8px; padding: 9px 11px; border: 1px solid var(--card-border); border-radius: 10px; background: var(--bg-2); cursor: pointer; font-size: .9rem; }
.role-check:hover { border-color: #38405a; }

/* ---------- الأوامر والسجل ---------- */
.command-toolbar { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.command-search { flex: 1; min-width: 200px; display: flex; gap: 8px; align-items: center; }
.command-filters { display: flex; gap: 6px; flex-wrap: wrap; }
.filter-chip { background: var(--bg-2); border: 1px solid var(--card-border); color: var(--text-dim); border-radius: 999px; padding: 5px 14px; cursor: pointer; font-family: inherit; font-size: .84rem; }
.filter-chip:hover { color: var(--text); }
.filter-chip.active { background: rgba(107, 155, 255, .12); border-color: rgba(107, 155, 255, .35); color: var(--gold-soft); }
.command-meta { display: flex; justify-content: space-between; color: var(--text-dim); font-size: .82rem; margin: 10px 2px; }
.command-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 12px; }
.command-card { background: var(--card); border: 1px solid var(--card-border); border-radius: 12px; padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.command-card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.command-kind { font-size: .72rem; color: var(--text-dim); }
.command-footer { display: flex; align-items: center; justify-content: space-between; margin-top: auto; }
.command-toggle { cursor: pointer; }
.audit-list { display: flex; flex-direction: column; }
.audit-item { display: flex; align-items: center; gap: 12px; padding: 12px 4px; border-bottom: 1px solid var(--line); }
.audit-item:last-child { border-bottom: 0; }
.audit-icon { width: 34px; height: 34px; border-radius: 10px; background: var(--bg-2); border: 1px solid var(--line); display: grid; place-items: center; flex: none; }
.audit-main { flex: 1; min-width: 0; }

/* ---------- التنبيهات ---------- */
.toast {
    position: fixed; bottom: 22px; right: 50%; transform: translate(50%, 12px);
    max-width: min(92vw, 460px); background: #1b2029; border: 1px solid var(--card-border);
    padding: 12px 18px; border-radius: 12px; font-weight: 500; z-index: 80;
    opacity: 0; transition: opacity .2s, transform .2s; pointer-events: none; box-shadow: 0 16px 40px -12px rgba(0, 0, 0, .7);
}
.toast.show { opacity: 1; transform: translate(50%, 0); }
.toast.ok { border-color: rgba(56, 201, 141, .4); }
.toast.ok::before { content: "✓ "; color: var(--success); font-weight: 700; }
.toast.err { border-color: rgba(242, 97, 111, .45); }
.toast.err::before { content: "! "; color: var(--danger); font-weight: 700; }

/* ---------- صفحة الخطأ ---------- */
.error-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; text-align: center; }
.error-box { max-width: 420px; }
.error-code { font-size: 4.2rem; font-weight: 700; color: var(--gold); line-height: 1; margin-bottom: 8px; font-feature-settings: "tnum"; }
.error-box h1 { margin: 0 0 8px; font-size: 1.3rem; }
.error-box p { color: var(--text-dim); margin: 0 0 22px; }
.error-box p.error-ref { margin: -10px 0 22px; font-size: .85rem; }

/* ---------- الجوال (المنطق محفوظ: القائمة جزء عادي من الصفحة) ---------- */
.mobile-shellbar { display: none; position: sticky; top: 0; z-index: 40; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; background: rgba(7, 9, 20, .94); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.mobile-menu-btn { background: var(--bg-2); border: 1px solid var(--card-border); width: 40px; height: 40px; border-radius: 10px; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; flex: none; padding: 0; }
.mobile-menu-btn span { display: block; width: 17px; height: 2px; border-radius: 2px; background: var(--text); }
.mobile-brand { display: flex; align-items: center; gap: 8px; font-weight: 700; }
.mobile-brand .brand-mark { width: 26px; height: 26px; }
.mobile-guild { color: var(--gold-soft); font-size: .84rem; max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mobile-nav-backdrop { display: none; }
.mobile-close-nav { display: none; background: transparent; border: 0; color: var(--text-dim); font-size: 1.4rem; cursor: pointer; margin-right: auto; }

@media (max-width: 1000px) {
    .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .content { padding: 0 24px 48px; }
}
@media (max-width: 900px) {
    .builder-layout { grid-template-columns: 1fr; }
    .preview-sticky { position: static; }
}
@media (max-width: 800px) {
    .tab-title { margin-top: 0; }
}
@media (max-width: 520px) {
    .stats-grid { gap: 8px; }
    .stat-card { padding: 12px; }
    .stat-icon { width: 34px; height: 34px; }
    .card { padding: 16px; }
    .row > .field { min-width: 100%; }
    .page { padding: 24px 14px 40px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ==========================================================================
   الوضع الفاتح + المبدّل + البحث العام + شريط الحفظ
   ========================================================================== */
html[data-theme="light"] {
    color-scheme: light;
    --bg-0: #f3f5f9; --bg-1: #ffffff; --bg-2: #eceff5;
    --card: #ffffff; --card-hover: #f7f9fc; --card-border: #dbe0ea; --line: #e5e9f0;
    --gold: #2468cc; --gold-soft: #1a5db8; --accent-ink: #ffffff;
    --violet: #4f5fe0; --text: #161a25; --text-dim: #5a6476;
    --danger: #d23a4a; --success: #117a56; --warn: #9a5f04;
}
html[data-theme="dark"] { color-scheme: dark; }
html[data-theme="light"] * { scrollbar-color: #c3cad8 transparent; }
html[data-theme="light"] ::-webkit-scrollbar-thumb { background: #c3cad8; }
html[data-theme="light"] ::selection { background: rgba(43, 120, 228, .22); }
html[data-theme="light"] input::placeholder, html[data-theme="light"] textarea::placeholder { color: var(--placeholder); }
html[data-theme="light"] input:hover, html[data-theme="light"] select:hover, html[data-theme="light"] textarea:hover { border-color: #bcc5d6; }
html[data-theme="light"] .btn-ghost:hover, html[data-theme="light"] .btn:not(.btn-gold):not(.btn-blurple):not(.btn-danger):hover { border-color: #b3bdd0; background: #e4e9f1; }
html[data-theme="light"] .nav-item:hover, html[data-theme="light"] .logout-link:hover { background: rgba(0, 0, 0, .045); }
html[data-theme="light"] .nav-item.active { background: rgba(43, 120, 228, .1); }
html[data-theme="light"] .guild-card:hover, html[data-theme="light"] .quick-card:hover, html[data-theme="light"] .role-check:hover { border-color: #aebad0; }
html[data-theme="light"] .builder-item, html[data-theme="light"] .workflow-button-card, html[data-theme="light"] .media-upload-inline { background: rgba(0, 0, 0, .018); }
html[data-theme="light"] .switch { background: #cbd2df; }
html[data-theme="light"] .switch::after { background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); }
html[data-theme="light"] .mock-bar i { background: #cdd4e1; }
html[data-theme="light"] .mock { box-shadow: 0 24px 50px -30px rgba(30, 50, 90, .35); }
html[data-theme="light"] .landing-body { background: var(--bg-0) radial-gradient(circle at 1px 1px, #dde3ee 1px, transparent 0) 0 0 / 28px 28px; }
html[data-theme="light"] .mobile-shellbar { background: rgba(255, 255, 255, .94); }
html[data-theme="light"] .toast { background: #fff; box-shadow: 0 14px 36px -14px rgba(30, 50, 90, .35); }

@media (prefers-reduced-motion: no-preference) {
    html.theme-anim, html.theme-anim *, html.theme-anim *::before, html.theme-anim *::after {
        transition: background-color .38s ease, color .38s ease, border-color .38s ease, fill .38s ease, stroke .38s ease, box-shadow .38s ease !important;
    }
}

/* مبدّل الوضع: شمس / قمر مع مؤشر ينزلق */
.theme-toggle { position: relative; display: inline-flex; gap: 0; padding: 3px; border-radius: 999px; background: var(--bg-2); border: 1px solid var(--card-border); flex: none; }
.theme-toggle button { position: relative; z-index: 1; width: 30px; height: 28px; display: grid; place-items: center; border: 0; background: transparent; color: var(--text-dim); border-radius: 999px; cursor: pointer; transition: color .25s; padding: 0; }
.theme-toggle button svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.theme-toggle .tt-thumb { position: absolute; top: 3px; right: 3px; width: 30px; height: 28px; border-radius: 999px; background: var(--card); border: 1px solid var(--card-border); box-shadow: 0 2px 8px -2px rgba(0, 0, 0, .35); transition: transform .38s cubic-bezier(.45, .1, .2, 1); }
html[data-theme="dark"] .theme-toggle .tt-thumb { transform: translateX(-30px); }
html[data-theme="light"] .theme-toggle [data-theme-set="light"] { color: #d98a00; }
html[data-theme="dark"] .theme-toggle [data-theme-set="dark"] { color: var(--gold-soft); }
.theme-toggle button:focus-visible { outline-offset: 0; }

/* زر البحث */
.search-btn { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 6px 12px; border-radius: 10px; background: var(--bg-2); border: 1px solid var(--card-border); color: var(--text-dim); font-family: inherit; font-size: .86rem; cursor: pointer; transition: border-color .15s, color .15s; }
.search-btn:hover { border-color: var(--gold); color: var(--text); }
.search-btn kbd { font-family: inherit; font-size: .72rem; padding: 1px 6px; border-radius: 6px; border: 1px solid var(--card-border); background: var(--card); direction: ltr; }
.search-btn-icon { display: none; width: 40px; height: 40px; padding: 0; justify-content: center; }

/* نافذة البحث العام */
.cmdk-backdrop { position: fixed; inset: 0; z-index: 90; background: rgba(8, 10, 16, .55); backdrop-filter: blur(3px); display: flex; justify-content: center; align-items: flex-start; padding: 12vh 14px 14px; opacity: 0; pointer-events: none; transition: opacity .2s; }
.cmdk-backdrop.open { opacity: 1; pointer-events: auto; }
.cmdk { width: min(560px, 100%); max-height: 70vh; display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--card-border); border-radius: 16px; box-shadow: 0 30px 70px -20px rgba(0, 0, 0, .55); overflow: hidden; transform: translateY(-8px) scale(.98); transition: transform .22s cubic-bezier(.3, .8, .3, 1); }
.cmdk-backdrop.open .cmdk { transform: none; }
.cmdk-input { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.cmdk-input input { flex: 1; min-width: 0; border: 0; background: transparent; box-shadow: none !important; padding: 0; font-size: 1rem; color: var(--text); font-family: inherit; }
.cmdk-input input:focus { outline: none; box-shadow: none; }
.cmdk-list { overflow-y: auto; padding: 8px; }
.cmdk-group { padding: 8px 10px 4px; font-size: .74rem; color: var(--text-dim); font-weight: 600; }
.cmdk-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border: 0; border-radius: 10px; background: transparent; color: var(--text); font-family: inherit; font-size: .94rem; text-align: right; cursor: pointer; }
.cmdk-item small { margin-right: auto; color: var(--text-dim); font-size: .78rem; }
.cmdk-item.sel { background: rgba(107, 155, 255, .14); color: var(--gold-soft); }
.cmdk-empty { padding: 26px 12px; text-align: center; color: var(--text-dim); }
.flash-target { animation: flashTarget 1.4s ease; }
@keyframes flashTarget { 0%, 60% { box-shadow: 0 0 0 3px var(--gold); } 100% { box-shadow: 0 0 0 3px transparent; } }

/* شريط الحفظ */
.savebar { position: fixed; z-index: 70; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); right: 50%; transform: translate(50%, 24px); width: min(560px, calc(100vw - 24px)); display: flex; align-items: center; gap: 12px; padding: 10px 12px 10px 14px; background: var(--card); border: 1px solid var(--card-border); border-radius: 14px; box-shadow: 0 18px 44px -14px rgba(0, 0, 0, .55); opacity: 0; pointer-events: none; transition: opacity .25s, transform .3s cubic-bezier(.3, .8, .3, 1); }
.savebar.show { opacity: 1; transform: translate(50%, 0); pointer-events: auto; }
.savebar .sb-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--warn); flex: none; }
.savebar .sb-text { flex: 1; min-width: 0; font-weight: 500; font-size: .92rem; }
.savebar .btn { min-height: 36px; padding: 6px 14px; }
body.has-savebar .toast { bottom: 90px; }
body.has-savebar .content { padding-bottom: 110px; }
[data-key].is-dirty:not([type="checkbox"]) { border-color: var(--warn); }

@media (max-width: 800px) {
    .search-btn-label { display: none; }
    .search-btn-icon { display: inline-flex; }
    .mobile-shellbar .theme-toggle { margin-inline-start: auto; }
}

/* ===== نظام الحفظ: حالات الشريط، شارة القسم، نافذة المغادرة ===== */
.savebar .sb-text { background: transparent; border: 0; color: inherit; font-family: inherit; text-align: right; cursor: pointer; padding: 0; line-height: 1.5; }
.savebar[data-state="saving"] .sb-dot { background: var(--gold); animation: sbPulse 1s ease-in-out infinite; }
.savebar[data-state="ok"] .sb-dot { background: var(--success); }
.savebar[data-state="ok"] .sb-text { color: var(--success); font-weight: 700; }
.savebar[data-state="error"] { border-color: var(--danger); }
.savebar[data-state="error"] .sb-dot { background: var(--danger); }
.savebar[data-state="error"] .sb-text { color: var(--danger); }
@keyframes sbPulse { 50% { opacity: .3; transform: scale(.8); } }
.savebar .btn[hidden] { display: none; }
.card.has-dirty { border-color: var(--warn); }
.card.has-dirty h3:first-of-type::after { content: "غير محفوظ"; margin-inline-start: 10px; padding: 2px 9px; border-radius: 999px; font-size: .68rem; font-weight: 600; vertical-align: middle; color: var(--warn); border: 1px solid var(--warn); background: transparent; }
.sheet-backdrop { position: fixed; inset: 0; z-index: 95; background: rgba(8, 10, 16, .55); backdrop-filter: blur(3px); display: flex; align-items: flex-end; justify-content: center; padding: 14px; opacity: 0; pointer-events: none; transition: opacity .2s; }
.sheet-backdrop.open { opacity: 1; pointer-events: auto; }
.sheet { width: min(460px, 100%); background: var(--card); border: 1px solid var(--card-border); border-radius: 18px; padding: 18px; box-shadow: 0 30px 70px -20px rgba(0, 0, 0, .55); transform: translateY(18px); transition: transform .25s cubic-bezier(.3, .8, .3, 1); }
.sheet-backdrop.open .sheet { transform: none; }
.sheet h4 { margin: 0 0 6px; font-size: 1.05rem; }
.sheet .sheet-list { margin: 0 0 14px; color: var(--text-dim); font-size: .9rem; }
.sheet-actions { display: grid; gap: 8px; }
.sheet-actions .btn { width: 100%; justify-content: center; }

/* ===== اللغة الإنجليزية: اتجاه اللوحة LTR (زر التبديل يبقى كما هو) ===== */
html[lang="en"] body { direction: ltr; }
html[lang="en"] .theme-toggle { direction: rtl; }


/* ==========================================================================
   زر إضافة البوت (أيقونة بدون خلفية + إضاءة خفيفة + شعاع)
   ========================================================================== */
.invite-btn {
    position: relative; display: inline-flex; align-items: center; gap: 12px;
    padding: 7px 22px 7px 16px; border-radius: 999px; isolation: isolate; overflow: hidden;
    color: #eaf2ff; font-weight: 600; font-size: .92rem; line-height: 1.2; letter-spacing: .01em;
    background: linear-gradient(180deg, rgba(22, 28, 48, .94), rgba(10, 13, 26, .96));
    border: 1px solid rgba(107, 155, 255, .34);
    box-shadow: inset 0 0 0 1px rgba(141, 155, 255, .07), 0 6px 24px rgba(70, 100, 255, .22);
    transition: transform .22s ease, box-shadow .28s ease, border-color .28s ease;
}
.invite-btn:hover { transform: translateY(-2px); border-color: rgba(164, 208, 255, .6);
    box-shadow: inset 0 0 0 1px rgba(164, 208, 255, .12), 0 10px 32px rgba(90, 120, 255, .38); }
.invite-btn:active { transform: translateY(0); }
.invite-btn img { position: relative; z-index: 1; width: 34px; height: auto; flex: none;
    filter: drop-shadow(0 0 7px rgba(108, 150, 255, .8)); }
.invite-glow { position: absolute; z-index: 0; inset-inline-start: 4px; top: 50%; width: 52px; height: 52px; margin-top: -26px;
    background: radial-gradient(circle, rgba(108, 150, 255, .42), transparent 68%); }
.invite-text { position: relative; z-index: 1; }
@keyframes inviteFloat { 50% { transform: translateY(-2px); } }
.invite-slot { margin-top: 20px; }

/* قسم الصفحة الرئيسية */
.invite-hero { position: relative; max-width: 1120px; margin: 0 auto 56px; padding: 40px 32px; overflow: hidden;
    display: flex; align-items: center; justify-content: center; gap: 36px; text-align: right;
    border-radius: 22px; border: 1px solid rgba(107, 155, 255, .26);
    background: radial-gradient(ellipse at 18% 50%, rgba(88, 101, 242, .22), transparent 60%), linear-gradient(180deg, #11152a, #0b0e1b);
    box-shadow: 0 18px 60px rgba(40, 60, 200, .18), inset 0 1px 0 rgba(164, 208, 255, .08); }
.invite-orb { position: relative; flex: none; width: 150px; display: grid; place-items: center; }
.invite-orb img { position: relative; z-index: 1; width: 132px; height: auto;
    filter: drop-shadow(0 0 18px rgba(108, 150, 255, .75)); animation: inviteFloat 4.4s ease-in-out infinite; }
.invite-rays { position: absolute; width: 190px; height: 190px; border-radius: 50%;
    background: conic-gradient(from 0deg, transparent 0 20%, rgba(108, 160, 255, .26) 28%, transparent 36% 64%, rgba(141, 155, 255, .2) 72%, transparent 80%);
    -webkit-mask: radial-gradient(circle, transparent 28%, #000 30%, #000 62%, transparent 70%);
    mask: radial-gradient(circle, transparent 28%, #000 30%, #000 62%, transparent 70%); animation: inviteSpin 14s linear infinite; }
@keyframes inviteSpin { to { transform: rotate(360deg); } }
.invite-copy { position: relative; z-index: 1; }
.invite-copy h2 { margin: 0 0 6px; font-size: 1.55rem; color: #f2f6ff; }
.invite-copy p { margin: 0 0 18px; color: #9aa6c4; max-width: 420px; }
@media (max-width: 700px) {
    .invite-hero { flex-direction: column; text-align: center; padding: 32px 20px; margin: 0 16px 40px; gap: 20px; }
    .invite-copy p { margin-inline: auto; }
}

/* ==========================================================================
   زر التفعيل الموحّد (Aether Switch) + صفوف الإعدادات
   المقاسات ثابتة بالبكسل: المسار 46×26، الكرة 20، الحشوة 3 → المسافة 20px
   رمادي = متوقف · أزرق = مفعّل · منطقة اللمس 44px بدون تغيير الحجم الظاهر
   ========================================================================== */
:root { --sw-off: #3a4150; --sw-on: #3d8bff; --sw-on-glow: rgba(61, 139, 255, .38); }
html[data-theme="light"] { --sw-off: #c5ccd9; --sw-on: #2b78e4; --sw-on-glow: rgba(43, 120, 228, .30); }

.ab-switch { position: relative; display: inline-flex; align-items: center; flex: none; width: 46px; height: 26px; cursor: pointer; vertical-align: middle; -webkit-tap-highlight-color: transparent; user-select: none; }
.ab-switch::after { content: ""; position: absolute; inset: -9px -6px; }                 /* تكبير منطقة اللمس */
.ab-switch input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; z-index: 1; }
.ab-switch-track { position: relative; width: 46px; height: 26px; border-radius: 13px; background: var(--sw-off); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .06); transition: background .2s ease, box-shadow .2s ease; }
.ab-switch-thumb { position: absolute; top: 3px; inset-inline-start: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .35); transition: transform .22s cubic-bezier(.3, .9, .3, 1.1); display: grid; place-items: center; }
.ab-switch-thumb::after { content: ""; width: 6px; height: 6px; background: var(--sw-on); transform: rotate(45deg) scale(0); transition: transform .2s ease; border-radius: 1px; }   /* ◆ هوية Aether */
.ab-switch input:checked + .ab-switch-track { background: var(--sw-on); box-shadow: 0 0 0 1px rgba(255, 255, 255, .08) inset, 0 0 14px var(--sw-on-glow); }
.ab-switch input:checked + .ab-switch-track .ab-switch-thumb { transform: translateX(20px); }
html[dir="rtl"] .ab-switch input:checked + .ab-switch-track .ab-switch-thumb { transform: translateX(-20px); }
.ab-switch input:checked + .ab-switch-track .ab-switch-thumb::after { transform: rotate(45deg) scale(1); }
.ab-switch input:active + .ab-switch-track .ab-switch-thumb { width: 24px; }
.ab-switch input:checked:active + .ab-switch-track .ab-switch-thumb { margin-inline-start: -4px; }
.ab-switch input:focus-visible + .ab-switch-track { outline: 2px solid var(--sw-on); outline-offset: 3px; }
.ab-switch input:disabled { cursor: not-allowed; }
.ab-switch input:disabled + .ab-switch-track { opacity: .5; }
.ab-switch input.is-dirty + .ab-switch-track { box-shadow: 0 0 0 2px rgba(255, 190, 70, .55); }

.ab-state { font-size: .8rem; font-weight: 600; min-width: 44px; color: var(--text-dim); }
.ab-state.on { color: var(--sw-on); }

.ab-item { border: 1px solid var(--card-border); border-radius: 12px; background: var(--bg-1); margin-bottom: 10px; overflow: hidden; transition: border-color .15s; }
.ab-item:hover { border-color: #323a4c; }
html[data-theme="light"] .ab-item:hover { border-color: #b8c1d3; }
.ab-item.is-on { border-color: rgba(61, 139, 255, .45); }
.ab-row { display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 12px 16px; }
.ab-info { flex: 1; min-width: 0; }
.ab-title { font-weight: 600; font-size: .95rem; line-height: 1.4; }
.ab-desc { color: var(--text-dim); font-size: .82rem; margin-top: 2px; line-height: 1.5; }
.ab-gear { flex: none; width: 36px; height: 36px; display: grid; place-items: center; padding: 0; border-radius: 10px; border: 1px solid var(--card-border); background: var(--bg-2); color: var(--text-dim); cursor: pointer; transition: color .15s, border-color .15s, background .15s; }
.ab-gear:hover { color: var(--text); border-color: #353c4d; }
.ab-gear svg { width: 18px; height: 18px; transition: transform .3s ease; }
.ab-gear[aria-expanded="true"] { color: var(--sw-on); border-color: var(--sw-on); }
.ab-gear[aria-expanded="true"] svg { transform: rotate(60deg); }
.ab-panel { padding: 4px 16px 16px; border-top: 1px dashed var(--card-border); background: rgba(255, 255, 255, .012); }
.ab-panel[hidden] { display: none; }
.ab-panel .row { margin-top: 12px; }
.ab-panel .field { margin-bottom: 4px; }
.ab-inline { display: flex; align-items: center; gap: 12px; padding: 12px 0 0; }
.ab-inline > span { flex: 1; font-size: .9rem; }
.ab-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.ab-picker { display: flex; gap: 8px; align-items: stretch; margin-top: 12px; }
.ab-picker select { flex: 1; }
@media (max-width: 560px) { .ab-row { padding: 12px; gap: 10px; } .ab-state { display: none; } }


/* ==========================================================================
   طبقة الهوية الجديدة — Aether Orbit
   فكرة التصميم: مدار رفيع ونجمة رباعية (من شعار البوت) فوق خلفية حبر داكنة.
   الجديد هنا يعتمد على المتغيّرات، فيعمل في الوضع الداكن والفاتح معاً.
   لا تغيير في أسماء الكلاسات: القوالب الحالية تعمل كما هي.
   ========================================================================== */
:root {
    --orbit: rgba(107, 155, 255, .10);
    --glint: rgba(170, 195, 255, .07);
    --grad-main: linear-gradient(135deg, #6b9bff 0%, #8d7bff 100%);
    --ring-soft: rgba(107, 155, 255, .35);
    --orbit-art: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='460' height='300' viewBox='0 0 460 300' fill='none'%3E%3Cellipse cx='230' cy='150' rx='205' ry='62' transform='rotate(-24 230 150)' stroke='rgba(120,160,255,.30)' stroke-width='1.2'/%3E%3Cellipse cx='230' cy='150' rx='150' ry='44' transform='rotate(-24 230 150)' stroke='rgba(150,130,255,.22)' stroke-width='1'/%3E%3Ccircle cx='230' cy='150' r='66' stroke='rgba(120,160,255,.16)'/%3E%3Cpath d='M230 112 C230 138 242 150 268 150 C242 150 230 162 230 188 C230 162 218 150 192 150 C218 150 230 138 230 112Z' fill='rgba(170,195,255,.55)'/%3E%3Cpath d='M64 70l4 10 10 4-10 4-4 10-4-10-10-4 10-4z' fill='rgba(170,195,255,.5)'/%3E%3Cpath d='M392 218l3 7 7 3-7 3-3 7-3-7-7-3 7-3z' fill='rgba(170,195,255,.4)'/%3E%3C/svg%3E");
}
html[data-theme="light"] {
    --orbit: rgba(43, 120, 228, .12);
    --glint: rgba(255, 255, 255, .9);
    --grad-main: linear-gradient(135deg, #2468cc 0%, #5a63e0 100%);
    --ring-soft: rgba(43, 120, 228, .35);
}

body { letter-spacing: 0; font-feature-settings: "tnum" 1; }
h1, h2, h3, .tab-title, .page-title { text-wrap: balance; }

/* ---------- خلفية المدار (سطح المكتب فقط) ---------- */
@media (min-width: 901px) {
    .dashboard-layout::before {
        content: ""; position: fixed; z-index: 0; pointer-events: none;
        width: 760px; height: 760px; top: -380px; inset-inline-end: -220px; border-radius: 50%;
        border: 1px solid var(--orbit);
        background: radial-gradient(circle at 50% 62%, rgba(107, 155, 255, .07), transparent 62%);
        box-shadow: 0 0 0 90px rgba(107, 155, 255, .012), 0 0 0 91px var(--orbit);
    }
    .sidebar { z-index: 2; }
    .content { position: relative; z-index: 1; }
}

/* ---------- القائمة الجانبية ---------- */
.sidebar { --sidebar: 252px; background: var(--bg-1); border-left: 1px solid var(--line); padding: 14px 12px; }
.brand-mini { padding: 4px 8px 16px; }
.brand-mini strong { font-size: .98rem; letter-spacing: .01em; }
.sidebar .guild-name { border-radius: 14px; background: linear-gradient(180deg, var(--bg-2), var(--bg-0)); border-color: var(--card-border); padding: 10px 12px; }
.sidebar .guild-name img, .guild-fallback { border-radius: 11px; box-shadow: 0 0 0 1px var(--card-border), 0 0 0 4px rgba(107, 155, 255, .08); }
.nav-group { margin-bottom: 16px; }
.nav-group-title { display: flex; align-items: center; gap: 10px; padding: 0 10px 7px; font-size: .74rem; font-weight: 600; color: var(--text-dim); }
.nav-group-title::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.nav-item { padding: 8px 12px; border-radius: 10px; font-size: .91rem; }
.nav-item:hover { background: rgba(130, 160, 255, .06); }
.nav-item.active {
    background: linear-gradient(270deg, rgba(107, 155, 255, .16), rgba(107, 155, 255, .02));
    color: var(--text); font-weight: 600;
}
html[data-theme="light"] .nav-item.active { background: linear-gradient(270deg, rgba(43, 120, 228, .14), rgba(43, 120, 228, .02)); }
.nav-item.active .ico { color: var(--gold); }
/* العلامة: نجمة رباعية بدل الشريط */
.nav-item.active::before {
    content: ""; right: -4px; top: 50%; bottom: auto; width: 10px; height: 10px; margin-top: -5px; border-radius: 0;
    background: var(--gold); box-shadow: none;
    clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%);
    filter: drop-shadow(0 0 4px var(--ring-soft));
}
.sidebar .back-link { border-radius: 10px; }
.sidebar .back-link:hover { background: rgba(130, 160, 255, .06); }

/* ---------- الشريط العلوي ---------- */
.topbar {
    position: sticky; top: 0; z-index: 30; margin: 0 -40px 20px; padding: 12px 40px;
    background: color-mix(in srgb, var(--bg-0) 82%, transparent);
    -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--line);
}
.topbar-breadcrumb strong { font-weight: 600; }
.search-btn { min-width: 250px; justify-content: flex-start; min-height: 38px; border-radius: 11px; background: var(--bg-1); }
.search-btn kbd { margin-inline-start: auto; }
.search-btn-icon { min-width: 0; }
.user-chip img { box-shadow: 0 0 0 2px var(--bg-0), 0 0 0 3px var(--card-border); }

/* ---------- العناوين ---------- */
.tab-title { font-size: 1.7rem; font-weight: 700; line-height: 1.3; margin: 6px 0 6px; letter-spacing: -.01em; }
.tab-desc { font-size: .96rem; line-height: 1.75; margin-bottom: 26px; }
.eyebrow { text-transform: none; letter-spacing: 0; }

/* ---------- البطاقات ---------- */
.card, .stat-card, .quick-card, .guild-card, .command-card, .feature, .feature-card {
    background-image: linear-gradient(180deg, var(--glint), transparent 46%);
    box-shadow: inset 0 1px 0 var(--glint);
}
.card { border-radius: 16px; padding: 24px; }
.card h3 { font-size: 1.04rem; letter-spacing: -.005em; }
.card-title-row { padding-bottom: 12px; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.quick-card:hover, .guild-card:hover, .command-card:hover { border-color: var(--ring-soft); background-color: var(--card-hover); }

/* ---------- الأزرار والحقول ---------- */
.btn { border-radius: 11px; }
.btn-gold { background: var(--grad-main); color: var(--accent-ink); border-color: transparent; box-shadow: 0 6px 18px -8px rgba(107, 155, 255, .55); }
.btn-gold:hover { background: var(--grad-main); filter: brightness(1.08); }
html[data-theme="light"] .btn-gold { color: #fff; box-shadow: 0 6px 16px -8px rgba(43, 120, 228, .5); }
input[type=text], input[type=number], input[type=password], input[type=url], input[type=search], select, textarea { background: var(--bg-0); border-radius: 11px; }
html[data-theme="light"] input[type=text], html[data-theme="light"] input[type=number], html[data-theme="light"] input[type=password],
html[data-theme="light"] input[type=url], html[data-theme="light"] input[type=search], html[data-theme="light"] select, html[data-theme="light"] textarea { background: #fff; }
.field label { font-weight: 600; color: var(--text); opacity: .82; }

/* ---------- الجداول ---------- */
th { padding-block: 10px; background: color-mix(in srgb, var(--bg-2) 70%, transparent); }
th:first-child { border-start-start-radius: 10px; } th:last-child { border-start-end-radius: 10px; }
tbody tr:hover td { background: rgba(130, 160, 255, .035); }

/* ---------- الصفحة الرئيسية ---------- */
.premium-hero {
    position: relative; display: flex; align-items: center; justify-content: space-between; gap: 24px; overflow: hidden;
    padding: 30px 32px; margin: 4px 0 18px; border: 1px solid var(--card-border); border-radius: 20px;
    background:
        var(--orbit-art) no-repeat left 70px bottom -30px / 440px auto,
        radial-gradient(ellipse at 12% 40%, rgba(107, 155, 255, .13), transparent 60%),
        linear-gradient(180deg, var(--bg-2), var(--card));
}
@media (min-width: 701px) { html[data-theme="light"] .premium-hero { background: var(--orbit-art) no-repeat left 70px bottom -30px / 440px auto, radial-gradient(ellipse at 12% 40%, rgba(43, 120, 228, .10), transparent 60%), linear-gradient(180deg, #fff, #f1f5fc); } }
html[data-theme="light"] .premium-hero { background-color: #fff; }
.premium-hero .hero-copy { position: relative; max-width: 560px; }
.premium-hero .tab-title { font-size: 1.85rem; margin-top: 0; }
.premium-hero .tab-desc { margin-bottom: 20px; }
.hero-status {
    position: relative; display: inline-flex; flex-direction: column; gap: 2px; align-items: flex-start; align-self: flex-start; flex: none; padding-inline-end: 34px;
    padding: 12px 16px; border-radius: 14px; background: color-mix(in srgb, var(--bg-0) 70%, transparent); border: 1px solid var(--card-border);
    -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.hero-status b { font-size: .92rem; }
.hero-status small { color: var(--text-dim); font-size: .78rem; }
.hero-status .status-dot { position: absolute; top: 14px; inset-inline-end: 14px; width: 8px; height: 8px; background: var(--success); box-shadow: 0 0 0 3px rgba(56, 201, 141, .18); }
@media (max-width: 700px) { .premium-hero { flex-direction: column; align-items: flex-start; padding: 22px 20px; background-position: left -210px top -50px, 0 0, 0 0; background-size: 400px auto, auto, auto; } .hero-status { align-self: stretch; } .stat-card { padding: 14px; gap: 10px; } .stat-icon { width: 36px; height: 36px; } .stat-value { font-size: 1.5rem; } }

.stats-grid { gap: 14px; }
.stat-card { padding: 18px; border-radius: 16px; align-items: flex-start; }
.stat-icon { width: 42px; height: 42px; border-radius: 12px; background: linear-gradient(180deg, var(--bg-2), var(--bg-1)); }
.stat-value { font-size: 1.75rem; font-weight: 700; letter-spacing: -.02em; line-height: 1.15; }
.stat-label { font-size: .84rem; margin-bottom: 2px; }
.stat-foot { display: block; margin-top: 2px; }

.section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 26px 0 12px; }
.section-heading h2 { margin: 0; font-size: 1.1rem; font-weight: 700; }
.quick-card { display: flex; align-items: center; gap: 14px; padding: 16px 18px; border-radius: 16px; }
.quick-card > span { width: 42px; height: 42px; flex: none; display: grid; place-items: center; border-radius: 12px; font-size: 1.15rem; background: linear-gradient(180deg, var(--bg-2), var(--bg-1)); border: 1px solid var(--line); }
.quick-card strong { display: block; font-size: .97rem; margin-bottom: 1px; }
.quick-card small { color: var(--text-dim); font-size: .8rem; line-height: 1.5; }
.quick-card > b { margin-inline-start: auto; color: var(--text-dim); font-weight: 400; }
.quick-card:hover > b { color: var(--gold); }
.split-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; margin-top: 18px; }
.feature-card { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 0; }
.feature-icon { width: 38px; height: 38px; flex: none; display: grid; place-items: center; border-radius: 11px; background: var(--bg-2); border: 1px solid var(--line); }
.feature-card h3 { margin-bottom: 4px; font-size: .98rem; }
.feature-card p { margin: 0; color: var(--text-dim); font-size: .88rem; line-height: 1.7; }

/* ---------- اختيار السيرفر وصفحة الدخول ---------- */
.guild-card { border-radius: 16px; padding: 16px 18px; }
.guild-card img, .guild-card .fallback-icon { border-radius: 14px; box-shadow: 0 0 0 1px var(--card-border), 0 0 0 4px rgba(107, 155, 255, .07); }
.hero h1 { letter-spacing: -.02em; }
.mock { border-radius: 18px; }
.landing-body { background-image: radial-gradient(circle at 1px 1px, rgba(120, 150, 255, .10) 1px, transparent 0), radial-gradient(ellipse at 80% 0%, rgba(107, 155, 255, .10), transparent 55%); background-size: 28px 28px, auto; }

/* ---------- تفاصيل أخيرة ---------- */
.pill, .mini-tag, .builder-badge { background: rgba(107, 155, 255, .10); border-color: rgba(107, 155, 255, .24); }
.toast { background: var(--card); box-shadow: 0 16px 40px -12px rgba(0, 0, 0, .6); }
html[data-theme="light"] .toast { background: #fff; }
::selection { background: rgba(107, 155, 255, .32); }
@media (max-width: 900px) {
    .topbar { position: static; margin: 0 0 16px; padding: 14px 0; background: transparent; -webkit-backdrop-filter: none; backdrop-filter: none; }
    .tab-title { font-size: 1.45rem; }
    .search-btn { min-width: 0; }
}

/* ==========================================================================
   القائمة الجانبية: مجموعات قابلة للطيّ · مفضلة · وضع الأيقونات · مسار التنقل
   ========================================================================== */
.skip-link { position: absolute; inset-inline-start: 12px; top: -64px; z-index: 200; padding: 10px 16px; border-radius: 10px; background: var(--gold); color: var(--accent-ink); font-weight: 700; }
.skip-link:focus { top: 10px; }
#mainContent:focus { outline: none; }

button.nav-group-title { width: 100%; background: none; border: 0; border-radius: 8px; font-family: inherit; text-align: start; cursor: pointer; }
button.nav-group-title:hover { color: var(--text); }
.nav-group-title::after { order: 1; }
.nav-chev { order: 2; width: 14px; height: 14px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform .2s ease; }
.nav-group.collapsed .nav-chev { transform: rotate(90deg); }
html[lang="en"] .nav-group.collapsed .nav-chev { transform: rotate(-90deg); }

.nav-items { display: grid; grid-template-rows: 1fr; transition: grid-template-rows .22s ease; }
.nav-items-inner { min-height: 0; overflow: hidden; padding: 2px 6px; margin: -2px -6px; }
.nav-group.collapsed .nav-items { grid-template-rows: 0fr; }
.nav-group.collapsed .nav-items-inner { visibility: hidden; transition: visibility 0s linear .22s; }

.nav-row { position: relative; }
.nav-pin { position: absolute; inset-inline-end: 6px; top: 50%; width: 28px; height: 28px; margin-top: -14px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 8px; background: none; color: var(--text-dim); cursor: pointer; opacity: 0; }
.nav-pin svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linejoin: round; }
.nav-row:hover .nav-pin, .nav-pin:focus-visible, .nav-row.is-pinned .nav-pin { opacity: 1; }
.nav-pin:hover { background: rgba(130, 160, 255, .1); color: var(--text); }
.nav-row.is-pinned .nav-pin { color: var(--gold); }
.nav-row.is-pinned .nav-pin svg { fill: currentColor; }
@media (hover: none) { .nav-pin { opacity: .5; } }
.nav-pinned { margin-bottom: 16px; }

.sidebar-foot { display: flex; align-items: center; gap: 6px; margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--line); }
.sidebar-foot .back-link { flex: 1; min-width: 0; margin-top: 0; border-top: 0; padding: 9px 10px; }
.nav-collapse { width: 38px; height: 38px; flex: none; display: grid; place-items: center; padding: 0; border: 0; border-radius: 10px; background: none; color: var(--text-dim); cursor: pointer; }
.nav-collapse:hover { background: rgba(130, 160, 255, .08); color: var(--text); }
.nav-collapse svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform .2s ease; }
html[lang="en"] .nav-collapse svg { transform: scaleX(-1); }

.topbar-breadcrumb { min-width: 0; }
.topbar-breadcrumb span, .topbar-breadcrumb strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 24ch; }

@media (max-width: 900px) { .nav-collapse { display: none; } }
@media (min-width: 901px) {
    .sidebar { transition: width .2s ease; }
    .content { margin-inline: auto; }
    html.nav-mini .sidebar { --sidebar: 76px; padding-inline: 10px; }
    html.nav-mini .brand-mini { justify-content: center; padding-inline: 0; }
    html.nav-mini .brand-mini > div, html.nav-mini .sidebar .guild-name > div, html.nav-mini .nav-item em,
    html.nav-mini .back-link span, html.nav-mini .nav-pin, html.nav-mini .nav-chev, html.nav-mini .nav-group-title span { display: none; }
    html.nav-mini .sidebar .guild-name { justify-content: center; padding: 8px; }
    html.nav-mini .nav-group-title { padding-inline: 4px; }
    html.nav-mini .nav-item { justify-content: center; padding: 10px 0; }
    html.nav-mini .nav-item .pl-lock { position: absolute; top: 5px; inset-inline-end: 7px; width: 11px; height: 11px; margin: 0; }
    html.nav-mini .sidebar-foot { flex-direction: column; }
    html.nav-mini .sidebar-foot .back-link { flex: none; width: 100%; justify-content: center; padding: 9px 0; }
    html.nav-mini .nav-group.collapsed .nav-items { grid-template-rows: 1fr; }
    html.nav-mini .nav-group.collapsed .nav-items-inner { visibility: visible; }
}

/* ==========================================================================
   v2 — ألوان · مقاسات · قائمة جانبية (درج) · حركة هادئة
   ========================================================================== */
:root {
    --pad: clamp(16px, 3.2vw, 40px);
    --ease-out: cubic-bezier(.22, .8, .3, 1);
    --shell-h: 58px;
    --premium: #e8b84b;
    --bg-0: #080b18; --bg-1: #0c1022; --bg-2: #131833; --card: #0f1429; --card-hover: #151b38;
    --card-border: #1f2747; --line: #182040; --text: #e9edfb; --text-dim: #9aa3c4;
}
html { scrollbar-gutter: stable; scroll-behavior: smooth; }
body { min-height: 100vh; min-height: 100dvh; }
html.nav-open, html.nav-open body { overflow: hidden; }
.dashboard-layout { min-height: 100vh; min-height: 100dvh; }
.sidebar { height: 100vh; height: 100dvh; border-left: 0; border-inline-end: 1px solid var(--line); }
.nav-scroll { min-height: 0; overscroll-behavior: contain; }
.nav-scroll.fade-b { -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 26px), transparent); mask-image: linear-gradient(to bottom, #000 calc(100% - 26px), transparent); }
.nav-scroll.fade-t { -webkit-mask-image: linear-gradient(to top, #000 calc(100% - 26px), transparent); mask-image: linear-gradient(to top, #000 calc(100% - 26px), transparent); }
.nav-scroll.fade-t.fade-b { -webkit-mask-image: linear-gradient(#0000, #000 22px, #000 calc(100% - 26px), #0000); mask-image: linear-gradient(#0000, #000 22px, #000 calc(100% - 26px), #0000); }
html.nav-pre .nav-items, html.nav-pre .nav-chev, html.nav-pre .sidebar { transition: none !important; }

/* عناصر القائمة */
.nav-item { min-height: 40px; padding: 0 12px; padding-inline-end: 36px; transition: background .18s ease, color .18s ease, transform .18s var(--ease-out); }
.nav-item .ico { transition: transform .25s var(--ease-out), color .18s ease; }
.nav-item:hover .ico { transform: scale(1.1); }
.nav-item:active { transform: scale(.985); }
.nav-item .pl-lock { margin-inline-start: auto; }
.nav-row[data-slug="premium"] .nav-item .ico { color: var(--premium); }
.nav-item.active::before { animation: starIn .55s .1s var(--ease-out) both; }
.guild-name { transition: border-color .2s ease; }
.guild-name:hover { border-color: var(--ring-soft); }

/* الشريط العلوي (سطح المكتب) */
.content { padding: 0 var(--pad) 56px; }
.topbar { margin-inline: calc(var(--pad) * -1); padding-inline: var(--pad); }

/* الشريط والدرج على الجوال والتابلت */
.drawer-tools { display: none; }
@media (max-width: 900px) {
    .dashboard-layout { display: block; }
    .topbar { display: none; }
    .content { padding: 18px var(--pad) 56px; max-width: none; }
    .mobile-shellbar { display: flex; gap: 10px; min-height: var(--shell-h); padding: 7px var(--pad); background: color-mix(in srgb, var(--bg-0) 86%, transparent); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
    .mobile-menu-btn { width: 44px; height: 44px; border-radius: 12px; gap: 5px; transition: background .2s ease, border-color .2s ease; }
    .mobile-menu-btn span { transition: transform .32s var(--ease-out), opacity .2s ease; }
    .mobile-menu-btn[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
    .mobile-menu-btn[aria-expanded="true"] span:nth-child(2) { opacity: 0; transform: scaleX(.2); }
    .mobile-menu-btn[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
    .mobile-guild { flex: 1; min-width: 0; max-width: none; display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 600; font-size: .95rem; }
    .mobile-guild img, .mobile-guild .guild-fallback { width: 30px; height: 30px; border-radius: 9px; flex: none; }
    .mobile-guild-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .mobile-shellbar .search-btn-icon { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 0; border-radius: 12px; }
    .search-btn-icon .ico { width: 20px; height: 20px; }

    .mobile-nav-backdrop { display: block !important; position: fixed; inset: 0; z-index: 55; background: rgba(4, 6, 14, .58); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); opacity: 0; visibility: hidden; transition: opacity .3s ease, visibility 0s linear .3s; }
    .mobile-nav-backdrop.open { opacity: 1; visibility: visible; transition: opacity .3s ease; }

    #dashboardSidebar {
        --out: 100%; --sidebar: min(86vw, 330px);
        position: fixed; z-index: 60; top: 0; bottom: 0; inset-inline-start: 0; width: var(--sidebar); max-width: none; height: 100vh; height: 100dvh;
        display: flex; flex-direction: column; gap: 4px; padding: 16px 14px calc(14px + env(safe-area-inset-bottom, 0px));
        border: 0; border-inline-end: 1px solid var(--line); border-start-end-radius: 22px; border-end-end-radius: 22px;
        transform: translate3d(var(--out), 0, 0); visibility: hidden; overscroll-behavior: contain;
        transition: transform .34s var(--ease-out), box-shadow .34s ease, visibility 0s linear .34s;
    }
    html[lang="en"] #dashboardSidebar { --out: -100%; }
    #dashboardSidebar.open { transform: none; visibility: visible; box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .7); transition: transform .34s var(--ease-out), box-shadow .34s ease; }
    #dashboardSidebar.dragging { transition: none; }
    #dashboardSidebar .nav-scroll { overflow-y: auto; margin: 0 -6px; padding: 0 6px 8px; }
    #dashboardSidebar .nav-item { min-height: 46px; font-size: .96rem; }
    #dashboardSidebar .nav-item.active::before { display: block; }
    #dashboardSidebar .nav-group-title { min-height: 36px; font-size: .78rem; }
    #dashboardSidebar .guild-name strong { max-width: 190px; }
    .mobile-close-nav { display: grid; place-items: center; width: 40px; height: 40px; margin-inline-start: auto; margin-right: 0; border-radius: 12px; background: var(--bg-2); border: 1px solid var(--card-border); color: var(--text-dim); transition: color .2s ease, background .2s ease; }
    .mobile-close-nav:hover { color: var(--text); }
    #dashboardSidebar.open .brand-mini, #dashboardSidebar.open .guild-name, #dashboardSidebar.open .nav-group, #dashboardSidebar.open .drawer-tools { animation: abIn .42s var(--ease-out) both; }
    #dashboardSidebar.open .guild-name { animation-delay: 40ms; }
    #dashboardSidebar.open .nav-group:nth-of-type(1) { animation-delay: 80ms; }
    #dashboardSidebar.open .nav-group:nth-of-type(2) { animation-delay: 120ms; }
    #dashboardSidebar.open .nav-group:nth-of-type(3) { animation-delay: 160ms; }
    #dashboardSidebar.open .nav-group:nth-of-type(n+4) { animation-delay: 200ms; }
    #dashboardSidebar.open .drawer-tools { animation-delay: 220ms; }

    .drawer-tools { display: flex; flex-direction: column; gap: 10px; padding: 12px 4px 6px; border-top: 1px solid var(--line); margin-top: 6px; }
    .drawer-user { display: flex; align-items: center; gap: 10px; }
    .drawer-user img { width: 34px; height: 34px; border-radius: 50%; }
    .drawer-user .drawer-name { flex: 1; min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .drawer-logout { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 12px; border-radius: 10px; color: var(--danger); background: rgba(242, 103, 122, .1); font-size: .86rem; font-weight: 600; }
    .drawer-prefs { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
    .ab-lang-btn { min-height: 36px; }
}
@media (min-width: 901px) { .sidebar { --sidebar: 264px; } html.nav-mini .sidebar { --sidebar: 76px; } }

/* الصفحة الرئيسية: مقاسات أدق */
.quick-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); }
@media (max-width: 700px) {
    .premium-hero { background-image: radial-gradient(ellipse at 12% 0%, rgba(107, 155, 255, .16), transparent 60%), linear-gradient(180deg, var(--bg-2), var(--card)); background-position: 0 0; background-size: auto; }
    .premium-hero .tab-title { font-size: 1.55rem; }
    .hero-status { flex-direction: row; align-items: center; gap: 10px; padding: 8px 14px; border-radius: 999px; }
    .hero-status .status-dot { position: static; flex: none; }
    .hero-status small { display: none; }
}
@media (max-width: 520px) {
    .stat-card { flex-direction: column; align-items: flex-start; gap: 10px; padding: 14px; }
    .stat-value { font-size: 1.5rem; }
    .stat-label { font-size: .8rem; }
}
.stat-value { font-variant-numeric: tabular-nums; }

/* اللمس: أهداف 44px وحقول 16px (يمنع تكبير iOS) */
@media (pointer: coarse) {
    .btn { min-height: 44px; }
    .icon-delete { width: 44px; height: 44px; }
    input[type=text], input[type=number], input[type=password], input[type=url], input[type=search], select, textarea { font-size: 16px; min-height: 44px; }
}

/* ---------- الحركة: دخول هادئ بلا ظهور مفاجئ ---------- */
@keyframes abIn { from { opacity: 0; transform: translate3d(0, 10px, 0); } to { opacity: 1; transform: none; } }
@keyframes abFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes starIn { from { opacity: 0; transform: scale(.3) rotate(-45deg); } }
.content > :not(.topbar) { animation: abIn .46s var(--ease-out) both; }
.content > .stats-grid, .content > .quick-grid, .content > .split-cards, .content > .command-grid { animation: none; }
.stats-grid > *, .quick-grid > *, .split-cards > *, .command-grid > * { animation: abIn .46s var(--ease-out) both; }
.command-grid > :nth-child(n+13) { animation: none; }
.ab-in { animation: abIn .38s var(--ease-out) both; }
.content > .adsterra-ad-slot { animation: abFade .8s ease 1.1s both; }
.content > :nth-child(3) { animation-delay: 45ms; }
.content > :nth-child(4) { animation-delay: 90ms; }
.content > :nth-child(5) { animation-delay: 135ms; }
.content > :nth-child(6) { animation-delay: 180ms; }
.content > :nth-child(7) { animation-delay: 225ms; }
.content > :nth-child(8) { animation-delay: 270ms; }
.content > :nth-child(9) { animation-delay: 315ms; }
.stats-grid > :nth-child(2), .quick-grid > :nth-child(2), .split-cards > :nth-child(2), .command-grid > :nth-child(2) { animation-delay: 125ms; }
.stats-grid > :nth-child(3), .quick-grid > :nth-child(3), .split-cards > :nth-child(3), .command-grid > :nth-child(3) { animation-delay: 170ms; }
.stats-grid > :nth-child(4), .quick-grid > :nth-child(4), .split-cards > :nth-child(4), .command-grid > :nth-child(4) { animation-delay: 215ms; }
.stats-grid > :nth-child(5), .quick-grid > :nth-child(5), .split-cards > :nth-child(5), .command-grid > :nth-child(5) { animation-delay: 260ms; }
.stats-grid > :nth-child(6), .quick-grid > :nth-child(6), .split-cards > :nth-child(6), .command-grid > :nth-child(6) { animation-delay: 305ms; }
.stats-grid > :nth-child(7), .quick-grid > :nth-child(7), .split-cards > :nth-child(7), .command-grid > :nth-child(7) { animation-delay: 350ms; }
.stats-grid > :nth-child(8), .quick-grid > :nth-child(8), .split-cards > :nth-child(8), .command-grid > :nth-child(8) { animation-delay: 395ms; }
.stats-grid > :nth-child(9), .quick-grid > :nth-child(9), .split-cards > :nth-child(9), .command-grid > :nth-child(9) { animation-delay: 440ms; }
.stats-grid > :nth-child(10), .quick-grid > :nth-child(10), .split-cards > :nth-child(10), .command-grid > :nth-child(10) { animation-delay: 485ms; }
.stats-grid > :nth-child(1), .quick-grid > :nth-child(1), .split-cards > :nth-child(1), .command-grid > :nth-child(1) { animation-delay: 80ms; }
.content > .adsterra-ad-slot { animation: abFade .8s ease 1.1s both; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } .mobile-menu-btn span { transition: none !important; } }

/* ==========================================================================
   v3 — صقل التنفيذ: اتساق الألوان · حالات التفاعل · الخطوط العربية · اللغتان
   (طبقة إضافية فوق ما سبق؛ لا تغيّر الهوية ولا أسماء الأصناف)
   ========================================================================== */
:root {
    --ring: rgba(107, 155, 255, .22);
    --hover-line: #2c365e;
    --btn-hover-bg: #171d3a;
    --btn-hover-line: #333d68;
    --placeholder: #7f88ad;
    --toast-bg: #121733;
}
html[data-theme="light"] {
    --ring: rgba(43, 120, 228, .2);
    --hover-line: #bcc5d6;
    --btn-hover-bg: #e4e9f1;
    --btn-hover-line: #b3bdd0;
    --placeholder: #6b7487;
    --toast-bg: #ffffff;
}

/* رماديات خارج لوحة الأزرق الداكن → من نفس الأساس اللوني */
.btn-ghost:hover, .btn:not(.btn-gold):not(.btn-blurple):not(.btn-danger):hover { border-color: var(--btn-hover-line); background: var(--btn-hover-bg); }
.ab-gear:hover { border-color: var(--btn-hover-line); }
.toast { background: var(--toast-bg); }
.mock-bar i { background: var(--card-border); }
input::placeholder, textarea::placeholder { color: var(--placeholder); }
input:hover, select:hover, textarea:hover { border-color: var(--hover-line); }
select { background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path d='M1 1.5l5 5 5-5' fill='none' stroke='%238d95b6' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/></svg>"); }

/* الأزرار: حالات واضحة */
.btn:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.btn-gold:active { filter: brightness(.96); box-shadow: none; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .45; filter: none; box-shadow: none; transform: none; pointer-events: none; }
.btn.is-loading { position: relative; color: transparent !important; pointer-events: none; }
.btn.is-loading::after {
    content: ""; position: absolute; width: 16px; height: 16px; border-radius: 50%;
    border: 2px solid currentColor; border-top-color: transparent; color: var(--text);
    animation: abSpin .7s linear infinite;
}
.btn-gold.is-loading::after { color: var(--accent-ink); }
@keyframes abSpin { to { transform: rotate(360deg); } }

/* الحقول: تركيز، تعطيل، خطأ */
input:focus, select:focus, textarea:focus { box-shadow: 0 0 0 3px var(--ring); }
input:disabled, select:disabled, textarea:disabled { opacity: .5; cursor: not-allowed; background: var(--bg-1); }
input[readonly], textarea[readonly] { color: var(--text-dim); }
input:user-invalid, select:user-invalid, textarea:user-invalid, .field.has-error input, .field.has-error select, .field.has-error textarea {
    border-color: var(--danger); box-shadow: 0 0 0 3px rgba(242, 97, 111, .14);
}
.field.has-error .field-error, .field-error { margin-top: 5px; font-size: .8rem; color: var(--danger); }
.field label { opacity: 1; color: color-mix(in srgb, var(--text) 86%, var(--text-dim)); }

/* خطوط عربية: لا تباعد حروف (يقطع اتصال الحروف) + ارتفاع سطر مناسب للعناوين */
html[lang="ar"] .tab-title, html[lang="ar"] .card h3, html[lang="ar"] .hero h1, html[lang="ar"] .brand-mini strong,
html[lang="ar"] .stat-value, html[lang="ar"] .section-heading h2, html[lang="ar"] .wordmark, html[lang="ar"] .eyebrow { letter-spacing: 0; }
html[lang="ar"] .tab-title, html[lang="ar"] .premium-hero .tab-title { line-height: 1.4; }
html[lang="ar"] .hero h1 { line-height: 1.4; }
.stat-value, .error-code, .data-row b, td.num { font-variant-numeric: tabular-nums; }
.stat-label, .field-help, .card .muted-inline { line-height: 1.55; }

/* حالة الاتجاه: يعمل مع زر تبديل اللغة */
th, td { text-align: start; }
html[lang="en"] select { padding-left: 13px; padding-right: 34px; background-position: right 12px center; }
html[lang="en"] select[multiple] { padding-right: 13px; }

/* بطاقة الحالة في الرئيسية: النقطة كانت تغطي النص (padding المختصر كان يلغي padding-inline-end) */
.hero-status { padding: 12px 16px; padding-inline-end: 34px; }
@media (max-width: 700px) { .hero-status { padding: 8px 14px; } }

/* بطاقات قابلة للنقر: ردّ فعل خفيف وتركيز لوحة المفاتيح */
.quick-card, .guild-card, .command-card { transition: border-color .18s ease, background-color .18s ease, transform .18s var(--ease-out); }
@media (hover: hover) { .quick-card:hover, .guild-card:hover { transform: translateY(-1px); } }
.quick-card:focus-visible, .guild-card:focus-visible, .command-card:focus-visible, .nav-item:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.nav-item:focus-visible { outline-offset: -2px; }

/* الجداول: تمرير أفقي بدل كسر التخطيط على الشاشات الضيقة */
@media (max-width: 700px) {
    .card:has(> table), .card:has(> .data-table), .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .card > table { min-width: 520px; }
}

/* حالة فارغة: أهدأ وأوضح */
.empty-state { padding: 44px 24px; line-height: 1.7; }
.empty-state strong { font-size: 1rem; font-weight: 600; }
.empty-state .btn { margin-top: 16px; }

/* هيكل تحميل بسيط */
.skeleton { position: relative; overflow: hidden; border-radius: 8px; background: var(--bg-2); min-height: 14px; }
.skeleton::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, var(--glint), transparent); animation: abShimmer 1.4s ease-in-out infinite; }
html[dir="rtl"] .skeleton::after { transform: translateX(100%); animation-name: abShimmerRtl; }
@keyframes abShimmer { to { transform: translateX(100%); } }
@keyframes abShimmerRtl { to { transform: translateX(-100%); } }

/* التنبيهات: أيقونة وحالة أوضح وعدم تغطية شريط iOS السفلي */
.toast { bottom: calc(22px + env(safe-area-inset-bottom, 0px)); padding: 11px 16px; }
.toast.ok::before, .toast.err::before { display: inline-block; width: 1.3em; text-align: center; margin-inline-end: 4px; }
@media (max-width: 900px) { .toast { max-width: calc(100vw - 32px); } }

/* احترام تفضيل تقليل الحركة في كل الشاشة */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
    .btn.is-loading::after, .skeleton::after { animation-duration: 1.4s !important; animation-iteration-count: infinite !important; }
}

/* ألوان الحالة/المميّز: كانت inline بقيم ثابتة؛ الآن من متغيرات الهوية مع تباين صحيح في الثيم الفاتح */
:root { --warn: #f2b84b; }
html[data-theme="light"] { --premium: #a9740c; --warn: #9a5f04; }

/* إصلاح: سهم القوائم المنسدلة كان يتكرر كشرائط (background-repeat أُعيد ضبطه بخاصية مختصرة لاحقة) */
select { background-repeat: no-repeat; background-size: 12px 8px; background-position: left 13px center; }
html[dir="ltr"] select, html[lang="en"] select { background-position: right 13px center; }
select[multiple] { background-image: none; }


/* =====================================================================
   قائمة المنشن (@) + شرائح المنشن + مفتاح الرد عام/خاص + تجربة الزر
   ===================================================================== */
.abm-pop { position: fixed; z-index: 9999; display: flex; flex-direction: column; direction: rtl;
    background: var(--card); border: 1px solid var(--card-border); border-radius: 14px; overflow: hidden;
    box-shadow: 0 18px 50px rgba(0, 0, 0, .55), 0 0 0 1px rgba(107, 155, 255, .08);
    font-family: var(--font); animation: abm-in .12s ease-out; }
.abm-pop[hidden] { display: none; }
@keyframes abm-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.abm-head { display: flex; align-items: center; justify-content: space-between; padding: 9px 14px 7px;
    font-size: .72rem; font-weight: 700; letter-spacing: .04em; color: var(--text-dim);
    border-bottom: 1px solid var(--line); background: rgba(255, 255, 255, .02); }
.abm-count { min-width: 22px; padding: 0 7px; border-radius: 999px; background: rgba(88, 101, 242, .22);
    color: #c9cdfb; text-align: center; line-height: 18px; font-size: .72rem; }
.abm-count:empty { display: none; }
.abm-list { flex: 1; min-height: 0; overflow-y: auto; padding: 6px; overscroll-behavior: contain; }
.abm-row { position: relative; display: flex; align-items: center; gap: 11px; min-height: 50px; padding: 7px 12px;
    border-radius: 10px; cursor: pointer; }
.abm-row.is-active { background: rgba(88, 101, 242, .2); }
.abm-row.is-active::before { content: ""; position: absolute; inset-block: 10px; inset-inline-start: 0;
    width: 3px; border-radius: 3px; background: var(--blurple); }
.abm-av { width: 36px; height: 36px; flex: none; overflow: hidden; border-radius: 50%; background: #1b2142;
    display: inline-flex; align-items: center; justify-content: center; font-weight: 700; color: #c9cdfb; }
.abm-av img { display: block; width: 100%; height: 100%; object-fit: cover; }
.abm-av-xs { width: 18px; height: 18px; font-size: .62rem; }
.abm-av-user { background: rgba(88, 101, 242, .25); font-family: ui-monospace, Consolas, monospace; font-size: .8rem; }
.abm-text { display: flex; flex-direction: column; flex: 1; min-width: 0; line-height: 1.3; }
.abm-name { font-weight: 600; font-size: .94rem; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.abm-sub { font-size: .78rem; color: var(--text-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    text-align: start; unicode-bidi: plaintext; }
.abm-badge { flex: none; padding: 1px 6px; border-radius: 4px; background: var(--blurple); color: #fff;
    font-size: .62rem; font-weight: 700; letter-spacing: .03em; }
.abm-foot { padding: 7px 14px; border-top: 1px solid var(--line); text-align: center; font-size: .7rem; color: var(--text-dim); }
.abm-state { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 22px 12px;
    color: var(--text-dim); font-size: .88rem; text-align: center; }
.abm-state-err { color: var(--danger); }
.abm-spin { width: 14px; height: 14px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .18);
    border-top-color: var(--gold); animation: abm-spin .7s linear infinite; }
@keyframes abm-spin { to { transform: rotate(360deg); } }
@media (hover: none) { .abm-foot { display: none; } }
@media (max-width: 640px) { .abm-row { min-height: 54px; } }
@media (prefers-reduced-motion: reduce) { .abm-pop, .abm-spin { animation: none; } }

/* المنشن الأزرق كما في ديسكورد (في المعاينة وفي الشرائح) */
.abm-mention { display: inline-block; padding: 0 3px; border-radius: 4px; background: rgba(88, 101, 242, .3);
    color: #c9cdfb; font-weight: 500; line-height: 1.35; cursor: default; transition: background .1s, color .1s; }
.abm-mention:hover { background: #5865f2; color: #fff; }

.abm-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.abm-chips:empty { display: none; }
.abm-chip { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 3px 4px 3px 6px;
    border-radius: 999px; background: rgba(88, 101, 242, .16); border: 1px solid rgba(88, 101, 242, .4);
    color: #c9cdfb; font-size: .82rem; font-weight: 500; }
.abm-chip-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 200px; }
.abm-chip-x { width: 20px; height: 20px; padding: 0; border: 0; border-radius: 50%; background: transparent;
    color: inherit; font: inherit; line-height: 1; cursor: pointer; opacity: .7; }
.abm-chip-x:hover { opacity: 1; background: rgba(242, 97, 111, .28); color: #fff; }

/* مفتاح نوع الرد: عامة / خاصة */
.vis-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 4px; border-radius: 12px;
    background: var(--bg-1); border: 1px solid var(--card-border); }
.vis-opt { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 9px 12px;
    border-radius: 9px; border: 1px solid transparent; background: transparent; color: var(--text-dim);
    font: inherit; text-align: start; cursor: pointer; transition: background .12s, border-color .12s; }
.vis-opt b { font-size: .9rem; color: var(--text); }
.vis-opt small { font-size: .74rem; line-height: 1.35; }
.vis-opt:hover { background: rgba(255, 255, 255, .04); }
.vis-opt[aria-checked="true"] { background: rgba(88, 101, 242, .18); border-color: rgba(107, 155, 255, .55); color: #c9cdfb; }
.vis-hint { margin-top: 6px; font-size: .76rem; color: var(--text-dim); }
@media (max-width: 520px) { .vis-switch { grid-template-columns: 1fr; } }

/* تجربة الزر داخل المعاينة */
.pv-btn[data-idx] { cursor: pointer; transition: filter .12s, transform .06s; user-select: none; }
.pv-btn[data-idx]:hover { filter: brightness(1.14); }
.pv-btn[data-idx]:active { transform: scale(.97); }
.pv-btn.is-picked { outline: 2px solid rgba(255, 255, 255, .35); outline-offset: 2px; }
.pv-try-hint { margin-top: 8px; font-size: .74rem; color: #949ba4; }
.preview-content { margin-bottom: 8px; font-size: .9rem; white-space: pre-wrap; word-break: break-word; }
.preview-content:empty { display: none; }
.pv-reply { margin-top: 12px; padding: 10px 12px; border-radius: 8px; background: #2b2d31; border-inline-start: 3px solid var(--blurple); }
.pv-reply-private { background: rgba(88, 101, 242, .1); }
.pv-reply-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; font-size: .85rem; }
.pv-reply-av { width: 24px; height: 24px; flex: none; border-radius: 50%; display: inline-block; font-size: 0; color: transparent; overflow: hidden;
    background: #05050f url("../img/bot-avatar.png") center / cover no-repeat; }
.pv-bot-tag { padding: 0 5px; border-radius: 4px; background: var(--blurple); color: #fff; font-size: .6rem; font-weight: 700; line-height: 15px; }
.pv-reply-head small { color: #949ba4; }
.pv-reply-title { font-weight: 700; color: #fff; margin-bottom: 4px; }
.pv-reply-body { font-size: .9rem; white-space: pre-wrap; word-break: break-word; }
.pv-reply-foot { margin-top: 8px; font-size: .74rem; color: #949ba4; }
.pv-reply-foot u { color: #c9cdfb; cursor: pointer; text-underline-offset: 2px; }

/* =====================================================================
   تنسيقات ديسكورد في المعاينة (# عناوين، **عريض**، > اقتباس، قوائم، كود...)
   ===================================================================== */
.abm-p { margin: 0; }
.abm-h { font-weight: 700; line-height: 1.25; margin: .55em 0 .2em; unicode-bidi: plaintext; text-align: start; }
.abm-h1 { font-size: 1.7em; }
.abm-h2 { font-size: 1.4em; }
.abm-h3 { font-size: 1.15em; }
.abm-h:first-child { margin-top: 0; }
.abm-small { font-size: .78em; color: #949ba4; line-height: 1.3; margin: .15em 0; unicode-bidi: plaintext; text-align: start; }
.abm-quote { margin: .25em 0; padding: 0 .8em; border-inline-start: 4px solid #4e5058; border-radius: 3px; }
.abm-ul, .abm-ol { margin: .25em 0; padding-inline-start: 1.6em; }
.abm-ul { list-style: disc; }
.abm-ol { list-style: decimal; }
.abm-ul .abm-ul { list-style: circle; }
.abm-ul li, .abm-ol li { padding-inline-start: .15em; unicode-bidi: plaintext; }
.abm-code { padding: .1em .35em; border-radius: 4px; background: #1e1f22; border: 1px solid #1a1b1e;
    font-family: ui-monospace, Consolas, "Courier New", monospace; font-size: .85em; white-space: pre-wrap; }
.abm-codeblock { margin: .35em 0; padding: .55em .7em; border-radius: 6px; background: #2b2d31; border: 1px solid #1e1f22;
    direction: ltr; text-align: left; white-space: pre-wrap; overflow-x: auto; max-width: 100%; }
.abm-codeblock code { font-family: ui-monospace, Consolas, "Courier New", monospace; font-size: .85em; background: none; color: #dbdee1; }
.abm-link { color: #00a8fc; text-decoration: none; word-break: break-all; }
.abm-link:hover { text-decoration: underline; }
.abm-spoiler { border-radius: 4px; background: #1e1f22; color: transparent; cursor: pointer; padding: 0 2px; }
.abm-spoiler > * { visibility: hidden; }
.abm-spoiler.is-open { background: rgba(255, 255, 255, .1); color: inherit; }
.abm-spoiler.is-open > * { visibility: visible; }

/* معاينة لحظية تحت حقول الكتابة */
.abm-live { margin-top: 8px; padding: 10px 12px; border-radius: 10px; background: #313338; color: #dbdee1;
    border: 1px solid var(--card-border); font-size: .9rem; line-height: 1.45; word-break: break-word; }
.abm-live[hidden] { display: none; }
.abm-live-label { margin-bottom: 6px; font-size: .66rem; font-weight: 700; letter-spacing: .06em; color: #949ba4; }
.abm-codeblock code { background: none; border: 0; padding: 0; }

/* الرومات (#) في قائمة المنشن والشرائح */
.abm-av-ch { background: rgba(88, 101, 242, .18); color: #c9cdfb; font-size: 1.05rem; }
.abm-chip-ico { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px;
    border-radius: 50%; background: rgba(88, 101, 242, .35); font-size: .68rem; font-weight: 700; }

/* ---------- إصلاح تداخل زر اللغة مع صورة الحساب و"خروج" ---------- */
/* الزر داخل التدفق الطبيعي للشريط العلوي (لا موضع ثابت/مطلق) مهما حقنت i18n من أنماط */
.topbar-actions { flex: none; flex-wrap: nowrap; position: relative; }
.topbar-actions > * { flex: none; position: static; }
.topbar-actions .ab-lang-btn,
.drawer-prefs .ab-lang-btn {
    position: static !important; inset: auto !important; transform: none !important;
    float: none !important; margin: 0 !important; z-index: auto !important;
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 40px; min-height: 36px; padding: 0 12px; flex: none;
    border-radius: 999px; background: var(--bg-2); color: var(--text-dim);
    border: 1px solid var(--card-border); font-size: .82rem; font-weight: 600;
    line-height: 1; cursor: pointer; white-space: nowrap;
}
.topbar-actions .ab-lang-btn:hover { color: var(--text); }
.topbar-actions .user-chip, .topbar-actions .logout-link { white-space: nowrap; }
@media (max-width: 1100px) {
    .topbar-actions { gap: 8px; }
    .search-btn { min-width: 0; }
    .search-btn-label, .search-btn kbd { display: none; }
    .user-chip span { display: none; }
}

/* V-13: الخروج صار نموذج POST بزر؛ نُلغي مظهر الزر الافتراضي ليبقى كالرابط السابق */
.logout-form{display:inline;margin:0}
button.logout-link,button.drawer-logout{background:none;border:0;font:inherit;color:inherit;cursor:pointer;padding:0;text-align:inherit}
.drawer-logout-form{display:block}
