/* reports-revops — identidade Logcomex (mesma paleta do kpis-revops) */
:root {
  --purple-darkest: hsl(266, 84%, 22%);
  --purple: hsl(266, 84%, 44%);
  --purple-mid: hsl(266, 80%, 60%);
  --purple-lightest: hsl(266, 84%, 96%);
  --orange: hsl(31, 99%, 55%);
  --gradient: linear-gradient(135deg, hsl(266, 80%, 60%), hsl(31, 99%, 58%));
  --ink: #0b0d19;
  --text: hsl(224, 15%, 20%);
  --text-muted: hsl(220, 9%, 46%);
  --bg: hsl(220, 20%, 98%);
  --surface: #fff;
  --border: hsl(220, 13%, 91%);
  --warning: hsl(38, 92%, 45%);
  --warning-light: hsl(38, 92%, 94%);
  --danger: hsl(0, 72%, 51%);
  --danger-light: hsl(0, 84%, 95%);
  --info-light: hsl(199, 89%, 94%);
  --radius: 14px;
  --shadow: 0 1px 2px rgba(11, 13, 25, .06), 0 4px 16px rgba(11, 13, 25, .05);
  --shadow-hover: 0 2px 4px rgba(11, 13, 25, .08), 0 12px 28px rgba(102, 19, 208, .12);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: "Poppins", system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--purple); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ── Cabeçalho ─────────────────────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 12px 28px;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); }
.brand img { width: 30px; height: 30px; }
.brand strong { font-size: 1.05rem; font-weight: 600; white-space: nowrap; }
.brand span { font-size: .8rem; color: var(--text-muted); display: block; margin-top: -2px; }
.topbar-right { display: flex; align-items: center; gap: 14px; }
.nav-link {
  font-size: .85rem; font-weight: 500; text-decoration: none; color: var(--purple);
  padding: 6px 12px; border-radius: 999px; background: var(--purple-lightest);
}
.session-chip { display: flex; align-items: center; gap: 10px; }
.avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--gradient); color: #fff;
  display: grid; place-items: center; font-size: .8rem; font-weight: 600;
  overflow: hidden; flex-shrink: 0;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.session-info { display: flex; flex-direction: column; line-height: 1.2; }
.session-info strong { font-size: .85rem; font-weight: 600; color: var(--ink); }
.session-info small { font-size: .75rem; color: var(--text-muted); }
.btn-ghost {
  font: inherit; font-size: .8rem; cursor: pointer;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  padding: 6px 12px; border-radius: 8px;
}
.btn-ghost:hover { border-color: var(--purple-mid); color: var(--purple); }

/* ── Hub ───────────────────────────────────────────────── */
.page { max-width: 1180px; margin: 0 auto; padding: 32px 28px 64px; }
.page-head h1 { margin: 0; font-size: 1.6rem; font-weight: 600; color: var(--ink); }
.page-head p { margin: 4px 0 0; color: var(--text-muted); }
.categoria { margin-top: 36px; }
.categoria h2 {
  font-size: .78rem; text-transform: uppercase; letter-spacing: .08em;
  color: var(--text-muted); font-weight: 600; margin: 0 0 12px;
}
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.card {
  position: relative; display: flex; flex-direction: column; gap: 8px;
  padding: 20px; min-height: 140px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); text-decoration: none; color: inherit;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.card::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 4px;
  border-radius: var(--radius) var(--radius) 0 0; background: var(--gradient); opacity: .85;
}
.card:hover, .card:focus-visible { transform: translateY(-2px); box-shadow: var(--shadow-hover); border-color: var(--purple-mid); outline: none; }
.card h3 { margin: 4px 0 0; font-size: 1rem; font-weight: 600; color: var(--ink); }
.card p { margin: 0; font-size: .85rem; color: var(--text-muted); }
.card-foot { margin-top: auto; display: flex; gap: 8px; align-items: center; font-size: .75rem; color: var(--text-muted); }
.badge { font-size: .7rem; font-weight: 600; padding: 2px 8px; border-radius: 999px; }
.badge-rascunho { background: var(--warning-light); color: var(--warning); }
.badge-externo { background: var(--info-light); color: hsl(199, 89%, 32%); }
.empty {
  margin-top: 48px; padding: 40px; text-align: center;
  background: var(--surface); border: 1px dashed var(--border); border-radius: var(--radius);
  color: var(--text-muted);
}

/* ── Login / páginas simples ───────────────────────────── */
.center-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: var(--bg); }
.login-card {
  width: 100%; max-width: 400px; padding: 40px 36px; text-align: center;
  background: var(--surface); border: 1px solid var(--border); border-radius: 20px; box-shadow: var(--shadow);
}
.login-card img { width: 48px; height: 48px; }
.login-card h1 { font-size: 1.35rem; margin: 16px 0 4px; color: var(--ink); font-weight: 600; }
.login-card p { margin: 0 0 24px; color: var(--text-muted); font-size: .9rem; }
.btn-google {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; width: 100%;
  padding: 12px 16px; border-radius: 10px; border: none; cursor: pointer;
  background: var(--purple); color: #fff; font: inherit; font-weight: 500; text-decoration: none;
}
.btn-google:hover { background: var(--purple-darkest); }
.alert { padding: 10px 12px; border-radius: 10px; font-size: .85rem; margin-bottom: 16px; text-align: left; }
.alert-erro { background: var(--danger-light); color: var(--danger); }
.alert-aviso { background: var(--purple-lightest); color: var(--purple); }
.login-card .foot-note { margin: 16px 0 0; font-size: .75rem; color: var(--text-muted); }

@media (max-width: 640px) {
  .topbar { padding: 10px 16px; }
  .brand span { display: none; }
  .nav-link { white-space: nowrap; padding: 6px 10px; }
  .session-info { display: none; }
  .page { padding: 24px 16px 48px; }
}

/* ── Administração ─────────────────────────────────────── */
.muted { color: var(--text-muted); }
.tabs { display: flex; gap: 4px; margin: 28px 0 20px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.tab {
  font: inherit; font-size: .9rem; font-weight: 500; cursor: pointer;
  padding: 10px 16px; border: none; background: none; color: var(--text-muted);
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tab:hover { color: var(--purple); }
.tab.ativa { color: var(--purple); border-bottom-color: var(--purple); }
.tabela-wrap { overflow-x: auto; border-radius: var(--radius); }
.tabela {
  width: 100%; min-width: 560px; border-collapse: collapse; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow);
}
.tabela th, .tabela td { padding: 12px 14px; text-align: left; vertical-align: middle; border-bottom: 1px solid var(--border); font-size: .88rem; }
.tabela th { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); font-weight: 600; background: var(--bg); }
.tabela tr:last-child td { border-bottom: none; }
.tabela .acoes { text-align: right; white-space: nowrap; }
.badge-status-ativo { background: hsl(142, 71%, 94%); color: hsl(142, 71%, 28%); }
.badge-status-rascunho { background: var(--warning-light); color: var(--warning); }
.badge-status-arquivado { background: var(--bg); color: var(--text-muted); border: 1px solid var(--border); }
.painel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; margin-bottom: 16px; box-shadow: var(--shadow); }
.painel h3 { margin: 0 0 4px; font-size: 1rem; color: var(--ink); }
.lista-emails { margin: 8px 0 0; padding-left: 18px; font-size: .9rem; }
.barra { display: flex; gap: 8px; align-items: center; margin-top: 14px; }
.barra .espaco { flex: 1; }
#aba-grupos > .barra { margin: 0 0 14px; justify-content: flex-end; }
textarea, select, input[type=text] {
  width: 100%; font: inherit; font-size: .88rem; padding: 8px 10px;
  border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); margin-top: 4px;
}
textarea:focus, select:focus, input[type=text]:focus { outline: 2px solid var(--purple-mid); outline-offset: -1px; }
textarea:disabled { background: var(--bg); color: var(--text-muted); }
.btn-primario {
  font: inherit; font-size: .85rem; font-weight: 500; cursor: pointer;
  padding: 8px 16px; border-radius: 8px; border: none; background: var(--purple); color: #fff;
}
.btn-primario:hover { background: var(--purple-darkest); }
.btn-primario:disabled { opacity: .5; cursor: not-allowed; }
.btn-perigo {
  font: inherit; font-size: .8rem; cursor: pointer; padding: 6px 12px; border-radius: 8px;
  border: 1px solid var(--danger-light); background: var(--surface); color: var(--danger);
}
.btn-perigo:hover { background: var(--danger-light); }
.dialogo {
  width: min(560px, calc(100vw - 32px)); border: 1px solid var(--border); border-radius: 16px;
  padding: 24px; box-shadow: 0 24px 64px rgba(11, 13, 25, .25); color: var(--text);
}
.dialogo::backdrop { background: rgba(11, 13, 25, .45); }
.dialogo h3 { margin: 0; color: var(--ink); }
.dialogo label { display: block; margin-top: 14px; font-size: .85rem; font-weight: 500; }
.dialogo fieldset { border: 1px solid var(--border); border-radius: 8px; margin: 14px 0 0; padding: 8px 12px 12px; }
.dialogo fieldset:disabled { opacity: .5; }
.dialogo legend { font-size: .85rem; font-weight: 500; padding: 0 4px; }
.check { display: flex !important; align-items: center; gap: 8px; font-weight: 400 !important; }
.checks { display: flex; flex-wrap: wrap; gap: 4px 18px; }
.checks .check { margin-top: 6px; }
.erro { color: var(--danger); background: var(--danger-light); padding: 8px 10px; border-radius: 8px; font-size: .85rem; }
.toast {
  position: fixed; right: 24px; bottom: 24px; z-index: 50; max-width: 380px;
  padding: 12px 16px; border-radius: 10px; font-size: .88rem; box-shadow: var(--shadow-hover);
  background: var(--ink); color: #fff;
}
.toast-erro { background: var(--danger); }
.toast-aviso { background: var(--warning); }
@media (max-width: 760px) {
  .tabela th:nth-child(2), .tabela td:nth-child(2), .tabela th:nth-child(5), .tabela td:nth-child(5) { display: none; }
}
@media (max-width: 480px) {
  .brand div { display: none; }
  .topbar-right { gap: 8px; }
}

.form-linha { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; margin-top: 12px; }
.form-linha label { display: flex; flex-direction: column; font-size: .82rem; font-weight: 500; flex: 1; min-width: 160px; }
.form-linha input[readonly] { flex: 1; min-width: 240px; font-family: ui-monospace, monospace; font-size: .8rem; }
.tv-gerado { margin-top: 14px; padding: 12px 14px; border-radius: 10px; background: var(--purple-lightest); }
.tv-gerado p { margin: 0; font-size: .88rem; }
#aba-tv .tabela-wrap { margin-top: 16px; }
