/* ==========================================================
   نظام التصميم الشامل لنظام إدارة المسجد وشؤون الخروج
   Design System & Main Stylesheet (RTL Arabic Modern UI)
   ========================================================== */

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

:root {
  /* Colors - Light Theme */
  --bg-main: #f4f7fa;
  --bg-surface: #ffffff;
  --bg-card: #ffffff;
  --bg-sidebar: #0f172a;
  --text-main: #1e293b;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  --border-color: #e2e8f0;
  
  /* Primary & Accent Palettes (Islamic Green / Teal / Royal Blue) */
  --primary: #0d9488;
  --primary-hover: #0f766e;
  --primary-light: #ccfbf1;
  --primary-dark: #115e59;
  
  --secondary: #3b82f6;
  --secondary-light: #dbeafe;
  
  --accent: #d97706;
  --accent-light: #fef3c7;
  
  --success: #10b981;
  --success-light: #d1fae5;
  
  --danger: #ef4444;
  --danger-light: #fee2e2;
  
  --warning: #f59e0b;
  --warning-light: #fef3c7;
  
  --info: #0284c7;
  --info-light: #e0f2fe;

  /* Shadows & Glassmorphism */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.05);
  --shadow-glow: 0 0 20px rgba(13, 148, 136, 0.18);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-full: 9999px;

  --sidebar-width: 270px;
  --header-height: 70px;
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dark Theme Variables */
[data-theme="dark"] {
  --bg-main: #0b1120;
  --bg-surface: #1e293b;
  --bg-card: #1e293b;
  --bg-sidebar: #070c18;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-light: #64748b;
  --border-color: #334155;
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4);
}

/* Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Cairo', system-ui, -apple-system, sans-serif;
  direction: rtl;
  text-align: right;
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  overflow-x: hidden;
  transition: background-color 0.3s ease, color 0.3s ease;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  color: var(--primary-hover);
}

/* Layout */
.app-container {
  display: flex;
  width: 100%;
  min-height: 100vh;
}

/* Sidebar Styles */
.sidebar {
  width: var(--sidebar-width);
  background: linear-gradient(180deg, #0f172a 0%, #090d16 100%);
  color: #f8fafc;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 100;
  box-shadow: -4px 0 25px rgba(0, 0, 0, 0.15);
  transition: transform 0.3s ease;
}

.sidebar-brand {
  padding: 24px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.02);
}

.sidebar-logo {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--primary) 0%, #059669 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: #fff;
  box-shadow: 0 4px 12px rgba(13, 148, 136, 0.35);
}

.sidebar-title h1 {
  font-size: 1.1rem;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.3px;
  margin: 0;
}

.sidebar-title p {
  font-size: 0.75rem;
  color: #94a3b8;
  margin: 0;
}

.sidebar-menu {
  padding: 20px 12px;
  flex: 1;
  overflow-y: auto;
  list-style: none;
}

.menu-category {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #64748b;
  padding: 12px 14px 6px;
  letter-spacing: 0.5px;
}

.menu-item {
  margin-bottom: 4px;
}

.menu-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  color: #94a3b8;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.95rem;
  transition: var(--transition);
  position: relative;
}

.menu-link .menu-icon {
  font-size: 1.25rem;
  width: 26px;
  text-align: center;
  transition: transform 0.2s ease;
}

.menu-link:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.06);
}

.menu-link:hover .menu-icon {
  transform: scale(1.15);
}

.menu-link.active {
  color: #ffffff;
  background: linear-gradient(90deg, rgba(13, 148, 136, 0.85) 0%, rgba(16, 185, 129, 0.6) 100%);
  box-shadow: 0 4px 15px rgba(13, 148, 136, 0.3);
}

.menu-link.pos-highlight {
  background: linear-gradient(90deg, #d97706 0%, #f59e0b 100%);
  color: #ffffff;
  box-shadow: 0 4px 15px rgba(217, 119, 6, 0.3);
  margin-top: 6px;
}

.menu-link.pos-highlight:hover {
  background: linear-gradient(90deg, #b45309 0%, #d97706 100%);
}

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(0, 0, 0, 0.2);
}

.user-snippet {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  color: #fff;
}

.user-info {
  display: flex;
  flex-direction: column;
}

.user-name {
  font-size: 0.85rem;
  font-weight: 700;
  color: #fff;
}

.user-role {
  font-size: 0.72rem;
  color: #94a3b8;
}

/* Main Content Wrapper */
.main-wrapper {
  flex: 1;
  margin-right: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  width: calc(100% - var(--sidebar-width));
  transition: var(--transition);
}

/* Header / Top Navbar */
.top-header {
  height: var(--header-height);
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 90;
  backdrop-filter: blur(10px);
}

.header-left, .header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.page-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.page-breadcrumb .current-page {
  font-weight: 700;
  color: var(--text-main);
  font-size: 1.1rem;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.theme-toggle-btn, .mobile-menu-btn {
  background: var(--bg-main);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.1rem;
  transition: var(--transition);
}

.theme-toggle-btn:hover, .mobile-menu-btn:hover {
  background: var(--border-color);
}

.mobile-menu-btn {
  display: none;
}

.live-time-badge {
  background: var(--primary-light);
  color: var(--primary-dark);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
}

[data-theme="dark"] .live-time-badge {
  background: rgba(13, 148, 136, 0.2);
  color: #5eead4;
}

/* Page Body */
.page-content {
  padding: 28px;
  flex: 1;
}

/* Dashboard Statistics Cards Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 4px;
  height: 100%;
}

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

.stat-card.primary::before { background: var(--primary); }
.stat-card.secondary::before { background: var(--secondary); }
.stat-card.accent::before { background: var(--accent); }
.stat-card.success::before { background: var(--success); }

.stat-info {
  display: flex;
  flex-direction: column;
}

.stat-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.stat-value {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.1;
}

.stat-hint {
  font-size: 0.78rem;
  color: var(--text-light);
  margin-top: 4px;
}

.stat-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
}

.stat-card.primary .stat-icon {
  background: var(--primary-light);
  color: var(--primary-dark);
}
.stat-card.secondary .stat-icon {
  background: var(--secondary-light);
  color: var(--secondary);
}
.stat-card.accent .stat-icon {
  background: var(--accent-light);
  color: var(--accent);
}
.stat-card.success .stat-icon {
  background: var(--success-light);
  color: var(--success);
}

[data-theme="dark"] .stat-card.primary .stat-icon { background: rgba(13, 148, 136, 0.2); color: #5eead4; }
[data-theme="dark"] .stat-card.secondary .stat-icon { background: rgba(59, 130, 246, 0.2); color: #93c5fd; }
[data-theme="dark"] .stat-card.accent .stat-icon { background: rgba(217, 119, 6, 0.2); color: #fcd34d; }
[data-theme="dark"] .stat-card.success .stat-icon { background: rgba(16, 185, 129, 0.2); color: #6ee7b7; }

/* Dashboard Action Banner */
.action-banner {
  background: linear-gradient(135deg, #0d9488 0%, #1e40af 100%);
  border-radius: var(--radius-lg);
  padding: 28px;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
  box-shadow: 0 10px 25px rgba(13, 148, 136, 0.25);
  position: relative;
  overflow: hidden;
}

.action-banner-content h2 {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 8px;
}

.action-banner-content p {
  font-size: 0.95rem;
  opacity: 0.9;
  max-width: 600px;
}

.action-banner-btn {
  background: #ffffff;
  color: #0d9488;
  font-weight: 800;
  padding: 12px 24px;
  border-radius: var(--radius-md);
  font-size: 1rem;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
  transition: var(--transition);
}

.action-banner-btn:hover {
  background: #f8fafc;
  color: #0f766e;
  transform: scale(1.03);
}

/* Card & Panels */
.panel-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  margin-bottom: 28px;
  overflow: hidden;
}

.panel-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(0, 0, 0, 0.01);
}

.panel-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 10px;
}

.panel-body {
  padding: 24px;
}

/* Tables */
.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.custom-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  text-align: right;
}

.custom-table th {
  background: var(--bg-main);
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 700;
  padding: 14px 18px;
  border-bottom: 2px solid var(--border-color);
  white-space: nowrap;
}

.custom-table td {
  padding: 16px 18px;
  font-size: 0.92rem;
  color: var(--text-main);
  border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
}

.custom-table tr:hover td {
  background: rgba(13, 148, 136, 0.03);
}

/* Badges & Status */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 700;
}

.badge-primary { background: var(--primary-light); color: var(--primary-dark); }
.badge-secondary { background: var(--secondary-light); color: var(--secondary); }
.badge-success { background: var(--success-light); color: var(--success); }
.badge-warning { background: var(--warning-light); color: #b45309; }
.badge-danger { background: var(--danger-light); color: var(--danger); }
.badge-info { background: var(--info-light); color: var(--info); }

[data-theme="dark"] .badge-primary { background: rgba(13, 148, 136, 0.2); color: #5eead4; }
[data-theme="dark"] .badge-secondary { background: rgba(59, 130, 246, 0.2); color: #93c5fd; }
[data-theme="dark"] .badge-success { background: rgba(16, 185, 129, 0.2); color: #6ee7b7; }
[data-theme="dark"] .badge-warning { background: rgba(245, 158, 11, 0.2); color: #fcd34d; }
[data-theme="dark"] .badge-danger { background: rgba(239, 68, 68, 0.2); color: #fca5a5; }

.status-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  font-weight: 600;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 700;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
}

.btn-primary {
  background: var(--primary);
  color: #ffffff;
}
.btn-primary:hover {
  background: var(--primary-hover);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(13, 148, 136, 0.3);
}

.btn-secondary {
  background: var(--secondary);
  color: #ffffff;
}
.btn-secondary:hover {
  background: #2563eb;
  color: #ffffff;
}

.btn-accent {
  background: var(--accent);
  color: #ffffff;
}
.btn-accent:hover {
  background: #b45309;
  color: #ffffff;
}

.btn-danger {
  background: var(--danger);
  color: #ffffff;
}
.btn-danger:hover {
  background: #dc2626;
  color: #ffffff;
}

.btn-outline {
  background: transparent;
  border-color: var(--border-color);
  color: var(--text-main);
}
.btn-outline:hover {
  background: var(--bg-main);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.8rem;
  border-radius: var(--radius-sm);
}

.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: var(--radius-sm);
}

/* Forms */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 8px;
}

.form-control {
  width: 100%;
  padding: 12px 16px;
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--text-main);
  background: var(--bg-surface);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  outline: none;
  transition: var(--transition);
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.15);
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
}

/* Flash Alerts */
.alert {
  padding: 16px 20px;
  border-radius: var(--radius-md);
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

.alert-success { background: var(--success-light); color: #065f46; border: 1px solid #a7f3d0; }
.alert-danger { background: var(--danger-light); color: #991b1b; border: 1px solid #fecaca; }
.alert-warning { background: var(--warning-light); color: #92400e; border: 1px solid #fde68a; }
.alert-info { background: var(--info-light); color: #075985; border: 1px solid #bae6fd; }

[data-theme="dark"] .alert-success { background: rgba(16, 185, 129, 0.15); color: #a7f3d0; border-color: #065f46; }
[data-theme="dark"] .alert-danger { background: rgba(239, 68, 68, 0.15); color: #fecaca; border-color: #991b1b; }

/* Profile View Screen Styles (صفحة بيانات كاملة) */
.profile-hero {
  background: linear-gradient(135deg, var(--primary-dark) 0%, #064e3b 100%);
  border-radius: var(--radius-lg);
  padding: 32px;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 24px;
  margin-bottom: 28px;
  box-shadow: var(--shadow-lg);
}

.profile-avatar-large {
  width: 90px;
  height: 90px;
  border-radius: var(--radius-full);
  background: #ffffff;
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  font-weight: 900;
  box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.profile-details h2 {
  font-size: 1.8rem;
  font-weight: 800;
  margin-bottom: 6px;
}

.profile-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 0.9rem;
  opacity: 0.95;
}

.profile-meta-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Modals */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
}

.modal-backdrop.active {
  opacity: 1;
  visibility: visible;
}

.modal-dialog {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  transform: translateY(20px);
  transition: var(--transition);
}

.modal-backdrop.active .modal-dialog {
  transform: translateY(0);
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-size: 1.2rem;
  font-weight: 800;
}

.modal-close {
  background: transparent;
  border: none;
  font-size: 1.4rem;
  cursor: pointer;
  color: var(--text-muted);
}

.modal-body {
  padding: 24px;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  background: rgba(0, 0, 0, 0.01);
}

/* Printable Official Roster Sheet */
@media print {
  body {
    background: #fff !important;
    color: #000 !important;
  }
  .sidebar, .top-header, .btn, .no-print {
    display: none !important;
  }
  .main-wrapper {
    margin: 0 !important;
    width: 100% !important;
  }
  .page-content {
    padding: 0 !important;
  }
  .print-roster-container {
    border: 2px solid #000;
    padding: 25px;
    border-radius: 8px;
    margin: 10px;
  }
}

/* ==========================================================
   📱 أنماط الهواتف المحمولة وشريط التنقل السفلي (Mobile & PWA UI)
   ========================================================== */

/* شريط التنقل السفلي للهواتف */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 68px;
  background: rgba(15, 23, 42, 0.96);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  z-index: 1000;
  align-items: center;
  justify-content: space-around;
  padding: 0 10px;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.25);
}

.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  text-decoration: none;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: var(--radius-md);
  transition: var(--transition);
  background: transparent;
  border: none;
  cursor: pointer;
  font-family: inherit;
  flex: 1;
}

.bottom-nav-item:hover, .bottom-nav-item.active {
  color: #5eead4;
}

.bottom-nav-icon {
  font-size: 1.35rem;
  margin-bottom: 2px;
  transition: transform 0.2s ease;
}

.bottom-nav-item:active .bottom-nav-icon {
  transform: scale(0.9);
}

/* الزر العائم المركزي لشاشة الخروج POS */
.bottom-nav-fab {
  position: relative;
  top: -14px;
}

.fab-circle {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, #d97706 0%, #f59e0b 100%);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  box-shadow: 0 4px 18px rgba(217, 119, 6, 0.5);
  border: 3px solid #0f172a;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.bottom-nav-fab:active .fab-circle {
  transform: scale(0.92);
}

/* خلفية التعتيم للقائمة المنبثقة */
.sidebar-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  z-index: 99;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
}

.sidebar-backdrop.active {
  opacity: 1;
  visibility: visible;
}

/* شبكات التجاوب العامة (Responsive Grids) */
.dashboard-split-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 24px;
  margin-bottom: 28px;
}

.responsive-two-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.responsive-profile-grid {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 24px;
}

/* Responsive Breakpoints & Mobile Optimization */
@media (max-width: 992px) {
  .sidebar {
    transform: translateX(100%);
    box-shadow: -10px 0 30px rgba(0,0,0,0.5);
  }
  .sidebar.mobile-open {
    transform: translateX(0);
  }
  .main-wrapper {
    margin-right: 0;
    width: 100%;
  }
  .mobile-menu-btn {
    display: flex;
  }
  .mobile-bottom-nav {
    display: flex;
  }
  .page-content {
    padding: 14px 14px 85px 14px; /* هامش سفلي حتى لا يغطي شريط التنقل المحتوى */
  }
  
  /* ترويسة الهاتف النقية والمريحة */
  .top-header {
    padding: 0 14px;
    height: 56px;
  }
  .top-header .btn-accent {
    display: none !important; /* إخفاء زر الخروج العلوي لوجود الزر العائم في الشريط السفلي */
  }
  .page-breadcrumb span:first-child,
  .page-breadcrumb span:nth-child(2) {
    display: none; /* إخفاء كلمة الرئيسية والشرطة لتوفير المساحة */
  }
  .page-breadcrumb .current-page {
    font-size: 1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 190px;
  }
  .live-time-badge {
    display: none; /* إخفاء الساعة في الشاشات الصغيرة لتوفير المساحة */
  }

  /* ترتيب الشبكات عمودياً في الهاتف */
  .dashboard-split-grid,
  .responsive-two-cols,
  .responsive-profile-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 18px;
  }
  .stat-card {
    padding: 14px;
    border-radius: var(--radius-md);
  }
  .stat-label {
    font-size: 0.8rem;
  }
  .stat-value {
    font-size: 1.4rem;
  }
  .stat-hint {
    display: none; /* إخفاء التلميح الصغير لتناسق بطاقات الهاتف */
  }
  .stat-icon {
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
  }
  
  .action-banner {
    flex-direction: column;
    text-align: center;
    gap: 14px;
    padding: 18px;
    margin-bottom: 18px;
  }
  .action-banner-content h2 {
    font-size: 1.25rem;
  }
  .action-banner-content p {
    font-size: 0.85rem;
  }
  .action-banner-btn {
    width: 100%;
    justify-content: center;
  }

  .profile-hero {
    flex-direction: column;
    text-align: center;
    padding: 20px 14px;
    gap: 14px;
  }
  .profile-meta {
    justify-content: center;
    gap: 10px;
  }
  .profile-avatar-large {
    width: 70px;
    height: 70px;
    font-size: 1.8rem;
  }
  
  .form-control {
    font-size: 16px !important; /* منع التكبير التلقائي في iOS Safari */
    padding: 10px 12px;
  }
  .form-row {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .panel-header {
    padding: 14px 16px;
  }
  .panel-title {
    font-size: 1rem;
  }
  .panel-body {
    padding: 16px;
  }
  .app-footer {
    display: none; /* إخفاء التذييل التقليدي على الهاتف للاعتماد على الشريط السفلي */
  }
}

@media (max-width: 576px) {
  .stats-grid {
    grid-template-columns: 1fr 1fr;
  }
}


