body {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: 100vh;
}

.text-muted {
  color: #b0b0bc !important;
}

#app-content {
  display: grid;
  grid-template-columns: 220px 1fr;
  grid-template-rows: 100vh;
}

.login-screen {
  position: fixed;
  inset: 0;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1040;
  padding: var(--space-4);
}

.login-card {
  width: 100%;
  max-width: 380px;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  animation: fadeInUp 0.5s var(--ease);
}

.login-header {
  text-align: center;
  margin-bottom: var(--space-2);
}

.login-header .brand-icon {
  font-size: 32px;
  display: block;
  margin-bottom: var(--space-2);
}

.login-header .brand-name {
  font-size: 1.5rem;
  margin-bottom: var(--space-1);
}

.login-error {
  color: var(--danger);
  font-size: 0.82rem;
  text-align: center;
  min-height: 20px;
}

.login-btn {
  width: 100%;
  justify-content: center;
  margin-top: var(--space-2);
}

.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: var(--space-6) 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
  transition: transform 0.3s var(--ease);
}

.sidebar__brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 0 var(--space-6) var(--space-8);
  border-bottom: 1px solid var(--border-soft);
}

.brand-icon {
  font-size: 22px;
  color: var(--gold);
  line-height: 1;
  filter: drop-shadow(0 0 8px var(--gold));
  animation: pulse-gold 3s ease-in-out infinite;
}

.brand-name {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.02em;
}

.sidebar__nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  padding: var(--space-6) var(--space-3);
  overflow-y: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius);
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 400;
  transition: all 0.2s var(--ease);
  position: relative;
}

.nav-item svg {
  flex-shrink: 0;
  transition: color 0.2s var(--ease);
}

.nav-item:hover {
  background: var(--surface-2);
  color: var(--text);
}

.nav-item--active {
  background: var(--gold-glow);
  color: var(--gold-light);
  border: 1px solid rgba(201, 168, 76, 0.2);
}

.nav-item--active svg {
  color: var(--gold);
}

.nav-item--active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 60%;
  background: var(--gold);
  border-radius: 0 2px 2px 0;
}

.sidebar__footer {
  padding: var(--space-6) var(--space-4) 0;
  border-top: 1px solid var(--border-soft);
}

.user-pill {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3);
  border-radius: var(--radius);
  transition: background 0.2s var(--ease);
}

.user-pill:hover {
  background: var(--surface-2);
  cursor: pointer;
}

.user-avatar {
  width: 34px;
  height: 34px;
  background: linear-gradient(135deg, var(--gold-dim), var(--gold));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--bg);
  flex-shrink: 0;
}

.user-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.user-name {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text);
}

.user-role {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.main {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  height: 100vh;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-5) var(--space-6);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  animation: fadeIn 0.4s var(--ease);
  flex-wrap: wrap;
  gap: var(--space-4);
}

.topbar__left {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 250px;
}

.page-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1;
}

.page-subtitle {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.topbar__actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.workspace {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  flex: 1;
  overflow: hidden;
}

.form-panel {
  overflow-y: auto;
  padding: var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  border-right: 1px solid var(--border);
  animation: fadeInUp 0.5s var(--ease);
}

.preview-panel {
  overflow-y: auto;
  background: #0a0a0e;
  display: flex;
  flex-direction: column;
  animation: fadeInUp 0.5s var(--ease) 0.1s both;
}

.preview-label {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-faint);
  padding: var(--space-4) var(--space-6);
  border-bottom: 1px solid var(--border-soft);
  flex-shrink: 0;
  background: var(--surface);
}

.preview-scroll {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-6);
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

@media (max-width: 992px) {
  #app-content {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    z-index: 1000;
    transform: translateX(-100%);
  }

  .main {
    height: auto;
    overflow: visible;
  }

  .workspace {
    grid-template-columns: 1fr;
  }

  .form-panel, .preview-panel {
    border-right: none;
    height: auto;
    overflow: visible;
  }
}

@media (max-width: 576px) {
  .topbar {
    padding: var(--space-4);
  }
  .form-panel, .preview-scroll {
    padding: var(--space-4);
  }
}