*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --surface-0: #0d0d12;
  --surface-1: #14141c;
  --surface-2: #1c1c28;
  --surface-3: #252534;
  --border: #2a2a3e;
  --border-active: #4a4a6a;
  --text-primary: #e8e8f0;
  --text-secondary: #8888a8;
  --text-muted: #5a5a78;
  --accent: #ff6b35;
  --accent-dim: #ff6b3520;
  --accent-hover: #ff8555;
  --danger: #ff4757;
  --success: #2ed573;
  --radius: 8px;
  --radius-sm: 4px;
  --font-ui: 'DM Sans', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

html, body {
  height: 100%;
  font-family: var(--font-ui);
  background: var(--surface-0);
  color: var(--text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-1);
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-icon {
  font-size: 20px;
  color: var(--accent);
}

.header-brand h1 {
  font-size: 18px;
  font-weight: 500;
  letter-spacing: -0.02em;
}

.accent {
  color: var(--accent);
}

.app-layout {
  display: grid;
  grid-template-columns: 400px 1fr;
  height: calc(100vh - 61px);
}

.sidebar {
  background: var(--surface-1);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.tab-nav {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  padding: 0 12px;
  overflow-x: auto;
}

.tab-btn {
  padding: 12px 14px;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: color 0.2s, border-color 0.2s;
  white-space: nowrap;
}

.tab-btn:hover {
  color: var(--text-primary);
}

.tab-btn.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.panels-container {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

.panel-content {
  display: none;
}

.panel-content.active {
  display: block;
}

.preview-pane {
  display: flex;
  flex-direction: column;
  background: var(--surface-0);
}

.preview-header {
  padding: 12px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-1);
}

.preview-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  font-weight: 600;
}

.toast-notification {
  position: fixed;
  bottom: 24px;
  right: 24px;
  padding: 12px 20px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  z-index: 9999;
  transform: translateY(20px);
  opacity: 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.toast-notification.visible {
  transform: translateY(0);
  opacity: 1;
}

.toast-success {
  background: var(--success);
  color: #0d0d12;
}

.toast-error {
  background: var(--danger);
  color: #fff;
}

@media (max-width: 900px) {
  .app-layout {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr 300px;
  }
  .preview-pane {
    border-top: 1px solid var(--border);
  }
}
