/* ==========================================================================
   Modern School Pickup Manager Stylesheet
   ========================================================================== */

/* -------------------------------------------------------------------------- */
/*                                  Variables                                 */
/* -------------------------------------------------------------------------- */

:root {
  --primary-color: #667eea;
  --primary-color-dark: #5a6ed8;
  --secondary-color: #764ba2;
  --accent-color: #f59e0b;
  --success-color: #10b981;
  --danger-color: #ef4444;
  --warning-color: #f59e0b;
  --info-color: #3b82f6;

  --gradient-primary: linear-gradient(
    135deg,
    var(--primary-color) 0%,
    var(--secondary-color) 100%
  );

  /* Light Theme */
  --bg-color: #f8f9fa;
  --surface-color: #ffffff;
  --text-color: #2d3748;
  --text-muted: #6c757d;
  --border-color: #e9ecef;
  --shadow-color: rgba(0, 0, 0, 0.05);

  /* Fonts */
  --font-primary: "Poppins", sans-serif;
  --font-secondary: "Cairo", sans-serif;

  /* Sizing & Spacing */
  --border-radius: 12px;
  --card-padding: 24px;
  --header-height: 80px;
  --sidebar-width: 260px;

  /* Transitions */
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);

  /* PWA Colors */
  --pwa-nav-bg: rgba(255, 255, 255, 0.85);
  --pwa-nav-active: var(--primary-color);
  --pwa-nav-text: var(--text-muted);
}

[data-theme="dark"] {
  --pwa-nav-bg: rgba(45, 55, 72, 0.85);
  --pwa-nav-active: var(--primary-color);
  --pwa-nav-text: var(--text-muted);
}

/* -------------------------------------------------------------------------- */
/*                               Skeleton Loaders                             */
/* -------------------------------------------------------------------------- */

.skeleton {
  background: linear-gradient(
    90deg,
    var(--border-color) 25%,
    var(--bg-color) 50%,
    var(--border-color) 75%
  );
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
  border-radius: 4px;
}

@keyframes skeleton-loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.skeleton-text { height: 1rem; margin-bottom: 0.5rem; width: 100%; }
.skeleton-title { height: 1.5rem; margin-bottom: 1rem; width: 60%; }
.skeleton-avatar { width: 50px; height: 50px; border-radius: 50%; }
.skeleton-card { height: 200px; border-radius: var(--border-radius); }

/* -------------------------------------------------------------------------- */
/*                                Mobile Navigation                           */
/* -------------------------------------------------------------------------- */

.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 65px;
  background: var(--pwa-nav-bg);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  box-shadow: 0 -2px 20px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  justify-content: space-around;
  align-items: center;
  padding-bottom: env(safe-area-inset-bottom);
  border-top: 1px solid var(--border-color);
}

.mobile-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--pwa-nav-text);
  text-decoration: none;
  font-size: 0.7rem;
  font-weight: 500;
  transition: var(--transition);
  flex: 1;
  height: 100%;
  gap: 4px;
}

.mobile-nav-item i {
  font-size: 1.2rem;
  transition: var(--transition);
}

.mobile-nav-item.active {
  color: var(--pwa-nav-active);
}

.mobile-nav-item.active i {
  transform: translateY(-2px);
}

.mobile-only {
  display: none;
}

@media (max-width: 768px) {
  .mobile-only {
    display: flex;
  }
  
  .desktop-only {
    display: none !important;
  }

  .mobile-bottom-nav {
    display: flex;
  }

  /* Sidebar Mobile Transitions removed - replaced with modern implementation at bottom of file */


  /* Main Content Adjustments */
  .main-content {
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding: 20px 15px 100px 15px !important; /* Extra bottom padding for mobile nav */
  }

  /* Mobile Header Styling */
  .app-header.mobile-only {
    position: sticky;
    top: 0;
    height: 60px;
    background: var(--surface-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    z-index: 1000;
    box-shadow: 0 2px 10px var(--shadow-color);
    border-bottom: 1px solid var(--border-color);
  }

  .mobile-sidebar-toggle {
    background: none;
    border: none;
    font-size: 1.2rem;
    color: var(--text-color);
    cursor: pointer;
    padding: 10px;
    margin-left: -10px;
  }

  .mobile-logo {
    font-size: 1.5rem;
  }

  .mobile-action-btn {
    position: relative;
    color: var(--text-color);
    font-size: 1.2rem;
  }

  .mobile-action-btn .badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--danger-color);
    color: white;
    font-size: 0.6rem;
    padding: 2px 5px;
    border-radius: 10px;
    border: 2px solid var(--surface-color);
  }

  /* Responsive Grid Adjustments */
  .student-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)) !important;
    gap: 10px !important;
  }

  .eta-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 15px !important;
  }

  .form-actions {
    flex-direction: column-reverse;
    gap: 10px;
  }

  .form-actions .btn {
    width: 100%;
    justify-content: center;
  }

  /* Card and Spacing Adjustments */
  .form-card {
    padding: 15px !important;
    margin-bottom: 15px !important;
  }

  .card-header {
    margin-bottom: 15px !important;
  }

  .form-title {
    font-size: 1.5rem !important;
  }

  /* Suggestion List Scroll */
  .suggestions-list {
    display: flex;
    overflow-x: auto;
    padding-bottom: 10px;
    gap: 8px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .suggestions-list::-webkit-scrollbar {
    display: none;
  }

  .btn-suggestion {
    white-space: nowrap;
    flex-shrink: 0;
  }

  /* Profile Grid Adjustments */
  .profile-grid {
    grid-template-columns: 1fr !important;
    gap: 15px !important;
  }

  .profile-card {
    padding: 20px !important;
  }
}

/* -------------------------------------------------------------------------- */
/*                                 Dark Theme                                 */
/* -------------------------------------------------------------------------- */

[data-theme="dark"] {
  --bg-color: #1a202c;
  --surface-color: #2d3748;
  --text-color: #e2e8f0;
  --text-muted: #a0aec0;
  --border-color: #4a5568;
  --shadow-color: rgba(0, 0, 0, 0.2);
}

/* -------------------------------------------------------------------------- */
/*                                 Base Styles                                */
/* -------------------------------------------------------------------------- */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-primary);
  background-color: var(--bg-color);
  color: var(--text-color);
  transition: var(--transition);
  line-height: 1.6;
  transition: background-color 0.3s, color 0.3s;
}

[dir="rtl"] body {
  font-family: var(--font-secondary);
}

a {
  color: var(--primary-color);
  text-decoration: none;
  transition: var(--transition);
  margin-bottom: 20px;
  animation: fadeIn 0.6s ease-out;
  animation-delay: 0.2s;
  animation-fill-mode: backwards;
}

a:hover {
  color: var(--primary-color-dark);
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* -------------------------------------------------------------------------- */
/*                                  Home Page                                 */
/* -------------------------------------------------------------------------- */

.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 15px 0;
  transition: var(--transition);
  background: transparent;
}

.navbar.scrolled {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] .navbar.scrolled {
  background: rgba(26, 32, 44, 0.5);
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 30px;
}

.nav-brand .logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.5rem;
  font-weight: 700;
  color: #434444;
}

.nav-menu {
  display: flex;
  gap: 30px;
}

.nav-link {
  color: #4a4a4a;
  font-weight: 500;
  position: relative;
  padding: 5px 0;
}

.nav-link::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: white;
  transition: var(--transition);
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 15px;
}

.theme-toggle,
.lang-toggle {
  background: none;
  border: none;
  color: white;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 5px;
  transition: var(--transition);
}

.theme-toggle:hover,
.lang-toggle:hover {
  transform: scale(1.1);
}

.login-btn {
  background: rgba(255, 255, 255, 0.2);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.3);
  padding: 8px 20px;
  border-radius: 50px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.login-btn:hover {
  background: white;
  color: var(--primary-color);
}

.mobile-menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  z-index: 1001;
}

.hamburger {
  color: white;
  font-size: 1.2rem;
  transition: var(--transition);
}

/* Hero Section */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: var(--gradient-primary);
  color: white;
  position: relative;
  overflow: hidden;
  padding: 100px 20px;
}

.hero-bg-pattern {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: radial-gradient(
    circle at 1px 1px,
    rgba(255, 255, 255, 0.1) 1px,
    transparent 0
  );
  background-size: 20px 20px;
  opacity: 0.5;
}

.hero-container {
  position: relative;
  z-index: 2;
}

.hero-badge {
  display: inline-block;
  background: rgba(255, 255, 255, 0.1);
  padding: 8px 16px;
  border-radius: 50px;
  font-size: 0.9rem;
  margin-bottom: 20px;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.hero-title {
  font-size: 3.5rem;
  font-weight: 700;
  margin-bottom: 20px;
  line-height: 1.2;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.hero-title .highlight {
  color: #fde047;
}

.hero-subtitle {
  font-size: 1.2rem;
  max-width: 700px;
  margin: 0 auto 40px;
  opacity: 0.9;
}

.hero-actions {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-bottom: 50px;
}

.btn {
  padding: 12px 28px;
  border-radius: 50px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  border: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-primary {
  background: white;
  color: var(--primary-color);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
}

.btn-secondary {
  background: transparent;
  color: white;
  border: 2px solid rgba(255, 255, 255, 0.4);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: white;
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 40px;
  margin-top: 60px;
}

.stat-item .stat-number {
  font-size: 2.5rem;
  font-weight: 700;
}

.stat-item .stat-label {
  font-size: 1rem;
  opacity: 0.8;
}

/* Features Section */
.features {
  padding: 100px 20px;
  background: var(--bg-color);
}

.section-header {
  text-align: center;
  margin-bottom: 60px;
}

.section-badge {
  display: inline-block;
  background: var(--primary-color);
  color: white;
  padding: 6px 14px;
  border-radius: 50px;
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 15px;
}

.section-title {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 15px;
  color: var(--text-color);
}

.section-subtitle {
  font-size: 1.1rem;
  max-width: 600px;
  margin: 0 auto;
  color: var(--text-muted);
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 30px;
}

.feature-card {
  background: var(--surface-color);
  padding: 30px;
  border-radius: var(--border-radius);
  box-shadow: 0 8px 25px var(--shadow-color);
  text-align: center;
  transition: var(--transition);
  border: 1px solid var(--border-color);
}

.feature-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 15px 35px var(--shadow-color);
}

.feature-icon {
  font-size: 2.5rem;
  margin-bottom: 20px;
  display: inline-block;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.feature-card h3 {
  font-size: 1.3rem;
  margin-bottom: 10px;
}

/* Dashboard Preview */
.dashboard-preview {
  padding: 100px 20px;
  background: var(--bg-color);
}

.dashboard-tabs {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 40px;
  background: var(--surface-color);
  padding: 8px;
  border-radius: 50px;
  box-shadow: 0 5px 15px var(--shadow-color);
  flex-wrap: wrap;
}

.tab-btn {
  padding: 10px 20px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-weight: 600;
  cursor: pointer;
  border-radius: 50px;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 8px;
}

.tab-btn.active {
  background: var(--primary-color);
  color: white;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.dashboard-panel {
  display: none;
  background: var(--surface-color);
  border-radius: var(--border-radius);
  padding: 40px;
  box-shadow: 0 10px 30px var(--shadow-color);
  border: 1px solid var(--border-color);
  animation: fadeIn 0.5s;
}

.dashboard-panel.active {
  display: block;
}

.dashboard-header {
  text-align: center;
  margin-bottom: 30px;
}

.dashboard-header h3 {
  font-size: 1.8rem;
}

.dashboard-header p {
  color: var(--text-muted);
}

.dashboard-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.dashboard-stats .stat-card {
  background: var(--bg-color);
  padding: 20px;
  border-radius: var(--border-radius);
  text-align: center;
  border: 1px solid var(--border-color);
}

.stat-card .stat-icon {
  font-size: 2rem;
  margin-bottom: 10px;
}

.stat-card .stat-number {
  font-size: 2rem;
  font-weight: 700;
}

.stat-card .stat-label {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.dashboard-actions {
  display: flow;
  justify-content: center;
  gap: 15px;
  flex-wrap: wrap;
}

.action-btn {
  padding: 10px 20px;
  border-radius: 8px;
  background: var(--bg-color);
  border: 1px solid var(--border-color);
  color: var(--text-color);
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.action-btn:hover {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

/* CTA Section */
.cta {
  padding: 100px 20px;
  text-align: center;
  background: var(--gradient-primary);
  color: white;
}

.cta h2 {
  font-size: 2.5rem;
  margin-bottom: 20px;
}

.cta p {
  font-size: 1.2rem;
  margin-bottom: 40px;
  opacity: 0.9;
}

.cta-actions {
  display: flex;
  justify-content: center;
  gap: 20px;
}

/* Footer */
.footer {
  background: #1a202c;
  color: #a0aec0;
  padding: 60px 20px 20px;
}

.footer-content {
  display: grid;
  grid-template-columns: 2fr repeat(4, 1fr);
  gap: 40px;
  margin-bottom: 40px;
}

.footer-brand .logo {
  color: white;
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 15px;
}

.footer-brand p {
  margin-bottom: 20px;
}

.social-links {
  display: flex;
  gap: 15px;
}

.social-link {
  color: #a0aec0;
  font-size: 1.5rem;
}

.social-link:hover {
  color: white;
}

.footer-section h4 {
  color: white;
  margin-bottom: 20px;
}

.footer-section ul {
  list-style: none;
}

.footer-section ul li {
  margin-bottom: 10px;
}

.footer-section ul li a {
  color: #a0aec0;
}

.footer-section ul li a:hover {
  color: white;
}

.footer-bottom {
  border-top: 1px solid #4a5568;
  padding-top: 20px;
  text-align: center;
  font-size: 0.9rem;
}

/* -------------------------------------------------------------------------- */
/*                                 Auth/Login Page                            */
/* -------------------------------------------------------------------------- */

.auth-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
  position: relative;
  overflow: hidden;
}

.auth-background {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: radial-gradient(
    circle at 1px 1px,
    rgba(255, 255, 255, 0.1) 1px,
    transparent 0
  );
  background-size: 20px 20px;
  opacity: 0.5;
}

.floating-shapes {
  display: none;
}

.shape {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  animation: float 6s ease-in-out infinite;
}

.shape-1 {
  width: 80px;
  height: 80px;
  top: 10%;
  left: 10%;
  animation-delay: 0s;
}

.shape-2 {
  width: 60px;
  height: 60px;
  top: 20%;
  right: 10%;
  animation-delay: 2s;
}

.shape-3 {
  width: 100px;
  height: 100px;
  bottom: 10%;
  left: 20%;
  animation-delay: 4s;
}

.shape-4 {
  width: 70px;
  height: 70px;
  bottom: 20%;
  right: 20%;
  animation-delay: 1s;
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-20px);
  }
}

.auth-card {
  background: var(--surface-color);
  padding: 40px;
  border-radius: var(--border-radius);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
  width: 100%;
  max-width: 500px;
  text-align: center;
  position: relative;
  z-index: 2;
}
.auth-card-reg {
  background: var(--surface-color);
  padding: 40px;
  border-radius: var(--border-radius);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
  width: 100%;
  max-width: 700px;
  text-align: center;
  position: relative;
  z-index: 2;
}
.auth-card.auth-register {
  max-width: 680px;
  box-shadow: 0 8px 24px var(--shadow-color);
  border: 1px solid var(--border-color);
}

.auth-container.auth-register {
  background: linear-gradient(180deg, var(--bg-color), var(--surface-color));
}

.auth-register .auth-header {
  margin-bottom: 24px;
}
.auth-register .auth-title {
  font-size: 1.6rem;
}
.auth-register .auth-subtitle {
  font-size: 0.95rem;
}

.auth-register .form-group {
  margin-bottom: 18px;
}
.auth-register .form-input {
  background: #fff;
}
.auth-register .password-toggle {
  color: var(--text-muted);
}

@media (max-width: 768px) {
  .form-row {
    grid-template-columns: 1fr;
  }
}

.glassmorphism-card {
  backdrop-filter: blur(10px);
  background: rgb(255 255 255 / 10%);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 8px;
  margin-top: 8px;
  margin-bottom: 8px;
}

.auth-header {
  margin-bottom: 30px;
}

.auth-logo {
  margin-bottom: 20px;
}

.logo-glow {
  filter: drop-shadow(0 0 10px rgba(102, 126, 234, 0.5));
}

.auth-title {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--text-color);
}

.auth-subtitle {
  color: var(--text-muted);
  margin-bottom: 20px;
}

.auth-body {
  text-align: left;
}

.alert {
  padding: 15px;
  margin-bottom: 20px;
  border-radius: 8px;
  border: 1px solid transparent;
  display: flex;
  align-items: center;
  gap: 10px;
}

.alert-error {
  background-color: #fee2e2;
  border-color: #fecaca;
  color: #991b1b;
}

.alert-success {
  background-color: #d1fae5;
  border-color: #a7f3d0;
  color: #065f46;
}

.alert-icon {
  font-size: 1.2rem;
}

.form-group {
  margin-bottom: 20px;
  position: relative;
}

.input-wrapper {
  position: relative;
}

.form-input {
  width: 100%;
  padding: 16px 15px 16px 45px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: var(--bg-color);
  color: var(--text-color);
  transition: var(--transition);
  font-size: 1rem;
}

.form-input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

.form-input:focus + .form-label,
.form-input:not(:placeholder-shown) + .form-label {
  top: -10px;
  left: 35px;
  font-size: 0.8rem;
  color: var(--primary-color);
}

.form-label {
  position: absolute;
  top: 50%;
  left: 45px;
  transform: translateY(-50%);
  color: var(--text-muted);
  transition: var(--transition);
  pointer-events: none;
  padding: 11px 5px;
}

.floating-label {
  color: #1e40af;
  /* Additional styles if needed */
}

.label-icon {
  position: absolute;
  top: 50%;
  left: 15px;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 1.2rem;
}

.input-focus-line {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--primary-color);
  transition: var(--transition);
  pointer-events: none;
}

.form-input:focus ~ .input-focus-line {
  width: 100%;
}

.input-glow {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: 8px;
  background: rgba(102, 126, 234, 0.1);
  opacity: 0;
  transition: var(--transition);
  pointer-events: none;
}

.form-input:focus ~ .input-glow {
  opacity: 1;
}

.input-particles {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  overflow: hidden;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 15px;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 1.2rem;
  margin-top: 12px !important;
}

.toggle-icon {
  /* Icon styles */
}

.form-options {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  font-size: 0.9rem;
}

.checkbox-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
}

.checkbox-input {
  display: none;
}

.checkmark {
  width: 18px;
  height: 18px;
  border: 2px solid #0e0e0e;
  border-radius: 4px;
  position: relative;
  cursor: pointer;
  transition: var(--transition);
}

.checkbox-input:checked ~ .checkmark {
  background: var(--primary-color);
  border-color: var(--primary-color);
}

.checkbox-input:checked ~ .checkmark::after {
  content: "✓";
  position: absolute;
  top: -2px;
  left: 2px;
  color: white;
  font-size: 12px;
}

.checkbox-text {
  cursor: pointer;
}

.forgot-link {
  color: #1f1296;
  text-decoration: none;
  font-weight: 500;
}

.forgot-link:hover {
  text-decoration: underline;
}

.auth-btn {
  width: 100%;
  padding: 14px;
  font-size: 1rem;
  background: var(--gradient-primary);
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.auth-btn:hover {
  opacity: 0.95;
  box-shadow: 0 6px 15px rgba(102, 126, 234, 0.3);
}

.btn-text {
  font-weight: 600;
}

.btn-icon {
  font-size: 1.2rem;
}

.btn-shimmer {
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent
  );
  transition: var(--transition);
}

.auth-btn:hover .btn-shimmer {
  left: 100%;
}

.btn-particles {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  overflow: hidden;
}

.auth-divider {
  display: flex;
  align-items: center;
  margin: 30px 0;
}

.divider-line {
  flex: 1;
  height: 1px;
  background: var(--border-color);
}

.divider-text {
  padding: 0 15px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.auth-footer {
  text-align: center;
}

.auth-footer-text {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.auth-link {
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.auth-link:hover {
  text-decoration: underline;
}

.link-arrow {
  font-size: 1rem;
}

.auth-form {
  display: block;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.feedback-message {
  margin-top: 8px;
  font-size: 0.9rem;
}

.feedback-message.success {
  color: var(--success-color);
}

.feedback-message.error {
  color: var(--danger-color);
}

.feedback-message.checking {
  color: var(--text-muted);
}

.password-strength {
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.strength-meter {
  flex: 1;
  height: 6px;
  background: var(--border-color);
  border-radius: 8px;
  overflow: hidden;
}

.strength-fill {
  height: 100%;
  width: 0;
  background: var(--danger-color);
  transition: width 0.3s ease, background-color 0.3s ease;
}

.strength-text {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.file-input-wrapper.enhanced {
  position: relative;
  border: 1px dashed var(--border-color);
  border-radius: 8px;
  padding: 16px;
  background: var(--bg-color);
}

.file-input-wrapper.enhanced input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.file-input-label {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-muted);
}

.file-preview {
  margin-top: 10px;
  display: flex;
  gap: 10px;
  align-items: center;
}

.file-preview img {
  max-width: 60px;
  max-height: 60px;
  border-radius: 6px;
  object-fit: cover;
  border: 1px solid var(--border-color);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Animations for Auth Page */
.animate-fade-in-up {
  animation: fadeInUp 0.6s ease-out;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-slide-down {
  animation: slideDown 0.6s ease-out;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-typing {
  animation: fadeInUp 0.4s ease-out;
}

.animate-fade-in-delay {
  animation: fadeIn 0.6s ease-out 0.3s both;
}

.animate-bounce-in {
  animation: fadeInUp 0.4s ease-out;
}

@keyframes bounceIn {
  0% {
    opacity: 0;
    transform: scale(0.3);
  }
  50% {
    opacity: 1;
    transform: scale(1.05);
  }
  70% {
    transform: scale(0.9);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

.animate-bounce-in-delay {
  animation: fadeInUp 0.4s ease-out 0.2s both;
}

.animate-slide-in-left {
  animation: slideInLeft 0.5s ease-out;
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.animate-slide-in-right {
  animation: slideInRight 0.5s ease-out;
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.animate-slide-up-delay-1 {
  animation: slideUp 0.5s ease-out 0.1s both;
}

.animate-slide-up-delay-2 {
  animation: slideUp 0.5s ease-out 0.2s both;
}

.animate-slide-up-delay-3 {
  animation: slideUp 0.5s ease-out 0.3s both;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-pulse {
  animation: fadeIn 0.4s ease-out;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

.animate-float {
  animation: none;
}

.animate-checkmark {
  animation: checkmark 0.3s ease-out;
}

@keyframes checkmark {
  0% {
    transform: scale(0);
  }
  50% {
    transform: scale(1.2);
  }
  100% {
    transform: scale(1);
  }
}

.animate-hover-lift {
  transition: var(--transition);
}

.animate-hover-lift:hover {
  transform: translateY(-3px);
}

.animate-hover-glow {
  transition: var(--transition);
}

.animate-hover-glow:hover {
  box-shadow: 0 0 20px rgba(102, 126, 234, 0.5);
}

.animate-arrow {
  transition: var(--transition);
}

.animate-arrow:hover {
  transform: translateX(5px);
}

/* Responsive for Auth Page */
@media (max-width: 768px) {
  .auth-card {
    padding: 30px 20px;
    max-width: 90%;
  }

  .auth-title {
    font-size: 1.5rem;
  }

  .hero-actions {
    flex-direction: column;
    gap: 15px;
  }

  .auth-btn {
    padding: 12px;
  }
}

/* -------------------------------------------------------------------------- */
/*                                 Login Page                                 */
/* -------------------------------------------------------------------------- */
.login-main {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--gradient-primary);
}

.login-container {
  background: var(--surface-color);
  padding: 40px;
  border-radius: var(--border-radius);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
  width: 100%;
  max-width: 450px;
  text-align: center;
}

.login-header .logo {
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 10px;
}

.login-header h1 {
  font-size: 1.8rem;
  margin-bottom: 10px;
}

.login-header p {
  color: var(--text-muted);
  margin-bottom: 30px;
}

.form-group {
  margin-bottom: 20px;
  text-align: left;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 12px 15px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: var(--bg-color);
  color: var(--text-color);
  transition: var(--transition);
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

.form-options {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  font-size: 0.9rem;
}

.btn-full {
  width: 100%;
  padding: 14px;
  font-size: 1rem;
}

.btn-primary-gradient {
  background: var(--gradient-primary);
  color: white;
  border: none;
}

.btn-primary-gradient:hover {
  opacity: 0.9;
  box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

.register-link {
  margin-top: 20px;
  font-size: 0.9rem;
}

/* -------------------------------------------------------------------------- */
/*                                 Animations                                 */
/* -------------------------------------------------------------------------- */

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.animate-on-scroll {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.animate-on-scroll.animate-in {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

/* -------------------------------------------------------------------------- */
/*                                Responsive                                */
/* -------------------------------------------------------------------------- */

/* Tablet Styles */
@media (max-width: 992px) {
  :root {
    --sidebar-width: 220px;
    --header-height: 70px;
    --card-padding: 20px;
  }

  .container {
    max-width: 100%;
    padding: 0 15px;
  }

  .nav-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--surface-color);
    flex-direction: column;
    padding: 20px;
    box-shadow: 0 10px 20px var(--shadow-color);
  }

  .nav-menu.active {
    display: flex;
  }

  .nav-link {
    color: var(--text-color);
  }

  .mobile-menu-toggle {
    display: block;
  }

  .hero-title {
    font-size: 2.8rem;
  }

  .hero-subtitle {
    font-size: 1.1rem;
  }

  .features-grid {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
  }

  .dashboard-stats {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  }

  .analytics-grid {
    grid-template-columns: 1fr;
  }

  .footer-content {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  }

  /* Redundant sidebar rules removed - consolidated at end of file */
.checkmark

  .main-content {
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding: 20px 15px 100px !important; /* Extra padding for bottom nav */
    width: 100% !important;
  }

  .mobile-nav {
    display: flex;
  }

  .app-header {
    padding: 10px 15px;
    position: sticky;
    top: 0;
    background: var(--surface-color);
    z-index: 999;
    box-shadow: 0 2px 10px var(--shadow-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  .mobile-sidebar-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    cursor: pointer;
  }
}

/* -------------------------------------------------------------------------- */
/*                                     RTL                                    */
/* -------------------------------------------------------------------------- */

[dir="rtl"] .nav-brand .logo {
  flex-direction: row-reverse;
}

[dir="rtl"] .nav-link::after {
  left: auto;
  right: 0;
}

[dir="rtl"] .btn {
  flex-direction: row-reverse;
}

[dir="rtl"] .form-group {
  text-align: right;
}

[dir="rtl"] .form-options {
  flex-direction: row-reverse;
}

[dir="rtl"] .checkbox-container {
  padding-left: 0;
  padding-right: 25px;
}

[dir="rtl"] .checkbox-container .checkmark {
  left: auto;
  right: 0;
}

/* -------------------------------------------------------------------------- */
/*                                  App Layout                                */
/* -------------------------------------------------------------------------- */

/* Dashboard Styles */
.dashboard-hero {
  background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
  color: rgb(51, 51, 51);
  padding: 40px 20px;
  border-radius: var(--border-radius);
  margin-bottom: 30px;
  text-align: center;
}

.hero-content h1 {
  font-size: 2.5rem;
  margin-bottom: 10px;
}

.hero-content p {
  font-size: 1.1rem;
  opacity: 0.9;
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 30px;
  margin-top: 20px;
}

.quick-stat {
  display: flex;
  align-items: center;
  gap: 10px;
}

.quick-stat .stat-icon {
  font-size: 1.5rem;
}

.quick-stat .stat-text {
  font-weight: 600;
}

.dashboard-stats {
  margin-bottom: 30px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
}

.stat-card {
  background: var(--surface-color);
  border-radius: var(--border-radius);
  padding: 25px;
  box-shadow: 0 8px 25px var(--shadow-color);
  border: 1px solid var(--border-color);
  transition: var(--transition);
  text-align: center;
}

.stat-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 35px var(--shadow-color);
}

.stat-card.primary {
  border-left: 4px solid var(--primary-color);
}

.stat-card.success {
  border-left: 4px solid var(--success-color);
}

.stat-card.info {
  border-left: 4px solid var(--info-color);
}

.stat-card.warning {
  border-left: 4px solid var(--warning-color);
}

.stat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

.stat-icon {
  font-size: 2.5rem;
  margin-bottom: 15px;
}

.stat-trend {
  font-size: 0.9rem;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 20px;
}

.stat-trend.positive {
  background: rgba(16, 185, 129, 0.1);
  color: var(--success-color);
}

.stat-trend.neutral {
  background: rgba(156, 163, 175, 0.1);
  color: var(--text-muted);
}

.stat-content {
  margin-bottom: 15px;
}

.stat-number {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 5px;
}

.stat-label {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 5px;
}

.stat-description {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.dashboard-section {
  margin-bottom: 40px;
}

.section-header {
  text-align: center;
  margin-bottom: 30px;
}

.section-title {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--text-color);
}

.section-icon {
  margin-right: 10px;
}

.section-description {
  font-size: 1rem;
  color: var(--text-muted);
}

.actions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
}

.action-card {
  background: var(--surface-color);
  border-radius: var(--border-radius);
  padding: 25px;
  box-shadow: 0 8px 25px var(--shadow-color);
  border: 1px solid var(--border-color);
  transition: var(--transition);
  display: flex;
  align-items: center;
  text-decoration: none;
  color: inherit;
}

.action-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 35px var(--shadow-color);
  border-color: var(--primary-color);
}

.action-card.primary {
  border-left: 4px solid var(--primary-color);
}

.action-card.success {
  border-left: 4px solid var(--success-color);
}

.action-card.info {
  border-left: 4px solid var(--info-color);
}

.action-card.warning {
  border-left: 4px solid var(--warning-color);
}

.action-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

.action-icon {
  font-size: 2.5rem;
  margin-bottom: 15px;
}

.action-badge {
  font-size: 0.8rem;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 20px;
  background: var(--primary-color);
  color: white;
}

.action-badge.urgent {
  background: var(--danger-color);
}

.action-content {
  flex: 1;
  margin-left: 20px;
}

.action-title {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 5px;
}

.action-desc {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.action-arrow {
  font-size: 1.5rem;
  color: var(--primary-color);
  margin-left: 20px;
}

.analytics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 20px;
}

.analytics-card {
  background: var(--surface-color);
  border-radius: var(--border-radius);
  box-shadow: 0 8px 25px var(--shadow-color);
  border: 1px solid var(--border-color);
  overflow: hidden;
}

.card-header {
  padding: 20px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-title {
  font-size: 1.3rem;
  font-weight: 600;
  margin: 0;
  display: flex;
  align-items: center;
}

.card-icon {
  margin-right: 10px;
  font-size: 1.2rem;
}

.card-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.card-body {
  padding: 20px;
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.chart-container {
  position: relative;
  height: 300px;
  margin: 20px 0;
}

.chart-container.large {
  height: 400px;
}

.time-range-select {
  padding: 8px 12px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--bg-color);
  color: var(--text-color);
}

.btn-icon {
  background: none;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  transition: var(--transition);
}

.btn-icon:hover {
  background: var(--bg-color);
}

.btn-link {
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
}

.btn-link:hover {
  text-decoration: underline;
}

.dropdown-content {
  position: absolute;
  top: 100%;
  right: 0;
  background: var(--surface-color);
  border-radius: var(--border-radius);
  box-shadow: 0 10px 25px var(--shadow-color);
  border: 1px solid var(--border-color);
  min-width: 280px;
  z-index: 5000;
  display: none;
  max-height: 60vh;
  overflow: auto;
  backdrop-filter: blur(8px);
}

.dropdown-content.show {
  display: block;
  animation: dropdown-in 0.16s ease;
}

.dropdown-header {
  padding: 15px 20px;
  border-bottom: 1px solid var(--border-color);
  font-weight: 600;
  color: var(--text-color);
}

.dropdown-item {
  display: flex;
  align-items: center;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border-color);
  text-decoration: none;
  color: inherit;
  transition: var(--transition);
}

.dropdown-item:hover {
  background: var(--bg-color);
}

.dropdown-item:last-child {
  border-bottom: none;
}

.item-icon {
  font-size: 1.2rem;
  margin-right: 15px;
  width: 20px;
  text-align: center;
}

.item-content {
  flex: 1;
}

.item-content strong {
  display: block;
  font-weight: 600;
  margin-bottom: 2px;
}

.item-content p {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin: 0;
}

.item-time {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.dropdown-footer {
  padding: 10px 20px;
  border-top: 1px solid var(--border-color);
  text-align: center;
}

.modern-dropdown {
  position: relative;
}
.notifications-dropdown .dropdown-content {
  width: 340px;
}
.messages-dropdown .dropdown-content {
  width: 380px;
}
.dropdown-content::before {
  content: "";
  position: absolute;
  top: -8px;
  right: 16px;
  width: 0;
  height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-bottom: 8px solid var(--surface-color);
}
[dir="rtl"] .modern-dropdown .dropdown-content {
  left: 0;
  right: auto;
}
[dir="rtl"] .dropdown-content::before {
  left: 16px;
  right: auto;
}
.dropdown-items-list {
  max-height: 50vh;
  overflow-y: auto;
}
@keyframes dropdown-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@media (max-width: 768px) {
  .notifications-dropdown .dropdown-content,
  .messages-dropdown .dropdown-content {
    width: calc(100vw - 32px);
    min-width: auto;
    left: 16px;
    right: 16px;
  }
}

.empty-state {
  text-align: center;
  padding: 40px 20px;
}

.empty-icon {
  font-size: 3rem;
  margin-bottom: 15px;
  opacity: 0.5;
}

.empty-title {
  font-size: 1.3rem;
  font-weight: 600;
  margin-bottom: 10px;
  color: var(--text-color);
}

.empty-description {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.approvals-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.approval-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px;
  background: var(--bg-color);
  border-radius: var(--border-radius);
  border: 1px solid var(--border-color);
}

.approval-info {
  flex: 1;
}

.approval-name {
  font-weight: 600;
  margin-bottom: 5px;
}

.approval-school {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 3px;
}

.school-icon {
  margin-right: 5px;
}

.approval-email {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.email-icon {
  margin-right: 5px;
}

.approval-actions {
  display: flex;
  gap: 10px;
}

.btn {
  padding: 8px 16px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  border: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.85rem;
}

.btn-success {
  background: var(--success-color);
  color: white;
}

.btn-success:hover {
  background: #059669;
}

.btn-outline {
  background: transparent;
  color: var(--text-color);
  border: 1px solid var(--border-color);
}

.btn-outline:hover {
  background: var(--bg-color);
}

.btn-icon {
  font-size: 1rem;
}

.full-width {
  grid-column: 1 / -1;
}

.activity-card {
  background: var(--surface-color);
  border-radius: var(--border-radius);
  box-shadow: 0 8px 25px var(--shadow-color);
  border: 1px solid var(--border-color);
  overflow: hidden;
}

.activity-list {
  display: flex;
  flex-direction: column;
}

.activity-item {
  display: flex;
  align-items: center;
  padding: 15px 20px;
  border-bottom: 1px solid var(--border-color);
  transition: var(--transition);
}

.activity-item:hover {
  background: var(--bg-color);
}

.activity-item:last-child {
  border-bottom: none;
}

.activity-icon {
  font-size: 1.5rem;
  margin-right: 15px;
  width: 30px;
  text-align: center;
}

.activity-content {
  flex: 1;
}

.activity-user {
  margin-bottom: 5px;
}

.user-name {
  font-weight: 600;
  margin-right: 10px;
}

.activity-action {
  color: var(--primary-color);
  font-weight: 500;
}

.activity-details {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 5px;
}

.activity-meta {
  display: flex;
  gap: 15px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.time-icon,
.ip-icon {
  margin-right: 5px;
}

.school-header {
  background: var(--surface-color);
  border-radius: var(--border-radius);
  padding: 25px;
  margin-bottom: 30px;
  box-shadow: 0 8px 25px var(--shadow-color);
  border: 1px solid var(--border-color);
}

.school-info {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 20px;
}

.school-logo {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--bg-color);
}

.school-logo-placeholder {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--primary-color);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
}

.school-details {
  flex: 1;
}

.school-name {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 5px;
}

.school-description {
  color: var(--text-muted);
}

.school-usage {
  margin-top: 20px;
}

.usage-bar {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.usage-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.usage-label {
  font-weight: 600;
}

.progress-bar {
  flex: 1;
  height: 8px;
  background: var(--bg-color);
  border-radius: 4px;
  margin: 0 15px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(
    90deg,
    var(--primary-color),
    var(--secondary-color)
  );
  border-radius: 4px;
  transition: width 0.3s ease;
}

.management-links {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.management-link {
  display: flex;
  align-items: center;
  padding: 15px;
  background: var(--bg-color);
  border-radius: var(--border-radius);
  text-decoration: none;
  color: inherit;
  transition: var(--transition);
}

.management-link:hover {
  background: var(--primary-color);
  color: white;
  transform: translateX(5px);
}

.link-icon {
  font-size: 1.5rem;
  margin-right: 15px;
  width: 25px;
  text-align: center;
}

.link-content {
  flex: 1;
}

.link-title {
  font-weight: 600;
  margin-bottom: 2px;
}

.link-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.management-link:hover .link-desc {
  color: rgba(255, 255, 255, 0.8);
}

.pickups-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.pickup-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px;
  background: var(--bg-color);
  border-radius: var(--border-radius);
  border: 1px solid var(--border-color);
}

.pickup-info {
  flex: 1;
}

.student-name {
  font-weight: 600;
  margin-bottom: 5px;
}

.student-icon {
  margin-right: 8px;
}

.parent-name {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.parent-icon {
  margin-right: 8px;
}

.pickup-actions {
  display: flex;
  gap: 10px;
}

.classes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 15px;
}

.class-card {
  display: flex;
  align-items: center;
  padding: 20px;
  background: var(--bg-color);
  border-radius: var(--border-radius);
  border: 1px solid var(--border-color);
  text-decoration: none;
  color: inherit;
  transition: var(--transition);
}

.class-card:hover {
  background: var(--primary-color);
  color: white;
  transform: translateX(5px);
}

.class-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.class-icon {
  font-size: 1.5rem;
}

.class-badge {
  font-size: 0.8rem;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 20px;
  background: var(--success-color);
  color: white;
}

.class-content {
  flex: 1;
  margin-left: 15px;
}

.class-name {
  font-weight: 600;
  margin-bottom: 5px;
}

.class-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.class-card:hover .class-desc {
  color: rgba(255, 255, 255, 0.8);
}

.class-arrow {
  font-size: 1.2rem;
  color: var(--primary-color);
  margin-left: 15px;
}

.class-card:hover .class-arrow {
  color: white;
}

.quick-actions-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.quick-action-item {
  display: flex;
  align-items: center;
  padding: 15px;
  background: var(--bg-color);
  border-radius: var(--border-radius);
  text-decoration: none;
  color: inherit;
  transition: var(--transition);
}

.quick-action-item:hover {
  background: var(--primary-color);
  color: white;
  transform: translateX(5px);
}

.action-icon {
  font-size: 1.5rem;
  margin-right: 15px;
  width: 25px;
  text-align: center;
}

.action-content {
  flex: 1;
}

.action-title {
  font-weight: 600;
  margin-bottom: 2px;
}

.action-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.quick-action-item:hover .action-desc {
  color: rgba(255, 255, 255, 0.8);
}

.status-badge {
  font-size: 0.8rem;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 20px;
  margin-left: 10px;
}

.status-pending {
  background: rgba(245, 158, 11, 0.1);
  color: var(--warning-color);
}

.status-confirmed {
  background: rgba(16, 185, 129, 0.1);
  color: var(--success-color);
}

.status-completed {
  background: rgba(16, 185, 129, 0.1);
  color: var(--success-color);
}

.status-cancelled {
  background: rgba(239, 68, 68, 0.1);
  color: var(--danger-color);
}

.status-unknown {
  background: rgba(156, 163, 175, 0.1);
  color: var(--text-muted);
}

.qr-code-container {
  text-align: center;
}

.qr-code-sm {
  width: 80px;
  height: 80px;
  border-radius: 8px;
  border: 2px solid var(--border-color);
}

.qr-text {
  font-size: 0.8rem;
  font-weight: 600;
  margin-top: 5px;
  word-break: break-all;
}

.mt-1 {
  margin-top: 0.25rem;
}

.expired-notice {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.expired-icon {
  margin-right: 5px;
}

.avatar-small {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
}

.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 10000;
  align-items: center;
  justify-content: center;
}

.modal.show {
  display: flex;
}

.modal-content {
  background: var(--surface-color);
  border-radius: var(--border-radius);
  padding: 30px;
  max-width: 500px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  position: relative;
}

.modal-close {
  position: absolute;
  top: 15px;
  right: 15px;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-muted);
}

.modal-close:hover {
  color: var(--text-color);
}

.animate-fade-in {
  animation: fadeIn 0.5s ease-out;
}

.animate-slide-up {
  animation: slideUp 0.5s ease-out;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.text-center {
  text-align: center;
}

/* Dashboard Dark Theme */
.dashboard-dark-theme {
  background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
  color: #f1f5f9;
  min-height: 100vh;
  padding: 20px;
}

.dashboard-dark-theme .dashboard-stats {
  background: rgba(30, 41, 59, 0.8);
  border-radius: var(--border-radius);
  padding: 30px;
  margin-bottom: 30px;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(148, 163, 184, 0.1);
}

.dashboard-dark-theme .stat-card {
  background: rgba(51, 65, 85, 0.8);
  border: 1px solid rgba(148, 163, 184, 0.2);
  color: #f1f5f9;
}

.dashboard-dark-theme .stat-card .stat-icon {
  color: #60a5fa;
}

.dashboard-dark-theme .stat-card .stat-number {
  color: #f1f5f9;
}

.dashboard-dark-theme .stat-card .stat-label {
  color: #cbd5e1;
}

.dashboard-dark-theme .dashboard-section {
  background: rgba(30, 41, 59, 0.8);
  border-radius: var(--border-radius);
  padding: 30px;
  margin-bottom: 30px;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(148, 163, 184, 0.1);
}

.dashboard-dark-theme .section-title {
  color: #f1f5f9;
}

.dashboard-dark-theme .section-description {
  color: #cbd5e1;
}

.dashboard-dark-theme .action-card {
  background: rgba(51, 65, 85, 0.8);
  border: 1px solid rgba(148, 163, 184, 0.2);
  color: #f1f5f9;
  transition: all 0.3s ease;
}

.dashboard-dark-theme .action-card:hover {
  background: rgba(71, 85, 105, 0.9);
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.dashboard-dark-theme .action-header .action-icon {
  color: #60a5fa;
}

.dashboard-dark-theme .action-title {
  color: #f1f5f9;
}

.dashboard-dark-theme .action-desc {
  color: #cbd5e1;
}

.dashboard-dark-theme .analytics-card {
  background: rgba(51, 65, 85, 0.8);
  border: 1px solid rgba(148, 163, 184, 0.2);
  color: #f1f5f9;
}

.dashboard-dark-theme .card-title {
  color: #f1f5f9;
}

.dashboard-dark-theme .card-title .card-icon {
  color: #60a5fa;
}

.dashboard-dark-theme .activity-card {
  background: rgba(51, 65, 85, 0.8);
  border: 1px solid rgba(148, 163, 184, 0.2);
}

.dashboard-dark-theme .activity-item {
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}

.dashboard-dark-theme .activity-item:last-child {
  border-bottom: none;
}

.dashboard-dark-theme .activity-user .user-name {
  color: #f1f5f9;
}

.dashboard-dark-theme .activity-action {
  color: #60a5fa;
}

.dashboard-dark-theme .activity-details {
  color: #cbd5e1;
}

.dashboard-dark-theme .activity-meta {
  color: #94a3b8;
}

.dashboard-dark-theme .activity-meta .time-icon,
.dashboard-dark-theme .activity-meta .ip-icon {
  color: #64748b;
}

.app-container {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 260px;
  background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
  border-right: 1px solid rgba(102, 126, 234, 0.1);
  box-shadow: 4px 0 25px rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}
.sidebar-nav {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  flex: 1;
  color: rgb(46, 46, 46);
}
.sidebar-nav::-webkit-scrollbar {
  width: 6px;
  background-color: var(--surface-color);
}
.sidebar-nav::-webkit-scrollbar-thumb {
  background-color: var(--border-color);
  border-radius: 10px;
}
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
}
.lang-text {
  font-size: 14px;
  font-weight: 500;
  color: rgb(46, 46, 46);
}
.top-header {
  height: var(--header-height);
  background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--card-padding);
  position: sticky;
  top: 0;
  z-index: 999;
  box-shadow: 2px 5px 5px 2px rgba(0, 0, 0, 0.2);
  color: #0e0e0e;
}

.content {
  padding: var(--card-padding);
  flex: 1;
}

/* Sidebar Styles */
.sidebar-header {
  height: var(--header-height);
  display: flex;
  align-items: center;
  padding: 0 var(--card-padding);
  border-bottom: 1px solid var(--border-color);
}

.sidebar-logo .logo-icon {
  font-size: 2rem;
}

.sidebar-logo .logo-text {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-color);
}

.sidebar-nav {
  flex: 1;
  padding: 20px 0;
}

.nav-group {
  margin-bottom: 20px;
}

.nav-group-header {
  padding: 0 20px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 10px;
}

.sidebar .nav-link {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 12px 20px;
  color: rgb(58, 58, 58);
  font-weight: 500;
  margin: 0 10px;
  border-radius: 8px;
}
.sidebar .nav-link:hover {
  text-shadow: 0 0 10px rgb(157, 179, 201); /* Hover state: full glow */
  box-shadow: 0 0 10px rgb(157, 179, 201);
}
.sidebar .nav-group-title {
  color: rgb(22, 4, 88);
}
.sidebar .nav-group-title:hover {
  text-shadow: 0 0 10px rgba(255, 255, 255, 1); /* Hover state: full glow */
}

.sidebar .nav-link:hover {
  background: var(--bg-color);
  color: var(--text-color);
}

.sidebar .nav-link.active {
  background: var(--primary-color);
  color: rgb(46, 46, 46);
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.sidebar .nav-icon {
  font-size: 1.2rem;
}

.sidebar-footer {
  padding: 20px;
  border-top: 1px solid var(--border-color);
}

.user-profile-card {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 20px;
}

.user-avatar img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
}

.user-details .user-name {
  font-weight: 600;
}

.user-details .user-role {
  font-size: 0.9rem;
  color: #d1bb12;
  background: #f7f7f7;
  border-radius: 8px;
  padding: 5px;
  margin: 5px;
  box-shadow: 2px 2px 4px 2px silver;
  font-weight: bold;
  text-align: center;
}
.profile-photo-lg {
  width: 300px;
  height: 300px;
  border-radius: 30%;
  object-fit: cover;
  border: 4px solid #f0f0f0;
  box-shadow: 0 5px 15px rgba(193, 193, 193, 0.79);
  margin-right: 15px;
  margin-left: 280px;
  margin-right: 280px;
}

.profile-photo-sm {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--surface-color);
  box-shadow: 0 5px 15px var(--shadow-color);
  margin-right: 10px;
}
.logout-link {
  display: block;
  text-align: center;
  padding: 10px;
  background: var(--bg-color);
  border-radius: 8px;
  color: var(--danger-color);
  font-weight: 600;
}

.logout-link:hover {
  background: var(--danger-color);
  color: white;
}

/* Header Styles */
.header-actions {
  display: flex;
  align-items: center;
  gap: 20px;
}

@media (max-width: 768px) {
  .header-actions {
    gap: 12px;
  }
  .top-header .user-profile-card .user-actions {
    display: none;
  }
  .lang-text {
    display: none;
  }
}

/* Header User Profile Card */
.top-header .user-profile-card {
  margin-bottom: 0;
}
.top-header .user-profile-card .user-avatar img {
  width: 32px;
  height: 32px;
}
.top-header .user-profile-card .user-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.notifications-dropdown .notifications-btn {
  position: relative;
}

.notification-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  background: var(--danger-color);
  color: white;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  font-size: 0.7rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
}

/* General Card */
.card {
  background: var(--surface-color);
  border-radius: var(--border-radius);
  box-shadow: 0 8px 25px var(--shadow-color);
  border: 1px solid var(--border-color);
  overflow: hidden;
}

.card-header {
  padding: 20px var(--card-padding);
  border-bottom: 1px solid var(--border-color);
}

.card-title {
  font-size: 1.3rem;
  font-weight: 600;
  margin: 0;
}

.card-body {
  padding: var(--card-padding);
}

/* Alerts */
.alert {
  padding: 15px;
  margin-bottom: 20px;
  border-radius: 8px;
  border: 1px solid transparent;
}

.alert-success {
  background-color: #d1fae5;
  border-color: #a7f3d0;
  color: #065f46;
}

.alert-danger {
  background-color: #fee2e2;
  border-color: #fecaca;
  color: #991b1b;
}

.alert-info {
  background-color: #dbeafe;
  border-color: #bfdbfe;
  color: #1e40af;
}

/* Profile Grid & Cards */
.profile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: var(--card-padding);
}

.profile-card-link {
  text-decoration: none;
  color: inherit;
  display: block;
}

.profile-card {
  background: var(--bg-color);
  border-radius: var(--border-radius);
  text-align: center;
  padding: var(--card-padding);
  border: 1px solid var(--border-color);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.profile-card:hover {
  transform: translateY(-8px);
  box-shadow: 5px 5px 20px 5px #c8c8c8;
  border-color: var(--primary-color);
  transition: 200ms ease-in-out;
}

.profile-photo {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 20px;
  border: 4px solid var(--surface-color);
  box-shadow: 0 5px 15px var(--shadow-color);
}

.profile-name {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 5px;
}

.profile-action {
  color: var(--primary-color);
  font-weight: 500;
  font-size: 0.9rem;
  transition: var(--transition);
}

.profile-card:hover .profile-action {
  letter-spacing: 0.5px;
}

.profile-card-actions {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.btn.btn-sm {
  padding: 8px 16px;
  font-size: 0.85rem;
  border-radius: 8px;
  background: #7bc2dee0 !important;
  box-shadow: 1px 4px 4px 1px silver !important;
  margin: 2px;
  color: rgb(39, 39, 39) !important;
}
.btn.btn-sm:hover {
  background: #a5e2fa !important;
  transform: translateY(-3px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
  color: white !important;
}
.btn.btn-sm:active {
  transform: translateY(-1px);
  box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
}
.btn.btn-sm::after {
  content: "";
  display: inline-block;
  height: 100%;
  width: 100%;
  border-radius: 100px;
  position: absolute;
  top: 0;
  left: 0;
  z-index: -1;
  transition: all 0.4s;
}

/* -------------------------------------------------------------------------- */
/*                              Cookie Consent                                */
/* -------------------------------------------------------------------------- */

.cookie-consent-banner {
  position: fixed;
  bottom: -200px; /* Start hidden */
  left: 0;
  right: 0;
  background: var(--surface-color);
  color: var(--text-color);
  padding: 20px;
  box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.1);
  z-index: 2000;
  transition: bottom 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  border-top: 1px solid var(--border-color);
}

.cookie-consent-banner.show {
  bottom: 0;
}

.cookie-consent-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.cookie-consent-text {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.cookie-consent-link {
  color: var(--primary-color);
  text-decoration: underline;
  font-weight: 500;
}

/* Professional UI Enhancements */
.glass-card {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.07);
}

[data-theme="dark"] .glass-card {
  background: rgba(45, 55, 72, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.hover-lift {
  transition: var(--transition);
}

.hover-lift:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px var(--shadow-color);
}

/* PWA Optimized Navigation */
.mobile-nav {
  display: none;
}

@media (max-width: 768px) {
  .mobile-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 65px;
    background: var(--surface-color);
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
    z-index: 999;
    justify-content: space-around;
    align-items: center;
    padding-bottom: env(safe-area-inset-bottom);
  }

  .mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--text-muted);
    font-size: 0.75rem;
    text-decoration: none;
    gap: 4px;
  }

  .mobile-nav-item.active {
    color: var(--primary-color);
  }

  .mobile-nav-item i {
    font-size: 1.25rem;
  }

  .content {
    padding-bottom: 80px; /* Space for mobile nav */
  }
}

/* Skeleton Loader for PWA feel */
.skeleton {
  background: linear-gradient(90deg, var(--border-color) 25%, var(--bg-color) 50%, var(--border-color) 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
  border-radius: 4px;
}

@keyframes skeleton-loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
@media (max-width: 768px) {
/* Redundant sidebar logic removed - consolidated at end of file */
  .main-content {
    width: 100%;
  }

  .content {
    padding: 15px;
  }

  .mobile-menu-toggle.app-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    color: var(--primary-color);
    border: none;
    cursor: pointer;
  }

  .sidebar-close-btn {
    display: block;
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    font-size: 1.2rem;
    color: var(--text-color);
    cursor: pointer;
  }

  [dir="rtl"] .sidebar-close-btn {
    right: auto;
    left: 20px;
  }
}

@media (max-width: 480px) {
  .hero-title {
    font-size: 2.5rem;
  }
  
  .hero-actions {
    flex-direction: column;
    gap: 15px;
  }

  .section-title {
    font-size: 2rem;
  }

  .footer-content {
    grid-template-columns: 1fr;
  }

  .auth-card, .auth-card-reg {
    padding: 25px 20px;
  }
}

/* -------------------------------------------------------------------------- */
/*                                Messaging UI                                */
/* -------------------------------------------------------------------------- */

.messaging-container {
  display: flex;
  height: calc(100vh - var(--header-height) - (var(--card-padding) * 2));
  background: var(--surface-color);
  border-radius: var(--border-radius);
  border: 1px solid var(--border-color);
  overflow: hidden;
}

.thread-list-pane {
  width: 340px;
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  background: var(--bg-color);
}

.thread-list-header {
  padding: 16px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  gap: 10px;
}

.thread-filter-toggle {
  display: flex;
  background: var(--surface-color);
  border-radius: 8px;
  padding: 4px;
}

.filter-btn {
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  transition: var(--transition);
}

.filter-btn.active {
  background: var(--primary-color);
  color: white;
}

.thread-list {
  flex: 1;
  overflow-y: auto;
}

.thread-item {
  border-bottom: 1px solid var(--border-color);
}

.thread-item a {
  display: flex;
  padding: 16px;
  gap: 12px;
  text-decoration: none;
  color: inherit;
  transition: background-color 0.2s;
}

.thread-item:hover a {
  background-color: var(--bg-color);
}

.thread-item.active a {
  background-color: var(--primary-color-light, #e0e7ff);
}

[data-theme="dark"] .thread-item.active a {
  background-color: var(--primary-color-dark);
}

.thread-item .avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
}

.thread-info {
  flex: 1;
  overflow: hidden;
}

.thread-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 4px;
}

.thread-header strong {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.thread-time {
  font-size: 0.8rem;
  color: var(--text-muted);
  flex-shrink: 0;
}

.thread-excerpt {
  font-size: 0.9rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 0;
}

.unread-badge {
  background: var(--primary-color);
  color: white;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 10px;
  float: right;
}

.message-view-pane {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.message-view-header {
  display: flex;
  align-items: center;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border-color);
  gap: 15px;
}

.message-view-header .avatar {
  width: 40px;
  height: 40px;
}

.message-view-header .recipient-info {
  flex: 1;
}

.message-thread {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column-reverse; /* Newest messages at the bottom */
}

.message-thread-inner {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.message-post {
  display: flex;
  gap: 15px;
  max-width: 75%;
}

.message-post .avatar {
  width: 36px;
  height: 36px;
}

.message-post.sent {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.message-post .message-content {
  background: var(--bg-color);
  padding: 12px 16px;
  border-radius: 18px;
}

.message-post.sent .message-content {
  background: var(--primary-color);
  color: white;
}

/* Responsive Messaging */
@media (max-width: 768px) {
  .messaging-container {
    position: relative;
  }
  .thread-list-pane {
    width: 100%;
    transition: transform 0.3s ease;
  }
  .message-view-pane {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--surface-color);
    transform: translateX(100%);
    transition: transform 0.3s ease;
  }
  .messaging-container.mobile-message-view .thread-list-pane {
    transform: translateX(-100%);
  }
  .messaging-container.mobile-message-view .message-view-pane {
    transform: translateX(0);
  }
  .back-to-threads-btn {
    display: block; /* Show on mobile */
  }
}

.recipient-status {
  display: flex;
  align-items: center;
  gap: 10px;
}

.typing-indicator {
  color: var(--primary-color);
  font-style: italic;
  font-size: 0.85rem;
  animation: fadeIn 0.5s;
}

.typing-indicator::after {
  content: "...";
  display: inline-block;
  animation: typing-dots 1.5s infinite;
}

@keyframes typing-dots {
  0%,
  20% {
    content: ".";
  }
  40% {
    content: "..";
  }
  60%,
  100% {
    content: "...";
  }
}

/* -------------------------------------------------------------------------- */
/*                              Pickup Request Form                           */
/* -------------------------------------------------------------------------- */

.pickup-form {
  background: var(--surface-color);
  border-radius: var(--border-radius);
  box-shadow: 0 8px 25px var(--shadow-color);
  border: 1px solid var(--border-color);
  overflow: hidden;
  max-width: 700px;
  margin: 0 auto;
}

.pickup-form-wrapper {
  padding: var(--card-padding);
}

.form-header {
  text-align: center;
  margin-bottom: 30px;
}

.form-title {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--text-color);
}

.form-title.animate-slide-up {
  animation: slideUp 0.6s ease-out;
  animation-delay: 0.2s;
  animation-fill-mode: backwards;
  animation-duration: 0.6s;
  animation-timing-function: ease-out;
  animation-fill-mode: backwards;
  animation-delay: 0.2s;
  animation-fill-mode: backwards;
}

.form-subtitle {
  font-size: 1rem;
  color: var(--text-muted);
  margin-bottom: 20px;
  animation: fadeIn 0.6s ease-out;
  animation-delay: 0.2s;
  animation-fill-mode: backwards;
}

.form-group {
  margin-bottom: 20px;
}

.form-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-color);
  margin-top: -30px;
  margin-left: -30px;
}
.fas .fa-eye .toggle-icon {
  margin-top: 38px;
}

.pickup-request-container {
  background: var(--bg-color);
  border-radius: var(--border-radius);
  padding: 25px;
  border: 1px solid var(--border-color);
  margin-bottom: 30px;
  animation: fadeIn 0.6s ease-out;
  animation-delay: 0.2s;
  animation-fill-mode: backwards;
  box-shadow: 0 8px 25px var(--shadow-color);
  max-width: 700px;
  margin: 0 auto;
}
.pickup-request-header {
  text-align: center;
  margin-bottom: 30px;
}
.form-title {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--text-color);
}
.form-title.animate-slide-up {
  animation: slideUp 0.6s ease-out;
  animation-delay: 0.2s;
  animation-fill-mode: backwards;
  animation-duration: 0.6s;
  animation-timing-function: ease-out;
  animation-fill-mode: backwards;
  animation-delay: 0.2s;
  animation-fill-mode: backwards;
}

.pickup-request-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 10px;
}
.student-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1.25rem;
  margin-bottom: 20px;
  animation: fadeIn 0.6s ease-out;
  animation-delay: 0.2s;
  animation-fill-mode: backwards;
}

@media (max-width: 768px) {
  .student-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.75rem;
  }
  
  .student-card {
    padding: 1rem 0.75rem;
  }
  
  .avatar-icon, .student-avatar-img {
    width: 48px;
    height: 48px;
    font-size: 2rem;
  }
}

.student-card {
  border: 2px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  padding: 1.25rem;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  background: var(--surface-color);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.student-card:hover {
  border-color: var(--primary-color-light);
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.student-card.active {
  border-color: var(--primary-color);
  background-color: var(--primary-color-light);
  box-shadow: 0 0 0 1px var(--primary-color);
}

.student-card.active .student-name {
  color: var(--primary-color);
}

.student-avatar {
  text-align: center;
  margin-bottom: 0.75rem;
}

.avatar-icon {
  font-size: 3rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: var(--bg-color);
  width: 64px;
  height: 64px;
  border-radius: 50%;
}

.student-avatar-img {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
}

.student-info {
  text-align: center;
}

.student-name {
  font-weight: 600;
  color: var(--text-color);
}

.student-check {
  position: absolute;
  top: 10px;
  right: 10px;
}

.student-checkbox {
  opacity: 0;
  width: 0;
  height: 0;
}

.checkmark {

  top: 0;
  right: 0;
  height: 20px;
  width: 20px;
  background-color: var(--bg-color);
  border: 2px solid var(--border-color);
  border-radius: 50%;
}

.student-checkbox:checked ~ .checkmark {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
}

.student-checkbox:checked ~ .checkmark:after {
  content: "";
  position: absolute;
  display: block;
  left: 6px;
  top: 2px;
  width: 5px;
  height: 10px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

[dir="rtl"] .student-check {
  right: auto;
  left: 10px;
}

[dir="rtl"] .checkmark:after {
  left: auto;
  right: 6px;
}
/* -------------------------------------------------------------------------- */
/*                              Toast System                                  */
/* -------------------------------------------------------------------------- */

.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

[dir="rtl"] .toast-container {
  right: auto;
  left: 20px;
}

.toast {
  background: var(--surface-color);
  color: var(--text-color);
  padding: 12px 20px;
  border-radius: 8px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 280px;
  max-width: 400px;
  border-left: 4px solid var(--primary-color);
  pointer-events: auto;
  animation: slideInRight 0.3s ease-out;
}

[dir="rtl"] .toast {
  border-left: none;
  border-right: 4px solid var(--primary-color);
  animation: slideInLeft 0.3s ease-out;
}

.toast-success { border-color: #10b981; }
.toast-warning { border-color: #f59e0b; }
.toast-error { border-color: #ef4444; }
.toast-info { border-color: #3b82f6; }

.toast-icon { font-size: 1.2rem; }
.toast-message { flex: 1; font-size: 0.9rem; font-weight: 500; }
.toast-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

.toast.animate-slide-out {
  animation: fadeOut 0.3s forwards;
}

@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes slideInLeft {
  from { transform: translateX(-100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes fadeOut {
  to { opacity: 0; transform: translateY(-10px); }
}

/* -------------------------------------------------------------------------- */
/*                              PWA Elements                                  */
/* -------------------------------------------------------------------------- */

.pwa-install-btn {
  display: none;
  align-items: center;
  gap: 10px;
  background: var(--primary-color);
  color: white;
  padding: 10px 20px;
  border-radius: 50px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  margin: 10px auto;
}

@media (max-width: 768px) {
  .pwa-install-btn {
    width: calc(100% - 40px);
    justify-content: center;
  }
}

.pwa-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(102, 126, 234, 0.1);
  color: var(--primary-color);
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}

.eta-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  margin-bottom: 20px;
}

@media (max-width: 768px) {
  .eta-grid {
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
  }
}

@media (max-width: 576px) {
  .eta-grid {
    grid-template-columns: 1fr;
  }
}

.reason-suggestions {
  margin-top: 1rem;
}

.suggestions-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.btn-suggestion {
  background-color: var(--bg-color);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 0.25rem 0.75rem;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s ease-in-out;
  color: var(--text-color);
}

.btn-suggestion:hover {
  background-color: var(--primary-color-light);
  border-color: var(--primary-color);
  color: var(--primary-color);
}

.preselected-student-card {
  background-color: var(--surface-color);
  border: 2px solid var(--primary-color);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-md);
  margin-bottom: 1.5rem;
  overflow: hidden;
}

.preselected-student-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.5rem;
  background-color: var(--primary-color);
  color: white;
}

.preselected-student-icon {
  font-size: 1.5rem;
}

.preselected-student-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0;
}

.preselected-student-body {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.5rem;
}

.preselected-student-avatar {
  flex-shrink: 0;
}

.preselected-student-photo {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid white;
  box-shadow: var(--shadow-sm);
}

.preselected-avatar-icon {
  font-size: 3rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: var(--bg-color);
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 3px solid white;
}

.preselected-student-info {
  flex: 1;
}

.preselected-student-name {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-color);
  margin-bottom: 0.25rem;
}

.preselected-student-note {
  font-size: 0.9rem;
  color: var(--text-muted);
}

@media (max-width: 576px) {
  .preselected-student-body {
    flex-direction: column;
    text-align: center;
  }
}

.file-upload-area {
  border: 2px dashed var(--border-color);
  border-radius: var(--border-radius);
  padding: 2rem;
  text-align: center;
  cursor: pointer;
  transition: background-color 0.2s, border-color 0.2s;
  background-color: var(--bg-color);
}

.file-upload-area:hover, .file-upload-area.drag-over {
  background-color: var(--primary-color-light);
  border-color: var(--primary-color);
}

.file-upload-area.has-file {
  border-style: solid;
}

.upload-icon {
  font-size: 2.5rem;
  color: var(--primary-color);
  margin-bottom: 10px;
}

.upload-text {
  font-weight: 600;
  display: block;
  margin-bottom: 5px;
}

.upload-hint {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.form-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-color);
  gap: 1.5rem;
}

@media (max-width: 768px) {
  .form-actions {
    flex-direction: column-reverse;
    gap: 1rem;
  }
  .form-actions .btn {
    width: 100%;
    justify-content: center;
  }
}

[dir="rtl"] .form-actions {
  flex-direction: row-reverse;
}

@media (max-width: 768px) {
  [dir="rtl"] .form-actions {
    flex-direction: column;
  }
}

.btn-loader {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: #fff;
  animation: spin 0.8s linear infinite;
  display: inline-block;
  margin-left: 0.5rem;
  vertical-align: middle;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

[dir="rtl"] .btn-loader {
  margin-left: 0;
  margin-right: 0.5rem;
}

.alert {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-radius: var(--border-radius);
  margin-bottom: 1.5rem;
  border: 1px solid transparent;
}

.alert-success {
  background-color: #d1fae5;
  border-color: #a7f3d0;
  color: #065f46;
}

.alert-danger {
  background-color: #fee2e2;
  border-color: #fecaca;
  color: #991b1b;
}

.alert-icon {
  font-size: 1.25rem;
}

.page-title {
  font-size: 24px;
  font-weight: bold;
  margin-bottom: 10px;
  color: #333;
}

.page-subtitle {
  font-size: 16px;
  color: #777;
  margin-bottom: 20px;
}

.student-card {
  background-color: #fff;
  border: 1px solid #ddd;
  border-radius: 5px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  padding: 20px;
  margin-bottom: 20px;
  animation: fadeIn 0.6s ease-out;
  animation-delay: 0.2s;
  animation-fill-mode: backwards;
}

.student-name {
  font-size: 18px;
  font-weight: bold;
  margin-bottom: 5px;
}

.student-email {
  font-size: 14px;
  color: #777;
  margin-bottom: 10px;
}

.student-phone {
  font-size: 14px;
  color: #777;
  margin-bottom: 10px;
}

.student-address {
  font-size: 14px;
  color: #777;
  margin-bottom: 10px;
}

.table-responsive {
  overflow-x: auto;
  margin-bottom: 20px;
}

.table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 20px;
  border: 1px solid #ddd;
  border-radius: 4px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

.table thead {
  background-color: #f2f2f2;
  font-weight: bold;
}

.table th,
.table td {
  padding: 10px;
  text-align: left;
  border-bottom: 1px solid #ddd;
}

.table tr {
  border-bottom: 1px solid #ddd;
}

.table tr:hover {
  background-color: #c0f6ff;
}

.table th,
.table td {
  padding: 10px;
  text-align: left;
}

.table th {
  background-color: #f2f2f2;
}

.table td {
  border-bottom: 1px solid #ddd;
}

.table tr:hover {
  background-color: #c0f6ff;
}

.table th,
.table td {
  padding: 10px;
  text-align: left;
}

.table th {
  background-color: #f2f2f2;
}

.table td {
  border-bottom: 1px solid #ddd;
}

.table tr:hover {
  background-color: #c0f6ff;
}

.table th,
.table td {
  padding: 10px;
  text-align: left;
}

.table th {
  background-color: #f2f2f2;
}

.table td {
  border-bottom: 1px solid #ddd;
}

.table tr:hover {
  background-color: #c0f6ff;
}
.textarea {
  resize: vertical;
  min-height: 100px;
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 4px;
  width: 100%;
}
.btn-secondary {
  background: #f9f9f9d9;
  border-radius: 8px;
  box-shadow: 2px 8px 8px 2px silver;
  color: #0e0e0e;
  padding: 8px;
}
.btn-secondary:hover {
  background: rgb(140, 223, 248);
  color: black;
  transform: scale(1.1);
}
.textarea {
  width: 100%;
  padding: 10px;
  margin: 5px;
  border-radius: 15px;
  box-shadow: 2px 8px 8px 2px silver;
}
.profile-info {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 15px;
}

/* -------------------------------------------------------------------------- */
/*                              Audit Log Table                               */
/* -------------------------------------------------------------------------- */

.audit-log-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 20px;
  background: var(--surface-color);
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: 0 8px 25px var(--shadow-color);
  border: 1px solid var(--border-color);
}

.audit-log-table thead {
  background: var(--primary-color);
  color: white;
}

.audit-log-table th,
.audit-log-table td {
  padding: 12px 15px;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

.audit-log-table th {
  font-weight: 600;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.audit-log-table tbody tr {
  transition: var(--transition);
}

.audit-log-table tbody tr:hover {
  background: var(--bg-color);
}

.audit-log-table tbody tr:last-child td {
  border-bottom: none;
}

.audit-log-table .action-column {
  font-weight: 600;
  color: var(--primary-color);
}

.audit-log-table .timestamp-column {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.audit-log-table .user-column {
  font-weight: 500;
}

.audit-log-table .details-column {
  max-width: 300px;
  word-wrap: break-word;
  font-size: 0.9rem;
}

.audit-log-table .status-column {
  text-align: center;
}

.audit-log-table .status-badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
}

.audit-log-table .status-success {
  background: rgba(16, 185, 129, 0.1);
  color: var(--success-color);
}

.audit-log-table .status-error {
  background: rgba(239, 68, 68, 0.1);
  color: var(--danger-color);
}

.audit-log-table .status-warning {
  background: rgba(245, 158, 11, 0.1);
  color: var(--warning-color);
}

.audit-log-table .status-info {
  background: rgba(59, 130, 246, 0.1);
  color: var(--info-color);
}

/* Responsive Audit Log Table */
@media (max-width: 768px) {
  .audit-log-table {
    font-size: 0.9rem;
  }

  .audit-log-table th,
  .audit-log-table td {
    padding: 8px 10px;
  }

  .audit-log-table .details-column {
    max-width: 200px;
  }
}

/* Add archive button styles */
.archive-form {
  margin-top: 0.5rem;
}

.archive-btn {
  background-color: #6c757d;
  color: white;
  border: none;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  cursor: pointer;
  transition: background-color 0.3s;
}

.archive-btn:hover {
  background-color: #5a6268;
}

/* ==========================================================================
   Mobile App-Like Transformation (Screens < 768px)
   ========================================================================== */

@media (max-width: 768px) {
  /* Hide Sidebars and Desktop Spacing */
  .sidebar {
    /* display: none !important; Removed to allow mobile sidebar toggle */
  }

  .app-container {
    display: block; /* Remove grid/flex used for sidebar */
  }

  .main-content {
    margin-left: 0 !important;
    margin-right: 0 !important;
    width: 100% !important;
    padding-bottom: 70px !important; /* Space for bottom nav */
  }

  /* Simplify Header for Mobile */
  .top-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    height: 60px;
    padding: 0 15px;
    background: #b7e9e8 !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  .top-header .user-profile-card {
    display: none !important; /* Hide large profile in header on mobile */
  }

  .mobile-menu-toggle {
    display: block !important;
    font-size: 1.2rem;
  }

  .content {
    margin-top: 60px; /* offset for fixed header */
    padding: 10px !important;
  }

  /* Full-width container and cards */
  .container-fluid {
    padding: 0 !important;
  }

  .card {
    border-radius: 0;
    margin-bottom: 15px;
    border-left: none;
    border-right: none;
  }

  /* Bottom Navigation Bar */
  .mobile-bottom-nav {
    display: flex !important;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 65px;
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
    border-top: 1px solid var(--border-color);
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
    z-index: 1000;
    justify-content: space-around;
    align-items: center;
    padding-bottom: env(safe-area-inset-bottom); /* iOS support */
    direction: ltr; /* Reset to LTR to keep icons in consistent order, or use flex-direction: row-reverse in RTL */
  }

  [dir="rtl"] .mobile-bottom-nav {
    flex-direction: row-reverse;
  }

  .mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.75rem;
    flex: 1;
    transition: var(--transition);
    padding: 10px 1px;
    position: relative;
  }

  .mobile-nav-item i {
    font-size: 1.4rem;
    margin-bottom: 4px;
  }

  .mobile-nav-item.active {
    color: var(--primary-color);
  }

  .mobile-nav-item.active::after {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 3px;
    background: var(--primary-color);
    border-radius: 0 0 4px 4px;
  }

  .mobile-nav-item.active i {
    transform: translateY(-2px);
  }

  /* Touch-friendly adjustments */
  .btn,
  .action-btn {
    min-height: 44px; /* Native tap target size */
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .profile-photo-lg {
    width: 120px;
    height: 120px;
  }

  /* Hide redundant elements on mobile */
  .breadcrumb {
    display: none;
  }
}

/* Default state for bottom nav on desktop */
.mobile-bottom-nav {
  display: none;
}

/* Page Loader for Smooth Transitions */
#page-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-color);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.3s ease-out;
}

.loader-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Mobile Polish Improvements */
@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: none !important; /* redundant with bottom nav */
    }

    .top-header .header-actions {
        gap: 8px; /* Reduce gap to fit more items */
    }

    .header-actions .lang-text {
        display: none; /* Hide lang text to save space, icon is enough */
    }

    /* Responsive Tables */
    .table-responsive, 
    .card-body > table {
        display: block;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        border-collapse: collapse;
    }

    /* Stack small card stats */
    .dashboard-stats {
        grid-template-columns: 1fr 1fr !important;
        gap: 10px !important;
    }
}

/* User-Agent Specific Hacks (if needed) */
/* PWA Install Button Styles */
.nav-group-app.pwa-install-btn {
    margin-top: auto;
    border-top: 1px solid var(--border-color);
    padding-top: 15px;
    transition: var(--transition);
}

.nav-group-app.pwa-install-btn:hover {
    background: rgba(102, 126, 234, 0.05);
}

.nav-group-app.pwa-install-btn .nav-group-title {
    color: var(--primary-color);
    font-weight: 600;
}

/* Mobile Sidebar Overlay */
@media (max-width: 1024px) {
    .sidebar {
        display: flex !important;
        position: fixed;
        top: 0;
        bottom: 0;
        width: 280px;
        z-index: 2001;
        background: var(--surface-color);
        box-shadow: var(--shadow-lg);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        flex-direction: column;
    }

    /* LTR positioning */
    [dir="ltr"] .sidebar {
        left: 0;
        transform: translateX(-100%);
    }

    [dir="ltr"] .sidebar.active {
        transform: translateX(0);
    }

    /* RTL positioning */
    [dir="rtl"] .sidebar {
        right: 0;
        transform: translateX(100%);
    }

    [dir="rtl"] .sidebar.active {
        transform: translateX(0);
    }

    .sidebar-backdrop {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        backdrop-filter: blur(4px);
        z-index: 2000;
        display: none;
        opacity: 0;
        transition: opacity 0.3s ease;
    }

    .sidebar-backdrop.active {
        display: block;
        opacity: 1;
    }

    .sidebar-close-btn {
        display: block !important;
        background: none;
        border: none;
        font-size: 1.5rem;
        color: var(--text-color);
        cursor: pointer;
        padding: 5px;
    }

    .sidebar-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        width: 100%;
        padding: 15px;
        border-bottom: 1px solid var(--border-color);
    }
}


.sidebar-close-btn {
    display: none;
}

/* --- Consolidated RTL Support Section --- */
[dir="rtl"] {
    font-family: 'Cairo', 'Poppins', sans-serif;
}

[dir="rtl"] .hero-content,
[dir="rtl"] .hero-title,
[dir="rtl"] .hero-subtitle,
[dir="rtl"] .section-title,
[dir="rtl"] h1, [dir="rtl"] h2, [dir="rtl"] h3, 
[dir="rtl"] h4, [dir="rtl"] h5, [dir="rtl"] h6 {
    text-align: right;
    letter-spacing: 0;
}

[dir="rtl"] .nav-link {
    border-left: none;
    border-right: 4px solid transparent;
}

[dir="rtl"] .nav-link:hover,
[dir="rtl"] .nav-link.active {
    border-right-color: var(--primary-color);
    border-left-color: transparent;
}

[dir="rtl"] .nav-icon {
    margin-right: 0;
    margin-left: 15px;
}

[dir="rtl"] .dropdown-content {
    right: auto !important;
    left: 0 !important;
}

[dir="rtl"] .dropdown-item {
    flex-direction: row-reverse;
}

[dir="rtl"] .item-icon {
    margin-right: 0;
    margin-left: 15px;
}

[dir="rtl"] .form-group {
    text-align: right;
}

[dir="rtl"] .table th,
[dir="rtl"] .table td {
    text-align: right;
}

[dir="rtl"] .modal-header {
    flex-direction: row-reverse;
}

[dir="rtl"] .sidebar-nav a {
    text-align: right;
}

/* Adjust spacing for Arabic text readability */
[dir="rtl"] .hero-subtitle,
[dir="rtl"] .feature-card p,
[dir="rtl"] .login-option-card p,
[dir="rtl"] .content p {
    line-height: 1.8;
}

[dir="rtl"] .login-btn {
    flex-direction: row-reverse;
}

[dir="rtl"] .btn-arrow {
    transform: rotate(180deg);
}

[dir="rtl"] .login-btn:hover .btn-arrow {
    transform: translateX(-5px) rotate(180deg);
}
/* --- End Consolidated RTL Section --- */
