/* ════════════════════════════════════════════════════════════════════════
   YUNKU CLOUD STUDIO — Crafted Luxury Dark SaaS Design System (v5.0)
   Inspired by Resend · Linear · Raycast · Full LTR (EN) & RTL (العربية)
   ════════════════════════════════════════════════════════════════════════ */

:root {
  --bg-canvas: #07080b;
  --bg-sidebar: #0b0c10;
  --bg-surface: #101218;
  --bg-surface-2: #151821;
  --bg-elevated: #1b1f2b;
  --bg-input: #0b0d12;

  --border: rgba(255, 255, 255, 0.075);
  --border-strong: rgba(255, 255, 255, 0.14);
  --border-highlight: rgba(255, 255, 255, 0.22);

  --accent: #6366f1;
  --accent-2: #818cf8;
  --accent-hover: #4f46e5;
  --accent-soft: rgba(99, 102, 241, 0.14);
  --accent-glow: rgba(99, 102, 241, 0.28);

  --emerald: #10b981;
  --emerald-soft: rgba(16, 185, 129, 0.13);
  --amber: #f59e0b;
  --amber-soft: rgba(245, 158, 11, 0.13);
  --rose: #f43f5e;
  --rose-soft: rgba(244, 63, 94, 0.14);
  --sky: #38bdf8;
  --sky-soft: rgba(56, 189, 248, 0.13);
  --violet: #a855f7;
  --violet-soft: rgba(168, 85, 247, 0.14);

  --text-1: #f8fafc;
  --text-2: #cbd5e1;
  --text-3: #8b95a7;
  --text-4: #596375;

  --font-sans: 'Inter', 'Segoe UI', 'IBM Plex Sans Arabic', 'Tahoma', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'Cascadia Code', 'Consolas', monospace;
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
}

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

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  background: var(--bg-canvas);
  color: var(--text-1);
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

html[dir="rtl"] body {
  font-size: 13.4px;
}

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.12); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.22); }

.mono { font-family: var(--font-mono); font-size: 12px; direction: ltr; unicode-bidi: isolate; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--text-3); }
.hidden { display: none !important; }

/* ── Ambient Luxury Auth Gate ── */
.auth-screen {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(640px circle at 50% 0%, rgba(99, 102, 241, 0.16), transparent 70%),
    radial-gradient(480px circle at 85% 90%, rgba(16, 185, 129, 0.08), transparent 65%),
    var(--bg-canvas);
  z-index: 9000;
}

.auth-card {
  width: 100%;
  max-width: 410px;
  background: linear-gradient(180deg, rgba(25, 29, 41, 0.94) 0%, rgba(15, 17, 24, 0.98) 100%);
  border: 1px solid var(--border-strong);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.10),
    0 32px 80px rgba(0, 0, 0, 0.72);
  border-radius: 18px;
  padding: 30px;
  position: relative;
}

.auth-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 11px;
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.42), inset 0 1px 0 rgba(255,255,255,0.35);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.brand-mark svg { width: 18px; height: 18px; stroke: #fff; fill: none; stroke-width: 2.2; }

.auth-title { margin: 0 0 5px; font-size: 20px; font-weight: 700; letter-spacing: -0.025em; }
.auth-sub { margin: 0 0 22px; font-size: 12.8px; color: var(--text-3); }

/* ── Main App Shell (LTR + RTL Native) ── */
.app-shell {
  display: flex;
  width: 100%;
  height: 100vh;
  background:
    radial-gradient(900px 320px at 50% -100px, rgba(99, 102, 241, 0.09), transparent 72%),
    var(--bg-canvas);
}

.sidebar {
  width: 252px;
  flex-shrink: 0;
  background: var(--bg-sidebar);
  border-inline-end: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 16px 12px;
  z-index: 20;
}

.sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 6px 15px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 12px;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}
.sidebar-brand-title { font-size: 14px; font-weight: 700; letter-spacing: -0.015em; color: var(--text-1); }
.sidebar-brand-sub { font-size: 10.5px; color: var(--accent-2); font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; }

.cmd-trigger {
  width: 100%;
  height: 35px;
  padding: 0 11px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text-3);
  font-family: inherit;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  margin-bottom: 12px;
  transition: all 0.15s ease;
}
.cmd-trigger:hover { border-color: var(--border-strong); color: var(--text-1); background: var(--bg-surface-2); }
.cmd-trigger-left { display: inline-flex; align-items: center; gap: 8px; }
.cmd-trigger-left svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 2; }

.kbd {
  font-family: var(--font-mono);
  font-size: 10.5px;
  padding: 2px 6px;
  border-radius: 5px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  color: var(--text-3);
  direction: ltr;
}

.nav-scroll {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-section-label {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-4);
  padding: 12px 10px 5px;
}

.nav-item {
  width: 100%;
  height: 36px;
  padding: 0 11px;
  border-radius: 9px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-3);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: all 0.14s ease;
  text-align: start;
}
.nav-item svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 1.85; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.nav-item:hover { background: rgba(255, 255, 255, 0.035); color: var(--text-1); }
.nav-item.is-active {
  background: linear-gradient(90deg, rgba(99, 102, 241, 0.16) 0%, rgba(99, 102, 241, 0.04) 100%);
  border-color: rgba(99, 102, 241, 0.30);
  color: #fff;
  font-weight: 600;
}
.nav-item.is-active svg { stroke: var(--accent-2); }

.nav-badge {
  margin-inline-start: auto;
  font-size: 10.5px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-2);
  font-variant-numeric: tabular-nums;
}
.nav-badge.is-danger { background: var(--rose-soft); color: #fda4af; }
.nav-badge.is-ok { background: var(--emerald-soft); color: #6ee7b7; }

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

.ws-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-2);
  padding: 4px 10px;
  border-radius: 99px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
}

/* ── Main Column & Topbar ── */
.main-col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
}

.topbar {
  height: 58px;
  flex-shrink: 0;
  border-bottom: 1px solid var(--border);
  background: rgba(11, 12, 16, 0.88);
  padding: 0 26px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.topbar-left { display: flex; align-items: center; gap: 10px; }
.topbar-title { font-size: 16px; font-weight: 700; letter-spacing: -0.02em; margin: 0; }
.topbar-sub { font-size: 12px; color: var(--text-4); }
.topbar-actions { display: flex; align-items: center; gap: 8px; }

.lang-toggle {
  display: inline-flex;
  align-items: center;
  height: 32px;
  padding: 2px;
  border-radius: 8px;
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  gap: 2px;
}
.lang-btn {
  height: 26px;
  padding: 0 9px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: var(--text-3);
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.12s;
}
.lang-btn.is-active {
  background: var(--accent);
  color: #fff;
}

.page-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 24px 28px 48px;
}
.page-container {
  max-width: 1420px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* ── Hero Banner / Studio Header Strip ── */
.studio-banner {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.13) 0%, rgba(16, 18, 24, 0.95) 55%, rgba(16, 185, 129, 0.08) 100%);
  border: 1px solid var(--border-strong);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08);
  border-radius: var(--radius-lg);
  padding: 18px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.studio-banner-title { font-size: 15.5px; font-weight: 700; margin: 0 0 4px; color: var(--text-1); }
.studio-banner-desc { font-size: 12.5px; color: var(--text-3); margin: 0; max-width: 740px; }

/* ── Crafted Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 34px;
  padding: 0 13px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.14s ease;
}
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.btn-sm { height: 28px; padding: 0 10px; font-size: 11.6px; border-radius: 7px; }
.btn-xs { height: 24px; padding: 0 8px; font-size: 11px; border-radius: 6px; }

.btn-primary {
  background: linear-gradient(180deg, #6d70f7 0%, #5658e8 100%);
  color: #fff;
  border-color: rgba(165, 180, 252, 0.32);
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.28), inset 0 1px 0 rgba(255,255,255,0.22);
}
.btn-primary:hover:not(:disabled) { background: linear-gradient(180deg, #787bf9 0%, #4f46e5 100%); transform: translateY(-0.5px); }

.btn-secondary {
  background: var(--bg-surface-2);
  color: var(--text-1);
  border-color: var(--border-strong);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.05);
}
.btn-secondary:hover:not(:disabled) { background: var(--bg-elevated); border-color: var(--border-highlight); }

.btn-danger { background: var(--rose-soft); color: #fda4af; border-color: rgba(244, 63, 94, 0.35); }
.btn-danger:hover:not(:disabled) { background: rgba(244, 63, 94, 0.25); color: #fff; }

.btn-ok { background: var(--emerald-soft); color: #6ee7b7; border-color: rgba(16, 185, 129, 0.35); }
.btn-ok:hover:not(:disabled) { background: rgba(16, 185, 129, 0.25); color: #fff; }

.btn-ghost { background: transparent; color: var(--text-3); padding: 0 9px; }
.btn-ghost:hover:not(:disabled) { background: rgba(255, 255, 255, 0.06); color: var(--text-1); }

.icon-btn {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-3);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.12s;
}
.icon-btn svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn:hover { background: rgba(255, 255, 255, 0.07); color: var(--text-1); border-color: var(--border); }

/* ── Crafted KPI Stat Cards ── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px;
}

.kpi-card {
  background: linear-gradient(180deg, rgba(24, 28, 39, 0.9) 0%, rgba(16, 18, 24, 0.98) 100%);
  border: 1px solid var(--border);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
  border-radius: var(--radius);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
  overflow: hidden;
  transition: border-color 0.15s;
}
.kpi-card:hover { border-color: var(--border-strong); }

.kpi-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.kpi-label { font-size: 12px; color: var(--text-3); font-weight: 600; }
.kpi-icon {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-soft);
  color: var(--accent-2);
}
.kpi-icon svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 2; }
.kpi-icon.is-ok { background: var(--emerald-soft); color: #34d399; }
.kpi-icon.is-warn { background: var(--amber-soft); color: #fbbf24; }
.kpi-icon.is-danger { background: var(--rose-soft); color: #fb7185; }
.kpi-icon.is-sky { background: var(--sky-soft); color: #38bdf8; }

.kpi-value { font-size: 25px; font-weight: 800; letter-spacing: -0.03em; color: var(--text-1); font-variant-numeric: tabular-nums; line-height: 1.15; }
.kpi-meta { font-size: 11.5px; color: var(--text-4); display: flex; align-items: center; gap: 6px; }

/* ── Grids & Cards ── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.grid-12 { display: grid; grid-template-columns: 7fr 5fr; gap: 16px; }
@media (max-width: 1080px) { .grid-2, .grid-3, .grid-12 { grid-template-columns: 1fr; } }

.card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.card-head {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: rgba(255, 255, 255, 0.015);
  flex-wrap: wrap;
}
.card-title-wrap { display: flex; align-items: center; gap: 9px; }
.card-title-wrap svg { width: 16px; height: 16px; stroke: var(--accent-2); fill: none; stroke-width: 2; }
.card-title { margin: 0; font-size: 13.8px; font-weight: 700; color: var(--text-1); }
.card-sub { font-size: 11.5px; color: var(--text-3); margin-top: 2px; }
.card-body { padding: 18px; display: flex; flex-direction: column; gap: 14px; }

/* ── DNS Wizard Cards (Resend / Cloudflare Grade) ── */
.domain-card {
  background: var(--bg-surface-2);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: border-color 0.15s;
}
.domain-card:hover { border-color: rgba(99, 102, 241, 0.42); }
.domain-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.domain-name {
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  direction: ltr;
}
.dns-records-box {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}
.dns-row {
  display: grid;
  grid-template-columns: 62px 110px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
}
.dns-row:last-child { border-bottom: none; }
@media (max-width: 720px) { .dns-row { grid-template-columns: 1fr; } }

.copy-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  border-radius: 6px;
  background: rgba(255,255,255,0.035);
  border: 1px solid var(--border);
  color: var(--text-2);
  font-family: var(--font-mono);
  font-size: 11.5px;
  cursor: pointer;
  direction: ltr;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: all 0.12s;
}
.copy-chip:hover { border-color: var(--accent); color: #fff; background: var(--accent-soft); }

/* ── Privacy Architecture Cards (2-Channel Telegram Model) ── */
.privacy-channel-card {
  background: linear-gradient(180deg, rgba(22, 26, 37, 0.95), rgba(14, 16, 23, 0.98));
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 11px;
}
.privacy-channel-card.is-public { border-top: 2px solid var(--sky); }
.privacy-channel-card.is-private { border-top: 2px solid var(--emerald); }
.privacy-channel-card.is-vault { border-top: 2px solid var(--violet); }

/* ── Toolbar & Inputs ── */
.toolbar {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.012);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.toolbar-group { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.input, .select, .textarea {
  width: 100%;
  height: 36px;
  padding: 0 12px;
  border-radius: 8px;
  border: 1px solid var(--border-strong);
  background: var(--bg-input);
  color: var(--text-1);
  font-family: inherit;
  font-size: 12.8px;
  outline: none;
  transition: border-color 0.14s, box-shadow 0.14s;
}
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.16);
}
.textarea { height: auto; min-height: 92px; padding: 10px 12px; resize: vertical; }
.input-sm { height: 32px; font-size: 12.2px; width: auto; min-width: 220px; }

.field { display: flex; flex-direction: column; gap: 5px; }
.label { font-size: 11.8px; font-weight: 600; color: var(--text-2); display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.hint { font-size: 11.2px; color: var(--text-3); }

/* Quick Preset Chips (Days / Unlimited toggles) */
.chip-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.chip {
  height: 25px;
  padding: 0 9px;
  border-radius: 6px;
  border: 1px solid var(--border-strong);
  background: var(--bg-surface-2);
  color: var(--text-2);
  font-family: inherit;
  font-size: 11.2px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.12s;
}
.chip:hover { border-color: var(--accent); color: #fff; }
.chip.is-active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-2); }

.segmented {
  display: inline-flex;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 2px;
  gap: 2px;
  flex-wrap: wrap;
}
.seg-btn {
  height: 28px;
  padding: 0 11px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: var(--text-3);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.12s;
}
.seg-btn:hover { color: var(--text-1); }
.seg-btn.is-active { background: var(--bg-elevated); color: #fff; box-shadow: 0 1px 3px rgba(0,0,0,0.35); }

/* ── Tables (LTR + RTL Aware) ── */
.table-wrap { width: 100%; overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; text-align: start; }
.table thead th {
  padding: 10px 16px;
  font-size: 10.8px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.055em;
  color: var(--text-4);
  background: rgba(255, 255, 255, 0.015);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  text-align: start;
}
.table tbody tr {
  border-bottom: 1px solid rgba(255, 255, 255, 0.045);
  transition: background 0.12s;
}
.table tbody tr:last-child { border-bottom: none; }
.table tbody tr:hover { background: rgba(255, 255, 255, 0.025); }
.table tbody td { padding: 11px 16px; vertical-align: middle; font-size: 12.8px; color: var(--text-2); }

.end-cell { text-align: end !important; white-space: nowrap; }

/* ── Dots & Pills ── */
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.dot.is-ok { background: var(--emerald); box-shadow: 0 0 8px rgba(16, 185, 129, 0.6); }
.dot.is-warn { background: var(--amber); }
.dot.is-danger { background: var(--rose); box-shadow: 0 0 8px rgba(244, 63, 94, 0.6); }
.dot.is-info { background: var(--sky); }
.dot.is-muted { background: var(--text-4); }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 23px;
  padding: 0 8.5px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-strong);
  color: var(--text-2);
  white-space: nowrap;
}
.pill.is-ok { background: var(--emerald-soft); border-color: rgba(16, 185, 129, 0.35); color: #6ee7b7; }
.pill.is-warn { background: var(--amber-soft); border-color: rgba(245, 158, 11, 0.35); color: #fcd34d; }
.pill.is-danger { background: var(--rose-soft); border-color: rgba(244, 63, 94, 0.35); color: #fda4af; }
.pill.is-info { background: var(--sky-soft); border-color: rgba(56, 189, 248, 0.35); color: #7dd3fc; }
.pill.is-primary { background: var(--accent-soft); border-color: rgba(99, 102, 241, 0.42); color: var(--accent-2); }

/* ── Progress Bars ── */
.bar-track { height: 6px; border-radius: 999px; background: rgba(255,255,255,0.07); overflow: hidden; width: 100%; }
.bar-fill { height: 100%; background: var(--accent); transition: width 0.25s; border-radius: 999px; }
.bar-fill.is-ok { background: var(--emerald); }
.bar-fill.is-warn { background: var(--amber); }
.bar-fill.is-danger { background: var(--rose); }

/* ── Switches ── */
.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 14px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: border-color 0.12s;
}
.switch-row:hover { border-color: var(--border-strong); }
.switch { position: relative; width: 38px; height: 21px; flex-shrink: 0; direction: ltr; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch-slider { position: absolute; inset: 0; border-radius: 999px; background: #293042; transition: background 0.16s; }
.switch-slider::after { content: ""; position: absolute; top: 2.5px; left: 2.5px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform 0.16s; }
.switch input:checked + .switch-slider { background: var(--accent); }
.switch input:checked + .switch-slider::after { transform: translateX(17px); }

/* ── Slide-Over 360° Drawer (LTR & RTL Adaptive) ── */
.drawer-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 8000;
  background: rgba(3, 5, 10, 0.72);
}
.drawer-backdrop.is-open { display: block; }

.drawer {
  position: fixed;
  top: 0;
  bottom: 0;
  inset-inline-end: 0;
  width: 720px;
  max-width: 96vw;
  z-index: 8001;
  background: #0d1017;
  border-inline-start: 1px solid var(--border-strong);
  box-shadow: -24px 0 70px rgba(0, 0, 0, 0.7);
  display: flex;
  flex-direction: column;
  transform: translateX(102%);
  transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}
html[dir="rtl"] .drawer {
  transform: translateX(-102%);
  box-shadow: 24px 0 70px rgba(0, 0, 0, 0.7);
}
.drawer.is-open, html[dir="rtl"] .drawer.is-open { transform: translateX(0); }

.drawer-head {
  padding: 16px 22px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  background: rgba(255,255,255,0.015);
}
.drawer-tabs {
  display: flex;
  gap: 5px;
  padding: 9px 22px;
  border-bottom: 1px solid var(--border);
  background: #090b10;
  overflow-x: auto;
}
.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px 22px 28px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.drawer-body > * {
  flex-shrink: 0;
}
.drawer-action-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding: 10px 12px;
  background: var(--bg-surface-2);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
}

/* ── Modals & Command Palette ── */
.modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 8500;
  background: rgba(3, 5, 10, 0.76);
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-backdrop.is-open { display: flex; }
.modal {
  width: 100%;
  max-width: 600px;
  max-height: 92vh;
  background: #10131c;
  border: 1px solid var(--border-strong);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08), 0 28px 80px rgba(0, 0, 0, 0.75);
  border-radius: 15px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.modal-head { padding: 15px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.modal-body { padding: 18px 20px; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; }
.modal-foot { padding: 13px 20px; border-top: 1px solid var(--border); background: #0b0d13; display: flex; justify-content: flex-end; gap: 8px; }

.cmd-modal { max-width: 560px; }
.cmd-input { width: 100%; height: 48px; padding: 0 18px; border: none; border-bottom: 1px solid var(--border); background: transparent; color: var(--text-1); font-family: inherit; font-size: 14px; outline: none; }
.cmd-results { max-height: 360px; overflow-y: auto; padding: 7px; }
.cmd-row {
  padding: 10px 13px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  color: var(--text-2);
  font-size: 13px;
}
.cmd-row:hover { background: var(--bg-elevated); color: #fff; }

/* ── Empty State ── */
.empty-box {
  padding: 34px 20px;
  text-align: center;
  color: var(--text-3);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.empty-box svg { width: 28px; height: 28px; stroke: var(--text-4); fill: none; stroke-width: 1.6; }

/* ── Toast ── */
.toast {
  position: fixed;
  bottom: 22px;
  inset-inline-end: 22px;
  z-index: 9999;
  padding: 11px 16px;
  border-radius: 10px;
  background: #171b26;
  border: 1px solid var(--border-strong);
  color: var(--text-1);
  font-size: 12.8px;
  font-weight: 600;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.55);
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 0.16s, transform 0.16s;
}
.toast.is-show { opacity: 1; transform: translateY(0); }
.toast.is-ok { border-color: rgba(16, 185, 129, 0.55); color: #6ee7b7; }
.toast.is-danger { border-color: rgba(244, 63, 94, 0.55); color: #fda4af; }
