/* ── Reset & Variables ─────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:        #080810;
  --bg2:       #0e0e1a;
  --bg3:       #141425;
  --border:    #1e1e35;
  --border2:   #2a2a45;
  --text:      #e2e8f0;
  --text2:     #94a3b8;
  --text3:     #4b5a6e;
  --accent:    #7c3aed;
  --accent2:   #a78bfa;
  --accent3:   #c4b5fd;
  --green:     #34d399;
  --yellow:    #fbbf24;
  --red:       #f87171;
  --blue:      #60a5fa;
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  --font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-mono: 'SF Mono', Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
  --radius:    10px;
  --sidebar-w: 220px;
}

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.5;
  overflow-x: hidden;
}

/* ── Layout ─────────────────────────────────────────────────────────────────── */
body { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: var(--bg2);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
}

.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Auth pages - no sidebar */
body.auth-page .main-content {
  margin-left: 0;
}

body.auth-page .page-header {
  padding: 24px 32px;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
}

/* ── Sidebar ─────────────────────────────────────────────────────────────────  */
.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 24px 20px 20px;
  border-bottom: 1px solid var(--border);
}

.logo-icon {
  font-size: 22px;
  color: var(--accent2);
  line-height: 1;
}

.logo-text {
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 800;
  color: var(--accent3);
  letter-spacing: 0.3px;
}

.sidebar-nav {
  padding: 16px 10px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 8px;
  text-decoration: none;
  color: var(--text2);
  font-size: 13px;
  font-weight: 500;
  transition: all 0.15s;
}

.nav-item:hover {
  background: var(--bg3);
  color: var(--text);
}

.nav-item.active {
  background: linear-gradient(135deg, #3b1f6e, #2d1a54);
  color: var(--accent3);
  border: 1px solid #4c2a8a44;
}

.nav-icon {
  font-size: 16px;
  width: 20px;
  text-align: center;
  opacity: 0.8;
}

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid var(--border);
  background: linear-gradient(180deg, var(--bg2) 0%, var(--bg) 100%);
}

.monitor-status {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--bg3);
  border: 1px solid var(--border2);
  border-radius: 10px;
  margin-bottom: 12px;
  transition: all 0.3s ease;
}

.monitor-status.running {
  background: #0a2e14;
  border-color: #1a5c2a;
  box-shadow: 0 0 15px rgba(52, 211, 153, 0.15);
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--text3);
  transition: all 0.3s ease;
  flex-shrink: 0;
}

.monitor-status.running .status-dot {
  background: var(--green);
  box-shadow: 0 0 10px var(--green), 0 0 20px rgba(52, 211, 153, 0.4);
  animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(0.85); opacity: 0.7; }
}

.status-text {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text2);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  flex: 1;
}

.monitor-status.running .status-text {
  color: var(--green);
}

.btn-toggle {
  width: 100%;
  padding: 10px 14px;
  background: linear-gradient(135deg, var(--accent) 0%, #6d28d9 100%);
  border: none;
  border-radius: 10px;
  color: white;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  letter-spacing: 0.3px;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3);
}

.btn-toggle:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(124, 58, 237, 0.4);
}

.btn-toggle:active {
  transform: translateY(0);
}

.btn-toggle.running {
  background: linear-gradient(135deg, #166534 0%, #15803d 100%);
  box-shadow: 0 4px 12px rgba(52, 211, 153, 0.3);
}

.btn-toggle.running:hover {
  background: linear-gradient(135deg, #14532d 0%, #166534 100%);
  box-shadow: 0 6px 20px rgba(52, 211, 153, 0.4);
}

/* ── Topbar ──────────────────────────────────────────────────────────────────  */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 28px 0;
  border-bottom: 1px solid var(--border);
  padding-bottom: 16px;
}

.page-title {
  font-family: var(--font-sans);
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.3px;
}

.page-subtitle {
  font-size: 12px;
  color: var(--text3);
  margin-top: 2px;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-ghost {
  padding: 7px 14px;
  background: transparent;
  border: 1px solid var(--border2);
  border-radius: 7px;
  color: var(--text2);
  font-family: var(--font-body);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s;
}
.btn-ghost:hover { background: var(--bg3); color: var(--text); }

.live-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text3);
  letter-spacing: 1px;
  text-transform: uppercase;
  opacity: 0.5;
  transition: opacity 0.3s;
}

.live-indicator.active {
  opacity: 1;
  color: var(--green);
}

.live-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.live-indicator.active .live-dot {
  animation: pulse 1.5s infinite;
}

/* ── Content ─────────────────────────────────────────────────────────────────  */
.content-area {
  padding: 24px 28px;
  flex: 1;
}

/* ── Cards ───────────────────────────────────────────────────────────────────  */
.card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 12px;
  border-bottom: 1px solid var(--border);
}

.card-title {
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.2px;
}

.card-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.card-link {
  font-size: 12px;
  color: var(--accent2);
  text-decoration: none;
}
.card-link:hover { color: var(--accent3); }

/* ── Stat Cards ──────────────────────────────────────────────────────────────  */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.stat-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  position: relative;
  overflow: hidden;
}

.stat-accent {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
}

.stat-value {
  font-family: var(--font-sans);
  font-size: 32px;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
  margin-bottom: 6px;
  margin-top: 10px;
}

.stat-label {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 12px;
}

.stat-bar {
  height: 3px;
  background: var(--bg3);
  border-radius: 2px;
  overflow: hidden;
}

.stat-bar-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.8s ease;
}

/* ── Charts Row ──────────────────────────────────────────────────────────────  */
.charts-row {
  display: grid;
  grid-template-columns: 1fr 280px 280px;
  gap: 12px;
  margin-bottom: 20px;
}

.chart-card { }

.chart-wrap {
  padding: 16px;
}

/* Platform bars */
.platform-bars {
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.platform-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.platform-name {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  width: 72px;
  flex-shrink: 0;
}

.platform-bar-bg {
  flex: 1;
  height: 6px;
  background: var(--bg3);
  border-radius: 3px;
  overflow: hidden;
}

.platform-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.8s ease;
  min-width: 2px;
}

.platform-count {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text2);
  width: 28px;
  text-align: right;
}

/* Donut */
.donut-wrap {
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 20px;
}

.donut-legend {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--text2);
}

.legend-item span {
  width: 10px; height: 10px;
  border-radius: 2px;
  flex-shrink: 0;
}

/* ── Recent Feed ─────────────────────────────────────────────────────────────  */
.recent-feed {
  padding: 8px 0;
  max-height: 320px;
  overflow-y: auto;
}

.feed-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
  animation: slideIn 0.3s ease;
  transition: background 0.15s;
}

.feed-item:hover { background: var(--bg3); }
.feed-item:last-child { border-bottom: none; }

@keyframes slideIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.feed-author {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text2);
  white-space: nowrap;
  min-width: 90px;
}

.feed-text {
  flex: 1;
  font-size: 13px;
  color: var(--text);
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
}

.feed-loading {
  padding: 20px;
  text-align: center;
  color: var(--text3);
  font-size: 13px;
}

/* ── Comments Table ──────────────────────────────────────────────────────────  */
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.toolbar-form {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.toolbar-actions {
  display: flex;
  gap: 8px;
}

.search-wrap {
  position: relative;
}

.search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text3);
  font-size: 16px;
  pointer-events: none;
}

.input-search {
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: 8px;
  padding: 8px 12px 8px 32px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 13px;
  width: 240px;
  outline: none;
  transition: border-color 0.15s;
}

.input-search:focus { border-color: var(--accent); }

.input-select {
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: 8px;
  padding: 8px 12px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 13px;
  cursor: pointer;
  outline: none;
}

.btn-primary {
  background: var(--accent);
  border: none;
  border-radius: 8px;
  padding: 8px 16px;
  color: white;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s;
  letter-spacing: 0.3px;
}
.btn-primary:hover { background: #6d28d9; }

.btn-ai {
  background: #1e1042;
  border: 1px solid #4c2a8a;
  border-radius: 8px;
  padding: 8px 14px;
  color: var(--accent2);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.btn-ai:hover { background: #2d1a6e; }

.btn-approve-sel {
  background: #0a2e14; border: 1px solid #1a5c2a;
  border-radius: 8px; padding: 8px 14px;
  color: var(--green); font-size: 12px; font-weight: 600;
  cursor: pointer; transition: all 0.15s;
}
.btn-approve-sel:hover { background: #0d3d1a; }

.btn-hide-sel {
  background: #2e1e00; border: 1px solid #5c3c00;
  border-radius: 8px; padding: 8px 14px;
  color: var(--yellow); font-size: 12px; font-weight: 600;
  cursor: pointer; transition: all 0.15s;
}
.btn-hide-sel:hover { background: #3d2800; }

.btn-delete-sel {
  background: #2e0a0a; border: 1px solid #5c1a1a;
  border-radius: 8px; padding: 8px 14px;
  color: var(--red); font-size: 12px; font-weight: 600;
  cursor: pointer; transition: all 0.15s;
}
.btn-delete-sel:hover { background: #3d1010; }

.selection-bar {
  background: var(--bg3);
  border: 1px solid var(--border2);
  border-radius: 8px;
  padding: 10px 16px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  color: var(--text2);
}

.selection-bar button {
  background: transparent;
  border: 1px solid var(--border2);
  border-radius: 6px;
  padding: 4px 10px;
  color: var(--text2);
  font-size: 11px;
  cursor: pointer;
}
.selection-bar button:hover { background: var(--bg2); }

.table-card { overflow: visible; }

.comments-table {
  width: 100%;
  border-collapse: collapse;
}

.comments-table th {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--accent2);
  padding: 12px 14px;
  text-align: left;
  background: var(--bg3);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.col-check { width: 40px; }

.comments-table td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  color: var(--text2);
  font-size: 13px;
}

.comment-row:hover td { background: var(--bg3); }
.comment-row:last-child td { border-bottom: none; }

.col-text {
  max-width: 320px;
  color: var(--text) !important;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.col-author { font-family: var(--font-mono); font-size: 11px; white-space: nowrap; }
.col-likes { text-align: center; font-family: var(--font-mono); }
.col-reason { max-width: 160px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 11px; }
.col-time { font-family: var(--font-mono); font-size: 11px; white-space: nowrap; }
.col-actions { white-space: nowrap; }

/* Platform badges */
.platform-badge {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  padding: 3px 8px;
  border-radius: 4px;
  letter-spacing: 0.3px;
}
.platform-youtube  { color: #FF0000; background: #FF000015; border: 1px solid #FF000030; }
.platform-instagram{ color: #E1306C; background: #E1306C15; border: 1px solid #E1306C30; }
.platform-facebook { color: #1877F2; background: #1877F215; border: 1px solid #1877F230; }
.platform-tiktok   { color: #69C9D0; background: #69C9D015; border: 1px solid #69C9D030; }

/* Verdict badges */
.verdict-badge {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 4px;
  letter-spacing: 0.5px;
  white-space: nowrap;
}
.verdict-approve { color: var(--green);  background: #34d39915; border: 1px solid #34d39930; }
.verdict-hide    { color: var(--yellow); background: #fbbf2415; border: 1px solid #fbbf2430; }
.verdict-delete  { color: var(--red);   background: #f8717115; border: 1px solid #f8717130; }
.verdict-pending { color: #64748b;      background: #64748b15; border: 1px solid #64748b30; }

/* Action buttons */
.act-btn {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 5px;
  padding: 4px 8px;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.12s;
  margin-right: 2px;
}
.act-approve { color: var(--green); }
.act-approve:hover { background: #34d39915; border-color: #34d39940; }
.act-hide    { color: var(--yellow); }
.act-hide:hover { background: #fbbf2415; border-color: #fbbf2440; }
.act-delete  { color: var(--red); }
.act-delete:hover { background: #f8717115; border-color: #f8717140; }

.empty-state {
  text-align: center;
  padding: 40px !important;
  color: var(--text3) !important;
  font-style: italic;
}

.table-footer {
  margin-top: 12px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text3);
}

/* ── Settings ─────────────────────────────────────────────────────────────────*/
.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.settings-card {}

.field-group {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
}

.field-group:last-child { border-bottom: none; }

.field-group label {
  display: block;
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text3);
  margin-bottom: 7px;
}

.input-field {
  width: 100%;
  background: var(--bg3);
  border: 1px solid var(--border2);
  border-radius: 7px;
  padding: 9px 12px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 13px;
  outline: none;
  transition: border-color 0.15s;
}

.input-field:focus { border-color: var(--accent); }

.field-hint {
  display: block;
  margin-top: 5px;
  font-size: 11px;
  color: var(--text3);
}

.settings-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.btn-save {
  padding: 11px 28px;
  font-size: 13px;
}

.save-hint {
  font-size: 12px;
  color: var(--text3);
}

/* ── Toast ────────────────────────────────────────────────────────────────────*/
.toast {
  position: fixed;
  bottom: 28px;
  right: 28px;
  background: var(--bg3);
  border: 1px solid var(--border2);
  border-radius: 10px;
  padding: 12px 20px;
  font-size: 13px;
  color: var(--text);
  opacity: 0;
  transform: translateY(12px);
  transition: all 0.25s;
  pointer-events: none;
  z-index: 9999;
  max-width: 320px;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.toast.success { border-left: 3px solid var(--green); }
.toast.error   { border-left: 3px solid var(--red); }

/* ── Scrollbar ────────────────────────────────────────────────────────────────*/
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* ── Banned Words ──────────────────────────────────────────────────────────── */
.banned-word-input {
  display: flex;
  gap: 10px;
  align-items: center;
}

.banned-word-input .input-field {
  flex: 1;
}

.banned-word-input button {
  padding: 9px 18px;
  white-space: nowrap;
}

.banned-words-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 16px 20px;
  min-height: 60px;
}

.banned-word-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg3);
  border: 1px solid var(--border2);
  border-radius: 20px;
  padding: 5px 12px;
  font-size: 13px;
  color: var(--text);
}

.banned-word-tag button {
  background: transparent;
  border: none;
  color: var(--red);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  padding: 0 2px;
  opacity: 0.7;
  transition: opacity 0.15s;
}

.banned-word-tag button:hover {
  opacity: 1;
}

.banned-words-list .empty-words,
.banned-words-list .loading,
.banned-words-list .error {
  color: var(--text3);
  font-style: italic;
  font-size: 13px;
  width: 100%;
  text-align: center;
  padding: 20px;
}

.settings-card.wide {
  grid-column: 1 / -1;
}

/* ── Analytics ─────────────────────────────────────────────────────────────── */

.platform-selector {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.platform-btn {
  padding: 8px 16px;
  background: var(--bg3);
  border: 1px solid var(--border2);
  border-radius: 8px;
  color: var(--text2);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s;
}

.platform-btn:hover {
  background: var(--border2);
  color: var(--text);
}

.platform-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

.analytics-grid {
  grid-template-columns: repeat(5, 1fr);
}

.stat-change {
  font-size: 11px;
  font-family: var(--font-mono);
  margin-top: 4px;
}

.stat-change.positive { color: var(--green); }
.stat-change.negative { color: var(--red); }

.engagement-banner {
  background: var(--bg3);
  border: 1px solid var(--border2);
  border-radius: 12px;
  padding: 20px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.er-left {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.er-label {
  font-size: 13px;
  color: var(--text2);
}

.er-value {
  font-size: 32px;
  font-weight: 700;
  color: var(--accent2);
}

.er-right {
  font-size: 13px;
  color: var(--text2);
}

.heatmap-wrap {
  padding: 16px;
}

.heatmap-grid {
  display: grid;
  grid-template-columns: 30px repeat(24, 1fr);
  gap: 2px;
  font-size: 9px;
}

.heatmap-header {
  text-align: center;
  color: var(--text3);
  padding: 4px 0;
}

.heatmap-day {
  text-align: center;
  color: var(--text3);
  display: flex;
  align-items: center;
  justify-content: center;
}

.heatmap-cell {
  aspect-ratio: 1;
  border-radius: 2px;
  min-width: 12px;
}

.geo-list {
  padding: 16px;
}

.geo-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}

.geo-item:last-child { border-bottom: none; }

.geo-rank {
  width: 24px;
  text-align: center;
  font-size: 11px;
  color: var(--text3);
  font-weight: 600;
}

.geo-name {
  flex: 1;
  font-size: 13px;
  color: var(--text);
}

.geo-bar-wrap {
  width: 80px;
  height: 6px;
  background: var(--bg3);
  border-radius: 3px;
  overflow: hidden;
}

.geo-bar {
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
  transition: width 0.3s;
}

.geo-count {
  width: 60px;
  text-align: right;
  font-size: 12px;
  color: var(--text2);
  font-family: var(--font-mono);
}

.content-stats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  padding: 16px;
}

.content-type-stat {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: var(--bg3);
  border-radius: 10px;
}

.ct-icon {
  font-size: 24px;
}

.ct-info {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.ct-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}

.ct-count {
  font-size: 11px;
  color: var(--text3);
}

.ct-metrics {
  display: flex;
  gap: 16px;
}

.ct-metric {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.ct-label {
  font-size: 10px;
  color: var(--text3);
}

.ct-value {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.top-posts {
  padding: 16px;
}

.top-post-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-bottom: 1px solid var(--border);
}

.top-post-item:last-child { border-bottom: none; }

.top-post-rank {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  color: white;
}

.top-post-platform {
  font-size: 12px;
  font-weight: 500;
  padding: 4px 8px;
  border-radius: 4px;
}

.top-post-platform.youtube { background: #ff000020; color: #ff0000; }
.top-post-platform.instagram { background: #e1306c20; color: #e1306c; }
.top-post-platform.facebook { background: #1877f220; color: #1877f2; }
.top-post-platform.tiktok { background: #69c9d020; color: #69c9d0; }

.top-post-type {
  font-size: 12px;
  color: var(--text2);
  flex: 1;
}

.top-post-stats {
  display: flex;
  gap: 12px;
  font-size: 12px;
  color: var(--text2);
}

.top-post-er {
  font-size: 13px;
  font-weight: 600;
  color: var(--green);
  font-family: var(--font-mono);
}

/* ── Canvas chart wrapper ─────────────────────────────────────────────────────*/
canvas { display: block; }

/* ── Mobile Responsive ───────────────────────────────────────────────────────*/
@media (max-width: 768px) {
  /* Auth pages - no mobile header */
  body.auth-page .main-content {
    padding-top: 0;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  
  .stat-card {
    padding: 14px;
  }
  
  .stat-value {
    font-size: 24px;
  }
  
  .charts-row {
    grid-template-columns: 1fr;
  }
  
  .toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  
  .toolbar-form {
    flex-direction: column;
    width: 100%;
    gap: 8px;
  }

  .input-search,
  .input-select,
  .toolbar-form .btn-primary {
    width: 100%;
  }

  .toolbar-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
  }

  .toolbar-actions button {
    width: 100%;
    min-width: 0;
    padding: 10px 8px;
    box-sizing: border-box;
  }
  
  /* Comments table → stacked cards on mobile (no sideways scrolling) */
  .comments-table,
  .comments-table tbody {
    display: block;
    width: 100%;
  }

  .comments-table thead {
    display: none;
  }

  .comments-table tr.comment-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 10px;
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px 14px;
    margin-bottom: 10px;
  }

  .comments-table td {
    border: none;
    padding: 0;
    font-size: 13px;
  }

  .comments-table td:nth-child(1) { order: 1; }   /* checkbox */
  .comments-table td:nth-child(2) { order: 2; }   /* platform badge */
  .comments-table td.col-author  { order: 3; flex: 1 1 auto; font-weight: 600; }
  .comments-table td:nth-child(6) { order: 4; margin-left: auto; }  /* verdict badge */

  .comments-table td.col-text {
    order: 5;
    flex-basis: 100%;
    max-width: none;
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
    color: var(--text) !important;
    margin-top: 2px;
  }

  .comments-table td.col-likes {
    order: 6;
    font-size: 12px;
    color: var(--text3);
  }
  .comments-table td.col-likes::before { content: "👍 "; }

  .comments-table td.col-reason {
    order: 7;
    flex-basis: 100%;
    font-size: 12px;
    font-style: italic;
    color: var(--text3);
  }

  .comments-table td.col-time {
    order: 8;
    font-size: 11px;
    color: var(--text3);
    margin-left: auto;
  }

  .col-actions {
    order: 9;
    flex-basis: 100%;
    display: flex;
    flex-direction: row;
    gap: 8px;
    margin-top: 6px;
  }

  .col-actions .act-btn {
    flex: 1;
    padding: 8px;
    font-size: 13px;
  }

  .comments-table .empty-state {
    flex-basis: 100%;
    text-align: center;
    padding: 20px;
  }
  
  .admin-tabs {
    flex-wrap: wrap;
    gap: 6px;
  }
  
  .tab-btn {
    padding: 8px 12px;
    font-size: 12px;
  }
  
  .data-table {
    font-size: 12px;
  }
  
  .data-table th,
  .data-table td {
    padding: 8px 10px;
  }
  
  .actions {
    flex-direction: column;
    gap: 4px;
  }
  
  .actions button {
    padding: 5px 8px;
    font-size: 11px;
    white-space: nowrap;
  }
  
  .audit-item {
    grid-template-columns: 1fr;
    gap: 4px;
    padding: 12px;
  }
  
  .audit-time {
    font-size: 11px;
  }
  
  .platform-selector {
    flex-wrap: wrap;
    gap: 6px;
  }
  
  .platform-btn {
    padding: 6px 12px;
    font-size: 12px;
  }
  
  .analytics-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  
  .engagement-banner {
    flex-direction: column;
    gap: 12px;
    text-align: center;
    padding: 16px;
  }
  
  .er-value {
    font-size: 28px;
  }
  
  .heatmap-grid {
    grid-template-columns: 24px repeat(12, 1fr);
    font-size: 8px;
    gap: 1px;
  }
  
  .heatmap-cell {
    min-width: 8px;
  }
  
  .content-stats {
    grid-template-columns: 1fr;
  }
  
  .content-type-stat {
    padding: 12px;
  }
  
  .ct-metrics {
    flex-direction: column;
    gap: 8px;
  }
  
  .top-post-item {
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px;
  }
  
  .top-post-stats {
    width: 100%;
    justify-content: space-between;
    font-size: 11px;
  }
  
  .settings-grid {
    grid-template-columns: 1fr;
  }
  
  .banned-words-list {
    padding: 12px;
  }
  
  .banned-word-tag {
    font-size: 12px;
    padding: 4px 10px;
  }
  
  .geo-list {
    padding: 12px;
  }
  
  .geo-item {
    flex-wrap: wrap;
    gap: 8px;
  }
  
  .geo-bar-wrap {
    width: 100%;
    order: 3;
  }
  
  .modal-content {
    width: 95%;
    max-width: none;
    margin: 20px;
  }

  /* Platforms list — markup uses inline styles for the row layout,
     so !important is required to override them at this breakpoint. */
  .platform-item {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 14px !important;
  }

  .platform-actions {
    flex-wrap: wrap !important;
    width: 100%;
  }

  .platform-actions button,
  .platform-actions a,
  .platform-actions > span {
    flex: 1 1 calc(50% - 6px);
    text-align: center;
    box-sizing: border-box;
  }
}

@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }
  
  .analytics-grid {
    grid-template-columns: 1fr;
  }
  
  .platform-selector {
    justify-content: center;
  }
  
  .selection-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  
  .btn-primary,
  .btn-ai,
  .btn-approve-sel,
  .btn-hide-sel,
  .btn-delete-sel {
    padding: 10px 14px;
    font-size: 13px;
    min-height: 44px;
  }
}
