.app-body {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 240px;
  min-height: 100vh;
  background: linear-gradient(180deg, #0f172a 0%, #1a2744 100%);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 1000;
  overflow-y: auto;
  overflow-x: hidden;
  box-shadow: 4px 0 24px rgba(0,0,0,0.18);
  scrollbar-width: none;
}

.sidebar::-webkit-scrollbar {
  display: none;
}

.main-content-wrapper {
  margin-left: 240px;
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.sidebar-overlay {
  display: none;
}

.sidebar-header-box {
  padding: 22px 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
}

.slogo img {
  height: 42px;
  width: auto;
  display: block;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
}

.sidebar-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1650cd, #3b82f6);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: bold;
  font-family: Georgia, serif;
  flex-shrink: 0;
  border: 2px solid rgba(255,255,255,0.15);
  box-shadow: 0 4px 12px rgba(22,80,200,0.4);
  letter-spacing: 1px;
}

.sidebar-user-info p {
  font-size: 13px;
  font-weight: bold;
  color: white;
  margin-bottom: 2px;
  line-height: 1.3;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: Georgia, serif;
}

.sidebar-user-info span {
  font-size: 11px;
  color: #60a5fa;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  font-family: Georgia, serif;
}

.sidebar-label {
  font-size: 10px;
  color: #475569;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  padding: 18px 20px 8px;
  font-family: Georgia, serif;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  padding: 4px 12px;
  gap: 2px;
  flex: 1;
}

.sidebar-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #94a3b8;
  font-size: 13px;
  font-weight: bold;
  padding: 11px 12px;
  border-radius: 8px;
  transition: background 0.2s, color 0.2s, transform 0.15s;
  position: relative;
  font-family: Georgia, serif;
}

.sidebar-link:hover {
  background: rgba(22,80,200,0.2);
  color: white;
  transform: translateX(3px);
}

.sidebar-link.active {
  background: linear-gradient(90deg, rgba(22, 80, 200, 0.35), rgba(59, 130, 246, 0.15));
  color: white;
 
  padding-left: 9px; 
}
.drawer-nav a.active {
  color: #3b82f6;
  font-weight: bold;
  padding-left: 9px;
  background: rgba(59, 130, 246, 0.08);
}
.sidebar-badge {
  background: #1650cd;
  color: white;
  font-size: 10px;
  font-weight: bold;
  padding: 2px 7px;
  border-radius: 20px;
  min-width: 20px;
  text-align: center;
  animation: pulse-badge 1.4s infinite;
}


@keyframes pulse-badge {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

.sidebar-footer-actions {
  padding: 12px 12px 24px;
  border-top: 1px solid rgba(255,255,255,0.07);
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.btn-sidebar-settings {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  color: #94a3b8;
  border-radius: 8px;
  font-size: 13px;
  font-weight: bold;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
  cursor: pointer;
  font-family: Georgia, serif;
}

.btn-sidebar-settings:hover {
  background: rgba(255,255,255,0.1);
  color: white;
  border-color: rgba(255,255,255,0.2);
}

.btn-sidebar-settings svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

.btn-sidebar-logout {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  background: white;
  border: 2px solid #1650cd;
  color: #1650cd;
  border-radius: 8px;
  font-size: 13px;
  font-weight: bold;
  transition: background 0.2s, color 0.2s, border-color 0.2s, transform 0.18s, box-shadow 0.2s;
  cursor: pointer;
  font-family: Georgia, serif;
}

.btn-sidebar-logout:hover {
  background: #1650cd;
  border-color: #1650cd;
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(220, 38, 38, 0.22);
}

.sidebar-mobile-close {
  display: none;
}

/* =========================================================================
   Mobile top nav + slide-in drawer
   Shared baseline for ALL dashboards (admin / patient / doctor).
   Loaded on every base.html, so every page gets a working mobile menu
   even if it doesn't ship its own page-specific override.
   ========================================================================= */

html, body { overflow-x: hidden; }

/* !important below is intentional: this header must render at the exact
   same size on every dashboard page no matter what a page-specific
   stylesheet (loaded after this one via {% block extra_css %}) declares
   for generic tags/classes it touches. Without this, a per-page CSS file
   can accidentally shrink/grow this bar and no one notices until it ships. */
.mobile-top-nav {
  display: none !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 14px !important;
  height: 58px !important;
  min-height: 58px !important;
  max-height: 58px !important;
  padding: 0 16px !important;
  background: #0f172a !important;
  position: sticky !important;
  top: 0 !important;
  z-index: 900 !important;
  box-sizing: border-box !important;
}

.mobile-top-nav .mobile-logo img {
  height: 34px !important;
  max-height: 34px !important;
  width: auto !important;
  max-width: none !important;
  display: block !important;
}

.mobile-logo-text {
  color: #ffffff;
  font-family: Georgia, serif;
  font-size: 18px;
  font-weight: bold;
  letter-spacing: 0.3px;
}

.mobile-top-nav .hamburger,
.hamburger {
  display: none;
  flex-direction: column !important;
  justify-content: center !important;
  align-items: center !important;
  gap: 5px !important;
  width: 40px !important;
  height: 40px !important;
  max-width: 40px !important;
  max-height: 40px !important;
  flex-shrink: 0 !important;
  background: transparent !important;
  border: none !important;
  cursor: pointer !important;
  padding: 6px !important;
  border-radius: 6px !important;
  box-sizing: border-box !important;
}

.hamburger:hover {
  background: rgba(255,255,255,0.08);
}

.hamburger span {
  display: block !important;
  width: 22px !important;
  height: 2px !important;
  background: white !important;
  border-radius: 2px;
  transition: transform 0.3s, opacity 0.3s;
}

.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
  z-index: 1998;
}

.drawer-overlay.open {
  opacity: 1;
  visibility: visible;
}

.mobile-drawer {
  position: fixed;
  top: 0;
  left: 0;
  width: 260px;
  max-width: 85%;
  height: 100%;
  background: linear-gradient(180deg, #0f172a 0%, #1a2744 100%);
  transform: translateX(-100%);
  transition: transform 0.3s ease;
  z-index: 1999;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  box-shadow: 10px 0 30px rgba(0,0,0,0.3);
}

.mobile-drawer.open {
  transform: translateX(0);
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
}

.drawer-logo {
  font-family: Georgia, serif;
  font-size: 20px;
  color: white;
  font-weight: bold;
}

.drawer-nav {
  display: flex;
  flex-direction: column;
  padding: 8px 16px;
  gap: 2px;
  flex: 1;
}

.drawer-nav a {
  color: #94a3b8;
  font-size: 14px;
  font-weight: bold;
  padding: 12px 12px;
  border-radius: 8px;
  transition: background 0.2s, color 0.2s;
  display: block;
  font-family: Georgia, serif;
}

.drawer-nav a:hover,
.drawer-nav a.active {
  color: white;
  background: rgba(22,80,200,0.25);
}

.drawer-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px 24px 24px;
  border-top: 1px solid rgba(255,255,255,0.08);
  margin-top: 12px;
  flex-shrink: 0;
}

.drawer-actions a {
  text-align: center;
  padding: 10px 14px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: bold;
  display: block;
  font-family: Georgia, serif;
}

.drawer-actions .btn-book-side {
  background: #1650cd;
  color: white;
  border: 1px solid #1650cd;
}

.drawer-actions .btn-book-side:hover {
  background: #123e9c;
}

body.drawer-open {
  overflow: hidden;
  position: fixed;
  width: 100%;
}


.btn-book-side {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  color: #94a3b8;
  border-radius: 8px;
  font-size: 13px;
  font-weight: bold;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
  cursor: pointer;
  font-family: Georgia, serif;
}

.btn-book-side:hover {
  background: rgba(255,255,255,0.1);
  color: white;
  border-color: rgba(255,255,255,0.2);
}

@media (max-width: 768px) {
  .sidebar {
    display: none !important;
  }
  .main-content-wrapper {
    margin-left: 0 !important;
    width: 100% !important;
  }
  .mobile-top-nav {
    display: flex !important;
  }
  .hamburger {
    display: flex !important;
  }
}