/* ============ الألوان الأساسية (نفس ألوان موقعك) ============ */
:root {
    --bg-dark: #0a0d14;
    --bg-sidebar: #11151f;
    --bg-card: #161b26;
    --bg-elev: #1b2130;
    --bg-hover: #1e2433;
    --bg-input: #0d1119;
    --text-main: #e6edf3;
    --text-soft: #b1bac4;
    --text-muted: #7d8590;
    --accent: #5865F2;
    --accent-hover: #4752c4;
    --accent-soft: rgba(88, 101, 242, .14);
    --border: #222937;
    --border-strong: #2d3547;
    --success: #3fb950;
    --success-soft: rgba(63, 185, 80, .14);
    --danger: #f85149;
    --danger-soft: rgba(248, 81, 73, .13);
    --warning: #d29922;
    --warning-soft: rgba(210, 153, 34, .14);
    --radius: 12px;
    --shadow: 0 10px 30px rgba(0, 0, 0, .35);
    --chart-1: #6b77f5;
    --chart-2: #2ea043;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
    font-family: 'Cairo', system-ui, sans-serif; background: var(--bg-dark); color: var(--text-main);
    font-size: 14px; line-height: 1.6; -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
a { color: #8ea1ff; text-decoration: none; }
::selection { background: var(--accent); color: #fff; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #262d3d; border-radius: 10px; border: 2px solid var(--bg-dark); }
::-webkit-scrollbar-track { background: transparent; }
.hidden { display: none !important; }
.muted { color: var(--text-muted); }
.soft { color: var(--text-soft); }
.small { font-size: 12px; }
.mono { font-family: ui-monospace, Consolas, monospace; direction: ltr; unicode-bidi: embed; }
.row { display: flex; gap: 10px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.spacer { flex: 1; }
.center { text-align: center; }

/* ============ أزرار ============ */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px; padding: 0 16px;
    border-radius: 9px; border: 1px solid transparent; background: var(--accent); color: #fff; font-weight: 700;
    cursor: pointer; transition: background .15s, transform .1s, border-color .15s, opacity .15s; white-space: nowrap; font-size: 13.5px;
}
.btn:hover { background: var(--accent-hover); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.sm { height: 32px; padding: 0 12px; font-size: 12.5px; border-radius: 8px; }
.btn.lg { height: 46px; padding: 0 24px; font-size: 15px; border-radius: 11px; }
.btn.ghost { background: transparent; border-color: var(--border-strong); color: var(--text-main); }
.btn.ghost:hover { background: var(--bg-hover); }
.btn.subtle { background: var(--bg-hover); color: var(--text-main); }
.btn.subtle:hover { background: #283044; }
.btn.danger { background: var(--danger); }
.btn.danger:hover { background: #da3633; }
.btn.success { background: #238636; }
.btn.success:hover { background: #2ea043; }
.btn.link { background: none; color: var(--text-muted); padding: 0 6px; height: auto; }
.btn.link:hover { color: var(--text-main); }
.icon-btn {
    width: 32px; height: 32px; border-radius: 8px; border: none; background: transparent; color: var(--text-muted);
    cursor: pointer; display: inline-flex; align-items: center; justify-content: center; transition: .15s; flex-shrink: 0;
}
.icon-btn:hover { background: var(--bg-hover); color: var(--text-main); }
.icon-btn.danger:hover { color: var(--danger); background: var(--danger-soft); }
.btn .spin, .spin { animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ============ شاشة الدخول واختيار السيرفر ============ */
.screen { min-height: 100vh; display: flex; flex-direction: column; }
.hero {
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 40px 20px; text-align: center;
    background: radial-gradient(900px 500px at 50% -10%, rgba(88, 101, 242, .22), transparent 60%), radial-gradient(600px 400px at 90% 110%, rgba(88, 101, 242, .1), transparent 60%);
}
.hero-logo {
    width: 84px; height: 84px; border-radius: 24px; display: grid; place-items: center; font-size: 38px; color: #fff;
    background: linear-gradient(135deg, var(--accent), #8b5cf6); box-shadow: 0 20px 50px rgba(88, 101, 242, .35); margin-bottom: 22px;
    animation: float 5s ease-in-out infinite;
}
@keyframes float { 50% { transform: translateY(-8px); } }
.hero h1 { font-size: 34px; font-weight: 900; margin-bottom: 8px; }
.hero p { color: var(--text-muted); max-width: 520px; margin-bottom: 26px; font-size: 15px; }
.hero .actions { display: flex; flex-direction: column; gap: 10px; width: min(360px, 100%); }
.notice {
    background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; text-align: right;
    font-size: 13px; color: var(--text-soft); margin-top: 18px; max-width: 560px;
}
.notice.warn { border-color: rgba(210, 153, 34, .4); background: var(--warning-soft); }
.notice.err { border-color: rgba(248, 81, 73, .4); background: var(--danger-soft); }
.notice.info { border-color: rgba(88, 101, 242, .4); background: var(--accent-soft); }
.notice code { background: rgba(0, 0, 0, .3); padding: 1px 6px; border-radius: 5px; direction: ltr; display: inline-block; }

.topnav {
    height: 64px; display: flex; align-items: center; gap: 14px; padding: 0 24px; border-bottom: 1px solid var(--border);
    background: rgba(10, 13, 20, .85); backdrop-filter: blur(10px); position: sticky; top: 0; z-index: 20;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 900; font-size: 18px; }
.brand .logo-dot { width: 34px; height: 34px; border-radius: 10px; background: linear-gradient(135deg, var(--accent), #8b5cf6); display: grid; place-items: center; color: #fff; font-size: 16px; }
.user-chip { display: flex; align-items: center; gap: 8px; background: var(--bg-card); border: 1px solid var(--border); padding: 4px 6px 4px 12px; border-radius: 50px; font-weight: 700; font-size: 13px; }
.user-chip img, .user-chip .av { width: 28px; height: 28px; border-radius: 50%; background: var(--bg-hover); display: grid; place-items: center; }

.guilds-wrap { max-width: 1100px; width: 100%; margin: 0 auto; padding: 36px 20px 60px; }
.guilds-wrap h2 { font-size: 26px; font-weight: 900; }
.guild-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; margin-top: 22px; }
.guild-card {
    background: var(--bg-card); border: 1px solid var(--border); border-radius: 16px; overflow: hidden; transition: .2s; display: flex; flex-direction: column;
    animation: rise .35s ease both;
}
.guild-card:hover { transform: translateY(-3px); border-color: var(--accent); box-shadow: var(--shadow); }
.guild-card .banner { height: 92px; position: relative; background: linear-gradient(135deg, #1b2140, #111522); }
.guild-card .banner-bg { position: absolute; inset: 0; overflow: hidden; }
.guild-card .banner img.blur { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: blur(22px) brightness(.55); transform: scale(1.4); }
.guild-card .gicon { width: 64px; height: 64px; border-radius: 18px; position: absolute; bottom: -26px; right: 18px; border: 4px solid var(--bg-card); background: var(--bg-hover); display: grid; place-items: center; font-weight: 900; font-size: 20px; overflow: hidden; }
.guild-card .gicon img { width: 100%; height: 100%; object-fit: cover; }
.guild-card .body { padding: 34px 18px 18px; display: flex; flex-direction: column; gap: 12px; flex: 1; }
.guild-card .name { font-weight: 800; font-size: 15.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.guild-card .btn { width: 100%; margin-top: auto; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }

/* ============ التخطيط الرئيسي ============ */
.app { display: flex; height: 100vh; overflow: hidden; }
.sidebar {
    width: 272px; flex-shrink: 0; background: var(--bg-sidebar); border-left: 1px solid var(--border); display: flex; flex-direction: column;
    transition: transform .25s ease;
}
.side-guild { padding: 14px; border-bottom: 1px solid var(--border); position: relative; }
.guild-switch {
    width: 100%; display: flex; align-items: center; gap: 10px; background: var(--bg-card); border: 1px solid var(--border); border-radius: 11px;
    padding: 8px 10px; cursor: pointer; text-align: right; transition: .15s;
}
.guild-switch:hover { border-color: var(--border-strong); background: var(--bg-hover); }
.gav { width: 36px; height: 36px; border-radius: 11px; background: var(--bg-hover); display: grid; place-items: center; font-weight: 800; overflow: hidden; flex-shrink: 0; font-size: 13px; }
.gav img { width: 100%; height: 100%; object-fit: cover; }
.guild-switch .gname { font-weight: 800; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.guild-menu {
    position: absolute; top: calc(100% - 6px); right: 14px; left: 14px; background: var(--bg-elev); border: 1px solid var(--border-strong); border-radius: 12px;
    padding: 6px; z-index: 50; box-shadow: var(--shadow); max-height: 340px; overflow: auto; animation: pop .15s ease;
}
.guild-menu .item { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 8px; cursor: pointer; font-weight: 600; font-size: 13px; }
.guild-menu .item:hover { background: var(--bg-hover); }
.guild-menu .item .gav { width: 28px; height: 28px; border-radius: 8px; font-size: 11px; }
@keyframes pop { from { opacity: 0; transform: translateY(-4px) scale(.98); } }

.nav { flex: 1; overflow-y: auto; padding: 10px 10px 20px; }
.nav-group { margin-top: 12px; }
.nav-group-title { font-size: 11px; font-weight: 800; color: var(--text-muted); padding: 0 10px 6px; letter-spacing: .3px; }
.nav a {
    display: flex; align-items: center; gap: 11px; padding: 8px 11px; color: var(--text-soft); border-radius: 9px; font-weight: 600;
    font-size: 13.5px; margin-bottom: 2px; transition: background .15s, color .15s; position: relative;
}
.nav a i { width: 18px; text-align: center; font-size: 14px; color: var(--text-muted); transition: color .15s; }
.nav a:hover { background: var(--bg-hover); color: var(--text-main); }
.nav a.active { background: var(--accent-soft); color: #fff; }
.nav a.active i { color: var(--accent); }
.nav a.active::before { content: ''; position: absolute; right: -10px; top: 8px; bottom: 8px; width: 4px; border-radius: 4px 0 0 4px; background: var(--accent); }
.nav a .dot-on { width: 7px; height: 7px; border-radius: 50%; background: var(--success); margin-right: auto; box-shadow: 0 0 6px var(--success); }

.side-foot { border-top: 1px solid var(--border); padding: 12px 14px; display: flex; align-items: center; gap: 10px; }
.side-foot .who { font-weight: 700; font-size: 13px; line-height: 1.2; }

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar {
    height: 62px; display: flex; align-items: center; gap: 12px; padding: 0 28px; border-bottom: 1px solid var(--border); flex-shrink: 0;
    background: rgba(10, 13, 20, .7); backdrop-filter: blur(8px);
}
.topbar .crumbs { font-weight: 700; color: var(--text-muted); font-size: 13px; display: flex; gap: 8px; align-items: center; }
.topbar .crumbs b { color: var(--text-main); }
.menu-toggle { display: none; }
.status-pill { display: flex; align-items: center; gap: 8px; background: var(--bg-card); border: 1px solid var(--border); padding: 5px 13px; border-radius: 50px; font-size: 12.5px; font-weight: 700; }
.status-pill .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--danger); }
.status-pill.online .dot { background: var(--success); box-shadow: 0 0 8px var(--success); }
.status-pill.starting .dot, .status-pill.reconnecting .dot { background: var(--warning); animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .3; } }

.content { flex: 1; overflow-y: auto; padding: 26px 28px 120px; scroll-behavior: smooth; }
.page { max-width: 1060px; margin: 0 auto; animation: pageIn .3s ease; }
@keyframes pageIn { from { opacity: 0; transform: translateY(8px); } }

/* ============ رأس الصفحة ============ */
.page-head {
    display: flex; align-items: center; gap: 16px; margin-bottom: 22px; padding: 20px 22px; background: var(--bg-card);
    border: 1px solid var(--border); border-radius: 16px; position: relative; overflow: hidden;
}
.page-head::after { content: ''; position: absolute; inset: 0; background: radial-gradient(420px 160px at 100% 0, rgba(88, 101, 242, .16), transparent 70%); pointer-events: none; }
.page-icon { width: 52px; height: 52px; border-radius: 14px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-size: 22px; flex-shrink: 0; }
.page-head h1 { font-size: 21px; font-weight: 900; line-height: 1.3; }
.page-head p { color: var(--text-muted); font-size: 13px; }
.page-head .head-actions { margin-right: auto; display: flex; align-items: center; gap: 10px; position: relative; z-index: 1; }
.page-head .state-label { font-weight: 800; font-size: 13px; color: var(--text-muted); }
.page-head .state-label.on { color: var(--success); }

.disabled-hint {
    text-align: center; padding: 50px 20px; border: 2px dashed var(--border); border-radius: 16px; color: var(--text-muted);
}
.disabled-hint i { font-size: 36px; margin-bottom: 12px; color: var(--border-strong); display: block; }
.disabled-hint b { color: var(--text-main); display: block; font-size: 16px; margin-bottom: 4px; }

/* ============ البطاقات والحقول ============ */
.card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 16px; animation: rise .3s ease both; }
.card-head { display: flex; align-items: center; gap: 12px; padding: 15px 18px; }
.card-head + .card-body { border-top: 1px solid var(--border); }
.card-head h3 { font-size: 15px; font-weight: 800; }
.card-head .desc { color: var(--text-muted); font-size: 12.5px; }
.card-head .ic { width: 36px; height: 36px; border-radius: 10px; background: var(--bg-hover); display: grid; place-items: center; color: var(--text-soft); flex-shrink: 0; }
.card-body { padding: 18px; }
.card-body.collapsed { display: none; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.field { margin-bottom: 16px; }
.field:last-child { margin-bottom: 0; }
.field > label, .label { display: block; font-weight: 700; font-size: 13px; margin-bottom: 7px; color: var(--text-main); }
.field .hint { color: var(--text-muted); font-size: 12px; margin-top: 6px; }
.input, .select, textarea.input {
    width: 100%; height: 40px; padding: 0 12px; background: var(--bg-input); border: 1px solid var(--border); border-radius: 9px; color: var(--text-main);
    outline: none; transition: border-color .15s, box-shadow .15s;
}
textarea.input { height: auto; min-height: 92px; padding: 10px 12px; resize: vertical; line-height: 1.6; }
.input:focus, .select:focus, textarea.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(88, 101, 242, .15); }
.input::placeholder { color: #545d6a; }
.select { appearance: none; cursor: pointer; background-image: linear-gradient(45deg, transparent 50%, var(--text-muted) 50%), linear-gradient(135deg, var(--text-muted) 50%, transparent 50%); background-position: 16px 17px, 11px 17px; background-size: 5px 5px; background-repeat: no-repeat; padding-left: 30px; }
.input-group { display: flex; align-items: stretch; }
.input-group .input { border-radius: 0 9px 9px 0; }
.input-group .addon { background: var(--bg-hover); border: 1px solid var(--border); border-right: none; border-radius: 9px 0 0 9px; padding: 0 12px; display: grid; place-items: center; color: var(--text-muted); font-size: 12.5px; font-weight: 700; }
.counter { font-size: 11px; color: var(--text-muted); text-align: left; margin-top: 4px; }

.vars { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.var-chip { background: var(--bg-hover); border: 1px solid var(--border); color: var(--text-soft); padding: 1px 9px; border-radius: 6px; font-size: 11.5px; cursor: pointer; direction: ltr; font-family: ui-monospace, Consolas, monospace; transition: .15s; }
.var-chip:hover { border-color: var(--accent); color: #fff; }

/* المفتاح (toggle) */
.switch { position: relative; width: 46px; height: 26px; flex-shrink: 0; cursor: pointer; display: inline-block; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch .slider { position: absolute; inset: 0; background: #3a4150; border-radius: 26px; transition: .2s; }
.switch .slider::before { content: ''; position: absolute; width: 20px; height: 20px; right: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s cubic-bezier(.3, 1.4, .5, 1); box-shadow: 0 2px 4px rgba(0, 0, 0, .3); }
.switch input:checked + .slider { background: var(--success); }
.switch input:checked + .slider::before { transform: translateX(-20px); }
.switch.lg { width: 54px; height: 30px; }
.switch.lg .slider::before { width: 24px; height: 24px; }
.switch.lg input:checked + .slider::before { transform: translateX(-24px); }

.toggle-row { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.toggle-row:last-child { border-bottom: none; padding-bottom: 0; }
.toggle-row:first-child { padding-top: 0; }
.toggle-row .t { font-weight: 700; font-size: 13.5px; }
.toggle-row .d { color: var(--text-muted); font-size: 12px; }

/* اختيار مجزأ (تبويبات) */
.segmented { display: inline-flex; background: var(--bg-input); border: 1px solid var(--border); border-radius: 10px; padding: 3px; gap: 3px; flex-wrap: wrap; }
.segmented button { border: none; background: transparent; color: var(--text-muted); padding: 6px 14px; border-radius: 7px; cursor: pointer; font-weight: 700; font-size: 13px; display: flex; gap: 7px; align-items: center; transition: .15s; }
.segmented button:hover { color: var(--text-main); }
.segmented button.on { background: var(--accent); color: #fff; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 18px; overflow-x: auto; }
.tabs button { background: none; border: none; color: var(--text-muted); padding: 10px 14px; font-weight: 700; cursor: pointer; position: relative; white-space: nowrap; display: flex; align-items: center; gap: 8px; }
.tabs button:hover { color: var(--text-main); }
.tabs button.on { color: #fff; }
.tabs button.on::after { content: ''; position: absolute; bottom: -1px; right: 8px; left: 8px; height: 3px; border-radius: 3px 3px 0 0; background: var(--accent); }
.tabs .badge { background: var(--accent); color: #fff; border-radius: 10px; padding: 0 7px; font-size: 11px; }

/* ============ منتقي الرومات والرولات ============ */
.picker { position: relative; }
.picker-btn {
    width: 100%; min-height: 40px; display: flex; align-items: center; gap: 8px; background: var(--bg-input); border: 1px solid var(--border);
    border-radius: 9px; padding: 5px 12px; cursor: pointer; text-align: right; transition: .15s; flex-wrap: wrap;
}
.picker-btn:hover { border-color: var(--border-strong); }
.picker.open .picker-btn { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(88, 101, 242, .15); }
.picker-btn .ph { color: #545d6a; }
.picker-btn .caret { margin-right: auto; color: var(--text-muted); font-size: 11px; transition: transform .15s; }
.picker.open .picker-btn .caret { transform: rotate(180deg); }
.picker-pop {
    position: absolute; top: calc(100% + 6px); right: 0; left: 0; z-index: 60; background: var(--bg-elev); border: 1px solid var(--border-strong);
    border-radius: 12px; box-shadow: var(--shadow); animation: pop .12s ease; overflow: hidden; min-width: 260px;
}
.picker-pop.up { top: auto; bottom: calc(100% + 6px); }
.picker-pop.portal { position: fixed; top: auto; right: auto; left: auto; bottom: auto; z-index: 1000; min-width: 0; }
.picker-pop.portal.up { animation-name: popUp; }
@keyframes popUp { from { opacity: 0; transform: translateY(4px) scale(.98); } }
.picker-search { padding: 8px; border-bottom: 1px solid var(--border); }
.picker-search .input { height: 36px; }
.picker-list { max-height: 280px; overflow-y: auto; padding: 6px; }
.picker-cat { font-size: 11px; font-weight: 800; color: var(--text-muted); padding: 8px 8px 4px; text-transform: uppercase; }
.picker-item { display: flex; align-items: center; gap: 9px; padding: 7px 9px; border-radius: 7px; cursor: pointer; font-weight: 600; font-size: 13px; }
.picker-item:hover, .picker-item.hl { background: var(--bg-hover); }
.picker-item.sel { background: var(--accent-soft); color: #fff; }
.picker-item .ci { width: 18px; text-align: center; color: var(--text-muted); }
.picker-item .check { margin-right: auto; color: var(--accent); }
.picker-item.action { color: #8ea1ff; }
.picker-item.action .ci { color: #8ea1ff; }
.picker-empty { padding: 16px; text-align: center; color: var(--text-muted); font-size: 12.5px; }
.picker-manual { padding: 8px; border-top: 1px solid var(--border); display: flex; gap: 6px; }
.picker-manual .input { height: 34px; direction: ltr; text-align: left; }
.chip { display: inline-flex; align-items: center; gap: 6px; background: var(--bg-hover); border: 1px solid var(--border); padding: 1px 6px 1px 9px; border-radius: 7px; font-size: 12.5px; font-weight: 600; }
.chip .x { cursor: pointer; color: var(--text-muted); width: 16px; height: 16px; display: grid; place-items: center; border-radius: 4px; }
.chip .x:hover { background: var(--danger-soft); color: var(--danger); }
.rdot { width: 11px; height: 11px; border-radius: 50%; flex-shrink: 0; background: #99aab5; }
.ch-name { display: inline-flex; gap: 6px; align-items: center; }
.ch-name i { color: var(--text-muted); font-size: 12px; }
.missing { color: var(--danger); }

/* ============ الإحصائيات ============ */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 16px; }
.stat {
    background: var(--bg-card); border: 1px solid var(--border); border-radius: 14px; padding: 16px 18px; position: relative; overflow: hidden;
    transition: border-color .2s, transform .2s; animation: rise .35s ease both;
}
.stat:hover { border-color: var(--border-strong); transform: translateY(-2px); }
.stat .k { color: var(--text-muted); font-size: 12.5px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.stat .k i { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-size: 13px; }
.stat .v { font-size: 28px; font-weight: 900; margin-top: 8px; letter-spacing: -.5px; font-variant-numeric: tabular-nums; }
.stat .s { color: var(--text-muted); font-size: 12px; }
.stat .s b { color: var(--text-soft); }

.chart-card { padding: 18px; }
.chart-title { display: flex; align-items: baseline; gap: 10px; margin-bottom: 12px; }
.chart-title h3 { font-size: 15px; font-weight: 800; }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--text-soft); margin-right: auto; }
.legend span { display: flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.chart { position: relative; height: 200px; direction: ltr; }
.chart svg { width: 100%; height: 100%; display: block; overflow: visible; }
.chart .grid line { stroke: #222937; stroke-width: 1; }
.chart .axis text { fill: var(--text-muted); font-size: 11px; font-family: Cairo, sans-serif; }
.chart rect.bar { transition: opacity .15s; }
.chart .hit { fill: transparent; cursor: pointer; }
.chart .hit:hover + rect.bar, .chart rect.bar.hover { opacity: .75; }
.tooltip {
    position: absolute; pointer-events: none; background: #0d1119; border: 1px solid var(--border-strong); border-radius: 9px; padding: 8px 11px;
    font-size: 12px; white-space: nowrap; box-shadow: var(--shadow); z-index: 5; direction: rtl; transform: translate(-50%, -100%); margin-top: -8px;
}
.tooltip b { font-variant-numeric: tabular-nums; }
.list-row { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--border); }
.list-row:last-child { border-bottom: none; }
.list-row .av { width: 34px; height: 34px; border-radius: 50%; background: var(--bg-hover); flex-shrink: 0; object-fit: cover; display: grid; place-items: center; font-weight: 800; color: var(--text-muted); }
.list-row .nm { font-weight: 700; font-size: 13.5px; }
.list-row .val { margin-right: auto; font-weight: 800; font-variant-numeric: tabular-nums; }
.rank-badge { width: 26px; height: 26px; border-radius: 8px; background: var(--bg-hover); display: grid; place-items: center; font-weight: 800; font-size: 12px; flex-shrink: 0; }
.rank-badge.r1 { background: rgba(241, 196, 15, .18); color: #f1c40f; }
.rank-badge.r2 { background: rgba(189, 195, 199, .15); color: #cfd6da; }
.rank-badge.r3 { background: rgba(205, 127, 50, .18); color: #e0914a; }
.progress { height: 6px; background: var(--bg-hover); border-radius: 6px; overflow: hidden; margin-top: 5px; }
.progress > div { height: 100%; background: var(--accent); border-radius: 6px; }
.empty { text-align: center; color: var(--text-muted); padding: 28px 10px; font-size: 13px; }
.empty i { display: block; font-size: 26px; margin-bottom: 8px; color: var(--border-strong); }

/* جداول */
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th { text-align: right; color: var(--text-muted); font-weight: 700; font-size: 12px; padding: 8px 10px; border-bottom: 1px solid var(--border); }
.table td { padding: 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: rgba(255, 255, 255, .015); }
.tag { display: inline-flex; align-items: center; gap: 5px; padding: 1px 9px; border-radius: 6px; font-size: 11.5px; font-weight: 700; background: var(--bg-hover); color: var(--text-soft); }
.tag.green { background: var(--success-soft); color: var(--success); }
.tag.red { background: var(--danger-soft); color: var(--danger); }
.tag.yellow { background: var(--warning-soft); color: var(--warning); }
.tag.blue { background: var(--accent-soft); color: #8ea1ff; }

/* عناصر قابلة للتكرار (ردود تلقائية، لوحات...) */
.item-card { background: var(--bg-input); border: 1px solid var(--border); border-radius: 11px; margin-bottom: 10px; transition: border-color .15s; }
.item-card:hover { border-color: var(--border-strong); }
.item-card .ih { display: flex; align-items: center; gap: 10px; padding: 11px 13px; cursor: pointer; }
.item-card .ih .ttl { font-weight: 800; font-size: 13.5px; }
.item-card .ib { padding: 14px; border-top: 1px solid var(--border); }
.add-row { border: 2px dashed var(--border); border-radius: 11px; padding: 13px; display: flex; align-items: center; justify-content: center; gap: 8px; color: var(--text-muted); font-weight: 700; cursor: pointer; transition: .15s; background: none; width: 100%; }
.add-row:hover { border-color: var(--accent); color: #fff; background: var(--accent-soft); }

.tags-input { display: flex; flex-wrap: wrap; gap: 6px; background: var(--bg-input); border: 1px solid var(--border); border-radius: 9px; padding: 6px 8px; min-height: 40px; align-items: center; }
.tags-input input { border: none; background: transparent; outline: none; flex: 1; min-width: 120px; height: 26px; color: var(--text-main); }
.tags-input:focus-within { border-color: var(--accent); }

/* ============ شريط الحفظ ============ */
.savebar {
    position: fixed; bottom: 22px; left: 50%; transform: translate(-50%, 140%); z-index: 90; width: min(720px, calc(100% - 32px));
    background: #0d1119; border: 1px solid var(--border-strong); border-radius: 14px; padding: 11px 12px 11px 11px; display: flex; align-items: center; gap: 12px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, .55); transition: transform .35s cubic-bezier(.2, 1.3, .4, 1);
}
.savebar.show { transform: translate(-50%, 0); }
.savebar.shake { animation: shake .45s; background: #2a1215; border-color: var(--danger); }
.savebar .msg { font-weight: 800; font-size: 13.5px; padding-right: 6px; }
@keyframes shake { 20%, 60% { transform: translate(calc(-50% - 8px), 0); } 40%, 80% { transform: translate(calc(-50% + 8px), 0); } }
@media (min-width: 901px) { .savebar { left: calc(50% - 136px); } }

/* ============ النوافذ المنبثقة ============ */
.modal-back { position: fixed; inset: 0; background: rgba(3, 5, 10, .72); z-index: 100; display: flex; align-items: center; justify-content: center; padding: 20px; animation: fade .15s ease; backdrop-filter: blur(3px); }
@keyframes fade { from { opacity: 0; } }
.modal { background: var(--bg-sidebar); border: 1px solid var(--border-strong); border-radius: 16px; width: min(520px, 100%); max-height: calc(100vh - 40px); display: flex; flex-direction: column; box-shadow: 0 30px 80px rgba(0, 0, 0, .6); animation: modalIn .22s cubic-bezier(.2, 1.2, .4, 1); }
.modal.wide { width: min(980px, 100%); height: min(720px, calc(100vh - 40px)); }
.modal.mid { width: min(680px, 100%); }
@keyframes modalIn { from { opacity: 0; transform: scale(.95) translateY(10px); } }
.modal-head { display: flex; align-items: center; gap: 10px; padding: 18px 20px 12px; }
.modal-head h2 { font-size: 18px; font-weight: 900; }
.modal-head .sub { color: var(--text-muted); font-size: 12.5px; }
.modal-head .icon-btn { margin-right: auto; }
.modal-body { padding: 6px 20px 18px; overflow-y: auto; flex: 1; }
.modal-foot { display: flex; gap: 10px; justify-content: flex-start; padding: 14px 20px; background: var(--bg-dark); border-top: 1px solid var(--border); border-radius: 0 0 16px 16px; flex-direction: row-reverse; }

/* نوع الروم (مثل ديسكورد) */
.type-list { display: flex; flex-direction: column; gap: 8px; }
.type-opt { display: flex; align-items: center; gap: 12px; padding: 11px 14px; background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px; cursor: pointer; transition: .15s; }
.type-opt:hover { background: var(--bg-hover); }
.type-opt.on { border-color: var(--accent); background: var(--accent-soft); }
.type-opt .ti { font-size: 20px; width: 28px; text-align: center; color: var(--text-soft); }
.type-opt .tt { font-weight: 800; }
.type-opt .td { color: var(--text-muted); font-size: 12px; }
.type-opt .radio { margin-right: auto; width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--text-muted); display: grid; place-items: center; }
.type-opt.on .radio { border-color: var(--accent); }
.type-opt.on .radio::after { content: ''; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
.name-preview { display: flex; align-items: center; gap: 8px; background: var(--bg-input); border: 1px solid var(--border); border-radius: 9px; padding: 0 12px; height: 42px; }
.name-preview:focus-within { border-color: var(--accent); }
.name-preview i { color: var(--text-muted); }
.name-preview input { flex: 1; background: none; border: none; outline: none; height: 100%; }

/* محرر الصلاحيات (ثلاثي الحالة مثل ديسكورد) */
.perm-layout { display: grid; grid-template-columns: 240px 1fr; gap: 0; height: 100%; min-height: 0; }
.perm-targets { border-left: 1px solid var(--border); padding: 0 0 0 12px; overflow-y: auto; }
.perm-target { display: flex; align-items: center; gap: 8px; padding: 7px 9px; border-radius: 8px; cursor: pointer; font-weight: 600; font-size: 13px; margin-bottom: 2px; }
.perm-target:hover { background: var(--bg-hover); }
.perm-target.on { background: var(--accent-soft); color: #fff; }
.perm-target .rm { margin-right: auto; opacity: 0; }
.perm-target:hover .rm { opacity: 1; }
.perm-target img { width: 20px; height: 20px; border-radius: 50%; }
.perm-list { padding: 0 16px 0 0; overflow-y: auto; }
.perm-group-title { font-size: 12px; font-weight: 800; color: var(--text-muted); margin: 16px 0 4px; }
.perm-group-title:first-child { margin-top: 0; }
.perm-row { display: flex; align-items: center; gap: 14px; padding: 11px 0; border-bottom: 1px solid var(--border); }
.perm-row .pn { font-weight: 700; font-size: 13.5px; }
.perm-row .pd { color: var(--text-muted); font-size: 12px; }
.perm-row .pk { color: #545d6a; font-size: 10.5px; direction: ltr; font-family: ui-monospace, Consolas, monospace; }
.tri { display: inline-flex; border: 1px solid var(--border-strong); border-radius: 8px; overflow: hidden; flex-shrink: 0; margin-right: auto; }
.tri button { width: 34px; height: 30px; border: none; background: var(--bg-input); color: var(--text-muted); cursor: pointer; font-size: 13px; transition: .12s; }
.tri button + button { border-right: 1px solid var(--border-strong); }
.tri button:hover { color: #fff; }
.tri button.deny.on { background: var(--danger); color: #fff; }
.tri button.neutral.on { background: #4e5566; color: #fff; }
.tri button.allow.on { background: #238636; color: #fff; }
.perm-row.danger .pn { color: #ff8a84; }

/* ============ إدارة السيرفر (قائمة ديسكورد) ============ */
.builder { display: grid; grid-template-columns: 360px 1fr; gap: 16px; align-items: start; }
.dc-list { background: #0f131b; border: 1px solid var(--border); border-radius: 14px; padding: 10px 8px 14px; max-height: calc(100vh - 250px); overflow-y: auto; }
.dc-cat { display: flex; align-items: center; gap: 4px; padding: 14px 6px 4px; font-size: 12px; font-weight: 800; color: var(--text-muted); cursor: pointer; text-transform: uppercase; user-select: none; }
.dc-cat:hover { color: var(--text-main); }
.dc-cat .chev { font-size: 9px; width: 12px; transition: transform .15s; }
.dc-cat.closed .chev { transform: rotate(90deg); }
.dc-cat .acts, .dc-ch .acts { margin-right: auto; display: flex; gap: 2px; opacity: 0; transition: opacity .12s; }
.dc-cat:hover .acts, .dc-ch:hover .acts { opacity: 1; }
.dc-cat .acts .icon-btn, .dc-ch .acts .icon-btn { width: 24px; height: 24px; font-size: 11.5px; }
.dc-ch { display: flex; align-items: center; gap: 7px; padding: 6px 9px; margin: 1px 0 1px 0; margin-right: 8px; border-radius: 7px; color: #949ba4; font-weight: 600; cursor: pointer; position: relative; font-size: 14px; }
.dc-ch:hover { background: #1e2330; color: #dbdee1; }
.dc-ch.sel { background: #262c3b; color: #fff; }
.dc-ch > i { width: 18px; text-align: center; font-size: 14px; }
.dc-ch .nm { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dc-ch.new { color: #7ee2a0; }
.dc-ch.edited .nm::after, .dc-cat.edited .nm::after { content: ' •'; color: var(--warning); }
.dc-ch.deleted, .dc-cat.deleted { text-decoration: line-through; opacity: .5; }
.dc-voice-members { margin: 0 34px 4px 0; }
.dc-voice-members div { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: #949ba4; padding: 2px 0; }
.dc-voice-members img { width: 20px; height: 20px; border-radius: 50%; }
.dc-ch.dragging, .dc-cat.dragging { opacity: .35; }
.drop-before { box-shadow: 0 -2px 0 0 var(--accent); }
.drop-into { background: var(--accent-soft) !important; outline: 1px dashed var(--accent); }
.role-row { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 9px; cursor: pointer; font-weight: 700; transition: .12s; border: 1px solid transparent; }
.role-row:hover { background: var(--bg-hover); }
.role-row.sel { background: var(--accent-soft); border-color: rgba(88, 101, 242, .35); }
.role-row .cnt { color: var(--text-muted); font-size: 12px; font-weight: 600; margin-right: auto; display: flex; gap: 6px; align-items: center; }
.role-row.new .nm { color: #7ee2a0; }
.role-row.deleted { text-decoration: line-through; opacity: .5; }
.role-row.edited .nm::after { content: ' •'; color: var(--warning); }
.detail-panel { position: sticky; top: 0; }
.swatches { display: flex; flex-wrap: wrap; gap: 7px; }
.swatch { width: 30px; height: 30px; border-radius: 8px; cursor: pointer; border: 2px solid transparent; transition: transform .1s; position: relative; }
.swatch:hover { transform: scale(1.1); }
.swatch.on { border-color: #fff; }
.swatch.default { background: #99aab5; }
.color-input { display: flex; align-items: center; gap: 8px; }
.color-input input[type=color] { width: 40px; height: 40px; border: 1px solid var(--border); border-radius: 9px; background: var(--bg-input); padding: 3px; cursor: pointer; }
.color-input .input { direction: ltr; text-align: left; font-family: ui-monospace, Consolas, monospace; }

/* ============ معاينة رسالة ديسكورد ============ */
.dc-preview { background: #313338; border-radius: 10px; padding: 14px 16px; direction: ltr; text-align: left; font-family: 'Cairo', 'gg sans', sans-serif; }
.dc-msg { display: flex; gap: 14px; }
.dc-msg .dav { width: 40px; height: 40px; border-radius: 50%; background: var(--accent); flex-shrink: 0; display: grid; place-items: center; color: #fff; overflow: hidden; }
.dc-msg .dav img { width: 100%; height: 100%; }
.dc-msg .dname { font-weight: 700; color: #f2f3f5; font-size: 15px; }
.dc-msg .dname .botb { background: #5865F2; color: #fff; font-size: 10px; padding: 0 5px; border-radius: 4px; margin-left: 5px; vertical-align: middle; font-weight: 700; }
.dc-msg .dtime { color: #949ba4; font-size: 11.5px; margin-left: 6px; font-weight: 500; }
.dc-content { color: #dbdee1; white-space: pre-wrap; word-break: break-word; direction: auto; unicode-bidi: plaintext; text-align: start; }
.dc-embed { margin-top: 6px; background: #2b2d31; border-radius: 4px; border-left: 4px solid #5865F2; padding: 10px 14px 14px 12px; max-width: 520px; display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.dc-embed .ea { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; color: #f2f3f5; }
.dc-embed .ea img { width: 24px; height: 24px; border-radius: 50%; }
.dc-embed .et { font-weight: 700; color: #f2f3f5; font-size: 15px; }
.dc-embed .et.link { color: #00a8fc; }
.dc-embed .ed { color: #dbdee1; font-size: 14px; white-space: pre-wrap; word-break: break-word; direction: auto; unicode-bidi: plaintext; text-align: start; }
.dc-embed .ef { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.dc-embed .ef > div { grid-column: 1 / -1; }
.dc-embed .ef > div.inl { grid-column: auto; }
.dc-embed .ef b { display: block; color: #f2f3f5; font-size: 13px; }
.dc-embed .ef span { color: #dbdee1; font-size: 13px; white-space: pre-wrap; }
.dc-embed .ei { max-width: 100%; border-radius: 4px; margin-top: 8px; grid-column: 1 / -1; }
.dc-embed .eth { width: 80px; height: 80px; border-radius: 4px; object-fit: cover; }
.dc-embed .eft { font-size: 12px; color: #b5bac1; grid-column: 1 / -1; display: flex; gap: 6px; align-items: center; }
.dc-buttons { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.dc-btn { background: #4e5058; color: #fff; padding: 5px 14px; border-radius: 4px; font-size: 13.5px; font-weight: 600; display: inline-flex; gap: 6px; align-items: center; }
.dc-btn.primary { background: #5865F2; }
.dc-btn.success { background: #248046; }
.dc-btn.danger { background: #da373c; }
.dc-mention { background: rgba(88, 101, 242, .3); color: #c9cdfb; border-radius: 3px; padding: 0 2px; font-weight: 500; }
.welcome-img { width: 100%; border-radius: 8px; margin-top: 6px; display: block; max-width: 460px; }

/* ============ ملف البوت ============ */
.img-pick { display: flex; gap: 14px; align-items: center; }
.img-thumb { width: 84px; height: 84px; border-radius: 50%; background: var(--bg-hover) center / cover no-repeat; flex-shrink: 0; display: grid; place-items: center; color: var(--text-muted); font-size: 26px; border: 2px solid var(--border-strong); }
.img-thumb.wide { width: 170px; height: 60px; border-radius: 10px; font-size: 12px; }
.dc-profile { background: #232428; border-radius: 14px; overflow: hidden; max-width: 340px; margin: 0 auto; box-shadow: 0 10px 30px rgba(0, 0, 0, .35); direction: ltr; text-align: left; }
.dp-banner { height: 120px; background: var(--accent) center / cover no-repeat; }
.dp-avatar { width: 92px; height: 92px; border-radius: 50%; border: 6px solid #232428; margin: -46px 0 0 16px; background: var(--accent); overflow: hidden; display: grid; place-items: center; color: #fff; font-size: 34px; position: relative; }
.dp-avatar img { width: 100%; height: 100%; object-fit: cover; }
.dp-body { padding: 8px 16px 18px; }
.dp-name { font-size: 20px; font-weight: 800; color: #f2f3f5; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; unicode-bidi: plaintext; }
.dp-name .botb { background: #5865F2; color: #fff; font-size: 10px; padding: 1px 5px; border-radius: 4px; font-weight: 700; }
.dp-user { color: #b5bac1; font-size: 13.5px; }
.dp-bio { margin-top: 12px; background: #111214; border-radius: 8px; padding: 10px 12px; color: #dbdee1; font-size: 13.5px; white-space: pre-wrap; direction: auto; unicode-bidi: plaintext; text-align: start; }

/* ============ الإيموجيات والملصقات ============ */
.emoji-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; }
.emoji-tile { background: var(--bg-input); border: 1px solid var(--border); border-radius: 12px; padding: 12px 8px 8px; display: flex; flex-direction: column; align-items: center; gap: 6px; transition: border-color .15s, transform .15s; }
.emoji-tile:hover { border-color: var(--border-strong); transform: translateY(-2px); }
.emoji-tile img { width: 48px; height: 48px; object-fit: contain; }
.emoji-name { width: 100%; background: transparent; border: 1px solid transparent; border-radius: 6px; text-align: center; font-size: 12px; color: var(--text-soft); padding: 2px 4px; outline: none; font-family: ui-monospace, Consolas, monospace; }
.emoji-name:hover, .emoji-name:focus { border-color: var(--border-strong); background: var(--bg-card); }
.sticker-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.sticker-tile { background: var(--bg-input); border: 1px solid var(--border); border-radius: 12px; padding: 12px; display: grid; gap: 8px; }
.sticker-tile img { width: 120px; height: 120px; object-fit: contain; margin: 0 auto; display: block; }
.sticker-tile .input { height: 34px; font-size: 12.5px; }

/* ============ المشغل ============ */
.np { display: flex; gap: 18px; align-items: center; }
.np-thumb { width: 170px; height: 110px; border-radius: 12px; object-fit: cover; background: var(--bg-hover); display: grid; place-items: center; font-size: 34px; color: var(--text-muted); flex-shrink: 0; box-shadow: 0 10px 24px rgba(0, 0, 0, .35); }
.np-title { display: block; font-size: 17px; font-weight: 800; color: var(--text-main); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin: 2px 0; }
.np-title:hover { color: #8ea1ff; }
input[type=range] { accent-color: var(--accent); }
@media (max-width: 700px) { .np { flex-direction: column; align-items: stretch; } .np-thumb { width: 100%; height: 160px; } }

/* ============ إشعارات منبثقة ============ */
.toasts { position: fixed; top: 18px; left: 18px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast {
    background: var(--bg-elev); border: 1px solid var(--border-strong); border-right: 4px solid var(--accent); border-radius: 10px; padding: 11px 15px;
    min-width: 260px; max-width: 380px; box-shadow: var(--shadow); font-weight: 600; font-size: 13px; display: flex; gap: 10px; align-items: flex-start; animation: toastIn .3s cubic-bezier(.2, 1.3, .4, 1);
}
.toast.ok { border-right-color: var(--success); }
.toast.ok i { color: var(--success); }
.toast.err { border-right-color: var(--danger); }
.toast.err i { color: var(--danger); }
.toast i { margin-top: 3px; }
.toast.out { animation: toastOut .25s ease forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateX(-30px); } }
@keyframes toastOut { to { opacity: 0; transform: translateX(-30px); } }

.skeleton { background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-hover) 50%, var(--bg-card) 75%); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: 12px; }
@keyframes shimmer { to { background-position: -200% 0; } }
.loading-page { display: flex; flex-direction: column; gap: 14px; }

.banner-offline { background: var(--danger-soft); border: 1px solid rgba(248, 81, 73, .35); color: #ffb3ae; padding: 10px 14px; border-radius: 11px; margin-bottom: 16px; display: flex; gap: 10px; align-items: center; font-weight: 600; }

/* ============ الجوال ============ */
@media (max-width: 1100px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .builder { grid-template-columns: 1fr; }
    .dc-list { max-height: none; }
}
@media (max-width: 900px) {
    .sidebar { position: fixed; top: 0; bottom: 0; right: 0; z-index: 80; transform: translateX(100%); box-shadow: var(--shadow); }
    .sidebar.open { transform: none; }
    .menu-toggle { display: inline-flex; }
    .content { padding: 18px 16px 120px; }
    .topbar { padding: 0 14px; }
    .grid-2, .grid-3 { grid-template-columns: 1fr; }
    .perm-layout { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
    .perm-targets { border-left: none; border-bottom: 1px solid var(--border); padding: 0 0 10px; max-height: 150px; }
    .perm-list { padding: 10px 0 0; }
    .page-head { flex-wrap: wrap; }
    .page-head .head-actions { margin-right: 0; width: 100%; }
    .topbar .crumbs > span, .topbar .crumbs > i { display: none; }
    .status-pill { white-space: nowrap; }
    .modal.wide { height: calc(100vh - 40px); }
}
@media (max-width: 520px) {
    .stats-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
    .stat .v { font-size: 22px; }
    .hero h1 { font-size: 26px; }
}

/* إعدادات كل أمر */
.cmd-item { border-bottom: 1px solid var(--border); }
.cmd-item:last-child { border-bottom: none; }
.cmd-item > .toggle-row { border-bottom: none; padding: 12px 0; }
.cmd-item .grow .d { margin-bottom: 3px; }
.cmd-panel { background: var(--bg-hover); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; margin: 0 0 14px; animation: popUp .18s ease; }
.icon-btn.on { background: var(--accent-soft); color: var(--accent); }
.tag.purple { background: rgba(139, 92, 246, .14); color: #a78bfa; }

/* ============ إدارة الأعضاء ============ */
.mem-list { margin-top: 10px; }
.mem-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; cursor: pointer; transition: background .15s; }
.mem-row:hover { background: var(--bg-hover); }
.mem-row .av { width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0; background: var(--bg-elev); }
.mem-row .nm { font-weight: 700; font-size: 14px; display: flex; align-items: center; flex-wrap: wrap; gap: 2px; }
.mem-roles { gap: 5px; max-width: 42%; justify-content: flex-end; }
.mem-date { width: 90px; text-align: left; }
.role-chip { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 999px; background: var(--bg-elev); border: 1px solid var(--border); font-size: 11.5px; white-space: nowrap; max-width: 140px; overflow: hidden; text-overflow: ellipsis; }
.role-chip i, .role-pick i { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.mem-roles-pick { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; max-height: 220px; overflow-y: auto; padding: 2px; }
.role-pick { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 999px; border: 1px solid var(--border); background: var(--bg-input); font-size: 12.5px; cursor: pointer; user-select: none; transition: .15s; }
.role-pick input { display: none; }
.role-pick.on { border-color: var(--accent); background: var(--accent-soft); }
.role-pick.off { opacity: .45; cursor: not-allowed; }
.mem-actions { border-top: 1px solid var(--border); margin-top: 16px; padding-top: 14px; }
@media (max-width: 700px) { .mem-roles, .mem-date { display: none; } }
.sub-msg { border: 1px solid var(--border); background: var(--bg-input); border-radius: 12px; padding: 12px; margin-bottom: 10px; }
/* تعديل جماعي للأوامر */
.bulk-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.bulk-list { max-height: 55vh; overflow-y: auto; padding-left: 4px; }
.bulk-cat { margin-bottom: 12px; }
.bulk-cat-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; cursor: pointer; }
.bulk-cmds { display: flex; flex-wrap: wrap; gap: 6px; }
.bulk-cmds .role-pick { font-family: ui-monospace, monospace; font-size: 12px; }
@media (max-width: 800px) { .bulk-grid { grid-template-columns: 1fr; } }
.swatch-item { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 70px; cursor: pointer; opacity: .55; transition: opacity .15s; }
.swatch-item.on { opacity: 1; }
.swatch-item span { font-size: 11px; color: var(--text-soft); text-align: center; line-height: 1.2; }
