:root {
    --bg: #0a0a0f;
    --surface: #141420;
    --border: #2a2a3a;
    --text: #e8e8f0;
    --text-muted: #8888a0;
    --accent: #7c5cfc;
    --accent-hover: #6a4ae0;
    --success: #22c55e;
    --warning: #f59e0b;
    --danger: #ef4444;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--text);
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 220px;
    background: var(--surface);
    border-right: 1px solid var(--border);
    padding: 24px 16px;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
}

.logo {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 32px;
    padding: 0 8px;
}

.nav-link {
    display: block;
    color: var(--text-muted);
    text-decoration: none;
    padding: 10px 12px;
    border-radius: 8px;
    margin-bottom: 4px;
    font-size: 14px;
    transition: all 0.2s;
}

.nav-link:hover { background: var(--border); color: var(--text); }

.content {
    margin-left: 220px;
    padding: 32px 40px;
    flex: 1;
    max-width: 1200px;
}

.page-header { margin-bottom: 32px; }
.page-header h1 { font-size: 28px; font-weight: 700; }
.page-header p { color: var(--text-muted); margin-top: 4px; }

.section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
}

.section h2 { font-size: 18px; margin-bottom: 16px; }

/* ─── Stats Row ────────────────────────────────────────────── */

.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 32px;
    font-weight: 700;
    color: var(--accent);
}

.stat-label {
    display: block;
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 4px;
}

.stat-link {
    display: inline-block;
    margin-top: 8px;
    font-size: 12px;
    color: var(--accent);
    text-decoration: none;
}

/* ─── Quick Actions ────────────────────────────────────────── */

.quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 12px;
}

.action-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 20px 16px;
    text-align: center;
    text-decoration: none;
    color: var(--text);
    font-size: 13px;
    line-height: 1.4;
    transition: border-color 0.2s;
}

.action-card:hover { border-color: var(--accent); }
.action-card:first-child { font-size: 24px; }

/* ─── Client Grid ──────────────────────────────────────────── */

.client-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }

.client-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 16px;
    text-decoration: none;
    color: var(--text);
    transition: border-color 0.2s;
}

.client-card:hover { border-color: var(--accent); }
.client-card h3 { font-size: 16px; margin-bottom: 8px; }

.badge {
    display: inline-block;
    background: var(--accent);
    color: white;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

/* ─── Post List ────────────────────────────────────────────── */

.post-list { display: flex; flex-direction: column; gap: 12px; }

.post-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--text);
}

.post-type {
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    white-space: nowrap;
}

.post-type.reel { background: #7c5cfc33; color: #7c5cfc; }
.post-type.carousel { background: #22c55e33; color: #22c55e; }
.post-type.static { background: #f59e0b33; color: #f59e0b; }
.post-type.story { background: #ef444433; color: #ef4444; }

.post-status {
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 500;
    white-space: nowrap;
}

.post-status.draft { background: #8888a033; color: #8888a0; }
.post-status.scheduled { background: #7c5cfc33; color: #7c5cfc; }
.post-status.published { background: #22c55e33; color: #22c55e; }
.post-status.approved { background: #22c55e33; color: #22c55e; }

.post-hook { flex: 1; font-size: 14px; }
.post-date { color: var(--text-muted); font-size: 12px; white-space: nowrap; }

.empty-state { color: var(--text-muted); font-size: 14px; }

/* ─── Approval Queue ───────────────────────────────────────── */

.filter-bar {
    margin-bottom: 16px;
}

.filter-group label {
    font-size: 13px;
    color: var(--text-muted);
    margin-right: 8px;
}

.filter-group select {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 12px;
    color: var(--text);
    font-size: 14px;
}

.approval-list { display: flex; flex-direction: column; gap: 16px; }

.approval-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    transition: opacity 0.3s;
}

.approval-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
}

.approval-body {
    padding: 16px;
}

.approval-body .content-block {
    margin-bottom: 12px;
}

.approval-body .content-block label {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 4px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.approval-body .content-block p {
    font-size: 14px;
    line-height: 1.6;
}

.approval-body .content-block .hashtags {
    color: var(--accent);
    font-size: 13px;
}

.feedback-block {
    background: #f59e0b10;
    border: 1px solid #f59e0b33;
    border-radius: 8px;
    padding: 12px;
}

.rejection-block {
    background: #ef444410;
    border: 1px solid #ef444433;
    border-radius: 8px;
    padding: 12px;
}

.approval-actions {
    padding: 16px;
    border-top: 1px solid var(--border);
}

.approval-actions .feedback-input textarea {
    width: 100%;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 12px;
    color: var(--text);
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    margin-bottom: 12px;
}

.action-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.btn-approve {
    background: var(--success);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
}

.btn-reject {
    background: var(--border);
    color: var(--text);
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-schedule {
    background: var(--accent);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-approve:hover,
.btn-reject:hover,
.btn-schedule:hover { opacity: 0.85; }

.approval-meta {
    padding: 10px 16px;
    background: #22c55e10;
    font-size: 12px;
    color: var(--success);
}

/* ─── Modal ────────────────────────────────────────────────── */

.modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
    min-width: 320px;
}

.modal-content h3 { margin-bottom: 16px; }

.modal-content .form-group { margin-bottom: 16px; }
.modal-content label { display: block; font-size: 13px; color: var(--text-muted); margin-bottom: 6px; }
.modal-content input { width: 100%; background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 10px; color: var(--text); }

/* ─── Outreach Tabs ────────────────────────────────────────── */

.outreach-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.tab-btn {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 18px;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.tab-btn.active {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

.tab-btn:hover:not(.active) {
    border-color: var(--accent);
    color: var(--text);
}

.tab-content { display: none; }
.tab-content.active { display: block; }

.tab-desc {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 16px;
}

/* ─── Outreach Output ──────────────────────────────────────── */

.outreach-result {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px;
}

.outreach-text {
    white-space: pre-wrap;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.7;
    color: var(--text);
    margin-bottom: 12px;
}

.btn-small {
    background: var(--border);
    color: var(--text);
    border: none;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-small:hover { background: var(--accent); color: white; }

/* ─── Publishing ───────────────────────────────────────────── */

.status-badge {
    display: inline-block;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
}

.status-badge.connected { background: #22c55e33; color: #22c55e; }
.status-badge.disconnected { background: #ef444433; color: #ef4444; }

.setup-guide {
    margin-top: 16px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px;
}

.setup-guide h3 { font-size: 14px; margin-bottom: 12px; }
.setup-guide ol { padding-left: 20px; }
.setup-guide li { font-size: 13px; color: var(--text-muted); margin-bottom: 8px; line-height: 1.5; }
.setup-guide a { color: var(--accent); }

.btn-publish {
    background: var(--success);
    color: white;
    border: none;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}

.btn-publish:hover { opacity: 0.85; }

/* ─── Forms ────────────────────────────────────────────────── */

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.generator-form .form-group,
.form-group { margin-bottom: 16px; }

.generator-form label,
.form-group label { display: block; font-size: 13px; color: var(--text-muted); margin-bottom: 6px; }

.generator-form select,
.generator-form input,
.generator-form textarea,
.form-group select,
.form-group input,
.form-group textarea {
    width: 100%;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 12px;
    color: var(--text);
    font-size: 14px;
    font-family: inherit;
}

.generator-form textarea,
.form-group textarea { min-height: 80px; resize: vertical; }

.btn-primary {
    background: var(--accent);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-primary:hover { background: var(--accent-hover); }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }

/* ─── Generated Content ────────────────────────────────────── */

.generated-block {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
}

.generated-block h3 {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.generated-block pre {
    white-space: pre-wrap;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text);
}

/* ─── Post Detail ──────────────────────────────────────────── */

.content-block {
    margin-bottom: 20px;
}

.content-block label {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 6px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.content-block p,
.content-block pre {
    font-size: 14px;
    line-height: 1.7;
}

.content-block .highlight {
    font-size: 18px;
    font-weight: 600;
    color: var(--accent);
}

.content-block pre.caption-full {
    font-family: inherit;
    white-space: pre-wrap;
}

.content-block .hashtags {
    color: var(--accent);
    font-size: 13px;
}

.back-link { margin-top: 24px; }
.back-link a { color: var(--accent); text-decoration: none; font-size: 14px; }

/* ─── Profile ──────────────────────────────────────────────── */

.profile-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }

code {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 8px 12px;
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 13px;
    display: block;
    margin: 8px 0;
}
/* ─── Auth Pages ───────────────────────────────────────────── */
.auth-box { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 40px; max-width: 420px; margin: 60px auto; }
.auth-box h1 { font-size: 1.8rem; margin-bottom: 8px; }
.auth-box p { color: var(--text-muted); margin-bottom: 24px; }

/* ─── Status Badges ────────────────────────────────────────── */
.status-draft { color: #8888a0; }
.status-approved { color: #22c55e; }
.status-scheduled { color: #7c5cfc; }
.status-published { color: #22c55e; }
.status-archived { color: #666; }
.badge-success { background: #22c55e33; color: #22c55e; }
.badge-danger { background: #ef444433; color: #ef4444; }

/* ─── Table ────────────────────────────────────────────────── */
table { width: 100%; border-collapse: collapse; }
table th { text-align: left; padding: 12px; color: var(--text-muted); font-size: 0.8rem; border-bottom: 1px solid var(--border); }
table td { padding: 12px; border-bottom: 1px solid #1a1a2e; }
table tr:hover { background: #1a1a2e88; }

/* ─── Select ───────────────────────────────────────────────── */
select { background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; color: var(--text); font-size: 14px; font-family: inherit; }
select:focus { outline: none; border-color: var(--accent); }

/* ─── Error ────────────────────────────────────────────────── */
.error-box { background: #2a1a1a; border: 1px solid #5a2a2a; color: #ff6b6b; padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; }
