/* ===== openaisolutions Mission Control ===== */

:root {
  --bg-0: #060814;
  --bg-1: #0c1024;
  --bg-2: #141a3a;
  --panel: rgba(20, 26, 58, 0.55);
  --panel-border: rgba(120, 130, 200, 0.18);
  --panel-border-hot: rgba(167, 139, 250, 0.35);
  --text: #E6EAFB;
  --text-dim: #94A3B8;
  --text-faint: #64748B;
  --accent: #A78BFA;
  --accent-cyan: #22D3EE;
  --accent-pink: #F472B6;
  --accent-green: #34D399;
  --accent-amber: #FBBF24;
  --accent-red: #FB7185;
  --grid-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  --grid-glow: 0 0 30px rgba(167, 139, 250, 0.12);
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, monospace;
  --sans: "Inter Tight", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; padding: 0; }
body {
  background: radial-gradient(ellipse at 20% 0%, var(--bg-2) 0%, var(--bg-0) 55%);
  color: var(--text);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  font-size: 14px;
  line-height: 1.5;
  overflow-x: hidden;
}

.bg-stars {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background-image:
    radial-gradient(1px 1px at 20% 30%, rgba(255,255,255,0.6) 50%, transparent 51%),
    radial-gradient(1px 1px at 60% 70%, rgba(167,139,250,0.5) 50%, transparent 51%),
    radial-gradient(1px 1px at 85% 20%, rgba(34,211,238,0.5) 50%, transparent 51%),
    radial-gradient(1px 1px at 40% 80%, rgba(255,255,255,0.4) 50%, transparent 51%),
    radial-gradient(1px 1px at 90% 90%, rgba(244,114,182,0.4) 50%, transparent 51%);
  background-size: 100% 100%;
}

/* ===== Top Navigation ===== */

.topnav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 28px; gap: 24px;
  border-bottom: 1px solid var(--panel-border);
  background: rgba(6, 8, 20, 0.7);
  backdrop-filter: blur(12px);
  position: sticky; top: 0; z-index: 50;
}

.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--text); }
.brand-orb {
  width: 28px; height: 28px; border-radius: 50%;
  background: radial-gradient(circle, var(--accent-cyan) 0%, var(--accent) 50%, transparent 70%);
  box-shadow: 0 0 24px var(--accent);
}
.brand-logo { width: 28px; height: 28px; border-radius: 6px; object-fit: contain; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-title { font-weight: 700; font-size: 14px; letter-spacing: 0.04em; }
.brand-sub { font-family: var(--mono); font-size: 11px; color: var(--text-dim); text-transform: uppercase; }
.brand-version { color: var(--accent); margin-left: 6px; }

.tabs { display: flex; gap: 4px; background: rgba(20, 26, 58, 0.4); padding: 4px; border-radius: 999px; border: 1px solid var(--panel-border); }
.tab {
  background: transparent; border: none; color: var(--text-dim);
  padding: 8px 18px; border-radius: 999px;
  font-family: var(--sans); font-size: 12px; font-weight: 600;
  letter-spacing: 0.06em; text-transform: uppercase;
  cursor: pointer; transition: all 0.15s ease;
}
.tab:hover { color: var(--text); }
.tab.active { background: rgba(167, 139, 250, 0.18); color: var(--text); box-shadow: inset 0 0 0 1px var(--panel-border-hot); }

.status { display: flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 11px; color: var(--text-dim); text-transform: uppercase; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-faint); }
.status-dot.ok { background: var(--accent-green); box-shadow: 0 0 10px var(--accent-green); }
.status-dot.warn { background: var(--accent-amber); box-shadow: 0 0 10px var(--accent-amber); }
.status-dot.err { background: var(--accent-red); box-shadow: 0 0 10px var(--accent-red); }
.status-sep { color: var(--text-faint); }

/* ===== Panels ===== */

main { padding: 28px 28px 48px; max-width: 1600px; margin: 0 auto; }
.panel { display: none; animation: fadeIn 0.3s ease; }
.panel.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }

.panel-header {
  display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap;
  gap: 16px; margin-bottom: 24px;
}
.panel-header h1 { margin: 4px 0 0; font-size: 28px; font-weight: 700; letter-spacing: -0.01em; }
.card-eyebrow {
  display: block; font-family: var(--mono); font-size: 10px; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--text-faint);
}

/* ===== Cards ===== */

.card {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 16px;
  padding: 20px;
  box-shadow: var(--grid-shadow);
  backdrop-filter: blur(8px);
}
.card header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.card h2 { margin: 4px 0 6px; font-size: 18px; font-weight: 700; color: var(--accent-cyan); }
.card h3 { margin: 4px 0; font-size: 16px; }
.card .meta { color: var(--text-dim); font-size: 12px; font-family: var(--mono); }
.card-pill {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase;
  padding: 3px 10px; border-radius: 999px; background: rgba(167, 139, 250, 0.15); color: var(--accent);
  border: 1px solid rgba(167, 139, 250, 0.3);
}

/* ===== Overview Grid ===== */

.grid-overview {
  display: grid; grid-template-columns: 1.4fr 1fr; gap: 20px;
  grid-template-rows: auto auto;
  margin-bottom: 20px;
}
.grid-overview .directive { grid-column: 1; grid-row: 1; }
.grid-overview .health    { grid-column: 2; grid-row: 1 / span 2; }
.grid-overview .throughput{ grid-column: 1; grid-row: 2; }
.grid-overview .next-cron { grid-column: 2; grid-row: 3; }
.grid-overview .next-cron, .grid-overview .throughput { /* keep them stretchable */ }

@media (max-width: 900px) {
  .grid-overview { grid-template-columns: 1fr; }
  .grid-overview .directive, .grid-overview .health, .grid-overview .throughput, .grid-overview .next-cron {
    grid-column: 1; grid-row: auto;
  }
}

.health-row { display: grid; grid-template-columns: 38px 1fr 50px; align-items: center; gap: 10px; margin: 8px 0 4px; }
.health-label { font-family: var(--mono); font-size: 10px; text-transform: uppercase; color: var(--text-dim); }
.health-val { text-align: right; font-family: var(--mono); font-size: 12px; }
.health-sub { font-family: var(--mono); font-size: 10px; color: var(--text-faint); margin: 0 0 6px 48px; }
.bar { height: 6px; background: rgba(120, 130, 200, 0.15); border-radius: 999px; overflow: hidden; }
.bar-fill { height: 100%; background: linear-gradient(90deg, var(--accent-green), var(--accent-cyan)); border-radius: 999px; transition: width 0.6s ease; }
.bar-fill.purple { background: linear-gradient(90deg, var(--accent), var(--accent-pink)); }
.bar-fill.cyan   { background: linear-gradient(90deg, var(--accent-cyan), var(--accent)); }

#sparkline { width: 100%; height: 80px; margin: 6px 0; }
.spark-area { fill: url(#sparkGrad); opacity: 0.4; }
.spark-line { fill: none; stroke: var(--accent-cyan); stroke-width: 2; }
.spark-dot { fill: var(--accent); }

/* ===== Stat Strip ===== */

.stat-strip {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 16px;
  padding: 18px;
  box-shadow: var(--grid-shadow);
}
.stat { text-align: center; }
.stat-val { font-size: 24px; font-weight: 700; font-family: var(--sans); color: var(--text); }
.stat-label { font-size: 10px; font-family: var(--mono); letter-spacing: 0.1em; color: var(--text-faint); text-transform: uppercase; margin-top: 2px; }

/* ===== Agents Tab ===== */

.agent-summary, .task-stats { display: flex; gap: 12px; }
.kpi { background: var(--panel); border: 1px solid var(--panel-border); border-radius: 12px; padding: 12px 18px; text-align: center; min-width: 90px; }
.kpi div { font-size: 22px; font-weight: 700; }
.kpi span { font-size: 10px; font-family: var(--mono); letter-spacing: 0.1em; color: var(--text-faint); text-transform: uppercase; }
.kpi.active div { color: var(--accent-green); }
.kpi.idle div { color: var(--accent-amber); }
.kpi.dormant div { color: var(--accent); }
.kpi.done div { color: var(--accent-green); }

.agent-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px;
}

.agent-card {
  background: var(--panel); border: 1px solid var(--panel-border); border-radius: 16px;
  padding: 18px; position: relative; overflow: hidden;
  box-shadow: var(--grid-shadow);
}
.agent-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: var(--agent-accent, var(--accent));
}
.agent-card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.agent-code {
  font-family: var(--mono); font-size: 10px; padding: 3px 8px; border-radius: 6px;
  background: rgba(167,139,250,0.12); color: var(--agent-accent, var(--accent)); letter-spacing: 0.08em;
}
.agent-channel {
  font-family: var(--mono); font-size: 9px; padding: 3px 8px; border-radius: 6px;
  background: rgba(120,130,200,0.1); color: var(--text-dim); text-transform: uppercase;
}
.agent-status-dot { width: 8px; height: 8px; border-radius: 50%; }
.agent-status-dot.active { background: var(--accent-green); box-shadow: 0 0 8px var(--accent-green); }
.agent-status-dot.idle { background: var(--accent-amber); }
.agent-status-dot.dormant { background: var(--text-faint); }
.agent-name { font-size: 18px; font-weight: 700; margin: 2px 0 6px; }
.agent-role { font-size: 12px; color: var(--text-dim); margin: 0 0 14px; min-height: 36px; }
.agent-spark { height: 36px; display: flex; align-items: flex-end; gap: 3px; margin: 8px 0 10px; }
.agent-spark-bar {
  flex: 1; min-height: 2px; background: var(--agent-accent, var(--accent)); border-radius: 3px 3px 0 0;
  opacity: 0.85;
}
.agent-meta { display: flex; align-items: center; justify-content: space-between; }
.agent-meta-num { font-size: 18px; font-weight: 700; }
.agent-meta-lbl { font-size: 10px; font-family: var(--mono); color: var(--text-faint); text-transform: uppercase; }
.agent-model { font-family: var(--mono); font-size: 10px; color: var(--text-dim); margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ===== Tasks Tab ===== */

.board-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.board-col { background: var(--panel); border: 1px solid var(--panel-border); border-radius: 14px; padding: 16px; min-height: 200px; }
.board-col header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.board-col h3 { margin: 0; font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; font-family: var(--mono); }
.board-col .count { font-family: var(--mono); font-size: 12px; color: var(--text-dim); }
.board-col.pending h3 { color: var(--accent-amber); }
.board-col.in-progress h3 { color: var(--accent-cyan); }
.board-col.done h3 { color: var(--accent-green); }

.task-card { background: rgba(20, 26, 58, 0.35); border: 1px solid var(--panel-border); border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; }
.task-title { font-size: 13px; font-weight: 600; line-height: 1.3; }
.task-meta { display: flex; gap: 10px; margin-top: 6px; font-family: var(--mono); font-size: 9px; color: var(--text-faint); text-transform: uppercase; }
.task-meta .assignee { color: var(--accent); }

/* ===== Schedule Tab ===== */

.cron-group { background: var(--panel); border: 1px solid var(--panel-border); border-radius: 14px; padding: 18px; margin-bottom: 14px; }
.cron-group-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.cron-group-kind { font-size: 14px; font-weight: 700; letter-spacing: 0.04em; color: var(--accent-cyan); }
.cron-group-count { font-family: var(--mono); font-size: 10px; padding: 2px 8px; border-radius: 6px; background: rgba(34,211,238,0.1); color: var(--accent-cyan); }
.cron-job { display: grid; grid-template-columns: 100px 1fr 120px 120px; gap: 14px; align-items: center; padding: 10px 0; border-top: 1px dashed var(--panel-border); }
.cron-job:first-of-type { border-top: none; }
.cron-time { font-family: var(--mono); font-size: 12px; color: var(--accent); }
.cron-name { font-weight: 600; }
.cron-name small { display: block; color: var(--text-dim); font-weight: 400; font-size: 11px; margin-top: 1px; font-family: var(--mono); }
.cron-when { font-family: var(--mono); font-size: 11px; color: var(--text-dim); }
.cron-status { font-family: var(--mono); font-size: 10px; padding: 3px 8px; border-radius: 6px; text-transform: uppercase; letter-spacing: 0.1em; text-align: center; }
.cron-status.ok { background: rgba(52,211,153,0.12); color: var(--accent-green); }
.cron-status.error { background: rgba(251,113,133,0.12); color: var(--accent-red); }
.cron-status.unknown, .cron-status.null { background: rgba(120,130,200,0.1); color: var(--text-dim); }

/* ===== Content Tab ===== */

.content-layout { display: grid; grid-template-columns: 280px 1fr; gap: 18px; }
.content-sidebar { background: var(--panel); border: 1px solid var(--panel-border); border-radius: 14px; padding: 16px; }
.filter-pills { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.filter-pills button {
  background: rgba(120,130,200,0.08); border: 1px solid var(--panel-border); color: var(--text-dim);
  padding: 4px 10px; border-radius: 999px; font-size: 10px; font-family: var(--mono); cursor: pointer;
  letter-spacing: 0.08em; text-transform: uppercase;
}
.filter-pills button.active { background: rgba(167,139,250,0.18); color: var(--accent); border-color: var(--panel-border-hot); }
.doc-list { display: flex; flex-direction: column; gap: 4px; max-height: 60vh; overflow-y: auto; }
.doc-item { background: rgba(20, 26, 58, 0.35); border: 1px solid transparent; border-radius: 8px; padding: 8px 10px; cursor: pointer; }
.doc-item:hover { border-color: var(--panel-border); }
.doc-item.active { border-color: var(--panel-border-hot); background: rgba(167,139,250,0.08); }
.doc-item-title { font-size: 12px; font-weight: 600; }
.doc-item-meta { font-family: var(--mono); font-size: 9px; color: var(--text-faint); margin-top: 2px; text-transform: uppercase; }
.doc-item-meta .agent { color: var(--accent); }
.doc-item-meta .doc-kind { color: var(--accent-cyan); padding: 0 4px; border: 1px solid rgba(125,211,252,0.25); border-radius: 3px; font-size: 8px; margin-left: 4px; }
.content-reader h2 { display: flex; align-items: center; gap: 12px; }
.copy-draft-btn {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: rgba(125,211,252,0.08);
  color: var(--accent-cyan);
  border: 1px solid rgba(125,211,252,0.35);
  border-radius: 4px;
  padding: 3px 10px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.copy-draft-btn:hover { background: rgba(125,211,252,0.18); border-color: rgba(125,211,252,0.6); }
.copy-draft-btn.copied { background: rgba(110,231,183,0.15); color: #6ee7b7; border-color: rgba(110,231,183,0.5); }

/* ===== Model spend card (Overview) ===== */
.grid-spend { margin-top: 18px; }
.spend-card { padding: 22px 24px; }
.spend-period-bar { margin: 6px 0 18px; }
.spend-period-label { display: flex; justify-content: space-between; align-items: baseline; font-family: var(--mono); font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-faint); margin-bottom: 6px; }
.spend-period-label > span:first-child { color: var(--accent-cyan); font-weight: 600; }
.spend-period-days { opacity: 0.7; }
.spend-period-track { height: 4px; background: rgba(125,211,252,0.08); border-radius: 2px; overflow: hidden; }
.spend-period-fill { height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-cyan)); border-radius: 2px; transition: width 0.6s ease; }
.spend-totals {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin: 14px 0 22px;
}
.spend-stat {
  background: rgba(125,211,252,0.04);
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  padding: 14px 16px;
}
.spend-val { font-size: 28px; font-weight: 700; letter-spacing: -0.02em; color: var(--accent-cyan); font-family: var(--mono); }
.spend-label { font-family: var(--mono); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-faint); margin-top: 6px; }
.spend-sub { font-family: var(--mono); font-size: 9px; color: var(--text-faint); margin-top: 4px; opacity: 0.7; }
@media (max-width: 760px) {
  .spend-totals { grid-template-columns: repeat(2, 1fr); }
}

.spend-model-table-wrap { overflow-x: auto; }
.spend-model-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.spend-model-table thead th {
  text-align: left;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-faint);
  padding: 8px 10px;
  border-bottom: 1px solid var(--panel-border);
}
.spend-model-table tbody td {
  padding: 10px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  font-family: var(--mono);
}
.spend-model-table .col-model { font-weight: 600; color: var(--accent); max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.spend-model-table .col-spend { color: var(--accent-cyan); font-weight: 600; white-space: nowrap; }
.spend-model-table .col-reqs, .spend-model-table .col-tokens { color: var(--text-faint); white-space: nowrap; }
.spend-model-table .col-share { min-width: 140px; }
.share-bar-wrap { display: inline-block; width: 80px; height: 6px; background: rgba(125,211,252,0.08); border-radius: 3px; overflow: hidden; vertical-align: middle; margin-right: 8px; }
.share-bar { height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-cyan)); border-radius: 3px; }
.share-pct { font-size: 10px; color: var(--text-faint); }
.spend-foot { margin-top: 14px; font-family: var(--mono); font-size: 10px; color: var(--text-faint); letter-spacing: 0.05em; }
.spend-foot a { color: var(--accent-cyan); }

/* ===== Per-agent cost on agent cards ===== */
.agent-cost {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed rgba(255,255,255,0.08);
  cursor: help;
}
.agent-cost-row { display: flex; align-items: center; gap: 8px; }
.agent-cost-lbl { font-family: var(--mono); font-size: 9px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-faint); }
.agent-cost-val { font-family: var(--mono); font-size: 14px; font-weight: 700; color: var(--accent-cyan); }
.agent-cost-share { margin-left: auto; font-family: var(--mono); font-size: 9px; color: var(--text-faint); padding: 2px 6px; border: 1px solid rgba(125,211,252,0.2); border-radius: 3px; }
.content-reader { background: var(--panel); border: 1px solid var(--panel-border); border-radius: 14px; padding: 24px; min-height: 60vh; }
.content-reader .empty { color: var(--text-faint); text-align: center; padding: 60px 20px; font-family: var(--mono); }
.content-reader h1 { margin-top: 0; }
.content-reader pre { background: rgba(0,0,0,0.3); padding: 12px; border-radius: 8px; overflow-x: auto; font-family: var(--mono); font-size: 12px; }
.content-reader code { background: rgba(120,130,200,0.1); padding: 2px 6px; border-radius: 4px; font-family: var(--mono); font-size: 12px; }
.content-reader table { border-collapse: collapse; width: 100%; margin: 14px 0; font-size: 13px; }
.content-reader th, .content-reader td { border: 1px solid var(--panel-border); padding: 8px 12px; text-align: left; }
.content-reader th { background: rgba(167,139,250,0.08); color: var(--accent); font-family: var(--mono); font-size: 11px; letter-spacing: 0.05em; text-transform: uppercase; }
.content-reader tr:nth-child(even) td { background: rgba(120,130,200,0.04); }
.content-reader h1, .content-reader h2, .content-reader h3 { letter-spacing: -0.01em; }
.content-reader h2 { color: var(--accent-cyan); margin-top: 24px; }
.content-reader a { color: var(--accent-cyan); }
.content-reader ul, .content-reader ol { padding-left: 24px; }
.content-reader li { margin-bottom: 4px; }

/* ===== Misc ===== */

.empty-msg { color: var(--text-faint); font-family: var(--mono); font-size: 11px; text-align: center; padding: 40px 0; }

/* ===== Activity feed + tool usage (Overview tab) ===== */
.grid-activity {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 16px;
  margin: 18px 0;
}
@media (max-width: 1000px) {
  .grid-activity { grid-template-columns: 1fr; }
}

.activity-feed, .tool-usage {
  padding: 18px;
  max-height: 380px;
  display: flex;
  flex-direction: column;
}
.activity-list, .tool-bars {
  list-style: none;
  padding: 0;
  margin: 12px 0 0 0;
  overflow-y: auto;
  flex: 1;
}
.activity-list::-webkit-scrollbar, .tool-bars::-webkit-scrollbar { width: 6px; }
.activity-list::-webkit-scrollbar-thumb, .tool-bars::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.08); border-radius: 3px;
}

.activity-row {
  display: grid;
  grid-template-columns: 8px 60px 14px 80px 90px 1fr;
  gap: 8px;
  align-items: center;
  padding: 7px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  font-size: 12.5px;
}
.activity-row:last-child { border-bottom: none; }
.activity-dot {
  width: 6px; height: 6px; border-radius: 50%;
  box-shadow: 0 0 6px currentColor;
}
.activity-when {
  color: rgba(255,255,255,0.45);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
}
.activity-profile {
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.activity-kind {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 3px;
  text-align: center;
}
.activity-kind.kind-tool {
  background: rgba(34, 211, 238, 0.12);
  color: #67E8F9;
  border: 1px solid rgba(34, 211, 238, 0.25);
}
.activity-kind.kind-msg {
  background: rgba(167, 139, 250, 0.12);
  color: #C4B5FD;
  border: 1px solid rgba(167, 139, 250, 0.25);
}
.activity-summary {
  color: rgba(255,255,255,0.7);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}
.activity-empty {
  text-align: center;
  color: rgba(255,255,255,0.4);
  padding: 32px 0;
  font-style: italic;
}

.tool-bar-row {
  display: grid;
  grid-template-columns: 110px 1fr 40px;
  gap: 10px;
  align-items: center;
  padding: 6px 0;
  font-size: 12.5px;
}
.tool-bar-name {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: rgba(255,255,255,0.85);
}
.tool-bar-track {
  height: 8px;
  background: rgba(255,255,255,0.06);
  border-radius: 4px;
  overflow: hidden;
}
.tool-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #22D3EE 0%, #A78BFA 100%);
  border-radius: 4px;
  transition: width 0.4s ease;
}
.tool-bar-count {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: rgba(255,255,255,0.6);
  text-align: right;
}

.agent-top-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 8px 0 0 0;
}
.agent-tool-chip {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  padding: 3px 7px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 3px;
  color: rgba(255,255,255,0.7);
}
.agent-tool-chip em {
  color: #67E8F9;
  font-style: normal;
  font-weight: 600;
  margin-left: 4px;
}

/* ===== Agent Log table (Agents tab) ===== */
.agent-log-card {
  margin-top: 24px;
  padding: 18px 20px;
}
.agent-log-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.agent-log-count {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: rgba(255,255,255,0.55);
  margin-left: 10px;
}
.agent-log-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.agent-log-filter {
  --accent: #94A3B8;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  padding: 5px 10px;
  background: transparent;
  color: rgba(255,255,255,0.55);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.agent-log-filter:hover {
  background: rgba(255,255,255,0.04);
  color: rgba(255,255,255,0.85);
}
.agent-log-filter.active {
  background: rgba(255,255,255,0.92);
  color: #0a0a14;
  border-color: rgba(255,255,255,0.92);
}

/* Tool toggle sits at the far right, visually separated */
.agent-log-tool-toggle {
  margin-left: auto;
  font-size: 10px;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.35);
  border-color: rgba(255,255,255,0.07);
  text-transform: uppercase;
}
.agent-log-tool-toggle:hover {
  color: rgba(255,255,255,0.65);
  border-color: rgba(255,255,255,0.2);
}
.agent-log-tool-toggle.active {
  background: rgba(251,191,36,0.15);
  color: #FBBF24;
  border-color: rgba(251,191,36,0.35);
}

.agent-log-table-wrap {
  max-height: 420px;
  overflow-y: auto;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.06);
}
.agent-log-table-wrap::-webkit-scrollbar { width: 6px; }
.agent-log-table-wrap::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.08); border-radius: 3px;
}

.agent-log-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}
.agent-log-table thead th {
  position: sticky;
  top: 0;
  background: rgba(15, 16, 28, 0.96);
  backdrop-filter: blur(8px);
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.45);
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.agent-log-table tbody td {
  padding: 8px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  color: rgba(255,255,255,0.78);
}
.agent-log-table tbody tr:hover td {
  background: rgba(255,255,255,0.02);
}
.agent-log-table .col-time {
  width: 70px;
  font-family: 'JetBrains Mono', monospace;
  color: rgba(255,255,255,0.45);
  font-size: 11px;
}
.agent-log-table .col-agent {
  width: 65px;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.05em;
}
.agent-log-table .col-task {
  max-width: 0; /* trick for ellipsis in flexible col */
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.agent-log-table .col-tool {
  width: 110px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: #67E8F9;
}
.agent-log-table .col-tool .muted {
  color: rgba(255,255,255,0.25);
}
.agent-log-table .col-session {
  width: 95px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: rgba(255,255,255,0.4);
}
.agent-log-table .col-status {
  width: 60px;
  text-align: center;
}
.log-status {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 2px 7px;
  border-radius: 3px;
}
.log-status.status-tool {
  background: rgba(34, 211, 238, 0.12);
  color: #67E8F9;
  border: 1px solid rgba(34, 211, 238, 0.2);
}
.log-status.status-msg {
  background: rgba(167, 139, 250, 0.12);
  color: #C4B5FD;
  border: 1px solid rgba(167, 139, 250, 0.2);
}
.agent-log-empty {
  text-align: center;
  color: rgba(255,255,255,0.4);
  padding: 32px 0 !important;
  font-style: italic;
}

/* ============================================================
   Cron attribution — ⏱ badges + Recent Cron Activity panel
   ============================================================ */

/* --- inline cron badge in live activity feed --- */
.cron-badge {
  display: inline-block;
  width: 14px;
  text-align: center;
  font-size: 11px;
  color: #FBBF24;
  opacity: 0.9;
}
.cron-badge-spacer { color: transparent; }
.activity-row-cron .activity-when { color: #FBBF24; }

/* --- cron-marked status badge in Agent Log table --- */
.log-status.status-cron {
  border-color: rgba(251, 191, 36, 0.4);
  color: #FBBF24;
  background: rgba(251, 191, 36, 0.07);
}
.log-row-cron .col-time {
  color: #FBBF24;
  font-weight: 500;
}

/* --- Recent Cron Activity panel on Overview tab --- */
.grid-cron-recent {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-top: 16px;
}
.card.cron-recent { padding: 16px 18px; }
.cron-recent-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.cron-recent-row {
  border: 1px solid rgba(251, 191, 36, 0.18);
  border-left: 3px solid #FBBF24;
  background: rgba(251, 191, 36, 0.04);
  padding: 9px 12px;
  border-radius: 4px;
  font-family: var(--mono);
  font-size: 12px;
}
.cron-recent-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}
.cron-recent-icon { color: #FBBF24; font-size: 13px; }
.cron-recent-job {
  font-weight: 600;
  color: var(--text);
  font-size: 12.5px;
}
.cron-recent-profile {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
}
.cron-recent-ago {
  margin-left: auto;
  color: var(--text-faint);
  font-size: 10.5px;
}
.cron-status {
  font-size: 10px;
  padding: 1px 7px;
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
}
.cron-status-ok {
  background: rgba(52, 211, 153, 0.12);
  color: #34D399;
  border: 1px solid rgba(52, 211, 153, 0.3);
}
.cron-status-running {
  background: rgba(34, 211, 238, 0.14);
  color: #22D3EE;
  border: 1px solid rgba(34, 211, 238, 0.35);
  animation: pulse-running 1.6s ease-in-out infinite;
}
@keyframes pulse-running {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}
.cron-status-unknown {
  background: rgba(148, 163, 184, 0.08);
  color: var(--text-faint);
  border: 1px solid rgba(148, 163, 184, 0.2);
}
.cron-recent-summary {
  color: var(--text-dim);
  margin: 2px 0 6px;
  line-height: 1.4;
  font-size: 11.5px;
}
.cron-recent-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.cron-recent-counts {
  color: var(--text-faint);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.cron-recent-tools {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}
.cron-tool-chip {
  background: rgba(167, 139, 250, 0.12);
  color: #C4B5FD;
  border: 1px solid rgba(167, 139, 250, 0.25);
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 10px;
  letter-spacing: 0.02em;
}

/* ===================== Kanban board ===================== */
.kanban-board {
  display: grid;
  grid-template-columns: repeat(4, minmax(220px, 1fr));
  gap: 14px;
  margin-top: 12px;
}
.kanban-col {
  background: var(--bg-card, #161b22);
  border: 1px solid var(--border, #30363d);
  border-radius: 10px;
  min-height: 200px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.kanban-col-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border, #30363d);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted, #8b949e);
  background: rgba(255, 255, 255, 0.02);
}
.kanban-col-header .col-count {
  background: rgba(255, 255, 255, 0.06);
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  color: var(--text, #c9d1d9);
}
.kanban-col[data-col-status="ready"] .kanban-col-header { color: #79c0ff; }
.kanban-col[data-col-status="in_progress"] .kanban-col-header { color: #f0a648; }
.kanban-col[data-col-status="blocked"] .kanban-col-header { color: #f85149; }
.kanban-col[data-col-status="done"] .kanban-col-header { color: #56d364; }
.kanban-col-body {
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  max-height: calc(100vh - 280px);
  overflow-y: auto;
}
.kanban-card {
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--border, #30363d);
  border-left: 3px solid #79c0ff;
  border-radius: 6px;
  padding: 10px 12px;
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease, transform 120ms ease;
}
.kanban-card:hover { background: rgba(255, 255, 255, 0.05); transform: translateY(-1px); }
.kanban-card:focus { outline: 2px solid #58a6ff; outline-offset: 2px; }
.kanban-col[data-col-status="in_progress"] .kanban-card { border-left-color: #f0a648; }
.kanban-col[data-col-status="blocked"] .kanban-card { border-left-color: #f85149; }
.kanban-col[data-col-status="done"] .kanban-card { border-left-color: #56d364; opacity: 0.78; }
.kanban-card .task-title {
  font-weight: 500;
  font-size: 13px;
  color: var(--text, #c9d1d9);
  margin-bottom: 6px;
  line-height: 1.35;
}
.kanban-card .task-meta {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-muted, #8b949e);
}
.kanban-card .assignee {
  background: rgba(88, 166, 255, 0.12);
  color: #79c0ff;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.kanban-card .task-time { color: var(--text-faint, #6e7681); }
.kanban-empty {
  color: var(--text-faint, #6e7681);
  font-size: 12px;
  text-align: center;
  padding: 30px 10px;
  font-style: italic;
}

/* ===================== Buttons ===================== */
.btn-primary {
  background: #1f6feb;
  border: 1px solid #1f6feb;
  color: white;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 120ms ease;
}
.btn-primary:hover { background: #388bfd; }
.btn-primary:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-secondary {
  background: transparent;
  border: 1px solid var(--border, #30363d);
  color: var(--text, #c9d1d9);
  padding: 7px 14px;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
}
.btn-secondary:hover { background: rgba(255, 255, 255, 0.04); }
.btn-danger {
  background: transparent;
  border: 1px solid #f85149;
  color: #f85149;
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
}
.btn-danger:hover { background: rgba(248, 81, 73, 0.1); }

/* ===================== Modal ===================== */
.modal-backdrop {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(13, 17, 23, 0.78);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  backdrop-filter: blur(2px);
}
.modal-backdrop[hidden] { display: none; }
.modal {
  background: var(--bg-card, #161b22);
  border: 1px solid var(--border, #30363d);
  border-radius: 12px;
  width: min(520px, 90vw);
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 12px 60px rgba(0, 0, 0, 0.5);
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border, #30363d);
}
.modal-header h2 { font-size: 16px; font-weight: 500; margin: 0; }
.modal-close {
  background: transparent; border: none; color: var(--text-muted, #8b949e);
  font-size: 24px; cursor: pointer; line-height: 1; padding: 0 4px;
}
.modal-close:hover { color: var(--text, #c9d1d9); }
.modal-form {
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.modal-form label { display: flex; flex-direction: column; gap: 6px; }
.modal-form label span {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted, #8b949e);
}
.modal-form label.modal-form-inline {
  flex-direction: row;
  align-items: center;
  gap: 12px;
}
.modal-form label.modal-form-inline span { flex: 0 0 70px; }
.modal-form input[type="text"],
.modal-form textarea,
.modal-form select {
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--border, #30363d);
  color: var(--text, #c9d1d9);
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 13px;
  font-family: inherit;
  width: 100%;
}
.modal-form input:focus, .modal-form textarea:focus, .modal-form select:focus {
  outline: none;
  border-color: #1f6feb;
  box-shadow: 0 0 0 3px rgba(31, 111, 235, 0.2);
}
.modal-form textarea { resize: vertical; min-height: 60px; }
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 6px;
}
.modal-error {
  background: rgba(248, 81, 73, 0.1);
  border: 1px solid rgba(248, 81, 73, 0.3);
  color: #f85149;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 12px;
  margin-top: 4px;
}

/* ===================== Drawer ===================== */
.drawer-backdrop {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(13, 17, 23, 0.6);
  z-index: 90;
  backdrop-filter: blur(2px);
}
.drawer-backdrop[hidden] { display: none; }
.drawer {
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: min(560px, 92vw);
  background: var(--bg-card, #161b22);
  border-left: 1px solid var(--border, #30363d);
  display: flex;
  flex-direction: column;
  box-shadow: -8px 0 40px rgba(0, 0, 0, 0.5);
}
.drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border, #30363d);
}
.drawer-header h2 { font-size: 17px; margin: 4px 0 0; line-height: 1.3; }
.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 18px 22px 24px;
}
.drawer-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}
.task-status-badge {
  background: rgba(121, 192, 255, 0.15);
  color: #79c0ff;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.task-status-badge[data-status="in_progress"] { background: rgba(240, 166, 72, 0.15); color: #f0a648; }
.task-status-badge[data-status="blocked"] { background: rgba(248, 81, 73, 0.15); color: #f85149; }
.task-status-badge[data-status="done"] { background: rgba(86, 211, 100, 0.15); color: #56d364; }
.task-meta-text { font-size: 12px; color: var(--text-muted, #8b949e); }
.drawer-section { margin-bottom: 22px; }
.drawer-section h3 {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted, #8b949e);
  margin: 0 0 8px;
}
.task-body {
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--border, #30363d);
  border-radius: 6px;
  padding: 10px 12px;
  font-size: 13px;
  color: var(--text, #c9d1d9);
  white-space: pre-wrap;
  word-wrap: break-word;
  font-family: inherit;
  line-height: 1.5;
}
.status-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.status-buttons button {
  background: transparent;
  border: 1px solid var(--border, #30363d);
  color: var(--text-muted, #8b949e);
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
  transition: all 120ms ease;
}
.status-buttons button:hover { background: rgba(255, 255, 255, 0.04); color: var(--text, #c9d1d9); }
.status-buttons button.active {
  background: #1f6feb;
  border-color: #1f6feb;
  color: white;
}
.comments { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.comment {
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--border, #30363d);
  border-radius: 6px;
  padding: 10px 12px;
}
.comment header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}
.comment header strong { font-size: 12px; color: var(--text, #c9d1d9); }
.comment header small { font-size: 11px; color: var(--text-faint, #6e7681); }
.comment p { font-size: 13px; color: var(--text, #c9d1d9); margin: 0; line-height: 1.4; }
.drawer-empty { font-size: 12px; color: var(--text-faint, #6e7681); font-style: italic; margin: 0 0 12px; }
.comment-form { display: flex; flex-direction: column; gap: 8px; }
.comment-form textarea {
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--border, #30363d);
  color: var(--text, #c9d1d9);
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 13px;
  font-family: inherit;
  resize: vertical;
}
.comment-form button { align-self: flex-end; }
.event-log {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 11px;
  color: var(--text-muted, #8b949e);
}
.event-log li {
  display: grid;
  grid-template-columns: 110px 1fr auto;
  gap: 8px;
  padding: 4px 0;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.04);
}
.event-log .event-kind {
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 10px;
  color: #79c0ff;
}
.event-log .event-time { color: var(--text-faint, #6e7681); }
.drawer-footer { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border, #30363d); }
