/*
 * sidebar-tw.css
 * Phase 3 — Premium Tailwind-based overhaul of the global sidebar & header.
 * This file REPLACES the sidebar rules in style.css / mobile.css / desktop.css
 * while keeping the exact same HTML class names so no HTML changes are needed.
 */

/* ──────────────────────────────────────────────────
   TOP HEADER BAR
─────────────────────────────────────────────────── */
.top-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(16, 42, 67, 0.08);
  box-shadow: 0 2px 10px rgba(16, 42, 67, 0.05);
  transition: box-shadow 0.3s ease;
}

.top-header .logo {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 20px;
  font-weight: 800;
  color: #102a43;
  text-decoration: none;
  letter-spacing: -0.5px;
}

.top-header .logo span {
  color: #3b82f6;
}

.mobile-menu-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: #f0f4f8;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
  font-size: 22px;
  color: #334e68;
}

.mobile-menu-icon:hover {
  background: #dbeafe;
  color: #3b82f6;
  transform: scale(1.05);
}

/* ──────────────────────────────────────────────────
   DESKTOP SIDEBAR
─────────────────────────────────────────────────── */
.desktop-sidebar {
  position: fixed;
  top: 62px;
  left: 0;
  bottom: 0;
  width: 230px;
  background: #ffffff;
  border-right: 1px solid #d9e2ec;
  box-shadow: 2px 0 10px rgba(16, 42, 67, 0.04);
  overflow-y: auto;
  overflow-x: hidden;
  padding: 16px 10px 24px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  scrollbar-width: thin;
  scrollbar-color: #d9e2ec transparent;
}

.desktop-sidebar::-webkit-scrollbar { width: 4px; }
.desktop-sidebar::-webkit-scrollbar-thumb { background: #d9e2ec; border-radius: 4px; }

/* Main layout shift for desktop sidebar */
.main-layout {
  display: flex;
  min-height: calc(100vh - 62px);
  margin-top: 62px;
}

.main-content-area {
  flex: 1;
  min-width: 0;
}

@media (min-width: 769px) {
  .main-content-area {
    margin-left: 230px;
  }
}

@media (max-width: 768px) {
  .desktop-sidebar { display: none; }
  .main-layout { margin-top: 62px; }
}

/* Sidebar Nav Links */
.sidebar-nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 10px;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: #334e68;
  text-decoration: none;
  background: transparent;
  border: none;
  width: 100%;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, transform 0.15s ease;
  white-space: nowrap;
}

.sidebar-nav-link i {
  font-size: 18px;
  flex-shrink: 0;
  color: #627d98;
  transition: color 0.2s;
}

.sidebar-nav-link:hover {
  background: #eff6ff;
  color: #2563eb;
  transform: translateX(3px);
}

.sidebar-nav-link:hover i { color: #3b82f6; }

.sidebar-nav-link.active {
  background: linear-gradient(135deg, #dbeafe, #eff6ff);
  color: #2563eb;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.15);
}

.sidebar-nav-link.active i { color: #3b82f6; }

/* Dropdown content */
.sidebar-dropdown-content {
  margin-top: 2px;
  border-radius: 8px;
  background: #f8fafc;
  overflow: hidden;
}

.sidebar-dropdown-content .sidebar-nav-link {
  font-size: 13px;
  padding: 8px 12px 8px 18px;
  font-weight: 500;
  border-radius: 8px;
}

/* Chevron on dropdown buttons */
.sidebar-nav-link .bx-chevron-down {
  margin-left: auto !important;
  font-size: 16px !important;
}

/* ──────────────────────────────────────────────────
   MOBILE SIDEBAR (DRAWER)
─────────────────────────────────────────────────── */
.mobile-sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: 290px;
  z-index: 200;
  background: #ffffff;
  box-shadow: 6px 0 40px rgba(16, 42, 67, 0.15);
  transform: translateX(-100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.mobile-sidebar.active {
  transform: translateX(0);
}

/* Sidebar User Block */
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 18px 16px;
  border-bottom: 1px solid #d9e2ec;
  background: linear-gradient(135deg, #f0f9ff 0%, #eff6ff 100%);
  flex-shrink: 0;
}

.user-pic {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #dbeafe;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  color: #3b82f6;
  flex-shrink: 0;
}

.user-details {
  flex: 1;
  min-width: 0;
}

.user-details h4 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: #102a43;
  margin: 0 0 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-details a {
  font-size: 12px;
  color: #3b82f6;
  text-decoration: none;
  font-weight: 600;
}

.user-details a:hover { text-decoration: underline; }

.close-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: none;
  background: #fee2e2;
  color: #ef4444;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.2s, transform 0.15s;
}

.close-btn:hover { background: #fca5a5; transform: scale(1.1); }

/* Sidebar Links Container */
.sidebar-links {
  flex: 1;
  padding: 10px 10px 20px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
}

.sidebar-links a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 10px;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: #334e68;
  text-decoration: none;
  transition: background 0.2s, color 0.2s;
}

.sidebar-links a i {
  font-size: 18px;
  color: #627d98;
  transition: color 0.2s;
}

.sidebar-links a:hover,
.sidebar-links a.active {
  background: #eff6ff;
  color: #2563eb;
}

.sidebar-links a:hover i { color: #3b82f6; }

/* Mobile section labels */
.menu-label {
  font-family: 'Inter', sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: #829ab1;
  padding: 10px 14px 4px;
  margin: 0;
}

/* Overlay */
.sidebar-overlay {
  position: fixed;
  inset: 0;
  z-index: 199;
  background: rgba(16, 42, 67, 0.45);
  backdrop-filter: blur(3px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.sidebar-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* ──────────────────────────────────────────────────
   FOOTER
─────────────────────────────────────────────────── */
.main-footer {
  background: #f0f4f8;
  border-top: 1px solid #d9e2ec;
  padding: 20px 24px;
  text-align: center;
  font-family: 'Inter', sans-serif;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  justify-content: center;
  margin-bottom: 10px;
}

.footer-links a {
  font-size: 12px;
  font-weight: 600;
  color: #486581;
  text-decoration: none;
  padding: 4px 10px;
  border-radius: 20px;
  background: #d9e2ec;
  transition: background 0.2s, color 0.2s;
}

.footer-links a:hover {
  background: #3b82f6;
  color: #fff;
}

.main-footer p {
  font-size: 12px;
  color: #829ab1;
}
