/* ===========================================
   Safeguard Dashboard — Design System v5 "Violet Neon"
   مأخوذ من هوية لوجو البوت: خلفية سوداء-نيلية عميقة + بنفسجي نيون مضيء + فضي/أبيض
   نظام مسافات موحّد (4px scale) عشان مفيش تباعد مكسور ولا تداخل
   =========================================== */

@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans+Arabic:wght@400;500;600;700&family=Exo+2:ital,wght@1,700;1,800&family=IBM+Plex+Mono:wght@400;500&display=swap');

:root {
    /* ألوان اللوجو */
    --bg: #0b0418;
    --bg-2: #110826;
    --surface: #170c32;
    --surface-2: #1e1040;
    --surface-3: #291657;

    /* ألوان قابلة للتغيير من صفحة الأونر (بتتغير عن طريق /theme.css) */
    --primary-rgb: 124, 58, 237;
    --accent-rgb: 167, 139, 250;
    --nav-1-rgb: 26, 12, 52;
    --nav-2-rgb: 15, 7, 32;
    --bg-top: #14082b;
    --violet-300: #C4B5FD;
    --violet-400: #A78BFA;
    --violet-500: #8B5CF6;
    --violet-600: #7C3AED;
    --violet-700: #6D28D9;
    --silver: #EEE9FF;
    --lavender: #E4DCFF;

    --text: #F4F0FF;
    --text-muted: #ADA3CC;
    --text-faint: #71688F;

    --line: rgba(var(--accent-rgb), 0.16);
    --line-strong: rgba(var(--accent-rgb), 0.28);
    --fill: rgba(var(--accent-rgb), 0.06);
    --fill-hover: rgba(var(--accent-rgb), 0.11);

    --primary: var(--violet-400);
    --primary-dim: rgba(var(--primary-rgb), 0.16);
    --primary-border: rgba(var(--accent-rgb), 0.45);
    --on-primary: #FFFFFF;

    --success: #4ADE80;
    --success-dim: rgba(74, 222, 128, 0.12);
    --danger: #FB7185;
    --danger-dim: rgba(251, 113, 133, 0.13);
    --danger-border: rgba(251, 113, 133, 0.42);
    --gold: #FBBF24;
    --gold-dim: rgba(251, 191, 36, 0.13);
    --gold-border: rgba(251, 191, 36, 0.4);

    --grad-primary: linear-gradient(135deg, var(--violet-600) 0%, var(--violet-500) 55%, var(--violet-400) 100%);
    --glow: 0 0 0 1px rgba(var(--accent-rgb),0.30), 0 8px 28px rgba(var(--primary-rgb),0.28);

    /* مقياس مسافات موحّد */
    --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 20px; --sp-6: 24px; --sp-8: 32px;

    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 16px;

    --shadow-sm: 0 1px 2px rgba(0,0,0,0.45);
    --shadow-md: 0 14px 36px rgba(0,0,0,0.55);

    --font: 'IBM Plex Sans Arabic', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --font-brand: 'Exo 2', 'IBM Plex Sans Arabic', sans-serif;
    --mono: 'IBM Plex Mono', ui-monospace, monospace;

    --ease: cubic-bezier(.2,.8,.2,1);

    /* أسماء قديمة لسه مستخدمة في ملفات تانية (login.html وغيره) */
    --glass: var(--fill);
    --glass-hover: var(--fill-hover);
    --glass-border: var(--line);
    --glass-border-strong: var(--line-strong);
    --surface-solid: var(--surface);
    --surface-solid-2: var(--surface-2);
    --radius-xl: 20px;
    --shadow-glow: var(--glow);
    --font-head: var(--font);
    --info: var(--violet-300);
    --primary-2: var(--violet-300);
}

*, *::before, *::after { box-sizing: border-box; }
html { color-scheme: dark; scroll-behavior: smooth; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--text); font-family: var(--font); -webkit-font-smoothing: antialiased; }
html[lang="ar"] *, html[lang="ar"] *::before, html[lang="ar"] *::after { letter-spacing: 0 !important; }

body { min-height: 100vh; font-size: 14px; line-height: 1.6; position: relative; overflow-x: hidden; }

/* الإضاءة المحيطة: توهج بنفسجي زي حلقة اللوجو + نجوم خفيفة */
body::before {
    content: ""; position: fixed; inset: 0; z-index: -2;
    background:
        linear-gradient(118deg, transparent 38%, rgba(var(--accent-rgb),0.055) 50%, transparent 62%),
        radial-gradient(1000px 560px at 50% -12%, rgba(var(--primary-rgb),0.42), transparent 66%),
        radial-gradient(720px 500px at 108% 38%, rgba(var(--primary-rgb),0.20), transparent 62%),
        radial-gradient(640px 440px at -6% 88%, rgba(var(--primary-rgb),0.24), transparent 62%),
        linear-gradient(180deg, var(--bg-top, #14082b) 0%, var(--bg) 70%);
}
body::after {
    content: ""; position: fixed; inset: 0; z-index: -1; opacity: .5; pointer-events: none;
    background-image:
        radial-gradient(1.2px 1.2px at 12% 18%, rgba(var(--accent-rgb),.7), transparent),
        radial-gradient(1px 1px at 78% 12%, rgba(255,255,255,.6), transparent),
        radial-gradient(1.4px 1.4px at 88% 62%, rgba(var(--accent-rgb),.6), transparent),
        radial-gradient(1px 1px at 30% 78%, rgba(255,255,255,.5), transparent),
        radial-gradient(1.2px 1.2px at 56% 40%, rgba(var(--accent-rgb),.45), transparent),
        radial-gradient(1px 1px at 6% 52%, rgba(255,255,255,.5), transparent);
}

h1, h2, h3, h4 { font-family: var(--font); margin: 0; }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--violet-300); }
button { font-family: inherit; }
::selection { background: rgba(var(--primary-rgb),.45); color: #fff; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* scrollbar */
* { scrollbar-width: thin; scrollbar-color: var(--surface-3) transparent; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: var(--violet-700); }

@keyframes content-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
.content-fade { animation: content-in .32s var(--ease); }

/* ========== البراند (لوجو + اسم) ========== */
.brand-logo { width: 38px; height: 38px; border-radius: 11px; flex-shrink: 0; box-shadow: var(--glow); object-fit: cover; display: block; }
.brand-name { font-family: var(--font-brand); font-style: italic; font-weight: 800; font-size: 19px; line-height: 1;
    background: linear-gradient(180deg, #FFFFFF 0%, #C4B5FD 100%); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ========== الهيكل: sidebar + main ========== */
.shell { display: flex; min-height: 100vh; }
.sidebar {
    width: 264px; flex-shrink: 0; height: 100vh; position: sticky; top: 0; z-index: 20;
    background: linear-gradient(180deg, rgba(15,11,31,.96), rgba(var(--nav-2-rgb),.98));
    border-inline-end: 1px solid var(--line);
    padding: var(--sp-5) var(--sp-4);
    display: flex; flex-direction: column; gap: var(--sp-4);
    overflow-y: auto;
}
.sidebar-brand { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-1) var(--sp-2) var(--sp-2); }

.sidebar-guild { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-3); border: 1px solid var(--line); border-radius: var(--radius); background: var(--fill); min-width: 0; }
.sidebar-guild img { width: 36px; height: 36px; border-radius: 10px; object-fit: cover; flex-shrink: 0; background: var(--surface-3); }
.sidebar-guild > div { min-width: 0; flex: 1; }
.sidebar-guild .name { font-weight: 600; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-guild .members { font-size: 11px; color: var(--text-muted); font-family: var(--mono); }

.nav { display: flex; flex-direction: column; gap: var(--sp-1); flex: 1; }
.nav-item {
    position: relative; display: flex; align-items: center; gap: var(--sp-3);
    padding: 10px var(--sp-3); border-radius: var(--radius-sm); border: 1px solid transparent;
    background: transparent; color: var(--text-muted); font-size: 13.5px; font-weight: 500; text-align: start;
    cursor: pointer; width: 100%; transition: background .18s var(--ease), color .18s var(--ease), border-color .18s var(--ease);
}
.nav-item:hover { background: var(--fill); color: var(--text); }
.nav-item:active { transform: scale(.985); }
.nav-item .icon { width: 20px; text-align: center; flex-shrink: 0; font-size: 14px; opacity: .85; }
.nav-item.active { background: var(--primary-dim); color: var(--violet-300); border-color: var(--primary-border); box-shadow: inset 0 0 18px rgba(var(--primary-rgb),.18); }
.nav-item.active .icon { opacity: 1; }
.nav-item.active::before { content: ""; position: absolute; inset-inline-start: -1px; top: 24%; bottom: 24%; width: 3px; border-radius: 3px; background: var(--grad-primary); box-shadow: 0 0 10px var(--violet-500); }

.sidebar-footer { display: flex; align-items: center; gap: var(--sp-2); padding-top: var(--sp-4); border-top: 1px solid var(--line); min-width: 0; }
.sidebar-footer img { width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0; background: var(--surface-3); border: 1px solid var(--line-strong); }
.sidebar-footer .user-name { flex: 1; min-width: 0; font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-footer .logout-btn { width: 32px; height: 32px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; background: var(--fill); border: 1px solid var(--line); border-radius: var(--radius-sm); color: var(--text-muted); cursor: pointer; transition: all .15s var(--ease); }
.sidebar-footer .logout-btn:hover { color: var(--danger); background: var(--danger-dim); border-color: var(--danger-border); }

.shell > .main { flex: 1; min-width: 0; padding: var(--sp-8) 40px 56px; }
.shell > .main > #content { max-width: 980px; margin-inline: auto; }

/* ========== الصفحات (servers/owner) ========== */
.page { padding: var(--sp-8) 40px 56px; max-width: 1120px; margin: 0 auto; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-4); padding: var(--sp-4) 40px; border-bottom: 1px solid var(--line); background: rgba(var(--nav-2-rgb),.7); backdrop-filter: blur(14px); position: sticky; top: 0; z-index: 30; }
.topbar .brand { display: flex; align-items: center; gap: var(--sp-3); }
.topbar .user { display: flex; align-items: center; gap: var(--sp-2); }
.topbar .user img { width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--line-strong); }

.page-header { margin-bottom: var(--sp-6); display: flex; align-items: flex-end; justify-content: space-between; gap: var(--sp-4); flex-wrap: wrap; }
.page-header h1 { font-size: 26px; font-weight: 700; line-height: 1.25; margin: 0 0 var(--sp-1); }
.page-header p { margin: 0; color: var(--text-muted); font-size: 13.5px; }

.lang-switch { display: inline-flex; background: var(--fill); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 3px; gap: 2px; }
.lang-switch button { padding: 5px 12px; border: 0; background: transparent; color: var(--text-muted); border-radius: 6px; cursor: pointer; font-size: 12px; font-weight: 600; }
.lang-switch button.active { background: var(--grad-primary); color: var(--on-primary); }

/* ========== البانل ========== */
.panel {
    position: relative; background: linear-gradient(180deg, var(--surface-2), var(--surface));
    border: 1px solid var(--line); border-radius: var(--radius-lg);
    padding: var(--sp-6); margin-bottom: var(--sp-5); box-shadow: var(--shadow-sm);
    transition: border-color .2s var(--ease);
}
.panel:hover { border-color: var(--line-strong); }
.panel::before { content: ""; position: absolute; top: -1px; inset-inline: 28px; height: 1px; background: linear-gradient(90deg, transparent, var(--violet-400), transparent); opacity: .55; pointer-events: none; }
.panel-header { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); margin-bottom: var(--sp-4); min-height: 32px; }
.panel-header h2 { display: flex; align-items: center; gap: var(--sp-3); font-size: 15px; font-weight: 600; margin: 0; }
.panel-header h2 .ph-icon { width: 32px; height: 32px; flex-shrink: 0; border-radius: 9px; background: var(--primary-dim); border: 1px solid var(--primary-border); color: var(--violet-300); display: inline-flex; align-items: center; justify-content: center; font-size: 13px; }
.panel-header .hint { font-size: 12px; color: var(--text-muted); }
.panel > p { margin: 0 0 var(--sp-4); line-height: 1.7; }
.panel-soon { opacity: .6; }
.soon-badge { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 600; color: var(--gold); background: var(--gold-dim); border: 1px solid var(--gold-border); padding: 3px 9px; border-radius: 999px; }

/* ========== الحقول ========== */
label { display: block; font-size: 12.5px; font-weight: 500; color: var(--text-muted); margin-bottom: 6px; }
.field { margin-bottom: var(--sp-4); min-width: 0; }
.field:last-child { margin-bottom: 0; }
.row { display: flex; gap: var(--sp-4); flex-wrap: wrap; margin-bottom: var(--sp-4); }
.row:last-child { margin-bottom: 0; }
.row > .field { flex: 1; min-width: 190px; margin-bottom: 0; }
.row .btn { flex-shrink: 0; }

input[type="text"], input[type="search"], input[type="number"], input[type="password"], input[type="email"], select, textarea {
    width: 100%; min-height: 42px; background: var(--bg-2); border: 1px solid var(--line); color: var(--text);
    padding: 10px 14px; border-radius: var(--radius-sm); font-family: var(--font); font-size: 13.5px;
    transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
textarea { min-height: 84px; line-height: 1.6; }
::placeholder { color: var(--text-faint); }
input:hover:not(:disabled), select:hover:not(:disabled), textarea:hover:not(:disabled) { border-color: var(--line-strong); }
input[type="text"]:focus, input[type="search"]:focus, input[type="number"]:focus, input[type="password"]:focus, input[type="email"]:focus, select:focus, textarea:focus {
    border-color: var(--violet-400); box-shadow: 0 0 0 3px rgba(var(--primary-rgb),.22); outline: none;
}
input:disabled, select:disabled, textarea:disabled { opacity: .45; cursor: not-allowed; }
input[type="number"] { -moz-appearance: textfield; }

select {
    cursor: pointer; appearance: none; -webkit-appearance: none; -moz-appearance: none; padding-inline-end: 38px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%23A78BFA' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: left 14px center;
}
html[dir="ltr"] select { background-position: right 14px center; }
select option, select optgroup { background: var(--surface-2); color: var(--text); }

input[type="checkbox"] {
    appearance: none; -webkit-appearance: none; width: 18px; height: 18px; min-height: 0; padding: 0; flex-shrink: 0; margin: 0;
    border: 1.5px solid var(--line-strong); border-radius: 5px; background: var(--bg-2); cursor: pointer; position: relative; transition: all .15s var(--ease);
}
input[type="checkbox"]:hover { border-color: var(--violet-400); }
input[type="checkbox"]:checked { background: var(--grad-primary); border-color: transparent; }
input[type="checkbox"]:checked::after { content: ""; position: absolute; inset: 0; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='10' viewBox='0 0 12 10' fill='none'%3E%3Cpath d='M1 5L4.3 8.3L11 1' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/12px 10px no-repeat; }
input[type="checkbox"]:disabled { opacity: .4; cursor: not-allowed; }

/* ========== الأزرار ========== */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2);
    min-height: 40px; padding: 9px 16px; border-radius: var(--radius-sm); border: 1px solid var(--line-strong);
    background: var(--fill); color: var(--text); font-size: 13px; font-weight: 600; line-height: 1.2; cursor: pointer; white-space: nowrap;
    transition: background .15s var(--ease), border-color .15s var(--ease), transform .12s var(--ease), box-shadow .15s var(--ease), filter .15s var(--ease);
}
.btn:hover { background: var(--fill-hover); border-color: var(--primary-border); }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--grad-primary); border-color: transparent; color: var(--on-primary); box-shadow: 0 6px 20px rgba(var(--primary-rgb),.35); }
.btn-primary:hover { background: var(--grad-primary); filter: brightness(1.1); box-shadow: 0 8px 26px rgba(var(--primary-rgb),.5); border-color: transparent; }
.btn-danger { background: var(--danger-dim); border-color: var(--danger-border); color: var(--danger); }
.btn-danger:hover { background: var(--danger); color: #1b0a10; border-color: transparent; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-muted); }
.btn-ghost:hover { background: var(--fill); color: var(--text); border-color: var(--line); }
.btn-sm { min-height: 34px; padding: 6px 12px; font-size: 12.5px; }
.btn-block { width: 100%; }
.lang-toggle-btn { min-width: 52px; }

/* ========== سويتش ========== */
.switch { position: relative; display: inline-block; width: 44px; height: 24px; flex-shrink: 0; margin: 0; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch .track { position: absolute; inset: 0; background: var(--surface-3); border: 1px solid var(--line-strong); border-radius: 999px; cursor: pointer; transition: all .2s var(--ease); }
.switch .track::before { content: ""; position: absolute; top: 50%; inset-inline-start: 3px; width: 16px; height: 16px; margin-top: -8px; border-radius: 50%; background: var(--text-muted); transition: all .2s var(--ease); }
.switch input:checked + .track { background: rgba(var(--primary-rgb),.35); border-color: var(--violet-400); box-shadow: 0 0 14px rgba(var(--primary-rgb),.4); }
.switch input:checked + .track::before { background: #fff; transform: translateX(20px); }
html[dir="rtl"] .switch input:checked + .track::before { transform: translateX(-20px); }
.switch input:focus-visible + .track { outline: 2px solid var(--primary); outline-offset: 2px; }
.switch input:disabled + .track { opacity: .5; cursor: not-allowed; }

/* ========== بادجات ========== */
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 600; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--fill); color: var(--text-muted); white-space: nowrap; }
.pill .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill-on { color: var(--success); background: var(--success-dim); border-color: rgba(74,222,128,.4); }
.pill-off { color: var(--danger); background: var(--danger-dim); border-color: var(--danger-border); }
.pill-gold { color: var(--gold); background: var(--gold-dim); border-color: var(--gold-border); }
.counter-badge { display: inline-flex; align-items: center; gap: 5px; background: var(--fill); border: 1px solid var(--line); color: var(--text-muted); font-size: 11.5px; font-weight: 600; padding: 3px 9px; border-radius: 999px; font-family: var(--mono); line-height: 1.4; }
.counter-badge.is-active { background: var(--primary-dim); border-color: var(--primary-border); color: var(--violet-300); }
.counter-badge.is-warning { background: var(--gold-dim); border-color: var(--gold-border); color: var(--gold); }

.section-title { display: flex; align-items: center; gap: var(--sp-2); font-size: 13px; font-weight: 700; color: var(--text-muted); margin: var(--sp-8) 0 var(--sp-4); }
.section-title:first-child { margin-top: 0; }

/* ========== الكروت (السيرفرات) ========== */
.server-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: var(--sp-5); }
.server-card { display: flex; flex-direction: column; background: linear-gradient(180deg, var(--surface-2), var(--surface)); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; transition: transform .2s var(--ease), border-color .2s var(--ease), box-shadow .2s var(--ease); }
.server-card:hover { transform: translateY(-3px); border-color: var(--primary-border); box-shadow: var(--glow); }
.server-card.is-invitable { border-style: dashed; opacity: .9; }
.server-card.is-invitable:hover { opacity: 1; }
.server-banner { height: 76px; flex-shrink: 0; background: radial-gradient(120% 200% at 20% -30%, rgba(var(--accent-rgb),.45), transparent 60%), radial-gradient(120% 200% at 90% 130%, rgba(var(--primary-rgb),.55), transparent 60%), var(--surface-3); background-size: cover; background-position: center; }
.server-card-body { display: flex; flex-direction: column; gap: var(--sp-2); padding: 0 var(--sp-5) var(--sp-5); flex: 1; }
.server-icon-row { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--sp-3); margin-top: -26px; margin-bottom: var(--sp-1); }
.server-icon { width: 54px; height: 54px; border-radius: 16px; object-fit: cover; flex-shrink: 0; border: 3px solid var(--surface-2); background: var(--surface-3); display: flex; align-items: center; justify-content: center; font-size: 20px; font-weight: 700; color: var(--violet-300); box-shadow: var(--shadow-sm); }
.server-badge { flex-shrink: 0; }
.server-name { font-size: 15.5px; font-weight: 700; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.server-meta { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-muted); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.server-meta .sep { opacity: .5; }
.server-meta .mono { font-family: var(--mono); }
.server-card-footer { display: flex; gap: var(--sp-2); margin-top: auto; padding-top: var(--sp-3); }
.server-card-footer .btn { flex: 1; }

/* ========== مودال ========== */
.modal-overlay { position: fixed; inset: 0; background: rgba(3,1,10,.72); backdrop-filter: blur(5px); display: flex; align-items: center; justify-content: center; z-index: 1000; animation: fade-in .15s var(--ease); padding: var(--sp-4); }
.modal-box { background: var(--surface-2); border: 1px solid var(--line-strong); border-radius: var(--radius-lg); padding: var(--sp-6); width: 100%; max-width: 440px; box-shadow: var(--shadow-md), var(--glow); }
.modal-title { font-size: 16px; font-weight: 700; margin-bottom: var(--sp-3); }
.modal-input-row { display: flex; gap: var(--sp-2); }
.modal-input-row input { flex: 1; font-family: var(--mono); font-size: 12px; }

/* ========== تابات ========== */
.tabs { display: flex; flex-wrap: wrap; gap: var(--sp-1); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--sp-1); margin-bottom: var(--sp-5); width: fit-content; max-width: 100%; }
.tab { display: inline-flex; align-items: center; gap: var(--sp-2); padding: 8px 16px; border: 0; background: transparent; color: var(--text-muted); border-radius: var(--radius-sm); font-size: 13px; font-weight: 600; cursor: pointer; transition: all .15s var(--ease); }
.tab:hover { color: var(--text); background: var(--fill); }
.tab.active { background: var(--grad-primary); color: var(--on-primary); box-shadow: 0 4px 16px rgba(var(--primary-rgb),.4); }
.tab-panel { display: none; }
.tab-panel.active { display: block; animation: content-in .28s var(--ease); }

/* ========== القوائم ========== */
.list { display: flex; flex-direction: column; gap: var(--sp-2); }
.list-row { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-3) var(--sp-4); background: var(--fill); border: 1px solid var(--line); border-radius: var(--radius); transition: background .15s var(--ease), border-color .15s var(--ease); min-width: 0; }
.list-row:hover { background: var(--fill-hover); border-color: var(--line-strong); }
.list-row > img { width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0; object-fit: cover; background: var(--surface-3); }
.list-row .main { flex: 1; min-width: 0; }
.list-row .title { font-size: 13.5px; font-weight: 600; line-height: 1.4; overflow: hidden; text-overflow: ellipsis; }
.list-row .title.sub, .list-row .sub { font-size: 11.5px; color: var(--text-muted); font-family: var(--mono); font-weight: 400; margin-top: 2px; }
.list-row .actions { display: flex; align-items: center; gap: var(--sp-2); flex-shrink: 0; }
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: var(--sp-2); }
.muted-note { font-size: 11.5px; color: var(--text-faint); }
.mw-box { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--sp-4); margin-top: var(--sp-2); display: flex; flex-direction: column; gap: var(--sp-4); }

.empty-state { text-align: center; padding: 40px var(--sp-5); color: var(--text-muted); }
.empty-state .icon { width: 56px; height: 56px; border-radius: 16px; background: var(--primary-dim); border: 1px solid var(--primary-border); display: flex; align-items: center; justify-content: center; font-size: 22px; margin: 0 auto var(--sp-4); color: var(--violet-300); }
.empty-state p { margin: 0; font-size: 13.5px; }
.list > .empty-state { padding: var(--sp-5); }

.search-wrap { position: relative; }
.search-results { position: absolute; top: calc(100% + 6px); inset-inline: 0; background: var(--surface-2); border: 1px solid var(--line-strong); border-radius: var(--radius); max-height: 230px; overflow-y: auto; z-index: 10; display: none; box-shadow: var(--shadow-md); }
.search-results.show { display: block; animation: fade-in .15s var(--ease); }
.search-result-item { display: flex; align-items: center; gap: var(--sp-3); padding: 10px var(--sp-3); cursor: pointer; }
.search-result-item:hover { background: var(--fill-hover); }
.search-result-item img { width: 28px; height: 28px; border-radius: 50%; }

.skeleton { position: relative; overflow: hidden; background: var(--surface-3); border-radius: var(--radius-sm); }
.skeleton::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(var(--accent-rgb),.12), transparent); animation: shimmer 1.4s infinite; }

#toast-container { position: fixed; bottom: var(--sp-6); inset-inline-end: var(--sp-6); z-index: 2000; display: flex; flex-direction: column; gap: var(--sp-2); }
.toast { display: flex; align-items: center; gap: var(--sp-3); background: var(--surface-2); border: 1px solid var(--line-strong); color: var(--text); padding: 12px 18px; border-radius: var(--radius); font-size: 13px; font-weight: 500; box-shadow: var(--shadow-md); animation: toast-in .2s var(--ease); }
.toast.success { border-color: rgba(74,222,128,.45); }
.toast.success::before { content: "\2713"; color: var(--success); font-weight: 800; }
.toast.error { border-color: var(--danger-border); }
.toast.error::before { content: "!"; color: var(--danger); font-weight: 800; }

.spinner { display: inline-block; width: 16px; height: 16px; border: 2px solid var(--line-strong); border-top-color: var(--violet-400); border-radius: 50%; animation: spin .7s linear infinite; flex-shrink: 0; }
.loading-page { display: flex; align-items: center; justify-content: center; gap: var(--sp-3); height: 50vh; color: var(--text-muted); }

.login-shell { min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.discord-btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; background: #5865F2; color: #fff; font-weight: 700; font-size: 14px; padding: 12px 22px; border-radius: var(--radius-sm); transition: background .15s var(--ease); }
.discord-btn:hover { background: #6874F5; color: #fff; }

/* ========== موبايل ========== */
@media (max-width: 860px) {
    .shell { flex-direction: column; }
    .sidebar { width: 100%; height: auto; position: sticky; top: 0; flex-direction: row; align-items: center; gap: var(--sp-2); padding: var(--sp-3) var(--sp-4); overflow-x: auto; border-inline-end: 0; border-bottom: 1px solid var(--line); }
    .sidebar-brand, .sidebar-guild { display: none; }
    .nav { flex-direction: row; flex: 0 0 auto; gap: var(--sp-1); }
    .nav-item { width: auto; white-space: nowrap; padding: 8px var(--sp-3); }
    .nav-item.active::before { display: none; }
    .sidebar-footer { border-top: 0; border-inline-start: 1px solid var(--line); padding: 0 0 0 var(--sp-3); padding-inline: var(--sp-3) 0; flex: 0 0 auto; }
    .sidebar-footer .user-name { display: none; }
    .shell > .main { padding: var(--sp-5) var(--sp-4) 40px; }
    .page { padding: var(--sp-5) var(--sp-4) 40px; }
    .topbar { padding: var(--sp-3) var(--sp-4); flex-wrap: wrap; }
    .panel { padding: var(--sp-5) var(--sp-4); }
    .page-header h1 { font-size: 21px; }
}

/* صفوف الحماية: مسافات موحّدة داخل list-row ذات العمود */
.list-row > .row, .list-row > .field { margin-bottom: 0; }
.list-row > .row { align-items: flex-end; }
.list-row > .row > .field { flex: 0 0 auto; min-width: 120px; }

/* بانلز جنب بعض داخل row: المسافة الرأسية بين الصفوف تبقى نفس مسافة البانلز العادية */
.row > .panel { margin-bottom: 0; }
#content > .row, .tab-panel > .row { margin-bottom: var(--sp-5); }

/* مسافة بعد الـ row بتتحط كـ margin-top على اللي بعده (بدل margin-bottom) عشان العناصر المخفية متسيبش فراغ */
.panel > .row { margin-bottom: 0; }
.panel > .row + * { margin-top: var(--sp-4); }
.row > .btn { min-height: 42px; }
.row > .btn-sm { min-height: 42px; }

/* ===== الإشراف التلقائي: كروت القواعد ===== */
.am-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: var(--sp-4); }
.am-card { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: var(--sp-4); display: flex; flex-direction: column; gap: var(--sp-4); }
.am-card-top { display: flex; align-items: center; gap: var(--sp-3); }
.am-icon { width: 40px; height: 40px; border-radius: 10px; background: var(--surface-3); border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; color: var(--violet-300); flex-shrink: 0; }
.am-title { flex: 1; min-width: 0; font-weight: 700; font-size: 14px; }
.am-sub { font-weight: 400; font-size: 11.5px; color: var(--text-faint); margin-top: 2px; }
.am-edit-btn { width: 100%; padding: 10px; border: 0; border-radius: 10px; background: var(--grad-primary); color: var(--on-primary); font-family: inherit; font-weight: 600; cursor: pointer; transition: filter .15s var(--ease); }
.am-edit-btn:hover:not(:disabled) { filter: brightness(1.12); }
.am-edit-btn:disabled { opacity: .35; cursor: not-allowed; }

/* ===== حقل + زرار إضافة + شرائح تحته ===== */
.am-add-row { display: flex; gap: var(--sp-2); align-items: stretch; }
.am-add-row > input, .am-add-row > select { flex: 1; min-width: 0; }
.am-add-btn { flex-shrink: 0; min-width: 42px; }
.am-chips { max-height: 150px; overflow-y: auto; padding: 2px; }

.sec-icon { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 8px; background: var(--primary-dim); border: 1px solid var(--primary-border); color: var(--violet-300); font-size: 13px; margin-inline-end: 10px; vertical-align: middle; }

/* ===== الأونر: بحث وترتيب السيرفرات ===== */
.servers-toolbar { display: flex; gap: var(--sp-3); align-items: center; flex-wrap: wrap; margin-bottom: var(--sp-4); }
.servers-search { position: relative; flex: 1; min-width: 220px; }
.servers-search i { position: absolute; top: 50%; inset-inline-start: 12px; transform: translateY(-50%); color: var(--text-faint); font-size: 13px; }
.servers-search input { width: 100%; padding-inline-start: 34px; }
.servers-toolbar select { min-width: 220px; }
.muted-note { color: var(--text-muted); font-size: 12.5px; margin: 0 0 16px; }

/* ===== تابات فرعية ===== */
.sub-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: var(--sp-4); }
.sub-tab { padding: 8px 16px; border-radius: 100px; border: 1px solid var(--glass-border-strong); background: transparent; color: var(--text-muted); font-family: inherit; font-size: 13px; cursor: pointer; }
.sub-tab.active { background: var(--primary-dim); border-color: var(--primary-border); color: var(--text); }
.sub-panel { display: none; } .sub-panel.active { display: block; }

/* ===== محرر الكونتينر ===== */
.ce-vars { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; margin-bottom: var(--sp-4); }
.ce-vars-title { font-size: 12px; color: var(--text-muted); margin-bottom: 8px; }
.ce-vars-list { display: flex; flex-wrap: wrap; gap: 6px; }
.ce-var { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 8px; border: 1px solid var(--primary-border); background: var(--primary-dim); color: var(--text); cursor: pointer; font-family: inherit; font-size: 11.5px; }
.ce-var code { font-family: var(--mono); color: var(--violet-300); }
.ce-var span { color: var(--text-muted); }
.ce-var:hover { filter: brightness(1.2); }
.ce-cols { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-4); align-items: start; }
@media (max-width: 1000px) { .ce-cols { grid-template-columns: 1fr; } }
.ce-col { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: var(--sp-4); min-width: 0; }
.ce-col-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.ce-col-head h3 { margin: 0; font-size: 14px; }
.ce-color { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-muted); }
.ce-color input[type=color] { width: 32px; height: 26px; padding: 0; border: 1px solid var(--line); border-radius: 6px; background: none; cursor: pointer; }
.ce-block { background: var(--surface-3); border: 1px solid var(--line); border-radius: 10px; padding: 10px; margin-bottom: 8px; display: flex; flex-direction: column; gap: 8px; }
.ce-block-head { display: flex; align-items: center; justify-content: space-between; }
.ce-block-title { font-size: 12px; font-weight: 700; color: var(--violet-300); }
.ce-block-actions { display: flex; gap: 4px; }
.ce-block textarea, .ce-block input[type=text], .ce-block select { width: 100%; font-size: 13px; }
.ce-inline { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.ce-check { display: flex; align-items: center; gap: 6px; font-size: 12.5px; }
.ce-btn-row { display: flex; gap: 6px; margin-bottom: 6px; flex-wrap: wrap; }
.ce-btn-row input { flex: 1; min-width: 110px; }
.ce-add { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 14px; }
.ce-pv-label { font-size: 12px; color: var(--text-faint); margin-bottom: 6px; }
.ce-preview { background: #1e1f22; color: #dbdee1; border-radius: 8px; border-inline-start: 4px solid #3a3358; padding: 12px 14px; font-size: 14px; line-height: 1.45; display: flex; flex-direction: column; gap: 8px; word-break: break-word; }
.ce-pv-section { display: flex; gap: 12px; align-items: flex-start; }
.ce-pv-thumb { width: 72px; height: 72px; border-radius: 8px; object-fit: cover; }
.ce-pv-image { max-width: 100%; border-radius: 8px; }
.ce-pv-sep hr { border: 0; border-top: 1px solid #3f4147; margin: 2px 0; } .ce-pv-sep.large { padding: 6px 0; }
.ce-pv-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.ce-pv-btn { background: #4e5058; color: #fff; padding: 6px 14px; border-radius: 6px; font-size: 13px; display: inline-flex; gap: 6px; align-items: center; }
.ce-pv-btn i { font-size: 10px; opacity: .8; }
.ce-emoji { width: 18px; height: 18px; vertical-align: -4px; }
.ce-mention { background: rgba(88,101,242,.3); color: #c9cdfb; border-radius: 4px; padding: 0 3px; }
.ce-h1 { font-size: 22px; font-weight: 700; } .ce-h2 { font-size: 18px; font-weight: 700; } .ce-h3 { font-size: 16px; font-weight: 700; }
.ce-sub { font-size: 12px; color: #949ba4; } .ce-quote { border-inline-start: 4px solid #4e5058; padding-inline-start: 10px; }
.ce-preview code { background: #2b2d31; padding: 1px 5px; border-radius: 4px; font-size: 13px; } .ce-preview pre { background: #2b2d31; padding: 8px; border-radius: 6px; margin: 0; white-space: pre-wrap; }
.ce-footer { display: flex; gap: 10px; justify-content: flex-end; margin-top: var(--sp-4); flex-wrap: wrap; }

/* ===== برودكاست ===== */
.bc-bar { height: 10px; background: var(--surface-3); border-radius: 100px; overflow: hidden; }
.bc-bar-fill { height: 100%; background: var(--grad-primary); transition: width .4s var(--ease); }
.bc-stats { display: flex; gap: 16px; flex-wrap: wrap; font-size: 13px; margin-top: 8px; }
.bc-failures { margin-top: 10px; font-size: 12.5px; color: var(--text-muted); } .bc-failures div { padding: 4px 0; border-bottom: 1px solid var(--line); }

/* ===== Active: كروت الإحصائيات ===== */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: var(--sp-3); margin-bottom: var(--sp-4); }
.stat-card { display: flex; gap: 12px; align-items: center; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 14px; }
.stat-icon { width: 40px; height: 40px; border-radius: 10px; background: var(--primary-dim); border: 1px solid var(--primary-border); color: var(--violet-300); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.stat-card.good .stat-icon { background: rgba(59,165,92,.15); border-color: rgba(59,165,92,.4); color: #3ba55c; }
.stat-card.bad .stat-icon { background: rgba(237,66,69,.15); border-color: rgba(237,66,69,.4); color: #ed4245; }
.stat-value { font-size: 20px; font-weight: 800; line-height: 1.1; }
.stat-label { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.stat-sub { font-size: 11px; color: var(--text-faint); margin-top: 2px; }
.mini-row { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.mini-row:last-child { border-bottom: 0; }
.act-row .act-icon { width: 34px; height: 34px; border-radius: 10px; background: var(--surface-3); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.act-type { font-size: 10.5px; font-weight: 600; color: var(--text-muted); border: 1px solid var(--line); border-radius: 100px; padding: 1px 8px; margin-inline-start: 6px; }
.chip-btn { border: 1px solid var(--line); background: transparent; cursor: pointer; font-family: inherit; }
.mono { font-family: var(--mono); font-size: 12px; }

/* ===== تاب البوت ===== */
.bot-layout { display: grid; grid-template-columns: 340px 1fr; gap: var(--sp-4); align-items: start; }
@media (max-width: 900px) { .bot-layout { grid-template-columns: 1fr; } }
.bot-card { background: #111214; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.bot-banner { height: 110px; background-size: cover; background-position: center; }
.bot-body { padding: 0 16px 16px; position: relative; }
.bot-avatar-wrap { position: relative; width: 84px; height: 84px; margin-top: -42px; }
.bot-avatar-wrap img { width: 84px; height: 84px; border-radius: 50%; border: 6px solid #111214; background: #111214; object-fit: cover; }
.bot-dot { position: absolute; bottom: 4px; inset-inline-end: 4px; width: 20px; height: 20px; border-radius: 50%; border: 4px solid #111214; }
.bot-name { font-size: 20px; font-weight: 800; margin-top: 8px; display: flex; align-items: center; gap: 8px; }
.bot-badge { background: #5865f2; color: #fff; font-size: 10px; padding: 2px 6px; border-radius: 4px; }
.bot-tag { color: var(--text-muted); font-size: 13px; }
.bot-body hr { border: 0; border-top: 1px solid var(--line); margin: 12px 0; }
.bot-section { font-size: 11px; font-weight: 800; text-transform: uppercase; color: var(--text-faint); margin-bottom: 4px; }
.bot-desc { font-size: 13.5px; white-space: pre-wrap; word-break: break-word; }

.backup-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ===== مزامنة AutoMod الرسمي ===== */
.am-native-box { background: var(--surface-2); border: 1px solid var(--primary-border); border-radius: var(--radius); padding: 12px 14px; margin-top: 4px; }
.am-native-line { font-size: 11.5px; color: var(--text-faint); min-height: 18px; }
.am-n-ok { color: #3ba55c; } .am-n-err { color: #ed4245; } .am-n-off { color: var(--text-faint); }

.ce-locked { font-size: 12.5px; color: var(--text-muted); background: var(--surface-2); border: 1px dashed var(--primary-border); border-radius: 8px; padding: 8px 12px; }
.ce-pv-menu { background: #1e1f22; border: 1px solid #3f4147; border-radius: 6px; padding: 8px 12px; display: flex; justify-content: space-between; align-items: center; color: #b5bac1; font-size: 13px; }

/* ===== Active (سجل الأمان) ===== */
.act-card { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 10px; }
.act-card-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.act-badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; color: var(--c); background: color-mix(in srgb, var(--c) 14%, transparent); border: 1px solid color-mix(in srgb, var(--c) 40%, transparent); border-radius: 100px; padding: 3px 11px; }
.act-cat { font-size: 11.5px; color: var(--text-muted); border: 1px solid var(--line); border-radius: 100px; padding: 2px 10px; }
.act-time { margin-inline-start: auto; font-size: 12px; color: var(--text-faint); }
.act-summary { font-weight: 700; font-size: 14.5px; margin-bottom: 6px; }
.act-meta { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 12.5px; color: var(--text-muted); }
.act-meta i { margin-inline-end: 5px; opacity: .8; }
.act-reason { margin-top: 8px; font-size: 12.5px; color: #faa61a; background: rgba(250,166,26,.08); border-radius: 8px; padding: 6px 10px; }
.act-details { margin: 8px 0 0; padding-inline-start: 20px; font-size: 12.5px; color: var(--text-muted); } .act-details li { margin: 2px 0; }

.am-n-warn { color: #faa61a; }

/* =====================================================
   Navbar الموقع — تصميم جديد على هوية البوت (Home / Dashboard / Privacy / Terms / Support)
   ===================================================== */
.brand-logo { width: 40px; height: 40px; border-radius: 0; box-shadow: none; object-fit: contain; background: none;
    filter: drop-shadow(0 4px 14px rgba(var(--accent-rgb),.55)); transition: transform .25s var(--ease); }
.brand:hover .brand-logo { transform: rotate(-6deg) scale(1.06); }

.topbar, .lp-nav {
    display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: var(--sp-4);
    padding: 10px 32px; position: sticky; top: 0; z-index: 30;
    background: linear-gradient(180deg, rgba(var(--nav-1-rgb),.86), rgba(var(--nav-2-rgb),.72));
    backdrop-filter: blur(18px) saturate(1.5); -webkit-backdrop-filter: blur(18px) saturate(1.5);
    border-bottom: 0; box-shadow: 0 12px 34px rgba(0,0,0,.35);
}
.topbar::after, .lp-nav::after { content: ""; position: absolute; inset-inline: 0; bottom: 0; height: 1px;
    background: linear-gradient(90deg, transparent, rgba(var(--accent-rgb),.55), transparent); pointer-events: none; }
.topbar > .brand, .lp-nav > .brand { justify-self: start; display: flex; align-items: center; gap: var(--sp-3); }
.topbar > .user, .lp-nav > div:last-child { justify-self: end; }

.site-links { display: inline-flex; align-items: center; gap: 2px; padding: 4px; border-radius: 100px; justify-self: center;
    background: rgba(var(--accent-rgb),.08); border: 1px solid rgba(var(--accent-rgb),.2); box-shadow: inset 0 1px 0 rgba(255,255,255,.04); }
.site-links a { display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 15px; border-radius: 100px;
    color: var(--text-muted); font-size: 13px; font-weight: 600; text-decoration: none; white-space: nowrap;
    transition: background .2s var(--ease), color .2s var(--ease), box-shadow .2s var(--ease); }
.site-links a i { font-size: 12px; opacity: .8; }
.site-links a:hover { color: #fff; background: rgba(var(--accent-rgb),.16); }
.site-links a.is-cta:not(.active) { color: var(--violet-300); }
.site-links a.active { color: #fff; background: var(--grad-primary); box-shadow: 0 4px 16px rgba(var(--primary-rgb),.5), inset 0 1px 0 rgba(255,255,255,.25); }
.site-links a.active i { opacity: 1; }

/* شريط صفحة إدارة السيرفر (من غير topbar) */
.sitebar { position: sticky; top: 0; z-index: 25; display: flex; justify-content: center; padding: 10px 20px; margin: -1px 0 var(--sp-5);
    background: linear-gradient(180deg, rgba(var(--nav-1-rgb),.82), rgba(var(--nav-2-rgb),.66)); backdrop-filter: blur(16px) saturate(1.4);
    box-shadow: 0 10px 28px rgba(0,0,0,.3); }
.sitebar::after { content: ""; position: absolute; inset-inline: 0; bottom: 0; height: 1px; background: linear-gradient(90deg, transparent, rgba(var(--accent-rgb),.5), transparent); }

@media (max-width: 900px) {
    .topbar, .lp-nav { grid-template-columns: minmax(0, 1fr) auto; padding: 10px 16px; row-gap: 10px; }
    .topbar > *, .lp-nav > * { min-width: 0; }
    /* الروابط بتنزل سطر تاني وبتلف على أكتر من صف بدل ما تتقطع أو تخرج برا الشاشة */
    .site-links { display: flex; flex-wrap: wrap; justify-content: center; max-width: 100%; box-sizing: border-box; border-radius: 22px; row-gap: 2px; }
    .topbar .site-links, .lp-nav .site-links { grid-column: 1 / -1; grid-row: 2; justify-self: stretch; }
    /* على الموبايل الشريط مش ثابت ومن غير مستطيل خلفية، فمش بياكل مساحة ومش بيبان كأنه مقصوص */
    .sitebar { position: static; padding: 0; margin: 0 0 var(--sp-4); background: none; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none; }
    .sitebar::after { display: none; }
    .sitebar .site-links { width: 100%; }
}
@media (max-width: 600px) {
    .site-links a { padding: 0 11px; height: 32px; font-size: 12.5px; } .site-links a i { display: none; }
}
@media (max-width: 520px) {
    /* الصف اللي فيه الشعار والأزرار: بيدخل في عرض الشاشة من غير ما العناصر تركب على بعض */
    .topbar { padding: 10px 12px; column-gap: 8px; }
    .topbar > .brand { gap: 8px; min-width: 0; overflow: hidden; }
    .topbar > .brand .brand-name { display: none; }
    .topbar > .user { gap: 6px; }
    .topbar > .user img { width: 28px; height: 28px; }
    .topbar .btn-sm { padding-inline: 10px; }
}

/* الشعار/الماسكوت في الصفحة الرئيسية */
@keyframes mascot-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
.sidebar-brand .brand-logo { width: 36px; height: 36px; }

/* منع الفراغ الجانبي على الموبايل: أي عنصر أعرض من الشاشة ما بيوسّعش الصفحة */
html, body { max-width: 100%; overflow-x: hidden; overflow-x: clip; }
img, video, svg, iframe { max-width: 100%; }

.site-bi { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; } .site-bi input, .site-bi textarea { width: 100%; }
@media (max-width: 700px) { .site-bi { grid-template-columns: 1fr; } }
.site-sec { border-inline-start: 3px solid var(--violet-300); }

.site-color { display: flex; gap: 8px; align-items: center; } .site-color input[type=color] { width: 46px; height: 38px; padding: 2px; border-radius: 8px; border: 1px solid var(--line); background: none; cursor: pointer; }
.site-color input[type=text] { flex: 1; font-family: var(--mono); }
.swatch { display: inline-block; width: 14px; height: 14px; border-radius: 50%; vertical-align: -2px; margin-inline-end: 4px; }

/* ===== هوية السيرفرات (Branding) ===== */
.bd-layout { display: grid; grid-template-columns: 360px 1fr; gap: var(--sp-4); align-items: start; }
@media (max-width: 900px) { .bd-layout { grid-template-columns: 1fr; } }
.bd-list { max-height: 560px; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; }
.bd-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); cursor: pointer; transition: border-color .15s, background .15s; }
.bd-row:hover { border-color: var(--primary-border); } .bd-row.is-active { border-color: var(--violet-400); background: var(--primary-dim); }
.bd-row img, .bd-ph { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; flex-shrink: 0; } .bd-ph { background: var(--surface-3); display: grid; place-items: center; font-weight: 700; font-size: 13px; }
.bd-info { flex: 1; min-width: 0; } .bd-name { font-weight: 700; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .bd-sub { font-size: 11.5px; color: var(--text-faint); }
.bd-bulk { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }

/* ===== صحة السيرفر + وضع التجربة ===== */
.hc-top { display:flex; align-items:center; gap:22px; flex-wrap:wrap; }
.hc-ring { --p:0; --c:#3ba55c; width:104px; height:104px; flex:none; border-radius:50%; background:conic-gradient(var(--c) calc(var(--p) * 1%), var(--fill) 0); display:grid; place-items:center; }
.hc-ring > div { width:80px; height:80px; border-radius:50%; background:var(--bg-2); display:flex; flex-direction:column; align-items:center; justify-content:center; line-height:1.2; }
.hc-ring b { font-size:22px; } .hc-ring span { font-size:11px; color:var(--text-muted); }
.hc-sum { flex:1; min-width:200px; }
.hc-counts { display:flex; gap:8px; flex-wrap:wrap; }
.hc-chip { display:inline-flex; align-items:center; gap:7px; font-size:12.5px; font-weight:700; padding:4px 12px; border-radius:100px; color:var(--c); border:1px solid var(--c); background:color-mix(in srgb, var(--c) 12%, transparent); }
.hc-item { display:flex; gap:14px; padding:14px 2px; border-bottom:1px solid var(--line); }
.hc-item:last-child { border-bottom:0; }
.hc-ic { font-size:20px; flex:none; width:24px; text-align:center; margin-top:1px; }
.hc-title { font-weight:700; }
.hc-detail { color:var(--text-muted); font-size:13px; margin-top:3px; overflow-wrap:anywhere; }
.hc-fix { font-size:13px; margin-top:6px; background:var(--fill); border-radius:10px; padding:6px 10px; display:inline-block; }
.hc-fix i { color:var(--gold); margin-inline-end:6px; }
.dry-banner { display:flex; align-items:center; gap:10px; padding:12px 16px; margin-bottom:var(--sp-4); border-radius:12px; border:1px solid rgba(56,189,248,.5); background:rgba(56,189,248,.1); color:#bfe9ff; font-weight:600; }

/* ===== الافتراضيات ===== */
.df-subs { display:flex; gap:8px; flex-wrap:wrap; margin-top:10px; }
.df-row { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:10px 0; border-bottom:1px solid var(--line); }
.df-row:last-child { border-bottom:0; }
.df-row select { max-width:220px; }
.df-mods { display:grid; grid-template-columns:repeat(auto-fill,minmax(300px,1fr)); gap:var(--sp-3); margin-top:var(--sp-3); }
.df-mod { background:var(--surface-2); border:1px solid var(--line); border-radius:14px; padding:14px; }
.df-mod-head { display:flex; justify-content:space-between; align-items:center; gap:10px; }
.df-grid { display:grid; gap:10px; margin-top:10px; }
.df-grid label, .df-block { display:flex; flex-direction:column; gap:4px; font-size:13px; }
.df-grid label.df-inline { flex-direction:row; justify-content:space-between; align-items:center; }
.df-block { margin-top:10px; }
.df-presets { display:flex; gap:12px; flex-wrap:wrap; }
.df-bottom { display:flex; gap:12px; flex-wrap:wrap; justify-content:flex-end; margin-top:var(--sp-4); position:sticky; bottom:12px; }
.df-status { font-size:12.5px; }
