:root {
  --blue: #1877F2; --blue-dark: #166FE5; --bg: #F0F2F5; --card: #FFFFFF;
  --text: #050505; --muted: #65676B; --divider: #E4E6EB; --danger: #E41E3F;
  --success: #31A24C; --hover: #F2F2F2; --radius: 8px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); padding-top: 72px; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
.muted { color: var(--muted); }
.topbar { position: fixed; top: 0; left: 0; right: 0; height: 56px; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.12); z-index: 10; }
.topbar-inner { max-width: 1100px; margin: 0 auto; height: 56px; display: flex; align-items: center; justify-content: space-between; padding: 0 16px; }
.logo { font-weight: 800; font-size: 24px; color: var(--blue); }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.user-link { display: flex; align-items: center; gap: 8px; color: var(--text); }
.container { max-width: 1100px; margin: 0 auto; padding: 0 16px 40px; }
.grid { display: grid; grid-template-columns: 280px 1fr 300px; gap: 16px; }
@media (max-width: 992px) { .grid { grid-template-columns: 1fr; } }
.card { background: var(--card); border-radius: var(--radius); box-shadow: 0 1px 2px rgba(0,0,0,.1); padding: 16px; margin-bottom: 16px; }
.btn-primary { background: var(--blue); color: #fff; border: 0; border-radius: 6px; padding: 8px 16px; font-weight: 600; cursor: pointer; }
.btn-primary:hover { background: var(--blue-dark); }
.btn-secondary { background: #E4E6EB; color: var(--text); border: 0; border-radius: 6px; padding: 8px 16px; cursor: pointer; }
.btn-secondary:hover { background: #d8dadf; }
.btn-sm { padding: 4px 10px; font-size: 13px; }
.input, textarea { width: 100%; border: 1px solid var(--divider); border-radius: 6px; padding: 10px 12px; font: inherit; }
.input:focus, textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 2px rgba(24,119,242,.2); }
textarea { min-height: 72px; resize: vertical; }
.flash { border-radius: 6px; padding: 10px 12px; margin-bottom: 12px; }
.flash.success { background: #e7f6ec; color: #1a7f37; }
.flash.error { background: #fde7eb; color: var(--danger); }
.avatar { --size: 40px; width: var(--size); height: var(--size); min-width: var(--size); border-radius: 50%; background: var(--blue); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; }
.post-card .post-header { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.post-card .post-content { white-space: pre-wrap; word-break: break-word; margin-bottom: 8px; }
.post-card .post-actions { display: flex; gap: 16px; align-items: center; border-top: 1px solid var(--divider); padding-top: 8px; }
.like-btn { background: none; border: 0; cursor: pointer; font: inherit; color: var(--muted); }
.like-btn.liked { color: var(--blue); font-weight: 700; }
.comment-item { display: flex; gap: 8px; margin-bottom: 10px; font-size: 14px; }
.stat-row { display: flex; gap: 8px; color: var(--muted); font-size: 14px; flex-wrap: wrap; }
.auth-wrap { min-height: calc(100vh - 72px); display: flex; align-items: center; justify-content: center; }
.auth-card { width: 100%; max-width: 400px; }
.profile-mini { display: flex; gap: 12px; align-items: center; }
.composer form { display: flex; flex-direction: column; gap: 8px; }
.footer { text-align: center; color: var(--muted); font-size: 13px; padding: 24px; }

/* ---------- Panel admin ---------- */
.btn-danger { background: var(--danger); color: #fff; border: 0; border-radius: 6px; padding: 4px 10px; font-size: 13px; cursor: pointer; }
.btn-danger:hover { background: #c11236; }
.admin-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.admin-search { display: flex; gap: 8px; align-items: center; }
.admin-search .input { width: 300px; }
.stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
.stat-card { margin-bottom: 0; text-align: center; }
.stat-card .muted { font-size: 13px; }
.stat-num { font-size: 26px; font-weight: 800; margin-top: 2px; }
.admin-tabs { display: flex; gap: 4px; margin: 16px 0 12px; border-bottom: 1px solid var(--divider); }
.admin-tabs a { padding: 8px 16px; border-radius: 6px 6px 0 0; color: var(--muted); font-weight: 600; }
.admin-tabs a.on { background: var(--card); color: var(--blue); box-shadow: 0 -2px 0 var(--blue) inset; }
.admin-tabs a:hover { text-decoration: none; background: var(--card); }
.table-scroll { overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.admin-table th { text-align: left; padding: 8px; border-bottom: 2px solid var(--divider); color: var(--muted); font-size: 13px; white-space: nowrap; }
.admin-table td { padding: 10px 8px; border-bottom: 1px solid var(--divider); vertical-align: top; }
.admin-table tr:hover td { background: var(--hover); }
.admin-table .actions { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.pill { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.pill.admin { background: #e7f0ff; color: #1a4fd6; }
.pill.blocked { background: #fde7eb; color: var(--danger); }
.pill.ok { background: #e7f6ec; color: var(--success); }
.pill.wait { background: #fff4e5; color: #a15c00; }
.pill.log { background: #EEE; color: #444; font-family: ui-monospace, Consolas, monospace; }
.mod-item { border-bottom: 1px solid var(--divider); padding: 10px 0; }
.mod-item:last-child { border-bottom: 0; }
.mod-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.mod-body { white-space: pre-wrap; word-break: break-word; margin: 6px 0 0 36px; }
@media (max-width: 640px) {
  .admin-search, .admin-search .input { width: 100%; }
  .mod-body { margin-left: 0; }
}
