/* ============================================================
   Copy? Vende! — Prospector — Stylesheet
   ============================================================ */
:root {
  --yellow:   #F5C400;
  --black:    #0A0A0A;
  --dark:     #141414;
  --card-bg:  #1A1A1A;
  --border:   #2A2A2A;
  --text:     #F0F0F0;
  --muted:    #888;
  --danger:   #C0392B;
  --success:  #27AE60;
  --warn:     #E67E22;
  --sidebar-w: 220px;
  --radius:   8px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--black);
  color: var(--text);
  display: flex;
  min-height: 100vh;
  font-size: 14px;
  line-height: 1.5;
}

/* ── Sidebar ─────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--dark);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  padding: 1.5rem 1rem;
  z-index: 10;
}
.sidebar-logo { margin-bottom: 2rem; }
.sidebar-logo-img {
  display: block;
  width: 180px;
  max-width: 100%;
  height: auto;
  margin-bottom: 8px;
}
.logo-sub {
  display: block;
  font-size: .7rem;
  color: var(--muted);
  letter-spacing: 1.5px;
  margin-top: 2px;
}
.sidebar-nav { flex: 1; }
.nav-item {
  display: flex; align-items: center; gap: .6rem;
  padding: .65rem .85rem;
  border-radius: 8px;
  color: var(--muted);
  text-decoration: none;
  font-size: .875rem;
  transition: background .15s, color .15s;
  margin-bottom: 2px;
}
.nav-item:hover { background: #222; color: var(--text); }
.nav-item.active { background: #222; color: var(--yellow); }
.nav-icon { font-size: 1rem; }
.sidebar-footer { font-size: .7rem; color: var(--muted); }

/* ── Main ────────────────────────────────────────────────── */
.main {
  margin-left: var(--sidebar-w);
  flex: 1;
  padding: 2rem;
  max-width: 100%;
}

/* ── Page header ─────────────────────────────────────────── */
.page-header { margin-bottom: 1.5rem; }
.page-title  { font-size: 1.4rem; font-weight: 600; }
.page-sub    { font-size: .85rem; color: var(--muted); margin-top: .25rem; }

/* ── Cards ───────────────────────────────────────────────── */
.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}
.card-title { font-size: 1rem; font-weight: 600; margin-bottom: 1rem; }

/* ── Forms ───────────────────────────────────────────────── */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 1rem; }
.form-row  { display: grid; grid-template-columns: repeat(4,1fr); gap: 1rem; margin-bottom: 1rem; }
.search-options { grid-template-columns: repeat(2, minmax(180px, 280px)); }
.category-search-row { grid-template-columns: repeat(2, minmax(240px, 420px)); }
.form-group { display: flex; flex-direction: column; gap: .35rem; }
.form-label { font-size: .8rem; color: var(--muted); font-weight: 500; }
.form-label .hint { font-weight: 400; }
.form-input {
  background: #111;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  padding: .6rem .75rem;
  font-size: .875rem;
  font-family: inherit;
  resize: vertical;
  width: 100%;
  transition: border-color .15s;
}
.form-input:focus { outline: none; border-color: var(--yellow); }
.search-note { margin: -.25rem 0 1rem; font-size: .8rem; }

.toggle-label { display: flex; align-items: center; gap: .5rem; cursor: pointer; color: var(--muted); font-size: .875rem; }
.toggle-label input[type=checkbox] { accent-color: var(--yellow); width: 16px; height: 16px; }

/* ── Buttons ─────────────────────────────────────────────── */
.btn-primary {
  background: var(--yellow);
  color: var(--black);
  border: none;
  border-radius: 8px;
  padding: .75rem 1.5rem;
  font-size: .95rem;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
  margin-top: .5rem;
  transition: background .15s, opacity .15s;
}
.btn-primary:hover    { background: #d4a900; }
.btn-primary:disabled { opacity: .45; cursor: not-allowed; }

.btn-outline {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: .5rem 1rem;
  font-size: .85rem;
  cursor: pointer;
  transition: background .15s;
}
.btn-outline:hover { background: #222; }

.btn-sm {
  background: var(--yellow);
  color: var(--black);
  border: none;
  border-radius: 6px;
  padding: .4rem .9rem;
  font-size: .8rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  margin-top: .5rem;
}
.btn-sm:hover { background: #d4a900; }

.btn-icon { background: none; border: none; cursor: pointer; font-size: 1rem; color: var(--muted); padding: .2rem; }
.btn-icon:hover { color: var(--danger); }

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--yellow);
  outline-offset: 2px;
}

/* ── Messages ────────────────────────────────────────────── */
.msg-box { border-radius: 8px; padding: .75rem 1rem; font-size: .875rem; margin-top: .75rem; }
.msg-error { background: #2C1010; border: 1px solid #5C2020; color: #FF8080; }
.msg-warn  { background: #2C2010; border: 1px solid #5C4020; color: #FFB060; }
.msg-success { background: #10281B; border: 1px solid #245C3A; color: #8FE0AA; }

/* ── Progress ────────────────────────────────────────────── */
.progress-wrap  { margin-top: .9rem; }
.progress-status { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: .45rem; }
.progress-track { background: #222; border-radius: 100px; height: 8px; overflow: hidden; }
.progress-bar   { height: 100%; background: var(--yellow); border-radius: 100px; transition: width .3s; }
.progress-label { font-size: .75rem; color: var(--muted); }
.progress-percent { color: var(--yellow); font-size: .85rem; }
.operation-progress { margin: 0 0 1.25rem; }

/* ── Stats ───────────────────────────────────────────────── */
.stats-row { display: grid; grid-template-columns: repeat(3,1fr); gap: 1rem; margin-bottom: 1.25rem; }
.stat-card { background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.25rem; }
.stat-val  { font-size: 1.8rem; font-weight: 600; color: var(--yellow); }
.stat-lbl  { font-size: .75rem; color: var(--muted); margin-top: .2rem; }

/* ── Table toolbar ───────────────────────────────────────── */
.table-toolbar { display: flex; justify-content: space-between; align-items: center; gap: .75rem; margin-bottom: .75rem; flex-wrap: wrap; }
.results-filter-bar { display: grid; grid-template-columns: repeat(3, minmax(160px, 220px)); gap: .75rem; padding: 1rem 0; margin-bottom: 1rem; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
#view-prospects #detailContent { margin-top: .45rem; }
.toolbar-actions { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.select-cell { text-align: center; }
.select-cell input { width: 16px; height: 16px; accent-color: var(--yellow); cursor: pointer; }
.select-cell input:disabled { cursor: not-allowed; opacity: .45; }
.profile-meta { color: var(--muted); font-size: .72rem; margin-top: .2rem; line-height: 1.3; }
.analysis-state { display: inline-block; margin-top: 4px; font-size: .68rem; color: var(--muted); }

/* ── Table ───────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border); }
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 42px;
  padding: .65rem 0;
  color: var(--muted);
  font-size: .78rem;
}
.pagination label, .pagination-nav { display: flex; align-items: center; gap: .5rem; }
.pagination-size {
  min-width: 62px;
  height: 32px;
  padding: 0 .5rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #111;
  color: var(--text);
  font: inherit;
}
.pagination-btn {
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 1.15rem;
}
.pagination-btn:hover:not(:disabled) { border-color: var(--yellow); color: var(--yellow); }
.pagination-btn:disabled { opacity: .35; cursor: not-allowed; }
table { width: 100%; border-collapse: collapse; font-size: .8rem; }
thead th {
  text-align: left;
  padding: .7rem .85rem;
  font-size: .72rem;
  font-weight: 600;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  background: var(--dark);
  white-space: nowrap;
}
td { padding: .7rem .85rem; border-bottom: 1px solid var(--border); vertical-align: top; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: #1E1E1E; }
.td-name    { font-weight: 500; max-width: 160px; }
.td-firstline { max-width: 200px; font-size: .75rem; }
.no-wrap    { white-space: nowrap; }
.italic     { font-style: italic; }

.sort-btn { background: none; border: none; cursor: pointer; font-size: .72rem; color: var(--muted); font-weight: 600; padding: 0; }
.sort-btn:hover { color: var(--text); }

.empty { text-align: center; padding: 2.5rem; color: var(--muted); }

/* ── Score badges ────────────────────────────────────────── */
.score-badge { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 50%; font-size: .75rem; font-weight: 700; }
.score-detail-btn { border: 0; padding: 0; font-family: inherit; cursor: pointer; }
.score-detail-btn:hover, .score-detail-btn:focus-visible { outline: 2px solid var(--yellow); outline-offset: 2px; }
.score-hi { background: #1A3A1A; color: #4CAF50; }
.score-md { background: #3A2A10; color: #E67E22; }
.score-lo { background: #3A1010; color: #E74C3C; }

/* ── Score details ───────────────────────────────────────── */
.score-dialog { width: min(480px, calc(100% - 2rem)); max-height: calc(100vh - 2rem); overflow-y: auto; background: var(--card-bg); color: var(--text); border: 1px solid var(--border); border-radius: 8px; padding: 0; margin: auto; }
.score-dialog::backdrop { background: rgba(0, 0, 0, .72); }
.score-dialog-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; padding: 1.1rem 1.25rem; border-bottom: 1px solid var(--border); }
.score-dialog-header h2 { font-size: 1rem; margin-top: .15rem; }
.score-dialog-label { display: block; color: var(--muted); font-size: .68rem; text-transform: uppercase; }
.score-dialog-close { width: 30px; height: 30px; border: 1px solid var(--border); border-radius: 6px; background: transparent; color: var(--muted); font-size: 1.25rem; cursor: pointer; }
.score-dialog-close:hover { color: var(--text); background: #222; }
.score-dialog-content { padding: 1.25rem; }
.score-dialog-summary { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.score-dialog-summary strong { display: block; font-size: .9rem; }
.score-dialog-summary span:not(.score-dialog-total) { display: block; color: var(--muted); font-size: .72rem; margin-top: .15rem; }
.score-dialog-total { display: inline-flex; align-items: center; justify-content: center; width: 42px; height: 42px; border-radius: 50%; background: var(--yellow); color: var(--black); font-size: 1rem; font-weight: 700; flex: 0 0 auto; }
.score-reasons { border-top: 1px solid var(--border); }
.score-reason { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .65rem 0; border-bottom: 1px solid var(--border); font-size: .82rem; }
.score-reason strong { color: var(--success); }
.score-reason-missing { color: var(--muted); }
.score-reason-missing strong { color: var(--muted); }
.score-note { color: var(--warn); font-size: .75rem; margin-top: .85rem; }
.score-ai-reason { font-size: .85rem; line-height: 1.6; padding-bottom: 1rem; border-bottom: 1px solid var(--border); }
.score-dialog-content h3 { font-size: .78rem; margin: 1rem 0 .45rem; }
.score-problem-list { padding-left: 1.1rem; color: var(--muted); font-size: .8rem; }
.score-problem-list li { margin-bottom: .35rem; }
.score-detail-line { border-top: 1px solid var(--border); margin-top: 1rem; padding-top: 1rem; }
.score-detail-line span { color: var(--muted); font-size: .7rem; }
.score-detail-line p { font-size: .82rem; margin-top: .25rem; }

/* ── Tags ────────────────────────────────────────────────── */
.tag { display: inline-block; font-size: .7rem; padding: 2px 7px; border-radius: 100px; background: #252525; color: var(--muted); margin: 2px 2px 0 0; white-space: nowrap; }

/* ── Contact ─────────────────────────────────────────────── */
.contact-row { font-size: .75rem; margin-bottom: 2px; }
.link { color: #5B9BD5; text-decoration: none; font-size: .75rem; }
.link:hover { text-decoration: underline; }

/* ── Status select ───────────────────────────────────────── */
.status-sel { background: #111; border: 1px solid var(--border); border-radius: 5px; color: var(--muted); font-size: .7rem; padding: .2rem .4rem; margin-top: 4px; cursor: pointer; }
.status-sel:focus { outline: none; border-color: var(--yellow); }

/* ── History ─────────────────────────────────────────────── */
.history-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 1rem; }
.history-card { background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; }
.history-header { display: flex; align-items: center; gap: .5rem; margin-bottom: .5rem; }
.history-id { font-size: .75rem; color: var(--yellow); font-weight: 600; }
.history-meta { font-size: .85rem; margin-bottom: .4rem; }
.history-stats { font-size: .75rem; color: var(--muted); margin-bottom: .75rem; }
.error-text { color: #FF8080; }

/* ── Categories ──────────────────────────────────────────── */
.category-page-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.category-form { max-width: 920px; }
.category-form-actions { display: flex; justify-content: flex-end; gap: .6rem; }
.category-form-actions .btn-sm { margin-top: 0; }
.category-list { margin-top: 1rem; }
.category-table td { vertical-align: middle; }
.category-table .td-name { min-width: 150px; }
.category-open-btn { margin: 0; white-space: nowrap; }
.category-row-actions { display: flex; gap: .4rem; align-items: center; }
.category-edit-btn { padding: .35rem .6rem; font-size: .75rem; }
.category-history-tag { color: var(--yellow); }
.category-back { display: block; border: 0; background: transparent; color: var(--muted); font: inherit; font-size: .78rem; cursor: pointer; margin-bottom: .55rem; }
.category-back:hover { color: var(--yellow); }
.category-stats-row { grid-template-columns: repeat(4, 1fr); }

/* ── Ignorados da busca ─────────────────────────────────── */
.ignored-section { margin-top: 1rem; border-top: 1px solid var(--border); }
.ignored-section summary { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 0; color: var(--muted); font-size: .8rem; font-weight: 600; cursor: pointer; list-style-position: inside; }
.ignored-section summary:hover { color: var(--text); }
.ignored-table-wrap { margin-top: 0; }
.ignored-table-wrap td { color: var(--muted); }
.ignored-table-wrap .td-name { color: var(--text); }
.ignored-problems { min-width: 220px; max-width: 360px; }
.ignored-actions { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; min-width: 110px; }
.ignored-open-btn { margin: 0; white-space: nowrap; }
.ignored-count { display: inline-flex; min-width: 24px; height: 24px; align-items: center; justify-content: center; padding: 0 .45rem; border-radius: 12px; background: #252525; color: var(--text); font-size: .7rem; }
.export-option { display: inline-flex; align-items: center; gap: .4rem; min-height: 32px; color: var(--muted); font-size: .72rem; cursor: pointer; white-space: nowrap; }
.export-option input { accent-color: var(--yellow); }
.suggestion-review-btn { margin-top: .35rem; }
.instagram-suggestion-content { padding: 1rem 1.25rem 1.25rem; }
.suggestion-business { display: flex; justify-content: space-between; gap: 1rem; margin: 0 0 .75rem; font-size: .82rem; }
.suggestion-business span { color: var(--muted); }
.suggestion-item { padding: .85rem 0; border-top: 1px solid var(--border); }
.suggestion-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.suggestion-header strong, .suggestion-header span { display: block; }
.suggestion-header strong { font-size: .85rem; }
.suggestion-header div span { margin-top: .15rem; color: var(--muted); font-size: .72rem; }
.suggestion-category { margin: .45rem 0 0; color: var(--yellow); font-size: .72rem; }
.suggestion-bio { margin: .45rem 0 0; color: var(--muted); font-size: .75rem; line-height: 1.5; }
.suggestion-signals { margin-top: .4rem; }
.suggestion-actions { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: .65rem; }

/* ── Utils ───────────────────────────────────────────────── */
.muted { color: var(--muted); }
small.muted { font-size: .72rem; display: block; }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 768px) {
  .sidebar {
    width: 100%;
    height: 68px;
    top: auto;
    right: 0;
    bottom: 0;
    padding: .35rem .5rem;
    border-right: 0;
    border-top: 1px solid var(--border);
    flex-direction: row;
    align-items: stretch;
    z-index: 50;
  }
  .sidebar-logo { display: none; }
  .sidebar-nav {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    flex: 1;
  }
  .nav-item {
    min-width: 0;
    margin: 0;
    padding: .25rem;
    flex-direction: column;
    justify-content: center;
    gap: .05rem;
    font-size: .66rem;
    line-height: 1.2;
    text-align: center;
  }
  .nav-icon { font-size: .95rem; line-height: 1; }
  .sidebar-footer {
    width: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-left: 1px solid var(--border);
  }
  .sidebar-footer small { display: none; }
  .main { margin-left: 0; padding: 1rem 1rem 5.75rem; }
  .form-grid, .form-row, .stats-row, .results-filter-bar, .category-stats-row { grid-template-columns: 1fr; }
  .category-page-header { flex-direction: column; }
  .toolbar-actions { width: 100%; }
  .toolbar-actions > * { flex: 1 1 auto; }
  .pagination { align-items: stretch; }
  .pagination-nav { justify-content: flex-end; }
}

.logout-form { margin: 0; }
.logout-link {
  display: block;
  padding: 0;
  margin: 0 0 .4rem;
  border: 0;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: .76rem;
  text-decoration: none;
  cursor: pointer;
}
.logout-link:hover { color: var(--yellow); }
@media (max-width: 768px) {
  .logout-link { margin: 0; padding: .45rem .25rem; }
}
