/* ═══════════════════════════════════════════════════════════════════
   TaskFlow — نظام إدارة المهام (Arabic RTL Edition)
   خط: Tajawal (body) + Cairo (headings)
═══════════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@300;400;500;700;800&family=Cairo:wght@600;700;800;900&display=swap');

/* ─── متغيرات CSS ──────────────────────────────────────────────── */
:root {
  --bg-base:       #0d1117;
  --bg-surface:    #161b22;
  --bg-elevated:   #1c2333;
  --bg-card:       #1e2535;
  --bg-hover:      #252d3d;
  --border:        rgba(99,120,160,0.18);
  --border-light:  rgba(99,120,160,0.10);

  --indigo:        #6366f1;
  --indigo-light:  #818cf8;
  --indigo-dim:    rgba(99,102,241,0.12);
  --indigo-glow:   rgba(99,102,241,0.25);

  --text-primary:  #e6edf3;
  --text-secondary:#8b9ab1;
  --text-muted:    #586279;
  --text-inverse:  #0d1117;

  --blue:    #3b82f6; --blue-dim:    rgba(59,130,246,0.15);
  --amber:   #f59e0b; --amber-dim:   rgba(245,158,11,0.15);
  --green:   #10b981; --green-dim:   rgba(16,185,129,0.15);
  --red:     #ef4444; --red-dim:     rgba(239,68,68,0.15);
  --purple:  #a855f7; --purple-dim:  rgba(168,85,247,0.15);
  --gray:    #6b7280; --gray-dim:    rgba(107,114,128,0.15);
  --orange:  #f97316; --orange-dim:  rgba(249,115,22,0.15);
  --cyan:    #06b6d4; --cyan-dim:    rgba(6,182,212,0.15);

  --sidebar-w:        256px;
  --font-body:     'Tajawal', system-ui, sans-serif;
  --font-heading:  'Cairo', system-ui, sans-serif;
  --radius-sm:  6px; --radius-md: 10px; --radius-lg: 14px;
  --radius-xl:  20px; --radius-full: 9999px;
  --shadow-sm:  0 1px 3px rgba(0,0,0,.4),0 1px 2px rgba(0,0,0,.3);
  --shadow-md:  0 4px 12px rgba(0,0,0,.5),0 2px 4px rgba(0,0,0,.3);
  --shadow-lg:  0 12px 32px rgba(0,0,0,.6),0 4px 8px rgba(0,0,0,.4);
  --shadow-glow:0 0 24px rgba(99,102,241,0.2);
  --ease: cubic-bezier(.4,0,.2,1);
  --duration-fast: 150ms; --duration: 250ms;
}

/* ─── إعادة ضبط RTL ──────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; scroll-behavior: smooth; direction: rtl; }
body {
  font-family: var(--font-body);
  background: var(--bg-base);
  color: var(--text-primary);
  line-height: 1.7;
  direction: rtl;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: inherit; }
input, textarea, select { font-family: inherit; direction: rtl; }

/* ─── الهيكل الأساسي ─────────────────────────────────────────── */
.app-shell { display: flex; min-height: 100vh; flex-direction: row-reverse; }

.sidebar {
  width: var(--sidebar-w);
  background: var(--bg-surface);
  border-left: 1px solid var(--border);
  display: flex; flex-direction: column;
  position: fixed;
  top: 0; right: 0; bottom: 0;
  z-index: 100;
  transition: width var(--duration) var(--ease);
  overflow: hidden;
}

.main-area {
  margin-right: var(--sidebar-w);
  flex: 1; display: flex; flex-direction: column;
  min-height: 100vh;
  transition: margin-right var(--duration) var(--ease);
}

.topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(13,17,23,0.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  height: 60px; display: flex; align-items: center;
  padding: 0 24px; gap: 16px;
}
.page-content { flex: 1; padding: 28px 28px 48px; }

/* ─── الشريط الجانبي ─────────────────────────────────────────── */
.sidebar-brand {
  height: 60px; display: flex; align-items: center;
  padding: 0 20px; border-bottom: 1px solid var(--border);
  gap: 10px; flex-shrink: 0;
}
.brand-icon {
  width: 32px; height: 32px;
  background: linear-gradient(135deg, var(--indigo), #8b5cf6);
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; flex-shrink: 0;
  box-shadow: var(--shadow-glow);
}
.brand-name {
  font-family: var(--font-heading); font-size: 18px; font-weight: 800;
  background: linear-gradient(135deg, #e6edf3, #818cf8);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  white-space: nowrap;
}
.sidebar-nav { flex: 1; padding: 12px 10px; overflow-y: auto; }
.nav-section-label {
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--text-muted); padding: 12px 10px 6px; white-space: nowrap;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: var(--radius-md);
  color: var(--text-secondary); font-size: 14px; font-weight: 500;
  transition: all var(--duration-fast) var(--ease);
  white-space: nowrap; position: relative; margin-bottom: 1px;
  flex-direction: row-reverse; justify-content: flex-end;
}
.nav-item:hover { background: var(--bg-hover); color: var(--text-primary); }
.nav-item.active { background: var(--indigo-dim); color: var(--indigo-light); font-weight: 700; }
.nav-item.active::before {
  content: ''; position: absolute;
  right: 0; top: 20%; bottom: 20%;
  width: 3px; background: var(--indigo);
  border-radius: var(--radius-full) 0 0 var(--radius-full);
}
.nav-item svg { width: 17px; height: 17px; flex-shrink: 0; }
.nav-badge {
  margin-right: auto;
  background: var(--red); color: white;
  font-size: 10px; font-weight: 700;
  min-width: 18px; height: 18px;
  border-radius: var(--radius-full);
  display: flex; align-items: center; justify-content: center; padding: 0 5px;
}
.sidebar-footer { padding: 12px 10px; border-top: 1px solid var(--border); }
.user-card {
  display: flex; align-items: center; gap: 10px; flex-direction: row-reverse;
  padding: 10px 12px; border-radius: var(--radius-md);
  cursor: pointer; transition: background var(--duration-fast);
}
.user-card:hover { background: var(--bg-hover); }
.user-avatar { width: 34px; height: 34px; border-radius: var(--radius-full); flex-shrink: 0; object-fit: cover; border: 2px solid var(--border); }
.user-info { flex: 1; min-width: 0; text-align: right; }
.user-name { font-size: 13px; font-weight: 700; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: 11px; color: var(--text-muted); }

/* ─── الشريط العلوي ──────────────────────────────────────────── */
.topbar-left { display: flex; align-items: center; gap: 12px; flex: 1; flex-direction: row-reverse; }
.topbar-right { display: flex; align-items: center; gap: 8px; }
.page-title { font-family: var(--font-heading); font-size: 17px; font-weight: 800; }
.icon-btn {
  width: 36px; height: 36px; border-radius: var(--radius-md);
  background: var(--bg-elevated); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-secondary); transition: all var(--duration-fast); position: relative;
}
.icon-btn:hover { background: var(--bg-hover); color: var(--text-primary); }
.icon-btn svg { width: 17px; height: 17px; }
.notif-dot {
  position: absolute; top: 5px; left: 5px;
  width: 7px; height: 7px;
  background: var(--red); border-radius: var(--radius-full);
  border: 1.5px solid var(--bg-base);
}
.menu-toggle { display: none; }

/* ─── البطاقات ───────────────────────────────────────────────── */
.card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.card-header {
  padding: 18px 22px 14px; border-bottom: 1px solid var(--border-light);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.card-title { font-family: var(--font-heading); font-size: 15px; font-weight: 800; }
.card-body { padding: 20px 22px; }

/* ─── بطاقات الإحصاء ─────────────────────────────────────────── */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(200px,1fr)); gap: 16px; margin-bottom: 28px; }
.stat-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 20px 22px;
  display: flex; flex-direction: column; gap: 10px;
  position: relative; overflow: hidden;
  transition: transform var(--duration-fast), box-shadow var(--duration-fast);
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.stat-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px; }
.stat-card.indigo::before { background: var(--indigo); }
.stat-card.blue::before   { background: var(--blue); }
.stat-card.green::before  { background: var(--green); }
.stat-card.amber::before  { background: var(--amber); }
.stat-card.red::before    { background: var(--red); }
.stat-card.purple::before { background: var(--purple); }
.stat-icon { width: 40px; height: 40px; border-radius: var(--radius-md); display: flex; align-items: center; justify-content: center; font-size: 18px; }
.stat-icon.indigo { background: var(--indigo-dim); color: var(--indigo-light); }
.stat-icon.blue   { background: var(--blue-dim);   color: var(--blue); }
.stat-icon.green  { background: var(--green-dim);  color: var(--green); }
.stat-icon.amber  { background: var(--amber-dim);  color: var(--amber); }
.stat-icon.red    { background: var(--red-dim);    color: var(--red); }
.stat-icon.purple { background: var(--purple-dim); color: var(--purple); }
.stat-value { font-family: var(--font-heading); font-size: 28px; font-weight: 900; line-height: 1; }
.stat-label { font-size: 13px; color: var(--text-muted); font-weight: 500; }

/* ─── الشارات ────────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px; border-radius: var(--radius-full);
  font-size: 11px; font-weight: 700;
}
.badge.blue   { background: var(--blue-dim);   color: var(--blue); }
.badge.amber  { background: var(--amber-dim);  color: var(--amber); }
.badge.green  { background: var(--green-dim);  color: var(--green); }
.badge.red    { background: var(--red-dim);    color: var(--red); }
.badge.purple { background: var(--purple-dim); color: var(--purple); }
.badge.gray   { background: var(--gray-dim);   color: var(--gray); }
.badge.orange { background: var(--orange-dim); color: var(--orange); }
.badge.indigo { background: var(--indigo-dim); color: var(--indigo-light); }
.priority-dot { width: 7px; height: 7px; border-radius: var(--radius-full); flex-shrink: 0; }
.priority-dot.low    { background: var(--gray); }
.priority-dot.medium { background: var(--blue); }
.priority-dot.high   { background: var(--orange); }
.priority-dot.urgent { background: var(--red); box-shadow: 0 0 6px var(--red); }

/* ─── الجداول ────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
  font-size: 11px; font-weight: 700; letter-spacing: 0.04em;
  color: var(--text-muted); padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap; text-align: right;
}
.data-table td { padding: 13px 16px; border-bottom: 1px solid var(--border-light); font-size: 13.5px; color: var(--text-secondary); vertical-align: middle; text-align: right; }
.data-table tbody tr { transition: background var(--duration-fast); }
.data-table tbody tr:hover { background: var(--bg-hover); }
.data-table tbody tr:last-child td { border-bottom: none; }
.td-primary { color: var(--text-primary); font-weight: 600; }

/* ─── الأزرار ────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 16px; border-radius: var(--radius-md);
  font-size: 13.5px; font-weight: 700;
  border: 1px solid transparent;
  transition: all var(--duration-fast) var(--ease);
  cursor: pointer; white-space: nowrap; font-family: var(--font-body);
}
.btn svg { width: 15px; height: 15px; }
.btn-primary  { background: var(--indigo);       color: white;               border-color: var(--indigo); }
.btn-primary:hover  { background: var(--indigo-light); box-shadow: var(--shadow-glow); }
.btn-secondary{ background: var(--bg-elevated);  color: var(--text-primary); border-color: var(--border); }
.btn-secondary:hover{ background: var(--bg-hover); }
.btn-danger   { background: var(--red-dim);      color: var(--red);          border-color: rgba(239,68,68,.2); }
.btn-danger:hover   { background: var(--red); color: white; }
.btn-success  { background: var(--green-dim);    color: var(--green);        border-color: rgba(16,185,129,.2); }
.btn-success:hover  { background: var(--green); color: white; }
.btn-ghost    { background: none; color: var(--text-secondary); border-color: transparent; }
.btn-ghost:hover    { background: var(--bg-hover); color: var(--text-primary); }
.btn-sm { padding: 5px 11px; font-size: 12px; }
.btn-sm svg { width: 13px; height: 13px; }
.btn-lg { padding: 11px 22px; font-size: 15px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ─── النماذج ────────────────────────────────────────────────── */
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-label { font-size: 13px; font-weight: 700; color: var(--text-secondary); }
.form-label .required { color: var(--red); margin-right: 3px; }
.form-control, .form-select {
  background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 9px 13px;
  color: var(--text-primary); font-size: 13.5px;
  transition: border-color var(--duration-fast), box-shadow var(--duration-fast);
  width: 100%; outline: none; text-align: right;
}
.form-control:focus, .form-select:focus { border-color: var(--indigo); box-shadow: 0 0 0 3px var(--indigo-dim); }
.form-control::placeholder { color: var(--text-muted); }
.form-select option { background: var(--bg-elevated); color: var(--text-primary); }
textarea.form-control { resize: vertical; min-height: 90px; }
.form-error { font-size: 12px; color: var(--red); }
.form-hint  { font-size: 12px; color: var(--text-muted); }
.form-row   { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-actions { display: flex; align-items: center; gap: 10px; padding-top: 8px; }
.checkbox-group { display: flex; align-items: center; gap: 8px; flex-direction: row-reverse; justify-content: flex-end; }
.checkbox-group input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--indigo); cursor: pointer; }

/* ─── شريط التقدم ────────────────────────────────────────────── */
.progress-bar-wrap { height: 6px; background: var(--bg-elevated); border-radius: var(--radius-full); overflow: hidden; }
.progress-bar-fill { height: 100%; border-radius: var(--radius-full); background: linear-gradient(90deg, var(--indigo), var(--indigo-light)); transition: width .6s var(--ease); }
.progress-bar-fill.green { background: linear-gradient(90deg, var(--green), #34d399); }
.progress-bar-fill.amber { background: linear-gradient(90deg, var(--amber), #fbbf24); }
.progress-bar-fill.red   { background: linear-gradient(90deg, var(--red), #f87171); }

/* ─── التنبيهات ──────────────────────────────────────────────── */
.alert { display: flex; align-items: flex-start; gap: 11px; padding: 13px 16px; border-radius: var(--radius-md); border: 1px solid; font-size: 13.5px; }
.alert svg { width: 17px; height: 17px; flex-shrink: 0; margin-top: 1px; }
.alert.success { background: var(--green-dim); border-color: rgba(16,185,129,.25); color: #6ee7b7; }
.alert.error   { background: var(--red-dim);   border-color: rgba(239,68,68,.25);  color: #fca5a5; }
.alert.warning { background: var(--amber-dim); border-color: rgba(245,158,11,.25); color: #fcd34d; }
.alert.info    { background: var(--blue-dim);  border-color: rgba(59,130,246,.25); color: #93c5fd; }

/* ─── رأس الصفحة ─────────────────────────────────────────────── */
.page-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 28px; flex-wrap: wrap; }
.page-header-left { display: flex; flex-direction: column; gap: 4px; }
.page-heading { font-family: var(--font-heading); font-size: 22px; font-weight: 900; color: var(--text-primary); }
.page-subheading { font-size: 13px; color: var(--text-muted); }
.page-header-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* ─── شريط الفلاتر ───────────────────────────────────────────── */
.filters-bar {
  display: flex; align-items: center; gap: 10px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 12px 16px;
  margin-bottom: 20px; flex-wrap: wrap;
}
.filters-bar .form-control, .filters-bar .form-select { width: auto; min-width: 150px; padding: 7px 11px; font-size: 13px; }
.filters-bar .btn { padding: 7px 14px; font-size: 13px; }
.filter-sep { width: 1px; height: 28px; background: var(--border); flex-shrink: 0; }

/* ─── بطاقات المهام ──────────────────────────────────────────── */
.task-cards-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(300px,1fr)); gap: 16px; }
.task-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 18px 20px;
  display: flex; flex-direction: column; gap: 12px;
  transition: transform var(--duration-fast), box-shadow var(--duration-fast), border-color var(--duration-fast);
  position: relative; overflow: hidden;
}
.task-card::after { content: ''; position: absolute; right: 0; top: 0; bottom: 0; width: 3px; }
.task-card.urgent::after { background: var(--red); }
.task-card.high::after   { background: var(--orange); }
.task-card.medium::after { background: var(--blue); }
.task-card.low::after    { background: var(--gray); }
.task-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--indigo); }
.task-card-title { font-size: 14px; font-weight: 700; color: var(--text-primary); line-height: 1.4; }
.task-card-meta  { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.task-card-footer{ display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.assignees-stack { display: flex; align-items: center; flex-direction: row-reverse; }
.assignees-stack .user-avatar { width: 26px; height: 26px; margin-left: -8px; border: 2px solid var(--bg-card); font-size: 10px; }

/* ─── الصور الرمزية ──────────────────────────────────────────── */
.avatar { border-radius: var(--radius-full); object-fit: cover; flex-shrink: 0; }
.avatar-sm { width: 28px; height: 28px; }
.avatar-md { width: 36px; height: 36px; }
.avatar-lg { width: 52px; height: 52px; }
.avatar-xl { width: 72px; height: 72px; }

/* ─── التعليقات ──────────────────────────────────────────────── */
.comment-list { display: flex; flex-direction: column; gap: 14px; }
.comment-item { display: flex; gap: 12px; flex-direction: row-reverse; }
.comment-bubble {
  flex: 1; background: var(--bg-elevated);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md) 0 var(--radius-md) var(--radius-md);
  padding: 11px 14px;
}
.comment-bubble.internal { background: var(--purple-dim); border-color: rgba(168,85,247,.2); }
.comment-meta { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; flex-direction: row-reverse; }
.comment-author { font-size: 13px; font-weight: 700; color: var(--text-primary); }
.comment-time   { font-size: 11px; color: var(--text-muted); }
.comment-body   { font-size: 13.5px; color: var(--text-secondary); line-height: 1.6; }

/* ─── المخطط الزمني ──────────────────────────────────────────── */
.timeline { display: flex; flex-direction: column; gap: 0; }
.timeline-item { display: flex; gap: 14px; position: relative; padding-bottom: 18px; flex-direction: row-reverse; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item:last-child .timeline-line { display: none; }
.timeline-dot { width: 30px; height: 30px; border-radius: var(--radius-full); display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 12px; border: 2px solid var(--border); }
.timeline-line { position: absolute; right: 14px; top: 30px; bottom: 0; width: 2px; background: var(--border); }
.timeline-content { flex: 1; padding-top: 4px; }
.timeline-title { font-size: 13.5px; font-weight: 500; color: var(--text-primary); }
.timeline-sub   { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* ─── الرسائل ────────────────────────────────────────────────── */
.messages-container { display: flex; flex-direction: column; gap: 14px; padding: 20px; max-height: 500px; overflow-y: auto; }
.message-row { display: flex; gap: 10px; align-items: flex-end; }
.message-row.mine { flex-direction: row-reverse; }
.message-bubble { max-width: 65%; padding: 10px 14px; border-radius: var(--radius-lg); font-size: 13.5px; line-height: 1.6; }
.message-row.theirs .message-bubble { background: var(--bg-elevated); color: var(--text-primary); border-bottom-right-radius: var(--radius-sm); }
.message-row.mine .message-bubble   { background: var(--indigo); color: white; border-bottom-left-radius: var(--radius-sm); }
.message-time { font-size: 11px; color: var(--text-muted); margin-top: 4px; }
.message-row.theirs .message-time { text-align: right; }
.message-row.mine .message-time   { text-align: left; }

/* ─── الإشعارات ──────────────────────────────────────────────── */
.notif-item { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-bottom: 1px solid var(--border-light); transition: background var(--duration-fast); cursor: pointer; flex-direction: row-reverse; }
.notif-item:hover { background: var(--bg-hover); }
.notif-item.unread { background: var(--indigo-dim); }
.notif-icon { width: 36px; height: 36px; border-radius: var(--radius-md); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.notif-content { flex: 1; text-align: right; }
.notif-title  { font-size: 13.5px; font-weight: 700; color: var(--text-primary); }
.notif-body   { font-size: 12.5px; color: var(--text-secondary); margin-top: 2px; }
.notif-time   { font-size: 11px; color: var(--text-muted); margin-top: 4px; }

/* ─── حالة فارغة ─────────────────────────────────────────────── */
.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 56px 24px; color: var(--text-muted); text-align: center; }
.empty-state svg { width: 48px; height: 48px; opacity: .35; }
.empty-state h3 { font-size: 15px; font-weight: 700; color: var(--text-secondary); }
.empty-state p  { font-size: 13px; max-width: 300px; line-height: 1.7; }

/* ─── القوائم المنسدلة ───────────────────────────────────────── */
.dropdown { position: relative; }
.dropdown-menu { position: absolute; left: 0; top: calc(100% + 6px); background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); min-width: 180px; z-index: 200; overflow: hidden; display: none; }
.dropdown-menu.open { display: block; animation: fadeDown .15s ease; }
@keyframes fadeDown { from { opacity:0; transform:translateY(-6px); } to { opacity:1; transform:none; } }
.dropdown-item { display: flex; align-items: center; gap: 9px; padding: 9px 14px; font-size: 13.5px; color: var(--text-secondary); cursor: pointer; transition: all var(--duration-fast); flex-direction: row-reverse; }
.dropdown-item:hover { background: var(--bg-hover); color: var(--text-primary); }
.dropdown-item.danger:hover { background: var(--red-dim); color: var(--red); }
.dropdown-divider { height: 1px; background: var(--border); margin: 4px 0; }

/* ─── النوافذ المنبثقة ───────────────────────────────────────── */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.7); backdrop-filter: blur(4px); z-index: 300; display: flex; align-items: center; justify-content: center; padding: 20px; opacity: 0; pointer-events: none; transition: opacity var(--duration); }
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-xl); box-shadow: var(--shadow-lg); width: 100%; max-width: 560px; max-height: 90vh; overflow-y: auto; transform: scale(.95); transition: transform var(--duration); }
.modal-overlay.open .modal { transform: scale(1); }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px; border-bottom: 1px solid var(--border); }
.modal-title { font-family: var(--font-heading); font-size: 17px; font-weight: 800; }
.modal-close { background: none; border: none; color: var(--text-muted); cursor: pointer; padding: 4px; border-radius: var(--radius-sm); }
.modal-body   { padding: 22px 24px; }
.modal-footer { padding: 16px 24px; border-top: 1px solid var(--border); display: flex; gap: 10px; justify-content: flex-start; }

/* ─── التبويبات ──────────────────────────────────────────────── */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 22px; }
.tab { padding: 9px 16px; font-size: 13.5px; font-weight: 600; color: var(--text-muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; transition: all var(--duration-fast); }
.tab:hover { color: var(--text-secondary); }
.tab.active { color: var(--indigo-light); border-bottom-color: var(--indigo); font-weight: 700; }

/* ─── مسار التنقل ────────────────────────────────────────────── */
.breadcrumb { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-muted); margin-bottom: 18px; flex-direction: row-reverse; justify-content: flex-end; }
.breadcrumb a:hover { color: var(--indigo-light); }
.breadcrumb-sep { color: var(--text-muted); }
.breadcrumb-current { color: var(--text-secondary); }

/* ─── ترقيم الصفحات ──────────────────────────────────────────── */
.pagination { display: flex; align-items: center; gap: 4px; }
.pagination .page-link { display: flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: var(--radius-md); font-size: 13px; font-weight: 600; color: var(--text-secondary); background: var(--bg-elevated); border: 1px solid var(--border); transition: all var(--duration-fast); }
.pagination .page-link:hover { background: var(--bg-hover); color: var(--text-primary); }
.pagination .page-link.active { background: var(--indigo); border-color: var(--indigo); color: white; }
.pagination .page-link.disabled { opacity: .4; pointer-events: none; }

/* ─── عرض التفاصيل ───────────────────────────────────────────── */
.detail-grid { display: grid; grid-template-columns: 1fr 340px; gap: 22px; align-items: start; }
.detail-meta-list { display: flex; flex-direction: column; gap: 12px; }
.detail-meta-item { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--border-light); }
.detail-meta-item:last-child { border-bottom: none; padding-bottom: 0; }
.detail-meta-label { font-size: 12px; font-weight: 700; color: var(--text-muted); }
.detail-meta-value { font-size: 13.5px; color: var(--text-primary); text-align: left; }

/* ─── صفحة تسجيل الدخول ──────────────────────────────────────── */
.auth-shell { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.auth-side { background: linear-gradient(145deg,#0d1117 0%,#1a1040 50%,#0d1117 100%); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 48px; position: relative; overflow: hidden; }
.auth-side::before { content: ''; position: absolute; inset: 0; background: radial-gradient(ellipse at 70% 50%,rgba(99,102,241,.15) 0%,transparent 70%),radial-gradient(ellipse at 30% 20%,rgba(139,92,246,.1) 0%,transparent 60%); }
.auth-panel { background: var(--bg-surface); display: flex; align-items: center; justify-content: center; padding: 48px; }
.auth-form-wrap { width: 100%; max-width: 420px; }

/* ─── استجابة الشاشة ─────────────────────────────────────────── */
@media(max-width:1024px){ .detail-grid { grid-template-columns: 1fr; } }
@media(max-width:768px){
  .sidebar { transform: translateX(100%); width: var(--sidebar-w)!important; }
  .sidebar.open { transform: translateX(0); box-shadow: var(--shadow-lg); }
  .main-area { margin-right: 0!important; }
  .menu-toggle { display: flex!important; }
  .page-content { padding: 16px 16px 40px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .auth-shell { grid-template-columns: 1fr; }
  .auth-side { display: none; }
}
@media(max-width:480px){ .stats-grid { grid-template-columns: 1fr; } .task-cards-grid { grid-template-columns: 1fr; } }

/* ─── شريط التمرير ───────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: var(--radius-full); }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ─── الحركات ────────────────────────────────────────────────── */
@keyframes fadeIn { from { opacity:0; transform:translateY(8px); } to { opacity:1; transform:none; } }
@keyframes slideIn { from { transform:translateX(12px); opacity:0; } to { transform:none; opacity:1; } }
.animate-in { animation: fadeIn .3s ease forwards; }
.stagger > * { animation: fadeIn .3s ease backwards; }
.stagger > *:nth-child(1) { animation-delay:.03s; }
.stagger > *:nth-child(2) { animation-delay:.07s; }
.stagger > *:nth-child(3) { animation-delay:.11s; }
.stagger > *:nth-child(4) { animation-delay:.15s; }
.stagger > *:nth-child(5) { animation-delay:.19s; }
.stagger > *:nth-child(6) { animation-delay:.23s; }
.stagger > *:nth-child(7) { animation-delay:.27s; }
.stagger > *:nth-child(8) { animation-delay:.31s; }

/* ─── مساعدات ────────────────────────────────────────────────── */
.flex{display:flex}.flex-col{display:flex;flex-direction:column}
.items-center{align-items:center}.justify-between{justify-content:space-between}
.gap-2{gap:8px}.gap-3{gap:12px}.gap-4{gap:16px}
.w-full{width:100%}.mt-1{margin-top:4px}.mt-2{margin-top:8px}
.mt-4{margin-top:16px}.mb-4{margin-bottom:16px}.mb-6{margin-bottom:24px}
.text-sm{font-size:12.5px}.text-xs{font-size:11px}
.text-muted{color:var(--text-muted)}.text-secondary{color:var(--text-secondary)}
.text-primary{color:var(--text-primary)}.font-bold{font-weight:700}
.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.rounded-full{border-radius:var(--radius-full)}

/* ═══════════════════════════════════════════════════════════════════
   🔒 مخفي مؤقتاً — سيتم تفعيله في تحديث لاحق
   للتفعيل: احذف هذا القسم أو غيّر display:none إلى display:flex
═══════════════════════════════════════════════════════════════════ */

/* الشريط الجانبي — مخفي */
.nav-hide-temp         { display: none !important; }

/* قسم "التواصل" بالكامل (الرسائل + الإشعارات + العنوان) */
.nav-section-comms     { display: none !important; }

/* قسم "التحليلات" بالكامل (التقارير + العنوان) */
.nav-section-analytics { display: none !important; }

/* أيقونات الـ topbar (الإشعارات + الرسائل) */
.topbar-hide-temp      { display: none !important; }
