/* Content Factory CRM — navy / cream / gold */
* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  background: #1C1B24;
  color: #F4EDE4;
  min-height: 100vh;
}

a { color: #C4725A; text-decoration: none; }
a:hover { text-decoration: underline; }

header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid #3A3836;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

header h1 { font-size: 1.35rem; font-weight: 500; font-family: Georgia, serif; }
header .sub { color: #A8A4B0; font-size: 0.85rem; margin-top: 0.25rem; }

.btn {
  background: #C4725A;
  color: #fff;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.85rem;
}
.btn:hover { background: #b3634d; }
.btn.secondary {
  background: #2A2826;
  border: 1px solid #444;
  color: #F4EDE4;
}
.btn.secondary:hover { background: #3A3836; }
.btn:disabled { opacity: 0.5; cursor: wait; }

.crm-board {
  display: flex;
  flex-direction: row;
  gap: 0.75rem;
  padding: 1rem;
  overflow-x: auto;
  align-items: flex-start;
  min-height: calc(100vh - 90px);
}

.drop-zone.drag-over {
  outline: 2px dashed #C4725A;
  background: #2e2d35;
}

.drop-hint {
  font-size: 0.75rem;
  color: #666;
  margin-bottom: 0.75rem;
  font-style: italic;
}

.slot-empty {
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px dashed #444;
  border-radius: 8px;
}

.add-topic {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.add-topic input {
  flex: 1;
  padding: 0.5rem;
  border-radius: 8px;
  border: 1px solid #444;
  background: #1C1B24;
  color: #F4EDE4;
  font-size: 0.85rem;
}

.variants { margin-top: 0.5rem; }

.variant-row {
  background: #1C1B24;
  border-radius: 8px;
  padding: 0.6rem;
  margin-bottom: 0.5rem;
}

.variant-thumb {
  width: 100%;
  max-width: 120px;
  border-radius: 6px;
  margin: 0.4rem 0;
  display: block;
}

.variant-thumb.placeholder {
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #333;
  color: #888;
  font-size: 0.75rem;
}

.variant-actions {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.badge.published {
  background: #4a7c5933;
  color: #8fbc8f;
}

.bank-card {
  cursor: grab;
  padding: 0.65rem;
  margin-bottom: 0.5rem;
}
.bank-card:active { cursor: grabbing; }
.bank-card h3 { font-size: 0.82rem; margin-bottom: 0.35rem; }
.bank-card .meta { font-size: 0.7rem; margin-bottom: 0.4rem; }
.bank-card .card-actions .btn { font-size: 0.7rem; padding: 0.25rem 0.5rem; }

.pending-card { border-left-color: #D4A574; }
.ready-card { border-left-color: #8fbc8f; }

.crm-column {
  background: #2A2826;
  border-radius: 12px;
  padding: 1rem;
  min-height: 200px;
  flex: 0 0 280px;
  min-width: 280px;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
}

.crm-column-bank {
  flex: 0 0 300px;
  min-width: 300px;
}

.crm-column-pending {
  flex: 0 0 420px;
  min-width: 420px;
}

.crm-column-ready.flash-ready {
  outline: 2px solid #8fbc8f;
  transition: outline 0.3s;
}

.variant-picker {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.45rem;
  margin: 0.5rem 0;
}

.variant-pick {
  position: relative;
  background: #1C1B24;
  border: 2px solid #3A3836;
  border-radius: 10px;
  padding: 0.45rem;
  cursor: pointer;
  text-align: center;
  transition: border-color 0.2s, transform 0.15s, box-shadow 0.2s;
}

.variant-pick:hover {
  border-color: #666;
}

.variant-pick-disabled {
  opacity: 0.55;
  cursor: not-allowed;
  border-style: dashed;
}

.badge.variant-status {
  display: block;
  margin: 0.25rem 0;
  font-size: 0.6rem;
}

.badge.variant-status.ok {
  background: #4a7c5933;
  color: #8fbc8f;
}

.badge.variant-status.warn {
  background: #a44a4a33;
  color: #d4a0a0;
}

.draft-placeholder small {
  display: block;
  margin-top: 0.25rem;
  color: #a44;
}

.variant-pick.selected {
  border-color: #C4725A;
  box-shadow: 0 0 0 1px #C4725A44;
  transform: translateY(-2px);
}

.variant-pick .variant-thumb {
  max-width: 100%;
  width: 100%;
  margin: 0.25rem 0;
}

.variant-label {
  display: block;
  font-size: 0.65rem;
  color: #A8A4B0;
  line-height: 1.3;
}

.variant-preview {
  position: absolute;
  top: 4px;
  right: 4px;
  padding: 0.15rem 0.35rem !important;
  font-size: 0.65rem !important;
  z-index: 1;
}

.pick-hint {
  font-size: 0.75rem;
  color: #888;
  font-style: italic;
}

.pick-confirm {
  width: 100%;
  margin-top: 0.25rem;
}

.pick-confirm:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.card-leaving {
  animation: cardLeave 0.4s ease forwards;
  pointer-events: none;
}

.card-arriving {
  animation: cardArrive 0.55s ease;
}

@keyframes cardLeave {
  to { opacity: 0; transform: translateX(40px) scale(0.96); }
}

@keyframes cardArrive {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: none; }
}

.toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(120%);
  background: #2A2826;
  border: 1px solid #8fbc8f;
  color: #F4EDE4;
  padding: 0.75rem 1.25rem;
  border-radius: 10px;
  font-size: 0.85rem;
  z-index: 200;
  transition: transform 0.3s ease;
  max-width: 90vw;
  text-align: center;
}

.crm-column-ready {
  flex: 0 0 300px;
  min-width: 300px;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
}

.crm-column h2 {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #C4725A;
  margin-bottom: 1rem;
}

.crm-column .count {
  background: #1C1B24;
  padding: 2px 8px;
  border-radius: 10px;
  margin-left: 6px;
  color: #A8A4B0;
}

.topic-card {
  background: #1C1B24;
  border-radius: 10px;
  padding: 1rem;
  margin-bottom: 0.75rem;
  border-left: 4px solid #C4725A;
  cursor: pointer;
  transition: background 0.15s;
}

.topic-card:hover { background: #24232a; }

.topic-card h3 {
  font-size: 0.95rem;
  font-family: Georgia, serif;
  font-weight: normal;
  line-height: 1.35;
  margin-bottom: 0.5rem;
}

.topic-card .meta { font-size: 0.75rem; color: #A8A4B0; margin-bottom: 0.6rem; }

.badge {
  display: inline-block;
  font-size: 0.65rem;
  padding: 2px 7px;
  border-radius: 4px;
  background: #C4725A33;
  color: #D4A574;
  margin-right: 4px;
}

.thumb {
  width: 100%;
  border-radius: 8px;
  margin-bottom: 0.6rem;
  display: block;
}

.progress-bar {
  height: 4px;
  background: #3A3836;
  border-radius: 2px;
  margin: 0.5rem 0;
  overflow: hidden;
}

.progress-bar span {
  display: block;
  height: 100%;
  background: #C4725A;
}

.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.5rem;
}

.card-actions .btn { font-size: 0.75rem; padding: 0.35rem 0.65rem; }

/* Topic workspace */
.workspace {
  padding: 1.25rem;
  max-width: 1400px;
  margin: 0 auto;
}

.workspace-header {
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #3A3836;
}

.workspace-header h1 {
  font-family: Georgia, serif;
  font-size: 1.5rem;
  font-weight: normal;
  margin-bottom: 0.5rem;
}

.workspace-header .angle {
  color: #A8A4B0;
  font-size: 0.9rem;
  max-width: 640px;
  line-height: 1.5;
}

.pipeline {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 1rem;
  margin-bottom: 1.5rem;
}

.pipeline-step {
  flex: 0 0 140px;
  background: #2A2826;
  border-radius: 10px;
  padding: 0.85rem;
  text-align: center;
  border: 2px solid transparent;
}

.pipeline-step.done { border-color: #4a7c59; }
.pipeline-step.active { border-color: #C4725A; }
.pipeline-step.fail { border-color: #a44; }

.pipeline-step .label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #A8A4B0;
  margin-bottom: 0.35rem;
}

.pipeline-step .state {
  font-size: 0.75rem;
  color: #F4EDE4;
  margin-bottom: 0.5rem;
}

.pipeline-step .btn { width: 100%; font-size: 0.65rem; padding: 0.3rem; }

.workspace-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

@media (max-width: 900px) {
  .workspace-grid { grid-template-columns: 1fr; }
}

.panel {
  background: #2A2826;
  border-radius: 12px;
  padding: 1.25rem;
}

.panel h2 {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #C4725A;
  margin-bottom: 1rem;
}

.gates label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
  cursor: pointer;
}

.gates input { accent-color: #C4725A; width: 18px; height: 18px; }

.preview-frame {
  width: 100%;
  min-height: 500px;
  border: none;
  border-radius: 8px;
  background: #1C1B24;
}

.log-panel {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  max-height: 220px;
  background: #111;
  border-top: 1px solid #333;
  padding: 0.75rem 1rem;
  overflow-y: auto;
  font-family: ui-monospace, monospace;
  font-size: 0.75rem;
  color: #8f8;
  display: none;
  z-index: 100;
}

.log-panel.open { display: block; }

.log-panel .close {
  float: right;
  background: none;
  border: none;
  color: #888;
  cursor: pointer;
  font-size: 1rem;
}

.empty { color: #666; font-size: 0.85rem; font-style: italic; }

.locked-cards {
  font-size: 0.8rem;
  color: #A8A4B0;
  line-height: 1.6;
}

.locked-cards code {
  background: #1C1B24;
  padding: 2px 6px;
  border-radius: 4px;
  color: #D4A574;
  font-size: 0.75rem;
}
