:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --panel: #ffffff;
  --line: #d9dee7;
  --text: #1c2430;
  --muted: #5c6878;
  --accent: #146c5f;
  --accent-dark: #0f5148;
  --danger: #b42318;
  --warn: #a15c07;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 15px;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.app-shell {
  display: grid;
  grid-template-columns: 220px 1fr;
  min-height: 100vh;
}

.sidebar {
  background: #202a37;
  color: #f8fafc;
  padding: 22px 16px;
}

.brand {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 6px;
}

.tenant {
  color: #cbd5e1;
  font-size: 13px;
  margin-bottom: 28px;
}

.nav {
  display: grid;
  gap: 6px;
}

.nav a {
  color: #e5e7eb;
  border-radius: 6px;
  padding: 10px 12px;
  text-decoration: none;
}

.nav a.active,
.nav a:hover {
  background: #334155;
}

.content {
  padding: 28px;
}

.page-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 20px;
}

h1,
h2 {
  margin: 0;
}

h1 {
  font-size: 26px;
}

h2 {
  font-size: 18px;
  margin-bottom: 12px;
}

.grid {
  display: grid;
  gap: 16px;
}

.grid.two {
  grid-template-columns: minmax(300px, 420px) 1fr;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}

.metric,
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}

.metric .value {
  display: block;
  font-size: 30px;
  font-weight: 700;
}

.metric .label {
  color: var(--muted);
}

form {
  display: grid;
  gap: 12px;
}

label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 13px;
}

input,
select {
  border: 1px solid var(--line);
  border-radius: 6px;
  font: inherit;
  padding: 9px 10px;
  width: 100%;
}

.checkbox {
  align-items: center;
  display: flex;
  gap: 8px;
}

.checkbox input {
  width: auto;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

button,
.button {
  background: var(--accent);
  border: 0;
  border-radius: 6px;
  color: #ffffff;
  cursor: pointer;
  display: inline-block;
  font: inherit;
  padding: 9px 12px;
  text-decoration: none;
}

button:hover,
.button:hover {
  background: var(--accent-dark);
  text-decoration: none;
}

.button.secondary {
  background: #475569;
}

.button.danger,
button.danger {
  background: var(--danger);
}

table {
  border-collapse: collapse;
  width: 100%;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 10px 8px;
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.badge {
  border-radius: 999px;
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  padding: 3px 8px;
}

.badge.present,
.badge.active {
  background: #d7f4e5;
  color: #075d3b;
}

.badge.missing,
.badge.inactive {
  background: #fee4e2;
  color: #912018;
}

.empty {
  color: var(--muted);
  padding: 20px 0;
}

.empty.compact {
  padding: 8px 0;
}

.map-board {
  background: #e9edf2;
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 420px;
  overflow: auto;
  position: relative;
}

.zone-block {
  background: var(--panel);
  border: 2px solid #94a3b8;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow: hidden;
  padding: 14px;
  position: absolute;
}

.zone-head {
  align-items: center;
  display: flex;
  gap: 8px;
  justify-content: space-between;
}

.zone-head h2 {
  margin: 0;
}

.zone-meta {
  color: var(--muted);
  font-size: 13px;
}

.people-list {
  margin: 0;
  padding-left: 18px;
}

@media (max-width: 850px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
  }

  .metrics,
  .grid.two {
    grid-template-columns: 1fr;
  }

  .page-head {
    align-items: flex-start;
    flex-direction: column;
  }
}
