/* ============================================================
   SellLive — Dark Command Center Theme
   ============================================================ */

/* --- CSS Variables --- */
:root {
  /* Surfaces */
  --sl-bg: #0f1117;
  --sl-surface: #1a1d27;
  --sl-surface-border: #2a2d3a;
  --sl-surface-hover: #1e2130;
  --sl-sidebar: #0d0f14;

  /* Text */
  --sl-text: #e2e4e9;
  --sl-text-muted: #7a7f8d;
  --sl-text-inverse: #0f1117;

  /* Accent */
  --sl-accent: #22d3ee;
  --sl-accent-hover: #06b6d4;

  /* Status */
  --sl-green: #10b981;
  --sl-amber: #f59e0b;
  --sl-red: #ef4444;
  --sl-gray: #4b5063;

  /* Typography */
  --sl-font-body: 'DM Sans', system-ui, sans-serif;
  --sl-font-mono: 'JetBrains Mono', ui-monospace, monospace;

  /* Pico CSS overrides */
  --pico-background-color: var(--sl-bg);
  --pico-color: var(--sl-text);
  --pico-primary: var(--sl-accent);
  --pico-primary-hover: var(--sl-accent-hover);
  --pico-card-background-color: var(--sl-surface);
  --pico-card-border-color: var(--sl-surface-border);
  --pico-card-sectioning-background-color: var(--sl-surface);
  --pico-muted-color: var(--sl-text-muted);
  --pico-muted-border-color: var(--sl-surface-border);
  --pico-form-element-background-color: var(--sl-surface);
  --pico-form-element-border-color: var(--sl-surface-border);
  --pico-form-element-color: var(--sl-text);
  --pico-form-element-focus-color: var(--sl-accent);
  --pico-table-border-color: var(--sl-surface-border);
  --pico-table-row-stripped-background-color: var(--sl-surface-hover);
  --pico-code-background-color: var(--sl-surface);
  --pico-code-color: var(--sl-accent);
  --pico-h1-color: var(--sl-text);
  --pico-h2-color: var(--sl-text);
  --pico-h3-color: var(--sl-text);
  --pico-h4-color: var(--sl-text);
  --pico-h5-color: var(--sl-text);
  --pico-h6-color: var(--sl-text);

  font-size: 14px;
}

/* --- Base --- */
html {
  background: var(--sl-bg);
  color: var(--sl-text);
}

body {
  font-family: var(--sl-font-body);
  margin: 0;
  min-height: 100vh;
  background: var(--sl-bg);
  color: var(--sl-text);
}

a { color: var(--sl-accent); }
a:hover { color: var(--sl-accent-hover); }

h1, h2, h3, h4, h5, h6 { color: var(--sl-text); }

code, pre, kbd {
  font-family: var(--sl-font-mono);
}

/* ============================================================
   Layout — Sidebar + Main
   ============================================================ */

.layout-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 220px;
  background: var(--sl-sidebar);
  border-right: 1px solid var(--sl-surface-border);
  display: flex;
  flex-direction: column;
  z-index: 100;
  overflow-y: auto;
}

.layout-main {
  margin-left: 220px;
  flex: 1;
  padding: 2rem;
  min-height: 100vh;
}

.page-content {
  max-width: 1100px;
  margin: 0 auto;
}

.page-content-wide {
  max-width: 1400px;
  margin: 0 auto;
}

/* --- Sidebar Elements --- */

.sidebar-brand {
  padding: 1.25rem 1rem 1rem;
}
.sidebar-brand a {
  color: var(--sl-accent);
  font-size: 1.15rem;
  font-weight: 700;
  text-decoration: none;
  letter-spacing: 0.02em;
}
.sidebar-brand a:hover {
  color: var(--sl-accent-hover);
}

.sidebar-channels {
  padding: 0.5rem 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

/* Push footer to bottom */
.sidebar-footer {
  margin-top: auto;
}

.sidebar-channel-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  color: var(--sl-text-muted);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  border-left: 3px solid transparent;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.sidebar-channel-link:hover {
  background: var(--sl-surface-hover);
  color: var(--sl-text);
}
.sidebar-channel-link.active {
  border-left-color: var(--sl-accent);
  color: var(--sl-text);
  background: var(--sl-surface-hover);
}

.sidebar-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.sidebar-footer {
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--sl-surface-border);
  font-size: 0.75rem;
  color: var(--sl-text-muted);
}
.sidebar-footer a {
  color: var(--sl-text-muted);
  text-decoration: none;
}
.sidebar-footer a:hover {
  color: var(--sl-accent);
}

/* ============================================================
   Components
   ============================================================ */

/* --- Status Pills --- */
.pill {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-family: var(--sl-font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.pill-planned   { background: rgba(75, 80, 99, 0.15);  color: var(--sl-gray); }
.pill-approved  { background: rgba(34, 211, 238, 0.15); color: var(--sl-accent); }
.pill-producing { background: rgba(245, 158, 11, 0.15); color: var(--sl-amber); }
.pill-ready     { background: rgba(16, 185, 129, 0.15); color: var(--sl-green); }
.pill-rendered  { background: rgba(16, 185, 129, 0.15); color: var(--sl-green); }
.pill-published { background: rgba(16, 185, 129, 0.15); color: var(--sl-green); }
.pill-failed    { background: rgba(239, 68, 68, 0.15);  color: var(--sl-red); }
.pill-skipped   { background: rgba(75, 80, 99, 0.15);   color: var(--sl-gray); }

/* --- Type Badges --- */
.badge {
  display: inline-block;
  padding: 0.1rem 0.45rem;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.badge-short   { background: rgba(168, 85, 247, 0.15);  color: #a855f7; }
.badge-story   { background: rgba(99, 102, 241, 0.15);  color: #818cf8; }
.badge-live    { background: rgba(245, 158, 11, 0.15);  color: var(--sl-amber); }
.badge-selling { background: rgba(56, 189, 248, 0.15);  color: #38bdf8; }

/* --- Agent Colors --- */
.agent-station-manager { color: #60a5fa; }
.agent-researcher      { color: #a78bfa; }
.agent-freshness       { color: #fb923c; }
.agent-analytics       { color: #34d399; }
.agent-community       { color: #2dd4bf; }

/* --- Channel Cards --- */
.channel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}
.channel-card {
  background: var(--sl-surface);
  border: 1px solid var(--sl-surface-border);
  border-radius: 8px;
  padding: 1.25rem;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
  border-left: 3px solid transparent;
}
.channel-card:hover {
  border-left-color: var(--sl-accent);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

/* --- Stats --- */
.stats-row {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}
.stat-card {
  flex: 1;
  min-width: 120px;
  text-align: center;
  background: var(--sl-surface);
  border: 1px solid var(--sl-surface-border);
  border-radius: 8px;
  padding: 1rem;
}
.stat-value {
  font-family: var(--sl-font-mono);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--sl-text);
}
.stat-label {
  font-family: var(--sl-font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--sl-text-muted);
  margin-top: 0.25rem;
}
.stats-vertical {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* --- Dashboard Grid --- */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 1.5rem;
  align-items: start;
}

/* --- Agent List --- */
.agent-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.agent-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: var(--sl-surface);
  border: 1px solid var(--sl-surface-border);
  border-radius: 6px;
  font-size: 0.85rem;
}
.agent-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.agent-dot-healthy { background: var(--sl-green); }
.agent-dot-stale   { background: var(--sl-amber); }
.agent-dot-never   { background: var(--sl-gray); }
.agent-name {
  flex: 1;
  font-weight: 500;
}
.agent-time {
  color: var(--sl-text-muted);
  font-family: var(--sl-font-mono);
  font-size: 0.75rem;
}

/* --- Activity Log --- */
.activity-log {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.activity-row {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  padding: 0.4rem 0;
  font-size: 0.82rem;
  border-bottom: 1px solid var(--sl-surface-border);
}
.activity-row:last-child { border-bottom: none; }
.activity-time {
  font-family: var(--sl-font-mono);
  font-size: 0.72rem;
  color: var(--sl-text-muted);
  white-space: nowrap;
}
.activity-agent {
  font-weight: 600;
  white-space: nowrap;
}
.activity-event {
  color: var(--sl-text-muted);
}

/* --- Filter Pills --- */
.filter-pills {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}
.filter-pill {
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 500;
  background: var(--sl-surface);
  border: 1px solid var(--sl-surface-border);
  color: var(--sl-text-muted);
  cursor: pointer;
  text-decoration: none;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.filter-pill:hover {
  background: var(--sl-surface-hover);
  color: var(--sl-text);
}
.filter-pill.active {
  background: rgba(34, 211, 238, 0.12);
  border-color: var(--sl-accent);
  color: var(--sl-accent);
}

/* --- Calendar --- */
.calendar-day-heading {
  font-family: var(--sl-font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--sl-text-muted);
  padding: 0.75rem 0 0.25rem;
  border-bottom: 1px solid var(--sl-surface-border);
  margin-bottom: 0.4rem;
}
.calendar-entry {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
  border-left: 3px solid var(--sl-gray);
  margin-bottom: 0.3rem;
  font-size: 0.85rem;
}
.calendar-entry.type-short   { border-left-color: #a855f7; }
.calendar-entry.type-story   { border-left-color: #818cf8; }
.calendar-entry.type-live    { border-left-color: var(--sl-amber); }
.calendar-entry.type-selling { border-left-color: #38bdf8; }
.calendar-entry-title {
  flex: 1;
  font-weight: 500;
}

/* ============================================================
   Pipeline Timeline
   ============================================================ */
.pipeline {
  position: relative;
  padding-left: 1.25rem;
}
.pipeline::before {
  content: '';
  position: absolute;
  left: 5px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--sl-surface-border);
}

.pipeline-stage {
  position: relative;
  padding-bottom: 1.25rem;
}
.pipeline-stage:last-child { padding-bottom: 0; }

.pipeline-node {
  position: absolute;
  left: -1.25rem;
  top: 0.15rem;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--sl-gray);
  border: 2px solid var(--sl-bg);
  z-index: 1;
}
.pipeline-node.complete { background: var(--sl-green); }
.pipeline-node.running  { background: var(--sl-amber); animation: pulse-node 1.5s ease-in-out infinite; }
.pipeline-node.failed   { background: var(--sl-red); }
.pipeline-node.pending  { background: var(--sl-gray); }

@keyframes pulse-node {
  0%, 100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.4); }
  50%      { box-shadow: 0 0 0 6px rgba(245, 158, 11, 0); }
}

.pipeline-card {
  background: var(--sl-surface);
  border: 1px solid var(--sl-surface-border);
  border-radius: 6px;
  overflow: hidden;
}
.pipeline-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 0.85rem;
  font-size: 0.85rem;
  font-weight: 600;
  border-bottom: 1px solid var(--sl-surface-border);
}
.pipeline-card-body {
  padding: 0.75rem 0.85rem;
  font-size: 0.82rem;
}

/* --- Redo Buttons --- */
.btn-redo {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 500;
  background: var(--sl-surface-hover);
  border: 1px solid var(--sl-surface-border);
  color: var(--sl-text-muted);
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
  text-decoration: none;
}
.btn-redo:hover {
  background: var(--sl-surface-border);
  color: var(--sl-text);
}
.btn-redo-danger {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 500;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: var(--sl-red);
  cursor: pointer;
  transition: background 0.12s;
  text-decoration: none;
}
.btn-redo-danger:hover {
  background: rgba(239, 68, 68, 0.2);
}

/* --- Asset Gallery --- */
.asset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
}
.asset-card {
  background: var(--sl-surface);
  border: 1px solid var(--sl-surface-border);
  border-radius: 6px;
  overflow: hidden;
  transition: border-color 0.12s;
}
.asset-card:hover {
  border-color: var(--sl-accent);
}
.asset-card img {
  width: 100%;
  display: block;
  cursor: pointer;
}
.asset-card-footer {
  padding: 0.5rem 0.65rem;
  font-size: 0.75rem;
  color: var(--sl-text-muted);
}
.asset-label {
  font-family: var(--sl-font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--sl-text-muted);
}

/* --- Lightbox --- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.lightbox img {
  max-width: 90vw;
  max-height: 90vh;
  border-radius: 8px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

/* --- Tables --- */
table {
  border-collapse: collapse;
  width: 100%;
  border: none;
}
table th {
  font-family: var(--sl-font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--sl-text-muted);
  border-bottom: 1px solid var(--sl-surface-border);
  padding: 0.5rem 0.75rem;
  text-align: left;
}
table td {
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--sl-surface-border);
  font-size: 0.85rem;
}
table tr:last-child td { border-bottom: none; }

/* --- Content Library --- */
.video-thumb {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  border-radius: 6px;
  background: var(--sl-surface);
}
.video-thumb-placeholder {
  width: 100%;
  aspect-ratio: 16/9;
  border-radius: 6px;
  background: var(--sl-surface);
  border: 1px dashed var(--sl-surface-border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--sl-text-muted);
  font-size: 0.8rem;
}

/* --- Video Detail --- */
.video-player-wrap {
  width: 100%;
  aspect-ratio: 16/9;
  background: #000;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 1.5rem;
}
.video-player-wrap video,
.video-player-wrap iframe {
  width: 100%;
  height: 100%;
}
.meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
}
.meta-item {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.meta-label {
  font-family: var(--sl-font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--sl-text-muted);
}
.meta-value {
  font-size: 0.9rem;
  color: var(--sl-text);
}

/* --- Forms --- */
fieldset {
  border: 1px solid var(--sl-surface-border);
  border-radius: 8px;
  padding: 1.25rem;
  background: var(--sl-surface);
}
legend {
  color: var(--sl-text);
  font-weight: 600;
  padding: 0 0.5rem;
}

input, select, textarea {
  background: var(--sl-bg) !important;
  border: 1px solid var(--sl-surface-border) !important;
  color: var(--sl-text) !important;
  border-radius: 6px;
  font-family: var(--sl-font-body);
}
input:focus, select:focus, textarea:focus {
  border-color: var(--sl-accent) !important;
  box-shadow: 0 0 0 2px rgba(34, 211, 238, 0.15);
  outline: none;
}

button[type="submit"],
input[type="submit"],
.btn-accent {
  background: var(--sl-accent);
  color: var(--sl-text-inverse);
  border: none;
  border-radius: 6px;
  padding: 0.5rem 1.25rem;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.12s;
}
button[type="submit"]:hover,
input[type="submit"]:hover,
.btn-accent:hover {
  background: var(--sl-accent-hover);
}

/* --- Buttons --- */
.btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.4rem 0.85rem;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 500;
  background: transparent;
  border: 1px solid var(--sl-surface-border);
  color: var(--sl-text);
  cursor: pointer;
  text-decoration: none;
  transition: background 0.12s, border-color 0.12s;
}
.btn-outline:hover {
  background: var(--sl-surface-hover);
  border-color: var(--sl-text-muted);
}

.btn-danger {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.4rem 0.85rem;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 500;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: var(--sl-red);
  cursor: pointer;
  text-decoration: none;
  transition: background 0.12s;
}
.btn-danger:hover {
  background: rgba(239, 68, 68, 0.22);
}

/* --- Breadcrumb --- */
nav[aria-label="breadcrumb"] {
  margin-bottom: 1rem;
}
nav[aria-label="breadcrumb"] ul {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0;
  margin: 0;
  font-size: 0.82rem;
}
nav[aria-label="breadcrumb"] li + li::before {
  content: '/';
  margin-right: 0.25rem;
  color: var(--sl-text-muted);
}
nav[aria-label="breadcrumb"] a {
  color: var(--sl-text-muted);
  text-decoration: none;
}
nav[aria-label="breadcrumb"] a:hover {
  color: var(--sl-accent);
}
nav[aria-label="breadcrumb"] li:last-child {
  color: var(--sl-text);
}

/* --- Prompts --- */
.prompt-text {
  background: var(--sl-surface);
  border: 1px solid var(--sl-surface-border);
  border-radius: 6px;
  padding: 0.85rem;
  font-family: var(--sl-font-mono);
  font-size: 0.8rem;
  white-space: pre-wrap;
  line-height: 1.5;
  color: var(--sl-text);
}

/* --- Section Headers --- */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}
.section-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--sl-text);
  margin: 0;
}

/* --- Audio Player --- */
audio {
  filter: invert(1) hue-rotate(180deg);
  width: 100%;
  height: 36px;
}

/* --- Details/Summary --- */
details {
  background: var(--sl-surface);
  border: 1px solid var(--sl-surface-border);
  border-radius: 6px;
  margin-bottom: 0.75rem;
}
details > summary {
  padding: 0.65rem 0.85rem;
  cursor: pointer;
  font-weight: 500;
  font-size: 0.85rem;
  color: var(--sl-text);
  list-style: none;
}
details > summary::-webkit-details-marker { display: none; }
details > summary::before {
  content: '\25B6';
  display: inline-block;
  margin-right: 0.5rem;
  font-size: 0.65rem;
  transition: transform 0.15s;
  color: var(--sl-text-muted);
}
details[open] > summary::before {
  transform: rotate(90deg);
}
details > :not(summary) {
  padding: 0 0.85rem 0.75rem;
  font-size: 0.85rem;
}

/* --- Generic KV Grid --- */
.kv-grid {
  display: grid;
  grid-template-columns: minmax(120px, max-content) 1fr;
  gap: 0.35rem 1.5rem;
  font-size: 0.85rem;
  align-items: baseline;
}
.kv-key {
  font-family: var(--sl-font-mono);
  font-size: 0.75rem;
  color: var(--sl-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
}
.kv-value {
  color: var(--sl-text);
}
.kv-nested {
  background: var(--sl-bg);
  border: 1px solid var(--sl-surface-border);
  border-radius: 4px;
  padding: 0.5rem;
  margin: 0.25rem 0;
}
.kv-array-table {
  width: 100%;
  font-size: 0.82rem;
}

/* --- HTMX Loading States --- */
.htmx-indicator {
  display: none;
}
.htmx-request .htmx-indicator {
  display: inline-block;
}
.htmx-request.htmx-indicator {
  display: inline-block;
}

/* Subtle loading overlay */
.htmx-request {
  position: relative;
}
.htmx-request::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(15, 17, 23, 0.4);
  border-radius: inherit;
  pointer-events: none;
}

/* Pico article (card) overrides */
article {
  background: var(--sl-surface);
  border: 1px solid var(--sl-surface-border);
  border-radius: 8px;
  color: var(--sl-text);
}

/* --- Tab Navigation --- */
.tab-nav {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--sl-surface-border);
  margin-bottom: 1.5rem;
}
.tab-link {
  padding: 0.5rem 1rem;
  font-size: 0.8rem;
  font-family: var(--sl-font-mono);
  color: var(--sl-text-muted);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: color 0.1s, border-color 0.1s;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
}
.tab-link:hover { color: var(--sl-text); }
.tab-link.active {
  color: var(--sl-accent);
  border-bottom-color: var(--sl-accent);
}

/* --- Color Swatches --- */
.color-swatches {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.color-swatch {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}
.color-swatch-circle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--sl-surface-border);
}
.color-swatch-label {
  font-family: var(--sl-font-mono);
  font-size: 0.65rem;
  color: var(--sl-text-muted);
}
.color-swatch-hex {
  font-family: var(--sl-font-mono);
  font-size: 0.7rem;
}

/* --- Tab Updated Timestamp --- */
.tab-updated {
  font-family: var(--sl-font-mono);
  font-size: 0.7rem;
  color: var(--sl-text-muted);
  text-align: right;
  margin-bottom: 0.5rem;
}

/* --- Rejection Pattern Cards --- */
.rejection-card {
  background: var(--sl-surface);
  border: 1px solid var(--sl-surface-border);
  border-left: 3px solid var(--sl-red);
  border-radius: 4px;
  padding: 0.5rem 0.75rem;
  margin-bottom: 0.5rem;
}
.rejection-pattern {
  font-family: var(--sl-font-mono);
  font-size: 0.8rem;
  color: var(--sl-text);
  margin-bottom: 0.25rem;
}
.rejection-reason {
  font-size: 0.8rem;
  color: var(--sl-text-muted);
}

/* --- MCP Command Hint --- */
.mcp-hint {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.3rem 0.75rem;
  border-radius: 4px;
  border: 1px solid var(--sl-surface-border);
  background: var(--sl-surface);
  font-family: var(--sl-font-mono);
  font-size: 0.75rem;
  color: var(--sl-text-muted);
  cursor: pointer;
}
.mcp-hint:hover {
  border-color: var(--sl-accent);
  color: var(--sl-accent);
}

/* --- Host Card --- */
.host-card {
  background: var(--sl-surface);
  border: 1px solid var(--sl-surface-border);
  border-radius: 6px;
  padding: 1rem;
  margin-bottom: 0.75rem;
}
.host-card-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}
.host-card-header h4 {
  margin: 0;
  font-size: 0.95rem;
}
.host-preamble {
  max-height: 200px;
  overflow-y: auto;
  white-space: pre-wrap;
  font-family: var(--sl-font-mono);
  font-size: 0.75rem;
  background: var(--sl-bg);
  border: 1px solid var(--sl-surface-border);
  border-radius: 4px;
  padding: 0.5rem;
  color: var(--sl-text-muted);
}

/* --- Branding Images --- */
.branding-banner {
  width: 100%;
  max-height: 200px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--sl-surface-border);
  margin-bottom: 1rem;
}
.branding-pair {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
}
.branding-pair img {
  width: 120px;
  height: 120px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--sl-surface-border);
}

/* --- Empty State --- */
.empty-state {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--sl-text-muted);
}
.empty-state p {
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 900px) {
  .layout-sidebar {
    width: 56px;
  }
  .layout-sidebar .sidebar-brand a {
    font-size: 0;
  }
  .layout-sidebar .sidebar-brand a::first-letter {
    font-size: 1.15rem;
  }
  .sidebar-channel-link span,
  .sidebar-footer span {
    display: none;
  }
  .sidebar-channel-link {
    justify-content: center;
    padding: 0.5rem;
  }
  .layout-main {
    margin-left: 56px;
    padding: 1.25rem;
  }
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .layout-sidebar {
    display: none;
  }
  .layout-main {
    margin-left: 0;
    padding: 1rem;
  }
  .stats-row {
    flex-direction: column;
  }
  .meta-grid {
    grid-template-columns: 1fr;
  }
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}
