/* Orbis Zero — Common styles shared across all pages */

:root {
  --bg: #1a1a2e;
  --panel: #16213e;
  --panel-light: #1c2b4a;
  --text: #e0e0e0;
  --text-dim: #8892b0;
  --accent: #4e9af1;
  --border: #2a3a5c;
  --green: #22c55e;
  --yellow: #eab308;
  --orange: #f59e0b;
  --red: #dc2626;
  --grey: #4a5568;
}

[data-theme="light"] {
  --bg: #f5f5f5;
  --panel: #ffffff;
  --panel-light: #f0f4f8;
  --text: #1a1a2e;
  --text-dim: #555;
  --accent: #2563eb;
  --border: #d0d5dd;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Nav bar */
.nav {
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
}

.nav-brand {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--accent);
  text-decoration: none;
  flex-shrink: 0;
}

.nav-links {
  display: flex;
  gap: 4px;
  align-items: center;
  min-width: 0;
}

.nav-link {
  color: var(--text-dim);
  text-decoration: none;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 0.88rem;
  transition: color 0.15s, background-color 0.15s;
}

.nav-link:hover {
  color: var(--text);
  background: var(--panel-light);
}

.nav-link.active {
  color: var(--accent);
  background: var(--panel-light);
}

/* Data import/export menu. The routes remain separate; the navigation does not. */
.nav-menu {
  position: relative;
}

.nav-menu summary {
  display: flex;
  align-items: center;
  gap: 6px;
  list-style: none;
  cursor: pointer;
  user-select: none;
}

.nav-menu summary::-webkit-details-marker { display: none; }

.nav-menu summary:focus-visible,
.nav-settings:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.nav-chevron {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  transition: transform 0.15s ease-out;
}

.nav-menu[open] .nav-chevron { transform: rotate(180deg); }

.nav-menu-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 184px;
  padding: 6px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.28);
  z-index: 60;
}

.nav-menu-item {
  display: flex;
  align-items: center;
  min-height: 40px;
  padding: 8px 12px;
  border-radius: 6px;
  color: var(--text-dim);
  text-decoration: none;
  font-size: 0.88rem;
  transition: color 0.15s, background-color 0.15s;
}

.nav-menu-item:hover,
.nav-menu-item:focus-visible,
.nav-menu-item.active {
  color: var(--text);
  background: var(--panel-light);
  outline: none;
}

.nav-controls {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
}

.nav-settings {
  display: none;
  align-items: center;
  gap: 7px;
  flex-shrink: 0;
  min-height: 40px;
  margin-right: 12px;
  padding: 7px 12px;
  border-right: 1px solid var(--border);
  border-radius: 6px 0 0 6px;
}

.nav-settings svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-database {
  display: flex;
  align-items: center;
  gap: 7px;
  max-width: 190px;
  min-height: 40px;
  padding: 7px 10px;
  border-radius: 6px;
  color: var(--text-dim);
  text-decoration: none;
  font-size: 0.8rem;
}

.nav-database[href]:hover,
.nav-database[href]:focus-visible {
  color: var(--text);
  background: var(--panel-light);
  outline: none;
}

.nav-database svg {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
}

.nav-database span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lang-select, .theme-btn {
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 6px 14px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
}

.nav-user {
  color: var(--text-dim);
  font-size: 0.82rem;
}

@media (max-width: 980px) {
  .nav {
    height: auto;
    min-height: 56px;
    padding: 8px 12px;
    flex-wrap: wrap;
    row-gap: 6px;
  }

  .nav-links,
  .nav .nav-links {
    display: flex !important;
    order: 3;
    width: 100%;
    overflow-x: auto;
    scrollbar-width: thin;
    padding-bottom: 2px;
  }

  .nav-controls { margin-left: auto; }
  .nav-user { display: none !important; }
  .nav-menu-panel { position: fixed; top: 105px; right: 12px; }
}

@media (max-width: 560px) {
  .nav-settings {
    width: 40px;
    justify-content: center;
    padding: 7px;
    margin-right: 2px;
    border-right: 0;
    border-radius: 6px;
  }

  .nav-settings-label { display: none; }
  .nav-database { max-width: 44px; padding: 7px 12px; }
  .nav-database span { display: none; }
  .nav-controls .nav-user,
  .nav-controls #signoutBtn { display: none !important; }
  .lang-select, .theme-btn { padding-left: 9px; padding-right: 9px; }
}

/* Common heading style — most pages use this; scoped overrides (e.g. .hero h1) win. */
h1 {
  font-size: 1.6rem;
  font-weight: 600;
  margin-bottom: 4px;
  text-wrap: balance;
}