@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&display=swap');

* { box-sizing: border-box; }
body {
  background: #020817;
  font-family: 'Outfit', sans-serif;
  color: #fff;
  margin: 0;
  padding: 30px;
}
a { color: #00e59b; }
.hidden { display: none !important; }

/* ---------- Auth screen ---------- */
.auth-wrap { max-width: 420px; margin: 8vh auto; }
.auth-card { background: #0b1630; padding: 40px; border-radius: 20px; }
.auth-card .logo { color: #00e59b; font-size: 40px; font-weight: 700; margin-bottom: 24px; }
.auth-card input {
  width: 100%; padding: 16px; border: none; border-radius: 10px;
  background: #1e293b; color: #fff; margin-bottom: 14px; font-family: inherit; font-size: 15px;
}
.auth-card button {
  background: #00d084; color: #000; border: none; padding: 14px 28px;
  border-radius: 10px; font-weight: 600; cursor: pointer; font-family: inherit; font-size: 15px;
}
.auth-card button.secondary { background: #1e293b; color: #fff; margin-left: 8px; }
.auth-msg { color: #f87171; margin-top: 14px; min-height: 18px; }
.toggle-link { color: #94a3b8; margin-top: 20px; font-size: 14px; }

/* ---------- Layout ---------- */
.dashboard-wrapper { display: flex; gap: 30px; }
.sidebar { width: 250px; background: #08111f; padding: 30px; border-radius: 20px; }
.sidebar .logo { color: #00e59b; font-size: 40px; font-weight: 700; margin-bottom: 40px; }
.sidebar ul { list-style: none; padding: 0; margin: 0; }
.sidebar li { padding: 0; margin-bottom: 10px; border-radius: 10px; }
.sidebar li a { display: block; padding: 15px; border-radius: 10px; color: #fff; text-decoration: none; }
.sidebar li a:hover { background: #0f1e38; }
.sidebar li.active a { background: #00d084; color: #000; }
.sidebar .signout { color: #94a3b8; font-size: 14px; margin-top: 30px; cursor: pointer; }

.main-content { flex: 1; }
.main-content h1 { font-weight: 700; }
.dashboard-card { background: #0b1630; padding: 30px; border-radius: 20px; margin-bottom: 30px; }
.dashboard-card h2 { margin-top: 0; }

.keyword-input {
  width: 100%; padding: 18px; border: none; border-radius: 10px;
  background: #1e293b; color: #fff; font-family: inherit; font-size: 16px;
}
.keyword-input + .keyword-input { margin-top: 12px; }
.create-btn {
  margin-top: 20px; background: #00d084; color: #000; border: none;
  padding: 15px 30px; border-radius: 10px; font-weight: 600; cursor: pointer; font-family: inherit; font-size: 15px;
}
.create-btn:disabled { opacity: .5; cursor: default; }

.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-bottom: 30px; }
.stat-card { background: #0b1630; padding: 30px; border-radius: 20px; }
.stat-card h3 { margin: 0 0 6px; font-weight: 500; color: #cbd5e1; }
.stat-card h2 { color: #00e59b; font-size: 45px; margin: 0; }
/* Per-metric colours matching the Analytics charts (sentiment doughnut + source palette). */
.stat-card.c-positive h2 { color: #00d084; }
.stat-card.c-negative h2 { color: #ef4444; }
.stat-card.c-reach h2 { color: #0693e3; }
/* semantic colors for sentiment / reach cards */
#statPos, #anPos { color: #00d084; }   /* positive — green */
#statNeg, #anNeg { color: #ef4444; }   /* negative — red */
#statReach, #anReach { color: #0693e3; } /* reach — blue */

.news-item { border-bottom: 1px solid #1e293b; padding: 15px 0; }
.news-item a { color: #00e59b; text-decoration: none; font-size: 18px; }
.news-item .src { display: inline-block; font-size: 11px; background: #00251a; color: #00e59b; padding: 2px 8px; border-radius: 6px; margin-right: 8px; }
.news-item p { color: #94a3b8; margin: 6px 0 0; }
.chip { display: inline-block; font-size: 11px; padding: 2px 8px; border-radius: 6px; margin-right: 8px; }
.muted { color: #64748b; font-size: 13px; }

/* charts */
.chart-box { position: relative; height: 300px; }
.charts-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; }
@media (max-width: 820px){ .charts-2col { grid-template-columns: 1fr; } }

/* Mentions page: articles on the left, platform filter panel on the right */
.mentions-layout { display: flex; gap: 24px; align-items: flex-start; }
.mentions-main { flex: 1; min-width: 0; }
.mentions-aside { flex: 0 0 200px; width: 200px; position: sticky; top: 20px; }

/* Platform/source filter checkboxes — stacked vertically in the right panel */
.source-filter { display: flex; flex-direction: column; gap: 10px;
  background: #0f172a; border: 1px solid #1e293b; border-radius: 10px; padding: 14px; }
.source-filter:empty { display: none; }
.src-check { display: flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
.src-check input { cursor: pointer; }
.src-all { padding-bottom: 8px; border-bottom: 1px solid #1e293b; }

@media (max-width: 820px){
  .mentions-layout { flex-direction: column-reverse; }
  .mentions-aside { position: static; flex: none; width: auto; }
  .source-filter { flex-flow: row wrap; gap: 8px 16px; }
}

.region-filters { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 10px; }
.region-filters select:disabled { opacity: .5; }
@media (max-width: 820px){ .region-filters { grid-template-columns: 1fr 1fr; } }

/* Regional page: results on the left, filter panel on the right. */
.regional-layout { display: flex; gap: 24px; align-items: flex-start; }
.regional-main { flex: 1; min-width: 0; }
.regional-aside { flex: 0 0 300px; width: 300px; position: sticky; top: 20px; }
.regional-aside .region-filters { grid-template-columns: 1fr; } /* stack vertically */
.region-filters label { display: block; font-size: 13px; color: #94a3b8; }
.region-filters label .keyword-input { margin-top: 4px; padding: 12px; font-size: 14px; }
@media (max-width: 900px){
  .regional-layout { flex-direction: column-reverse; }
  .regional-aside { position: static; flex: none; width: auto; }
  .regional-aside .region-filters { grid-template-columns: 1fr 1fr; }
}

/* keyword manager rows */
.kw-block { padding: 6px 0 14px; border-bottom: 1px solid #1e293b; margin-bottom: 10px; }
.kw-block:last-child { border-bottom: none; margin-bottom: 0; }
.kw-block .kw-row { border-bottom: none; padding-bottom: 0; }
.kw-aliases { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.alias-label { font-size: 13px; }
.alias-chip { display: inline-flex; align-items: center; gap: 6px; background: #1e293b; color: #cbd5e1; padding: 5px 10px; border-radius: 14px; font-size: 13px; }
.alias-chip button { background: none; border: none; color: #94a3b8; cursor: pointer; font-size: 15px; line-height: 1; padding: 0; }
.alias-chip button:hover { color: #f87171; }
.alias-input { background: #1e293b; border: none; border-radius: 14px; padding: 7px 12px; color: #fff; font-family: inherit; font-size: 13px; min-width: 170px; }
.kw-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid #1e293b; }
.kw-edit { flex: 1; padding: 12px; border: none; border-radius: 8px; background: #1e293b; color: #fff; font-family: inherit; font-size: 15px; }
.kw-count { white-space: nowrap; }
button.mini { background: #00d084; color: #000; border: none; padding: 9px 16px; border-radius: 8px; font-weight: 600; cursor: pointer; font-family: inherit; font-size: 13px; margin: 4px 0; }
button.mini.danger { background: #1e293b; color: #f87171; }
button.mini:disabled { background: #1e293b; color: #64748b; cursor: not-allowed; }
.pagination { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 16px; }
button.mini.page-num { min-width: 38px; padding: 9px 12px; background: #1e293b; color: #cbd5e1; }
button.mini.page-num.active { background: #00d084; color: #000; }
.page-gap { padding: 0 2px; }

/* ---------- Monitor page (Brand24-style 3-column) ---------- */
.mon-topbar { display: flex; gap: 14px; margin-bottom: 24px; }
.mon-topbar .keyword-input { margin: 0; }
#monKeyword { flex: 0 0 260px; }
#monSearch { flex: 1; }
.mon-grid { display: grid; grid-template-columns: 1fr 320px; gap: 24px; align-items: start; }
.mon-center { min-width: 0; }
.mon-filters .dashboard-card { position: sticky; top: 20px; }
.mon-chart-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.mon-tabs { display: flex; gap: 8px; }
.mon-tab { background: #1e293b; color: #cbd5e1; border: none; padding: 8px 14px; border-radius: 8px; font-family: inherit; font-weight: 600; font-size: 13px; cursor: pointer; }
.mon-tab.active { background: #00d084; color: #000; }
.mon-chart-hint { font-size: 13px; }
.mon-feed-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; gap: 12px; flex-wrap: wrap; }
.mon-feed-head h2 { margin: 0; }
.mon-card { display: flex; gap: 14px; padding: 16px 0; border-bottom: 1px solid #1e293b; }
.mon-card:last-child { border-bottom: none; }
.mon-av { flex: 0 0 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; font-size: 14px; }
.mon-card-body { flex: 1; min-width: 0; }
.mon-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.mon-title { color: #e2e8f0; font-weight: 600; text-decoration: none; font-size: 15px; }
.mon-title:hover { color: #00d084; text-decoration: underline; }
.mon-meta { font-size: 12.5px; margin: 6px 0; }
.mon-snip { margin: 6px 0 10px; color: #94a3b8; font-size: 14px; line-height: 1.5; }
.mon-actions a { color: #0693e3; text-decoration: none; font-size: 13px; font-weight: 600; }
.mon-actions a:hover { text-decoration: underline; }
.mon-flabel { display: block; font-weight: 600; font-size: 13px; color: #cbd5e1; margin: 18px 0 10px; }
.mon-flabel:first-child { margin-top: 0; }
.mon-filters .source-filter { max-height: 220px; overflow-y: auto; }
.mon-range { width: 100%; accent-color: #00d084; }
@media (max-width: 1024px){ .mon-grid { grid-template-columns: 1fr; } .mon-filters .dashboard-card { position: static; } }

@media (max-width: 820px){ .stats-grid{grid-template-columns:repeat(2,1fr);} .dashboard-wrapper{flex-direction:column;} .sidebar{width:auto;} }
@media print {
  body { background: #fff; color: #000; padding: 0; }
  .sidebar, .no-print { display: none !important; }
  .dashboard-card, .stat-card { background: #f4f4f4 !important; color: #000; }
  .stat-card h2, .news-item a { color: #047857 !important; }
}
