/* GymManager Social – egyetlen stíluslap. Színek: a GymManager logójáé (tinta #0B1B3A, kiemelő #1D4ED8). */
:root {
    --ink: #0B1B3A;
    --accent: #1D4ED8;
    --accent-dark: #1E40AF;
    --bg: #F5F7FB;
    --card: #FFFFFF;
    --line: #E3E8F0;
    --muted: #5B6B85;
    --ok: #0F7A4A;    --ok-bg: #E7F6EE;
    --warn: #8A5A00;  --warn-bg: #FFF4DB;
    --err: #B42318;   --err-bg: #FDECEA;
    --radius: 12px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}
h1 { font-size: 26px; line-height: 1.2; margin: 0 0 6px; }
h2 { font-size: 17px; margin: 0 0 8px; }
a { color: var(--accent); }
code { font: 13px/1.4 ui-monospace, Consolas, monospace; background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; word-break: break-all; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

/* Felső sáv */
.topbar { background: var(--ink); color: #fff; }
.topbar-inner { max-width: 1040px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-weight: 700; letter-spacing: .2px; }
.brand img { border-radius: 8px; }
.nav { display: flex; gap: 4px; flex: 1; }
.nav a { color: #C9D6F0; text-decoration: none; padding: 6px 12px; border-radius: 8px; font-weight: 600; }
.nav a:hover { color: #fff; background: rgba(255,255,255,.08); }
.nav a.is-active { color: #fff; background: rgba(125,176,255,.18); }
.user { display: flex; align-items: center; gap: 10px; font-size: 13px; color: #C9D6F0; }
.topbar .btn-ghost { color: #fff; border-color: rgba(255,255,255,.3); background: transparent; }

/* Oldal */
.page { max-width: 1040px; margin: 0 auto; padding: 28px 16px 48px; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; margin-top: 16px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-top: 16px; }
.cards .card { margin-top: 0; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 14px 0 4px; }
.actions form { margin: 0; }
.callback { font-size: 12px; color: var(--muted); margin: 14px 0 0; }

/* Állapotok */
.status-list { list-style: none; margin: 12px 0; padding: 0; }
.status-list li { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 0; border-top: 1px solid var(--line); }
.status-list li:first-child { border-top: 0; }
.pf { min-width: 120px; font-weight: 600; display: inline-flex; align-items: center; gap: 8px; }
.pf::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--muted); }
.pf-facebook::before { background: #1877F2; }
.pf-instagram::before { background: #E1306C; }
.pf-tiktok::before { background: #111; box-shadow: 2px 0 0 #25F4EE, -2px 0 0 #FE2C55; }
.st { font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 999px; }
.st-ok { color: var(--ok); background: var(--ok-bg); }
.st-mute { color: var(--muted); background: var(--bg); border: 1px solid var(--line); }
.st-info { color: var(--accent-dark); background: #E8EEFC; }
.st-warn { color: var(--warn); background: var(--warn-bg); }
.st-err { color: var(--err); background: var(--err-bg); }

/* Üzenetek */
.alert { border-radius: 10px; padding: 10px 14px; margin: 0 0 14px; border: 1px solid transparent; }
.alert-ok { color: var(--ok); background: var(--ok-bg); border-color: #BFE6D0; }
.alert-warn { color: var(--warn); background: var(--warn-bg); border-color: #F5DFA8; }
.alert-err { color: var(--err); background: var(--err-bg); border-color: #F5C2BC; }

/* Gombok */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: inherit; font-weight: 600; padding: 9px 16px; border-radius: 10px; border: 1px solid transparent; cursor: pointer; text-decoration: none; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); }
.btn-ghost { background: #fff; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: #C5CEDD; }
.btn-sm { padding: 5px 10px; font-size: 13px; }
.btn-danger { color: var(--err); }
.btn-danger:hover { border-color: #F5C2BC; background: var(--err-bg); }
.btn-block { width: 100%; }
.btn:focus-visible, input:focus-visible, textarea:focus-visible, summary:focus-visible { outline: 3px solid rgba(29,78,216,.35); outline-offset: 2px; }

/* Űrlap */
.form { display: grid; gap: 14px; margin-top: 18px; }
.field { display: grid; gap: 6px; font-weight: 600; font-size: 14px; }
.field input { font: inherit; font-weight: 400; padding: 10px 12px; border: 1px solid #C5CEDD; border-radius: 10px; background: #fff; color: var(--ink); width: 100%; }
.code-input { font-size: 24px !important; letter-spacing: 8px; text-align: center; }

/* Belépő oldalak */
.auth-body { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.auth-card { width: 100%; max-width: 400px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 28px; box-shadow: 0 10px 30px rgba(11,27,58,.06); }
.auth-brand { display: flex; align-items: center; gap: 12px; font-weight: 700; font-size: 18px; margin-bottom: 22px; }
.auth-brand img { border-radius: 10px; }
.auth-card h1 { font-size: 22px; }

/* ---------- Posztok listája ---------- */
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.page-head p { margin: 0; }
.post-section { margin-top: 26px; }
.post-section > h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); margin-bottom: 10px; }
.card.empty { text-align: center; padding: 28px 20px; }
.card.empty p { margin-top: 0; }
.post-card { display: grid; grid-template-columns: 150px 88px 1fr auto; gap: 16px; align-items: start; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 10px; }
.post-card.is-locked { background: #FBFCFE; }
.post-when { display: grid; gap: 6px; justify-items: start; }
.post-when strong { font-size: 15px; }
.post-thumb { position: relative; width: 88px; height: 88px; border-radius: 10px; overflow: hidden; background: var(--bg); border: 1px solid var(--line); display: grid; place-items: center; }
.post-thumb img, .post-thumb video { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb-text { font-weight: 700; color: var(--muted); font-size: 22px; }
.thumb-badge { position: absolute; right: 4px; bottom: 4px; background: rgba(11,27,58,.78); color: #fff; font-size: 11px; font-weight: 700; padding: 1px 6px; border-radius: 6px; }
.post-main { min-width: 0; }
.post-text { margin: 0 0 8px; white-space: pre-line; overflow-wrap: anywhere; }
.targets { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.targets li { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.targets .pf { min-width: 118px; font-size: 13px; }
.target-error { flex-basis: 100%; color: var(--err); font-size: 13px; padding-left: 18px; }
.target-note { flex-basis: 100%; color: var(--warn); font-size: 13px; padding-left: 18px; }
.target-retry { margin: 0; }
.target-retry .btn-sm { padding: 2px 9px; font-size: 12px; }
.post-actions { display: flex; flex-direction: column; gap: 6px; align-items: stretch; }
.post-actions form { margin: 0; }
.post-actions .btn { width: 100%; }
.pager { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 16px; }

/* ---------- Szerkesztő ---------- */
.editor { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 20px; align-items: start; }
.editor-form .card:first-child { margin-top: 0; }
.textarea, .input { font: inherit; padding: 10px 12px; border: 1px solid #C5CEDD; border-radius: 10px; background: #fff; color: var(--ink); width: 100%; }
.textarea { resize: vertical; min-height: 120px; line-height: 1.5; }
.input { max-width: 260px; }
.counters { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.counter { font-size: 12px; color: var(--muted); background: var(--bg); border: 1px solid var(--line); border-radius: 999px; padding: 2px 9px; }
.counter.is-over { color: var(--err); background: var(--err-bg); border-color: #F5C2BC; font-weight: 700; }

.media-list { list-style: none; margin: 12px 0; padding: 0; display: grid; gap: 8px; }
.media-list:empty { display: none; }
.media-item { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 12px; align-items: center; border: 1px solid var(--line); border-radius: 10px; padding: 8px; background: #fff; }
.media-item.is-error { border-color: #F5C2BC; background: var(--err-bg); }
.media-thumb { position: relative; width: 64px; height: 64px; border-radius: 8px; overflow: hidden; background: var(--bg); display: grid; place-items: center; }
.media-thumb img, .media-thumb video { width: 100%; height: 100%; object-fit: cover; display: block; }
.media-info { display: grid; gap: 2px; min-width: 0; }
.media-name { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.media-error { color: var(--err); font-size: 13px; }
.media-tools { display: flex; gap: 4px; }
.icon-btn { width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--line); background: #fff; font: inherit; font-weight: 700; cursor: pointer; color: var(--ink); }
.icon-btn:hover:not(:disabled) { border-color: #C5CEDD; }
.icon-btn:disabled { opacity: .35; cursor: default; }
.icon-danger { color: var(--err); }
.progress { position: relative; display: block; height: 18px; background: var(--bg); border-radius: 999px; overflow: hidden; }
.progress span { position: absolute; inset: 0 auto 0 0; background: #C9D8FB; transition: width .2s; }
.progress em { position: relative; font-style: normal; font-size: 12px; padding-left: 8px; line-height: 18px; }
.dropzone { position: relative; display: grid; justify-items: center; gap: 2px; border: 2px dashed #C5CEDD; border-radius: 12px; padding: 22px 16px; text-align: center; cursor: pointer; background: #FBFCFE; }
.dropzone:hover, .dropzone.is-over { border-color: var(--accent); background: #F1F5FE; }
.dropzone input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.dropzone:focus-within { outline: 3px solid rgba(29,78,216,.35); outline-offset: 2px; }
.dropzone-title { font-weight: 700; color: var(--accent); }

.platform-options { display: grid; gap: 10px; }
.platform-option { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.platform-check { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; cursor: pointer; }
.platform-check input { width: 18px; height: 18px; accent-color: var(--accent); }
.own-text { margin-top: 8px; }
.own-text summary { cursor: pointer; color: var(--accent); font-size: 14px; font-weight: 600; }
.own-text .textarea { margin-top: 8px; min-height: 90px; }

.issues { list-style: none; margin: 14px 0 0; padding: 10px 14px; border-radius: 10px; background: var(--warn-bg); border: 1px solid #F5DFA8; display: grid; gap: 4px; font-size: 14px; }
.issues.has-errors { background: var(--err-bg); border-color: #F5C2BC; }
.issues .issue-err { color: var(--err); }
.issues .issue-note { color: var(--warn); }
.danger-zone { margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--line); }

/* ---------- Előnézet ---------- */
.editor-preview { align-self: stretch; }
.preview-sticky { position: sticky; top: 16px; }
.preview-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0 12px; }
.tab { font: inherit; font-size: 13px; border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 4px 10px; cursor: pointer; }
.tab.is-active { border-color: var(--accent); background: #E8EEFC; }
.tab .pf { min-width: 0; }
.pv { background: #fff; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; font-size: 14px; }
.pv-head { display: flex; align-items: center; gap: 10px; padding: 10px 12px; }
.pv-head > div { display: grid; }
.pv-sub { font-size: 12px; color: var(--muted); }
.pv-avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--ink); color: #fff; display: grid; place-items: center; font-weight: 700; flex: none; }
.pv-ring { box-shadow: 0 0 0 2px #fff, 0 0 0 4px #E1306C; width: 30px; height: 30px; }
.pv-text { margin: 0; padding: 0 12px 10px; white-space: pre-line; overflow-wrap: anywhere; }
.pv-more { color: var(--muted); }
.pv-fit { width: 100%; max-height: 420px; object-fit: contain; display: block; background: #000; }
.pv-cover { width: 100%; height: 100%; object-fit: cover; display: block; }
.pv-contain { width: 100%; height: 100%; object-fit: contain; display: block; }
.pv-fb-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; }
.pv-fb-grid.n3 .pv-fb-cell:first-child { grid-column: span 2; aspect-ratio: 2 / 1; }
.pv-fb-cell { position: relative; aspect-ratio: 1; overflow: hidden; background: var(--bg); }
.pv-plus { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(0,0,0,.45); color: #fff; font-size: 26px; font-weight: 700; }
.pv-instagram .pv-text { padding-top: 8px; }
.pv-ig-frame { position: relative; width: 100%; aspect-ratio: 1; background: var(--bg); overflow: hidden; }
.pv-count { position: absolute; top: 8px; right: 8px; background: rgba(0,0,0,.6); color: #fff; font-size: 12px; padding: 2px 8px; border-radius: 999px; }
.pv-dots { display: flex; justify-content: center; gap: 4px; padding-top: 8px; }
.pv-dots span { width: 6px; height: 6px; border-radius: 50%; background: #C5CEDD; }
.pv-dots span.on { background: var(--accent); }
.pv-tiktok { background: #000; border-color: #000; }
.pv-tt-frame { position: relative; aspect-ratio: 9 / 16; max-height: 560px; margin: 0 auto; color: #fff; }
.pv-tt-caption { position: absolute; left: 0; right: 0; bottom: 0; padding: 40px 12px 14px; background: linear-gradient(transparent, rgba(0,0,0,.7)); }
.pv-tt-caption p { margin: 4px 0 0; white-space: pre-line; overflow-wrap: anywhere; font-size: 13px; }
.pv-tiktok .muted, .pv-tiktok .pv-more { color: #C9D6F0; }

@media (max-width: 900px) {
    .editor { grid-template-columns: 1fr; }
    .preview-sticky { position: static; }
    .post-card { grid-template-columns: 88px minmax(0, 1fr); }
    .post-when { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
    .post-actions { grid-column: 1 / -1; flex-direction: row; }
    .post-actions .btn { width: auto; }
}

@media (max-width: 640px) {
    .topbar-inner { gap: 10px; }
    .nav { order: 3; flex-basis: 100%; }
    .user { margin-left: auto; }
    .user-email { display: none; }
    h1 { font-size: 22px; }
}
