/* Portal de gestão de redes sociais — estilos */
:root {
  --paper: #f5f6fa;
  --surface: #ffffff;
  --ink: #18213d;
  --ink-2: #3a4463;
  --muted: #646d88;
  --line: #dfe3ee;
  --line-strong: #c9cfde;
  --cobalt: #2847c8;
  --cobalt-dark: #1d379f;
  --cobalt-soft: #e8ecfc;
  --danger: #c2263d;
  --danger-soft: #fdecee;
  --ok: #1d7f4f;
  --ok-soft: #e3f5ec;
  --warn: #a35d00;
  --warn-soft: #fff3df;

  --st-rascunho: #6b7280; --st-rascunho-bg: #eef0f3;
  --st-pendente: #a35d00; --st-pendente-bg: #fff1d6;
  --st-aprovado: #1d7f4f; --st-aprovado-bg: #e1f4ea;
  --st-alteracoes: #c2263d; --st-alteracoes-bg: #fde8eb;
  --st-agendado: #2847c8; --st-agendado-bg: #e6ebfc;
  --st-publicado: #5b3fb5; --st-publicado-bg: #efeafb;

  --serif: "Iowan Old Style", "Charter", "Bitstream Charter", "Sitka Text", Cambria, Georgia, serif;
  --sans: "Inter", "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --radius-s: 6px;
  --radius: 10px;
  --shadow-pop: 0 12px 40px rgba(24, 33, 61, .18);
  --sidebar: 248px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 15px/1.5 var(--sans);
}
a { color: var(--cobalt); text-decoration: none; }
a:hover { text-decoration: underline; }
img, video { max-width: 100%; display: block; }
svg[aria-hidden="true"] { width: 18px; height: 18px; flex: none; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--cobalt) 55%, transparent); outline-offset: 2px; border-radius: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

/* ---------- Estrutura ---------- */
.app { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100vh; }
.sidebar {
  background: var(--ink); color: #cfd5e8; position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; padding: 20px 14px; gap: 4px; overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 18px; color: #fff; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 9px; background: var(--cobalt); display: grid; place-items: center;
  font: 700 15px/1 var(--serif); color: #fff;
}
.brand-name { font: 600 17px/1.1 var(--serif); }
.brand-sub { font-size: 12px; color: #9aa3c0; }
.nav-group { margin-top: 14px; padding: 0 10px 4px; font-size: 12px; color: #8790ae; }
.nav a {
  display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: 8px; color: #d6dbee;
  font-weight: 500;
}
.nav a:hover { background: rgba(255,255,255,.07); text-decoration: none; }
.nav a.active { background: rgba(255,255,255,.12); color: #fff; }
.nav a.active svg { color: #fff; }
.nav svg { width: 18px; height: 18px; color: #8f99bb; flex: none; }
.nav .count { margin-left: auto; background: #f0b43c; color: var(--ink); font-size: 12px; font-weight: 700; border-radius: 20px; padding: 0 7px; }
.sidebar-foot { margin-top: auto; padding: 14px 10px 0; border-top: 1px solid rgba(255,255,255,.1); font-size: 13px; }
.sidebar-foot .who { color: #fff; font-weight: 600; }
.sidebar-foot .role { color: #9aa3c0; }
.sidebar-foot button { margin-top: 10px; background: none; border: 1px solid rgba(255,255,255,.2); color: #d6dbee; border-radius: 8px; padding: 6px 10px; cursor: pointer; width: 100%; }
.sidebar-foot button:hover { background: rgba(255,255,255,.07); }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 60px; display: flex; align-items: center; gap: 12px; padding: 0 28px;
  border-bottom: 1px solid var(--line); background: rgba(245,246,250,.92); backdrop-filter: blur(6px);
  position: sticky; top: 0; z-index: 20;
}
.topbar .menu-btn { display: none; }
.topbar .spacer { flex: 1; }
.icon-btn {
  width: 38px; height: 38px; display: grid; place-items: center; border-radius: 9px; border: 1px solid transparent;
  background: none; cursor: pointer; color: var(--ink-2); position: relative;
}
.icon-btn:hover { background: var(--surface); border-color: var(--line); }
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn .dot { position: absolute; top: 5px; right: 5px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: var(--danger); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; }
.content { padding: 28px; max-width: 1320px; width: 100%; }

/* ---------- Títulos de página ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head h1 { font: 600 30px/1.15 var(--serif); margin: 0; letter-spacing: -.01em; }
.page-head p { margin: 6px 0 0; color: var(--muted); max-width: 62ch; }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.back svg { width: 16px; height: 16px; }
.back { display: inline-flex; gap: 6px; align-items: center; color: var(--muted); font-size: 14px; margin-bottom: 8px; }
h2 { font: 600 19px/1.25 var(--serif); margin: 0 0 12px; }
h3 { font-size: 15px; margin: 0 0 8px; }

/* ---------- Botões ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 8px 14px; border-radius: 8px;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); font-weight: 600; font-size: 14px;
  cursor: pointer; white-space: nowrap; line-height: 1.3;
}
.btn:hover { border-color: var(--ink-2); text-decoration: none; }
.btn svg { width: 16px; height: 16px; }
.btn-primary { background: var(--cobalt); border-color: var(--cobalt); color: #fff; }
.btn-primary:hover { background: var(--cobalt-dark); border-color: var(--cobalt-dark); }
.btn-ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn-ok:hover { filter: brightness(.92); border-color: var(--ok); }
.btn-danger { color: var(--danger); }
.btn-danger:hover { border-color: var(--danger); background: var(--danger-soft); }
.btn-ghost { border-color: transparent; background: none; }
.btn-ghost:hover { background: var(--surface); border-color: var(--line); }
.btn-sm { padding: 5px 10px; font-size: 13px; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

/* ---------- Superfícies ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.panel + .panel { margin-top: 18px; }
.grid > .panel + .panel { margin-top: 0; }
.panel-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 12px; }
.panel-head h2 { margin: 0; }
.panel-head a { font-size: 14px; }
.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-main { grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); align-items: start; }
.stack > * + * { margin-top: 18px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.nowrap { white-space: nowrap; }

/* Resumo do painel: linha de números simples */
.tally { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 18px; }
.tally a { padding: 16px 20px; color: var(--ink); border-right: 1px solid var(--line); }
.tally a:last-child { border-right: 0; }
.tally a:hover { background: var(--paper); text-decoration: none; }
.tally strong { display: block; font: 600 28px/1.1 var(--serif); }
.tally span { color: var(--muted); font-size: 13px; }
.tally .warn strong { color: var(--warn); }
.tally .bad strong { color: var(--danger); }

/* Atalhos */
.shortcuts { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 22px; }

/* ---------- Listas de publicações ---------- */
.post-list { list-style: none; margin: 0; padding: 0; }
.post-row {
  display: grid; grid-template-columns: 56px minmax(0,1fr) auto; gap: 14px; align-items: center;
  padding: 10px 0; border-top: 1px solid var(--line);
}
.post-row:first-child { border-top: 0; }
.post-row .when { text-align: center; line-height: 1.1; }
.post-row .when b { display: block; font: 600 20px/1 var(--serif); }
.post-row .when span { font-size: 12px; color: var(--muted); display: block; }
.post-row .title { font-weight: 600; color: var(--ink); display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.post-row .meta { display: flex; gap: 8px; align-items: center; font-size: 13px; color: var(--muted); flex-wrap: wrap; }
.client-tag { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-2); }
.client-tag i { width: 9px; height: 9px; border-radius: 3px; background: var(--c, var(--cobalt)); flex: none; }

/* Estados */
.status { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 20px; font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.status.rascunho { color: var(--st-rascunho); background: var(--st-rascunho-bg); }
.status.pendente { color: var(--st-pendente); background: var(--st-pendente-bg); }
.status.aprovado { color: var(--st-aprovado); background: var(--st-aprovado-bg); }
.status.alteracoes { color: var(--st-alteracoes); background: var(--st-alteracoes-bg); }
.status.agendado { color: var(--st-agendado); background: var(--st-agendado-bg); }
.status.publicado { color: var(--st-publicado); background: var(--st-publicado-bg); }

.platform { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; color: var(--ink-2); }
.platform svg { width: 15px; height: 15px; }

/* Avisos */
.alerts { list-style: none; margin: 0; padding: 0; }
.alert-item { display: flex; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); align-items: flex-start; }
.alert-item:first-child { border-top: 0; }
.alert-item .lvl { width: 8px; height: 8px; border-radius: 50%; margin-top: 7px; flex: none; }
.lvl.alta { background: var(--danger); }
.lvl.media { background: #e19a1c; }
.lvl.baixa { background: var(--cobalt); }
.alert-item a { color: var(--ink); }
.alert-item.unread a { font-weight: 600; }

.empty { padding: 26px 12px; text-align: center; color: var(--muted); }
.empty .btn { margin-top: 10px; }

.notice { display: flex; gap: 10px; padding: 12px 14px; border-radius: 8px; background: var(--warn-soft); color: #6b3d00; font-size: 14px; border: 1px solid #f3dcae; }
.notice.info { background: var(--cobalt-soft); color: #1d2f80; border-color: #cdd6f8; }
.notice svg { width: 18px; height: 18px; flex: none; margin-top: 1px; }

/* ---------- Tabelas ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-weight: 600; color: var(--muted); font-size: 13px; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 11px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr.clickable { cursor: pointer; }
tbody tr.clickable:hover { background: var(--paper); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* Clientes */
.client-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.client-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 18px 16px;
  border-top: 4px solid var(--c); color: var(--ink); display: block;
}
.client-card:hover { text-decoration: none; border-color: var(--line-strong); border-top-color: var(--c); }
.client-card h3 { font: 600 18px/1.2 var(--serif); margin: 0 0 2px; }
.client-card .company { color: var(--muted); font-size: 13px; margin-bottom: 12px; }
.client-card .facts { display: flex; gap: 16px; font-size: 13px; color: var(--muted); margin-top: 12px; }
.client-card .facts b { color: var(--ink); font-size: 15px; }
.acct { font-size: 12.5px; font-weight: 600; padding: 2px 8px; border-radius: 20px; background: var(--paper); color: var(--muted); border: 1px solid var(--line); }
.acct.ativo { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.acct.pausado { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.dl { display: grid; grid-template-columns: 130px 1fr; gap: 8px 12px; margin: 0; font-size: 14px; }
.dl dt { color: var(--muted); }
.dl dd { margin: 0; overflow-wrap: anywhere; }
.client-hero { border-left: 5px solid var(--c); padding-left: 16px; }

/* ---------- Formulários ---------- */
.form { display: grid; gap: 16px; }
.form-row { display: grid; gap: 16px; grid-template-columns: repeat(2, minmax(0,1fr)); }
.form-row.three { grid-template-columns: repeat(3, minmax(0,1fr)); }
.field { display: grid; gap: 6px; min-width: 0; align-content: start; }
.field label, .field .label { font-weight: 600; font-size: 14px; }
.field .hint { font-size: 12.5px; color: var(--muted); }
.field .counter { font-size: 12.5px; color: var(--muted); text-align: right; }
.field .counter.over { color: var(--danger); font-weight: 600; }
input[type=text], input[type=email], input[type=password], input[type=tel], input[type=url], input[type=number],
input[type=date], input[type=time], input[type=month], input[type=datetime-local], input[type=search], select, textarea {
  width: 100%; padding: 9px 11px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface);
  min-height: 40px;
}
textarea { resize: vertical; min-height: 96px; line-height: 1.5; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--cobalt); box-shadow: 0 0 0 3px var(--cobalt-soft); }
.field.invalid input, .field.invalid select, .field.invalid textarea { border-color: var(--danger); }
.field .error { color: var(--danger); font-size: 13px; font-weight: 500; }
.form-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; padding-top: 4px; }
.form-error { background: var(--danger-soft); color: var(--danger); padding: 10px 12px; border-radius: 8px; font-size: 14px; }
.checkbox { display: inline-flex; gap: 8px; align-items: center; font-weight: 500; cursor: pointer; }
.socials-edit .social-line { display: grid; grid-template-columns: 140px 1fr 1fr 38px; gap: 8px; margin-bottom: 8px; }

/* Filtros */
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.filters select, .filters input { width: auto; min-width: 150px; min-height: 36px; padding: 6px 10px; }
.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 8px; overflow: hidden; background: var(--surface); }
.seg button { border: 0; background: none; padding: 7px 13px; cursor: pointer; font-weight: 600; font-size: 14px; color: var(--muted); }
.seg button + button { border-left: 1px solid var(--line-strong); }
.seg button.on { background: var(--ink); color: #fff; }

/* ---------- Calendário ---------- */
.cal-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.cal-bar h2 { margin: 0 8px; min-width: 190px; font-size: 22px; }
.cal { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.cal-head, .cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0,1fr)); }
.cal-head div { padding: 8px 10px; font-size: 13px; color: var(--muted); font-weight: 600; border-bottom: 1px solid var(--line); }
.cal-day { min-height: 118px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 6px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.cal-day:nth-child(7n) { border-right: 0; }
.cal-day.out { background: #fafbfd; }
.cal-day.out .dnum { color: #a9b0c4; }
.cal-day .dhead { display: flex; justify-content: space-between; align-items: center; }
.cal-day .dnum { font-size: 13px; font-weight: 600; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; }
.cal-day.today .dnum { background: var(--cobalt); color: #fff; }
.cal-day .add { opacity: 0; border: 0; background: none; cursor: pointer; color: var(--muted); width: 24px; height: 24px; border-radius: 6px; font-size: 18px; line-height: 1; }
.cal-day:hover .add, .cal-day .add:focus-visible { opacity: 1; }
.cal-day .add:hover { background: var(--cobalt-soft); color: var(--cobalt); }
.chip {
  display: block; text-align: left; border: 0; width: 100%; cursor: pointer; padding: 4px 6px 4px 8px; border-radius: 5px;
  background: var(--paper); border-left: 3px solid var(--c); font-size: 12.5px; line-height: 1.3; color: var(--ink);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.chip:hover { background: var(--cobalt-soft); }
.chip .t { color: var(--muted); margin-right: 4px; font-variant-numeric: tabular-nums; }
.chip .sd { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 4px; vertical-align: 1px; }
.more { font-size: 12px; color: var(--muted); border: 0; background: none; text-align: left; cursor: pointer; padding: 0 4px; }
.cal-week .cal-day { min-height: 340px; }
.cal-week .chip { white-space: normal; padding: 7px 8px 7px 10px; }
.cal-week .chip .ttl { display: block; font-weight: 600; margin: 2px 0; }
.legend { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 12px; font-size: 13px; color: var(--muted); }
.legend span { display: inline-flex; gap: 6px; align-items: center; }
.legend i { width: 9px; height: 9px; border-radius: 50%; }

/* ---------- Editor + pré-visualização ---------- */
.editor { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(320px, .85fr); gap: 22px; align-items: start; }
.preview-col { position: sticky; top: 80px; }
.preview-col .panel { background: #eceef5; border-color: #dde1ec; }
.dropzone {
  border: 2px dashed var(--line-strong); border-radius: 10px; padding: 18px; text-align: center; color: var(--muted);
  cursor: pointer; background: #fafbfd;
}
.dropzone.drag { border-color: var(--cobalt); background: var(--cobalt-soft); }
.dropzone svg { width: 26px; height: 26px; margin: 0 auto 6px; display: block; }
.dropzone strong { color: var(--cobalt); }
.media-chosen { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; padding: 10px; border: 1px solid var(--line); border-radius: 10px; }
.media-chosen img, .media-chosen video { width: 64px; height: 64px; object-fit: cover; border-radius: 6px; }

/* Mockups das plataformas */
.pv { background: #fff; border-radius: 12px; overflow: hidden; color: #111; font-family: -apple-system, "Segoe UI", Helvetica, Arial, sans-serif; max-width: 400px; margin: 0 auto; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.pv-head { display: flex; gap: 10px; align-items: center; padding: 10px 12px; }
.pv-avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--c); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 14px; flex: none; }
.pv-name { font-weight: 600; font-size: 14px; line-height: 1.2; }
.pv-sub { font-size: 12px; color: #65676b; }
.pv-media { background: linear-gradient(135deg, var(--c), color-mix(in srgb, var(--c) 40%, #fff)); display: grid; place-items: center; color: rgba(255,255,255,.9); font-size: 13px; }
.pv-media { position: relative; overflow: hidden; }
.pv-media img, .pv-media video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.pv-text { padding: 10px 12px; font-size: 14px; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
.pv-text .tags { color: #00376b; }
.pv-actions { display: flex; gap: 16px; padding: 8px 12px 4px; color: #262626; }
.pv-actions svg { width: 22px; height: 22px; }
.pv.ig .pv-media { aspect-ratio: 4 / 5; }
.pv.ig .pv-text b { margin-right: 4px; }
.pv.fb .pv-media { aspect-ratio: 4 / 5; }
.pv.fb .pv-text .tags { color: #385898; }
.pv.fb .pv-bar, .pv.li .pv-bar { display: flex; justify-content: space-around; border-top: 1px solid #e4e6eb; margin: 0 12px; padding: 8px 0; font-size: 13px; font-weight: 600; color: #65676b; }
.pv.li .pv-media { aspect-ratio: 4 / 5; }
.pv.li .pv-text .tags { color: #0a66c2; font-weight: 600; }
.pv.li .pv-avatar { border-radius: 6px; }
.pv.tt { background: #000; color: #fff; position: relative; aspect-ratio: 9 / 16; max-width: 290px; }
.pv.tt .pv-media { position: absolute; inset: 0; aspect-ratio: auto; }
.pv.tt .pv-overlay { position: absolute; left: 0; right: 54px; bottom: 0; padding: 14px; background: linear-gradient(transparent, rgba(0,0,0,.65)); font-size: 13.5px; }
.pv.tt .pv-overlay .pv-text { padding: 6px 0 0; color: #fff; }
.pv.tt .pv-overlay .tags { color: #fff; font-weight: 600; }
.pv.tt .pv-side { position: absolute; right: 10px; bottom: 70px; display: grid; gap: 18px; justify-items: center; }
.pv.tt .pv-side svg { width: 28px; height: 28px; }
.pv-more { color: #8e8e8e; }

/* Detalhe da publicação */
.post-detail { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 400px); gap: 22px; align-items: start; }
.decision { border: 2px solid var(--st-pendente-bg); background: #fffaf0; }
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline li { position: relative; padding: 0 0 16px 22px; }
.timeline li::before { content: ""; position: absolute; left: 5px; top: 8px; bottom: -6px; width: 2px; background: var(--line); }
.timeline li:last-child::before { display: none; }
.timeline li::after { content: ""; position: absolute; left: 0; top: 4px; width: 12px; height: 12px; border-radius: 50%; background: var(--surface); border: 2px solid var(--line-strong); }
.timeline li.ev-aprovacao::after { border-color: var(--ok); background: var(--ok); }
.timeline li.ev-pedido_alteracoes::after { border-color: var(--danger); background: var(--danger); }
.timeline li.ev-comentario::after { border-color: var(--cobalt); }
.timeline .ev-title { font-size: 14px; }
.timeline .ev-when { font-size: 12.5px; color: var(--muted); }
.timeline blockquote { margin: 6px 0 0; padding: 8px 12px; background: var(--paper); border-radius: 8px; font-size: 14px; white-space: pre-wrap; }

/* Tarefas */
.task { display: grid; grid-template-columns: 26px minmax(0,1fr) auto; gap: 10px; padding: 12px 0; border-top: 1px solid var(--line); align-items: start; }
.task:first-child { border-top: 0; }
.task input[type=checkbox] { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--ok); cursor: pointer; }
.task .t-title { font-weight: 600; }
.task.done .t-title { text-decoration: line-through; color: var(--muted); }
.task .t-meta { display: flex; flex-wrap: wrap; gap: 10px; font-size: 13px; color: var(--muted); margin-top: 2px; }
.task .late { color: var(--danger); font-weight: 600; }
.prio { font-size: 12px; font-weight: 600; padding: 1px 7px; border-radius: 10px; }
.prio.alta { background: var(--danger-soft); color: var(--danger); }
.prio.media { background: var(--warn-soft); color: var(--warn); }
.prio.baixa { background: var(--paper); color: var(--muted); }

/* Relatórios */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); margin-bottom: 18px; }
.kpi { padding: 16px 18px; border-right: 1px solid var(--line); }
.kpi:last-child { border-right: 0; }
.kpi .v { font: 600 26px/1.1 var(--serif); }
.kpi .l { color: var(--muted); font-size: 13px; }
.kpi .d { font-size: 13px; font-weight: 600; }
.kpi .d.up { color: var(--ok); }
.kpi .d.down { color: var(--danger); }
.chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart .axis text { fill: var(--muted); font-size: 13px; }
.chart .gridline { stroke: var(--line); }
.demo-flag svg { width: 14px; height: 14px; }
.demo-flag { display: inline-flex; gap: 6px; align-items: center; font-size: 12.5px; font-weight: 600; color: var(--warn); background: var(--warn-soft); padding: 2px 9px; border-radius: 20px; }

/* Integrações */
.integration { display: grid; grid-template-columns: 40px 1fr auto; gap: 14px; padding: 16px 0; border-top: 1px solid var(--line); }
.integration:first-of-type { border-top: 0; }
.integration .ico { width: 40px; height: 40px; border-radius: 10px; background: var(--paper); display: grid; place-items: center; }
.integration .ico svg { width: 22px; height: 22px; }
.integration ul { margin: 6px 0 0; padding-left: 18px; color: var(--ink-2); font-size: 14px; }
.integration code { font-size: 12.5px; background: var(--paper); padding: 1px 5px; border-radius: 4px; }
.pill-off { font-size: 12.5px; font-weight: 600; padding: 3px 10px; border-radius: 20px; background: var(--paper); color: var(--muted); border: 1px solid var(--line); white-space: nowrap; height: fit-content; }

/* ---------- Login ---------- */
.login-wrap { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.login-side { background: var(--ink); color: #dfe4f5; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.login-side h1 { font: 600 40px/1.1 var(--serif); color: #fff; margin: 0 0 16px; max-width: 14ch; }
.login-side p { max-width: 42ch; color: #aeb6d3; font-size: 16px; }
.ribbons { display: grid; gap: 8px; margin-top: 32px; max-width: 360px; }
.ribbons div { background: rgba(255,255,255,.06); border-left: 4px solid var(--c); border-radius: 6px; padding: 9px 12px; font-size: 14px; color: #fff; display: flex; justify-content: space-between; gap: 10px; }
.ribbons span { color: #9aa3c0; font-size: 13px; }
.login-main { display: grid; place-items: center; padding: 32px 20px; }
.login-card { width: 100%; max-width: 380px; }
.login-card h2 { font-size: 26px; margin-bottom: 6px; }
.demo-box { margin-top: 22px; font-size: 13.5px; color: var(--muted); border-top: 1px solid var(--line); padding-top: 16px; }
.demo-box button { border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: 7px 10px; cursor: pointer; text-align: left; width: 100%; margin-top: 6px; display: flex; justify-content: space-between; gap: 8px; }
.demo-box button:hover { border-color: var(--cobalt); }

/* ---------- Modal e toast ---------- */
.modal-backdrop { position: fixed; inset: 0; background: rgba(24,33,61,.45); display: grid; place-items: center; z-index: 100; padding: 16px; }
.modal { background: var(--surface); border-radius: 14px; width: 100%; max-width: 560px; max-height: calc(100vh - 32px); overflow-y: auto; box-shadow: var(--shadow-pop); }
.modal.wide { max-width: 760px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 18px 22px 0; }
.modal-head h2 { margin: 0; }
.modal-body { padding: 16px 22px 22px; }
.toasts { position: fixed; bottom: 20px; right: 20px; display: grid; gap: 8px; z-index: 200; max-width: min(420px, calc(100vw - 40px)); }
.toast { background: var(--ink); color: #fff; padding: 12px 16px; border-radius: 10px; box-shadow: var(--shadow-pop); font-size: 14px; display: flex; gap: 10px; align-items: flex-start; animation: toast-in .2s ease-out; }
.toast.error { background: var(--danger); }
.toast.ok::before { content: "✓"; font-weight: 700; color: #7ee2ae; }
@keyframes toast-in { from { transform: translateY(8px); opacity: 0; } }
.loading { padding: 40px; text-align: center; color: var(--muted); }

.drawer-backdrop { display: none; }

/* ---------- Responsivo ---------- */
@media (max-width: 1100px) {
  .grid-main, .editor, .post-detail { grid-template-columns: 1fr; }
  .preview-col { position: static; }
  .grid-3 { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 280px; z-index: 60; transform: translateX(-100%); transition: transform .2s ease; }
  .app.nav-open .sidebar { transform: none; }
  .app.nav-open .drawer-backdrop { display: block; position: fixed; inset: 0; background: rgba(24,33,61,.4); z-index: 50; }
  .topbar { padding: 0 16px; }
  .topbar .menu-btn { display: grid; }
  .content { padding: 20px 16px; }
  .tally, .kpis { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .tally a:nth-child(2), .kpi:nth-child(2) { border-right: 0; }
  .tally a:nth-child(-n+2), .kpi:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .grid-2, .grid-3, .form-row, .form-row.three { grid-template-columns: 1fr; }
  .login-wrap { grid-template-columns: 1fr; }
  .login-side { padding: 28px 22px; }
  .login-side h1 { font-size: 30px; }
  .ribbons { display: none; }
  .page-head h1 { font-size: 25px; }
  .cal-day { min-height: 84px; padding: 3px; }
  .chip { font-size: 11px; padding: 2px 4px 2px 5px; }
  .chip .t { display: none; }
  .cal-week .cal-grid { grid-template-columns: 1fr; }
  .cal-week .cal-head { display: none; }
  .cal-week .cal-day { min-height: 0; border-right: 0; }
  .cal-week .cal-day .dnum { width: auto; padding: 0 8px; border-radius: 12px; }
  .socials-edit .social-line { grid-template-columns: 1fr 1fr 38px; }
  .socials-edit .social-line input[name=url] { grid-column: 1 / 3; }
  .dl { grid-template-columns: 1fr; gap: 2px; }
  .dl dd { margin-bottom: 8px; }
}
@media (max-width: 520px) {
  .post-row { grid-template-columns: 46px minmax(0,1fr); }
  .post-row > .status { grid-column: 2; justify-self: start; }
  .cal-head div { padding: 6px 3px; text-align: center; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- Campos de data/hora/cor (PT-PT, independentes do browser) ---------- */
.dfield { position: relative; display: flex; gap: 6px; }
.dfield input { flex: 1; min-width: 0; }
.dfield .icon-btn { border: 1px solid var(--line-strong); background: var(--surface); width: 40px; height: 40px; }
.datepop {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 120; width: 288px; background: var(--surface);
  border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-pop); padding: 10px;
}
.dp-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.dp-head b { font-size: 14px; }
.dp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; text-align: center; }
.dp-wd { font-size: 12px; color: var(--muted); font-weight: 600; padding: 4px 0; }
.dp-grid button { border: 0; background: none; height: 34px; border-radius: 8px; cursor: pointer; font-size: 13.5px; font-variant-numeric: tabular-nums; }
.dp-grid button:hover { background: var(--cobalt-soft); }
.dp-grid button.out { color: #a9b0c4; }
.dp-grid button.today { font-weight: 700; color: var(--cobalt); }
.dp-grid button.sel { background: var(--cobalt); color: #fff; }
.dp-foot { display: flex; justify-content: space-between; margin-top: 6px; border-top: 1px solid var(--line); padding-top: 6px; }
.swatches { display: flex; flex-wrap: wrap; gap: 6px; padding-top: 2px; }
.swatch { cursor: pointer; }
.swatch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.swatch span:not(.sr-only) { display: block; width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--surface); box-shadow: 0 0 0 1px var(--line-strong); }
.swatch input:checked + span { box-shadow: 0 0 0 2px var(--ink); }
.swatch input:focus-visible + span { outline: 3px solid color-mix(in srgb, var(--cobalt) 55%, transparent); outline-offset: 2px; }

/* ---------- Equipa ---------- */
.member { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 14px; padding: 16px 0; border-top: 1px solid var(--line); align-items: start; }
.member:first-child { border-top: 0; }
.member.inactive { opacity: .65; }
.member .avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--cobalt-soft); color: var(--cobalt); display: grid; place-items: center; font: 600 17px/1 var(--serif); }
.member-name { font-weight: 600; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.member-clients { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 8px; }
.member-actions { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.role-badge { font-size: 12px; font-weight: 600; padding: 1px 8px; border-radius: 20px; background: var(--paper); color: var(--muted); border: 1px solid var(--line); }
.role-badge.manager { background: var(--ink); color: #fff; border-color: var(--ink); }
.role-badge.collaborator { background: var(--cobalt-soft); color: var(--cobalt); border-color: transparent; }
.role-badge.off { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.checklist { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px 16px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; max-height: 260px; overflow-y: auto; }
.checklist .check-all { grid-column: 1 / -1; padding-bottom: 8px; border-bottom: 1px solid var(--line); font-weight: 600; }
.checklist input[type=checkbox], .check-all input { width: 16px; height: 16px; accent-color: var(--cobalt); }
.perm-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: 14px; }
.perm-list li { padding-left: 24px; position: relative; }
.perm-list li::before { position: absolute; left: 0; top: 0; font-weight: 700; }
.perm-list li.yes::before { content: "✓"; color: var(--ok); }
.perm-list li.no::before { content: "✕"; color: var(--danger); }
.perm-list li.no { color: var(--muted); }
.assignee { display: inline-flex; align-items: center; gap: 5px; }
.assignee i { width: 18px; height: 18px; border-radius: 50%; background: var(--cobalt-soft); color: var(--cobalt); font-style: normal; font-size: 11px; font-weight: 700; display: grid; place-items: center; }
@media (max-width: 860px) {
  .member { grid-template-columns: 40px minmax(0, 1fr); }
  .member-actions { grid-column: 2; justify-content: flex-start; }
}

/* ---------- Clientes inativos ---------- */
.acct.terminado { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.acct.prospeto { background: var(--cobalt-soft); color: var(--cobalt); border-color: transparent; }
.client-card:has(.acct.terminado) { opacity: .7; }
.danger-zone { border-color: #f1c7cd; }
.danger-zone h2 { color: var(--danger); }

/* ---------- Carrossel (editor e pré-visualização) ---------- */
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 10px; }
.media-tile { position: relative; aspect-ratio: 4 / 5; border-radius: 8px; overflow: hidden; background: var(--paper); border: 1px solid var(--line); cursor: grab; }
.media-tile img, .media-tile video { width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.media-tile.drop-target { outline: 3px solid var(--cobalt); outline-offset: 2px; }
.media-pos { position: absolute; top: 6px; left: 6px; background: rgba(24,33,61,.82); color: #fff; font-size: 11.5px; font-weight: 600; padding: 1px 7px; border-radius: 10px; }
.media-kind { position: absolute; top: 6px; right: 6px; background: rgba(0,0,0,.6); color: #fff; font-size: 11px; padding: 1px 6px; border-radius: 10px; }
.media-tools { position: absolute; left: 0; right: 0; bottom: 0; display: flex; justify-content: space-between; padding: 5px; background: linear-gradient(transparent, rgba(0,0,0,.55)); }
.media-tools .tool { width: 28px; height: 28px; border-radius: 7px; border: 0; background: rgba(255,255,255,.92); color: var(--ink); display: grid; place-items: center; cursor: pointer; }
.media-tools .tool svg { width: 15px; height: 15px; }
.media-tools .tool:disabled { opacity: .35; cursor: default; }
.media-tools .tool.danger { color: var(--danger); margin-left: auto; }
.media-tools .tool + .tool { margin-left: 4px; }
.media-add { aspect-ratio: 4 / 5; display: grid; place-items: center; align-content: center; gap: 4px; padding: 8px; font-size: 13px; }
.media-grid:has(.media-tile) .media-add { min-height: 0; }
.media-grid:not(:has(.media-tile)) { grid-template-columns: 1fr; }
.media-grid:not(:has(.media-tile)) .media-add { aspect-ratio: auto; padding: 22px; }
.media-loading { display: grid; place-items: center; text-align: center; font-size: 12.5px; color: var(--muted); padding: 8px; cursor: default; }
.file-list { margin: 0; padding-left: 20px; }

.pv-carousel { display: block; position: relative; overflow: hidden; touch-action: pan-y; user-select: none; }
.pv-track { position: absolute; inset: 0; display: flex; transition: transform .25s ease; }
.pv-slide { flex: 0 0 100%; height: 100%; position: relative; }
.pv-slide img, .pv-slide video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.pv-count { position: absolute; top: 10px; right: 10px; background: rgba(0,0,0,.65); color: #fff; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 12px; }
.pv-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 28px; height: 28px; border-radius: 50%; border: 0; background: rgba(255,255,255,.9); color: #111; display: grid; place-items: center; cursor: pointer; box-shadow: 0 1px 4px rgba(0,0,0,.25); }
.pv-nav svg { width: 16px; height: 16px; }
.pv-nav.prev { left: 8px; }
.pv-nav.next { right: 8px; }
.pv-dots { display: flex; gap: 4px; justify-content: center; padding: 8px 0 0; }
.pv-dots i { width: 6px; height: 6px; border-radius: 50%; background: #c7c7c7; }
.pv-dots i.on { background: #0095f6; }
.pv.ig .pv-actions { position: relative; }
.pv.ig .pv-actions .pv-dots { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); padding: 0; }
.pv.fb .pv-dots i.on { background: #1877f2; }
.pv.li .pv-dots i.on { background: #0a66c2; }
.pv.tt .pv-dots { justify-content: flex-start; padding: 0 0 8px; }
.pv.tt .pv-dots i { background: rgba(255,255,255,.5); }
.pv.tt .pv-dots i.on { background: #fff; }
.pv.tt .pv-media.pv-carousel { position: absolute; inset: 0; }
@media (prefers-reduced-motion: reduce) { .pv-track { transition: none; } }
