/* BobX Command Center — single-page dashboard */

:root {
  --green: #6aad60;
  --green-dim: rgba(106, 173, 96, 0.15);
  --amber: #c9a227;
  --amber-dim: rgba(201, 162, 39, 0.12);
  --red: #e07a7a;
  --red-dim: rgba(224, 122, 122, 0.15);
  --blue: #7ab5e0;
  --blue-dim: rgba(122, 181, 224, 0.15);
}

/* Layout */
.bobx-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.bobx-body {
  flex: 1;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
  padding: 2rem 2.5rem 3rem;
}

/* Page header */
.bobx-page-header {
  padding: 1.5rem 2.5rem 0;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.bobx-page-title {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 1.5rem;
  font-weight: 400;
  color: var(--text);
}

.bobx-page-subtitle {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 0.2rem;
  letter-spacing: 0.03em;
}

.bobx-meta {
  text-align: right;
  flex-shrink: 0;
}

.bobx-date {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 1.1rem;
  color: var(--text);
}

.bobx-generated {
  font-size: 11px;
  color: var(--text-tertiary);
  margin-top: 0.2rem;
}

.bobx-refresh-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 0.5rem;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.05em;
  color: var(--accent);
  background: none;
  border: 1px solid rgba(201, 162, 39, 0.25);
  padding: 0.35rem 0.75rem;
  border-radius: 4px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  text-decoration: none;
}

.bobx-refresh-btn:hover {
  border-color: var(--accent);
  background: var(--amber-dim);
}

/* Sections */
.bobx-sections {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  align-items: start;
}

/* Wide sections */
.bobx-section--full {
  grid-column: 1 / -1;
}

.bobx-section--half {
  grid-column: span 2;
}

/* Section card */
.bobx-section {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: border-color 0.2s;
}

.bobx-section:hover {
  border-color: rgba(201, 162, 39, 0.2);
}

.bobx-section--warning {
  border-color: rgba(224, 122, 122, 0.25);
}

.bobx-section--info {
  border-color: rgba(122, 181, 224, 0.2);
}

/* Section header */
.bobx-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.bobx-section-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.bobx-section-label svg {
  color: var(--accent);
  opacity: 0.65;
}

.bobx-section-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  background: var(--amber-dim);
  border: 1px solid rgba(201, 162, 39, 0.25);
  color: var(--amber);
  font-size: 10px;
  font-weight: 600;
  border-radius: 10px;
}

.bobx-section-count--red {
  background: var(--red-dim);
  border-color: rgba(224, 122, 122, 0.25);
  color: var(--red);
}

.bobx-section-count--green {
  background: var(--green-dim);
  border-color: rgba(106, 173, 96, 0.25);
  color: var(--green);
}

/* List items */
.bobx-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.bobx-list-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.6rem 0.75rem;
  background: var(--surface-2);
  border-radius: 4px;
  border: 1px solid transparent;
  transition: border-color 0.15s;
  cursor: pointer;
}

.bobx-list-item:hover {
  border-color: var(--rule);
}

.bobx-list-item-name {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text);
  line-height: 1.35;
}

.bobx-list-item-meta {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 0.15rem;
}

.bobx-list-item-meta span {
  color: var(--text-tertiary);
}

.bobx-list-item-score {
  font-size: 11px;
  font-weight: 600;
  padding: 0.15rem 0.45rem;
  border-radius: 3px;
  flex-shrink: 0;
}

.bobx-list-item-score--hot {
  background: var(--red-dim);
  color: var(--red);
}

.bobx-list-item-score--warm {
  background: var(--amber-dim);
  color: var(--amber);
}

.bobx-list-item-score--cool {
  background: rgba(122, 181, 224, 0.1);
  color: var(--blue);
}

.bobx-list-item-days {
  font-size: 11px;
  color: var(--text-tertiary);
  flex-shrink: 0;
  margin-left: auto;
  min-width: 45px;
  text-align: right;
}

/* Pipeline stage pills */
.bobx-stage-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.bobx-stage-pill {
  font-size: 11px;
  padding: 0.25rem 0.65rem;
  border-radius: 3px;
  background: var(--surface-2);
  border: 1px solid var(--rule);
  color: var(--text-secondary);
}

.bobx-stage-pill strong {
  color: var(--text);
  font-weight: 600;
}

/* Workflows */
.bobx-workflow-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.bobx-workflow-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.75rem;
  background: var(--surface-2);
  border-radius: 4px;
  font-size: 0.8rem;
}

.bobx-workflow-status {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.bobx-workflow-status--active {
  background: var(--green);
}

.bobx-workflow-status--inactive {
  background: var(--text-tertiary);
}

.bobx-workflow-info {
  flex: 1;
}

.bobx-workflow-name {
  font-weight: 500;
  color: var(--text);
  font-size: 0.82rem;
}

.bobx-workflow-meta {
  font-size: 0.72rem;
  color: var(--text-secondary);
  margin-top: 0.1rem;
}

.bobx-workflow-runs {
  font-size: 11px;
  color: var(--text-tertiary);
}

/* Recommendations */
.bobx-recommendations {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.bobx-recommendation {
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
}

.bobx-rec-number {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--amber-dim);
  border: 1px solid rgba(201, 162, 39, 0.3);
  color: var(--amber);
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.bobx-rec-text {
  font-size: 0.85rem;
  color: var(--text);
  line-height: 1.45;
}

.bobx-rec-action {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 0.2rem;
}

.bobx-rec-action a {
  color: var(--accent);
  text-decoration: none;
}

.bobx-rec-action a:hover {
  text-decoration: underline;
}

/* Empty state */
.bobx-empty {
  font-size: 0.8rem;
  color: var(--text-tertiary);
  font-style: italic;
  padding: 0.5rem 0;
}

.bobx-empty a {
  color: var(--accent);
  text-decoration: none;
}

/* Loading state */
.bobx-loading {
  font-size: 0.85rem;
  color: var(--text-secondary);
  padding: 1rem 0;
  text-align: center;
}

/* Error */
.bobx-error {
  font-size: 0.82rem;
  color: var(--red);
  padding: 0.5rem 0;
}

/* Navigation addition for BobX */
.bobx-nav-link {
  color: var(--amber);
  font-weight: 500;
}

/* ── BobX AI Brain Additions ─────────────────────────────────────────────── */

/* Health Score */
.bobx-health-score {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 6px;
  margin-bottom: 0;
}

.bobx-health-ring {
  position: relative;
  width: 56px;
  height: 56px;
  flex-shrink: 0;
}

.bobx-health-ring svg {
  width: 56px;
  height: 56px;
  transform: rotate(-90deg);
}

.bobx-health-ring circle.track {
  fill: none;
  stroke: var(--rule);
  stroke-width: 5;
}

.bobx-health-ring circle.fill {
  fill: none;
  stroke-width: 5;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.6s ease;
}

.bobx-health-ring .score-label {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}

.bobx-health-meta {
  flex: 1;
}

.bobx-health-score-value {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 1.6rem;
  font-weight: 400;
  color: var(--text);
  line-height: 1;
}

.bobx-health-score-label {
  font-size: 11px;
  color: var(--text-tertiary);
  margin-top: 0.2rem;
  letter-spacing: 0.05em;
}

.bobx-health-dimensions {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 180px;
}

.bobx-health-dim-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 11px;
}

.bobx-health-dim-name {
  color: var(--text-secondary);
  width: 90px;
  flex-shrink: 0;
}

.bobx-health-dim-bar {
  flex: 1;
  height: 4px;
  background: var(--surface-2);
  border-radius: 2px;
  overflow: hidden;
  min-width: 50px;
}

.bobx-health-dim-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.5s ease;
}

.bobx-health-dim-val {
  color: var(--text-tertiary);
  min-width: 24px;
  text-align: right;
}

/* Alerts */
.bobx-alerts {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.bobx-alert-item {
  padding: 0.75rem 1rem;
  border-radius: 5px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: border-color 0.15s;
}

.bobx-alert-item:hover {
  border-color: var(--rule);
}

.bobx-alert-item--high {
  background: var(--red-dim);
  border-color: rgba(224, 122, 122, 0.2);
}

.bobx-alert-item--medium {
  background: var(--amber-dim);
  border-color: rgba(201, 162, 39, 0.2);
}

.bobx-alert-item--low {
  background: var(--green-dim);
  border-color: rgba(106, 173, 96, 0.2);
}

.bobx-alert-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
}

.bobx-alert-message {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-top: 0.2rem;
  line-height: 1.4;
}

.bobx-alert-action {
  font-size: 0.75rem;
  color: var(--accent);
  margin-top: 0.35rem;
}

/* AI Overview */
.bobx-ai-overview {
  font-size: 0.85rem;
  color: var(--text);
  line-height: 1.7;
  white-space: pre-wrap;
}

.bobx-ai-overview strong {
  color: var(--text);
  font-weight: 600;
}

.bobx-ai-overview a {
  color: var(--accent);
  text-decoration: none;
}

.bobx-generate-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 500;
  color: var(--accent);
  background: none;
  border: 1px solid rgba(201, 162, 39, 0.25);
  padding: 0.4rem 0.85rem;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s;
}

.bobx-generate-btn:hover {
  border-color: var(--accent);
  background: var(--amber-dim);
}

.bobx-generate-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* AI Chat */
.bobx-chat {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.bobx-chat-input-row {
  display: flex;
  gap: 0.5rem;
  align-items: flex-end;
}

.bobx-chat-input {
  flex: 1;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--rule);
  border-radius: 5px;
  background: var(--surface-2);
  color: var(--text);
  font-size: 0.82rem;
  font-family: inherit;
  resize: none;
  min-height: 40px;
  max-height: 120px;
  line-height: 1.5;
}

.bobx-chat-input:focus {
  outline: none;
  border-color: rgba(201, 162, 39, 0.3);
}

.bobx-chat-send {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: var(--accent);
  color: var(--surface);
  border: none;
  border-radius: 4px;
  cursor: pointer;
  flex-shrink: 0;
  transition: opacity 0.15s;
}

.bobx-chat-send:hover { opacity: 0.85; }
.bobx-chat-send:disabled { opacity: 0.4; cursor: not-allowed; }

.bobx-chat-messages {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  max-height: 300px;
  overflow-y: auto;
}

.bobx-chat-msg {
  padding: 0.65rem 0.85rem;
  border-radius: 5px;
  font-size: 0.82rem;
  line-height: 1.5;
}

.bobx-chat-msg--user {
  background: var(--amber-dim);
  border: 1px solid rgba(201, 162, 39, 0.2);
  color: var(--text);
}

.bobx-chat-msg--bobx {
  background: var(--surface-2);
  border: 1px solid var(--rule);
  color: var(--text);
  white-space: pre-wrap;
}

/* Quick prompts */
.bobx-quick-prompts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.25rem;
}

.bobx-quick-chip {
  font-size: 11px;
  padding: 0.25rem 0.65rem;
  background: var(--surface-2);
  border: 1px solid var(--rule);
  border-radius: 20px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s;
}

.bobx-quick-chip:hover {
  border-color: rgba(201, 162, 39, 0.3);
  color: var(--accent);
}

/* Permission Level badge */
.bobx-perm-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  padding: 0.2rem 0.55rem;
  border-radius: 3px;
  background: var(--amber-dim);
  border: 1px solid rgba(201, 162, 39, 0.2);
  color: var(--amber);
}

.bobx-perm-badge span {
  font-weight: 700;
}

/* Weekly report */
.bobx-weekly-report {
  font-size: 0.82rem;
  color: var(--text);
  line-height: 1.7;
  white-space: pre-wrap;
}

.bobx-weekly-report strong {
  font-weight: 600;
}

/* Responsive */
@media (max-width: 900px) {
  .bobx-sections {
    grid-template-columns: 1fr 1fr;
  }
  .bobx-section--half {
    grid-column: 1 / -1;
  }
}

@media (max-width: 600px) {
  .bobx-body {
    padding: 1.5rem 1.25rem 2rem;
  }
  .bobx-page-header {
    padding: 1.25rem 1.25rem 0;
    flex-direction: column;
  }
  .bobx-meta {
    text-align: left;
  }
  .bobx-sections {
    grid-template-columns: 1fr;
  }
  .bobx-section--half,
  .bobx-section--full {
    grid-column: 1;
  }
}