[hidden] { display: none !important; }
:root {
  --bg: #0b0d12;
  --bg-2: #10131a;
  --card: #151924;
  --card-2: #1b2030;
  --line: #262c3d;
  --text: #e8ebf3;
  --muted: #8b93a7;
  --accent: #8b5cf6;
  --accent-2: #a78bfa;
  --pink: #ff3d7f;
  --cyan: #22d3ee;
  --ok: #22c55e;
  --warn: #f59e0b;
  --bad: #ef4444;
  --radius: 14px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.5 ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; }
a { color: var(--accent-2); }
h1, h2, h3 { margin: 0; font-weight: 650; letter-spacing: -0.01em; }
h2 { font-size: 16px; }
h3 { font-size: 14px; }
small, .muted { color: var(--muted); }
code { background: var(--card-2); padding: 1px 6px; border-radius: 6px; font-size: 12px; }

/* Topo */
.topbar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 24px; padding: 12px 24px; background: rgba(11, 13, 18, .85); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 16px; }
.logo { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: linear-gradient(135deg, var(--pink), var(--accent) 55%, var(--cyan)); color: #fff; font-size: 16px; }
.tabs { display: flex; gap: 4px; flex: 1; }
.tabs a { padding: 7px 14px; border-radius: 9px; color: var(--muted); text-decoration: none; font-weight: 550; }
.tabs a:hover { color: var(--text); background: var(--card); }
.tabs a.active { color: var(--text); background: var(--card-2); }
.user { display: flex; align-items: center; gap: 10px; }
.user img { width: 28px; height: 28px; border-radius: 50%; }

main { max-width: 1180px; margin: 0 auto; padding: 24px; display: grid; gap: 20px; }
#banner:empty { display: none; }
#banner { max-width: 1180px; margin: 16px auto 0; padding: 0 24px; display: grid; gap: 8px; }

.alert { padding: 10px 14px; border-radius: 10px; border: 1px solid; font-size: 13px; }
.alert.info { background: rgba(34, 211, 238, .07); border-color: rgba(34, 211, 238, .3); }
.alert.warn { background: rgba(245, 158, 11, .08); border-color: rgba(245, 158, 11, .35); }
.alert.bad { background: rgba(239, 68, 68, .08); border-color: rgba(239, 68, 68, .35); }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.grow { flex: 1; }
.grid { display: grid; gap: 16px; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.stat .label { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
.stat .value { font-size: 26px; font-weight: 700; margin-top: 4px; }
.stat .sub { color: var(--muted); font-size: 12px; }

/* Botões e campos */
button, .btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 34px; padding: 0 14px; border-radius: 9px; border: 1px solid var(--line); background: var(--card-2); color: var(--text); font: inherit; font-weight: 550; cursor: pointer; text-decoration: none; white-space: nowrap; }
button:hover, .btn:hover { border-color: #3a4258; }
button:disabled { opacity: .5; cursor: not-allowed; }
.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.primary:hover { background: #7c4ef0; border-color: #7c4ef0; }
.danger { color: #fca5a5; }
.danger:hover { border-color: var(--bad); }
.ghost { background: transparent; }
.sm { height: 28px; padding: 0 10px; font-size: 12px; border-radius: 8px; }

input, select, textarea { width: 100%; background: var(--bg-2); color: var(--text); border: 1px solid var(--line); border-radius: 9px; padding: 8px 10px; font: inherit; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); }
textarea { resize: vertical; min-height: 80px; }
label.field { display: grid; gap: 5px; font-size: 12px; color: var(--muted); font-weight: 550; }
label.check { display: flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; }
label.check input { width: auto; accent-color: var(--accent); }
.form-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.span-2 { grid-column: span 2; }
.span-4 { grid-column: 1 / -1; }

/* Badges */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 99px; font-size: 11.5px; font-weight: 600; background: var(--card-2); color: var(--muted); border: 1px solid var(--line); white-space: nowrap; }
.badge.ok { color: #86efac; border-color: rgba(34, 197, 94, .35); background: rgba(34, 197, 94, .08); }
.badge.warn { color: #fcd34d; border-color: rgba(245, 158, 11, .35); background: rgba(245, 158, 11, .08); }
.badge.bad { color: #fca5a5; border-color: rgba(239, 68, 68, .35); background: rgba(239, 68, 68, .08); }
.badge.info { color: #67e8f9; border-color: rgba(34, 211, 238, .35); background: rgba(34, 211, 238, .08); }
.badge.accent { color: #c4b5fd; border-color: rgba(139, 92, 246, .4); background: rgba(139, 92, 246, .1); }

/* Agenda */
.sched-row { display: grid; grid-template-columns: 220px 1fr; gap: 14px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); }
.sched-row:first-of-type { border-top: 0; }
.acct { display: flex; align-items: center; gap: 10px; min-width: 0; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--card-2); object-fit: cover; flex: none; display: grid; place-items: center; font-weight: 700; color: var(--muted); }
.acct .name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 9px; background: var(--bg-2); border: 1px solid var(--line); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.chip .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.chip.done .dot { background: var(--ok); }
.chip.failed .dot, .chip.no_content .dot { background: var(--bad); }
.chip.posting .dot, .chip.processing .dot { background: var(--cyan); animation: pulse 1s infinite; }
.chip.skipped { opacity: .55; text-decoration: line-through; }
.chip.pending .dot { background: var(--accent-2); }
@keyframes pulse { 50% { opacity: .3; } }

/* Contas */
.accounts { display: grid; grid-template-columns: repeat(auto-fill, minmax(520px, 1fr)); gap: 16px; }
.account-card .head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.account-card .head .avatar { width: 44px; height: 44px; }
.account-card .actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; flex-wrap: wrap; }
.switch { position: relative; width: 40px; height: 22px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; border-radius: 99px; background: var(--line); cursor: pointer; transition: .15s; }
.switch span::after { content: ''; position: absolute; left: 3px; top: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: .15s; }
.switch input:checked + span { background: var(--ok); }
.switch input:checked + span::after { transform: translateX(18px); }

/* Upload */
.dropzone { border: 1.5px dashed #3a4258; border-radius: var(--radius); padding: 26px; text-align: center; cursor: pointer; transition: .15s; background: var(--bg-2); }
.dropzone:hover, .dropzone.over { border-color: var(--accent); background: rgba(139, 92, 246, .06); }
.dropzone strong { display: block; font-size: 15px; margin-bottom: 4px; }
.preview-groups { display: grid; gap: 10px; margin-top: 14px; }
.preview-group { display: flex; align-items: center; gap: 8px; padding: 8px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg-2); }
.preview-group .n { width: 64px; flex: none; font-size: 12px; color: var(--muted); text-align: center; }
.thumbs { display: flex; gap: 6px; overflow-x: auto; }
.thumb { width: 54px; height: 72px; border-radius: 7px; object-fit: cover; background: var(--card-2); flex: none; border: 1px solid var(--line); }
.progress { height: 6px; border-radius: 99px; background: var(--line); overflow: hidden; }
.progress > div { height: 100%; width: 0; background: linear-gradient(90deg, var(--pink), var(--accent)); transition: width .2s; }

/* Lista de publicações */
.filters { display: flex; gap: 6px; }
.filters button.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.posts { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.post { background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; display: flex; flex-direction: column; }
.post .strip { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 2px; aspect-ratio: 16 / 10; overflow: hidden; background: #000; cursor: pointer; flex: none; }
.post .strip img, .post .strip video { width: 100%; height: 100%; object-fit: cover; display: block; }
.post .body { padding: 10px 12px; display: grid; gap: 6px; flex: 1; align-content: start; }
.post .caption { font-size: 12.5px; color: #c9cfdd; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; white-space: pre-wrap; min-height: 18px; }
.post .meta { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.post .foot { display: flex; gap: 6px; padding: 8px 12px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.post .error { font-size: 12px; color: #fca5a5; }

/* Tabela */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; font-weight: 600; }
td.err { color: #fca5a5; font-size: 12.5px; max-width: 360px; }

/* Modal */
dialog { background: var(--card); color: var(--text); border: 1px solid var(--line); border-radius: 16px; padding: 0; width: min(760px, 94vw); max-height: 90vh; }
dialog::backdrop { background: rgba(0, 0, 0, .6); backdrop-filter: blur(2px); }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.modal-body { padding: 20px; display: grid; gap: 14px; overflow: auto; max-height: calc(90vh - 130px); }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--line); }
.edit-photos { display: flex; gap: 10px; flex-wrap: wrap; }
.edit-photo { position: relative; width: 110px; }
.edit-photo img, .edit-photo video { width: 110px; height: 150px; object-fit: cover; border-radius: 9px; border: 2px solid var(--line); display: block; }
.edit-photo.cover img { border-color: var(--accent); }
.edit-photo .ctrls { display: flex; gap: 3px; margin-top: 5px; justify-content: center; }
.edit-photo .ctrls button { height: 24px; padding: 0 7px; font-size: 12px; }
.edit-photo .tag { position: absolute; top: 6px; left: 6px; }

.empty { text-align: center; padding: 34px; color: var(--muted); }

/* Toasts */
#toasts { position: fixed; right: 20px; bottom: 20px; display: grid; gap: 8px; z-index: 100; }
.toast { padding: 10px 14px; border-radius: 10px; background: var(--card-2); border: 1px solid var(--line); box-shadow: 0 10px 30px rgba(0, 0, 0, .4); max-width: 380px; animation: up .2s ease-out; }
.toast.ok { border-color: rgba(34, 197, 94, .5); }
.toast.bad { border-color: rgba(239, 68, 68, .5); }
@keyframes up { from { transform: translateY(8px); opacity: 0; } }

@media (max-width: 900px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .form-grid { grid-template-columns: repeat(2, 1fr); }
  .accounts { grid-template-columns: 1fr; }
  .sched-row { grid-template-columns: 1fr; }
  .topbar { flex-wrap: wrap; gap: 10px; }
}

/* Login */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(800px 400px at 50% -10%, rgba(139, 92, 246, .25), transparent), var(--bg); }
.login-card { width: min(400px, 100%); text-align: center; padding: 36px 30px; }
.login-card .logo { width: 56px; height: 56px; font-size: 28px; border-radius: 16px; margin: 0 auto 16px; }
.login-card h1 { font-size: 24px; margin-bottom: 6px; }
.discord-btn { width: 100%; height: 44px; margin-top: 24px; background: #5865f2; border-color: #5865f2; color: #fff; font-size: 15px; }
.discord-btn:hover { background: #4752c4; border-color: #4752c4; }

/* Páginas de termos e privacidade */
.doc-page{max-width:760px;margin:40px auto;padding:28px 32px;line-height:1.6}
.doc-page h1{margin:0 0 4px}
.doc-page h2{font-size:17px;margin:22px 0 6px}
.doc-page ul{padding-left:20px}
.doc-page a{color:inherit}
