:root {
  --bg-solid: #09090b;
  --card-bg: #121214;
  --card-border: #27272a;
  --card-hover-border: #3f3f46;
  --text-primary: #fafafa;
  --text-secondary: #a1a1aa;
  
  --bullish: #10b981;
  --bearish: #f43f5e;
  --neutral: #f59e0b;
  --cyan: #06b6d4;
  --card-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.5);
}

body {
  margin: 0;
  padding: 0;
  font-family: 'Outfit', 'Inter', -apple-system, sans-serif;
  background: var(--bg-solid);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

.background-blobs {
  display: none;
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.35;
  animation: float 22s infinite ease-in-out alternate;
}

.blob-1 { top: -15%; left: -10%; width: 50vw; height: 50vw; background: #0284c7; }
.blob-2 { bottom: -15%; right: -10%; width: 55vw; height: 55vw; background: #059669; animation-delay: -7s; }

@keyframes float {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(30px, 30px) scale(1.05); }
}

header {
  padding: 1.2rem 6%;
  border-bottom: 1px solid var(--card-border);
  background: rgba(9, 9, 11, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
}

.logo-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-badge {
  background: rgba(6, 182, 212, 0.12);
  color: var(--cyan);
  border: 1px solid rgba(6, 182, 212, 0.3);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  letter-spacing: 1px;
}

h1.logo-title {
  margin: 0;
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, #ffffff 0%, #cbd5e1 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.btn-export {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--card-border);
  padding: 9px 20px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-export:hover {
  background: #27272a;
  border-color: var(--card-hover-border);
}

.btn-pdf {
  background: #fafafa;
  color: #09090b;
  border: none;
  padding: 9px 20px;
  border-radius: 6px;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-pdf:hover {
  background: #e4e4e7;
}

.container {
  padding: 2.2rem 6%;
  flex: 1;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.glass-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 1.6rem;
  box-shadow: var(--card-shadow);
  transition: all 0.2s ease;
  box-sizing: border-box;
}

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

.card-title {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 0;
  margin-bottom: 1.2rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.2px;
}

.metric-value {
  font-size: 2.4rem;
  font-weight: 800;
  margin: 0;
  letter-spacing: -1px;
}

.sentiment-badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 18px;
  border-radius: 20px;
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: 1px;
}

.sentiment-badge.BULLISH { background: rgba(16, 185, 129, 0.15); color: var(--bullish); border: 1px solid rgba(16, 185, 129, 0.4); }
.sentiment-badge.BEARISH { background: rgba(244, 63, 94, 0.15); color: var(--bearish); border: 1px solid rgba(244, 63, 94, 0.4); }
.sentiment-badge.NEUTRAL { background: rgba(245, 158, 11, 0.15); color: var(--neutral); border: 1px solid rgba(245, 158, 11, 0.4); }

.charts-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
}

@media(min-width: 992px) {
  .charts-grid { grid-template-columns: 1fr 1.4fr; }
}

.chart-container {
  position: relative;
  height: 280px;
  width: 100%;
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.data-table th {
  padding: 14px 16px;
  color: var(--text-secondary);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.data-table td {
  padding: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  font-size: 0.92rem;
}

.ticker-symbol {
  font-weight: 800;
  font-size: 1.05rem;
  color: #ffffff;
}

.signal-pill {
  padding: 4px 12px;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 700;
  display: inline-block;
  letter-spacing: 0.5px;
}

.signal-BUY { background: rgba(16, 185, 129, 0.15); color: var(--bullish); border: 1px solid rgba(16, 185, 129, 0.3); }
.signal-SELL, .signal-REDUCE { background: rgba(244, 63, 94, 0.15); color: var(--bearish); border: 1px solid rgba(244, 63, 94, 0.3); }
.signal-HOLD { background: rgba(245, 158, 11, 0.15); color: var(--neutral); border: 1px solid rgba(245, 158, 11, 0.3); }
.signal-WATCH { background: rgba(6, 182, 212, 0.15); color: var(--cyan); border: 1px solid rgba(6, 182, 212, 0.3); }

.user-info-text {
  font-size: 0.85rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-highlight {
  color: var(--cyan);
  font-weight: 700;
}

.logout-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.82rem;
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.2s;
}

.logout-link:hover {
  color: white;
  border-color: rgba(255, 255, 255, 0.3);
}

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

.rec-box {
  background: rgba(0, 0, 0, 0.25);
  border-radius: 14px;
  padding: 1.2rem;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.rec-title {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 10px;
}

/* ==========================================================================
   STRICT INSTITUTIONAL PDF REPORT STYLES (Light Paper Layout)
   ========================================================================== */
#pdf-template-container {
  display: none;
  background: #ffffff;
  color: #0f172a;
  padding: 40px;
  font-family: 'Inter', Arial, sans-serif;
  width: 800px;
  box-sizing: border-box;
}

.pdf-header {
  border-bottom: 3px solid #0f172a;
  padding-bottom: 20px;
  margin-bottom: 30px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}

.pdf-title {
  font-size: 22px;
  font-weight: 800;
  color: #0f172a;
  margin: 0 0 6px 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.pdf-subtitle {
  font-size: 13px;
  color: #475569;
  margin: 0;
  font-weight: 500;
}

.pdf-meta {
  text-align: right;
  font-size: 11px;
  color: #64748b;
  line-height: 1.6;
}

.pdf-section-title {
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
  text-transform: uppercase;
  letter-spacing: 1px;
  border-bottom: 1.5px solid #cbd5e1;
  padding-bottom: 6px;
  margin: 25px 0 15px 0;
}

.pdf-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 15px;
  margin-bottom: 25px;
}

.pdf-kpi-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 12px;
  text-align: center;
}

.pdf-kpi-label {
  font-size: 10px;
  color: #64748b;
  font-weight: 600;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.pdf-kpi-val {
  font-size: 20px;
  font-weight: 800;
  color: #0f172a;
}

.pdf-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
}

.pdf-table th {
  background: #0f172a;
  color: #ffffff;
  padding: 10px 12px;
  font-size: 11px;
  text-transform: uppercase;
  text-align: left;
}

.pdf-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #e2e8f0;
  font-size: 12px;
  color: #1e293b;
}

.pdf-badge-buy { background: #d1fae5; color: #047857; padding: 3px 8px; border-radius: 4px; font-weight: 700; font-size: 10px; }
.pdf-badge-sell { background: #ffe4e6; color: #be123c; padding: 3px 8px; border-radius: 4px; font-weight: 700; font-size: 10px; }
.pdf-badge-hold { background: #fef3c7; color: #b45309; padding: 3px 8px; border-radius: 4px; font-weight: 700; font-size: 10px; }
.pdf-badge-watch { background: #e0f2fe; color: #0369a1; padding: 3px 8px; border-radius: 4px; font-weight: 700; font-size: 10px; }

.pdf-proposals-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 15px;
  margin-bottom: 20px;
}

.pdf-prop-card {
  border-radius: 8px;
  padding: 14px;
  border: 1px solid #e2e8f0;
}

.pdf-prop-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.pdf-footer {
  margin-top: 40px;
  border-top: 1px solid #cbd5e1;
  padding-top: 12px;
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: #94a3b8;
}
