/* ── Design Tokens ──────────────────────────────────────────────── */
:root {
  /* Backgrounds */
  --bg-primary: hsl(220, 20%, 10%);
  --bg-surface: hsl(220, 18%, 14%);
  --bg-elevated: hsl(220, 16%, 18%);
  --bg-hover: hsl(220, 14%, 22%);

  /* Accent */
  --accent: hsl(210, 100%, 60%);
  --accent-hover: hsl(210, 100%, 50%);
  --accent-muted: hsla(210, 100%, 60%, 0.15);

  /* Status */
  --success: hsl(152, 70%, 50%);
  --success-muted: hsla(152, 70%, 50%, 0.15);
  --warning: hsl(38, 95%, 55%);
  --warning-muted: hsla(38, 95%, 55%, 0.15);
  --danger: hsl(0, 75%, 55%);
  --danger-muted: hsla(0, 75%, 55%, 0.15);

  /* Text */
  --text-primary: hsl(220, 15%, 90%);
  --text-secondary: hsl(220, 10%, 55%);
  --text-muted: hsl(220, 10%, 40%);

  /* Borders */
  --border: hsl(220, 15%, 20%);
  --border-subtle: hsl(220, 15%, 16%);

  /* Radius */
  --radius-sm: 4px;
  --radius: 6px;
  --radius-lg: 8px;
  --radius-xl: 12px;

  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;

  /* Typography */
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-size-xs: 11px;
  --font-size-sm: 13px;
  --font-size-base: 14px;
  --font-size-lg: 16px;
  --font-size-xl: 20px;
  --font-size-2xl: 24px;

  /* Transitions */
  --transition-fast: 150ms ease-out;
  --transition-normal: 200ms ease-out;
  --transition-slow: 300ms ease-out;

  /* Shadows */
  --shadow-sm: 0 1px 2px hsla(0, 0%, 0%, 0.3);
  --shadow-md: 0 4px 12px hsla(0, 0%, 0%, 0.4);
  --shadow-lg: 0 8px 24px hsla(0, 0%, 0%, 0.5);

  /* Sidebar */
  --sidebar-width: 240px;
  --sidebar-collapsed: 60px;
  --header-height: 56px;
}

/* ── Reset & Base ───────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  color: var(--text-primary);
  background: var(--bg-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }

button {
  font-family: var(--font-family);
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
  font-size: inherit;
}

input, select, textarea {
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  color: var(--text-primary);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-sm) var(--space-md);
  outline: none;
  transition: border-color var(--transition-fast);
}

input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
}

/* ── Layout ─────────────────────────────────────────────────────── */
#app {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

#main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  margin-left: var(--sidebar-width);
  transition: margin-left var(--transition-normal);
}

#page-content {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-lg);
}

/* ── Utility Classes ────────────────────────────────────────────── */
.hidden { display: none !important; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-xs { gap: var(--space-xs); }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }
.text-sm { font-size: var(--font-size-sm); }
.text-xs { font-size: var(--font-size-xs); }
.text-secondary { color: var(--text-secondary); }
.text-muted { color: var(--text-muted); }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Scrollbar ──────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }
