/* ================================================================
   NIYAZ WEB AI — DESIGN SYSTEM v2.0
   Precision Workspace · Dark-First · World-Class SaaS
   ================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Plus+Jakarta+Sans:wght@500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

/* ----------------------------------------------------------------
   0. CSS CUSTOM PROPERTIES
   ---------------------------------------------------------------- */
:root {
  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-heading: 'Plus Jakarta Sans', 'Inter', -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;

  /* Type Scale */
  --text-xs: 0.6875rem;   /* 11px */
  --text-sm: 0.8125rem;   /* 13px */
  --text-base: 0.875rem;  /* 14px */
  --text-md: 0.9375rem;   /* 15px */
  --text-lg: 1.0625rem;   /* 17px */
  --text-xl: 1.25rem;     /* 20px */
  --text-2xl: 1.5rem;     /* 24px */
  --text-3xl: 2rem;       /* 32px */
  --text-4xl: 2.5rem;     /* 40px */
  --text-5xl: 3.25rem;    /* 52px */

  /* Spacing (4px grid) */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 20px;
  --sp-6: 24px;
  --sp-7: 28px;
  --sp-8: 32px;
  --sp-10: 40px;
  --sp-12: 48px;
  --sp-16: 64px;
  --sp-20: 80px;
  --sp-24: 96px;

  /* Dark Palette — Warm Neutral */
  --gray-950: #0a0b0e;
  --gray-900: #0f1117;
  --gray-850: #13151c;
  --gray-800: #181b24;
  --gray-750: #1c1f2a;
  --gray-700: #232732;
  --gray-600: #2e3340;
  --gray-500: #3d4354;
  --gray-400: #565e73;
  --gray-300: #8891a5;
  --gray-200: #b0b8cc;
  --gray-100: #d4d9e4;
  --gray-50: #ebeef5;
  --white: #f8f9fc;

  /* Brand — Coral Accent System */
  --coral-600: #e05535;
  --coral-500: #ff6b4a;
  --coral-400: #ff8a6e;
  --coral-300: #ffb09a;
  --coral-glow: rgba(255, 107, 74, 0.15);
  --coral-glow-strong: rgba(255, 107, 74, 0.25);

  /* Secondary — Electric Blue */
  --blue-500: #3b82f6;
  --blue-400: #60a5fa;
  --blue-glow: rgba(59, 130, 246, 0.15);

  /* Semantic */
  --success-500: #10b981;
  --success-bg: rgba(16, 185, 129, 0.12);
  --success-border: rgba(16, 185, 129, 0.25);
  --warning-500: #f59e0b;
  --warning-bg: rgba(245, 158, 11, 0.12);
  --warning-border: rgba(245, 158, 11, 0.25);
  --error-500: #ef4444;
  --error-bg: rgba(239, 68, 68, 0.1);
  --error-border: rgba(239, 68, 68, 0.25);
  --info-500: #3b82f6;
  --info-bg: rgba(59, 130, 246, 0.1);
  --info-border: rgba(59, 130, 246, 0.25);

  /* Surface System */
  --bg: var(--gray-950);
  --bg-raised: var(--gray-900);
  --surface: var(--gray-850);
  --surface-hover: var(--gray-800);
  --surface-active: var(--gray-750);
  --panel: var(--gray-900);
  --panel-header: var(--gray-850);
  --glass: rgba(15, 17, 23, 0.92);

  /* Borders */
  --border: rgba(255, 255, 255, 0.06);
  --border-subtle: rgba(255, 255, 255, 0.04);
  --border-hover: rgba(255, 255, 255, 0.1);
  --border-active: var(--coral-500);
  --border-focus: var(--coral-500);

  /* Text */
  --text-primary: var(--gray-50);
  --text-secondary: var(--gray-300);
  --text-muted: var(--gray-400);
  --text-disabled: var(--gray-500);

  /* Elevation */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 24px var(--coral-glow);
  --shadow-focus: 0 0 0 2px var(--bg), 0 0 0 4px var(--coral-500);

  /* Radius */
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-2xl: 20px;
  --radius-full: 9999px;

  /* Layout */
  --sidebar-width: 220px;
  --topbar-height: 48px;
  --container-max: 1200px;

  /* Transitions */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
  --duration-fast: 120ms;
  --duration-normal: 200ms;
  --duration-slow: 350ms;
}

/* ----------------------------------------------------------------
   1. RESET & BASE
   ---------------------------------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  background-color: var(--bg);
  color: var(--text-primary);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  min-height: 100vh;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  line-height: 1.2;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  cursor: pointer;
}

img {
  max-width: 100%;
  display: block;
}

/* Scrollbars */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--gray-600); border-radius: var(--radius-full); }
::-webkit-scrollbar-thumb:hover { background: var(--gray-500); }

/* Selection */
::selection {
  background: var(--coral-glow-strong);
  color: var(--text-primary);
}

/* ----------------------------------------------------------------
   2. LAYOUT PRIMITIVES
   ---------------------------------------------------------------- */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--sp-6);
  width: 100%;
}

.section-padding {
  padding: var(--sp-16) 0;
}

/* ----------------------------------------------------------------
   3. BUTTONS
   ---------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-4);
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
  border: 1px solid transparent;
  white-space: nowrap;
  outline: none;
  line-height: 1.4;
  text-decoration: none;
}

.btn:focus-visible {
  box-shadow: var(--shadow-focus);
}

.btn-primary {
  background: var(--coral-500);
  color: #ffffff;
  border-color: var(--coral-500);
}
.btn-primary:hover {
  background: var(--coral-600);
  border-color: var(--coral-600);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px var(--coral-glow-strong);
}
.btn-primary:active {
  transform: translateY(0);
}
.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-secondary {
  background: var(--surface);
  color: var(--text-primary);
  border-color: var(--border-hover);
}
.btn-secondary:hover {
  background: var(--surface-hover);
  border-color: var(--gray-500);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: transparent;
}
.btn-ghost:hover {
  background: var(--surface);
  color: var(--text-primary);
}

.btn-danger {
  background: var(--error-bg);
  color: var(--error-500);
  border-color: var(--error-border);
}
.btn-danger:hover {
  background: rgba(239, 68, 68, 0.18);
  border-color: var(--error-500);
}

.btn-sm {
  padding: var(--sp-1) var(--sp-3);
  font-size: var(--text-xs);
}

.btn-lg {
  padding: var(--sp-3) var(--sp-6);
  font-size: var(--text-md);
  border-radius: var(--radius-lg);
}

.btn-icon {
  padding: var(--sp-2);
  width: 32px;
  height: 32px;
}

/* ----------------------------------------------------------------
   4. FORM CONTROLS
   ---------------------------------------------------------------- */
.form-group {
  margin-bottom: var(--sp-5);
}

.form-label {
  display: block;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: var(--sp-2);
}

.form-input,
.form-textarea,
.form-select {
  width: 100%;
  padding: var(--sp-2) var(--sp-3);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  outline: none;
  transition: all var(--duration-fast) var(--ease-out);
  line-height: 1.5;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  border-color: var(--coral-500);
  box-shadow: 0 0 0 3px var(--coral-glow);
  background: var(--surface-hover);
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--text-disabled);
}

.form-textarea {
  resize: vertical;
  min-height: 80px;
}

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23565e73' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

.form-hint {
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-top: var(--sp-1);
}

.form-error-text {
  font-size: var(--text-xs);
  color: var(--error-500);
  margin-top: var(--sp-1);
}

.char-count {
  font-size: var(--text-xs);
  color: var(--text-muted);
  font-family: var(--font-mono);
  text-align: right;
  margin-top: var(--sp-1);
}

/* ----------------------------------------------------------------
   5. CARDS
   ---------------------------------------------------------------- */
.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--sp-5);
  transition: all var(--duration-normal) var(--ease-out);
}

.card-interactive {
  cursor: pointer;
}
.card-interactive:hover {
  border-color: var(--border-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.card-interactive::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--coral-500), var(--coral-400));
  opacity: 0;
  transition: opacity var(--duration-normal) var(--ease-out);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.card-interactive:hover::before {
  opacity: 1;
}

/* ----------------------------------------------------------------
   6. BADGES & STATUS PILLS
   ---------------------------------------------------------------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  padding: 2px var(--sp-2);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.02em;
  font-family: var(--font-mono);
  line-height: 1.4;
}

.badge-coral {
  background: var(--coral-glow);
  color: var(--coral-500);
  border: 1px solid var(--coral-glow-strong);
}

.badge-success {
  background: var(--success-bg);
  color: var(--success-500);
  border: 1px solid var(--success-border);
}

.badge-warning {
  background: var(--warning-bg);
  color: var(--warning-500);
  border: 1px solid var(--warning-border);
}

.badge-error {
  background: var(--error-bg);
  color: var(--error-500);
  border: 1px solid var(--error-border);
}

.badge-info {
  background: var(--info-bg);
  color: var(--info-500);
  border: 1px solid var(--info-border);
}

.badge-neutral {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

/* Status dots */
.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
.status-dot-success { background: var(--success-500); }
.status-dot-warning { background: var(--warning-500); }
.status-dot-error { background: var(--error-500); }
.status-dot-info { background: var(--info-500); }
.status-dot-pulse {
  animation: pulse-dot 2s ease-in-out infinite;
}

/* ----------------------------------------------------------------
   7. TABS
   ---------------------------------------------------------------- */
.tab-group {
  display: inline-flex;
  background: var(--surface);
  padding: 3px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  gap: 2px;
}

.tab-btn {
  padding: var(--sp-1) var(--sp-3);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
  display: flex;
  align-items: center;
  gap: var(--sp-1);
  white-space: nowrap;
}
.tab-btn:hover {
  color: var(--text-primary);
  background: var(--surface-hover);
}
.tab-btn.active {
  color: #ffffff;
  background: var(--coral-500);
}

/* ----------------------------------------------------------------
   8. MODAL / DIALOG
   ---------------------------------------------------------------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-6);
  animation: fadeIn var(--duration-fast) var(--ease-out);
}

.modal-content {
  background: var(--panel);
  border: 1px solid var(--border-hover);
  border-radius: var(--radius-xl);
  padding: var(--sp-8);
  max-width: 480px;
  width: 100%;
  box-shadow: var(--shadow-lg);
  animation: slideUp var(--duration-normal) var(--ease-out);
  position: relative;
}

.modal-close {
  position: absolute;
  top: var(--sp-4);
  right: var(--sp-4);
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: var(--text-lg);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--duration-fast) var(--ease-out);
}
.modal-close:hover {
  background: var(--surface);
  color: var(--text-primary);
}

/* ----------------------------------------------------------------
   9. TOAST NOTIFICATIONS
   ---------------------------------------------------------------- */
.toast-container {
  position: fixed;
  bottom: var(--sp-6);
  right: var(--sp-6);
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  background: var(--gray-800);
  border: 1px solid var(--border-hover);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  max-width: 380px;
  min-width: 280px;
  pointer-events: auto;
  animation: slideInRight var(--duration-normal) var(--ease-out);
  font-size: var(--text-sm);
  color: var(--text-primary);
}

.toast-success { border-left: 3px solid var(--success-500); }
.toast-error { border-left: 3px solid var(--error-500); }
.toast-warning { border-left: 3px solid var(--warning-500); }
.toast-info { border-left: 3px solid var(--info-500); }

.toast-icon {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  margin-top: 1px;
}

.toast-dismiss {
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
  font-size: var(--text-xs);
  padding: 2px;
  flex-shrink: 0;
  margin-left: auto;
}

.toast-exit {
  animation: slideOutRight var(--duration-fast) var(--ease-out) forwards;
}

/* ----------------------------------------------------------------
   10. SKELETON LOADING
   ---------------------------------------------------------------- */
.skeleton {
  background: linear-gradient(90deg, var(--surface) 25%, var(--surface-hover) 50%, var(--surface) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  border-radius: var(--radius-md);
}

.skeleton-text {
  height: 14px;
  margin-bottom: var(--sp-2);
}
.skeleton-text-sm { height: 10px; width: 60%; }
.skeleton-text-lg { height: 20px; width: 80%; }
.skeleton-avatar { width: 32px; height: 32px; border-radius: 50%; }
.skeleton-card { height: 120px; }
.skeleton-btn { width: 100px; height: 32px; }

/* ----------------------------------------------------------------
   11. ALERT BANNERS
   ---------------------------------------------------------------- */
.alert {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--radius-lg);
  font-size: var(--text-sm);
  line-height: 1.5;
}

.alert-error {
  background: var(--error-bg);
  border: 1px solid var(--error-border);
  color: var(--error-500);
}

.alert-success {
  background: var(--success-bg);
  border: 1px solid var(--success-border);
  color: var(--success-500);
}

.alert-warning {
  background: var(--warning-bg);
  border: 1px solid var(--warning-border);
  color: var(--warning-500);
}

.alert-info {
  background: var(--info-bg);
  border: 1px solid var(--info-border);
  color: var(--info-500);
}

/* ----------------------------------------------------------------
   12. APP SHELL — SIDEBAR
   ---------------------------------------------------------------- */
.app-root {
  display: flex;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text-primary);
}

.sidebar {
  width: var(--sidebar-width);
  background: var(--panel);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 50;
  transition: transform var(--duration-normal) var(--ease-out);
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar-brand {
  padding: var(--sp-4) var(--sp-4);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}

.brand-mark {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--coral-500), var(--coral-400));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: var(--text-sm);
  font-weight: 800;
  flex-shrink: 0;
}

.brand-name {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: var(--text-md);
  color: var(--text-primary);
  white-space: nowrap;
}

.sidebar-nav {
  padding: var(--sp-3) var(--sp-2);
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.sidebar-section-label {
  padding: var(--sp-3) var(--sp-3) var(--sp-1);
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-secondary);
  transition: all var(--duration-fast) var(--ease-out);
  cursor: pointer;
  border: 1px solid transparent;
  text-decoration: none;
}
.nav-item:hover {
  background: var(--surface);
  color: var(--text-primary);
}
.nav-item.active {
  background: var(--coral-glow);
  color: var(--coral-500);
  font-weight: 600;
  border-color: var(--coral-glow-strong);
}

.nav-item-icon {
  font-size: var(--text-base);
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}

.nav-item-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-footer {
  padding: var(--sp-3) var(--sp-3);
  border-top: 1px solid var(--border);
}

.user-card {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-2) var(--sp-2);
  border-radius: var(--radius-md);
  transition: background var(--duration-fast) var(--ease-out);
}
.user-card:hover {
  background: var(--surface);
}

.user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--coral-500);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: var(--text-xs);
  flex-shrink: 0;
}

.user-info {
  flex: 1;
  min-width: 0;
}
.user-name {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.user-meta {
  font-size: var(--text-xs);
  color: var(--text-muted);
}

/* ----------------------------------------------------------------
   13. APP SHELL — MAIN WORKSPACE
   ---------------------------------------------------------------- */
.main-workspace {
  flex: 1;
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  height: var(--topbar-height);
  background: var(--glass);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0 var(--sp-6);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 40;
}

.topbar-title {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--text-primary);
  font-family: var(--font-heading);
}

.content-area {
  padding: var(--sp-6);
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
  flex: 1;
}

/* ----------------------------------------------------------------
   14. AUTH SCREENS
   ---------------------------------------------------------------- */
.auth-layout {
  min-height: 100vh;
  display: flex;
  width: 100%;
  background: var(--bg);
}

.auth-brand-panel {
  flex: 1;
  background: linear-gradient(135deg, rgba(255, 107, 74, 0.06) 0%, rgba(59, 130, 246, 0.04) 100%);
  border-right: 1px solid var(--border);
  padding: var(--sp-12);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}

.auth-brand-panel::before {
  content: '';
  position: absolute;
  top: -200px;
  right: -200px;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--coral-glow) 0%, transparent 70%);
  pointer-events: none;
}

.auth-form-panel {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-8);
}

.auth-card {
  width: 100%;
  max-width: 400px;
}

/* ----------------------------------------------------------------
   15. STUDIO WORKSPACE
   ---------------------------------------------------------------- */
.studio-container {
  display: flex;
  flex-direction: column;
  height: calc(100vh - var(--topbar-height));
  margin: calc(-1 * var(--sp-6));
  overflow: hidden;
  background: var(--bg);
}

.studio-toolbar {
  height: var(--topbar-height);
  background: var(--panel-header);
  border-bottom: 1px solid var(--border);
  padding: 0 var(--sp-4);
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 20;
  flex-shrink: 0;
  gap: var(--sp-3);
}

.studio-body {
  display: flex;
  flex: 1;
  overflow: hidden;
}

.studio-chat-panel {
  width: 360px;
  min-width: 280px;
  max-width: 480px;
  background: var(--panel);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.studio-canvas {
  flex: 1;
  background: var(--gray-950);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

/* Browser Chrome */
.browser-bar {
  height: 36px;
  background: var(--panel-header);
  border-bottom: 1px solid var(--border);
  padding: 0 var(--sp-4);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.browser-dots {
  display: flex;
  align-items: center;
  gap: 5px;
}
.browser-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
}
.dot-red { background: #ff5f56; }
.dot-yellow { background: #ffbd2e; }
.dot-green { background: #27c93f; }

.browser-url {
  flex: 1;
  max-width: 400px;
  margin: 0 var(--sp-4);
  height: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0 var(--sp-3);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.preview-iframe {
  width: 100%;
  flex: 1;
  border: none;
  background: #ffffff;
}

/* Chat Messages */
.chat-header {
  padding: var(--sp-3) var(--sp-4);
  border-bottom: 1px solid var(--border);
  font-size: var(--text-sm);
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--panel-header);
  flex-shrink: 0;
}

.chat-messages {
  flex: 1;
  padding: var(--sp-4);
  overflow-y: auto;
}

.chat-msg {
  display: flex;
  gap: var(--sp-3);
  margin-bottom: var(--sp-4);
  animation: fadeIn var(--duration-fast) var(--ease-out);
}

.chat-avatar {
  width: 26px;
  height: 26px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-xs);
  font-weight: 700;
  flex-shrink: 0;
}
.chat-avatar-ai {
  background: linear-gradient(135deg, var(--coral-500), var(--coral-400));
  color: #ffffff;
}
.chat-avatar-user {
  background: var(--surface);
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.chat-bubble {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--sp-3);
  font-size: var(--text-sm);
  line-height: 1.55;
  color: var(--text-primary);
  min-width: 0;
}

.chat-sender {
  font-weight: 600;
  font-size: var(--text-xs);
  margin-bottom: var(--sp-1);
}

.chat-composer {
  padding: var(--sp-3);
  background: var(--panel-header);
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.composer-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--sp-2) var(--sp-3);
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  transition: all var(--duration-fast) var(--ease-out);
}
.composer-box:focus-within {
  border-color: var(--coral-500);
  box-shadow: 0 0 0 3px var(--coral-glow);
}

.composer-textarea {
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  resize: none;
  min-height: 36px;
  max-height: 120px;
  line-height: 1.5;
}

.composer-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* ----------------------------------------------------------------
   16. PROGRESS BAR
   ---------------------------------------------------------------- */
.progress-bar-track {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  height: 8px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--coral-500), var(--coral-400));
  border-radius: var(--radius-full);
  transition: width 0.4s var(--ease-out);
}

/* ----------------------------------------------------------------
   17. EMPTY STATES
   ---------------------------------------------------------------- */
.empty-state {
  padding: var(--sp-12) var(--sp-6);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.empty-state-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-xl);
  background: var(--coral-glow);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-xl);
  margin-bottom: var(--sp-5);
}

.empty-state-title {
  font-size: var(--text-lg);
  font-weight: 700;
  margin-bottom: var(--sp-2);
}

.empty-state-desc {
  color: var(--text-secondary);
  font-size: var(--text-sm);
  max-width: 380px;
  margin-bottom: var(--sp-6);
  line-height: 1.6;
}

/* ----------------------------------------------------------------
   18. PROJECT CARDS
   ---------------------------------------------------------------- */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--sp-4);
}

.project-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--sp-5);
  transition: all var(--duration-normal) var(--ease-out);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  cursor: pointer;
}
.project-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.project-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--coral-500), var(--coral-400));
  opacity: 0;
  transition: opacity var(--duration-normal) var(--ease-out);
}
.project-card:hover::before {
  opacity: 1;
}

.project-card-title {
  font-size: var(--text-md);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--sp-2);
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.project-card-desc {
  color: var(--text-secondary);
  font-size: var(--text-sm);
  margin-bottom: var(--sp-4);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}

.project-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--border);
  padding-top: var(--sp-3);
  font-size: var(--text-xs);
}

/* ----------------------------------------------------------------
   19. PRESET TEMPLATE CARDS
   ---------------------------------------------------------------- */
.preset-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--sp-4);
  cursor: pointer;
  transition: all var(--duration-normal) var(--ease-out);
}
.preset-card:hover {
  background: var(--surface-hover);
  border-color: var(--coral-500);
  transform: translateY(-1px);
}

.preset-card-icon {
  font-size: var(--text-xl);
  margin-bottom: var(--sp-2);
}

.preset-card-name {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--sp-1);
}

.preset-card-desc {
  font-size: var(--text-xs);
  color: var(--text-secondary);
  line-height: 1.4;
}

/* ----------------------------------------------------------------
   20. DOMAIN CARDS
   ---------------------------------------------------------------- */
.domain-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--sp-5);
}

.domain-name {
  font-weight: 700;
  font-size: var(--text-md);
  color: var(--text-primary);
}

.dns-info {
  background: var(--surface);
  padding: var(--sp-3);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  border: 1px solid var(--border);
  margin-top: var(--sp-3);
}

.dns-label {
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: var(--sp-1);
  font-size: var(--text-xs);
}

.dns-value {
  font-family: var(--font-mono);
  color: var(--coral-400);
  word-break: break-all;
  font-size: var(--text-sm);
}

/* ----------------------------------------------------------------
   21. LANDING PAGE
   ---------------------------------------------------------------- */
.landing-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--glass);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

.landing-header-inner {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--sp-6);
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.landing-nav {
  display: flex;
  align-items: center;
  gap: var(--sp-6);
}

.landing-nav-link {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-secondary);
  transition: color var(--duration-fast);
}
.landing-nav-link:hover {
  color: var(--text-primary);
}

.hero-section {
  padding: var(--sp-16) 0 var(--sp-12);
  text-align: center;
}

.hero-title {
  font-size: clamp(2.5rem, 5vw, var(--text-5xl));
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.1;
  margin-bottom: var(--sp-5);
}

.hero-gradient-text {
  background: linear-gradient(135deg, var(--coral-500) 0%, var(--coral-400) 50%, var(--blue-400) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: var(--text-lg);
  color: var(--text-secondary);
  max-width: 620px;
  margin: 0 auto var(--sp-8);
  line-height: 1.6;
}

.hero-prompt-bar {
  max-width: 680px;
  margin: 0 auto var(--sp-6);
  background: var(--panel);
  border: 1px solid var(--border-hover);
  border-radius: var(--radius-xl);
  padding: var(--sp-2) var(--sp-2) var(--sp-2) var(--sp-5);
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  box-shadow: var(--shadow-lg);
}

.hero-prompt-input {
  flex: 1;
  border: none;
  background: transparent;
  outline: none;
  font-family: var(--font-sans);
  font-size: var(--text-md);
  color: var(--text-primary);
}
.hero-prompt-input::placeholder {
  color: var(--text-disabled);
}

.hero-presets {
  display: flex;
  gap: var(--sp-2);
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: var(--sp-10);
}

.hero-preset-chip {
  padding: var(--sp-1) var(--sp-3);
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-secondary);
  font-size: var(--text-xs);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
  text-decoration: none;
}
.hero-preset-chip:hover {
  border-color: var(--coral-500);
  color: var(--coral-500);
  background: var(--coral-glow);
}

/* Studio Preview Mockup (Landing Page) */
.studio-mockup {
  max-width: 960px;
  margin: 0 auto;
  border: 1px solid var(--border-hover);
  border-radius: var(--radius-xl);
  background: var(--panel);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.studio-mockup-toolbar {
  padding: var(--sp-3) var(--sp-4);
  background: var(--panel-header);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.studio-mockup-content {
  padding: var(--sp-10) var(--sp-8);
  background: #0b0d12;
  min-height: 320px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  color: #ffffff;
}

/* Feature Grid */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--sp-5);
}

.feature-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--sp-6);
}

.feature-icon {
  font-size: var(--text-2xl);
  margin-bottom: var(--sp-4);
}

.feature-title {
  font-size: var(--text-lg);
  font-weight: 700;
  margin-bottom: var(--sp-2);
}

.feature-desc {
  color: var(--text-secondary);
  font-size: var(--text-sm);
  line-height: 1.6;
}

/* FAQ */
.faq-item {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--sp-5);
}

.faq-question {
  font-size: var(--text-md);
  font-weight: 700;
  margin-bottom: var(--sp-2);
}

.faq-answer {
  color: var(--text-secondary);
  font-size: var(--text-sm);
  line-height: 1.6;
}

/* Landing Footer */
.landing-footer {
  border-top: 1px solid var(--border);
  padding: var(--sp-10) 0;
  color: var(--text-muted);
  font-size: var(--text-sm);
}

/* ----------------------------------------------------------------
   22. STATIC PAGES (Privacy, Terms, Account Deletion)
   ---------------------------------------------------------------- */
.static-page {
  max-width: 740px;
  margin: 0 auto;
  padding: var(--sp-12) var(--sp-6);
}

.static-page h1 {
  font-size: var(--text-3xl);
  margin-bottom: var(--sp-2);
}

.static-page-subtitle {
  color: var(--text-secondary);
  font-size: var(--text-md);
  margin-bottom: var(--sp-8);
}

.static-page h2 {
  font-size: var(--text-xl);
  margin-top: var(--sp-8);
  margin-bottom: var(--sp-3);
}

.static-page p {
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: var(--sp-4);
}

.static-page ul {
  padding-left: var(--sp-5);
  margin-bottom: var(--sp-4);
}

.static-page li {
  color: var(--text-secondary);
  margin-bottom: var(--sp-2);
  line-height: 1.6;
}

.static-page a {
  color: var(--coral-500);
  font-weight: 500;
}
.static-page a:hover {
  text-decoration: underline;
}

.callout-box {
  background: var(--surface);
  padding: var(--sp-5);
  border-radius: var(--radius-lg);
  border-left: 3px solid var(--coral-500);
  margin-top: var(--sp-6);
}

/* ----------------------------------------------------------------
   23. ANIMATIONS
   ---------------------------------------------------------------- */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(60px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes slideOutRight {
  from { opacity: 1; transform: translateX(0); }
  to { opacity: 0; transform: translateX(60px); }
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.animate-fade-in {
  animation: fadeIn var(--duration-normal) var(--ease-out);
}

.animate-slide-up {
  animation: slideUp var(--duration-slow) var(--ease-out);
}

/* Spinner */
.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  display: inline-block;
}

.spinner-sm {
  width: 12px;
  height: 12px;
  border-width: 1.5px;
}

.spinner-lg {
  width: 24px;
  height: 24px;
  border-width: 2.5px;
}

.spinner-coral {
  border-color: var(--coral-glow);
  border-top-color: var(--coral-500);
}

/* ----------------------------------------------------------------
   24. VIEWPORT SWITCHER
   ---------------------------------------------------------------- */
.viewport-switcher {
  display: flex;
  gap: 2px;
  background: var(--surface);
  padding: 2px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.viewport-btn {
  padding: var(--sp-1) var(--sp-2);
  border-radius: 4px;
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--text-muted);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
  display: flex;
  align-items: center;
  gap: var(--sp-1);
}
.viewport-btn:hover {
  color: var(--text-primary);
}
.viewport-btn.active {
  background: var(--coral-500);
  color: #ffffff;
}

/* ----------------------------------------------------------------
   25. VERSION SELECTOR
   ---------------------------------------------------------------- */
.version-select {
  appearance: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: var(--sp-1) var(--sp-6) var(--sp-1) var(--sp-3);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 500;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10'%3E%3Cpath fill='%23565e73' d='M5 7L1 3h8z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
}
.version-select:hover {
  border-color: var(--border-hover);
}

/* ----------------------------------------------------------------
   26. REDUCED MOTION
   ---------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
}

/* ----------------------------------------------------------------
   27. FOCUS VISIBLE (Accessibility)
   ---------------------------------------------------------------- */
:focus-visible {
  outline: 2px solid var(--coral-500);
  outline-offset: 2px;
}

button:focus:not(:focus-visible),
a:focus:not(:focus-visible),
input:focus:not(:focus-visible),
textarea:focus:not(:focus-visible),
select:focus:not(:focus-visible) {
  outline: none;
}

/* ----------------------------------------------------------------
   28. RESPONSIVE
   ---------------------------------------------------------------- */

/* Tablet */
@media (max-width: 1024px) {
  :root {
    --sidebar-width: 0px;
  }
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
    width: 260px;
  }
  .main-workspace {
    margin-left: 0;
  }
  .mobile-menu-btn {
    display: flex !important;
  }
  .sidebar-overlay {
    display: block !important;
  }
}

/* Mobile */
@media (max-width: 768px) {
  .content-area {
    padding: var(--sp-4);
  }
  .auth-brand-panel {
    display: none;
  }
  .auth-form-panel {
    padding: var(--sp-5);
  }
  .studio-body {
    flex-direction: column;
  }
  .studio-chat-panel {
    width: 100%;
    max-width: 100%;
    height: 280px;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  .hero-title {
    font-size: var(--text-3xl);
  }
  .hero-prompt-bar {
    flex-direction: column;
    padding: var(--sp-3);
    gap: var(--sp-2);
  }
  .hero-prompt-bar .btn {
    width: 100%;
  }
  .landing-nav {
    display: none;
  }
  .project-grid {
    grid-template-columns: 1fr;
  }
  .feature-grid {
    grid-template-columns: 1fr;
  }
  .studio-toolbar {
    flex-wrap: wrap;
    height: auto;
    padding: var(--sp-2) var(--sp-3);
    gap: var(--sp-2);
  }
  .toast-container {
    left: var(--sp-4);
    right: var(--sp-4);
    bottom: var(--sp-4);
  }
  .toast {
    max-width: 100%;
    min-width: auto;
  }
}

/* Mobile small */
@media (max-width: 480px) {
  .hero-presets {
    flex-direction: column;
    align-items: stretch;
  }
  .hero-preset-chip {
    text-align: center;
  }
}

/* Large */
@media (min-width: 1440px) {
  .container {
    max-width: 1320px;
  }
}

/* 4K */
@media (min-width: 2560px) {
  :root {
    --container-max: 1600px;
  }
}

/* Mobile sidebar overlay */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 49;
}

.mobile-menu-btn {
  display: none;
  padding: var(--sp-1);
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: var(--text-lg);
  cursor: pointer;
}

/* Utility: visually hidden (a11y) */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
