/* Reputation Check - Estilo alinhado ao mockup (POC X Reputation) */
:root {
  --bg: #f1f1f1;
  --bg-card: #ffffff;
  --border: #dedede;
  --text: #1A1F48;
  --text-muted: #505682;
  --sidebar: #DCDB00;
  --sidebar-hover: rgba(0,0,0,.08);
  --accent: #1A1F48;
  --accent-hover: #505682;
  --btn-primary: #1A1F48;
  --btn-primary-hover: #505682;
  --danger: #c62828;
  --success: #2e7d32;
  --warning: #f9a825;
  --radius: 8px;
  --font: 'Segoe UI', system-ui, -apple-system, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: var(--font); background: var(--bg-card); color: var(--text); min-height: 100vh; line-height: 1.5; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Layout: sidebar + main */
.app-layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 60px; min-width: 60px; flex-shrink: 0;
  background: var(--sidebar);
  display: flex; flex-direction: column; align-items: center;
  padding: 10px 0; z-index: 1020;
}
.sidebar-nav { display: flex; flex-direction: column; gap: 0.5rem; flex: 1; }
.sidebar-nav a {
  width: 44px; height: 44px; border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  color: var(--text); text-decoration: none;
}
.sidebar-nav a:hover, .sidebar-nav a.active { background: var(--sidebar-hover); }
.sidebar-nav .nav-icon { width: 24px; height: 24px; display: block; color: inherit; }
.sidebar-nav .nav-icon use { fill: currentColor; }
.sidebar-brand { font-weight: 700; font-size: 0.75rem; color: var(--text); writing-mode: vertical-rl; transform: rotate(180deg); margin-top: auto; padding: 0.5rem 0; }
.sidebar-user { width: 36px; height: 36px; border-radius: 50%; background: var(--border); margin-top: 0.5rem; display: flex; align-items: center; justify-content: center; font-size: 0.75rem; font-weight: 700; color: var(--text); }
.sidebar-logout { font-size: 0.7rem; color: var(--text); margin-top: 0.5rem; padding: 0.25rem; }
.main-content { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.top-bar { display: flex; align-items: center; padding: 1rem 1.5rem; background: var(--bg-card); border-bottom: 1px solid var(--border); }
.top-bar .brand { font-weight: 700; font-size: 1.1rem; color: var(--text); }
.main-inner {
  flex: 1; padding: 1rem 1.5rem; background: var(--bg); min-height: 100vh; box-shadow: inset 2px 0 3px rgba(0,0,0,0.08);
  width: 100%; max-width: 1200px; margin-left: auto; margin-right: auto; min-width: 0;
}

/* Login (mockup) */
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 2rem; background: var(--bg-card); }
.login-card { width: 100%; max-width: 420px; text-align: center; }
.login-logo { width: 64px; height: 64px; margin: 0 auto 0.5rem; background: var(--text); border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 2rem; }
.login-card .brand-name { font-weight: 700; font-size: 1.5rem; letter-spacing: 0.02em; color: var(--text); margin-bottom: 0.25rem; }
.login-card .tagline { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 2rem; }
.login-card h2 { font-size: 1.25rem; margin: 0 0 0.5rem; color: var(--text); }
.login-card .login-instruction { font-size: 0.9rem; color: var(--text-muted); margin-bottom: 1.5rem; }
.form-group { margin-bottom: 1rem; text-align: left; }
.form-group label { display: block; margin-bottom: 0.35rem; font-size: 0.9rem; color: var(--text); }
.form-group input, .form-group select, .form-group textarea { width: 100%; padding: 0.65rem 0.75rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-card); color: var(--text); font: inherit; }
.form-group input:focus { outline: none; border-color: var(--accent); }
.btn { display: inline-flex; align-items: center; justify-content: center; padding: 0.65rem 1.25rem; border: none; border-radius: var(--radius); font: inherit; font-weight: 600; cursor: pointer; transition: background 0.15s; }
.btn-primary { background: var(--btn-primary); color: #fff; width: 100%; margin-top: 0.25rem; }
.btn-primary:hover { background: var(--btn-primary-hover); }
.login-card .forgot { display: block; margin-top: 1rem; font-size: 0.9rem; color: var(--accent); }

/* Dashboard: welcome, banner, action cards */
.welcome-msg { font-size: 1.25rem; font-weight: 600; margin-bottom: 1rem; color: var(--text); }
.alert-banner { background: #e0f2e9; border: 1px solid #a5d6a7; border-radius: var(--radius); padding: 1rem 1.25rem; margin-bottom: 1.5rem; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 1rem; }
.alert-banner h3 { margin: 0 0 0.25rem; font-size: 0.95rem; color: var(--text); }
.alert-banner p { margin: 0; font-size: 0.85rem; color: var(--text-muted); }
.action-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1rem; margin-bottom: 2rem; }
.action-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; text-align: center; }
.action-card .action-card-icon { font-size: 2rem; margin-bottom: 0.5rem; display: flex; align-items: center; justify-content: center; color: var(--accent); }
.action-card .action-card-icon .nav-icon { width: 32px; height: 32px; }
.action-card p { margin: 0 0 1rem; font-size: 0.9rem; color: var(--text-muted); }
.btn-dark { background: var(--accent); color: #fff; border: none; padding: 0.5rem 1rem; border-radius: var(--radius); font-size: 0.85rem; font-weight: 600; cursor: pointer; display: inline-block; text-decoration: none; box-shadow: 2px 2px 4px rgba(0,0,0,0.15); }
.btn-dark:hover { background: var(--accent-hover); color: #fff; }
.chart-title { font-size: 1rem; font-weight: 600; margin-bottom: 1rem; color: var(--text); }
.chart-placeholder { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); height: 280px; display: flex; align-items: center; justify-content: center; color: var(--text-muted); margin-bottom: 2rem; }
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 1rem; margin-bottom: 2rem; }
.stat-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; }
.stat-card .value { font-size: 1.75rem; font-weight: 700; color: var(--text); }
.stat-card .label { font-size: 0.85rem; color: var(--text-muted); margin-top: 0.25rem; }

/* Page title, tables, lists */
.page-title { margin: 0 0 1.5rem; font-size: 1.5rem; }
.container { max-width: 1200px; margin: 0 auto; }
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-card); }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 0.75rem 1rem; text-align: left; border-bottom: 1px solid var(--border); }
th { font-weight: 600; color: var(--text-muted); font-size: 0.85rem; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(26, 31, 72, 0.04); }
.post-cards { display: flex; flex-direction: column; gap: 1rem; }
.post-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; min-width: 0; overflow-wrap: anywhere; }
.post-card .meta { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 0.5rem; }
.post-card .risk-badge { display: inline-block; padding: 0.2rem 0.5rem; border-radius: 6px; font-size: 0.75rem; font-weight: 600; margin-top: 0.5rem; }
.risk-baixo { background: rgba(46, 125, 50, 0.2); color: var(--success); }
.risk-medio { background: rgba(249, 168, 37, 0.2); color: var(--warning); }
.risk-alto { background: rgba(198, 40, 40, 0.2); color: var(--danger); }
.risk-critico { background: var(--danger); color: #fff; }
.filters-bar { display: flex; gap: 1rem; flex-wrap: wrap; align-items: flex-end; margin-bottom: 1.5rem; }
.filters-bar .form-group { margin-bottom: 0; min-width: 140px; }
.termos-create-bar { display: flex; gap: 1rem; flex-wrap: wrap; align-items: flex-end; margin-bottom: 1rem; }
.termos-create-bar .form-group { margin-bottom: 0; }
.termos-create-bar .form-group input[type="text"] { min-width: 200px; }
.term-checkbox .inline { font-weight: normal; cursor: pointer; }
.term-list { list-style: none; padding: 0; margin: 0 0 1.5rem; }
.term-list li { display: flex; align-items: center; gap: 0.5rem; padding: 0.75rem 1rem; border: 1px solid var(--border); border-radius: 8px; margin-bottom: 0.5rem; background: var(--bg-card); }
.term-name { font-weight: 600; }
.term-rule { font-size: 0.85rem; color: var(--text-muted); flex: 1; }
.toggle-btn {
  padding: 0.3rem 0.6rem; border-radius: var(--radius); font-size: 0.85rem; font-weight: 700;
  border: 1px solid var(--border); cursor: pointer; transition: all 0.15s; min-width: 36px;
  display: inline-flex; align-items: center; justify-content: center;
}
.toggle-pause { background: rgba(249, 168, 37, 0.15); color: #b8860b; border-color: var(--warning); }
.toggle-pause:hover { background: rgba(249, 168, 37, 0.3); }
.toggle-play { background: rgba(46, 125, 50, 0.15); color: var(--success); border-color: var(--success); }
.toggle-play:hover { background: rgba(46, 125, 50, 0.3); }
.term-list .active-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--success); flex-shrink: 0; }
.term-list .active-dot.inactive { background: var(--text-muted); }
.topic-users-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.multi-select { min-height: 200px; padding: 0.5rem; border: 1px solid var(--border); border-radius: 8px; background: var(--bg-card); color: var(--text); }
.usage-summary { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.5rem; margin-bottom: 1.5rem; }
.usage-summary h3 { margin: 0 0 1rem; font-size: 1rem; }
.console-link { margin-top: 1rem; font-size: 0.9rem; color: var(--text-muted); }
.empty-state { text-align: center; padding: 3rem 2rem; color: var(--text-muted); }
.error-msg { color: var(--danger); font-size: 0.9rem; margin-top: 0.5rem; }
.api-unavailable-banner { background: rgba(249, 168, 37, 0.2); border: 1px solid var(--warning); border-radius: var(--radius); padding: 1rem 1.25rem; margin-bottom: 1.5rem; font-size: 0.9rem; color: var(--text); }
.api-unavailable-banner code { background: var(--bg); padding: 0.15rem 0.4rem; border-radius: 4px; font-size: 0.85em; }
.btn-small { padding: 0.35rem 0.75rem; font-size: 0.85rem; }
.subsection { font-size: 1rem; font-weight: 600; margin: 1.5rem 0 0.75rem; color: var(--text); }
/* Análise: filter panel */
.analise-filters {
  display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: flex-end;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1rem 1.25rem; margin-bottom: 1.5rem;
}
.filter-field { display: flex; flex-direction: column; min-width: 130px; }
.filter-field label { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 0.25rem; }
.filter-field select,
.filter-field input[type="date"] { padding: 0.45rem 0.5rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-card); font: inherit; font-size: 0.9rem; color: var(--text); }
.filter-actions { flex-direction: row; gap: 0.5rem; align-items: flex-end; }
.btn-filter { padding: 0.45rem 1rem; font-size: 0.9rem; min-width: auto; width: auto; }
.btn-secondary { background: var(--bg); border: 1px solid var(--border); color: var(--text); }
.btn-secondary:hover { background: var(--border); }

/* Análise: enriched post card */
.post-card .meta { display: flex; justify-content: space-between; align-items: center; }
.tweet-link { font-size: 0.85rem; color: var(--accent); white-space: nowrap; }
.filter-term { font-size: 0.85rem; color: var(--text-muted); margin: 0 0 0.5rem; }
.post-card__image {
  margin-bottom: 0.75rem;
  border-radius: var(--radius);
  background: #ececec;
  display: flex;
  align-items: center;
  justify-content: center;
  max-height: min(70vh, 560px);
}
.post-card__image img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  max-height: min(70vh, 560px);
  object-fit: contain;
  object-position: center;
  border-radius: var(--radius);
}
.post-text { margin: 0 0 0.5rem; line-height: 1.55; word-break: break-word; overflow-wrap: anywhere; }
.post-card__context {
  background: #f7f7f7; border-left: 3px solid var(--border); border-radius: 0 var(--radius) var(--radius) 0;
  padding: 0.6rem 0.85rem; margin-bottom: 0.75rem; font-size: 0.88rem; color: var(--text-muted);
  word-break: break-word; overflow-wrap: anywhere;
}
.ctx-label { font-weight: 600; color: var(--text); }
.post-risk-row { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.75rem; }
.risk-summary { font-size: 0.85rem; color: var(--text-muted); }

/* Human classification buttons */
.human-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin-bottom: 0.5rem; }
.human-row .btn-remove-post { margin-left: auto; }
.human-label-text { font-size: 0.85rem; font-weight: 600; color: var(--text); }
.human-btn {
  padding: 0.3rem 0.7rem; border-radius: var(--radius); font-size: 0.82rem; font-weight: 600;
  border: 1px solid var(--border); background: var(--bg-card); color: var(--text); cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.human-btn:hover { border-color: var(--accent); }
.human-ok.active { background: rgba(46, 125, 50, 0.15); border-color: var(--success); color: var(--success); }
.human-nao-ok.active { background: rgba(198, 40, 40, 0.15); border-color: var(--danger); color: var(--danger); }

/* Tags */
.tags-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; }
.tags-label { font-size: 0.85rem; font-weight: 600; color: var(--text); margin-right: 0.25rem; }
.tag-badge {
  display: inline-flex; align-items: center; gap: 0.25rem;
  background: var(--accent); color: #fff; font-size: 0.78rem; font-weight: 600;
  padding: 0.2rem 0.55rem; border-radius: 12px;
}
.tag-remove { background: none; border: none; color: #fff; font-size: 0.9rem; cursor: pointer; padding: 0; line-height: 1; }
.tag-input {
  border: 1px dashed var(--border); border-radius: var(--radius); padding: 0.2rem 0.5rem;
  font-size: 0.82rem; width: 80px; background: var(--bg-card); color: var(--text);
}
.tag-input:focus { border-color: var(--accent); outline: none; }

.hide { display: none !important; }
