/* Vantage Dashboard — Dark theme matching Bitsmithing */

:root {
  --bg: #0f0f0e;
  --bg-surface: #1a1a18;
  --bg-border: #2a2a26;
  --bg-hover: #222220;
  --accent: #f5c518;
  --text: #e8e6e0;
  --text-muted: #7a7870;
  --text-dim: #555550;
  --green: #4ade80;
  --red: #f87171;
  --amber: #fbbf24;
  --blue: #60a5fa;
  --font-body: 'Inter', -apple-system, sans-serif;
  --font-heading: 'JetBrains Mono', monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 0.9rem;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Layout */
.layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  background: var(--bg-surface);
  border-right: 1px solid var(--bg-border);
  padding: 1.5rem 1rem;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}

.sidebar__logo {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.logo-mark { color: var(--accent); margin-right: 0.25rem; }
.accent { color: var(--accent); }

.sidebar__client {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--bg-border);
}

.sidebar__nav {
  list-style: none;
  flex: 1;
}

.sidebar__nav li { margin-bottom: 0.25rem; }

.sidebar__nav a {
  display: block;
  padding: 0.5rem 0.75rem;
  border-radius: 4px;
  color: var(--text-muted);
  font-size: 0.85rem;
  transition: all 0.15s;
}

.sidebar__nav a:hover {
  background: var(--bg-hover);
  color: var(--text);
  text-decoration: none;
}

.sidebar__nav a.active {
  background: var(--bg-hover);
  color: var(--accent);
}

.sidebar__footer {
  padding-top: 1rem;
  border-top: 1px solid var(--bg-border);
}

.sidebar__status {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Content area */
.content {
  padding: 2rem 2.5rem;
  overflow-y: auto;
}

/* Page header */
.page-header {
  margin-bottom: 2rem;
}

.page-header h1 {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  color: var(--accent);
  margin-bottom: 0.25rem;
}

.page-header__breadcrumb {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.page-header__breadcrumb a { color: var(--text-muted); }
.page-header__breadcrumb a:hover { color: var(--accent); }

.page-subtitle {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.page-header__actions {
  margin-top: 1rem;
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

/* Stat grid */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--bg-surface);
  border: 1px solid var(--bg-border);
  border-radius: 6px;
  padding: 1.25rem;
}

.stat-card__value {
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent);
}

.stat-card__label {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

/* Grid layouts */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

/* Card */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--bg-border);
  border-radius: 6px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.card h2 {
  font-family: var(--font-heading);
  font-size: 1rem;
  color: var(--text);
  margin-bottom: 1rem;
}

.card h3 {
  font-size: 0.95rem;
  margin-bottom: 0.5rem;
}

/* Data table */
.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th,
.data-table td {
  padding: 0.5rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--bg-border);
  font-size: 0.85rem;
}

.data-table th {
  font-family: var(--font-heading);
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.data-table tr:hover { background: var(--bg-hover); }

.truncate {
  max-width: 250px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Article list */
.article-list { display: flex; flex-direction: column; }

.article-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--bg-border);
  color: var(--text);
}

.article-row:hover { text-decoration: none; background: var(--bg-hover); margin: 0 -0.5rem; padding: 0.75rem 0.5rem; border-radius: 4px; }

.article-row__title { display: block; font-weight: 500; }
.article-row__meta { display: block; font-size: 0.8rem; color: var(--text-muted); margin-top: 0.15rem; }
.stat-inline { font-size: 0.8rem; color: var(--text-dim); }

/* Keywords */
.kw-text { font-weight: 500; display: block; }
.kw-meta { font-size: 0.75rem; color: var(--text-muted); }

.score-badge {
  display: inline-block;
  background: rgba(245, 197, 24, 0.15);
  color: var(--accent);
  font-family: var(--font-heading);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.1rem 0.4rem;
  border-radius: 3px;
}

/* Status */
.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 0.35rem;
}

.status-dot--active { background: var(--green); }
.status-dot--inactive { background: var(--text-dim); }

.status-pill {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.15rem 0.45rem;
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.status-pill--pending { background: rgba(251, 191, 36, 0.15); color: var(--amber); }
.status-pill--brief_generated { background: rgba(96, 165, 250, 0.15); color: var(--blue); }
.status-pill--drafted { background: rgba(96, 165, 250, 0.25); color: var(--blue); }
.status-pill--published { background: rgba(74, 222, 128, 0.15); color: var(--green); }
.status-pill--skipped { background: rgba(248, 113, 113, 0.15); color: var(--red); }
.status-pill--draft { background: rgba(122, 120, 112, 0.2); color: var(--text-muted); }

/* Keyword detail */
.kw-detail__row {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--bg-border);
}

.kw-detail__row:last-child { border-bottom: none; }
.kw-detail__label { color: var(--text-muted); font-size: 0.85rem; }
.kw-detail__value { font-weight: 500; }
.kw-detail__value--accent { color: var(--accent); font-family: var(--font-heading); }

/* Reasoning */
.reasoning-text {
  color: var(--text-muted);
  font-size: 0.9rem;
  font-style: italic;
  line-height: 1.5;
}

.reasoning-block {
  padding: 1rem 0;
  border-bottom: 1px solid var(--bg-border);
}

.reasoning-block__seq {
  font-family: var(--font-heading);
  color: var(--accent);
  font-size: 0.85rem;
  margin-right: 0.5rem;
}

.reasoning-block__keyword {
  font-weight: 600;
  font-size: 0.9rem;
}

.reasoning-block p {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-top: 0.35rem;
}

/* Forms */
.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.form-input {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--bg-border);
  border-radius: 4px;
  padding: 0.6rem 0.75rem;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.9rem;
  transition: border-color 0.15s;
}

.form-input:focus {
  outline: none;
  border-color: var(--accent);
}

.form-textarea {
  resize: vertical;
  line-height: 1.6;
  min-height: 120px;
}

.form-textarea--large {
  min-height: 70vh;
  font-family: var(--font-heading);
  font-size: 0.85rem;
}

.form-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.5rem;
  margin-bottom: 2rem;
}

/* Series badge */
.series-badge {
  display: inline-block;
  margin-top: 0.75rem;
  background: rgba(96, 165, 250, 0.15);
  color: var(--blue);
  font-size: 0.8rem;
  padding: 0.25rem 0.6rem;
  border-radius: 3px;
}

/* Analytics */
.analytics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.analytics-stat {
  text-align: center;
  padding: 0.75rem;
  background: var(--bg);
  border-radius: 4px;
}

.analytics-stat__value {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-dim);
}

.analytics-stat__label {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.chart-placeholder {
  background: var(--bg);
  border: 1px dashed var(--bg-border);
  border-radius: 4px;
  padding: 2rem;
  text-align: center;
  color: var(--text-dim);
  font-size: 0.85rem;
  margin-bottom: 0.75rem;
}

/* Meta display */
.meta-display__row {
  display: flex;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--bg-border);
  gap: 1rem;
}

.meta-display__label {
  color: var(--text-muted);
  font-size: 0.85rem;
  min-width: 120px;
}

.meta-display__value {
  font-size: 0.85rem;
}

/* Article body in dashboard */
.article-body {
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.7;
  max-height: 500px;
  overflow-y: auto;
  padding-right: 1rem;
}

.article-body h2 { color: var(--text); margin: 1.5rem 0 0.5rem; font-size: 1.1rem; }
.article-body h3 { color: var(--text); margin: 1rem 0 0.5rem; font-size: 1rem; }
.article-body p { margin-bottom: 0.75rem; }
.article-body ul, .article-body ol { margin: 0.5rem 0 0.75rem 1.5rem; }
.article-body li { margin-bottom: 0.25rem; }
.article-body strong { color: var(--text); }
.article-body a { color: var(--accent); }

/* Settings */
.setting-display {
  background: var(--bg);
  border: 1px solid var(--bg-border);
  border-radius: 4px;
  padding: 1rem;
  margin-bottom: 1rem;
}

.brand-brief-display {
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: var(--text-muted);
  white-space: pre-wrap;
  line-height: 1.6;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  font-size: 0.85rem;
  font-weight: 500;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s;
}

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

.btn--primary {
  background: var(--accent);
  color: var(--bg);
}

.btn--secondary {
  background: transparent;
  border-color: var(--bg-border);
  color: var(--text-muted);
}

.btn--danger {
  background: transparent;
  border-color: var(--red);
  color: var(--red);
}

/* Workflow */
.workflow-pipeline {
  max-width: 600px;
}

.workflow-step {
  background: var(--bg);
  border: 1px solid var(--bg-border);
  border-radius: 6px;
  padding: 1rem 1.25rem;
}

.workflow-step--inactive {
  opacity: 0.5;
}

.workflow-step__header {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.workflow-step__info { flex: 1; }

.workflow-step__info h3 {
  font-size: 0.95rem;
  margin-bottom: 0;
}

.workflow-step__schedule {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.workflow-step__controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.workflow-tag {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
  text-transform: uppercase;
}

.workflow-tag--human { background: rgba(251, 191, 36, 0.15); color: var(--amber); }
.workflow-tag--auto { background: rgba(74, 222, 128, 0.15); color: var(--green); }

.workflow-connector {
  width: 2px;
  height: 20px;
  background: var(--bg-border);
  margin: 0 auto;
}

/* Toggle switch */
.toggle {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 20px;
}

.toggle input { opacity: 0; width: 0; height: 0; }

.toggle__slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background: var(--bg-border);
  border-radius: 20px;
  transition: 0.3s;
}

.toggle__slider:before {
  content: "";
  position: absolute;
  height: 14px;
  width: 14px;
  left: 3px;
  bottom: 3px;
  background: var(--text-muted);
  border-radius: 50%;
  transition: 0.3s;
}

.toggle input:checked + .toggle__slider { background: var(--accent); }
.toggle input:checked + .toggle__slider:before { transform: translateX(16px); background: var(--bg); }

/* Retroactive options */
.retro-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-top: 1rem;
}

.retro-option {
  background: var(--bg);
  border: 1px solid var(--bg-border);
  border-radius: 6px;
  padding: 1.25rem;
}

.retro-option h3 { color: var(--accent); font-size: 0.9rem; }
.retro-option p { color: var(--text-muted); font-size: 0.85rem; }

/* Utility */
.text-muted { color: var(--text-muted); }

@media (max-width: 768px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .grid-2 { grid-template-columns: 1fr; }
  .analytics-grid { grid-template-columns: repeat(2, 1fr); }
  .retro-options { grid-template-columns: 1fr; }
}
