:root {
  --primary: #1a5f4a;
  --primary-dark: #123f31;
  --bg: #f6f7f5;
  --border: #dde2df;
  --danger: #b3413a;
  --text: #1f2a26;
}

* { box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  margin: 0;
}

.topbar {
  background: var(--primary-dark);
  color: white;
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.topbar h1 { font-size: 1.2rem; margin: 0; }

.topbar nav a {
  color: white;
  text-decoration: none;
  margin-left: 1.5rem;
  font-size: 0.9rem;
}

main { padding: 2rem; max-width: 900px; margin: 0 auto; }

.btn-primary {
  background: var(--primary);
  color: white !important;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  font-size: 0.9rem;
  text-decoration: none;
  display: inline-block;
}

.btn-danger {
  background: none;
  border: 1px solid var(--danger);
  color: var(--danger);
  padding: 0.3rem 0.7rem;
  border-radius: 6px;
  cursor: pointer;
}

.flash {
  padding: 0.7rem 1rem;
  border-radius: 6px;
  margin-bottom: 1rem;
}
.flash-success { background: #e1f3ea; color: #14532d; }
.flash-error { background: #fbe3e1; color: #7a2018; }

.posts-table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  border-radius: 8px;
  overflow: hidden;
}

.posts-table th, .posts-table td {
  padding: 0.7rem 1rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
  font-size: 0.9rem;
}

.badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  margin-right: 0.3rem;
  color: white;
}
.badge-instagram { background: linear-gradient(45deg, #f09433, #dc2743, #bc1888); }
.badge-x { background: #000; }

.status { padding: 0.15rem 0.5rem; border-radius: 4px; font-size: 0.75rem; }
.status-pending { background: #fff3cd; color: #856404; }
.status-published { background: #d4edda; color: #155724; }
.status-failed { background: #f8d7da; color: #721c24; }
.status-partial { background: #ffe5d0; color: #8a4b00; }
.status-publishing { background: #d1ecf1; color: #0c5460; }

.error-log { font-size: 0.7rem; color: var(--danger); cursor: help; }

.post-form {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  background: white;
  padding: 1.5rem;
  border-radius: 8px;
  max-width: 600px;
}

.post-form label { font-weight: 600; font-size: 0.85rem; margin-top: 0.6rem; }
.post-form input, .post-form textarea {
  padding: 0.5rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-family: inherit;
}

.ai-row { display: flex; gap: 0.5rem; }
.ai-row input { flex: 1; }
.ai-row button {
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 6px;
  padding: 0.5rem 0.8rem;
  cursor: pointer;
}

#ai-status { font-size: 0.8rem; color: #555; min-height: 1em; }

.checkbox-row { display: flex; gap: 1.5rem; font-weight: normal !important; }
.checkbox-row label { font-weight: normal; margin-top: 0; }

.empty-state { color: #666; }
