/* Design-tokens - en källa till sanning för alla färger, storlekar, spacing */
:root {
  /* Färger */
  --bg: #ffffff;
  --surface: #f1e6db;
  --surface-2: #ede1d2;
  --surface-hover: #e8d8c4;
  --border: #e0cdba;
  --border-strong: #c9b59e;
  --text: #1a1a1a;
  --text-muted: #5b4a3a;
  --text-subtle: #8a7560;
  --accent: #0a7d6e;
  --accent-hover: #086256;
  --accent-soft: rgba(10, 125, 110, 0.1);
  --green: #16a34a;
  --danger: #c0392b;
  --amber: #d97706;
  --gold: #d4a017;

  /* Skuggor */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.12);

  /* Sidopanel */
  --sidebar-width: 280px;
  --sidebar-min: 220px;
  --sidebar-max: 500px;

  /* Typografi (matchar Nox AI) */
  --font-base: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Courier New', monospace;
  --font-size-sm: 12.5px;
  --font-size-base: 14px;
  --font-size-md: 14.5px;
  --font-size-lg: 16px;
  --font-size-xl: 18px;
  --line-height-base: 1.5;
  --line-height-comfy: 1.6;
}

html[data-theme="dark"] {
  --bg: #1a1a1a;
  --surface: #2a221c;
  --surface-2: #2f2620;
  --surface-hover: #36271f;
  --border: #3d3128;
  --border-strong: #4a3c30;
  --text: #f0e8de;
  --text-muted: #b09c88;
  --text-subtle: #7a6855;
  --accent: #4ba89c;
  --accent-hover: #5dbab0;
  --accent-soft: rgba(75, 168, 156, 0.15);
  --green: #22c55e;
  --danger: #e74c3c;
  --amber: #f59e0b;
  --gold: #f0c041;
}

/* Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-base);
  font-size: var(--font-size-base);
  line-height: var(--line-height-base);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

code, pre {
  font-family: var(--font-mono);
}

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

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

/* Topbar - delad mellan undersidor */
.topbar {
  height: 56px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 8px;
  background: var(--surface);
  flex-shrink: 0;
}
.nav-btn {
  padding: 7px 12px;
  border-radius: 8px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.nav-btn:hover {
  background: var(--surface-hover);
  border-color: var(--border-strong);
}
.nav-btn svg {
  flex-shrink: 0;
}
.topbar-title {
  font-weight: 600;
  font-size: 14.5px;
  margin-left: 8px;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}
.topbar-title svg {
  color: var(--accent);
  flex-shrink: 0;
}

/* Knapp-bas */
.btn {
  padding: 8px 14px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-primary {
  background: var(--accent);
  color: white;
}
.btn-primary:hover {
  background: var(--accent-hover);
}
.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover {
  background: var(--surface-hover);
}
