:root {
  color-scheme: dark;
  --bg: #0b0f12;
  --panel: #121820;
  --panel-strong: #17222b;
  --border: #2a3641;
  --text: #e7edf2;
  --muted: #8fa1ad;
  --accent: #38bdf8;
  --accent-strong: #0ea5e9;
  --ok: #22c55e;
  --warn: #f59e0b;
  --danger: #ef4444;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.34);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
  background: var(--bg);
  color: var(--text);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select {
  font: inherit;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 24px 18px;
  background: #090d10;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.brand {
  display: grid;
  grid-template-columns: 44px 1fr;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 50%, #0b0f12 0 32%, transparent 33%),
    conic-gradient(from 30deg, #38bdf8, #22c55e, #f59e0b, #38bdf8);
  box-shadow: 0 0 30px rgba(56, 189, 248, 0.22);
}

.brand strong {
  display: block;
  font-size: 18px;
}

.brand small,
.eyebrow,
.metric-card span,
.panel-heading span {
  color: var(--muted);
  letter-spacing: 0;
}

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

.nav-stack a,
.logout-form button {
  display: block;
  width: 100%;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 11px 12px;
  color: #c7d3dc;
  background: transparent;
  text-align: left;
}

.nav-stack a:hover,
.logout-form button:hover {
  background: #111820;
  border-color: var(--border);
}

.logout-form {
  margin-top: auto;
}

.logout-form button {
  cursor: pointer;
}

.main-surface {
  min-width: 0;
  padding: 28px;
}

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

.eyebrow {
  margin: 0 0 8px;
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 700;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 34px;
  line-height: 1.1;
}

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

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

.button {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.button.primary {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
  color: #041018;
  font-weight: 800;
}

.button.secondary {
  background: #101820;
  color: #dce6ed;
}

.map-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 18px;
  min-height: calc(100vh - 116px);
}

.map-panel,
.status-panel,
.table-panel,
.panel-form,
.metric-card,
.auth-card,
.notice {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.map-panel {
  overflow: hidden;
}

.map-canvas {
  width: 100%;
  height: 100%;
  min-height: 640px;
}

.status-panel {
  padding: 18px;
  display: flex;
  flex-direction: column;
  min-height: 640px;
}

.panel-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.panel-heading-spaced {
  margin-top: 24px;
}

.member-list,
.event-list {
  display: grid;
  gap: 10px;
}

.member-card,
.event-card {
  border: 1px solid var(--border);
  background: var(--panel-strong);
  border-radius: 8px;
  padding: 12px;
}

.member-card strong,
.event-card strong {
  display: block;
  margin-bottom: 4px;
}

.member-card span,
.event-card span {
  color: var(--muted);
  font-size: 13px;
}

.circle-marker {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent);
  border: 3px solid #e7edf2;
  box-shadow: 0 0 0 8px rgba(56, 189, 248, 0.18), 0 8px 20px rgba(0, 0, 0, 0.4);
}

.place-marker {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--warn);
  border: 2px solid #fff7ed;
  box-shadow: 0 0 0 10px rgba(245, 158, 11, 0.16);
}

.split-layout {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  gap: 18px;
}

.panel-form {
  padding: 18px;
  display: grid;
  align-content: start;
  gap: 10px;
}

label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

input,
select {
  width: 100%;
  min-height: 42px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #0d1318;
  color: var(--text);
  padding: 9px 11px;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
}

.checkbox-row input {
  width: 18px;
  min-height: 18px;
}

.table-panel {
  overflow: auto;
}

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

th,
td {
  text-align: left;
  padding: 13px 14px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

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

.pill {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 8px;
  background: #0d1318;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.metric-card {
  padding: 18px;
  min-height: 120px;
}

.metric-card strong {
  display: block;
  margin-top: 12px;
  overflow-wrap: anywhere;
}

.auth-shell {
  min-height: calc(100vh - 56px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 32px;
  align-items: center;
}

.auth-copy h1 {
  font-size: 48px;
  max-width: 680px;
}

.auth-copy p {
  max-width: 560px;
  color: var(--muted);
}

.auth-card {
  padding: 22px;
  display: grid;
  gap: 12px;
}

.alert,
.notice {
  border-color: rgba(245, 158, 11, 0.42);
  background: rgba(245, 158, 11, 0.12);
  color: #fde68a;
  padding: 12px;
  border-radius: 8px;
}

.notice {
  margin-bottom: 18px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

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

  .sidebar {
    position: static;
    height: auto;
  }

  .nav-stack {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .map-layout,
  .split-layout,
  .auth-shell {
    grid-template-columns: 1fr;
  }

  .map-canvas,
  .status-panel {
    min-height: 520px;
  }
}

@media (max-width: 620px) {
  .main-surface {
    padding: 18px;
  }

  .page-header {
    align-items: stretch;
    flex-direction: column;
  }

  .nav-stack {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  h1,
  .auth-copy h1 {
    font-size: 30px;
  }
}
