/* ============================================================
   Shared Sidebar Styles
   ============================================================ */

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  backdrop-filter: blur(2px);
  z-index: 900;
  transition: opacity 0.3s ease;
  opacity: 0;
}
.sidebar-overlay.open { display: block; opacity: 1; }

@media (min-width: 769px) {
  .sidebar-overlay { display: none !important; }
}

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 260px;
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  z-index: 950;
  transform: translateX(0);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.sidebar-scroll {
  flex: 1;
  overflow-y: auto;
}
/* Desktop: sidebar always visible, never collapses */
@media (min-width: 769px) {
  .sidebar { transform: translateX(0) !important; }
  .page-wrapper { margin-left: 260px !important; }
  .hamburger-btn, .sidebar-toggle { display: none !important; }
  .sidebar-close { display: none !important; }
}

/* Mobile: sidebar hidden by default, slides in as overlay */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.mobile-open { transform: translateX(0); }
  .page-wrapper { margin-left: 0 !important; }
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.25rem;
  border-bottom: 1px solid var(--border);
  height: 52px;
  flex-shrink: 0;
  box-sizing: border-box;
}
.sidebar-header-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text-heading);
}
.sidebar-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 6px;
  transition: color 0.15s, background 0.15s;
  display: flex;
}
.sidebar-close:hover { color: var(--text); background: var(--bg-hover); }

.sidebar-section {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-light);
}
.sidebar-section:last-child { border-bottom: none; }

.sidebar-profile {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0;
  text-decoration: none;
  color: var(--text);
  border-radius: 8px;
  transition: opacity 0.15s;
}
.sidebar-profile:hover { opacity: 0.8; }
.sidebar-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bg-hover);
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
  color: var(--text-muted);
}
.sidebar-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.sidebar-profile-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.sidebar-profile-name {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-heading);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-profile-title {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 500;
}

.sidebar-checklists-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  margin-top: 0.6rem;
  padding: 0.5rem 0.75rem;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--blue);
  background: rgba(59,130,246,0.08);
  border: 1px solid rgba(59,130,246,0.15);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s;
}
.sidebar-checklists-btn:hover {
  background: rgba(59,130,246,0.14);
  border-color: rgba(59,130,246,0.25);
}

.sidebar-section-title {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 0.6rem;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.65rem;
  border-radius: 8px;
  text-decoration: none;
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
  margin-bottom: 0.15rem;
}
.sidebar-link:hover { background: var(--bg-hover); color: var(--blue); }
.sidebar-emoji { font-size: 1.1rem; flex-shrink: 0; width: 22px; text-align: center; }
.sidebar-link-planned {
  opacity: 0.45;
  cursor: default;
  pointer-events: none;
}
.sidebar-link-planned::after {
  content: 'Soon';
  font-size: 0.6rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  background: var(--bg-input);
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  margin-left: auto;
}

.sidebar-info {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.6;
}
.sidebar-info strong {
  color: var(--text-heading);
  font-weight: 600;
}
.sidebar-info-row {
  display: flex;
  justify-content: space-between;
  padding: 0.3rem 0;
}
.sidebar-info-label { color: var(--text-muted); font-size: 0.75rem; }
.sidebar-info-value { font-weight: 600; font-size: 0.8rem; }

.sidebar-contact-card {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border-light);
}
.sidebar-contact-card:last-child { border-bottom: none; }
.sidebar-contact-name {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-heading);
  margin-bottom: 0.3rem;
}
.sidebar-contact-links {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.sidebar-contact-link {
  font-size: 0.75rem;
  color: var(--blue);
  text-decoration: none;
  transition: color 0.15s;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sidebar-contact-link:hover { color: var(--blue-dark); text-decoration: underline; }

.sidebar-footer {
  flex-shrink: 0;
  padding: 0.75rem 1.25rem;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.sidebar-logout-btn {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.35rem 0.6rem;
  border-radius: 8px;
  transition: all 0.15s;
}
.sidebar-logout-btn:hover {
  color: #dc2626;
  background: rgba(239,68,68,0.08);
}
.sidebar-settings-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  color: var(--text-muted);
  transition: all 0.2s ease;
}
.sidebar-settings-btn:hover {
  color: var(--text);
  background: var(--bg-hover);
}

.hamburger-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.45rem;
  cursor: pointer;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}
.hamburger-btn:hover { border-color: var(--blue); color: var(--text); background: var(--bg-hover); }
.hamburger-btn svg { width: 18px; height: 18px; }

/* Mobile: sidebar is overlay, not push */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    z-index: 950;
  }
  .sidebar.mobile-open {
    transform: translateX(0);
  }
  .page-wrapper {
    margin-left: 0 !important;
  }
}

.back-btn {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  transition: color 0.15s;
}
.back-btn:hover { color: var(--blue); }
.back-btn svg { width: 14px; height: 14px; }
