/* ============================================================
   Wisper Ai — clean, minimal, light theme
   ============================================================ */

:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #f1f3f5;
  --border: #e6e8eb;
  --border-strong: #d4d8dd;
  --text: #1a1d21;
  --text-2: #5b6470;
  --text-3: #8b94a0;
  --accent: #4f46e5;
  --accent-soft: #eef0fe;
  --accent-hover: #4338ca;
  --pos: #16a34a;
  --neu: #d4a017;
  --neg: #dc2626;
  --danger: #dc2626;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 1px 3px rgba(16, 24, 40, 0.06);
  --shadow-md: 0 4px 12px rgba(16, 24, 40, 0.08);
  --font: "Noto Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-deva: "Madan", "Noto Sans Devanagari", var(--font);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 { color: var(--text); font-weight: 700; line-height: 1.25; }

[lang="ne"], .result-snippet, .article-content-body { font-family: var(--font-deva); }

/* ---------- Header / nav ---------- */
.header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0.85rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}
.brand { display: flex; flex-direction: column; line-height: 1.1; }
.brand-title {
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
}
.brand-subtitle { font-size: 0.72rem; color: var(--text-3); letter-spacing: 0.02em; }

.nav { display: flex; align-items: center; gap: 0.25rem; flex-wrap: wrap; }
.nav-link {
  color: var(--text-2);
  font-size: 0.88rem;
  font-weight: 500;
  padding: 0.45rem 0.7rem;
  border-radius: var(--radius-sm);
  transition: background 0.15s, color 0.15s;
}
.nav-link:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.nav-link.active { color: var(--accent); background: var(--accent-soft); }
.nav-link-super { color: #b45309 !important; font-weight: 700; }

.nav-user { display: inline-flex; align-items: center; gap: 0.6rem; margin-left: 0.4rem; padding-left: 0.6rem; border-left: 1px solid var(--border); }
.nav-user-email { color: var(--text-3); font-size: 0.78rem; max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-logout, .nav-login { border: 1px solid var(--border-strong); }
.nav-logout:hover { border-color: var(--danger); color: var(--danger) !important; background: #fef2f2; }
.nav-login:hover { border-color: var(--accent); color: var(--accent) !important; background: var(--accent-soft); }

/* ---------- Layout ---------- */
.main { max-width: 1180px; margin: 0 auto; padding: 1.5rem; }
.footer {
  max-width: 1180px;
  margin: 2rem auto 0;
  padding: 1.5rem;
  color: var(--text-3);
  font-size: 0.82rem;
  border-top: 1px solid var(--border);
  text-align: center;
}

/* ---------- Buttons & inputs ---------- */
button, .admin-link-button {
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 0.5rem 1.05rem;
  background: var(--accent);
  color: #fff;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
}
button:hover { background: var(--accent-hover); }
button:disabled { opacity: 0.55; cursor: not-allowed; }
button.secondary, .btn-secondary {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border-strong);
}
button.secondary:hover, .btn-secondary:hover { background: var(--surface-2); }
button.danger, .btn-danger { background: var(--danger); }
button.danger:hover { background: #b91c1c; }
.admin-link-button { display: inline-block; text-decoration: none; }
.admin-link-button:hover { text-decoration: none; color: #fff; }

input[type="text"], input[type="number"], input[type="date"], input[type="email"],
input[type="password"], select, textarea {
  font-family: inherit;
  font-size: 0.92rem;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 0.55rem 0.7rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
label { color: var(--text-2); font-size: 0.82rem; font-weight: 600; }

/* ---------- Filters ---------- */
.filters {
  display: flex;
  align-items: flex-end;
  gap: 1rem;
  flex-wrap: wrap;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow);
}
.filter-item { display: flex; flex-direction: column; gap: 0.35rem; }
.filter-item input { min-width: 230px; }
.filter-actions { display: flex; gap: 0.5rem; margin-left: auto; }

/* ---------- Compact "clouds" (categories / keywords / outlets) ---------- */
.categories-cloud, .keywords-cloud, .outlets-cloud { margin-bottom: 0.85rem; }
.categories-cloud h2, .keywords-cloud h2, .outlets-cloud h2 {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-3);
  margin: 0 0 0.5rem;
  font-weight: 700;
}
.categories-list, .keywords-list, .outlets-list {
  list-style: none;
  margin: 0;
  padding: 0 0 0.25rem;
  display: flex;
  gap: 0.4rem;
  overflow-x: auto;
  scrollbar-width: thin;
}
.categories-list li, .keywords-list li, .outlets-list li {
  display: inline-flex; align-items: center; gap: 0.25rem; flex: 0 0 auto;
}
.category-pill-main, .keyword-pill-main, .outlet-pill-main {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  color: var(--text-2);
  font-size: 0.8rem;
  font-weight: 500;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
}
.category-pill-main:hover, .keyword-pill-main:hover, .outlet-pill-main:hover {
  border-color: var(--accent); color: var(--accent); background: var(--accent-soft);
}
.category-pill-main.active, .outlet-pill-main.active {
  background: var(--accent); color: #fff; border-color: var(--accent);
}
.category-pill-main-count, .keyword-pill-main-count, .outlet-pill-main-count { font-size: 0.7rem; color: var(--text-3); }
.outlet-pill-logo { width: 14px; height: 14px; object-fit: contain; vertical-align: middle; }

/* ---------- Feed scope (My News / All News) ---------- */
.feed-scope-bar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin: 0.25rem 0 1.1rem; flex-wrap: wrap; }
.feed-scope-bar.hidden { display: none; }
.feed-scope-toggle { display: inline-flex; background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; padding: 0.22rem; }
.scope-btn { border: none; background: transparent; color: var(--text-2); padding: 0.4rem 1rem; border-radius: 999px; font-size: 0.85rem; font-weight: 600; }
.scope-btn:hover { background: transparent; color: var(--text); }
.scope-btn.active { background: var(--accent); color: #fff; }
.scope-edit-btn { background: var(--surface); border: 1px solid var(--border-strong); color: var(--text-2); padding: 0.4rem 0.9rem; border-radius: var(--radius-sm); font-size: 0.82rem; }
.scope-edit-btn:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }

/* ---------- News hero ---------- */
.news-hero {
  position: relative; border-radius: var(--radius); overflow: hidden; margin-bottom: 1.5rem;
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); min-height: 320px;
}
.news-hero.hidden { display: none; }
.news-hero-link { display: block; color: inherit; }
.news-hero-link:hover { text-decoration: none; }
.news-hero-image { width: 100%; height: 360px; object-fit: cover; display: block; }
.news-hero-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.82) 0%, rgba(0,0,0,0.35) 45%, transparent 75%);
  display: flex; flex-direction: column; justify-content: flex-end; padding: 1.5rem;
}
.news-hero-badge {
  align-self: flex-start; background: var(--accent); color: #fff; font-size: 0.7rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.05em; padding: 0.25rem 0.6rem; border-radius: 999px; margin-bottom: 0.6rem;
}
.news-hero-title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.news-hero-title { color: #fff; font-size: 1.6rem; font-weight: 800; margin: 0; text-shadow: 0 1px 12px rgba(0,0,0,0.4); }
.news-hero-meta { color: rgba(255,255,255,0.85); font-size: 0.82rem; margin-top: 0.6rem; }

/* ---------- News grid + cards ---------- */
.news-layout { display: block; }
.news-main-column { width: 100%; }
.results { margin-top: 0.5rem; }

.results-list {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 1.1rem;
}

.result-item {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column; box-shadow: var(--shadow);
  transition: box-shadow 0.18s, transform 0.18s, border-color 0.18s; position: relative;
}
.result-item:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); border-color: var(--border-strong); }
.result-item.sentiment-positive { border-top: 3px solid var(--pos); }
.result-item.sentiment-neutral  { border-top: 3px solid var(--neu); }
.result-item.sentiment-negative { border-top: 3px solid var(--neg); }

.result-card-image { width: 100%; aspect-ratio: 16 / 9; background: var(--surface-2); overflow: hidden; }
.result-card-image img { width: 100%; height: 100%; object-fit: cover; display: block; }

.result-overlay { display: none; }   /* legacy element, unused in light theme */

.result-title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.5rem; padding: 0.9rem 1rem 0; }
.result-title { font-size: 1.02rem; font-weight: 700; color: var(--text); line-height: 1.35; display: block; }
.result-title:hover { color: var(--accent); text-decoration: none; }
.result-title-right { display: flex; align-items: center; gap: 0.4rem; flex: 0 0 auto; }

.result-profile-tags { display: flex; flex-wrap: wrap; gap: 0.3rem; padding: 0.55rem 1rem 0; }
.profile-tag { background: var(--accent-soft); color: var(--accent); font-size: 0.7rem; font-weight: 600; padding: 0.15rem 0.5rem; border-radius: 999px; white-space: nowrap; }

.result-snippet-container { padding: 0.5rem 1rem 0; }
.result-snippet-label { font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-3); font-weight: 700; margin-bottom: 0.2rem; }
.result-snippet {
  font-size: 0.88rem; color: var(--text-2); line-height: 1.55;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}

.result-bottom-wrapper { margin-top: auto; padding: 0.7rem 1rem 0.9rem; }
.result-meta {
  display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap;
  font-size: 0.76rem; color: var(--text-3); margin-top: 0.5rem;
  border-top: 1px solid var(--border); padding-top: 0.6rem;
}
.result-meta-logo { width: 15px; height: 15px; object-fit: contain; border-radius: 3px; }
.result-preview { color: var(--text-2); font-size: 0.88rem; }

.virality-badge { background: #fff7ed; color: #c2410c; border: 1px solid #fed7aa; font-size: 0.72rem; font-weight: 700; padding: 0.1rem 0.45rem; border-radius: 999px; white-space: nowrap; }

/* sentiment indicator */
.sentiment-indicator { display: inline-flex; align-items: center; gap: 0.25rem; }
.sentiment-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.sentiment-dot.positive { background: var(--pos); }
.sentiment-dot.neutral { background: var(--neu); }
.sentiment-dot.negative { background: var(--neg); }
.sentiment-score { font-size: 0.72rem; color: var(--text-3); }
.sentiment-meter { display: flex; align-items: center; gap: 0.3rem; }
.sentiment-meter-bar { height: 5px; border-radius: 999px; background: var(--surface-2); position: relative; width: 54px; overflow: hidden; }
.sentiment-meter-needle { position: absolute; top: 0; bottom: 0; width: 3px; background: var(--text); }
.sentiment-meter-value { font-size: 0.7rem; color: var(--text-3); }

/* related news inside card */
.result-related-wrapper, .related-news-container { margin-top: 0.5rem; }
.related-news-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.3rem; }
.related-news-link { display: flex; align-items: center; gap: 0.4rem; font-size: 0.78rem; color: var(--text-2); }
.related-news-logo { width: 14px; height: 14px; object-fit: contain; }
.related-news-title-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.related-news-source, .related-news-outlet { color: var(--text-3); }
.related-badge { position: absolute; top: 0.6rem; left: 0.6rem; z-index: 2; background: rgba(0,0,0,0.65); color: #fff; font-size: 0.66rem; font-weight: 700; padding: 0.15rem 0.45rem; border-radius: 999px; text-transform: uppercase; }

/* timeline separators */
.news-timeline { list-style: none; grid-column: 1 / -1; display: flex; align-items: center; gap: 0.6rem; margin: 0.6rem 0; }
.news-timeline-line { flex: 1; height: 1px; background: var(--border); }
.news-timeline-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.news-timeline-label { font-size: 0.74rem; color: var(--text-3); font-weight: 600; white-space: nowrap; }

.load-more { display: block; margin: 1.75rem auto 0; background: var(--surface); color: var(--text); border: 1px solid var(--border-strong); padding: 0.6rem 1.5rem; }
.load-more:hover { background: var(--surface-2); }
.load-more.hidden { display: none; }

/* ---------- Status / utility ---------- */
.status { font-size: 0.85rem; color: var(--text-2); margin: 0.5rem 0; }
.status.error, .error { color: var(--danger); }
.status.loading, .loading { color: var(--text-3); }
.status.success, .success { color: var(--pos); }
.empty { color: var(--text-3); }
.hidden { display: none !important; }
.subtitle { color: var(--text-2); }

/* ---------- Article page ---------- */
.article-page { max-width: 880px; margin: 0 auto; }
.back-link { display: inline-block; color: var(--text-2); font-size: 0.85rem; margin-bottom: 1rem; }
.back-link:hover { color: var(--accent); }
.article-header { margin-bottom: 1.5rem; }
.article-page-title { font-size: 1.9rem; font-weight: 800; letter-spacing: -0.01em; margin: 0 0 0.6rem; }
.article-page-meta { color: var(--text-3); font-size: 0.84rem; display: flex; gap: 0.4rem; flex-wrap: wrap; }
.article-page-link { margin-top: 0.6rem; font-size: 0.84rem; color: var(--text-3); }
.article-audio-controls { display: flex; gap: 0.5rem; margin: 0.9rem 0; flex-wrap: wrap; }

.article-layout { display: grid; grid-template-columns: 1fr 300px; gap: 1.75rem; align-items: start; }
.article-main { min-width: 0; }
.article-image-wrapper { border-radius: var(--radius); overflow: hidden; margin-bottom: 1.25rem; border: 1px solid var(--border); }
.article-image-wrapper img { width: 100%; display: block; }

.article-summary { background: var(--accent-soft); border: 1px solid #e0e3fb; border-radius: var(--radius); padding: 1rem 1.15rem; margin-bottom: 1.25rem; }
.article-summary-header { font-weight: 700; color: var(--accent); margin-bottom: 0.4rem; font-size: 0.9rem; }
.article-summary-body p { margin: 0; color: var(--text); }

.article-content-single { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.3rem 1.4rem; box-shadow: var(--shadow); }
.article-content-header { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-3); font-weight: 700; margin-bottom: 0.7rem; }
.article-content-body { font-size: 1.02rem; line-height: 1.75; color: var(--text); }
.article-content-body p { margin: 0 0 1rem; }

.article-translate-box { margin: 1.25rem 0; }
.article-translate-controls { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; margin-bottom: 0.75rem; }
.article-translated-content { padding: 1rem 1.15rem; background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--accent); border-radius: var(--radius); }
.article-translated-content.hidden { display: none; }
.article-translated-content p { margin: 0 0 0.6rem; line-height: 1.7; }

.article-sidebar { display: flex; flex-direction: column; gap: 1rem; }
.article-analytics-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.15rem; box-shadow: var(--shadow); }
.article-analytics-card h2 { font-size: 0.95rem; margin: 0 0 0.6rem; }
.article-sentiment-label { font-weight: 700; text-transform: capitalize; margin: 0 0 0.2rem; }
.article-sentiment-scores { font-size: 0.78rem; color: var(--text-3); margin: 0; }
.article-highlights { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.5rem; font-size: 0.86rem; color: var(--text-2); }
.article-highlights a { font-weight: 600; }
.article-related-meta { color: var(--text-3); font-size: 0.78rem; }
.article-keywords { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.article-detail-empty { color: var(--text-3); font-size: 0.85rem; }
.keyword-pill { background: var(--surface-2); color: var(--text-2); font-size: 0.74rem; padding: 0.15rem 0.55rem; border-radius: 999px; }

/* superadmin article tools */
.sa-article-tools { display: flex; align-items: center; gap: 0.6rem; margin: 0.75rem 0; flex-wrap: wrap; }
.sa-article-tools button { padding: 0.4rem 0.9rem; }
.sa-article-msg { font-size: 0.84rem; color: var(--text-2); }
.sa-edit-form { display: flex; flex-direction: column; gap: 0.35rem; margin: 0.5rem 0 1rem; padding: 1.1rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.sa-edit-form.hidden { display: none; }
.sa-edit-form label { margin-top: 0.3rem; }
.sa-edit-form input, .sa-edit-form textarea { width: 100%; }
.sa-edit-actions { display: flex; gap: 0.6rem; margin-top: 0.7rem; }

/* ---------- Profiles page ---------- */
.profiles, .profile-reports-page { display: flex; flex-direction: column; gap: 1.25rem; }
.page-header h1 { font-size: 1.5rem; }
.profile-form, .admin-form, .inline-form, .form-grid {
  display: flex; flex-wrap: wrap; gap: 1rem; align-items: flex-end;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.1rem 1.25rem; box-shadow: var(--shadow);
}
.profile-field, .form-group, .admin-field { display: flex; flex-direction: column; gap: 0.35rem; }
.profile-field.full, .full { width: 100%; }
.profile-field input, .form-group input { min-width: 220px; }
.profile-actions, .profile-date-actions { display: flex; gap: 0.5rem; }
.profile-layout { display: grid; grid-template-columns: 320px 1fr; gap: 1.5rem; align-items: start; }
.profile-list-wrapper, .profile-details-wrapper { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.1rem 1.25rem; box-shadow: var(--shadow); }
.profile-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.4rem; }
.profile-item { padding: 0.6rem 0.75rem; border: 1px solid var(--border); border-radius: var(--radius-sm); cursor: pointer; transition: border-color 0.15s, background 0.15s; }
.profile-item:hover, .profile-item.active { border-color: var(--accent); background: var(--accent-soft); }
.profile-summary { color: var(--text-2); }
.profile-charts { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin: 1rem 0; }
.profile-chart-card, .profile-chart-card-fullwidth { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; }
.profile-chart-card-fullwidth { grid-column: 1 / -1; }
.profile-chart-card h4 { font-size: 0.85rem; margin: 0 0 0.6rem; color: var(--text-2); }
.profile-samples { list-style: none; margin: 1rem 0 0; padding: 0; display: flex; flex-direction: column; gap: 0.75rem; }
.profile-sample { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 0.85rem 1rem; }
.profile-sample-title { font-weight: 700; margin-bottom: 0.3rem; }
.profile-sample-meta, .profile-sample-scores, .profile-sample-keywords { font-size: 0.78rem; color: var(--text-3); }
.profile-sample-text-header { font-weight: 600; color: var(--text-2); }
.profile-sample-text-body { color: var(--text); }
.profile-date-range { display: flex; gap: 1rem; flex-wrap: wrap; align-items: flex-end; }
.profile-date-field { display: flex; flex-direction: column; gap: 0.3rem; }
.profile-wordcloud { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.profile-wordcloud-item { background: var(--surface-2); color: var(--text-2); padding: 0.2rem 0.55rem; border-radius: 999px; font-size: 0.8rem; }
.profile-sentiment-sources, .profile-sentiment-list { display: flex; flex-direction: column; gap: 0.35rem; }
.profile-sentiment-source-name { color: var(--text); font-weight: 600; }
.profile-sentiment-source-count, .profile-sentiment-column-title { color: var(--text-3); font-size: 0.8rem; }

/* ---------- Admin / Super admin ---------- */
.admin-page, .superadmin-page { display: flex; flex-direction: column; gap: 1.25rem; }
.admin-page h2 { font-size: 1.5rem; }
.admin-layout { display: grid; grid-template-columns: 1fr; gap: 1.25rem; }
.admin-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem 1.4rem; box-shadow: var(--shadow); }
.admin-card h3 { font-size: 1.05rem; margin: 0 0 0.4rem; }
.admin-card p { color: var(--text-2); font-size: 0.88rem; margin: 0 0 0.9rem; }
.admin-card-full { grid-column: 1 / -1; }
.admin-field-inline { flex-direction: row; align-items: center; }
.admin-actions { display: flex; gap: 0.5rem; align-items: flex-end; flex-wrap: wrap; }
.admin-scraper-controls { display: flex; gap: 0.6rem; align-items: center; flex-wrap: wrap; margin-bottom: 1rem; }
.admin-scraper-status-text { color: var(--text-2); font-size: 0.85rem; }

.admin-table { width: 100%; border-collapse: collapse; font-size: 0.86rem; }
.admin-table thead th { text-align: left; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-3); font-weight: 700; padding: 0.6rem 0.7rem; border-bottom: 1px solid var(--border); }
.admin-table tbody td { padding: 0.65rem 0.7rem; border-bottom: 1px solid var(--border); color: var(--text); vertical-align: top; }
.admin-table tbody tr:hover { background: var(--surface-2); }
.admin-row-selected { background: var(--accent-soft) !important; }
.admin-table-logs { font-size: 0.8rem; }

.superadmin-header { display: flex; align-items: center; gap: 0.75rem; }
.superadmin-header h2 { margin: 0; }
.superadmin-badge { font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; background: #fef3c7; color: #b45309; padding: 0.2rem 0.6rem; border-radius: 999px; }
.superadmin-tabs { display: flex; gap: 0.3rem; flex-wrap: wrap; border-bottom: 1px solid var(--border); padding-bottom: 0.5rem; }
.sa-tab { background: transparent; color: var(--text-2); border: 1px solid transparent; padding: 0.45rem 0.9rem; }
.sa-tab:hover { background: var(--surface-2); color: var(--text); }
.sa-tab.active { background: var(--accent-soft); color: var(--accent); }
.sa-panel { display: none; }
.sa-panel.active { display: block; }
.sa-status { font-size: 0.86rem; min-height: 1.2em; }
.sa-status.ok { color: var(--pos); }
.sa-status.error { color: var(--danger); }
.sa-user-detail { margin-top: 1.25rem; }
.sa-detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; margin-bottom: 1rem; }
.sa-detail-grid h4 { margin: 0 0 0.5rem; }
.sa-detail-col { max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); }
.sa-lbl { display: block; margin: 0.5rem 0 0.2rem; }
.sa-url { font-size: 0.8rem; color: var(--text-2); max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sa-actions-cell { display: flex; gap: 0.35rem; }
.sa-mini { padding: 0.3rem 0.7rem; font-size: 0.78rem; background: var(--surface); color: var(--text); border: 1px solid var(--border-strong); }
.sa-mini:hover { background: var(--surface-2); }
.sa-mini.danger { background: var(--danger); color: #fff; border-color: transparent; }
.sa-mini.danger:hover { background: #b91c1c; }
.sa-row-suspended { opacity: 0.6; }
.sa-pill-good { color: var(--pos); font-weight: 600; }
.sa-pill-bad { color: var(--danger); font-weight: 600; }
.sa-role { font-size: 0.72rem; font-weight: 700; padding: 0.12rem 0.5rem; border-radius: 999px; background: var(--surface-2); color: var(--text-2); }
.sa-role-superadmin { background: #fef3c7; color: #b45309; }
.sa-role-admin { background: var(--accent-soft); color: var(--accent); }
.sa-profile-card { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 0.85rem; margin-bottom: 0.6rem; display: flex; flex-direction: column; gap: 0.35rem; }
.sa-profile-head { display: flex; gap: 0.5rem; align-items: center; }
.sa-profile-head .sa-p-name { flex: 1; }
.sa-activity-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.3rem; font-size: 0.8rem; color: var(--text-2); }
.sa-act-time { color: var(--text-3); }
.sa-cat { font-size: 0.7rem; font-weight: 700; padding: 0.1rem 0.45rem; border-radius: 999px; background: var(--surface-2); color: var(--text-2); }
.sa-cat-auth { background: #e0f2fe; color: #0369a1; }
.sa-cat-user { background: #f3e8ff; color: #7e22ce; }
.sa-cat-profile { background: var(--accent-soft); color: var(--accent); }
.sa-cat-scrape { background: #dcfce7; color: #15803d; }
.sa-cat-content { background: #fee2e2; color: #b91c1c; }
.sa-error { color: var(--danger); }

/* ---------- Defaults modal ---------- */
.defaults-modal { position: fixed; inset: 0; background: rgba(16, 24, 40, 0.45); display: flex; align-items: center; justify-content: center; z-index: 1000; }
.defaults-modal.hidden { display: none; }
.defaults-modal-inner { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.5rem; width: min(560px, 92vw); max-height: 82vh; overflow-y: auto; box-shadow: var(--shadow-md); }
.defaults-modal-inner h3 { margin-top: 0; }
.defaults-modal-inner p { color: var(--text-2); font-size: 0.9rem; }
.defaults-list { margin: 1rem 0; display: flex; flex-direction: column; gap: 0.5rem; }
.defaults-item { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 0.5rem; padding: 0.6rem 0.75rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); cursor: pointer; }
.defaults-item:hover { border-color: var(--accent); background: var(--accent-soft); }
.defaults-name { font-weight: 600; }
.defaults-kw { grid-column: 2 / 4; color: var(--text-3); font-size: 0.78rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.defaults-shared { font-size: 0.65rem; text-transform: uppercase; background: var(--surface-2); color: var(--text-2); padding: 0.1rem 0.4rem; border-radius: 4px; }
.defaults-empty { color: var(--text-3); }
.defaults-actions { display: flex; gap: 0.75rem; justify-content: flex-end; }

/* ---------- Scraper status / reports / misc ---------- */
.scraper-status, .scraper-status-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.1rem 1.25rem; box-shadow: var(--shadow); }
.scraper-next-run { color: var(--text-2); font-size: 0.85rem; margin-bottom: 0.6rem; }
.scraper-runs { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.5rem; }
.scraper-run { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 0.6rem 0.8rem; font-size: 0.82rem; }
.scraper-run-summary { color: var(--text); }
.scraper-run-details { color: var(--text-3); }
.scraper-run-error { color: var(--danger); }
.report-card, .report-section, .reports-container { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.1rem 1.25rem; box-shadow: var(--shadow); }
.report-status { font-size: 0.85rem; color: var(--text-2); }
.recipients-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.4rem; }
.recipient-item { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; padding: 0.5rem 0.7rem; border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 0.85rem; }
.checkbox-group { display: flex; align-items: center; gap: 0.4rem; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .article-layout { grid-template-columns: 1fr; }
  .profile-layout { grid-template-columns: 1fr; }
  .profile-charts { grid-template-columns: 1fr; }
  .sa-detail-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .main { padding: 1rem; }
  .header-inner { padding: 0.7rem 1rem; }
  .results-list { grid-template-columns: 1fr; }
  .filter-item input { min-width: 0; width: 100%; }
  .filters { flex-direction: column; align-items: stretch; }
  .filter-actions { margin-left: 0; }
  .article-page-title { font-size: 1.5rem; }
}

/* ---------- Approval / auth states ---------- */
.sa-pill-pending { color: #b45309; font-weight: 600; }
.sa-row-pending { background: #fffbeb; }
.sa-approve { background: var(--pos) !important; color: #fff !important; border-color: transparent !important; }
.sa-approve:hover { background: #15803d !important; }
.auth-error {
  background: #fef2f2; border: 1px solid #fecaca; color: #b91c1c;
  padding: 0.7rem 0.9rem; border-radius: var(--radius-sm); font-size: 0.88rem; margin-bottom: 1rem;
}
.auth-notice {
  background: #ecfdf5; border: 1px solid #a7f3d0; color: #047857;
  padding: 0.7rem 0.9rem; border-radius: var(--radius-sm); font-size: 0.88rem; margin-bottom: 1rem;
}
/* Login / register: centered narrow card */
.admin-page:has(form[action*="login"]),
.admin-page:has(form[action*="register"]) { max-width: 420px; margin: 3rem auto; }
