/* App wrapper */
.app {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  height: 100dvh;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  z-index: var(--z-sidebar);
  overflow-y: auto;
}

.sidebar-logo {
  padding: var(--space-6) var(--space-5);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
}

.sidebar-logo img {
  height: 32px;
  width: auto;
}

.sidebar-nav {
  flex: 1;
  padding: var(--space-4) 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  overflow-y: auto;
  min-height: 0;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-5);
  color: var(--text-secondary);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  border-radius: 0;
  transition: all var(--transition);
  cursor: pointer;
  position: relative;
  text-decoration: none;
}

.nav-item:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.nav-item.active {
  color: var(--gold);
  background: var(--gold-subtle);
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--gold);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.nav-item svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.sidebar-bottom {
  padding: var(--space-4) var(--space-5);
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.sidebar-user-avatar {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background: var(--gold-subtle);
  border: 1px solid var(--gold-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  flex-shrink: 0;
}

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

.sidebar-user-name {
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-plan {
  font-size: var(--text-xs);
  color: var(--text-muted);
}

/* Main content */
.main {
  margin-left: var(--sidebar-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-width: 0;
}

/* Topbar */
.topbar {
  height: var(--topbar-height);
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-8);
  position: sticky;
  top: 0;
  z-index: var(--z-topbar);
}

.topbar-title {
  font-size: var(--text-lg);
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

/* Page content */
.page {
  flex: 1;
  padding: var(--space-8);
  background: var(--bg-primary);
  min-width: 0;
  overflow-x: hidden;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-6);
}

.page-title {
  font-size: var(--text-xl);
  font-weight: var(--weight-semibold);
}

.page-subtitle {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  margin-top: var(--space-1);
}

/* Auth layout */
.auth-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-primary);
  padding: var(--space-6);
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-10);
  box-shadow: var(--shadow-lg);
}

.auth-logo {
  display: flex;
  justify-content: center;
  margin-bottom: var(--space-8);
}

.auth-logo img {
  height: 40px;
  width: auto;
}

.auth-title {
  text-align: center;
  font-size: var(--text-xl);
  font-weight: var(--weight-bold);
  margin-bottom: var(--space-2);
}

.auth-subtitle {
  text-align: center;
  font-size: var(--text-sm);
  color: var(--text-secondary);
  margin-bottom: var(--space-8);
}

/* Pending state */
.pending-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-primary);
}

.pending-card {
  max-width: 480px;
  text-align: center;
  padding: var(--space-12);
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
}

.pending-icon {
  width: 56px;
  height: 56px;
  background: var(--gold-subtle);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--space-6);
  color: var(--gold);
}

.pending-title {
  font-size: var(--text-xl);
  font-weight: var(--weight-bold);
  margin-bottom: var(--space-3);
}

.pending-text {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: 1.7;
}

/* Auth two-panel layout */
.auth-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: stretch;
  background: var(--bg-primary);
}

.auth-left {
  flex: 1;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-12);
}

.auth-left-inner {
  max-width: 480px;
}

.auth-left-logo {
  height: 36px;
  width: auto;
  margin-bottom: var(--space-10);
}

.auth-left-headline {
  font-size: 42px;
  font-weight: var(--weight-bold);
  line-height: 1.15;
  margin-bottom: var(--space-5);
  color: var(--text-primary);
}

.auth-left-highlight {
  color: var(--gold);
}

.auth-left-sub {
  font-size: var(--text-md);
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: var(--space-8);
}

.auth-features {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.auth-feature {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

.auth-feature-dot {
  width: 6px;
  height: 6px;
  border-radius: var(--radius-full);
  background: var(--gold);
  flex-shrink: 0;
}

.auth-right {
  width: 480px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-10);
  flex-shrink: 0;
}

.auth-card {
  width: 100%;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-8);
  box-shadow: var(--shadow-lg);
}

.auth-logo {
  display: flex;
  justify-content: center;
  margin-bottom: var(--space-6);
}

.auth-logo img {
  height: 44px;
  width: auto;
}

.auth-tabs {
  display: flex;
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  padding: 3px;
  margin-bottom: var(--space-6);
}

.auth-tab {
  flex: 1;
  height: 34px;
  border-radius: calc(var(--radius-md) - 2px);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--text-muted);
  transition: all var(--transition);
  cursor: pointer;
}

.auth-tab.active {
  background: var(--bg-secondary);
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
}

.auth-tab:hover:not(.active) {
  color: var(--text-secondary);
}

.auth-form {
  display: flex;
  flex-direction: column;
}

.auth-form.hidden {
  display: none;
}

.auth-disclaimer {
  font-size: var(--text-xs);
  color: var(--text-muted);
  text-align: center;
  margin-top: var(--space-4);
  line-height: 1.6;
}


.hamburger-btn {
  display: none;
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  cursor: pointer;
}

.hamburger-btn svg {
  width: 20px;
  height: 20px;
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 99;
}

@media (max-width: 768px) {
    .auth-wrapper {
    flex-direction: column;
  }

    .auth-left {
    padding: var(--space-6);
    border-right: none;
    border-bottom: 1px solid var(--border);
    border-radius: var(--radius-xl);  }

  .auth-left-headline {
    font-size: 28px;
  }

  .auth-features {
    display: none;
  }

  .auth-right {
    width: 100%;
    padding: var(--space-6);
  }

  .sidebar {
    transform: translateX(-100%);
    transition: transform var(--transition-slow);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .main {
    margin-left: 0;
  }

  .hamburger-btn {
    display: flex;
  }

  .sidebar-overlay.open {
    display: block;
  }

  .chip-input-row {
  flex-wrap: wrap;
}

  .chip-input-row .form-input {
    min-width: 180px;
  }
}