:root {
  --obsidian: #06070a;
  --charcoal: #10141a;
  --panel-bg: #1b2028;
  --gold: #d4af37;
  --alert-red: #8b0000;
  --neon-red: #ff4d4d;
  --parchment: #edf0f4;
  --muted: #8d9ab0;
  --c5-green: #4ade80;
  --community-blue: #70a1ff;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  background: radial-gradient(circle at 15% 10%, #111827 0, #050507 45%, #020203 100%);
  color: var(--parchment);
  font-family: Inter, sans-serif;
}

.praesidium-shell {
  height: 100vh;
  display: grid;
  grid-template-rows: 64px 1fr;
}

.praesidium-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 18px;
  border-bottom: 1px solid rgba(212, 175, 55, 0.26);
  background: linear-gradient(90deg, rgba(11, 15, 20, 0.98), rgba(18, 23, 30, 0.98));
}

.brand-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--gold);
}

.brand-wordmark {
  font-family: Cinzel, serif;
  font-weight: 700;
  letter-spacing: 2.8px;
  font-size: 1.2rem;
}

.system-status {
  font-family: "Fira Code", monospace;
  color: var(--c5-green);
  font-size: 0.78rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 54vw;
}

.praesidium-grid {
  display: grid;
  grid-template-columns: 310px minmax(0, 1fr) 300px;
  gap: 1px;
  background: rgba(212, 175, 55, 0.1);
  min-height: 0;
}

.panel {
  min-height: 0;
  background: var(--panel-bg);
  border: 1px solid rgba(212, 175, 55, 0.12);
}

.panel-left,
.panel-right {
  display: flex;
  flex-direction: column;
  padding: 14px;
  overflow-y: auto;
}

.panel-center {
  position: relative;
  overflow: hidden;
  background: #07090c;
}

.panel h2 {
  margin: 0;
  font-family: Cinzel, serif;
  font-size: 0.98rem;
  text-transform: uppercase;
  color: var(--gold);
  letter-spacing: 1px;
}

.panel-subtitle {
  margin-top: 8px;
  margin-bottom: 14px;
  font-size: 0.75rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.panel-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.refresh-btn {
  border: 1px solid rgba(212, 175, 55, 0.45);
  background: rgba(212, 175, 55, 0.12);
  color: var(--gold);
  border-radius: 8px;
  width: 34px;
  height: 34px;
}

.refresh-btn:hover {
  background: rgba(212, 175, 55, 0.24);
}

.incident-feed {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
}

.incident-card {
  text-align: left;
  border: none;
  width: 100%;
  background: linear-gradient(135deg, rgba(15, 20, 28, 0.88), rgba(25, 32, 42, 0.88));
  border-left: 3px solid var(--alert-red);
  color: var(--parchment);
  padding: 11px;
  border-radius: 6px;
  cursor: pointer;
  opacity: 0;
  transform: translateX(-6px);
  animation: cardIn 0.35s ease-out forwards;
}

.incident-card.fgj {
  border-left-color: var(--gold);
}

.incident-card.c5 {
  border-left-color: var(--c5-green);
}

.incident-card.community {
  border-left-color: var(--community-blue);
}

.incident-card:hover {
  background: linear-gradient(135deg, rgba(28, 35, 47, 0.9), rgba(36, 46, 60, 0.9));
}

.incident-time {
  font-family: "Fira Code", monospace;
  color: var(--neon-red);
  font-size: 0.72rem;
}

.incident-title {
  margin-top: 4px;
  font-size: 0.88rem;
  font-weight: 600;
}

.incident-loc {
  margin-top: 3px;
  font-size: 0.78rem;
  color: var(--muted);
}

.empty-feed {
  border: 1px dashed rgba(212, 175, 55, 0.3);
  color: var(--muted);
  border-radius: 8px;
  padding: 14px;
  font-size: 0.86rem;
}

.ops-map {
  height: 100%;
  width: 100%;
}

.map-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  display: flex;
  justify-content: center;
  align-items: center;
}

.crosshair {
  width: 42px;
  height: 42px;
  border: 1px solid rgba(212, 175, 55, 0.7);
  border-radius: 50%;
  position: relative;
}

.crosshair::before,
.crosshair::after {
  content: "";
  position: absolute;
  background: rgba(212, 175, 55, 0.8);
}

.crosshair::before {
  left: 50%;
  width: 1px;
  top: -10px;
  bottom: -10px;
}

.crosshair::after {
  top: 50%;
  height: 1px;
  left: -10px;
  right: -10px;
}

.map-legend {
  position: absolute;
  right: 12px;
  bottom: 12px;
  background: rgba(12, 14, 18, 0.85);
  border: 1px solid rgba(212, 175, 55, 0.25);
  border-radius: 8px;
  padding: 9px 10px;
  font-family: "Fira Code", monospace;
  font-size: 0.68rem;
  color: var(--parchment);
  display: grid;
  gap: 5px;
}

.legend-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 6px;
}

.legend-dot.fgj {
  background: var(--gold);
}

.legend-dot.c5 {
  background: var(--c5-green);
}

.legend-dot.community {
  background: var(--community-blue);
}

.legend-dot.heat {
  background: var(--alert-red);
}

.node-list {
  display: flex;
  flex-direction: column;
}

.node-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  font-family: "Fira Code", monospace;
  font-size: 0.78rem;
}

.node-detail {
  color: var(--muted);
  margin-left: 10px;
  max-width: 38%;
  text-align: right;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 6px;
}

.status-online {
  background: var(--c5-green);
  box-shadow: 0 0 8px rgba(74, 222, 128, 0.8);
}

.status-offline {
  background: #73829c;
}

.map-popup {
  min-width: 220px;
  font-size: 0.8rem;
}

.map-popup .popup-title {
  font-weight: 700;
  margin-bottom: 6px;
}

@keyframes cardIn {
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@media (max-width: 1140px) {
  .praesidium-grid {
    grid-template-columns: 280px minmax(0, 1fr) 250px;
  }

  .system-status {
    max-width: 45vw;
  }
}

@media (max-width: 920px) {
  .praesidium-shell {
    grid-template-rows: 58px 1fr;
  }

  .praesidium-grid {
    grid-template-columns: 1fr;
    grid-template-rows: 34vh 40vh 26vh;
  }

  .panel-left,
  .panel-right {
    padding: 11px;
  }

  .map-legend {
    font-size: 0.63rem;
  }

  .system-status {
    font-size: 0.7rem;
    max-width: 58vw;
  }
}
