* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  background: #f6f7f9;
  color: #1f2937;
}
header {
  background: #1f2937;
  color: #f9fafb;
  padding: 14px 22px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 18px;
}
header h1 { margin: 0; font-size: 20px; }
header .auth { display: flex; gap: 8px; align-items: center; }
header input { padding: 6px 10px; border: 1px solid #4b5563; border-radius: 4px; background: #374151; color: #f9fafb; }
header button { padding: 6px 12px; border: 0; border-radius: 4px; cursor: pointer; background: #2563eb; color: white; }
header #status { font-size: 13px; opacity: 0.7; }
header #status.live { color: #10b981; opacity: 1; }
header nav { margin-left: auto; display: flex; gap: 4px; }
header nav button {
  background: transparent;
  color: #d1d5db;
  border: 1px solid #374151;
}
header nav button.active { background: #2563eb; color: white; }
main { padding: 18px; }
.tab { display: none; }
.tab.active { display: block; }

.kanban {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
}
.col {
  background: #fff;
  border-radius: 8px;
  padding: 12px;
  border: 1px solid #e5e7eb;
  min-height: 70vh;
}
.col h2 { font-size: 14px; margin: 0 0 12px; color: #374151; display: flex; justify-content: space-between; }
.col .count { background: #e5e7eb; color: #4b5563; padding: 2px 8px; border-radius: 12px; font-size: 12px; }
.cards { display: flex; flex-direction: column; gap: 10px; }
.card {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-left: 3px solid #2563eb;
  border-radius: 6px;
  padding: 10px;
  cursor: pointer;
  font-size: 13px;
}
.card.hubagent { border-left-color: #2563eb; }
.card.medusahub { border-left-color: #16a34a; }
.card.both { border-left-color: #ea580c; }
.card .title { font-weight: 600; margin-bottom: 6px; }
.card .meta { display: flex; gap: 8px; font-size: 11px; color: #6b7280; }
.card .priority-critical { color: #dc2626; font-weight: 600; }
.card .priority-high { color: #ea580c; }
.card .priority-medium { color: #ca8a04; }

.feed { display: flex; flex-direction: column; gap: 6px; }
.event {
  background: #fff;
  padding: 8px 12px;
  border-radius: 6px;
  border: 1px solid #e5e7eb;
  font-size: 13px;
  display: flex;
  gap: 12px;
  align-items: baseline;
}
.event time { color: #6b7280; font-size: 11px; min-width: 80px; }
.event .actor { font-weight: 600; }
.event .actor.hubagent { color: #2563eb; }
.event .actor.medusahub { color: #16a34a; }
.event .actor.human { color: #ea580c; }
.event .type { background: #f3f4f6; padding: 2px 6px; border-radius: 4px; font-size: 11px; color: #4b5563; }

#decisions-list, #sprints-view { display: flex; flex-direction: column; gap: 10px; }
.adr {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 14px;
}
.adr h3 { margin: 0 0 6px; font-size: 15px; }
.adr .status { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 11px; }
.adr .status-proposed { background: #fef3c7; color: #92400e; }
.adr .status-accepted { background: #d1fae5; color: #065f46; }
.adr .status-rejected { background: #fee2e2; color: #991b1b; }

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
.modal {
  background: #fff;
  border-radius: 8px;
  padding: 24px;
  max-width: 800px;
  max-height: 85vh;
  overflow-y: auto;
  width: 90%;
  position: relative;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
}
.modal h2 { margin: 0 0 12px; padding-right: 30px; }
.modal .close {
  position: absolute;
  top: 12px;
  right: 16px;
  background: transparent;
  border: 0;
  font-size: 24px;
  cursor: pointer;
  color: #6b7280;
}
.modal .task-meta { display: flex; flex-wrap: wrap; gap: 16px; margin: 12px 0; font-size: 13px; }
.modal .event-list { display: flex; flex-direction: column; gap: 6px; max-height: 300px; overflow-y: auto; }

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