:root {
  --wine: #5e1924;
  --wine-dark: #4a141c;
  --bg: #f7f4f1;
  --card: #ffffff;
  --border: #e4ddd7;
  --text: #2b2320;
  --text-muted: #6b5f58;
  --success: #2f7d4f;
  --success-bg: #e7f5ec;
  --pending: #a3690b;
  --pending-bg: #fbf0dd;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
}
a { color: var(--wine); text-decoration: none; }
a:hover { text-decoration: underline; }

.admin-topbar {
  background: var(--wine);
  color: #fff;
  padding: 14px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.admin-topbar .brand { color: #fff; font-weight: 600; font-size: 16px; }
.admin-topbar nav { display: flex; align-items: center; gap: 20px; font-size: 14px; }
.admin-topbar a { color: #f1dfe1; }
.admin-topbar a:hover { color: #fff; }
.admin-topbar form { display: inline; }
.admin-topbar button.link-btn {
  background: none; border: none; color: #f1dfe1; font-size: 14px; cursor: pointer; padding: 0; font-family: inherit;
}
.admin-topbar button.link-btn:hover { color: #fff; text-decoration: underline; }

.admin-main { max-width: 1100px; margin: 0 auto; padding: 32px 24px 64px; }

.admin-header-row { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px; margin-bottom: 24px; }
.admin-header-row h1 { font-size: 22px; margin: 0; }

.btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--wine); color: #fff; border: none; border-radius: 8px;
  padding: 10px 18px; font-size: 14.5px; font-weight: 600; cursor: pointer; font-family: inherit;
}
.btn:hover { background: var(--wine-dark); text-decoration: none; }
.btn-outline { background: #fff; color: var(--wine); border: 1.5px solid var(--wine); }
.btn-outline:hover { background: #fbeef0; }
.btn-secondary { background: #ede7e3; color: var(--text); }
.btn-secondary:hover { background: #e1d9d3; }
.btn-danger { background: #a3352c; }
.btn-danger:hover { background: #872a22; }
.btn-sm { padding: 6px 12px; font-size: 13px; }

.filters { display: flex; gap: 8px; margin-bottom: 20px; }
.filters a {
  padding: 7px 14px; border-radius: 100px; font-size: 13.5px; font-weight: 600;
  background: #fff; border: 1px solid var(--border); color: var(--text-muted);
}
.filters a.active { background: var(--wine); color: #fff; border-color: var(--wine); }

table.posts-table { width: 100%; border-collapse: collapse; background: var(--card); border-radius: 10px; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,0.06); }
table.posts-table th, table.posts-table td { padding: 14px 16px; text-align: left; font-size: 14.5px; border-bottom: 1px solid var(--border); }
table.posts-table th { background: #faf7f5; font-size: 12.5px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); }
table.posts-table tr:last-child td { border-bottom: none; }
table.posts-table td.actions { display: flex; gap: 8px; flex-wrap: wrap; }

.badge { display: inline-block; padding: 4px 10px; border-radius: 100px; font-size: 12.5px; font-weight: 600; }
.badge-aprovado { background: var(--success-bg); color: var(--success); }
.badge-a_analisar { background: var(--pending-bg); color: var(--pending); }

.empty-state { text-align: center; padding: 64px 24px; color: var(--text-muted); background: var(--card); border-radius: 10px; }

/* Login */
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--bg); padding: 24px; }
.login-card { background: #fff; border-radius: 14px; padding: 40px 36px; width: 100%; max-width: 380px; box-shadow: 0 4px 24px rgba(0,0,0,0.08); }
.login-card .brand-mark { width: 44px; height: 44px; display: block; margin: 0 auto 16px; }
.login-card h1 { font-size: 19px; text-align: center; margin: 0 0 28px; }
.login-card .field { margin-bottom: 16px; }
.login-card label { display: block; font-size: 13.5px; font-weight: 600; margin-bottom: 6px; }
.login-card input { width: 100%; padding: 11px 13px; border-radius: 8px; border: 1.5px solid var(--border); font-size: 15px; font-family: inherit; }
.login-card .btn { width: 100%; justify-content: center; padding: 12px; margin-top: 8px; }
.login-error { background: #fbeaea; color: #a3352c; padding: 10px 14px; border-radius: 8px; font-size: 13.5px; margin-bottom: 16px; }

/* Editor */
.editor-grid { display: grid; grid-template-columns: 1fr 280px; gap: 24px; align-items: start; }
.editor-card { background: var(--card); border-radius: 10px; padding: 24px; box-shadow: 0 1px 3px rgba(0,0,0,0.06); }
.editor-card + .editor-card { margin-top: 20px; }
.field { margin-bottom: 18px; }
.field:last-child { margin-bottom: 0; }
.field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.03em; }
.field input[type=text], .field textarea {
  width: 100%; padding: 10px 12px; border-radius: 8px; border: 1.5px solid var(--border); font-size: 15px; font-family: inherit;
}
.field textarea { resize: vertical; }
.field-hint { font-size: 12.5px; color: var(--text-muted); margin-top: 4px; }

#quill-editor { background: #fff; border-radius: 0 0 8px 8px; min-height: 420px; }
.ql-toolbar { border-radius: 8px 8px 0 0 !important; }

.status-box { text-align: center; }
.status-box .badge { font-size: 14px; padding: 6px 16px; margin-bottom: 16px; }
.status-box .btn { width: 100%; justify-content: center; margin-bottom: 10px; }
.status-box .btn:last-child { margin-bottom: 0; }

.saved-toast { background: var(--success-bg); color: var(--success); padding: 10px 16px; border-radius: 8px; font-size: 14px; margin-bottom: 20px; }

@media (max-width: 820px) {
  .editor-grid { grid-template-columns: 1fr; }
}
