:root {
  --bg: #0d1117;
  --surface: #161b22;
  --surface-2: #1f242c;
  --text: #e6edf3;
  --text-dim: #8b949e;
  --accent: #3b82f6;
  --accent-dim: #1e3a8a;
  --danger: #ef4444;
  --border: #30363d;
  --radius: 6px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  font-size: 14px;
  background: var(--bg);
  color: var(--text);
}

body {
  display: grid;
  grid-template-columns: 320px 1fr;
  height: 100vh;
}

#sidebar {
  background: var(--surface);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

#sidebar header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

#sidebar h1 { margin: 0; font-size: 16px; letter-spacing: 0.5px; }
#sidebar h2 {
  margin: 0 0 8px 0;
  font-size: 12px;
  text-transform: uppercase;
  color: var(--text-dim);
  letter-spacing: 0.6px;
}

#sidebar section { padding: 12px 16px; border-bottom: 1px solid var(--border); }
.panel .hint { color: var(--text-dim); font-size: 12px; margin: 4px 0 8px; }

input, button {
  font: inherit;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 6px 10px;
}

input:focus { outline: 1px solid var(--accent); border-color: var(--accent); }

button {
  cursor: pointer;
  transition: background 100ms;
}
button:hover { background: var(--accent-dim); border-color: var(--accent); }
button.danger { color: var(--danger); }
button.danger:hover { background: #3b1f1f; border-color: var(--danger); }

#search { width: 100%; margin-bottom: 8px; }

#vessel-list, #watchlist-items, #area-items {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 320px;
  overflow-y: auto;
}

#vessel-list li, #watchlist-items li, #area-items li {
  padding: 6px 8px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}
#vessel-list li:hover { background: var(--surface-2); }

#vessel-list .name { font-weight: 600; }
#vessel-list .meta { color: var(--text-dim); font-size: 12px; }

#watchlist-form { display: flex; gap: 6px; margin-bottom: 8px; }
#watchlist-form input { flex: 1; }

#map { height: 100vh; background: #07101c; }

.popup-form { display: flex; flex-direction: column; gap: 6px; min-width: 220px; color: #111; }
.popup-form input { color: #111; background: #fff; border: 1px solid #ccc; }
.popup-form button { color: #fff; background: var(--accent); border: 1px solid var(--accent); }

.toast {
  position: fixed;
  bottom: 16px;
  right: 16px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 10px 14px;
  border-radius: var(--radius);
  z-index: 10000;
  max-width: 320px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}
.toast.error { border-color: var(--danger); }

.leaflet-popup-content { font-family: inherit; }
