/* ══════════════════════════════════════════════════════════════════════════
   Market Brief dashboard
   ──────────────────────────────────────────────────────────────────────────
   The original Cadence-themed dashboard, now the only dashboard layout.
   Loaded only by templates/market_brief.html, so these rules never touch
   any other page.

   This is the CSS that used to live in style.css / theme.css and was only ever
   used by the old brief markup; it moved here when the brief was redesigned, so
   the shared stylesheets carry no view-specific rules. Colours are tokens from
   theme.css, same as everywhere else.
   ══════════════════════════════════════════════════════════════════════════ */

/* ── Layout & components (was style.css) ─────────────────────────────────── */

.risk-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 1rem 1.5rem .5rem;
  padding: .75rem 1.5rem;
  border: 2px solid;
  border-radius: 6px;
  background: var(--overlay);
}

.risk-label {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: .12em;
}

.risk-sub { font-size: .75rem; color: var(--muted); }

.headline-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: .75rem;
  margin: 1rem 1.5rem;
}

.headline-card {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: .9rem 1.1rem 1rem;
  transition: border-color .15s;
}

.headline-card:hover { border-color: var(--border); }

.headline-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: .5rem;
}

.headline-label {
  font-size: .75rem;
  font-weight: 600;
  color: var(--muted);
}

.headline-sym { font-weight: 400; color: var(--muted); opacity: .75; }

.headline-arrow {
  flex-shrink: 0;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .65rem;
  color: var(--muted);
}

.headline-arrow.pos { color: var(--pos); border-color: var(--pos-line); }

.headline-arrow.neg { color: var(--neg); border-color: var(--neg-line); }

.headline-price {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  margin-top: .5rem;
}

.headline-change { font-size: .8rem; margin-top: .25rem; font-weight: 500; }

.headline-change.pos { color: var(--pos); }

.headline-change.neg { color: var(--neg); }

.headline-change.neutral { color: var(--muted); }

.sanity-flag { color: var(--warn); cursor: help; font-size: .78em; }

.macro-panel,
.news-panel {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: .8rem 1rem;
}

.macro-table { width: 100%; border-collapse: collapse; font-size: .8rem; }

.macro-table tr { border-bottom: 1px solid var(--border); }

.macro-table tr:last-child { border-bottom: none; }

.macro-table td { padding: .35rem .1rem; }

.macro-table td:first-child { color: var(--text); }

.macro-table .val { text-align: right; font-weight: 500; color: var(--text); }

.news-item {
  padding: .5rem 0;
  border-bottom: 1px solid var(--border);
}

.news-item:last-child { border-bottom: none; }

.news-summary { font-size: .73rem; color: var(--muted); margin-top: .2rem; line-height: 1.4; }

.news-meta { font-size: .65rem; color: var(--muted); margin-top: .2rem; display: block; }

.news-empty { color: var(--muted); font-size: .78rem; padding: .5rem 0; font-style: italic; }

.news-empty.small { font-size: .7rem; margin-top: .4rem; }

.stocks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: .7rem;
}

.stock-card {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: .8rem 1rem;
  border-left: 3px solid var(--border);
  transition: border-color .15s;
}

.pos-card { border-left-color: var(--pos); }

.neg-card { border-left-color: var(--neg); }

.stock-card:hover { border-color: var(--accent); border-left-color: inherit; }

.stock-header {
  display: flex;
  align-items: baseline;
  gap: .6rem;
  margin-bottom: .4rem;
}

.stock-ticker { font-size: .95rem; font-weight: 700; color: var(--text); }

.stock-name { font-size: .7rem; color: var(--muted); }

.stock-price {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: .5rem;
  display: flex;
  align-items: baseline;
  gap: .5rem;
}

.stock-chg { font-size: .8rem; }

.risk-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: .6rem;
}

.risk-card {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: .7rem 1rem;
}

.risk-card-label { font-size: .68rem; color: var(--muted); margin-bottom: .3rem; letter-spacing: .05em; }

.risk-card-signal { font-size: .85rem; font-weight: 600; }

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 60vh;
  color: var(--muted);
  font-size: 1rem;
  gap: 1rem;
}

.movers-section { border-color: var(--border); }

.movers-list { list-style: none; display: flex; flex-direction: column; gap: .5rem; }

.mover-item {
  display: flex;
  align-items: baseline;
  gap: .6rem;
  padding: .5rem .6rem;
  background: var(--bg3);
  border-radius: 4px;
  border-left: 3px solid var(--border);
  flex-wrap: wrap;
}

.mover-item:has(.mover-bear) { border-left-color: var(--neg); }

.mover-item:has(.mover-bull) { border-left-color: var(--pos); }

.mover-badge {
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .06em;
  padding: .15rem .4rem;
  border-radius: 3px;
  white-space: nowrap;
  flex-shrink: 0;
}

.mover-bear { background: var(--neg-tint); color: var(--neg); }

.mover-bull { background: var(--pos-tint); color: var(--pos); }

.mover-score {
  font-size: .65rem;
  color: var(--muted);
  flex-shrink: 0;
  min-width: 1.2rem;
}

.mover-label { font-size: .78rem; font-weight: 700; flex-shrink: 0; white-space: nowrap; }

.mover-unexplained { color: var(--muted); font-weight: 400; font-style: italic; }

.mover-event { flex-direction: column; align-items: stretch; border-left-color: var(--warn); padding: .7rem .8rem; }

.mover-event .mover-title { font-size: 1rem; font-weight: 700; color: var(--text); }

.mover-event .mover-summary { padding-left: 0; width: 100%; margin-top: .2rem; }

.mover-affected { width: 100%; font-size: .68rem; color: var(--muted); margin-top: .5rem; }

.mover-affected-label { color: var(--muted); font-weight: 400; }

.mover-affected-item { font-weight: 500; }

.mover-affected-item.pos { color: var(--pos); }

.mover-affected-item.neg { color: var(--neg); }

.geo-subgroup { margin-bottom: 1.1rem; }

.geo-subgroup:last-child { margin-bottom: 0; }

.geo-subheading {
  font-size: .72rem;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: .1em;
  text-transform: uppercase;
  margin-bottom: .5rem;
  padding: .3rem 0 .3rem .6rem;
  border-left: 2px solid var(--gold);
}

.snapshot-row { margin-bottom: 1rem; }

.snapshot-row:last-child { margin-bottom: 0; }

.snapshot-row-label {
  font-size: .6rem;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: .1em;
  text-transform: uppercase;
  margin-bottom: .4rem;
}

.indices-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: .6rem;
}

.sectors-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: .5rem;
}

.sector-card {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: .6rem .75rem;
  border-left: 3px solid var(--border);
}

.sector-card.pos-card { border-left-color: var(--pos); }

.sector-card.neg-card { border-left-color: var(--neg); }

.sector-ticker { font-size: .78rem; font-weight: 700; color: var(--text); }

.sector-chg { font-size: .9rem;  font-weight: 600; }

.sector-summary {
  font-size: .72rem;
  color: var(--muted);
  margin-top: .65rem;
  padding-top: .5rem;
  border-top: 1px solid var(--border);
}

.macro-table .val-change {
  text-align: right;
  font-size: .72rem;
  min-width: 5rem;
  padding-left: .5rem;
}


/* ── Cadence theme layer (was theme.css) ─────────────────────────────────── */

body.theme-nova .headline-card { border-radius: var(--radius-lg); padding: 1.45rem 1.55rem; }
body.theme-nova .headline-arrow {
  border: none;
  background: var(--bg2);
}
body.theme-nova .headline-arrow.pos { background: var(--pos-tint); color: var(--pos); }
body.theme-nova .headline-arrow.neg { background: var(--neg-tint); color: var(--neg); }
body.theme-nova .headline-price { font-size: 1.6rem; }
body.theme-nova .headline-change {
  display: inline-block;
  padding: .15rem .55rem;
  border-radius: var(--radius-pill);
  font-size: .74rem;
  font-weight: 600;
}
body.theme-nova .headline-change.pos { background: var(--pos-tint); color: var(--pos); }
body.theme-nova .headline-change.neg { background: var(--neg-tint); color: var(--neg); }
body.theme-nova .headline-change.neutral { background: var(--bg2); color: var(--muted); }

/* Risk banner → status chip */
body.theme-nova .risk-banner {
  border-radius: var(--radius-pill);
  border-width: 1px;
  background: var(--bg2);
  box-shadow: var(--shadow-2);
}
body.theme-nova .risk-label { letter-spacing: .08em; }
body.theme-nova .risk-banner.risk_on { color: var(--pos); border-color: var(--pos-line); }
body.theme-nova .risk-banner.risk_off { color: var(--neg); border-color: var(--neg-line); }
body.theme-nova .risk-banner.rotation { color: var(--warn); border-color: var(--warn-line); }

body.theme-nova .macro-panel,
body.theme-nova .news-panel { border-radius: var(--radius-md); }

body.theme-nova .stock-card,
body.theme-nova .sector-card,
body.theme-nova .risk-card {
  border-radius: var(--radius-sm);
  border-left-width: 3px;
}
body.theme-nova .sector-chg,
body.theme-nova .stock-chg {
  display: inline-block;
  padding: .1rem .5rem;
  border-radius: var(--radius-pill);
  font-weight: 600;
}
body.theme-nova .sector-chg.pos, body.theme-nova .stock-chg.pos { background: var(--pos-tint); color: var(--pos); }
body.theme-nova .sector-chg.neg, body.theme-nova .stock-chg.neg { background: var(--neg-tint); color: var(--neg); }

body.theme-nova .mover-item { border-radius: var(--radius-sm); }

body.theme-nova .section-icon {
  display: inline-flex;
  width: 42px;
  height: 42px;
  align-items: center;
  justify-content: center;
  flex: 0 0 42px;
  border-radius: var(--radius-md);
  background: var(--accent-tint);
  color: var(--accent);
}
body.theme-nova .section-icon .nav-icon-svg { width: 21px; height: 21px; opacity: 1; }

body.theme-nova .headline-price { font-variant-numeric: tabular-nums; }

/* Change chips get the same pill + leading dot treatment as the rest of the app. */
body.theme-nova .headline-change,
body.theme-nova .sector-chg,
body.theme-nova .stock-chg {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  border-radius: var(--radius-pill);
}
body.theme-nova .headline-change::before,
body.theme-nova .sector-chg::before,
body.theme-nova .stock-chg::before {
  width: 6px;
  height: 6px;
  flex: 0 0 6px;
  border-radius: var(--radius-pill);
  background: currentColor;
  content: "";
}

@media (max-width: 768px) {
  body.theme-nova .headline-grid { grid-template-columns: 1fr !important; }
}
