/* ========================================================
   CITRINE V2 • ANALITIK & INSIGHT CORPUS
   ======================================================== */
.analytics-view-container {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
  gap: 10px;
  overflow-y: auto;
  overflow-x: hidden;
  height: calc(100vh - 128px);
  padding-right: 4px;
}
.an-card {
  background: var(--card-bg, #161617);
  border: 1px solid var(--card-border, #2a2a2d);
  border-radius: 8px;
  padding: 12px 14px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  min-width: 0;
}
.an-card-title {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-white, #f8fafc);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 10px;
}
.an-card-title .an-sub {
  margin-left: auto;
  font-size: 10px;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
  color: var(--text-muted, #57708c);
}

/* toolbar */
.an-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.an-toolbar-title { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; color: var(--text-white); margin-right: auto; }
.an-input, .an-select {
  background: var(--card-elevated, #1e1e20);
  border: 1px solid var(--card-border, #2a2a2d);
  color: var(--text-main, #e2ecf8);
  border-radius: 6px;
  padding: 6px 9px;
  font-size: 12px;
  font-family: inherit;
  outline: none;
}
.an-input { width: 190px; }
.an-input:focus, .an-select:focus { border-color: var(--accent-blue, #29a9ff); }
.an-btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(41, 169, 255, 0.12);
  border: 1px solid rgba(41, 169, 255, 0.35);
  color: var(--accent-blue, #29a9ff);
  border-radius: 6px;
  padding: 6px 11px;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
}
.an-btn:hover { background: rgba(41, 169, 255, 0.2); }
.an-btn.ghost { background: transparent; border-color: var(--card-border); color: var(--text-sec); }
.an-meta { width: 100%; font-size: 10.5px; color: var(--text-muted); font-family: var(--font-mono, monospace); }

/* KPI tiles */
.an-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.an-kpi { background: var(--card-bg); border: 1px solid var(--card-border); border-radius: 8px; padding: 10px 12px; }
.an-kpi-label { font-size: 10px; font-weight: 600; color: var(--text-sec); text-transform: uppercase; letter-spacing: 0.3px; }
.an-kpi-value { font-family: var(--font-mono, monospace); font-size: 20px; font-weight: 700; color: var(--text-white); margin-top: 4px; }
.an-kpi-foot { font-size: 10.5px; color: var(--text-muted); margin-top: 2px; }
.an-pos { color: #10b981 !important; }
.an-neg { color: #ef4444 !important; }
.an-neu { color: #94a3b8 !important; }

/* grids */
.an-grid-2 { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 10px; }
.an-grid-2-even { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.an-grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 1100px) {
  .an-grid-2, .an-grid-2-even, .an-grid-3 { grid-template-columns: minmax(0, 1fr); }
}

/* conclusion */
.an-conclusion { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.an-conclusion li {
  font-size: 12.5px; line-height: 1.55; color: var(--text-main);
  padding-left: 14px; position: relative;
}
.an-conclusion li::before {
  content: ""; position: absolute; left: 0; top: 8px; width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent-blue, #29a9ff);
}

/* charts */
.an-chart-box { position: relative; height: 220px; }
.an-chart-box.tall { height: 420px; }
.an-chart-box.short { height: 180px; }

/* trending list */
.an-trend-list { display: flex; flex-direction: column; gap: 6px; }
.an-trend-item {
  background: var(--card-elevated); border: 1px solid var(--card-border-subtle, #232326);
  border-radius: 6px; padding: 8px 10px; cursor: pointer;
}
.an-trend-item:hover { border-color: rgba(255, 255, 255, 0.18); }
.an-trend-top { display: flex; align-items: center; gap: 8px; }
.an-trend-rank { font-family: var(--font-mono); font-size: 10.5px; color: var(--text-muted); width: 18px; }
.an-trend-term { font-size: 13px; font-weight: 700; color: var(--text-white); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.an-badge { font-size: 9.5px; font-weight: 700; padding: 2px 6px; border-radius: 4px; white-space: nowrap; }
.an-badge.new { background: rgba(239, 68, 68, 0.15); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.35); }
.an-badge.up { background: rgba(245, 158, 11, 0.13); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.35); }
.an-badge.count { background: rgba(148, 163, 184, 0.12); color: #cbd5e1; }
.an-sbar { display: flex; height: 5px; border-radius: 3px; overflow: hidden; margin-top: 6px; background: rgba(148, 163, 184, 0.15); }
.an-sbar span { display: block; height: 100%; }
.an-trend-meta { display: flex; gap: 10px; margin-top: 5px; font-size: 10.5px; color: var(--text-muted); flex-wrap: wrap; }
.an-samples { display: none; margin-top: 8px; flex-direction: column; gap: 6px; }
.an-trend-item.open .an-samples { display: flex; }
.an-sample { border-left: 2px solid var(--card-border); padding: 3px 0 3px 8px; font-size: 11.5px; color: var(--text-sec); line-height: 1.45; }
.an-sample b { color: var(--text-main); font-weight: 600; }
.an-sample.POSITIF { border-left-color: #10b981; }
.an-sample.NEGATIF { border-left-color: #ef4444; }

/* chips & tables */
.an-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.an-chip {
  font-size: 11px; padding: 3px 8px; border-radius: 12px; cursor: pointer;
  background: var(--card-elevated); border: 1px solid var(--card-border-subtle); color: var(--text-main);
}
.an-chip em { font-style: normal; color: var(--text-muted); margin-left: 4px; font-family: var(--font-mono); font-size: 10px; }
.an-chip:hover { border-color: var(--accent-blue); }
.an-table { width: 100%; border-collapse: collapse; font-size: 11.5px; }
.an-table td { padding: 5px 4px; border-bottom: 1px solid var(--card-border-subtle); color: var(--text-main); }
.an-table td.num { text-align: right; font-family: var(--font-mono); color: var(--text-sec); }
.an-empty { font-size: 12px; color: var(--text-muted); padding: 10px 0; }
.an-loading { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--text-sec); padding: 30px; justify-content: center; }
.an-spin { width: 16px; height: 16px; border: 2px solid rgba(41, 169, 255, 0.25); border-top-color: var(--accent-blue); border-radius: 50%; animation: an-spin 0.8s linear infinite; }
@keyframes an-spin { to { transform: rotate(360deg); } }
.an-neg-list { display: flex; flex-direction: column; gap: 8px; max-height: 360px; overflow-y: auto; }
