:root {
  --bg: #0f1720;
  --panel: #16202b;
  --panel-2: #1d2a38;
  --text: #e8eef5;
  --muted: #8ba0b5;
  --accent: #2f9e79;
  --border: #263647;
}

* { box-sizing: border-box; }

body.app {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 220px;
  background: var(--panel);
  border-right: 1px solid var(--border);
  padding: 1rem;
  display: flex;
  flex-direction: column;
}

.brand { font-weight: 700; font-size: 1.25rem; margin-bottom: 1.5rem; }

.sidebar nav { display: flex; flex-direction: column; gap: .25rem; }

.nav-item {
  display: block;
  padding: .5rem .75rem;
  border-radius: 6px;
  color: var(--text);
  text-decoration: none;
}

.nav-item:hover { background: var(--panel-2); }
.nav-item.disabled { color: var(--muted); cursor: not-allowed; }
.nav-item.disabled:hover { background: transparent; }

.logout { margin-top: auto; }

.content { flex: 1; min-width: 0; padding: 1.5rem; }

.page-header { display: flex; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.page-header h1 { margin: 0; font-size: 1.5rem; }

.card, .panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
  animation: fade .3s ease both;
}

@keyframes fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

.nav-item.active { background: var(--panel-2); color: #fff; box-shadow: inset 3px 0 0 var(--accent); }

a { color: var(--accent); }

button, .btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  background: var(--accent);
  color: #04231a;
  border: none;
  border-radius: 6px;
  padding: .5rem .9rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background .15s ease, box-shadow .15s ease, transform .05s ease;
}

button:hover, .btn:hover { background: #38b98d; box-shadow: 0 2px 10px rgba(0, 0, 0, .28); }
button:active, .btn:active { transform: translateY(1px); }

button.active { outline: 2px solid #fff; }

.icon-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon {
  width: 1em;
  height: 1em;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: .5rem; border-bottom: 1px solid var(--border); }

.messages { list-style: none; padding: 0; }
.messages li { background: var(--panel-2); padding: .5rem .75rem; border-radius: 6px; margin-bottom: .5rem; }

#map { height: 520px; border-radius: 8px; border: 1px solid var(--border); }
.toolbar { display: flex; gap: .5rem; margin-bottom: .75rem; flex-wrap: wrap; }
.project-detail { display: grid; gap: 1rem; }

.detail-layout { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 1rem; align-items: start; }
.panels { display: grid; gap: 1rem; }
.panels h2 { margin: 0 0 .75rem; font-size: 1rem; }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem .75rem; }
.field-grid label { display: flex; flex-direction: column; gap: .25rem; font-size: .78rem; color: var(--muted); }
.field-grid input, .field-grid select {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: .4rem .5rem;
  color: var(--text);
  font: inherit;
}
.route-summary { font-size: 1.15rem; font-weight: 600; margin-bottom: .6rem; }
.maneuvers {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 340px;
  overflow-y: auto;
  display: grid;
  gap: .35rem;
}
.maneuvers li {
  display: flex;
  justify-content: space-between;
  gap: .5rem;
  font-size: .82rem;
  padding: .35rem .5rem;
  background: var(--panel-2);
  border-radius: 6px;
}
.maneuvers .len { color: var(--muted); white-space: nowrap; }

@media (max-width: 900px) {
  .detail-layout { grid-template-columns: 1fr; }
}

#map.placing { cursor: crosshair; }

.route-info { align-self: center; color: var(--muted); font-variant-numeric: tabular-nums; }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
