/* SY Shield — هوية داكنة أولاً: أسود فحمي مع أحمر قرمزي (لون الدرع)، ولايت ثيم كامل.
   التخطيط: صفحة هبوط + لوحة تحكم بشريط جانبي يمين ومجموعات أقسام */
:root {
  --bg: #0a0b0f;
  --bg-2: #0f1117;
  --panel: #14161d;
  --panel-2: #1b1e27;
  --line: #262a35;
  --fg: #eceef3;
  --muted: #8d93a3;
  --accent: #e5354b;
  --accent-2: #ff6a5a;
  --accent-fg: #ffffff;
  --accent-soft: rgba(229, 53, 75, .14);
  --ok: #34c77b;
  --warn: #f0a93b;
  --bad: #f05a5a;
  --info: #5b8cff;
  --glow: 0 0 0 1px rgba(229, 53, 75, .35), 0 10px 40px -12px rgba(229, 53, 75, .45);
  --shadow: 0 1px 0 rgba(255, 255, 255, .03) inset, 0 12px 32px -18px rgba(0, 0, 0, .8);
  --grid-line: rgba(255, 255, 255, .035);
  --font-body: "IBM Plex Sans Arabic", Tahoma, "Segoe UI", sans-serif;
  --font-display: "Readex Pro", "IBM Plex Sans Arabic", Tahoma, sans-serif;
  --font-mono: "JetBrains Mono", Consolas, monospace;
  --r: 14px;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #f5f5f7; --bg-2: #eeeef2; --panel: #ffffff; --panel-2: #f2f2f6; --line: #e1e2e8; --fg: #16171c; --muted: #646a78;
    --accent: #d1263c; --accent-2: #ef4f3f; --accent-soft: rgba(209, 38, 60, .09);
    --glow: 0 0 0 1px rgba(209, 38, 60, .25), 0 10px 30px -14px rgba(209, 38, 60, .35);
    --shadow: 0 1px 2px rgba(20, 20, 30, .05), 0 8px 24px -16px rgba(20, 20, 30, .2);
    --grid-line: rgba(0, 0, 0, .04); color-scheme: light;
  }
}
:root[data-theme="light"] {
  --bg: #f5f5f7; --bg-2: #eeeef2; --panel: #ffffff; --panel-2: #f2f2f6; --line: #e1e2e8; --fg: #16171c; --muted: #646a78;
  --accent: #d1263c; --accent-2: #ef4f3f; --accent-soft: rgba(209, 38, 60, .09);
  --glow: 0 0 0 1px rgba(209, 38, 60, .25), 0 10px 30px -14px rgba(209, 38, 60, .35);
  --shadow: 0 1px 2px rgba(20, 20, 30, .05), 0 8px 24px -16px rgba(20, 20, 30, .2);
  --grid-line: rgba(0, 0, 0, .04); color-scheme: light;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--fg); font: 15px/1.65 var(--font-body); -webkit-font-smoothing: antialiased; overflow-x: clip; }
a { color: inherit; }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; margin: 0; text-wrap: balance; letter-spacing: -.01em; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }

/* ---------- الشعار ---------- */
.logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--font-display); font-weight: 600; font-size: 1.1rem; white-space: nowrap; }
.logo svg { width: 34px; height: 34px; flex: none; }
.logo b { color: var(--accent); font-weight: 600; }

/* ---------- أزرار ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 18px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--panel-2); cursor: pointer; text-decoration: none; font-weight: 500; white-space: nowrap;
  transition: border-color .15s, background .15s, transform .15s;
}
.btn:hover { border-color: var(--accent); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: linear-gradient(135deg, var(--accent), var(--accent-2)); border-color: transparent; color: var(--accent-fg); box-shadow: var(--glow); }
.btn.ok { background: var(--ok); border-color: transparent; color: #fff; }
.btn.danger { background: var(--bad); border-color: transparent; color: #fff; }
.btn.ghost { background: transparent; }
.btn.small { padding: 5px 12px; font-size: .85rem; border-radius: 8px; }
.btn.lg { padding: 13px 26px; font-size: 1.05rem; border-radius: 12px; }
.btn:disabled { opacity: .5; cursor: default; }
.icon-btn { width: 40px; height: 40px; padding: 0; border-radius: 10px; }
.btn svg, .nav-item svg { width: 18px; height: 18px; flex: none; }

/* ---------- الهبوط ---------- */
.site-nav {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 30; backdrop-filter: blur(14px);
  background: color-mix(in srgb, var(--bg) 78%, transparent); border-bottom: 1px solid var(--line);
}
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 31; background: var(--bg); }
.site-nav .in { max-width: 1180px; margin: 0 auto; display: flex; align-items: center; gap: 24px; padding-block: 14px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.site-nav nav { display: flex; gap: 22px; flex: 1; justify-content: center; }
.site-nav nav a { text-decoration: none; color: var(--muted); font-size: .95rem; }
.site-nav nav a:hover { color: var(--fg); }
.site-nav .actions { display: flex; gap: 8px; align-items: center; }
@media (max-width: 760px) { .site-nav nav { display: none; } .site-nav .in { justify-content: space-between; } }

.hero { position: relative; overflow: hidden; text-align: center; }
.hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(600px 300px at 50% 0%, var(--accent-soft), transparent 70%),
    linear-gradient(var(--grid-line) 1px, transparent 1px) 0 0 / 48px 48px,
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px) 0 0 / 48px 48px;
  mask-image: linear-gradient(#000 40%, transparent);
}
.hero .in { position: relative; max-width: 900px; margin: 0 auto; padding-block: 72px 56px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); display: grid; justify-items: center; gap: 22px; }
.badge-pill { display: inline-flex; align-items: center; gap: 10px; padding: 5px 6px 5px 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel); font-size: .88rem; }
.badge-pill span { background: var(--accent); color: var(--accent-fg); padding: 1px 10px; border-radius: 999px; font-size: .78rem; font-weight: 600; }
.hero h1 { font-size: clamp(2.3rem, 6.5vw, 4.6rem); line-height: 1.15; font-weight: 600; }
.hero h1 em { font-style: normal; background: linear-gradient(135deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p { color: var(--muted); font-size: 1.1rem; max-width: 56ch; margin: 0; }
.hero .cta { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.stat-strip { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); margin-top: 12px; width: min(560px, 100%); }
.stat-strip > div { padding: 16px 12px; text-align: center; }
.stat-strip > div + div { border-inline-start: 1px solid var(--line); }
.stat-strip b { display: block; font-family: var(--font-display); font-size: 1.6rem; font-variant-numeric: tabular-nums; }
.stat-strip span { color: var(--muted); font-size: .85rem; }

.section { max-width: 1180px; margin: 0 auto; padding-block: 56px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.section > header { text-align: center; display: grid; gap: 8px; margin-bottom: 32px; }
.section > header h2 { font-size: clamp(1.6rem, 3.5vw, 2.2rem); }
.section > header p { color: var(--muted); margin: 0; }
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.feature { padding: 22px; border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); display: grid; gap: 10px; align-content: start; }
.feature .ic { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.feature .ic svg { width: 22px; height: 22px; }
.feature p { margin: 0; color: var(--muted); font-size: .93rem; }
.cmd-cloud { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.cmd-cloud code { font-family: var(--font-mono); font-size: .85rem; padding: 4px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); direction: ltr; }
.site-foot { border-top: 1px solid var(--line); color: var(--muted); font-size: .88rem; }
.site-foot .in { max-width: 1180px; margin: 0 auto; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-block: 22px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }

/* ---------- قائمة السيرفرات ---------- */
.servers-page { max-width: 1100px; margin: 0 auto; padding-block: 40px 80px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.welcome-box { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; padding: 24px; border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); margin-bottom: 28px; }
.welcome-box h1 { font-size: 1.5rem; }
.guilds { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.guild-card { display: flex; align-items: center; gap: 14px; padding: 16px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); text-decoration: none; min-width: 0; transition: border-color .15s, transform .15s; }
.guild-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.guild-card .gi { width: 52px; height: 52px; border-radius: 16px; background: var(--panel-2); display: grid; place-items: center; font-weight: 600; flex: none; overflow: hidden; }
.guild-card .gi img { width: 100%; height: 100%; }
.guild-card .name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.guild-card .sub { font-size: .82rem; color: var(--muted); }
.guild-card.off { opacity: .65; }
.guild-card.off .sub { color: var(--accent); }

/* ---------- لوحة التحكم ---------- */
.shell { display: grid; grid-template-columns: 270px minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; overflow-y: auto; background: var(--bg-2); border-inline-start: 1px solid var(--line); padding: 18px 14px 40px; display: flex; flex-direction: column; gap: 6px; }
.sidebar .logo { padding: 4px 8px 14px; }
.sidebar .server-pick { padding: 0 4px 10px; }
.sidebar .server-pick label { font-size: .75rem; color: var(--muted); display: block; margin-bottom: 4px; }
.nav-group { margin-top: 10px; }
.nav-group > button { all: unset; display: flex; justify-content: space-between; align-items: center; width: 100%; box-sizing: border-box; padding: 6px 10px; font-size: .78rem; color: var(--muted); cursor: pointer; letter-spacing: .02em; }
.nav-group > button::after { content: "⌄"; transition: transform .15s; }
.nav-group.closed > button::after { transform: rotate(90deg); }
.nav-group.closed .items { display: none; }
.items { display: grid; gap: 2px; }
.nav-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; text-decoration: none; color: var(--muted); font-size: .95rem; border: 1px solid transparent; }
.nav-item:hover { background: var(--panel); color: var(--fg); }
.nav-item.active { background: var(--accent-soft); color: var(--fg); border-color: color-mix(in srgb, var(--accent) 35%, transparent); }
.nav-item.active svg { color: var(--accent); }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; display: flex; align-items: center; gap: 12px; padding: 12px max(16px, env(safe-area-inset-left, 0px)) 12px max(16px, env(safe-area-inset-right, 0px)); background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.bot-chip { display: flex; align-items: center; gap: 10px; }
.bot-chip img { width: 40px; height: 40px; border-radius: 12px; }
.bot-chip .n { font-weight: 600; line-height: 1.2; }
.bot-chip .s { font-size: .78rem; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 25%, transparent); }
.pill-active { font-size: .72rem; font-weight: 700; letter-spacing: .06em; padding: 3px 10px; border-radius: 999px; background: color-mix(in srgb, var(--ok) 15%, transparent); color: var(--ok); }
.topbar .spacer { flex: 1; }
.menu-btn { display: none; }
.content { padding: 28px max(16px, env(safe-area-inset-left, 0px)) 120px max(16px, env(safe-area-inset-right, 0px)); max-width: 1160px; width: 100%; margin: 0 auto; }

@media (max-width: 900px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; inset: 0 0 0 auto; width: min(300px, 86vw); z-index: 50; transform: translateX(100%); transition: transform .2s; box-shadow: var(--shadow); padding-top: calc(18px + env(safe-area-inset-top, 0px)); }
  .sidebar:not(.open) { visibility: hidden; }
  .sidebar.open { transform: none; }
  .menu-btn { display: inline-flex; }
  .topbar { gap: 8px; }
  .topbar .pill-active, .bot-chip .s, .topbar .user-name { display: none; }
  .bot-chip img { width: 34px; height: 34px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .stat { padding: 14px; }
  .stat b { font-size: 1.5rem; }
  .charts { grid-template-columns: minmax(0, 1fr); }
  .scrim { position: fixed; inset: 0; background: rgba(0, 0, 0, .5); z-index: 45; }
}

.page-head { display: grid; gap: 4px; margin-bottom: 22px; }
.page-head h1 { font-size: 1.75rem; display: flex; align-items: center; gap: 10px; }
.page-head h1 svg { width: 26px; height: 26px; color: var(--accent); }
.page-head p { margin: 0; color: var(--muted); }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); margin-bottom: 18px; box-shadow: var(--shadow); }
.card > .ch { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.card > .ch h3 { font-size: 1.02rem; display: flex; align-items: center; gap: 8px; }
.card > .ch h3 svg { width: 18px; height: 18px; color: var(--accent); }
.card > .ch p { margin: 0; color: var(--muted); font-size: .85rem; width: 100%; }
.card > .cb { padding: 20px; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 18px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 18px 20px; display: grid; gap: 10px; }
.stat .ic { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; }
.stat .ic svg { width: 22px; height: 22px; }
.stat b { font-family: var(--font-display); font-size: 1.9rem; line-height: 1; font-variant-numeric: tabular-nums; }
.stat span { color: var(--muted); font-size: .88rem; }
.tone-red { background: var(--accent-soft); color: var(--accent); }
.tone-green { background: color-mix(in srgb, var(--ok) 15%, transparent); color: var(--ok); }
.tone-amber { background: color-mix(in srgb, var(--warn) 15%, transparent); color: var(--warn); }
.tone-blue { background: color-mix(in srgb, var(--info) 15%, transparent); color: var(--info); }
.charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 18px; }
.charts .card { margin: 0; }
.chart-box { position: relative; height: 260px; }
.kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.kv > div { padding: 12px 14px; border-radius: 10px; background: var(--panel-2); min-width: 0; }
.kv span { display: block; font-size: .78rem; color: var(--muted); }
.kv b { font-weight: 500; overflow-wrap: anywhere; }

/* ---------- النماذج ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px 18px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label { font-size: .85rem; color: var(--muted); font-weight: 500; }
.field.wide { grid-column: 1 / -1; }
.hint { font-size: .8rem; color: var(--muted); }
input[type=text], input[type=number], input[type=url], select, textarea {
  width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg-2); transition: border-color .15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); outline: none; }
textarea { min-height: 84px; resize: vertical; }
input[type=color] { width: 44px; height: 42px; border: 1px solid var(--line); border-radius: 10px; padding: 3px; background: var(--bg-2); cursor: pointer; }
.toggle { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 14px; border-radius: 10px; background: var(--panel-2); cursor: pointer; border: 1px solid transparent; }
.toggle:hover { border-color: var(--line); }
.toggle input { appearance: none; width: 42px; height: 24px; border-radius: 12px; background: var(--line); position: relative; cursor: pointer; flex: none; transition: background .15s; margin: 0; }
.toggle input::after { content: ""; position: absolute; top: 3px; right: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: right .15s; }
.toggle input:checked { background: var(--ok); }
.toggle input:checked::after { right: 21px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 4px 3px 12px; border-radius: 999px; background: var(--accent-soft); font-size: .85rem; }
.chip button { border: 0; background: none; cursor: pointer; color: var(--muted); padding: 0 6px; font-size: 1rem; line-height: 1; }
.chips select { width: auto; min-width: 170px; flex: 1; }
.rows { display: flex; flex-direction: column; gap: 8px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row > * { flex: 1; min-width: 120px; }
.row > .btn { flex: none; min-width: 0; }
.limits { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.limit { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 10px; background: var(--panel-2); }
.limit .t { flex: 1; font-size: .92rem; }
.limit input[type=number] { width: 74px; }
.limit input[type=checkbox] { accent-color: var(--accent); width: 18px; height: 18px; }
.divider { border: 0; border-top: 1px solid var(--line); margin: 18px 0; }

/* المظهر */
.media-row { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.media-row .av { width: 84px; height: 84px; border-radius: 50%; object-fit: cover; border: 3px solid var(--accent); box-shadow: var(--glow); flex: none; background: var(--panel-2); }
.media-row .grow { flex: 1; min-width: 220px; display: grid; gap: 10px; }
.banner-prev { width: 100%; aspect-ratio: 5 / 2; max-height: 220px; border-radius: 12px; object-fit: cover; background: var(--panel-2); border: 1px solid var(--line); display: block; }
.banner-empty { display: grid; place-items: center; color: var(--muted); }
.swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.swatch { width: 36px; height: 36px; border-radius: 10px; border: 2px solid transparent; cursor: pointer; padding: 0; }
.swatch.on { border-color: var(--fg); }
.upload input[type=file] { display: none; }
.upload { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* شريط الحفظ */
.savebar { position: fixed; bottom: 0; left: 0; right: 0; z-index: 40; display: flex; justify-content: center; padding: 12px 16px calc(14px + env(safe-area-inset-bottom, 0px)); pointer-events: none; }
.savebar .in { pointer-events: auto; display: flex; align-items: center; gap: 14px; padding: 10px 10px 10px 18px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); box-shadow: 0 18px 50px -12px rgba(0, 0, 0, .6); flex-wrap: wrap; }
.savebar .in > span { display: flex; align-items: center; gap: 8px; }
.savebar .in > span::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--warn); }
.toast { position: fixed; top: calc(80px + env(safe-area-inset-top, 0px)); left: 50%; transform: translateX(-50%); z-index: 60; padding: 11px 20px; border-radius: 12px; background: var(--panel); border: 1px solid var(--ok); box-shadow: var(--shadow); }
.toast.err { border-color: var(--bad); color: var(--bad); }

/* محرر صورة الترحيب */
.editor { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: start; }
@media (max-width: 1240px) { .editor { grid-template-columns: minmax(0, 1fr); } }
.stage-wrap { background: repeating-conic-gradient(var(--panel-2) 0 25%, var(--panel) 0 50%) 0 0 / 20px 20px; border-radius: 12px; border: 1px solid var(--line); padding: 10px; }
.stage { position: relative; width: 100%; user-select: none; touch-action: none; }
.stage img { display: block; width: 100%; height: auto; border-radius: 8px; }
.stage .loading { position: absolute; top: 8px; left: 8px; font-size: .75rem; background: var(--panel); padding: 2px 8px; border-radius: 6px; }
.handle { position: absolute; transform: translate(-50%, -50%); cursor: grab; border: 2px dashed var(--accent); }
.handle.avatar { border-radius: 50%; }
.handle.avatar.square { border-radius: 0; }
.handle.avatar.rounded { border-radius: 20%; }
.handle.text { width: 18px; height: 18px; border-radius: 50%; background: var(--accent); border: 2px solid #fff; }
.handle.text span { position: absolute; bottom: 120%; left: 50%; transform: translateX(-50%); white-space: nowrap; font-size: .7rem; background: var(--accent); color: var(--accent-fg); padding: 1px 6px; border-radius: 4px; }
.handle.active { border-style: solid; }
.text-item { padding: 12px; border-radius: 10px; background: var(--panel-2); display: grid; gap: 8px; }
.text-item .row > * { min-width: 60px; }
.vars { font-family: var(--font-mono); font-size: .8rem; color: var(--muted); direction: ltr; text-align: right; }

/* الجداول */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { text-align: right; padding: 11px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--muted); font-weight: 500; font-size: .8rem; }
.who { display: flex; align-items: center; gap: 8px; }
.who img { width: 26px; height: 26px; border-radius: 50%; }
.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .78rem; background: var(--panel-2); }
.pill.on { background: color-mix(in srgb, var(--ok) 16%, transparent); color: var(--ok); }
.pill.t-ban, .pill.t-blacklist { color: var(--bad); }
.pill.t-mute, .pill.t-vmute, .pill.t-timeout, .pill.t-prison { color: var(--warn); }
.cmd-cat { margin-bottom: 18px; }
.cmd-cat h4 { margin-bottom: 10px; font-size: .95rem; }
.cmd-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 6px; }
.cmd-list .toggle { padding: 7px 12px; font-size: .88rem; }
.cmd-list code { font-family: var(--font-mono); color: var(--accent); }
.empty { padding: 40px; text-align: center; color: var(--muted); }
.center-page { min-height: 70vh; display: grid; place-items: center; text-align: center; gap: 14px; padding: 16px; }

@media (max-width: 900px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .stat { padding: 14px; }
  .stat b { font-size: 1.5rem; }
  .charts { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- المتجر: الباقات ---------- */
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.plan { padding: 24px; border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); display: grid; gap: 10px; text-align: center; }
.plan.featured { border-color: var(--accent); box-shadow: var(--glow); }
.plan h3 { font-size: 1.1rem; }
.plan .price { font-family: var(--font-display); font-size: 1.9rem; font-weight: 600; }
.plan .price small { font-size: .9rem; color: var(--muted); font-weight: 400; }
.plan ul { list-style: none; margin: 6px 0; padding: 0; display: grid; gap: 6px; color: var(--muted); font-size: .9rem; text-align: right; }
.plan li::before { content: "✓ "; color: var(--ok); }
.store-note { text-align: center; color: var(--muted); margin-top: 18px; }

/* ---------- لوحة العميل ---------- */
.mini-stats { display: flex; gap: 10px; flex-wrap: wrap; }
.mini-stats > div { min-width: 86px; padding: 10px 14px; border-radius: 12px; background: var(--panel-2); text-align: center; }
.mini-stats b { display: block; font-family: var(--font-display); font-size: 1.4rem; font-variant-numeric: tabular-nums; }
.mini-stats span { font-size: .78rem; color: var(--muted); }
.sub-card { border: 1px solid var(--line); border-radius: 18px; background: var(--panel); margin-bottom: 22px; overflow: hidden; }
.sub-head { display: flex; align-items: center; gap: 14px; padding: 18px 20px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.sub-head img { width: 56px; height: 56px; border-radius: 16px; background: var(--panel-2); object-fit: cover; }
.sub-head .t { flex: 1; min-width: 160px; }
.sub-head h2 { font-size: 1.2rem; }
.sub-head .muted { font-size: .85rem; }
.status { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 999px; font-size: .82rem; font-weight: 600; }
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.st-online { color: var(--ok); background: color-mix(in srgb, var(--ok) 14%, transparent); }
.st-starting { color: var(--warn); background: color-mix(in srgb, var(--warn) 14%, transparent); }
.st-stopped { color: var(--muted); background: var(--panel-2); }
.st-expired, .st-suspended { color: var(--bad); background: color-mix(in srgb, var(--bad) 14%, transparent); }
.sub-body { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 18px; padding: 20px; }
@media (max-width: 900px) { .sub-body { grid-template-columns: minmax(0, 1fr); } }
.power { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.power button { all: unset; box-sizing: border-box; cursor: pointer; display: grid; justify-items: center; gap: 6px; padding: 16px 8px; border-radius: 14px; background: var(--panel-2); border: 1px solid var(--line); text-align: center; font-weight: 600; font-size: .92rem; }
.power button:hover:not(:disabled) { border-color: var(--accent); }
.power button:disabled { opacity: .45; cursor: default; }
.power button svg { width: 22px; height: 22px; }
.power .p-start svg { color: var(--ok); } .power .p-stop svg { color: var(--warn); } .power .p-restart svg { color: var(--info); }
.power small { font-weight: 400; color: var(--muted); font-size: .75rem; }
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
.tile { padding: 14px; border-radius: 14px; background: var(--panel-2); display: grid; gap: 4px; min-width: 0; }
.tile span { font-size: .78rem; color: var(--muted); }
.tile b { font-family: var(--font-display); font-size: 1.05rem; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.progress { height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; margin-top: 4px; }
.progress i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); border-radius: 3px; }
.ctl-list { display: grid; gap: 8px; }
.ctl { all: unset; box-sizing: border-box; cursor: pointer; display: flex; align-items: center; gap: 12px; padding: 13px 14px; border-radius: 12px; background: var(--panel-2); border: 1px solid transparent; text-decoration: none; }
.ctl:hover { border-color: var(--line); }
.ctl .ic { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; flex: none; }
.ctl .ic svg { width: 18px; height: 18px; }
.ctl .tx { flex: 1; min-width: 0; }
.ctl .tx b { display: block; font-weight: 600; font-size: .95rem; }
.ctl .tx span { font-size: .8rem; color: var(--muted); }
.ctl .arrow { color: var(--muted); }
.ctl.disabled { opacity: .5; pointer-events: none; }
.alert { padding: 12px 16px; border-radius: 12px; font-size: .9rem; display: flex; gap: 10px; align-items: flex-start; }
.alert.err { background: color-mix(in srgb, var(--bad) 12%, transparent); color: var(--bad); }
.alert.warn { background: color-mix(in srgb, var(--warn) 12%, transparent); color: var(--warn); }
.steps { counter-reset: s; display: grid; gap: 10px; padding: 0; margin: 0; list-style: none; }
.steps li { counter-increment: s; display: grid; grid-template-columns: 28px 1fr; gap: 10px; align-items: start; font-size: .92rem; }
.steps li::before { content: counter(s); width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: .85rem; }
.steps code { font-family: var(--font-mono); background: var(--panel-2); padding: 1px 6px; border-radius: 6px; font-size: .82rem; }

/* نافذة منبثقة */
dialog.modal { border: 1px solid var(--line); border-radius: 18px; background: var(--panel); color: var(--fg); padding: 0; width: min(520px, calc(100vw - 32px)); box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .7); }
dialog.modal::backdrop { background: rgba(0, 0, 0, .6); backdrop-filter: blur(3px); }
dialog.modal header { padding: 18px 20px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; }
dialog.modal .mb { padding: 20px; display: grid; gap: 14px; }
dialog.modal footer { padding: 14px 20px; border-top: 1px solid var(--line); display: flex; gap: 8px; justify-content: flex-start; }

/* لوحة الإدارة */
.admin-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; }
@media (max-width: 900px) { .admin-grid { grid-template-columns: minmax(0, 1fr); } }
.inline-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.inline-actions select { width: auto; padding: 5px 8px; font-size: .85rem; }
