:root {
  color-scheme: light;
  --nav: #1f2a2e;
  --accent: #0f6f66;
  --line: #d5d8d8;
  --bad: #f4c7c3;
  --good: #cde8d0;
  --warn: #f8e3b0;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Consolas, "Segoe UI", sans-serif;
  color: #1c1c1c;
  background: #f6f7f7;
}

a { color: #0b57d0; }
button, input, select, textarea { font: inherit; }

.top { background: var(--nav); color: white; }
.nav { display: flex; flex-wrap: wrap; gap: 0; list-style: none; margin: 0; padding: 0; align-items: center; }
.nav li { border-right: 1px solid #3c4a4f; }
.nav a, .nav button { color: white; background: transparent; border: 0; padding: 12px 14px; display: inline-block; text-decoration: none; cursor: pointer; }
.nav a:hover, .nav button:hover, .active { background: var(--accent); }
.nav .right { margin-left: auto; border-right: 0; }
.search-item { position: relative; padding: 8px; }
.search-item input { min-width: 220px; }
.search-results, .search-results ul { position: absolute; z-index: 5; background: white; color: #1c1c1c; min-width: 320px; max-height: 320px; overflow: auto; border: 1px solid var(--line); margin: 0; padding: 0; list-style: none; }
.search-results li { padding: 6px 8px; }

.layout { display: flex; align-items: flex-start; }
#sidebar { width: 320px; min-height: calc(100vh - 48px); background: #eef2f2; border-right: 1px solid var(--line); padding: 8px; }
#content { flex: 1; padding: 16px; min-width: 0; position: relative; }
#content.htmx-request { outline: 2px solid var(--accent); }

.sidebar-tools { display: flex; gap: 6px; margin-bottom: 8px; }
.sidebar-tools input, .sidebar-tools select, .table-filter { width: 100%; padding: 6px; }
#system-table { width: 100%; border-collapse: collapse; }
#system-table td { padding: 3px 4px; }
#system-table tr.active { background: #d7efe9; }
#system-table tr[hidden] { display: none; }

.row { display: flex; gap: 12px; align-items: flex-start; }
.column { flex: 1; min-width: 0; }
.card { background: white; border: 1px solid var(--line); padding: 12px; margin-bottom: 12px; }
.tab { margin-right: 8px; }
.tab.active { background: var(--accent); color: white; padding: 2px 6px; }

table { border-collapse: collapse; width: 100%; }
th, td { border-bottom: 1px solid var(--line); padding: 4px 6px; text-align: left; vertical-align: top; }
th { background: #f0f3f3; }
td.right, th.right { text-align: right; }
.good { background: var(--good); }
.bad { background: var(--bad); }
.warn, .cron { background: var(--warn); }
.event { background: #e4d4ef; }
.grey { background: #e6e6e6; }
.muted { color: #667; font-size: 0.85em; }
.scroll { overflow: auto; }
pre { white-space: pre-wrap; word-break: break-word; }

.spinner {
  display: inline-block;
  width: 1em;
  height: 1em;
  border: 2px solid #c5c5c5;
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  vertical-align: text-bottom;
}
@keyframes spin { to { transform: rotate(360deg); } }

.chart-box { min-height: 240px; margin-bottom: 12px; }
.leaflet-map { height: 420px; width: 100%; background: #d9e2e2; }
iframe { width: 100%; height: 640px; border: 1px solid var(--line); background: white; }
.logs { font-family: Consolas, monospace; font-size: 12px; }
.booting { padding: 24px; }
