/* Sidebar Navigation */

/* Full-screen shell: sidebar + content */
.app-shell {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  background-color: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  z-index: 100;
  overflow-y: auto;
}

/* Brand / Logo area */
.sidebar__brand {
  padding: 1.25rem 1rem;
  border-bottom: 1px solid var(--sidebar-border);
}

.sidebar__logo-link {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  text-decoration: none;
  color: white;
}

.sidebar__logo-link:hover {
  color: white;
  text-decoration: none;
}

.sidebar__logo-icon {
  flex-shrink: 0;
}

.sidebar__logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.sidebar__logo-name {
  font-size: 0.875rem;
  font-weight: 700;
  color: white;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.sidebar__logo-sub {
  font-size: 0.7rem;
  color: var(--sidebar-text);
  font-weight: 400;
  letter-spacing: 0.01em;
}

/* Nav */
.sidebar__nav {
  flex: 1;
  padding: 1rem 0;
}

.sidebar__nav-list {
  list-style: none;
  margin: 0;
  padding: 0 0.5rem;
}

.sidebar__nav-item {
  margin: 0;
}

.sidebar__nav-link {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.5rem 0.75rem;
  border-radius: var(--border-radius-sm);
  color: var(--sidebar-text);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: background-color var(--transition-speed) var(--transition-timing),
              color var(--transition-speed) var(--transition-timing);
  margin-bottom: 1px;
}

.sidebar__nav-link:hover {
  background-color: var(--sidebar-bg-hover);
  color: var(--sidebar-text-hover);
}

.sidebar__nav-link--active {
  background-color: var(--sidebar-bg-active);
  color: var(--sidebar-text-active);
}

.sidebar__nav-icon {
  flex-shrink: 0;
  opacity: 0.8;
}

.sidebar__nav-link--active .sidebar__nav-icon,
.sidebar__nav-link:hover .sidebar__nav-icon {
  opacity: 1;
}

/* Section label */
.sidebar__section-label {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--sidebar-section-label);
  padding: 1rem 1.25rem 0.375rem;
}

/* Footer: user info + sign out */
.sidebar__footer {
  padding: 0.75rem 0.5rem;
  border-top: 1px solid var(--sidebar-border);
}

.sidebar__user {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  margin-bottom: 0.25rem;
}

.sidebar__user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background-color: var(--color-primary);
  color: white;
  font-size: 0.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sidebar__user-info {
  flex: 1;
  min-width: 0;
}

.sidebar__user-email {
  font-size: 0.75rem;
  color: var(--sidebar-text);
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar__signout {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  border-radius: var(--border-radius-sm);
  color: var(--sidebar-text);
  text-decoration: none;
  font-size: 0.8125rem;
  font-weight: 500;
  transition: background-color var(--transition-speed) var(--transition-timing),
              color var(--transition-speed) var(--transition-timing);
  width: 100%;
}

.sidebar__signout:hover {
  background-color: var(--sidebar-bg-hover);
  color: var(--sidebar-text-hover);
}

/* Main content area (offset by sidebar width) */
.app-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  min-width: 0;
  display: flex;
  flex-direction: column;
  background-color: var(--color-background);
}

.main-content {
  flex: 1;
  padding: 2rem 2.5rem;
}

.main-content--unauthenticated {
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* Flash messages */
.flash-messages {
  padding: 1rem 2.5rem 0;
}

.flash-messages--standalone {
  max-width: 600px;
  margin: 1rem auto;
  padding: 0 1.5rem;
}

/* Page header */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.75rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--color-border);
}

/* When page-header is used as a plain title block (no flex children) */
.page-header > h1,
.page-header > .page-header__title {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--color-text-dark);
  margin-bottom: 0;
  line-height: 1.2;
}

.page-header__title {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--color-text-dark);
  margin-bottom: 0.25rem;
  line-height: 1.2;
}

.page-header__description {
  font-size: 0.875rem;
  color: var(--color-text-light);
  margin-bottom: 0;
  margin-top: 0.25rem;
}

.page-header__actions {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
  align-items: center;
}

/* Back link */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.8125rem;
  color: var(--color-text-light);
  text-decoration: none;
  margin-bottom: 0.5rem;
}

.back-link:hover {
  color: var(--color-text);
}

/* Legacy nav classes (kept for compatibility) */
.app-nav {
  display: none;
}

.app-header {
  display: none;
}
