:root {
  --bg-1: #f3efe6;
  --bg-2: #e8dcc7;
  --ink: #1f2924;
  --muted: #516057;
  --accent: #2e6f62;
  --accent-2: #bf5d3f;
  --line: #b9ae9a;
  --card: rgba(255, 251, 243, 0.92);
  --warn: #b0632f;
  --good: #2d7b4b;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  color: var(--ink);
  background: radial-gradient(circle at 20% 20%, var(--bg-1), var(--bg-2));
  position: relative;
  overflow-x: hidden;
}

.bg-shape {
  position: fixed;
  z-index: -1;
  border-radius: 999px;
  filter: blur(2px);
  opacity: 0.5;
}

.shape-1 {
  width: 320px;
  height: 320px;
  background: linear-gradient(140deg, #d9a772, #cf704d);
  top: -90px;
  right: -80px;
}

.shape-2 {
  width: 260px;
  height: 260px;
  background: linear-gradient(140deg, #85b2a6, #5a8f84);
  bottom: -100px;
  left: -70px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 1.2rem 1.2rem 0.6rem;
}

.eyebrow {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  font-size: 0.72rem;
}

h1 {
  margin: 0.2rem 0 0;
  font-size: clamp(1.4rem, 2vw, 2rem);
}

.live-badge {
  border: 1px solid var(--line);
  background: #fff7ea;
  border-radius: 999px;
  padding: 0.4rem 0.8rem;
  font-size: 0.78rem;
}

.layout {
  display: grid;
  gap: 0.9rem;
  grid-template-columns: 1.2fr 1.2fr 1fr;
  padding: 0.4rem 1.2rem 1rem;
}

.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 0.9rem;
  box-shadow: 0 16px 28px rgba(61, 53, 40, 0.08);
}

h2 {
  margin: 0 0 0.7rem;
  font-size: 1rem;
}

h3 {
  margin: 0.8rem 0 0.4rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.org-graph {
  display: grid;
  gap: 0.5rem;
}

.node {
  border: 1px solid var(--line);
  border-left: 5px solid var(--accent);
  border-radius: 10px;
  padding: 0.5rem;
  background: #fffef9;
  cursor: pointer;
}

.node.selected {
  border-left-color: var(--accent-2);
  box-shadow: 0 0 0 2px rgba(191, 93, 63, 0.2);
}

.node small {
  color: var(--muted);
  display: block;
  margin-top: 0.15rem;
}

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

.stat {
  border: 1px dashed var(--line);
  border-radius: 10px;
  padding: 0.45rem;
  font-size: 0.8rem;
  background: #fff8ef;
}

.agent-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.chip {
  padding: 0.2rem 0.45rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.74rem;
  background: #fffaf2;
}

.latest-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.6rem;
  background: #fffdf7;
  min-height: 70px;
}

.history-list,
.timeline-list,
.audit-list,
.search-results {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.4rem;
  max-height: 280px;
  overflow: auto;
}

.history-list li,
.timeline-list li,
.audit-list li,
.search-results li {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.45rem;
  background: #fffef9;
  font-size: 0.82rem;
}

.path {
  font-weight: 600;
  word-break: break-all;
}

.tool-block {
  margin-bottom: 0.9rem;
}

label {
  display: grid;
  gap: 0.2rem;
  margin-bottom: 0.45rem;
  font-size: 0.82rem;
}

input,
select,
textarea,
button {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.45rem 0.55rem;
  font: inherit;
}

button {
  background: linear-gradient(120deg, var(--accent), #4e9a8a);
  color: #fff;
  border: none;
  cursor: pointer;
}

button:hover {
  filter: brightness(1.06);
}

.inline-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.35rem;
}

.feedback {
  margin: 0.4rem 0 0;
  min-height: 1.2rem;
  color: var(--muted);
  font-size: 0.8rem;
}

.timeline-panel {
  margin: 0 1.2rem 1.2rem;
}

.status-good {
  color: var(--good);
}

.status-warn {
  color: var(--warn);
}

@media (max-width: 1100px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .timeline-panel {
    margin-top: 0;
  }
}
