/* Painel de gestão — identidade Rui Alexandre */
body { background: #fff; }

/* Entrar */
.login { min-height: 100vh; background: var(--ink); display: grid; place-items: center; padding: 24px; }
.login-card { width: min(100%, 380px); color: #fff; }
.login-logo { height: 46px; width: auto; margin-bottom: 40px; }
.login-card h1 { font-size: 22px; font-weight: 700; margin: 0 0 24px; }
.login-card .field > span { color: rgba(255,255,255,.6); }
.login-card .input { background: #111; border-color: #333; color: #fff; }
.login-card .input:focus { border-color: #fff; }
.login-card .btn { margin-top: 10px; height: 48px; }
.login-err { color: #ff8787; font-size: 13px; margin-top: 14px; }

/* Estrutura */
.shell { display: grid; grid-template-columns: 272px 1fr; min-height: 100vh; }
.demo-strip:not([hidden]) + .login, .demo-strip:not([hidden]) ~ .shell { min-height: calc(100vh - 31px); }
.side { background: var(--ink); color: #fff; display: flex; flex-direction: column; padding: 22px 14px 14px; position: sticky; top: 0; height: 100vh; }
.side-logo { display: block; padding: 4px 10px 26px; }
.side-logo img { height: 34px; width: auto; }
.side-home { text-align: left; border: 0; background: none; color: rgba(255,255,255,.8); padding: 10px 12px; border-radius: 12px; font-weight: 600; font-size: 14px; }
.side-home:hover, .side-home.on { background: #1d1d1d; color: #fff; }
.side-h { display: flex; align-items: center; justify-content: space-between; padding: 20px 6px 8px 12px; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: rgba(255,255,255,.5); font-weight: 600; }
.side-h .icon-btn { color: #fff; width: 32px; height: 32px; background: #1d1d1d; }
.side-h .icon-btn:hover { background: #2c2c2c; }
.side-list { flex: 1; overflow-y: auto; display: grid; align-content: start; gap: 2px; margin: 0 -4px; padding: 0 4px; }
.side-item { display: grid; grid-template-columns: 34px 1fr auto; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 12px; border: 0; background: none; color: #fff; text-align: left; }
.side-item:hover { background: #161616; }
.side-item.on { background: #fff; color: #000; }
.side-item img { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; background: #222; }
.side-item b { display: block; font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-item small { display: block; font-size: 12px; opacity: .55; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-item .n { min-width: 22px; height: 22px; border-radius: 999px; background: #fff; color: #000; font-size: 11.5px; font-weight: 700; display: grid; place-items: center; padding: 0 6px; }
.side-item.on .n { background: #000; color: #fff; }
.side-empty { color: rgba(255,255,255,.5); font-size: 13px; padding: 8px 12px; line-height: 1.5; }
.side-out { display: flex; align-items: center; gap: 10px; border: 0; background: none; color: rgba(255,255,255,.6); padding: 10px 12px; border-radius: 12px; font-size: 13px; font-weight: 500; margin-top: 8px; }
.side-out:hover { color: #fff; background: #161616; }

.main { min-width: 0; }
.top { height: 68px; display: flex; align-items: center; gap: 10px; padding: 0 28px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: rgba(255,255,255,.92); backdrop-filter: blur(10px); z-index: 20; }
.top-title { flex: 1; font-weight: 700; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.menu-btn { display: none; }
.bell { position: relative; }
.bell-n { position: absolute; top: 3px; right: 2px; min-width: 18px; height: 18px; border-radius: 999px; background: var(--warn); color: #fff; font-size: 10.5px; font-weight: 700; display: grid; place-items: center; padding: 0 5px; border: 2px solid #fff; }
.view { padding: 32px 28px 80px; max-width: 1180px; }

/* Visão geral */
.hello { font-size: clamp(28px, 4vw, 40px); font-weight: 800; letter-spacing: -.03em; margin: 0 0 6px; line-height: 1.1; }
.sub { color: var(--muted); margin: 0 0 28px; font-size: 15px; }
.kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 36px; }
.kpi { border: 1.5px solid var(--line); border-radius: 18px; padding: 18px 20px; }
.kpi b { display: block; font-size: 36px; font-weight: 800; letter-spacing: -.03em; line-height: 1.1; }
.kpi span { font-size: 13px; color: var(--muted); font-weight: 500; display: flex; align-items: center; gap: 6px; }
.kpi span i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.kpi.dark { background: var(--ink); color: #fff; border-color: var(--ink); }
.kpi.dark span { color: rgba(255,255,255,.65); }
.sec-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 14px; }
.sec-h h2 { font-size: 13px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin: 0; font-weight: 600; }
.empty { border: 1.5px dashed var(--line); border-radius: 18px; padding: 40px 24px; text-align: center; color: var(--muted); }
.empty b { display: block; color: var(--ink); font-size: 18px; margin-bottom: 6px; }
.empty .btn { margin-top: 16px; }

/* Atividade / notificações */
.act { display: grid; grid-template-columns: 44px 1fr 52px; gap: 14px; align-items: center; padding: 12px; border-radius: 14px; border: 0; background: none; text-align: left; width: 100%; }
.act:hover { background: var(--soft); }
.act .av { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; position: relative; }
.act .avw { position: relative; }
.act .avw .ic { position: absolute; right: -3px; bottom: -3px; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; color: #fff; border: 2px solid #fff; }
.act .ic.approved { background: var(--ok); } .act .ic.changes { background: var(--warn); }
.act p { margin: 0; font-size: 14px; line-height: 1.4; }
.act p b { font-weight: 600; }
.act q { display: block; font-style: normal; color: var(--ink-3); font-size: 13px; margin-top: 4px; background: var(--warn-soft); padding: 6px 10px; border-radius: 10px; }
.act time { font-size: 12px; color: var(--muted); display: block; margin-top: 3px; }
.act .th { width: 52px; aspect-ratio: 3/4; border-radius: 8px; overflow: hidden; background: #eee; }
.act .th img, .act .th video { width: 100%; height: 100%; object-fit: cover; }
.act.unread { background: #fafafa; }
.act.unread p::before { content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--warn); margin-right: 8px; vertical-align: 1px; }

/* Cliente */
.ch { display: grid; grid-template-columns: auto 1fr auto; gap: 22px; align-items: center; margin-bottom: 24px; }
.ch img.av { width: 84px; height: 84px; border-radius: 50%; object-fit: cover; background: #eee; }
.ch h1 { margin: 0; font-size: clamp(24px, 3vw, 32px); font-weight: 800; letter-spacing: -.02em; line-height: 1.15; }
.ch .u { color: var(--muted); font-size: 14px; margin-top: 2px; }
.ch-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.linkbox { display: flex; align-items: center; gap: 8px; border: 1.5px solid var(--ink); border-radius: 16px; padding: 8px 8px 8px 16px; margin-bottom: 28px; }
.linkbox .lbl { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 600; white-space: nowrap; }
.linkbox code { flex: 1; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.chip { height: 36px; padding: 0 14px; border-radius: 999px; border: 1.5px solid var(--line); background: #fff; font-size: 13px; font-weight: 600; display: inline-flex; align-items: center; gap: 8px; }
.chip em { font-style: normal; opacity: .55; }
.chip.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.chip.on em { opacity: .7; }

.posts { display: grid; grid-template-columns: repeat(auto-fill, minmax(196px, 1fr)); gap: 18px; }
.pc { border: 0; background: none; padding: 0; text-align: left; display: grid; gap: 10px; align-content: start; }
.pc .th { position: relative; aspect-ratio: 3/4; border-radius: 14px; overflow: hidden; background: #eee; transition: transform .15s; }
.pc:hover .th { transform: translateY(-2px); }
.pc .th img, .pc .th video { width: 100%; height: 100%; object-fit: cover; }
.pc .tt { position: absolute; top: 10px; left: 10px; height: 24px; padding: 0 9px; border-radius: 999px; background: rgba(0,0,0,.72); color: #fff; font-size: 11.5px; font-weight: 600; display: inline-flex; align-items: center; gap: 5px; }
.pc .pill { position: absolute; bottom: 10px; left: 10px; box-shadow: 0 1px 6px rgba(0,0,0,.15); }
.pc .pill.pending { background: #fff; color: #000; }
.pc .pill.approved { background: var(--ok); color: #fff; }
.pc .pill.changes { background: var(--warn); color: #fff; }
.pc .meta b { font-size: 13.5px; font-weight: 600; display: block; }
.pc .meta span { font-size: 12.5px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.4; margin-top: 2px; }
.pc .meta q { display: block; font-style: normal; font-size: 12.5px; background: var(--warn-soft); color: #8a3405; padding: 8px 10px; border-radius: 10px; margin-top: 6px; line-height: 1.4; }
.pc.past { opacity: .62; }
.pc.add .th { display: grid; place-items: center; border: 1.5px dashed #cfcfcf; background: #fafafa; color: var(--ink); }
.pc.add .th span { display: grid; justify-items: center; gap: 8px; font-weight: 600; font-size: 14px; }

/* Folhas modais */
.sheet-wrap { position: fixed; inset: 0; z-index: 200; background: rgba(0,0,0,.55); display: grid; place-items: center; padding: 20px; animation: fade .18s ease; }
@keyframes fade { from { opacity: 0; } }
.sheet { background: #fff; border-radius: 22px; width: min(100%, 640px); max-height: calc(100vh - 40px); display: flex; flex-direction: column; box-shadow: var(--shadow); }
.sheet.wide { width: min(100%, 860px); }
.sheet-h { display: flex; align-items: center; justify-content: space-between; padding: 18px 18px 14px 24px; border-bottom: 1px solid var(--line); }
.sheet-h h2 { margin: 0; font-size: 18px; font-weight: 700; }
.sheet-b { padding: 22px 24px; overflow-y: auto; }
.sheet-f { display: flex; gap: 8px; align-items: center; padding: 14px 18px 14px 24px; border-top: 1px solid var(--line); }
.sheet-f .sp { flex: 1; }

.seg { display: inline-grid; grid-auto-flow: column; background: var(--soft); border-radius: 999px; padding: 4px; gap: 2px; margin-bottom: 18px; }
.seg button { border: 0; background: none; height: 36px; padding: 0 18px; border-radius: 999px; font-weight: 600; font-size: 13.5px; color: var(--muted); }
.seg button.on { background: var(--ink); color: #fff; }

.drop { border: 1.5px dashed #cfcfcf; border-radius: 16px; padding: 22px; text-align: center; cursor: pointer; transition: border-color .15s, background .15s; display: grid; justify-items: center; gap: 6px; color: var(--muted); font-size: 13px; }
.drop b { color: var(--ink); font-size: 14px; }
.drop:hover, .drop.over { border-color: var(--ink); background: #fafafa; }
.mlist { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.mitem { position: relative; width: 96px; aspect-ratio: 3/4; border-radius: 12px; overflow: hidden; background: #eee; }
.mitem img, .mitem video { width: 100%; height: 100%; object-fit: cover; }
.mitem .no { position: absolute; top: 6px; left: 6px; width: 22px; height: 22px; border-radius: 50%; background: #000; color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; }
.mitem .ctl { position: absolute; left: 0; right: 0; bottom: 0; display: flex; justify-content: space-between; padding: 4px; background: linear-gradient(transparent, rgba(0,0,0,.6)); }
.mitem .ctl button { width: 26px; height: 26px; border-radius: 50%; border: 0; background: rgba(255,255,255,.92); display: grid; place-items: center; padding: 0; color: #000; }
.mitem.loading { display: grid; place-items: center; }
.cover-row { display: flex; align-items: center; gap: 12px; margin-top: 12px; font-size: 13px; color: var(--muted); }
.cover-row .mitem { width: 64px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.count { font-size: 12px; color: var(--muted); text-align: right; margin-top: -8px; margin-bottom: 10px; }
.check { display: flex; align-items: center; gap: 10px; font-size: 14px; margin: 4px 0 14px; }
.check input { width: 18px; height: 18px; accent-color: #000; }
.hist { border-top: 1px solid var(--line); margin-top: 8px; padding-top: 16px; }
.hist h3 { font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin: 0 0 10px; }
.hist li { list-style: none; font-size: 13.5px; padding: 8px 0; border-bottom: 1px solid #f2f2f2; display: grid; gap: 4px; }
.hist ul { margin: 0; padding: 0; }
.hist time { color: var(--muted); font-size: 12px; }
.av-edit { display: flex; align-items: center; gap: 16px; margin-bottom: 18px; }
.av-edit img { width: 80px; height: 80px; border-radius: 50%; object-fit: cover; background: #eee; }

/* Gaveta de notificações */
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(100vw, 420px); background: #fff; z-index: 150; box-shadow: var(--shadow); transform: translateX(105%); transition: transform .25s ease; display: flex; flex-direction: column; }
.drawer.open { transform: none; }
.drawer-h { display: flex; align-items: center; justify-content: space-between; padding: 18px 16px 8px 22px; }
.drawer-h h2 { margin: 0; font-size: 20px; font-weight: 800; }
.drawer-tools { padding: 0 22px 10px; }
.notif-list { flex: 1; overflow-y: auto; padding: 0 10px 20px; }
.side-scrim { display: none; }

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; left: 0; top: 0; bottom: 0; width: 280px; z-index: 160; transform: translateX(-105%); transition: transform .25s ease; height: 100%; }
  .side.open { transform: none; }
  .side-scrim.open { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 155; }
  .menu-btn { display: inline-grid; }
  .top { padding: 0 12px; height: 60px; }
  .view { padding: 22px 16px 80px; }
  .kpis { grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
  .kpi { padding: 14px; border-radius: 14px; }
  .kpi b { font-size: 26px; }
  .kpi span { font-size: 11.5px; }
  .ch { grid-template-columns: auto 1fr; gap: 14px; }
  .ch img.av { width: 64px; height: 64px; }
  .ch-actions { grid-column: 1 / -1; justify-content: stretch; }
  .ch-actions .btn { flex: 1; }
  .linkbox { flex-wrap: wrap; padding: 12px; }
  .linkbox code { flex-basis: 100%; order: 1; }
  .linkbox .lbl { order: 0; }
  .linkbox .btn { order: 2; flex: 1; }
  .posts { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .sheet-wrap { padding: 0; place-items: end stretch; }
  .sheet, .sheet.wide { width: 100%; max-height: 94vh; border-radius: 22px 22px 0 0; }
  .grid2 { grid-template-columns: 1fr; gap: 0; }
  .sheet-f { padding-bottom: calc(14px + env(safe-area-inset-bottom)); }
}
