:root {
  --bg: #071018;
  --bg-soft: #0d1724;
  --panel: rgba(17, 29, 43, 0.78);
  --panel-strong: rgba(23, 37, 54, 0.94);
  --line: rgba(148, 163, 184, 0.18);
  --text: #e5eef8;
  --muted: #8ea3b7;
  --green: #22c55e;
  --red: #ef4444;
  --blue: #38bdf8;
  --gold: #fbbf24;
  --violet: #a855f7;
  --orange: #fb923c;
  --radius: 22px;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 10% 0%, rgba(34, 197, 94, 0.16), transparent 30rem),
    radial-gradient(circle at 85% 10%, rgba(56, 189, 248, 0.14), transparent 28rem),
    linear-gradient(145deg, #05080d, var(--bg) 45%, #0b101d);
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
}

button,
input,
select,
textarea {
  font: inherit;
}

.app-shell {
  display: grid;
  grid-template-columns: 290px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 26px;
  border-right: 1px solid var(--line);
  background: rgba(5, 11, 18, 0.82);
  backdrop-filter: blur(22px);
}

.brand {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-bottom: 32px;
}

.brand-mark {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--green), var(--blue));
  color: #021018;
  font-weight: 900;
}

.brand small,
.muted,
.post-author span,
.footer,
.field-hint {
  color: var(--muted);
}

.nav {
  display: grid;
  gap: 8px;
}

.nav a,
.button,
.icon-button,
.profile-chip,
.post-actions a,
.post-actions button {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
}

.nav a {
  padding: 12px 14px;
}

.nav a.is-active,
.nav a:hover {
  border-color: rgba(56, 189, 248, 0.42);
  background: rgba(56, 189, 248, 0.12);
}

.sidebar-disclaimer {
  margin: 30px 0;
  padding: 16px;
  border: 1px solid rgba(251, 146, 60, 0.28);
  border-radius: 18px;
  background: rgba(251, 146, 60, 0.08);
}

.sidebar-disclaimer p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.sidebar-button {
  width: 100%;
  margin-top: 10px;
}

.main-shell {
  min-width: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  gap: 18px;
  align-items: center;
  justify-content: space-between;
  padding: 18px 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(7, 16, 24, 0.78);
  backdrop-filter: blur(22px);
}

.topbar-search {
  flex: 1;
  max-width: 720px;
}

.topbar-search input,
.form-control {
  width: 100%;
  padding: 13px 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  outline: none;
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.profile-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 12px 7px 7px;
}

.profile-chip img,
.post-author img,
.comment img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
}

.icon-button,
.button,
.post-actions a,
.post-actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 15px;
  cursor: pointer;
}

.icon-button b {
  display: grid;
  min-width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 999px;
  background: var(--red);
  font-size: 0.76rem;
}

.button-primary {
  border-color: transparent;
  background: linear-gradient(135deg, var(--green), var(--blue));
  color: #041018;
  font-weight: 800;
}

.button-ghost {
  background: rgba(255, 255, 255, 0.04);
}

.page-content {
  width: min(1180px, calc(100vw - 330px));
  margin: 0 auto;
  padding: 28px;
}

.hero-card,
.panel,
.post-card,
.metric-card,
.auth-card,
.profile-header,
.admin-table {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px);
}

.hero-card {
  display: flex;
  gap: 20px;
  align-items: center;
  justify-content: space-between;
  padding: 30px;
  margin-bottom: 22px;
}

.hero-card h1 {
  margin: 0 0 8px;
  font-size: clamp(2rem, 4vw, 4rem);
  letter-spacing: -0.06em;
}

.hero-card p {
  margin: 0;
  max-width: 720px;
  color: var(--muted);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--blue);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.grid {
  display: grid;
  gap: 16px;
}

.grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 20px;
  align-items: start;
}

.stack {
  display: grid;
  gap: 16px;
}

.panel,
.post-card,
.metric-card,
.auth-card {
  padding: 20px;
}

.metric-card span {
  display: block;
  color: var(--muted);
}

.metric-card strong {
  display: block;
  margin-top: 8px;
  font-size: 2rem;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.section-heading h2 {
  margin: 0;
}

.section-heading a {
  color: var(--blue);
}

.post-author {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
}

.post-body h3 {
  margin: 0 0 8px;
  font-size: 1.3rem;
}

.post-body p {
  margin: 0;
  color: #cfdae8;
  line-height: 1.58;
}

.post-meta,
.post-actions,
.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 14px;
}

.asset-pill,
.tag,
.bias-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.06);
  font-size: 0.86rem;
}

.asset-pill {
  color: var(--blue);
}

.bias-long {
  border-color: rgba(34, 197, 94, 0.38);
  color: var(--green);
}

.bias-short {
  border-color: rgba(239, 68, 68, 0.38);
  color: var(--red);
}

.bias-neutral {
  border-color: rgba(56, 189, 248, 0.32);
  color: var(--blue);
}

.tag-premium {
  color: var(--gold);
  border-color: rgba(251, 191, 36, 0.38);
}

.chart-preview {
  display: block;
  margin-top: 14px;
  overflow: hidden;
  border-radius: 18px;
  border: 1px solid var(--line);
}

.chart-preview img {
  width: 100%;
  max-height: 460px;
  object-fit: cover;
}

.post-actions form {
  margin: 0;
}

.post-actions button {
  border: 1px solid var(--line);
}

.form-grid {
  display: grid;
  gap: 14px;
}

.form-row {
  display: grid;
  gap: 8px;
}

.form-row label {
  font-weight: 700;
}

textarea.form-control {
  min-height: 140px;
  resize: vertical;
}

.auth-page {
  display: grid;
  min-height: calc(100vh - 180px);
  place-items: center;
}

.auth-card {
  width: min(520px, 100%);
}

.flash {
  padding: 14px 16px;
  border-radius: 16px;
  margin-bottom: 18px;
}

.flash-success {
  border: 1px solid rgba(34, 197, 94, 0.35);
  background: rgba(34, 197, 94, 0.12);
}

.flash-error {
  border: 1px solid rgba(239, 68, 68, 0.35);
  background: rgba(239, 68, 68, 0.12);
}

.empty-state {
  padding: 28px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  text-align: center;
}

.asset-row,
.notification-item {
  display: grid;
  gap: 4px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.notification-item.is-unread strong {
  color: var(--blue);
}

.profile-header {
  overflow: hidden;
  margin-bottom: 20px;
}

.profile-banner {
  min-height: 220px;
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.24), rgba(34, 197, 94, 0.12));
}

.profile-info {
  display: flex;
  gap: 18px;
  align-items: flex-end;
  padding: 0 24px 24px;
  margin-top: -48px;
}

.profile-info img {
  width: 104px;
  height: 104px;
  object-fit: cover;
  border: 4px solid var(--bg);
  border-radius: 30px;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
}

.admin-table th,
.admin-table td {
  padding: 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.sentiment-bar {
  display: grid;
  grid-template-columns: var(--long, 1fr) var(--short, 1fr) var(--neutral, 1fr);
  overflow: hidden;
  height: 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.sentiment-bar span:nth-child(1) {
  background: var(--green);
}

.sentiment-bar span:nth-child(2) {
  background: var(--red);
}

.sentiment-bar span:nth-child(3) {
  background: var(--blue);
}

.footer {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: center;
  padding: 26px;
  border-top: 1px solid var(--line);
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
  }

  .page-content {
    width: 100%;
  }

  .content-grid,
  .grid-2,
  .grid-3 {
    grid-template-columns: 1fr;
  }

  .topbar,
  .hero-card {
    align-items: stretch;
    flex-direction: column;
  }
}

