:root {
  --primary: #1691D0;
  --primary-light: #2FA9E0;
  --primary-dark: #15508A;
  --success: #10b981;
  --warning: #f59e0b;
  --error: #ef4444;
  --info: #3b82f6;
  --bg-body: #f1f5f9;
  --bg-card: #ffffff;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --border-color: #e2e8f0;
  --sidebar-width: 280px;
  --header-height: 70px;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.1);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 12px 24px rgba(0,0,0,0.12);
  --transition: 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
  --bg-body: #020617;
  --bg-card: #0f172a;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --border-color: #1e293b;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
  --shadow-lg: 0 12px 24px rgba(0,0,0,0.5);
}

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

html, body {
  width: 100%;
  height: 100%;
}

body {
  font-family: 'Cairo', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background-color: var(--bg-body);
  color: var(--text-main);
  transition: background-color var(--transition), color var(--transition);
  font-size: 16px;
  line-height: 1.6;
  direction: rtl;
}

.admin-wrapper {
  display: flex;
  height: 100vh;
  width: 100%;
  overflow: hidden;
  background-color: var(--bg-body);
}

.sidebar {
  width: var(--sidebar-width);
  background: var(--primary-dark);
  background: linear-gradient(180deg, var(--primary-dark) 0%, #0c2d4d 100%);
  color: white;
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: fixed;
  right: 0;
  top: 0;
  z-index: 1000;
  transition: transform var(--transition), visibility var(--transition);
  box-shadow: var(--shadow-lg);
  will-change: transform;
  transform: translate3d(0, 0, 0);
}

/* Sidebar Overlay Fix */
.sidebar-overlay {
  display: block;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  z-index: 999;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition), visibility var(--transition);
  pointer-events: none;
}

.sidebar-overlay.show {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

[data-toggle-sidebar] * {
  pointer-events: none;
}

@media (max-width: 991px) {
  .sidebar {
    transform: translate3d(100%, 0, 0);
    visibility: hidden;
  }
  .sidebar.active {
    transform: translate3d(0, 0, 0);
    visibility: visible;
  }
  .sidebar-mobile-header {
    display: flex !important;
  }
}

.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  margin-right: var(--sidebar-width);
  width: calc(100% - var(--sidebar-width));
  height: 100vh;
  overflow: hidden;
  transition: margin var(--transition);
}

@media (max-width: 991px) {
  .main-content {
    margin-right: 0;
    width: 100%;
  }
}

.header {
  height: var(--header-height);
  background: var(--bg-card);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-color);
  padding: 0 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.content {
  flex: 1;
  padding: 24px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

@media (max-width: 768px) {
  .content {
    padding: 16px;
  }
}

.content-inner {
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
}

/* Grid & Spacing */
.grid { display: grid; gap: 24px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.grid-5 { 
  grid-template-columns: repeat(5, 1fr); 
  gap: 12px; 
}

@media (max-width: 1024px) {
  .grid-5 { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
}

/* تحسين حجم بطاقات الإحصائيات لتناسب السطر الواحد */
.grid-5 .stat-card {
  padding: 15px 10px;
  gap: 10px;
}

.grid-5 .stat-icon {
  width: 45px;
  height: 45px;
  font-size: 1.2rem;
  border-radius: 12px;
}

.grid-5 .stat-value {
  font-size: 1.4rem;
}

.grid-5 .text-muted {
  font-size: 0.8rem;
  white-space: nowrap;
}

.flex { display: flex; }
.flex-center { align-items: center; }
.flex-column { flex-direction: column; }
.flex-1 { flex: 1; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }

.m-0 { margin: 0; }
.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }

.p-2 { padding: 8px; }
.p-3 { padding: 12px; }
.p-4 { padding: 16px; }

.text-center { text-align: center; }

/* Animations */
@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

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

.animate-up { animation: slideUp 0.4s ease-out forwards; }
.animate-fade { animation: fadeIn 0.4s ease-out forwards; }

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* Glassmorphism */
.glass {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

[data-theme="dark"] .glass {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Buttons & Actions */
.btn-action {
    padding: 8px 16px;
    font-size: 0.85rem;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    border-radius: 10px;
    transition: all var(--transition);
}

.btn-action i {
    font-size: 1rem;
}

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

.content {
  animation: fadeIn 0.5s ease-out;
}


/* Splash Screen */
.splash-screen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: radial-gradient(circle at top right, var(--primary-light), transparent),
              radial-gradient(circle at bottom left, var(--primary-dark), transparent),
              var(--bg-body);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: opacity 0.5s ease, visibility 0.5s;
}

.splash-content {
  text-align: center;
  animation: splashScale 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.splash-logo {
  width: 100px;
  height: 100px;
  background: white;
  border-radius: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  color: var(--primary);
  margin: 0 auto 20px;
  box-shadow: 0 15px 35px rgba(0,0,0,0.2);
  position: relative;
}

.splash-logo::after {
  content: '';
  position: absolute;
  inset: -10px;
  border: 2px solid rgba(255,255,255,0.3);
  border-radius: 30px;
  animation: splashPulse 2s infinite;
}

.splash-logo i {
  animation: barcodeScan 2s infinite ease-in-out;
}

.splash-name {
  font-size: 1.8rem;
  font-weight: 800;
  color: white;
  text-shadow: 0 2px 10px rgba(0,0,0,0.2);
  margin-top: 15px;
}

.splash-hospital {
  font-size: 0.9rem;
  color: rgba(255,255,255,0.8);
  font-weight: 600;
  margin-top: 5px;
}

@keyframes splashScale {
  from { opacity: 0; transform: scale(0.5); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes splashPulse {
  0% { transform: scale(1); opacity: 0.5; }
  70% { transform: scale(1.2); opacity: 0; }
  100% { transform: scale(1); opacity: 0; }
}

@keyframes barcodeScan {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.7; transform: scale(0.9); }
}

.splash-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* Hide splash on desktop if desired, but user asked for mobile/handheld */
@media (min-width: 1025px) {
  .splash-screen {
    display: none;
  }
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-weight: 800;
  margin-bottom: 16px;
  color: var(--text-main);
  line-height: 1.2;
}

h1 { font-size: 2.2rem; }
h2 { font-size: 1.8rem; }
h3 { font-size: 1.4rem; }
h4 { font-size: 1.15rem; }
h5 { font-size: 1rem; }
h6 { font-size: 0.85rem; }

.text-muted { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-error { color: var(--error); }

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

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

.form-control {
  width: 100%;
  padding: 14px 18px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  color: var(--text-main);
  font-family: inherit;
  font-size: 1rem;
  transition: all var(--transition);
  box-shadow: var(--shadow-sm);
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(22, 145, 208, 0.15);
  transform: translateY(-1px);
}

.form-control:disabled {
  background: var(--bg-body);
  opacity: 0.6;
}

/* Buttons */
.btn {
  padding: 12px 24px;
  border: none;
  border-radius: var(--radius-sm);
  font-family: 'Cairo', sans-serif;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition);
  font-size: 0.95rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-decoration: none;
  box-shadow: var(--shadow-sm);
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: white;
}

.btn-primary:hover {
  background: var(--primary-dark);
  box-shadow: 0 8px 20px rgba(22, 145, 208, 0.3);
  transform: translateY(-2px);
}

.btn-success {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
}

.btn-success:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(16, 185, 129, 0.3);
}

.btn-danger {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: white;
}

.btn-danger:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(239, 68, 68, 0.3);
}

.btn-secondary {
  background: var(--bg-body);
  color: var(--text-main);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background: var(--border-color);
}

.btn-sm {
  padding: 8px 16px;
  font-size: 0.85rem;
}

.btn-block {
  width: 100%;
  justify-content: center;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Cards */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition);
  animation: slideUp 0.4s ease-out forwards;
}

.card:hover {
  box-shadow: var(--shadow-md);
}

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

.card-header h4 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--primary);
}

.card-body {
  padding: 24px;
}

.card-footer {
  padding: 20px 24px;
  border-top: 1px solid var(--border-color);
  background: var(--bg-body);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

/* Tables */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

th {
  padding: 18px 20px;
  text-align: right;
  font-weight: 800;
  color: var(--text-muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  background: var(--bg-body);
  border-bottom: 2px solid var(--border-color);
}

td {
  padding: 18px 20px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-main);
  font-weight: 500;
}

tbody tr:last-child td {
  border-bottom: none;
}

tbody tr:hover {
  background: rgba(22, 145, 208, 0.03);
}


/* Badges */
.badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
}

.badge-primary {
  background: rgba(22, 145, 208, 0.1);
  color: var(--primary);
}

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

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

.badge-error {
  background: rgba(239, 68, 68, 0.1);
  color: var(--error);
}

/* Alerts */
.alert {
  padding: 16px;
  border-radius: var(--radius-md);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  animation: slideUp 0.3s ease-out;
}

.alert-success {
  background: rgba(16, 185, 129, 0.1);
  border-left: 4px solid var(--success);
  color: var(--success);
}

.alert-error {
  background: rgba(239, 68, 68, 0.1);
  border-left: 4px solid var(--error);
  color: var(--error);
}

.alert-warning {
  background: rgba(245, 158, 11, 0.1);
  border-left: 4px solid var(--warning);
  color: var(--warning);
}

.alert-info {
  background: rgba(59, 130, 246, 0.1);
  border-left: 4px solid var(--info);
  color: var(--info);
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 2000;
  align-items: center;
  justify-content: center;
}

.modal.show {
  display: flex;
}

.modal-content {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  max-width: 500px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  animation: slideUp 0.3s ease-out;
}

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

.modal-header h4 {
  margin: 0;
}

.modal-body {
  padding: 20px;
}

.modal-footer {
  padding: 20px;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

/* Utilities */
.grid {
  display: grid;
  gap: 24px;
}

.grid-2 {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.grid-3 {
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.col-span-2 {
  grid-column: span 2 / span 2;
}

@media (min-width: 1024px) {
  .grid-3-fixed {
    grid-template-columns: repeat(3, 1fr);
  }
}

.flex {
  display: flex;
}

.flex-center {
  align-items: center;
}

.flex-between {
  justify-content: space-between;
}

.flex-col {
  flex-direction: column;
}

.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }

.m-0 { margin: 0; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }

.p-2 { padding: 8px; }
.p-3 { padding: 12px; }
.p-4 { padding: 16px; }

.mt-auto { margin-top: auto; }
.flex-1 { flex: 1; }

/* Animations */
@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

.animate-up {
  animation: slideUp var(--transition);
}

.animate-fade {
  animation: fadeIn var(--transition);
}

/* Responsive */
@media (max-width: 768px) {
  .content {
    padding: 16px;
  }

  .grid-2, .grid-3 {
    grid-template-columns: 1fr;
  }

  .header {
    padding: 12px 16px;
  }

  h1 { font-size: 1.5rem; }
  h2 { font-size: 1.25rem; }
}

/* Responsive Utility Classes */
.hide-desktop { display: none !important; }
.hide-mobile { display: flex !important; }

@media (max-width: 768px) {
  .hide-desktop { display: flex !important; }
  .hide-mobile { display: none !important; }
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-body);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* الشريط السفلي للجوال الحديث */
.bottom-nav-modern {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    height: 80px;
    display: none;
    flex-wrap: wrap;
    justify-content: space-around;
    align-items: center;
    box-shadow: 0 -15px 50px rgba(0,0,0,0.15);
    border-top: 1px solid rgba(255,255,255,0.4);
    z-index: 1000;
    padding-bottom: max(20px, env(safe-area-inset-bottom));
    padding-top: 12px;
    gap: 8px;
}

[data-theme="dark"] .bottom-nav-modern {
    background: rgba(15, 23, 42, 0.85);
    border-top: 1px solid rgba(255,255,255,0.08);
    box-shadow: 0 -15px 50px rgba(0,0,0,0.4);
}

.nav-link-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 700;
    font-size: 0.75rem;
    padding: 8px 12px;
    border-radius: 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    flex: 1;
    max-width: 75px;
}

.nav-link-item:active {
    transform: scale(0.95);
}

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

.nav-link-item.active .nav-icon {
    background: linear-gradient(135deg, rgba(22, 145, 208, 0.15), rgba(22, 145, 208, 0.05));
    box-shadow: 0 4px 15px rgba(22, 145, 208, 0.2);
    transform: translateY(-4px);
}

.nav-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-label {
    display: none;
}

.nav-link-item:hover .nav-label {
    display: block;
    position: absolute;
    bottom: 100%;
    right: 50%;
    transform: translateX(50%);
    white-space: nowrap;
    background: var(--text-main);
    color: var(--bg-card);
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.7rem;
    font-weight: 700;
    margin-bottom: 8px;
    z-index: 1001;
    pointer-events: none;
    animation: tooltipFadeIn 0.2s ease-out;
}

.nav-link-item:hover .nav-label::after {
    content: '';
    position: absolute;
    top: 100%;
    right: 50%;
    transform: translateX(50%);
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 5px solid var(--text-main);
}

[data-theme="dark"] .nav-link-item:hover .nav-label {
    background: var(--bg-card);
    color: var(--text-main);
}

[data-theme="dark"] .nav-link-item:hover .nav-label::after {
    border-top-color: var(--bg-card);
}

@keyframes tooltipFadeIn {
    from {
        opacity: 0;
        transform: translateX(50%) translateY(4px);
    }
    to {
        opacity: 1;
        transform: translateX(50%) translateY(0);
    }
}

.nav-link-item:not(.active) .nav-icon {
    background: rgba(0,0,0,0.03);
}

[data-theme="dark"] .nav-link-item:not(.active) .nav-icon {
    background: rgba(255,255,255,0.05);
}

.nav-link-item.nav-logout {
    color: #ef4444;
}

.nav-link-item.nav-logout.active {
    color: #ef4444;
}

.nav-link-item.nav-logout .nav-icon {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.nav-link-item.nav-logout.active .nav-icon {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.2), rgba(239, 68, 68, 0.1));
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.15);
}

@media (max-width: 991px) {
    .bottom-nav-modern { 
        display: flex; 
    }
    .main-content { 
        padding-bottom: 110px !important; 
    }
}

/* شاشات صغيرة جداً (iPhone SE - 375px) */
@media (max-width: 480px) {
    .bottom-nav-modern {
        height: 75px;
        padding-bottom: max(16px, env(safe-area-inset-bottom));
        gap: 4px;
    }
    
    .nav-link-item {
        max-width: 68px;
        padding: 6px 8px;
    }
    
    .nav-icon {
        width: 38px;
        height: 38px;
        font-size: 1.1rem;
    }
    
    .nav-label {
        font-size: 0.7rem;
    }
    
    .main-content { 
        padding-bottom: 100px !important; 
    }
}

/* شاشات متوسطة (480px - 768px) */
@media (min-width: 481px) and (max-width: 991px) {
    .bottom-nav-modern {
        height: 80px;
        padding-bottom: max(18px, env(safe-area-inset-bottom));
    }
    
    .nav-link-item {
        max-width: 80px;
    }
    
    .nav-icon {
        width: 42px;
        height: 42px;
        font-size: 1.2rem;
    }
    
    .nav-label {
        font-size: 0.75rem;
    }
}

/* شاشات iPad والأجهزة الكبيرة (768px فأكثر) */
@media (min-width: 768px) and (max-width: 991px) {
    .bottom-nav-modern {
        display: flex;
        height: 85px;
        padding: 12px max(20px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-bottom)) 20px;
    }
    
    .nav-link-item {
        max-width: 100px;
        padding: 10px 16px;
    }
    
    .nav-icon {
        width: 48px;
        height: 48px;
        font-size: 1.4rem;
    }
    
    .nav-label {
        font-size: 0.8rem;
        font-weight: 700;
    }
}

/* Unified Card Header Styles */
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    position: relative;
}

.card-header::after {
    content: '';
    position: absolute;
    right: 0;
    top: 25%;
    height: 50%;
    width: 4px;
    background: var(--primary);
    border-radius: 4px 0 0 4px;
}

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

.header-title i {
    width: 34px;
    height: 34px;
    background: rgba(22, 145, 208, 0.1);
    color: var(--primary);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    transition: all 0.3s;
}

.card:hover .header-title i {
    background: var(--primary);
    color: white;
    transform: rotate(-10deg);
}

.header-title h4 {
    margin: 0;
    font-size: 1rem !important;
    font-weight: 700 !important;
    color: var(--text-main);
    letter-spacing: -0.5px;
}

/* تنسيقات الرسائل المنبثقة الاحترافية (Popup) */
.alert-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10000;
    min-width: 320px;
    max-width: 90%;
    background: var(--bg-card);
    border-radius: 24px;
    display: flex;
    align-items: center;
    padding: 24px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.3);
    border: 1px solid var(--border-color);
    animation: popupIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
    text-align: center;
    flex-direction: column;
    gap: 16px;
    backdrop-filter: blur(10px);
}

@keyframes popupIn {
    from { opacity: 0; transform: translate(-50%, -45%) scale(0.9); }
    to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

.alert-popup.fade-out {
    opacity: 0;
    transform: translate(-50%, -45%) scale(0.9);
    transition: all 0.3s ease;
}

.alert-popup-icon {
    width: 64px;
    height: 64px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin: 0;
    flex-shrink: 0;
}

.alert-popup-success { border-bottom: 4px solid var(--success); }
.alert-popup-success .alert-popup-icon { background: rgba(16, 185, 129, 0.1); color: var(--success); }

.alert-popup-error { border-bottom: 4px solid var(--error); }
.alert-popup-error .alert-popup-icon { background: rgba(239, 68, 68, 0.1); color: var(--error); }

.alert-popup-warning { border-bottom: 4px solid var(--warning); }
.alert-popup-warning .alert-popup-icon { background: rgba(245, 158, 11, 0.1); color: var(--warning); }

.alert-popup-info { border-bottom: 4px solid var(--primary); }
.alert-popup-info .alert-popup-icon { background: rgba(22, 145, 208, 0.1); color: var(--primary); }

.alert-popup-content {
    flex: 1;
    text-align: center;
    padding: 0;
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1.5;
    color: var(--text-main);
}

.alert-popup-close {
    position: absolute;
    top: 12px;
    right: 12px;
    cursor: pointer;
    opacity: 0.5;
    padding: 5px;
    transition: opacity 0.3s;
    color: var(--text-muted);
}
.alert-popup-close:hover { opacity: 1; }

.alert-popup-progress {
    position: absolute;
    bottom: 0;
    right: 0;
    height: 3px;
    background: rgba(0,0,0,0.05);
    width: 100%;
}

.alert-popup-success .alert-popup-progress { background: var(--success); animation: progress 5s linear forwards; }
.alert-popup-error .alert-popup-progress { background: var(--error); animation: progress 5s linear forwards; }
.alert-popup-warning .alert-popup-progress { background: var(--warning); animation: progress 5s linear forwards; }
.alert-popup-info .alert-popup-progress { background: var(--primary); animation: progress 5s linear forwards; }

@keyframes progress {
    from { width: 100%; }
    to { width: 0%; }
}
