/*
 * Akompani - Design System
 * Pure minimalism: no borders, no shadows, color-based hierarchy
 */

/* ========================================
   1. DESIGN TOKENS
   ======================================== */

:root {
  /* User-selected palette */
  --tone-dark-purple-grey: #2f2a3a;
  --tone-dark-grey: #33353b;
  --tone-light-grey: #d8dbe2;
  --tone-off-white: #f7f5f2;
  --tone-plain-white: #ffffff;
  --tone-light-sky: #eaf6f5;
  --tone-pink: #fbc8c8;
  --tone-rose: #fddcee;
  --tone-light-lavender: #c5bcd8;
  --tone-light-blue: #63dff6;
  --tone-blue-grey: #a4b8cd;

  /* Core surfaces */
  --bg: var(--tone-off-white);
  --bg-secondary: var(--tone-plain-white);
  --bg-tertiary: var(--tone-light-sky);
  --bg-hover: var(--tone-light-grey);

  /* Surface colors for depth without borders */
  --surface: var(--tone-off-white);
  --surface-subtle: var(--tone-light-sky);
  --surface-elevated: var(--tone-plain-white);

  /* Borders */
  --border: color-mix(in srgb, var(--tone-blue-grey) 45%, var(--tone-plain-white));
  --border-strong: color-mix(in srgb, var(--tone-blue-grey) 70%, var(--tone-light-grey));

  /* Text */
  --text: var(--tone-dark-purple-grey);
  --text-secondary: var(--tone-dark-grey);
  --text-muted: var(--tone-blue-grey);
  --text-placeholder: color-mix(in srgb, var(--tone-blue-grey) 78%, var(--tone-light-grey));
  --text-inverse: var(--tone-plain-white);

  /* Accent */
  --brand: var(--tone-dark-purple-grey);
  --brand-hover: var(--tone-dark-grey);
  --brand-soft: color-mix(in srgb, var(--tone-light-lavender) 24%, transparent);
  --brand-medium: color-mix(in srgb, var(--tone-light-blue) 22%, transparent);
  --brand-light: color-mix(in srgb, var(--tone-light-sky) 72%, var(--tone-plain-white));

  /* Semantic colors */
  --blue: var(--tone-light-blue);
  --blue-soft: color-mix(in srgb, var(--tone-light-blue) 18%, transparent);
  --purple: var(--tone-light-lavender);
  --purple-soft: color-mix(in srgb, var(--tone-light-lavender) 20%, transparent);
  --orange: var(--tone-pink);
  --orange-soft: color-mix(in srgb, var(--tone-pink) 18%, transparent);
  --red: var(--tone-rose);
  --red-soft: color-mix(in srgb, var(--tone-rose) 20%, transparent);
  --success: var(--tone-light-blue);
  --success-soft: color-mix(in srgb, var(--tone-light-blue) 18%, transparent);
  --accent: var(--tone-light-blue);
  --accent-soft: color-mix(in srgb, var(--tone-light-blue) 16%, transparent);

  /* Static shadows (no blur/drop-shadow policy) */
  --shadow-sm: 0 2px 0 rgba(47, 42, 58, 0.16);
  --shadow-md: 0 4px 0 rgba(47, 42, 58, 0.18);
  --shadow-lg: 0 6px 0 rgba(47, 42, 58, 0.20);

  /* Semantic aliases */
  --error: var(--tone-rose);
  --warning: var(--tone-pink);
  --brand-dark: var(--tone-dark-purple-grey);

  /* Typography - Clean sans-serif */
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "SF Mono", Monaco, "Cascadia Code", "Roboto Mono", Consolas, monospace;
  
  /* Font sizes - Comfortable reading */
  --text-xs: 0.75rem;
  --text-sm: 0.8125rem;
  --text-base: 0.9375rem;
  --text-md: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 2rem;
  --text-4xl: 2.5rem;
  
  /* Font weights */
  --font-normal: 400;
  --font-medium: 500;
  --font-semibold: 600;
  
  /* Spacing - Generous */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  
  /* Border radius - Soft and rounded */
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-full: 50vw;
  
  /* NO SHADOWS - Clean design */
  --shadow-none: none;
  
  /* Transitions - Smooth */
  --transition-fast: 150ms ease;
  --transition-base: 200ms ease;

  /* Animation easings */
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-smooth: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out-smooth: cubic-bezier(0.65, 0, 0.35, 1);
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);

  /* Animation durations */
  --dur-fast: 150ms;
  --dur-base: 200ms;
  --dur-slow: 400ms;
  --dur-slower: 600ms;

  /* Z-Index */
  --z-dropdown: 100;
  --z-sticky: 200;
  --z-modal: 300;
  --z-toast: 400;
}

/* ========================================
   1b. DARK MODE TOKENS
   ======================================== */

[data-theme="dark"] {
  --bg: #33353b;
  --bg-secondary: #3d4049;
  --bg-tertiary: #4a4f5a;
  --bg-hover: #565c68;
  --surface: #3d4049;
  --surface-subtle: #4a4f5a;
  --surface-elevated: #565c68;
  --border: #4a5160;
  --border-strong: #5f6778;
  --text: #ffffff;
  --text-secondary: #c5bcd8;
  --text-muted: #a4b8cd;
  --text-placeholder: #8ea0b3;
  --text-inverse: #33353b;
  --brand: #63dff6;
  --brand-hover: #a4b8cd;
  --brand-soft: rgba(99, 223, 246, 0.16);
  --brand-medium: rgba(99, 223, 246, 0.24);
  --brand-light: rgba(99, 223, 246, 0.10);
  --blue: #63dff6;
  --purple: #c5bcd8;
  --orange: #fbc8c8;
  --red: #fddcee;
  --success: #63dff6;
  --accent: #63dff6;
  --shadow-sm: 0 2px 0 rgba(0, 0, 0, 0.28);
  --shadow-md: 0 4px 0 rgba(0, 0, 0, 0.30);
  --shadow-lg: 0 6px 0 rgba(0, 0, 0, 0.34);
  --error: #fddcee;
  --warning: #fbc8c8;
  --brand-dark: #63dff6;
}

/* ========================================
   1c. DARK MODE COMPONENT OVERRIDES
   ======================================== */

.theme-icon-dark { display: none; }
[data-theme="dark"] .theme-icon-light { display: none; }
[data-theme="dark"] .theme-icon-dark { display: block; }
[data-theme="dark"] .top-nav { background: rgba(51, 53, 59, 0.86); }
[data-theme="dark"] .btn-primary:hover:not(:disabled) { background: var(--tone-light-grey); }

/* ========================================
   2. RESET & BASE
   ======================================== */

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Scrollbar — transparent track */
html {
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 0, 0, 0.15) transparent;
}

[data-theme="dark"] html {
  scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
  background: transparent;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-corner {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.15);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] ::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
}

[data-theme="dark"] ::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

::selection {
  background: var(--brand-soft);
  color: var(--brand);
}

/* Smooth theme switching */
html.theme-transition,
html.theme-transition *,
html.theme-transition *::before,
html.theme-transition *::after {
  transition: background-color 400ms ease,
              color 400ms ease,
              border-color 400ms ease,
              box-shadow 400ms ease,
              fill 400ms ease,
              stroke 400ms ease !important;
}

/* ========================================
   3. ANIMATIONS
   ======================================== */

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

@keyframes fadeInScale {
  from { opacity: 0; transform: scale(0.98); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes slideIn {
  from { opacity: 0; transform: translateX(-12px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

.animate-fade-in {
  animation: fadeIn 0.3s var(--transition-base) forwards;
}

.animate-fade-in-scale {
  animation: fadeInScale 0.25s var(--transition-base) forwards;
}

.animate-slide-in {
  animation: slideIn 0.3s var(--transition-base) forwards;
}

.stagger-1 { animation-delay: 0.05s; }
.stagger-2 { animation-delay: 0.1s; }
.stagger-3 { animation-delay: 0.15s; }
.stagger-4 { animation-delay: 0.2s; }

/* Extended stagger delays */
.stagger-5 { animation-delay: 0.25s; }
.stagger-6 { animation-delay: 0.3s; }

/* Spring animations */
@keyframes springScaleIn {
  0% { opacity: 0; transform: scale(0.8); }
  70% { transform: scale(1.03); }
  100% { opacity: 1; transform: scale(1); }
}

@keyframes springSlideUp {
  0% { opacity: 0; transform: translateY(24px); }
  70% { transform: translateY(-3px); }
  100% { opacity: 1; transform: translateY(0); }
}

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

/* Toast notifications */
@keyframes toastSlideIn {
  0% { opacity: 0; transform: translateX(100%); }
  100% { opacity: 1; transform: translateX(0); }
}

@keyframes toastSlideOut {
  0% { opacity: 1; transform: translateX(0); }
  100% { opacity: 0; transform: translateX(100%); }
}

/* Status pulse */
@keyframes morphPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.5); opacity: 0.5; }
}

/* Page transitions */
@keyframes contentFadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes contentFadeOut {
  from { opacity: 1; transform: translateY(0); }
  to { opacity: 0; transform: translateY(-8px); }
}

/* Deploy progress */
@keyframes progressFill {
  from { width: 0%; }
  to { width: 100%; }
}

@keyframes progressIndeterminate {
  0% { left: -30%; width: 30%; }
  50% { left: 50%; width: 30%; }
  100% { left: 100%; width: 30%; }
}

/* Spring utility classes */
.animate-spring-in {
  animation: springScaleIn var(--dur-slow) var(--ease-spring) forwards;
}

.animate-spring-slide {
  animation: springSlideUp var(--dur-slow) var(--ease-spring) forwards;
}

/* Skeleton loaders */
.skeleton {
  background: linear-gradient(90deg, var(--bg-secondary) 25%, var(--bg-tertiary) 50%, var(--bg-secondary) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s ease infinite;
  border-radius: var(--radius-md);
}

.skeleton-text {
  height: 14px;
  margin-bottom: 8px;
  border-radius: 4px;
}

.skeleton-text:last-child {
  width: 60%;
}

.skeleton-circle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
}

.skeleton-card {
  height: 120px;
  border-radius: var(--radius-lg);
}

/* Press feedback */
.press-feedback {
  transition: transform var(--dur-fast) var(--ease-spring);
}

.press-feedback:active {
  transform: scale(0.97);
}

/* Hover lift */
.hover-lift {
  transition: transform var(--dur-base) var(--ease-smooth), box-shadow var(--dur-base) var(--ease-smooth);
}

.hover-lift:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* View transition classes */
.view-active {
  animation: contentFadeIn var(--dur-slow) var(--ease-smooth) forwards;
}

.view-hidden {
  animation: contentFadeOut var(--dur-base) var(--ease-smooth) forwards;
  pointer-events: none;
}

/* Toast container */
.toast-container {
  position: fixed;
  top: var(--space-4);
  right: var(--space-4);
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  pointer-events: none;
  max-width: 380px;
}

.toast {
  background: var(--surface-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-3) var(--space-4);
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  pointer-events: auto;
  animation: toastSlideIn var(--dur-slow) var(--ease-spring) forwards;
  box-shadow: var(--shadow-lg);
  cursor: pointer;
}

.toast.toast-exit {
  animation: toastSlideOut var(--dur-base) ease forwards;
}

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

.toast-body {
  flex: 1;
  min-width: 0;
}

.toast-title {
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  color: var(--text);
  margin-bottom: 2px;
}

.toast-message {
  font-size: var(--text-xs);
  color: var(--text-secondary);
  line-height: 1.4;
}

.toast-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px;
  line-height: 1;
  font-size: 16px;
  transition: color var(--dur-fast) ease;
}

.toast-close:hover {
  color: var(--text);
}

.toast--success .toast-icon { color: var(--success); }
.toast--error .toast-icon { color: var(--error); }
.toast--warning .toast-icon { color: var(--warning); }
.toast--info .toast-icon { color: var(--brand); }

/* Nav user avatar */
.nav-user {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.nav-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--bg-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  cursor: pointer;
  transition: background-color var(--dur-fast) ease;
}

.nav-avatar:hover {
  background: color-mix(in srgb, var(--brand-soft) 55%, var(--bg-tertiary));
}

.nav-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.nav-avatar-fallback {
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  color: var(--text-secondary);
}

/* Progress bar */
.progress-bar {
  width: 100%;
  height: 4px;
  background: var(--bg-tertiary);
  border-radius: 2px;
  overflow: hidden;
  position: relative;
}

.progress-bar-fill {
  height: 100%;
  background: var(--brand);
  border-radius: 2px;
  transition: width var(--dur-slow) var(--ease-smooth);
}

.progress-bar-indeterminate .progress-bar-fill {
  position: absolute;
  animation: progressIndeterminate 1.5s var(--ease-in-out-smooth) infinite;
}

/* Deploy step indicators */
.deploy-steps {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.deploy-step {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: var(--text-sm);
  color: var(--text-muted);
  transition: color var(--dur-base) ease;
}

.deploy-step.active {
  color: var(--brand);
}

.deploy-step.done {
  color: var(--success);
}

.deploy-step.error {
  color: var(--error);
}

.deploy-step-icon {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.deploy-step-icon .spinner {
  width: 16px;
  height: 16px;
  border: 2px solid var(--bg-tertiary);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: pulse 0.8s linear infinite;
}

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

.spin { animation: spin 0.8s linear infinite; }

.deploy-step-icon .spinner {
  animation: spin 0.8s linear infinite;
}

/* Connection status dot */
.connection-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-muted);
}

.connection-dot.connected {
  background: var(--success);
  animation: morphPulse 2s ease infinite;
}

.connection-dot.error {
  background: var(--error);
}

/* View Transitions API */
@view-transition {
  navigation: auto;
}

::view-transition-old(root) {
  animation: contentFadeOut var(--dur-base) ease forwards;
}

::view-transition-new(root) {
  animation: contentFadeIn var(--dur-slow) var(--ease-smooth) forwards;
}

/* ========================================
   4. TYPOGRAPHY
   ======================================== */

h1, h2, h3, h4, h5, h6 {
  font-weight: var(--font-semibold);
  line-height: 1.3;
  color: var(--text);
  letter-spacing: -0.01em;
}

h1 { font-size: var(--text-4xl); }
h2 { font-size: var(--text-3xl); }
h3 { font-size: var(--text-2xl); }
h4 { font-size: var(--text-xl); }
h5 { font-size: var(--text-lg); }
h6 { font-size: var(--text-md); }

.text-secondary { color: var(--text-secondary); }
.text-muted { color: var(--text-muted); }
.text-brand { color: var(--brand); }

/* ========================================
   5. LAYOUT
   ======================================== */

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-6);
}

.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ========================================
   6. NAVIGATION - Ultra-clean top bar
   ======================================== */

.top-nav {
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  height: 56px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.top-nav-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-6);
  max-width: 1200px;
  margin: 0 auto;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  text-decoration: none;
  color: var(--text);
  font-weight: var(--font-semibold);
  font-size: var(--text-sm);
}

.nav-brand-icon {
  width: 28px;
  height: 28px;
  background: var(--text);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
}

.nav-brand-icon svg {
  width: 15px;
  height: 15px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.nav-link {
  display: flex;
  align-items: center;
  padding: var(--space-2) var(--space-3);
  color: var(--text-muted);
  text-decoration: none;
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  border-radius: var(--radius-md);
  transition: color var(--transition-fast);
}

.nav-link:hover {
  color: var(--text);
}

.nav-link.active {
  color: var(--text);
}

.nav-link-icon {
  display: none;
}

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

/* ========================================
   7. BUTTONS - Clean & minimal
   ======================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  line-height: 1.5;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
  white-space: nowrap;
  background: transparent;
}

.btn:hover:not(:disabled) {
  background: var(--bg-hover);
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Primary - Dark, confident */
.btn-primary {
  background: var(--text);
  color: var(--bg);
  border-radius: var(--radius-full);
  transition: all 200ms ease;
}

.btn-primary:hover:not(:disabled) {
  background: var(--brand-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

/* Secondary */
.btn-secondary {
  background: var(--bg-secondary);
  color: var(--text);
  border-radius: var(--radius-full);
  transition: all 200ms ease;
}

.btn-secondary:hover:not(:disabled) {
  background: var(--bg-tertiary);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

/* Ghost */
.btn-ghost {
  color: var(--text-secondary);
}

.btn-ghost:hover:not(:disabled) {
  color: var(--text);
  background: transparent;
}

/* Brand accent */
.btn-brand {
  background: var(--brand);
  color: white;
}

.btn-brand:hover:not(:disabled) {
  background: var(--brand-hover);
}

/* Danger */
.btn-danger {
  color: var(--red);
}

.btn-danger:hover:not(:disabled) {
  background: var(--red-soft);
}

/* Text button */
.btn-text {
  color: var(--brand);
  padding: var(--space-1) var(--space-2);
}

.btn-text:hover:not(:disabled) {
  background: var(--brand-light);
}

/* Sizes */
.btn-sm {
  padding: var(--space-1) var(--space-3);
  font-size: var(--text-xs);
  border-radius: var(--radius-sm);
}

.btn-icon.btn-sm {
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 50%;
}

.btn-lg {
  padding: var(--space-3) var(--space-6);
  font-size: var(--text-base);
}

.btn-icon {
  padding: var(--space-2);
}

/* ========================================
   8. CARDS - NO BORDERS, color based
   ======================================== */

.card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  transition: background var(--transition-fast);
}

.card-hover:hover {
  background: var(--bg-tertiary);
}

.card-header {
  padding: var(--space-5) var(--space-6);
}

.card-body {
  padding: var(--space-6);
}

.card-footer {
  padding: var(--space-4) var(--space-6);
  background: var(--bg-secondary);
}

/* ========================================
   9. BADGES - Subtle color backgrounds
   ======================================== */

.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-2);
  font-size: var(--text-xs);
  font-weight: var(--font-medium);
  border-radius: var(--radius-full);
}

.badge-neutral {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
}

.badge-brand {
  background: var(--brand-soft);
  color: var(--brand);
}

.badge-blue {
  background: var(--blue-soft);
  color: var(--blue);
}

.badge-purple {
  background: var(--purple-soft);
  color: var(--purple);
}

.badge-orange {
  background: var(--orange-soft);
  color: var(--orange);
}

.badge-red {
  background: var(--red-soft);
  color: var(--red);
}

/* ========================================
   10. PANELS - Clean 3-column layout
   ======================================== */

.panel-layout {
  display: grid;
  grid-template-columns: 260px 1fr 320px;
  gap: 0;
  flex: 1;
  min-height: 0;
}

.panel {
  background: var(--bg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.panel + .panel {
  border-left: 1px solid var(--bg-tertiary);
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) var(--space-5);
  min-height: 56px;
}

.panel-title {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  color: var(--text);
}

.panel-content {
  flex: 1;
  overflow: auto;
  padding: var(--space-4);
}

/* ========================================
   11. LIST ITEMS - Clean row style
   ======================================== */

.list-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  margin-bottom: var(--space-1);
}

.list-item:hover {
  background: var(--bg-hover);
}

.list-item.active {
  background: var(--bg-tertiary);
}

.list-item-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: var(--bg-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
}

.list-item.active .list-item-icon {
  background: var(--bg-tertiary);
}

.list-item-content {
  flex: 1;
  min-width: 0;
}

.list-item-title {
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.list-item-subtitle {
  font-size: var(--text-xs);
  color: var(--text-muted);
}

/* ========================================
   12. SECTIONS
   ======================================== */

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

.section-alt {
  background: var(--bg-secondary);
}

.section-header {
  margin-bottom: var(--space-8);
}

.section-title {
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

/* ========================================
   13. FORMS - Clean inputs
   ======================================== */

.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-bottom: var(--space-5);
}

.form-label {
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--text-secondary);
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  color: var(--text);
  background: var(--bg-secondary);
  border: none;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  outline: none;
}

.form-input:hover,
.form-select:hover,
.form-textarea:hover {
  background: var(--bg-hover);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  background: var(--bg-tertiary);
}

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

.form-textarea {
  min-height: 120px;
  resize: vertical;
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  line-height: 1.6;
}

/* ========================================
   14. EMPTY STATE
   ======================================== */

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-16) var(--space-8);
  text-align: center;
  color: var(--text-muted);
}

.empty-state-icon {
  width: 48px;
  height: 48px;
  margin-bottom: var(--space-4);
  color: var(--bg-hover);
}

.empty-state-title {
  font-size: var(--text-md);
  font-weight: var(--font-medium);
  color: var(--text-secondary);
  margin-bottom: var(--space-1);
}

.empty-state-text {
  font-size: var(--text-sm);
  color: var(--text-muted);
}

/* ========================================
   15. UTILITIES
   ======================================== */

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }

.grid { display: grid; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.text-center { text-align: center; }
.truncate {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Status indicators */
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
}

.status-dot.active { background: var(--brand); }
.status-dot.pending { background: var(--orange); }
.status-dot.error { background: var(--red); }

/* Divider */
.divider {
  height: 1px;
  background: var(--bg-tertiary);
  margin: var(--space-4) 0;
}

/* ========================================
   16. RESPONSIVE
   ======================================== */

@media (max-width: 1024px) {
  .panel-layout {
    grid-template-columns: 220px 1fr 280px;
  }
}

@media (max-width: 768px) {
  .panel-layout {
    grid-template-columns: 1fr;
  }
  
  .panel + .panel {
    border-left: none;
    border-top: 1px solid var(--bg-tertiary);
  }
  
  .nav-links {
    display: none;
  }
}
