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

:root {
  --font-family: 'Cairo', system-ui, -apple-system, sans-serif;
  --bg-main: #0f172a;
  --bg-card: #1e293b;
  --bg-card-hover: #334155;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --purple: #8b5cf6;
  --border-color: #334155;
}

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

body {
  font-family: var(--font-family);
  background-color: var(--bg-main);
  color: var(--text-main);
  direction: rtl;
  min-height: 100vh;
  line-height: 1.6;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: #0f172a;
}
::-webkit-scrollbar-thumb {
  background: #334155;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #475569;
}

/* Container & Layout */
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 1.5rem;
}

/* Glassmorphism Cards */
.card {
  background: rgba(30, 41, 59, 0.85);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 1rem;
  padding: 1.5rem;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3);
  transition: all 0.25s ease-in-out;
}
.card:hover {
  border-color: rgba(59, 130, 246, 0.3);
}

/* Grid System */
.grid { display: grid; gap: 1.5rem; }
.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
@media (min-width: 640px) { .grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1024px) {
  .grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* Typography */
h1 { font-size: 1.875rem; font-weight: 800; color: #ffffff; }
h2 { font-size: 1.5rem; font-weight: 700; color: #ffffff; }
h3 { font-size: 1.25rem; font-weight: 700; color: #f1f5f9; }
p { color: var(--text-muted); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  border-radius: 0.75rem;
  font-family: var(--font-family);
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: all 0.2s ease-in-out;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.btn-primary {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: #ffffff;
}
.btn-primary:hover {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.4);
}
.btn-success {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
}
.btn-success:hover {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}
.btn-warning {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #ffffff;
}
.btn-danger {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: #ffffff;
}
.btn-secondary {
  background: #334155;
  color: #f8fafc;
}
.btn-secondary:hover {
  background: #475569;
}
.btn-sm {
  padding: 0.375rem 0.75rem;
  font-size: 0.85rem;
  border-radius: 0.5rem;
}

/* Forms & Inputs */
.form-group {
  margin-bottom: 1.25rem;
}
.form-label {
  display: block;
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
  color: #e2e8f0;
}
.form-control, .form-select, textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 0.75rem;
  color: #ffffff;
  font-family: var(--font-family);
  font-size: 0.95rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.form-control:focus, .form-select:focus, textarea:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 700;
}
.badge-success { background: rgba(16, 185, 129, 0.2); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.3); }
.badge-warning { background: rgba(245, 158, 11, 0.2); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.3); }
.badge-danger { background: rgba(239, 68, 68, 0.2); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.3); }
.badge-info { background: rgba(59, 130, 246, 0.2); color: #60a5fa; border: 1px solid rgba(59, 130, 246, 0.3); }
.badge-purple { background: rgba(139, 92, 246, 0.2); color: #c084fc; border: 1px solid rgba(139, 92, 246, 0.3); }

/* Tables */
.table-container {
  width: 100%;
  overflow-x: auto;
  border-radius: 1rem;
  border: 1px solid #334155;
}
table {
  width: 100%;
  border-collapse: collapse;
  text-align: right;
}
th {
  background: #1e293b;
  color: #94a3b8;
  font-weight: 700;
  padding: 1rem;
  font-size: 0.85rem;
  border-bottom: 1px solid #334155;
}
td {
  padding: 1rem;
  border-bottom: 1px solid #1e293b;
  color: #e2e8f0;
  font-size: 0.9rem;
}
tr:hover td {
  background: rgba(51, 65, 85, 0.4);
}

/* Navbar */
.navbar {
  background: rgba(10, 16, 35, 0.97);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(59, 130, 246, 0.15);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 24px rgba(0,0,0,0.4);
}
.nav-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 4rem;
  padding: 0 1.25rem;
  max-width: 1380px;
  margin: 0 auto;
  gap: 0.75rem;
}
.nav-logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 900;
  font-size: 1.2rem;
  color: #ffffff;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
}
.nav-logo:hover {
  color: #60a5fa;
}
.nav-logo-icon {
  font-size: 1.6rem;
  line-height: 1;
}

/* Desktop nav links (hidden on mobile) */
.nav-links-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  overflow: hidden;
  flex: 1;
  max-width: 750px; /* Limit width on laptop so it doesn't collide with user info */
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  list-style: none;
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
  width: 100%;
  scroll-behavior: smooth;
}
.nav-links::-webkit-scrollbar { display: none; }

.nav-scroll-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(59, 130, 246, 0.3);
  color: #60a5fa;
  border-radius: 50%;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 5;
  transition: all 0.2s;
  font-size: 0.7rem;
  box-shadow: 0 2px 6px rgba(0,0,0,0.5);
}
.nav-scroll-btn:hover {
  background: #3b82f6;
  color: #fff;
  border-color: #3b82f6;
}
.nav-scroll-left {
  left: 2px;
}
.nav-scroll-right {
  right: 2px;
}
.nav-link {
  color: #94a3b8;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.82rem;
  transition: color 0.2s, background 0.2s;
  padding: 0.45rem 0.65rem;
  border-radius: 0.5rem;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}
.nav-link:hover {
  color: #ffffff;
  background: rgba(59, 130, 246, 0.12);
}
.nav-link.active {
  color: #60a5fa;
  background: rgba(59, 130, 246, 0.18);
  border-bottom: 2px solid #3b82f6;
}

/* Right-side nav actions */
.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}
.nav-user {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.nav-username {
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
}
a.nav-username:hover {
  color: #93c5fd;
  text-decoration: underline;
}

/* Hamburger button (mobile only) */
.nav-hamburger {
  display: none;
  background: none;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 0.5rem;
  color: #94a3b8;
  font-size: 1.4rem;
  cursor: pointer;
  padding: 0.3rem 0.55rem;
  line-height: 1;
  transition: background 0.2s, color 0.2s;
  flex-shrink: 0;
}
.nav-hamburger:hover {
  background: rgba(255,255,255,0.1);
  color: #fff;
}

/* Mobile Drawer Overlay */
.nav-drawer-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  z-index: 200;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.nav-drawer-overlay.open {
  opacity: 1;
}

/* Mobile Drawer Panel */
.nav-drawer {
  position: fixed;
  top: 0;
  right: -100%;
  width: min(310px, 85vw);
  height: 100%;
  background: rgba(10, 16, 35, 0.99);
  border-left: 1px solid rgba(59, 130, 246, 0.2);
  z-index: 300;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  transition: right 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: -8px 0 40px rgba(0,0,0,0.6);
}
.nav-drawer.open {
  right: 0;
}
.nav-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  flex-shrink: 0;
}
.nav-drawer-close {
  background: rgba(255,255,255,0.06);
  border: none;
  color: #94a3b8;
  font-size: 1.4rem;
  cursor: pointer;
  padding: 0.25rem 0.6rem;
  border-radius: 0.5rem;
  line-height: 1;
  transition: background 0.2s;
}
.nav-drawer-close:hover {
  background: rgba(239,68,68,0.2);
  color: #f87171;
}
.nav-drawer-user {
  padding: 1rem 1.25rem;
  background: rgba(30, 41, 59, 0.5);
  border-bottom: 1px solid rgba(255,255,255,0.07);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: inherit;
  text-decoration: none;
  transition: background 0.2s;
}
.nav-drawer-user:hover {
  background: rgba(59, 130, 246, 0.12);
}
.nav-drawer-avatar {
  width: 2.5rem;
  height: 2.5rem;
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  font-weight: 900;
  color: #fff;
  flex-shrink: 0;
}
.nav-drawer-links {
  list-style: none;
  padding: 0.75rem 0.5rem;
  flex: 1;
}
.nav-drawer-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  min-height: 44px; /* comfortable touch target on mobile */
  color: #94a3b8;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  border-radius: 0.75rem;
  transition: all 0.2s;
  margin-bottom: 0.2rem;
}
.nav-drawer-link:hover {
  color: #ffffff;
  background: rgba(59, 130, 246, 0.12);
  padding-right: 1.3rem;
}
.nav-drawer-link.active {
  color: #60a5fa;
  background: rgba(59, 130, 246, 0.18);
  border-right: 3px solid #3b82f6;
  padding-right: calc(1rem - 3px);
}
.nav-drawer-divider {
  height: 1px;
  background: rgba(255,255,255,0.07);
  margin: 0.5rem 1rem;
}
.nav-drawer-section-title {
  padding: 0.5rem 1rem 0.25rem;
  font-size: 0.7rem;
  font-weight: 800;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.nav-drawer-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid rgba(255,255,255,0.07);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  flex-shrink: 0;
}
.nav-drawer-sync {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  flex-wrap: wrap;
}
.nav-drawer-footer-actions {
  display: flex;
  gap: 0.5rem;
  align-items: stretch;
}

/* Responsive: hide desktop nav, show hamburger */
@media (max-width: 900px) {
  .nav-top-logout {
    display: none !important;
  }
  /* Mobile top bar stays minimal: logo + hamburger only.
     All the items below live inside the drawer on mobile. */
  .nav-top-sync,
  .nav-top-sync-now,
  .nav-top-offline,
  .nav-top-notif,
  .nav-top-account,
  .nav-top-settings,
  .nav-top-logout,
  .nav-top-user {
    display: none !important;
  }
  .nav-links {
    display: none !important;
  }
  .nav-hamburger {
    display: flex !important;
    align-items: center;
    justify-content: center;
  }
  .nav-drawer-overlay {
    display: block;
    pointer-events: none;
  }
  .nav-drawer-overlay.open {
    pointer-events: all;
  }
  .nav-username {
    display: none;
  }
}
@media (min-width: 901px) {
  .nav-drawer, .nav-drawer-overlay, .nav-hamburger {
    display: none !important;
  }
}

/* Station Badge in navbar */
.nav-station-badge {
  background: rgba(59, 130, 246, 0.12);
  border: 1px solid rgba(59, 130, 246, 0.25);
  border-radius: 0.6rem;
  padding: 0.25rem 0.6rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: #93c5fd;
  white-space: nowrap;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
}
@media (max-width: 600px) {
  .nav-station-badge { display: none; }
  .nav-content {
    padding: 0 0.75rem;
    gap: 0.5rem;
  }
  .nav-logo {
    font-size: 1.05rem;
    gap: 0.45rem;
  }
  .nav-logo-icon {
    font-size: 1.35rem;
  }
  .nav-actions {
    gap: 0.3rem;
  }
}

/* Utility Helpers */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.justify-center { justify-content: center; }
.gap-2 { gap: 0.5rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.gap-8 { gap: 2rem; }
.text-emerald { color: #34d399; }
.text-amber { color: #fbbf24; }
.text-red, .text-danger { color: #f87171; }
.text-blue { color: #60a5fa; }
.text-purple { color: #c084fc; }
.text-slate { color: #94a3b8; }
.text-white { color: #ffffff; }
.text-muted { color: #94a3b8; }
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.font-black { font-weight: 900; }
.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }
.text-lg { font-size: 1.125rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.p-3 { padding: 0.75rem; }
.p-4 { padding: 1rem; }
.py-8 { padding-top: 2rem; padding-bottom: 2rem; }
.block { display: block; }
.hidden { display: none !important; }
.w-full { width: 100%; }
.rounded-xl { border-radius: 1rem; }
.rounded-lg { border-radius: 0.75rem; }
.border-b { border-bottom: 1px solid; }
.border-t { border-top: 1px solid; }
.border-slate-700 { border-color: #334155; }
.border-slate-800 { border-color: #1e293b; }
.space-y-1 > * + * { margin-top: 0.25rem; }
.overflow-hidden { overflow: hidden; }
.text-center { text-align: center; }
.text-right { text-align: right; }
@media (min-width: 768px) {
  .md\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .md\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .md\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
  .md\:col-span-2 { grid-column: span 2; }
}
@media (min-width: 1024px) {
  .lg\:col-span-3 { grid-column: span 3; }
  .lg\:col-span-4 { grid-column: span 4; }
  .lg\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .lg\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .lg\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
}
[x-cloak] { display: none !important; }

/* Dashboard Welcome & Header styling */
.dashboard-header-card {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.9) 0%, rgba(15, 23, 42, 0.95) 100%);
  border: 1px solid rgba(59, 130, 246, 0.2);
  border-radius: 1.25rem;
  padding: 1.5rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  margin-bottom: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}
@media (max-width: 640px) {
  .dashboard-header-card {
    flex-direction: column;
    align-items: stretch;
    padding: 1.25rem;
    text-align: center;
  }
}

/* Mobile Quick Action Buttons Grid */
.quick-actions-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}
.action-card-btn {
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 1rem;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 0.5rem;
  text-decoration: none;
  transition: all 0.2s ease-in-out;
  cursor: pointer;
}
.action-card-btn:hover {
  transform: translateY(-2px);
  background: rgba(59, 130, 246, 0.12);
  border-color: rgba(59, 130, 246, 0.3);
}
.action-icon {
  font-size: 1.75rem;
  line-height: 1;
}
.action-title {
  font-weight: 700;
  font-size: 0.85rem;
  color: #ffffff;
}

/* Custom grid for 2 columns on mobile, 4 on desktop */
.grid-mobile-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}
@media (min-width: 768px) {
  .grid-mobile-2 {
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
  }
}

/* App-style list cards (replaces tables on mobile) */
.mobile-list-card {
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 0.75rem;
  padding: 0.75rem 1rem;
  margin-bottom: 0.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background 0.2s;
}
.mobile-list-card:hover {
  background: rgba(30, 41, 59, 0.8);
  border-color: rgba(59, 130, 246, 0.15);
}

/* Floating Action Button (FAB) */
.fab-btn {
  position: fixed;
  bottom: 2rem;
  left: 2rem;
  width: 3.75rem;
  height: 3.75rem;
  background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
  color: #ffffff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  box-shadow: 0 4px 20px rgba(139, 92, 246, 0.4), 0 0 0 0 rgba(139, 92, 246, 0.7);
  cursor: pointer;
  z-index: 90;
  text-decoration: none;
  border: 1px solid rgba(255, 255, 255, 0.15);
  animation: fab-pulse 2s infinite;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.fab-btn:hover {
  transform: scale(1.1) rotate(5deg);
  box-shadow: 0 6px 24px rgba(139, 92, 246, 0.6);
  background: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
}
.fab-btn:active {
  transform: scale(0.95);
}

@keyframes fab-pulse {
  0% {
    box-shadow: 0 4px 20px rgba(139, 92, 246, 0.4), 0 0 0 0 rgba(139, 92, 246, 0.5);
  }
  70% {
    box-shadow: 0 4px 20px rgba(139, 92, 246, 0.4), 0 0 0 12px rgba(139, 92, 246, 0);
  }
  100% {
    box-shadow: 0 4px 20px rgba(139, 92, 246, 0.4), 0 0 0 0 rgba(139, 92, 246, 0);
  }
}

/* Modals */
.modal {
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

/* Modal overlay: flex centering lives in CSS (not inline style) so Alpine's
   x-show can toggle display without losing the centered layout. */
.modal-backdrop {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Responsive visibility utilities */
@media (max-width: 767px) {
  .hidden-mobile { display: none !important; }
  .visible-mobile { display: block !important; }
  .flex-mobile { display: flex !important; }
}
@media (min-width: 768px) {
  .hidden-desktop { display: none !important; }
  .visible-desktop { display: block !important; }
}


/* Mobile Bottom Tab Bar (App-like Navigation) */
.mobile-tab-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: calc(4.25rem + env(safe-area-inset-bottom, 0px));
  padding: 0 0.5rem env(safe-area-inset-bottom, 0px);
  background: rgba(10, 16, 35, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid rgba(59, 130, 246, 0.2);
  display: flex;
  justify-content: space-around;
  align-items: center;
  z-index: 150;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.4);
}
.tab-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  text-decoration: none;
  font-size: 0.65rem;
  font-weight: 700;
  width: 20%;
  height: 100%;
  gap: 0.25rem;
  transition: color 0.2s, transform 0.15s;
}
.tab-item:active {
  transform: scale(0.92);
}
.tab-item.active {
  color: #60a5fa;
}
.tab-icon {
  font-size: 1.35rem;
  line-height: 1;
}
/* Elevated Center Scan Tab Button */
.tab-scan-btn {
  width: 3.5rem;
  height: 3.5rem;
  background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: #ffffff;
  box-shadow: 0 4px 15px rgba(139, 92, 246, 0.5);
  transform: translateY(-0.8rem);
  border: 2px solid rgba(10, 16, 35, 0.95);
  transition: transform 0.2s, box-shadow 0.2s;
}
.tab-scan-btn:active {
  transform: translateY(-0.8rem) scale(0.92);
  box-shadow: 0 2px 8px rgba(139, 92, 246, 0.7);
}

/* Adjust page content padding so bottom nav doesn't cover content on mobile */
@media (max-width: 900px) {
  body {
    padding-bottom: calc(5.5rem + env(safe-area-inset-bottom, 0px)) !important;
  }
  /* Floating Action Button can be hidden since it's now integrated in the Tab Bar */
  .fab-btn {
    display: none !important;
  }
}
@media (min-width: 901px) {
  .mobile-tab-bar {
    display: none !important;
  }
}

/* Desktop-only layout widening (mobile ≤ 900px is untouched). */
@media (min-width: 1025px) {
  .container {
    max-width: 1536px;
    padding: 2rem;
  }

  /* Let nav links breathe instead of being cramped into a 750px band */
  .nav-links-wrapper {
    max-width: 1000px;
  }

  /* Action cards read as oversized blocks on wide screens — tighten them */
  .quick-actions-grid {
    grid-template-columns: repeat(2, 420px);
    justify-content: center;
    gap: 1.5rem;
  }

  /* Fix admin navbar overlap: Super Admin renders <ul.nav-links> as a direct
     child of the space-between navbar with width:100%, which collides with the
     logo and user actions on wide screens. Constrain it on desktop only. */
  .superadmin-nav .nav-links {
    width: auto;
    flex: 1 1 auto;
    max-width: 1000px;
    overflow-x: auto;
  }
}



