/* ════════════════════════════════════════════════════════════════════
   ownEvo workspace app shell — design tokens, nav, layout primitives.
   Tokens lifted verbatim from www/index.html so app + landing stay
   visually identical. Dark variants added for the in-app theme toggle.
   ════════════════════════════════════════════════════════════════════ */

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

:root {
  --bg: #ffffff;
  --surface: #f8fafc;
  --surface-2: #f1f5f9;
  --border: #e2e8f0;
  --border-light: #cbd5e1;
  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --accent-dim: #3b82f60d;
  --accent-glow: #3b82f614;
  --accent-muted: rgba(59, 130, 246, 0.10);
  --text: #0f172a;
  --text-2: #1e293b;
  --text-3: #334155;
  --text-4: #475569;
  --text-muted: #64748b;
  --text-faint: #94a3b8;
  --green: #059669;
  --green-soft: rgba(5, 150, 105, 0.10);
  --red: #dc2626;
  --red-soft: rgba(220, 38, 38, 0.10);
  --amber: #d97706;
  --amber-soft: rgba(217, 119, 6, 0.10);
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow: 0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-pop: 0 8px 24px rgba(15, 23, 42, 0.08), 0 2px 6px rgba(15, 23, 42, 0.04);
  --banner-bg: #fef3c7;
  --banner-border: #fcd34d;
  --banner-text: #78350f;
  --sans: 'Outfit', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
}

[data-theme="dark"] {
  --bg: #0a0e1a;
  --surface: #111827;
  --surface-2: #1e293b;
  --border: #1e293b;
  --border-light: #334155;
  --accent: #60a5fa;
  --accent-hover: #93c5fd;
  --accent-dim: rgba(96, 165, 250, 0.06);
  --accent-glow: rgba(96, 165, 250, 0.10);
  --accent-muted: rgba(96, 165, 250, 0.15);
  --text: #f1f5f9;
  --text-2: #e2e8f0;
  --text-3: #cbd5e1;
  --text-4: #94a3b8;
  --text-muted: #64748b;
  --text-faint: #475569;
  --green: #10b981;
  --green-soft: rgba(16, 185, 129, 0.12);
  --red: #f87171;
  --red-soft: rgba(248, 113, 113, 0.12);
  --amber: #f59e0b;
  --amber-soft: rgba(245, 158, 11, 0.12);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
  --shadow-pop: 0 8px 24px rgba(0, 0, 0, 0.5);
  --banner-bg: #422006;
  --banner-border: #92400e;
  --banner-text: #fcd34d;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--sans);
  font-weight: 400;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: 'cv02', 'cv11';
  font-size: 14px;
  line-height: 1.5;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

/* ── Preview banner ── */
.preview-banner {
  background: var(--banner-bg);
  color: var(--banner-text);
  border-bottom: 1px solid var(--banner-border);
  font-size: 12px;
  font-weight: 500;
  padding: 6px 16px;
  text-align: center;
  letter-spacing: 0.02em;
}
.preview-banner code { font-family: var(--mono); font-size: 11px; padding: 1px 5px; background: rgba(0, 0, 0, 0.06); border-radius: 3px; }

/* ── App shell ── */
.app-shell { display: grid; grid-template-columns: 232px 1fr; min-height: calc(100vh - 28px); }
@media (max-width: 900px) { .app-shell { grid-template-columns: 64px 1fr; } .nav-label { display: none; } .nav-section { display: none; } }

/* ── Nav sidebar ── */
.nav { background: var(--surface); border-right: 1px solid var(--border); padding: 16px 12px; display: flex; flex-direction: column; gap: 2px; overflow-y: auto; }
.nav-brand { display: flex; align-items: center; gap: 10px; padding: 2px 8px 20px; }
.brand-mark { width: 30px; height: 30px; color: var(--accent); flex-shrink: 0; }
.brand-wordmark { display: inline-flex; align-items: baseline; line-height: 1; }
.logo-own { color: var(--text-3); font-weight: 600; letter-spacing: -0.03em; font-size: 20px; }
.logo-evo { color: var(--accent); font-style: italic; font-weight: 600; letter-spacing: -0.03em; font-size: 20px; }

.workspace-switcher {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; margin-bottom: 16px;
  background: var(--bg); border: 1px solid var(--border); border-radius: 6px;
  font-size: 13px; color: var(--text-2); cursor: pointer;
}
.workspace-switcher:hover { border-color: var(--border-light); }
.workspace-avatar {
  width: 22px; height: 22px; border-radius: 4px;
  background: var(--accent); color: white;
  font-size: 11px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.workspace-switcher .chev { margin-left: auto; color: var(--text-faint); font-size: 11px; }

.nav-section { font-size: 10px; font-weight: 600; letter-spacing: 0.10em; text-transform: uppercase; color: var(--text-faint); padding: 14px 12px 6px; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 12px; border-radius: 6px;
  font-size: 13.5px; color: var(--text-3);
  transition: background 0.12s, color 0.12s;
}
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.active { background: var(--accent-muted); color: var(--accent); font-weight: 500; }
.nav-item .nav-badge {
  margin-left: auto;
  font-size: 11px; font-weight: 600;
  background: var(--accent); color: white;
  padding: 1px 6px; border-radius: 8px; min-width: 18px;
  text-align: center; line-height: 1.4;
}
.nav-item.active .nav-badge { background: var(--accent); }
.nav-icon { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 1.75; flex-shrink: 0; }
.nav-footer { margin-top: auto; padding-top: 16px; border-top: 1px solid var(--border); }

/* ── Main content area ── */
.main { padding: 24px 32px 48px; overflow-y: auto; }
.page-header { display: flex; justify-content: space-between; align-items: flex-end; padding-bottom: 18px; margin-bottom: 24px; border-bottom: 1px solid var(--border); }
.page-title { font-size: clamp(1.625rem, 2.4vw, 2rem); font-weight: 600; letter-spacing: -0.02em; color: var(--text); line-height: 1.2; }
.page-subtitle { font-size: 13px; color: var(--text-muted); margin-top: 4px; }
.page-actions { display: flex; gap: 8px; align-items: center; }

/* ── Buttons ── */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 6px; font-size: 13px; font-weight: 500; border: 1px solid transparent; transition: background 0.12s, color 0.12s, border-color 0.12s; }
.btn-primary { background: var(--accent); color: white; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-secondary { background: var(--bg); color: var(--text-2); border-color: var(--border); }
.btn-secondary:hover { background: var(--surface-2); border-color: var(--border-light); }
.btn-ghost { background: transparent; color: var(--text-3); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-icon { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 2; }

/* ── Theme toggle ── */
.theme-toggle { background: var(--surface-2); border: 1px solid var(--border); color: var(--text-3); padding: 5px 8px; border-radius: 6px; font-size: 12px; display: inline-flex; align-items: center; gap: 6px; }
.theme-toggle:hover { background: var(--surface); color: var(--text); }

/* ── Pills / badges ── */
.pill { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 500; padding: 2px 8px; border-radius: 10px; background: var(--surface-2); color: var(--text-3); white-space: nowrap; }
.pill.green { background: var(--green-soft); color: var(--green); }
.pill.red { background: var(--red-soft); color: var(--red); }
.pill.amber { background: var(--amber-soft); color: var(--amber); }
.pill.accent { background: var(--accent-muted); color: var(--accent); }
.pill.outline { background: transparent; border: 1px solid var(--border); }

/* ── Card / panel ── */
.card { background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 16px; box-shadow: var(--shadow-sm); }
.card-title { font-size: 12px; font-weight: 500; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 10px; }

/* ── Utility ── */
.muted { color: var(--text-muted); }
.faint { color: var(--text-faint); }
.numeric { font-variant-numeric: tabular-nums; }
.divider { height: 1px; background: var(--border); margin: 16px 0; }
