/*
 * Varaha Design System — Design Tokens
 * Ported from @varaha/tokens (Kosh) for Lens.
 * Single source of truth for all raw design values.
 */

:root {
  /* ── Primary palette ── */
  --color-primary: #07342f;
  --color-primary-light: #0a4a43;
  --color-primary-dark: #052420;
  --color-primary-mid: #3D6A64;
  --color-accent: #f9ac00;
  --color-accent-light: #fbc94d;
  --color-accent-dark: #d99200;
  --color-sage: #dfedee;
  --color-sage-dark: #c4dfe0;
  --color-sage-light: #eef5f6;

  /* ── Backgrounds ── */
  --color-bg-page: #fafbfb;
  --color-bg-card: #ffffff;
  --color-bg-sidebar: #07342f;
  --color-bg-sidebar-hover: #0a4a43;
  --color-bg-sidebar-active: rgba(223, 237, 238, 0.12);
  --color-bg-table-header: #dfedee;
  --color-bg-table-row-alt: #f8fafa;
  --color-bg-table-row-hover: #eef5f6;
  --color-bg-table-row-selected: #dfedee;
  --color-bg-input: #ffffff;
  --color-bg-filter-bar: #dfedee;

  /* ── Text ── */
  --color-text-primary: #545454;
  --color-text-heading: #07342f;
  --color-text-muted: #94a3b8;
  --color-text-light: #888888;
  --color-text-inverse: #ffffff;
  --color-text-link: #07342f;
  --color-text-link-hover: #0a4a43;

  /* ── Borders ── */
  --color-border: #e2e8f0;
  --color-border-hover: #cbd5e1;
  --color-border-focus: #07342f;
  --color-border-input: #e2e8f0;

  /* ── Status colors ── */
  --color-status-green: #10b981;
  --color-status-green-light: #d1fae5;
  --color-status-green-dark: #065f46;
  --color-status-amber: #f59e0b;
  --color-status-amber-light: #fef3c7;
  --color-status-amber-dark: #92400e;
  --color-status-red: #ef4444;
  --color-status-red-light: #fee2e2;
  --color-status-red-dark: #991b1b;
  --color-status-blue: #3b82f6;
  --color-status-blue-light: #dbeafe;
  --color-status-blue-dark: #1e40af;
  --color-status-slate: #64748b;
  --color-status-slate-light: #f1f5f9;
  --color-status-slate-dark: #334155;
  --color-status-gray: #6b7280;
  --color-status-gray-light: #f3f4f6;
  --color-status-gray-dark: #374151;
  --color-status-purple: #7c3aed;
  --color-status-purple-light: rgba(147, 51, 234, 0.1);
  --color-status-emerald: #047857;
  --color-status-emerald-light: rgba(16, 185, 129, 0.1);

  /* ── Spacing ── */
  --spacing-xs: 4px;
  --spacing-sm: 8px;
  --spacing-md: 16px;
  --spacing-lg: 24px;
  --spacing-xl: 32px;
  --spacing-2xl: 48px;
  --spacing-3xl: 64px;

  /* ── Border radius ── */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-full: 9999px;

  /* ── Shadows ── */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.1);
  --shadow-inner: inset 0 2px 4px rgba(0, 0, 0, 0.05);

  /* ── Fonts ── */
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  /* ── Font sizes ── */
  --text-xs: 11px;
  --text-sm: 12px;
  --text-base: 14px;
  --text-lg: 16px;
  --text-xl: 18px;
  --text-2xl: 22px;
  --text-3xl: 28px;
  --text-4xl: 32px;

  /* ── Line heights ── */
  --leading-tight: 1.25;
  --leading-normal: 1.5;
  --leading-relaxed: 1.625;

  /* ── Layout ── */
  --content-max-width: 1400px;
  --content-padding: 32px;
  --header-height: 56px;

  /* ── Transitions ── */
  --transition-fast: 150ms ease;
  --transition-base: 200ms ease-out;
  --transition-slow: 300ms ease-in-out;

  /* ── Z-index ── */
  --z-header: 30;
  --z-sidebar: 40;
  --z-dropdown: 50;
  --z-modal: 60;
  --z-toast: 70;
  --z-tooltip: 80;
}

/* ── Typography classes ── */

.text-h1 {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: var(--text-3xl);
  line-height: var(--leading-tight);
  color: var(--color-text-heading);
}

.text-h2 {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: var(--text-2xl);
  line-height: var(--leading-tight);
  color: var(--color-text-heading);
}

.text-h3 {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: var(--text-xl);
  line-height: var(--leading-tight);
  color: var(--color-text-heading);
}

.text-h4 {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: var(--text-lg);
  line-height: var(--leading-normal);
  color: var(--color-text-primary);
}

.text-body {
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--color-text-primary);
}

.text-body-sm {
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
  color: var(--color-text-muted);
}

.text-body-xs {
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: var(--text-xs);
  line-height: var(--leading-normal);
  color: var(--color-text-muted);
}

.text-label {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
  color: var(--color-text-primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.text-data {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--color-text-primary);
}

.text-data-lg {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: var(--text-4xl);
  line-height: var(--leading-tight);
  color: var(--color-text-heading);
}

.text-data-md {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: var(--text-2xl);
  line-height: var(--leading-tight);
  color: var(--color-text-heading);
}

.text-code {
  font-family: var(--font-mono);
  font-weight: 400;
  font-size: 13px;
  line-height: var(--leading-normal);
  color: var(--color-text-primary);
}

/* ── Animations ── */

@keyframes page-enter {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes tab-enter {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes dialog-in {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes slide-in-right {
  0% { transform: translateX(100%); opacity: 0; }
  100% { transform: translateX(0); opacity: 1; }
}

@keyframes slide-down {
  0% { max-height: 0; opacity: 0; }
  100% { max-height: 500px; opacity: 1; }
}

@keyframes pulse-badge {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

.page-enter { animation: page-enter 0.2s ease-out; }
.tab-enter { animation: tab-enter 0.15s ease-out; }
[data-state="open"] > .dialog-content { animation: dialog-in 0.2s ease-out; }
