/* Social Dashboard - Self-contained CSS (no Tailwind dependency) */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --sidebar-width: 256px;
    --sidebar-collapsed-width: 56px;
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1e293b;
    --pink-600: #db2777;
    --purple-600: #7c3aed;
    --blue-600: #2563eb;
    --green-600: #16a34a;
    --amber-600: #d97706;
    --red-500: #ef4444;
    --red-600: #dc2626;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--gray-100);
    color: var(--gray-700);
    line-height: 1.5;
    font-size: 14px;
}

a { text-decoration: none; color: inherit; }
svg { display: inline-block; vertical-align: middle; width: 1.25rem; height: 1.25rem; flex-shrink: 0; }

/* ── Sidebar ── */
.sidebar {
    width: var(--sidebar-width);
    min-height: 100vh;
    background: linear-gradient(180deg, #1e1b4b 0%, #312e81 100%);
    position: fixed;
    left: 0; top: 0;
    z-index: 40;
    display: flex;
    flex-direction: column;
    transition: width 0.25s ease;
    overflow: hidden;
}
.sidebar-header { padding: 1.5rem; white-space: nowrap; }
.sidebar-header h1 { font-size: 1.15rem; font-weight: 700; color: #fff; letter-spacing: -0.02em; }
.sidebar-header p { color: #a5b4fc; font-size: 0.75rem; margin-top: 0.25rem; }
.sidebar-nav { margin-top: 0.5rem; flex: 1; }
.sidebar-nav a {
    display: flex; align-items: center; gap: 0.75rem;
    padding: 0.7rem 1.25rem; color: #c7d2fe;
    border-radius: 0.5rem; margin: 0.2rem 0.75rem;
    font-size: 0.875rem; transition: all 0.15s;
    white-space: nowrap; overflow: hidden;
}
.sidebar-nav a:hover, .sidebar-nav a.active { background: rgba(255,255,255,0.1); color: #fff; }
.sidebar-nav svg { width: 1.25rem; height: 1.25rem; flex-shrink: 0; }

/* ── Sidebar Toggle Button ── */
.sidebar-toggle {
    position: absolute; top: 1.1rem; right: -12px;
    width: 24px; height: 24px; border-radius: 50%;
    background: var(--primary); color: #fff;
    border: 2px solid #fff; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.65rem; z-index: 41; transition: transform 0.25s ease;
    box-shadow: 0 1px 4px rgba(0,0,0,0.2);
    padding: 0; line-height: 1;
}
.sidebar-toggle:hover { background: var(--primary-dark); }

/* ── Sidebar Collapsed State ── */
.sidebar.collapsed { width: var(--sidebar-collapsed-width); }
.sidebar.collapsed .sidebar-header h1,
.sidebar.collapsed .sidebar-header p,
.sidebar.collapsed .sidebar-footer { opacity: 0; pointer-events: none; }
.sidebar.collapsed .nav-label,
.sidebar.collapsed .nav-group-arrow,
.sidebar.collapsed .nav-group-items { display: none !important; }
.sidebar.collapsed .sidebar-header { padding: 1.5rem 0.5rem; }
.sidebar.collapsed .sidebar-nav a { padding: 0.7rem 0; justify-content: center; margin: 0.2rem 0.4rem; overflow: hidden; }
.sidebar.collapsed .nav-group { margin: 0.2rem 0.4rem; }
.sidebar.collapsed .nav-group-toggle { padding: 0.7rem 0; justify-content: center; overflow: hidden; }
.sidebar.collapsed .sidebar-toggle { transform: rotate(180deg); }
.sidebar.collapsed + .main-content { margin-left: var(--sidebar-collapsed-width); }

/* ── Nav Group (expandable sidebar items) ── */
.nav-group { margin: 0.2rem 0.75rem; }
.nav-group-toggle {
    display: flex; align-items: center; gap: 0.75rem;
    padding: 0.7rem 1.25rem; color: #c7d2fe;
    border-radius: 0.5rem; font-size: 0.875rem;
    cursor: pointer; transition: all 0.15s;
    margin: 0; border: none; background: none; width: 100%;
    text-align: left;
}
.nav-group-toggle:hover, .nav-group.open .nav-group-toggle { background: rgba(255,255,255,0.1); color: #fff; }
.nav-group-arrow {
    margin-left: auto; font-size: 0.6rem; transition: transform 0.2s;
    color: #818cf8;
}
.nav-group.open .nav-group-arrow { transform: rotate(90deg); }
.nav-group-items {
    display: none; padding-left: 1rem;
}
.nav-group.open .nav-group-items { display: block; }
.nav-group-items a {
    display: flex; align-items: center; gap: 0.5rem;
    padding: 0.45rem 1rem; color: #a5b4fc;
    border-radius: 0.4rem; margin: 0.1rem 0;
    font-size: 0.8rem; transition: all 0.15s;
}
.nav-group-items a:hover, .nav-group-items a.active { background: rgba(255,255,255,0.08); color: #fff; }
.nav-group-items a .nav-dot {
    width: 5px; height: 5px; border-radius: 50%; background: #818cf8; flex-shrink: 0;
}
.nav-group-items a.active .nav-dot { background: #fff; }

.sidebar-footer { padding: 1rem 1.5rem; color: #818cf8; font-size: 0.7rem; }

/* ── Main ── */
.main-content { margin-left: var(--sidebar-width); padding: 1.5rem; min-height: 100vh; transition: margin-left 0.25s ease; }

/* ── Page Header ── */
.page-header { margin-bottom: 1.5rem; }
.page-header h2 { font-size: 1.5rem; font-weight: 700; color: var(--gray-800); }
.page-header p { font-size: 0.85rem; color: var(--gray-500); margin-top: 0.25rem; }
.page-header-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.5rem; }

/* ── Grid / Flex ── */
.grid { display: grid; gap: 1rem; }
.grid-6 { grid-template-columns: repeat(6, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-1 { grid-template-columns: 1fr; }
.col-span-2 { grid-column: span 2; }
.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.items-end { align-items: flex-end; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.flex-1 { flex: 1; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.ml-1 { margin-left: 0.25rem; }
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }
.py-8 { padding-top: 2rem; padding-bottom: 2rem; }
.px-5 { padding-left: 1.25rem; padding-right: 1.25rem; }
.pb-4 { padding-bottom: 1rem; }

/* ── KPI Card ── */
.kpi-card {
    background: #fff; border-radius: 0.75rem; padding: 1.25rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1); border: 1px solid var(--gray-200);
}
.kpi-card .value { font-size: 2rem; font-weight: 700; color: var(--gray-800); }
.kpi-card .label { font-size: 0.8rem; color: var(--gray-500); margin-top: 0.2rem; }
.kpi-card .value.pink { color: var(--pink-600); }
.kpi-card .value.purple { color: var(--purple-600); }
.kpi-card .value.blue { color: var(--blue-600); }
.kpi-card .value.green { color: var(--green-600); }
.kpi-card .value.amber { color: var(--amber-600); }

/* ── Card ── */
.card {
    background: #fff; border-radius: 0.75rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1); border: 1px solid var(--gray-200);
}
.card-header {
    padding: 1rem 1.25rem; border-bottom: 1px solid var(--gray-200);
    display: flex; align-items: center; justify-content: space-between;
}
.card-header h3 { font-size: 0.95rem; font-weight: 600; color: var(--gray-700); }
.card-header span { font-size: 0.8rem; color: var(--gray-400); }
.card-body { padding: 1.25rem; }
.card-body.overflow-x { overflow-x: auto; }
.chart-container { height: 300px; position: relative; }

/* ── Buttons ── */
.btn {
    display: inline-flex; align-items: center; gap: 0.5rem;
    padding: 0.5rem 1rem; border-radius: 0.5rem;
    font-size: 0.875rem; font-weight: 500;
    cursor: pointer; transition: all 0.15s;
    border: none; white-space: nowrap;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-danger { background: var(--red-500); color: #fff; }
.btn-danger:hover { background: var(--red-600); }
.btn-outline { background: #fff; color: var(--gray-700); border: 1px solid var(--gray-300); }
.btn-outline:hover { background: var(--gray-50); }
.btn-sm { padding: 0.35rem 0.7rem; font-size: 0.8rem; }

/* ── Badge ── */
.badge {
    display: inline-block; padding: 0.2rem 0.6rem;
    border-radius: 9999px; font-size: 0.72rem; font-weight: 500;
}
.badge-instagram { background: #fce7f3; color: #be185d; }
.badge-threads { background: #ede9fe; color: #6d28d9; }
.badge-all { background: #e0e7ff; color: #3730a3; }
.badge-active { background: #dcfce7; color: #166534; }
.badge-inactive { background: #fee2e2; color: #991b1b; }
.badge-running { background: #fef3c7; color: #92400e; }
.badge-completed { background: #dcfce7; color: #166534; }
.badge-failed { background: #fee2e2; color: #991b1b; }
.badge-green { background: #dcfce7; color: #166534; }
.badge-gray { background: #f3f4f6; color: #6b7280; }
.badge-amber { background: #fef3c7; color: #92400e; }

/* ── Tables ── */
table { width: 100%; border-collapse: collapse; }
table th {
    text-align: left; padding: 0.75rem; font-size: 0.75rem;
    font-weight: 600; color: var(--gray-500);
    text-transform: uppercase; letter-spacing: 0.05em;
    border-bottom: 2px solid var(--gray-200);
}
table td {
    padding: 0.75rem; font-size: 0.85rem;
    border-bottom: 1px solid var(--gray-100); color: var(--gray-700);
}
table tr:hover { background: var(--gray-50); }
.text-center { text-align: center; }
.font-medium { font-weight: 500; }
.font-mono { font-family: ui-monospace, monospace; }
.post-text { max-width: 400px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Forms ── */
input[type="text"], input[type="number"], select {
    border: 1px solid var(--gray-300); border-radius: 0.5rem;
    padding: 0.5rem 0.75rem; font-size: 0.85rem;
    outline: none; transition: box-shadow 0.15s;
    font-family: inherit;
}
input[type="text"]:focus, input[type="number"]:focus, select:focus {
    box-shadow: 0 0 0 2px rgba(99,102,241,0.3);
    border-color: var(--primary);
}
.input-full { width: 100%; }

/* ── Keyword Tags ── */
.keyword-tag {
    display: inline-flex; align-items: center; gap: 0.25rem;
    background: var(--gray-100); border-radius: 9999px;
    padding: 0.25rem 0.75rem; font-size: 0.85rem;
}
.keyword-tag .badge { cursor: pointer; }
.keyword-tag button {
    background: none; border: none; color: var(--gray-400);
    cursor: pointer; font-size: 1rem; padding: 0; line-height: 1;
}
.keyword-tag button:hover { color: var(--red-500); }

/* ── Progress Bar ── */
.progress-bar {
    width: 100%; height: 8px; background: var(--gray-200);
    border-radius: 9999px; overflow: hidden;
}
.progress-bar .fill {
    height: 100%; background: var(--primary);
    border-radius: 9999px; transition: width 0.5s;
}
.collect-status { font-size: 0.85rem; color: var(--gray-500); }

/* ── Modal ── */
.modal-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,0.5);
    display: flex; align-items: center; justify-content: center; z-index: 50;
}
.modal {
    background: #fff; border-radius: 0.75rem; padding: 1.5rem;
    min-width: 400px; max-width: 800px; width: 90%;
    max-height: 80vh; overflow-y: auto;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25);
}
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.modal-header h3 { font-size: 1.1rem; font-weight: 700; color: var(--gray-800); }
.modal-close {
    background: none; border: none; color: var(--gray-400);
    cursor: pointer; font-size: 1.5rem; line-height: 1;
}
.modal-close:hover { color: var(--gray-600); }
.modal-body { padding: 0; }



/* ── Tag Analysis ── */
.balance-bar {
    display: inline-block; width: 50px; height: 6px;
    background: var(--gray-200); border-radius: 9999px;
    overflow: hidden; vertical-align: middle; margin-right: 0.25rem;
}
.balance-fill { height: 100%; border-radius: 9999px; transition: width 0.3s; }

/* ── Keyword Type Badges ── */
.badge-type-posts { background: #dbeafe; color: #1d4ed8; }
.badge-type-reels { background: #fce7f3; color: #be185d; }

/* ── Icon Buttons ── */
.btn-icon {
    background: none; border: 1px solid var(--gray-200); border-radius: 0.25rem;
    color: var(--gray-500); cursor: pointer; font-size: 0.7rem;
    padding: 0.15rem 0.4rem; line-height: 1; transition: all 0.15s;
}
.btn-icon:hover { background: var(--gray-100); color: var(--gray-700); }
.btn-icon-danger { border-color: transparent; font-size: 1.1rem; color: var(--gray-400); }
.btn-icon-danger:hover { color: var(--red-500); background: #fee2e2; }

/* ── Capture ── */
.badge-capturing { background: #fef3c7; color: #92400e; }
.badge-done { background: #dcfce7; color: #166534; cursor: pointer; }
.badge-capture-failed { background: #fee2e2; color: #991b1b; }
.capture-img-wrap { margin-bottom: 0.75rem; }
.capture-img { width: 100%; max-width: 600px; border-radius: 0.5rem; border: 1px solid var(--gray-200); }
.capture-video-wrap { margin-bottom: 0.75rem; }
.capture-video { width: 100%; max-width: 600px; border-radius: 0.5rem; }
.capture-status { font-size: 0.85rem; color: var(--gray-500); }

/* ── Utility text ── */
.text-xs { font-size: 0.75rem; }
.text-sm { font-size: 0.85rem; }
.text-muted { color: var(--gray-400); }
.text-red { color: var(--red-500); }
.text-red:hover { color: var(--red-600); }
.cursor-pointer { cursor: pointer; }
.hidden { display: none; }
.block { display: block; }
.label-text { display: block; font-size: 0.75rem; color: var(--gray-500); margin-bottom: 0.25rem; }
.truncate { max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Tab Navigation ── */
.tab-nav { display: flex; border-bottom: 2px solid var(--gray-200); margin-bottom: 1rem; }
.tab-btn {
    background: none; border: none; padding: 0.6rem 1rem; font-size: 0.85rem;
    color: var(--gray-500); cursor: pointer; border-bottom: 2px solid transparent;
    margin-bottom: -2px; font-family: inherit; transition: all 0.15s;
}
.tab-btn:hover { color: var(--gray-700); }
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }

/* ── Post Detail Modal ── */
.post-detail-row { display: flex; padding: 0.5rem 0; border-bottom: 1px solid var(--gray-100); }
.post-detail-label { width: 100px; flex-shrink: 0; font-weight: 500; color: var(--gray-500); font-size: 0.8rem; }
.post-detail-value { flex: 1; word-break: break-word; font-size: 0.85rem; }

/* ── Media Grid ── */
.post-detail-media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0.75rem; }
.post-detail-media-grid img { width: 100%; border-radius: 0.5rem; border: 1px solid var(--gray-200); }

/* ── Raw JSON ── */
.raw-json-pre {
    background: var(--gray-50); border: 1px solid var(--gray-200); border-radius: 0.5rem;
    padding: 1rem; font-family: ui-monospace, monospace; font-size: 0.75rem;
    max-height: 400px; overflow: auto; white-space: pre-wrap; word-break: break-all;
}

/* ── Thumbnail ── */
.thumb-wrap {
    position: relative; display: inline-block; width: 40px; height: 40px;
}
.post-thumb {
    width: 40px; height: 40px; object-fit: cover; border-radius: 0.375rem;
    border: 1px solid var(--gray-200);
}
.thumb-badge {
    position: absolute; font-size: 0.55rem; line-height: 1; padding: 1px 3px;
    border-radius: 3px; color: #fff; font-weight: 600; pointer-events: none;
}
.thumb-badge-video {
    top: 2px; left: 2px; background: rgba(0,0,0,0.6); font-size: 0.5rem;
}
.thumb-badge-count {
    bottom: 2px; right: 2px; background: rgba(37,99,235,0.85);
}
tr.clickable-row { cursor: pointer; }

/* ── View Toggle ── */
.view-toggle { display: inline-flex; border: 1px solid var(--gray-300); border-radius: 0.5rem; overflow: hidden; }
.view-toggle-btn { background: #fff; border: none; padding: 0.4rem 0.6rem; cursor: pointer; color: var(--gray-400); transition: all 0.15s; }
.view-toggle-btn:not(:last-child) { border-right: 1px solid var(--gray-300); }
.view-toggle-btn.active { background: var(--primary); color: #fff; }

/* ── Masonry Grid (Waterfall) ── */
.masonry-flex { display: flex; gap: 0.5rem; }
.masonry-col { flex: 1; display: flex; flex-direction: column; gap: 0.5rem; min-width: 0; }
.masonry-card {
    position: relative; border-radius: 0.5rem; overflow: hidden;
    cursor: pointer; background: var(--gray-100);
}
.masonry-card-img { width: 100%; display: block; }
.masonry-card-overlay {
    position: absolute; inset: 0; background: rgba(0,0,0,0.45);
    display: flex; flex-direction: column; justify-content: flex-end;
    padding: 0.85rem; opacity: 0; transition: opacity 0.2s;
}
.masonry-card:hover .masonry-card-overlay { opacity: 1; }
.masonry-card-overlay .masonry-card-author {
    color: #fff; font-size: 0.9rem; font-weight: 700;
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}
.masonry-card-overlay .masonry-card-stats {
    display: flex; gap: 0.75rem; font-size: 0.85rem; font-weight: 500;
    color: rgba(255,255,255,0.95); margin-top: 0.35rem;
}
.masonry-card-type {
    position: absolute; top: 0.5rem; left: 0.5rem;
    font-size: 0.75rem; font-weight: 600; padding: 0.2rem 0.55rem; border-radius: 0.3rem;
    backdrop-filter: blur(4px); background: rgba(255,255,255,0.9);
}
.masonry-card-grade {
    position: absolute; top: 0.5rem; right: 0.5rem;
    font-size: 0.7rem; font-weight: 700; padding: 0.15rem 0.45rem; border-radius: 0.3rem;
    color: #fff; line-height: 1.2;
}
.masonry-card-capture {
    font-size: 0.7rem; font-weight: 500; margin-top: 0.15rem;
}
.masonry-card-scores {
    display: flex; gap: 0.6rem; font-size: 0.75rem; font-weight: 500;
    color: rgba(255,255,255,0.85); margin-top: 0.2rem;
}
.masonry-card-noimg {
    display: flex; align-items: center; justify-content: center;
    min-height: 120px; color: var(--gray-400); font-size: 0.8rem;
}

/* ── Analysis Card ── */
.analysis-card {
    background: #fff; border-radius: 0.5rem; padding: 1rem; margin-bottom: 0.75rem;
    border: 1px solid var(--gray-200); transition: box-shadow 0.15s;
}
.analysis-card:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

/* ── Mobile Menu Button ── */
.mobile-menu-btn {
    display: none;
    position: fixed; top: 0.75rem; left: 0.75rem;
    width: 40px; height: 40px; border-radius: 0.5rem;
    background: var(--primary); color: #fff;
    border: none; cursor: pointer;
    align-items: center; justify-content: center;
    z-index: 50;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.mobile-menu-btn svg { width: 1.5rem; height: 1.5rem; }
.mobile-menu-btn:hover { background: var(--primary-dark); }

/* ── Sidebar Overlay ── */
.sidebar-overlay {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 39;
}
.sidebar-overlay.active { display: block; }

/* ── Responsive ── */
@media (max-width: 1200px) {
    .grid-6 { grid-template-columns: repeat(3, 1fr); }
    .grid-3 { grid-template-columns: repeat(2, 1fr); }
}
/* ── Content Filter: Step Wizard ── */
.step-wizard {
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 2rem; gap: 0;
}
.step-item {
    display: flex; align-items: center; gap: 0.5rem;
    font-size: 0.85rem; color: var(--gray-400); font-weight: 500;
    transition: color 0.2s;
}
.step-item.active { color: var(--primary); }
.step-item.done { color: var(--green-600); }
.step-number {
    width: 32px; height: 32px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.8rem; font-weight: 700;
    background: var(--gray-200); color: var(--gray-500);
    transition: all 0.2s; flex-shrink: 0;
}
.step-item.active .step-number { background: var(--primary); color: #fff; }
.step-item.done .step-number { background: var(--green-600); color: #fff; }
.step-connector {
    width: 40px; height: 2px; background: var(--gray-200); margin: 0 0.5rem;
    transition: background 0.2s;
}
.step-connector.done { background: var(--green-600); }

/* ── Content Filter: Pattern Card ── */
.pattern-card {
    background: #fff; border-radius: 0.75rem; padding: 1.25rem;
    border: 1px solid var(--gray-200); transition: box-shadow 0.15s;
}
.pattern-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.08); }
.pattern-card h4 {
    font-size: 0.9rem; font-weight: 600; color: var(--gray-700);
    margin-bottom: 0.75rem; display: flex; align-items: center; gap: 0.5rem;
}
.pattern-card ul { list-style: none; padding: 0; }
.pattern-card li {
    font-size: 0.82rem; color: var(--gray-600); padding: 0.35rem 0;
    border-bottom: 1px solid var(--gray-100); line-height: 1.5;
}
.pattern-card li:last-child { border-bottom: none; }
.pattern-card li::before { content: "•"; color: var(--primary); margin-right: 0.5rem; font-weight: 700; }

/* ── Content Filter: Proposal Card ── */
.proposal-card {
    background: #fff; border-radius: 0.75rem; padding: 1.5rem;
    border: 1px solid var(--gray-200); transition: box-shadow 0.15s;
}
.proposal-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.1); }
.proposal-card .proposal-num {
    display: inline-flex; align-items: center; justify-content: center;
    width: 28px; height: 28px; border-radius: 50%;
    background: var(--primary); color: #fff; font-size: 0.8rem; font-weight: 700;
    margin-bottom: 0.75rem;
}
.proposal-card h4 {
    font-size: 1rem; font-weight: 600; color: var(--gray-800); margin-bottom: 0.75rem;
}
.proposal-section { margin-bottom: 0.75rem; }
.proposal-section-label {
    font-size: 0.72rem; font-weight: 600; text-transform: uppercase;
    color: var(--gray-400); letter-spacing: 0.05em; margin-bottom: 0.25rem;
}
.proposal-section-content {
    font-size: 0.85rem; color: var(--gray-700); line-height: 1.6;
    white-space: pre-line;
}
.proposal-tags { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: 0.5rem; }
.proposal-tag {
    display: inline-block; padding: 0.15rem 0.5rem; border-radius: 9999px;
    background: #e0e7ff; color: #3730a3; font-size: 0.72rem; font-weight: 500;
}

/* ── Content Filter: Post Card ── */
.cf-post-card {
    background: #fff; border-radius: 0.5rem; padding: 0.85rem;
    border: 1px solid var(--gray-200); font-size: 0.82rem;
    transition: box-shadow 0.15s;
}
.cf-post-card:hover { box-shadow: 0 2px 6px rgba(0,0,0,0.06); }
.cf-post-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.4rem; }
.cf-post-author { font-weight: 600; color: var(--gray-700); }
.cf-post-score { font-weight: 700; color: var(--primary); }
.cf-post-caption {
    color: var(--gray-600); line-height: 1.5; margin-bottom: 0.4rem;
    display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.cf-post-stats { display: flex; gap: 0.75rem; font-size: 0.75rem; color: var(--gray-400); }

/* ── Content Filter: Loading Spinner ── */
.cf-loading {
    display: flex; align-items: center; justify-content: center;
    padding: 3rem; color: var(--gray-400); font-size: 0.9rem; gap: 0.75rem;
}
.cf-spinner {
    width: 20px; height: 20px; border: 2px solid var(--gray-200);
    border-top-color: var(--primary); border-radius: 50%;
    animation: cf-spin 0.6s linear infinite;
}
@keyframes cf-spin { to { transform: rotate(360deg); } }

/* ── Content Filter: Form ── */
.cf-form-group { margin-bottom: 1rem; }
.cf-form-group label {
    display: block; font-size: 0.8rem; font-weight: 500;
    color: var(--gray-600); margin-bottom: 0.3rem;
}
.cf-form-group label .required { color: var(--red-500); }
.cf-form-group input, .cf-form-group select, .cf-form-group textarea {
    width: 100%; border: 1px solid var(--gray-300); border-radius: 0.5rem;
    padding: 0.5rem 0.75rem; font-size: 0.85rem; font-family: inherit;
    outline: none; transition: box-shadow 0.15s;
}
.cf-form-group input:focus, .cf-form-group select:focus, .cf-form-group textarea:focus {
    box-shadow: 0 0 0 2px rgba(99,102,241,0.3); border-color: var(--primary);
}
.cf-form-group textarea { resize: vertical; min-height: 80px; }

/* ── Content Filter: Platform Tabs ── */
.cf-platform-tabs {
    display: flex; border-bottom: 2px solid var(--gray-200);
    margin-bottom: 1.5rem; gap: 0;
}
.cf-platform-tab {
    background: none; border: none;
    padding: 0.6rem 1.25rem; font-size: 0.95rem; font-weight: 600;
    color: var(--gray-400); cursor: pointer;
    border-bottom: 3px solid transparent; margin-bottom: -2px;
    font-family: inherit; transition: all 0.15s;
    display: inline-flex; align-items: center; gap: 0.5rem;
}
.cf-platform-tab:hover { color: var(--gray-600); }
.cf-platform-tab[data-platform="instagram"].active {
    color: var(--pink-600); border-bottom-color: var(--pink-600);
}
.cf-platform-tab[data-platform="threads"].active {
    color: var(--purple-600); border-bottom-color: var(--purple-600);
}

/* ── Content Filter: Prompt Editor Modal ── */
.cf-prompt-tabs {
    display: flex; border-bottom: 2px solid var(--gray-200);
    margin-bottom: 1rem; gap: 0;
}
.cf-prompt-tab {
    background: none; border: none;
    padding: 0.5rem 1rem; font-size: 0.85rem; font-weight: 600;
    color: var(--gray-400); cursor: pointer;
    border-bottom: 2px solid transparent; margin-bottom: -2px;
    font-family: inherit; transition: all 0.15s;
}
.cf-prompt-tab:hover { color: var(--gray-600); }
.cf-prompt-tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.cf-prompt-tab-panel { display: none; }
.cf-prompt-tab-panel.active { display: block; }
.cf-prompt-tab-panel textarea {
    width: 100%; min-height: 180px; border: 1px solid var(--gray-300);
    border-radius: 0.5rem; padding: 0.75rem; font-size: 0.8rem;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    line-height: 1.5; resize: vertical; outline: none;
    transition: box-shadow 0.15s;
}
.cf-prompt-tab-panel textarea:focus {
    box-shadow: 0 0 0 2px rgba(99,102,241,0.3); border-color: var(--primary);
}
.cf-prompt-tab-panel label {
    display: block; font-size: 0.8rem; font-weight: 500;
    color: var(--gray-600); margin-bottom: 0.3rem; margin-top: 0.75rem;
}
.cf-prompt-tab-panel label:first-child { margin-top: 0; }

/* ── Content Filter: Step panel ── */
.cf-step-panel { display: none; }
.cf-step-panel.active { display: block; }

@media (max-width: 768px) {
    .mobile-menu-btn { display: flex; }
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        width: var(--sidebar-width);
    }
    .sidebar.open { transform: translateX(0); }
    .sidebar.collapsed { width: var(--sidebar-width); }
    .sidebar-toggle { display: none; }
    .main-content { margin-left: 0; padding-top: 3.5rem; }
    .sidebar.collapsed + .main-content { margin-left: 0; }
    .grid-6, .grid-3 { grid-template-columns: repeat(2, 1fr); }
    .grid-2 { grid-template-columns: 1fr; }
    .page-header-row { flex-direction: column; gap: 0.75rem; align-items: flex-start; }
    .step-wizard { flex-wrap: wrap; gap: 0.5rem; }
    .step-connector { width: 20px; }
    .step-item span:not(.step-number) { display: none; }
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}
