  /* متغيرات الألوان */
  :root {
      --primary: #6366f1;
      --primary-dark: #4f46e5;
      --secondary: #8b5cf6;
      --accent: #06b6d4;
      --success: #10b981;
      --warning: #f59e0b;
      --danger: #ef4444;
      --light: #f8fafc;
      --dark: #1e293b;
      --gray: #64748b;
      --gray-light: #e2e8f0;
      --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
      --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
      --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
      --radius: 16px;
      --radius-sm: 10px;
      --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }

  * {
      margin: 0;
      padding: 0;
      box-sizing: border-box;
      -webkit-tap-highlight-color: transparent;
  }

  body {
      font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Cairo', sans-serif;
      background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
      color: var(--dark);
      line-height: 1.6;
      min-height: 100vh;
      padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  }

  .app-container {
      min-height: 100vh;
      display: flex;
      flex-direction: column;
      background: rgba(255, 255, 255, 0.95);
      backdrop-filter: blur(10px);
  }

  /* شريط الحالة العلوي */
  .status-bar {
      height: 44px;
      padding: 0 16px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      background: transparent;
      color: var(--dark);
      font-size: 14px;
  }

  .status-time {
      font-weight: 600;
  }

  .status-icons {
      display: flex;
      align-items: center;
      gap: 8px;
  }

  /* بطاقة المستخدم العائمة */
  .user-floating-card {
      margin: 16px;
      background: white;
      border-radius: var(--radius);
      padding: 20px;
      box-shadow: var(--shadow-lg);
      position: relative;
      overflow: hidden;
      border: 1px solid rgba(255, 255, 255, 0.2);
  }

  .user-floating-card::before {
      content: '';
      position: absolute;
      top: 0;
      right: 0;
      width: 100%;
      height: 4px;
      background: linear-gradient(to left, var(--primary), var(--secondary));
  }

  .user-info {
      display: flex;
      align-items: center;
      gap: 16px;
  }

  .user-avatar {
      width: 60px;
      height: 60px;
      border-radius: 50%;
      background: linear-gradient(135deg, var(--primary), var(--secondary));
      color: white;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 24px;
      font-weight: 600;
      box-shadow: var(--shadow-md);
  }

  .user-details {
      flex: 1;
  }

  .user-name {
      font-size: 18px;
      font-weight: 700;
      color: var(--dark);
      margin-bottom: 4px;
  }

  .user-role {
      font-size: 14px;
      color: var(--gray);
      display: flex;
      align-items: center;
      gap: 6px;
  }

  .user-role i {
      color: var(--primary);
  }

  /* بطاقات التقارير */
  .reports-grid {
      padding: 0 16px 16px;
      display: grid;
      grid-template-columns: repeat(2, minmax(300px, 1fr));
      gap: 16px;
      /* margin-bottom: 100px; */
      /* max-height: 100vh; */
      overflow: auto;
      max-height: 80vh;
  }

  .report-meta {
      display: flex;
      flex-direction: column;
      align-items: flex-end;
      gap: 5px;
  }

  .report-card {
      background: white;
      border-radius: var(--radius);
      padding: 20px;
      box-shadow: var(--shadow-md);
      transition: var(--transition);
      border: 1px solid var(--gray-light);
      cursor: pointer;
      position: relative;
      overflow: hidden;
  }

  .report-card:hover {
      transform: translateY(-4px);
      box-shadow: var(--shadow-lg);
  }

  .report-card::after {
      content: '';
      position: absolute;
      top: 0;
      right: 0;
      width: 4px;
      height: 100%;
      background: linear-gradient(to bottom, var(--primary), var(--accent));
      border-radius: 0 var(--radius) var(--radius) 0;
  }

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

  .report-icon {
      width: 48px;
      height: 48px;
      border-radius: 12px;
      background: linear-gradient(135deg, var(--primary), var(--secondary));
      color: white;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 20px;
  }

  .report-meta {
      text-align: left;
  }

  .report-date {
      font-size: 12px;
      color: var(--gray);
      display: flex;
      align-items: center;
      gap: 4px;
  }

  .report-title {
      font-size: 16px;
      font-weight: 600;
      color: var(--dark);
      margin-bottom: 8px;
  }

  .report-description {
      font-size: 14px;
      color: var(--gray);
      margin-bottom: 16px;
      line-height: 1.5;
  }

  .report-stats {
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding-top: 16px;
      border-top: 1px solid var(--gray-light);
  }

  .stat-item {
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 4px;
  }

  .stat-value {
      font-size: 20px;
      font-weight: 700;
      color: var(--dark);
  }

  .stat-label {
      font-size: 12px;
      color: var(--gray);
  }

  .status-badge {
      padding: 4px 12px;
      border-radius: 20px;
      font-size: 12px;
      font-weight: 600;
  }

  .status-completed {
      background: rgba(16, 185, 129, 0.1);
      color: var(--success);
  }

  .status-pending {
      background: rgba(245, 158, 11, 0.1);
      color: var(--warning);
  }

  .status-in-progress {
      background: rgba(6, 182, 212, 0.1);
      color: var(--accent);
  }

  /* شريط التنقل السفلي */
  .bottom-nav {
      position: fixed;
      bottom: 0;
      left: 0;
      right: 0;
      background: white;
      padding: 12px 24px;
      display: flex;
      justify-content: space-around;
      align-items: center;
      box-shadow: 0 -2px 20px rgba(0, 0, 0, 0.1);
      border-radius: var(--radius) var(--radius) 0 0;
      z-index: 1000;
      height: 80px;
  }

  .nav-item {
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 6px;
      text-decoration: none;
      color: var(--gray);
      transition: var(--transition);
      position: relative;
      padding: 8px;
      border-radius: var(--radius-sm);
  }

  .nav-item.active {
      color: var(--primary);
  }

  .nav-item:hover {
      background: rgba(99, 102, 241, 0.05);
  }

  .nav-icon {
      font-size: 20px;
      width: 24px;
      height: 24px;
      display: flex;
      align-items: center;
      justify-content: center;
  }

  .nav-label {
      font-size: 12px;
      font-weight: 500;
  }

  .nav-item.active .nav-icon {
      transform: translateY(-2px);
  }

  .nav-item.active::after {
      content: '';
      position: absolute;
      top: -4px;
      width: 4px;
      height: 4px;
      background: var(--primary);
      border-radius: 50%;
  }

  /* قائمة الإجراءات العائمة */
  .fab-menu {
      position: fixed;
      bottom: 100px;
      right: 24px;
      z-index: 999;
  }

  .fab-main {
      width: 56px;
      height: 56px;
      border-radius: 50%;
      background: linear-gradient(135deg, var(--primary), var(--secondary));
      color: white;
      border: none;
      box-shadow: var(--shadow-lg);
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 20px;
      transition: var(--transition);
  }

  .fab-main:hover {
      transform: scale(1.1);
      box-shadow: 0 10px 25px rgba(99, 102, 241, 0.3);
  }

  .fab-items {
      position: absolute;
      bottom: 70px;
      right: 0;
      display: flex;
      flex-direction: column;
      gap: 12px;
      opacity: 0;
      transform: translateY(20px);
      transition: var(--transition);
      pointer-events: none;
  }

  .fab-menu.open .fab-items {
      opacity: 1;
      transform: translateY(0);
      pointer-events: all;
  }

  .fab-item {
      width: 44px;
      height: 44px;
      border-radius: 50%;
      background: white;
      color: var(--dark);
      border: none;
      box-shadow: var(--shadow-md);
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 18px;
      transition: var(--transition);
  }

  .fab-item:hover {
      background: var(--primary);
      color: white;
      transform: scale(1.1);
  }

  /* صفحة التفاصيل */
  .detail-page {
      position: fixed;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      background: white;
      z-index: 2000;
      transform: translateX(100%);
      transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
      overflow-y: auto;
      padding-top: 44px;
  }

  .detail-page.active {
      transform: translateX(0);
  }

  .detail-header {
      padding: 20px;
      background: linear-gradient(135deg, var(--primary), var(--secondary));
      color: white;
      position: sticky;
      top: 0;
      z-index: 100;
  }

  .detail-back {
      background: none;
      border: none;
      color: white;
      font-size: 18px;
      cursor: pointer;
      margin-bottom: 20px;
      display: flex;
      align-items: center;
      gap: 8px;
  }

  .detail-title {
      font-size: 24px;
      font-weight: 700;
      margin-bottom: 8px;
  }

  .detail-content {
      padding: 20px;
  }

  /* رسومات المعلومات */
  .stats-cards {
      display: grid;
      grid-template-columns: repeat(2, 1fr);
      gap: 12px;
      margin: 20px 16px;
  }

  .stat-card {
      background: white;
      border-radius: var(--radius-sm);
      padding: 16px;
      text-align: center;
      box-shadow: var(--shadow-sm);
      border: 1px solid var(--gray-light);
  }

  .stat-card .value {
      font-size: 24px;
      font-weight: 700;
      color: var(--primary);
      margin-bottom: 4px;
  }

  .stat-card .label {
      font-size: 12px;
      color: var(--gray);
  }

  /* رسوم بيانية مبسطة */
  .chart-container {
      background: white;
      border-radius: var(--radius);
      padding: 20px;
      margin: 16px;
      box-shadow: var(--shadow-md);
  }

  .chart-title {
      font-size: 16px;
      font-weight: 600;
      margin-bottom: 16px;
      color: var(--dark);
  }

  .chart-bar {
      display: flex;
      align-items: center;
      gap: 12px;
      margin-bottom: 12px;
  }

  .chart-label {
      width: 80px;
      font-size: 14px;
      color: var(--gray);
  }

  .chart-progress {
      flex: 1;
      height: 8px;
      background: var(--gray-light);
      border-radius: 4px;
      overflow: hidden;
  }

  .chart-fill {
      height: 100%;
      background: linear-gradient(to right, var(--primary), var(--accent));
      border-radius: 4px;
      transition: width 1s ease-out;
  }

  /* رسوم متحركة */
  @keyframes fadeIn {
      from {
          opacity: 0;
          transform: translateY(20px);
      }

      to {
          opacity: 1;
          transform: translateY(0);
      }
  }

  @keyframes slideIn {
      from {
          transform: translateX(30px);
          opacity: 0;
      }

      to {
          transform: translateX(0);
          opacity: 1;
      }
  }

  .animate-fade {
      animation: fadeIn 0.6s ease-out;
  }

  .animate-slide {
      animation: slideIn 0.4s ease-out;
  }

  /* تخصيصات للتابلت */
  @media (min-width: 768px) {
      .app-container {
          max-width: 768px;
          margin: 0 auto;
          border-radius: 0;
          box-shadow: 0 0 40px rgba(0, 0, 0, 0.1);
      }

      .status-bar {
          padding: 0 32px;
      }

      .user-floating-card {
          margin: 24px;
      }

      .reports-grid {
          padding: 0 24px 24px;
          grid-template-columns: repeat(2, 1fr);
      }

      .stats-cards {
          grid-template-columns: repeat(4, 1fr);
          margin: 24px;
      }

      .chart-container {
          margin: 24px;
      }

      .bottom-nav {
          max-width: 768px;
          left: 50%;
          transform: translateX(-50%);
          border-radius: var(--radius) var(--radius) 0 0;
      }

      .fab-menu {
          right: calc(50% - 360px);
      }
  }

  @media (min-width: 1024px) {
      .app-container {
          max-width: 1024px;
      }

      .reports-grid {
          grid-template-columns: repeat(3, 1fr);
      }

      .bottom-nav {
          max-width: 1024px;
      }

      .fab-menu {
          right: calc(50% - 488px);
      }
  }

  /* تحسينات للشاشات الصغيرة */
  @media (max-width: 374px) {
      .reports-grid {
          grid-template-columns: 1fr;
      }

      .user-avatar {
          width: 50px;
          height: 50px;
          font-size: 20px;
      }

      .report-card {
          padding: 16px;
      }
  }

  /* تأثيرات خاصة */
  .pulse {
      animation: pulse 2s infinite;
  }

  @keyframes pulse {
      0% {
          box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.4);
      }

      70% {
          box-shadow: 0 0 0 10px rgba(99, 102, 241, 0);
      }

      100% {
          box-shadow: 0 0 0 0 rgba(99, 102, 241, 0);
      }
  }

  .glass-effect {
      background: rgba(255, 255, 255, 0.2);
      backdrop-filter: blur(10px);
      border: 1px solid rgba(255, 255, 255, 0.3);
  }

  /* تأثيرات تحميل */
  .skeleton {
      background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
      background-size: 200% 100%;
      animation: loading 1.5s infinite;
  }

  @keyframes loading {
      0% {
          background-position: 200% 0;
      }

      100% {
          background-position: -200% 0;
      }
  }

  /* Login Page Styles */
  .login-page {
      background: linear-gradient(135deg, #4361ee 0%, #3a0ca3 100%);
      min-height: 100vh;
      display: flex;
      align-items: center;
      justify-content: center;
      padding: 2rem;
  }

  .login-container {
      display: grid;
      grid-template-columns: 1fr 1fr;
      max-width: 1200px;
      width: 100%;
      min-height: 700px;
      background: white;
      border-radius: 20px;
      overflow: hidden;
      box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
  }

  .login-left {
      background: linear-gradient(135deg, #3a0ca3 0%, #4361ee 100%);
      color: white;
      padding: 3rem;
      display: flex;
      flex-direction: column;
      justify-content: space-between;
  }

  .login-brand {
      margin-bottom: 3rem;
  }

  .brand-icon {
      font-size: 2.5rem;
      margin-bottom: 1rem;
      color: rgba(255, 255, 255, 0.9);
  }

  .login-brand h1 {
      font-size: 2.2rem;
      margin-bottom: 0.5rem;
      color: white;
  }

  .brand-tagline {
      color: rgba(255, 255, 255, 0.8);
      font-size: 1rem;
  }

  .login-illustration {
      text-align: center;
      margin: 2rem 0;
  }

  .illustration {
      width: 120px;
      height: 120px;
      background: rgba(255, 255, 255, 0.1);
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      margin: 0 auto 1.5rem;
      font-size: 3rem;
      color: white;
  }

  .login-illustration h3 {
      font-size: 1.5rem;
      margin-bottom: 0.5rem;
  }

  .login-illustration p {
      color: rgba(255, 255, 255, 0.8);
      max-width: 300px;
      margin: 0 auto;
  }

  .login-features {
      display: flex;
      flex-direction: column;
      gap: 1rem;
      margin-top: 2rem;
  }

  .feature {
      display: flex;
      align-items: center;
      gap: 0.75rem;
      color: rgba(255, 255, 255, 0.9);
      padding: 0.75rem;
      background: rgba(255, 255, 255, 0.1);
      border-radius: 8px;
      transition: var(--transition);
  }

  .feature:hover {
      background: rgba(255, 255, 255, 0.15);
      transform: translateX(5px);
  }

  .feature i {
      font-size: 1.2rem;
  }

  .login-right {
      padding: 3rem;
      display: flex;
      flex-direction: column;
      justify-content: center;
  }

  .login-card {
      max-width: 400px;
      margin: 0 auto;
      width: 100%;
  }

  .login-header {
      text-align: center;
      margin-bottom: 2.5rem;
  }

  .login-header h2 {
      font-size: 2rem;
      color: var(--dark);
      margin-bottom: 0.5rem;
  }

  .login-header p {
      color: var(--gray);
  }

  .login-form {
      width: 100%;
  }

  .form-group {
      margin-bottom: 1.5rem;
  }

  .form-group label {
      display: flex;
      align-items: center;
      gap: 0.5rem;
      margin-bottom: 0.5rem;
      color: var(--dark);
      font-weight: 500;
  }

  .form-group input {
      width: 100%;
      padding: 0.75rem 1rem;
      border: 2px solid var(--border);
      border-radius: 8px;
      font-size: 1rem;
      transition: var(--transition);
  }

  .form-group input:focus {
      outline: none;
      border-color: var(--primary);
      box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.1);
  }

  .form-group input.error {
      border-color: var(--danger);
  }

  .input-feedback {
      font-size: 0.85rem;
      margin-top: 0.25rem;
      min-height: 20px;
  }

  .password-input {
      position: relative;
  }

  .password-toggle {
      position: absolute;
      left: 1rem;
      top: 50%;
      transform: translateY(-50%);
      background: none;
      border: none;
      color: var(--gray);
      cursor: pointer;
      font-size: 1rem;
  }

  .password-toggle:hover {
      color: var(--primary);
  }

  .form-options {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-bottom: 1.5rem;
  }

  .checkbox {
      display: flex;
      align-items: center;
      gap: 0.5rem;
      cursor: pointer;
      color: var(--dark);
  }

  .checkbox input {
      width: auto;
  }

  .forgot-password {
      color: var(--primary);
      text-decoration: none;
      font-size: 0.9rem;
      transition: var(--transition);
  }

  .forgot-password:hover {
      color: var(--secondary);
      text-decoration: underline;
  }

  .btn-login {
      width: 100%;
      padding: 0.9rem;
      font-size: 1rem;
      border-radius: 8px;
      margin-bottom: 1.5rem;
  }

  .login-divider {
      display: flex;
      align-items: center;
      margin: 1.5rem 0;
      color: var(--gray);
  }

  .login-divider::before,
  .login-divider::after {
      content: '';
      flex: 1;
      height: 1px;
      background: var(--border);
  }

  .login-divider span {
      padding: 0 1rem;
      font-size: 0.9rem;
  }

  .social-login {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 1rem;
      margin-bottom: 1.5rem;
  }

  .btn-social {
      padding: 0.75rem;
      border: 2px solid var(--border);
      background: white;
      border-radius: 8px;
      cursor: pointer;
      transition: var(--transition);
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 0.5rem;
      font-weight: 500;
  }

  .btn-social.google:hover {
      background: #f8f9fa;
      border-color: #db4437;
      color: #db4437;
  }

  .btn-social.github:hover {
      background: #f8f9fa;
      border-color: #333;
      color: #333;
  }

  .login-footer {
      text-align: center;
      margin-top: 1.5rem;
      padding-top: 1.5rem;
      border-top: 1px solid var(--border);
      color: var(--gray);
  }

  .login-footer a {
      color: var(--primary);
      text-decoration: none;
      font-weight: 500;
  }

  .login-footer a:hover {
      text-decoration: underline;
  }

  .login-notice {
      margin-top: 2rem;
      padding: 1rem;
      background: #f8f9fa;
      border-radius: 8px;
      display: flex;
      align-items: center;
      gap: 0.75rem;
      color: var(--gray);
      font-size: 0.9rem;
  }

  .login-notice i {
      color: var(--warning);
  }

  /* Responsive Design for Login */
  @media (max-width: 992px) {
      .login-container {
          grid-template-columns: 1fr;
          max-width: 500px;
          min-height: auto;
      }

      .login-left {
          display: none;
      }

      .login-right {
          padding: 2rem;
      }
  }

  @media (max-width: 576px) {
      .login-page {
          padding: 1rem;
      }

      .login-right {
          padding: 1.5rem;
      }

      .social-login {
          grid-template-columns: 1fr;
      }

      .form-options {
          flex-direction: column;
          align-items: flex-start;
          gap: 1rem;
      }
  }


  #global-loader {
      position: fixed;
      inset: 0;
      background: rgba(255, 255, 255, 0.75);
      display: none;
      justify-content: center;
      align-items: center;
      z-index: 999999;
  }

  #global-loader .spinner {
      width: 55px;
      height: 55px;
      border: 6px solid #ddd;
      border-top-color: #6c63f2;
      /* Primary color */
      border-radius: 50%;
      animation: spin 0.8s linear infinite;
  }

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