* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #f5f5f7;
  color: #1a1a1a;
  line-height: 1.5;
}

header {
  background: #fff;
  border-bottom: 1px solid #e5e5e7;
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.header-left { display: flex; align-items: center; gap: 1rem; }
.header-right { display: flex; align-items: center; gap: 1rem; }
h1 { font-size: 1.2rem; font-weight: 600; }
h3 { font-size: 1rem; margin-bottom: 0.75rem; color: #1a1a1a; }

.badge {
  background: #0066cc;
  color: #fff;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 500;
}
.live { color: #16a34a; font-size: 0.85rem; }

button {
  background: #0066cc;
  color: #fff;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
}
button:hover { background: #0052a3; }
button.ghost {
  background: transparent;
  color: #1a1a1a;
  border: 1px solid #d1d1d6;
}
button.ghost:hover { background: #e5e5e7; }
button.small { font-size: 0.8rem; padding: 0.25rem 0.6rem; }
button.danger { background: #c00; }
button.danger:hover { background: #900; }

.tabs {
  background: #fff;
  border-bottom: 1px solid #e5e5e7;
  padding: 0 2rem;
  display: flex;
  gap: 0.5rem;
}
.tab {
  background: transparent;
  color: #666;
  padding: 0.75rem 1.25rem;
  border-radius: 0;
  border-bottom: 2px solid transparent;
  font-weight: 500;
}
.tab:hover { background: transparent; color: #1a1a1a; }
.tab.active { color: #0066cc; border-bottom-color: #0066cc; }

main { padding: 2rem; max-width: 1400px; margin: 0 auto; }

.view { display: none; }
.view.active { display: block; }

.card {
  background: #fff;
  border-radius: 8px;
  padding: 1.25rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.card-label { font-size: 0.8rem; color: #666; text-transform: uppercase; letter-spacing: 0.5px; }
.card-value { font-size: 2rem; font-weight: 600; margin: 0.5rem 0; }
.card-sub { font-size: 0.85rem; color: #666; }

.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }

.toolbar {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
  background: #fff;
  padding: 1rem;
  border-radius: 8px;
}
.toolbar label { display: flex; align-items: center; gap: 0.5rem; font-size: 0.9rem; }
.toolbar select, .toolbar input { padding: 0.4rem 0.6rem; border: 1px solid #d1d1d6; border-radius: 4px; }

input, select {
  padding: 0.5rem;
  border: 1px solid #d1d1d6;
  border-radius: 4px;
  font-size: 0.9rem;
  font-family: inherit;
}
form label { display: block; margin-bottom: 0.75rem; }
form input { width: 100%; max-width: 400px; margin-top: 0.25rem; }
form button { margin-top: 0.5rem; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 0.75rem 0.5rem; border-bottom: 1px solid #e5e5e7; font-size: 0.9rem; }
th { background: #f5f5f7; font-weight: 600; color: #555; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.5px; }
tr:hover { background: #fafafb; cursor: pointer; }

.row-table {
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.pill {
  display: inline-block;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 500;
}
.pill-succeeded, .pill-complete, .pill-success { background: #dcfce7; color: #16803c; }
.pill-needs_review, .pill-warning { background: #fef3c7; color: #92400e; }
.pill-auto_excluded, .pill-failed, .pill-blocked { background: #fee2e2; color: #991b1b; }
.pill-retrying, .pill-running, .pill-in_flight { background: #dbeafe; color: #1e40af; }
.pill-action_required { background: #fed7aa; color: #9a3412; }
.pill-info { background: #e5e7eb; color: #4b5563; }

.modal {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 100;
  padding: 2rem;
}
.modal.open { display: flex; align-items: flex-start; justify-content: center; }
.modal-body {
  background: #fff;
  border-radius: 8px;
  max-width: 800px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 2rem;
  position: relative;
}
.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: transparent;
  color: #666;
  font-size: 1.2rem;
  padding: 0.25rem 0.5rem;
}
.modal-close:hover { color: #000; background: #f5f5f7; }

.muted { color: #888; font-size: 0.85rem; }
.empty {
  padding: 2rem;
  text-align: center;
  color: #888;
  background: #fff;
  border-radius: 8px;
}
.error {
  color: #c00;
  padding: 1rem;
  background: #fee2e2;
  border-radius: 6px;
  margin-bottom: 1rem;
}
.success {
  color: #16803c;
  padding: 0.75rem 1rem;
  background: #dcfce7;
  border-radius: 6px;
  margin-bottom: 1rem;
}

code {
  font-family: 'Menlo', 'Monaco', monospace;
  font-size: 0.85rem;
  background: #f5f5f7;
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
}
