* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #0f172a;
  color: #e2e8f0;
  line-height: 1.5;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

header {
  background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
  border-bottom: 1px solid #334155;
  padding: 24px 0;
  margin-bottom: 32px;
}
header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
header h1 { font-size: 22px; font-weight: 600; }
.meta {
  display: flex;
  gap: 16px;
  align-items: center;
  font-size: 13px;
  color: #94a3b8;
}
#refresh-btn {
  background: #334155;
  color: #e2e8f0;
  border: none;
  border-radius: 6px;
  width: 28px;
  height: 28px;
  cursor: pointer;
  font-size: 14px;
}
#refresh-btn:hover { background: #475569; }

main { padding-bottom: 64px; }

h2 {
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #94a3b8;
  margin-bottom: 12px;
}

section { margin-bottom: 36px; }

/* KPI bar */
.kpi-bar {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.kpi-item {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 12px;
  padding: 20px;
}
.kpi-label {
  font-size: 11px;
  color: #94a3b8;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}
.kpi-value {
  font-size: 36px;
  font-weight: 700;
  color: #f1f5f9;
}
.kpi-value.warn { color: #f59e0b; }
.kpi-value.bad { color: #ef4444; }
.kpi-value.good { color: #10b981; }
.kpi-sub {
  font-size: 12px;
  color: #64748b;
  margin-top: 4px;
}

/* Agents */
.agents-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}
.agent-card {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 12px;
  padding: 16px;
}
.agent-card .agent-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.agent-card .emoji { font-size: 24px; }
.agent-card .name { font-weight: 600; font-size: 16px; }
.agent-card .role { font-size: 12px; color: #94a3b8; }

.agent-card .status {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}
.status.active { background: #064e3b; color: #34d399; }
.status.idle { background: #334155; color: #94a3b8; }
.status.waiting { background: #78350f; color: #fbbf24; }

.agent-card .last-msg {
  font-size: 13px;
  color: #cbd5e1;
  margin-top: 4px;
  line-height: 1.4;
}
.agent-card .last-time {
  font-size: 11px;
  color: #64748b;
  margin-top: 6px;
}
.agent-card .tasks-badge {
  display: inline-block;
  background: #312e81;
  color: #c7d2fe;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
  margin-top: 8px;
}

/* Tasks list */
#tasks-list, #journal-list {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 12px;
  padding: 8px;
}
.task-item, .journal-item {
  padding: 12px;
  border-bottom: 1px solid #334155;
}
.task-item:last-child, .journal-item:last-child { border-bottom: none; }

.task-title {
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 4px;
}
.task-priority {
  display: inline-block;
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 3px;
  margin-right: 6px;
  text-transform: uppercase;
}
.task-priority.urgent { background: #7f1d1d; color: #fecaca; }
.task-priority.normal { background: #334155; color: #cbd5e1; }
.task-priority.low { background: #1e3a8a; color: #bfdbfe; }
.task-meta { font-size: 11px; color: #64748b; }

/* Journal */
.journal-item .head {
  display: flex;
  justify-content: space-between;
  margin-bottom: 4px;
}
.journal-item .author {
  font-weight: 600;
  font-size: 13px;
  color: #e2e8f0;
}
.journal-item .time {
  font-size: 11px;
  color: #64748b;
}
.journal-item .body {
  font-size: 13px;
  color: #cbd5e1;
  line-height: 1.4;
  white-space: pre-wrap;
}
.journal-item .status-tag {
  display: inline-block;
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 3px;
  margin-top: 6px;
  text-transform: uppercase;
}
.status-tag.open { background: #78350f; color: #fbbf24; }
.status-tag.in-progress { background: #1e3a8a; color: #bfdbfe; }
.status-tag.done { background: #064e3b; color: #34d399; }

/* Touch buttons */
.touch-bar { background: #1e293b; border: 1px solid #334155; border-radius: 12px; padding: 20px; }
.touch-bar .hint { font-size: 13px; color: #94a3b8; margin-bottom: 12px; }
.touch-buttons { display: flex; gap: 8px; flex-wrap: wrap; }
.touch-btn {
  background: #334155;
  color: #e2e8f0;
  border: 1px solid #475569;
  border-radius: 8px;
  padding: 10px 16px;
  cursor: pointer;
  font-size: 14px;
}
.touch-btn:hover { background: #475569; }
.touch-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.touch-btn.recorded { background: #064e3b; border-color: #10b981; }

footer {
  font-size: 12px;
  color: #64748b;
  text-align: center;
  padding: 32px 0;
  border-top: 1px solid #1e293b;
  margin-top: 32px;
}
footer a { color: #94a3b8; text-decoration: none; }
footer a:hover { color: #e2e8f0; }
