/* ========================================
   ClyHub — القالب البصري الرئيسي
   نمط: صناعي راقٍ / Industrial Refined
   ======================================== */

@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500&family=Tajawal:wght@300;400;500;700;900&family=DM+Serif+Display&display=swap');

:root {
  /* الألوان الرئيسية */
  --ink:         #0F0F0F;
  --ink-soft:    #1C1C1E;
  --ink-mute:    #3A3A3C;
  --surface:     #F7F6F3;
  --surface-2:   #EDECEA;
  --surface-3:   #E3E1DC;
  --border:      #D8D5CF;
  --border-soft: #EBEBEB;

  /* اللون المميز */
  --accent:      #1B4FFF;
  --accent-dark: #1240D6;
  --accent-glow: rgba(27, 79, 255, 0.12);
  --accent-soft: rgba(27, 79, 255, 0.08);

  /* الخطر والنجاح والتحذير */
  --red:         #E8271E;
  --red-soft:    rgba(232, 39, 30, 0.1);
  --green:       #1A7A4A;
  --green-soft:  rgba(26, 122, 74, 0.1);
  --amber:       #C47C0A;
  --amber-soft:  rgba(196, 124, 10, 0.1);

  /* الطباعة */
  --font-ar:     'Tajawal', sans-serif;
  --font-mono:   'IBM Plex Mono', monospace;
  --font-serif:  'DM Serif Display', serif;

  /* الأحجام */
  --radius:      8px;
  --radius-lg:   14px;
  --radius-xl:   20px;
  --sidebar-w:   260px;
  --topbar-h:    64px;

  /* الظلال */
  --shadow-sm:   0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md:   0 4px 16px rgba(0,0,0,0.08), 0 2px 6px rgba(0,0,0,0.04);
  --shadow-lg:   0 12px 40px rgba(0,0,0,0.1), 0 4px 12px rgba(0,0,0,0.06);

  /* الحركة */
  --transition:  200ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ----------------------------------------
   إعادة ضبط ورثيات
   ---------------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

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

body {
  font-family: var(--font-ar);
  background-color: var(--surface);
  color: var(--ink);
  direction: rtl;
  line-height: 1.7;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

body[dir="ltr"] {
  direction: ltr;
  font-family: var(--font-mono), sans-serif;
  font-size: 14px;
}

a { color: var(--accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent-dark); }

img { max-width: 100%; display: block; }

/* ----------------------------------------
   التخطيط الرئيسي
   ---------------------------------------- */
.ch-layout {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  grid-template-rows: var(--topbar-h) 1fr;
  min-height: 100vh;
}

/* ----------------------------------------
   الشريط الجانبي
   ---------------------------------------- */
.ch-sidebar {
  grid-row: 1 / -1;
  grid-column: 1;
  background: var(--ink);
  color: var(--surface);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  transition: transform var(--transition);
}

body[dir="ltr"] .ch-sidebar { grid-column: 1; }

.ch-sidebar__logo {
  padding: 24px 20px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.ch-sidebar__logo-mark {
  width: 36px;
  height: 36px;
  background: var(--accent);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 14px;
  color: white;
  letter-spacing: -0.5px;
  flex-shrink: 0;
}

.ch-sidebar__logo-text {
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 500;
  color: white;
  letter-spacing: -0.3px;
}

.ch-sidebar__logo-sub {
  font-size: 10px;
  color: rgba(255,255,255,0.35);
  font-weight: 300;
  margin-top: 1px;
}

.ch-nav {
  flex: 1;
  padding: 12px 10px;
  overflow-y: auto;
}

.ch-nav__section {
  margin-bottom: 4px;
}

.ch-nav__label {
  font-size: 10px;
  font-weight: 700;
  color: rgba(255,255,255,0.25);
  letter-spacing: 1.2px;
  text-transform: uppercase;
  padding: 12px 10px 4px;
}

.ch-nav__item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius);
  color: rgba(255,255,255,0.6);
  font-size: 14px;
  font-weight: 400;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  margin-bottom: 2px;
}

.ch-nav__item svg { width: 17px; height: 17px; flex-shrink: 0; opacity: 0.7; }

.ch-nav__item:hover {
  background: rgba(255,255,255,0.07);
  color: white;
}

.ch-nav__item.active {
  background: var(--accent);
  color: white;
}

.ch-nav__item.active svg { opacity: 1; }

.ch-nav__badge {
  margin-right: auto; /* rtl */
  background: var(--red);
  color: white;
  font-size: 10px;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
}

body[dir="ltr"] .ch-nav__badge { margin-right: unset; margin-left: auto; }

.ch-sidebar__footer {
  padding: 16px 10px;
  border-top: 1px solid rgba(255,255,255,0.07);
  flex-shrink: 0;
}

.ch-sidebar__user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background var(--transition);
  text-decoration: none;
}

.ch-sidebar__user:hover { background: rgba(255,255,255,0.07); }

.ch-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
  overflow: hidden;
}

.ch-avatar img { width: 100%; height: 100%; object-fit: cover; }

.ch-sidebar__user-info { flex: 1; min-width: 0; }
.ch-sidebar__user-name { font-size: 13px; color: white; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ch-sidebar__user-role { font-size: 11px; color: rgba(255,255,255,0.35); }

/* ----------------------------------------
   الشريط العلوي
   ---------------------------------------- */
.ch-topbar {
  grid-column: 2;
  grid-row: 1;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 28px;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.ch-topbar__title {
  font-size: 17px;
  font-weight: 700;
  color: var(--ink);
  flex: 1;
}

.ch-topbar__search {
  display: flex;
  align-items: center;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 7px 14px;
  gap: 8px;
  width: 240px;
  transition: all var(--transition);
}

.ch-topbar__search:focus-within {
  border-color: var(--accent);
  background: white;
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.ch-topbar__search input {
  border: none;
  background: transparent;
  outline: none;
  font-family: var(--font-ar);
  font-size: 13px;
  color: var(--ink);
  width: 100%;
  direction: inherit;
}

.ch-topbar__search input::placeholder { color: var(--ink-mute); opacity: 0.6; }

.ch-topbar__search svg { width: 15px; height: 15px; color: var(--ink-mute); flex-shrink: 0; }

.ch-topbar__actions { display: flex; align-items: center; gap: 8px; }

.ch-icon-btn {
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--ink-mute);
  transition: all var(--transition);
  position: relative;
}

.ch-icon-btn:hover { background: var(--surface-2); color: var(--ink); }

.ch-icon-btn svg { width: 18px; height: 18px; }

.ch-icon-btn__dot {
  position: absolute;
  top: 6px;
  left: 6px;
  width: 7px;
  height: 7px;
  background: var(--red);
  border-radius: 50%;
  border: 1.5px solid var(--surface);
}

/* ----------------------------------------
   منطقة المحتوى
   ---------------------------------------- */
.ch-main {
  grid-column: 2;
  grid-row: 2;
  padding: 28px;
  overflow-y: auto;
}

.ch-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 16px;
}

.ch-page-header h1 {
  font-size: 24px;
  font-weight: 900;
  color: var(--ink);
  line-height: 1.2;
}

.ch-page-header p {
  font-size: 14px;
  color: var(--ink-mute);
  margin-top: 4px;
}

/* ----------------------------------------
   البطاقات
   ---------------------------------------- */
.ch-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.ch-card__header {
  padding: 18px 22px 14px;
  border-bottom: 1px solid var(--border-soft);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.ch-card__title {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
}

.ch-card__body { padding: 20px 22px; }

/* بطاقات الإحصاء */
.ch-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.ch-stat {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  position: relative;
  overflow: hidden;
}

.ch-stat::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 3px;
  background: var(--accent);
}

.ch-stat__label { font-size: 12px; color: var(--ink-mute); font-weight: 500; margin-bottom: 8px; }
.ch-stat__value { font-size: 32px; font-weight: 900; color: var(--ink); font-family: var(--font-mono); letter-spacing: -1px; line-height: 1; }
.ch-stat__sub { font-size: 11px; color: var(--ink-mute); margin-top: 6px; }

/* ----------------------------------------
   الأزرار
   ---------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: var(--radius);
  font-family: var(--font-ar);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all var(--transition);
  text-decoration: none;
  white-space: nowrap;
}
a.btn:hover { text-decoration: none; }
a.btn-primary, a.btn-primary:hover { color: white; }
a.btn-secondary, a.btn-secondary:hover { color: var(--ink); }
a.btn-danger, a.btn-danger:hover { color: white; }
a.btn-ghost, a.btn-ghost:hover { color: var(--ink); }

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

.btn-primary {
  background: var(--accent);
  color: white;
}
.btn-primary:hover {
  background: var(--accent-dark);
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px var(--accent-glow);
}

.btn-secondary {
  background: var(--surface-2);
  color: var(--ink);
  border: 1px solid var(--border);
}
.btn-secondary:hover { background: var(--surface-3); color: var(--ink); }

.btn-danger {
  background: var(--red);
  color: white;
}
.btn-danger:hover { background: #cc1e16; color: white; }

.btn-ghost {
  background: transparent;
  color: var(--ink-mute);
}
.btn-ghost:hover { background: var(--surface-2); color: var(--ink); }

.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-lg { padding: 12px 24px; font-size: 16px; }

.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; }

/* ----------------------------------------
   النماذج
   ---------------------------------------- */
.form-group { margin-bottom: 18px; }

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
  margin-bottom: 7px;
}

.form-label .required { color: var(--red); margin-right: 3px; }

.form-control {
  width: 100%;
  padding: 9px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--font-ar);
  font-size: 14px;
  color: var(--ink);
  background: white;
  outline: none;
  transition: all var(--transition);
  direction: inherit;
}

.form-control:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.form-control.error { border-color: var(--red); }
.form-control.error:focus { box-shadow: 0 0 0 3px var(--red-soft); }

.form-control::placeholder { color: var(--ink-mute); opacity: 0.5; }

textarea.form-control { resize: vertical; min-height: 100px; }

select.form-control { cursor: pointer; appearance: none; }

.form-hint {
  font-size: 12px;
  color: var(--ink-mute);
  margin-top: 5px;
}

.form-error {
  font-size: 12px;
  color: var(--red);
  margin-top: 5px;
  display: none;
}

.form-error.show { display: block; }

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

/* ----------------------------------------
   الجداول
   ---------------------------------------- */
.ch-table-wrap { overflow-x: auto; }

.ch-table {
  width: 100%;
  border-collapse: collapse;
}

.ch-table th {
  background: var(--surface-2);
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-mute);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding: 10px 16px;
  text-align: right;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

body[dir="ltr"] .ch-table th { text-align: left; }

.ch-table td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--border-soft);
  font-size: 14px;
  color: var(--ink-soft);
}

.ch-table tr:hover td { background: var(--surface); }
.ch-table tr:last-child td { border-bottom: none; }

.ch-table .actions { display: flex; gap: 6px; justify-content: flex-end; }

/* ----------------------------------------
   الشارات
   ---------------------------------------- */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
}

.badge-blue   { background: var(--accent-soft); color: var(--accent); }
.badge-green  { background: var(--green-soft);  color: var(--green); }
.badge-red    { background: var(--red-soft);    color: var(--red); }
.badge-amber  { background: var(--amber-soft);  color: var(--amber); }
.badge-muted  { background: var(--surface-3);   color: var(--ink-mute); }

/* ----------------------------------------
   التنبيهات
   ---------------------------------------- */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 13px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 16px;
}

.alert svg { width: 16px; height: 16px; flex-shrink: 0; margin-top: 1px; }

.alert-success { background: var(--green-soft); color: var(--green); border: 1px solid rgba(26,122,74,0.2); }
.alert-error   { background: var(--red-soft);   color: var(--red);   border: 1px solid rgba(232,39,30,0.2); }
.alert-info    { background: var(--accent-soft); color: var(--accent); border: 1px solid rgba(27,79,255,0.15); }
.alert-amber   { background: var(--amber-soft); color: var(--amber); border: 1px solid rgba(196,124,10,0.2); }

/* ----------------------------------------
   النوافذ المنبثقة (Modal)
   ---------------------------------------- */
.ch-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  backdrop-filter: blur(2px);
  z-index: 900;
  display: none;
  align-items: center;
  justify-content: center;
}

.ch-overlay.open { display: flex; animation: overlayIn 150ms ease; }

@keyframes overlayIn { from { opacity: 0; } to { opacity: 1; } }

.ch-modal {
  background: white;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 520px;
  margin: 20px;
  animation: modalIn 200ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95) translateY(8px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.ch-modal__header {
  padding: 22px 24px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-soft);
}

.ch-modal__title { font-size: 17px; font-weight: 800; color: var(--ink); }

.ch-modal__close {
  width: 32px; height: 32px;
  border: none; background: var(--surface-2);
  border-radius: 50%;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--ink-mute);
  transition: all var(--transition);
}

.ch-modal__close:hover { background: var(--surface-3); color: var(--ink); }
.ch-modal__close svg { width: 14px; height: 14px; }

.ch-modal__body { padding: 22px 24px; }
.ch-modal__footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-soft);
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

/* ----------------------------------------
   صفحات: تسجيل الدخول والتنصيب
   ---------------------------------------- */
.ch-auth {
  min-height: 100vh;
  display: flex;
  background: var(--surface);
}

.ch-auth__panel {
  width: 480px;
  flex-shrink: 0;
  padding: 48px 52px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: white;
  border-left: 1px solid var(--border); /* rtl */
  position: relative;
  z-index: 2;
}

body[dir="ltr"] .ch-auth__panel { border-left: none; border-right: 1px solid var(--border); }

.ch-auth__bg {
  flex: 1;
  background: var(--ink);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* نقوش خلفية التسجيل */
.ch-auth__bg::before {
  content: '';
  position: absolute;
  width: 600px; height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(27,79,255,0.25) 0%, transparent 70%);
  top: -100px; left: -100px;
}

.ch-auth__bg::after {
  content: '';
  position: absolute;
  width: 400px; height: 400px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(27,79,255,0.15) 0%, transparent 70%);
  bottom: -50px; right: 50px;
}

.ch-auth__bg-text {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 40px;
}

.ch-auth__bg-logo {
  font-family: var(--font-mono);
  font-size: 52px;
  font-weight: 500;
  color: white;
  letter-spacing: -2px;
  line-height: 1;
  margin-bottom: 12px;
}

.ch-auth__bg-logo span { color: var(--accent); }

.ch-auth__bg-tagline {
  font-size: 15px;
  color: rgba(255,255,255,0.45);
  font-weight: 300;
  max-width: 260px;
  margin: 0 auto;
  line-height: 1.6;
}

.ch-auth__logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 40px;
}

.ch-auth__logo-mark {
  width: 40px; height: 40px;
  background: var(--ink);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 500;
  color: white;
}

.ch-auth__logo-text {
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 500;
  color: var(--ink);
  letter-spacing: -0.5px;
}

.ch-auth h1 {
  font-size: 26px;
  font-weight: 900;
  color: var(--ink);
  margin-bottom: 6px;
}

.ch-auth__subtitle {
  font-size: 14px;
  color: var(--ink-mute);
  margin-bottom: 32px;
}

.ch-auth__footer {
  margin-top: auto;
  padding-top: 32px;
  font-size: 12px;
  color: var(--ink-mute);
  opacity: 0.5;
}

/* ----------------------------------------
   خطوات التنصيب
   ---------------------------------------- */
.ch-steps {
  display: flex;
  gap: 0;
  margin-bottom: 36px;
}

.ch-step {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}

.ch-step:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 14px;
  right: calc(-50% + 14px);
  left: calc(50% + 14px);
  height: 1.5px;
  background: var(--border);
  transition: background var(--transition);
}

body[dir="ltr"] .ch-step:not(:last-child)::after {
  right: calc(50% + 14px);
  left: calc(-50% + 14px);
}

.ch-step.done:not(:last-child)::after { background: var(--accent); }

.ch-step__dot {
  width: 28px; height: 28px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  color: var(--ink-mute);
  transition: all var(--transition);
  position: relative;
  z-index: 1;
}

.ch-step.active .ch-step__dot {
  border-color: var(--accent);
  background: var(--accent);
  color: white;
}

.ch-step.done .ch-step__dot {
  border-color: var(--accent);
  background: var(--accent);
  color: white;
}

.ch-step__label {
  font-size: 11px;
  color: var(--ink-mute);
  margin-top: 6px;
  text-align: center;
}

.ch-step.active .ch-step__label { color: var(--accent); font-weight: 600; }

/* ----------------------------------------
   البحث والفلترة
   ---------------------------------------- */
.ch-filters {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.ch-search-box {
  display: flex;
  align-items: center;
  background: white;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 14px;
  gap: 8px;
  flex: 1;
  max-width: 340px;
  transition: all var(--transition);
}

.ch-search-box:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.ch-search-box input { border: none; background: transparent; outline: none; font-family: var(--font-ar); font-size: 14px; color: var(--ink); width: 100%; direction: inherit; }
.ch-search-box svg { width: 15px; height: 15px; color: var(--ink-mute); flex-shrink: 0; }

/* ----------------------------------------
   شريط التحميل (نشاط)
   ---------------------------------------- */
.ch-spinner {
  width: 20px; height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  display: inline-block;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ----------------------------------------
   الصفحة الفارغة
   ---------------------------------------- */
.ch-empty {
  text-align: center;
  padding: 60px 20px;
}

.ch-empty__icon {
  width: 64px; height: 64px;
  background: var(--surface-2);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 16px;
  color: var(--ink-mute);
}

.ch-empty__icon svg { width: 28px; height: 28px; }
.ch-empty h3 { font-size: 16px; font-weight: 700; color: var(--ink); margin-bottom: 6px; }
.ch-empty p { font-size: 13px; color: var(--ink-mute); margin-bottom: 20px; }

/* ----------------------------------------
   الجوال
   ---------------------------------------- */
.ch-mobile-toggle {
  display: none;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 8px;
  color: var(--ink);
}

@media (max-width: 768px) {
  .ch-layout {
    grid-template-columns: 1fr;
    grid-template-rows: var(--topbar-h) 1fr;
  }

  .ch-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 800;
    transform: translateX(100%); /* rtl */
    width: var(--sidebar-w);
  }

  body[dir="ltr"] .ch-sidebar { transform: translateX(-100%); }

  .ch-sidebar.open { transform: translateX(0); }

  .ch-topbar { grid-column: 1; padding: 0 16px; }
  .ch-main { grid-column: 1; padding: 16px; }
  .ch-mobile-toggle { display: flex; }
  .ch-topbar__search { display: none; }
  .form-row { grid-template-columns: 1fr; }
  .ch-auth { flex-direction: column; }
  .ch-auth__bg { display: none; }
  .ch-auth__panel { width: 100%; padding: 32px 24px; border: none; }
}

/* ----------------------------------------
   أنيميشن عام
   ---------------------------------------- */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.fade-in { animation: fadeIn 300ms ease forwards; }

.page-enter { animation: fadeIn 250ms cubic-bezier(0.4, 0, 0.2, 1); }

/* ----------------------------------------
   مساعدات
   ---------------------------------------- */
.text-muted  { color: var(--ink-mute) !important; }
.text-accent { color: var(--accent) !important; }
.text-red    { color: var(--red) !important; }
.text-green  { color: var(--green) !important; }
.text-sm     { font-size: 12px !important; }
.text-mono   { font-family: var(--font-mono) !important; }
.font-bold   { font-weight: 700 !important; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 16px; }
.mt-4 { margin-top: 24px; }
.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 16px; }
.mb-4 { margin-bottom: 24px; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 16px; }
.w-full { width: 100%; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
