:root {
  --bg: #07111f;
  --panel: #0d1b2a;
  --panel-2: #12263a;
  --line: #1d4ed8;
  --text: #e5f0ff;
  --muted: #9bb1cc;
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --accent: #3b82f6;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Inter, Arial, sans-serif;
  background: radial-gradient(circle at top, #102546 0%, #06101d 55%, #040a13 100%);
  color: var(--text);
}

.hidden {
  display: none !important;
}

.screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-card {
  width: min(420px, 100%);
  background: rgba(13, 27, 42, 0.96);
  border: 1px solid rgba(59, 130, 246, 0.35);
  border-radius: 20px;
  padding: 28px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.32);
}

.brand-line {
  font-size: 12px;
  letter-spacing: 0.18em;
  color: #7da3da;
}

.login-card h1 {
  margin: 10px 0 6px;
  font-size: 42px;
}

.login-card p {
  margin: 0 0 22px;
  color: var(--muted);
}

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

label {
  display: grid;
  gap: 8px;
  font-size: 14px;
}

input {
  height: 48px;
  border-radius: 12px;
  border: 1px solid rgba(125, 163, 218, 0.25);
  background: rgba(4, 10, 19, 0.8);
  color: var(--text);
  padding: 0 14px;
  font-size: 15px;
}

button {
  height: 48px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, #2563eb, #3b82f6);
  color: white;
  font-weight: 700;
  cursor: pointer;
}

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

.error {
  min-height: 18px;
  color: #fca5a5;
  margin: 0;
}

.topbar {
  height: 72px;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(59, 130, 246, 0.2);
  background: rgba(7, 17, 31, 0.9);
}

.brand {
  font-size: 24px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.subtitle {
  margin-left: 12px;
  color: var(--muted);
}

.actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.office-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 20px;
  padding: 20px;
}

.canvas-wrapper {
  position: relative;
  background: rgba(13, 27, 42, 0.92);
  border: 1px solid rgba(59, 130, 246, 0.24);
  border-radius: 18px;
  padding: 14px;
}

#office-canvas {
  width: 100%;
  max-width: 960px;
  aspect-ratio: 16 / 9;
  border-radius: 14px;
  image-rendering: pixelated;
  background: #9dd4fb;
  display: block;
}

.canvas-help {
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
}

.side-panel {
  display: grid;
  gap: 16px;
}

.panel-card {
  background: rgba(13, 27, 42, 0.95);
  border: 1px solid rgba(59, 130, 246, 0.2);
  border-radius: 16px;
  padding: 18px;
}

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

.panel-card h2 {
  margin: 0;
  font-size: 18px;
}

.agent-card {
  display: grid;
  gap: 14px;
  background: linear-gradient(180deg, rgba(3, 7, 14, 0.62), rgba(5, 12, 22, 0.8));
  border-radius: 14px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.agent-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.agent-title-row strong {
  display: block;
  font-size: 22px;
  margin-bottom: 4px;
}

.agent-card span,
.panel-card small,
.history-time,
.empty-state {
  color: var(--muted);
}

.agent-meta-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.agent-meta-grid p,
.agent-message-box p {
  margin: 6px 0 0;
  line-height: 1.4;
}

.agent-message-box {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(59, 130, 246, 0.12);
  border-radius: 12px;
  padding: 12px;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 112px;
  height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  border: 1px solid transparent;
}

.status-badge.is-idle {
  background: rgba(148, 163, 184, 0.14);
  color: #cbd5e1;
  border-color: rgba(148, 163, 184, 0.26);
}

.status-badge.is-working {
  background: rgba(245, 158, 11, 0.16);
  color: #fbbf24;
  border-color: rgba(245, 158, 11, 0.3);
}

.status-badge.is-success {
  background: rgba(16, 185, 129, 0.16);
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.3);
}

.status-badge.is-error {
  background: rgba(239, 68, 68, 0.16);
  color: #f87171;
  border-color: rgba(239, 68, 68, 0.3);
}

.history-list {
  display: grid;
  gap: 10px;
}

.history-item {
  background: rgba(3, 7, 14, 0.52);
  border: 1px solid rgba(59, 130, 246, 0.14);
  border-radius: 14px;
  padding: 12px;
}

.history-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.history-flow {
  font-weight: 700;
  line-height: 1.35;
}

.history-time {
  margin-top: 8px;
  font-size: 12px;
}

.history-message {
  margin-top: 10px;
  line-height: 1.45;
}

.panel-card code {
  display: block;
  margin-bottom: 8px;
  white-space: nowrap;
  overflow: auto;
}

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