/**
 * CycleForge Two — shared UI components (ported from CF1 portal.css + scorecard tokens)
 * Use with shell.css for top-down layout: sidebar → topbar → title band → content
 */

/* ── Title band (CF1 cf-page-title-band) ───────────────── */
.cf2-title-band {
  flex-shrink: 0;
  min-height: var(--title-band-h, 52px);
  display: flex;
  align-items: center;
  padding: 10px var(--page-pad-x);
  border-bottom: 1px solid var(--border);
  background: var(--surface2);
}

.cf2-title-band__inner { width: 100%; max-width: var(--content-max-w); }

.cf2-title-main {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--muted2);
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.cf2-title-accent {
  font-size: 1.45rem;
  font-weight: 800;
  color: #f3f4f6;
  margin-left: 0.12em;
}

.cf2-title-sub {
  margin: 4px 0 0;
  font-size: var(--font-sm);
  color: var(--muted);
  line-height: 1.45;
  max-width: 52rem;
}

/* ── Top bar (batch meta + actions) ────────────────────── */
.cf2-topbar {
  flex-shrink: 0;
  height: var(--topbar-h, 48px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 var(--page-pad-x);
  border-bottom: 1px solid var(--border);
  background: rgba(11, 15, 20, 0.92);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 30;
}

.cf2-topbar-meta {
  font-size: var(--font-xs);
  color: var(--muted);
  font-family: "JetBrains Mono", ui-monospace, monospace;
}

.cf2-topbar-meta strong { color: var(--text); font-weight: 600; }

.cf2-topbar-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ── Content regions ───────────────────────────────────── */
.cf2-content {
  flex: 1;
  padding: 16px var(--page-pad-x) 32px;
  max-width: calc(var(--content-max-w) + var(--page-pad-x) * 2);
  min-width: 0;
}

.cf2-content--flush { padding-top: 12px; }

/* ── Section labels (CF1 cf-section-label) ─────────────── */
.cf2-section-label {
  font-size: var(--font-sm);
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #cbd5e1;
}

.cf2-subsection-label {
  font-size: var(--font-xs);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted2);
}

/* ── Cards & panels ────────────────────────────────────── */
.cf2-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
}

.cf2-panel--scroll {
  min-height: 120px;
  max-height: 100%;
  overflow: auto;
}

.cf2-summary-bar {
  margin-bottom: 16px;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  font-size: 13px;
  color: var(--muted2);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 20px;
}

/* ── Buttons ───────────────────────────────────────────── */
.cf2-btn {
  font-size: var(--font-xs);
  font-weight: 600;
  padding: 7px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--border);
  color: var(--text);
  cursor: pointer;
  transition: background 0.12s ease;
}
.cf2-btn:hover { background: #2A3749; }
.cf2-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.cf2-btn--accent {
  background: #059669;
  border-color: #059669;
  color: #fff;
}
.cf2-btn--accent:hover { background: #10b981; }

.cf2-btn--ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--muted2);
}

/* ── Badges ────────────────────────────────────────────── */
.cf2-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 999px;
}

.cf2-badge--warn {
  background: rgba(251, 191, 36, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(251, 191, 36, 0.35);
}

.cf2-badge--sentence {
  text-transform: none;
  letter-spacing: 0.02em;
  font-weight: 600;
}

.cf2-badge--muted {
  background: var(--border);
  color: var(--muted2);
  border: 1px solid #2a3749;
}

/* ── Decision pills (CF1 rec-buy/sell/hold) ────────────── */
.cf2-rec {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 3.2em;
  padding: 3px 10px;
  border-radius: 6px;
  font-size: var(--font-xs);
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.cf2-rec--buy { background: rgba(52,211,153,.15); color: #34d399; border: 1px solid rgba(52,211,153,.35); }
.cf2-rec--sell { background: rgba(248,113,113,.15); color: #f87171; border: 1px solid rgba(248,113,113,.35); }
.cf2-rec--hold { background: rgba(251,191,36,.12); color: #fbbf24; border: 1px solid rgba(251,191,36,.3); }
.cf2-rec--neutral { background: var(--border); color: var(--muted2); border: 1px solid #2a3749; }

.cf2-pos { color: #34d399; }
.cf2-neg { color: #f87171; }

.cf2-mono { font-family: "JetBrains Mono", ui-monospace, monospace; }

/* ── Data tables (CF1 portal-data-table) ───────────────── */
.cf2-table-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow-x: auto;
}

.cf2-table {
  width: 100%;
  min-width: 900px;
  border-collapse: collapse;
  font-size: 13px;
}

.cf2-table thead tr {
  background: var(--surface2);
  border-bottom: 1px solid var(--border);
}

.cf2-table th {
  padding: 12px 14px;
  text-align: left;
  font-size: var(--font-xs);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted2);
}

.cf2-table th.cf2-sortable {
  cursor: pointer;
  user-select: none;
}
.cf2-table th.cf2-sortable:hover { color: var(--text); }
.cf2-table th.cf2-sort-on { color: var(--text); }
.cf2-sort-ind {
  display: inline-block;
  margin-left: 4px;
  font-size: 10px;
  opacity: 0.45;
  vertical-align: middle;
  text-transform: none;
  letter-spacing: 0;
}
.cf2-table th.cf2-sort-on .cf2-sort-ind {
  opacity: 1;
  color: var(--accent);
}

.cf2-table td {
  padding: 11px 14px;
  line-height: 1.45;
  border-bottom: 1px solid var(--border);
}

.cf2-table th.cf2-center,
.cf2-table td.cf2-center { text-align: center; }

.cf2-table tbody tr:hover { background: rgba(255,255,255,0.02); }
.cf2-table tbody tr:last-child td { border-bottom: none; }

.cf2-table .cf2-sym-cell {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-weight: 700;
  font-size: var(--font-sm);
}

.cf2-table a {
  color: var(--accent-blue);
  text-decoration: none;
  font-weight: 600;
}
.cf2-table a:hover { text-decoration: underline; }

.cf2-table .cf2-rationale {
  color: var(--muted2);
  font-size: 12px;
  max-width: 28rem;
}

.cf2-decision-cell {
  vertical-align: middle;
}
.cf2-row-flags {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  justify-content: center;
  margin-top: 4px;
  max-width: 6.5rem;
}
.cf2-row-flags .cf2-badge {
  font-size: 8px;
  padding: 1px 5px;
  letter-spacing: 0.02em;
  line-height: 1.3;
}

.cf2-rationale-cell {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-start;
}
.cf2-rationale-price {
  font-size: 11px;
  white-space: nowrap;
}
.cf2-wl-price { color: var(--text); }

/* ── Grid layouts ──────────────────────────────────────── */
.cf2-grid-2 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}
@media (min-width: 960px) {
  .cf2-grid-2 { grid-template-columns: 1fr 1fr; }
}

.cf2-grid-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
}

.cf2-tile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s ease;
}
.cf2-tile:hover { border-color: #475569; }
.cf2-tile strong { display: block; font-size: 14px; margin-bottom: 4px; }
.cf2-tile span { font-size: 12px; color: var(--muted); }

/* ── Quadrant chips (asset report H widget) ────────────── */
.cf2-quad {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.cf2-quad-chip {
  border-radius: 5px;
  padding: 5px 10px;
  font-size: 10px;
  font-weight: 700;
  text-align: center;
  min-width: 76px;
  line-height: 1.2;
  background: #1a2330;
  color: var(--muted);
  border: 1px solid #2a3749;
}

.cf2-quad-chip.cf2-quad--pos {
  background: rgba(52, 211, 153, 0.28);
  color: #6ee7b7;
  border-color: rgba(52, 211, 153, 0.55);
  box-shadow: inset 0 0 12px rgba(52, 211, 153, 0.12);
}

.cf2-quad-chip.cf2-quad--neg {
  background: rgba(248, 113, 113, 0.28);
  color: #fca5a5;
  border-color: rgba(248, 113, 113, 0.55);
}

.cf2-quad-chip.cf2-quad--mid {
  background: rgba(251, 191, 36, 0.22);
  color: #fcd34d;
  border-color: rgba(251, 191, 36, 0.5);
}

.cf2-quad-chip .cf2-quad-v { display: block; font-size: 11px; margin-top: 2px; }

/* ── Timeframe tabs ────────────────────────────────────── */
.cf2-tf {
  font-size: 11px;
  padding: 5px 11px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  color: var(--text);
  background: var(--border);
}
.cf2-tf.is-on { background: #1e3a5f; color: #7dd3fc; }

/* ── Lists (sentiment feed) ────────────────────────────── */
.cf2-feed-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.cf2-feed-list li {
  padding: 6px 0;
  border-bottom: 1px solid rgba(31, 42, 55, 0.7);
  font-size: 12px;
  color: var(--muted2);
  line-height: 1.45;
}
.cf2-feed-list li:last-child { border-bottom: none; }

/* ── Empty / placeholder states ────────────────────────── */
.cf2-empty {
  color: var(--muted);
  font-size: 13px;
  padding: 32px 16px;
  text-align: center;
}

.cf2-empty-box {
  background: var(--surface);
  border: 1px dashed #2a3749;
  border-radius: var(--radius-lg);
  padding: 40px 24px;
  text-align: center;
  color: var(--muted);
}

.cf2-empty-box h3 {
  font-size: 15px;
  color: var(--muted2);
  margin-bottom: 8px;
}

/* ── Login ─────────────────────────────────────────────── */
.cf2-login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.cf2-login-card {
  width: 100%;
  max-width: 380px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
}

.cf2-login-card h1 { font-size: 20px; margin-bottom: 6px; }
.cf2-login-card p { color: var(--muted2); font-size: 13px; margin-bottom: 20px; }

.cf2-field { display: block; width: 100%; margin-bottom: 12px; }
.cf2-field label {
  display: block;
  font-size: var(--font-xs);
  color: var(--muted);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.cf2-field input {
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
}

.cf2-login-error {
  color: #f87171;
  font-size: 13px;
  margin-bottom: 12px;
  min-height: 18px;
}

/* ── Insights filters (deferred page layout) ───────────── */
.cf2-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
  margin-bottom: 16px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.cf2-filters label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: var(--font-xs);
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.cf2-filters input,
.cf2-filters select {
  padding: 7px 10px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 13px;
  min-width: 100px;
}

.cf2-code {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 11px;
  background: var(--bg);
  padding: 2px 6px;
  border-radius: 4px;
}
