/* ==========================================================================
   Media Regent — Global Custom Styles
   Aesthetic: Dark luxury — gold accent on deep surfaces
   ========================================================================== */

/* === Reset & Base === */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --color-bg: #0a0a0f;
    --color-surface: #12121a;
    --color-surface-hover: #1a1a25;
    --color-surface-elevated: #1e1e2a;
    --color-text: #e8e6e3;
    --color-text-muted: #6b6b7b;
    --color-text-light: #a2a2b9;
    --color-gold: #c8a456;
    --color-gold-hover: #d4b366;
    --color-gold-dim: rgba(200, 164, 86, 0.08);
    --color-border: rgba(255, 255, 255, 0.06);
    --color-border-hover: rgba(255, 255, 255, 0.1);
    --color-reddit: #FF4500;
    --color-hackernews: #FF6600;
    --color-linkedin: #0A66C2;
    --color-google: #4285F4;
    --color-x: #000;
    --color-facebook: #1877F2;
    --color-pending-bg: rgba(251, 191, 36, 0.12);
    --color-pending-text: #fbbf24;
    --color-approved-bg: rgba(52, 211, 153, 0.12);
    --color-approved-text: #34d399;
    --color-edited-bg: rgba(96, 165, 250, 0.12);
    --color-edited-text: #60a5fa;
    --color-discarded-bg: rgba(107, 107, 123, 0.12);
    --color-discarded-text: #6b6b7b;
    --color-posted-bg: rgba(167, 139, 250, 0.12);
    --color-posted-text: #a78bfa;
    --color-failed-bg: rgba(248, 113, 113, 0.12);
    --color-failed-text: #f87171;
    --color-toast-success-bg: rgba(52, 211, 153, 0.12);
    --color-toast-success-border: rgba(52, 211, 153, 0.3);
    --color-toast-success-text: #34d399;
    --color-toast-error-bg: rgba(248, 113, 113, 0.12);
    --color-toast-error-border: rgba(248, 113, 113, 0.3);
    --color-toast-error-text: #f87171;
    --color-toast-info-bg: rgba(200, 164, 86, 0.08);
    --color-toast-info-border: rgba(200, 164, 86, 0.2);
    --color-toast-info-text: #c8a456;
    --color-warning-bg: rgba(251, 191, 36, 0.12);
    --color-warning-text: #fbbf24;
    --color-primary: #c8a456;
    --color-primary-hover: #d4b366;
    --color-sidebar-bg: #0d0d14;
    --color-sidebar-hover: rgba(200, 164, 86, 0.06);
    --color-sidebar-border: rgba(255, 255, 255, 0.06);
    --color-sidebar-text: #9f9faa;
    --color-sidebar-text-hover: #e8e6e3;
    --font-heading: 'Playfair Display', Georgia, serif;
    --font-display: 'Playfair Display', Georgia, 'Times New Roman', serif;
    --font-body: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

    /* Extended palette (used by dashboard components) */
    --color-card: #1A1A20;
    --color-card-hover: #22222A;
    --color-border-subtle: rgba(255, 255, 255, 0.06);
    --color-gold-light: #E8D5A0;
    --color-gold-glow: rgba(200, 164, 86, 0.25);
    --color-text-secondary: #9A9698;
    --color-success: #4CAF7D;
    --color-warning: #E8A634;
    --color-error: #D45454;

    /* Spacing scale */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    --space-3xl: 4rem;

    /* Border radius */
    --border-radius: 12px;
    --border-radius-sm: 8px;
    --border-radius-lg: 20px;

    /* Transitions */
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --transition-fast: 150ms var(--ease-out);
    --transition-base: 300ms var(--ease-out);
}

html, body {
    height: 100%;
    font-family: var(--font-body);
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: inherit;
    text-decoration: none;
}

h1, h2, h3 {
    font-family: var(--font-heading);
}

/* === Grain Overlay === */
.grain-overlay {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.025;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 256px;
}

/* === Layout === */
.layout {
    display: flex;
    height: 100%;
}

.main-content {
    flex: 1;
    overflow-y: auto;
}

.main-content-inner {
    max-width: 72rem;
    margin: 0 auto;
    padding: 2rem 1rem;
}

/* === Sidebar === */
.sidebar {
    display: none;
    flex-direction: column;
    width: 16rem;
    background: var(--color-sidebar-bg);
    border-right: 1px solid var(--color-sidebar-border);
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
}

.sidebar__header {
    padding: 1.25rem;
    border-bottom: 1px solid var(--color-sidebar-border);
}

.sidebar__brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
}

.sidebar__monogram {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: var(--color-gold-dim);
    border: 1px solid rgba(200, 164, 86, 0.2);
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.75rem;
    color: var(--color-gold);
}

.sidebar__wordmark {
    font-family: var(--font-heading);
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--color-text);
}

.sidebar__nav {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem 0.75rem;
}

.sidebar__section {
    margin-bottom: 0.25rem;
}

.sidebar__section-label {
    display: block;
    font-size: 0.625rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--color-text-light);
    padding: 1rem 0.75rem 0.375rem;
}

.sidebar__link {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    color: var(--color-sidebar-text);
    font-size: 0.8125rem;
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
}

.sidebar__link:hover {
    background: var(--color-sidebar-hover);
    color: var(--color-sidebar-text-hover);
}

.sidebar__link--active {
    background: var(--color-gold-dim);
    color: var(--color-gold);
}

.sidebar__link--active:hover {
    background: var(--color-gold-dim);
    color: var(--color-gold);
}

.sidebar__link svg {
    flex-shrink: 0;
    opacity: 0.6;
}

.sidebar__link--active svg {
    opacity: 1;
}

.sidebar__badge {
    margin-left: auto;
    font-size: 0.6875rem;
    font-weight: 600;
    min-width: 20px;
    text-align: center;
    padding: 1px 6px;
    border-radius: 100px;
    background: var(--color-surface-elevated);
    color: var(--color-text-muted);
}

.sidebar__badge--gold {
    background: var(--color-gold-dim);
    color: var(--color-gold);
    border: 1px solid rgba(200, 164, 86, 0.2);
}

.sidebar__platform-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.sidebar__platform-dot--reddit { background: var(--color-reddit); }
.sidebar__platform-dot--hackernews { background: var(--color-hackernews); }
.sidebar__platform-dot--linkedin { background: var(--color-linkedin); }
.sidebar__platform-dot--google { background: var(--color-google); }
.sidebar__platform-dot--facebook { background: var(--color-facebook); }
.sidebar__platform-dot--x { background: var(--color-x); }

/* Project selector dropdown in sidebar */
.sidebar__project-selector {
    padding: 0.5rem 1rem;
    border-bottom: 1px solid var(--color-sidebar-border);
}

.project-select {
    width: 100%;
    padding: 0.375rem 0.625rem;
    background: var(--color-surface);
    color: var(--color-text);
    border: 1px solid var(--color-border);
    border-radius: 6px;
    font-size: 0.8125rem;
    font-family: var(--font-body);
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b6b7b' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.5rem center;
    padding-right: 1.5rem;
}

.project-select:hover {
    border-color: var(--color-border-hover);
}

.project-select:focus {
    outline: none;
    border-color: var(--color-gold);
    box-shadow: 0 0 0 2px rgba(200, 164, 86, 0.1);
}

.sidebar__footer {
    padding: 1rem;
    border-top: 1px solid var(--color-sidebar-border);
}

.sidebar__user {
    display: flex;
    align-items: center;
    gap: 0.625rem;
}

.sidebar__avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--color-gold-dim);
    border: 1px solid rgba(200, 164, 86, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--color-gold);
}

.sidebar__user-info {
    display: flex;
    flex-direction: column;
}

.sidebar__user-name {
    font-size: 0.8125rem;
    color: var(--color-text);
    font-weight: 500;
}

.sidebar__user-plan {
    font-size: 0.6875rem;
    color: var(--color-text-muted);
}

/* === Mobile Header === */
.mobile-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: var(--color-sidebar-bg);
    border-bottom: 1px solid var(--color-sidebar-border);
    padding: 0.75rem 1rem;
    z-index: 50;
}

.mobile-header__toggle {
    display: flex;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}

.mobile-header__toggle span {
    display: block;
    width: 18px;
    height: 2px;
    background: var(--color-text-muted);
    border-radius: 1px;
    transition: transform 0.2s, opacity 0.2s;
}

.mobile-header__toggle--active span:nth-child(1) {
    transform: rotate(45deg) translate(4px, 4px);
}

.mobile-header__toggle--active span:nth-child(2) {
    opacity: 0;
}

.mobile-header__toggle--active span:nth-child(3) {
    transform: rotate(-45deg) translate(4px, -4px);
}

.mobile-header__title {
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-text);
}

/* Sidebar overlay for mobile */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 90;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(2px);
}

.sidebar-overlay--visible {
    display: block;
}

/* Mobile sidebar open state */
.sidebar.sidebar--open {
    display: flex;
}

/* Mobile: show mobile header, add top padding to main */
.layout .main-content {
    padding-top: 3.5rem;
}

/* === Toast === */
#toast-area {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.toast {
    background: var(--color-surface-elevated);
    border: 1px solid var(--color-border);
    border-radius: 0.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    padding: 1rem;
    max-width: 22rem;
    animation: toast-in 0.3s ease-out;
}

.toast-inner {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.toast-message {
    font-size: 0.875rem;
    font-weight: 500;
}

.toast-close {
    background: none; border: none; cursor: pointer;
    color: var(--color-text-light); margin-left: auto; font-size: 1.25rem; line-height: 1;
}

.toast-close:hover { color: var(--color-text-muted); }

.toast--success {
    background: var(--color-toast-success-bg);
    border-color: var(--color-toast-success-border);
    color: var(--color-toast-success-text);
}

.toast--error {
    background: var(--color-toast-error-bg);
    border-color: var(--color-toast-error-border);
    color: var(--color-toast-error-text);
}

.toast--info {
    background: var(--color-toast-info-bg);
    border-color: var(--color-toast-info-border);
    color: var(--color-toast-info-text);
}

@keyframes toast-in {
    from { opacity: 0; transform: translateX(1rem); }
    to   { opacity: 1; transform: translateX(0); }
}

/* === Modal === */
.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.7);
}

.modal-panel {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 0.75rem;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
    max-width: 32rem;
    width: 100%;
    margin: 0 1rem;
    padding: 1.5rem;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.modal-header h3 {
    font-size: 1.125rem;
    font-weight: 600;
    font-family: var(--font-heading);
}

.modal-close {
    background: none; border: none; cursor: pointer;
    color: var(--color-text-light); font-size: 1.5rem; line-height: 1;
}

.modal-close:hover { color: var(--color-text-muted); }

/* === Badges === */
.badge {
    display: inline-block;
    padding: 0.125rem 0.625rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1.5;
    white-space: nowrap;
}

.badge--reddit     { background: rgba(255, 69, 0, 0.15);  color: var(--color-reddit); }
.badge--hn         { background: rgba(255, 102, 0, 0.15);  color: var(--color-hackernews); }
.badge--linkedin   { background: rgba(10, 102, 194, 0.15); color: var(--color-linkedin); }
.badge--google     { background: rgba(66, 133, 244, 0.15); color: var(--color-google); }
.badge--facebook   { background: rgba(24, 119, 242, 0.15); color: var(--color-facebook); }
.badge--hackernews { background: rgba(255, 102, 0, 0.15);  color: var(--color-hackernews); }
.badge--twitter    { background: rgba(255, 255, 255, 0.08); color: var(--color-text); }
.badge--linkedin   { background: rgba(10, 102, 194, 0.15); color: var(--color-linkedin); }
.badge--google     { background: rgba(66, 133, 244, 0.15); color: var(--color-google); }

.badge--pending   { background: var(--color-pending-bg);   color: var(--color-pending-text); }
.badge--approved  { background: var(--color-approved-bg);  color: var(--color-approved-text); }
.badge--edited    { background: var(--color-edited-bg);    color: var(--color-edited-text); }
.badge--discarded { background: var(--color-discarded-bg); color: var(--color-discarded-text); }
.badge--posted    { background: var(--color-posted-bg);    color: var(--color-posted-text); }
.badge--failed    { background: var(--color-failed-bg);    color: var(--color-failed-text); }

/* === Empty State === */
.empty-state {
    text-align: center;
    padding: 3rem 0;
}

.empty-state-icon { font-size: 2.5rem; color: var(--color-text-light); margin-bottom: 1rem; }
.empty-state h3 { font-size: 1.125rem; font-weight: 500; margin-bottom: 0.5rem; }
.empty-state p { color: var(--color-text-muted); margin-bottom: 1.5rem; }

/* === Buttons === */
.btn {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    font-family: var(--font-body);
    border-radius: 0.5rem;
    border: none;
    cursor: pointer;
    transition: background 0.15s, box-shadow 0.15s;
    text-decoration: none;
    gap: 0.375rem;
}

.btn--primary {
    background: var(--color-primary);
    color: #0a0a0f;
}

.btn--primary:hover {
    background: var(--color-primary-hover);
    box-shadow: 0 0 20px rgba(200, 164, 86, 0.15);
}

.btn--danger {
    background: var(--color-failed-bg);
    color: var(--color-failed-text);
}

.btn--danger:hover {
    background: rgba(248, 113, 113, 0.2);
}

.btn--small,
.btn--sm {
    padding: 0.25rem 0.625rem;
    font-size: 0.75rem;
}

.btn--ghost { background: transparent; color: var(--color-text-muted); border: 1px solid var(--color-border); }
.btn--ghost:hover { background: var(--color-surface-hover); border-color: var(--color-border-hover); color: var(--color-text); }

/* === Typography helpers === */
.page-title {
    font-size: 1.5rem;
    font-weight: 700;
    font-family: var(--font-heading);
    margin-bottom: 1.5rem;
    color: var(--color-text);
}

.text-muted {
    color: var(--color-text-muted);
}

/* === Forms === */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.375rem;
    color: var(--color-text);
}

.form-group input,
.form-group textarea,
.form-group select {
    display: block;
    width: 100%;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    font-family: var(--font-body);
    line-height: 1.5;
    color: var(--color-text);
    background: var(--color-surface-elevated);
    border: 1px solid var(--color-border);
    border-radius: 0.375rem;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--color-gold);
    box-shadow: 0 0 0 3px rgba(200, 164, 86, 0.12);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--color-text-light);
}

.form-group textarea {
    resize: vertical;
    min-height: 5rem;
}

.form-group select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b6b7b' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    padding-right: 2rem;
}

.form-group .helptext {
    display: block;
    font-size: 0.75rem;
    color: var(--color-text-muted);
    margin-top: 0.25rem;
}

.form-errors {
    color: var(--color-failed-text);
    background: var(--color-failed-bg);
    border: 1px solid rgba(248, 113, 113, 0.3);
    border-radius: 0.375rem;
    padding: 0.75rem 1rem;
    margin-bottom: 1.25rem;
    font-size: 0.875rem;
}

.form-errors ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.field-error,
.form-error {
    color: var(--color-failed-text);
    font-size: 0.75rem;
    margin-top: 0.25rem;
}

.form-help {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    margin-top: 0.25rem;
}

/* === Auth Pages === */
.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 1rem;
    background: var(--color-bg);
}

.auth-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 0.75rem;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.4);
    padding: 2rem;
    width: 100%;
    max-width: 24rem;
    text-align: center;
}

.auth-monogram {
    width: 48px;
    height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: var(--color-gold-dim);
    border: 1px solid rgba(200, 164, 86, 0.2);
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 1rem;
    color: var(--color-gold);
    margin-bottom: 1.25rem;
}

.auth-card h1 {
    font-size: 1.5rem;
    font-weight: 700;
    font-family: var(--font-heading);
    margin-bottom: 0.5rem;
    color: var(--color-text);
}

.auth-card form {
    text-align: left;
}

.auth-card .auth-subtitle {
    color: var(--color-text-muted);
    font-size: 0.875rem;
    margin-bottom: 1.5rem;
}

.auth-card .auth-footer {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.875rem;
    color: var(--color-text-muted);
}

.auth-card .auth-footer a {
    color: var(--color-gold);
    font-weight: 500;
}

.auth-card .auth-footer a:hover {
    text-decoration: underline;
    color: var(--color-gold-hover);
}

.btn--full {
    width: 100%;
    justify-content: center;
}

/* === Tables === */
.topic-table-wrap {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.data-table th,
.data-table td {
    text-align: left;
    padding: 0.625rem 0.75rem;
    border-bottom: 1px solid var(--color-border);
}

.data-table th {
    font-weight: 600;
    color: var(--color-text-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.data-table tbody tr:hover {
    background: var(--color-surface-hover);
}

/* === Card === */
.card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 0.5rem;
    padding: 1.5rem;
}

.card-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.card-actions {
    display: flex;
    gap: 0.5rem;
}

/* === Progress Bar === */
.progress-bar {
    height: 0.5rem;
    background: var(--color-surface-elevated);
    border-radius: 9999px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: var(--color-approved-text);
    border-radius: 9999px;
    transition: width 0.3s;
}

.progress-bar-fill--warning {
    background: var(--color-pending-text);
}

.progress-bar-fill--danger {
    background: var(--color-failed-text);
}

/* === Stat Cards === */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    text-align: center;
}

.stat-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-text);
}

/* === Settings Sections === */
.settings-section {
    border: none;
    padding: 0;
    margin: 0 0 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--color-border);
}

.settings-section legend {
    font-size: 1.0625rem;
    font-weight: 600;
    font-family: var(--font-heading);
    margin-bottom: 0.75rem;
    padding: 0;
    color: var(--color-text);
}

.settings-section code {
    font-size: 0.8125rem;
    font-family: var(--font-mono);
    background: var(--color-surface-elevated);
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    color: var(--color-gold);
}

/* === Queue === */
.filter-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.filter-tabs {
    display: flex;
    gap: 0.25rem;
}

.filter-tab {
    padding: 0.375rem 0.875rem;
    font-size: 0.875rem;
    border-radius: 0.375rem;
    color: var(--color-text-muted);
    transition: background 0.15s, color 0.15s;
}

.filter-tab:hover {
    background: var(--color-surface-hover);
    color: var(--color-text);
}

.filter-tab--active {
    background: var(--color-gold-dim);
    color: var(--color-gold);
}

.filter-tab--active:hover {
    background: rgba(200, 164, 86, 0.12);
    color: var(--color-gold-hover);
}

.filter-bar select {
    padding: 0.375rem 0.625rem;
    font-size: 0.875rem;
    border: 1px solid var(--color-border);
    border-radius: 0.375rem;
    background: var(--color-surface-elevated);
    color: var(--color-text);
}

.queue-cards {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.queue-card {
    max-width: 48rem;
}

.queue-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.queue-card-badges {
    display: flex;
    gap: 0.375rem;
    flex-wrap: wrap;
    align-items: center;
}

/* Status dots */
.status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 0.375rem;
}

.status-dot--green { background: var(--color-approved-text); }
.status-dot--yellow { background: var(--color-pending-text); }
.status-dot--red { background: var(--color-failed-text); }

.badge--safety-warning {
    background: var(--color-warning-bg);
    color: var(--color-warning-text);
    cursor: help;
}

.queue-card-post {
    margin-bottom: 0.75rem;
}

.queue-card-title {
    color: var(--color-gold);
    font-weight: 500;
    font-size: 0.9375rem;
}

.queue-card-title:hover {
    text-decoration: underline;
    color: var(--color-gold-hover);
}

.queue-card-snippet {
    font-size: 0.8125rem;
    margin-top: 0.25rem;
    line-height: 1.5;
    color: var(--color-text-muted);
}

.queue-card-divider {
    border: none;
    border-top: 1px solid var(--color-border);
    margin: 0.75rem 0;
}

.queue-card-draft {
    font-size: 0.875rem;
    line-height: 1.6;
    margin-bottom: 0.75rem;
}

.queue-card-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.btn--approve {
    background: var(--color-approved-bg);
    color: var(--color-approved-text);
}

.btn--approve:hover { background: rgba(52, 211, 153, 0.2); }

.btn--edit {
    background: var(--color-edited-bg);
    color: var(--color-edited-text);
}

.btn--edit:hover { background: rgba(96, 165, 250, 0.2); }

.btn--regen {
    background: var(--color-pending-bg);
    color: var(--color-pending-text);
}

.btn--regen:hover { background: rgba(251, 191, 36, 0.2); }

.btn--discard {
    background: var(--color-discarded-bg);
    color: var(--color-discarded-text);
}

.btn--discard:hover { background: rgba(107, 107, 123, 0.2); }

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* === Desktop breakpoint === */
@media (min-width: 1024px) {
    .sidebar {
        display: flex;
        position: fixed;
    }

    .mobile-header {
        display: none !important;
    }

    .layout .main-content {
        padding-top: 0;
        margin-left: 16rem;
    }

    .main-content-inner {
        padding: 2rem;
    }
}

/* === Onboarding Wizard === */

.wizard-container {
    max-width: 720px;
    margin: 0 auto;
}

.wizard-header {
    margin-bottom: 2rem;
}

.wizard-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    font-family: var(--font-heading);
    margin-bottom: 0.25rem;
    color: var(--color-text);
}

.wizard-progress {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    padding: 1rem 0;
    border-bottom: 1px solid var(--color-border);
}

.wizard-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    gap: 0.35rem;
}

.wizard-step-dot {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
    background: var(--color-surface-elevated);
    color: var(--color-text-light);
    transition: background 0.2s, color 0.2s;
}

.wizard-step.active .wizard-step-dot {
    background: var(--color-gold);
    color: #0a0a0f;
    box-shadow: 0 0 12px rgba(200, 164, 86, 0.3);
}

.wizard-step.completed .wizard-step-dot {
    background: var(--color-approved-bg);
    color: var(--color-approved-text);
}

.wizard-step-label {
    font-size: 0.7rem;
    color: var(--color-text-muted);
    text-align: center;
}

.wizard-step.active .wizard-step-label {
    color: var(--color-gold);
    font-weight: 600;
}

.wizard-body {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 2rem;
}

.wizard-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--color-border);
}

/* Form row (side by side) */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* Checkbox group */
.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
    cursor: pointer;
    color: var(--color-text);
}

.checkbox-label input[type="checkbox"] {
    accent-color: var(--color-gold);
}

/* Platform overrides */
.platform-overrides {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--color-border);
}

.platform-overrides h3 {
    font-size: 1.1rem;
    font-family: var(--font-heading);
    margin-bottom: 0.5rem;
}

.override-section {
    padding: 1rem;
    margin-top: 1rem;
    background: var(--color-surface-elevated);
    border-radius: 6px;
    border: 1px solid var(--color-border);
}

.override-section h4 {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--color-text);
}

/* Notification channels */
.notification-channel {
    padding: 1.25rem;
    margin-bottom: 1rem;
    background: var(--color-surface-elevated);
    border-radius: 6px;
    border: 1px solid var(--color-border);
}

.notification-channel h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--color-text);
}

/* Preview cards */
.preview-meta {
    margin-bottom: 1rem;
    padding: 0.75rem 1rem;
    background: var(--color-surface-elevated);
    border-radius: 6px;
}

.preview-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.preview-card {
    padding: 1rem;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    background: var(--color-surface);
}

.preview-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.preview-card-title {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.35rem;
}

.preview-card-title a { color: var(--color-text); text-decoration: none; }
.preview-card-title a:hover { color: var(--color-gold); }
.preview-card-body { font-size: 0.85rem; line-height: 1.5; color: var(--color-text-muted); }

/* Alert boxes */
.alert {
    padding: 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
}

.alert-warning {
    background: var(--color-pending-bg);
    color: var(--color-pending-text);
    border: 1px solid rgba(251, 191, 36, 0.3);
}

.alert-error {
    background: var(--color-failed-bg);
    color: var(--color-failed-text);
    border: 1px solid rgba(248, 113, 113, 0.3);
}

.alert-success {
    background: var(--color-approved-bg);
    color: var(--color-approved-text);
    border: 1px solid rgba(52, 211, 153, 0.3);
}

.text-success { color: var(--color-approved-text); }
.text-error   { color: var(--color-failed-text); }
.text-small   { font-size: 0.8rem; }
.btn-sm { padding: 0.35rem 0.75rem; font-size: 0.8rem; }

/* Responsive wizard */
@media (max-width: 640px) {
    .wizard-progress {
        gap: 0.25rem;
    }
    .wizard-step-label {
        display: none;
    }
    .wizard-body {
        padding: 1.25rem;
    }
    .form-row {
        grid-template-columns: 1fr;
    }
}

/* === Dashboard === */

.page-header {
    margin-bottom: 1.5rem;
}

.page-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.page-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    font-family: var(--font-heading);
    color: var(--color-text);
}

.dashboard-cta {
    display: block;
    text-align: center;
    padding: 2rem;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 10px;
    margin-bottom: 1.5rem;
    text-decoration: none;
    color: var(--color-text);
    transition: border-color 0.15s, box-shadow 0.15s;
}

.dashboard-cta:hover {
    border-color: rgba(200, 164, 86, 0.2);
    box-shadow: 0 4px 20px rgba(200, 164, 86, 0.08);
}

.dashboard-cta-number {
    font-size: 3rem;
    font-weight: 800;
    color: var(--color-gold);
    font-family: var(--font-heading);
    line-height: 1;
}

.dashboard-cta-label {
    font-size: 1.1rem;
    color: var(--color-text-muted);
    margin-top: 0.25rem;
}

.dashboard-cta-action {
    margin-top: 0.75rem;
    font-weight: 600;
    color: var(--color-gold);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.dashboard-section {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.dashboard-section h3 {
    font-size: 1rem;
    font-weight: 600;
    font-family: var(--font-heading);
    margin-bottom: 1rem;
    color: var(--color-text);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.section-header h3 {
    margin-bottom: 0;
}

/* Budget bar */
.budget-bar-container {
    margin-top: 0.5rem;
}

.budget-bar {
    height: 12px;
    background: var(--color-surface-elevated);
    border-radius: 6px;
    overflow: hidden;
}

.budget-bar-fill {
    height: 100%;
    background: var(--color-approved-text);
    border-radius: 6px;
    transition: width 0.3s;
}

.budget-bar-fill.budget-warning {
    background: var(--color-pending-text);
}

.budget-bar-fill.budget-danger {
    background: var(--color-failed-text);
}

.budget-bar-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 0.35rem;
    font-size: 0.8rem;
    color: var(--color-text-muted);
}

/* Recent items */
.recent-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.recent-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.65rem 0;
    border-bottom: 1px solid var(--color-border);
}

.recent-item:last-child { border-bottom: none; }
.recent-item-left { display: flex; align-items: center; gap: 0.5rem; min-width: 0; }

.recent-item-title {
    color: var(--color-text); text-decoration: none;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.recent-item-title:hover { color: var(--color-gold); }

/* Quick actions */
.quick-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .quick-actions {
        flex-direction: column;
    }
}

/* === Billing === */

.billing-current {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.billing-current h3 {
    font-size: 1rem;
    font-weight: 600;
    font-family: var(--font-heading);
    margin-bottom: 1rem;
}

.current-plan-card {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.plan-badge {
    display: inline-block;
    padding: 0.3rem 0.75rem;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 600;
}

.plan-badge-active {
    background: var(--color-gold);
    color: #0a0a0f;
}

.subscription-info {
    font-size: 0.9rem;
    color: var(--color-text-muted);
}

.billing-plans {
    margin-bottom: 1.5rem;
}

.billing-plans h3 {
    font-size: 1rem;
    font-weight: 600;
    font-family: var(--font-heading);
    margin-bottom: 1rem;
}

.plans-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

.plan-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    transition: border-color 0.15s;
}

.plan-card:hover {
    border-color: var(--color-border-hover);
}

.plan-card-current {
    border-color: rgba(200, 164, 86, 0.3);
    box-shadow: 0 0 0 1px rgba(200, 164, 86, 0.15);
}

.plan-card-header h4 {
    font-size: 1.1rem;
    font-weight: 700;
    font-family: var(--font-heading);
    margin-bottom: 0.25rem;
    color: var(--color-text);
}

.plan-card-price {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--color-gold);
    margin-bottom: 1rem;
}

.plan-card-features {
    list-style: none;
    padding: 0;
    flex: 1;
    margin-bottom: 1.25rem;
}

.plan-card-features li {
    padding: 0.3rem 0; font-size: 0.85rem;
    color: var(--color-text-muted); border-bottom: 1px solid var(--color-border);
}

.plan-card-features li:last-child { border-bottom: none; }
.plan-card-action { text-align: center; }
.btn-disabled { opacity: 0.5; pointer-events: none; }

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

/* === Dashboard === */
.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stats-row .stat-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 0.5rem;
    padding: 1.25rem;
    text-align: center;
}

.stat-card__value {
    display: block;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--color-gold);
    font-family: var(--font-heading);
}

.stat-card__label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.card__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.card__title {
    font-family: var(--font-heading);
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--color-text);
}

.card + .card { margin-top: 1.5rem; }

.alert-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.alert-card--warning {
    border-color: var(--color-warning);
    background: var(--color-warning-bg);
    color: var(--color-warning-text);
}

.alert-card__content {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.btn--retry {
    background: var(--color-failed-bg);
    color: var(--color-failed-text);
    border: 1px solid rgba(248, 113, 113, 0.3);
}

.btn--retry:hover {
    background: rgba(248, 113, 113, 0.25);
}

.post-row-title {
    color: var(--color-text);
    text-decoration: none;
}

.post-row-title:hover {
    color: var(--color-gold);
}

.post-row--not-relevant {
    opacity: 0.5;
}

.post-row--not-relevant:hover {
    opacity: 0.8;
}

.post-row-reason {
    display: block;
    font-size: 0.7rem;
    line-height: 1.3;
    margin-top: 0.2rem;
}

/* Platform bars */
.platform-bars {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.platform-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.platform-bar__label {
    width: 6rem;
    font-size: 0.8125rem;
    color: var(--color-text-muted);
    text-align: right;
}

.platform-bar__track {
    flex: 1;
    height: 0.5rem;
    background: var(--color-surface-elevated);
    border-radius: 9999px;
    overflow: hidden;
}

.platform-bar__fill {
    height: 100%;
    border-radius: 9999px;
    transition: width 0.3s;
    min-width: 2px;
}

.platform-bar__fill--reddit { background: var(--color-reddit); }
.platform-bar__fill--hackernews { background: var(--color-hackernews); }
.platform-bar__fill--linkedin { background: var(--color-linkedin); }
.platform-bar__fill--google { background: var(--color-google); }

.platform-bar__count {
    width: 2rem;
    font-size: 0.8125rem;
    color: var(--color-text);
    font-weight: 600;
}
