/* ==========================================================================
   Mobile Navigation Drawer (Simple & Direct)
   ========================================================================== */

/* Toggle Button */
.mobile-nav-toggle {
  display: none;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.4rem 0.5rem;
  color: var(--text);
  cursor: pointer;
  line-height: 0;
}

@media (max-width: 768px) {
  .mobile-nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  header nav ul,
  header nav aside {
    display: none !important;
  }
}

/* Drawer Overlay */
.mobile-drawer {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 100;
}

.mobile-drawer.open {
  display: block;
}

.mobile-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(2px);
}

.mobile-drawer-sheet {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(290px, 82vw);
  background: var(--surface);
  z-index: 101;
  display: flex;
  flex-direction: column;
  padding: 1.25rem 1rem;
  gap: 1rem;
  overflow-y: auto;
  box-shadow: -2px 0 12px rgba(0, 0, 0, 0.15);
}

.drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.drawer-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: var(--primary);
  font-weight: 700;
  font-size: 1.1rem;
}

.drawer-close {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.35rem;
  line-height: 0;
}

.drawer-user-card {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.75rem;
  background: var(--surface-alt);
  border-radius: var(--radius-sm);
}

.drawer-user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary-subtle);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.drawer-user-info {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  gap: 0.2rem;
}

.drawer-user-info strong {
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.drawer-user-meta {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.drawer-user-meta small {
  color: var(--text-muted);
  font-size: 0.75rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.drawer-role-badge {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  background: var(--primary-subtle);
  color: var(--primary);
}

.drawer-role-badge[data-role="admin"] {
  background: #fef3c7;
  color: #92400e;
}

.drawer-nav {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.drawer-nav a {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.65rem 0.75rem;
  border-radius: var(--radius-sm);
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  min-height: 44px;
}

.drawer-nav a:hover,
.drawer-nav a[aria-current="page"] {
  background: var(--primary-subtle);
  color: var(--primary);
  font-weight: 600;
}

.drawer-footer {
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.drawer-logout-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid var(--danger-border);
  padding: 0.65rem 1rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.9rem;
  min-height: 42px;
  cursor: pointer;
}
