:root {
    --bg: #0f1115;
    --surface: #181b22;
    --text: #e8eaed;
    --muted: #9aa0ab;
    --accent: #5b8cff;
    --border: #2a2e38;
}

* { box-sizing: border-box; }

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

a { color: var(--accent); text-decoration: none; }

.site-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 32px;
    border-bottom: 1px solid var(--border);
}

.site-header .logo { font-weight: 700; font-size: 1.25rem; color: var(--text); }
.site-header nav a, .site-header nav button {
    margin-left: 16px;
    background: none;
    border: none;
    color: var(--text);
    cursor: pointer;
    font-size: 0.95rem;
}

main { max-width: 1100px; margin: 0 auto; padding: 32px; }

.hero { text-align: center; padding: 48px 0; }
.hero h1 { font-size: 2rem; margin-bottom: 8px; }
.hero p { color: var(--muted); }

.product-section { margin: 40px 0; }
.product-section h2 { border-bottom: 1px solid var(--border); padding-bottom: 8px; }

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
    margin-top: 16px;
}

.product-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px;
}

.product-card .seller { color: var(--muted); font-size: 0.85rem; }
.product-card .price { font-weight: 700; margin-top: 8px; }

.empty-state { color: var(--muted); }

.auth-form { max-width: 360px; margin: 0 auto; }
.auth-form label { display: block; margin-bottom: 12px; }
.auth-form input {
    display: block;
    width: 100%;
    margin-top: 4px;
    padding: 8px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text);
}
.auth-form button, .profile-header button {
    background: var(--accent);
    color: #fff;
    border: none;
    padding: 10px 16px;
    border-radius: 4px;
    cursor: pointer;
}

.errors { color: #ff6b6b; }

.profile-header { text-align: center; }
.profile-header .avatar { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; }
.profile-header .cover { width: 100%; max-height: 200px; object-fit: cover; border-radius: 8px; }
.profile-header .username { color: var(--muted); }

.flash-success { background: #1f3d2b; border: 1px solid #2d5c3e; padding: 10px; border-radius: 4px; margin-bottom: 16px; }

.post-composer, .comment-form { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 16px; margin-bottom: 24px; }
.post-composer textarea, .comment-form textarea {
    width: 100%; background: var(--bg); color: var(--text); border: 1px solid var(--border);
    border-radius: 4px; padding: 8px; margin-bottom: 8px; resize: vertical;
}
.post-card { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 16px; margin-bottom: 16px; }
.post-author { font-weight: 600; }
.post-time { color: var(--muted); font-size: 0.85rem; margin-left: 8px; }
.post-image { max-width: 100%; border-radius: 6px; margin-top: 8px; }
.post-actions button { background: none; border: 1px solid var(--border); color: var(--text); padding: 6px 12px; border-radius: 4px; cursor: pointer; }
.post-actions a { margin-left: 12px; color: var(--muted); }

.comments { margin-top: 24px; }
.comment { border-top: 1px solid var(--border); padding: 12px 0; }

.notification { background: var(--surface); border: 1px solid var(--border); border-radius: 6px; padding: 12px; margin-bottom: 8px; }
.notification.unread { border-color: var(--accent); }

.sales-table { width: 100%; border-collapse: collapse; margin-top: 16px; }
.sales-table th, .sales-table td { text-align: left; padding: 8px; border-bottom: 1px solid var(--border); }

.owner-panel { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 16px; margin-top: 16px; }

.conversation-row { display: flex; justify-content: space-between; padding: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: 6px; margin-bottom: 8px; }
.message-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.message { background: var(--surface); border: 1px solid var(--border); border-radius: 6px; padding: 8px 12px; max-width: 70%; }
.message.mine { align-self: flex-end; background: #25304a; }

.vote-buttons { display: flex; align-items: center; gap: 8px; margin: 12px 0; }
.vote-buttons button { background: var(--surface); border: 1px solid var(--border); color: var(--text); padding: 6px 12px; border-radius: 4px; cursor: pointer; }
.vote-buttons button.active-up { border-color: #4caf50; color: #4caf50; }
.vote-buttons button.active-down { border-color: #ff6b6b; color: #ff6b6b; }
.vote-score { font-weight: 700; }
