/* Dark dashboard theme, tokens carried over from TraderDaddy Pro's own
   frontend/app/globals.css (the --tm-* brand tokens) so this internal tool
   reads as the same product family instead of a bare unstyled page. Plain
   CSS, no build step - this app has none and doesn't need one for a
   1-3 person tool. */
:root {
  --bg-base: #050a18;
  --bg-raised: #0a1426;
  --surface-1: #0c1526;
  --surface-2: #111c33;
  --surface-3: #16233d;
  --border-hair: rgba(148, 168, 200, 0.11);
  --border-line: rgba(59, 130, 246, 0.2);
  --dot-grid: rgba(59, 130, 246, 0.11);
  --text-primary: #eef2f8;
  --text-secondary: #b9c5d8;
  --text-muted: #8b9ab4;
  --text-dim: #5d6b85;
  --gold: #d4a62a;
  --gold-bright: #e9bc42;
  --bull: #10b981;
  --bear: #ef4444;
  --info: #60a5fa;
  --violet: #a855f7;
  --radius: 12px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  padding: 2rem 1.25rem 4rem;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--text-primary);
  background-color: var(--bg-base);
  background-image:
    radial-gradient(circle, var(--dot-grid) 1px, transparent 1px),
    radial-gradient(ellipse 110% 45% at 50% 0%, rgba(59, 130, 246, 0.09) 0%, transparent 65%);
  background-size: 28px 28px, 100% 100%;
  min-height: 100vh;
}

/* Shared header: title, platform nav, metrics readout. Identical on all
   three pages (/, /ig, /youtube) so moving between them reads as one app,
   not three unrelated pages - hub/cards.py's _page_shell builds this once. */
.dash-header {
  max-width: 1400px;
  margin: 0 auto 1.5rem;
}

.dash-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.1rem;
}

h1.dash-title {
  font-size: 1.4rem;
  letter-spacing: -0.01em;
  margin: 0;
}

.dash-subtitle {
  font-size: 0.78rem;
  color: var(--text-dim);
  margin-top: 0.2rem;
}

/* A pill-track nav, same shape language the filter chips already use for
   "the thing you can switch to" - three real destinations (/, /ig,
   /youtube), not a client-side toggle, so these are plain anchors. */
.platform-nav {
  display: flex;
  gap: 0.2rem;
  background: var(--surface-1);
  border: 1px solid var(--border-hair);
  border-radius: 999px;
  padding: 0.25rem;
}

.platform-link {
  padding: 0.4rem 1.1rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.15s ease, background 0.15s ease;
}

.platform-link:hover { color: var(--text-primary); }

.platform-link.active {
  color: var(--bg-base);
  background: linear-gradient(135deg, var(--gold), var(--gold-bright));
}

/* The metrics readout: a strip per account, not a grid of identical
   shadowed cards - numbers are the content here, so they carry the weight
   instead of a box around each one. */
.metrics-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.metrics-account {
  flex: 1 1 340px;
  background: var(--surface-1);
  border: 1px solid var(--border-hair);
  border-radius: var(--radius);
  padding: 0.75rem 1rem 0.85rem;
}

.metrics-account h3 {
  margin: 0 0 0.5rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.metrics-stats {
  display: flex;
  flex-wrap: wrap;
  column-gap: 1.4rem;
  row-gap: 0.5rem;
}

.metric {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.metric-value {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

.metric-value.up { color: var(--bull); }
.metric-value.down { color: var(--bear); }

.metric-label {
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* An honest gap, not an empty list: distinguishes "nothing wired in for
   this account" from ".empty"'s "wired in, nothing pending right now" -
   a dashed border reads as "status", not as content. */
.platform-note {
  color: var(--text-dim);
  font-size: 0.9rem;
  line-height: 1.5;
  background: var(--surface-1);
  border: 1px dashed var(--border-hair);
  border-radius: var(--radius);
  padding: 0.9rem 1rem;
}

.board {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 1.5rem;
  max-width: 1400px;
  margin: 0 auto;
}

.column-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1rem;
}

.avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  background: linear-gradient(135deg, var(--gold), var(--gold-bright));
  color: var(--bg-base);
  flex-shrink: 0;
}

.column-header h2 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
}

.count-chip {
  margin-left: auto;
  font-size: 0.75rem;
  color: var(--text-muted);
  background: var(--surface-2);
  border: 1px solid var(--border-hair);
  border-radius: 999px;
  padding: 0.2rem 0.6rem;
  white-space: nowrap;
}

.filters {
  display: flex;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

.filter-chip {
  font-size: 0.78rem;
  color: var(--text-secondary);
  background: var(--surface-1);
  border: 1px solid var(--border-hair);
  border-radius: 999px;
  padding: 0.3rem 0.75rem;
  cursor: pointer;
}

.filter-chip.active {
  color: var(--bg-base);
  background: var(--gold);
  border-color: var(--gold);
}

.compose {
  background: var(--surface-1);
  border: 1px solid var(--border-hair);
  border-radius: var(--radius);
  padding: 0.85rem;
  margin-bottom: 1.25rem;
}

.compose textarea {
  width: 100%;
  min-height: 70px;
  background: var(--surface-2);
  color: var(--text-primary);
  border: 1px solid var(--border-hair);
  border-radius: 8px;
  padding: 0.6rem;
  font-family: inherit;
  font-size: 0.92rem;
  resize: vertical;
}

.compose-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.5rem;
}

.compose-count { font-size: 0.75rem; color: var(--text-dim); }

.compose-post {
  background: var(--bull);
  border-color: var(--bull);
  color: #06281c;
  font-weight: 600;
}

.yt-upload {
  background: var(--surface-1);
  border: 1px solid var(--border-hair);
  border-radius: var(--radius);
  padding: 0.85rem;
  margin-bottom: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.yt-upload h3 {
  margin: 0 0 0.15rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
}

.yt-upload input,
.yt-upload textarea,
.yt-upload select {
  width: 100%;
  background: var(--surface-2);
  color: var(--text-primary);
  border: 1px solid var(--border-hair);
  border-radius: 8px;
  padding: 0.5rem 0.6rem;
  font-family: inherit;
  font-size: 0.88rem;
}

.yt-upload textarea {
  min-height: 60px;
  resize: vertical;
}

.yt-upload-post {
  align-self: flex-start;
  border: 1px solid var(--bull);
  background: var(--bull);
  color: #06281c;
  border-radius: 999px;
  padding: 0.35rem 0.9rem;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
}

.yt-upload-post:disabled {
  opacity: 0.5;
  cursor: default;
}

.yt-upload-result {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.card {
  background: linear-gradient(135deg, rgba(17, 28, 51, 0.55), rgba(12, 21, 38, 0.7));
  border: 1px solid var(--border-hair);
  border-radius: var(--radius);
  padding: 1rem;
  margin-bottom: 1rem;
}

.card-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.handle { color: var(--text-primary); }

.kind {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.status-pill {
  margin-left: auto;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
}

.status-pending { color: var(--gold-bright); background: rgba(233, 188, 66, 0.14); }
.status-sending,
.status-approved,
.status-scheduled { color: var(--info); background: rgba(96, 165, 250, 0.14); }
.status-posted { color: var(--bull); background: rgba(16, 185, 129, 0.14); }
.status-handoff { color: var(--violet); background: rgba(168, 85, 247, 0.14); }
.status-rejected,
.status-failed { color: var(--bear); background: rgba(239, 68, 68, 0.14); }

.target {
  background: var(--surface-2);
  border-left: 3px solid var(--border-line);
  border-radius: 6px;
  padding: 0.6rem 0.75rem;
  margin: 0.5rem 0;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.target-user { color: var(--text-primary); font-weight: 600; }

/* A draft's line breaks are part of the draft. Collapsed to one paragraph
   the preview shows a different post than the one that will go out. */
.card-body {
  white-space: pre-wrap;
  font-size: 0.95rem;
  line-height: 1.45;
  color: var(--text-primary);
}

.card-media {
  max-width: 100%;
  border-radius: 8px;
  border: 1px solid var(--border-hair);
  margin-top: 0.6rem;
}

.card-handoff a {
  display: inline-block;
  margin-top: 0.6rem;
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  background: var(--violet);
  color: #fff;
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
}

.card-input {
  display: none;
  width: 100%;
  margin-top: 0.6rem;
  background: var(--surface-2);
  color: var(--text-primary);
  border: 1px solid var(--border-hair);
  border-radius: 8px;
  padding: 0.5rem;
  font-family: inherit;
}

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

.card-actions button,
.compose button {
  border: 1px solid var(--border-hair);
  background: var(--surface-2);
  color: var(--text-primary);
  border-radius: 999px;
  padding: 0.35rem 0.9rem;
  font-size: 0.82rem;
  cursor: pointer;
}

button[data-action="approve"] {
  background: var(--bull);
  border-color: var(--bull);
  color: #06281c;
  font-weight: 600;
}

button[data-action="reject"] {
  background: transparent;
  border-color: var(--bear);
  color: var(--bear);
}

.card-actions button:disabled,
.compose button:disabled {
  opacity: 0.5;
  cursor: default;
}

.card-result {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 0.4rem;
}

.card-result a { color: var(--gold-bright); }

.empty { color: var(--text-dim); font-size: 0.9rem; }
.error { color: var(--bear); font-size: 0.9rem; }

/* Login page shares the same theme, kept minimal since it's one form. */
.login-box {
  max-width: 320px;
  margin: 4rem auto;
  background: var(--surface-1);
  border: 1px solid var(--border-hair);
  border-radius: var(--radius);
  padding: 1.5rem;
}

.login-box input {
  width: 100%;
  padding: 0.6rem;
  margin-top: 0.75rem;
  background: var(--surface-2);
  border: 1px solid var(--border-hair);
  border-radius: 8px;
  color: var(--text-primary);
}

.login-box button {
  width: 100%;
  margin-top: 0.75rem;
  padding: 0.6rem;
  border-radius: 8px;
  border: none;
  background: var(--gold);
  color: var(--bg-base);
  font-weight: 600;
  cursor: pointer;
}

/* Overview tab: rollups, unified compose, calendar, idea bank. All four
   live as direct children of .board (already a grid) - .rollup and
   .unified-compose span every column so they read as a header row and a
   hero section, the calendar and idea-bank panels fall into place as
   ordinary auto-fit columns beside each other. */
.rollup {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.rollup-group {
  flex: 1 1 260px;
  background: var(--surface-1);
  border: 1px solid var(--border-hair);
  border-radius: var(--radius);
  padding: 0.75rem 1rem 0.85rem;
}

.rollup-group h3 {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.rollup-source {
  font-size: 0.68rem;
  color: var(--text-dim);
  margin-bottom: 0.55rem;
}

/* A boxed section that isn't a list of .card drafts - the calendar, the
   idea bank, the unified compose hero, and the Reddit/AH+Blossom mock
   notes all use this instead of the bare (unstyled) .column. */
.panel {
  background: var(--surface-1);
  border: 1px solid var(--border-hair);
  border-radius: var(--radius);
  padding: 1rem;
}

.panel.full-width { grid-column: 1 / -1; }

.panel h2 {
  margin: 0 0 0.85rem;
  font-size: 1.05rem;
  font-weight: 600;
}

.unified-compose {
  grid-column: 1 / -1;
  background: linear-gradient(135deg, rgba(17, 28, 51, 0.55), rgba(12, 21, 38, 0.7));
}

.unified-compose textarea {
  width: 100%;
  min-height: 80px;
  background: var(--surface-2);
  color: var(--text-primary);
  border: 1px solid var(--border-hair);
  border-radius: 8px;
  padding: 0.6rem;
  font-family: inherit;
  font-size: 0.92rem;
  resize: vertical;
  margin-bottom: 0.65rem;
}

.target-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.65rem;
}

.target-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.78rem;
  color: var(--text-secondary);
  background: var(--surface-2);
  border: 1px solid var(--border-hair);
  border-radius: 999px;
  padding: 0.32rem 0.75rem;
  cursor: pointer;
}

.target-chip input { margin: 0; }

.target-chip.disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.unified-compose .compose-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.compose-hint {
  font-size: 0.78rem;
  color: var(--text-dim);
}

.unified-post {
  background: var(--bull);
  border: 1px solid var(--bull);
  color: #06281c;
  font-weight: 600;
  border-radius: 999px;
  padding: 0.4rem 1.1rem;
  font-size: 0.85rem;
  cursor: pointer;
}

.unified-post:disabled { opacity: 0.5; cursor: default; }

.unified-result {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
}

.calendar-row {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  padding: 0.55rem 0;
  border-bottom: 1px solid rgba(148, 168, 200, 0.08);
}

.calendar-row:last-child { border-bottom: none; }

.calendar-platform {
  width: 90px;
  flex-shrink: 0;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--text-muted);
}

.calendar-handle { font-weight: 400; color: var(--text-dim); }

.calendar-text {
  flex: 1;
  min-width: 0;
  font-size: 0.86rem;
  color: var(--text-secondary);
}

.idea-bank {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.idea-chip {
  font-size: 0.78rem;
  color: var(--text-secondary);
  background: var(--surface-2);
  border: 1px solid var(--border-hair);
  border-radius: 999px;
  padding: 0.35rem 0.8rem;
}

.idea-chip b { color: var(--gold-bright); }

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

/* Instagram page: recent posts and followers history tables. */
.ig-subhead { margin: 1rem 0 0.4rem; font-size: 0.85rem; color: var(--text-secondary); }
.ig-table-wrap { overflow-x: auto; }
.ig-table { width: 100%; border-collapse: collapse; font-size: 0.8rem; }
.ig-table th { text-align: left; color: var(--text-muted); font-weight: 500; padding: 0.3rem 0.5rem; }
.ig-table td { padding: 0.3rem 0.5rem; border-top: 1px solid var(--border-hair); vertical-align: middle; }
.ig-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.ig-table .ig-caption { max-width: 320px; color: var(--text-secondary); }
.ig-thumb { width: 44px; height: 44px; object-fit: cover; border-radius: 6px; display: block; }

/* growth charts (hub/metrics_pages.py) */
.chart { width: 100%; height: auto; display: block; }
.chart-small { max-width: 320px; }
.chart-line { stroke: var(--accent, #4f8cff); stroke-width: 2; }
/* fill-opacity, not opacity: opacity makes each chart its own compositing layer, and a page with
   eight of them hung the browser on scroll (2026-10-08). */
.chart-fill { fill: var(--accent, #4f8cff); fill-opacity: .12; }
.chart-dot { fill: var(--accent, #4f8cff); }
.chart-axis { fill: currentColor; opacity: .55; font-size: 10px; }

.chart-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1rem; margin-top: .5rem; }
.chart-cell .ig-subhead { margin: 0 0 .25rem; }
.chart-cell .chart { max-height: 130px; }

.ig-table a, .gtable a, .em-table a { color: var(--gold-bright); }
.ig-table a:hover { color: var(--gold); }
