:root {
  --bg-1: #071224;
  --bg-2: #112a50;
  --panel: rgba(8, 20, 41, 0.86);
  --line: rgba(255, 255, 255, 0.15);
  --ink: #ecf4ff;
  --muted: #9fb8d8;
  --ok: #63e6b4;
  --warn: #ffd26f;
  --risk: #ff8b7d;
  --blue: #63b5ff;
}

* { box-sizing: border-box; }

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: "Space Grotesk", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 16% 14%, rgba(99, 181, 255, 0.24), transparent 30%),
    radial-gradient(circle at 84% 12%, rgba(0, 214, 199, 0.17), transparent 24%),
    linear-gradient(145deg, var(--bg-1), var(--bg-2));
}

.shell {
  padding: 0.75rem;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 0.62rem;
}

.top {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
  padding: 0.65rem 0.75rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.eyebrow {
  margin: 0;
  color: #83f3d7;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.7rem;
}

.top h1 {
  margin: 0.28rem 0 0;
  font-family: "Sora", sans-serif;
  font-size: 1.1rem;
}

.top-actions {
  display: flex;
  gap: 0.45rem;
  align-items: center;
  flex-wrap: wrap;
}

.control-label {
  font-size: 0.72rem;
  color: var(--muted);
}

.top-actions select {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--ink);
  font: inherit;
  padding: 0.38rem 0.52rem;
}

button {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--ink);
  font: inherit;
  padding: 0.42rem 0.62rem;
  cursor: pointer;
}

button:hover { background: rgba(99, 181, 255, 0.18); }

.kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.5rem;
}

.kpi {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  padding: 0.55rem;
}

.kpi span {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
}

.kpi strong {
  display: block;
  margin-top: 0.16rem;
  font-size: 0.98rem;
}

.layout {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 300px 1fr 320px;
  gap: 0.62rem;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
  padding: 0.65rem;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.panel > header h2 {
  margin: 0;
  font-family: "Sora", sans-serif;
  font-size: 0.98rem;
}

.panel > header p {
  margin: 0.2rem 0 0.45rem;
  color: var(--muted);
  font-size: 0.75rem;
}

.room-list {
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.room-item {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.5rem;
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
}

.room-item.active,
.room-item:hover {
  border-color: rgba(99, 181, 255, 0.62);
  background: rgba(99, 181, 255, 0.14);
}

.room-item h4 {
  margin: 0;
  font-size: 0.82rem;
}

.room-item p {
  margin: 0.18rem 0 0;
  color: var(--muted);
  font-size: 0.72rem;
}

.room-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.45rem;
  margin-bottom: 0.55rem;
}

.grid-cell {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.42rem;
  min-height: 78px;
  background: rgba(255, 255, 255, 0.04);
}

.grid-cell h5 {
  margin: 0;
  font-size: 0.75rem;
}

.grid-cell p {
  margin: 0.22rem 0 0;
  font-size: 0.7rem;
  color: var(--muted);
}

.state-ok { box-shadow: inset 0 0 0 1px rgba(99, 230, 180, 0.5); }
.state-warn { box-shadow: inset 0 0 0 1px rgba(255, 210, 111, 0.55); }
.state-risk { box-shadow: inset 0 0 0 1px rgba(255, 139, 125, 0.62); }

.event-log {
  border-top: 1px solid var(--line);
  padding-top: 0.45rem;
}

.event-log h3 {
  margin: 0;
  font-size: 0.86rem;
}

.log-list {
  margin-top: 0.35rem;
  max-height: 132px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.log-item {
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 0.38rem;
  background: rgba(255, 255, 255, 0.04);
  font-size: 0.72rem;
  color: var(--muted);
}

.detail-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.62rem;
  background: rgba(255, 255, 255, 0.04);
}

.detail-card h3 { margin: 0; }
.detail-card p { margin: 0.22rem 0 0; color: var(--muted); font-size: 0.75rem; }

.detail-grid {
  margin-top: 0.45rem;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.4rem;
}

.mini {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.38rem;
  background: rgba(255, 255, 255, 0.04);
}

.mini span {
  display: block;
  color: var(--muted);
  font-size: 0.68rem;
}

.mini strong { font-size: 0.83rem; }

.agents {
  margin-top: 0.6rem;
}

.agents h3 {
  margin: 0 0 0.35rem;
  font-size: 0.88rem;
}

.agent-status {
  display: flex;
  flex-direction: column;
  gap: 0.32rem;
}

.agent-item {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.42rem;
  background: rgba(255, 255, 255, 0.04);
}

.agent-item strong {
  display: block;
  font-size: 0.78rem;
}

.agent-item span {
  color: var(--muted);
  font-size: 0.71rem;
}

@media (max-width: 1180px) {
  .layout { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
