/* Layout: cabeçalho com resumo de status e, abaixo, um feed de uma coluna em que cada post já aparece inteiro, com aprovação direta. Formulários da social media abrem num painel. */
:root {
  --bg: #f6f5f8;
  --surface: #ffffff;
  --ink: #1d1a24;
  --muted: #6b6577;
  --line: #e4e1ea;
  --accent: #5b2a86;
  --accent-ink: #ffffff;
  --accent-soft: #efe7f6;
  --wait: #9a6400; --wait-bg: #fff3d6;
  --ok: #1d7a46; --ok-bg: #dff3e7;
  --fix: #b3372b; --fix-bg: #fde4e0;
  --shadow: 0 1px 2px rgba(29,26,36,.06), 0 8px 24px rgba(29,26,36,.06);
  --f-display: "Bricolage Grotesque", "Inter", system-ui, sans-serif;
  --f-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #141219; --surface: #1d1a24; --ink: #f1eef6; --muted: #a59fb2; --line: #2f2b38;
  --accent: #c9a2ef; --accent-ink: #1d1029; --accent-soft: #2c2238;
  --wait: #f2c062; --wait-bg: #3a2e12; --ok: #79d6a0; --ok-bg: #16331f; --fix: #f3998e; --fix-bg: #3d1c18;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.25); color-scheme: dark } }
:root[data-theme="dark"] {
  --bg: #141219; --surface: #1d1a24; --ink: #f1eef6; --muted: #a59fb2; --line: #2f2b38;
  --accent: #c9a2ef; --accent-ink: #1d1029; --accent-soft: #2c2238;
  --wait: #f2c062; --wait-bg: #3a2e12; --ok: #79d6a0; --ok-bg: #16331f; --fix: #f3998e; --fix-bg: #3d1c18;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.25); color-scheme: dark }

* { box-sizing: border-box }
body { background: var(--bg); color: var(--ink); font-family: var(--f-body); font-size: 15px; line-height: 1.5 }
.wrap { max-width: 620px; margin: 0 auto; padding-block: 28px 64px;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)) }
button, input, textarea, select { font: inherit; color: inherit }
button { cursor: pointer }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px }

header.top { display: flex; flex-wrap: wrap; gap: 16px 24px; align-items: flex-end; justify-content: space-between }
.eyebrow { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600 }
h1 { font-family: var(--f-display); font-weight: 700; font-size: clamp(28px, 6vw, 38px); line-height: 1.05; margin: 4px 0 0; text-wrap: balance }
.handle { color: var(--muted); font-size: 15px; margin-top: 4px }
.btn { border: 1px solid var(--line); background: var(--surface); border-radius: 10px; padding: 9px 14px; font-weight: 500; display: inline-flex; align-items: center; gap: 6px }
.btn:hover { border-color: var(--muted) }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent) }
.btn.ok { background: var(--ok); color: var(--surface); border-color: var(--ok) }
.btn.fix { background: var(--surface); color: var(--fix); border-color: var(--fix) }
.btn.ghost { border-color: transparent; background: transparent; color: var(--muted) }
.btn:disabled { opacity: .5; cursor: default }
.btn.big { width: 100%; justify-content: center; padding: 13px 16px; font-size: 16px; font-weight: 600; border-radius: 12px }
.btn.wa { background: #1fa855; color: #ffffff; border-color: #1fa855; text-decoration: none; justify-content: center; font-weight: 600 }
.btn.wa:hover { background: #1a9149; border-color: #1a9149 }
.linkish { background: none; border: 0; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; font-size: 14px; padding: 4px; align-self: center }
.actions { display: flex; gap: 8px; flex-wrap: wrap }

.summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 22px }
.sum { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; text-align: left; display: flex; flex-direction: column; gap: 2px }
.sum b { font-family: var(--f-display); font-size: 28px; line-height: 1; font-variant-numeric: tabular-nums }
.sum span { font-size: 13px; color: var(--muted) }
.sum.wait b { color: var(--wait) } .sum.fix b { color: var(--fix) } .sum.ok b { color: var(--ok) }
.sum[aria-pressed="true"] { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) }
.toolbar { margin: 18px 0 14px }
.meta { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; font-size: 12.5px; color: var(--muted) }
.meta .dot::before { content: "·"; margin-right: 6px }

/* feed */
.feed { display: flex; flex-direction: column; gap: 22px }
.post { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column }
.statusbar { display: flex; align-items: center; gap: 7px; padding: 6px 14px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .09em }
.statusbar::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor }
.statusbar.pendente { color: var(--wait); background: var(--wait-bg) }
.statusbar.aprovado { color: var(--ok); background: var(--ok-bg) }
.statusbar.ajustes { color: var(--fix); background: var(--fix-bg) }
.cardhead { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line); background: linear-gradient(180deg, var(--accent-soft), var(--surface)) }
.cardhead .ch-date { display: flex; align-items: center; gap: 10px; min-width: 0 }
.cardhead .ch-day { font-family: var(--f-display); font-size: 26px; font-weight: 500; line-height: 1; color: var(--accent); font-variant-numeric: tabular-nums }
.cardhead .ch-txt { display: flex; flex-direction: column; line-height: 1.2; min-width: 0 }
.cardhead .ch-mon { font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .1em; color: var(--ink) }
.cardhead .ch-wd { font-size: 12px; color: var(--muted) }
.cardhead .ch-hr { font-size: 13px; font-weight: 600; color: var(--accent); border: 1px solid var(--accent); border-radius: 99px; padding: 2px 10px; font-variant-numeric: tabular-nums; white-space: nowrap }
.cardhead .ch-none { font-size: 13px; color: var(--muted) }
.post-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 14px; min-width: 0 }
.post-body > * { min-width: 0 }
.post-foot { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 14px; border-top: 1px solid var(--line); background: var(--surface); background: color-mix(in srgb, var(--bg) 55%, var(--surface)) }
.post-foot > * { min-width: 0 }
.post h3 { margin: 2px 0 0; font-size: 17px; font-weight: 600; line-height: 1.3 }
.tag-ex { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); border: 1px dashed var(--line); border-radius: 6px; padding: 1px 6px }

.viewer { position: relative; aspect-ratio: 4 / 5; width: 100%; max-width: 100%; background: #000; overflow: hidden }
.placeholder { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; padding: 22px; text-align: center;
  font-family: var(--f-display); font-size: 22px; line-height: 1.2; color: var(--accent); background: linear-gradient(160deg, var(--accent-soft), var(--bg)) }
.viewer img, .viewer video { width: 100%; height: 100%; object-fit: contain; display: block; background: #000 }
.track { display: flex; width: 100%; height: 100%; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch }
.track::-webkit-scrollbar { display: none }
.slide { flex: 0 0 100%; width: 100%; height: 100%; scroll-snap-align: center; scroll-snap-stop: always }
.vwrap { position: relative; width: 100%; height: 100% }
.vplay { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); border: 0; background: rgba(0,0,0,.6); color: #fff; padding: 10px 18px; border-radius: 99px; font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 8px; white-space: nowrap }
.vplay:disabled { opacity: 1; cursor: default }
.viewer .nav { position: absolute; top: 50%; transform: translateY(-50%); border: 0; width: 28px; height: 28px; border-radius: 50%; background: rgba(255,255,255,.55); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); color: #1d1a24; font-size: 16px; line-height: 1; display: flex; align-items: center; justify-content: center; box-shadow: 0 1px 4px rgba(0,0,0,.12); opacity: .8; transition: opacity .15s }
.viewer .nav:hover { opacity: 1 }
@media (hover: none) { .viewer .nav { opacity: .55 } }
.viewer .prev { left: 10px } .viewer .next { right: 10px }
.vcount { position: absolute; top: 10px; right: 10px; background: rgba(0,0,0,.45); color: #fff; font-size: 12px; font-weight: 500; padding: 2px 8px; border-radius: 99px; pointer-events: none; font-variant-numeric: tabular-nums }
.dots { display: flex; gap: 5px; justify-content: center; padding-top: 10px }
.dots:empty { display: none }
.dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--line) } .dots i.on { background: var(--accent) }

.section-label { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; margin-bottom: 6px }
.caption { white-space: pre-wrap; font-size: 14.5px; overflow-wrap: anywhere }
.caption.clamp { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden }
.more { background: none; border: 0; padding: 2px 0; color: var(--muted); font-weight: 600; font-size: 14px }
.note-box { white-space: pre-wrap; background: var(--bg); border-radius: 10px; padding: 10px 12px; font-size: 14px; overflow-wrap: anywhere }
.thread { display: flex; flex-direction: column; gap: 10px }
.msg { border-left: 3px solid var(--fix); padding: 2px 0 2px 12px }
.msg .who { font-size: 12.5px; color: var(--muted) }
.msg .txt { white-space: pre-wrap; overflow-wrap: anywhere }
.msg.done { border-color: var(--ok) }
.msg.done .txt { text-decoration: line-through; color: var(--muted) }
.msg.owner { display: flex; align-items: flex-start; gap: 10px }
.msg-body { flex: 1; min-width: 0 }
.msg-check { flex: none; width: 22px; height: 22px; margin-top: 1px; border-radius: 6px; border: 1.5px solid var(--muted); background: transparent; color: var(--surface); font-size: 13px; font-weight: 700; line-height: 1; display: flex; align-items: center; justify-content: center; padding: 0 }
.msg-check[aria-pressed="true"] { background: var(--ok); border-color: var(--ok) }
.msg-del { flex: none; border: 0; background: transparent; color: var(--muted); font-size: 14px; padding: 2px 4px; border-radius: 6px }
.msg-del:hover { color: var(--fix) }
.cover-mini { display: flex; gap: 12px; align-items: center; padding-top: 14px; border-top: 1px dashed var(--line) }
.cover-frame { position: relative; overflow: hidden; aspect-ratio: 4 / 5; max-width: 100%; border-radius: 10px; background: var(--accent-soft) }
.cover-frame img { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; user-select: none; -webkit-user-drag: none }
.client-actions { display: flex; flex-direction: column; gap: 10px }
.cover-btn { padding: 0; border: 0; background: none; cursor: zoom-in; flex: none; border-radius: 10px }
.lightbox { position: fixed; inset: 0; z-index: 40; background: rgba(10,8,14,.88); display: flex; align-items: center; justify-content: center; cursor: zoom-out;
  padding: calc(env(safe-area-inset-top, 0px) + 60px) max(16px, env(safe-area-inset-right, 0px)) calc(env(safe-area-inset-bottom, 0px) + 24px) max(16px, env(safe-area-inset-left, 0px)) }
.lb-frame { width: min(440px, 100%, calc((100vh - 120px) * .8)); box-shadow: 0 20px 60px rgba(0,0,0,.5) }
.lb-close { position: fixed; top: calc(env(safe-area-inset-top, 0px) + 12px); right: max(12px, env(safe-area-inset-right, 0px)); width: 40px; height: 40px; border-radius: 50%; border: 0; background: rgba(255,255,255,.16); color: #ffffff; font-size: 18px }
.approved-note { display: flex; flex-direction: column; gap: 2px; background: var(--ok-bg); color: var(--ok); border-radius: 12px; padding: 12px 14px; font-size: 14px }
.approved-note strong { font-size: 15px }
.approved-note span { color: var(--ink); opacity: .8 }
.approved-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px 10px 10px; border-radius: 12px; background: var(--ok-bg) }
.approved-row .ok-ico { width: 26px; height: 26px; flex: none; border-radius: 50%; background: var(--ok); color: var(--surface); display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 700 }
.approved-row .ok-txt { flex: 1; min-width: 0; font-weight: 600; color: var(--ok) }
.undo-link { background: none; border: 0; padding: 4px 2px; color: var(--muted); font-size: 13.5px; text-decoration: underline; text-underline-offset: 3px }
.undo-link:hover { color: var(--ink) }
.owner-row { display: flex; gap: 8px; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 12px }
.err { color: var(--fix); font-size: 13.5px }

.empty { border: 1px dashed var(--line); border-radius: 14px; padding: 40px 20px; text-align: center; color: var(--muted) }
.empty strong { display: block; color: var(--ink); font-family: var(--f-display); font-size: 20px; margin-bottom: 4px }
.notice { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; color: var(--muted); font-size: 14px }
.preview-bar { margin-top: 18px; display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; justify-content: space-between; background: var(--accent-soft); border: 1px solid var(--accent); border-radius: 12px; padding: 12px 14px; font-size: 14px }

/* painel (formulários da social media) */
.scrim { position: fixed; inset: 0; background: rgba(20,16,28,.45); z-index: 20 }
.panel { position: fixed; top: 0; right: 0; bottom: 0; width: min(560px, 100%); background: var(--surface); z-index: 21; overflow-y: auto;
  padding: calc(env(safe-area-inset-top, 0px) + 16px) max(20px, env(safe-area-inset-right, 0px)) calc(env(safe-area-inset-bottom, 0px) + 28px) 20px;
  box-shadow: -12px 0 40px rgba(0,0,0,.15); display: flex; flex-direction: column; gap: 16px }
.panel > * { flex-shrink: 0 }
@media (max-width: 640px) { .panel { top: auto; height: 92vh; width: 100%; border-radius: 18px 18px 0 0; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)) } }
.panel-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px }
.panel h2 { font-family: var(--f-display); font-size: 24px; margin: 4px 0 0; line-height: 1.15; text-wrap: balance }
textarea, input[type=text], input[type=date], input[type=time], select { width: 100%; border: 1px solid var(--line); background: var(--bg); border-radius: 10px; padding: 9px 12px }
textarea { min-height: 90px; resize: vertical }
label.f { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 500; color: var(--muted) }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px }
.files { display: flex; gap: 8px; flex-wrap: wrap }
.files .f-item { position: relative; width: 72px; height: 90px; border-radius: 8px; overflow: hidden; background: var(--accent-soft) }
.files .f-item img, .files .f-item video { width: 100%; height: 100%; object-fit: cover }
.files .f-item button { position: absolute; top: 3px; right: 3px; border: 0; width: 22px; height: 22px; border-radius: 50%; background: rgba(0,0,0,.6); color: #fff; font-size: 13px; line-height: 1 }
.dropzone { border: 2px dashed var(--line); border-radius: 12px; padding: 22px 16px; text-align: center; display: flex; flex-direction: column; gap: 4px; cursor: pointer; background: var(--bg); transition: border-color .15s, background .15s }
.dropzone strong { font-weight: 600 }
.dropzone span { font-size: 13px; color: var(--muted) }
.dropzone:hover, .dropzone.over { border-color: var(--accent); background: var(--accent-soft) }
.cover-row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap }
.cover-edit { width: 180px; cursor: grab; touch-action: none; outline: 1px solid var(--line) }
.cover-edit:active { cursor: grabbing }
.zoom-row { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); font-weight: 500; flex-wrap: wrap }
.zoom-row input { width: 140px; max-width: 100%; accent-color: var(--accent) }
.cover-sec { display: flex; flex-direction: column; gap: 8px }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(env(safe-area-inset-bottom, 0px) + 20px); background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 10px; z-index: 30; font-weight: 500 }

/* ---------- sistema próprio: login, barra do topo e painel da superadmin ---------- */
html, body { min-height: 100% }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; font-size: 13.5px; color: var(--muted) }
.topbar .who { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0 }
.linkbtn { background: none; border: 0; padding: 4px 0; color: var(--muted); font-weight: 500; text-decoration: underline; text-underline-offset: 3px }
.linkbtn:hover { color: var(--ink) }
.backlink { background: none; border: 0; padding: 4px 0; color: var(--accent); font-weight: 600 }

.login { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding-block: 32px;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)) }
.login-card { width: min(380px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); padding: 28px 24px; display: flex; flex-direction: column; gap: 14px }
.login-card h1 { font-size: 28px }
.login-card .sub { color: var(--muted); font-size: 14px; margin-top: -6px }
input[type=password], input[type=email] { width: 100%; border: 1px solid var(--line); background: var(--bg); border-radius: 10px; padding: 9px 12px }

.clients { display: flex; flex-direction: column; gap: 12px }
.client-card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; box-shadow: var(--shadow) }
.client-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px }
.client-top h3 { margin: 0; font-family: var(--f-display); font-size: 19px; line-height: 1.2 }
.client-top .meta { margin-top: 2px }
.counts { display: flex; gap: 6px; flex-wrap: wrap }
.count { font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 99px; font-variant-numeric: tabular-nums }
.count.pendente { color: var(--wait); background: var(--wait-bg) }
.count.ajustes { color: var(--fix); background: var(--fix-bg) }
.count.aprovado { color: var(--ok); background: var(--ok-bg) }
.client-actions-row { display: flex; gap: 8px; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 10px }
.settings-card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin-bottom: 22px }
.settings-card label.f { flex: 1 1 220px }
.creds { background: var(--bg); border-radius: 10px; padding: 12px 14px; font-size: 14px; line-height: 1.7; white-space: pre-wrap; overflow-wrap: anywhere; font-variant-numeric: tabular-nums }
