:root {
  --sakshi:      #10a0eb;
  --sakshi-dark: #0b7fbd;
  --ink:         #14161a;
  --muted:       #6b7280;
  --line:        #e5e7eb;
  --bg:          #f6f7f9;
  --card:        #ffffff;
  --new:         #10a0eb;
  --up:          #16a34a;
  --down:        #dc2626;
  --radius:      8px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  /* Telugu first: Noto Sans Telugu renders the headlines; Inter picks up the
     Latin UI chrome and the English Google Trends rows. */
  font-family: "Noto Sans Telugu", Inter, "Segoe UI", system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.5;
}

/* ---------- masthead ---------- */
.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 14px 20px;
  background: var(--card);
  border-bottom: 3px solid var(--sakshi);
}
.brand { display: flex; align-items: center; gap: 14px; }
.logo {
  background: var(--sakshi);
  color: #fff;
  font-weight: 700;
  font-size: 22px;
  padding: 6px 14px;
  border-radius: var(--radius);
  letter-spacing: .5px;
}
.brand-text h1 { margin: 0; font-size: 19px; font-weight: 700; }
.tagline { margin: 2px 0 0; font-size: 12.5px; color: var(--muted); }
.meta { display: flex; align-items: center; gap: 14px; }
.meta .ts { font-size: 13px; color: var(--muted); }
.refresh {
  background: var(--sakshi);
  color: #fff;
  border: 0;
  border-radius: var(--radius);
  padding: 9px 18px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.refresh:hover { background: var(--sakshi-dark); }

/* ---------- login ---------- */
.login-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
}
.login-card {
  width: 100%;
  max-width: 360px;
  background: var(--card);
  border: 1px solid var(--line);
  border-top: 4px solid var(--sakshi);
  border-radius: var(--radius);
  padding: 32px 28px;
  text-align: center;
  box-shadow: 0 6px 24px rgba(0, 0, 0, .06);
}
.login-card .logo { display: inline-block; margin-bottom: 14px; }
.login-card h1 { margin: 0; font-size: 20px; }
.login-card .sub { margin: 4px 0 22px; font-size: 13px; color: var(--muted); }
.login-card label {
  display: block;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .4px;
  color: var(--muted);
  margin-bottom: 5px;
}
.login-card input {
  width: 100%;
  font: inherit;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  margin-bottom: 16px;
}
.login-card input:focus { outline: 2px solid var(--sakshi); outline-offset: -1px; }
.login-card button {
  width: 100%;
  background: var(--sakshi);
  color: #fff;
  border: 0;
  border-radius: 6px;
  padding: 11px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.login-card button:hover { background: var(--sakshi-dark); }
.login-error {
  background: #fdeaea;
  color: #b91c1c;
  font-size: 13px;
  font-weight: 600;
  padding: 8px;
  border-radius: 6px;
  margin: 0 0 16px;
}
.signout { font-size: 12px; color: var(--muted); text-decoration: none; }
.signout:hover { color: var(--sakshi); text-decoration: underline; }

/* ---------- stat bar ---------- */
.statbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 20px;
  background: var(--card);
  border-bottom: 1px solid var(--line);
  font-size: 12px;
}
.stat {
  padding: 3px 10px;
  border-radius: 999px;
  background: #eef2f5;
  color: var(--muted);
}
.stat.ok   { background: #e8f5ec; color: #15803d; }
.stat.fail { background: #fdeaea; color: #b91c1c; font-weight: 600; }
.stat.muted { background: transparent; }

/* ---------- tabs ---------- */
.tabs {
  display: flex;
  gap: 6px;
  padding: 12px 20px 0;
  flex-wrap: wrap;
}
.tab {
  background: var(--card);
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: var(--radius) var(--radius) 0 0;
  padding: 9px 16px;
  font: inherit;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
}
.tab.active { color: var(--sakshi); box-shadow: inset 0 -3px 0 var(--sakshi); }
.tab .c {
  display: inline-block;
  margin-left: 5px;
  padding: 1px 7px;
  border-radius: 999px;
  background: #eef2f5;
  font-size: 11.5px;
  color: var(--muted);
}

/* ---------- filters ---------- */
.filters {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  align-items: flex-end;
  padding: 14px 20px;
  background: var(--card);
  border: 1px solid var(--line);
  border-left: 0;
  border-right: 0;
}
.group { display: flex; flex-direction: column; gap: 4px; }
.group.grow { flex: 1; min-width: 200px; }
.group label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .4px;
  color: var(--muted);
}
select, input[type="search"] {
  font: inherit;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
}
input[type="search"] { width: 100%; }
select:focus, input:focus { outline: 2px solid var(--sakshi); outline-offset: -1px; }

/* ---------- table ---------- */
main { padding: 16px 20px 40px; }
table { width: 100%; border-collapse: collapse; background: var(--card); border-radius: var(--radius); overflow: hidden; }
th, td { padding: 11px 12px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
th {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .4px;
  color: var(--muted);
  background: #fafbfc;
  position: sticky;
  top: 0;
  z-index: 1;
}
tbody tr:hover { background: #fcfcfd; }
.col-rank  { width: 44px; color: var(--muted); font-variant-numeric: tabular-nums; }
.col-score { width: 70px; text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.col-title a { color: var(--ink); text-decoration: none; font-weight: 600; }
.col-title a:hover { color: var(--sakshi); text-decoration: underline; }
.outlets { display: block; margin-top: 3px; font-size: 11.5px; color: var(--muted); }

.badge {
  display: inline-block;
  padding: 2px 8px;
  margin: 1px 3px 1px 0;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.badge.new    { background: var(--new); color: #fff; }
.badge.region { background: #eef2f5; color: var(--muted); }
.badge.src               { background: #eef2f5; color: #374151; }
.src-news_rss      { background: #e2f4fd; color: #0b7fbd; }
.src-google_news   { background: #eef1f5; color: #475569; }
.src-youtube       { background: #fdeaea; color: #b91c1c; }
.src-google_trends { background: #fff4e0; color: #b45309; }
.src-twitter_x     { background: #e8eaed; color: #1f2937; }

.col-trend { white-space: nowrap; }
.spark { font-weight: 700; }
.sparkline { margin-left: 3px; letter-spacing: -1px; font-weight: 400; color: var(--muted); }
.dir-up   { color: var(--up); }
.dir-down { color: var(--down); }
.dir-new  { color: var(--sakshi); }
.dir-flat { color: var(--muted); }
.age { margin-left: 6px; font-size: 11px; color: var(--muted); }

#empty { padding: 30px; text-align: center; color: var(--muted); }
footer { padding: 16px 20px 30px; font-size: 12.5px; color: var(--muted); }

/* ---------- mobile: table -> cards ---------- */
@media (max-width: 640px) {
  .masthead { flex-direction: column; align-items: flex-start; }
  main { padding: 12px 10px 30px; }
  thead { display: none; }
  table, tbody, tr, td { display: block; width: 100%; }
  tr {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    margin-bottom: 10px;
    padding: 10px 12px;
    position: relative;
  }
  td { border: 0; padding: 3px 0; }
  .col-rank {
    position: absolute;
    top: 10px;
    right: 12px;
    font-size: 11px;
  }
  .col-score {
    display: inline-block;
    width: auto;
    text-align: left;
    color: var(--sakshi);
  }
  .col-score::before {
    content: "score ";
    font-weight: 400;
    font-size: 11px;
    color: var(--muted);
  }
  .col-cat { display: inline-block; width: auto; margin-right: 12px; color: var(--muted); font-size: 12px; }
  .col-trend { display: inline-block; width: auto; margin-right: 12px; }
  .col-title { padding-right: 34px; }
}
