/* Agent Status (task-0132 hologram revamp) — glass agent cards, glowing
   status indicators, bloom dots, frosted detail panels. */

a { color: inherit; }
.section-meta, .muted { color: var(--text-dim); font-size: 0.85rem; }
.task-link:hover { border-color: var(--accent); }

.status-main {
  display: grid;
  gap: 0.75rem;
  padding: 0.75rem;
}

.panel-section, .source-errors {
  background: rgba(8, 10, 20, 0.75);
  backdrop-filter: blur(16px) saturate(1.2);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  border: 1px solid rgba(245,158,11,0.16);
  border-radius: 10px;
  padding: 0.65rem;
  box-shadow: var(--shadow);
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem;
  margin-bottom: 0.6rem;
}
.section-head h2, .source-errors h2 {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  font-family: var(--font-mono);
}

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

.agent-card, .provider-card, .health-limit, .health-empty {
  background: rgba(10,12,22,0.78);
  border: 1px solid rgba(245,158,11,0.12);
  border-radius: 8px;
}

/* Loading state */
.health-loading {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-dim);
  font-size: 0.85rem;
}
.health-spinner {
  width: 0.85rem; height: 0.85rem;
  border: 2px solid rgba(245,158,11,0.15);
  border-top-color: var(--accent);
  border-radius: 50%;
}
@media (prefers-reduced-motion: no-preference) {
  .health-spinner { animation: status-spin 0.7s linear infinite; }
}
.usage-skeleton {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.6rem;
}
.skel-bar {
  height: 0.85rem;
  border-radius: 6px;
  background: linear-gradient(90deg,
    rgba(10,12,22,0.8) 25%,
    rgba(20,22,40,0.85) 37%,
    rgba(10,12,22,0.8) 63%);
  background-size: 400% 100%;
}
@media (prefers-reduced-motion: no-preference) {
  .skel-bar { animation: status-shimmer 1.4s ease infinite; }
}
.skel-bar:nth-child(2) { width: 80%; }
.skel-bar:nth-child(3) { width: 60%; }
@keyframes status-spin    { to { transform: rotate(360deg); } }
@keyframes status-shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }

.agent-card {
  padding: 0.7rem;
  border-left: 3px solid rgba(245,158,11,0.20);
  cursor: pointer;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}
.agent-card:hover { transform: translateY(-1px); box-shadow: 0 4px 20px rgba(0,0,0,0.4); }
.agent-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.agent-card.expanded   { grid-column: 1 / -1; cursor: default; transform: none; }
.agent-card.working    { border-left-color: var(--accent); box-shadow: -3px 0 14px rgba(245,158,11,0.18); }
.agent-card.rate-limited { border-left-color: var(--danger); box-shadow: -3px 0 14px rgba(255,92,108,0.15); }
.agent-card.needs-reconcile { border-left-color: var(--warn); box-shadow: -3px 0 14px rgba(255,200,87,0.15); }

.reconcile-block {
  display: grid;
  gap: 0.3rem;
  margin-top: 0.5rem;
  padding: 0.55rem;
  border: 1px solid var(--warn);
  border-radius: 8px;
  background: var(--warn-bg);
  font-size: 0.84rem;
  box-shadow: 0 0 12px rgba(255,200,87,0.10);
}
.reconcile-block strong { color: var(--warn); }
.reconcile-block ul { margin: 0; padding-left: 1.1rem; display: grid; gap: 0.2rem; }
.reconcile-block a { font-weight: 700; text-decoration: none; }

.agent-card-head, .agent-title, .task-top, .provider-head, .usage-label { display: flex; align-items: center; }
.agent-card-head, .task-top, .provider-head, .usage-label { justify-content: space-between; gap: 0.75rem; }
.agent-title { gap: 0.55rem; min-width: 0; }
.agent-emoji { font-size: 1.35rem; }
.agent-title h3 { margin: 0; font-size: 0.98rem; }
.agent-actions { display: flex; align-items: center; gap: 0.4rem; }
.agent-id, .task-status { color: var(--text-dim); font-size: 0.74rem; font-family: ui-monospace, monospace; }

.status-pill {
  border-radius: 6px;
  padding: 0.12rem 0.45rem;
  font-size: 0.76rem;
  font-weight: 700;
  white-space: nowrap;
  background: var(--chip-bg);
  border: 1px solid rgba(245,158,11,0.10);
}
.status-pill.working {
  background: rgba(245,158,11,0.14);
  color: var(--accent);
  border-color: rgba(245,158,11,0.38);
  box-shadow: 0 0 8px rgba(245,158,11,0.18);
}
.status-pill.idle {
  background: var(--ok-bg);
  color: var(--ok);
  border-color: rgba(46,230,168,0.3);
  box-shadow: 0 0 6px rgba(46,230,168,0.12);
}
.status-pill.rate-limited {
  background: var(--danger-bg);
  color: var(--danger);
  border-color: rgba(255,92,108,0.3);
}

.expand-button {
  border: 1px solid rgba(245,158,11,0.18);
  border-radius: 6px;
  padding: 0.12rem 0.45rem;
  background: rgba(10,12,22,0.75);
  color: var(--text);
  font: inherit;
  font-size: 0.76rem;
  cursor: pointer;
  transition: all 0.18s ease;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
.expand-button:hover, .expand-button:focus-visible {
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: var(--glow-soft);
}

.agent-facts {
  display: grid;
  grid-template-columns: 7.5rem minmax(0, 1fr);
  gap: 0.28rem 0.6rem;
  margin: 0.65rem 0;
}
.agent-facts dt { color: var(--text-dim); }
.agent-facts dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }

.task-block, .idle-block, .limit-block {
  display: grid;
  gap: 0.35rem;
  padding: 0.55rem;
  border: 1px solid rgba(245,158,11,0.12);
  border-radius: 8px;
  background: rgba(5,5,10,0.55);
}
.task-block p { margin: 0; color: var(--text-dim); }
.task-link    { font-weight: 700; text-decoration: none; overflow-wrap: anywhere; }
.duration-line, .reset-line { color: var(--text-dim); font-size: 0.82rem; }

.agent-details {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.6rem;
  margin-top: 0.65rem;
  padding-top: 0.65rem;
  border-top: 1px solid rgba(245,158,11,0.08);
}
.detail-section { min-width: 0; }
.detail-section h4 {
  margin: 0 0 0.4rem;
  color: var(--text-dim);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-family: var(--font-mono);
}
.detail-empty { margin: 0; }

.detail-list, .history-list {
  display: grid;
  gap: 0.45rem;
  margin: 0; padding: 0;
  list-style: none;
}
.detail-list li, .history-list li {
  display: grid;
  gap: 0.15rem;
  min-width: 0;
  padding: 0.45rem;
  border: 1px solid rgba(245,158,11,0.10);
  border-radius: 8px;
  background: rgba(5,5,10,0.55);
}
.detail-list a, .history-list a { font-weight: 700; text-decoration: none; overflow-wrap: anywhere; }
.detail-list span, .history-meta, .history-log { color: var(--text-dim); font-size: 0.82rem; }
.verify-list { display: grid; gap: 0.35rem; margin-top: 0.6rem; }
.history-top { display: flex; justify-content: space-between; gap: 0.75rem; }
.history-top time { flex: 0 0 auto; color: var(--text-dim); font-size: 0.78rem; }
.history-log { margin: 0.15rem 0 0; }

.model-health {
  display: grid;
  grid-template-columns: repeat(2, minmax(240px, 1fr));
  gap: 0.6rem;
}

.health-empty, .provider-card, .health-limit { padding: 0.65rem; }
.health-limit {
  display: grid;
  gap: 0.25rem;
}
.health-limit.soft { border-left: 3px solid var(--warn); box-shadow: -3px 0 10px rgba(255,200,87,0.12); }
.health-limit.hard { border-left: 3px solid var(--danger); box-shadow: -3px 0 10px rgba(255,92,108,0.12); }

.provider-card {
  display: grid;
  gap: 0.55rem;
  transition: border-color 0.18s ease;
}
.provider-card:hover { border-color: rgba(245,158,11,0.25); }
.provider-card.unreported, .provider-card.unavailable { border-style: dashed; opacity: 0.75; }
.provider-head span { color: var(--text-dim); font-size: 0.82rem; }

.usage-windows { display: grid; gap: 0.5rem; }
.usage-window  { display: grid; gap: 0.2rem; }
.meter {
  height: 0.5rem;
  overflow: hidden;
  background: rgba(14,17,30,0.80);
  border: 1px solid rgba(245,158,11,0.10);
  border-radius: 6px;
}
.meter span {
  display: block;
  height: 100%;
  background: var(--grad-accent);
  box-shadow: 0 0 6px rgba(245,158,11,0.30);
}

/* Ollama panel */
.ollama-panel {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0.6rem;
}
.ollama-health, .ollama-window, .ollama-usage-empty {
  background: rgba(10,12,22,0.78);
  border: 1px solid rgba(245,158,11,0.12);
  border-radius: 8px;
  padding: 0.65rem;
  display: grid;
  gap: 0.4rem;
  align-content: start;
}
.ollama-health.online  { border-left: 3px solid var(--accent); box-shadow: -3px 0 10px rgba(245,158,11,0.15); }
.ollama-health.offline { border-left: 3px solid var(--danger); box-shadow: -3px 0 10px rgba(255,92,108,0.12); }
.ollama-health-head { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.ollama-endpoint { color: var(--text-dim); font-size: 0.78rem; word-break: break-all; }
.ollama-loaded { display: flex; flex-wrap: wrap; gap: 0.3rem; align-items: center; }
.ollama-loaded-label { color: var(--text-dim); font-size: 0.78rem; }
.ollama-chip {
  font-size: 0.74rem;
  padding: 0.1rem 0.4rem;
  border: 1px solid rgba(245,158,11,0.14);
  border-radius: 6px;
  background: rgba(10,12,22,0.75);
}
.ollama-window { border-left: 3px solid var(--cyan, #06b6d4); box-shadow: -3px 0 10px rgba(6,182,212,0.12); }
.ollama-window-head { display: flex; justify-content: space-between; align-items: baseline; gap: 0.5rem; }
.ollama-model-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 0.25rem; }
.ollama-model-list li { display: flex; justify-content: space-between; gap: 0.5rem; font-size: 0.85rem; }
.ollama-model-name   { font-family: var(--mono, monospace); }
.ollama-model-tokens { white-space: nowrap; }

.source-errors { border-color: rgba(255,200,87,0.3); color: var(--warn); background: var(--warn-bg); }
.source-errors ul { margin: 0.45rem 0 0; padding-left: 1.2rem; }

@media (max-width: 900px) {
  .model-health, .ollama-panel, .agent-details { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .section-head { width: 100%; }
  .agent-facts  { grid-template-columns: 1fr; }
}
