/* =========================================================
   sites-hub — styles
   ========================================================= */

:root {
  --font: 'IBM Plex Sans Arabic', 'Segoe UI', system-ui, -apple-system, sans-serif;

  --bg: #060911;
  --bg-2: #080d18;
  --surface: rgba(255, 255, 255, 0.045);
  --surface-2: rgba(255, 255, 255, 0.075);
  --surface-solid: #0d1421;
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.18);
  --text: #e9effb;
  --text-soft: #c3cee2;
  --muted: #8a9bb9;
  --shadow-lg: 0 30px 70px -30px rgba(0, 0, 0, 0.9);
  --shadow-sm: 0 10px 26px -16px rgba(0, 0, 0, 0.8);
  --ring: rgba(96, 165, 250, 0.35);

  --brand: #3b82f6;
  --brand-2: #60a5fa;
  --brand-soft: rgba(59, 130, 246, 0.16);

  --radius: 20px;
  --radius-sm: 12px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

[data-theme='light'] {
  --bg: #eff4fc;
  --bg-2: #e5edfa;
  --surface: #ffffff;
  --surface-2: #f5f8ff;
  --surface-solid: #ffffff;
  --border: #dde7f6;
  --border-strong: #c5d5ec;
  --text: #0a1728;
  --text-soft: #2c3f5c;
  --muted: #5f7391;
  --shadow-lg: 0 30px 60px -34px rgba(23, 52, 96, 0.35);
  --shadow-sm: 0 12px 28px -20px rgba(23, 52, 96, 0.4);
  --ring: rgba(59, 130, 246, 0.28);
  --brand-soft: rgba(59, 130, 246, 0.1);
}

[data-accent='cyan'] { --brand: #0891b2; --brand-2: #22d3ee; --brand-soft: rgba(8, 145, 178, 0.16); }
[data-accent='violet'] { --brand: #7c3aed; --brand-2: #a78bfa; --brand-soft: rgba(124, 58, 237, 0.16); }
[data-accent='indigo'] { --brand: #4f46e5; --brand-2: #818cf8; --brand-soft: rgba(79, 70, 229, 0.16); }
[data-accent='emerald'] { --brand: #059669; --brand-2: #34d399; --brand-soft: rgba(5, 150, 105, 0.16); }
[data-accent='amber'] { --brand: #d97706; --brand-2: #fbbf24; --brand-soft: rgba(217, 119, 6, 0.16); }
[data-accent='rose'] { --brand: #e11d48; --brand-2: #fb7185; --brand-soft: rgba(225, 29, 72, 0.16); }
[data-accent='slate'] { --brand: #475569; --brand-2: #94a3b8; --brand-soft: rgba(71, 85, 105, 0.18); }

*,
*::before,
*::after { box-sizing: border-box; }

[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background 0.35s var(--ease), color 0.35s var(--ease);
}

/* خلفية مزخرفة */
.bg-orbs {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(900px 620px at 88% -12%, color-mix(in srgb, var(--brand) 34%, transparent), transparent 62%),
    radial-gradient(720px 520px at 2% 4%, color-mix(in srgb, var(--brand-2) 18%, transparent), transparent 60%),
    radial-gradient(900px 700px at 50% 118%, rgba(99, 102, 241, 0.18), transparent 62%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
}

.bg-orbs::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: linear-gradient(to right, rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(circle at 50% 12%, black, transparent 72%);
  -webkit-mask-image: radial-gradient(circle at 50% 12%, black, transparent 72%);
  opacity: 0.55;
}

[data-theme='light'] .bg-orbs::after {
  background-image: linear-gradient(to right, rgba(20, 50, 100, 0.06) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(20, 50, 100, 0.06) 1px, transparent 1px);
  opacity: 0.8;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
img { max-width: 100%; display: block; }

.wrap {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
}

/* =========================================================
   الهيدر
   ========================================================= */

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  border-bottom: 1px solid transparent;
  transition: background 0.3s var(--ease), border-color 0.3s var(--ease), backdrop-filter 0.3s;
}

.topbar.is-stuck {
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  border-bottom-color: var(--border);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 16px;
  padding-bottom: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  box-shadow: 0 10px 24px -12px var(--brand), inset 0 1px 0 rgba(255, 255, 255, 0.4);
  flex: none;
}

.brand-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }

.brand-name {
  font-weight: 600;
  font-size: 15.5px;
  letter-spacing: -0.2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand-sub {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.6px;
  text-transform: uppercase;
}

.topbar-actions { display: flex; align-items: center; gap: 8px; flex: none; }

.icon-btn {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-soft);
  cursor: pointer;
  transition: all 0.2s var(--ease);
}

.icon-btn:hover { color: var(--text); border-color: var(--border-strong); background: var(--surface-2); }
.icon-btn svg { width: 18px; height: 18px; }
[data-theme='light'] .icon-sun { display: none; }
[data-theme='dark'] .icon-moon { display: none; }

.ghost-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-soft);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s var(--ease);
  white-space: nowrap;
}

.ghost-btn:hover {
  color: var(--text);
  border-color: color-mix(in srgb, var(--brand) 45%, var(--border));
  background: var(--brand-soft);
  transform: translateY(-1px);
}

.ghost-btn svg { width: 16px; height: 16px; }

/* =========================================================
   الواجهة الرئيسية
   ========================================================= */

main { padding-bottom: 32px; }

.hero {
  padding: 64px 0 34px;
  max-width: 760px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px 6px 10px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--brand) 30%, var(--border));
  background: var(--brand-soft);
  color: color-mix(in srgb, var(--brand-2) 75%, var(--text));
  font-size: 12.5px;
  font-weight: 500;
  margin-bottom: 22px;
}

.pulse {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--brand-2);
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--brand-2) 70%, transparent);
  animation: pulse 2.6s infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--brand-2) 60%, transparent); }
  70% { box-shadow: 0 0 0 9px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

.hero h1 {
  margin: 0 0 14px;
  font-size: clamp(32px, 5.4vw, 54px);
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: -1px;
  background: linear-gradient(115deg, var(--text) 30%, color-mix(in srgb, var(--brand-2) 85%, var(--text)) 78%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-sub {
  margin: 0 0 22px;
  color: var(--muted);
  font-size: 16px;
  max-width: 600px;
  line-height: 1.75;
}

.hero-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 26px; }

.meta-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--text-soft);
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
}

.meta-chip b { font-weight: 600; color: var(--text); }

.search {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 520px;
  padding: 0 16px;
  height: 52px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--surface);
  backdrop-filter: blur(12px);
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.search:focus-within {
  border-color: color-mix(in srgb, var(--brand) 55%, var(--border));
  box-shadow: 0 0 0 4px var(--ring);
  background: var(--surface-2);
}

.search svg { width: 18px; height: 18px; color: var(--muted); flex: none; }

.search input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  font-family: inherit;
  font-size: 14.5px;
  outline: none;
}

.search input::placeholder { color: var(--muted); }
.search input::-webkit-search-cancel-button { display: none; }

.search kbd {
  font-family: var(--font);
  font-size: 11px;
  color: var(--muted);
  border: 1px solid var(--border-strong);
  border-bottom-width: 2px;
  border-radius: 6px;
  padding: 1px 7px;
  background: var(--surface-2);
}

/* ---------- شبكة المواقع ---------- */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
  padding-bottom: 24px;
}

.card {
  --c1: #3b82f6;
  --c2: #60a5fa;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 20px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  overflow: hidden;
  isolation: isolate;
  transition: transform 0.28s var(--ease), border-color 0.28s var(--ease), box-shadow 0.28s var(--ease),
    background 0.28s var(--ease);
  animation: card-in 0.5s var(--ease) both;
  animation-delay: calc(var(--i, 0) * 45ms);
  box-shadow: var(--shadow-sm);
}

@keyframes card-in {
  from { opacity: 0; transform: translateY(14px) scale(0.985); }
  to { opacity: 1; transform: none; }
}

.card::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(420px 160px at 88% -10%, color-mix(in srgb, var(--c1) 26%, transparent), transparent 70%);
  opacity: 0;
  transition: opacity 0.3s var(--ease);
}

.card::after {
  content: '';
  position: absolute;
  top: 0;
  inset-inline: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--c2), transparent);
  opacity: 0;
  transition: opacity 0.3s var(--ease);
}

.card:hover {
  transform: translateY(-5px);
  border-color: color-mix(in srgb, var(--c1) 48%, var(--border));
  box-shadow: 0 26px 54px -30px color-mix(in srgb, var(--c1) 75%, black), var(--shadow-sm);
  background: var(--surface-2);
}

.card:hover::before,
.card:hover::after { opacity: 1; }

.card:focus-visible { outline: 2px solid var(--c2); outline-offset: 3px; }

.card-top { display: flex; align-items: center; gap: 12px; }

.card-id { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 3px; }

.avatar {
  width: 48px;
  height: 48px;
  flex: none;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-size: 22px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(145deg, var(--c2), var(--c1));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45), 0 12px 24px -14px var(--c1);
  overflow: hidden;
}

.avatar span { transform: translateY(1px); }

.card-arrow {
  width: 30px;
  height: 30px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: var(--muted);
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 30%, transparent);
  transition: all 0.25s var(--ease);
}

.card-arrow svg { width: 15px; height: 15px; }

.card:hover .card-arrow {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(145deg, var(--c2), var(--c1));
  transform: translate(-2px, -2px);
  box-shadow: 0 8px 18px -10px var(--c1);
}

.card-title {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: -0.2px;
  color: var(--text);
  overflow-wrap: anywhere;
}

.card-host {
  margin: 0;
  font-size: 11.5px;
  color: var(--muted);
  direction: ltr;
  text-align: right;
  font-family: ui-monospace, 'SF Mono', 'Cascadia Mono', Consolas, monospace;
  letter-spacing: -0.2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-desc {
  margin: 2px 0 0;
  font-size: 13px;
  line-height: 1.65;
  color: var(--text-soft);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-foot {
  margin-top: auto;
  padding-top: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border-top: 1px solid var(--border);
}

.card-cta {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: color 0.2s;
}

.card:hover .card-cta { color: color-mix(in srgb, var(--c2) 80%, var(--text)); }
.card-cta svg { width: 14px; height: 14px; }

.copy-btn {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  opacity: 0;
  transition: all 0.2s var(--ease);
}

.card:hover .copy-btn,
.copy-btn:focus-visible { opacity: 1; }
.copy-btn:hover { color: var(--text); background: var(--surface-2); border-color: var(--border-strong); }
.copy-btn svg { width: 14px; height: 14px; }

.card-sheen {
  position: absolute;
  inset: -40% -60%;
  z-index: -1;
  background: linear-gradient(115deg, transparent 38%, rgba(255, 255, 255, 0.09) 48%, transparent 58%);
  transform: translateX(-60%);
  transition: transform 0.9s var(--ease);
  pointer-events: none;
}

.card:hover .card-sheen { transform: translateX(60%); }

/* ألوان الكروت */
.accent-blue { --c1: #3b82f6; --c2: #60a5fa; }
.accent-cyan { --c1: #0891b2; --c2: #22d3ee; }
.accent-violet { --c1: #7c3aed; --c2: #a78bfa; }
.accent-indigo { --c1: #4f46e5; --c2: #818cf8; }
.accent-emerald { --c1: #059669; --c2: #34d399; }
.accent-amber { --c1: #d97706; --c2: #fbbf24; }
.accent-rose { --c1: #e11d48; --c2: #fb7185; }
.accent-slate { --c1: #475569; --c2: #94a3b8; }

/* ---------- حالات فارغة ---------- */

.empty {
  text-align: center;
  padding: 70px 24px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--muted);
}

.empty-icon { font-size: 34px; margin-bottom: 10px; }
.empty h3 { margin: 0 0 6px; color: var(--text); font-size: 17px; font-weight: 600; }
.empty p { margin: 0 0 18px; font-size: 13.5px; }

.skeleton {
  height: 176px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: linear-gradient(100deg, var(--surface) 30%, var(--surface-2) 50%, var(--surface) 70%);
  background-size: 240% 100%;
  animation: shimmer 1.4s infinite linear;
}

@keyframes shimmer {
  from { background-position: 130% 0; }
  to { background-position: -30% 0; }
}

/* =========================================================
   الفوتر
   ========================================================= */

.footer {
  margin-top: 30px;
  border-top: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 60%, transparent);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding-top: 26px;
  padding-bottom: 28px;
}

.dev { display: flex; align-items: center; gap: 12px; }

.dev-mark {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  box-shadow: 0 8px 20px -12px var(--brand);
}

.dev div { display: flex; flex-direction: column; line-height: 1.35; }
.dev strong { font-size: 14px; font-weight: 600; }
.dev span { font-size: 11.5px; color: var(--muted); }

.dev-links { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }

.dev-links a {
  font-size: 12.5px;
  color: var(--muted);
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid transparent;
  transition: all 0.2s var(--ease);
}

.dev-links a:hover {
  color: var(--text);
  border-color: var(--border);
  background: var(--surface);
}

.copyright { font-size: 12px; color: var(--muted); }
.footer-note { font-size: 12.5px; color: var(--muted); width: 100%; }

/* =========================================================
   لوحة التحكم
   ========================================================= */

.admin-main { padding-top: 34px; padding-bottom: 60px; min-height: 60vh; }

/* شاشة الدخول */
.auth-screen { display: grid; place-items: center; padding: 50px 0 30px; }

.auth-card {
  width: 100%;
  max-width: 420px;
  padding: 30px 28px;
  border-radius: 24px;
  border: 1px solid var(--border);
  background: var(--surface);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow-lg);
  animation: card-in 0.45s var(--ease) both;
}

.auth-icon {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  font-size: 24px;
  border-radius: 16px;
  background: var(--brand-soft);
  border: 1px solid color-mix(in srgb, var(--brand) 32%, var(--border));
  margin-bottom: 18px;
}

.auth-card h1 { margin: 0 0 6px; font-size: 22px; font-weight: 700; letter-spacing: -0.4px; }
.auth-card > p { margin: 0 0 22px; font-size: 13.5px; color: var(--muted); line-height: 1.7; }

/* الحقول */
.field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }

.field > span {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-soft);
  display: flex;
  align-items: center;
  gap: 6px;
}

.field > span em { font-style: normal; color: var(--muted); font-size: 11.5px; }

.field input,
.field textarea,
.field select {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 45%, var(--surface));
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.field textarea { height: auto; min-height: 84px; padding: 12px 14px; resize: vertical; line-height: 1.6; }

.field input::placeholder,
.field textarea::placeholder { color: var(--muted); opacity: 0.85; }

.field input:focus,
.field textarea:focus,
.field select:focus {
  border-color: color-mix(in srgb, var(--brand) 60%, var(--border));
  box-shadow: 0 0 0 4px var(--ring);
  background: var(--surface-2);
}

[data-theme='light'] .field input,
[data-theme='light'] .field textarea { background: #fff; }

.form-error {
  margin: 12px 0 0;
  font-size: 12.5px;
  color: #f87171;
  background: rgba(248, 113, 113, 0.1);
  border: 1px solid rgba(248, 113, 113, 0.25);
  padding: 9px 12px;
  border-radius: 10px;
}

.hint {
  margin: 18px 0 0;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.8;
  border-top: 1px solid var(--border);
  padding-top: 14px;
}

.hint code {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 11.5px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1px 6px;
  direction: ltr;
  display: inline-block;
}

/* الأزرار */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding: 0 20px;
  border-radius: 12px;
  border: 1px solid transparent;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s var(--ease);
  white-space: nowrap;
}

.btn svg { width: 16px; height: 16px; }

.btn.primary {
  color: #fff;
  background: linear-gradient(150deg, var(--brand-2), var(--brand));
  box-shadow: 0 14px 28px -16px var(--brand), inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.btn.primary:hover { transform: translateY(-1px); box-shadow: 0 18px 34px -16px var(--brand), inset 0 1px 0 rgba(255, 255, 255, 0.32); }
.btn.primary:active { transform: translateY(0); }

.btn.ghost {
  border-color: var(--border);
  background: var(--surface);
  color: var(--text-soft);
}

.btn.ghost:hover { background: var(--surface-2); border-color: var(--border-strong); color: var(--text); }

.btn.danger { border-color: rgba(248, 113, 113, 0.35); background: rgba(248, 113, 113, 0.12); color: #fca5a5; }
.btn.danger:hover { background: rgba(248, 113, 113, 0.2); }

.btn.sm { height: 34px; padding: 0 13px; font-size: 12.5px; border-radius: 10px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none !important; }

/* رأس اللوحة */
.dash { animation: card-in 0.4s var(--ease) both; }

.dash-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

.dash-head h1 { margin: 0 0 4px; font-size: 26px; font-weight: 700; letter-spacing: -0.6px; }
.dash-head p { margin: 0; font-size: 13px; color: var(--muted); max-width: 560px; }
.dash-head-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.mode-banner {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid rgba(251, 191, 36, 0.32);
  background: rgba(251, 191, 36, 0.1);
  color: #fcd34d;
  font-size: 12.5px;
  line-height: 1.7;
  margin-bottom: 18px;
}

[data-theme='light'] .mode-banner { color: #92400e; }

.mode-banner b { font-weight: 600; }

/* التبويبات */
.tabs {
  display: flex;
  gap: 6px;
  padding: 6px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--surface);
  width: fit-content;
  max-width: 100%;
  overflow-x: auto;
  margin-bottom: 18px;
}

.tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 16px;
  border-radius: 11px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s var(--ease);
}

.tab:hover { color: var(--text); }

.tab.active {
  color: var(--text);
  background: var(--surface-2);
  box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

[data-theme='light'] .tab.active { background: #fff; }

.pill {
  font-size: 11px;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: color-mix(in srgb, var(--brand-2) 80%, var(--text));
  border: 1px solid color-mix(in srgb, var(--brand) 30%, transparent);
}

.panel { display: flex; flex-direction: column; gap: 16px; }

/* البطاقات داخل اللوحة */
.card.form-card,
.card.list-card {
  padding: 22px;
  background: var(--surface);
  cursor: default;
  animation: none;
  transform: none !important;
}

.card.form-card:hover,
.card.list-card:hover {
  border-color: var(--border);
  box-shadow: var(--shadow-sm);
  background: var(--surface);
}

.card.form-card::before,
.card.form-card::after,
.card.list-card::before,
.card.list-card::after { display: none; }

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.card-head h2 {
  margin: 0;
  font-size: 15.5px;
  font-weight: 600;
  letter-spacing: -0.2px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.small { font-size: 12px; color: var(--muted); }

.grid-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.grid-form .span2 { grid-column: 1 / -1; }

.form-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.save-note { font-size: 12.5px; color: #34d399; }

/* اختيار الأيقونة */
.emoji-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }

.emoji-btn {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  font-size: 17px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  cursor: pointer;
  transition: all 0.18s var(--ease);
}

.emoji-btn:hover { transform: translateY(-2px); border-color: var(--border-strong); }

.emoji-btn.active {
  border-color: color-mix(in srgb, var(--brand) 65%, transparent);
  box-shadow: 0 0 0 3px var(--ring);
  background: var(--brand-soft);
}

.emoji-input {
  width: 46px !important;
  text-align: center;
  font-size: 18px !important;
  padding: 0 !important;
}

/* عيّنات الألوان */
.swatches { display: flex; flex-wrap: wrap; gap: 8px; }

.swatch {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  border: 2px solid transparent;
  cursor: pointer;
  background: linear-gradient(145deg, var(--c1), var(--c2));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
  transition: transform 0.18s var(--ease), box-shadow 0.18s var(--ease);
  position: relative;
}

.swatch:hover { transform: translateY(-2px); }

.swatch.active {
  border-color: color-mix(in srgb, var(--text) 75%, transparent);
  box-shadow: 0 0 0 3px var(--ring);
}

/* المفتاح */
.switch-field {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--text-soft);
  cursor: pointer;
  padding: 10px 0;
  user-select: none;
}

.switch-field input { position: absolute; opacity: 0; width: 0; height: 0; }

.switch {
  width: 40px;
  height: 23px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  position: relative;
  transition: all 0.22s var(--ease);
  flex: none;
}

.switch::after {
  content: '';
  position: absolute;
  top: 2px;
  right: 2px;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: var(--muted);
  transition: all 0.22s var(--ease);
}

.switch-field input:checked + .switch {
  background: linear-gradient(150deg, var(--brand-2), var(--brand));
  border-color: transparent;
}

.switch-field input:checked + .switch::after { right: 20px; background: #fff; }
.switch-field input:focus-visible + .switch { box-shadow: 0 0 0 3px var(--ring); }

/* قائمة المواقع */
.site-list { display: flex; flex-direction: column; gap: 10px; }

.site-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 30%, transparent);
  transition: all 0.2s var(--ease);
}

.site-row:hover { border-color: var(--border-strong); background: var(--surface-2); }
.site-row.is-hidden { opacity: 0.55; }

.site-row .avatar { width: 42px; height: 42px; border-radius: 12px; font-size: 19px; }

.row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }

.row-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  gap: 8px;
}

.row-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  border: 1px solid var(--border);
  flex: none;
}

.row-host {
  font-size: 11.5px;
  color: var(--muted);
  direction: ltr;
  text-align: right;
  font-family: ui-monospace, Consolas, monospace;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.row-actions { display: flex; align-items: center; gap: 4px; flex: none; }

.mini-btn {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.18s var(--ease);
}

.mini-btn svg { width: 15px; height: 15px; }
.mini-btn:hover { color: var(--text); background: var(--surface-2); border-color: var(--border); }
.mini-btn.danger:hover { color: #fca5a5; background: rgba(248, 113, 113, 0.12); border-color: rgba(248, 113, 113, 0.25); }
.mini-btn:disabled { opacity: 0.3; cursor: default; }

.row-edit {
  display: none;
  padding: 14px 12px 16px;
  border-radius: 14px;
  border: 1px dashed var(--border-strong);
  background: var(--surface-2);
  margin-top: -4px;
}

.site-item { display: flex; flex-direction: column; }

.empty-mini {
  text-align: center;
  padding: 26px 12px;
  color: var(--muted);
  font-size: 13px;
  border: 1px dashed var(--border);
  border-radius: 12px;
}

/* معاينة سريعة */
.preview-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px 6px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  font-size: 12.5px;
  color: var(--text-soft);
  max-width: 100%;
  overflow: hidden;
}

.preview-chip .mini-avatar {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-size: 13px;
  color: #fff;
  background: linear-gradient(145deg, var(--c2), var(--c1));
  flex: none;
}

.preview-chip span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* =========================================================
   توست + مودال
   ========================================================= */

.toast-wrap {
  position: fixed;
  inset-inline: 0;
  bottom: 22px;
  z-index: 90;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
  padding: 0 16px;
}

.toast {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 11px 18px;
  border-radius: 12px;
  border: 1px solid var(--border-strong);
  background: color-mix(in srgb, var(--surface-solid) 88%, transparent);
  backdrop-filter: blur(14px);
  color: var(--text);
  font-size: 13px;
  box-shadow: var(--shadow-lg);
  animation: toast-in 0.3s var(--ease) both;
}

.toast.ok { border-color: rgba(52, 211, 153, 0.4); }
.toast.err { border-color: rgba(248, 113, 113, 0.45); }
.toast .tick { color: #34d399; }
.toast.err .tick { color: #f87171; }

@keyframes toast-in {
  from { opacity: 0; transform: translateY(12px) scale(0.97); }
  to { opacity: 1; transform: none; }
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(3, 6, 12, 0.62);
  backdrop-filter: blur(6px);
  animation: fade-in 0.2s var(--ease) both;
}

@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

.modal-card {
  width: 100%;
  max-width: 400px;
  padding: 24px;
  border-radius: 20px;
  border: 1px solid var(--border-strong);
  background: var(--surface-solid);
  box-shadow: var(--shadow-lg);
  animation: card-in 0.25s var(--ease) both;
}

.modal-card h3 { margin: 0 0 8px; font-size: 17px; font-weight: 600; }
.modal-card p { margin: 0 0 20px; font-size: 13.5px; color: var(--muted); line-height: 1.7; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-start; }

/* =========================================================
   استجابة الشاشات
   ========================================================= */

@media (max-width: 720px) {
  .wrap { padding: 0 16px; }
  .hero { padding: 38px 0 24px; }
  .hero h1 { font-size: clamp(28px, 8vw, 38px); letter-spacing: -0.6px; }
  .hero-sub { font-size: 14.5px; }
  .grid { grid-template-columns: 1fr; gap: 12px; }
  .grid-form { grid-template-columns: 1fr; }
  .footer-inner { flex-direction: column; align-items: flex-start; gap: 14px; }
  .dash-head h1 { font-size: 22px; }
  .card.form-card, .card.list-card { padding: 18px; }
  .site-row { flex-wrap: wrap; }
  .row-actions { width: 100%; justify-content: flex-end; }
  .brand-sub { display: none; }
  .auth-card { padding: 24px 20px; }
  .search kbd { display: none; }
  .search { height: 48px; }
}

@media (min-width: 721px) {
  .site-item .row-edit .grid-form { grid-template-columns: 1fr 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

::selection { background: color-mix(in srgb, var(--brand) 45%, transparent); color: #fff; }
