/*
 * App shell layout — account bar, sidebar, content area.
 * Three-pane on desktop, stacked on mobile.
 */

.app-shell {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* Account bar — narrow vertical strip on the left */
.account-bar {
  width: var(--account-bar-width);
  min-width: var(--account-bar-width);
  background: var(--bg-account-bar);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.75rem 0;
  gap: 0.5rem;
  border-right: 1px solid var(--border-subtle);
  overflow-y: auto;
}

.account-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-surface-raised);
  color: var(--text-secondary);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  text-transform: uppercase;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all var(--transition-fast);
}
.account-icon:hover {
  background: var(--bg-surface-hover);
  color: var(--text-primary);
}
.account-icon.active {
  border-color: var(--accent);
  color: var(--text-primary);
}
.account-initial {
  pointer-events: none;
}

.add-account {
  margin-top: auto;
}
.account-add-icon {
  font-size: var(--text-lg);
  font-weight: var(--weight-normal);
  color: var(--text-tertiary);
}

/* Main area — sidebar + content */
.app-main {
  flex: 1;
  display: flex;
  overflow: hidden;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  background: var(--bg-sidebar);
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border-subtle);
  overflow-y: auto;
}

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

.sidebar-nav {
  flex: 1;
  padding: 0 0.5rem;
}

.nav-compose-btn {
  display: block;
  text-align: center;
  padding: 0.5rem 1rem;
  margin: 0 0.5rem 0.75rem;
  background: var(--bg-btn-primary);
  color: var(--text-btn-primary);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  transition: opacity var(--transition-fast);
  text-decoration: none;
}
.nav-compose-btn:hover {
  opacity: 0.9;
  text-decoration: none;
}

.nav-group {
  margin-bottom: 0.25rem;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0.75rem;
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  color: var(--text-secondary);
  text-decoration: none;
  transition: all var(--transition-fast);
  cursor: pointer;
  background: none;
  border: none;
  width: 100%;
  font-family: var(--font-sans);
  text-align: left;
}
.nav-item:hover {
  background: var(--bg-surface-hover);
  color: var(--text-primary);
  text-decoration: none;
}
.nav-item.active {
  background: var(--bg-surface-active);
  color: var(--text-primary);
}

.nav-icon {
  font-size: var(--text-base);
  width: 1.25rem;
  text-align: center;
  flex-shrink: 0;
}
.nav-label {
  flex: 1;
}
.nav-badge {
  background: var(--accent);
  color: var(--text-btn-primary);
  font-size: var(--text-xs);
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
  font-weight: var(--weight-semibold);
}

.sidebar-footer {
  padding: 0.5rem;
  border-top: 1px solid var(--border-subtle);
}
.nav-logout {
  color: var(--text-tertiary);
}

/* Content area */
.content {
  flex: 1;
  overflow-y: auto;
  background: var(--bg-surface);
  padding: 1.5rem;
}

/* Auth layout (login) */
.auth-layout {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 2rem;
}

.login-card {
  width: 100%;
  max-width: 400px;
}
.login-header {
  margin-bottom: 2rem;
  text-align: center;
}
.login-logo {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-lg);
  margin-bottom: 1rem;
}
.login-title {
  font-size: var(--text-2xl);
  margin-bottom: 0.25rem;
}
.login-subtitle {
  color: var(--text-secondary);
  font-size: var(--text-sm);
}
.login-form {
  display: flex;
  flex-direction: column;
}

.toggle-advanced {
  background: none;
  border: none;
  color: var(--text-tertiary);
  font-size: var(--text-sm);
  cursor: pointer;
  padding: 0.25rem 0;
  margin-bottom: 0.75rem;
  text-align: left;
  font-family: var(--font-sans);
}
.toggle-advanced:hover {
  color: var(--text-secondary);
}

.advanced-fields {
  margin-bottom: 0.5rem;
}

/* Responsive */
@media (max-width: 768px) {
  .account-bar {
    display: none;
  }
  .sidebar {
    display: none;
  }
  .content {
    padding: 1rem;
  }
}
