@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;500;600;700;800;900&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=IBM+Plex+Sans+Arabic:wght@400;500;600;700&display=swap');

/* ============================================================
   Design Tokens & System Variables
   ============================================================ */
:root {
  /* Core Brand Colors */
  --primary:         #6366f1;
  --primary-dark:    #4f46e5;
  --primary-hover:   #4338ca;
  --primary-light:   #818cf8;
  --primary-xlight:  #eef2ff;
  --primary-glow:    rgba(99, 102, 241, 0.22);
  --primary-gradient: linear-gradient(135deg, #6366f1 0%, #4338ca 100%);

  /* Accent & Secondary */
  --accent:          #06b6d4;
  --accent-dark:     #0891b2;
  --accent-light:    #67e8f9;
  --accent-gradient: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
  --secondary-color: #1e293b;

  /* Backwards-compatible aliases */
  --primary-color:   var(--primary);
  --accent-color:    var(--accent);
  --bg-card:         #ffffff;
  --border-color:    #e2e8f0;

  /* Semantic Colors */
  --success:         #10b981;
  --success-dark:    #059669;
  --success-light:   #ecfdf5;
  --success-border:  #a7f3d0;
  
  --warning:         #f59e0b;
  --warning-dark:    #d97706;
  --warning-light:   #fffbeb;
  --warning-border:  #fde68a;
  
  --danger:          #f43f5e;
  --danger-dark:     #e11d48;
  --danger-light:    #fff1f2;
  --danger-border:   #fecdd3;
  
  --info:            #3b82f6;
  --info-dark:       #2563eb;
  --info-light:      #eff6ff;
  --info-border:     #bfdbfe;

  /* Backgrounds */
  --bg-body:         #f8fafc;
  --bg-card-hover:   #fafbff;
  --bg-sidebar:      #0f172a;
  --bg-sidebar-alt:  #1e293b;
  --bg-glass:        rgba(255, 255, 255, 0.82);

  /* Typography */
  --text-primary:    #0f172a;
  --text-secondary:  #334155;
  --text-muted:      #64748b;
  --text-faint:      #94a3b8;
  --text-inverse:    #ffffff;

  /* Borders */
  --border:          #e2e8f0;
  --border-focus:    var(--primary);
  --border-card:     rgba(99, 102, 241, 0.08);

  /* Elevation & Shadows */
  --shadow-xs:   0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-sm:   0 2px 8px -2px rgba(15, 23, 42, 0.06), 0 1px 4px -1px rgba(15, 23, 42, 0.03);
  --shadow-md:   0 10px 25px -5px rgba(15, 23, 42, 0.08), 0 4px 10px -2px rgba(15, 23, 42, 0.04);
  --shadow-lg:   0 20px 45px -10px rgba(15, 23, 42, 0.12), 0 8px 16px -4px rgba(15, 23, 42, 0.06);
  --shadow-xl:   0 25px 60px -15px rgba(15, 23, 42, 0.2);
  --shadow-glow: 0 0 0 4px rgba(99, 102, 241, 0.18);

  /* Border Radii */
  --r-xs:   8px;
  --r-sm:   12px;
  --r-md:   16px;
  --r-lg:   24px;
  --r-xl:   32px;
  --r-full: 9999px;

  /* Animation Curves */
  --ease:        all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  --ease-bounce: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Dynamic Spacing */
  --sidebar-w: 265px;
  --navbar-h:  72px;
}

/* ============================================================
   Reset & Base Styles
   ============================================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: 'Cairo', 'IBM Plex Sans Arabic', 'Plus Jakarta Sans', -apple-system, sans-serif;
  background-color: var(--bg-body);
  color: var(--text-primary);
  direction: rtl;
  text-align: right;
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Numbers font handling */
.number-latin, .stat-value, .currency-amount {
  font-family: 'Plus Jakarta Sans', 'Cairo', sans-serif;
}

/* Scrollbar */
::-webkit-scrollbar { width: 7px; height: 7px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: var(--r-full); }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ============================================================
   Layout Shell
   ============================================================ */
.app-container {
  display: flex;
  min-height: 100vh;
  background-color: var(--bg-body);
}

/* ============================================================
   Sidebar
   ============================================================ */
.sidebar {
  width: var(--sidebar-w);
  background: var(--bg-sidebar);
  color: #fff;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; right: 0; bottom: 0;
  z-index: 200;
  transition: var(--ease);
  overflow: hidden;
  border-left: 1px solid rgba(255, 255, 255, 0.06);
}

/* Decorative Ambient Lighting */
.sidebar::before {
  content: '';
  position: absolute;
  top: -100px;
  right: -80px;
  width: 280px;
  height: 280px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.35) 0%, transparent 70%);
  pointer-events: none;
}

.sidebar::after {
  content: '';
  position: absolute;
  bottom: 20px;
  left: -80px;
  width: 240px;
  height: 240px;
  background: radial-gradient(circle, rgba(6, 182, 212, 0.2) 0%, transparent 70%);
  pointer-events: none;
}

.sidebar-header {
  padding: 24px 20px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  position: relative;
  z-index: 1;
}

.logo-icon {
  width: 44px;
  height: 44px;
  background: var(--primary-gradient);
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 800;
  color: #fff;
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.45);
  flex-shrink: 0;
}

.sidebar-brand {
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.3px;
  color: #ffffff;
}

.sidebar-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
  margin: 0 16px;
}

.sidebar-menu {
  list-style: none;
  display: flex;
  flex-direction: column;
  padding: 18px 14px;
  flex-grow: 1;
  overflow-y: auto;
  position: relative;
  z-index: 1;
}

.sidebar-menu li {
  margin-bottom: 5px;
}

.sidebar-section-label {
  font-size: 0.72rem;
  font-weight: 800;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 16px 14px 6px;
  display: block;
}

.sidebar-menu a,
.sidebar-menu button.logout-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 15px;
  color: #94a3b8;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.94rem;
  border-radius: var(--r-sm);
  transition: var(--ease);
  position: relative;
}
.sidebar-menu button.logout-link {
  width: 100%;
  border: 0;
  background: transparent;
  appearance: none;
  text-align: inherit;
  font-family: inherit;
  line-height: inherit;
  cursor: pointer;
}

.sidebar-menu a .nav-icon,
.sidebar-menu button.logout-link .nav-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-xs);
  font-size: 16px;
  flex-shrink: 0;
  transition: var(--ease);
  background: rgba(255, 255, 255, 0.04);
}

.sidebar-menu a:hover {
  color: #f1f5f9;
  background: rgba(255, 255, 255, 0.06);
}

.sidebar-menu a:hover .nav-icon {
  background: rgba(99, 102, 241, 0.25);
  color: #ffffff;
}

.sidebar-menu a.active {
  color: #ffffff;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.32), rgba(99, 102, 241, 0.12));
  border: 1px solid rgba(99, 102, 241, 0.35);
}

.sidebar-menu a.active .nav-icon {
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.5);
}

.sidebar-menu .sidebar-logout-item {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-menu .logout-link:hover {
  background: rgba(244, 63, 94, 0.12);
  color: #fb7185;
}

.sidebar-menu .logout-link:hover .nav-icon {
  background: rgba(244, 63, 94, 0.18);
  color: #fb7185;
}

.sidebar-menu .logout-link:focus-visible {
  outline: 2px solid #fb7185;
  outline-offset: 2px;
}

/* ============================================================
   Main Wrapper & Sticky Navbar
   ============================================================ */
.main-wrapper {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  margin-right: var(--sidebar-w);
  transition: var(--ease);
}

.navbar {
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  height: var(--navbar-h);
  border-bottom: 1px solid rgba(226, 232, 240, 0.8);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 4px 20px -5px rgba(15, 23, 42, 0.03);
}

.navbar-toggle {
  display: none;
  background: #f1f5f9;
  border: 1px solid var(--border);
  font-size: 20px;
  cursor: pointer;
  color: var(--text-secondary);
  width: 42px;
  height: 42px;
  border-radius: var(--r-sm);
  transition: var(--ease);
  align-items: center;
  justify-content: center;
}

.navbar-toggle:hover {
  background: #e2e8f0;
  color: var(--text-primary);
}

.navbar-brand {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 10px;
}

.navbar-brand-dot {
  width: 9px;
  height: 9px;
  background: var(--success);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--success);
  animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.75); }
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 6px 14px;
  border-radius: var(--r-full);
  background: #ffffff;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-xs);
}

.user-avatar {
  width: 40px;
  height: 40px;
  background: var(--primary-gradient);
  color: #fff;
  font-weight: 800;
  font-size: 1rem;
  border-radius: var(--r-full);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 12px rgba(99, 102, 241, 0.4);
}

.user-name {
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--text-primary);
}

.user-role {
  font-size: 0.76rem;
  color: var(--text-muted);
}

.role-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 9px;
  background: var(--primary-xlight);
  color: var(--primary-dark);
  border-radius: var(--r-full);
  font-size: 0.74rem;
  font-weight: 800;
}

/* ============================================================
   Main Content Area & Page Header
   ============================================================ */
.content {
  padding: 32px;
  flex-grow: 1;
}

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

.page-title {
  font-size: 1.7rem;
  font-weight: 900;
  color: var(--text-primary);
  letter-spacing: -0.5px;
  line-height: 1.25;
}

.page-subtitle {
  color: var(--text-muted);
  font-size: 0.92rem;
  margin-top: 5px;
  font-weight: 500;
}

/* ============================================================
   Quick Stats 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);
  border-radius: var(--r-md);
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 18px;
  box-shadow: var(--shadow-sm);
  transition: var(--ease);
  position: relative;
  overflow: hidden;
}

.stat-card::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: transparent;
  transition: var(--ease);
}

.stat-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
  border-color: rgba(99, 102, 241, 0.25);
}

.stat-card:hover::after {
  background: var(--primary-gradient);
}

.stat-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
}

.stat-icon.primary {
  background: var(--primary-xlight);
  color: var(--primary);
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.18);
}
.stat-icon.success {
  background: var(--success-light);
  color: var(--success);
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.18);
}
.stat-icon.warning {
  background: var(--warning-light);
  color: var(--warning);
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.18);
}
.stat-icon.danger {
  background: var(--danger-light);
  color: var(--danger);
  box-shadow: 0 4px 14px rgba(244, 63, 94, 0.18);
}
.stat-icon.info {
  background: var(--info-light);
  color: var(--info);
  box-shadow: 0 4px 14px rgba(59, 130, 246, 0.18);
}

.stat-info h3 {
  font-size: 0.84rem;
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 4px;
}

.stat-value {
  font-size: 1.65rem;
  font-weight: 900;
  color: var(--text-primary);
  letter-spacing: -0.5px;
  line-height: 1.1;
}

.stat-meta {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 5px;
  font-weight: 600;
}

/* ============================================================
   Cards & Panels
   ============================================================ */
.card {
  background: var(--bg-card);
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  padding: 26px;
  margin-bottom: 26px;
  transition: var(--ease);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 22px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.card-body {
  padding-top: 4px;
}

/* ============================================================
   Pagination
   ============================================================ */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 18px 0 6px;
  flex-wrap: wrap;
}

.pagination a,
.pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 38px;
  padding: 0 10px;
  border-radius: var(--r-xs);
  font-size: 0.88rem;
  font-weight: 700;
  text-decoration: none;
  border: 1.5px solid var(--border);
  transition: var(--ease);
  color: var(--text-secondary);
  background: #ffffff;
  user-select: none;
}

.pagination a:hover {
  background: var(--primary-xlight);
  border-color: var(--primary);
  color: var(--primary-dark);
}

.pagination span.active {
  background: var(--primary-gradient);
  border-color: var(--primary);
  color: #ffffff;
  box-shadow: 0 3px 10px rgba(99, 102, 241, 0.35);
  pointer-events: none;
}

.pagination .pagination-ellipsis {
  border: none;
  background: transparent;
  color: var(--text-faint);
  font-weight: 900;
  font-size: 1rem;
  min-width: 28px;
}

.pagination .pagination-prev,
.pagination .pagination-next {
  font-size: 0.82rem;
  font-weight: 800;
  gap: 4px;
  padding: 0 14px;
}


.card-title {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 10px;
}

.card-title-icon {
  width: 32px;
  height: 32px;
  background: var(--primary-xlight);
  border-radius: var(--r-xs);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  color: var(--primary);
}

/* Step Indicator Badges for Form Cards */
.step-number {
  width: 28px;
  height: 28px;
  background: var(--primary-gradient);
  color: #fff;
  border-radius: var(--r-full);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 800;
  margin-left: 8px;
  box-shadow: 0 3px 10px rgba(99, 102, 241, 0.4);
}

/* ============================================================
   Tables Design System
   ============================================================ */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
}

.table {
  width: 100%;
  border-collapse: collapse;
  text-align: right;
  background: #ffffff;
}

.table th {
  padding: 14px 18px;
  background: #f8fafc;
  color: var(--text-muted);
  font-weight: 800;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
}

.table td {
  padding: 14px 18px;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
  font-size: 0.93rem;
  color: var(--text-secondary);
}

.table tbody tr {
  transition: var(--ease);
}

.table tbody tr:hover {
  background: #f8fafc;
}

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

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

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

.form-label .required-star {
  color: var(--danger);
  margin-right: 2px;
}

.form-control, .form-select {
  width: 100%;
  height: 46px;
  padding: 10px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm);
  font-family: inherit;
  font-size: 0.94rem;
  background-color: #ffffff;
  color: var(--text-primary);
  transition: var(--ease);
  outline: none;
}

textarea.form-control {
  height: auto;
  padding: 12px 16px;
  resize: vertical;
}

/* Select Dropdown Custom Chevron */
.form-select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%64748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: left 14px center;
  padding-left: 40px;
}

.form-control:focus, .form-select:focus {
  border-color: var(--primary);
  box-shadow: var(--shadow-glow);
  background-color: #ffffff;
}

.form-control::placeholder {
  color: var(--text-faint);
}

.form-row {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}

.form-row .form-group {
  flex: 1;
  min-width: 220px;
}

/* Input with Icon Container */
.input-icon-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon-wrapper .form-control {
  padding-right: 42px;
}

.input-icon-wrapper .input-icon {
  position: absolute;
  right: 14px;
  color: var(--text-muted);
  pointer-events: none;
}

/* ============================================================
   Buttons Design System
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 22px;
  font-size: 0.92rem;
  font-weight: 700;
  font-family: inherit;
  border-radius: var(--r-sm);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: var(--ease-bounce);
  white-space: nowrap;
  position: relative;
  overflow: hidden;
  user-select: none;
}

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

.btn-primary {
  background: var(--primary-gradient);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.4);
}
.btn-primary:hover {
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.55);
  transform: translateY(-2px);
}

.btn-success {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35);
}
.btn-success:hover {
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.5);
  transform: translateY(-2px);
}

.btn-warning {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.35);
}
.btn-warning:hover {
  box-shadow: 0 6px 20px rgba(245, 158, 11, 0.5);
  transform: translateY(-2px);
}

.btn-danger {
  background: linear-gradient(135deg, #f43f5e 0%, #e11d48 100%);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(244, 63, 94, 0.35);
}
.btn-danger:hover {
  box-shadow: 0 6px 20px rgba(244, 63, 94, 0.5);
  transform: translateY(-2px);
}

.btn-secondary {
  background: linear-gradient(135deg, #64748b 0%, #475569 100%);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(100, 116, 139, 0.25);
}

.btn-outline {
  background: #ffffff;
  border-color: var(--border);
  color: var(--text-secondary);
  box-shadow: var(--shadow-xs);
}
.btn-outline:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: var(--text-primary);
}

.btn-sm {
  padding: 6px 14px;
  font-size: 0.83rem;
  border-radius: var(--r-xs);
}

.btn-lg {
  padding: 14px 30px;
  font-size: 1.02rem;
  border-radius: var(--r-sm);
}

/* Specialized Table Action Buttons (Pill Style) */
.action-btn-group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.btn-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 5px 12px;
  font-size: 0.82rem;
  font-weight: 700;
  border-radius: var(--r-full);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: var(--ease);
  line-height: 1.2;
}

.btn-action-view {
  background: var(--info-light);
  color: var(--info-dark);
  border-color: var(--info-border);
}
.btn-action-view:hover {
  background: #dbeafe;
  transform: translateY(-1px);
}

.btn-action-edit {
  background: var(--warning-light);
  color: #92400e;
  border-color: var(--warning-border);
}
.btn-action-edit:hover {
  background: #fef3c7;
  transform: translateY(-1px);
}

.btn-action-delete {
  background: var(--danger-light);
  color: var(--danger-dark);
  border-color: var(--danger-border);
}
.btn-action-delete:hover {
  background: #ffe4e6;
  transform: translateY(-1px);
}

.btn-action-success {
  background: var(--success-light);
  color: #065f46;
  border-color: var(--success-border);
}
.btn-action-success:hover {
  background: #d1fae5;
  transform: translateY(-1px);
}

/* ============================================================
   Badges System
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 12px;
  border-radius: var(--r-full);
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1.2;
  border: 1px solid transparent;
}

.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
}

.badge-new {
  background: var(--info-light);
  color: #1e40af;
  border-color: var(--info-border);
}
.badge-new .badge-dot { background: #2563eb; }

.badge-prepared {
  background: var(--warning-light);
  color: #b45309;
  border-color: var(--warning-border);
}
.badge-prepared .badge-dot { background: #d97706; }

.badge-delivered {
  background: var(--success-light);
  color: #047857;
  border-color: var(--success-border);
}
.badge-delivered .badge-dot { background: #10b981; }

.badge-cancelled {
  background: var(--danger-light);
  color: #be123c;
  border-color: var(--danger-border);
}
.badge-cancelled .badge-dot { background: #f43f5e; }

.badge-vip {
  background: #fef3c7;
  color: #92400e;
  border-color: #fde68a;
}

.badge-currency {
  background: #f1f5f9;
  color: var(--text-secondary);
  border-color: var(--border);
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 700;
}

/* ============================================================
   Alerts & Notifications
   ============================================================ */
.alert {
  padding: 14px 20px;
  border-radius: var(--r-sm);
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 600;
  font-size: 0.93rem;
  animation: slide-in-down 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) both;
  border-right: 5px solid transparent;
  box-shadow: var(--shadow-xs);
}

@keyframes slide-in-down {
  from { opacity: 0; transform: translateY(-14px); }
  to   { opacity: 1; transform: translateY(0); }
}

.alert-success {
  background: var(--success-light);
  color: #065f46;
  border-right-color: var(--success);
}

.alert-danger {
  background: var(--danger-light);
  color: #9f1239;
  border-right-color: var(--danger);
}

.alert-warning {
  background: var(--warning-light);
  color: #78350f;
  border-right-color: var(--warning);
}

.alert-info {
  background: var(--info-light);
  color: #1e3a8a;
  border-right-color: var(--info);
}

/* ============================================================
   Modal Dialogs
   ============================================================ */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.62);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: var(--ease);
}

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

.modal {
  background: var(--bg-card);
  border-radius: var(--r-lg);
  width: 92%;
  max-width: 560px;
  box-shadow: var(--shadow-xl);
  padding: 32px;
  transform: scale(0.92) translateY(15px);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  border: 1px solid var(--border);
}

.modal-backdrop.show .modal {
  transform: scale(1) translateY(0);
}

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

.modal-title {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal-close {
  background: #f1f5f9;
  border: none;
  width: 36px;
  height: 36px;
  border-radius: var(--r-full);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 20px;
  transition: var(--ease);
}

.modal-close:hover {
  background: var(--danger-light);
  color: var(--danger);
}

/* ============================================================
   Pagination Controls
   ============================================================ */
.pagination {
  display: flex;
  gap: 6px;
  justify-content: center;
  margin-top: 28px;
  flex-wrap: wrap;
}

.pagination a, .pagination span {
  padding: 8px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm);
  text-decoration: none;
  color: var(--text-secondary);
  font-weight: 700;
  font-size: 0.9rem;
  transition: var(--ease);
  min-width: 42px;
  text-align: center;
}

.pagination a:hover {
  background: var(--primary-xlight);
  border-color: var(--primary-light);
  color: var(--primary);
}

.pagination span.active {
  background: var(--primary-gradient);
  color: #ffffff;
  border-color: transparent;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.4);
}

/* ============================================================
   Login Page Design
   ============================================================ */
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: linear-gradient(135deg, #0a0c1a 0%, #111827 50%, #0f172a 100%);
  position: relative;
  overflow: hidden;
}

.login-page::before,
.login-page::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  animation: orb-float 9s ease-in-out infinite;
  pointer-events: none;
}

.login-page::before {
  width: 520px; height: 520px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.28) 0%, transparent 70%);
  top: -160px; right: -160px;
}

.login-page::after {
  width: 440px; height: 440px;
  background: radial-gradient(circle, rgba(6, 182, 212, 0.22) 0%, transparent 70%);
  bottom: -120px; left: -120px;
  animation-delay: -4.5s;
}

@keyframes orb-float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33%       { transform: translate(35px, -25px) scale(1.06); }
  66%       { transform: translate(-25px, 25px) scale(0.94); }
}

.login-card {
  width: 100%;
  max-width: 450px;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--r-xl);
  padding: 48px 42px;
  box-shadow: 0 35px 90px rgba(0,0,0,0.55), 0 0 0 1px rgba(99, 102, 241, 0.15);
  animation: login-appear 0.65s cubic-bezier(0.34, 1.56, 0.64, 1) both;
  position: relative;
  z-index: 1;
}

@keyframes login-appear {
  from { opacity: 0; transform: translateY(40px) scale(0.94); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.login-logo {
  width: 66px;
  height: 66px;
  background: var(--primary-gradient);
  border-radius: var(--r-md);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  font-weight: 900;
  color: #ffffff;
  box-shadow: 0 10px 32px rgba(99, 102, 241, 0.55);
  margin-bottom: 20px;
}

.login-card h1 {
  font-size: 1.7rem;
  font-weight: 900;
  color: #ffffff;
  letter-spacing: -0.5px;
}

.login-card p.subtitle {
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.9rem;
  margin-top: 6px;
}

.login-card .form-label {
  color: rgba(255, 255, 255, 0.85);
}

.login-card .form-control {
  background: rgba(255, 255, 255, 0.08);
  border: 1.5px solid rgba(255, 255, 255, 0.15);
  color: #ffffff;
  border-radius: var(--r-sm);
  padding: 12px 18px;
  font-size: 0.96rem;
}

.login-card .form-control::placeholder {
  color: rgba(255, 255, 255, 0.35);
}

.login-card .form-control:focus {
  border-color: var(--primary-light);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.35);
  background: rgba(255, 255, 255, 0.12);
}

.login-card .btn-primary {
  width: 100%;
  padding: 14px;
  font-size: 1.05rem;
  border-radius: var(--r-sm);
  margin-top: 10px;
}

/* ============================================================
   Public Share Page (Mobile & Staff)
   ============================================================ */
.public-share-wrapper {
  max-width: 650px;
  margin: 0 auto;
  padding: 24px 18px;
}

.public-header {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  color: #ffffff;
  border-radius: var(--r-lg);
  padding: 32px 26px;
  margin-bottom: 24px;
  text-align: center;
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}

.public-header h1 {
  font-size: 1.5rem;
  font-weight: 900;
  position: relative;
}

.public-header p {
  color: #94a3b8;
  font-size: 0.92rem;
  margin-top: 6px;
}

.order-card {
  background: var(--bg-card);
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  padding: 22px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
  transition: var(--ease);
}

.order-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.order-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px dashed var(--border);
  padding-bottom: 14px;
  margin-bottom: 14px;
}

.order-card-id {
  font-weight: 900;
  color: var(--primary);
  font-size: 1.1rem;
}

.phone-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  background: var(--success-light);
  color: #065f46;
  border-radius: var(--r-full);
  text-decoration: none;
  font-weight: 800;
  font-size: 0.88rem;
  transition: var(--ease);
  border: 1px solid var(--success-border);
}

.phone-action-btn:hover {
  background: #a7f3d0;
}

/* Dynamic Rows & Remove Buttons */
.remove-row-btn {
  width: 34px;
  height: 34px;
  border-radius: var(--r-full);
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

/* Product Image Upload & Share Thumbnails */
.product-image-uploader {
  display: flex;
  flex-direction: column;
}

.file-input-sm {
  font-size: 0.8rem !important;
  padding: 4px 8px !important;
  height: 38px !important;
  line-height: 1.2 !important;
  border-radius: var(--r-xs) !important;
}

.product-thumb-wrapper img:hover {
  transform: scale(1.08);
  box-shadow: var(--shadow-md);
}


/* ============================================================
   Empty State Utility
   ============================================================ */
.empty-state {
  text-align: center;
  padding: 60px 24px;
  color: var(--text-muted);
}

.empty-state-icon {
  width: 72px;
  height: 72px;
  background: var(--primary-xlight);
  color: var(--primary);
  border-radius: var(--r-full);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  margin-bottom: 16px;
}

.empty-state h4 {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 6px;
}

/* ============================================================
   Print Media Styles
   ============================================================ */
@media print {
  body { background: #fff; color: #000; }
  .sidebar, .navbar, .btn, .no-print { display: none !important; }
  .main-wrapper { margin-right: 0 !important; }
  .content { padding: 0; }
}

/* ============================================================
   Responsive Utilities
   ============================================================ */
@media (max-width: 768px) {
  .sidebar {
    right: calc(-1 * var(--sidebar-w));
    box-shadow: none;
  }

  .sidebar.open {
    right: 0;
    box-shadow: var(--shadow-xl);
  }

  .main-wrapper {
    margin-right: 0;
  }

  .navbar-toggle {
    display: flex;
  }

  .navbar {
    padding: 0 18px;
  }

  .content {
    padding: 20px 16px;
  }

  .page-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 14px;
  }

  .form-row {
    flex-direction: column;
    gap: 0;
  }

  .form-row .form-group {
    min-width: 100%;
  }
}

@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }
  .login-card {
    padding: 36px 24px;
  }
}

/* ============================================================
   Autocomplete Dropdown for Customer Search
   ============================================================ */
.autocomplete-suggestions {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  left: 0;
  z-index: 1050;
  background: var(--bg-card, #ffffff);
  border: 1.5px solid var(--primary-light, #c7d2fe);
  border-radius: var(--r-md, 12px);
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.18);
  max-height: 240px;
  overflow-y: auto;
  display: none;
  scrollbar-width: thin;
}

.autocomplete-suggestions::-webkit-scrollbar {
  width: 6px;
}

.autocomplete-suggestions::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

.autocomplete-item {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border, #f1f5f9);
  cursor: pointer;
  transition: var(--ease, background 0.15s ease);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.autocomplete-item:last-child {
  border-bottom: none;
}

.autocomplete-item:hover, .autocomplete-item.active {
  background: var(--primary-xlight, rgba(99, 102, 241, 0.08));
}

.autocomplete-item-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.autocomplete-item-name {
  font-weight: 700;
  color: var(--text-primary, #1e293b);
  font-size: 0.92rem;
}

.autocomplete-item-meta {
  font-size: 0.78rem;
  color: var(--text-muted, #64748b);
  display: flex;
  align-items: center;
  gap: 8px;
}

.autocomplete-item-badge {
  font-size: 0.75rem;
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--primary-xlight, rgba(99, 102, 241, 0.1));
  color: var(--primary, #6366f1);
  font-weight: 700;
  white-space: nowrap;
}

