/* ════════════════════════════════════════════════════════════════
   منصة تنمية القيادات — نظام التصميم الموحّد (Design System v3)
   Tokens + Components + Utilities
   ──────────────────────────────────────────────────────────────── */

/* ──────────── DESIGN TOKENS ──────────── */
:root {
  /* Colors — Brand */
  --lp-or: #E05A28;
  --lp-or-2: #d04a18;
  --lp-or-3: #b53d10;
  --lp-or-soft: #fef0ea;
  --lp-or-softer: #fff7f3;
  --lp-nv: #1B3A5E;
  --lp-nv-2: #243F6A;
  --lp-nv-soft: #eff3f8;

  /* Colors — Neutral */
  --lp-bg: #fafaf7;
  --lp-surface: #ffffff;
  --lp-surface-2: #f5f4f0;
  --lp-surface-3: #ebe9e3;
  --lp-surface-hover: #f0eee8;
  --lp-border: #ebe9e3;
  --lp-border-strong: #d8d5cc;
  --lp-divider: #f0eee8;

  /* Colors — Text */
  --lp-text: #0a0a0a;
  --lp-text-muted: #6b6b6b;
  --lp-text-dim: #9a9a9a;
  --lp-text-inverse: #ffffff;

  /* Colors — Semantic */
  --lp-success: #16a34a;
  --lp-success-soft: #dcfce7;
  --lp-warning: #d97706;
  --lp-warning-soft: #fef3c7;
  --lp-danger: #dc2626;
  --lp-danger-soft: #fee2e2;
  --lp-info: #2563eb;
  --lp-info-soft: #dbeafe;
  --lp-purple: #7C3AED;
  --lp-teal: #0891B2;
  --lp-pink: #BE185D;

  /* Spacing scale */
  --lp-s-1: 4px;
  --lp-s-2: 8px;
  --lp-s-3: 12px;
  --lp-s-4: 16px;
  --lp-s-5: 20px;
  --lp-s-6: 24px;
  --lp-s-8: 32px;
  --lp-s-10: 40px;
  --lp-s-12: 48px;
  --lp-s-16: 64px;
  --lp-s-20: 80px;

  /* Typography */
  --lp-font: 'Tajawal', -apple-system, sans-serif;
  --lp-font-mono: ui-monospace, 'SF Mono', Menlo, monospace;
  --lp-fs-xs: 11px;
  --lp-fs-sm: 12px;
  --lp-fs-base: 14px;
  --lp-fs-md: 15px;
  --lp-fs-lg: 16px;
  --lp-fs-xl: 18px;
  --lp-fs-2xl: 22px;
  --lp-fs-3xl: 26px;
  --lp-fs-4xl: 32px;
  --lp-fs-5xl: 40px;
  --lp-lh-tight: 1.25;
  --lp-lh-base: 1.55;
  --lp-lh-loose: 1.75;

  /* Radii */
  --lp-r-sm: 6px;
  --lp-r: 8px;
  --lp-r-md: 10px;
  --lp-r-lg: 12px;
  --lp-r-xl: 16px;
  --lp-r-2xl: 20px;
  --lp-r-full: 9999px;

  /* Shadows */
  --lp-sh-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
  --lp-sh-sm: 0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
  --lp-sh: 0 4px 8px -2px rgba(15, 23, 42, 0.06), 0 2px 4px -1px rgba(15, 23, 42, 0.04);
  --lp-sh-md: 0 8px 16px -4px rgba(15, 23, 42, 0.1), 0 4px 8px -2px rgba(15, 23, 42, 0.05);
  --lp-sh-lg: 0 16px 32px -8px rgba(15, 23, 42, 0.12), 0 4px 8px -2px rgba(15, 23, 42, 0.06);
  --lp-sh-xl: 0 24px 48px -12px rgba(15, 23, 42, 0.16);

  /* Transitions */
  --lp-trans: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --lp-trans-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);

  /* Z-index */
  --lp-z-dropdown: 100;
  --lp-z-sticky: 50;
  --lp-z-modal: 200;
  --lp-z-toast: 1000;
  --lp-z-tooltip: 1500;

  /* Layout */
  --lp-topbar-h: 60px;
  --lp-sidebar-w: 260px;
  --lp-container: 1280px;
}

/* ──────────── DARK MODE ──────────── */
[data-theme="dark"] {
  --lp-bg: #0d0e10;
  --lp-surface: #16181d;
  --lp-surface-2: #1c1e24;
  --lp-surface-3: #24262e;
  --lp-surface-hover: #24262e;
  --lp-border: #2a2d36;
  --lp-border-strong: #3a3d46;
  --lp-divider: #24262e;
  --lp-text: #e8e8e8;
  --lp-text-muted: #b0b0b0;
  --lp-text-dim: #707070;
  --lp-or-soft: #3a1810;
  --lp-or-softer: #2a1208;
  --lp-nv-soft: #131e2f;
  --lp-success-soft: #14532d;
  --lp-warning-soft: #422006;
  --lp-danger-soft: #7f1d1d;
  --lp-info-soft: #1e3a8a;
  --lp-sh-xs: 0 1px 2px rgba(0, 0, 0, 0.3);
  --lp-sh-sm: 0 1px 3px rgba(0, 0, 0, 0.4);
  --lp-sh: 0 4px 8px rgba(0, 0, 0, 0.5);
  --lp-sh-md: 0 8px 16px rgba(0, 0, 0, 0.5);
  --lp-sh-lg: 0 16px 32px rgba(0, 0, 0, 0.6);
  --lp-sh-xl: 0 24px 48px rgba(0, 0, 0, 0.7);
}

/* ──────────── RESET ──────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; font-family: var(--lp-font); background: var(--lp-bg); color: var(--lp-text); -webkit-font-smoothing: antialiased; line-height: var(--lp-lh-base); }
body { font-size: var(--lp-fs-base); }
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
a { color: inherit; text-decoration: none; transition: color var(--lp-trans); }
a:hover { color: var(--lp-or); }
img { max-width: 100%; display: block; }
svg { display: inline-block; vertical-align: middle; }

/* ──────────── TYPOGRAPHY ──────────── */
.lp-h1 { font-size: var(--lp-fs-4xl); font-weight: 800; line-height: var(--lp-lh-tight); color: var(--lp-text); }
.lp-h2 { font-size: var(--lp-fs-3xl); font-weight: 800; line-height: var(--lp-lh-tight); color: var(--lp-text); }
.lp-h3 { font-size: var(--lp-fs-2xl); font-weight: 700; line-height: var(--lp-lh-tight); color: var(--lp-text); }
.lp-h4 { font-size: var(--lp-fs-xl); font-weight: 700; color: var(--lp-text); }
.lp-h5 { font-size: var(--lp-fs-lg); font-weight: 700; color: var(--lp-text); }
.lp-muted { color: var(--lp-text-muted); }
.lp-dim { color: var(--lp-text-dim); }
.lp-mono { font-family: var(--lp-font-mono); }

/* ──────────── LAYOUT ──────────── */
.lp-app {
  display: grid;
  grid-template-rows: var(--lp-topbar-h) 1fr;
  height: 100vh;
  overflow: hidden;
}
.lp-app-body {
  display: grid;
  grid-template-columns: var(--lp-sidebar-w) 1fr;
  overflow: hidden;
}
.lp-app-body.no-sidebar { grid-template-columns: 1fr; }
.lp-app-main {
  overflow-y: auto;
  background: var(--lp-bg);
}
.lp-container {
  max-width: var(--lp-container);
  margin: 0 auto;
  padding: var(--lp-s-8) var(--lp-s-8);
}
.lp-page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--lp-s-3);
  margin-bottom: var(--lp-s-8);
}
.lp-page-title { font-size: var(--lp-fs-3xl); font-weight: 800; color: var(--lp-text); margin-bottom: 4px; }
.lp-page-subtitle { font-size: var(--lp-fs-base); color: var(--lp-text-muted); }

/* ──────────── TOPBAR ──────────── */
.lp-topbar {
  background: rgba(255,255,255,.78);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--lp-border);
  display: flex;
  align-items: center;
  padding: 0 var(--lp-s-5);
  gap: var(--lp-s-3);
  height: var(--lp-topbar-h);
  flex-shrink: 0;
  position: sticky; top: 0; z-index: 100;
}
[data-theme="dark"] .lp-topbar { background: rgba(22,24,29,.78); }
.lp-brand-pill {
  display: flex;
  align-items: center;
  gap: var(--lp-s-2);
  padding: 6px 14px 6px 8px;
  border-radius: var(--lp-r-full);
  background: transparent;
  transition: background var(--lp-trans);
}
.lp-brand-pill:hover { background: var(--lp-surface-hover); }
.lp-brand-logo {
  width: 36px; height: 36px;
  border-radius: var(--lp-r-md);
  background: linear-gradient(135deg, var(--lp-or), #f0723c);
  color: white;
  display: flex; align-items: center; justify-content: center;
  font-weight: 900; font-size: 15px;
  letter-spacing: -0.5px;
  box-shadow: 0 2px 8px rgba(224, 90, 40, 0.3);
}
.lp-brand-name { font-weight: 700; font-size: var(--lp-fs-base); }
.lp-brand-arrow { color: var(--lp-text-dim); font-size: 11px; }

.lp-spacer { flex: 1; }

.lp-topbar-link {
  display: flex; align-items: center; gap: var(--lp-s-2);
  padding: var(--lp-s-2) var(--lp-s-4);
  border-radius: var(--lp-r);
  font-size: var(--lp-fs-base);
  font-weight: 600;
  color: var(--lp-text);
  transition: background var(--lp-trans);
}
.lp-topbar-link:hover { background: var(--lp-surface-hover); }
.lp-topbar-link svg { width: 18px; height: 18px; }

.lp-icon-btn {
  width: 38px; height: 38px;
  border-radius: var(--lp-r-full);
  display: flex; align-items: center; justify-content: center;
  font-size: var(--lp-fs-lg);
  background: transparent;
  color: var(--lp-text);
  position: relative;
  transition: background var(--lp-trans);
}
.lp-icon-btn:hover { background: var(--lp-surface-hover); }
.lp-icon-btn .lp-dot {
  position: absolute;
  top: 6px; left: 6px;
  background: var(--lp-danger);
  color: white;
  font-size: 10px;
  font-weight: 700;
  min-width: 18px; height: 18px;
  padding: 0 5px;
  border-radius: var(--lp-r-full);
  display: none;
  align-items: center; justify-content: center;
}

.lp-avatar {
  width: 36px; height: 36px;
  border-radius: var(--lp-r-full);
  background: linear-gradient(135deg, var(--lp-nv), var(--lp-nv-2));
  color: white;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  border: 2px solid var(--lp-border);
  transition: transform var(--lp-trans);
}
.lp-avatar:hover { transform: scale(1.05); }
.lp-avatar.sm { width: 28px; height: 28px; font-size: 11px; border-width: 1px; }
.lp-avatar.lg { width: 48px; height: 48px; font-size: 18px; }

/* ──────────── SIDEBAR ──────────── */
.lp-sidebar {
  background: var(--lp-surface);
  border-left: 1px solid var(--lp-border);
  padding: var(--lp-s-5) var(--lp-s-3);
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
}
.lp-nav-group {
  font-size: var(--lp-fs-xs);
  font-weight: 700;
  color: var(--lp-text-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 12px var(--lp-s-4) 6px;
}
.lp-nav-link {
  display: flex;
  align-items: center;
  gap: var(--lp-s-3);
  padding: var(--lp-s-3) var(--lp-s-4);
  border-radius: var(--lp-r-md);
  font-size: var(--lp-fs-base);
  font-weight: 600;
  color: var(--lp-text);
  cursor: pointer;
  transition: all var(--lp-trans);
  position: relative;
}
.lp-nav-link:hover { background: var(--lp-surface-2); color: var(--lp-text); }
.lp-nav-link.active { background: var(--lp-or-soft); color: var(--lp-or); }
.lp-nav-link.active::before {
  content: '';
  position: absolute;
  right: -12px;
  top: 12px; bottom: 12px;
  width: 3px;
  background: var(--lp-or);
  border-radius: 0 2px 2px 0;
}
.lp-nav-icon {
  width: 22px; height: 22px;
  display: flex; align-items: center; justify-content: center;
  font-size: var(--lp-fs-base);
}
.lp-nav-count {
  margin-right: auto;
  background: var(--lp-surface-2);
  padding: 2px 8px;
  border-radius: var(--lp-r-full);
  font-size: var(--lp-fs-xs);
  color: var(--lp-text-muted);
  font-weight: 700;
}
.lp-nav-link.active .lp-nav-count { background: rgba(224, 90, 40, 0.15); color: var(--lp-or); }

/* ──────────── BUTTONS ──────────── */
.lp-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--lp-s-2);
  padding: 10px var(--lp-s-5);
  border-radius: var(--lp-r);
  font-size: var(--lp-fs-base);
  font-weight: 700;
  transition: all var(--lp-trans);
  white-space: nowrap;
  user-select: none;
  border: 1px solid transparent;
}
.lp-btn:disabled { opacity: 0.5; cursor: not-allowed; pointer-events: none; }
.lp-btn-primary { background: var(--lp-or); color: white; }
.lp-btn-primary:hover { background: var(--lp-or-2); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(224, 90, 40, 0.25); color: white; }
.lp-btn-dark { background: var(--lp-text); color: var(--lp-surface); }
.lp-btn-dark:hover { background: var(--lp-or); color: white; }
.lp-btn-secondary { background: var(--lp-surface); color: var(--lp-text); border-color: var(--lp-border); }
.lp-btn-secondary:hover { background: var(--lp-surface-hover); border-color: var(--lp-border-strong); color: var(--lp-text); }
.lp-btn-ghost { background: transparent; color: var(--lp-text); }
.lp-btn-ghost:hover { background: var(--lp-surface-hover); color: var(--lp-text); }
.lp-btn-danger { background: var(--lp-danger); color: white; }
.lp-btn-danger:hover { background: #b91c1c; color: white; }
.lp-btn-success { background: var(--lp-success); color: white; }
.lp-btn-sm { padding: 6px 12px; font-size: var(--lp-fs-sm); }
.lp-btn-lg { padding: 14px var(--lp-s-6); font-size: var(--lp-fs-lg); }
.lp-btn-block { width: 100%; }
.lp-btn-icon { padding: 0; width: 36px; height: 36px; border-radius: var(--lp-r); }

/* ──────────── FORMS ──────────── */
.lp-field { margin-bottom: var(--lp-s-5); }
.lp-label {
  display: block;
  font-size: var(--lp-fs-sm);
  font-weight: 700;
  color: var(--lp-text);
  margin-bottom: var(--lp-s-2);
}
.lp-required { color: var(--lp-danger); }
.lp-input, .lp-textarea, .lp-select {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--lp-border);
  background: var(--lp-surface);
  border-radius: var(--lp-r);
  font-size: var(--lp-fs-base);
  color: var(--lp-text);
  transition: border-color var(--lp-trans), box-shadow var(--lp-trans);
}
.lp-input:focus, .lp-textarea:focus, .lp-select:focus {
  outline: 0;
  border-color: var(--lp-or);
  box-shadow: 0 0 0 3px var(--lp-or-soft);
}
.lp-input::placeholder, .lp-textarea::placeholder { color: var(--lp-text-dim); }
.lp-textarea { min-height: 80px; resize: vertical; }
.lp-input-icon-wrap { position: relative; }
.lp-input-icon-wrap .lp-input { padding-right: 38px; }
.lp-input-icon-wrap .lp-input-icon {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--lp-text-dim);
  pointer-events: none;
}
.lp-help { font-size: var(--lp-fs-xs); color: var(--lp-text-dim); margin-top: 4px; }
.lp-error { font-size: var(--lp-fs-xs); color: var(--lp-danger); margin-top: 4px; }

/* Checkbox / Radio */
.lp-check {
  display: inline-flex;
  align-items: center;
  gap: var(--lp-s-2);
  cursor: pointer;
  user-select: none;
}
.lp-check input[type="checkbox"], .lp-check input[type="radio"] {
  width: 18px; height: 18px; cursor: pointer; accent-color: var(--lp-or);
}

/* Switch */
.lp-switch {
  width: 40px; height: 22px;
  background: var(--lp-border-strong);
  border-radius: var(--lp-r-full);
  position: relative; cursor: pointer;
  transition: background var(--lp-trans);
  flex-shrink: 0;
}
.lp-switch::after {
  content: '';
  position: absolute;
  width: 18px; height: 18px;
  background: white;
  border-radius: var(--lp-r-full);
  top: 2px; right: 2px;
  transition: all var(--lp-trans);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}
.lp-switch.on { background: var(--lp-or); }
.lp-switch.on::after { right: 20px; }

/* ──────────── CARDS ──────────── */
.lp-card {
  background: var(--lp-surface);
  border: 1px solid var(--lp-border);
  border-radius: var(--lp-r-lg);
  overflow: hidden;
}
.lp-card-padded { padding: var(--lp-s-6); }
.lp-card-header {
  padding: var(--lp-s-4) var(--lp-s-6);
  border-bottom: 1px solid var(--lp-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--lp-s-3);
}
.lp-card-body { padding: var(--lp-s-6); }
.lp-card-footer {
  padding: var(--lp-s-4) var(--lp-s-6);
  border-top: 1px solid var(--lp-border);
  display: flex;
  gap: var(--lp-s-2);
  justify-content: flex-start;
}

/* ──────────── TABLES ──────────── */
.lp-table {
  width: 100%;
  border-collapse: collapse;
}
.lp-table thead { background: var(--lp-surface-2); }
.lp-table th {
  padding: var(--lp-s-3) var(--lp-s-5);
  text-align: right;
  font-size: var(--lp-fs-xs);
  font-weight: 700;
  color: var(--lp-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--lp-border);
}
.lp-table td {
  padding: var(--lp-s-4) var(--lp-s-5);
  font-size: var(--lp-fs-base);
  border-bottom: 1px solid var(--lp-border);
}
.lp-table tbody tr { transition: background var(--lp-trans); }
.lp-table tbody tr:hover { background: var(--lp-surface-2); }
.lp-table tbody tr:last-child td { border-bottom: 0; }
.lp-table-actions { text-align: left; white-space: nowrap; }

/* ──────────── BADGES ──────────── */
.lp-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: var(--lp-r-full);
  font-size: var(--lp-fs-xs);
  font-weight: 700;
  background: var(--lp-surface-2);
  color: var(--lp-text-muted);
}
.lp-badge-success { background: var(--lp-success-soft); color: var(--lp-success); }
.lp-badge-warning { background: var(--lp-warning-soft); color: var(--lp-warning); }
.lp-badge-danger { background: var(--lp-danger-soft); color: var(--lp-danger); }
.lp-badge-info { background: var(--lp-info-soft); color: var(--lp-info); }

/* ──────────── MODAL ──────────── */
.lp-modal-bg {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(4px);
  z-index: var(--lp-z-modal);
  display: none;
  align-items: center;
  justify-content: center;
  padding: var(--lp-s-5);
}
.lp-modal-bg.show { display: flex; animation: lp-fade-in 0.2s ease; }
.lp-modal {
  background: var(--lp-surface);
  border-radius: var(--lp-r-xl);
  max-width: 540px;
  width: 100%;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--lp-sh-xl);
  animation: lp-slide-up 0.25s ease;
}
.lp-modal.lg { max-width: 760px; }
.lp-modal.xl { max-width: 920px; }
.lp-modal-header {
  padding: var(--lp-s-5) var(--lp-s-6);
  border-bottom: 1px solid var(--lp-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.lp-modal-title { font-size: var(--lp-fs-xl); font-weight: 800; color: var(--lp-text); }
.lp-modal-subtitle { font-size: var(--lp-fs-sm); color: var(--lp-text-muted); margin-top: 4px; }
.lp-modal-body { padding: var(--lp-s-6); overflow-y: auto; flex: 1; }
.lp-modal-footer {
  padding: var(--lp-s-4) var(--lp-s-6);
  border-top: 1px solid var(--lp-border);
  display: flex;
  justify-content: flex-end;
  gap: var(--lp-s-2);
}
.lp-close-btn {
  width: 32px; height: 32px;
  border-radius: var(--lp-r-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: var(--lp-text-muted);
  background: transparent;
  transition: background var(--lp-trans);
}
.lp-close-btn:hover { background: var(--lp-surface-hover); }

/* ──────────── DROPDOWN ──────────── */
.lp-dropdown {
  position: absolute;
  background: var(--lp-surface);
  border: 1px solid var(--lp-border);
  border-radius: var(--lp-r-lg);
  box-shadow: var(--lp-sh-lg);
  padding: 6px;
  z-index: var(--lp-z-dropdown);
  min-width: 220px;
  display: none;
}
.lp-dropdown.show { display: block; animation: lp-fade-in 0.15s ease; }
.lp-menu-item {
  display: flex;
  align-items: center;
  gap: var(--lp-s-3);
  padding: var(--lp-s-3);
  border-radius: var(--lp-r);
  font-size: var(--lp-fs-base);
  font-weight: 500;
  color: var(--lp-text);
  width: 100%;
  text-align: right;
  background: transparent;
  transition: background var(--lp-trans);
}
.lp-menu-item:hover { background: var(--lp-surface-hover); color: var(--lp-text); }
.lp-menu-divider { height: 1px; background: var(--lp-border); margin: 4px 0; }

/* ──────────── TOAST (محسّنة) ──────────── */
.lp-toast-stack {
  position: fixed;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  z-index: var(--lp-z-toast);
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
  align-items: center;
}
.lp-toast {
  background: white;
  color: var(--lp-text);
  padding: 14px 18px;
  border-radius: 12px;
  box-shadow: 0 16px 40px rgba(15,23,42,.14), 0 4px 8px rgba(15,23,42,.06);
  min-width: 280px;
  max-width: 480px;
  font-size: 14px;
  font-weight: 600;
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  border-right: 4px solid var(--lp-info);
  opacity: 0;
  transform: translateY(-12px) scale(.96);
  transition: opacity .35s cubic-bezier(.16,1,.3,1), transform .35s cubic-bezier(.34,1.56,.64,1);
  backdrop-filter: blur(12px);
  background: rgba(255,255,255,.96);
}
.lp-toast.show { opacity: 1; transform: translateY(0) scale(1); }
.lp-toast-icon {
  width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 900; font-size: 16px; flex-shrink: 0;
  background: var(--lp-info); color: white;
}
.lp-toast-msg { flex: 1; line-height: 1.5; }
.lp-toast-close {
  background: none; border: none; cursor: pointer;
  font-size: 18px; color: var(--lp-text-muted); padding: 0;
  width: 24px; height: 24px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  transition: all .15s; flex-shrink: 0;
}
.lp-toast-close:hover { background: var(--lp-surface-2); color: var(--lp-text); }
.lp-toast.success { border-right-color: var(--lp-success); }
.lp-toast.success .lp-toast-icon { background: var(--lp-success); }
.lp-toast.error { border-right-color: var(--lp-danger); }
.lp-toast.error .lp-toast-icon { background: var(--lp-danger); }
.lp-toast.warning { border-right-color: var(--lp-warning); }
.lp-toast.warning .lp-toast-icon { background: var(--lp-warning); }
.lp-toast.info { border-right-color: var(--lp-info); }
[data-theme="dark"] .lp-toast { background: rgba(28,30,36,.96); color: var(--lp-text); }

/* ──────────── TABS ──────────── */
.lp-tabs {
  display: flex;
  gap: 2px;
  border-bottom: 1px solid var(--lp-border);
  margin-bottom: var(--lp-s-6);
}
.lp-tab {
  padding: var(--lp-s-3) var(--lp-s-5);
  font-size: var(--lp-fs-base);
  font-weight: 600;
  color: var(--lp-text-muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: all var(--lp-trans);
  display: flex;
  align-items: center;
  gap: var(--lp-s-2);
}
.lp-tab:hover { color: var(--lp-text); }
.lp-tab.active { color: var(--lp-text); border-bottom-color: var(--lp-or); }

/* ──────────── EMPTY STATE ──────────── */
.lp-empty {
  text-align: center;
  padding: var(--lp-s-16) var(--lp-s-5);
}
.lp-empty-icon {
  width: 80px; height: 80px;
  border-radius: var(--lp-r-2xl);
  background: var(--lp-or-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  margin: 0 auto var(--lp-s-5);
}
.lp-empty h3 { font-size: var(--lp-fs-xl); color: var(--lp-text); margin-bottom: 6px; }
.lp-empty p { color: var(--lp-text-muted); font-size: var(--lp-fs-base); margin-bottom: var(--lp-s-5); max-width: 380px; margin-left: auto; margin-right: auto; }
.lp-empty-actions { display: flex; gap: var(--lp-s-2); justify-content: center; flex-wrap: wrap; }

/* ──────────── SPINNER ──────────── */
.lp-spinner {
  display: inline-block;
  width: 16px; height: 16px;
  border: 2px solid var(--lp-border);
  border-top-color: var(--lp-or);
  border-radius: var(--lp-r-full);
  animation: lp-spin 0.6s linear infinite;
}
.lp-spinner-lg { width: 36px; height: 36px; border-width: 3px; }
.lp-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--lp-s-16);
}

/* ──────────── TOOLTIP ──────────── */
.lp-tooltip {
  position: relative;
}
.lp-tooltip::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 8px);
  right: 50%;
  transform: translateX(50%);
  background: var(--lp-text);
  color: var(--lp-surface);
  padding: 4px 10px;
  border-radius: var(--lp-r-sm);
  font-size: var(--lp-fs-xs);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--lp-trans);
  z-index: var(--lp-z-tooltip);
}
.lp-tooltip:hover::after { opacity: 1; }

/* ──────────── KEYBOARD KBD ──────────── */
.lp-kbd {
  background: var(--lp-surface-2);
  border: 1px solid var(--lp-border);
  border-bottom-width: 2px;
  border-radius: var(--lp-r-sm);
  padding: 2px 6px;
  font-family: var(--lp-font-mono);
  font-size: var(--lp-fs-xs);
  color: var(--lp-text);
}

/* ──────────── ANIMATIONS ──────────── */
@keyframes lp-fade-in { from { opacity: 0 } to { opacity: 1 } }
@keyframes lp-slide-up { from { transform: translateY(20px); opacity: 0 } to { transform: none; opacity: 1 } }
@keyframes lp-slide-in { from { transform: translateX(-30px); opacity: 0 } to { transform: none; opacity: 1 } }
@keyframes lp-spin { to { transform: rotate(360deg) } }
@keyframes lp-pulse { 0%, 100% { opacity: 1 } 50% { opacity: 0.5 } }

/* ──────────── UTILITIES ──────────── */
.lp-flex { display: flex; }
.lp-flex-col { flex-direction: column; }
.lp-items-center { align-items: center; }
.lp-justify-between { justify-content: space-between; }
.lp-gap-1 { gap: var(--lp-s-1); }
.lp-gap-2 { gap: var(--lp-s-2); }
.lp-gap-3 { gap: var(--lp-s-3); }
.lp-gap-4 { gap: var(--lp-s-4); }
.lp-mt-2 { margin-top: var(--lp-s-2); }
.lp-mt-4 { margin-top: var(--lp-s-4); }
.lp-mt-6 { margin-top: var(--lp-s-6); }
.lp-mb-2 { margin-bottom: var(--lp-s-2); }
.lp-mb-4 { margin-bottom: var(--lp-s-4); }
.lp-mb-6 { margin-bottom: var(--lp-s-6); }
.lp-text-center { text-align: center; }
.lp-w-full { width: 100%; }

/* ──────────── RESPONSIVE ──────────── */
@media (max-width: 900px) {
  .lp-app-body { grid-template-columns: 1fr; }
  .lp-sidebar { display: none; position: fixed; top: var(--lp-topbar-h); right: 0; bottom: 0; width: 280px; z-index: var(--lp-z-modal); box-shadow: var(--lp-sh-lg); }
  .lp-sidebar.open { display: flex; }
  .lp-container { padding: var(--lp-s-4); }
  .lp-page-title { font-size: var(--lp-fs-2xl); }
  .lp-topbar-link span { display: none; }
}

/* ──────────── POLISH: scrollbars, focus, transitions ──────────── */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--lp-border-strong); border-radius: 10px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: var(--lp-text-muted); border: 2px solid transparent; background-clip: padding-box; }
* { scrollbar-width: thin; scrollbar-color: var(--lp-border-strong) transparent; }

/* Smooth focus rings */
.lp-input:focus, .lp-select:focus, .lp-textarea:focus, button:focus-visible, a:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--lp-or) 25%, transparent);
  outline-offset: 2px;
}

/* Hover lift للبطاقات */
.lp-card { transition: transform .25s cubic-bezier(.16,1,.3,1), box-shadow .25s cubic-bezier(.16,1,.3,1), border-color .15s; }
.lp-card.lp-card-hover:hover { transform: translateY(-3px); box-shadow: 0 12px 28px -8px rgba(15,23,42,.12), 0 4px 8px -2px rgba(15,23,42,.06); }

/* Buttons: ripple + lift */
.lp-btn { position: relative; overflow: hidden; transition: all .22s cubic-bezier(.16,1,.3,1); }
.lp-btn::after { content: ''; position: absolute; top: 50%; left: 50%; width: 0; height: 0; border-radius: 50%; background: rgba(255,255,255,.35); transform: translate(-50%,-50%); transition: width .5s, height .5s; pointer-events: none; }
.lp-btn:active::after { width: 320px; height: 320px; }
.lp-btn-primary:hover { transform: translateY(-1px); box-shadow: 0 8px 20px rgba(224,90,40,.28); }

/* Page transitions */
.lp-app-main { animation: pageIn .45s cubic-bezier(.16,1,.3,1); }
@keyframes pageIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* Skeleton loader */
.lp-skeleton {
  background: linear-gradient(90deg, var(--lp-surface-2) 0%, var(--lp-surface-hover) 50%, var(--lp-surface-2) 100%);
  background-size: 200% 100%;
  animation: lp-skel 1.4s ease-in-out infinite;
  border-radius: 8px;
}
@keyframes lp-skel { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.lp-skeleton-row { height: 16px; margin: 8px 0; }
.lp-skeleton-row.lp-w-50 { width: 50%; }
.lp-skeleton-row.lp-w-75 { width: 75%; }

/* Smooth color transitions على الجذر */
:root { transition: --lp-bg .3s, --lp-surface .3s; }
body { transition: background .3s, color .3s; }
