/* Páginas internas (dashboard, admin). Mesmo visual escuro/neon do editor. */
:root {
  color-scheme: dark;
  --page: #07070d;
  --surface: #12121c;        /* superfície dos cards e gráficos */
  --surface-2: #0b0b14;
  --line: #262640;
  --grid: #24243a;
  --text: #ecebf7;
  --text-2: #c3c2d6;
  --muted: #8b8ba8;
  --accent: #00f0ff;
  --accent-2: #ff2bd6;
  --danger: #ff3b5c;
  --good: #0ca30c;
  --warning: #fab219;
  --s-youtube: #3987e5;      /* série 1 (validada no fundo escuro) */
  --s-instagram: #d95926;    /* série 2 */
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--page); color: var(--text); font: 14px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
html.auth-wait body { visibility: hidden; }
a { color: var(--accent); }
[hidden] { display: none !important; }

/* topo */
.top {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 10px 20px; border-bottom: 1px solid var(--line);
  background: rgba(7, 7, 13, .88); backdrop-filter: blur(10px);
}
.top .brand { font-weight: 700; font-size: 17px; text-decoration: none;
  background: linear-gradient(90deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.top nav { display: flex; gap: 4px; flex: 1; }
.top nav a { padding: 6px 12px; border-radius: 8px; color: var(--text-2); text-decoration: none; }
.top nav a:hover { background: var(--surface); color: var(--text); }
.top nav a.on { background: var(--surface); color: var(--text); box-shadow: inset 0 -2px 0 var(--accent); }
.me { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); }
.avatar { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; overflow: hidden; flex: none;
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #001018; font-weight: 700; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }

main.wrap { max-width: 1200px; margin: 0 auto; padding: 22px 20px 60px; }
h1.title { margin: 0 0 4px; font-size: 24px; }
p.sub { margin: 0 0 20px; color: var(--muted); }
h2 { font-size: 16px; margin: 0 0 12px; }

.card { padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
/* itens de grade podem encolher (tabelas largas rolam dentro do card, sem alargar a página) */
.grid, .grid > *, .card { min-width: 0; }

.btn { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--surface-2); color: var(--text); font: inherit; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { border-color: var(--accent); }
.btn.primary { background: linear-gradient(90deg, var(--accent), #4d6bff); color: #001018; border: 0; font-weight: 700; }
.btn.danger { color: var(--danger); border-color: rgba(255, 59, 92, .45); }
.btn.small { padding: 4px 9px; font-size: 12px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

input, select { padding: 7px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text); font: inherit; }
input:focus, select:focus { outline: none; border-color: var(--accent); }

.pill { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: 99px; font-size: 11px; border: 1px solid var(--line); white-space: nowrap; }
.pill.active, .pill.published { color: #39ff14; border-color: rgba(57, 255, 20, .5); }
.pill.pending, .pill.queued, .pill.processing, .pill.uploading { color: var(--warning); border-color: rgba(250, 178, 25, .5); }
.pill.disabled, .pill.error { color: var(--danger); border-color: rgba(255, 59, 92, .5); }
.pill.admin { color: var(--accent); border-color: rgba(0, 240, 255, .5); }

table.t { width: 100%; border-collapse: collapse; font-size: 13px; }
table.t th { text-align: left; font-weight: 600; color: var(--muted); font-size: 12px; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.t td { padding: 9px 10px; border-bottom: 1px solid var(--grid); vertical-align: middle; }
table.t td.num, table.t th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.t tr:hover td { background: rgba(255, 255, 255, .02); }
.scroll-x { overflow-x: auto; }

.net { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 5px; flex: none; }
.net svg { width: 14px; height: 14px; }
.net.instagram { color: #fff; background: radial-gradient(circle at 30% 107%, #fdf497 0%, #fd5949 45%, #d6249f 60%, #285aeb 90%); }
.net.youtube, .net.google { background: #fff; }

.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); padding: 10px 16px; border-radius: 10px;
  background: #1c1c30; border: 1px solid var(--line); box-shadow: 0 10px 30px rgba(0, 0, 0, .5); z-index: 50; }
.empty { padding: 30px; text-align: center; color: var(--muted); }

@media (max-width: 720px) {
  .top { padding: 10px 16px; }
  .top nav { order: 3; flex-basis: 100%; }
  main.wrap { padding: 16px 16px 50px; }
}
