:root {
  --bg: #ffffff;
  --nav-bg: #0f172a;
  --nav-text: #e2e8f0;
  --nav-text-muted: #94a3b8;
  --nav-active: #ffffff;
  --nav-accent: #3b82f6;
  --border: #e3e5e9;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ---- Navbar --------------------------------------------------------- */
.navbar {
  display: flex;
  align-items: center;
  gap: 2rem;
  padding: 0 1.25rem;
  height: 56px;
  background: var(--nav-bg);
  flex: 0 0 auto;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--nav-active);
  font-weight: 700;
  font-size: 1.05rem;
  text-decoration: none;
  letter-spacing: 0.01em;
}

.brand-mark {
  width: 22px;
  height: 22px;
  border-radius: 5px;
  background: linear-gradient(135deg, var(--nav-accent), #60a5fa);
  display: inline-block;
}

.nav-links {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0;
  padding: 0;
  height: 100%;
}

.nav-links a {
  display: flex;
  align-items: center;
  height: 100%;
  padding: 0 0.9rem;
  color: var(--nav-text-muted);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
  border-bottom: 2px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}

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

.nav-links a.active {
  color: var(--nav-active);
  border-bottom-color: var(--nav-accent);
}

/* ---- Main / viz ----------------------------------------------------- */
main {
  flex: 1 1 auto;
  position: relative;
  display: flex;
}

#viz-container {
  flex: 1 1 auto;
  width: 100%;
  height: 100%;
}

tableau-viz {
  width: 100%;
  height: 100%;
  display: block;
}

.error {
  margin: 1rem;
  padding: 1rem;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
  border-radius: 8px;
  white-space: pre-wrap;
  font-size: 0.9rem;
}

.hidden { display: none; }

@media (max-width: 640px) {
  .navbar { gap: 1rem; padding: 0 0.9rem; }
  .nav-links a { padding: 0 0.6rem; font-size: 0.85rem; }
}
