*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #0f0f0f; --surface: #161616; --border: #2d2d2d;
  --text: #e5e7eb; --muted: #6b7280; --purple: #7c3aed;
  --linkedin: #0a66c2; --instagram: #e1306c; --facebook: #1877f2;
}

body { background: var(--bg); color: var(--text); font-family: system-ui, sans-serif; font-size: 14px; min-height: 100vh; }

/* ── Login ─────────────────────────────────────────────────────────────────── */
.login-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.login-card { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 32px; width: 100%; max-width: 380px; }
.login-card .logo { font-size: 20px; font-weight: 700; color: var(--purple); margin-bottom: 24px; }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.field input { width: 100%; padding: 9px 12px; background: var(--bg); border: 1px solid var(--border); border-radius: 6px; color: var(--text); font-size: 14px; }
.field input:focus { outline: none; border-color: var(--purple); }
.error-msg { color: #f87171; font-size: 12px; margin-bottom: 12px; }
button[type=submit] { width: 100%; padding: 10px; background: var(--purple); color: white; border: none; border-radius: 6px; font-size: 14px; font-weight: 600; cursor: pointer; }
button[type=submit]:disabled { opacity: 0.6; cursor: not-allowed; }

/* ── Header ────────────────────────────────────────────────────────────────── */
header { background: var(--surface); border-bottom: 1px solid var(--border); padding: 0 20px; }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 52px; }
.header-logo { font-weight: 700; color: var(--purple); }
#logout-btn { padding: 6px 14px; font-size: 12px; background: transparent; border: 1px solid var(--border); color: var(--muted); border-radius: 6px; cursor: pointer; }
#logout-btn:hover { border-color: var(--purple); color: var(--text); }
#week-nav { display: flex; align-items: center; gap: 10px; }
#week-nav button { background: transparent; border: 1px solid var(--border); color: var(--muted); padding: 4px 10px; border-radius: 6px; cursor: pointer; }
#week-nav button:hover { border-color: var(--purple); color: var(--text); }
#week-label { font-size: 13px; color: var(--muted); min-width: 140px; text-align: center; }

/* ── Client tabs ───────────────────────────────────────────────────────────── */
.client-tabs { display: flex; gap: 8px; padding: 12px 20px; border-bottom: 1px solid var(--border); overflow-x: auto; }
.tab { background: var(--surface); border: 1px solid var(--border); border-radius: 6px; padding: 5px 14px; font-size: 12px; color: var(--muted); cursor: pointer; white-space: nowrap; }
.tab.active { border-color: var(--purple); color: var(--purple); background: #1a1033; }

/* ── Main content ──────────────────────────────────────────────────────────── */
main { padding: 20px; max-width: 860px; margin: 0 auto; }
.stats-bar { display: flex; gap: 12px; margin-bottom: 16px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: 6px; padding: 8px 16px; font-size: 12px; }
.stat span { font-weight: 700; font-size: 18px; display: block; }

/* ── Post cards ────────────────────────────────────────────────────────────── */
.posts-list { display: flex; flex-direction: column; gap: 12px; }
.post-card { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 16px; }
.post-card.status-approved { border-color: #1a4a1a; }
.post-card.status-rejected { border-color: #4a1a1a; opacity: 0.6; }
.post-card.status-posted   { border-color: #1a2a4a; opacity: 0.7; }
.post-card.status-failed   { border-color: #4a1a2a; opacity: 0.7; }

.post-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; flex-wrap: wrap; gap: 8px; }
.platform-badge { font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 4px; color: white; }
.platform-badge.linkedin  { background: var(--linkedin); }
.platform-badge.instagram { background: var(--instagram); }
.platform-badge.facebook  { background: var(--facebook); }
.post-meta { font-size: 11px; color: var(--muted); }
.post-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.post-copy { font-size: 13px; line-height: 1.6; white-space: pre-wrap; color: var(--text); }
.post-copy[contenteditable=true] { outline: 1px solid var(--purple); border-radius: 4px; padding: 6px; cursor: text; }

.image-row { margin-top: 10px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.image-row label { font-size: 11px; color: var(--muted); white-space: nowrap; }
.image-row input { flex: 1; min-width: 200px; padding: 5px 8px; background: var(--bg); border: 1px solid var(--border); border-radius: 4px; color: var(--text); font-size: 12px; }

.action-btn { font-size: 11px; padding: 4px 12px; border-radius: 4px; border: 1px solid var(--border); cursor: pointer; background: var(--surface); color: var(--text); }
.action-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.action-btn.approve { background: #1a3a1a; color: #4ade80; border-color: #2d5a2d; }
.action-btn.reject  { background: #3a1a1a; color: #f87171; border-color: #5a2d2d; }
.action-btn.approve:hover:not(:disabled) { background: #16a34a; color: white; border-color: #16a34a; }
.action-btn.reject:hover:not(:disabled)  { background: #dc2626; color: white; border-color: #dc2626; }

.status-badge { font-size: 10px; padding: 2px 8px; border-radius: 4px; font-weight: 600; }
.status-badge.pending  { background: #2a2a10; color: #fbbf24; }
.status-badge.approved { background: #1a3a1a; color: #4ade80; }
.status-badge.rejected { background: #3a1a1a; color: #f87171; }
.status-badge.posted   { background: #1a2a3a; color: #60a5fa; }
.status-badge.failed   { background: #3a1a2a; color: #f472b6; }

.loading { color: var(--muted); text-align: center; padding: 40px; }
.empty-state { color: var(--muted); text-align: center; padding: 60px; font-size: 15px; }
