html {
  /* Compact 83% scale so more fits on screen */
  zoom: 83%;
}

:root {
  /* Dark Mode (Default) - Deep Electric Blue Theme */
  --bg-base: #060a12;
  --bg-grad-1: #0a1128;
  --bg-grad-2: #020817;
  
  /* Navigation & UI Shell (Electric Deep Blue) */
  --nav-bg: rgba(10, 18, 42, 0.92);
  --nav-border: rgba(0, 240, 255, 0.2);
  --nav-shadow: 0 8px 32px rgba(0, 102, 255, 0.25);
  
  /* Footer Specific (Dark Mode) */
  --footer-bg: rgba(10, 18, 42, 0.92);
  --footer-border: rgba(0, 240, 255, 0.12);
  --footer-text: rgba(240, 246, 255, 0.75);
  --footer-brand-text: #f0f6ff;

  /* Blue Accent Palette */
  --accent: #00f0ff;          /* Vibrant Cyan-Blue */
  --accent-2: #0066ff;        /* Electric Deep Blue */
  --accent-soft: rgba(0, 240, 255, 0.12);
  --accent-glow: rgba(0, 240, 255, 0.35);
  --accent-blue-glow: rgba(0, 102, 255, 0.4);
  
  /* Navigation Text */
  --text-on-nav: #f0f6ff;
  --text-muted-nav: rgba(240, 246, 255, 0.75);
  
  /* Main Content & Cards */
  --card-bg: rgba(12, 22, 48, 0.7);
  --card-border: rgba(0, 240, 255, 0.18);
  --card-text: #e2edff;
  --card-shadow: 0 10px 35px rgba(2, 8, 23, 0.6), 0 0 15px rgba(0, 240, 255, 0.08);
  --card-shadow-hover: 0 18px 50px rgba(0, 102, 255, 0.35), 0 0 25px rgba(0, 240, 255, 0.25);
  --body-bg: #060a12;
  
  /* Table & Form Inputs */
  --input-bg: rgba(255, 255, 255, 0.04);
  --table-head: rgba(10, 18, 42, 0.95);
  --table-row-alt: rgba(255, 255, 255, 0.02);
  --table-row-hover: rgba(0, 240, 255, 0.08);
  --muted: #8298c4;
  --border: rgba(0, 240, 255, 0.12);
  
  /* Background Glow Orbs */
  --orb-1: rgba(0, 240, 255, 0.18);
  --orb-2: rgba(0, 102, 255, 0.16);
  --orb-3: rgba(59, 130, 246, 0.1);
  
  /* Status Colors */
  --status-pending-bg: rgba(251, 192, 45, 0.15);
  --status-pending-text: #fbc02d;
  --status-confirmed-bg: rgba(0, 240, 255, 0.15);
  --status-confirmed-text: #00f0ff;
  --status-cancelled-bg: rgba(244, 67, 54, 0.15);
  --status-cancelled-text: #ef5350;

  /* Semantic Status Colors */
  --success: #00ff88;
  --success-soft: rgba(0, 255, 136, 0.12);
  --error: #ff4d4d;
  --error-soft: rgba(255, 77, 77, 0.12);
  --warning: #ffaa00;
  --warning-soft: rgba(255, 170, 0, 0.12);

  /* Shared layout geometry */
  --sidenav-clearance: 180px;
  --content-edge: max(1.2vw, calc(50vw - 720px));
  --content-left: max(var(--sidenav-clearance), var(--content-edge));
  
  --content-right-edge: 12px; 
  --content-right-pad: var(--content-right-edge);

  /* Notification bell clearance (kept in sync with the bell's real footprint
     at each breakpoint so the top nav never runs under it) */
  --notif-clearance-1024: 80px;
  --notif-clearance-480: 72px;
}

body.light-mode {
  --bg-base: #f0f4f8;
  --bg-grad-1: #e0f2fe;
  --bg-grad-2: #f8fafc;
  --body-bg: #f0f4f8;

  --nav-bg: rgba(15, 23, 42, 0.95);
  --nav-border: rgba(139, 92, 246, 0.3);
  --nav-shadow: 0 10px 30px rgba(124, 58, 237, 0.18);
  --text-on-nav: #ffffff;
  --text-muted-nav: rgba(241, 245, 249, 0.85);

  --footer-bg: rgba(255, 255, 255, 0.9);
  --footer-border: rgba(139, 92, 246, 0.2);
  --footer-text: #475569;
  --footer-brand-text: #0f172a;

  --accent: #8b5cf6;          
  --accent-2: #7c3aed;        
  --accent-soft: rgba(139, 92, 246, 0.12);
  --accent-glow: rgba(139, 92, 246, 0.3);
  --accent-blue-glow: rgba(124, 58, 237, 0.35);

  --card-bg: rgba(255, 255, 255, 0.95);
  --card-border: rgba(139, 92, 246, 0.2);
  --card-text: #1e293b;
  --card-shadow: 0 10px 30px rgba(139, 92, 246, 0.08), 0 0 12px rgba(139, 92, 246, 0.05);
  --card-shadow-hover: 0 18px 45px rgba(139, 92, 246, 0.2), 0 0 20px rgba(139, 92, 246, 0.15);
  
  --input-bg: #ffffff;
  --table-head: #f1f5f9;
  --table-row-alt: rgba(139, 92, 246, 0.02);
  --table-row-hover: rgba(139, 92, 246, 0.08);
  --muted: #64748b;
  --border: rgba(139, 92, 246, 0.18);
  
  --orb-1: rgba(139, 92, 246, 0.12);
  --orb-2: rgba(124, 58, 237, 0.08);
  --orb-3: rgba(168, 85, 247, 0.06);
  
  --status-pending-bg: rgba(251, 192, 45, 0.18);
  --status-pending-text: #856404;
  --status-confirmed-bg: rgba(139, 92, 246, 0.15);
  --status-confirmed-text: #7c3aed;
  --status-cancelled-bg: rgba(244, 67, 54, 0.15);
  --status-cancelled-text: #b91c1c;

  --success: #16a34a;
  --success-soft: rgba(22, 163, 74, 0.12);
  --error: #dc2626;
  --error-soft: rgba(220, 38, 38, 0.12);
  --warning: #d97706;
  --warning-soft: rgba(217, 119, 6, 0.12);
}

/* ========= GLOBAL RESET & TOUCH ENHANCEMENTS ========= */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Montserrat", "Inter", sans-serif;
  -webkit-tap-highlight-color: transparent;
}

ul, li {
  list-style: none !important;
  list-style-type: none !important;
}

body {
  min-height: 100vh;
  min-height: -webkit-fill-available;
  background: var(--body-bg);
  color: var(--card-text);
  transition: background 0.4s ease, color 0.4s ease;
  overflow-x: hidden;
  padding-bottom: 60px;
}

/* ========= BACKGROUND & ORBS ========= */
.bg-gradient {
  position: fixed;
  inset: 0;
  z-index: -2;
  background: linear-gradient(135deg, var(--bg-grad-1), var(--bg-grad-2));
  transition: background 0.4s ease;
}

.bg-orbs {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  animation: float 20s ease-in-out infinite;
}

.orb-1 {
  width: 450px; height: 450px;
  background: var(--orb-1);
  top: -120px; left: -100px;
  animation-delay: 0s;
}
.orb-2 {
  width: 400px; height: 400px;
  background: var(--orb-2);
  bottom: -100px; right: 10%;
  animation-delay: -7s;
}
.orb-3 {
  width: 320px; height: 320px;
  background: var(--orb-3);
  top: 35%; right: -100px;
  animation-delay: -14s;
}

@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(30px, -40px) scale(1.05); }
  66% { transform: translate(-20px, 30px) scale(0.95); }
}

/* ========= BRAND LOGO ========= */
.brand-101 {
  display: inline-flex;
  align-items: center;
  gap: 1px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  font-weight: 900;
  letter-spacing: -0.5px;
}

.brand-101 .ball-zero {
  -webkit-text-fill-color: initial;
  color: var(--accent);
  font-size: 0.85em;
  margin: 0 1px;
  display: inline-block;
  transition: transform 0.4s ease;
}

.logo:hover .brand-101 .ball-zero,
.footer-brand:hover .brand-101 .ball-zero {
  transform: rotate(180deg);
}
/* ========= TOP NAVIGATION (Perfectly Centered Over Main Content) ========= */
.topnav-floating {
  position: fixed;
  top: 15px;
  
  /* Left/right offsets match main-content's own edges (content-left /
     content-right-pad), so with margin:0 auto below, the nav centers
     itself inside the main content area rather than the whole page */
  left: var(--content-left);
  right: var(--content-right-pad);
  
  /* Center inside the page without manual pixel transforms */
  margin: 0 auto;
  width: 100%;
  max-width: 1000px;
  
  height: 58px;
  background: var(--nav-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--nav-border);
  border-radius: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 24px;
  box-shadow: var(--nav-shadow);
  z-index: 1000;
  transition: background 0.4s ease, box-shadow 0.4s ease, border-color 0.4s ease, transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.topnav-floating.nav-hidden {
  transform: translateY(-140%);
}


.topnav-floating .nav-links {
  list-style: none;
  display: flex;
  gap: 6px;
}

.topnav-floating .nav-links li a {
  color: var(--text-muted-nav);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.88rem;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.3s ease;
  padding: 8px 14px;
  border-radius: 10px;
  position: relative;
  min-height: 40px;
}

.topnav-floating .nav-links li a:hover,
.topnav-floating .nav-links li a.active {
  color: var(--accent);
  background: var(--accent-soft);
  box-shadow: inset 0 0 12px var(--accent-soft);
}

.topnav-floating .nav-links li a.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 3px;
  border-radius: 3px;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent-glow);
}

/* ========= TOP NAV ACTIONS ========= */
.nav-actions {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: flex-end;
  gap: 10px;
  position: relative;
}

.theme-toggle, button.profile {
  background: var(--accent-soft);
  border: 1px solid var(--nav-border);
  color: var(--accent);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  transition: all 0.3s ease;
  padding: 0;
  margin: 0;
  outline: none;
}

.theme-toggle:hover, button.profile:hover {
  transform: scale(1.05);
  box-shadow: 0 0 16px var(--accent-glow);
}

.theme-toggle .icon-sun { display: none; }
body.light-mode .theme-toggle .icon-moon { display: none; }
body.light-mode .theme-toggle .icon-sun { display: block; color: #f59e0b; }

.profile-dropdown-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.profile-dropdown-menu {
  position: absolute !important;
  top: calc(100% + 12px) !important;
  right: 0 !important;
  width: 240px !important;
  background: var(--nav-bg) !important;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--nav-border) !important;
  border-radius: 16px !important;
  padding: 12px !important;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45), 0 0 15px var(--accent-soft) !important;
  display: flex;
  flex-direction: column;
  gap: 4px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all 0.25s ease-in-out;
  z-index: 2500 !important;
}

.profile-dropdown-menu.active {
  opacity: 1 !important;
  visibility: visible !important;
  transform: translateY(0) !important;
}

.dropdown-header {
  padding: 6px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.dropdown-header .user-name {
  font-weight: 700;
  font-size: 0.95rem;
  color: #ffffff;
}

.dropdown-header .user-email {
  font-size: 0.78rem;
  color: rgba(240, 246, 255, 0.65);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dropdown-divider {
  height: 1px;
  background: var(--accent-soft);
  margin: 6px 0;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 12px 14px;
  color: var(--text-muted-nav);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 500;
  border-radius: 10px;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
  min-height: 44px;
}

.dropdown-item i {
  font-size: 1rem;
  width: 18px;
  text-align: center;
  color: var(--accent);
}

.dropdown-item:hover {
  background: var(--accent-soft);
  color: var(--accent);
}

.dropdown-item.logout-link:hover {
  background: rgba(244, 67, 54, 0.15);
  color: #ef5350;
}

/* ========= TOP-RIGHT NOTIFICATION BELL ========= */
.top-right-notif-wrapper {
  position: fixed;
  top: 30px; /* nudged down from 15px so it no longer sits flush with the nav's top edge */
  right: 20px;
  z-index: 10000;
}

.top-right-notif-btn {
  position: relative;
  background: var(--nav-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--nav-border);
  color: var(--accent);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--nav-shadow);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.top-right-notif-btn:hover {
  transform: translateY(-2px) scale(1.05);
  border-color: var(--accent);
  box-shadow: 0 0 20px var(--accent-glow);
}

@keyframes bellRingAnimation {
  0% { transform: rotate(0); }
  10% { transform: rotate(14deg); }
  20% { transform: rotate(-12deg); }
  30% { transform: rotate(10deg); }
  40% { transform: rotate(-8deg); }
  50% { transform: rotate(6deg); }
  60% { transform: rotate(-4deg); }
  70% { transform: rotate(2deg); }
  80%, 100% { transform: rotate(0); }
}

.top-right-notif-btn.has-unread i {
  animation: bellRingAnimation 2.2s infinite ease-in-out;
  transform-origin: top center;
  color: var(--accent);
}

.top-right-badge {
  position: absolute;
  top: -1px;
  right: -1px;
  background: linear-gradient(135deg, var(--accent-2) 0%, var(--accent) 100%);
  color: #ffffff;
  font-size: 0.65rem;
  font-weight: 800;
  min-width: 18px;
  height: 18px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  border: 2px solid var(--body-bg);
}

.notif-popup-panel {
  position: absolute;
  top: 50px;
  right: 0;
  width: 330px;
  background: var(--nav-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--nav-border);
  border-radius: 16px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5), 0 0 20px var(--accent-soft);
  display: none;
  flex-direction: column;
  overflow: hidden;
  z-index: 10001;
  animation: popFadeIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes popFadeIn {
  from { opacity: 0; transform: translateY(-10px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.notif-popup-panel.active {
  display: flex;
}

.notif-popup-header {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--accent-soft);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.notif-popup-header h4 {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 700;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.notif-badge-pill {
  font-size: 0.72rem;
  background: var(--accent-soft);
  color: var(--accent);
  padding: 2px 8px;
  border-radius: 12px;
  font-weight: 700;
}

.notif-popup-list {
  max-height: 300px;
  overflow-y: auto;
  padding: 0.4rem 0;
  -webkit-overflow-scrolling: touch;
}

.notif-item {
  padding: 0.75rem 1rem;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  text-decoration: none;
  color: #ffffff;
  transition: background 0.2s ease;
  min-height: 48px;
}

.notif-item:hover {
  background: var(--accent-soft);
}

.notif-item-icon {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  flex-shrink: 0;
}

.notif-item-content {
  flex: 1;
}

.notif-item-title {
  font-size: 0.8rem;
  font-weight: 600;
  margin: 0 0 0.2rem 0;
  line-height: 1.3;
}

.notif-item-time {
  font-size: 0.68rem;
  color: rgba(240, 246, 255, 0.65);
}

.notif-popup-footer {
  padding: 0.65rem 1rem;
  border-top: 1px solid var(--accent-soft);
  text-align: center;
  background: rgba(255, 255, 255, 0.02);
}

.notif-popup-footer a {
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 700;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.notif-popup-footer a:hover {
  text-decoration: underline;
}

/* ========= SIDE NAVIGATION ========= */
.sidenav-floating {
  position: fixed;
  top: 90px;
  left: 20px;
  background: var(--nav-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--nav-border);
  border-radius: 24px;
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: var(--nav-shadow);
  z-index: 999;
  width: 260px;
  transition: background 0.4s ease, box-shadow 0.4s ease, border-color 0.4s ease, transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.sidenav-floating li a {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--text-muted-nav);
  font-size: 1rem;
  font-weight: 500;
  text-decoration: none;
  padding: 14px 18px;
  border-radius: 12px;
  transition: all 0.3s ease;
  position: relative;
  min-height: 50px;
}

.sidenav-floating li a i {
  font-size: 1.3rem;
  width: 24px;
  text-align: center;
  color: var(--accent);
}

.sidenav-floating li a:hover,
.sidenav-floating li a.active {
  background: var(--accent-soft);
  color: var(--accent);
  box-shadow: inset 0 0 10px var(--accent-soft);
}

.nav-divider {
  height: 1px;
  background: var(--accent-soft);
  margin: 6px 10px;
}

.logout-btn {
  background: none;
  border: 1px solid transparent;
  color: var(--text-muted-nav);
  font-size: 0.92rem;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  width: 100%;
  text-align: left;
  padding: 12px 14px;
  border-radius: 12px;
  font-weight: 500;
  transition: all 0.3s ease;
  min-height: 44px;
}

.logout-btn i {
  font-size: 1.15rem;
  width: 20px;
  text-align: center;
}

.logout-btn:hover {
  background: rgba(244, 67, 54, 0.12);
  color: #ef5350;
  border-color: rgba(244, 67, 54, 0.2);
}

/* ========= MAIN CONTENT AREA ========= */
.main-content {
  padding: 95px var(--content-right-pad) 40px var(--content-left);
  min-height: 100vh;
}

.main-card {
  position: relative;
  background: var(--card-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--card-border);
  color: var(--card-text);
  padding: 2.2rem;
  border-radius: 22px;
  box-shadow: var(--card-shadow);
  width: 100%;
  max-width: 1250px;
  margin: 0 auto;
  transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.4s ease, color 0.4s ease, border-color 0.4s ease;
}

.main-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 10%;
  right: 10%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), var(--accent-2), transparent);
  border-radius: 2px;
}

.main-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: var(--card-shadow-hover);
}

.welcome-header {
  display: flex;
  align-items: center;
  gap: 18px;
}

.welcome-icon {
  width: 58px;
  height: 58px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  color: #ffffff;
  flex-shrink: 0;
  box-shadow: 0 8px 25px var(--accent-blue-glow);
}

.welcome-header h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.welcome-header p {
  color: var(--muted);
  line-height: 1.6;
}

/* ========= HAMBURGER & OVERLAY ========= */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: var(--accent-soft);
  border: 1px solid var(--nav-border);
  border-radius: 12px;
  cursor: pointer;
  padding: 8px;
  width: 40px;
  height: 40px;
  align-items: center;
}

.hamburger span {
  width: 20px;
  height: 2px;
  border-radius: 3px;
  background: var(--text-on-nav);
  transition: all 0.3s ease;
}

.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.mobile-overlay {
  position: fixed;
  inset: 0;
  background: rgba(2, 8, 23, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 998;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

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

/* ========= MESSAGES ========= */
.django-messages {
  margin-bottom: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.django-message {
  padding: 14px 18px;
  border-radius: 12px;
  font-weight: 500;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slideIn 0.4s ease;
}

@keyframes slideIn {
  from { opacity: 0; transform: translateX(-20px); }
  to { opacity: 1; transform: translateX(0); }
}

.django-message.success { background-color: var(--success-soft); border-left: 4px solid var(--success); color: var(--success); }
.django-message.info { background-color: var(--accent-soft); border-left: 4px solid var(--accent); color: var(--accent); }
.django-message.warning { background-color: var(--warning-soft); border-left: 4px solid var(--warning); color: var(--warning); }
.django-message.error { background-color: var(--error-soft); border-left: 4px solid var(--error); color: var(--error); }

/* ========= FOOTER ========= */
.thin-footer-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 44px;
  background: var(--footer-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--footer-border);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  font-size: 0.82rem;
  color: var(--footer-text);
  transition: background 0.4s ease, border-color 0.4s ease, color 0.4s ease;
}

.footer-left-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.footer-brand {
  font-weight: 700;
  color: var(--footer-brand-text);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.footer-quick-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  list-style: none;
}

.footer-modal-trigger {
  background: none;
  border: none;
  color: var(--footer-text);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: color 0.2s ease;
  min-height: 44px;
}

.footer-modal-trigger:hover {
  color: var(--accent);
}

/* Modal Pop-up Styling */
.footer-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 10002;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
}

.footer-modal.active {
  display: flex;
}

.footer-modal-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 20px;
  width: 100%;
  max-width: 550px;
  max-height: 85vh;
  overflow-y: auto;
  padding: 1.75rem;
  position: relative;
  color: var(--card-text);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5), 0 0 20px var(--accent-soft);
  animation: modalFadeIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  -webkit-overflow-scrolling: touch;
}

@keyframes modalFadeIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.modal-close-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: var(--accent-soft);
  border: none;
  color: var(--card-text);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, color 0.2s;
}

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

.modal-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.75rem;
}

.modal-header i {
  font-size: 1.25rem;
  color: var(--accent);
}

.modal-header h3 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
}

.modal-body {
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--muted);
}

/* ========= BUTTON STYLES ========= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  text-decoration: none;
  border: none;
  cursor: pointer;
  font-weight: 700;
  font-size: 0.88rem;
  padding: 0.75rem 1.4rem;
  border-radius: 10px;
  transition: all 0.3s ease;
  min-height: 44px;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px var(--accent-glow);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #ffffff;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 10px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  min-height: 44px;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px var(--accent-glow);
}

/* ========= RESPONSIVE DATA TABLE ========= */
.card-table-container {
  border-radius: 14px;
  overflow-x: auto;
  border: 1px solid var(--border);
  -webkit-overflow-scrolling: touch;
  width: 100%;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  white-space: nowrap;
}

.data-table thead th {
  padding: 14px 16px;
  text-align: left;
  font-weight: 700;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
  border-bottom: 2px solid var(--border);
  background: var(--table-head);
}

.data-table tbody tr {
  transition: background 0.2s ease;
}

.data-table tbody tr:hover {
  background: var(--table-row-hover);
}

.data-table tbody td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--card-text);
}

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

/* ========= FORM INPUT DEFAULTS =========
   Scoped with :not([class]) so this only styles bare, unclassed form
   elements (e.g. a plain <input> dropped into a template with no
   component class). The moment an input/select/textarea has ANY class
   on it — like .select-control or .search-input — this rule steps
   aside entirely and that component's own CSS is fully in charge of
   its width, height, padding, etc. No more silently-inherited
   width:100%/min-height:44px fighting with a component's own sizing. */
input[type="text"]:not([class]), input[type="email"]:not([class]), input[type="date"]:not([class]), input[type="file"]:not([class]),
input[type="password"]:not([class]), input[type="number"]:not([class]), select:not([class]), textarea:not([class]) {
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--card-text);
  padding: 0.75rem 1rem;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  font-family: inherit;
  width: 100%;
  min-height: 44px;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

label {
  cursor: pointer;
}

/* ========= SMOOTH SCROLL & SELECTION ========= */
html { 
  scroll-behavior: smooth;
  height: -webkit-fill-available;
}

::selection {
  background: var(--accent-soft);
  color: var(--accent);
}

/* ========= FOCUS VISIBLE ========= */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ==========================================================================
   MEDIUM DESKTOP / SMALL LAPTOP WINDOW (e.g. ~1180px browser width)
   Scoped so it only applies in this narrow band — everything above 1366px
   or below 1025px keeps the exact same layout as before.
   ========================================================================== */
@media (min-width: 1025px) and (max-width: 1366px) {
  :root {
    /* Sidebar occupies left:20px + width:240px = up to x=260px. At this
       window size --sidenav-clearance's normal 220px value sits inside
       that footprint, so the topnav/content start underneath the sidebar
       instead of beside it. Nudge it up just for this range. */
    --sidenav-clearance: 300px;
  }

  .topnav-floating {
    /* A little narrower here so it doesn't feel squeezed in the tighter box */
    max-width: 720px;
  }
}

/* ==========================================================================
   MOBILE & TOUCH DESIGN (FKF Responsive-Style Layout & Safe Zone Dock)
   ========================================================================== */

@media (max-width: 1024px) {
  /* 1. TOP NAV - Scrollable Header Link Hub */
  .topnav-floating {
    top: 10px;
    left: 10px;
    /* Bell footprint here is 10px(right)+52px(width)=62px. Reserve a real
       gap past that so the scrollable nav never runs under the bell. */
    right: var(--notif-clearance-1024);
    max-width: none;
    height: 52px;
    padding: 0 8px;
    border-radius: 16px;
    background: rgba(10, 18, 42, 0.92);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), inset 0 1px 1px rgba(0, 240, 255, 0.2);
    display: flex;
    align-items: center;
    overflow-x: auto; /* Horizontal scroll support for top header links */
    scrollbar-width: none;
  }

  .topnav-floating::-webkit-scrollbar {
    display: none;
  }

  .topnav-floating .logo span {
    display: none;
  }

  /* Accessible nav links in top bar on mobile */
  .topnav-floating .nav-links {
    display: flex !important;
    gap: 4px;
    align-items: center;
    white-space: nowrap;
    padding-left: 4px;
  }

  .topnav-floating .nav-links li a {
    padding: 6px 10px;
    font-size: 0.78rem;
    min-height: 36px;
  }

  /* 2. ISOLATED NOTIFICATION BELL (No Component Collision) */
  .top-right-notif-wrapper {
    position: fixed;
    top: 45px; /* nudged down from 10px, off the nav's top edge */
    right: 10px;
    z-index: 10005;
    margin: 0;
    padding: 0;
  }

  .top-right-notif-btn {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    background: rgba(10, 18, 42, 0.92);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid var(--accent-glow);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5), 0 0 15px var(--accent-soft);
  }

  .top-right-notif-btn:active {
    transform: scale(0.92);
  }

  .notif-popup-panel {
    position: fixed;
    top: 68px;
    left: 10px;
    right: 10px;
    width: auto;
    max-height: 70vh;
    border-radius: 20px;
    border: 1px solid var(--accent);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), 0 0 30px var(--accent-soft);
  }

  /* 3. FKF-STYLE FLOATING APP DOCK (Non-blocking Bottom Nav) */
  .sidenav-floating {
    position: fixed;
    top: auto;
    bottom: calc(10px + env(safe-area-inset-bottom));
    left: 10px;
    right: 10px;
    width: auto;
    height: 60px;
    border-radius: 20px;
    background: rgba(6, 10, 18, 0.9);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border: 1px solid rgba(0, 240, 255, 0.25);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.6), 0 0 20px rgba(0, 240, 255, 0.15);
    padding: 4px 8px;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-around;
    z-index: 9999;
    transform: translateY(0);
  }

  .sidenav-floating li {
    flex: 1;
    display: flex;
    justify-content: center;
  }

  .sidenav-floating li a, 
  .sidenav-floating .logout-btn {
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 2px;
    padding: 4px;
    min-height: auto;
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--text-muted-nav);
    border-radius: 12px;
  }

  .sidenav-floating li a i, 
  .sidenav-floating .logout-btn i {
    font-size: 1.2rem;
    margin: 0;
  }

  .sidenav-floating li a.active,
  .sidenav-floating li a:active {
    background: var(--accent-soft);
    color: var(--accent);
    box-shadow: 0 0 12px var(--accent-soft);
  }

  .nav-divider {
    display: none;
  }

  /* 4. NON-BLOCKING PAGE CONTENT CLEARANCE */
  .main-content {
    /* Extended bottom padding ensures page content never gets blocked by the floating dock */
    padding: 72px 10px calc(120px + env(safe-area-inset-bottom)) 10px;
  }

  .main-card {
    padding: 1.25rem;
    border-radius: 20px;
    border: 1px solid var(--card-border);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    margin-bottom: 20px;
  }

  .welcome-header {
    flex-direction: row;
    text-align: left;
    gap: 12px;
  }

  .welcome-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    font-size: 1.2rem;
  }

  /* 5. FOOTER ADJUSTMENTS */
  .thin-footer-bar {
    display: none; /* Hidden on mobile to keep interface clean */
  }

  .hamburger {
    display: none;
  }
}

@media (max-width: 480px) {
  .top-right-notif-wrapper {
    top: 50px; /* nudged down from 8px, off the nav's top edge */
    right: 8px;
  }

  .topnav-floating {
    top: 8px;
    left: 8px;
    /* Bell footprint here is 8px(right)+48px(width)=56px. Reserve a real
       gap past that so the scrollable nav never runs under the bell. */
    right: var(--notif-clearance-480);
    height: 48px;
  }

  .top-right-notif-btn {
    width: 48px;
    height: 48px;
  }

  .sidenav-floating {
    bottom: calc(8px + env(safe-area-inset-bottom));
    left: 8px;
    right: 8px;
    height: 58px;
  }
}

/* ========= CUSTOM SCROLLBAR ========= */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--accent-soft); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }